How can I livestream mv-hevc from an iPhone 15 pro

Asked on 07/31/2024

1 search

To livestream MV-HEVC from an iPhone 15 Pro, you can leverage the new spatial video recording capabilities introduced in the "Build compelling spatial photo and video experiences" session at WWDC 2024. Here are the steps to get started:

  1. Set Up AV Capture Session:

    • Create an AVCaptureSession.
    • Add an input from the built-in dual wide camera, which includes both the wide and ultra-wide cameras.
    • Add a movie file output to manage the output and write it to disk.
  2. Enable Spatial Video Recording:

    • Change the AVCaptureDevice to use the built-in dual wide camera.
    • Pick a video format that supports spatial video by iterating through the formats in the video device and checking if isSpatialVideoCaptureSupported is true.
    • Enable spatial video recording on the output by setting isSpatialVideoCaptureEnabled to true.
  3. Video Stabilization and Preview:

    • Set the preferred video stabilization mode to cinematicExtendedEnhanced for smoother videos.
    • Use the AVCaptureVideoPreviewLayer API to get a video preview feed.

For more detailed code examples and explanations, you can refer to the session Build compelling spatial photo and video experiences (04:13).

Relevant Sessions

  1. Build compelling spatial photo and video experiences
  2. Capture HDR content with ScreenCaptureKit

If you need more specific details or code snippets, please let me know!