Motion Compensation
Also known as: motion estimation video, motion compensation codec, motion compensation
Motion compensation is a video compression technique that encodes a frame as motion vectors pointing to similar blocks in earlier or later frames, plus a small residual, instead of storing every pixel again. It is the main reason video files are far smaller than the sum of their frames.
- Stores motion vectors plus a small residual instead of repeating pixels across frames.
- Relies on I-, P-, and B-frames; only I-frames skip motion compensation entirely.
- Newer codecs (HEVC, AV1) use larger, variable blocks for better compression than H.264.
How motion compensation works
Most adjacent video frames are nearly identical, so re-storing each one in full wastes space. A codec splits a frame into blocks (in H.264/AVC these are macroblocks, in HEVC and AV1 they are larger, variable-size coding units) and, for each block, searches earlier or later reference frames for a region that looks the same. That search is called motion estimation.
When a close match is found, the encoder stores a motion vector (how far and in which direction the block moved) instead of the pixels themselves. The leftover difference between the predicted block and the real block is the residual, which is transformed, quantized, and entropy-coded. A block that barely changed needs only a tiny vector and a near-zero residual.
Frame types and prediction
Compressed video uses three frame roles. An I-frame (intra) is coded on its own with no motion compensation and acts as a seek point. A P-frame (predicted) references one earlier frame. A B-frame (bi-directional) can reference both past and future frames, often giving the best compression. The repeating pattern of these frames is the GOP (group of pictures).
Modern codecs add sub-pixel motion (quarter- or eighth-pixel accuracy) and multiple reference frames so prediction tracks smooth, gradual motion precisely. Fast cuts, lots of grain, or chaotic motion defeat prediction, force more I-frames and bigger residuals, and inflate file size.
Why it matters for storage
Motion compensation, paired with the bitrate and codec you record at, is the dominant factor in how much space your videos occupy. A static talking-head clip compresses far more than the same length of action footage because its blocks barely move between frames.
When Cleanor surfaces your largest files, long videos almost always top the list. Re-encoding them to a newer codec such as HEVC or AV1, which use smarter, larger-block motion compensation, can cut size substantially with little visible quality loss, freeing space without deleting the footage.