[mythtv-users] user job using ffmpeg

Jonatan Lindblad mythtv at comhem.se
Sat Nov 24 13:22:43 UTC 2012

On 2012-11-23 21:44, Jim Judd wrote:
> On 11/23/2012 1:57 PM, Karl Newman wrote:
>> On Fri, Nov 23, 2012 at 11:26 AM, Jim Judd <jim at cincojudds.com
>> <mailto:jim at cincojudds.com>> wrote:
>>     Hello everyone,
>> <snip>
>>     The command line for ffmpeg is the following:
>>     /usr/bin/ffmpeg -y -i <in mpeg 2 file> -pass 1 -vcodec libx264
>>     -b:v 2500k -g 30 -bf 3 -refs 6 -b_strategy 1 -coder 1 -qmin 10
>>     -qmax 51 -sc_threshold 40 -flags +loop -cmp +chroma -me_range 16
>>     -me_method umh -subq 7 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4
>>     -directpred 3 -flags2 +dct8x8+wpred+bpyramid+mixed_refs -trellis 1
>>     -partitions +parti8x8+parti4x4+partp8x8+partp4x4+partb8x8 -acodec
>>     libfaac -ab 44100 <outputfile>
>>     Since it works in a bash shell I'm not sure why it errors out when
>>     mythtv launches the user job. Can anyone see something that I'm
>>     missing or know if anything special I need to do when setting up
>>     user jobs?
>>     Thanks!
>> I seem to recall there is a limit for the length of the user job
>> command line. You might try putting that long ffmpeg command line into
>> a shell script and then passing the parameters in the user job.
> Sorry I didn't mention that before, I have that in a script already. I
> just included it so show what parameters I was already passing to
> ffmpeg. There are actually two calls since I'm doing 2 pass encoding,
> but the second call is 90% the same as far as parameters go.
> Calling the script from the command line works great, just not sure
> what's different when called from user jobs.
> The user job is defined like "/home/mythtv/mpg2toh264.py %CHANID%

(Fixed top posting and trimmed the footers)

It could be that the script is run from a directory where it doesn't 
have permission to create the stats file needed for the second pass, 
hence the "[libx264 @ 0xd0ec40] ratecontrol_init: can't open stats file".


More information about the mythtv-users mailing list