我正在检查从 Android 设备录制的 .mp4 视频文件中包含的解码器配置记录。某些设备在解码器配置记录中写入了奇怪或不正确的参数。
这是来自 Galaxy Player 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 个最低有效位被保留并设置为等于 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
参数进行比较来检查或可能修复错误的参数?
最佳答案
level_idc
是 10 * level
。即,如果您使用的是级别 3.1
,它将是 31
。
profile_idc
在 ISO/IEC 14496-10
的附录 A 中指定。例如,Baseline profile 是 66
,Main Profile 是 77
,Extended Profile 是 88
。
此外,您可以分别在 7.3.2.1 和 7.3.2.2 节中查看 SPS RBSP 和 PPS RBSP 的语法。注意ue(x)
和se(x)
表示无符号指数哥伦布编码和有符号指数哥伦布编码。
编辑:我很抱歉。 AVCProfileIndication
和 AVCLevelIndication
应该与 profile_idc
和 level_idc
关于h.264 - 从 .mp4 中获取的 H.264 解码器配置记录的格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11868869/