Transcode of LiveTV into TV apps (Samsung and Roku)

I run my Plex server in a 24 core beast, with a SiliconDust Prime tuner. It works flawlessly, but consumes energy like there is no tomorrow, so I’ve decided to go small and port the server into an Intel NUC machine.
For agents we use Roku Tvs and Samsung TV.

Since then, I’ve started to pay more attention to the CPU consumption, and noted the following CPU utilization:

  • HIGH cpu when live tv is showing on the TVs
  • LOW cpu when live tv is recording to disk
  • LOW cpu when a previously recorded live tv show plays on the TVs

Looking at the details, it seems that the TVs can’t get direct stream and are forcing a transcode to take place in the first case, but that is not the case in the other two scenarios, with the same file type.

Is there anything that I can do on the agents or the server to avoid transcoding something that the TV can play natively? I mainly use Plex to watch liveTV and live TV recorded shows.

Thanks

I’m puzzled that the

So, it there a reason why LiveTV requires transcoding but recording to disk or playing such recording at a later time does not?

Is there a setting that can be toggled to enable/disable this behavior?

I’ve notice the same behavior, and I don’t think it’s related to transcoding necessarily, I think it may be simpler than that - when you’re watching “Live TV” (your first scenario), it’s doing both jobs at once, recording a TV stream to disk and it’s also playing it back at the same time. That is doing twice the work of either just recording or just watching something already recorded (your cases 2 and 3).

That would be my best guess as to why it’s working so much harder to watch Live TV - my solution so far has just been to not do that! I try to record everything ahead of time and I usually use VLC to play back the videos after they have recorded.

I thought the same at first, but when verifying the status of the server in the dashboard, I can see that pre recorded shows are played directly, without transcoding, as if the TV and the server agreed that this particular file format is able to be streamed directly thus no CPU impact when playing a recorded show.
When playing LiveTV, this handshake between TV and server doesn’t seem to occur, as the default behavior is to transcode the show before sending to the TV and thus the high CPU impact.

I don’t mind having to wait an extra second or so to allow for some communication with the TV that will ensure that shows are streamed. This will allow Live TV watching on less power hungry devices.

Recorded media is analyzed so Plex is able to make better decisions than when it has to remux the live stream for consumption by a client. Arbitrarily de-interlacing and audio conversion in most cases. Filter the log for MDE to find out what decisions are being made.

To many have complained about the long startup time for tuning channels for Plex to backtrack and add more analysis to the startup.

MDE logs reinforce the idea that livetv does not correctly analyze the stream and thus the default transcode is used. Is there any way to change the behavior?

Here is a dump of the logs.
Basically:

  • MDE: Selected protocol hls; container: mpegts
  • MDE: : no direct play video profile exists for http/mpegts/
  • MDE: : codec is unavailable for analysis
  • MDE: Selected protocol dash; container: mp4
  • MDE: media must be transcoded in order to use the dash protocol

So, can this be resolved by creating a profile type? Is this documented somewhere?

Here is the full log:

ibravo@plex:/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs$ tail -f Plex\ Media\ Server.log | grep MDE
Nov 14, 2021 22:11:18.977 [0x7f3f7f6f5b38] DEBUG - [Grabber/5fc76e23eb8098002d84fee0-5fc705f2ef776a002eba3cb8-dg1wkus5dupfouxlrj4wodvf] MDE: Selected protocol hls; container: mpegts
Nov 14, 2021 22:11:18.977 [0x7f3f7f6f5b38] DEBUG - [Grabber/5fc76e23eb8098002d84fee0-5fc705f2ef776a002eba3cb8-dg1wkus5dupfouxlrj4wodvf] MDE: analyzing media item -1
Nov 14, 2021 22:11:18.977 [0x7f3f7f6f5b38] DEBUG - [Grabber/5fc76e23eb8098002d84fee0-5fc705f2ef776a002eba3cb8-dg1wkus5dupfouxlrj4wodvf] MDE: : no direct play video profile exists for http/mpegts/
Nov 14, 2021 22:11:18.977 [0x7f3f7f6f5b38] DEBUG - [Grabber/5fc76e23eb8098002d84fee0-5fc705f2ef776a002eba3cb8-dg1wkus5dupfouxlrj4wodvf] MDE: : no direct play video profile exists for http/mpegts//
Nov 14, 2021 22:11:18.977 [0x7f3f7f6f5b38] DEBUG - [Grabber/5fc76e23eb8098002d84fee0-5fc705f2ef776a002eba3cb8-dg1wkus5dupfouxlrj4wodvf] MDE: : codec is unavailable for analysis
Nov 14, 2021 22:11:18.977 [0x7f3f7f6f5b38] DEBUG - [Grabber/5fc76e23eb8098002d84fee0-5fc705f2ef776a002eba3cb8-dg1wkus5dupfouxlrj4wodvf] MDE: : codec is unavailable for analysis
Nov 14, 2021 22:11:18.977 [0x7f3f7f6f5b38] DEBUG - [Grabber/5fc76e23eb8098002d84fee0-5fc705f2ef776a002eba3cb8-dg1wkus5dupfouxlrj4wodvf] MDE: : selected media 0 / -1
Nov 14, 2021 22:11:20.613 [0x7f3f7f9a9b38] DEBUG - Request: [192.168.1.112:58898 (Allowed Network (Subnet))] GET /video/:/transcode/universal/decision?hasMDE=1&path=%2Flivetv%2Fsessions%2F001247f2-05f6-4e72-aef0-8bb53add8061&mediaIndex=0&partIndex=0&protocol=dash&fastSeek=1&directPlay=0&directStream=1&subtitleSize=100&audioBoost=100&location=lan&addDebugOverlay=0&autoAdjustQuality=1&directStreamAudio=1&mediaBufferSize=102400&session=0l2w4huw5psl4cezcl3kva8o&subtitles=burn&copyts=0&Accept-Language=en (21 live) TLS GZIP Signed-in Token (ibravo@hotmail.com)
Nov 14, 2021 22:11:20.628 [0x7f3f7f9a9b38] DEBUG - [Transcode] MDE: Selected protocol dash; container: mp4
Nov 14, 2021 22:11:20.628 [0x7f3f7f9a9b38] DEBUG - [Transcode] MDE: analyzing media item 48129
Nov 14, 2021 22:11:20.629 [0x7f3f7f9a9b38] DEBUG - [Transcode] MDE: E1 - The Mayor of Kingstown: Direct Play is disabled
Nov 14, 2021 22:11:20.629 [0x7f3f7f9a9b38] DEBUG - [Transcode] MDE: E1 - The Mayor of Kingstown: media must be transcoded in order to use the dash protocol
Nov 14, 2021 22:11:20.629 [0x7f3f7f9a9b38] DEBUG - [Transcode] MDE: E1 - The Mayor of Kingstown: selected subtitle cannot be converted to a compatible format, burning into video stream
Nov 14, 2021 22:11:20.629 [0x7f3f7f9a9b38] DEBUG - [Transcode] MDE: E1 - The Mayor of Kingstown: avoiding video remux due to burned subtitle stream
Nov 14, 2021 22:11:20.629 [0x7f3f7f9a9b38] DEBUG - [Transcode] MDE: E1 - The Mayor of Kingstown: no remuxable profile found, so video stream will be transcoded
Nov 14, 2021 22:11:20.629 [0x7f3f7f9a9b38] DEBUG - [Transcode] MDE: Cannot direct stream video stream due to profile or setting limitations
Nov 14, 2021 22:11:20.629 [0x7f3f7f9a9b38] DEBUG - [Transcode] MDE: Cannot direct stream audio stream due to codec ac3 when profile only allows aac
Nov 14, 2021 22:11:20.629 [0x7f3f7f9a9b38] DEBUG - [Transcode] MDE: Mayor of Kingstown - S1 E1 - The Mayor of Kingstown: selected media 0 / 48129
Nov 14, 2021 22:11:20.631 [0x7f3f89cfeb38] DEBUG - Completed: [192.168.1.112:58898] 200 GET /video/:/transcode/universal/decision?hasMDE=1&path=%2Flivetv%2Fsessions%2F001247f2-05f6-4e72-aef0-8bb53add8061&mediaIndex=0&partIndex=0&protocol=dash&fastSeek=1&directPlay=0&directStream=1&subtitleSize=100&audioBoost=100&location=lan&addDebugOverlay=0&autoAdjustQuality=1&directStreamAudio=1&mediaBufferSize=102400&session=0l2w4huw5psl4cezcl3kva8o&subtitles=burn&copyts=0&Accept-Language=en (21 live) TLS GZIP 18ms 1381 bytes (pipelined: 26)

Do you/can you use Hardware Transcoding? This will help with the video, subtitles(Closed Captioning) will still hit the CPU. Getting your clients to direct play will provide the most benefit. For the Roku, enable allow mpeg2 is usually required. Samsung presents it’s own issues since the client is currently requiring insecure connections.

While a Live Stream is playing if you check the dashboard from a browser via https://app.plex.tv/web it will give you an idea of what is happening.

Plex does not provide an interface to override transcoder parameters. I have seen user create work arounds but that gets involved.

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