我的应用程序中有一个摄像头视图,用户可以在其中拍摄静止图像或录像 . 在我的viewDidLoad中,我将AVCaptureMovieFileOutput和AVCaptureStillImageOutput添加到单个捕获会话中 .

功能正常,但是当您使用AVCaptureStillImageOutput.captureStillImageAsynchronouslyFromConnection拍摄静止图像时,快门声音非常慢且滞后(分成两个单独的声音) . 我已经尝试删除了moviefileoutput,没有它就可以正常工作 . 问题是,AVFoundation的Apple开发人员文档显示将这两个输出添加到单个会话中就可以了:( https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html

我已尝试仅在单击拍摄照片/视频按钮时添加相应的输出,但似乎曝光和焦点没有时间进行调整,因为图像非常暗,并且视频有第二个或所以在开始你看到相机调整 .

我已经尝试过captureSession.addOutputWithoutConnections,但是在按下记录按钮时却很难添加连接 .

我想知道是否有人有任何解决方案?再次,'s really just the sound that is an issue, not the functionality. I'看到这篇关于关闭声音的帖子:AVFoundation, how to turn off the shutter sound when captureStillImageAsynchronouslyFromConnection?