MP4文件格式
2017-03-20 15:49:07 0 举报
AI智能生成
MP4文件解析
作者其他创作
大纲/内容
ftyp(file type)
major_brand(eg. isom 4 bytes)
minor_version(4 bytes)
compatible_brands(12 bytes)
moov(moive box)
mvhd
version (1)
flags (3)
creation time (4)
modification time (4) 未使用
timescale(4) MOVContext->time_scale
duration (4/8) MOVContext->fc->duration = av_rescale(c->duration, AV_TIME_BASE, c->time_scale);
rate (4) 推荐播放速率 未使用
volume(2) 最大音量 未使用
reserved (10) 保留位 未使用
matrix (36) 未使用
pre-defined (24) 未使用
next track id (4) 未使用
trak
tkhd
version (1)
flags (3)
creation time (4/8) 未使用
modification time (4/8) 未使用
track id (4)
duration (4/8 未用到)
reserved (8)
layer (2 未用到)
alternate group (2 未用到)
volume (2 未用到)
reserved (2)
matrix (36) 这个matrix与上面的matrix有什么关系?
width (4) MOVStreamContext->width = width >> 16
height (4) MOVStreamContext->height = height >> 16
edts
elst (edit list) 用于映射movie的时间到此track media的时间
mdia
mdhd
version (1)
flags (3)
creation time (4/8)
modification time (4/8) 未使用
time scale (4) MOVStreamContext->time_scale 这个好像是要转换成AVStream中的time_base
duration (4/8) AVStream->duration
language (2)
quality (2) 未使用
hdlr
version (1)
flags (3)
component type (4) 未使用
component subtype (4) vide/soun/mla /subp/clcp
reserved (12)
componext name 可变长度
minf
vmhd(video)
version (1)
flags (3)
graphics mode (4) 视频合成模式,0:拷贝原始图像,否则与opcolor进行合成
opcolor
smhd(audio)
version (1)
flags (3)
blance (2) 立体声平衡,[8,8]格式值,一般为0,-1.0表示全部左声道,1.0表示全部右声道
dinf (data information)
stbl (sample table)
stsd (sample description) 里面有一个avc1 box,前面需要跳过76个字节
version (1)
flags (3)
count
next sample description string size (4)
data format (4)
reserved (6)
data reference (2)
stts (time to sample) 描述各个sample的duration
version (1)
flags (3)
count
sample count (4) 有相同duration的连续sample的数目
sample duration (4) 每个sample的duration
stss (sync sample)
version (1)
flags (3)
count (4)
index (4) 每个数据占4个字节
ctts (composition offset) PT(n) = DT(n) + CTTS(n)
version (1)
flags (3)
count (4)
offset (4)
stsc (sample to chunk)
version (1)
flags (3)
count (4)
index (4) 第一个chunk的序号
samples per chunk (4) 每个chunk中sample的数量
sample description id (4)
stsz (sample size)
version (1)
flags (3)
sample size (4) 全部sapmle的数目。如果所有sample的长度相同,这个字段就是一个长度值,否则为0.
size (4)
stco (chunk offset)
version (1)
count (4) chunk的总数
offset (4)
mdat
0 条评论
下一页
为你推荐
查看更多