FourCC

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.

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.

Some FourCCs however, do contain non-printable characters, and are not human-readable without special formatting for display; for example, 10bit Y'CbCr 4:2:2 video can have a FourCC of ('Y', '3', 10, 10)[1] which ffmpeg displays as rawvideo (Y3[10][10] / 0x0A0A3359), 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 (SMF) format, the PNG image file format, the 3DS (3D Studio Max) mesh file format and the ICC profile format.

See also

References

  1. "RAW.C". ffmpeg.org. June 10, 2017.
  2. Morrison, Jerry (January 14, 1985). ""EA IFF 85" Standard for Interchange Format Files". Electronic Arts.
  • Fleischman, E. (June 1998). "RFC2361 - WAVE and AVI Codec Registries". Internet Assigned Numbers Authority (IANA).
  • "Audio Subtype GUIDs". Microsoft. Retrieved 23 February 2017.
  • Kroon, Dirk-Jan (16 February 2011). "List Video Codecs, FourCC". MathWorks (published 13 September 2010). This function GETFOURCC gives a list of available Video encoder-codecs in the current Windows installation
  • "Video codecs and Pixel Formats". FourCC. Retrieved 23 February 2017.


This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.