kids encyclopedia robot

FourCC facts for kids

Kids Encyclopedia Facts

A FourCC (which stands for "four-character code") is like a short, secret code made of four bytes (usually ASCII letters or numbers). Its main job is to give a unique name to different kinds of data formats. Think of it as a special tag that tells your computer what kind of information is inside a file, like if it's a video, an audio file, or an image.

This idea first came from classic Mac OS computers, where it was called an OSType or ResType. Later, it was used for the Amiga computer's Interchange File Format (IFF) and then became popular in systems like QuickTime and DirectShow to identify compressed data.

History of FourCCs

In 1984, when the first System 1 for Macintosh computers came out, it used special tags to identify files. These tags included things like the file's type and which program created it. This meant you could change how a file was seen by the computer without changing the actual data inside it.

In 1985, a company called Electronic Arts created the Interchange File Format (IFF). This was a way to organize files into "chunks," and each chunk started with a four-byte ID. The IFF creators said they got the idea for these four-byte IDs from Apple's system.

Many companies started using IFF. Apple used it for AIFF audio files, and Microsoft used it for RIFF files. RIFF files became the basis for popular formats like AVI (for videos) and WAV (for audio). Apple called these codes OSTypes, while Microsoft and Windows developers called them FourCCs or Four-Character Codes. Microsoft also used FourCC codes in DirectX to identify data formats for graphics and media.

Apple's Use of OSTypes

For a long time, Apple computers used OSTypes to figure out what kind of file something was. However, since Mac OS X Panther, Apple computers mostly use file name extensions (like .mp3 or .jpg) to identify file types. Even so, OSTypes are still sometimes checked to help identify files.

How FourCCs Work

FourCCs are usually made of four printable characters, which means letters, numbers, or symbols you can see. Sometimes, spaces are used to fill out shorter codes. Unlike file extensions, FourCCs care about whether letters are uppercase or lowercase.

These four-byte codes are helpful because they can be easy to remember (like "DIVX" for a video type). They also fit neatly into the small memory spaces computers often use for numbers. This makes them efficient for computer programs to use, and they can also give clues about data when someone looks at the raw file.

Common Uses of FourCCs

One of the most common places you'll see FourCCs is in AVI video files. They tell your computer which video codec (the program that compresses and decompresses video) was used. For example, common FourCCs for video include DIVX, XVID, and H264.

For audio, AVI and WAV files use a two-byte code. But in QuickTime files, these two-byte codes often get "ms" added to the front to make them a FourCC. RealMedia files also use four-character codes, but they might be different from the ones in AVI or QuickTime.

Other file formats that use four-byte IDs include:

  • The Standard MIDI File (SMF) format for music.
  • The PNG image file format.
  • The 3DS (3D Studio Max) format for 3D models.
  • The ICC profile format, which helps manage colors.

Four-character codes are also used in other ways, not just for files:

  • They help identify vendors in the ACPI ID Registry for computer hardware.
  • They are used in the ACPI specification for computer power management.

Some other uses for OSTypes (Apple's version of FourCCs) include:

  • Identifying different parts in AppleEvents, which let programs talk to each other.
  • Identifying components in Apple's Component Manager.
  • Identifying "atoms" in QuickTime movie and image files.
  • Identifying standard folders on a Mac computer.

See also

Kids robot.svg In Spanish: FourCC para niños

  • Filename extension (also known as "file extension")
  • Interchange File Format
  • Magic number
  • OSType
    • creator code
    • type code
kids search engine
FourCC Facts for Kids. Kiddle Encyclopedia.