fmp4格式解析

一個典型的fmp4格式如下

sidx box(segment index):

SidxBox:
unsigned int(32) size; 
int(32) type;
if (size==1) {
    unsigned int(64) largesize;
}
unsigned int(8) version;
bit(24) flags;
unsigned int(32) reference_ID;
unsigned int(32) timescale;
if(version == 0) {
    unsigned int(32) earliest_presentation_time;
    unsigned int(32) first_offset;
}
if(version == 1) {
    unsigned int(64) earliest_presentation_time;
    unsigned int(64) first_offset;
}
unsigned int(16) reserved;
unsigned int(16) reference_count;

for (i=0; i < reference_count; i++) {
    bit(1) reference_type;
    unsigned int(31) referenced_size;
    unsigned int(32) subsegment_duration;
    bit(1) starts_with_SAP;
    bit(3) SAP_type;
    unsigned int(28) SAP_delta_time;
}

reference_ID:如果sidx被“parent”sidx引用,reference_ID的值應該同引用者sidx box的reference_ID 值一致。

timescale:時間刻度。

earliest_presentation_time:最早的呈現時間。

first_offset:從該box後到索引材料的第一個字節的距離(以字節爲單位)。

reserved:0。

reference_count:reference個數。

reference_type:置1表示引用的是一個sidx box,否則則是media content。

referenced_size:從引用項的第一個字節到下一個引用項的第一個字節的字節距離,或者在最後一個條目的情況下,到引用材料的結尾的距離。

subsegment_duration:時長,與earliest_presentation_time的單位相同。

starts_with_SAP:

SAP_type:

SAP_delta_time:

 

 

 

發佈了4 篇原創文章 · 獲贊 9 · 訪問量 1萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章