MMCamScanner icon indicating copy to clipboard operation
MMCamScanner copied to clipboard

Error on captureStillImageAsynchronouslyFromConnection

Open Rehmanbu opened this issue 7 years ago • 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}

Rehmanbu avatar Feb 09 '17 11:02 Rehmanbu

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

MapleNoise avatar Feb 10 '17 14:02 MapleNoise

Will look in to it

Thnks for reporting

On Fri, 10 Feb 2017 at 8:05 PM, Lionel [email protected] wrote:

Same error since iOS 10...

captureStillImageAsynchronouslyFromConnection:videoConnection works randomly for me

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mukyasa/MMCamScanner/issues/8#issuecomment-278956210, or mute the thread https://github.com/notifications/unsubscribe-auth/AHIlzFz_8OjdXUFch5sqfdTxH-GUBmXJks5rbHWzgaJpZM4L7_XI .

mukyasa avatar Feb 10 '17 18:02 mukyasa

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 avatar Mar 09 '17 09:03 MapleNoise

@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

AzimJavaidKhan avatar Nov 08 '17 12:11 AzimJavaidKhan

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

AzimJavaidKhan avatar Nov 08 '17 12:11 AzimJavaidKhan

@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

mukyasa avatar Nov 08 '17 12:11 mukyasa

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

AzimJavaidKhan avatar Nov 08 '17 13:11 AzimJavaidKhan

where to add this line?

AzimJavaidKhan avatar Nov 08 '17 13:11 AzimJavaidKhan

@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 ?

MapleNoise avatar Nov 08 '17 13:11 MapleNoise

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

AzimJavaidKhan avatar Nov 08 '17 13:11 AzimJavaidKhan

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

MapleNoise avatar Nov 08 '17 13:11 MapleNoise

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

AzimJavaidKhan avatar Nov 08 '17 13:11 AzimJavaidKhan

@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!

AzimJavaidKhan avatar Nov 08 '17 14:11 AzimJavaidKhan

@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

AzimJavaidKhan avatar Nov 09 '17 11:11 AzimJavaidKhan