1

Is there any way I could improve the speed of captureStillImageAsynchronouslyFromConnection ?

I've tried to simply focus on outputted frames, like so: captureOutput:didOutputSampleBuffer:fromConnection:, but that doesn't really solve the problem. Besides, I can't get the same resolution from that delegation method as I could with the captureAsync method above.

So my question is, is there any way I could improve the return speed of captureAsync? Right now I'm averaging about ~0.5 seconds each on an iPhone 7.

Maybe disabling HDR, etc. ? If anyone has any input, I'd be forever thankful.

COOKIES
  • 434
  • 4
  • 14

1 Answers1

1

As you might have already know,captureStillImageAsynchronouslyFromConnection:completionHandler: is deprecated from iOS 10.

As per apple documentation

The AVCaptureStillImageOutput class is deprecated in iOS 10.0 and does not support newer camera capture features such as RAW image output, Live Photos, or wide-gamut color. In iOS 10.0 and later, use the AVCapturePhotoOutput class instead. (The AVCaptureStillImageOutput class remains supported in macOS 10.12.)

Since you are targeting iPhone 7 i would suggest to use AVCapturePhotoOutput and its delegate AVCapturePhotoCaptureDelegate

For more info chceck out my previous SO answer

To increase the speed, AFAIK only way is to use captureOutput:didOutputSampleBuffer:fromConnection:

  • it gives you the frames which are processed by Capture Device.
  • To ensure you get a high quality picture, you need to add correct AVCapturePhotoSettings and get high quality image data.

From my testing results for processing speed this method can process more then 20 frames per second for iPhone 6 and more then 50 frames per second on iPhone 7 and 7 plus (note it might be not exact result as my photo settings and image processing might be different then yours)

Community
  • 1
  • 1
Bluewings
  • 3,438
  • 3
  • 18
  • 31
  • `captureOutput:didOutputSampleBuffer:fromConnection:` seems to be the only option. Thanks @Bluewings – COOKIES May 15 '17 at 06:24