Hey Everyone!
I’m trying to run an FFMPEG subprocess from a Plex Channel modified from HDHRViewer. The script below transcodes a channel (only testing one right now) and hosts it using FFServer (already started as a service). I was able to run the call fine manually, but it appears to crash when run locally.
import subprocess
...
subprocess.call(['ffmpeg','-i','http://sonnytv.local:5004/auto/v1007','http://127.0.0.1:8090/720.ffm'])
...
From this, I get the following error in the channel’s error log:
2016-08-07 12:40:44,736 (80879d000) : CRITICAL (runtime:889) - Exception (most recent call last):
File “/usr/local/share/plexmediaserver/Resources/Plug-ins-35f0caa/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py”, line 843, in handle_request
result = f(**d)
File “/usr/local/plexdata/Plex Media Server/Plug-ins/HDHRViewerV2.bundle/Contents/Code/init.py”, line 140, in FavoriteChannelsMenu
return BuildChannelObjectContainer(favorite.name,channelList)
File “/usr/local/plexdata/Plex Media Server/Plug-ins/HDHRViewerV2.bundle/Contents/Code/init.py”, line 192, in BuildChannelObjectContainer
oc.add(CreateVO(url=channel.streamUrl,title=GetVcoTitle(channel), year=GetVcoYear(program), tagline=GetVcoTagline(program), summary=GetVcoSummary(program), starRating=GetVcoStarRating(program), thumb=GetVcoIcon(channel,program)))
File “/usr/local/plexdata/Plex Media Server/Plug-ins/HDHRViewerV2.bundle/Contents/Code/init.py”, line 605, in CreateVO
subprocess.call([‘ffmpeg’,‘-i’,‘http://sonnytv.local:5004/auto/v1007’,'http://127.0.0.1:8090/720.ffm’])
File “/usr/home/plex/jenkins/pms-deps-universal-v2/BUILD_TAG/freebsd-x86_64/output/pms-depends-freebsd-x86_64-release-c0dbc55/lib/python2.7/subprocess.py”, line 524, in call
File “/usr/home/plex/jenkins/pms-deps-universal-v2/BUILD_TAG/freebsd-x86_64/output/pms-depends-freebsd-x86_64-release-c0dbc55/lib/python2.7/subprocess.py”, line 711, in init
File “/usr/home/plex/jenkins/pms-deps-universal-v2/BUILD_TAG/freebsd-x86_64/output/pms-depends-freebsd-x86_64-release-c0dbc55/lib/python2.7/subprocess.py”, line 1308, in _execute_child
OSError: [Errno 2] No such file or directory2016-08-07 12:40:44,738 (80879d000) : DEBUG (runtime:924) - Response: [500] 1760 bytes
I’ve tested the subprocess natively in the system python so I know it works. If I’m reading the error above correctly, the version of python within Plex has stripped out subprocess? I’ve run several searches and cannot seem to find any part of the mentioned path after ‘/usr/’
If that is the case, does anyone know how to import system python so that this can run properly?
Before anyone asks, I have already talked with @zynine . It sounds like both of us are pretty amateur at python, but when this is done, I’m offering it back to wrap into HDHRViewer.