# H.264 / AVC

H.264 / AVC, also known as MPEG4 Part 10 is the latest MPEG video codec. It is comparable to VP8, and while somewhat better in quality it is encumbered by patents and royalty fees. It is currently the most widely supported format.

## Options

- Quantizer (1 - 50)
  Set a specific visual quality (recommended). Default is 21. Must use with pass=quant.

      quantizer=23

- Bitrate (number)
  Set a specific bitrate in kbps to control file size. Default is 2048 kbps. Must use with pass=cbr, pass1, or pass2.

      bitrate=512

- Profile
  Set an encoding profile. This may override other options. Defautl is main.
  - baseline: H.264 Baseline Profile
  - main: H.264 Main Profile
  - high: H.264 High Profile

      profile=baseline

- Speed Preset Set a speed preset. This automatically configures other options listed below. Default is medium.
  - ultrafast
  - superfast
  - veryfast
  - faster
  - fast
  - medium
  - slow
  - slower
  - veryslow

      speed-preset=ultrafast

- CABAC (boolean)
  Choose between using CABAC or CAVLC. CABAC is better but not supported by all devices (e.g. the ones requiring H.264 Baseline profile). Default is true.

      cabac=false

- Motion estimation
  Set a motion estimation method.
  - dia: diamond search (fastest, worst)
  - hex: hexagon search (default)
  - umh: uneven multi-hexagonal search (recommended)
  - esa: exhaustive search (slowest, best)

      me=umh

- Subpixel motion estimation (1 - 6)
  Set a subpixel motion estimation and partition decision quality. The higher the number the slower the encoding and better the final quality. Default is 1.

      subme=5

- Pass
  Set the mode of operation for single or multiple passes.
  - cbr: Constant bitrate (default)
  - qual: Constant quality (recommended)
  - pass1: first of two passes
  - pass2: second of two passes

      pass=qual

- Threads
  Use multiple threads when encoding. Default is 0, which automatically chooses the best number for you.

      threads=2

- Reference frames (1 - 12)
  Set the number of reference frames. Using more will allow frames to reference parts of previous frames. Some devices can only use a limited amount of reference frames. Default is 1. Values over 3 are not recommended.

      ref=3

- B-frames (0 - 4)
  Set the number of bidirectional reference frames. Some devices don't support this feature. Default is 0. Recommended is 1 or 2.

      bframes=1