Hello, We are developing to shoot 48MP Apple Pro Raw feature in my app, but we couldn't find any documentation on shooting 48MP Apple Pro Raw. Is it possible to shoot 48MP Apple ProRaw with a third-party app? Any help is much appreciated. Thanks.
Hello,
Is it possible to shoot 48MP Apple ProRaw with a third-party app?
Yes!
Your capture configuration needs to meet a few requirements to do so:
- The AVCaptureDevice's activeFormat needs to be set to a format that contains a 48 MP resolution in its supportedMaxPhotoDimensions array. (you can loop over the supported formats of the device to find such a format, or you can just use the .photo preset for your capture session's sessionPreset.)
Note that the only AVCaptureDevice that has a format that supports a 48 MP resolution is the builtInWideAngleCamera of iPhone 14 Pro and iPhone 14 Pro Max.
- Your capture session needs to have an AVCapturePhotoOutput, and it needs to be configured as follows:
photoOutput.isAppleProRAWEnabled = true
photoOutput.maxPhotoDimensions = .init(width: 8064, height: 6048)
- Finally, when you go to capture the photo, you need configure the AVCapturePhotoSettings, specifying an Apple ProRAW pixel format, as well as the 48 MP dimensions:
let query = photoOutput.isAppleProRAWEnabled ?
{ AVCapturePhotoOutput.isAppleProRAWPixelFormat($0) } :
{ AVCapturePhotoOutput.isBayerRAWPixelFormat($0) }
// Retrieve the RAW format, favoring Apple ProRAW when it's in an enabled state.
guard let rawFormat =
photoOutput.availableRawPhotoPixelFormatTypes.first(where: query) else {
fatalError("No RAW format found.")
}
let photoSettings = AVCapturePhotoSettings(rawPixelFormatType: rawFormat)
photoSettings.maxPhotoDimensions = .init(width: 8064, height: 6048)
photoOutput.capturePhoto(with: photoSettings, delegate: self)
With all of this, you should receive 48 MP Apple ProRAW photos in photoOutput(_:didFinishProcessingPhoto:error:)
Please let me know if these steps are not working for you!