Back

Multimedia container formats

Introduction
Different streams of data are produced when you record a video. Typically, this will be a video stream (recorded in something called H.264) and an audio stream (recorded in something called ACC). There may be other streams that involve still images or text, for example. A container format simply describes how the data in a number of different multimedia streams are wrapped up into one single file format. The container format definition defines the file structure, how the metadata (the data about the data) in the file header will be organised, information about timings and when the different tracks in the container should be played relative to each other (sychronisation). 

videoTypical container formats
Video is frequently shot in a format called H.264 (also known as MPEG-4 Part10). Audio is frequently recorded in a format known as ACC. In both cases, there are other formats that could be used. Once recorded, a codec is then applied to these data streams to compress the streams and then they are wrapped up into a single file format. The user now doesn't see an H.264 file along with an ACC file. They just see an mp4 file, for example. This is an mp4 container, which holds the H.264 video and the ACC audio files, both of which have been compressed.

Multimedia streams can be stored in a range of containers. There are different onces because each one is designed for a particular quality, or for use with some particular hardware or software. Although one of the most common containers used these days is the MP4 format, you will frequently come across the other commonest ones. These include:

.mp4 - one of the most common containers for MPEG-4 media.
.m4a - audio-only files can have the .mp4 extension.
.mov - the Apple-specific video format.
.3gp and .3g2 - used by 3G phone and tablet devices.
.ogg - A free, open standard container format for sound.
.flv, .swf - A video and audio container developed by Adobe for their Flash Player.
.asf, .wmv - Developed by Windows for their Windows Media Player
.
.avi - Another Microsoft container for video.

Container format, container file or codec?
All of the above are container files. They simply provide a wrapper around a number of data streams. The container format is the definition of these files, defining the file structure, how the metadata (the data about the data) in the file header will be organised, information about timings and when the different tracks in the container should be played relative to each other (sychronisation). Inside the container file, the data streams will almost always be compressed. There are a number of ways to do this but these days, the compression method used for a particular container file is nearly always defined in that file's container format. Because of this, many people use 'container format', 'container file' and 'codec' interchangeably. Strictly speaking, however, as we have seen, they are not. .mp4 etc are all container files.

Data compression
Data compression is where a Maths formula is applied to the data streams to make them take up less space than if they weren't compressed. There are two main ways of doing this. Lossless codecs compress data in a way that preserves all of the original data in a data stream. Lossy codecs compress data in a way that degrades the original file a little bit but in a way that is hardly noticable. 

Back