video - H264 SPS 和 PPS - 如果我更改它们会怎样?
问题描述
播放 H264 格式。
想知道如何构建具有所需 SPS 和 PPS 的视频吗?可能只是样本,1帧左右?我希望我使用了正确的术语。
有没有任何库?要创建具有所需 SPS 和 PPS 的视频?
以下是示例视频中的数据:
0x01 is the configurationVersion
0x42 is AVCProfileIndication
0x00 is profile_compatibility
0x1F is AVCLevelIndication
0xFF is 6bit reserved and 2bit lengthSizeMinusOne
0xE1 is 3bit reserved and 5bit numOfSequenceParameterSets
0x00 0x09 is the length of sps is 9 bytes.
So the content of SPS is the next 9 bytes: 67 42 00 1f e9 02 c1 2c 80
Next: 01 is numOfPictureParameterSets
0x00 and 0x04 are pps with a length of 4 bytes.
So the content of PPS is the next 4 bytes: 68 ce 06 f2
The SPS length is: 9
The content of the SPS is: 67 42 00 1f e9 02 c1 2c 80
----------
The PPS length is: 4
The content of the PPS is: 68 ce 06 f2
----------
我的问题是如果我在视频文件中更改/修改 SPS 或 PPS 参数会发生什么?它仍然有效吗?那些似乎没有校验和?
例如,如果我更改 SPS 或 PPS 的长度?
解决方案
SPS/PPS 对解码器需要的数据进行编码。它对分辨率、压缩方法、颜色数据等内容进行编码。每个视频只需要一次而不是每帧一次。如果修改它,解码器将无法正确解码视频,导致损坏或无输出。
它仍然有效吗?
好吧,这取决于您对“有效”的定义。如果它仍然设法确认规范,是的,但实际上不是。进行符合要求的随机更改的几率非常低。
即使不符合要求,许多解码器仍会尝试解码视频。但它很可能会失败。
我建议您获取 ISO-14496-10 的副本并阅读它,而不是随意更改。然后,您将了解您的更改实际上会做什么。
推荐阅读
- python - 加载预训练网络时,错误表明尺寸变平
- c# - 了解 Mvc 核心标识
- swift - Xcode 未检测 gomobile(绑定)生成的框架上的架构
- javascript - 当用户在按钮单击时输入无效的日期格式时如何显示验证错误?
- python - 找出可用作缺失值建议的特定字符串
- mysql - 你如何多次打开/关闭mysql连接?
- rust - 带有类型问题的 Future 和 Stream 嵌套
- r - 将插入符号的混淆矩阵应用于由 data.frames 组成的列表,从而产生多个混淆矩阵
- javascript - 来自“动态”数据 JSON 值的多折线图
- python - 使用 Pandas 比较字符串到 JSON