Lossy and Lossless Compression
How encoders shrink audio, images, and video.
Read moreHow media files shrink and travel: lossy and lossless compression, codecs, and container formats explained.
Codecs and containers decide how media files are sized and shaped. A codec is an algorithm that compresses data for storage and decompresses it for playback. Compression comes in two families: lossy, which discards detail people notice least, and lossless, which reconstructs the original exactly.
Containers are the wrappers that hold encoded streams together, video beside audio, subtitles, and metadata, in one file. Well-known pairings such as MP4 carrying H.264 video and AAC audio are examples of the codec-inside-container pattern.
The articles here explain the two ideas separately and then show how they fit together, with the concepts first and the format lists second.