MerlinVR / USharpVideo

A basic video player made for VRChat using Udon and UdonSharp
MIT License
322 stars 43 forks source link

Issue with AVPro causing excessive ram usage #20

Closed DoggoDivine449 closed 3 years ago

DoggoDivine449 commented 3 years ago

When using the AVPro backend for USharpVideo it appears as though a memory leak will occur when a video has ended and players enter the world. I tested this with a fresh version of the prefab added to a world (with up to date sdk and udon sharp). If I enter a world with a friend, watch to the end of a video and then rejoin the ram usage will shoot up. The reason I first noticed this was that I left and rejoined on a friend which eventually led to my pc crashing (it took maybe a minute for my pc to completely freeze). This was not the case with the Unity video player. If I were to switch to Unity player from AVPro after joining the ram usage would stop increasing.

I am unsure if this is a VRChat related issue but though it was worth mentioning. AVPro has benefits like the automatic aspect ratio scaling and retains the ability to seek through Dropbox links so hopefully it's fixable in any case.

MerlinVR commented 3 years ago

The only benefit of AVPro over the Unity player is that it supports streams and some more obscure video formats. The aspect ratio scaling is present in both players. Do not use it unless you actually need to.

I am unable to reproduce the issue with YouTube videos. This sounds like an AVPro issue which is part of why AVPro is not the default. Try reproducing the issue with the AVPro asset in the Unity editor https://github.com/RenderHeads/UnityPlugin-AVProVideo/releases and report it to AVPro if you can reproduce it there.