2012-08-08 136 views
2

我正在檢查包含在從Android設備記錄的.mp4視頻文件中的解碼器配置記錄。某些設備在解碼器配置記錄中寫入了奇怪或不正確的參數。H.264解碼器配置記錄的格式取自.mp4

這裏是銀河隊球星4.0示例這是不正確的:

DecoderConfigurationRecord: 010283f2ffe100086742000de90283f201000568ce010f20 
     pictureParameterSetNALUnits : 68ce010f20 
     AVCLevelIndication : 242 
     AVCProfileIndication : 2 
     sequenceParameterSetNALUnits : 6742000de90283f2 
     lengthSizeMinusOne : 3 
     configurationVersion : 1 
     profile_compatibility : 131 
     profile_idc : 103 
     constraint_set : 16 
     level_idc : 0 

AVCLevelIndication == 242是錯誤的,因爲標準規定51爲最高值。

AVCProfileIndication應在(66,77,88,100,120,...)

profile_compatibility稱爲constraint_set_flag秒和2個最低顯著位被保留,seposed等於0

這是應該的樣子:

DecoderConfigurationRecord: 0142000dffe100086742000de90283f201000568ce010f20 
     pictureParameterSetNALUnits : 68ce010f20 
     AVCLevelIndication : 13 
     AVCProfileIndication : 66 
     sequenceParameterSetNALUnits : 6742000de90283f2 
     lengthSizeMinusOne : 3 
     configurationVersion : 1 
     profile_compatibility : 0 
     profile_idc : 103 
     constraint_set : 16 
     level_idc : 0 

如何AVCLevelIndicationAVCProfileIndicationprofile_idclevel_idc推斷?

有沒有辦法通過將參數與SPS參數進行比較來檢查或修復錯誤參數?

回答

5

level_idc10 * level。即如果您使用的是3.1級別,則它將是31

profile_idcISO/IEC 14496-10的附件A中指定。例如,基線簡檔是66,主簡檔是77,擴展簡檔是88

此外,您可以分別在第7.3.2.1和7.3.2.2節中看到SPS RBSP和PPS RBSP的語法。注ue(x)se(x)表示無符號指數golomb編碼和有符號指數golomb編碼。

編輯:我的歉意。 AVCProfileIndicationAVCLevelIndication應該與profile_idclevel_idclevel_idc

+0

在我的示例profile_idc == 103如何轉換爲66(基線配置文件)?和level_idc == 0如何轉換爲13(等級1.3)? – Alex 2012-08-08 18:20:16

+0

它看起來沿着線的某個位置向後移。 'AVCProfileIndication','profile_compatibility'和'AVCLevelIndication'是SPS NALU中的字節1到3。即,您應該忽略0x67,因爲這表示它是SPS NALU,然後對這些值使用0x42,0x00,0x0d。但是,它似乎是從NALU數據的後面使用'0xF2','0x83'和'0x02',並且走錯了方向。 '0xF2'給你242,'0x83'給你131的profile_compatibility,'0x02'給你一個等級2. – jgh 2012-08-08 21:00:59

+1

此外,這個profile_idc == 103表明你正在獲取profile_idc = 0x67這實際上是NALU頭。 '0x67&0x1F == 0x7' SPS類型爲0x7。你想從下一個字節0x42開始。 – jgh 2012-08-08 22:13:55