Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HEVC Direct Play override for Profile Version #774

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions locale/en_US/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,5 +692,25 @@
<source>Play Trailer</source>
<translation>Play Trailer</translation>
</message>
<message>
<source>Attempt H.264 Direct Play (Profile Lvl)</source>
<translation>Attempt H.264 Direct Play (Profile Lvl)</translation>
<extracomment>Settings Menu - Title for option</extracomment>
</message>
<message>
<source>Attempt Direct Play for H.264 media with unsupported profile levels (> 4.2) before falling back to transcoding if it fails.</source>
neilsb marked this conversation as resolved.
Show resolved Hide resolved
<translation>Attempt Direct Play for H.264 media with unsupported profile levels (> 4.2) before falling back to transcoding if it fails.</translation>
<extracomment>Settings Menu - Description for option</extracomment>
</message>
<message>
<source>Attempt HECV Direct Play (Profile Lvl)</source>
neilsb marked this conversation as resolved.
Show resolved Hide resolved
<translation>Attempt HECV Direct Play (Profile Lvl)</translation>
<extracomment>Settings Menu - Title for option</extracomment>
</message>
<message>
<source>Attempt Direct Play for HEVC media with unsupported profile levels (> 5.1) before falling back to trancoding if it fails.</source>
<translation>Attempt Direct Play for HEVC media with unsupported profile levels (> 5.1) before falling back to trancoding if it fails.</translation>
<extracomment>Settings Menu - Description for option</extracomment>
</message>
</context>
</TS>
9 changes: 8 additions & 1 deletion settings/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@
"default": "false"
},
{
"title": "Attempt Direct Play (Profile Lvl)",
"title": "Attempt H.264 Direct Play (Profile Lvl)",
neilsb marked this conversation as resolved.
Show resolved Hide resolved
"description": "Attempt Direct Play for H.264 media with unsupported profile levels (> 4.2) before falling back to transcoding if it fails.",
"settingName": "playback.tryDirect.h264ProfileLevel",
"type": "bool",
"default": "true"
},
{
"title": "Attempt hevc Direct Play (Profile Lvl)",
neilsb marked this conversation as resolved.
Show resolved Hide resolved
"description": "Attempt Direct Play for hevc media with unsupported profile levels (> 5.1) before falling back to trancoding if it fails.",
neilsb marked this conversation as resolved.
Show resolved Hide resolved
"settingName": "playback.tryDirect.hevcProfileLevel",
"type": "bool",
"default": "true"
},
{
"title": "Cinema Mode",
"description": "Cinema Mode brings the theater experience straight to your living room with the ability to play custom intros before the main feature.",
Expand Down
8 changes: 5 additions & 3 deletions source/VideoPlayer.brs
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,14 @@ sub AddVideoContent(video, mediaSourceId, audio_stream_idx = 1, subtitle_idx = -
fully_external = false


' For h264 video, Roku spec states that it supports and Encoding level 4.1 and 4.2.
' For h264/hevc video, Roku spec states that it supports specfic encoding levels
' The device can decode content with a Higher Encoding level but may play it back with certain
' artifacts. If the user preference is set, and the only reason the server says we need to
' transcode is that the Envoding Level is not supported, then try to direct play but silently
' transcode is that the Encoding Level is not supported, then try to direct play but silently
' fall back to the transcode if that fails.
if meta.live = false and get_user_setting("playback.tryDirect.h264ProfileLevel") = "true" and playbackInfo.MediaSources[0].TranscodingUrl <> invalid and forceTranscoding = false and playbackInfo.MediaSources[0].MediaStreams[0].codec = "h264"
tryDirectPlay = get_user_setting("playback.tryDirect.h264ProfileLevel") = "true" and playbackInfo.MediaSources[0].MediaStreams[0].codec = "h264"
tryDirectPlay = tryDirectPlay or (get_user_setting("playback.tryDirect.hevcProfileLevel") = "true" and playbackInfo.MediaSources[0].MediaStreams[0].codec = "hevc")
if meta.live = false and tryDirectPlay and playbackInfo.MediaSources[0].TranscodingUrl <> invalid and forceTranscoding = false
transcodingReasons = getTranscodeReasons(playbackInfo.MediaSources[0].TranscodingUrl)
if transcodingReasons.Count() = 1 and transcodingReasons[0] = "VideoLevelNotSupported"
video.directPlaySupported = true
Expand Down