AVCaptureMovieFileOutput DOES NOT support spatial video capture on iPhone 15 Pro of iOS 18.1?

Hi everyone, I am having trouble implementing spatial video recording into files by following the WWDC24 video: Build compelling spatial photo and video experiences. Specifically, the flag "isSpatialVideoCaptureSupported" of AVCaptureMovieFileOutput shows FALSE where the code is tested on both my physical iPhone 15 Pro (iOS 18.1) and the simulator (iOS 18.0).

This is the code that I am running:

let movieFileOutput = AVCaptureMovieFileOutput()
print("movieCapture output isSpatialVideoCaptureSupported: \(movieFileOutput.isSpatialVideoCaptureSupported)")

However, one of the formats of AVCaptureDevice shows a TRUE for the flag isSpatialVideoCaptureSupported.

for format in currentDevice.formats {
    if format.isSpatialVideoCaptureSupported {
           print("isSpatialVideoCaptureSupported is true")
           break
    }
}

I am totally confused now, why DOES the camera device support spatial mode while the movieFileCapture DOES NOT? Can someone please help? Really appreciate it!!

Here are my testing environment:

  • iPhone 15 Pro iOS 18.1 (US version)
  • Xcode 16.0 beta 16A5171c
Answered by brrruski in 801075022

Okay after debugging with carefulness, I found that the connection.preferredVideoStabilizationMode must be set to .cinematicExtendedEnhanced to enable isSpatialVideoCaptureSupported to be true. Apple's engineers should have mentioned the cascade relation here!!!

guard let connection = output.connection(with: .video) else { return }

guard connection.isVideoStabilizationSupported else { return }

// The key setting to enable `isSpatialVideoCaptureSupported`
connection.preferredVideoStabilizationMode = .cinematicExtendedEnhanced
Accepted Answer

Okay after debugging with carefulness, I found that the connection.preferredVideoStabilizationMode must be set to .cinematicExtendedEnhanced to enable isSpatialVideoCaptureSupported to be true. Apple's engineers should have mentioned the cascade relation here!!!

guard let connection = output.connection(with: .video) else { return }

guard connection.isVideoStabilizationSupported else { return }

// The key setting to enable `isSpatialVideoCaptureSupported`
connection.preferredVideoStabilizationMode = .cinematicExtendedEnhanced
AVCaptureMovieFileOutput DOES NOT support spatial video capture on iPhone 15 Pro of iOS 18.1?
 
 
Q