Best practice for rapid sequential Live Photo captures with AVCapturePhotoOutput?

Hi everyone,

I’m working on a camera app as a learning project and have reached a point where I’m trying to better understand the intended architecture for Live Photo capture using AVCapturePhotoOutput.

The app currently supports:

  • Live Photos
  • Depth data
  • Location metadata
  • Multiple lens presets on a virtual multi-camera device

Everything is working well, but I’m now thinking about capture throughput and rapid shutter presses.

Right now, my implementation is fairly conservative. I wait for a Live Photo capture to finish processing and importing before allowing another capture. This is reliable, but it doesn’t feel particularly camera-like when compared to Apple’s Camera app.

One observation from field testing caught my attention:

I took a Live Photo, immediately switched lenses, then took another Live Photo. When I viewed the first Live Photo later, the movie portion included the lens-switching actions that occurred after I pressed the shutter.

That made me realize that I may be thinking about the capture lifecycle incorrectly.

My questions are:

  1. When using AVCapturePhotoOutput with Live Photos enabled, what is the earliest point at which a capture can be considered “safely secured”?
  2. Is it expected that apps wait for PhotoKit import to complete before accepting another Live Photo capture request?
  3. If supporting rapid sequential shutter presses, is the recommended approach to queue capture requests and process them one at a time?
  4. Are there any best practices around lens changes or camera reconfiguration while a Live Photo is still being captured or processed?

I’m not looking for details about the implementation of Apple’s Camera app. I’m mainly trying to understand the recommended approach when working with the public AVFoundation APIs.

I’d appreciate any guidance, documentation references, or examples from developers who have worked through similar problems.

Thanks!

Hi Countingcook, Great questions about LivePhotos. When you fire off a capture request, your AVCapturePhotoCaptureDelegate gets a series of callbacks taking you through the life of the photo as it's captured, processed, and ultimately delivered to you as an AVCapturePhoto.

You can't simply fire off photo requests in a loop, as the framework limits you to 10 outstanding requests. But you don't have to wait for one photo request's -didFinishCaptureForResolvedSettings to fire before making your next request. Live Photo movie complements are allowed to overlap, so you can fire off a second or third request before the first one has completed.

The best way to track the photo output's readiness to capture another photo is to use the photo output's "captureReadiness" property, which will tell you when its ready to service a new request.

Best practice for rapid sequential Live Photo captures with AVCapturePhotoOutput?
 
 
Q