以 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 中什么都不做,一张一张地执行此操作(如连续拍摄模式)和预览每次都会卡住一小段时间。
正在寻找使捕获顺畅的解决方案,也许在后台线程中,但目前我被卡住了..
最佳答案
预览挂起的原因是称为光学稳定的功能。
您只需在拍摄照片时将其关闭即可流畅预览:
photoSettings.isAutoStillImageStabilizationEnabled = false
关于ios - swift AVCapturePhotoOutput capturePhoto 挂起预览,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50740668/