Plex seems to transcode entire episodes or movies in 1 go instead of transcoding only when required

This seems to have surfaced for me with the latest version of PMS, and it doesnt seem to happen with every client, but plex web seems to ignore whatever setting that keeps a transcode from going all the way.

I currently see a session that is only at 15 procent of watching the episode, yet the transcoder has transcoded 100 procent of the episode already. This puts significant unnecessary load on my server’s CPU, not to mention that if the client restarts his session, he does it all over again.

For now the only clients that I see doing this, are chrome/safari/firefox, my nvidia shield behaves as he should, only transcoding like 10 procent ahead of what the user is watching…

Is this a known issue?

There are a few threads with this issue now, but I haven’t seen an official respons yet, except in an old thread about Firefox doing this (and still doing). I’ also have this issue since plexweb player got updated. Same for every browser.

well let’s hope they can officially answer this one, see it as bug (because it has a lot of impact in my opinion) and get it fixed soon, glad to see I am not the only one that has this problem

Can you please create / capture a test case?

I would be very interested to see it and will write it up when I can verify it.

  1. Make sure logging level is set to Debug
  2. Obtain the XML of the video you’re transcoding (so I can track it in the log file)
  3. Start to play. Wait 30 seconds, capture the log set (Settings - Server - Help - Download Logs)
  4. Keep that ZIP file safe until playback finishes.
  5. When you stop playback, wait 30 seconds and generate another logfile set (if playback was longer than about 20 minutes )
  6. Please post all 3 items (XML and both log file sets)

@Michael.De.Vijlder said:
This seems to have surfaced for me with the latest version of PMS, and it doesnt seem to happen with every client, but plex web seems to ignore whatever setting that keeps a transcode from going all the way.

I currently see a session that is only at 15 procent of watching the episode, yet the transcoder has transcoded 100 procent of the episode already. This puts significant unnecessary load on my server’s CPU, not to mention that if the client restarts his session, he does it all over again.

For now the only clients that I see doing this, are chrome/safari/firefox, my nvidia shield behaves as he should, only transcoding like 10 procent ahead of what the user is watching…

Is this a known issue?

FYI. I found one of my remote clients forced transcoding virtually all the time - he was using Chrome - switched to IE and no transcoding.

@ChuckPa said:
Can you please create / capture a test case?

I would be very interested to see it and will write it up when I can verify it.

  1. Make sure logging level is set to Debug
  2. Obtain the XML of the video you’re transcoding (so I can track it in the log file)
  3. Start to play. Wait 30 seconds, capture the log set (Settings - Server - Help - Download Logs)
  4. Keep that ZIP file safe until playback finishes.
  5. When you stop playback, wait 30 seconds and generate another logfile set (if playback was longer than about 20 minutes )
  6. Please post all 3 items (XML and both log file sets)

Glad to see a plex developer interested in this, tonight I cannot make the logfile but tomorrow I have time to do so.

I did attach a couple of screenshots to show you what I see on the server side, I have a freenas on which my plex server runs, and it has a Intel(R) Xeon(R) CPU E3-1265L v3 @ 2.50GHz as reference, so a pretty decent cpu. Yet for a simple 720p transcode, it makes my cpu almost max out for 5 minutes until the full transcode is done:

In the following screenshots you can see that the spikes correspond to the moment a transcoder starts, the last screenshot shows the transcoding process in plexpy, which is 100 procent for all 3 episodes, which are being played in chrome, chrome and safari respectively:


I will do my very best to provide decent logfiles tomorrow, maybe this already helps a bit? Or at least confirms that I am not crazsy :slight_smile:

A point I failed to ask earlier but is of importance…

What are your values for:

Transcoder default duration 
120
Duration in minutes to use when transcoding something with an unknown duration.

Transcoder default throttle buffer 
60
Amount in seconds to buffer before throttling the transcoder.

These are the defaults. If too large, it is possible to run off the end of the file.

Also, there was a small bug some time back which has since been corrected.

When you are able to capture the test case, we will see what is happening

@ChuckPA said:
A point I failed to ask earlier but is of importance…

What are your values for:

Transcoder default duration 
120
Duration in minutes to use when transcoding something with an unknown duration.

Transcoder default throttle buffer 
60
Amount in seconds to buffer before throttling the transcoder.

These are the defaults. If too large, it is possible to run off the end of the file.

Also, there was a small bug some time back which has since been corrected.

When you are able to capture the test case, we will see what is happening

These values for me are the default that you have listed there, and I havent changed them in forever, but this transcode all the way problem is very much new, it doesnt throttle anymore at all

Ok… then let’s find out what is happening and FIX IT. "I hate bugs!.. " :slight_smile:

I’ll also try to post logs tomorrow if I’m not too busy…

Until then, here is my observations:

  1. Firefox has caused this a long time, but very few users use Firefox so I haven’t made it a priority.

  2. After plexweb got the new player, this is a problem in every browser I’ve tested. Chrome, Safari and I.E.

  3. If you connect directly to https://yourexternalip:port/web/index.html or your personal plex.direct url and use an older plexweb client without the new player, problem is gone. (Except for Firefox ofcourse)

  4. Doesn’t matter if you use PMS 1.8 or 1.5, the only thing that makes a difference is what version of plexweb you use.

@ChuckPA said:
Can you please create / capture a test case?

I would be very interested to see it and will write it up when I can verify it.

  1. Make sure logging level is set to Debug
  2. Obtain the XML of the video you’re transcoding (so I can track it in the log file)
  3. Start to play. Wait 30 seconds, capture the log set (Settings - Server - Help - Download Logs)
  4. Keep that ZIP file safe until playback finishes.
  5. When you stop playback, wait 30 seconds and generate another logfile set (if playback was longer than about 20 minutes )
  6. Please post all 3 items (XML and both log file sets)

I have one more questions so that I get it right, so I need to let an entire episode play? Or do you only need like a minute of the video playing? Your point 4 confuses me a bit

I will be taking the logs this evening, once you answer the question that I am sure to do it right :slight_smile:

meanwhile, on reddit there is a thread about the same problem: https://www.reddit.com/r/PleX/comments/6szdwu/plex_not_throttling_transcodes_at_all/

Michael,
I would like you to

  1. Start playback and capture one log set at that time.
  2. Let playback continue for ~5 minutes. There is no need to play longer
  3. Interrupt playback as you normally would and wait 30 seconds for logs to settle in which time the transcoder should have exited and cleaned up
  4. Collect the second set (Settings - Server - Help - Download Logs
  5. Attach both sets here with the XML

If the machine is only performing this single playback task when you do this, I would greatly appreciate it. It will simplify debugging significantly

@ChuckPA said:
Michael,
I would like you to

  1. Start playback and capture one log set at that time.
  2. Let playback continue for ~5 minutes. There is no need to play longer
  3. Interrupt playback as you normally would and wait 30 seconds for logs to settle in which time the transcoder should have exited and cleaned up
  4. Collect the second set (Settings - Server - Help - Download Logs
  5. Attach both sets here with the XML

If the machine is only performing this single playback task when you do this, I would greatly appreciate it. It will simplify debugging significantly

alright, tomorrow I can do that when no one is using my server, I will try to keep it as clean as possible, I appreciate you taking the time :slight_smile:

I appreciate your time as well. I’ve tried it here and can’t reproduce so there must be something unique to your configuration we need to identify. Regardless the root cause, we’ll figure it out and resolve it

First attempt at making the logfiles, can you tell me if these suffice?

Michael, If you look at the XML file, it is zero length. It didn’t upload before you click “Post”.

Please confirm:

A. PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR is pointing to /usr/local/plexdata-plexpass ?
B. You granted user plex (or whichever user is running PMS) permission to write to wherever you’re pointing the transcoder temp directory? It appears you forgot the permissions:

Aug 12, 2017 15:55:22.586 [0x80dcbf800] DEBUG - Downloaded stream from [127.0.0.1:32400/library/streams/319540?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx] (codec: srt) to temporary file [/tmp/Transcode/Sessions/plex-transcode-zjhma5e3dqss10jelg6i5dck-d97140b6-12d1-4cc6-a94d-9afc21b78472/temp-0.srt]
Aug 12, 2017 15:55:22.587 [0x80dcbf800] ERROR - Error creating directory /transcode: boost::filesystem::create_directory: Permission denied: "/transcode"
Aug 12, 2017 15:55:22.587 [0x80dcbf800] DEBUG - Job running: EAE_ROOT='/tmp/pms-1f1d85c2-3e18-4cde-8852-2de4dde2793f/EasyAudioEncoder' FFMPEG_EXTERNAL_LIBS

The permissions thing seems to be the issue. In the second set of log files, I also find.

Aug 12, 2017 15:58:54.316 [0x80dcc0000] DEBUG - Job was already killed, not killing again.
Aug 12, 2017 15:58:54.316 [0x80dcc0000] DEBUG - Stopping transcode session zjhma5e3dqss10jelg6i5dck
Aug 12, 2017 15:58:54.316 [0x80dcc0000] DEBUG - Transcoder: Cleaning old transcode directories.
Aug 12, 2017 15:58:54.316 [0x80dcc0000] ERROR - Error creating directory /transcode: boost::filesystem::create_directory: Permission denied: "/transcode"
Aug 12, 2017 15:58:54.316 [0x80dcc0000] DEBUG - Transcoder: Cleaning old transcode directory: /tmp/Transcode/Sessions/plex-transcode-zjhma5e3dqss10jelg6i5dck-d97140b6-12d1-4cc6-a94d-9afc21b78472

This tells me PMS is stopping the transcoder. Now to find out what else is going on after the permissions issues are resolved.

This should work better. Also, I will fix the permission problems, but honestly, when a PS4 plex client asks for a transcode, it still works. but I will definitely look into it :slight_smile: I honestly dont really understand how it happens, since the entire directory is owned by the user that runs plex, the transcoder is in the normal folder (/usr/local/plexdata-plexpass/Plex Media Server/Cache/Transcode/? or is the uppercase a problem?)

I think this might have to do with the fact that I have moved my server a couple of times, maybe it got mixed up

and yes, the dir for plex media server is there, it is on a freebsd jail that the PMS runs

edit2: it seems transcoding happens in /tmp/Transcode, I have no idea why plex is using that one honestly…

@Michael.De.Vijlder said:
This should work better. Also, I will fix the permission problems, but honestly, when a PS4 plex client asks for a transcode, it still works. but I will definitely look into it :slight_smile: I honestly dont really understand how it happens, since the entire directory is owned by the user that runs plex, the transcoder is in the normal folder (/usr/local/plexdata-plexpass/Plex Media Server/Cache/Transcode/? or is the uppercase a problem?)

I think this might have to do with the fact that I have moved my server a couple of times, maybe it got mixed up

and yes, the dir for plex media server is there, it is on a freebsd jail that the PMS runs

edit2: it seems transcoding happens in /tmp/Transcode, I have no idea why plex is using that one honestly…

Permission issues or not, I’m on Windows and got exactly the same issues with the new player on plexweb. Transcoder never throttles. Got all my users connecting directly to my plex.direct url now and problem is gone.

@Michael.De.Vijlder said:

edit2: it seems transcoding happens in /tmp/Transcode, I have no idea why plex is using that one honestly…

Just as a check? What is your transcoder temp directory pointing to? If it’s blank, did you configure the environment variable external to PMS prior to it starting up? (old style)