mp4的box信息——avcC,mdat

前面忽略了avcC的box信息和mdat的格式信息,后面遇到了问题,现在在这里补充上这两个box的信息。

这2个box的信息在iso_iec-14496-15中。

//————avcC——————-//
5.3.4.1
Sample description name and format
5.3.4.1.1 Definition
Box Types:‘avc1’, ‘avcC’, ‘m4ds’,’btrt’
Container:Sample Table Box (‘stbl’)
Mandatory:The avc1 box is mandatory
Quantity:One or more sample entries may be present

5.3.4.1.2 Syntax

// Visual Sequences
class AVCConfigurationBox extends Box(‘avcC’) {
    AVCDecoderConfigurationRecord() AVCConfig;
}
class MPEG4BitRateBox extends Box(‘btrt’){
    unsigned int(32) bufferSizeDB;
    unsigned int(32) maxBitrate;
    unsigned int(32) avgBitrate;
}
class MPEG4ExtensionDescriptorsBox extends Box(‘m4ds’) {
    Descriptor Descr[0 .. 255];
}
class AVCSampleEntry() extends VisualSampleEntry (‘avc1’){
    AVCConfigurationBox config;
    MPEG4BitRateBox ();
    // optional
    MPEG4ExtensionDescriptorsBox (); // optional
}

关于这个:AVCDecoderConfigurationRecord的说明:

aligned(8) class AVCDecoderConfigurationRecord {
    unsigned int(8) configurationVersion = 1;
    unsigned int(8) AVCProfileIndication;
    unsigned int(8) profile_compatibility;
    unsigned int(8) AVCLevelIndication;
    bit(6) reserved = ‘111111’b;
    unsigned int(2) lengthSizeMinusOne;
    bit(3) reserved = ‘111’b;
    unsigned int(5) numOfSequenceParameterSets;
    for (i=0; i< numOfSequenceParameterSets; i++) {
        unsigned int(16) sequenceParameterSetLength ;
        bit(8*sequenceParameterSetLength) sequenceParameterSetNALUnit;
    }
    unsigned int(8) numOfPictureParameterSets;
    for (i=0; i< numOfPictureParameterSets; i++) {
        unsigned int(16) pictureParameterSetLength;
        bit(8*pictureParameterSetLength) pictureParameterSetNALUnit;
    }
}

分析一段avcC的数据:

字段16进制2进制含义
00 00 00 2Esize大小
61 76 63 43‘a’ ‘v’ ‘c’ ‘C’
0x01configurationVersion
0x4DAVCProfileIndication。10进制的77,对照profile的情况,知道是main profile
00profile_compatibility .一般0
1FAVCLevelIndication.10进制的31
FF1111 1111前面6位为reserved,后面2位(0b11)为:lengthSizeMinusOne,表示3,那么用来表示size的字节就有3+1=4个
E11110 0001前面3位是reserved,后面5bit是numOfSequenceParameterSets,表示有1个。
00 17sequenceParameterSetLength
67 4D 00 1F 95 A8 14 01 6E 9B 80 80 80 A0 00 00 7D 00 00 0E A6 10 80这0x17=23个字节就是sps的内容
01numOfPictureParameterSets,有1个pps
00 04pictureParameterSetLength
68 EE 3C 80PPS的内容

回到mdat那里看:
00 20 FA 68 6D 64 61 74 00 00 00 17 67 4D 00 1F
95 A8 14 01 6E 9B 80 80 80 A0 00 00 7D 00 00 0E
A6 10 80 00 00 00 04 68 EE 3C 80 00 00 00 05 06

字段含义
00 20 FA 68
6D 64 61 74
00 00 00 174个字节的长度信息,由上面的lengthSizeMinusOne+1决定
67 4D 00 1F 95 A8 14 01 6E 9B 80 80 80 A0 00 00 7D 00 00 0E A6 10 80sps内容
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值