MP4, WMV, AVI, OGG, etc. What are the differences between them, how supported are they in different platforms, and what are the advantages of each one?
Multimedia container formats
The container file is used to identify and interleave the different data types. Simpler container formats can contain different types of audio codecs, while more advanced container formats can support multiple audio and video streams, subtitles, chapter-information, and meta-data (tags) — along with the synchronization information needed to play back the various streams together. In most cases, the file header, most of the metadata and the synchro chunks are specified by the container format (for example container formats exist for optimized, low-quality, internet video streaming which, for example, differs from high-quality DVD streaming requirements).
The constituent parts of a container format have various names; they are often called "chunks", as in RIFF and PNG, while they are called "packets" in MPEG-TS (from the communications term), and they are called "segments" in JPEG. The main content of a chunk is called the "data" or the "payload". Most container formats have chunks in sequence, each with a header, while TIFF unusually instead stores offsets, which results in difficulties in properly preserving information – notably, Exif photo data is often discarded. Modular chunks make it easy to recover other chunks in case of file corruption or dropped frames or bit slip, while offsets result in framing errors in cases of bit slip.
Some containers are exclusive to audio:
Other containers are exclusive to still images:
Other flexible containers can hold many types of audio and video, as well as other media. The most popular multi-media containers are:
There are many other container formats, such as NUT, MXF, GXF, ratDVD, SVI, VOB and DivX Media Format
The VideoLan documentation on Streaming, Muxers and Codecs is a good place for the basics.
Codecs (Xvid, x264 etc.) encode video and/or audio to achieve smaller filesizes. Containers (MP4, MKV etc.) hold video and audio streams in the file. Every digital content is encoded somehow. DVD- and BD-video (and such media formats) use their dedicated codec standards (dedicated by companies which developed them).
Codecs and containers are constantly improved and developed. Codecs get faster and more efficient, while new/improved containers get more features (such as support for multiple audio channels or subtitles which were previously not available).
New codecs and containers spawn rapidly, some are here to stay for a relatevely long time, some are to be forgotten.
If you are deciding to encode video I recommend checking this out:
Remember, different devices support different things. It is a whole mess!