One of the most commonly misunderstood parts of video production is the difference between a Codec and a Container, so let’s set the record straight.
Containers are what we typically call a file format. What it does is in its name. It ¨contains¨ all the various elements of the video: the audio track, metadata, and visual track. Some common containers are AVI and MPEG.
Any audio or video track that is in a container has to compressed and decompressed for it to be stored and played back on your computer. A compression scheme is how the track is compressed. It is the language of the compression and decompression. Some common compression schemes are H.264 and ProRes.
A codec is a program that interprets the audio or video track and chooses what compression scheme to use. It is the enabler in the system. A codec has two components: an encoder that compresses data and a decoder that decompresses the data. Some common codec are Xvid and DivX.
Let’s look at it this way, if a video file was a bookshelf, the container would be the bookshelf frame. It would be what holds all the information in one place: all those audio and video tracks. The Compression Scheme would be the writing in the books. It would be the information on how it is compressed or encoded. Finally the codec would be the author of the book, the one deciding which compression scheme to use and making that scheme to be put into action.