Plex Remote Transcoder - A distributed transcoding backend for Plex

@boboki said:
What top program are you using in the pictures at Improvements & Additional Features · wnielson/Plex-Remote-Transcoder Wiki · GitHub ? I really like it.

edit ahh it is htop, awesome, one more tool for my abuse :wink: I now have three transcoders rolling and it seems all is working pretty well.

# htop -u plex

Yeah I figured it out, but thanks for the full command to make it all clean and pretty. Greatly appreciate it :wink:
Anyone test prt with the new 1.0.3.2461?

@boboki said:
Yeah I figured it out, but thanks for the full command to make it all clean and pretty. Greatly appreciate it :wink:
Anyone test prt with the new 1.0.3.2461?

I didnt yet but the new release doest have any transcorder changes so you can do the upgrade without affecting PRT.

Ok, went ahead and installed it and did a prt overwrite, all is working well still :slight_smile:

Question: I have a Mac which is running pms. I have another plex server running on a NAS. Could I install prt in parallel to the pms server on the Mac ?

@spanishu said:
Question: I have a Mac which is running pms. I have another plex server running on a NAS. Could I install prt in parallel to the pms server on the Mac ?

This setup likely wouldn’t work out of the box as we haven’t really done any work on supporting anything other than Ubuntu. The big difference between these platforms are the huge variation in where Plex expects certain files to be.

The configuration needed to get PRT working between two machines running the same OS is hard enough that most people have issues at first. I’d really like to simplify the setup process before addressing complex, multiplatform configurations.

That said, we’re always looking for people to help and pull requests are always appreciated!

@wnielson said:

@spanishu said:
Question: I have a Mac which is running pms. I have another plex server running on a NAS. Could I install prt in parallel to the pms server on the Mac ?

This setup likely wouldn’t work out of the box as we haven’t really done any work on supporting anything other than Ubuntu. The big difference between these platforms are the huge variation in where Plex expects certain files to be.

The configuration needed to get PRT working between two machines running the same OS is hard enough that most people have issues at first. I’d really like to simplify the setup process before addressing complex, multiplatform configurations.

That said, we’re always looking for people to help and pull requests are always appreciated!

Hi I wished I could really help here. My Coding knowledge is closer to 0 than to anything else, was just a thought. Maybe for a future release it could be interesting to think of the remote transcoder as either a standalone program which could be also names as such plex_remote_transcoder so it would not conflict with the standard transcoder on a machine. Looking forward to the future developments!

@wnielson . Hello. I just installed this and the install was flawless, but my transcoder won’t start and I can’t play anything. The temp directory (/opt/plex) is owned by the plex user on the master and slave so I don’t understand what is happening. Any ideas??

Thank you.

@xl3b4n0nx said:
@wnielson . Hello. I just installed this and the install was flawless, but my transcoder won’t start and I can’t play anything. The temp directory (/opt/plex) is owned by the plex user on the master and slave so I don’t understand what is happening. Any ideas??

First, check the logs. The PRT logs are in /tmp/prt.log and the Plex logs are /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Logs/Plex\ Media\ Server.log (if you’re on Linux). Second, verify that you can ssh as the plex user from the master to the slave without having to enter a password.

I forgot to post the log output.

2016-08-09 21:30:51,032 - prt - INFO - Transcode stopped on host ‘192.168.0.205’
2016-08-09 21:31:53,137 - prt - INFO - Host with minimum load is ‘192.168.0.205’
2016-08-09 21:31:53,137 - prt - INFO - Using transcode host ‘192.168.0.205’
2016-08-09 21:31:53,138 - prt - INFO - Launching transcode_remote with args [‘ssh’, u’plex@192.168.0.205’, ‘-p’, u’22’, u’export LANG=en_US.UTF-8;export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support;export SHELL=/bin/bash;export XDG_DATA_HOME=/usr/lib/plexmediaserver/Resources/;export XDG_CACHE_HOME=/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/;export X_PLEX_TOKEN=1HjpRCeyTpMsvvDAqxcf;export PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver;export PWD=/;export LOGNAME=plex;export USER=plex;export FFMPEG_EXTERNAL_LIBS=/var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Codecs/ecd8c57-1099-linux-ubuntu-x86_64/;export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin;export HOME=/var/lib/plexmediaserver;export PLEX_MEDIA_SERVER_TMPDIR=/tmp;export LD_LIBRARY_PATH=/usr/lib/plexmediaserver;export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6;export PRT_ID=36ec426e5e9a11e68eee50b7c3708c10;cd /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Transcode/Sessions/plex-transcode-jjmt0f2h7rjgd8b37hj7l23xr-23ea0f82-2280-4472-85c1-b73189929a13;prt_local -codec:0 mpeg4 -i ‘/media/zack/Zack(Home)/TV Shows/Hogan’"’"‘s Heroes/Hogan’"’"‘s Heroes Season 6/Hogan’"’"‘s Heroes S06E05 - Lady Chitterly’"’"‘s Lover Part 2.avi’ -filter_complex ‘[0:0]scale=w=min(640\,iw):h=min(480\,ih):force_original_aspect_ratio=decrease[0]’ -map ‘[0]’ -codec:0 libx264 -crf:0 16 -pix_fmt:0 yuv420p -maxrate:0 1278k -bufsize:0 2556k -r:0 23.975999999999999 -preset:0 veryfast -x264opts:0 subme=2:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -map ‘0:#0x01’ -codec:1 copy -copypriorss:1 0 -f matroska -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 - -start_at_zero -copyts -y -nostats -loglevel quiet -loglevel_plex error -progressurl http://192.168.0.200:32400/video/:/transcode/session/jjmt0f2h7rjgd8b37hj7l23xr/progress’]

2016-08-09 21:31:54,363 - prt - INFO - Transcode stopped on host ‘192.168.0.205’

@xl3b4n0nx said:
I forgot to post the log output.

Also check the log on the slave.

Here is the slave’s log.

2016-08-09 21:41:43,574 - prt - INFO - Launching transcode_local: [’/usr/lib/plexmediaserver/Resources/plex_transcoder’, ‘-codec:0’, ‘mpeg4’, ‘-i’, “/media/zack/Zack(Home)/TV Shows/Hogan’s Heroes/Hogan’s Heroes Season 6/Hogan’s Heroes S06E05 - Lady Chitterly’s Lover Part 2.avi”, ‘-filter_complex’, ‘[0:0]scale=w=min(640\,iw):h=min(480\,ih):force_original_aspect_ratio=decrease[0]’, ‘-map’, ‘[0]’, ‘-codec:0’, ‘libx264’, ‘-crf:0’, ‘16’, ‘-pix_fmt:0’, ‘yuv420p’, ‘-maxrate:0’, ‘1278k’, ‘-bufsize:0’, ‘2556k’, ‘-r:0’, ‘23.975999999999999’, ‘-preset:0’, ‘veryfast’, ‘-x264opts:0’, ‘subme=2:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none’, ‘-map’, ‘0:#0x01’, ‘-codec:1’, ‘copy’, ‘-copypriorss:1’, ‘0’, ‘-f’, ‘matroska’, ‘-avoid_negative_ts’, ‘disabled’, ‘-map_metadata’, ‘-1’, ‘-map_chapters’, ‘-1’, ‘-’, ‘-start_at_zero’, ‘-copyts’, ‘-y’, ‘-nostats’, ‘-loglevel’, ‘quiet’, ‘-loglevel_plex’, ‘error’, ‘-progressurl’, ‘http://192.168.0.200:32400/video/:/transcode/session/fagx7j2u9gdegaibtv3aowp14i/progress’]

We are seeing an uptick in people experiencing issues like this and we haven’t been able to pinpoint what the issue is. I’ll put together a utility for debugging. Stay tuned.

Ok thank you. I am on Ubuntu 16.04 if that helps. Let me know if you need anymore information.

@xl3b4n0nx said:
Ok thank you. I am on Ubuntu 16.04 if that helps. Let me know if you need anymore information.

I just pushed a new version. Can you pull the latest version and install it?

sudo python setup.py install
sudo prt overwrite

Hello,

Sorry that it has been a while. I just tried your latest update and it didn’t work. Here is the log on the master.

2016-08-16 22:47:38,324 - prt - INFO - Host with minimum load is ‘192.168.0.205’
2016-08-16 22:47:38,324 - prt - INFO - Using transcode host ‘192.168.0.205’
2016-08-16 22:47:38,325 - prt - INFO - Launching transcode_remote with args [‘ssh’, u’plex@192.168.0.205’, ‘-p’, u’22’, u’export LANG=en_US.UTF-8;export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support;export SHELL=/bin/bash;export XDG_DATA_HOME=/usr/lib/plexmediaserver/Resources/;export XDG_CACHE_HOME=/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/;export X_PLEX_TOKEN=1HjpRCeyTpMsvvDAqxcf;export PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver;export PWD=/;export LOGNAME=plex;export USER=plex;export FFMPEG_EXTERNAL_LIBS=/var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Codecs/ecd8c57-1099-linux-ubuntu-x86_64/;export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin;export HOME=/var/lib/plexmediaserver;export PLEX_MEDIA_SERVER_TMPDIR=/tmp;export LD_LIBRARY_PATH=/usr/lib/plexmediaserver;export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6;export PRT_ID=f523301e642411e6ad0f50b7c3708c10;cd /opt/plex/tmp/plex-transcode-ujnbd3adp5nwvplsf07ctyb9-ca54fecd-0e79-4087-98da-5ac9d5a4eb9b;prt_local -codec:0 mpeg4 -ss 1313.77698 -i ‘/media/zack/Zack(Home)/TV Shows/Hogan’"’"‘s Heroes/Hogan’"’"‘s Heroes Season 1/Hogan’"’"‘s Heroes S01E07 - German Bridge Is Falling Down.avi’ -filter_complex ‘[0:0]scale=w=min(608\,iw):h=min(448\,ih):force_original_aspect_ratio=decrease[0]’ -map ‘[0]’ -codec:0 libx264 -crf:0 16 -pix_fmt:0 yuv420p -maxrate:0 2260k -bufsize:0 4520k -r:0 23.975999999999999 -preset:0 veryfast -x264opts:0 subme=2:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -map ‘0:#0x01’ -codec:1 copy -copypriorss:1 0 -f matroska -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 - -start_at_zero -copyts -y -nostats -loglevel quiet -loglevel_plex error -progressurl http://192.168.0.200:32400/video/:/transcode/session/ujnbd3adp5nwvplsf07ctyb9/progress’]

2016-08-16 22:47:39,150 - prt - INFO - Transcode stopped on host ‘192.168.0.205’

And the log on the slave.

2016-08-16 22:47:38,998 - prt - INFO - Launching transcode_local: [’/usr/lib/plexmediaserver/Resources/plex_transcoder’, ‘-codec:0’, ‘mpeg4’, ‘-ss’, ‘1313.77698’, ‘-i’, “/media/zack/Zack(Home)/TV Shows/Hogan’s Heroes/Hogan’s Heroes Season 1/Hogan’s Heroes S01E07 - German Bridge Is Falling Down.avi”, ‘-filter_complex’, ‘[0:0]scale=w=min(608\,iw):h=min(448\,ih):force_original_aspect_ratio=decrease[0]’, ‘-map’, ‘[0]’, ‘-codec:0’, ‘libx264’, ‘-crf:0’, ‘16’, ‘-pix_fmt:0’, ‘yuv420p’, ‘-maxrate:0’, ‘2260k’, ‘-bufsize:0’, ‘4520k’, ‘-r:0’, ‘23.975999999999999’, ‘-preset:0’, ‘veryfast’, ‘-x264opts:0’, ‘subme=2:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none’, ‘-map’, ‘0:#0x01’, ‘-codec:1’, ‘copy’, ‘-copypriorss:1’, ‘0’, ‘-f’, ‘matroska’, ‘-avoid_negative_ts’, ‘disabled’, ‘-map_metadata’, ‘-1’, ‘-map_chapters’, ‘-1’, ‘-’, ‘-start_at_zero’, ‘-copyts’, ‘-y’, ‘-nostats’, ‘-loglevel’, ‘quiet’, ‘-loglevel_plex’, ‘error’, ‘-progressurl’, ‘http://192.168.0.200:32400/video/:/transcode/session/ujnbd3adp5nwvplsf07ctyb9/progress’]

Thank you.

@xl3b4n0nx What do you get when you run the following on the transcode machine?

mkdir /opt/plex/tmp/plex-transcode-ujnbd3adp5nwvplsf07ctyb9-ca54fecd-0e79-4087-98da-5ac9d5a4eb9b

export LANG=en_US.UTF-8;export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR='/var/lib/plexmediaserver/Library/Application Support';export SHELL=/bin/bash;export XDG_DATA_HOME=/usr/lib/plexmediaserver/Resources/;export XDG_CACHE_HOME='/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/';export X_PLEX_TOKEN=1HjpRCeyTpMsvvDAqxcf;export PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver;export PWD=/;export LOGNAME=plex;export USER=plex;export FFMPEG_EXTERNAL_LIBS='/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Codecs/ecd8c57-1099-linux-ubuntu-x86_64/';export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin;export HOME=/var/lib/plexmediaserver;export PLEX_MEDIA_SERVER_TMPDIR=/tmp;export LD_LIBRARY_PATH=/usr/lib/plexmediaserver;export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6;export PRT_ID=f523301e642411e6ad0f50b7c3708c10

cd /opt/plex/tmp/plex-transcode-ujnbd3adp5nwvplsf07ctyb9-ca54fecd-0e79-4087-98da-5ac9d5a4eb9b

prt_local -codec:0 mpeg4 -ss 1313.77698 -i "/media/zack/Zack(Home)/TV Shows/Hogan's Heroes/Hogan's Heroes Season 1/Hogan's Heroes S01E07 - German Bridge Is Falling Down.avi" -filter_complex '[0:0]scale=w=min(608\,iw):h=min(448\,ih):force_original_aspect_ratio=decrease[0]' -map '[0]' -codec:0 libx264 -crf:0 16 -pix_fmt:0 yuv420p -maxrate:0 2260k -bufsize:0 4520k -r:0 23.975999999999999 -preset:0 veryfast -x264opts:0 subme=2:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -map '0:#0x01' -codec:1 copy -copypriorss:1 0 -f matroska -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 - -start_at_zero -copyts -y -nostats -loglevel verbose -loglevel_plex verbose -progressurl http://192.168.0.200:32400/video/:/transcode/session/ujnbd3adp5nwvplsf07ctyb9/progress

@boboki said:
Ok, I am starting to have a little doubt with this being all correct. I just completely reloaded that server using Debian 8.5. Recreated everything from scratch, loaded the prt and followed the standard walkthrough… and did a transcode which failed. I copied and pasted the prt log command as we have above and I got the error message:

bash: export: `Support/Plex': not a valid identifier
bash: export: `Server/Cache/': not a valid identifier
bash: export: `Support/Plex\': not a valid identifier
bash: export: `Media\': not a valid identifier
bash: export: `Server/Codecs/ecd8c57-1099-linux-ubuntu-x86_64/': not a valid identifier
bash: cd: /opt/plex/tmp/plex-transcode-4kzym0nvydk9qy1xt7qu5zh0k9-71f960ad-a437-4b71-a797-30e06426f1ba: No such file or directory
Traceback (most recent call last):
  File "/usr/lib/plexmediaserver/Resources/plex_transcoder", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2876, in <module>
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 451, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 464, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 639, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: prt==0.3.2

There is something very obviously more going on than just a random bad install here. The same exact error messages with the export not valid identifiers are still occurring, and resource.py issues from before have carried over with a totally new OS and load. Looking forward to your next suggestions.

That error is from the \ in the path name being escaped during the handover between master and slave. I fixed that exact issue in the 0.3.5 release. So we shouldn’t see that again.

Liviy

WARNING ABOUT UPGRADING TO PMS 1.1 RELEASE
At first glance it would appear the coders of PMS have changed things AGAIN and it breaks PRT so if you’re using PRT I’d suggest you don’t upgrade until we can confirm whether it just broke PRT on my system or if it’s a common problem.

Cheers,
Liviy

@wnielson said:

@vdplex2 said:
aaand I narrowed down the issue…

anybody know how I can resolve this folder issue?

Try:

chmod 600 /var/lib/plexmediaserver/.ssh/authorized_keys

Assuming your user is named plex (as is the group), you should probably also do:

chown plex:plex /var/lib/plexmediaserver/.ssh/authorized_keys

keeps asking for the password …