diff --git a/locale/en_US/translations.ts b/locale/en_US/translations.ts index 0f8cbbc23..0c759ec40 100644 --- a/locale/en_US/translations.ts +++ b/locale/en_US/translations.ts @@ -712,6 +712,25 @@ Play Trailer + Direct Play H.264 Unsupported Profile Levels + Direct Play H.264 Unsupported Profile Levels + Settings Menu - Title for option + + + Attempt Direct Play for H.264 media with unsupported profile levels before falling back to transcoding if it fails. + Attempt Direct Play for H.264 media with unsupported profile levels before falling back to transcoding if it fails. + Settings Menu - Description for option + + + Direct Play HEVC Unsupported Profile Levels + Direct Play HEVC Unsupported Profile Levels + Settings Menu - Title for option + + + Attempt Direct Play for HEVC media with unsupported profile levels before falling back to trancoding if it fails. + Attempt Direct Play for HEVC media with unsupported profile levels before falling back to trancoding if it fails. + Settings Menu - Description for option + Settings relating to playback and supported codec and media types. Settings relating to playback and supported codec and media types. diff --git a/settings/settings.json b/settings/settings.json index 83d63934a..1f07e8f77 100644 --- a/settings/settings.json +++ b/settings/settings.json @@ -18,12 +18,19 @@ "default": "true" }, { - "title": "Attempt Direct Play (Profile Lvl)", - "description": "Attempt Direct Play for H.264 media with unsupported profile levels (> 4.2) before falling back to transcoding if it fails.", + "title": "Direct Play H.264 Unsupported Profile Levels", + "description": "Attempt Direct Play for H.264 media with unsupported profile levels before falling back to transcoding if it fails.", "settingName": "playback.tryDirect.h264ProfileLevel", "type": "bool", "default": "true" }, + { + "title": "Direct Play HEVC Unsupported Profile Levels", + "description": "Attempt Direct Play for HEVC media with unsupported profile levels before falling back to trancoding if it fails.", + "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.", diff --git a/source/VideoPlayer.brs b/source/VideoPlayer.brs index 158b5484c..2e083597f 100644 --- a/source/VideoPlayer.brs +++ b/source/VideoPlayer.brs @@ -218,16 +218,20 @@ 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 m.playbackInfo.MediaSources[0].TranscodingUrl <> invalid and forceTranscoding = false and m.playbackInfo.MediaSources[0].MediaStreams[0].codec = "h264" - transcodingReasons = getTranscodeReasons(m.playbackInfo.MediaSources[0].TranscodingUrl) - if transcodingReasons.Count() = 1 and transcodingReasons[0] = "VideoLevelNotSupported" - video.directPlaySupported = true - video.transcodeAvailable = true + if m.playbackInfo.MediaSources[0].MediaStreams.Count() > 0 and meta.live = false + tryDirectPlay = get_user_setting("playback.tryDirect.h264ProfileLevel") = "true" and m.playbackInfo.MediaSources[0].MediaStreams[0].codec = "h264" + tryDirectPlay = tryDirectPlay or (get_user_setting("playback.tryDirect.hevcProfileLevel") = "true" and m.playbackInfo.MediaSources[0].MediaStreams[0].codec = "hevc") + if tryDirectPlay and m.playbackInfo.MediaSources[0].TranscodingUrl <> invalid and forceTranscoding = false + transcodingReasons = getTranscodeReasons(m.playbackInfo.MediaSources[0].TranscodingUrl) + if transcodingReasons.Count() = 1 and transcodingReasons[0] = "VideoLevelNotSupported" + video.directPlaySupported = true + video.transcodeAvailable = true + end if end if end if