Transcoder is slowing down the machine and slow buffering

I am running Plex on Linux.
There is pretty much nothing on there but Plex

Everytime I see a movie/show, the system becomes extremelty show and I see tha the transcoder is taking the 4CPUs at 100

Here is the output of lspcu

Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 60
Model name: Intel® Core™ i5-4690 CPU @ 3.50GHz
Stepping: 3
CPU MHz: 1079.121
BogoMIPS: 6999.96
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 6144K
NUMA node0 CPU(s): 0-3

Below is the a ps -ef | grep plex when idle
plex 2662 1 1 01:46 ? 00:00:06 /usr/lib/plexmediaserver/Plex Media Server
plex 2673 2662 0 01:46 ? 00:00:02 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-04b80c8/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.4.0.3173-04b80c8 /usr/lib/plexmediaserver/Resources/Plug-ins-04b80c8/System.bundle
plex 2732 2662 0 01:46 ? 00:00:00 /usr/lib/plexmediaserver/Plex DLNA Server
plex 2885 2662 0 01:46 ? 00:00:00 Plex Plug-in [com.plexapp.agents.opensubtitles] /usr/lib/plexmediaserver/Resources/Plug-ins-04b80c8/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.4.0.3173-04b80c8 /usr/lib/plexmediaserver/Resources/Plug-ins-04b80c8/OpenSubtitles.bundle
plex 2945 2662 0 01:46 ? 00:00:00 Plex Plug-in [com.plexapp.agents.plexthememusic] /usr/lib/plexmediaserver/Resources/Plug-ins-04b80c8/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.4.0.3173-04b80c8 /usr/lib/plexmediaserver/Resources/Plug-ins-04b80c8/PlexThemeMusic.bundle
plex 2982 2662 0 01:46 ? 00:00:00 Plex Plug-in [com.plexapp.agents.themoviedb] /usr/lib/plexmediaserver/Resources/Plug-ins-04b80c8/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.4.0.3173-04b80c8 /usr/lib/plexmediaserver/Resources/Plug-ins-04b80c8/TheMovieDB.bundle
plex 3002 2662 0 01:46 ? 00:00:00 Plex Plug-in [com.plexapp.agents.plexmusic] /usr/lib/plexmediaserver/Resources/Plug-ins-04b80c8/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.4.0.3173-04b80c8 /usr/lib/plexmediaserver/Resources/Plug-ins-04b80c8/PlexMusic.bundle
plex 3004 2662 0 01:46 ? 00:00:00 Plex Plug-in [com.plexapp.agents.thetvdb] /usr/lib/plexmediaserver/Resources/Plug-ins-04b80c8/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.4.0.3173-04b80c8 /usr/lib/plexmediaserver/Resources/Plug-ins-04b80c8/TheTVDB.bundle
plex 3049 2662 0 01:46 ? 00:00:01 Plex Plug-in [com.plexapp.agents.imdb] /usr/lib/plexmediaserver/Resources/Plug-ins-04b80c8/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.4.0.3173-04b80c8 /usr/lib/plexmediaserver/Resources/Plug-ins-04b80c8/PlexMovie.bundle
plex 3298 2662 59 01:51 ? 00:01:42 /usr/lib/plexmediaserver/Plex Transcoder -codec:0 h264 -codec:1 ac3 -ss 2397.30103 -i http://127.0.0.1:32400/library/parts/1364/1332538313/file.mkv?X-Plex-Token=ghg8vddx2XRQ8JiXM3q6 -ss 2397.30103 -i /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Transcode/Sessions/plex-transcode-imsni1z10v2dwz2mz8flayvi-6ee572f4-9e58-43b3-8b49-d765f175ca55/temp-0.srt -map_inlineass 1:s:0 -filter_complex [0:0]scale=w=min(1280,iw):h=min(544,ih):force_original_aspect_ratio=decrease,format=pix_fmts=yuv420p|nv12,inlineass=font_scale=1.000000:font_path=/usr/lib/plexmediaserver/Resources/Fonts/DejaVuSans-Regular.ttf:fontconfig_file=/usr/lib/plexmediaserver/Resources/fonts.conf[0] -map [0] -metadata:s:0 language=fre -codec:0 libx264 -crf:0 16 -maxrate:0 5214k -bufsize:0 10428k -r:0 23.975999999999999 -preset:0 veryfast -x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -map 0:1 -metadata:s:1 language=fre -codec:1 aac -ar:1 48000 -channel_layout:1 5.1 -strict:1 experimental -aac_coder:1 fast -q:1 0 -f matroska -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 - -map 1:s:0 -f null -codec copy nullfile -start_at_zero -copyts -y -nostats -loglevel quiet -loglevel_plex error -progressurl http://127.0.0.1:32400/video/:/transcode/session/imsni1z10v2dwz2mz8flayvi/progress

Any pointers

Plex Media Server log files would help a lot to determine what you have going on here. I’m going to guess the problem has to do with subtitles, though… (Based on what little information you have provided, that is.)

It looks like you are putting French subtitles into the stream? If so, then you are probably using some bitmapped type of subtitles. Some of those are much more CPU intensive than any other format. Even if the CPU would normally be considered more than adequate, they can be reduced to a crawl if the subtitles need to be transcoded into the video stream.

Sidecar SRT subs can be sent along side the audio and video stream and put onto the video by many of Plex’s client apps now. This would eliminate a LOT of transcoding. There are scripts that can be run to convert bitmapped subs to srt’s. Then the server just needs to send them long side, and you can get the benefits of subs as well as your media. And your server’s CPU isn’t going to hurt as badly as it appears to be here.

So first suggestion is to try the file without the subs, to see what happens to the CPU. then try again with the subs and again look at CPU. If there is a drastic difference, then you found the problem.

Also, when in doubt, start a playback session which recreates the issue; let it run a few seconds; stop it and start another which doesn’t have the problem; stop it and then collect the logs from Settings / Server / Help / Download Logs and attach the ZIP file here. We’ll gladly take a look at it.

I deleted the logs and restarted and see a bunch of

It looks like a problem with MythTV?

Plex Media Server.log:Jan 19, 2017 19:41:48.251 [0x7fbf5f7ff700] ERROR - [PlexRelay] kex protocol error: type 7 seq 11
Plex Media Server.log:Jan 19, 2017 19:41:50.171 [0x7fbf687ff700] ERROR - JobManager: child process killed by signal: 9 (Killed)
Plex Media Server.log:Jan 19, 2017 19:43:46.293 [0x7fbf687ff700] ERROR - JobManager: child process killed by signal: 9 (Killed)
Plex Media Server.log:Jan 19, 2017 19:43:46.522 [0x7fbf6affe700] ERROR - handle_stream_read error 32 Broken pipe
Plex Media Server.log:Jan 19, 2017 19:44:44.924 [0x7fbf6a7fd700] ERROR - Couldn’t copy file /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.1.log to /tmp/tempLogs660a34bb-db14-461a-84b7-8cdbdd5b97b1/Plex Media Server.1.log: boost::filesystem::copy: Function not implemented: “/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.1.log”, “/tmp/tempLogs660a34bb-db14-461a-84b7-8cdbdd5b97b1/Plex Media Server.1.log”
Plex Media Server.log:Jan 19, 2017 19:44:44.924 [0x7fbf6a7fd700] ERROR - Couldn’t copy file /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.2.log to /tmp/tempLogs660a34bb-db14-461a-84b7-8cdbdd5b97b1/Plex Media Server.2.log: boost::filesystem::copy: Function not implemented: “/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.2.log”, “/tmp/tempLogs660a34bb-db14-461a-84b7-8cdbdd5b97b1/Plex Media Server.2.log”
Plex Media Server.log:Jan 19, 2017 19:44:44.924 [0x7fbf6a7fd700] ERROR - Couldn’t copy file /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.3.log to /tmp/tempLogs660a34bb-db14-461a-84b7-8cdbdd5b97b1/Plex Media Server.3.log: boost::filesystem::copy: Function not implemented: “/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.3.log”, “/tmp/tempLogs660a34bb-db14-461a-84b7-8cdbdd5b97b1/Plex Media Server.3.log”
Plex Media Server.log:Jan 19, 2017 19:44:44.924 [0x7fbf6a7fd700] ERROR - Couldn’t copy file /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.4.log to /tmp/tempLogs660a34bb-db14-461a-84b7-8cdbdd5b97b1/Plex Media Server.4.log: boost::filesystem::copy: Function not implemented: “/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.4.log”, “/tmp/tempLogs660a34bb-db14-461a-84b7-8cdbdd5b97b1/Plex Media Server.4.log”
Plex Media Server.log:Jan 19, 2017 19:44:44.924 [0x7fbf6a7fd700] ERROR - Couldn’t copy file /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.5.log to /tmp/tempLogs660a34bb-db14-461a-84b7-8cdbdd5b97b1/Plex Media Server.5.log: boost::filesystem::copy: Function not implemented: “/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.5.log”, “/tmp/tempLogs660a34bb-db14-461a-84b7-8cdbdd5b97b1/Plex Media Server.5.log”
Plex Media Server.log:Jan 19, 2017 19:44:44.924 [0x7fbf6a7fd700] ERROR - Couldn’t copy file /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Scanner.log to /tmp/tempLogs660a34bb-db14-461a-84b7-8cdbdd5b97b1/Plex Media Scanner.log: boost::filesystem::copy: Function not implemented: "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex M

@ChuckPa said:
Also, when in doubt, start a playback session which recreates the issue; let it run a few seconds; stop it and start another which doesn’t have the problem; stop it and then collect the logs from Settings / Server / Help / Download Logs and attach the ZIP file here. We’ll gladly take a look at it.

It looks like a MythTV issue…
Where do you want me to drop the logs ?

Attach the logs here. settings - server - help - download logs will give you a nice complete ZIP file to attach with your post

Edit: If it’s MythTV, there’s really nothing I can do there.

Here you go

Did you delete all the other log files? I normally expect to see the previous rotation logs and the agent logs.

Also, for future reference, there is no need to use VERBOSE logging (Settings - Server - General) unless specifically requested. Verbose causes so much extra output that logs tend to ‘roll off’ and data needed is often lost.

In checking the CPU performance of the transcoder. The lowest speed rating it has is 22.7 (22.7 times faster than real time… aka 22.7 seconds of video per 1 second of elapsed transcoding). It’s not slowing down your CPU. It is making good use of it.

If you have other tasks, then yes, this will impact them as transcoding makes high demand on 2-3 threads (cores). Typically 2 cores will take a full 100% ‘hit’ while it fills the transcoder output buffer, which I do see happening (it goes to sleep when done until needed again as it should).

You have Myth and Plex on the machine. What is Myth doing? Is is capturing at the same time? It too does transcoding as it records (depending on settings). Two transcode sessions on an I5-class is noticeable.

Please further define what you mean by ‘slow buffering’. Do you refer to the time it takes the video to start playing from the time you press Play (the time you watch it filling the player’s buffers) ? Are you using subtitles? May I see the XML (Get Info -> Show XML … use ‘code’ paragraph formatting at top of the reply window so the forum doesn’t ‘eat’ the XML)?

Thanks for taking the time and helping me on this, please see my response below

Did you delete all the other log files? I normally expect to see the previous rotation logs and the agent logs.
I did and you are correct, I don’t see the error anymore

If you have other tasks, then yes, this will impact them as transcoding makes high demand on 2-3 threads (cores). Typically 2 cores will take a full 100% 'hit
This computer has just running Plex and sonaar. There is really nothing else.

You have Myth and Plex on the machine. What is Myth doing?
I googled and it look like Myth is now bundle with Plex(I could be totally wrong), that why I mentionned Myth before.

Please further define what you mean by 'slow buffering
If I play any movies, with or without subtitle, it will play for 5second and then stop for another second which makes the movie impossible to watch

Myth is not bundled with Plex. MythTV is a totally different piece of software.

If you are part of the DVR beta / running the DVR beta binaries, then Yes you are seeing the DVR functions like what MythTV provides. I used to use Myth until coming to Plex. Now, myth is long gone.

If you’re not using a DVR functionality, I would highly recommend running normal PMS (current is 1.3.3)

When DVR runs, it is my understanding, PMS will transcode inbound as it needs for storing. If you’re also performing transcoding at the same time, you will see the extra load of two transcode tasks on the CPU. DVR activities will not be reflected in the PMS log files. PMS DVR and PMS 1.3.3 are currently two different development efforts. At some point in the near future, Engineering will merge DVR into the normal PMS mains and it will be fully integrated. I personally am waiting to see how that turns out and will have a lot to learn. (my hands are sufficiently busy here for now :slight_smile: ).

So I installed plexmediaserver.x86_64 0:1.3.3.3148-b38628e, i still experience the same slowness :frowning:

Please do a “Get Info” and then “Show XML” for one of (or the) items which are slow. What you are describing should not be this way so there’s something we’re not seeing yet.

Here is the last set of logs.
I deleted them all and start Plex and play the video

The content is too long

I have put it on here
http://pastebin.com/F5kQrKPh

Thank you for that.

Please look at the XML. Do you see the subtitles? VOBSUB. These are very CPU-expensive. If you need to display subtitles and PMS has to put them with the image, it has to ‘burn-in’ those because they are bitmap graphics. SRT subtitles are text and much easier to deal with.

This is why we’re seeing your CPU run at 500x real time and then drop to 20x and then sleep, then shoot up again. It’s dealing with subtitles.

Are those subtitles required? An option is to use some of the 3rd party programs to convert them to text. It will take a huge load off your CPU.

Does just remove all of .sub helps or there is an extra step? ?
I am not even using the subtitles!

let’s do this:

  1. get mkvtoolnix ( mkvmerge and mkvmerge-gui)
  2. make a copy of the original file away from PMS for safe keeping
  3. open the file, in the gui and ‘remux’ the file, but do not keep the subtitle tracks.
  4. replace the in-place file with the one without subtitles.
  5. Play that and see what happens. It will be flawless if subtitles are kicking in

Sadly it still not working :frowning:

Here is the info XML http://pastebin.com/QxCiUt7v

I removed the subtitle doing it like this

mkvmerge -o XXXXX1.mkv --no-subtitles XXXXX.mkv

the SRT subtitle is still there.

<Stream id="32195" key="/library/streams/32195" streamType="3" selected="1" codec="srt" language="English" languageCode="eng"/>

what is this playing to?

Suggestion: Do it in the GUI… much easier to uncheck what you don’t want.