Every video encoder is quietly answering one question: how many bits can I spend on this frame? Spend too few and you get blocks, smeared faces and banding in the sky. Spend too many and the file balloons for no visible gain. Bitrate, CRF and two-pass encoding are just different ways of telling the encoder how to make that trade. Understand them and you can reliably get files that are small and clean.
Bitrate: the budget
Bitrate is how much data the video uses per second, usually in kilobits or megabits per second (kbps, Mbps). File size follows directly from it:
file size (megabytes) = total bitrate (megabits/s) x duration (s) / 8
Example: 5 Mbps video + 0.128 Mbps audio, 10 minutes
5.128 x 600 / 8 = about 385 MB
The catch is that video content varies wildly. A talking head against a plain wall needs very few bits; confetti, rain, water and fast camera pans need a great many. A single fixed number is always wrong for some part of the video.
Three ways to control the budget
| Mode | You set | What you get | Best for |
|---|---|---|---|
| Constant bitrate (CBR) | An exact bitrate | Predictable data rate; easy scenes waste bits, hard ones look worse | Live streaming, broadcast |
| Average / variable bitrate (ABR/VBR) | A target average | Bits move to harder scenes; size roughly predictable | When you need a size, with two-pass |
| Constant quality (CRF/CQ) | A quality level | Consistent look; size depends on the content | Archiving, sharing, most everyday encoding |
CRF: aim for a quality, not a size
CRF (Constant Rate Factor) tells the encoder “keep the quality at roughly this level and use however many bits that takes”. Easy scenes get few bits, hard scenes get more, and the result looks consistent from start to finish. For most purposes it is the right default.
The scale is backwards: lower numbers mean higher quality and bigger files. Each encoder has its own range and sweet spot:
| Encoder | Range | Default | Common starting points |
|---|---|---|---|
| x264 (H.264) | 0–51 | 23 | 18 (visually near-lossless) to 28 (small, softer) |
| x265 (HEVC) | 0–51 | 28 | 22–30 |
| libvpx-vp9 (VP9) | 0–63 | — | around 30–35, used with -b:v 0 |
| SVT-AV1 (AV1) | 0–63 | varies by version | high 20s to mid 30s |
A useful rule of thumb for x264 and x265: raising CRF by about 6 roughly halves the file size, and lowering it by 6 roughly doubles it. Do not compare numbers across encoders — CRF 28 in x265 is not the same thing as CRF 28 in x264.
# Good-looking, reasonably small H.264
ffmpeg -i input.mov -c:v libx264 -crf 21 -preset slow -c:a aac -b:a 128k out.mp4
# Same idea in HEVC, noticeably smaller at similar quality
ffmpeg -i input.mov -c:v libx265 -crf 26 -preset slow -tag:v hvc1 -c:a aac -b:a 128k out.mp4
# CRF with a ceiling - quality-driven, but never above 6 Mbps (handy for streaming uploads)
ffmpeg -i input.mov -c:v libx264 -crf 21 -maxrate 6M -bufsize 12M -c:a aac -b:a 128k out.mp4
The best way to pick a CRF is empirical: encode the same 30-second clip, ideally a demanding one, at three values and compare on the screen you care about. Pick the highest number you cannot tell apart from the lowest.
Presets: speed versus efficiency
Encoders such as x264 and x265 have presets from ultrafast to veryslow. A slower preset does not change the target quality; it lets the encoder search harder for efficient ways to describe each frame, so you reach the same quality in a smaller file. The gains shrink quickly past slow, so medium or slow is the usual sweet spot. Pick the slowest preset you have patience for, then tune CRF.
Hardware encoders (NVIDIA NVENC, Intel Quick Sync, AMD AMF) are a different trade: dramatically faster and lighter on the processor, but generally needing somewhat more bitrate for the same quality than a slow software encode. They have their own constant-quality modes rather than CRF. For day-to-day conversions, the speed usually wins.
VideoTech — Three Quality Settings Instead of Thirty
Not everyone wants to tune encoder flags. VideoTech boils quality down to three presets — Smaller file, Balanced and Best quality — alongside resolution and frame rate, the two settings that save the most space. Leave the video encoder on Auto and it picks the fastest one your machine can actually run, testing each rather than trusting what it claims to support. History is kept across restarts and shows what each conversion did to the file size.
Two-pass: aim for a file size
Sometimes the size is the requirement: an upload limit, a disc, a fixed bandwidth budget. CRF cannot promise a size, because it does not know in advance how demanding the video is. Two-pass encoding solves that. The first pass analyses the whole video and logs how complex each part is; the second pass uses that map to spread a fixed bit budget exactly where it is needed.
First, work out the bitrate. Say the limit is 100 MB for a 10-minute video with 128 kbps audio:
100 MB x 8 = 800 megabits = 800,000 kilobits
800,000 kbit / 600 s = 1,333 kbps total
1,333 - 128 (audio) = 1,205 kbps for video
Leave ~2-3% for container overhead -> use about 1,170k
Then run the two passes. The first pass throws its video output away (NUL on Windows, /dev/null on Linux and macOS):
ffmpeg -y -i input.mov -c:v libx264 -preset slow -b:v 1170k -pass 1 -an -f null NUL
ffmpeg -i input.mov -c:v libx264 -preset slow -b:v 1170k -pass 2 -c:a aac -b:a 128k out.mp4
Two-pass at a given average bitrate and single-pass CRF that happens to land on the same size look very similar — the point of two-pass is hitting the target, not magic quality. If you do not need a specific size, CRF is simpler and faster.
Keyframes and GOP length
A keyframe is a complete picture; the frames after it, up to the next keyframe, are stored as changes. That run of frames is a GOP (group of pictures). Long GOPs compress better, because changes are cheap and full pictures are expensive. Short GOPs make seeking snappier and let streaming players switch quality more often.
x264 defaults to a maximum keyframe interval of 250 frames and also inserts extra keyframes at scene cuts, which suits files for download and local playback. Adaptive streaming usually wants fixed intervals instead — commonly every two seconds:
# 30 fps source: a keyframe exactly every 60 frames (2 s), no extra scene-cut keyframes
ffmpeg -i input.mov -c:v libx264 -crf 22 -g 60 -keyint_min 60 -sc_threshold 0 -c:a aac out.mp4
Unless you are preparing video for a streaming server, leave keyframe settings at their defaults.
The settings that save the most space
Codec tweaks get the attention, but some of the biggest savings are elsewhere:
- Resolution. A 4K file scaled to 1080p has a quarter of the pixels. If it will only be watched on a laptop or phone, that is the biggest single saving available.
- Frame rate. A 60 fps screen recording of slides gains nothing over 30 fps.
- Codec. Moving from H.264 to HEVC or AV1 gives the same quality in noticeably fewer bits, if your devices can play it.
- Audio. 128 kbps AAC or 96 kbps Opus is plenty for most stereo content; uncompressed audio tracks can outweigh the video.
- Length. Silence and dead air cost bits like anything else.
Mistakes that make video ugly
- Re-encoding an already compressed file at a high bitrate. It cannot restore lost detail; it just makes a bigger copy of the same artefacts. If you only need a different container, remux instead.
- Repeated re-encodes. Each lossy generation adds damage. Always work from the best original you have.
- A fixed low bitrate for high-motion content. Sport and confetti at CBR fall apart; use CRF or two-pass so the bits go where they are needed.
- Judging quality on a paused frame. Watch it moving, at the size it will actually be viewed.
For a look at how this all comes together in a single Windows app — plus on-device AI subtitles, audio cleanup, silence removal, face blur and upscaling — see our introduction to VideoTech.
VideoTech — Smaller Files, Less Dead Air
The cheapest bit is the one you never encode. VideoTech can cut the silence out of a long recording with a speech model rather than a volume threshold, inside the same single conversion pass — and clean up noisy audio before it does. It is all on-device, works on a whole folder at once, and runs headless from a script with the same format, quality, resolution and frame-rate options as the window.
Key takeaways
- Bitrate is the data budget per second; file size follows directly from bitrate and duration.
- CRF targets a quality level — lower is better and bigger. Start around 21–23 for x264 and 26–28 for x265; +6 roughly halves the size.
- Two-pass targets a file size: calculate the bitrate from the limit and duration, minus audio and a little overhead.
- Slower presets give smaller files at the same quality; hardware encoders trade some efficiency for a lot of speed.
- Leave keyframe settings alone unless you are preparing adaptive streaming.
- Resolution, frame rate, codec, audio and length often save more than any encoder flag. VideoTech wraps the essentials in three quality presets and adds on-device silence removal.
VideoTech — Three Quality Settings Instead of Thirty
Not everyone wants to tune encoder flags. VideoTech boils quality down to three presets — Smaller file, Balanced and Best quality — alongside resolution and frame rate, the two settings that save the most space. Leave the video encoder on Auto and it picks the fastest one your machine can actually run, testing each rather than trusting what it claims to support. History is kept across restarts and shows what each conversion did to the file size.

Leave a Reply