【问题标题】:swift AVCapturePhotoOutput capturePhoto hangs previewswift AVCapturePhotoOutput capturePhoto 挂起预览
【发布时间】:2018-06-07 12:00:28
【问题描述】:

以 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 中什么都不做,也会一个一个地进行(如连拍模式)并且每次预览都会冻结一小段时间。


寻找使捕获顺利的解决方案,可能在后台线程中,但目前我被卡住了..

【问题讨论】:

  • 你找到解决办法了吗?
  • @HuangJie 请看我在这个话题下面的回答
  • 知道了,谢谢你的回答。

标签: ios swift ios-camera


【解决方案1】:

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


您只需在拍摄照片时将其关闭即可流畅预览:

photoSettings.isAutoStillImageStabilizationEnabled = false

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-14
    • 2017-01-03
    • 2012-12-20
    • 2021-11-02
    相关资源
    最近更新 更多