Pink Screen with VideoMaterial in ARKit

Hi everyone,

I'm developing an ARKit app using RealityKit and encountering an issue where a video displayed on a 3D plane shows up as a pink screen instead of the actual video content.

Here's a simplified version of my setup:

func createVideoScreen(video: AVPlayerItem, canvasWidth: Float, canvasHeight: Float, aspectRatio: Float, fitsWidth: Bool = true) -> ModelEntity {
    let width = (fitsWidth) ? canvasWidth : canvasHeight * aspectRatio
    let height = (fitsWidth) ? canvasWidth * (1/aspectRatio) : canvasHeight
    let screenPlane = MeshResource.generatePlane(width: width, depth: height)

    let videoMaterial: Material = createVideoMaterial(videoItem: video)
    let videoScreenModel = ModelEntity(mesh: screenPlane, materials: [videoMaterial])
    return videoScreenModel
}

func createVideoMaterial(videoItem: AVPlayerItem) -> VideoMaterial {
    let player = AVPlayer(playerItem: videoItem)
    let videoMaterial = VideoMaterial(avPlayer: player)
    player.play()
    return videoMaterial
}

Despite following the standard process, the video plane renders pink. Has anyone encountered this before, or does anyone know what might be causing it?

Thanks in advance!

Answered by DTS Engineer in 834513022

Hello all,

Thanks for the continued feedback on this!

A couple of observations:

  1. I'm unable to reproduce the behavior described. Can someone provide a focused sample project that reproduces the issue?

  2. If you have not filed a bug report for this issue using Feedback Assistant, please do file one, and then post your Feedback ID on this thread so that I can track it.

--Greg

It finally works on iOS 18.5 on an iPhone 16e! Does it also work for you, @Dauben ?

Pink Screen with VideoMaterial in ARKit
 
 
Q