how to generate spatial video file
Generated on 3/3/2025
1 search
To generate a spatial video file, you can follow the steps outlined in the session "Build compelling spatial photo and video experiences" from WWDC 2024. Here's a summary of the process:
-
Set Up AV Capture Session:
- Create an AV capture session.
- Add an AV capture device, setting it to the default system preferred camera.
- Add an input and an output to the session.
- Commit the configuration and start running the session.
-
Enable Spatial Video Recording:
- Change the AV capture device to use the built-in dual wide camera, as spatial video requires both the wide and ultra-wide cameras to stream simultaneously.
- Select a video format that supports spatial video by iterating through the formats in the video device and checking if
isSpatialVideoCaptureSupported
is true. - Set
isSpatialVideoCaptureEnabled
to true if spatial video capture is supported. Note that this feature is only available on the iPhone 15 Pro.
-
Handle Output:
- The movie file output will manage the output and write the spatial video file to disk. The complexity of synchronization, camera calibration, encoding, and metadata writing is abstracted away, providing a fully formed spatial video file.
-
Enhance Quality:
- For improved video stabilization, set the preferred video stabilization mode to cinematic extended enhanced.
For more detailed information, you can refer to the session Build compelling spatial photo and video experiences (04:33).

Optimize for the spatial web
Discover how to make the most of visionOS capabilities on the web. Explore recent updates like improvements to selection highlighting, and the ability to present spatial photos and panorama images in fullscreen. Learn to take advantage of existing web standards for dictation and text-to-speech with WebSpeech, spatial soundscapes with WebAudio, and immersive experiences with WebXR.

Build compelling spatial photo and video experiences
Learn how to adopt spatial photos and videos in your apps. Explore the different types of stereoscopic media and find out how to capture spatial videos in your iOS app on iPhone 15 Pro. Discover the various ways to detect and present spatial media, including the new QuickLook Preview Application API in visionOS. And take a deep dive into the metadata and stereo concepts that make a photo or video spatial.