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)
Line 1: Line 1:
FourCC, is a FOUR Character Code in the beginning of the media file that tells what codec your system should use for decoding the file. It is mostly associated with [[AVI]] media files. You can use this to force [[AviSource]] to open the avi file using a different codec. A list of FOURCCs can be found [http://www.fourcc.org/index.php here].  
+
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.
 +
 
 +
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 ==
 +
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]], 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==
 +
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.
 +
 
 +
==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==
 +
# [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)
 +
 
 +
==External links==
 +
* [http://www.mathworks.com/matlabcentral/fileexchange/28706 List Video Codecs, FourCC] (mathworks.com)
 +
* [http://www.fourcc.org Video codecs and Pixel Formats] (fourcc.org)
 +
 
 +
 
 +
----
 +
''This page was adapted from Wikipedia: [https://en.wikipedia.org/w/index.php?title=FourCC&oldid=769753770 FourCC]; version 11 March 2017. ''
 +
 
 +
''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:Glossary]]
 
[[Category:Glossary]]

Revision as of 19:43, 10 June 2017

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

The concept originated in the OSType scheme used in the Macintosh system software and was adopted for the Amiga/Electronic Arts Interchange File Format and derivatives. The idea was later reused to identify compressed data types in QuickTime and DirectShow.

Contents

Technical details

The byte sequence is usually restricted to ASCII printable characters, with space characters reserved for padding shorter sequences. Case sensitivity is preserved, unlike in 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 32-bit systems (although 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.

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, is known in ffmpeg as ('Y', '3', 10, 10)(1) which ffprobe 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). Apple referred to many of these codes as OSTypes. Microsoft and Windows developers refer to their four-byte identifiers as FourCCs or Four-Character Codes. FourCC codes were also adopted by Microsoft to identify data formats used in DirectX, specifically within DirectShow and DirectX Graphics.

Common uses

One of the most well-known uses of FourCCs is to identify the video codec or video coding format in AVI files. Common identifiers include DIVX, XVID, and H264. For audio coding formats, AVI and WAV files use a two-byte identifier, usually written in hexadecimal (such as 0055 for MP3). In QuickTime files, these two-byte identifiers are prefixed with the letters "ms" to form a four-character code. 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 MIDI File Format, the PNG image file format, the 3DS (3D Studio Max) mesh file format and the ICC profile format.

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