Plex transcoding MKV to MPEGTS

Hello,

Here’s my setup before I state the problem:

  • Western Digital My Passport Pro (most up-to-date version)
  • Plex app on LG TV (most up-to-date version)
  • LG OLED55E6P TV (most up-to-date version)
  • Wifi wireless local connection (my internet speed tested on fast.com shows 810 Mbps)

ISSUE:

Most of my HVEC and REMUX MKV movies stream fine with no transcoding however I have a few files that say the following when I try and stream them:

  • Mode: Direct Stream
  • Container: MKV → MPEGTS
  • Protocol: HLS
  • Reason: Application disabled direct play. Direct play not available; Conversion OK.

One file that’s having this issue is a “4K DoVi/HDR10 (HEVC Main 10)” file while another file having this issue is a “4K HDR10 (HEVC Main 10)” file. But like I said, most “4K HDR10 (HEVC Main 10)” play fine while I noticed another REMUXED “4K DoVi/HDR10 (HEVC Main 10)” file plays fine as well.

I watch all my streams with direct stream / direct play and no transcoding.

Through online research it’s been suggested that buying an NVIDIA or an Apple TV might solve the issue. Unsure how or unsure why I’d spend money on new hardware since most of my content streams fine with no buffering / transcoding.

Thanks to anyone that can help.

Hi I’m also wondering why some of my files are transcoding, where did you find the “Reason:” information ? Thanks!

From the looks, there’s no actual transcoding – for some reason Plex is re-muxing the tracks into a different container. That won’t touch/impact the content of the video, audio or subtitle tracks.

https://support.plex.tv/articles/200250387-streaming-media-direct-play-and-direct-stream/

There’s an option in settings in the Plex app for my LG TV that if enabled allows you to see info on screen while you stream the video. It’s called “enable playback info” or something like that.

Well it says “Application disabled direct play. Direct play not available; Conversion OK” while streaming and it keeps buffering rendering the movie unwatchable so I’m unsure what it’s doing if it’s not transcoding (reading the link you provided it appears it’s extracting the info from the MKV container and repacking it into something Plex can read).

If there’s a way to avoid the extraction/repacking, that would be great.

my question is how do I get the REASON for a transcode. I’d love to know WHY plex is transcoding a particular file and where that reason originated - like is it the client asking for a specific item? has the server made a determination based on bandwidth? is the container not compatible with the client? information like that so I can see why certain files (that I thought were encoded the same) play differently on the same player. I’ve had the same file stream to the same client and one time be transcoded and another time not… I’d like to know why that is.

Most players will display a reason for transcoding (see moseh’s post above).
Depending on how hard-core you feel about it you can also check out the server logs for MDE labelled lines.

I’m totally fine with scrubbing through server logs to find out why, I just want to know what to look for. In my server logs, the only “MDE” line I see say
WARN - MDE: unable to find a working transcode profile for video stream

I don’t see anything that would give me a reason for initiating a transcode. The transcodes I keep seeing is the same as the title on this topic MKV to MPEGTS. I think it would be reasonable to have a reason for the transcode on my server somewhere and not have to ask every (non-technical) client operator I have why they’re transcoding since they’d probably respond with “uh… what?”.

Please let me know if you figure this out through the logs. thx!

I’m waiting for details on how to find the transcode reason details in the logs. It would be really helpful if Plex would publish transcode reasons in the API as well.

@tom80H can you point us at the MDE lines in the server logs that we’re looking for? Can you give an example? Are there additional server options that need to be turned on to see the transcode reasons? Thanks!

Make sure Debug logging is enabled in Settings > [Server Name] > General (but not verbose logging!!). You’ll be looking for the Plex Media Server.log or one of the numbered versions (e.g. Plex Media Server.5.log).

Here’s an example of the lines you’ll be looking for. Notice the lines labeled with a MDE: prefix

Mar 01, 2023 23:16:58.516 [0x7fa12d6d9b38] DEBUG - [Req#ca08] We're going to try to auto-select an audio stream for account 1.
Mar 01, 2023 23:16:58.517 [0x7fa12d6d9b38] DEBUG - [Req#ca08] Selecting best audio stream for part ID 66067 (language: en)
Mar 01, 2023 23:16:58.517 [0x7fa12d6d9b38] DEBUG - [Req#ca08] We're going to try to auto-select a subtitle.
Mar 01, 2023 23:16:58.517 [0x7fa12d8dcb38] DEBUG - [Req#ca0c/Transcode] MDE: Selected protocol http; container: mkv
Mar 01, 2023 23:16:58.517 [0x7fa12d6d9b38] DEBUG - [Req#ca08] Audio Stream: 199170, Subtitle Stream: -1
Mar 01, 2023 23:16:58.517 [0x7fa12d8dcb38] DEBUG - [Req#ca0c/Transcode] MDE: analyzing media item 53813
Mar 01, 2023 23:16:58.517 [0x7fa12d8dcb38] DEBUG - [Req#ca0c/Transcode] MDE: E7 - Eine Minute: Direct Playing due to no transcode profile
Mar 01, 2023 23:16:58.517 [0x7fa12d8dcb38] DEBUG - [Req#ca0c/Transcode] MDE: E7 - Eine Minute: DirectPlay
Mar 01, 2023 23:16:58.517 [0x7fa12d8dcb38] DEBUG - [Req#ca0c/Transcode] MDE: Breaking Bad - S3 E7 - Eine Minute: selected media 0 / 53813
Mar 01, 2023 23:16:58.517 [0x7fa12d8dcb38] DEBUG - [Req#ca0c/Transcode] Streaming Resource: Added session 0x7fa132a4eb38:CFB163AD-3744-4CA2-8B18-65D542FB013F
Mar 01, 2023 23:16:58.517 [0x7fa12d8dcb38] DEBUG - [Req#ca0c/Transcode] Streaming Resource: Reached Decision id=32855 codes=(General=1000,Direct play OK. Direct Play=1000,Direct play OK.) media=(id=53813 part=(id=65911 decision=direct play protocol=http streams=(Video=(id=198566 decision= width=720 height=574) Audio=(id=198567 decision= channels=6 rate=48000))))

My AppleTV is able to directly play the video, therefore there’s not all that many details. If a file is being transcoded or directly streamed, you should find a reference on why that is.

Thanks for the tip @tom80H ! I turned on debug logging, and found the MDE data! However, I don’t know how to interpret this as a “why” the transcode happened. The source media is an MKV file and it transcodes it to an MPEGTS file but I’m not sure why, here’s a log snipped:

DEBUG - Request: [zzz (WAN)] GET /video/:/transcode/universal/decision?protocol=hls&mediaIndex=0&waitForSegments=1&videoQuality=100&session=zzz&maxVideoBitrate=4000&mediaBufferSize=50000&offset=0&partIndex=0&videoResolution=1280x720&directPlay=0&path=%2Flibrary%2Fmetadata%2F48724&directStream=1&hasMDE=1&skipSubtitles=1 (14 live) #zzz TLS GZIP Signed-in Token (zzz)
DEBUG - [Reqzzz/Transcode] Found session GUID of zzz in session start.
DEBUG - [Reqzzz/Transcode] TranscodeUniversalRequest: adapting profile with augmentation data: add-limitation(scope=videoCodec&scopeName=hevc&type=notMatch&name=video.DOVIProfile&value=5)+add-limitation(scope=videoTranscodeTarget&scopeName=hevc&scopeType=videoCodec&context=streaming&protocol=hls&type=match&name=video.colorTrc&list=bt709|bt470m|bt470bg|smpte170m|smpte240m|bt2020-10|bt2020-10&isRequired=false)+add-limitation(scope=videoCodec&scopeName=h264&type=upperBound&name=video.level&value=41)+add-limitation(scope=videoCodec&scopeName=h264&type=upperBound&name=video.refFrames&value=16&replace=true)+add-limitation(scope=videoAudioCodec&scopeName=mp3&type=upperBound&name=audio.channels&replace=true&value=0)
DEBUG - [Reqzzz/Transcode] TranscodeUniversalRequest: using augmented profile Roku-7.x
DEBUG - [Reqzzz/Transcode] Downloading document http://127.0.0.1:32400/library/metadata/48724?includeBandwidths=1&offset=0&X-Plex-Client-Capabilities=videoDecoders%3dh264%7bprofile%3ahigh%26resolution%3a1080%26level%3d41%7d%3baudioDecoders%3daac%7bchannels%3a2%7d&X-Plex-Incomplete-Segments=1&X-Plex-Session-Identifier=zzz
DEBUG - [Reqzzz/Transcode/Reqzzz] Auth: authenticated user zzz as zzz
DEBUG - [Reqzzz/Transcode/Reqzzz] It took 0.000000 ms to retrieve 128 items.
DEBUG - [Reqzzz/Transcode/Reqzzz] It took 31.250000 ms to retrieve 128 items.
DEBUG - [Reqzzz/Transcode/Reqzzz] We're going to try to auto-select an audio stream for account zzz.
DEBUG - [Reqzzz/Transcode/Req#zzz] Selecting best audio stream for part ID 92818 (language: en)
DEBUG - [Reqzzz/Transcode/Req#zzz] Audio Stream: 208857, Subtitle Stream: 0
DEBUG - [Reqzzz/Transcode] MDE: Selected protocol hls; container: mpegts
DEBUG - [Reqzzz/Transcode] MDE: analyzing media item 92501
DEBUG - [Reqzzz/Transcode] MDE: zzz: Direct Play is disabled
DEBUG - [Reqzzz/Transcode] MDE: zzz: media must be transcoded in order to use the hls protocol
DEBUG - [Reqzzz/Transcode] MDE: zzz: no direct play video profile exists for http/mkv/h264/ac3
DEBUG - [Reqzzz/Transcode] MDE: zzz: selected media 0 / 92501
DEBUG - [Reqzzz/Transcode] Streaming Resource: Adding session zzz which is using 3357kbps of WAN bandwidth.  Used is now 3357kbps
DEBUG - [Reqzzz/Transcode] Streaming Resource: Added session zzz
DEBUG - [Reqzzz/Transcode] Streaming Resource: Reached Decision id=48724 codes=(General=1001,Direct play not available; Conversion OK. Direct Play=3000,App cannot direct play this item. Direct play is disabled. Transcode=1001,Direct play not available; Conversion OK.) media=(id=92501 part=(id=92818 decision=transcode container=mpegts protocol=hls streams=(Video=(id=208856 decision=copy width=720 height=460) Audio=(id=208857 decision=copy channels=2 rate=48000))))
DEBUG - Completed: [zzz] 200 GET /video/:/transcode/universal/decision?protocol=hls&mediaIndex=0&waitForSegments=1&videoQuality=100&session=zzz&maxVideoBitrate=4000&mediaBufferSize=50000&offset=0&partIndex=0&videoResolution=1280x720&directPlay=0&path=%2Flibrary%2Fmetadata%2F48724&directStream=1&hasMDE=1&skipSubtitles=1 (14 live) #8ee2a TLS GZIP 33ms 5103 bytes (pipelined: 6)

here’s a screen shot from Tautulli also, didn’t see an obvious reason for transcode there either…
image

Running latest PMS on windows, with a Roku as a client for this example.

Looks like the client has the streaming quality set to a max bitrate of 4000 kbps – that appears to be ok as the video has a lower average bitrate (Plex estimates the peak bitrate required as 3357 kbps).
However, the client is apparently set not to direct play videos – hence Plex will use “direct stream” mode (where it remuxes the video/audio streams as-is into a different/preferred streaming container.

DEBUG - Request: [zzz (WAN)] GET /video/:/transcode/universal/decision?protocol=hls&mediaIndex=0&waitForSegments=1&videoQuality=100&session=zzz&maxVideoBitrate=4000&mediaBufferSize=50000&offset=0&partIndex=0&videoResolution=1280x720&directPlay=0&path=%2Flibrary%2Fmetadata%2F48724&directStream=1&hasMDE=1&skipSubtitles=1 (14 live) #zzz TLS GZIP Signed-in Token (zzz)
                                                                                                                                                ^^^^^^^^^^^^^^^^^^^^                                                                     ^^^^^^^^^^^^

...
DEBUG - [Reqzzz/Transcode] MDE: zzz: Direct Play is disabled

So, you’re saying that if the client enabled direct play, then that media would direct play? Another oddity (to me anyhow) is that Tautulli reported copy and copy for the video and audio streams but media->bitrate was different between source and stream?

Another oddity looking over the logs in Tautulli, on this same client on same tv, and on the same media, prior to Jan 2023, the media always direct played. After Jan 2023, the client always transcoded with various bitrates. This user is not a technical user who most likely is using whatever the defaults in the client are, so I doubt the person modified the Roku Plex client settings, but I will ask to verify.

It seems like that’s what’s currently blocking it from direct-playing.
Possibly there’s other obstacles but none of those are currently showing.

Could be you’re comparing average bitrate (file/track size divided by duration) vs. the actual bitrate for a specific timeframe.

In my experience, there’s very few settings, people won’t change or click on if they feel this should change something – especially if they’re not all that technically inclined.
Put a big red button with a label “Don’t click!” in a room and people will click it :red_circle:
:wink:

As I suspected, the user has all the default client settings, Direct Play is set to Auto on the Roku client, not disabled.

So, I guess the real question is boiling down to how does “Auto” result in directPlay=0 in the client GET /video/ request.

I found in the logs that on the same player and on the same media the client will set directPlay=0 and directPlay=1 seemingly randomly.

Does anyone know how the “Auto” setting in the client results in the directPlay flag value in the GET request?

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