Changes between Version 17 and Version 18 of Encode/H.264
- Timestamp:
- Sep 6, 2012, 4:10:29 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Encode/H.264
v17 v18 34 34 35 35 == Two-Pass ==#twopass 36 This method is generally used if you are targeting a specific output file size and output quality is of less importance. This is best explained with an example. Your video is 10 minutes (600 seconds) long and an output of 50 MB is desired. Since `bitrate = file size / duration`:36 This method is generally used if you are targeting a specific output file size and output quality from frame to frame is of less importance. This is best explained with an example. Your video is 10 minutes (600 seconds) long and an output of 50 MB is desired. Since `bitrate = file size / duration`: 37 37 38 38 {{{ … … 48 48 }}} 49 49 50 As with CRF, choose the slowest preset you can tolerate. 50 As with CRF, choose the slowest preset you can tolerate. Obviously, if you increase the target bitrate, that will increase quality, too, up to some threshold. 51 51 52 52 ---- 53 53 54 54 == Lossless H.264 == 55 You can use `-qp 0` or `-crf 0` to encode a lossless output. T he two useful presets are `ultrafast` or `veryslow` since either a fast encoding speed or best compression are usually the most important factors.55 You can use `-qp 0` or `-crf 0` to encode a lossless output. Two useful presets for this are `ultrafast` or `veryslow` since either a fast encoding speed or best compression are usually the most important factors. 56 56 57 57 === Lossless Example (fastest encoding) === … … 71 71 72 72 == Overwriting default preset settings == 73 73 74 You can overwrite default preset settings with the `x264opts` option or by using the libx264 private options (see `libx264 AVOptions` in `ffmpeg -h`). This is not recommended unless you know what you are doing. The presets were created by the x264 developers and tweaking values to get a better output is usually a waste of time. 74 75 … … 89 90 }}} 90 91 91 This is the default, andprovides something of a "running average" target, with the end goal that the final file match this number "overall on average" (so basically, if it gets a lot of black frames, which cost very little, it will encode them with less than the requested bitrate, but then the next few seconds of (non-black) frames it will encode at very high quality, to bring the average back in line). Using 2-pass can help this method to be more effective. You can also use this in combination with a "max bit rate" setting in order to prevent some of the swings.92 This provides something of a "running average" target, with the end goal that the final file match this number "overall on average" (so basically, if it gets a lot of black frames, which cost very little, it will encode them with less than the requested bitrate, but then the next few seconds of (non-black) frames it will encode at very high quality, to bring the average back in line). Using 2-pass can help this method to be more effective. You can also use this in combination with a "max bit rate" setting in order to prevent some of the swings. 92 93 93 94 === CBR (Constant Bit Rate) === … … 98 99 }}} 99 100 100 in this example, bufsize is the "rate control buffer" so it will enforce your requested "average" (4000k in this case) across each 1835k worth of video. So basically it is assumed that the receiver/end player will buffer that much data so it's ok to fluctuate within that quantity.101 in this example, bufsize is the "rate control buffer" so it will enforce your requested "average" (4000k in this case) across each 1835k worth of video. So basically it is assumed that the receiver/end player will buffer that much data so it's ok to fluctuate within that much. 101 102 102 103 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, up to the crf level).
