[FFmpeg-user] 2-pass ENcoding with mpeg (switching from mencoder)

James Board jpboard2 at yahoo.com
Wed Aug 7 14:56:48 CEST 2013


> ----------------------------------------
>> I saw this in another post on how to do 2-pass encoding:
>> 
>>     /usr/local/bin/ffmpeg -y -i AI_kerndeint_ffvhuff_trim.avi -c:v libx264
-
>> preset medium -b:v 10m -pass 1 -an -f mp4 /dev/null
>>     /usr/local/bin/ffmpeg -y -i AI_kerndeint_ffvhuff_trim.avi -c:v libx264
-
>> preset medium -b:v 10m -pass 2 -an OUT.mp4
>> 
>> There was no error on the first command.  The error on the second was
>>     Error while opening encoder for output stream #0:0 - maybe incorrect
>> parameters such as bit_rate, rate, width or height

>There probably is something wrong with the format you're passing to the
>encoder. Normally I get this error when trying to pass 5.1-channel audio to
>the libvo-aacenc encoder which can't handle it, but in this case you've
>disabled audio with '-an' (do you really want that?). The problem therefore
>is with video, and it only surfaced on the 2nd pass because the 1st pass
>doesn't encode video. You'd have to inspect ffmpeg's console output for
>video information it reports to try work out what video parameter may have
>caused the error.

The only thing in the ffmpeg output from the 2ns pass that looks problematic is:
    [libx264 @ 0x206f040] constant rate-factor is incompatible with 2pass
    ....
    Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

Is that a clue?
 
Thanks for your help.


More information about the ffmpeg-user mailing list