Merge pull request #686 from whiteowl3/patch-2

Support for HDR, VP9, AV1
This commit is contained in:
1hitsong 2022-12-06 08:11:37 -05:00 committed by GitHub
commit a762e714ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 119 additions and 25 deletions

View File

@ -489,6 +489,16 @@
<translation>Support Direct Play of MPEG-2 content (e.g., Live TV). This will prevent transcoding of MPEG-2 content, but uses significantly more bandwidth.</translation>
<extracomment>Settings Menu - Description for option</extracomment>
</message>
<message>
<source>AV1 Support</source>
<translation>AV1 Support</translation>
<extracomment>Settings Menu - Title for option</extracomment>
</message>
<message>
<source>** EXPERIMENTAL** Support Direct Play of AV1 content if this Roku device supports it.</source>
<translation>** EXPERIMENTAL** Support Direct Play of AV1 content if this Roku device supports it.</translation>
<extracomment>Settings Menu - Description for option</extracomment>
</message>
<message>
<source>Enabled</source>
<translation>Enabled</translation>

View File

@ -3,6 +3,13 @@
"title": "Playback",
"description": "Settings relating to playback and supported codec and media types.",
"children": [
{
"title": "AV1 Support",
"description": "** EXPERIMENTAL** Support Direct Play of AV1 content if this Roku device supports it.",
"settingName": "playback.av1",
"type": "bool",
"default": "false"
},
{
"title": "MPEG-2 Support",
"description": "Support Direct Play of MPEG-2 content (e.g., Live TV). This will prevent transcoding of MPEG-2 content, but uses significantly more bandwidth.",

View File

@ -18,6 +18,7 @@ end function
function getDeviceProfile() as object
playMpeg2 = get_user_setting("playback.mpeg2") = "true"
playAv1 = get_user_setting("playback.av1") = "true"
'Check if 5.1 Audio Output connected
maxAudioChannels = 2
@ -26,14 +27,19 @@ function getDeviceProfile() as object
maxAudioChannels = 6
end if
if playMpeg2 and di.CanDecodeVideo({ Codec: "mpeg2" }).Result = true
tsVideoCodecs = "h264,mpeg2video"
else
tsVideoCodecs = "h264"
addHevcProfile = false
MAIN10 = ""
tsVideoCodecs = "h264"
if di.CanDecodeVideo({ Codec: "hevc" }).Result = true
tsVideoCodecs = "h265,hevc," + tsVideoCodecs
addHevcProfile = true
if di.CanDecodeVideo({ Codec: "hevc", Profile: "main 10" }).Result
MAIN10 = "|main 10"
end if
end if
if di.CanDecodeVideo({ Codec: "hevc" }).Result = true
tsVideoCodecs = tsVideoCodecs + ",h265,hevc"
if playMpeg2 and di.CanDecodeVideo({ Codec: "mpeg2" }).Result = true
tsVideoCodecs = tsVideoCodecs + ",mpeg2video"
end if
if di.CanDecodeAudio({ Codec: "ac3" }).result
@ -42,9 +48,42 @@ function getDeviceProfile() as object
tsAudioCodecs = "aac"
end if
addAv1Profile = false
if playAv1 and di.CanDecodeVideo({ Codec: "av1" }).result
tsVideoCodecs = tsVideoCodecs + ",av1"
addAv1Profile = true
end if
addVp9Profile = false
if di.CanDecodeVideo({ Codec: "vp9" }).result
tsVideoCodecs = tsVideoCodecs + ",vp9"
addVp9Profile = true
end if
hevcVideoRangeTypes = "SDR"
vp9VideoRangeTypes = "SDR"
av1VideoRangeTypes = "SDR"
dp = di.GetDisplayProperties()
if dp.Hdr10 ' or dp.Hdr10Plus?
hevcVideoRangeTypes = hevcVideoRangeTypes + "|HDR10"
vp9VideoRangeTypes = vp9VideoRangeTypes + "|HDR10"
av1VideoRangeTypes = av1VideoRangeTypes + "|HDR10"
end if
if dp.HLG
hevcVideoRangeTypes = hevcVideoRangeTypes + "|HLG"
vp9VideoRangeTypes = vp9VideoRangeTypes + "|HLG"
av1VideoRangeTypes = av1VideoRangeTypes + "|HLG"
end if
if dp.DolbyVision
hevcVideoRangeTypes = hevcVideoRangeTypes + "|DOVI"
'vp9VideoRangeTypes = vp9VideoRangeTypes + ",DOVI" no evidence that vp9 can hold DOVI
av1VideoRangeTypes = av1VideoRangeTypes + "|DOVI"
end if
DirectPlayProfile = GetDirectPlayProfiles()
return {
deviceProfile = {
"MaxStreamingBitrate": 120000000,
"MaxStaticBitrate": 100000000,
"MusicStreamingTranscodingBitrate": 192000,
@ -133,24 +172,6 @@ function getDeviceProfile() as object
"IsRequired": false
}
]
},
{
"Type": "Video",
"Codec": "hevc",
"Conditions": [
{
"Condition": "EqualsAny",
"Property": "VideoProfile",
"Value": "main",
"IsRequired": false
},
{
"Condition": "LessThanEqual",
"Property": "VideoLevel",
"Value": StrI(120 * 5.1),
"IsRequired": false
}
]
}
],
"SubtitleProfiles": [
@ -172,6 +193,62 @@ function getDeviceProfile() as object
}
]
}
if addAv1Profile
deviceProfile.CodecProfiles.push({
"Type": "Video",
"Codec": "av1",
"Conditions": [
{
"Condition": "EqualsAny",
"Property": "VideoRangeType",
"Value": av1VideoRangeTypes,
"IsRequired": false
}
]
})
end if
if addHevcProfile
deviceProfile.CodecProfiles.push({
"Type": "Video",
"Codec": "hevc",
"Conditions": [
{
"Condition": "EqualsAny",
"Property": "VideoProfile",
"Value": "main" + MAIN10,
"IsRequired": false
},
{
"Condition": "EqualsAny",
"Property": "VideoRangeType",
"Value": hevcVideoRangeTypes,
"IsRequired": false
},
{
"Condition": "LessThanEqual",
"Property": "VideoLevel",
"Value": (120 * 5.1).ToStr(),
"IsRequired": false
}
]
})
end if
if addVp9Profile
deviceProfile.CodecProfiles.push({
"Type": "Video",
"Codec": "vp9",
"Conditions": [
{
"Condition": "EqualsAny",
"Property": "VideoRangeType",
"Value": vp9VideoRangeTypes,
"IsRequired": false
}
]
})
end if
return deviceProfile
end function