Technology

CRF vs Bitrate: Two Ways to Control Video Compression

Constant quality (CRF) and target bitrate are the two main ways encoders decide file size. Learn how each works, with FFmpeg examples you can copy.

By Published October 2, 2026 9 min read

Every video encoder has to answer one question for every frame: how many bits can I spend here? There are two common ways to tell it. You can ask for a quality level and let the size fall where it may, or you can ask for a size (through a bitrate) and let the quality vary. Knowing the difference explains why two tools can produce very different files from the same settings.

CRF: constant quality

CRF (Constant Rate Factor) is the quality mode in the popular x264 and x265 encoders. You choose a number, and the encoder aims for that perceived quality throughout the video. Simple scenes get few bits, complex scenes get many. The result looks consistent, but you cannot know the file size in advance: a static screen recording might come out at 5 MB and a confetti-filled party clip of the same length at 80 MB.

EncoderDefault CRFTypical rangeEach +6 roughly
x264 (H.264)2318 to 28Halves the bitrate
x265 (H.265)2822 to 32Halves the bitrate
SVT-AV1about 3525 to 45Varies by preset

Lower numbers mean higher quality. CRF values are not comparable across encoders: x265 at 28 looks roughly like x264 at 23.

# H.264, constant quality
ffmpeg -i input.mp4 -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k output.mp4

# H.265, constant quality, tagged so Apple devices play it
ffmpeg -i input.mp4 -c:v libx265 -crf 28 -preset medium -tag:v hvc1 -c:a aac -b:a 128k output.mp4

Bitrate targets: predictable size

With a bitrate target (often called ABR, average bitrate), you tell the encoder how much data per second to use on average. File size becomes predictable: bitrate times duration. The encoder still moves bits around, giving complex frames more and simple frames less, but it must hit the average. Easy footage ends up looking great; hard footage may look soft.

# H.264 at an average of 2.5 Mbps
ffmpeg -i input.mp4 -c:v libx264 -b:v 2500k -preset medium -c:a aac -b:a 128k output.mp4

Two-pass: the best way to hit a size

A single pass has to guess how to spread the budget before it has seen the whole video. Two-pass encoding analyzes the full video first, then encodes with that knowledge, which gives better quality at exactly the same size. It takes about twice as long.

# Pass 1 (analysis only, no output file)
ffmpeg -y -i input.mp4 -c:v libx264 -b:v 2500k -preset medium -pass 1 -an -f null /dev/null

# Pass 2 (the real encode)
ffmpeg -i input.mp4 -c:v libx264 -b:v 2500k -preset medium -pass 2 -c:a aac -b:a 128k output.mp4

On Windows, replace /dev/null with NUL. To pick the bitrate for a size limit, use the video size calculator or the formula in how to calculate video file size.

Capped CRF: a useful middle ground

You can combine both: constant quality, but with a ceiling so busy scenes cannot blow up the size. This is popular for streaming and archives.

ffmpeg -i input.mp4 -c:v libx264 -crf 23 -maxrate 4M -bufsize 8M -c:a aac -b:a 128k output.mp4

Which one should you use?

GoalBest mode
Archive with consistent quality, size does not matterCRF
Fit a hard limit (Discord, WhatsApp, email)Two-pass bitrate
Predictable size, fast turnaroundSingle-pass bitrate
Streaming or uploads with a bandwidth ceilingCapped CRF

What BoltCompress does

BoltCompress uses a single-pass bitrate target based on your original: about 75%, 45%, or 25% of the source video bitrate depending on the level. We chose this over CRF because it guarantees the output is smaller than the input, which CRF does not: re-encoding an already compressed file at a fixed CRF can make it bigger. It also lets the tool show an estimated size before you start. The trade-off is that very complex footage at Maximum Savings can look soft. The details are on the how it works page.

Summary

CRF fixes quality and lets size vary. Bitrate targets fix size and let quality vary. Use CRF when you care about consistent quality, two-pass bitrate when you must hit a limit, and capped CRF when you want a bit of both.

Quick answers

What CRF value should I use?

For x264 (H.264), 18 to 23 is a common range, with 23 as the default. For x265 (H.265), 22 to 28, with 28 as the default. Lower numbers mean higher quality and bigger files.

How do I compress a video to an exact file size?

Use a bitrate target, ideally with two-pass encoding. Calculate the bitrate from the size limit and duration, subtract the audio bitrate, and leave a few percent of headroom.

Try it on your own video

Upload a video, see the estimated size for each level, and download a smaller file. Free, no install.

Open the compressor