我正在檢查包含在從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
如何AVCLevelIndication
和AVCProfileIndication
從profile_idc
和level_idc
推斷?
有沒有辦法通過將參數與SPS
參數進行比較來檢查或修復錯誤參數?
在我的示例profile_idc == 103如何轉換爲66(基線配置文件)?和level_idc == 0如何轉換爲13(等級1.3)? – Alex 2012-08-08 18:20:16
它看起來沿着線的某個位置向後移。 '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
此外,這個profile_idc == 103表明你正在獲取profile_idc = 0x67這實際上是NALU頭。 '0x67&0x1F == 0x7' SPS類型爲0x7。你想從下一個字節0x42開始。 – jgh 2012-08-08 22:13:55