FourCC

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
(copied (even more) content from wikipedia:FourCC - will trim down later; also added AVS+ note)
m (correction)
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
A '''FourCC''' (literally, '''four'''-'''c'''haracter '''c'''ode) is a sequence of four [[wikipedia:byte|bytes]] used to uniquely identify [[wikipedia:File format|data format]]s.  
+
__NOTOC__
 +
<div style="max-width:62em" >
 +
A '''FourCC''' (literally, '''four'''-'''c'''haracter '''c'''ode) is a sequence of four [[wikipedia:byte|bytes]] used to uniquely identify [[wikipedia:File format|data format]]s.
 +
</div>
  
The concept originated in the [[wikipedia:OSType|OSType]] scheme used in the [[wikipedia:classic_Mac_OS|Macintosh system software]] and was adopted for the [[wikipedia:Amiga|Amiga]]/[[wikipedia:Electronic Arts|Electronic Arts]] [[wikipedia:Interchange File Format|Interchange File Format]] and derivatives. The idea was later reused to identify compressed data types in [[wikipedia:QuickTime|QuickTime]] and [[wikipedia:DirectShow|DirectShow]].
+
=====Technical details===== __NOEDITSECTION__
 +
<div style="max-width:62em" >
 +
The byte sequence is usually restricted to [[wikipedia:ASCII#ASCII printable characters|ASCII printable characters]], with space characters reserved for padding shorter sequences. Case sensitivity is preserved.  
  
== Technical details ==
+
Four-byte identifiers are useful because they can be made up of four human-readable characters with mnemonic qualities. Thus, the codes can be used efficiently in program code as integers, as well as giving cues in binary data streams when inspected.
The byte sequence is usually restricted to [[wikipedia:ASCII#ASCII printable characters|ASCII printable characters]], with space characters reserved for padding shorter sequences. Case sensitivity is preserved, unlike in [[wikipedia:file extension|file extensions]].  
+
  
Four-byte identifiers are useful because they can be made up of four human-readable characters with mnemonic qualities, while still fitting in the four-byte memory space typically allocated for integers in [[wikipedia:32-bit|32-bit]] systems (although [[wikipedia:endianness|endian]] issues may make them less readable). Thus, the codes can be used efficiently in program code as integers, as well as giving cues in binary data streams when inspected.
+
{{AvsPluscon}} Some FourCCs, such as those for certain [[High_bit_depth|high bit depth]] raw video formats, contain non-printable characters and are not human-readable without special formatting for display; for example, 10bit planar YUV422, known in [[AviSynth%2B]] as [[Avisynthplus_color_formats|YUV422P10]], can have a FourCC of <span style="white-space:nowrap">('Y', '3', 10, 10)<sup>[http://ffmpeg.org/doxygen/trunk/raw_8c_source.html#l00136 (1)]</sup></span> which ffmpeg displays as <span style="white-space:nowrap"><code>rawvideo (Y3[10][10] / 0xA0A3359), yuv422p10le</code>.</span>
 +
</div>
  
{{AvsPluscon}} Some FourCCs, such as those for certain [[High_bit_depth|high bit depth]] raw video formats, contain non-printable characters and are not human-readable without special formatting for display; for example, 10bit planar YUV422, known in [[AviSynth%2B]] as [[Avisynthplus_color_formats|YUV422P10]], is known in ffmpeg as <span style="white-space:nowrap">('Y', '3', 10, 10)<sup>[http://ffmpeg.org/doxygen/trunk/raw_8c_source.html#l00136 (1)]</sup></span> which [http://ffmpeg.org/ffprobe.html#Synopsis ffprobe] displays as <span style="white-space:nowrap"><code>rawvideo (Y3[10][10] / 0xA0A3359), yuv422p10le</code>.</span>
+
=====History===== __NOEDITSECTION__
 
+
<div style="max-width:62em" >
==History==
+
 
In 1985, [[wikipedia:Electronic Arts|Electronic Arts]] introduced the [[wikipedia:Interchange File Format|Interchange File Format]] (IFF) meta-format (family of file formats), originally devised for use on the [[wikipedia:Amiga|Amiga]]. These files consisted of a sequence of "chunks", which could contain arbitrary data, each chunk prefixed by a four-byte ID. The IFF specification explicitly mentions that the origins of the FourCC idea lie with Apple.<sup>[http://www.martinreddy.net/gfx/2d/IFF.txt (2)]</sup>
 
In 1985, [[wikipedia:Electronic Arts|Electronic Arts]] introduced the [[wikipedia:Interchange File Format|Interchange File Format]] (IFF) meta-format (family of file formats), originally devised for use on the [[wikipedia:Amiga|Amiga]]. These files consisted of a sequence of "chunks", which could contain arbitrary data, each chunk prefixed by a four-byte ID. The IFF specification explicitly mentions that the origins of the FourCC idea lie with Apple.<sup>[http://www.martinreddy.net/gfx/2d/IFF.txt (2)]</sup>
  
This IFF was adopted by a number of developers including [[wikipedia:Apple Computer|Apple]] for [[wikipedia:AIFF|AIFF]] files and [[wikipedia:Microsoft|Microsoft]] for [[wikipedia:RIFF (File format)|RIFF]] files (which were used as the basis for the [[wikipedia:Audio Video Interleave|AVI]] and [[wikipedia:WAV|WAV]] file format).  Apple referred to many of these codes as [[wikipedia:OSType|OSTypes]]. Microsoft and [[wikipedia:Microsoft Windows|Windows]] developers refer to their four-byte identifiers as '''FourCC'''s or Four-Character Codes. FourCC codes were also adopted by Microsoft to identify data formats used in [[wikipedia:DirectX|DirectX]], specifically within DirectShow and DirectX Graphics.
+
This IFF was adopted by a number of developers including [[wikipedia:Apple Computer|Apple]] for [[wikipedia:AIFF|AIFF]] files and [[wikipedia:Microsoft|Microsoft]] for [[wikipedia:RIFF (File format)|RIFF]] files (which were used as the basis for the [[wikipedia:Audio Video Interleave|AVI]] and [[wikipedia:WAV|WAV]] file format). Microsoft and [[wikipedia:Microsoft Windows|Windows]] developers refer to their four-byte identifiers as '''FourCC'''s.
 
+
</div>
==Common uses==
+
One of the most well-known uses of FourCCs is to identify the [[wikipedia:video codec|video codec]] or [[wikipedia:video coding format|video coding format]] in AVI files. Common identifiers include [[wikipedia:DivX|DIVX]], [[wikipedia:Xvid|XVID]], and [[wikipedia:H.264/MPEG-4 AVC|H264]]. For [[wikipedia:audio coding format|audio coding formats]], AVI and WAV files use a two-byte identifier, usually written in [[wikipedia:hexadecimal|hexadecimal]] (such as 0055 for [[wikipedia:MP3|MP3]]). In QuickTime files, these two-byte identifiers are prefixed with the letters "ms" to form a four-character code. [[wikipedia:RealMedia|RealMedia]] files also use four-character codes, however, the actual codes used differ from those found in AVI or QuickTime files.
+
 
+
Other file formats that make important use of the four-byte ID concept are the Standard [[wikipedia:MIDI File|MIDI File]] Format, the [[wikipedia:Portable Network Graphics|PNG]] image file format, the [[wikipedia:.3ds|3DS]] (3D Studio Max) mesh file format and the [[wikipedia:International Color Consortium|ICC]] profile format.
+
  
==References==
+
=====References===== __NOEDITSECTION__
 
# [http://ffmpeg.org/doxygen/trunk/raw_8c_source.html#l00136 ''RAW.C''] (ffmpeg.org)
 
# [http://ffmpeg.org/doxygen/trunk/raw_8c_source.html#l00136 ''RAW.C''] (ffmpeg.org)
 
# [http://www.martinreddy.net/gfx/2d/IFF.txt ''"EA IFF 85" Standard for Interchange Format Files''] (martinreddy.net)
 
# [http://www.martinreddy.net/gfx/2d/IFF.txt ''"EA IFF 85" Standard for Interchange Format Files''] (martinreddy.net)
  
==External links==
+
=====External links===== __NOEDITSECTION__
* [http://www.mathworks.com/matlabcentral/fileexchange/28706 List Video Codecs, FourCC] (mathworks.com)
+
 
* [http://www.fourcc.org Video codecs and Pixel Formats] (fourcc.org)
 
* [http://www.fourcc.org Video codecs and Pixel Formats] (fourcc.org)
  
Line 34: Line 33:
 
''Wikipedia text is available under the [https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License Creative Commons Attribution-ShareAlike License]''  
 
''Wikipedia text is available under the [https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License Creative Commons Attribution-ShareAlike License]''  
  
 +
[[Category:Advanced topics]]
 
[[Category:Glossary]]
 
[[Category:Glossary]]

Latest revision as of 20:03, 10 June 2017

A FourCC (literally, four-character code) is a sequence of four bytes used to uniquely identify data formats.

Technical details

The byte sequence is usually restricted to ASCII printable characters, with space characters reserved for padding shorter sequences. Case sensitivity is preserved.

Four-byte identifiers are useful because they can be made up of four human-readable characters with mnemonic qualities. Thus, the codes can be used efficiently in program code as integers, as well as giving cues in binary data streams when inspected.

AVS+ Some FourCCs, such as those for certain high bit depth raw video formats, contain non-printable characters and are not human-readable without special formatting for display; for example, 10bit planar YUV422, known in AviSynth+ as YUV422P10, can have a FourCC of ('Y', '3', 10, 10)(1) which ffmpeg displays as rawvideo (Y3[10][10] / 0xA0A3359), yuv422p10le.

History

In 1985, Electronic Arts introduced the Interchange File Format (IFF) meta-format (family of file formats), originally devised for use on the Amiga. These files consisted of a sequence of "chunks", which could contain arbitrary data, each chunk prefixed by a four-byte ID. The IFF specification explicitly mentions that the origins of the FourCC idea lie with Apple.(2)

This IFF was adopted by a number of developers including Apple for AIFF files and Microsoft for RIFF files (which were used as the basis for the AVI and WAV file format). Microsoft and Windows developers refer to their four-byte identifiers as FourCCs.

References
  1. RAW.C (ffmpeg.org)
  2. "EA IFF 85" Standard for Interchange Format Files (martinreddy.net)
External links



This page was adapted from Wikipedia: FourCC; version 11 March 2017.

Wikipedia text is available under the Creative Commons Attribution-ShareAlike License

Personal tools