Codec

Definition
A codec is a software or hardware tool used to compress and decompress digital media files such as audio, video, or images. The term comes from "coder-decoder." Codecs reduce file sizes for storage and transmission, then decode the data for playback.
Different codecs are optimised for different needs. Some prioritise quality with less compression, while others reduce file size for faster streaming and lower bandwidth usage. Codecs are essential for media distribution across devices, platforms, and networks.
Advanced
At an advanced level, codecs use algorithms that balance compression efficiency, quality, and processing requirements. Video codecs such as H.264, H.265 (HEVC), AV1, and VP9 are common in streaming, while MP3, AAC, and FLAC are used for audio. Lossy codecs remove some data for smaller files, while lossless codecs preserve all information for maximum quality.
Performance considerations include compatibility with playback devices, encoding speed, decoding efficiency, and licensing costs. Emerging codecs like AV1 are designed to deliver high-quality video at lower bitrates for modern streaming environments.
Why it matters
Use cases
Metrics
Issues
Example
A streaming service adopts H.265 (HEVC) to deliver 4K video. Compared to H.264, it achieves similar visual quality at nearly half the bitrate, reducing bandwidth costs while maintaining a smooth viewing experience for users.