FourCC

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

It originated from the OSType or ResType metadata system used in classic Mac OS and was adopted for the Amiga/Electronic Arts Interchange File Format and derivatives.

Filesystem-associated type codes are not readily accessible for users to manipulate, although they can be viewed and changed with certain software, most notably the macOS command line tools GetFileInfo and SetFile which are installed as part of the developer tools into /Developer/Tools, or the ResEdit utility available for older Macs.

FourCC is written in big endian relative to the underlying ASCII character sequence, so that it appears in the correct byte order when read as a string.

Many C compilers, including GCC, define a multi-character literal behavior of right-aligning to the least significant byte, so that '1234' becomes 0x31323334 in ASCII.

Taking the avc1 example from above: although the literal 'avc1' already converts to the integer value 0x61766331, a little-endian machine would have reversed the byte order and stored the value as 31 63 76 61.

For audio coding formats, AVI and WAV files use a two-byte identifier, usually written in hexadecimal (such as 0055 for MP3).