Keyframes and inter-frame compression
A keyframe (I-frame) stores a complete picture. Most frames in a video are not keyframes — they are P-frames or B-frames, which only store what changed from a nearby keyframe.
This works because most frames in a video look almost identical to the frame before. Storing only the differences is dramatically smaller than storing every full picture.
Motion estimation
Codecs analyse motion between frames and describe it as small offsets: 'this block from the previous frame, moved 4 pixels right'.
Combined with a tiny correction, this represents complex movement using far fewer bits than encoding new pixels.
Bitrate and quality
Bitrate is how many bits per second the encoder uses. Higher bitrate means more detail, larger files, and better quality.
Common 1080p H.264 bitrates: 2 Mbps for screen recordings, 5 Mbps for general footage, 8–12 Mbps for high-motion content.
Variable bitrate (VBR) lets the encoder spend more bits on complex scenes and fewer on static ones — usually better quality per byte.
Codec families
H.264 (AVC): the universal standard. Great quality, hardware-accelerated everywhere.
H.265 (HEVC): about 30–50% smaller than H.264 at the same quality. Common in 4K and Apple devices.
VP9: Google's open answer to H.265, used widely on YouTube and the web.
AV1: the newest open codec — best compression, but slower to encode. Increasingly used by streaming services.