Best `AVMediaType` for depth data.

Dear Apple Developer Forum, I have a question regarding the AVCaptureDevice on iOS. We're trying to capture photos in the best quality possible along with depth data with the highest accuracy possible. We were delighted when we saw AVCaptureDevice could be initialized with the AVMediaType=.depthData which works as expected (depthData is a part of the AVCapturePhoto). When setting to AVMediaType=.video, we still receive depth data (of same quality according to our own internal tests). That confused us.

Mind you, we set the device format and depth format as well:

    private func getDeviceFormat() throws -> AVCaptureDevice.Format {
        
        // Ensures high video format and an appropriate color profile.
        let format = camera?.formats.first(where: {
            $0.isHighPhotoQualitySupported &&
            $0.supportedDepthDataFormats.count > 0 &&
            $0.formatDescription.mediaSubType.rawValue == kCVPixelFormatType_420YpCbCr8BiPlanarFullRange
        })
        
        // Check and see if it's available.
        guard format != nil else {
            throw CaptureDeviceError.necessaryFormatNotAvailable
        }
        
        return format!
    }
    
    private func getDepthDataFormat(for format: AVCaptureDevice.Format) throws -> AVCaptureDevice.Format {
        // Access the depth format.
        let depthDataFormat = format.supportedDepthDataFormats.first(where: {
            $0.formatDescription.mediaSubType.rawValue == kCVPixelFormatType_DepthFloat32
        })
        
        // Check if it exists
        guard depthDataFormat != nil else {
            throw CaptureDeviceError.necessaryFormatNotAvailable
        }
        
        // Returns it.
        return depthDataFormat!
    }

We're wondering, what steps we can take to ensure the best quality photo, along with the most accurate depth data? What properties are the most important, which have an effect, which don't? Are there any ways we can optimize our current configuration? We find it difficult as there's very limited guides and explanations on the media subtypes, for example kCVPixelFormatType_420YpCbCr8BiPlanarFullRange. Is it the best? Is it the best for our use case of high quality photo + most accurate depth data?

Important comment: Our App only runs on iPhone 14 Pro, iPhone 15 Pro, iPhone 16 Pro on the latest iOS versions.

We hope someone with greater knowledge at Apple can help us and guide us on how we can have the photos of best quality and depth data with most accuracy. Thank you very much! Kind regards.

Best `AVMediaType` for depth data.
 
 
Q