← Home

videocompression Blog

How Does Video Compression Work?

2026-10-29

How Does Video Compression Work?

A minute of raw 1080p video is roughly 10 gigabytes. Yet the movie you stream is a few gigabytes *per hour*. Video compression routinely shrinks footage by 100x or more — while still looking good. Here's how, in plain English.

The core idea: remove what you won't miss

Compression exploits three kinds of redundancy:

  1. Spatial redundancy — within a single frame, neighboring pixels look alike (a blue sky is mostly just... blue).
  2. Temporal redundancy — between frames, most of the picture doesn't change. In a talking-head video, only the mouth moves.
  3. Perceptual redundancy — your eyes are less sensitive to fine color detail than to brightness, so color can be stored more coarsely.

I, P and B frames

Instead of storing every frame fully, encoders store:

A typical stream is mostly tiny P and B frames anchored by occasional I-frames. That's where the biggest savings come from.

Transform, quantize, entropy-code

Each block of pixels goes through a pipeline:

  1. Transform (DCT) — converts pixel data into frequencies. Most image energy concentrates in a few low frequencies.
  2. Quantization — the lossy step. High frequencies get rounded aggressively or zeroed out. This is where quality is *decided*: the famous CRF/quality setting directly controls how brutal this rounding is.
  3. Entropy coding — the remaining data is packed losslessly (like a ZIP file).

Higher CRF = harsher quantization = smaller file, more artifacts. Lower CRF = gentler = bigger file, cleaner image.

Motion compensation: the real magic

The encoder searches for where each block of the image *moved* between frames and stores just a motion vector ("shifted 12 pixels right") plus the small leftover difference. Static backgrounds cost almost nothing. This is why a slideshow compresses to nearly nothing while confetti exploding compresses terribly — there's no shortcut for pure randomness.

Codecs: H.264, HEVC, VP9, AV1

A codec is just the agreed-upon recipe for all of the above. Newer codecs are smarter at prediction, so they need fewer bits for the same quality:

CRF vs. bitrate: how you control it

For most people, CRF 23 (H.264) or CRF 28 (AV1) hits the sweet spot.

The takeaway

Video compression is prediction plus clever discarding: store one full frame, then just the *differences*, and round away detail your eyes won't catch. Modern codecs just predict better. If you want to try it hands-on, our free online video compressor lets you transcode MP4 and WebM with adjustable CRF right in your browser — no upload, no install.