Support MPEG2 codec when available
Support playing video using the MPEG-2 codec when supported by the device. Enabled by option since MPEG-2 requires high bandwidth and some users report issues with MPEG-2 decoding on some Roku models.
This commit is contained in:
parent
ee8301f8ab
commit
a7c6737e1f
|
@ -380,6 +380,16 @@ sub Main (args as dynamic) as void
|
||||||
SignOut()
|
SignOut()
|
||||||
wipe_groups()
|
wipe_groups()
|
||||||
goto app_start
|
goto app_start
|
||||||
|
else if button.id = "play_mpeg2"
|
||||||
|
playMpeg2 = get_setting("playback.mpeg2")
|
||||||
|
if playMpeg2 = "true"
|
||||||
|
playMpeg2 = "false"
|
||||||
|
button.title = tr("MPEG2 Support: Off")
|
||||||
|
else
|
||||||
|
playMpeg2 = "true"
|
||||||
|
button.title = tr("MPEG2 Support: On")
|
||||||
|
end if
|
||||||
|
set_setting("playback.mpeg2", playMpeg2)
|
||||||
end if
|
end if
|
||||||
else if isNodeEvent(msg, "selectSubtitlePressed")
|
else if isNodeEvent(msg, "selectSubtitlePressed")
|
||||||
node = m.scene.focusedChild
|
node = m.scene.focusedChild
|
||||||
|
|
|
@ -194,6 +194,22 @@ function CreateHomeGroup()
|
||||||
new_options.push(o)
|
new_options.push(o)
|
||||||
end for
|
end for
|
||||||
|
|
||||||
|
' Add option for mpeg-2 playback
|
||||||
|
playMpeg2 = get_setting("playback.mpeg2")
|
||||||
|
if playMpeg2 = invalid
|
||||||
|
playMpeg2 = "true"
|
||||||
|
set_setting("playback.mpeg2", playMpeg2)
|
||||||
|
end if
|
||||||
|
o = CreateObject("roSGNode", "OptionsButton")
|
||||||
|
if playMpeg2 = "true"
|
||||||
|
o.title = tr("MPEG2 Support: On")
|
||||||
|
else
|
||||||
|
o.title = tr("MPEG2 Support: Off")
|
||||||
|
end if
|
||||||
|
o.id = "play_mpeg2"
|
||||||
|
o.observeField("optionSelected", m.port)
|
||||||
|
new_options.push(o)
|
||||||
|
|
||||||
' And a profile button
|
' And a profile button
|
||||||
user_node = CreateObject("roSGNode", "OptionsData")
|
user_node = CreateObject("roSGNode", "OptionsData")
|
||||||
user_node.id = "active_user"
|
user_node.id = "active_user"
|
||||||
|
|
|
@ -17,6 +17,7 @@ end function
|
||||||
|
|
||||||
|
|
||||||
function getDeviceProfile() as object
|
function getDeviceProfile() as object
|
||||||
|
playMpeg2 = get_setting("playback.mpeg2") = "true"
|
||||||
|
|
||||||
'Check if 5.1 Audio Output connected
|
'Check if 5.1 Audio Output connected
|
||||||
maxAudioChannels = 2
|
maxAudioChannels = 2
|
||||||
|
@ -25,6 +26,19 @@ function getDeviceProfile() as object
|
||||||
maxAudioChannels = 6
|
maxAudioChannels = 6
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
if playMpeg2 and di.CanDecodeVideo({ Codec: "mpeg2" }).Result = true
|
||||||
|
tsVideoCodecs = "h264,mpeg2video"
|
||||||
|
else
|
||||||
|
tsVideoCodecs = "h264"
|
||||||
|
end if
|
||||||
|
|
||||||
|
if di.CanDecodeAudio({ Codec: "ac3" }).result
|
||||||
|
tsAudioCodecs = "aac,ac3"
|
||||||
|
else
|
||||||
|
tsAudioCodecs = "aac"
|
||||||
|
end if
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"MaxStreamingBitrate": 120000000,
|
"MaxStreamingBitrate": 120000000,
|
||||||
"MaxStaticBitrate": 100000000,
|
"MaxStaticBitrate": 100000000,
|
||||||
|
@ -66,8 +80,8 @@ function getDeviceProfile() as object
|
||||||
{
|
{
|
||||||
"Container": "ts",
|
"Container": "ts",
|
||||||
"Type": "Video",
|
"Type": "Video",
|
||||||
"AudioCodec": "aac",
|
"AudioCodec": tsAudioCodecs,
|
||||||
"VideoCodec": "h264",
|
"VideoCodec": tsVideoCodecs,
|
||||||
"Context": "Streaming",
|
"Context": "Streaming",
|
||||||
"Protocol": "hls",
|
"Protocol": "hls",
|
||||||
"MaxAudioChannels": StrI(maxAudioChannels) ' Currently Jellyfin server expects this as a string
|
"MaxAudioChannels": StrI(maxAudioChannels) ' Currently Jellyfin server expects this as a string
|
||||||
|
@ -142,6 +156,8 @@ function GetDirectPlayProfiles() as object
|
||||||
mkvAudio = "mp3,pcm,lpcm,wav"
|
mkvAudio = "mp3,pcm,lpcm,wav"
|
||||||
audio = "mp3,pcm,lpcm,wav"
|
audio = "mp3,pcm,lpcm,wav"
|
||||||
|
|
||||||
|
playMpeg2 = get_setting("playback.mpeg2") = "true"
|
||||||
|
|
||||||
di = CreateObject("roDeviceInfo")
|
di = CreateObject("roDeviceInfo")
|
||||||
|
|
||||||
'Check for Supported Video Codecs
|
'Check for Supported Video Codecs
|
||||||
|
@ -154,6 +170,11 @@ function GetDirectPlayProfiles() as object
|
||||||
mkvVideo = mkvVideo + ",vp9"
|
mkvVideo = mkvVideo + ",vp9"
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
if playMpeg2 and di.CanDecodeVideo({ Codec: "mpeg2" }).Result = true
|
||||||
|
mp4Video = mp4Video + ",mpeg2video"
|
||||||
|
mkvVideo = mkvVideo + ",mpeg2video"
|
||||||
|
end if
|
||||||
|
|
||||||
' Check for supported Audio
|
' Check for supported Audio
|
||||||
if di.CanDecodeAudio({ Codec: "ac3" }).result
|
if di.CanDecodeAudio({ Codec: "ac3" }).result
|
||||||
mkvAudio = mkvAudio + ",ac3"
|
mkvAudio = mkvAudio + ",ac3"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user