Video Player Memory Usage

I’m working on a VR app for all Oculus platforms where a primary component is downloading and/or streaming 360 videos for playback. I’ve been having some problems with the built-in Unity VideoPlayer, specifically in the Android builds due to memory constraints.

I’ve done all of the legwork to profile the app extensively, and reduce repeat memory allocations as much as possible (all of our code generates 0B after scene setup, for reference). When profiling the video playback scene for a 6K video, memory usage actually goes down because we’re unloading some skybox and UI-related textures among other things.

The first thing I notice is that VideoPlayer memory usage isn’t profiled properly. Monitoring available memory on any device (Desktop or Android) will show that the app memory usage balloons as playback starts and the Unity profiler doesn’t catch it. The obvious culprit is the videos. Rather than load clips, I’m simply providing a URL to stream the video from the server or the downloaded file’s location. Still, memory is allocated for the size of the file (and, oddly, 2x that momentarily just before playback starts on 6K videos). Obviously, with a reasonable length of 6K video, this has a high likelihood of getting the app killed by the Go’s OS as I skirt memory limitations, particularly on devices without enough free storage to cache some of the required memory.

Now, for my actual question since the VideoPlayer is likely working as intended: does anyone know a pre-packaged way to stream videos from disk (and an online source, preferably) while keeping memory utilization low? For reference, these videos have been extensively tested in a variety of standalone 360 video player apps on all pertinent hardware and have no problems there, so there’s definitely SOME way to do it, though perhaps not from within the Unity engine.

@scottishrob13 did you ever find a method for streaming video from disk? I will be running up to this issue soon as well!

Also was the profiler issue ever resolved?