Closed c0linsteele closed 6 years ago
I have run into this issue on FreeBSD install and haven’t found a solution yet. The script runs perfectly when I execute it manually from the command line. Things that I have checked is that permissions are set correctly (chmod 777) and that PATH includes the location of the script. Other insight would be helpful.
Just for info. Bash exit code 127 is “command not found”
It seems to run fine when run manually through terminal, but Plex keeps giving me an error. The permissions (777) are set correctly and the PATH variable includes the path to the script. My only other thought might be owner and group permissions, but I'm not sure what those would need to be set to.
777 should cover the group and owner permissions. My next steps for debugging were to add some lines in the script to create a log file to see how far it gets through the script/or if it even executes the script to see where gets hung up. I just haven't gotten around to it yet. I believe it gets executed as the user 'Plex' so there may be a weird issue with permissions on some command.
debug update added to the top of the script
logfile=/usr/home/plex/bin/log.out
exec > $logfile 2>&1
when executed by plex this is the output
/mnt/DVR/.grab/412041aef5f491ecd54cde3d062e8d3098e65554/Who Wants to Be a Millionaire (2002) - S16E68 - Episode 68.ts
/tmp/tmp.nQG6RbYH.mkv
********************************************************
Starting Transcoding: Converting to H.264 w/ffmpeg @720p
********************************************************
/usr/home/plex/bin/PlexPostProc.sh: ffmpeg: not found
ERROR # 127 : Failed to convert using ffmepg
so looks like an issue with accessing ffmpeg.
So i was able to get rid of the exit code 127 by calling the full path of ffmpeg
/usr/local/bin/ffmpeg -i "$FILENAME" -s hd720 -c:v libx264 -preset veryfast -vf yadif -c:a copy "$TEMPFILENAME"
Sorry folks, was on Holiday for the past week. Looks like you were able to debug for the Mac environment by adding the path for FFMPEG. Would it help if I added a "path-to" variable definition to the script so that you can specify a directory for environments that don't have FFMPEG in the system variables path?
I can confirm that it is working when the full path to FFMPEG is referenced in the script. Thanks @calederer for your debugging efforts. @nebhead I'm not sure if the "path-to" variable definition would help or not. FFMPEG is in the /usr/local/bin/ folder which should it to be executed by default without modification to the path variable and while the script runs fine without the path when you run it manually, it freaks out when Plex tries to execute it. I also ensured the location of the PlexPostProc script was added to the PATH variable and still had no luck. As soon as I added the full path for FFMPEG to the PlexPostProc script, post processing occurred as expected.
f.y.i. Did you see Plex added native commercial skipping. It's now an option under DVR settings for the latest Plex Pass build.
I'm not sure if adding a path-to variable would be warranted here. When I execute which FFMPEG
I get back usr/local/bin
which is as expected so something else is going on. I would recommend closing this and it can be reopened later if more users experience this issue. Might be worth noting in the readme.
OK, sounds good @calederer and @c0linsteele! I'll go ahead and add a comment to the readme for this one.
I'm using the FFMPEG branch and the post processing script fails. Exits with an error code 127 and just copies the unconverted file into my library. Has anyone seen this before and know of a solution?