C.W.K.
Stream
Lesson 07 of 10 · published

Bitrate Modes — CBR, VBR, CRF, CQP

~10 min · bitrate, cbr, vbr, rate-control

Level 0Viewer
0 XP0/73 lessons0/15 achievements
0/100 XP to next level100 XP to go0% complete

The four rate-control modes

  • CRF (Constant Rate Factor) — quality target. File size varies. Default for libx264/x265/svtav1 single-pass.
  • VBR (Variable Bitrate) — average bitrate over the clip; bits flexibly allocated to busy scenes. Two-pass uses this.
  • CBR (Constant Bitrate) — every second hits the same bitrate. Used for streaming protocols that need a stable buffer. Wasteful for stored files but mandatory for live RTMP.
  • CQP (Constant Quantizer) — every macroblock uses the same quantization. Hardware encoders sometimes call this their 'CQ' mode.

Picking

For a stored file you'll watch later: CRF. For an upload you must size precisely: two-pass VBR. For live streaming: CBR. For hardware encoders: their proprietary 'CQ' or bitrate-cap mode (read ffmpeg -h encoder=...).

Code

All four modes, one source·bash
# CRF — quality target
ffmpeg -i in.mp4 -c:v libx264 -crf 20 -preset slow out_crf.mp4

# VBR (single-pass, average bitrate)
ffmpeg -i in.mp4 -c:v libx264 -b:v 4M -preset slow out_vbr.mp4

# CBR — constant bitrate (use for streaming)
ffmpeg -i in.mp4 -c:v libx264 -b:v 4M -minrate 4M -maxrate 4M \
  -bufsize 4M -preset slow out_cbr.mp4

# CQP — constant quantizer (rare, mostly for testing)
ffmpeg -i in.mp4 -c:v libx264 -qp 20 -preset slow out_cqp.mp4
Hardware bitrate caps·bash
# VideoToolbox with bitrate cap and buffer
ffmpeg -i in.mp4 -c:v h264_videotoolbox \
  -b:v 6M -maxrate 8M -bufsize 12M \
  -c:a aac -b:a 192k out.mp4

# NVENC with constant quality target
ffmpeg -i in.mp4 -c:v h264_nvenc -rc constqp -qp 22 \
  -c:a aac -b:a 192k out.mp4

External links

Exercise

Pick a clip with a mix of static and high-motion content (game footage, a music video). Encode it once with -crf 22, once with -b:v set to the bitrate the CRF version produced, once with the CBR variant of that bitrate. Visually inspect the high-motion sections — which mode keeps quality stable? Which sacrifices the static sections to feed the busy ones?

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.