frame

Welcome

Search content for your interest. If you want to get more answers or contribute, click one of the buttons below!

Sign In Register

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Fix plex media server transcoder crashing raspberry pi 3 for 9.16.6.1993

edited June 2016 in Plex

The current version 0.9.16.6 has a bug with the transcoder. In order to fix the Plex transcoder the script below replaces it with a previous working transcoder from version 0.9.14.6.xxx. Plex Web Client is also blocking transcoding automatically for ARM servers running Plex Media Server.

We are going to run the script below in order to allow transcoding using the working Plex transcoder, this should not affect the transcoding tools already installed for *.mkv types.The script also /fix overrides this behavior by modifying the web client’s javascript file to force transcoding.

Please note that there is more detailed annotation of the script and code in the purchased eBook script version as well as additional transcoder tool installation instructions, however the code below should function.

Login with PuTTY as user root.
Create the script, make it executable.

sudo nano /root/rpi-fixtranscoder-script.sh

Copy and paste script below into the editor

#!/usr/bin/env bash
if [ "$EUID" -ne 0 ]
    then echo "Must be root"
    exit
fi
echo -e " Automated Fix Server is not Powerful Enough Method."
echo -e  "Do you want to apply or remove the fix? (apply) a or (remove) r"
read FIX 
if  [[ "$FIX" == "a" ]]
then
echo "Stopping the plexmedia server service"
sudo service plexmediaserver stop
echo "Installing the dependencies for the backup"
sudo apt-get install zip -y
echo "Backing the /usr/lib/plexmediaserver/Resources/ folder"
cd /usr/lib/plexmediaserver/Resources/
sudo zip backup.zip * && mv backup.zip /root/
echo "making a security backup"
sudo zip security.zip *
echo "Downloading the working transcoder and replacing the broken one"
cd /tmp
sudo wget http://iiot.co.za/downloads/media/rpi/0.9.14.6.1620-e0b7243-arm7.spk -O 0.9.14.6.1620-e0b7243-arm7.tar
sudo mkdir -p replace
tar -xOf 0.9.14.6.1620-e0b7243-arm7.tar package.tgz | tar -xzf - -C replace/
sudo cp replace/Resources/Plex\ New\ Transcoder /usr/lib/plexmediaserver/Resources/
sudo chown -R plex /usr/lib/plexmediaserver/Resources/
echo "Starting the plex media server service"
sudo service plexmediaserver start
echo "modifying the web client’s javascript file to force transcoding"
plexjstofix=$(sudo find /usr/lib/plexmediaserver -name main*.js)
sudo cp $plexjstofix $plexjstofix".bak"
sudo sed -i s'/validateTranscoder:function([a-zA-Z],[a-zA-Z]){/&return false;/' $plexjstofix
sudo service plexmediaserver restart
echo "All done! - please reboot your raspberry pi"
exit
fi
if [[ "$FIX" == "r" ]]
then
echo "stopping the Plex Media Server"
sudo service plexmediaserver stop
echo "Install the dependencies for the restore"
sudo apt-get install zip -y
echo "Restoring the /usr/lib/plexmediaserver/Resources/ folder"
cd /usr/lib/plexmediaserver/Resources/
cp /root/backup.zip ./
sudo unzip -o backup.zip 
echo "starting Plex Media Server"
sudo service plexmediaserver start
echo "restoring the previously backed up main.js file"
plexjstofix=$(sudo find /usr/lib/plexmediaserver -name main*.js)
mv $plexjstofix".bak" $plexjstofix
echo "All done! - please reboot your raspberry pi"
exit
fi

Save changes and exit, [CTRL]+ [X], [Y], [ENTER]
We will now make it executable and run it. Please note the script can be used to apply and remove the fix.
chmod +x /root/rpi-fixtranscoder-script.sh
Run the script (choose a to apply the fix or r to remove it when asked)
sudo /root/rpi-fixtranscoder-script.sh
If you want to remove the fix then re-run the script and choose the “r” option. To re-run the script just run the last line again.
sudo /root/rpi-fixtranscoder-script.sh
Setup the transcoder temporary directory under the Plex server settings. Try NFS directory for transcoding speed improvements.

Please note that the Pi really performs best for multiple concurrent sessions of 5 and above when streaming directly.

Best wishes.
The iIot Team

Comments

Sign In or Register to comment.

Contact us

info@iiot.co.za

Get In Touch