Transcoding issue with HEVC 10bit

Server Version#: 1.20.1.3252 (Linux box on Celeron J4105 with hardware transcoding although I’d prefer not to transcode)
Player Version#: 8.5.1.19778 (Nvidia Shield TV Pro 2017)
TV custom display mode: 3840x2160p 60 Hz YUV 420 10-bit Rec. 709

I managed to direct play HDR (10 bit) content with the official Plex for Kodi with the original colours [1] but the original Plex app always triggers transcoding the video and giving AC3 audio as the reason for transcoding, although it’s not even transcoding the audio! [2]

It seems to be transcoding 10bit → 8bit as the colours look horrible (washed out) with the transcoded play from the Plex app.

How can the “normal” Plex app be told not to transcode that video?

[1] Plex for Kodi direct streams

[2] Plex transcodes video, giving a lame excuse about the AC3 audio that it’s not even transcoding…

What Shield Experience version are you using?
I have full DirectPlay of 2160p HDR 59.94 hz (yes, 59.94) with Dolby passthrough the Plex app and Shield perform full local trancode onto a 1080p display.

Latest Shield version that I can get: 8.2.0 (32.6.435.1)
image

I’m also on 59.94 Hz, and the default is RGB 8-bit but I changed it to YUV 420 10-bit as I couldn’t find any way to properly render 10-bit files with the default RGB 8-bit setting (with any app at all, even Kodi was washing out the colours):

I found the logs related to this stream [1] and if I am reading it correctly…

For the audio, Plex “transcodes” it (actually just copies it) because it’s not the first audio stream and direct play seems to be only enabled for the first stream.
“direct play stream selection is not enabled” << how can I enable it?

For the video, Plex seems to be transcoding because the colour profile (smpte2084) is not supported for remux (supported: bt709, bt470m, smpte240m, smpte170m, bt470bg, bt2020-10).

For both (?), Plex seems to be transcoding it because of the HLS protocol.
I’m not sure what that protocol is but the fact that I can direct play it in Kodi or Plex for Kodi makes me think my Shield supports it just fine… How can I tell Plex to direct stream it?

[1] Logs

09:06 Debug — Codecs: 10-bit HEVC test succeeded
09:06 Debug — Scaled up video bitrate to 38560Kbps based on 4.500000x fudge factor.
09:06 Debug — MDE: Selected protocol hls; container: mkv
09:06 Debug — MDE: analyzing media item 14439
09:06 Debug — MDE: Movie Name (YYYY): Direct Play is disabled
09:06 Debug — MDE: Movie Name (YYYY): media must be transcoded in order to use the hls protocol
09:06 Debug — MDE: Movie Name (YYYY): selected audio stream is not the first audio stream and direct play stream selection is not enabled
09:06 Debug — MDE: Movie Name (YYYY): no direct play video profile exists for http/mkv/hevc
09:06 Debug — MDE: Movie Name (YYYY): no direct play video profile exists for http/mkv/hevc/dca
09:06 Debug — MDE: Movie Name (YYYY): no direct play video profile exists for http/mkv/hevc/ac3
09:06 Debug — MDE: Movie Name (YYYY): no direct play video profile exists for http/mkv/hevc/dca
09:06 Debug — MDE: Movie Name (YYYY): no direct play video profile exists for http/mkv/hevc/ac3
09:06 Debug — Movie Name - video.colorTrc limitation applies: smpte2084 != bt709|bt470m|smpte240m|smpte170m|bt470bg|bt2020-10 [list]
09:06 Debug — MDE: Movie Name (YYYY): no remuxable profile found, so video stream will be transcoded
09:06 Debug — MDE: Cannot direct stream video stream due to profile or setting limitations
09:06 Debug — Codecs: testing hevc (decoder) with hwdevice vaapi
09:06 Debug — Codecs: hardware transcoding: testing API vaapi

Dolby Vision is not bt2020 which is what Nvidia implemented in HW and Shield Experience 8.2. Because it’s not implemented by the shield, yes Plex will transcode it

The snipped of log file does not tell the whole story. It only shows the initial MDE.
The rest of the decision (the FFMPEG invocation) is needed

“First audio track” is not a requirement here. “Default audio track” is. In this case, the video incompatibility overshadows the audio.

More logs: https://pastebin.com/raw/QFJnWNAL

Does that explain why it’s transcoding the video? Any way to get it direct stream it so that I don’t lose colours?
I can try finding the logs when direct playing in Plex for Kodi if that helps.

May I have the ZIP logs please?
May I also have the XML (hover over movie, click ellipsis -> Get Info -> View XML - the media section only. no artist genre info is needed).

I can’t help with anything Kodi related. Plex for Kodi is the Plex UI on top of base Kodi.

As for its reason in transcoding:

  1. If the player can’t accept Dolby Vision (which it can’t), Plex will see that and transcode it.
  2. Engineering is working on transcoding BT2020 -> BT709 but I cannot speak to BT2084 (Dolby Vision). It really is better to curate that which your players can play. If nothing in the house can play Dolby Vision, is it really a good idea if you can’t enjoy it?

@TDA, does your TV support HDR? (HDR10 or HDR10+ or Dolby Vision standards? BT.2020 Color?)

A 10-bit Rec. 709 display is not HDR. Rec. 709 is a standard gamut color profile.

More bits doesn’t mean more extreme colors, it means finer steps between adjacent colors. 10 bits doesn’t mean HDR.


@ChuckPA I’m confused by comments re: SMTPE 2084 and BT.2020.

SMTPE 2084 is a PQ/color transfer function used in both HDR10 and Dolby Vision.

BT.2020 is a wide-gamut color space used in both HDR10 and Dolby Vision.

(HDR10 content for consumers is often mastered to about P3, a subset of the BT.2020 color space, because that’s all consumer displays can display.)

That, truly. Trying to “cook” it at playback time isn’t going to look as good as a version that was mastered for the display you have.

I’m referring to what was kicked out by the MDE as to why transcoding was forced.

Debug — Movie Name - video.colorTrc limitation applies: smpte2084 != bt709|bt470m|smpte240m|smpte170m|bt470bg|bt2020-10 [list]

My TV does not support HDR (unfortunately…).
With the default RGB 8-bit, colours were washed out in all players when playing HDR 10-bit movies (Plex and Kodi).
By changing my TV to YUV 420 10-bit, Kodi properly plays it with normal colours.
Moving on to the next step, I am trying to get Plex to play it correctly (trying to feel less bad about having bought a Plex Pass…).

I agree I shouldn’t acquire HDR content when my TV doesn’t support it, but I am looking forward to the day I can afford a better TV and would prefer to have the content ready when possible.
I could also re-encode such content as Plex supports multiple versions of a video, and had started to do that, but there are too many of them for it to be sustainable… (especially since 4k HDR -> 4k SDR is slow on my desktop…).
As Kodi/VLC are able to play it on the fly, I am trying to achieve the same experience in my favourite player (Plex).

Media Info:

<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="1" librarySectionTitle="Movies" librarySectionUUID="ad2ef252-8c08-433a-978d-197eed291440" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1598519402">
<Video ratingKey="7526" key="/library/metadata/7526" guid="com.plexapp.agents.imdb://tt5311514?lang=en" studio="CoMix Wave Films" type="movie" title="Movie Name" librarySectionTitle="Movies" librarySectionID="1" librarySectionKey="/library/sections/1" originalTitle="&#21531;&#12398;&#21517;&#12399;&#12290;" contentRating="PG" summary="High schoolers Mitsuha and Taki are complete strangers living separate lives. But one night, they suddenly switch places. Mitsuha wakes up in Taki&#8217;s body, and he in hers. This bizarre occurrence continues to happen randomly, and the two must adjust their lives around each other." rating="9.8" audienceRating="9.4" viewCount="1" lastViewedAt="1598951296" year="2016" thumb="/library/metadata/7526/thumb/1597453438" art="/library/metadata/7526/art/1597453438" duration="6395648" originallyAvailableAt="2016-08-26" addedAt="1596320035" updatedAt="1597453438" audienceRatingImage="rottentomatoes://image.rating.upright" chapterSource="media" primaryExtraKey="/library/metadata/7527" ratingImage="rottentomatoes://image.rating.ripe">
<Media id="14439" duration="6395648" bitrate="12921" width="3840" height="2160" aspectRatio="1.78" audioChannels="6" audioCodec="dca-ma" videoCodec="hevc" videoResolution="4k" container="mkv" videoFrameRate="24p" audioProfile="ma" videoProfile="main 10">
<Part accessible="1" exists="1" id="14440" key="/library/parts/14440/1596320022/file.mkv" duration="6395648" file="/path/to/Movies/Movie Name (2016)/Movie Name (2016) Bluray-2160p [x265 DTS-HD MA].mkv" size="10330139819" audioProfile="ma" container="mkv" deepAnalysisVersion="4" hasThumbnail="1" requiredBandwidths="2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647" videoProfile="main 10">
<Stream id="34382" streamType="1" default="1" codec="hevc" index="0" bitrate="8569" language="&#26085;&#26412;&#35486;" languageCode="jpn" bitDepth="10" chromaSubsampling="4:2:0" codedHeight="2160" codedWidth="3840" colorPrimaries="bt2020" colorRange="tv" colorSpace="bt2020nc" colorTrc="smpte2084" frameRate="23.976" height="2160" level="153" profile="main 10" refFrames="1" requiredBandwidths="47089,35101,11772,10124,10124,10124,10124,10124" title="Movie.Name.2016.2160p.BluRay.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ" width="3840" displayTitle="4K (HEVC Main 10 HDR)" extendedDisplayTitle="Movie.Name.2016.2160p.BluRay.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ (4K HEVC Main 10 HDR)" />
<Stream id="34383" streamType="2" default="1" codec="dca" index="1" channels="6" bitrate="1536" language="&#26085;&#26412;&#35486;" languageCode="jpn" audioChannelLayout="5.1(side)" bitDepth="24" profile="ma" requiredBandwidths="4229,4035,3711,3630,3630,3630,3630,3630" samplingRate="48000" title="Movie.Name.2016.2160p.BluRay.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ" displayTitle="&#26085;&#26412;&#35486; (DTS-HD MA 5.1)" extendedDisplayTitle="Movie.Name.2016.2160p.BluRay.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ (&#26085;&#26412;&#35486; DTS-HD MA 5.1)" />
<Stream id="34384" streamType="2" selected="1" codec="ac3" index="2" channels="6" bitrate="640" language="&#26085;&#26412;&#35486;" languageCode="jpn" audioChannelLayout="5.1(side)" requiredBandwidths="640,640,640,640,640,640,640,640" samplingRate="48000" title="Movie.Name.2016.2160p.BluRay.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ" displayTitle="&#26085;&#26412;&#35486; (AC3 5.1)" extendedDisplayTitle="Movie.Name.2016.2160p.BluRay.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ (&#26085;&#26412;&#35486; AC3 5.1)" />
<Stream id="34385" streamType="2" codec="dca" index="3" channels="6" bitrate="1536" language="English" languageCode="eng" audioChannelLayout="5.1(side)" bitDepth="24" profile="ma" requiredBandwidths="3728,3651,3572,3572,3572,3572,3572,3572" samplingRate="48000" title="Movie.Name.2016.2160p.BluRay.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ" displayTitle="English (DTS-HD MA 5.1)" extendedDisplayTitle="Movie.Name.2016.2160p.BluRay.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ (English DTS-HD MA 5.1)" />
<Stream id="34386" streamType="2" codec="ac3" index="4" channels="6" bitrate="640" language="English" languageCode="eng" audioChannelLayout="5.1(side)" requiredBandwidths="640,640,640,640,640,640,640,640" samplingRate="48000" title="Movie.Name.2016.2160p.BluRay.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ" displayTitle="English (AC3 5.1)" extendedDisplayTitle="Movie.Name.2016.2160p.BluRay.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ (English AC3 5.1)" />
<Stream id="34387" streamType="3" default="1" forced="1" codec="srt" index="5" language="English" languageCode="eng" requiredBandwidths="1,1,1,1,1,1,1,1" title="English-SRT" displayTitle="English Forced (SRT)" extendedDisplayTitle="English-SRT (Forced)" />
<Stream id="34388" streamType="3" forced="1" codec="pgs" index="6" language="English" languageCode="eng" headerCompression="1" requiredBandwidths="47,47,47,47,47,47,47,47" title="English-PGS" displayTitle="English Forced (PGS)" extendedDisplayTitle="English-PGS (Forced)" />
<Stream id="34389" streamType="3" codec="pgs" index="7" language="&#26085;&#26412;&#35486;" languageCode="jpn" headerCompression="1" requiredBandwidths="69,69,69,69,69,69,69,69" title="Japanese-PGS" displayTitle="&#26085;&#26412;&#35486; (PGS)" extendedDisplayTitle="Japanese-PGS (&#26085;&#26412;&#35486;)" />
<Stream id="34390" streamType="3" codec="pgs" index="8" language="&#20013;&#25991;" languageCode="chi" headerCompression="1" requiredBandwidths="47,47,47,47,47,47,47,47" title="Chinese-PGS" displayTitle="&#20013;&#25991; (PGS)" extendedDisplayTitle="Chinese-PGS (&#20013;&#25991;)" />
<Stream id="34391" streamType="3" codec="pgs" index="9" language="English" languageCode="eng" headerCompression="1" requiredBandwidths="39,39,39,39,39,39,39,39" title="English-Theme-Song-PGS" displayTitle="English (PGS)" extendedDisplayTitle="English-Theme-Song-PGS" />
<Stream id="34403" key="/library/streams/34403" streamType="3" codec="srt" language="English" languageCode="eng" displayTitle="English (SRT External)" extendedDisplayTitle="English (SRT External)" />
<Stream id="34402" key="/library/streams/34402" streamType="3" codec="srt" language="Fran&#231;ais" languageCode="fre" displayTitle="Fran&#231;ais (SRT External)" extendedDisplayTitle="Fran&#231;ais (SRT External)" />
<Stream id="34404" key="/library/streams/34404" streamType="3" codec="srt" language="&#26085;&#26412;&#35486;" languageCode="jpn" displayTitle="&#26085;&#26412;&#35486; (SRT External)" extendedDisplayTitle="&#26085;&#26412;&#35486; (SRT External)" />
</Part>
</Media>

It seems to be bt2020:
image

Plex Media Server.log attached: Plex Media Server - HEVC 4k HDR 10bit.zip (44.0 KB)

I was distracted by your question:

That’s the wrong question. :slight_smile:

You need something in the pipeline that processes the HDR video.

  • Ideally that would be an HDR TV.
  • Next best would be the player (Shield) doing HDR → SDR mapping
  • Fallback would be Plex Media Server transcoding

Today transcoding in Plex Media Server between HDR and SDR produces poor colors. As @ChuckPa said, they’re working on improving this.

The Shield Pro can sometimes perform HDR to SDR tone mapping in the player. Most players can’t do that at all. I’m not sure what the capabilities/prerequisites for it are in the Shield.

I think that’s what @ChuckPa was trying to help you with. I don’t understand this comment:

I don’t know what the Shield’s HDR → SDR capabilities are, but I assume it includes BT.2020 → YUV/BT.709.

@ChuckPa - do you see something that indicates Dolby Vision? I’m still confused by that.

@TDA, it’s POSSIBLE that the Shield will convert to YUV / BT.709 8-bit but not YUV / BT.709 10-bit. You might try that on the TV.

It’s also possible that you should restart the TV and the Shield after making any color setting changes on the TV. Sometimes HDMI/color capabilities are only correctly exchanged at power-on.

My point was that it’s not as simple as the number of bits, or avoiding conversion/transcoding.

Some of the other players, especially standalone ones, have some tonemapping ability. That’s an advantage the standalone players have. It’s a bit more complicated for Plex because it’s a bigger ecosystem of components.

Understood. My TV is an entry-level 4k from early 2017 so I doubt it can do HDR->SDR and don’t see any option that seems related to that in its setup menu. It doesn’t have an eARC HDMI port either (only a standard ARC one).

The Shield (Android TV) settings are more promising.
I reverted back to the default RGB 8-bit Rec 709 profile and restarted both the TV and the Shield.
Now I see a new “Dynamic Range” option in the Shield settings that defaults to “Auto (recommended)” and can be changed to “Full” or “Limited”.
I kept the default dynamic range setting (Auto) and Plex for Kodi still plays it correctly (not sure what I was doing wrong before…), but the “normal” Plex app still washes out the colours via transcoding – which as far as I understand seems to be a known issue that is being worked on?
There’s also an option to automatically switch between Rec 2020 and Rec 709, which I have enabled (wasn’t enabled by default).

I’ll try forcing YUV / BT.709 8-bit later, as well as the Limited/Full options of the Dynamic Range setting and report if I get any more luck with a particular combination.

What I am not fully understanding is that no matter if the client is Plex or Plex for Kodi, the same Plex Media Server is delivering the data, so not sure why the standard Plex app couldn’t also play it correctly.
Is it because when Plex for Kodi is the client, the PMS doesn’t bother checking the client capabilities and just sends the stream, letting the client handle it, and that Kodi better supports HDR->SDR than Plex at the moment so that it looks great, but that the Plex team is working on it so that someday it will also look fine in the normal Plex app?

I tried all the possible modes of my TV (all Rec 709):

  • RGB 8bit (Default)
  • YUV 420 8bit
  • YUV 420 10bit
  • YUV 422 12bit
  • YUV 444 8bit

None of them make it direct play from Plex application, resulting in colour loss because of transcoding.

I’ll stick to Plex for Kodi which plays the HDR videos correctly until that is fixed on Plex itself.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.