The QuickTime file format describes the characteristics of QuickTime movie files. A QuickTime movie file contains a QuickTime movie resource, or else points to one or more external sources using movie references. The media samples used by the movie (such as video frames or groups of audio samples) may be included in the movie file, or may be external to the movie file in one or more files, streams, or other sources.
A QuickTime movie is not limited to video and audio; it may use any subset or combination of media types that QuickTime supports, including video, sound, still images, text, Flash, 3D models, and virtual reality panoramas. It supports both time-based and nonlinear interactive media.
In
file systems that support filename extensions, QuickTime movie files
should have an extension of .mov.
On the Macintosh platform, QuickTime files have a Mac OS file type
of 'MooV'. QuickTime
movie files should always be associated with the MIME type "video/quicktime",
whether or not the movie contains video.
Note: In file systems that support both a resource fork and a data fork, the movie resource may be contained in the resource fork. The default, however, is for the movie resource to be contained in the data fork for all file systems. If media sample data is included in the movie file, it is always in the data fork.
A QuickTime movie file is structured as a collection of atoms that together identify the file as a QuickTime movie, describe the structure of the movie, and may contain the sample data needed to play the movie. Not all atoms are required.
The file format is extensible, and from time to time new atom types are introduced. If your application encounters an unknown atom type in a QuickTime file, it should simply ignore it. This allows the file format to be extended without breaking existing applications, and provides a measure of forward compatibility. Because the first field in any atom contains its size, including any contained atoms, it is easy to skip to the end of an unknown atom type and continue parsing the file.
Generally speaking, atoms can be present in any order. Do not conclude that a particular atom is not present until you have parsed all the atoms in the file.
An exception is the file type atom, which typically identifies the file as a QuickTime movie. If present, this atom precedes any movie atom, movie data, preview, or free space atoms. If you encounter one of these other atom types prior to finding a file type atom, you may assume the file type atom is not present. (This atom is introduced in the QuickTime File Format Specification for 2004, and is not present in QuickTime movie files created prior to 2004).
While other atoms can be in any order, unless specified in this document, for practical reasons there is a recommended order you should use when creating a QuickTime movie file. For example, the atom containing the movie resource should precede any atoms containing the movie's sample data. If you follow this recommended atom order, it is possible to play a movie over a network while the movie file is in the process of downloading.
A QuickTime movie file must contain a movie atom, which contains either the movie structure or a reference to one or more alternate movie sources external to the file. Generally speaking, these alternate sources will be QuickTime movie files that contain movie structures.
A QuickTime movie file typically contains one or more movie data atoms, which contain media sample data such as video frames and groups of audio samples. There may be no movie data atoms in the file, however, as the movie may depend on sample data external to the movie file, such as external data files or live streams on the Internet. A single movie data atom may contain sample data for a variety of different media. Generally speaking, it is possible to contain all the media samples used by a movie in a single movie data atom. Movie data atoms can be quite large, and sometimes exceed 2^32 bytes.
Figure 1-6 shows the essential atom types in a QuickTime movie file within which other atoms are stored. In addition, the file may contain free space atoms, preview atoms, and other atoms not enumerated in this file format specification. Unknown atom types should be ignored.
Table 1-1 lists the basic atom types.
Atom type |
Use |
|---|---|
|
File type compatibility—identifies the file type and differentiates it from similar file types, such as MPEG-4 files and JPEG-2000 files. |
Movie resource metadata about the movie (number and type of tracks, location of sample data, and so on). Describes where the movie data can be found and how to interpret it. |
|
Movie sample data—media samples such as video frames and groups of audio samples. Usually this data can be interpreted only by using the movie resource. |
|
Unused space available in file. |
|
Unused space available in file. |
|
' |
Reserved space—can be overwritten by an extended size field if the following atom exceeds 2^32 bytes, without displacing the contents of the following atom. |
Reference to movie preview data. |
The following sections describe these basic atom types (except for the movie atom) in more detail, including descriptions of other atoms that each basic atom may contain. The movie atom is described separately in “Movie Atoms”
The File Type Compatibility Atom
Free Space Atoms
Movie Data Atoms
Preview Atoms
The file type atom allows the reader to determine whether this is a type of file that the reader understands. Specifically, the file type atom identifies the file type specifications the file is compatible with. This allows the reader to distinguish among closely related file types, such as QuickTime movie files, MPEG-4, and JPEG-2000 files (all of which may contain file type atoms, movie atoms, and movie data atoms).
When a file is compatible with more than one specification, the file type atom lists all the compatible types and indicates the preferred brand, or best use, among the compatible types. For example, a music player using a QuickTime-compatible file format might identify a file’s best use as a music file for that player but also identify it as a QuickTime movie.
The file type atom serves a further purpose of distinguishing among different versions or specifications of the same file type, allowing it to convey more information than the file extension or MIME type alone. The file type atom also has the advantage of being internal to the file, where it is less subject to accidental alteration than a file extension or MIME type.
Note: The file type atom described here is functionally identical to the file type box defined in the ISO specifications for MPEG-4 and JPEG-2000.
The file type atom is optional, but strongly recommended. If present, it must be the first significant atom in the file, preceding the movie atom (and any free space atoms, preview atom, or movie data atoms).
The file type atom has an atom type value of 'ftyp' and
contains the following fields:
A 32-bit unsigned integer that specifies the number of bytes in this atom.
A 32-bit unsigned integer that identifies the atom type,
typically represented as a four-character code; this field must
be set to 'ftyp'.
A 32-bit unsigned integer that should be set to 'qt
' (note the two trailing ASCII space characters)
for QuickTime movie files. If a file is compatible with multiple
brands, all such brands are listed in the Compatible_Brands fields,
and the Major_Brand identifies the
preferred brand or best use.
A 32-bit field that indicates the file format specification
version. For QuickTime movie files, this takes the form of four
binary-coded decimal values, indicating the century, year, and month
of the QuickTime File Format Specification, followed by a binary
coded decimal zero. For example, for the June 2004 minor version,
this field is set to the BCD values 20 04 06 00.
A series of unsigned 32-bit integers listing compatible file formats. The major brand must appear in the list of compatible brands. One or more “placeholder” entries with value zero are permitted; such entries should be ignored.
If none of the Compatible_Brands fields is set to 'qt
', then the file is not a QuickTime movie file and is
not compatible with this specification. Applications should return
an error and close the file, or else invoke a file importer appropriate
to one of the specified brands, preferably the major brand. QuickTime
currently returns an error when attempting to open a file whose
file type, file extension, or MIME type identifies it as a QuickTime
movie, but whose file type atom does not include the 'qt
' brand.
Note: A common source
of this error is an MPEG-4 file incorrectly named with the .mov file extension
or with the MIME type incorrectly set to “video/quicktime”.
MPEG-4 files are automatically imported by QuickTime only when they
are correctly identified as MPEG-4 files using the Mac OS file type,
file extension, or MIME type.
If you are creating a file type that is fully compatible with
the QuickTime file format, one of the Compatible_Brand fields must
be set to 'qt '; otherwise QuickTime
will not recognize the file as a QuickTime movie.
Both free and skip atoms
designate unused space in the movie data file. These atoms consist
of only an atom header (size and type fields), followed by the appropriate
number of bytes of free space. When reading a QuickTime movie, your
application may safely skip these atoms. When writing or updating
a movie, you may reuse the space associated with these atom types.
A wide atom typically precedes
a movie data atom. The wide atom
consists only of a type and size field. This occupies 8 bytes—enough
space to add an extended size field to the header of the atom that
follows, without displacing the contents of that atom. If an atom grows
to exceed 2^32 bytes in size, and it is preceded by a wide atom,
you may create a new atom header containing an extended size field
by overwriting the existing atom header and the preceding wide atom.
As with the free and skip atoms, the movie data atom is structured quite simply. It consists of an atom header (atom size and type fields), followed by the movie’s media data. Your application can understand the data in this atom only by using the metadata stored in the movie atom. This atom can be quite large, and may exceed 2^32 bytes, in which case the size field will be set to 1, and the header will contain a 64-bit extended size field.
The preview atom contains information that allows you to find the preview image associated with a QuickTime movie. The preview image, or poster, is a representative image suitable for display to the user in, for example, Open dialog boxes. Figure 1-7 depicts the layout of the preview atom.
The preview atom has an atom type value of 'pnot' and,
following its atom header, contains the following fields:
A 32-bit integer that specifies the number of bytes in this preview atom.
A 32-bit integer that identifies the atom type; this
field must be set to 'pnot'.
A 32-bit unsigned integer containing a date that indicates when the preview was last updated. The data is in standard Macintosh format.
A 16-bit integer that must be set to 0.
A 32-bit integer that indicates the type of atom that
contains the preview data. Typically, this is set to 'PICT' to
indicate a QuickDraw picture.
A 16-bit integer that identifies which atom of the specified type is to be used as the preview. Typically, this field is set to 1 to indicate that you should use the first atom of the type specified in the atom type field.
Note: This specification defines the preview atom primarily for backward compatibility. Current practice is normally to define movie previews by placing information in the movie header atom. See “Movie Header Atoms.”
Last updated: 2007-09-04