gpt4 book ai didi

iPhone 摄像头直播

转载 作者:行者123 更新时间:2023-12-03 20:15:27 25 4
gpt4 key购买 nike

我已经下载了ffmpeg lib文件并为armv7编译了它。我成功在项目中添加了 ffmpeg lib 文件。我能够使用 AVFoundation 获取 iphone 摄像头实时流。

现在的问题是我如何将 iPhone 相机流输出转换为 ffmpeg 的输入进行解码?检查我的代码

- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection {


CMBlockBufferRef bufferData = CMSampleBufferGetDataBuffer(sampleBuffer);
size_t lengthAtOffset;
size_t totalLength; char* data;

if(CMBlockBufferGetDataPointer(bufferData, 0, &lengthAtOffset, &totalLength, &data ) != noErr ){ NSLog(@"error!"); } }

请建议我使用 ffmpeg lib 的哪个函数进行解码以及如何将 CMBlockBufferRef 作为其输入?

谢谢

最佳答案

您可以使用 OPenTok 进行实时视频流

https://github.com/opentok/opentok-ios-sdk

关于iPhone 摄像头直播,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10042506/

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