x264

h264 levels

DVDs max out at high 3.1. You don't need 3.2 on DVDs because that is the first level that accepts 720p.

Blu-ray at high 4.1. You can go higher if you want, it's your preference. :)

h264 levels: comparison

  • “Main” adds
    • CABAC Entropy Coding (link)
    • Interlaced Coding (PicAFF, MBAFF)
    • B slices
  • “High” adds
    • 4:0:0 Monochrome
    • 8×8 vs 4×4 Transform Adaptivity
    • Quantization Scaling Matrices
    • Separate Cb and Cr QP control

mtune

Keep it simple (for DVDs): use film or animation. For old movies or sources that have artifacts already, use grain or you risk making it even worse.

Choosing a preset

Short answer: just use medium, and tweak settings somewhere else.

Choose the preset that you can stand waiting for. :)

Two-pass encoding

Use a two-pass encode if you want to meet a specific filesize or constant bitrate.

preset comparison gains

  • medium to slow, 5 to 10% quality gain
  • slow to slower, 5%
  • slower to veryslow, 3%
  • veryslow to placebo, 1%

Animation

“All of this combines to make animation at first glance deceptively easy–but in reality quite difficult–to encode.” So true!

His tests on x264

x264 (r1206)
Video format: H.264/AVC High Profile
Settings: –preset placebo –tune ssim –rc-lookahead 250, two-pass

Note: Don't use animation tune on CGI.

motion estimation comparison

See this forum post on an excellent visual comparison between mostion estimation settings.

For quick reference, here's what the x264 presets use:

  • diamond (dia): ultrafast, superfast
  • hexagon (hex): veryfast, faster, fast, medium
  • uneven multi-hexagon (umh): slow, slower, veryslow
  • exhaustive (tesa): placebo