M1 iPad Pro with iPadOS 16 Beta 3
Xcode 14.0 beta 3
In a freshly created Xcode 14 beta 2 app using the Augmented Reality App template with Content Technology set to Metal, ARWorldTrackingConfiguration.recommendedVideoFormatForHighResolutionFrameCapturing returns a 60 fps, 1920 x 1440 video format.
So, session.captureHighResolutionFrame fails to deliver a high res frame.
Hi, be careful not to confuse two different APIs, although both of them are supported on the iPad Pro with M1 chip:
recommendedVideoFormatFor4KResolution
returns a video format that delivers frames with 4K resolution at a continuous rate of 30 Hz.recommendedVideoFormatForHighResolutionFrameCapturing
returns a video format for high-resolution background image capture. It is expected that regular frames have a lower resolution, such as 1920 x 1440 pixels at 60 Hz, as you correctly observed. However,session.captureHighResolutionFrame
should return a 12 megapixel frame. You can verify the resolution of the captured high-resolution frame with the below code snippet.
session.captureHighResolutionFrame { frame, error in
guard let frame = frame else {
print(error)
}
let width = CVPixelBufferGetWidth(frame.capturedImage)
let height = CVPixelBufferGetHeight(frame.capturedImage)
print("Received frame with dimensions: \(width) x \(height)")
}