Great stuff Andrew! I have a few comments: Andrew Church wrote: > There was a short thread recently on encoding options for x264 (and 2-pass > encoding in particular), to which I wrote a reply that was subsequently > swallowed by a power failure before I could send it. Since then I took > the time to actually try 1-pass, 2-pass, and constant rate factor (CRF, > x264's "2-pass in a single pass") modes, and here's what I found as of > x264 build 84: > > - 2-pass does significantly better than 1-pass on smoothing out the image > quality. This may actually be a double-edged sword, because if you > lose too much detail in still scenes (as can happen if the bitrate is > too low), that loss of quality can carry over into motion scenes, and > you may not get the benefit you'd expect. That said, I didn't try > encoding at a low bitrate so I can't say for sure one way or the other. > > (Phil, regarding what you said you heard about 2-pass support being > nonfunctional: I can only assume that was referring to a very old x264 > build, because the PSNR curves were substantially different between > 1-pass and 2-pass. If nothing else, I know the 2-pass log file has > actual data because I had to add a workaround in encode_x264 for an > x264 bug that writes invalid frame numbers at the end of the log.)
That's good to hear. Back when I was hashing this out in another forum, the x264 developer pasted a section of an x264 2-pass log and ALL THE LINES WERE THE SAME!! > - Constant rate factor mode (enabled by crf=N in x264.cfg) does a fairly > good job of matching the 2-pass PSNR curve for the same bitrate, but it > fluctuates a bit more (slightly higher PSNR in still scenes, lower PSNR > in high-motion scenes). This may indicate that CRF mode tries harder > than regular 2-pass to retain detail in still scenes. The conclusion of the formerly mentioned x264 developer was that "crf is better than 2-pass"... Without saying that 2-pass was disabled. Sigh. Anyway, recently, encoders of HDTV raws for Asian drama fansubbing have been switching over to x264, and many of them are producing raws that are devastatingly sharp in still scenes, and a flurry of rubbish in high motion scenes, thanks to crf. This is happening even at very high bitrates (higher than I would use for divx!). Whereas it *is* nice to be able to count the leaves on the trees 2 miles in the background during a still scene, it would also be nice to see that spinning roundhouse kick (that cost the actor a stay in the hospital) in all it's glory. So, for a still scene, for example people sitting around a dinner table having an animated discussion (the scene is still, the actors are only ever keeping <25% of the macroblocks in motion at best) crf is fine... But a panning shot of people and cars in motion will turn into mashed potatoes. In that case, 2-pass lavc mpeg4 will beat the pants off x264 crf (though the PSNR of the x264 will be better because the still scenes are SO good!!). So please, anybody out there that is reading this and is a raw provider, don't rely on x264 crf when you are ripping an action show! Also remember that your target resolution should still be modulo 16 in both dimensions...