Log in

View Full Version : Figuring out which Rate control to use (A small tutorial)


Sagekilla
3rd October 2008, 19:43
I thought it might be helpful to put a small tutorial up for anyone confused on what rate control to use. Enjoy!


x264 has two widely used rate control methods*: 2-pass bitrate and constant rate factor (CRF). 2-pass and CRF utilize the same rate control method, but 2-pass allows you to target a specific size while CRF targets a specific quality.

In short:

CRF
++ Good for finding a specific quality
+ Only 1-pass, but about the same quality as 2-pass bitrate
- Difficult to target specific size

2-pass
++ Good for targetting specific Size
+ If used at same bitrate as a similar CRF encode, provides same quality
- Sometimes quality can be poor if you're not providing sufficient bitrate
- With heavy preprocessing, 2-pass can be very slow


Because not all sources are the same, 2000 kbps for one movie could look amazing while it looks like utter crap on another. If you're trying to target specific quality without having to hit specific size constraints (I.e. rip to your hard drive) it's recommended you use CRF, since you can just plug in a CRF value without having to worry. But, if you're trying to rip a Blu-ray to a DVD, for example, it's recommended you use 2-pass so you can specify the exact size to completely fill up the DVD. In this case, you get maximum quality per disc. On CRF, you may end up an under or oversized encode.


Generally speaking, CRF can be "set and forget," since once you find the right CRF value you can use this among all your encodes without having to worry about if you're using the right bitrate, because x264 will automatically give it the bitrate necessary.

To find the right CRF value to use, I recommend encoding a few samples with CRF from 18 to 22. Lower values give bigger file sizes, and vice versa. CRF 18 tends to be "transparent" to most eyes, but you may have to go lower. Try to find the highest CRF your eyes will tolerate so you get the smallest possible file size at a quality you consider good. Remember, no one has the same two eyes so while CRF 20 may look good to you, others may prefer CRF 18.


Happy encoding! :)


If you have any constructive criticism on what might be more helpful, feel free to PM me. Anything to help people new to x264 is always appreciated.