mukyasa/MMCamScanner

Error on captureStillImageAsynchronouslyFromConnection

Rehmanbu opened this issue · 14 comments

[_stillImageOutput captureStillImageAsynchronouslyFromConnection:videoConnection completionHandler: ^(CMSampleBufferRef imageSampleBuffer, NSError *error)

Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSUnderlyingError=0x174056170 {Error Domain=NSOSStatusErrorDomain Code=-16800 "(null)"}, NSLocalizedFailureReason=An unknown error occurred (-16800), NSLocalizedDescription=The operation could not be completed}

Same error since iOS 10...
captureStillImageAsynchronouslyFromConnection:videoConnection works randomly for me

Correction :
On MMCameraPickerController.m -> capturePhoto() -> handler of captureStillImageAsynchronouslyFromConnection add :

if(!CMSampleBufferIsValid(imageSampleBuffer)){
             isCapturingImage = NO;
             [self capturePhoto];
             return;
}

EDIT 8NOV2017

         if(!CMSampleBufferIsValid(imageSampleBuffer))
         {
             isCapturingImage = NO;
             [self capturePhoto];
             return;
         }
         
         [_mySesh stopRunning];

And remove [_mySesh stopRunning]; on the -(IBAction)capturePhoto:(id)sender method

@MapleNoise this is not fixing my issue still my camera works randomly!
if u have another suggestion regarding this issue please let me know...Thanx

@mukyasa tell me something to fix it please it's urgent

@AzimJavaidKhan It's Camera library issue you can change it with diff camera library and problem solved, It will take time from my end to update the camera library code. You dont have to touch OpenCV code

ok thanx!
1 more favour please can u tell me diff libraries for camera?

where to add this line?

@AzimJavaidKhan if you add :

         if(!CMSampleBufferIsValid(imageSampleBuffer))
         {
             isCapturingImage = NO;
             [self capturePhoto];
             return;
         }
         
         [_mySesh stopRunning];

And remove [_mySesh stopRunning]; on the - (IBAction)capturePhoto:(id)sender method ?

now the retake button also captures, the black screen and sends black screen for cropping!

Oh... Sorry That's the only thing I changed to worked for me...

[self.capturePhoto]....is it important to write this?

@MapleNoise but after your answer i m now able to take 7/10 pictures thanks. But still missing 3 times don't know why? i haven't changed anything except what u suggested!

@mukyasa if u have excess time can you please fix it. It's very important for me and i have short time period for this task!
please