3

我已经下载了 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其作为输入?

谢谢

4

1 回答 1

0

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

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

于 2012-06-15T05:13:47.320 回答