A video container or wrapper is a file system that can be understood by your operating system. Take a look at this analogy:
Random 0s and 1s are called data. When this data is grouped together in a way humans understand, it’s called information. The gift that you want to send a loved one is information.
Sometimes, information is compressed to save space (packaging – like stuffing a suitcase). The ordering and packaging of data is done by a set of rules called a codec (coding-decoding). If the codec is designed to stuff your socks into every available space, that’s what it does. Some codecs arrange socks nicely rolled up, and so on. In the above analogy, the way the items are packaged into a box represents encoding, or the codec.
What you write on the box is metadata – it’s information about information. If your box is a gift, you put on a label, sticker or tag. The person delivering it doesn’t have to know what’s in it, only what he or she is supposed to do with it.
The outer box, a standard that makes it easier to process, send or read, is the wrapper, or container. When the recipient gets the package, he or she will hopefully know how to open it. That’s how you get an unboxing video.
But imagine getting a gift that you just can’t open!
Why do we need containers?
Because that’s how operating systems are designed to work with data. They need to know what the data is, and what it’s supposed to do with that data. They’re like the delivery guy.
E.g., A .exe file system tells the operating system that it needs to execute (run) this file. A .bat file (batch file) tells the OS that there are one or more executable commands that need to be run one after the other.
Similarly, how does the OS know the difference between an MP3 file with music versus a blank video file with the same music? It looks at the file system. Is it .mp3 or something else? If you specify the wrong file extension, it won’t know what to do with it, just like an incorrect address on a package will be returned to sender.
Video containers or wrappers are file systems designed to interface (be the gate keeper) between the OS and the video data. Think of them as customer service reps. When a client calls for help or support, the rep tells the customer: “I’ll gladly help you, no need to speak to the CEO.” It deals with the OS directly.
Since file systems are closely tied in with operating systems, each OS has a ‘favorite’ for every purpose. For Windows, the favored video containers are WMV and AVI (which stands for Audio Video Interleave), while for Macs, it is MOV.
Here are few currently popular video containers:
- AVI – Windows Professional
- MOV – Mac everything
- MKV – Open Source
- MPEG or MPG – by the MPEG group
- FLV – Flash video
- MP4 – by the MPEG group
- MTS or TS – Transport Stream
- MXF – Material Exchange Format
- WMV – Windows Consumer
- VOB – DVDs
- R3D – Redcode RAW
- DNG – Digital Negative, by Adobe
- JPG or JPEG – by the JPEG group
- TIFF – Tagged Image File Format, by Adobe
- TARGA – non-proprietary
- DPX – Digital Picture Exchange, by the SMPTE
- EXR – OpenEXR, by ILM
How’s a container different from a codec?
A codec is a compression algorithm or specification. It has no bearing on the video container, even if sometimes they are named similarly. E.g., MPEG-4 is a compression specification, and we also have a video container called MP4. The same applies to JPEGs. They are two different things – like two people with the exact same name – sometimes it leads to complications, among people.
But not by operating systems. They know precisely how to deal with each container. If they see a container they recognize, they use an application designed to deal with it. E.g., MP3 files are automatically opened with your favorite media player, and so on.
Whatever app opens the container, the first thing it checks is if the contents are arranged as it should be. If you’ve ordered something online, and you get a box which contains something else – you freak out. Applications do this too, but they are designed to vent their anger more gracefully. Sometimes they just shut down.
Once the app has recognized and confirmed the validity of the video container and its contents, it reads whatever metadata is available, and tries to find what codec has been used to compress the data, if any. If it finds a matching codec, it proceeds to do its thing.
Every app has a decoder (as opposed to the encoder who did the coding). If the encoder is your loved one, and she has done the packing, you (decoder) better know where your socks are.