gpt4 book ai didi

video-streaming - 从 CMSampleBufferRef 获取 sps 和 pps

转载 作者:行者123 更新时间:2023-12-03 23:09:18 28 4
gpt4 key购买 nike

我使用新 API 将图像从相机推送到 videoToolBox 编码器并从编码器回调中获取编码的 CMSampleBufferRef

我需要这些 sps 和 pts 用于 CMVideoFormatDescriptionCreateFromH264ParameterSets配置解码器

有人可以帮助/指导我吗? )感谢

最佳答案

反之则很容易,相关函数是 CMVideoFormatDescriptionGetH264ParameterSetAtIndex 并且可以像这样使用

CMFormatDescriptionRef format = CMSampleBufferGetFormatDescription(sampleBuffer);
size_t spsSize, ppsSize;
size_t parmCount;
const uint8_t* sps, *pps;

CMVideoFormatDescriptionGetH264ParameterSetAtIndex(format, 0, &sps, &spsSize, &parmCount, nullptr );
CMVideoFormatDescriptionGetH264ParameterSetAtIndex(format, 1, &pps, &ppsSize, &parmCount, nullptr );

关于video-streaming - 从 CMSampleBufferRef 获取 sps 和 pps,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24318092/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com