Plex Remote Transcoder - A distributed transcoding backend for Plex

@igowas said:
If you look at your system messages by using dmesg do you have a few lines like this

plex_transcoder[82410]: segfault at 0 ip 00000000005f8108 sp

No, I don’t see any messages like this.

@igowas said:
@wnielson
The next version of PMS available with a plexpass " plexmediaserver_1.0.1.2396-c094d0d_amd64.deb " doesnt work with PRT. X(

I just upgraded to plexmediaserver_1.0.1.2396-c094d0d_amd64.deb and it is working. Here are the steps:

wget https://downloads.plex.tv/plex-media-server/1.0.1.2396-c094d0d/plexmediaserver_1.0.1.2396-c094d0d_amd64.deb
sudo dpkg -i plexmediaserver_1.0.1.2396-c094d0d_amd64.deb
sudo rm /usr/lib/plexmediaserver/Resources/plex_transcoder
sudo prt install

@wnielson
Thx for you help but it doesnt work. I’ll try to figure out why. If I go back to the previous version it works

Can’t wait until this gets working again and stable, I am super excited to use it! I have a few servers laying around hardly having their cpu touched and this will come in such handy for me as my darn family of private members grows! Where do I donate to the cause at?

edit nevermind found you put up a donation link on your github, enjoy the beer money man!

@wnielson said:

@igowas said:
@wnielson
The next version of PMS available with a plexpass " plexmediaserver_1.0.1.2396-c094d0d_amd64.deb " doesnt work with PRT. X(

I just upgraded to plexmediaserver_1.0.1.2396-c094d0d_amd64.deb and it is working. Here are the steps:

wget https://downloads.plex.tv/plex-media-server/1.0.1.2396-c094d0d/plexmediaserver_1.0.1.2396-c094d0d_amd64.deb
sudo dpkg -i plexmediaserver_1.0.1.2396-c094d0d_amd64.deb
sudo rm /usr/lib/plexmediaserver/Resources/plex_transcoder
sudo prt install

Okay I dont know what was wrong but I deleted all PMS folder except the Database one and I followed your step instead of using prt overwrite and now its working like à charm !

I have a problem with the upgrade :confused: When I do a “prt install” and fill in the IP of my mainserver I only get this

root@plexbox:/var/lib/plexmediaserver# prt install Installing Plex Remote Transcoder IP address of this machine: 77.***.**.*** Renaming original transcoder Error renaming original transcoder: [Errno 2] No such file or directory root@plexbox:/var/lib/plexmediaserver#

I don’t know whats wrong. Just followed the steps by mr wnielson :slight_smile:

So I asked earlier but had not gotten a response yet. Should this be used in a virtual environment having 4 sperate VMs with 1cpu each (just an example) or a single vm with 4 cpu? Which would get the most usage out of the hardware?

@Nordicpipeline said:
I have a problem with the upgrade :confused: When I do a “prt install” and fill in the IP of my mainserver I only get this

Do you see Plex Transcoder in /usr/lib/plexmediaserver/Resources/?

@boboki said:
So I asked earlier but had not gotten a response yet. Should this be used in a virtual environment having 4 sperate VMs with 1cpu each (just an example) or a single vm with 4 cpu? Which would get the most usage out of the hardware?

I don’t have a definitive answer to that. Let’s consider the multiple VM approach first. Let’s say you have 4 VMs and 4 active transcode sessions. Each transcode session will be isolated from the other and will utilize as much of the single CPU as it needs to. In the single VM situation, all 4 transcode sessions will be “competing” against each other over the 4 CPU cores. The Plex Transcoder is capable of utilizing multiple CPU cores at the same time though, so on a 4 core machine a single transcode job should complete faster than on a single CPU core.

If it were me, I would probably go with a single VM with all of the cores. Down the road you can always add another machine to the pool.

Has anyone gotten the ssh key authentication working via openSUSE yet? If I keep the home directory for user plex set to /home/plex then the key works just fine. If I change it to point to the mounted share at /var/lib/plexmediaserver, even if I copy over the exact same authorized_key file to that .ssh directory, the ssh session fails and asks for a password. I verified the permissions on the directory and the files were the same as well, and have done most the normal troubleshooting to make sure it is not sshd config (which like I said if I change the plex home dir to /home/plex it works perfectly), so I just do not understand what the issue is.

Here is the output when using the /var/lib/plexmedia as my homedir:
debug1: Offering RSA public key: /var/lib/plexmediaserver/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Authentications that can continue: publickey,keyboard-interactive debug2: we did not send a packet, disable method debug3: authmethod_lookup keyboard-interactive debug3: remaining preferred: password

And here it is with the home dir set to /home/plex (again same auth key is being used, I copied it over)
debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: /var/lib/plexmediaserver/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Server accepts key: pkalg ssh-rsa blen 279

Of course, you cannot have the home dir for plex set to /home/plex as then the entire process fails to spawn any of the plex transcoders and all that good stuff. Feedback is greatly appreciated. (makes me wonder if I should have just stuck to debian :frowning: )

@boboki said:
So I asked earlier but had not gotten a response yet. Should this be used in a virtual environment having 4 sperate VMs with 1cpu each (just an example) or a single vm with 4 cpu? Which would get the most usage out of the hardware?

I agree with @wnielson , apart from his reason from a pure system perspective it’s always more economical to have 1 virtual system with 4 cores rather than 4 systems with 1 core each as you have the overhead of each operating system running so 3 lots of wastage plus running an OS and app off 1 core isn’t very efficient.

@boboki said:
Has anyone gotten the ssh key authentication working via openSUSE yet? If I keep the home directory for user plex set to /home/plex then the key works just fine. If I change it to point to the mounted share at /var/lib/plexmediaserver, even if I copy over the exact same authorized_key file to that .ssh directory, the ssh session fails and asks for a password. I verified the permissions on the directory and the files were the same as well, and have done most the normal troubleshooting to make sure it is not sshd config (which like I said if I change the plex home dir to /home/plex it works perfectly), so I just do not understand what the issue is.

Here is the output when using the /var/lib/plexmedia as my homedir:
debug1: Offering RSA public key: /var/lib/plexmediaserver/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Authentications that can continue: publickey,keyboard-interactive debug2: we did not send a packet, disable method debug3: authmethod_lookup keyboard-interactive debug3: remaining preferred: password

And here it is with the home dir set to /home/plex (again same auth key is being used, I copied it over)
debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: /var/lib/plexmediaserver/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Server accepts key: pkalg ssh-rsa blen 279

Of course, you cannot have the home dir for plex set to /home/plex as then the entire process fails to spawn any of the plex transcoders and all that good stuff. Feedback is greatly appreciated. (makes me wonder if I should have just stuck to debian :frowning: )

I suspect this isn’t anything to do with the flavor of Linux but more a big standard ssh key issue around the permissions of the home directory, the .ssh directory and the files.

Have a look here under troubleshooting : SSH/OpenSSH/Keys - Community Help Wiki

While using Linux in the true spirit of it means you can run whatever flavor/version you like I’d suggest if you’re struggling to go with the one suggested in the PRT guide that way you’ll have all the answers in front of you to help you get it running quickly. Just a suggestion :slight_smile:

@boboki said:
Has anyone gotten the ssh key authentication working via openSUSE yet?

I agree with @liviy that it is likely a permissions/ownership issue.

Unfortunately SUSE is a little different than most flavors of linux, it uses the YaST system and systemd for most of it’s apps. Things like adduser do not exist, it’s useradd, etc.

That said I think I found the issue and I now have ssh working. I ended up having to turn off strictmode, for whatever reason even though the permissions were correct (groups, chowns, chmods, exactly like the /home/plex) the sshd still hated it. The link was appreciated as it pointed me to the sshd journalctl to view the logs (yet again different in suse).

I cannot do a prt sessions unfortunately as pip errors when trying to install psutils for some reason… but when I try to play a movie it waits for a moment, then says there was a problem playing this item. I looked in the plex logs (Plex Media Server.log) and can see the play starting, but no further error messages seem to show up. I very quickly see a ssh session start on the transcoder box, then go away, no clue if it is actually doing anything as I am not sure where prt logs are? I am not a super linux buff (deal mostly in VMware and wintel) but can very competently provide any info needed and take direction quite well if anyone has any suggestions for me, or at least point me where to start.

Test Plex box - Ubuntu 14.04.4 LTS (192.168.0.160)
Test Transcoder box - opensuse leap 42.1 (192.168.0.250)

(and if you think I should reload the transcode box to a different version to guarantee app version cohesion, just tell me what ver and it’s done.)

edit Found the prt log. It does not seem to give me a lot of info unfortunately. Here is the last transcode I tried:

2016-07-21 18:14:19,856 - prt - INFO - Host with minimum load is '192.168.0.250'
2016-07-21 18:14:19,860 - prt - INFO - Using transcode host '192.168.0.250'
2016-07-21 18:14:19,862 - prt - INFO - Launching transcode_remote with args ['ssh', u'plex@192.168.0.250', '-p', u'22', u"export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support;export PLEX_MEDIA_SERVER_MAX_STACK_SIZE=3000;export XDG_CACHE_HOME=/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/;export OLDPWD=/;export PLEX_MEDIA_SERVER_USER=plex;export TERM=linux;export X_PLEX_TOKEN=;export PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver;export UPSTART_INSTANCE=;export PWD=/usr/lib/plexmediaserver;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/bin:/usr/sbin:/sbin:/bin;export UPSTART_JOB=plexmediaserver;export HOME=/var/lib/plexmediaserver;export XDG_DATA_HOME=/usr/lib/plexmediaserver/Resources/;export PLEX_MEDIA_SERVER_TMPDIR=/tmp;export LD_LIBRARY_PATH=/usr/lib/plexmediaserver;export TMPDIR=/tmp;export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6;export PRT_ID=784b7f224f9011e6bb7d005056bf0d20;cd /opt/plex/tmp/plex-transcode-7gu53i3tffsdfy8iwqpuys0pb9-5d048cba-9034-4c14-8890-2ce95d9f902e;prt_local -codec:0 h264 -codec:1 ac3 -i '/mnt/Media/Requests/Movies - Requests/Brotherhood.Of.The.Wolf.2001.1080p.BluRay.x264-FLHD/Brotherhood of the Wolf.mkv' -map_inlineass 0:2 -filter_complex '[0:0]scale=w=min(1280\\,iw):h=min(550\\,ih):force_original_aspect_ratio=decrease,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 19 -pix_fmt:0 yuv420p -maxrate:0 2000k -bufsize:0 4000k -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 -b:1 579k -f matroska -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 - -map 0:2 -f null -codec copy nullfile -start_at_zero -copyts -y -nostats -loglevel quiet -loglevel_plex error -progressurl http://:32400/video/:/transcode/session/7gu53i3tffsdfy8iwqpuys0pb9/progress"]

2016-07-21 18:14:20,110 - prt - INFO - Transcode stopped on host '192.168.0.250'

@boboki said:
I looked in the plex logs (Plex Media Server.log) and can see the play starting, but no further error messages seem to show up. I very quickly see a ssh session start on the transcoder box, then go away, no clue if it is actually doing anything as I am not sure where prt logs are?

By default the logs are in /tmp/prt.log.

I posted my prt logs in the post above in an edit. No clue where to go from here, and I just noticed a new version of PMS is out too (have not updated to it yet).

@boboki said:
I posted my prt logs in the post above in an edit. No clue where to go from here, and I just noticed a new version of PMS is out too (have not updated to it yet).

How about the logs from the transcode host 192.168.0.250? (Also, if you surround your logs in triple back ticks ``` they will be easier for us to read)

The transcode box does not seem to have any prt.log in the /tmp dir at all. I did a ls -R | grep prt.log from / and it also did not find any file.

Thanks for tip on the ‘’’ I will do so… went back and edited the above culprit with ``` so should be good now.

@boboki said:
The transcode box does not seem to have any prt.log in the /tmp dir at all. I did a ls -R | grep prt.log from / and it also did not find any file.

Alright, then what you can do is copy the command above (starting from export PLEX... to /progress) and run it manually, as the Plex user, on your transcode box.

Oh, and you should also edit sensitive bits out of your log files before posting as well.

I am in no way at all concerned with the internal ips, this is a quick sandbox environment that once I get functional I will then rebuild in my production. All IPs, data, servernames, etc will all change after I go prod.

Here is the feedback from bash after running the export which did require me to run it in quotes ".

bash: export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support;export PLEX_MEDIA_SERVER_MAX_STACK_SIZE=3000;export XDG_CACHE_HOME=/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/;export OLDPWD=/;export PLEX_MEDIA_SERVER_USER=plex;export TERM=linux;export X_PLEX_TOKEN=;export PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver;export UPSTART_INSTANCE=;export PWD=/usr/lib/plexmediaserver;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/bin:/usr/sbin:/sbin:/bin;export UPSTART_JOB=plexmediaserver;export HOME=/var/lib/plexmediaserver;export XDG_DATA_HOME=/usr/lib/plexmediaserver/Resources/;export PLEX_MEDIA_SERVER_TMPDIR=/tmp;export LD_LIBRARY_PATH=/usr/lib/plexmediaserver;export TMPDIR=/tmp;export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6;export PRT_ID=784b7f224f9011e6bb7d005056bf0d20;cd /opt/plex/tmp/plex-transcode-7gu53i3tffsdfy8iwqpuys0pb9-5d048cba-9034-4c14-8890-2ce95d9f902e;prt_local -codec:0 h264 -codec:1 ac3 -i '/mnt/Media/Requests/Movies - Requests/Brotherhood.Of.The.Wolf.2001.1080p.BluRay.x264-FLHD/Brotherhood of the Wolf.mkv' -map_inlineass 0:2 -filter_complex '[0:0]scale=w=min(1280\,iw):h=min(550\,ih):force_original_aspect_ratio=decrease,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 19 -pix_fmt:0 yuv420p -maxrate:0 2000k -bufsize:0 4000k -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 -b:1 579k -f matroska -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 - -map 0:2 -f null -codec copy nullfile -start_at_zero -copyts -y -nostats -loglevel quiet -loglevel_plex error -progressurl http://:32400/video/:/transcode/session/7gu53i3tffsdfy8iwqpuys0pb9/progress: No such file or directory

Looking at that it looks like the first PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR might not be correct, as it either should be in ’ or should look more like “/var/lib/plexmediaserver/Library/Application\ Support/” correct?