Jump to content

Container format: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
→‎See also: better ordering
m →‎top: Cleaned up MOS:ORDER and other matters.
 
(38 intermediate revisions by 27 users not shown)
Line 1: Line 1:
{{Short description|Metafile format}}
{{incomprehensible|date=November 2018}}
{{About|a kind of computer file||container format (disambiguation)}}
{{more citations|date=June 2017}}
{{More citations|date=June 2017}}
{{about|a kind of computer file||container format (disambiguation)}}

A '''container format''' (informally, sometimes called a '''wrapper''') belongs to a class of [[computer file]]s that exist to allow multiple data streams to be embedded into a single file, usually along with [[metadata]] for identifying and further detailing those streams.<ref>{{Cite book|url=https://books.google.com/books?id=pDU0DAAAQBAJ&pg=PT146&dq=container+format|title=Handbook of Digital Forensics of Multimedia Data and Devices, Enhanced E-Book|last=Ho|first=Anthony T. S.|last2=Li|first2=Shujun|date=20 May 2016|publisher=John Wiley & Sons|year=|isbn=9781118757079|location=|pages=146–(?)|oclc=953319457}}</ref> Notable examples of container formats include [[archive file]]s (such as the [[Zip (file format)|ZIP format]] and formats used for multimedia playback (such as [[Matroska]], [[MPEG-4 Part 14|MP4]], and [[Audio Video Interleave|AVI]]). Among the earliest [[cross-platform]] container formats were [[Distinguished Encoding Rules]] and the 1985 [[Interchange File Format]].
A '''container format''' (informally, sometimes called a '''wrapper''') or '''metafile''' is a [[file format]] that allows multiple data streams to be embedded into a single [[computer file|file]], usually along with [[metadata]] for identifying and further detailing those streams.<ref>{{Cite book |last=Ho |first=Anthony T. S. |url=https://books.google.com/books?id=pDU0DAAAQBAJ&q=container+format&pg=PT146 |title=Handbook of Digital Forensics of Multimedia Data and Devices, Enhanced E-Book |last2=Li |first2=Shujun |date=20 May 2016 |publisher=John Wiley & Sons |isbn=9781118757079 |pages=146–(?) |oclc=953319457}}</ref> Notable examples of container formats include [[archive file]]s (such as the [[ZIP (file format)|ZIP format]]) and formats used for multimedia playback (such as [[Matroska]], [[MPEG-4 Part 14|MP4]], and [[Audio Video Interleave|AVI]]). Among the earliest [[cross-platform]] container formats were [[Distinguished Encoding Rules]] and the 1985 [[Interchange File Format]].


==Design==
==Design==
[[File:Container Formats Examples.svg|thumb|The layouts of common container formats: [[Audio Video Interleave|AVI]], [[Matroska]] and [[PDF]]]]
Since the container does not describe how data or metadata is encoded, a [[Computer program|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 [[Codec|decoding algorithm]].
Although containers may identify how data or metadata is encoded, they do not actually provide instructions about how to decode that data. A [[Computer program|program]] that can open a container must also use an appropriate [[codec]] to decode its contents. If the program doesn't have the required algorithm, it can't use the contained data. In these cases, programs usually emit an error message that complains of a missing codec, which users may be able to acquire.


By definition, a container format could wrap any kind of data. Though there are some examples of such file formats (e.g. [[Microsoft Windows]]'s [[Dynamic-link library|DLL]] files), 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 file format|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.
Container formats can be made to wrap any kind of data. Though there are some examples of such file formats (e.g. [[Microsoft Windows]]'s [[Dynamic-link library|DLL]] files), most container formats are specialized for specific data requirements. For example, since [[Audio coding format|audio]] and [[Video coding format|video]] streams can be coded and decoded with many different algorithms, a container format may be used to provide the appearance of a single file format to users of multimedia playback software.


===Considerations===
===Considerations===
Line 26: Line 28:


==Multimedia container formats==
==Multimedia container formats==
{{further|Audio file format|Image file format|Video file format}}
{{further|Audio file format|Image file formats|Video file format}}
{{See also|Comparison of container formats}}
{{See also|Comparison of video 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, [[Subtitle (captioning)|subtitles]], chapter-information, and meta-data ([[Tag (metadata)|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 differs from high-quality Blu-ray streaming requirements.
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, [[Subtitle (captioning)|subtitles]], chapter-information, and meta-data ([[Tag (metadata)|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 differs from high-quality Blu-ray streaming requirements.
Line 34: Line 36:


Some containers are exclusive to audio:
Some containers are exclusive to audio:
* [[Audio Interchange File Format|AIFF]] (IFF file format, widely used on [[Mac OS]] platform)
* [[Audio Interchange File Format|AIFF]] ([[Interchange File Format|IFF]] file format, widely used on the [[macOS]] platform)
* [[WAV]] ([[Resource Interchange File Format|RIFF]] file format, widely used on [[Microsoft Windows|Windows]] platform)
* [[WAV]] ([[Resource Interchange File Format|RIFF]] file format, widely used on [[Microsoft Windows|Windows]] platform)
* [[Extensible Music Format (XMF)|XMF]] (Extensible Music Format)
* [[Extensible Music Format (XMF)|XMF]] (Extensible Music Format)
Line 40: Line 42:
Other containers are exclusive to still images:
Other containers are exclusive to still images:
* [[FITS]] (Flexible Image Transport System) still images, raw data, and associated metadata.
* [[FITS]] (Flexible Image Transport System) still images, raw data, and associated metadata.
* [[Tagged Image File Format|TIFF]] (Tagged Image File Format) still images and associated metadata.
* [[Tag Image File Format|TIFF]] (Tag Image File Format) still images and associated metadata.
* [[Macintosh]] PICT resource ([[PICT]]), superseded by [[Portable Document Format|PDF]] in [[Mac OS X]]
* [[Windows Metafile]] (WMF) = (EMF) [[Enhanced Metafile]]
* [[Encapsulated PostScript]] (EPS)
* [[Computer Graphics Metafile]] (CGM)
* [[Portable Document Format]] (PDF)
* [[Corel Draw File]] (CDR)
* [[Scalable Vector Graphics]] (SVG)
* [[Rich Text Format]] file (RTF)


Other flexible containers can hold many types of audio and video, as well as other media. The most popular multi-media containers are:
Other flexible containers can hold many types of audio and video, as well as other media. The most popular multi-media containers are:
Line 57: Line 67:
* [[Ogg]] (standard container for [[Xiph.Org Foundation|Xiph.org]] audio formats [[Vorbis]] and [[Opus (audio format)|Opus]] and video format [[Theora]])
* [[Ogg]] (standard container for [[Xiph.Org Foundation|Xiph.org]] audio formats [[Vorbis]] and [[Opus (audio format)|Opus]] and video format [[Theora]])
* [[RealMedia|RM]] (RealMedia; standard container for [[RealVideo]] and [[RealAudio]])
* [[RealMedia|RM]] (RealMedia; standard container for [[RealVideo]] and [[RealAudio]])
* [[WebM]] (subset of [[Matroska]], used for web-based media distribution on online platforms; container for royalty-free audio formats [[Vorbis]]/[[Opus (audio format)|Opus]] and video formats [[VP8]]/[[VP9]]/[[AV1]])


There are many other container formats, such as [[FFmpeg#NUT|NUT]], [[Material Exchange Format|MXF]], [[General Exchange Format|GXF]], [[ratDVD]], SVI, [[VOB]] and [[DivX Media Format]]
There are many other container formats, such as [[FFmpeg#NUT|NUT]], [[Material Exchange Format|MXF]], [[General Exchange Format|GXF]], [[ratDVD]], SVI, [[VOB]] and [[DivX Media Format]]
Line 65: Line 76:
* [[Comparison of video codecs]]
* [[Comparison of video codecs]]
* [[Comparison of video container formats]]
* [[Comparison of video container formats]]
* [[NTFS#Metafiles]]
* [[List of codecs]]
* [[List of codecs]]
** [[List of open-source codecs]]
** [[List of open-source codecs]]
* [[Serialization]]


==References==
==References==

Latest revision as of 04:05, 29 February 2024

A container format (informally, sometimes called a wrapper) or metafile is a file format that allows multiple data streams to be embedded into a single file, usually along with metadata for identifying and further detailing those streams.[1] Notable examples of container formats include archive files (such as the ZIP format) and formats used for multimedia playback (such as Matroska, MP4, and AVI). Among the earliest cross-platform container formats were Distinguished Encoding Rules and the 1985 Interchange File Format.

Design

[edit]
The layouts of common container formats: AVI, Matroska and PDF

Although containers may identify how data or metadata is encoded, they do not actually provide instructions about how to decode that data. A program that can open a container must also use an appropriate codec to decode its contents. If the program doesn't have the required algorithm, it can't use the contained data. In these cases, programs usually emit an error message that complains of a missing codec, which users may be able to acquire.

Container formats can be made to wrap any kind of data. Though there are some examples of such file formats (e.g. Microsoft Windows's DLL files), most container formats are specialized for specific data requirements. For example, since audio and video streams can be coded and decoded with many different algorithms, a container format may be used to provide the appearance of a single file format to users of multimedia playback software.

Considerations

[edit]

The differences between various container formats arise from five main issues:

  1. Popularity; how widely supported a container is.
  2. Overhead. This is the difference in file-size between two files with the same content in a different container.
  3. Support for advanced codec functionality. Older formats such as AVI do not support new codec features like B-frames, VBR audio or VFR video natively. The format may be "hacked" to add support, but this creates compatibility problems.
  4. Support for advanced content, such as chapters, subtitles, meta-tags, user-data.
  5. Support of streaming media.

Single coding formats

[edit]

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 (JFIF) for containing JPEG data, and Portable Network Graphics (PNG).

In principle, coding can be changed while the storage layer is retained; for example, Multiple-image Network Graphics (MNG) uses the PNG container format but provides animation, while JPEG Network Graphics (JNG) 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

[edit]

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 (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 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 (from the communications term), 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:

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

See also

[edit]

References

[edit]
  1. ^ Ho, Anthony T. S.; Li, Shujun (20 May 2016). Handbook of Digital Forensics of Multimedia Data and Devices, Enhanced E-Book. John Wiley & Sons. pp. 146–(?). ISBN 9781118757079. OCLC 953319457.
[edit]