Enable tone-mapping and HLS remuxing for DoVi Profile 10 in AV1 (#12604)

This commit is contained in:
Nyanmisaka 2024-09-08 01:19:26 +08:00 committed by GitHub
parent d0567fc8c6
commit 5d4f71eb9a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 9 deletions

View File

@ -1797,10 +1797,11 @@ public class DynamicHlsController : BaseJellyfinApiController
var args = "-codec:v:0 " + codec; var args = "-codec:v:0 " + codec;
if (string.Equals(state.ActualOutputVideoCodec, "h265", StringComparison.OrdinalIgnoreCase) var isActualOutputVideoCodecAv1 = string.Equals(state.ActualOutputVideoCodec, "av1", StringComparison.OrdinalIgnoreCase);
|| string.Equals(state.ActualOutputVideoCodec, "hevc", StringComparison.OrdinalIgnoreCase) var isActualOutputVideoCodecHevc = string.Equals(state.ActualOutputVideoCodec, "h265", StringComparison.OrdinalIgnoreCase)
|| string.Equals(codec, "h265", StringComparison.OrdinalIgnoreCase) || string.Equals(state.ActualOutputVideoCodec, "hevc", StringComparison.OrdinalIgnoreCase);
|| string.Equals(codec, "hevc", StringComparison.OrdinalIgnoreCase))
if (isActualOutputVideoCodecHevc || isActualOutputVideoCodecAv1)
{ {
var requestedRange = state.GetRequestedRangeTypes(state.ActualOutputVideoCodec); var requestedRange = state.GetRequestedRangeTypes(state.ActualOutputVideoCodec);
var requestHasDOVI = requestedRange.Contains(VideoRangeType.DOVI.ToString(), StringComparison.OrdinalIgnoreCase); var requestHasDOVI = requestedRange.Contains(VideoRangeType.DOVI.ToString(), StringComparison.OrdinalIgnoreCase);
@ -1814,10 +1815,17 @@ public class DynamicHlsController : BaseJellyfinApiController
|| (state.VideoStream.VideoRangeType == VideoRangeType.DOVIWithHLG && requestHasDOVIWithHLG) || (state.VideoStream.VideoRangeType == VideoRangeType.DOVIWithHLG && requestHasDOVIWithHLG)
|| (state.VideoStream.VideoRangeType == VideoRangeType.DOVIWithSDR && requestHasDOVIWithSDR))) || (state.VideoStream.VideoRangeType == VideoRangeType.DOVIWithSDR && requestHasDOVIWithSDR)))
{ {
// Prefer dvh1 to dvhe if (isActualOutputVideoCodecHevc)
args += " -tag:v:0 dvh1 -strict -2"; {
// Prefer dvh1 to dvhe
args += " -tag:v:0 dvh1 -strict -2";
}
else if (isActualOutputVideoCodecAv1)
{
args += " -tag:v:0 dav1 -strict -2";
}
} }
else else if (isActualOutputVideoCodecHevc)
{ {
// Prefer hvc1 to hev1 // Prefer hvc1 to hev1
args += " -tag:v:0 hvc1"; args += " -tag:v:0 hvc1";

View File

@ -315,8 +315,7 @@ namespace MediaBrowser.Controller.MediaEncoding
return false; return false;
} }
if (string.Equals(state.VideoStream.Codec, "hevc", StringComparison.OrdinalIgnoreCase) if (state.VideoStream.VideoRange == VideoRange.HDR
&& state.VideoStream.VideoRange == VideoRange.HDR
&& state.VideoStream.VideoRangeType == VideoRangeType.DOVI) && state.VideoStream.VideoRangeType == VideoRangeType.DOVI)
{ {
// Only native SW decoder and HW accelerator can parse dovi rpu. // Only native SW decoder and HW accelerator can parse dovi rpu.