postprocess with ffmpeg script - problem with mutliple running

wrender

Cadet
Joined
Apr 5, 2017
Messages
1
Hi, I have a Dell T310 server with FreeNAS-11.3-U1 installed on it and Plex plugin installed to a jail. I bought an HDhomerun Duo for tv, but having issues getting the trans-coding working. It doesn't convert it to a format that is compatible with my Roku Ultimate. So I thought I would try the "postprocess script" feature of the DVR portion of Plex. When I run this postprocess script it works great, but then if I try to encode a second tv show at the same time, the second postprocess script doesn't write the mp4 file.

If I do a "top" on the FreeNAS server I can see two different processes of "ffmpeg" running, and then do stuff and then exit. So I'm confused on what is going on with the second recording. (Here is the script). I it is basically what I came up with from googling on Plex and FreeNAS

Code:
#!/bin/sh

PATH=$PATH:/usr/local/bin:/usr/bin

#LD_LIBRARY_PATH is set and will mess up ffmpeg, unset it, then re-set it when done
ldPath=${LD_LIBRARY_PATH}
unset LD_LIBRARY_PATH

filetoencode="$1"
/usr/local/bin/ffmpeg -i "$1" -threads 1 -acodec copy -vcodec libx264 -preset superfast "${1%.ts}.mp4"

export LD_LIBRARY_PATH="$ldPath"
 
Top