Skip to main content

Addressing the AVPro Black Frames Issue

· 3 min read
ArchiTech Anon

UPDATE

AVPro has released 3.0.0 which has appeared to resolve the flickering frames issue as they said.
This post will be updated again once VRChat has upgraded to the new AVPro version.
Until then, the below information is still mostly relevant.

The Problem

For the past few months (maybe a bit more), there has been a rise of observations where people notice that video screens have intermittent frames that are just black. This generally happens in worlds where the framerate is unstable (either due to uncapped framerate dipping a lot (desktop) or the render resolution being too high for the world to handle (VR)).

The Investigation

The primary thread for trying to get to the bottom of the issue was: https://feedback.vrchat.com/open-beta/p/1370avpro-screens-black-frames
We originally thought that is was just a framerate stability problem. But as we looked more into it, we found someone else who reported another intermittent frame issue: https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/1637 (Title: Video Frames Occasionally Render Incorrectly Fully Transparent)

Turns out that this was the source issue and how video player shaders typically handled things was as an opaque texture. This means that when the AVPro video hit that random "invisible" frame, it would ignore the alpha and just draw the r/g/b values which were all 0, thus being a black frame.

The Proof

You can see the results of the investigation here:
Video: https://streamable.com/fqrcg7
World: https://vrchat.com/home/world/wrld_88f8dda9-2d0c-4506-af7c-954831897dad

In this proof, the Unlit/Transparent shader is used along with ProTV 2.3.15 for driving the video. We used 2.3 for the demonstration as that version uses AVPro as a direct draw and does not do any special handling with the material. Behind the material is a plain green quad to easily detect the invisible frames (see video).

This issue is very likely something that AVPro will have to fix internally and is not a VRChat or video player specific issue.

The Mitigations

There are a few options available to deal with this particular problem.

1) If you are a world creator, you can just upgrade your video player to ProTV 3. ProTV 3 uses a Blit operation internally which avoids the invisible frame problem entirely since it stores the previous frame.

2) You should try to reduce the instability of the framerate by either capping the framerate (or VSync) on desktop, or in VR you will need to reduce the render resolution and/or super-sampling.
framerate control

3) Another option is to add the startup parameter --disable-hw-video-decoding to your launch parameters. This is usually used to help mitigate video rendering issues with AMD GPUs, but in this case it affects pretty much all GPUs (YMMV).
launch parameter