Codec
The algorithm that squeezes video small enough to stream — and rebuilds it on the viewer's screen. The choice behind quality, file size and device support.
A codec is the compression algorithm that shrinks video for storage and streaming and rebuilds it for playback — H.264, H.265 and AV1 are the common ones, trading efficiency against device support.
What is a codec?
A codec (coder–decoder) is the algorithm that compresses video into a manageable size for storage and streaming, then decompresses it for playback. Raw video is enormous — far too large to stream — so every video you watch online has been through a codec.
A codec is not the same as a file format. The codec encodes the actual video and audio; the container (MP4, MOV, WebMWebMGoogle’s open video container with VP8, VP9 or AV1 inside. Browser recordings produce it; MP4 is still the more compatible choice.Open definition →) is the wrapper that holds the encoded streams plus metadata and subtitles. An MP4 file typically carries H.264 video and AAC audio inside it — two codecs, one container.
The codec choice drives the trade-off at the heart of streaming: better compression means smaller files and lower bitrateBitrateThe amount of data used per second of video. Higher bitrate means more detail and a larger file; the core lever behind streaming quality.Open definition → for the same quality, but often at the cost of heavier encoding and narrower device support.
The common video codecs
| Codec | Also known as | Efficiency | Support | Notes |
|---|---|---|---|---|
| H.264H.264 (AVC)The most compatible video codec: practically every browser, phone and smart TV plays it. The safe format to upload and deliver.Open definition → | AVC | Baseline | Universal | The safe default |
| H.265HEVC (H.265)The successor to H.264: the same picture at up to half the bitrate. The iPhone records in it, but only some browsers play it.Open definition → | HEVC | ~2× H.264 | Broad | Licensing cost; 4K4K (2160p)Ultra HD at 3840×2160 — four times the pixels of Full HD, and the point where codec choice starts paying for itself.Open definition →-friendly |
| AV1AV1The open, royalty-free codec: about 40% less data than H.264 for the same picture, in exchange for heavier encoding.Open definition → | — | Best; royalty-free | Growing | Heavy to encode |
| VP9 | — | ~H.265; royalty-free | Broad (web) | Common on YouTube |
H.265 and AV1 reach similar quality at roughly half the bitrate of H.264 — the reason large platforms invest in them despite higher encoding cost.
Audio codecs
Video always ships with an audio codec alongside it, and the same efficiency-vs-support logic applies:
| Codec | Efficiency | Where it's used |
|---|---|---|
| AAC | Standard | HLS and most web video — the default |
| Opus | Better at low bitrates; royalty-free | WebRTC, WebM |
| MP3 | Older, less efficient | Legacy / audio-only |
Just like video, the platform picks an audio codec the target device can decode — you don't choose it by hand.
Further reading
- Video codec — Wikipedia — a vendor-neutral overview.
- Alliance for Open Media — AV1 — the AV1 codec project.
- Video metadata viewer — see which codec, profile and bitrate a file uses.






