I use AVCaptureSession getting live data from camera and AVCaptureVideoDataOutput & AVCaptureAudioDataOutput delegates in order to get live data frame by frame. (-(void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection). I sent sample buffer frames (CMSampleBufferRef) that are taken from captureOutput:didOutputSampleBuffer:fromConnection: method to the AVAssetWriter's appendSampleBuffer: method in order to save the taken buffers as video file. But AVAssetWriter instance's status becomes to AVAssetWriterStatusFailed when back camera is toggled to front camera and try to appendSampleBuffer: with the sample buffer that is received from front camera.
The exact error message is:
Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x176573f0 {NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x175e9e50 "The operation couldn’t be completed. (OSStatus error -12710.)", NSLocalizedFailureReason=An unknown error occurred (-12710)}
What can be the problem?
Thanks in advance...