Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques Error using 2-pass for mpeg4 output

  • Error using 2-pass for mpeg4 output

    Posted by Werner Clausen on June 29, 2011 at 6:31 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

    Michael Rampe replied 15 years, 1 month ago 2 Members · 1 Reply
  • 1 Reply
  • Michael Rampe

    July 4, 2011 at 12:55 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

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy