


We use cookies to improve your experience
We use essential cookies to make our site work. With your consent, we may also use non-essential cookies to improve user experience.
Definition
A codec (coder-decoder) is software or hardware that compresses and decompresses digital media. Video codecs like H.264, H.265, VP9, and AV1 compress video for storage and streaming. Audio codecs like AAC, MP3, and Opus compress audio. The codec determines quality, file size, and compatibility.
Codecs are the algorithms that make digital video and audio practical. Uncompressed 1080p video generates about 1.5 Gbps of data — impossible to stream or store efficiently. Video codecs compress this by 100-1000x using techniques like motion estimation (predicting frames from previous ones), transform coding, and entropy coding.
Major video codecs include: H.264/AVC (the current universal standard, supported everywhere), H.265/HEVC (50% more efficient but with licensing complexity), VP9 (Google's open codec, widely used on YouTube), and AV1 (the newest open codec with the best compression). Each generation of codecs achieves roughly 30-50% better compression than the previous.
Codec choice involves trade-offs between compression efficiency, encoding speed, decoding complexity, licensing costs, and device support. H.264 remains the safe default for maximum compatibility. AV1 is the future for streaming services that can afford the encoding cost. For web developers, understanding codecs helps in choosing video formats and configuring media delivery pipelines.