Mov file format Analysis

Source: Internet
Author: User

See qtff.pdf (quick time file format)


I. Basic Concepts and Definitions


The basic data unit in a QuickTime file is the atom. Each atom contains size and type information along with its data.

Atom is the basic data unit of the QuickTime file. Each atom contains the size, type, and subsequent data.


The size field indicates the number of bytes in the atom, including the size andtype fields. the Type field specifies the type of data stored in the atom and, by implication, the format of that data.

Size indicates the number of atom bytes, including the size and type bytes.

Type indicates the type of data storage and the format of data.

Atom types are specified by a 32-bit integer, typically a four-character code.

1. Definition of size

Atom size:

A 32-bit integer that indicates the size of the atom, including both the atom header and theatom's contents, including any contained atoms. normally, the size field contains the actualsize of the atom, in bytes, expressed as a 32-bit unsigned integer. however, the size field cancontain special values that indicate an alternate method of determining the atom size. (thesespecial values are normally used only for media data ('mdat ') atoms .) if the size field is setto 0, which is allowed only for a top-level atom, this is the last atom in the file and it extendsto the end of the file. if the size field is set to 1, then the actual size is given in the extendedsize field, an optional 64-bit field that follows the type field. this accomodates media dataatoms that contain more than 2 ^ 32 bytes.


2. Atom type:

A 32-bit integer that contains the type of the atom. this can often be usefully treated as afour-character field with a mnemonic value, such as 'moov '(0x6d6f6f76) for a movie atom, or 'trak' (0x7472616b) for a track atom, but non-ASCII values (such as 0x00000001) arealso used. knowing an atom's type allows you to interpret its data. an atom's data can bearranged as any arbitrary collection of fields, tables, or other atoms. the data structure isspecific to the atom type. an atom of a given type has a defined data structure. if yourapplication encounters an atom of an unknown type, it shocould not attempt to interpret theatom's data. use the atom's size field to skip this atom and all of its contents. this allows adegree of forward compatability with extensions to the QuickTime file format.

3. Extended size

If the size field of an atom is set to 1, the Type field is followed by a 64-bit extended size

Field, which contains the actual size of the atom as a 64-bit unsigned integer. This is used whenthe size of a media data atom exceeds 2 ^ 32 bytes.


4. Version

All version fields must be set to0, unless this document states otherwise.

Ii. Data Analysis


1. Wide Atom

The 'wid' atom is exactly 8 bytes in size, and consists solely of its size and type fields. It containsno other data.

The above is the overall structure analysis of the mov file. The following analyzes the internal structure of moov and mdat.


Take a look at the overall relationship:



This is basically the end of the structure, and other details will gradually increase in the future.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.