<s>
A	O
FourCC	B-Application
(	O
"	O
four-character	O
code	O
"	O
)	O
is	O
a	O
sequence	O
of	O
four	O
bytes	B-Application
(	O
typically	O
ASCII	B-Protocol
)	O
used	O
to	O
uniquely	O
identify	O
data	O
formats	O
.	O
</s>
<s>
It	O
originated	O
from	O
the	O
OSType	B-Application
or	O
ResType	O
metadata	O
system	O
used	O
in	O
classic	B-Application
Mac	I-Application
OS	I-Application
and	O
was	O
adopted	O
for	O
the	O
Amiga/Electronic	O
Arts	O
Interchange	B-Device
File	I-Device
Format	I-Device
and	O
derivatives	O
.	O
</s>
<s>
The	O
idea	O
was	O
later	O
reused	O
to	O
identify	O
compressed	O
data	O
types	O
in	O
QuickTime	B-Application
and	O
DirectShow	B-Library
.	O
</s>
<s>
In	O
1984	O
,	O
the	O
earliest	O
version	O
of	O
a	O
Macintosh	O
OS	O
,	O
Apple	B-Operating_System
System	I-Operating_System
1	I-Operating_System
,	O
was	O
released	O
.	O
</s>
<s>
It	O
used	O
the	O
single-level	O
Macintosh	B-Application
File	I-Application
System	I-Application
with	O
metadata	O
fields	O
including	O
file	O
types	O
,	O
creator	O
(	O
application	O
)	O
information	O
,	O
and	O
forks	O
to	O
store	O
additional	B-Operating_System
resources	I-Operating_System
.	O
</s>
<s>
All	O
these	O
fields	O
are	O
four-character	O
codes	O
known	O
as	O
OSType	B-Application
.	O
</s>
<s>
In	O
1985	O
,	O
Electronic	O
Arts	O
introduced	O
the	O
Interchange	B-Device
File	I-Device
Format	I-Device
(	O
IFF	O
)	O
meta-format	O
(	O
family	O
of	O
file	O
formats	O
)	O
,	O
originally	O
devised	O
for	O
use	O
on	O
the	O
Amiga	B-Device
.	O
</s>
<s>
These	O
files	O
consisted	O
of	O
a	O
sequence	O
of	O
"	O
chunks	O
"	O
,	O
which	O
could	O
contain	O
arbitrary	O
data	O
,	O
each	O
chunk	O
prefixed	O
by	O
a	O
four-byte	O
ID	O
.	O
</s>
<s>
The	O
IFF	O
specification	O
explicitly	O
mentions	O
that	O
the	O
origins	O
of	O
the	O
FourCC	B-Application
idea	O
lie	O
with	O
Apple	O
.	O
</s>
<s>
Apple	O
referred	O
to	O
many	O
of	O
these	O
codes	O
as	O
OSTypes	B-Application
.	O
</s>
<s>
Microsoft	O
and	O
Windows	B-Application
developers	O
refer	O
to	O
their	O
four-byte	O
identifiers	O
as	O
FourCCs	B-Application
or	O
Four-Character	O
Codes	O
.	O
</s>
<s>
FourCC	B-Application
codes	O
were	O
also	O
adopted	O
by	O
Microsoft	O
to	O
identify	O
data	O
formats	O
used	O
in	O
DirectX	B-Application
,	O
specifically	O
within	O
DirectShow	B-Library
and	O
DirectX	B-Application
Graphics	O
.	O
</s>
<s>
Since	O
Mac	B-Operating_System
OS	I-Operating_System
X	I-Operating_System
Panther	I-Operating_System
,	O
OSType	B-Application
signatures	O
are	O
one	O
of	O
several	O
sources	O
that	O
may	O
be	O
examined	O
to	O
determine	O
a	O
Uniform	B-Operating_System
Type	I-Operating_System
Identifier	I-Operating_System
and	O
are	O
no	O
longer	O
used	O
as	O
the	O
primary	O
data	O
type	O
signature	O
.	O
</s>
<s>
Mac	B-Application
OS	I-Application
X	O
(	O
macOS	B-Application
)	O
prefers	O
the	O
more	O
colloquial	O
convention	O
of	O
labelling	O
file	O
types	O
using	O
file	O
name	O
extensions	O
.	O
</s>
<s>
Filesystem-associated	O
type	O
codes	O
are	O
not	O
readily	O
accessible	O
for	O
users	O
to	O
manipulate	O
,	O
although	O
they	O
can	O
be	O
viewed	O
and	O
changed	O
with	O
certain	O
software	O
,	O
most	O
notably	O
the	O
macOS	B-Application
command	O
line	O
tools	O
GetFileInfo	O
and	O
SetFile	O
which	O
are	O
installed	O
as	O
part	O
of	O
the	O
developer	O
tools	O
into	O
/Developer/Tools	O
,	O
or	O
the	O
ResEdit	B-Operating_System
utility	O
available	O
for	O
older	O
Macs	O
.	O
</s>
<s>
The	O
byte	B-Application
sequence	O
is	O
usually	O
restricted	O
to	O
ASCII	B-Protocol
printable	O
characters	O
,	O
with	O
space	O
characters	O
reserved	O
for	O
padding	O
shorter	O
sequences	O
.	O
</s>
<s>
FourCCs	B-Application
are	O
sometimes	O
encoded	O
in	O
hexadecimal	O
(	O
e.g.	O
,	O
"	O
0x31637661	O
"	O
for	O
'	O
avc1	B-Application
 '	O
)	O
and	O
sometimes	O
encoded	O
in	O
a	O
human-readable	O
way	O
(	O
e.g.	O
,	O
"	O
mp4a	B-Application
"	O
)	O
.	O
</s>
<s>
Some	O
FourCCs	B-Application
however	O
,	O
do	O
contain	O
non-printable	O
characters	O
,	O
and	O
are	O
not	O
human-readable	O
without	O
special	O
formatting	O
for	O
display	O
;	O
for	O
example	O
,	O
10bit	O
Y'CbCr	O
4:2:2	O
video	O
can	O
have	O
a	O
FourCC	B-Application
of	O
( 	O
 '	O
Y	O
 '	O
,	O
'	O
3	O
 '	O
,	O
10	O
,	O
10	O
)	O
which	O
ffmpeg	B-Library
displays	O
as	O
rawvideo	O
(	O
Y3[10]	O
 [ 10 ] 	O
/	O
0x0A0A3359	O
)	O
,	O
yuv422p10le	O
.	O
</s>
<s>
Four-byte	O
identifiers	O
are	O
useful	O
because	O
they	O
can	O
be	O
made	O
up	O
of	O
four	O
human-readable	O
characters	O
with	O
mnemonic	O
qualities	O
,	O
while	O
still	O
fitting	O
in	O
the	O
four-byte	O
memory	O
space	O
typically	O
allocated	O
for	O
integers	O
in	O
32-bit	O
systems	O
(	O
although	O
endian	O
issues	O
may	O
make	O
them	O
less	O
readable	O
)	O
.	O
</s>
<s>
FourCC	B-Application
is	O
written	O
in	O
big	O
endian	O
relative	O
to	O
the	O
underlying	O
ASCII	B-Protocol
character	I-Protocol
sequence	O
,	O
so	O
that	O
it	O
appears	O
in	O
the	O
correct	O
byte	B-Application
order	O
when	O
read	O
as	O
a	O
string	O
.	O
</s>
<s>
Many	O
C	O
compilers	O
,	O
including	O
GCC	O
,	O
define	O
a	O
multi-character	O
literal	O
behavior	O
of	O
right-aligning	O
to	O
the	O
least	O
significant	O
byte	B-Application
,	O
so	O
that	O
becomes	O
0x31323334	O
in	O
ASCII	B-Protocol
.	O
</s>
<s>
This	O
is	O
the	O
conventional	O
way	O
of	O
writing	O
FourCC	B-Application
codes	O
used	O
by	O
Mac	B-Application
OS	I-Application
programmers	O
for	O
OSType	B-Application
.	O
</s>
<s>
(	O
Classic	B-Application
Mac	I-Application
OS	I-Application
was	O
exclusively	O
big-endian	O
.	O
)	O
</s>
<s>
On	O
little-endian	O
machines	O
,	O
a	O
byte-swap	O
on	O
the	O
value	O
is	O
required	O
to	O
make	O
the	O
result	O
correct	O
.	O
</s>
<s>
Taking	O
the	O
avc1	B-Application
example	O
from	O
above	O
:	O
although	O
the	O
literal	O
already	O
converts	O
to	O
the	O
integer	O
value	O
,	O
a	O
little-endian	O
machine	O
would	O
have	O
reversed	O
the	O
byte	B-Application
order	O
and	O
stored	O
the	O
value	O
as	O
.	O
</s>
<s>
To	O
yield	O
the	O
correct	O
byte	B-Application
sequence	O
,	O
the	O
pre-swapped	O
value	O
is	O
used	O
.	O
</s>
<s>
One	O
of	O
the	O
most	O
well-known	O
uses	O
of	O
FourCCs	B-Application
is	O
to	O
identify	O
the	O
video	B-Application
codec	I-Application
or	O
video	B-Algorithm
coding	I-Algorithm
format	I-Algorithm
in	O
AVI	O
files	O
.	O
</s>
<s>
Common	O
identifiers	O
include	O
DIVX	B-Application
,	O
XVID	B-Algorithm
,	O
and	O
H264	B-Application
.	O
</s>
<s>
For	O
audio	O
coding	O
formats	O
,	O
AVI	O
and	O
WAV	O
files	O
use	O
a	O
two-byte	O
identifier	O
,	O
usually	O
written	O
in	O
hexadecimal	O
(	O
such	O
as	O
0055	O
for	O
MP3	B-Application
)	O
.	O
</s>
<s>
In	O
QuickTime	B-Application
files	O
,	O
these	O
two-byte	O
identifiers	O
are	O
prefixed	O
with	O
the	O
letters	O
"	O
ms	O
"	O
to	O
form	O
a	O
four-character	O
code	O
.	O
</s>
<s>
RealMedia	O
files	O
also	O
use	O
four-character	O
codes	O
,	O
however	O
,	O
the	O
actual	O
codes	O
used	O
differ	O
from	O
those	O
found	O
in	O
AVI	O
or	O
QuickTime	B-Application
files	O
.	O
</s>
<s>
Other	O
file	O
formats	O
that	O
make	O
important	O
use	O
of	O
the	O
four-byte	O
ID	O
concept	O
are	O
the	O
Standard	O
MIDI	O
File	O
(	O
SMF	O
)	O
format	O
,	O
the	O
PNG	O
image	O
file	O
format	O
,	O
the	O
3DS	O
(	O
3D	O
Studio	O
Max	O
)	O
mesh	O
file	O
format	O
and	O
the	O
ICC	O
profile	O
format	O
.	O
</s>
<s>
Other	O
uses	O
for	O
OSTypes	B-Application
include	O
:	O
</s>
<s>
in	O
QuickDraw	B-Operating_System
GX	I-Operating_System
,	O
they	O
were	O
used	O
as	O
gxTag	O
types	O
and	O
also	O
as	O
types	O
of	O
collection	O
items	O
in	O
the	O
Collection	O
Manager	O
.	O
</s>
