Changes between Version 7 and Version 8 of x264EncodingGuide
- Timestamp:
- 08/11/2012 09:16:45 AM (10 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
x264EncodingGuide
v7 v8 3 3 x264 is a H.264/MPEG-4 AVC encoder. The goal of this guide is to inform new users how to create a high-quality H.264 video. 4 4 5 There are two most popular methods that are useful for general use: Constant Rate Factor (CRF) rate control and Two-Pass Encoding. Explained below. 6 5 7 First you must choose your ratecontrol. A ratecontrol is a method that will decide how many bits will be used for each frame. This will determine the file size and also how quality is distributed. 6 8 7 There are two most popular methods that are useful for general use: Constant Rate Factor (CRF) and Two-Pass Encoding. Use CRF if you don't know what ratecontrol method to use. 8 9 CRF is basically a "keep this same constant quality always" setting. 0 is considered lossless, 51 is worst quality. You can either set this value, or set a bit rate with one of the other methods, not both. This is easy to use for beginners--just figure out how much quality you want, then record using this setting. 9 CRF is basically a "keep this same constant quality always" setting. 0 is considered lossless, 51 is worst quality. You can either set this value, or set a bit rate with one of the other methods, not both. This is easy to use for beginners--just figure out how much quality you want, then record using this setting. It has good results even with just 1 pass. 10 10 11 11 The default is ABR (Average Bit Rate). Like … … 25 25 Of course, if it's all just empty/black frames then it will still serve less than that many bits/s (but it will raise the quality level as much as it can to try to satisfy the requested parameters). 26 26 27 You can also "fake" a maximum bit rate by specifying both crf *and* maxrate settings, like 28 {{{ 29 ffmpeg -i input -vcodec libx264 -crf 20 -maxrate 400k -bufsize 1835k 30 }}} 31 32 This will effectively "target" crf 20, but if the output exceeds 400k, it will degrade to something less than crf 20 in that case. 33 27 34 If you need help compiling and installing libx264 see one of our [wiki:CompilationGuide FFmpeg and x264 compiling guides]. 28 35 … … 36 43 37 44 === 2. Choose a preset === 38 A preset is a collection of options that will provide a certain encoding speed:compression ratio. A slower preset will provide better compression (compression is quality per filesize). General usage is to use the slowest preset that you have patience for. Current presets in descending order of speed are: `ultrafast`, `superfast`, `veryfast`, `faster`, `fast`, `medium`, `slow`, `slower`, `veryslow`, `placebo`. Ignore `placebo` as it is a joke and a waste of time (see FAQ) .45 A preset is a collection of options that will provide a certain encoding speed:compression ratio. A slower preset will provide better compression (compression is quality per filesize). General usage is to use the slowest preset that you have patience for. Current presets in descending order of speed are: `ultrafast`, `superfast`, `veryfast`, `faster`, `fast`, `medium`, `slow`, `slower`, `veryslow`, `placebo`. Ignore `placebo` as it is a joke and a waste of time (see FAQ), but useful for command lines that require a preset when none is actually needed. 39 46 40 47 You can also choose a tune and/or profile. 48 49 === 2.5 Output file size === 50 51 As you can see, there are actually several things that contribute to file size. If you have a high CRF value, then that will tend to increase file size. If you encode with "veryslow" then that will tend to decrease file size. They both play a role in the output size. 41 52 42 53 === 3. Continue encoding ===


