Codec
Also known as: codecs, video codec, audio codec
A pair of algorithms — encoder and decoder — that compress and decompress media. The reason a 4K video isn't a terabyte.
- Primary domain
- Graphics & Media
- Sub-category
- Photograph Manipulation & Image Compression
In simple terms
Raw audio and video are huge. A second of 1080p60 raw video is hundreds of megabytes. A codec (“coder/decoder”) is the algorithm that squeezes that down to a few megabits per second on the way out, and reconstructs a visually-similar copy on the way back in.
More detail
Video codecs exploit:
- Spatial redundancy within a frame (like JPEG does for images).
- Temporal redundancy between frames — most of one frame looks like the previous one. Encode the difference, not the whole picture.
- Motion estimation — describe how blocks of pixels moved between frames.
- Entropy coding — pack the bits efficiently.
Frames come in types:
- I-frame (intra) — encoded from scratch. Random-access point.
- P-frame (predicted) — encoded as differences from the previous frame.
- B-frame (bidirectional) — uses both past and future references.
Major video codecs in 2026:
| Codec | Family | Notes |
|---|---|---|
| H.264 / AVC | Mainstream | Universal compatibility, modest compression. |
| H.265 / HEVC | Better | Patent-encumbered; widespread on Apple devices. |
| AV1 | Royalty-free | ~30% smaller than H.265 for same quality. Hardware-decode now common. |
| VP9 | Royalty-free | YouTube workhorse; AV1’s predecessor. |
| H.266 / VVC | Next-gen | Even better compression; rolling out. |
Audio codecs: Opus (modern, free), AAC (Apple/streaming), MP3 (legacy), FLAC (lossless).
Codecs are wrapped in containers: MP4, WebM, MKV, MOV. The container holds video, audio, subtitles, and metadata; the codec is what’s inside.
Why it matters
Codecs are what make video streaming, video calls, and modern photography possible. They are also a battleground of patents and royalties — the move toward royalty-free codecs (AV1, Opus) is a major industry trend.
Real-world examples
-
Netflix streams in AV1 (and HEVC) to save bandwidth.
-
A WhatsApp voice note uses Opus.
-
YouTube delivers different codecs to different devices based on what they can decode in hardware.
-
A single Netflix title is encoded into dozens of variants (different codecs, bitrates, resolutions) so adaptive streaming can pick the right one for each viewer’s bandwidth.
Common misconceptions
- “MP4 is a codec.” MP4 is a container. The video inside it is usually H.264 or HEVC.
- “Lossless video is just impractical.” It’s used in production and archiving; broadcast and streaming use lossy codecs because the size difference is enormous.
Learn next
The still-image equivalent: image format. The atomic display unit: pixel.
Read this in a learning path
All paths →This topic is part of a learning path. Start in context to keep prev/next and progress tracking.
Relationships
- Requires
- Related
- Required by
Neighborhood
A visual companion to the relationships above. Click any node to visit that topic.