

8-bit is more common among distributors.Ī preset is a collection of options that will provide a certain encoding speed to compression ratio. You can see what you are using by referring to the ffmpeg console output during encoding ( yuv420p or similar for 8-bit, and yuv420p10le or similar for 10-bit). When compiled with 10-bit support, x264's quantizer scale is 0–63 (internally in x264 itself it is from -12 to 51 but ffmpeg libx264 wrapper shifted it, so that 0 is lossless, but only in supported profiles, High 10 does not support lossless). Note: The 0–51 CRF quantizer scale mentioned on this page only applies to 8-bit x264. If the output looks good, then try a higher value. The range is exponential, so increasing the CRF value +6 results in roughly half the bitrate / file size, while -6 leads to roughly twice the bitrate.Ĭhoose the highest CRF value that still provides an acceptable quality. Consider 17 or 18 to be visually lossless or nearly so it should look the same or nearly the same as the input but it isn't technically lossless. A lower value generally leads to higher quality, and a subjectively sane range is 17–28. The range of the CRF scale is 0–51, where 0 is lossless (for 8 bit only, for 10 bit use -qp 0), 23 is the default, and 51 is worst quality possible. The downside is that you can't tell it to get a specific filesize or not go over a specific size or bitrate, which means that this method is not recommended for encoding videos for streaming. By adjusting the so-called quantizer for each frame, it gets the bitrate it needs to keep the requested quality level. This provides maximum compression efficiency with a single pass. This method allows the encoder to attempt to achieve a certain output quality for the whole file when output file size is of less importance. This is the recommended rate control mode for most uses. Use this rate control mode if you want to keep the best quality and care less about the file size. To know more about what the different rate control modes do see this post. This will determine the file size and also how quality is distributed. Rate control decides how many bits will be used for each frame. There are two rate control modes that are usually suggested for general use: Constant Rate Factor (CRF) or Two-Pass ABR.

See HWAccelIntro for information on supported hardware H.264 encoders. If you need help compiling and installing see one of our compiling guides. It assumes you have ffmpeg compiled with -enable-libx264.
