Jake G
Jake G

Reputation: 1195

AVFoundation: Capture session with AVCaptureMovieFileOutput and AVCaptureStillImageOutput has lagging shutter sound

I have a camera view in my app where the user can take a still image, or a video recording. In my viewDidLoad, I add an AVCaptureMovieFileOutput and an AVCaptureStillImageOutput to a single capture session.

The functionality works fine, but when you take a still image with AVCaptureStillImageOutput.captureStillImageAsynchronouslyFromConnection, the shutter sound is very slow and laggy (broken into two separate sounds it seems). I've tried removing the moviefileoutput, and it works fine without it. The thing is, the Apple developer docs for AVFoundation show that adding these two outputs to a single session is fine:(https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html)

I've tried adding the respective output only when the take photo/video button is clicked on, but it seems the exposure and focus don't have time to adjust, as the image comes out VERY dark, and the video has a second or so in the beginning where you see the camera adjusting.

I've tried doing captureSession.addOutputWithoutConnections, but have struggled to then add the connection when the record button is pressed.

I was wondering if anyone had any solutions? Again, it's really just the sound that is an issue, not the functionality. I've seen this post regarding turning the sound off: AVFoundation, how to turn off the shutter sound when captureStillImageAsynchronouslyFromConnection?

Upvotes: 1

Views: 342

Answers (0)

Related Questions