确定moov数据的位置及大小:
协议中对于moov的描述如下:
The metadata for a presentation is stored in the single Movie Box which occurs at the top‐level of a file.
Normally this box is close to the beginning or end of the file, though this is not required.
先在文件中找到moov (8.2.1 container for all the metadata)
00000540: 6a03 8000 0006 d46d 6f6f 7600 0000 6c6d j……moov…lm
从上面二进制文本中查找,000006d4是moov atom的大小,即8+1740=1748.
从文件地址看,moov开始地址为0x543,0x543+0x6d4 = 0xc17。
文件结尾大小正好为0xc17
00000c10: 2e32 392e 3130 30。
得出0x543->0xc17所有数据属于moov。
按照协议规范 moov中包含必选项如下:
moov * 8.2.1 container for all the metadata
mvhd * 8.2.2 movie header, overall declarations
trak * 8.3.1 container for an individual track or stream
tkhd * 8.3.2 track header, overall information about the track
mdia * 8.4 container for the media information in a track
mdhd * 8.4.2 media header, overall information about the media
hdlr * 8.4.3 handler, declares the media (handler) type
minf * 8.4.4 media information container
dinf * 8.7.1 data information box, container
dref * 8.7.2 data reference box, declares source(s) of media data in track
stbl * 8.5.1 sample table box, container for the time/space
map
stsd * 8.5.2 sample descriptions (codec types, initialization
etc.)
stts * 8.6.1.2 (decoding) time-to-sample
stsc * 8.7.4 sample-to-chunk, partial data-offset information
stco * 8.7.5 chunk offset, partial data-offset information