Mov檔案格式分析

來源:互聯網
上載者:User

參考 qtff.pdf (quick time file format)


一、基本概念和定義


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

Atom是quickTime檔案的基本資料單元,每個Atom包含size和type,以及之後的資料部分。


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部分指明Atom的位元組數量,包括size和type的位元組。

type指明資料存放區的類型,也指明了資料的格式。

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

1、關於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 should 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. 

二、資料分析


1、wide atom

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

上面是mov檔案整體的結構分析,下面分析moov和mdat內部的結構。


看一下整體的關係:



結構基本上就到此為止,其他細節在以後逐漸增加。



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.