Hi all,
I am experiencing a problem with front camera when app is running on device with iOS with 16.4 or later. My app is using the front camera and it captured photo with maximum resolution which I am setting by using AVCaptureSession.Preset.photo.
When I am capturing photos on device with iOS 16.3 and below, maximum resolution of captured photo is 3384x4512. But when the same code is run on device with iOS 16.4 and above - maximum resolution is way more below the 3384x4512 and it varies depending of the specific device (iPhone 12, iPhone 13 Pro, iPhone 14).
Below is the code used for configuring the session:
guard let device = AVCaptureDevice.default(AVCaptureDevice.DeviceType.builtInWideAngleCamera, for: .video, position: .front) else {
print("No front facing camera found")
return
}
session.beginConfiguration()
var frontInput: AVCaptureInput?
do {
frontInput = try AVCaptureDeviceInput(device: device)
} catch let error {
print("ERROR WITH FRONT CAMERA: \(error)")
}
if let inputFr = frontInput, session.canAddInput(inputFr) {
session.addInput(inputFr)
}
let output = AVCaptureVideoDataOutput()
output.alwaysDiscardsLateVideoFrames = true
let queue = DispatchQueue(label: "cameraQueue")
output.setSampleBufferDelegate(self, queue: queue)
output.videoSettings = [kCVPixelBufferPixelFormatTypeKey as String: Int(kCVPixelFormatType_32BGRA)]
session.addOutput(output)
session.sessionPreset = AVCaptureSession.Preset.photo
session.commitConfiguration()
Does anybody else experiencing problem with lower resolution on devices with iOS 16.4 and above?