Stuck recording when switching cameras
prokopiev-cr opened this issue · comments
Hi guys, faced the problem. I wanted to switch cameras while capturing video. I use AVCaptureSessionPreset1280x720 preset. But it led the audio&video desynchronization. So I just pause video capture on flip camera button action, and resume in delegate method -visionCameraDeviceDidChange:
But there is another problem, after multiple cameras switching the
-vision:didCaptureVideoSampleBuffer:
-vision:didCaptureAudioSampleBuffer:
methods begin to log the same vision.capturedVideoSeconds & vision.capturedAudioSeconds, so the video seems to be broken, also after calling
-endVideoCapture
this method logs an error
"encounted an error in video capture (Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSUnderlyingError=0x15152b4c0 {Error Domain=NSOSStatusErrorDomain Code=-16364 "(null)"}, NSLocalizedFailureReason=An unknown error occurred (-16364), NSLocalizedDescription=The operation could not be completed})"
Any suggestions how to solve it? Or maybe there is a way to not pause capturing and avoid desynchronization when switching cameras? (
Hey friends, i recommend checking out http://github.com/nextlevel/nextlevel
It's more resilient when it comes to switching devices.