I’ve been trying to craft a post-processing script to remove commercials and re-encode the 1080i broadcasts off my HDHR.
Manually executed, my script is working nearly perfectly.
After finally enabling it in Plex DVR, I’m receiving the following error:
Mar 01, 2017 16:01:00.889 [0x7ff9043fd700] DEBUG - Job running: '/home/plex/postprocess.sh' '/home/plex/sorted/TV/.grab/3a0f9446c700bbf4effb66b2e1aa62c5da9e37d3/Dogs The Untold Story (2016) - S01E01 - Stronger Together.ts' Mar 01, 2017 16:01:03.116 [0x7ff9043fd700] DEBUG - Jobs: '/home/plex/postprocess.sh' exit code is 1 Mar 01, 2017 16:01:03.116 [0x7ff9043fd700] ERROR - MediaRecorder: Postprocessing script '/home/plex/postprocess.sh' exited with error code 1. Mar 01, 2017 16:01:03.116 [0x7ff9043fd700] DEBUG - MediaGrabber: Operation for E1 - Stronger Together completed with status 5 (An error occurred while postprocessing the recording.)
If I execute ‘/home/plex/postprocess.sh’ ‘/home/plex/sorted/TV/.grab/3a0f9446c700bbf4effb66b2e1aa62c5da9e37d3/Dogs The Untold Story (2016) - S01E01 - Stronger Together.ts’ from CLI as plex user it completes successfully.
My script is based off of the following https://github.com/jadrian2006/plex_post and I have verified that it’s never even executing the python successfully so I 'm guessing this is an issue of the env of the plex daemon as opposed to that of the plex user in bash.
I even added the following to my postprocess.sh and I am not getting any output from python at all. The first two lines writes to /tmp/pp.output but the third line does not. Why can’t plex running as a daemon execute python?
#!/bin/bash env >> /tmp/pp.output echo "$1" >> /tmp/pp.output /usr/bin/python --version >> /tmp/pp.output
So I grabbed the PlexComSkip script since it was at least a maintained postprocessing option that I assume would work out of the box.
I’m getting the exact same failure however. I don’t even know where to look for solutions at this point.
Mar 24, 2017 16:31:01.254 [0x7f6f557ff700] DEBUG - Job running: '/var/lib/plexmediaserver/PlexComskip/PlexComskip.py' '/home/plex/sorted/TV/.grab/3b338147f138bc320ce992bf27cb8e73d9f29d9b/Who Wants to Be a Millionaire (2002) - S15E55 - Episode 55.ts' Mar 24, 2017 16:31:01.865 [0x7f6f557ff700] DEBUG - Jobs: '/var/lib/plexmediaserver/PlexComskip/PlexComskip.py' exit code is 1 Mar 24, 2017 16:31:01.865 [0x7f6f557ff700] ERROR - MediaRecorder: Postprocessing script '/var/lib/plexmediaserver/PlexComskip/PlexComskip.py' exited with error code 1. Mar 24, 2017 16:31:01.865 [0x7f6f557ff700] DEBUG - MediaGrabber: Operation for E55 - Episode 55 completed with status 5 (An error occurred while postprocessing the recording.)
I had to overcome this issue using python-virtenv, then using the virt-env python path in calling the post processing script.
@spuniun Try https://github.com/ekim1337/PlexComskip along with https://github.com/BrettSheleski/comchap I’ve had better luck with those. I’ve not tried the comskip.ini from plex_post, I’ll have to one day…
Props to the devs, and @jdbower for pointing out the scripts to me.
I’ll give python-virtenv a try when I’ve upgraded back to a DVR release. I downgraded back to 1.3.4 today due to unrelated issues with streaming bandwidth caps
I had tried PlexComskip as well and was getting the same error so I expect it’s python env issues. I even wrote a hello world python to simply write to a file and even that wasn’t working.
ahh, yes. Then try and set virt-env up and point the post processing script to the virt-env python interpreter. See an ebuild here: https://github.com/gentoo/gentoo/blob/master/media-tv/plex-media-server/plex-media-server-1.4.4.ebuild They still haven’t bumped versions, yet. Lines
FYI, I ended up rebuilding my PMS for other reasons and no longer have this problem