Server Version#: 1.19.5.2889-52a517a93 (and older)
FreeNAS. FreeBSD version manually installed in a jail.
TLDR: I think Plex Transcoder is being unnecessarily throttled by PMS when processing background media tasks. I modified the Transcoder binary to test this theory, with great results.
Generating video preview thumbnail / media index / index-sd.bif files has been surprisingly slow for me.
Today I got frustrated and started looking. I noticed that while being slow, it’s also hardly doing any I/O or asking for any CPU, and that the Transcoder process is spending a lot of time sleeping.
I looked at how Plex Transcoder is called. I ran ffmpeg with the same arguments, and extracting the jpg files was hundreds (!!!) of times faster.
It didn’t make sense for ffmpeg to be faster, so I set the environment variables and called Plex Transcoder directly.
LD_LIBRARY_PATH=/PATH/TO/PLEX/LIB
FFMPEG_EXTERNAL_LIBS=/PATH/TO/DATA/CODECS/
X_PLEX_TOKEN=TOKENHERE
Calling Plex Transcoder in the same way PMS does is very slow. This is how it extracts jpg images for index-sd.bif preview thumbnail generation:
$ ./Plex\ Transcoder -skip_frame:v nokey -i input.mkv -threads 0 -q 3 \
-filter_complex "[0:V:0] fps=fps=0.500000:round=up,scale=w=320:h=240:force_original_aspect_ratio=decrease [out]" \
-map "[out]" img-%06d.jpg \
-progressurl http://127.0.0.1:32400/video/:/transcode/session/bif/SESSION-ID/progress
// (output trimmed)
frame= 64 fps=0.4 q=3.0 Lsize=N/A time=00:02:08.00 bitrate=N/A speed=0.79x
0.4 FPS! Barf! I cancelled that job. That’s how bad it has been from inside Plex, too.
(Note: I removed -nostats and -loglevel quiet so I could see what was going on. They don’t seem to affect the speed.)
If I remove -progressurl it becomes fast:
$ ./Plex\ Transcoder -skip_frame:v nokey -i input.mkv -threads 0 -q 3 \
-filter_complex "[0:V:0] fps=fps=0.500000:round=up,scale=w=320:h=240:force_original_aspect_ratio=decrease [out]" \
-map "[out]" img-%06d.jpg
// (output trimmed)
frame= 687 fps= 55 q=3.0 Lsize=N/A time=00:22:54.00 bitrate=N/A speed= 111x
It’s truly +100x faster.
Without -progressurl, or if I don’t set a good X_PLEX_TOKEN, or if I give a bad URL, then it is fast.
When I provide -progressurl, and a good X_PLEX_TOKEN, and a valid URL, then it becomes dramatically slower.
At first I thought the Transcoder must be doing something wrong. It sends status updates to PMS every 500ms, and PMS responds very quickly. The Transcoder is sleeping when it should be working, so I blamed it. 
Then I looked at the responses from PMS to the Transcoder, and realized the Transcoder is actually following instructions. PMS is sending this:
<MediaContainer size="0" canThrottle="1">
That canThrottle there is very interesting. I think it’s the smoking gun. Is the Transcoder obeying this instruction to throttle?
To test, I hacked up a copy of the Transcoder binary, changing every instance of “Throttle” to “Thrapple”, so it wouldn’t parse canThrottle any more.
perl -pi -e 's/Throttle/Thrapple/g' "Plex Transcoder"
That worked great manually, so I dropped it into the Plex directory and restarted Plex. It works great there, too.
Video preview thumbnail generation is super fast now. Moments vs. hours. I’ve generated more previews in the last hour than I did all last week.
I also tested with several Sync tasks. I previously ignored this feature because of how slow conversions were. They also work much more quickly with the modified Transcoder binary.
My theory is that Plex Media Server is (incorrectly) sending canThrottle="1" to the Plex Transcoder for these “background” media processing tasks. If I understand correctly, throttling the transcoder makes sense for foreground/attended/interactive/immediate transcoded playback, not background tasks.
I’ve made sure that all of my clients are configured to Direct Play, so I don’t think it will hurt anything if I leave it this way.
I’m very curious to find out if this is a Plex issue or something with my config.
thanks for doing most of the work 
But it does make progress, and it does eventually complete. I never guessed it was broken, I just didn’t use it because it was so slow.



I recognize that this is basically my issue. I’d love for that checkbox to behave differently - to only disable video transcoding during playback. And to have my cake. 