Do you know the difference between a codec, a container and a format?

Published on by electricproductsview

Have you ever confused about the difference between a codec and a container format and video format?

A codec is a compression algorithm, used to reduce the size of a stream. There are audio codecs and video codecs. MPEG-1, MPEG-2, MPEG-4, Vorbis, DivX, ... are codecs. It is used by video players to determine how the video needs to be played correctly on the system. Many video players on a computer system come with their own set of binary codecs that only they can use. Codec packs on the other hand install codecs system wide so that applications like Windows Media Player can make use of them to play specific video formats.

 

A container format contains one or several streams already encoded by codecs. Very often, there is an audio stream and a video one. AVI, Ogg, MOV, ASF, ... are container formats. The streams contained can be encoded using different codecs. In a perfect world, you could put any codec in any container format. Unfortunately, there are some incompatibilities.

 

A format consists basically of a set of rules and parameters that define the video. This is the native resolution, color depth, the frames per second among other parameters. Video format examples are the DVD video format, the 3GP video format or 1080p and 1080i formats. A format does not necessarily mean anything about the video quality, it only dictates the underlying structure of a file. I always scratch my head when people say things like "I like AVIs better than MPEGs because they're smaller," which is a statement that makes absolutely no sense. I've had an AVI file that's 26GB large, orders of magnitude larger than most MPEG files. The fact is that formats like AVI and Quicktime have little to nothing to do with the underlying Codec, except that the limitations of a format must be adhered to in the codec. For instance, AVI does not support bidirectional-predicate frames, therefore the MPEG4 implementation that Microsoft made for AVI/ASF is incomplete as it does not implement this essential feature of the MPEG specification.

 

One advantage of using a container for a video is that programs can use different codecs for the tracks of the video. It is therefor possible to use one codec for the video and one for the audio, which is often preferable to using a single codec.

 

Published on movie format

To be informed of the latest articles, subscribe:
Comment on this post