>FFmpegLab Sign In
FFmpeg Deep Dive

Codec private options: squeezing every bit of quality

CRF and presets are just the beginning. Learn how to control reference frames (`refs`), B‑frame decision (`b-adapt`), lookahead (`rc-lookahead`), psychovisual tuning (`psy-rd`), deblocking, and niche encoders like MPEG‑2, MJPEG, PNG, and WMV.

The Complete Codecs Guide gave you the foundation. Now we go deeper. Every serious encoder offers private options—tuning knobs that control motion estimation, rate control, psychovisual optimizations, and stream structure. These are the settings that differentiate a "good" encode from a "masterpiece" encode.

Key takeaways


libx264 – the deep tuning guide

To pass private options to libx264, use -x264-params with a colon‑separated list of key=value pairs.

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
ffmpeg -i input.mov -c:v libx264 -preset medium -crf 23 \
  -x264-params "refs=5:bframes=3:b-adapt=2:rc-lookahead=60:deblock=-1,-1:psy-rd=1.0,0.15" \
  output.mp4

Breaking down the critical x264 options

Pro tip for grain preservation (film, noisy content): -x264-params "deblock=-2,-2:psy-rd=1.2,0.2:no-mbtree=1"


libx265 – HEVC advanced tuning

With H.265, use -x265-params. The options are similar but often more sensitive.

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
ffmpeg -i input.mov -c:v libx265 -crf 24 \
  -x265-params "ref=5:bframes=5:b-adapt=2:rc-lookahead=60:rd-refine=1:limit-refs=3" \
  output.mp4

VP9 – libvpx-vp9 tuning

VP9 options are passed directly as flags, not via a params string.

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
ffmpeg -i input.mov -c:v libvpx-vp9 -crf 30 -b:v 0 \
  -row-mt 1 -tile-columns 2 -tile-rows 1 -frame-parallel 1 \
  -speed 2 -c:a libopus output.webm

AV1 – libsvtav1 tuning

The SVT‑AV1 encoder is gaining popularity for its speed/quality balance.

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
ffmpeg -i input.mov -c:v libsvtav1 -crf 30 -preset 8 \
  -svtav1-params "enable-tf=1:tile-columns=2:tile-rows=1:enable-overlays=1" \
  -c:a libopus output.mkv

Niche & legacy codecs

Not every project needs H.264 or HEVC. Here are the codecs you'll encounter in legacy broadcast, archival, or specialized pipelines.

MPEG‑2 Video (`mpeg2video`)

Still used in broadcast, DVD, and MPEG‑TS streams. It lacks the advanced tools of modern codecs.

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
# MPEG‑2 with high bitrate (DVD quality)
ffmpeg -i input.mov -c:v mpeg2video -b:v 8M -maxrate 9M -bufsize 3.5M \
  -mpeg2video_psi 1 -g 15 -bf 2 output.m2v

MJPEG (`mjpeg`)

Motion JPEG – each frame is a separate JPEG image. Used in IP cameras and legacy video mixers. High bitrate required.

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
# MJPEG with custom quantization (quality 2–31, lower = better)
ffmpeg -i input.mov -c:v mjpeg -q:v 5 -huffman 1 output.avi

PNG (`png`)

Lossless, but huge file sizes. Used for screenshot sequences or lossless intermediates.

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
# PNG with maximum compression (slower)
ffmpeg -i input.mov -c:v png -compression_level 9 -pred mixed output/%05d.png

WMV (Windows Media Video) – `wmv2`

Legacy Microsoft codec. Rarely used today, but still encountered in corporate archives.

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
ffmpeg -i input.mov -c:v wmv2 -b:v 2M -c:a wmav2 output.wmv

Codec tuning cheat sheet

CodecFor maximum quality (slow)For speed (good quality)
H.264-preset veryslow -x264-params "refs=8:bframes=5:b-adapt=2:rc-lookahead=80:deblock=-1,-1:psy-rd=1.1,0.15"-preset medium -x264-params "refs=4:bframes=3:b-adapt=1:rc-lookahead=40"
H.265-preset veryslow -x265-params "ref=6:bframes=6:b-adapt=2:rc-lookahead=60:rd-refine=1:rd-level=6"-preset medium -x265-params "ref=4:bframes=4:b-adapt=1"
VP9-speed 1 -row-mt 1 -tile-columns 2 -tile-rows 1 -frame-parallel 0-speed 4 -row-mt 1 -tile-columns 2
AV1 (svt)-preset 4 -svtav1-params "enable-tf=1:enable-overlays=1:tile-columns=2"-preset 10 -svtav1-params "enable-tf=1"

Pair these advanced settings with the right container. Read the Advanced Muxer Flags guide to ensure your container isn't the bottleneck.

✦  Fresh from the render queue

Better FFmpeg workflows, delivered.

Get practical commands, new templates, and deep-dive guides for the edits that are usually hardest to get right.

✓  Copy-pasteable commands    ✓  Editor templates    ✓  No noise
One useful email at a time.

Fine‑tune your encode on a real timeline — offline.

Free in your browser — nothing to install, nothing uploaded.