简体   繁体   English

Android 设备上的 H264 PPS 和 SPS

[英]H264 PPS and SPS on Android Device

Using the Android Camera Video recorder I made a video:使用 Android 摄像机录像机我制作了一个视频:

It seems like seqParamSetLength always is 15 and picParamSetLength is always 4.似乎 seqParamSetLength 始终为 15,而 picParamSetLength 始终为 4。

Is this somehow defined in Codec (MediaCodec)?这是在编解码器(MediaCodec)中以某种方式定义的吗?

03-14 20:27:30.125   379  3343 I MPEG4Writer: parseAVCCodecSpecificData
03-14 20:27:30.125   379  3343 I MPEG4Writer: getNalUnitType: 103
03-14 20:27:30.125   379  3343 I MPEG4Writer: parseParamSet
03-14 20:27:30.125   379  3343 I MPEG4Writer: parseParamSet 67
03-14 20:27:30.125   379  3343 I MPEG4Writer: getNalUnitType: 104
03-14 20:27:30.125   379  3343 I MPEG4Writer: parseParamSet
03-14 20:27:30.125   379  3343 I MPEG4Writer: parseParamSet 68
03-14 20:27:30.125   379  3343 I MPEG4Writer: seqParamSetLength 15
03-14 20:27:30.125   379  3343 I MPEG4Writer: picParamSetLength 4

Want to do something similar like this below, but wonder how to set the values in the MediaCodec for seqParamSetLength and picParamSetLength?想要在下面做类似的事情,但想知道如何在 MediaCodec 中为 seqParamSetLength 和 picParamSetLength 设置值? Are they per device?他们是每台设备吗? Per codec?每个编解码器?

MediaCodec configuration for SPS and PPS H264 encoder SPS 和 PPS H264 编码器的 MediaCodec 配置

It seems like seqParamSetLength always is 15 and picParamSetLength is always 4.似乎 seqParamSetLength 始终为 15,而 picParamSetLength 始终为 4。

This is not true.这不是真的。 The size of the SPS/PPS are different depending on the encoder and settings used. SPS/PPS 的大小因使用的编码器和设置而异。 Since android typically uses hardware encoders, You will get different sizes on different devices.由于 android 通常使用硬件编码器,您将在不同的设备上获得不同的尺寸。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM