Merge pull request #10968 from nyanmisaka/correct-hlg

Correct VIDEO-RANGE field for HLG content
This commit is contained in:
Bond-009 2024-02-06 20:13:55 +01:00 committed by GitHub
commit 470a32c8f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -325,6 +325,7 @@ public class DynamicHlsHelper
if (state.VideoStream is not null && state.VideoStream.VideoRange != VideoRange.Unknown) if (state.VideoStream is not null && state.VideoStream.VideoRange != VideoRange.Unknown)
{ {
var videoRange = state.VideoStream.VideoRange; var videoRange = state.VideoStream.VideoRange;
var videoRangeType = state.VideoStream.VideoRangeType;
if (EncodingHelper.IsCopyCodec(state.OutputVideoCodec)) if (EncodingHelper.IsCopyCodec(state.OutputVideoCodec))
{ {
if (videoRange == VideoRange.SDR) if (videoRange == VideoRange.SDR)
@ -333,10 +334,17 @@ public class DynamicHlsHelper
} }
if (videoRange == VideoRange.HDR) if (videoRange == VideoRange.HDR)
{
if (videoRangeType == VideoRangeType.HLG)
{
builder.Append(",VIDEO-RANGE=HLG");
}
else
{ {
builder.Append(",VIDEO-RANGE=PQ"); builder.Append(",VIDEO-RANGE=PQ");
} }
} }
}
else else
{ {
// Currently we only encode to SDR. // Currently we only encode to SDR.