MP4 ESDS

来源:互联网 发布:移动卡网络慢怎么办 编辑:程序博客网 时间:2024/04/28 08:17

原文:http://blog.csdn.net/coreavs163/article/details/8603026


ISO/IEC 14496-1 ES_Descriptor is defined as follow:
8.6.5.1 Syntax
class ES_Descriptor extends BaseDescriptor : bit(8) tag=ES_DescrTag {
bit(16) ES_ID;
bit(1) streamDependenceFlag;
bit(1) URL_Flag;
bit(1) OCRstreamFlag;
bit(5) streamPriority;
if (streamDependenceFlag)
bit(16) dependsOn_ES_ID;
if (URL_Flag) {
bit(8) URLlength;
bit(8) URLstring[URLlength];
}
if (OCRstreamFlag)
bit(16) OCR_ES_Id;
DecoderConfigDescriptor decConfigDescr;
SLConfigDescriptor slConfigDescr;
IPI_DescrPointer ipiPtr[0 .. 1];
IP_IdentificationDataSet ipIDS[0 .. 255];
IPMP_DescriptorPointer ipmpDescrPtr[0 .. 255];
LanguageDescriptor langDescr[0 .. 255];
QoS_Descriptor qosDescr[0 .. 1];
RegistrationDescriptor regDescr[0 .. 1];
ExtensionDescriptor extDescr[0 .. 255];
}

ESDS分析
这是一段ESDS数据
00001e7: 0000 0027 6573 6473 0000 0000 0319 0000  ...'esds........
00001f7: 0004 1140 1500 01f8 0001 2728 0000 f3e8 
...@......'(....
0000207: 0502 1388 0601 02                        .......

ES_Descriptor
bis   8         8/16/24/32    16         1                    1            1              5                 16                 8      8*URLlength     U16       
  | TAG=0x03 | Length Field | ES_ID | steamDependenceFlag | URL_Flag | OCRstreamFlag | streamPriority | dependsOn_ES_ID | URLlength | URLstring | OCR_ES_Id | Dec Config Descr | sl Config Descr | ipiPtr[0..1] | ipIDS[0..255] | ipmp DescrPtr[0..255] | lang Descr[0..255] | qos Descr[0..1] | extDescr[0..255] |
                                            |                  |           |                                  ^               ^            ^          ^
                                            |------------------|-----------|----------------------------------|               |            |          |
                                                               |-----------|--------------------------------------------------|------------|          |
                                                                           |--------------------------------------------------------------------------|
Length field
    | 0 | length
bits  1     7
    | 1 | length | 1 | length | 1 | length | 0 | length
bits  1     7      1     7      1     7      1     7
0000 0027:   :esds box长度, 长度是39
6373 6473:   :esds box type: esds
00           :Version为0
  00 0000:   :Flags为0
03           :ES_DescrTag 见14496-1 Table 1
  19         :Length Field:25
     0000:   :ES_ID: 是0
00           :00(hex) =
             :0000 0000(bits)
             :0              :steamDependenceFlag,如果为1,则有16bits的dependsOn_ES_IS
             : 0             :URL_Flag,如果为1,后边则有8bits URLlength, 和相应的URLstring(URLlength)
             :  0            :OCRstreamFlag, 如果为1,有16bits OCR_ES_id;
             :   0 0000      :streamPriority
  04         :DecoderConfigDescriptor TAG
     11      :Length Field:17
       40:   :objectTypeIndication 14496-1 Table8, 0x40是Audio ISO/IEC 14496-3
15           :15(hex) =
             :0001 0101
             :0001 01        :streamType  5是Audio Stream, 14496-1 Table9
             :       0       :upStream
             :        1      :reserved
  00 01f8:   :bufferSizeDB   504
0001 2728:   :maxBitrate  75560
0000 f3e8:   :avgBitrate  62440
05           :DecSpecificInfotag
  02         :Length Field:2
     1388    :14496-3 1.6
             :1388(hex)=
             :0001 0011 1000 1000(bit)
             :0001 0                     :audioObjectType 2 GASpecificConfig
             :      011 1                :samplingFrequencyIndex
             :           000 1           :channelConfiguration 1 
             :                00         :cpConfig
             :                  0        :directMapping
06           :SLConfigDescrTag
  01         :Length Field:1
     02      :predefined 0x02 Reserved for use in MP4 files


0 0