我已经下载了ffmpeg库文件并为armv7编译过。我成功地将ffmpeg库文件添加到我的项目中。使用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;
如果(CMBlockBufferGetDataPointer(bufferData, 0, &lengthAtOffset, &totalLength, &data ) != noErr ){ NSLog(@"错误!"); } }
请告知我在FFmpeg库中用于解码的哪个函数以及如何将CMBlockBufferRef
作为其输入?
谢谢。