Since the container does not describe how data or metadata is encoded, a program able to identify and open a container file might not be able to decode the contained data. This may be caused by the program lacking the required decoding algorithm. By definition, a container format could wrap any kind of data. Though there are some examples of such file formats, most container formats are specialized for specific data requirements. For example, a popular family of containers is found for use with multimedia file formats. Since audio and video streams can be coded and decoded with many different algorithms, a container format may be used to provide a single file format to the user.
Considerations
The differences between various container formats arise from five main issues:
Popularity; how widely supported a container is.
Overhead. This is the difference in file-size between two files with the same content in a different container.
Support for advanced codec functionality. Older formats such as AVI do not support new codec features like B-frames, VBRaudio or VFR video natively. The format may be "hacked" to add support, but this creates compatibility problems.
Support for advanced content, such as chapters, subtitles, meta-tags, user-data.
In addition to pure container formats, which specify only the wrapper but not the coding, a number of file formats specify both a storage layer and the coding, as part of modular design and forward compatibility. Examples include JPEG File Interchange Format for containing JPEG data, and Portable Network Graphics. In principle, coding can be changed while the storage layer is retained; for example, Multiple-image Network Graphics uses the PNG container format but provides animation, while JPEG Network Graphics puts JPEG encoded data in a PNG container; in both cases however, the different formats have different magic numbers – the format specifies the coding, though a MNG can contain both PNG-encoded images and JPEG-encoded images.
Multimedia container formats
The container file is used to identify and interleave different data types. Simpler container formats can contain different types of audio formats, while more advanced container formats can support multiple audio and video streams, subtitles, chapter-information, and meta-data — 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 differs from high-quality Blu-ray streaming requirements. Container format parts have various names: "chunks" as in RIFF and PNG, "atoms" in QuickTime/MP4, "packets" in MPEG-TS, and "segments" in JPEG. The main content of a chunk is called the "data" or "payload". Most container formats have chunks in sequence, each with a header, while TIFF instead stores offsets. 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: