I am working on a camera. I am using AVCapturePhotoOutput for an ios 10.x device and AVCaptureStillImageOutput for below 10.x devices.
I use below capture settings when capturing Photo
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)
when I try to capture a photo using the above setting
captureOutput:didFinishProcessingPhotoSampleBuffer:previewPhotoSampleBuffer:resolvedSettings:bracketSettings:error
above the delegate gives an error the first time. I am starting for AVCapturePhotoSettings. The problem occurs after each successful capture of photos in flash mode.
source share