Oculus Quest Unity Video Player error: Cannot read file while preparing

Hello,

We are encountering an error message when trying to prepare a video on Oculus Quest 1. To be more specific: We want to seamlessly loop different videos and utilize two unity video players. One that actively plays and one that preprares the video and then waits until the first video player finishes playing. They then swap roles. While the second video player prepares, there is a bit of lag, but that is fine for now.

The problem is, that sometimes preparing the video fails. Attaching a callback to VideoPlayer.errorReceived gives the message “VideoPlayer cannot play clip: [path of the video] Cannot read file.” The error sometimes occurs at the first loop preparation attempt, sometimes the looping works fine several times in a row. The error only occurs on build versions. On a side note, on some of our Quests the error happens much more frequently than on others. We only build for the Quest 1 so we cannot say anything about other devices.

We figured that reducing the resolution and/or bit rate of the videos reduces the frequency of the error and reducing it to a certain point resolves the error completely, but we are displaying 5760x2880 resolution, 35mbits/s, 360 degree videos which suffer a lot from reduced resolution or a reduced bit rate. We optimally would find a solution to keep videos stats high while also not encountering the error at all.

We are seriously asking ourself where this is coming from, especially since it worked fine at some point, but we did a lot of changes since we last checked out our video feature throughoutly. We upgraded Unity to the 2021.3.0f1 LTS version, updated several packages, increased the amount of videos and possibly more. Sadly we cannot really go back to old versions that easily.

Here are some more information:

  • the videos in question are 40s to 60s long and use about 180mb to 250mb of space
  • the video condex is H264
  • looking at the ovr metrics tool on the quest, none of the devices stats seem to high (cpu usage, gpu usage, video memory)
  • the quest gets quite hot while playing the videos
  • after receiving the error once, the app retries to prepare the video but it still receives errors

Does anyone know a direction we could look into to find out why this error message appears? If someone has different approach to seamless video looping, I’d be interested as well.

Thank you

edit: While retrying to prepare the video after the error occured, this is what the log cat shows:

Other things we noticed was multiple lines of this message:
“c2dcolorconvert unknown format passed for luma alignment number”
“OMXNodeInstance: getParameter(0xf087f204:qcom.decoder.avc, ??(0x7f000044)) ERROR: UnsupportedSetting(0x80001019)”

Hi. I want to say that what you are doing is far outside the Android SDK specs. Officially, The biggest supported resolution is 1920x1080 with VP8 https://developer.android.com/guide/topics/media/media-formats. Although reading on the Occulus, you should be able to support higher resolution https://creator.oculus.com/blog/encoding-high-resolution-360-and-180-video-for-oculus-go/.

I am not saying we are not going to help you, but we will have to work together to see what would be the best solution to make it work. I need to check what error code -38 in the NDKMediaCodec means. Meanwhile, try this.

5120x2560 30fps H264 seems to be the recommended resolution while maintaining a reasonable quality. You said you tried lowering the resolution. Have you tried this resolution? Another thing you could try is using VP8 instead of H264. Android has better support and higher resolution for VP8 than any codecs but generally worse performance, so probably not an option in your case.

Can you confirm if it happens only when you have two players in the scene or if playing one video player normally causes the same issue?

I don’t find the doc, but I am confident the SDK may downgrade the capability if it becomes too hot. Maybe you can check if the error happens only when the device is already hot.

Hello The_Island,

we did try the recommended resolution and we had no luck on this either. It indeed only happens when we try to load the second video while the other one is still playing. Sadly we have only little to no information about the devices heat management, but we indeed assume that it is the combination of too much heat and the resulting reduced capability.

We ended up buying a third party video player which seems to resolve our problem. We can now just set the video on loop and it loops without problems, creates less heat and seems more stable.

I still thank you for you time. Your post confirmed our thoughts that the problem is a bit more hardware sided and that the unity player doesn’t quite perform what we need (as it is an all round solution compared to a specialized one).

Thank you

1 Like