VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. I've Googled this problem, and I can find examples of people using presets and proper syntax for two-pass H.264 encodes using x264, but I don't want to just copy-paste them; I want to understand what I'm doing wrong here. The documentation doesn't go into much detail regarding this.

    So here's what I'm running, using ffmpeg on Windows, a January 14 2013 build.

    ffmpeg -i pelicans.mpg -c:v libx264 -pass 1 -an -f rawvideo NUL
    ffmpeg -i pelicans.mpg -c:v libx264 -q:v 5 -pass 2 -an pelicout.mkv

    Error: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width, or height.

    The first command works correctly. The second is what gives me trouble. If I use -b:v 2500k, then that works fine. But -q:v 9 does not, and I haven't been able to understand why. If I invoke that command outside of a two-pass encode, it seems to work fine. And it's in the same position a flat bitrate indicator would be. So what's the deal here? What am I doing wrong?
    Quote Quote  
  2. Usually with 2pass encodes, you enter a desired average bitrate, which is the same for pass1 and pass2. I suspect that's what it's expecting too - thus the error

    Why are you using -q:v ? Did you want same constant quantizer encoding (--qp in x264CLI) or crf encoding ? For ffmpeg, -crf is the equivalent to --crf in x264CLI . Both crf and qp encoding are 1pass encodes
    Quote Quote  
  3. Ah, see, that's what I didn't know. Though it makes sense now that I think about it.

    So is two-pass encoding only done these days when having a specific and predictable filesize the main concern, and CRF/QP encoding done when quality is more important?
    Quote Quote  
  4. Originally Posted by Iced Coffee View Post
    Ah, see, that's what I didn't know. Though it makes sense now that I think about it.

    So is two-pass encoding only done these days when having a specific and predictable filesize the main concern, and CRF/QP encoding done when quality is more important?

    Yes, when you need a specific bitrate or filesize, use 2pass . Common scenarios are fixed capacity limitations (e.g. blu-ray media, maybe streaming bandwidth limitations)

    When average quality, but don't care as much about final bitrate is more important, CRF encoding is used. The final bitrate will vary accorrding to content complexity, and you will achieve an average quality proportional to the CRF value entered. Almost nobody uses QP encoding (constant quantizer), there is no reason to since CRF is better in every way
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!