3

フレームごとにライブデータを取得するために、カメラと AVCaptureVideoDataOutput & AVCaptureAudioDataOutput デリゲートからライブデータを取得する AVCaptureSession を使用します。(-(void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)接続)。取得したバッファを動画ファイルとして保存するために、captureOutput:didOutputSampleBuffer:fromConnection: メソッドから取得したサンプル バッファ フレーム (CMSampleBufferRef) を AVAssetWriter の appendSampleBuffer: メソッドに送信しました。ただし、背面カメラが前面カメラに切り替えられ、前面カメラから受信したサンプル バッファーを使用して appendSampleBuffer: を試行すると、AVAssetWriter インスタンスのステータスは AVAssetWriterStatusFailed になります。

正確なエラー メッセージは次のとおりです。

Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x176573f0 {NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x175e9e50 "The operation could not be completed. (OSStatus error -12710.)", NSLocalizedFailureReason=不明なエラーが発生しました (-12710)}

何が問題になる可能性がありますか?

前もって感謝します...

4

0 に答える 0