Changes between Version 17 and Version 18 of Encode/H.264


Ignore:
Timestamp:
Sep 6, 2012, 7:10:29 PM (7 years ago)
Author:
rogerdpack
Comment:

tweak verbiage

Legend:

Unmodified
Added
Removed
Modified
  • Encode/H.264

    v17 v18  
    3434
    3535== 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`:
     36This 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`:
    3737
    3838{{{
     
    4848}}}
    4949
    50 As with CRF, choose the slowest preset you can tolerate.
     50As 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.
    5151
    5252----
    5353
    5454== Lossless H.264 ==
    55 You can use `-qp 0` or `-crf 0` to encode a lossless output.  The two useful presets are `ultrafast` or `veryslow` since either a fast encoding speed or best compression are usually the most important factors.
     55You 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.
    5656
    5757=== Lossless Example (fastest encoding) ===
     
    7171
    7272== Overwriting default preset settings ==
     73
    7374You 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.
    7475
     
    8990}}}
    9091
    91 This is the default, and 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.
     92This 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.
    9293
    9394=== CBR (Constant Bit Rate) ===
     
    9899}}}
    99100
    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.
     101in 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.
    101102
    102103Of 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).