swift AVCapturePhotoOutput capturePhoto挂起预览

时间:2018-06-07 12:00:28

标签: ios swift ios-camera

以1080 x 1440显示预览;使用代码:

在iPhone 8 Plus上获得最高分辨率(3024 x 4032)和质量的照片
capturePhotoOutput?.capturePhoto(with: configurePhotoSettings(), delegate: self)

带照片设置:

private func configurePhotoSettings() -> AVCapturePhotoSettings {
    let photoSettings = AVCapturePhotoSettings()
    photoSettings.isHighResolutionPhotoEnabled = true
    photoSettings.isAutoStillImageStabilizationEnabled = (capturePhotoOutput?.isStillImageStabilizationSupported)!
    photoSettings.isAutoDualCameraFusionEnabled = (capturePhotoOutput?.isDualCameraFusionSupported)!

    return photoSettings
}

逐个进行(如顺序拍摄模式),即使我在didFinishProcessingPhoto中没有做任何事情,也会在短时间内每次预览冻结。

寻找能够顺利进行捕捉的解决方案,也许是在后台线程中,但目前我已经卡住了..

1 个答案:

答案 0 :(得分:0)

预览挂起的原因是称为光学稳定的功能。


您只需要关闭它即可在捕获照片时进行流畅的预览:

photoSettings.isAutoStillImageStabilizationEnabled = false
相关问题