28 March 2013

Video file containers


Anyone who uses video on a computer, from editors to casual users, knows that sometimes different video formats can be incompatible with software. Luckily all the major video player applications that come with a computer (e.g. Windows Media Player, QuickTime Player) or are downloaded from the Internet (e.g. VLC, MPEG Streamclip and many others) can play almost any video we throw at them. But if you want to know more about formats and their peculiarities, read on.


A video "format" is a loose umbrella term, but can be said to comprise a container and the audio-visual tracks within the container.

The file container is the most visible part of the file to the user. It determines the file extension, which often determines what icon is given to the file and what application will open it, such as Windows Media Player, QuickTime or VLC. The container is not just an empty shell though, it gives information to the software about how the various tracks (or "streams") are interleaved together for synchronisation, which include not just video and audio but also subtitles data and chapter markers.

There might be many media tracks inside the container, such as multiple video for varied angles (as found on DVDs), multiple audio for mono, stereo, surround sound etc, multiple subtitles for various countries, chapter markers, and other metadata such as keywords for searching. Some software can extract these tracks to separate them, which is useful if you want to copy the audio track from a video and use it elsewhere.

QuickTime 7's Movie Properties shows the media tracks in the container and allows some modification to them.

Different containers have different capabilities. Matroska MKV is fairly modern and can contain unlimited tracks. Audio-Video Interleave AVI is older and is more restricted.

The video, audio or subtitle tracks are each encoded in a codec. The details about the codec are usually not shown to the user but can be revealed in an information panel, for example in QuickTime go to Window -> Show movie inspector.

The Inspector panel in QuickTime shows additional details like the codecs of the media, frame rate and frame size.

The file container doesn't describe how its media is encoded, it is up to the software to decode the media for playback. You might be familiar with the situation where a video file could (or should) be opened by the software, but cannot be played; this is likely because the software is not equipped to decode the particular codec inside the container.

QuickTime X shows this message when it requires a codec which isn't installed. Clicking the "Tell Me More" button takes the user to an Apple web page which explains the various codecs supported by default.

QuickTime 7 gives the user less useful information.

MPEG-4 is now a very common format to record and play video, but it is also the most confusing. It is both a container with the .MP4 file extension, but it is also a codec. The MPEG-4 codec also has two alternative names which are H.264 and AVC (or AVCHD). Also consider that the MPEG-4 codec can also be in a different container, such as AVI, QuickTime MOV, Matroska MKV, or MTS from a camcorder, etc. So if someone says they have an MPEG-4 video for you, who knows what you will get!

Awareness of file containers is not necessarily a requirement for enjoying video, but it helps to have some background information when an error occurs, or when someone vaguely requests their video should be encoded as "a QuickTime" or "for Windows Media Player".

No comments:

Post a Comment