FORUMS: list search recent posts

Error using 2-pass for mpeg4 output

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Werner Clausen
Error using 2-pass for mpeg4 output
on Jun 29, 2011 at 6:31:25 pm

Hi,

I'm using these 2 lines (from WinFF) trying to do 2-pass:

"C:\Program Files\WinFF\ffmpeg.exe" -i "C:\Kamera\020.MOV" -crf 15.0 -vcodec libx264 -acodec libfaac -ar 48000 -ab 192k -coder 1 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me_method hex -subq 6 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -threads 0 -an -passlogfile "C:\Kamera\020.log" -pass 1 -y "NUL.avi"

"C:\Program Files\WinFF\ffmpeg.exe" -y -i "C:\Kamera\020.MOV" -crf 15.0 -vcodec libx264 -acodec libfaac -ar 48000 -ab 192k -coder 1 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me_method hex -subq 6 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -threads 0 -passlogfile "C:\Kamera\020.log" -pass 2 "C:\Kamera\020.mp4"

The first pass completes but the second fails on start with this message: "Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height".

Can anyone spot the culprit in these commands?

--
Werner


Return to posts index

Michael Rampe
Re: Error using 2-pass for mpeg4 output
on Jul 4, 2011 at 12:55:33 am

[Werner Clausen] "The first pass completes but the second fails on start with this message: "Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height"."

Does the first pass actually complete?

Please post the FFmpeg version.

For newer builds of FFmpeg, the use of presets is recommended for the libx264 codec.

Depending on the build, this is achieved by using the -vpre or -preset option.

Also, the pass log file option is not needed for the libx264 library as it generates it's own logs.

Finally, -crf only needs one pass as it is setting the constant "q" factor which would be determined by two pass.


Anyway, for the latest version, a UNIX 2 pass example (using -b instead of -crf) would be:

ffmpeg -i Kamera20.MOV -an -vcodec libx264 -preset slow -b 1500k -pass 1 -f rawvideo -y /dev/null &&
ffmpeg -i Kamera20.MOV -acodec libfaac -ar 48000 -ab 192k -vcodec libx264 -preset slow -b 1500k -pass 2 Kamera20.mp4

Adjust as needed for windows.

Michael


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]