360 video in Vision Pro

Hi there, We have 2D Video playback in the Vision Pro environment. Our requirement is to play a 360 video throughout the environment where we can see a 360 video in oculus. Is there any possibility to do so with the current Vision OS SDK?

I have exactly the same question.

We actually produce 12K - 16K high resolution material with 10-12bit color space of Art and Architecture.

We was wondering which resolution the Vision Pro can play video.

Does Vision Pro have hardware decoders like M1 M2 for ProRes on board?

Hello, It is very easy to represent a 360° Video in the Vision Pro environment.

  1. You have to create videoPlayer
  2. create a very big sphere I recommend a sphere with the size 1E3 (1* 10^3)
  3. assign a VideoMaterial to this entity
  4. adjust the properties of the entity for your needs and add some videoPlayer controls to your video if it is you want.

Here is a simple approach and a little code snippet:



            //Create Entity for the video
            let videoEntity = Entity()

            //Search for video in paths
            guard let url = Bundle.main.url(forResource: "example", withExtension: "mp4") else {fatalError("Video was not found!")}
            
            //create a simple AVPlayer
            let asset = AVURLAsset(url: url)
            let playerItem = AVPlayerItem(asset: asset)
            let player = AVPlayer()

            //create a videoMaterial
            let material = VideoMaterial(avPlayer: player)

            //Made a Sphere with the videoEntity and asign the videoMaterial to it
            videoEntity.components.set(ModelComponent(mesh: .generateSphere(radius: 1E3), materials: [material]))

            //adjust the properties of the videoEntity(Sphere) if needed
            videoEntity.scale = .init(x: 1, y: 1, z: -1)
            videoEntity.transform.translation += SIMD3<Float>(0.0, 10.0, 0.0)

            let angle = Angle.degrees(90)
            let rotation = simd_quatf(angle: Float(angle.radians), axis: .init(x: 0, y: 0, z: 0))

            videoEntity.transform.rotation = rotation

            //add VideoEntity to realityView
            content.add(videoEntity)
            
            //start the VideoPlayer
            player.replaceCurrentItem(with: playerItem)
            player.play()

        }

I would recommend actually to use a video which was actually designed for 360° view :) I hope I could help you :)

@PatrickDevX, I tired your solution and it works amazing for videos saved in project directory, but when I try to play video via URL, I can hear sound of video but view is black. Can you please tell me any workaround for this? I am creating asset via AVURLAsset

    let asset = AVURLAsset(url: URL(string: "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4")!)
    let playerItem = AVPlayerItem(asset: asset)

What about stereoscopic 360 video..?

Hello, it's possible to play streamed (via RTMP) 360 video on VisionOS?? it can work directly on the TV app?

Has anybody been able to get video material to work with a USDZ file? I've tried everything. I can't even find a single example of that working anywhere in Vision OS. There's some examples and mentions of it in RealityKit, but that's more in AR Foundation. Every time I try it, it just doesn't work. It just cannot attach to the USDZ. Let me know if anybody can do it.

I was actually able to view Monoscopic 360 Videos perfectly using the code provided by @PatrickDevX -- very thankful for that.

But I am still unable to play Stereoscopic Over-Under(Top-Bottom) 360 Videos.

Maybe @PatrickDevX can provide better insight on this as he has a beautiful article on this as well, which would be very helpful

360 video in Vision Pro
 
 
Q