AVFoundation:使用AVCaptureMovieFileOutput和AVCaptureStillImageOutput捕获会话具有滞后的快门声音

时间:2016-08-26 23:54:38

标签: avfoundation avcapturesession avcapturemoviefileoutput shutter

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

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

我已尝试仅在点击拍摄照片/视频按钮时添加相应的输出,但似乎曝光和焦点没有时间进行调整,因为图像非常暗,并且视频在开头有一秒左右,您可以看到相机调整。

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

我想知道是否有人有任何解决方案?同样,它只是一个问题的声音,而不是功能。我已经看过关于关闭声音的帖子:AVFoundation, how to turn off the shutter sound when captureStillImageAsynchronouslyFromConnection?

0 个答案:

没有答案