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(@"エラー!"); } }
デコードに使用されるffmpeg libの機能とCMBlockBufferRef
、これを入力としてどのように配置するかを教えてください??
ありがとう