Video compression has a vocabulary problem. Bitrate, CRF, resolution, codec, container: tutorials throw these words around as if everyone was born knowing them. Then you run an encoder, get a file twice as big or half as good as expected, and the manual might as well be written in assembly.
This guide explains the four ideas that actually matter, then shows how to use them.
Codec and container: the two layers
People say "MP4 video", but MP4 is a container, a box that holds video tracks, audio tracks, and subtitles. The video inside is encoded with a codec, which is the algorithm that squeezes the picture into fewer bits.
The codecs you meet in practice: H.264, the universal default that everything plays; H.265 (HEVC), its successor, roughly half the size at the same quality but with spottier support on older devices; and AV1, the newest, best royalty-free option, slow to encode and improving in support. For sharing a video with strangers on the internet, H.264 remains the safest choice; H.265 is the sweet spot when you control playback or size matters most.
Resolution: the canvas size
Resolution is the pixel grid, 1920x1080 for 1080p, 1280x720 for 720p. More pixels mean more detail and more data. But resolution alone does not determine quality or size: a 1080p video at a starvation bitrate looks worse than a crisp 720p. Resolution sets the ceiling; bitrate decides how much of that ceiling you can afford.
Bitrate: the budget
Bitrate is how many bits per second the file spends, measured in kilobits or megabits per second. Think of it as a data budget. Rich, detailed, fast-moving content needs a bigger budget to look clean; a static talking-head video looks fine on a small one.
As rough modern references for H.264 on-demand video: 1080p around 5 to 8 Mbps, 720p around 2.5 to 5 Mbps, 480p around 1 to 2 Mbps. H.265 achieves similar looks at roughly half these numbers. This is why streaming platforms publish quality ladders, a menu of bitrates and resolutions, and let each viewer's player pick what their connection sustains.
Two encoding modes use the budget differently:
Constant bitrate (CBR)
Spends the budget evenly. Wrong for most on-demand video, because static scenes waste bits and busy scenes starve. Its niche is live streaming, where predictable output matters.
Variable bitrate (VBR) and CRF
Spends the budget where it matters. CRF, constant rate factor, is the elegant form: you set a quality target from 0 to 51, and the encoder spends bits as needed to hold that quality, giving static scenes small budgets and complex scenes big ones. Lower numbers mean better quality and bigger files. For H.264, CRF 18 to 23 covers the sane range; 23 is the default and looks good for most content. H.265 at 23 to 28 performs similarly.
Putting it to work with FFmpeg
The one-liner you will actually use most:
ffmpeg -i input.mov -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 160k -movflags +faststart output.mp4
What each piece does: libx264 encodes H.264; CRF 23 targets good quality at default bitrate freedom; the preset trades encoding time for efficiency, slower presets squeeze more quality from the same bits; AAC at 160 kbps covers normal stereo audio; and faststart rearranges the file so playback can begin before the download finishes, essential for web viewing.
A workflow that works
Start from the highest-quality source you have. Compression is a ratchet: quality removed at step one never comes back. Encode once at CRF 23, check the file size, and only then decide whether to go further, dropping to CRF 25 to 26 or scaling 1080p to 720p if it is still too heavy. Compare on a real screen at full size, not a small preview window.
If you are publishing to a platform rather than hosting yourself, upload the least-compressed file that meets the size limit and let the platform's transcoder do the ladder encoding. Platforms like s.pub and every major video site run server-side HLS transcoding precisely so uploaders do not have to think about bitrates: give them a clean high-bitrate source and their pipeline produces the adaptive renditions viewers need.
The takeaway
Codec is the algorithm, container is the box, resolution is the canvas, and bitrate is the budget. CRF lets you set quality and let the budget float, which is why it is the right default for files people will actually watch. Learn those five words, keep the FFmpeg one-liner, and video compression stops being a mystery and becomes a dial you turn.
No comments yet