A
FourCC is a sequence of four
byteThe byte is a unit of digital information in computing and telecommunications that most commonly consists of eight bits. Historically, a byte was the number of bits used to encode a single character of text in a computer and for this reason it is the basic addressable element in many computer...
s used to uniquely identify
data formatData format in information technology can refer to either one of:* Data type, constraint placed upon the interpretation of data in a type system* Signal , a format for signal data used in signal processing...
s.
The concept originated in the
OSTypeOSType is the name of a four-byte sequence commonly used as an identifier in Mac OS. While the bytes can have any value, they usually display figures characterized in software programs such as those utilized in ASCII or Mac OS Roman character sets.OSType values are used to identify file data...
scheme used in the
Macintosh system softwareMac OS is a series of graphical user interface-based operating systems developed by Apple Inc. for their Macintosh line of computer systems. The Macintosh user experience is credited with popularizing the graphical user interface...
and was adopted for the
AmigaThe Amiga is a family of personal computers that was sold by Commodore in the 1980s and 1990s. The first model was launched in 1985 as a high-end home computer and became popular for its graphical, audio and multi-tasking abilities...
/
Electronic ArtsElectronic Arts, Inc. is a major American developer, marketer, publisher and distributor of video games. Founded and incorporated on May 28, 1982 by Trip Hawkins, the company was a pioneer of the early home computer games industry and was notable for promoting the designers and programmers...
Interchange File FormatInterchange File Format , is a generic container file format originally introduced by the Electronic Arts company in 1985 in order to ease transfer of data between software produced by different companies....
and derivatives. The idea was later reused to identify compressed data types in
QuickTimeQuickTime is an extensible proprietary multimedia framework developed by Apple Inc., capable of handling various formats of digital video, picture, sound, panoramic images, and interactivity. The classic version of QuickTime is available for Windows XP and later, as well as Mac OS X Leopard and...
and
DirectShowDirectShow , codename Quartz, is a multimedia framework and API produced by Microsoft for software developers to perform various operations with media files or streams. It is the replacement for Microsoft's earlier Video for Windows technology...
.
Technical details
The byte sequence is usually restricted to
ASCIIThe American Standard Code for Information Interchange is a character-encoding scheme based on the ordering of the English alphabet. ASCII codes represent text in computers, communications equipment, and other devices that use text...
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-bitThe range of integer values that can be stored in 32 bits is 0 through 4,294,967,295. Hence, a processor with 32-bit memory addresses can directly access 4 GB of byte-addressable memory....
systems (although
endianIn computing, the term endian or endianness refers to the ordering of individually addressable sub-components within the representation of a larger data item as stored in external memory . Each sub-component in the representation has a unique degree of significance, like the place value of digits...
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.
History
In 1985
Electronic ArtsElectronic Arts, Inc. is a major American developer, marketer, publisher and distributor of video games. Founded and incorporated on May 28, 1982 by Trip Hawkins, the company was a pioneer of the early home computer games industry and was notable for promoting the designers and programmers...
introduced the
Interchange File FormatInterchange File Format , is a generic container file format originally introduced by the Electronic Arts company in 1985 in order to ease transfer of data between software produced by different companies....
(IFF) meta-format (family of file formats), originally devised for use on the
AmigaThe Amiga is a family of personal computers that was sold by Commodore in the 1980s and 1990s. The first model was launched in 1985 as a high-end home computer and became popular for its graphical, audio and multi-tasking abilities...
. 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.
This IFF was adopted by a number of developers including
AppleApple Inc. is an American multinational corporation that designs and markets consumer electronics, computer software, and personal computers. The company's best-known hardware products include the Macintosh line of computers, the iPod, the iPhone and the iPad...
for
AIFFAudio Interchange File Format is an audio file format standard used for storing sound data for personal computers and other electronic audio devices...
files and
MicrosoftMicrosoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...
for RIFF files (which were used as the basis for the
AVIAudio Video Interleave , known by its acronym AVI, is a multimedia container format introduced by Microsoft in November 1992 as part of its Video for Windows technology. AVI files can contain both audio and video data in a file container that allows synchronous audio-with-video playback...
and
WAVWaveform Audio File Format , is a Microsoft and IBM audio file format standard for storing an audio bitstream on PCs...
file format). Apple referred to many of these codes as
OSTypeOSType is the name of a four-byte sequence commonly used as an identifier in Mac OS. While the bytes can have any value, they usually display figures characterized in software programs such as those utilized in ASCII or Mac OS Roman character sets.OSType values are used to identify file data...
s. Microsoft and
WindowsMicrosoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...
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
DirectXMicrosoft DirectX is a collection of application programming interfaces for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with Direct, such as Direct3D, DirectDraw, DirectMusic, DirectPlay,...
, specifically within DirectShow and DirectX Graphics.
Common uses
One of the most well-known uses of FourCCs is to identify the
video codecA video codec is a device or software that enables video compression and/or decompression for digital video. The compression usually employs lossy data compression. Historically, video was stored as an analog signal on magnetic tape...
used in AVI files. Common identifiers include
DIVXDivX is a brand name of products created by DivX, Inc. , including the DivX Codec which has become popular due to its ability to compress lengthy video segments into small sizes while maintaining relatively high visual quality.There are two DivX codecs; the regular MPEG-4 Part 2 DivX codec and the...
,
XVIDXvid is a video codec library following the MPEG-4 standard, specifically MPEG-4 Part 2 Advanced Simple Profile . It uses ASP features such as b-frames, global and quarter pixel motion compensation, lumi masking, trellis quantization, and H.263, MPEG and custom quantization matrices.Xvid is a...
, and H264. For
audio codecAll codecs are devices or computer programs capable of coding or decoding a digital data stream or signal.The term audio codec has two meanings depending on the context:...
s, AVI and WAV files use a two-byte identifier, usually written in
hexadecimalIn mathematics and computer science, hexadecimal is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen...
(such as 0055 for
MP3MPEG-1 or MPEG-2 Audio Layer III, more commonly referred to as MP3, is a patented digital audio encoding format using a form of lossy data compression...
). In QuickTime files, these two-byte identifiers are prefixed with the letters 'ms' to form a four-character code.
RealMediaRealMedia is a proprietary multimedia container format created by RealNetworks. Its extension is ".rm". It is typically used in conjunction with RealVideo and RealAudio and is used for streaming content over the Internet....
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
3DS3DS is one of the file formats used by the Autodesk 3ds Max 3D modeling, animation and rendering software.It was the native file format of the old Autodesk 3D Studio DOS , which was popular until its successor replaced it in April 1996...
(3D Studio Max) mesh file format and the
ICCThe International Color Consortium was formed in 1993 by eight industry vendors in order to create a universal color management system that would function transparently across all operating systems and software packages....
profile format.
See also
- Magic number
- Interchange File Format
Interchange File Format , is a generic container file format originally introduced by the Electronic Arts company in 1985 in order to ease transfer of data between software produced by different companies....
- OSType
OSType is the name of a four-byte sequence commonly used as an identifier in Mac OS. While the bytes can have any value, they usually display figures characterized in software programs such as those utilized in ASCII or Mac OS Roman character sets.OSType values are used to identify file data...
External links
- FourCC.org - video codec and pixel format information, maintained mostly up to date as of 2007 February
- List of registered FOURCC Codes - as of 2003 June
- Matlab Code - Gives a list of available FOURCC codes of the users Windows OS
- RFC2361 - "WAVE and AVI Codec Registries" by the Internet Assigned Numbers Authority (IANA)