【发布时间】:2017-06-05 13:40:37
【问题描述】:
我正在开发相机应用程序。我将 AVCapturePhotoOutput 用于 ios 10.x 设备,将 AVCaptureStillImageOutput 用于 10.x 以下设备。
我在拍摄照片时使用以下拍摄设置
let settings = AVCapturePhotoSettings()
let previewPixelType = settings.availablePreviewPhotoPixelFormatTypes.first!
let previewFormat = [kCVPixelBufferPixelFormatTypeKey as String: previewPixelType,
kCVPixelBufferWidthKey as String: 1080,
kCVPixelBufferHeightKey as String: 1080,
]
settings.previewPhotoFormat = previewFormat
settings.isHighResolutionPhotoEnabled = true
settings.flashMode = .on
settings.isAutoStillImageStabilizationEnabled = true
self.captureOutputPhoto?.capturePhoto(with: settings, delegate: self)
当我尝试使用上述设置拍摄照片时
captureOutput:didFinishProcessingPhotoSampleBuffer:previewPhotoSampleBuffer:resolvedSettings:bracketSettings:error
上面的委托第一次抛出错误。我是 AVCapturePhotoSettings 的初学者。每次使用闪光灯模式成功拍摄照片后都会出现此问题。
【问题讨论】:
-
你能复制并粘贴你得到的错误信息吗?
-
我遇到了同样的错误。错误代码 -16005 错误描述:操作无法完成。当 flashmode 设置为 On 时,每次成功捕获图像后都会出现此错误
-
@Dhaval 你想用另一个类来用闪光灯捕捉图像吗?
-
我使用 AVCapturePhotoOutput for iOS 10.x 和 AVCaptureStillImageOutput。 AVCaptureStillImageOutput 适用于 10.x 以下的设备。 ios 10.x 设备中的 AVCapturePhotoOutput 出现问题。 AVCaptureStillImageOutput 现已弃用。
-
在预览层停止渲染后使用 Flash 捕获时出现以下错误 :: (Error Domain=AVFoundationErrorDomain Code=-11800 \"无法完成操作\" UserInfo={NSUnderlyingError=0x174652060 {Error Domain=NSOSStatusErrorDomain Code=-16800 \"(null)\"}, NSLocalizedFailureReason=发生未知错误 (-16800), NSLocalizedDescription=操作无法完成})
标签: ios swift avcapturesession avcapturephotosettings