0

I am using 'PBJVISION' in my app for Instagram like touch-to-record feature. It works fine but when I try to switch from PBJCameraMode.Video to PBJCameraMode.Photo, I am receiving an error;

reason: -[AVCaptureStillImageOutput captureStillImageAsynchronouslyFromConnection:completionHandler:] - inconsistent state.'

My code is pretty straightforward;

@IBAction func changeCameraModeAction(sender: AnyObject) {
    if recordFlag == false {
        PBJVision.sharedInstance().maximumCaptureDuration = CMTimeMakeWithSeconds(kTotalVideoLength, kVideoFramePerSec)
        PBJVision.sharedInstance().cameraMode = PBJCameraMode.Video

        recordFlag = true

    } else {
        progressBarView.hidden = true
        PBJVision.sharedInstance().cameraMode = PBJCameraMode.Photo
        recordFlag = false
        }
}

Can you please help me?

Thanks, E.

rmaddy
  • 314,917
  • 42
  • 532
  • 579

1 Answers1

0

I had the same error when before I took down and set up the AVCaptureSession.

I only had spotted in iPhone 6.

Something it happen even when I do this in the main thread. I haven't use PBJVISION though. My error

    App crashing with exception: *** -[AVCaptureStillImageOutput captureStillImageAsynchronouslyFromConnection:completionHandler:] - inconsistent state.

   *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '*** -[AVCaptureStillImageOutput captureStillImageAsynchronouslyFromConnection:completionHandler:] - inconsistent state.'

I will update if I get more insight on this.

igpogo
  • 16
  • 4