Compressing video for the web without guessing
Every export dialog offers a quality slider and tells you nothing about what it does. Four settings decide the file size, and understanding them replaces trial and error.

Short answer
Four settings decide the size: resolution, frame rate, codec and bitrate. Halving the resolution cuts roughly three quarters of the data; dropping 60fps to 30 halves it again. Choose H.264 for compatibility everywhere or H.265/AV1 for a much smaller file that older devices may not play, and set a quality target rather than a bitrate.
On this page
Most people compress video by moving a slider, exporting, checking the size, and repeating. That works and takes twenty minutes. Knowing which four numbers matter takes one attempt.
The four settings
1. Resolution. The largest single factor, and the one people touch last. Halving each dimension — 1080p to 540p — quarters the pixel count. For video that will be watched in a feed, on a phone, or in a small embed, 720p is usually indistinguishable from 1080p and roughly half the size.
Match the resolution to where it will be watched, not to what the camera produced.
2. Frame rate. 60fps carries twice the data of 30fps. It is worth it for fast motion, sport and gameplay. For a talking head, a screen recording of someone typing, or a slow product demo, 30fps looks the same and costs half.
3. Codec. How efficiently the data is packed.
- H.264 — plays everywhere, on everything, including old devices. The safe choice, and the largest file.
- H.265 / HEVC — roughly 30–50% smaller at the same quality. Playback support is good but not universal.
- AV1 — smaller still, royalty-free, well supported in current browsers and increasingly in hardware. Slower to encode.
- VP9 — widely supported on the web, a reasonable middle ground.
For a file people will download, H.264. For a web page where you control the player, AV1 or H.265 with an H.264 fallback.
4. Bitrate. How much data per second. Two ways to set it:
- Constant bitrate (CBR) — a fixed number. Predictable size, wasteful on simple scenes, poor on complex ones.
- Quality-targeted (CRF) — you set a quality level and the encoder spends what each scene needs. Better results at the same average size.
Prefer the quality target. In tools built on ffmpeg this is -crf: lower is better quality, around 18 is visually lossless, 23 is a good default, 28 is noticeably soft.
# A good general-purpose web export
ffmpeg -i input.mov -vf scale=-2:720 -r 30 -c:v libx264 -crf 23 -preset slow -c:a aac -b:a 128k -movflags +faststart output.mp4-movflags +faststart moves the index to the front of the file so playback can begin before the download finishes. Leaving it out is why some videos appear to hang before they start.
Audio is not free
Audio is often left at whatever the source was, which can be a surprisingly large share of a small file.
- 128 kbps AAC is fine for speech and most music in a web context.
- 64 kbps mono is fine for a screen recording with narration, and can halve the audio track.
- No audio at all for a silent background loop — and it should also be muted in the player, or browsers will not autoplay it.
Doing it without uploading
The same privacy question applies as to any online file tool: a video of your family, your workplace or your client's product uploaded to a free converter is a file on someone else's server.
- ffmpeg locally does everything above and is the reference implementation everything else wraps.
- Several browser-based tools run ffmpeg compiled to WebAssembly, so the file never leaves the tab. Verify it by disconnecting the network before processing.
- Handbrake is a graphical front end for people who would rather not use a command line.
Which numbers to start from
- Social feed — 720p, 30fps, H.264, CRF 23.
- Web page hero loop — 1080p with no audio, 30fps, AV1 or H.265, CRF 28.
- Screen recording — scaled to 1080p, 30fps, H.264, CRF 20.
- Archive master — native resolution and frame rate, H.264, CRF 18.
Start there, encode once, and only adjust if the result is actually wrong. The slider-and-retry loop exists because nobody tells you which knob does what.
What does it mean to compress video?
To compress video is to remove data the viewer will not miss, and there are 4 controls that decide how much: resolution, frame rate, codec and bitrate. Every export dialog exposes some of them, usually behind one slider that says nothing about which it is moving.
Which setting saves the most?
| Setting | Change | Roughly saves |
|---|---|---|
| Resolution | 1080p to 720p | Over half the data |
| Frame rate | 60 to 30fps | Half |
| Codec | H.264 to AV1 | 40–50% at equal quality |
| Bitrate mode | CBR to CRF | Better quality at the same size |
| Audio | 256 to 128 kbps AAC | A few percent, more on short clips |
Resolution is first because it is the largest single factor and the one people touch last. Match it to where the video will be watched rather than to what the camera produced.
Which codec should you choose?
- H.264 — plays on everything, including old devices. The right answer for a file people download.
- H.265 / AV1 — substantially smaller, well supported in current browsers, less so elsewhere. The right answer for a page you control, with a fallback.
Set a quality target rather than a fixed bitrate: in ffmpeg that is -crf, where about 18 is visually lossless, 23 is a good default and 28 is noticeably soft. And add -movflags +faststart, which moves the index to the front so playback can begin before the download finishes — its absence is why some videos appear to hang. See video tools, online tools and file tools.
Audio is not free
Audio is often left at whatever the source used, and on a short clip it can be a surprising share of the file.
- 128 kbps AAC is fine for speech and most music on the web.
- 64 kbps mono suits a screen recording with narration and halves the track.
- No audio at all for a silent background loop — and mute it in the player too, or browsers will not autoplay it.
Doing it without uploading
The same privacy question applies as to any file tool. A video of your family, your workplace or a client's product uploaded to a free converter is a file on someone else's server.
ffmpeg does all of the above locally and is the reference implementation that most other tools wrap. Handbrake gives it a graphical front end, and several browser tools run ffmpeg compiled to WebAssembly so the file never leaves the tab — verify by disconnecting the network before processing.
Encode once, from the original, at the settings the destination needs. The slider-and-retry loop exists only because nobody explains which knob does what. Start from the table above, encode once, and only adjust when the result is actually wrong rather than when the number looks large.
Compression is a trade between size and detail. The only bad version is the one where you did not know which you were giving up.
What to do when it is still too large
If the source is 20 minutes of screen recording, no codec setting makes it small. The options are real ones: trim it, split it, host it rather than attach it, or drop the resolution a step further and accept the result.
Compress video from the original every time. Re-encoding an already-compressed file applies a second round of lossy compression to damage that is already there, and no CRF value recovers it.
Frequently asked questions
- What is CRF and why prefer it to a bitrate?
- CRF is a quality target rather than a data rate — the encoder spends more on complex scenes and less on simple ones. At the same average size the result is better than a fixed bitrate, which wastes data on easy frames and starves hard ones.
- Should I use H.265 or AV1 instead of H.264?
- For a page where you control the player and can offer a fallback, yes — both are substantially smaller. For a file people download and open in whatever they have, H.264 still plays everywhere.
- Why does my video pause before playing?
- Often because the file's index is at the end, so the player must download most of the file before it can start. Exporting with faststart moves the index to the front.
- Can I compress video without uploading it?
- Yes. ffmpeg and Handbrake work locally, and several browser-based tools run ffmpeg through WebAssembly so the file never leaves the tab. Disconnect the network to confirm.
Sources
- FFmpeg documentation — FFmpeg
- H.264 Video Encoding Guide — FFmpeg Wiki
- AV1 Codec — Alliance for Open Media
Published by
Loopara
Practical guides, free tools, workflows, and resources for productivity, files, images, video, text, creators, and everyday digital tasks.
About the publication