VideoHelp Forum
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. What exactly do I gain if I use 3-pass encoding with x264, instead of 2-pass ? More quality at the same bitrate ? More accurate bit allocation decissions ? Less dB's of global PSNR ?

    In other words, let's say you want to encode some dvd's containing something very important to you, and slow encoding speed is not a problem. In that case, would you choose 3-pass, or stick with 2-pass, and why ? And would you enable slow_firstpass on the first pass ? If yes, why ?

    I can't seem to understand what is the role of 3-pass and 4-pass, or what they were designed for, since 2-pass encoding is enough to gather the necesary statistics during the first pass, and use them in the second pass. But what I would like to know is if 3-pass and 4-pass offer greater quality at the same bitrate, and if the quality is increased considerably enough to justify using 3 or 4 pass.
    Last edited by codemaster; 21st Sep 2011 at 17:20.
    Quote Quote  
  2. aBigMeanie aedipuss's Avatar
    Join Date
    Oct 2005
    Location
    666th portal
    Search Comp PM
    too many variable to make a one answer for all situations. sometimes a better allocation of bits is achieved with more passes.

    if i had a very important dvd i wouldn't re-encode it. if i need it as a file i'd use vob2mpg and leave it as the original quality mpeg-2.
    --
    "a lot of people are better dead" - prisoner KSC2-303
    Quote Quote  
  3. so, I guess it ultimately depends on the source ?

    for me, the original mpeg2 video stream seems too huge, I prefer to encode it to h264 and mux it to .mkv with the original and untouched ac3, that's why I asked if 2-pass is enough, or 3-pass would considerably influence the quality
    Quote Quote  
  4. Use single pass CRF encoding. You'll get the quality you ask for every time. The bitrate will turn out whatever is necessary for each particular video.
    Quote Quote  
  5. @ jagabo: I learned from MEncoder's x264 documentation that there are very good reasons for using at least two pass encoding:

    For one thing, single pass ratecontrol is not psychic, and it often makes unreasonable choices because it cannot see the big picture. For example, suppose you have a two minute long video consisting of two distinct halves. The first half is a very high-motion scene lasting 60 seconds which, in isolation, requires about 2500kbps in order to look decent. Immediately following it is a much less demanding 60-second scene that looks good at 300kbps. Suppose you ask for 1400kbps on the theory that this is enough to accommodate both scenes. Single pass ratecontrol will make a couple of "mistakes" in such a case. First of all, it will target 1400kbps in both segments. The first segment may end up heavily overquantized, causing it to look unacceptably and unreasonably blocky. The second segment will be heavily underquantized; it may look perfect, but the bitrate cost of that perfection will be completely unreasonable. What is even harder to avoid is the problem at the transition between the two scenes. The first seconds of the low motion half will be hugely over-quantized, because the ratecontrol is still expecting the kind of bitrate requirements it met in the first half of the video. This "error period" of heavily over-quantized low motion will look jarringly bad, and will actually use less than the 300kbps it would have taken to make it look decent. There are ways to mitigate the pitfalls of single-pass encoding, but they may tend to increase bitrate misprediction. Multipass ratecontrol can offer huge advantages over a single pass. Using the statistics gathered from the first pass encode, the encoder can estimate, with reasonable accuracy, the "cost" (in bits) of encoding any given frame, at any given quantizer. This allows for a much more rational, better planned allocation of bits between the expensive (high-motion) and cheap (low-motion) scenes.

    Moreover, two passes need not take twice as long as one pass. You can tweak the options in the first pass for higher speed and lower quality. If you choose your options well, you can get a very fast first pass. The resulting quality in the second pass will be slightly lower because size prediction is less accurate, but the quality difference is normally much too small to be visible.
    They suggest to always use two pass encoding. They say the reasons for not using it could be:
    for instance, if you are capturing live TV and encoding in realtime, you are forced to use single-pass. Also, one pass is obviously faster than two passes.
    To me, it seems that single pass CRF looks great but does not offer the best way of spending the bits, especially if you want the best/optimal ballance between quality and file size. In contrast, it seems to me that multi pass is spending the bits much more wisely, but it's not necesarily useful only if you want to fit a 2h video onto 2x700 mb discs, but also when you want to specify whatever bitrate you think it's needed.
    Last edited by codemaster; 21st Sep 2011 at 21:42.
    Quote Quote  
  6. Originally Posted by codemaster View Post
    @ jagabo: I learned from MEncoder's x264 documentation that there are very good reasons for using at least two pass encoding:
    For one thing, single pass ratecontrol is not psychic
    They're talking about single pass bitrate based encoding. None of that applies to quality based encoding. CRF and QP encoding use whatever bitrate is needed at each and every frame to encode it with the quality you specified.
    Quote Quote  
  7. CRF if you want a given level of quality, 2pass if you need an exact filesize

    If you encoded CRF, examined the average bitrate , then used that same bitrate with a 2pass encode they would be almost identical .

    The only reason you would need 2 pass is if you need an exact filesize (e.g. fit to blu-ray disc fixed capacity, or maybe you have bandwidth limitations for streaming flash) . These days HDD are cheap, and so are media players (e.g. asus oplay mini is $60 , wdtv)

    But who says 1400MB is the "proper" filesize ? or "x" bitrate is the proper size? For an action movie it might look like crap, for a simple cartoon it will be too much and you waste bitrate. Those are reasons why 1 pass CRF is often preferred. It allocates the proper amount of bitrate for a certain level of "quality". So high content complexity or noise/grain movies will be larger in bitrate, and simple movies, with little motion will get less bitrate. If you choose a predetermined bitrate, some movies get too much (waste), some get too little.
    Quote Quote  
  8. If you encode a video using CRF encoding, then go back and make a 2-pass VBR encoding at the same bitrate the CRF encoding turned out, the two videos will look nearly identical.

    You should use 2 (or more) pass VBR encoding when you need a specific file size. Use CRF encoding when you want a particular visual quality.

    QP encoding is constant quality in a mathematical sense. CRF encoding also takes into account what is visible to the human eye. CRF delivers smaller file sizes than QP.
    Quote Quote  
  9. I just found that one of the x264 developers said:
    CRF and 2-pass use identical bit allocation algorithms. All 2-pass does is pick the CRF value that gives the filesize you want. It's still using the CRF algorithm.
    Now that I actally have an idea of what CRF is, it makes more sense to use it, since I don't need a certain file size...
    Quote Quote  



Similar Threads

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