Search Unity

Question Streaming Video stuttering in Quest 2 but not in Oculus native browser

Discussion in 'VR' started by Pool_Programmer, Jan 25, 2023.

  1. Pool_Programmer

    Pool_Programmer

    Joined:
    Jun 20, 2017
    Posts:
    8
    Hey guys! Hoping to get some clarity here. I'm trying to play a 180 VR Video in my Quest 2. I'm loading it in through the VideoPlayer.url variable. Strangely, it seems to buffer every 5 seconds or so, which is pretty disorienting. In fact during that time it seems the whole Unity player comes to a halt. In a separate test, I am able to play back these videos in VR in a browser using BabylonJS and these same videos play back just fine without any buffering or halting.

    What's the deal with the difference in performance? Is there a setting in Unity I'm missing or some sort of manifest variable I need to set? As an additional note, I've tried using the trial version of the AVPro plugin to see if that could fix things but so far I'm experiencing the same issues.

    Thanks!

    -Steven
     
    Last edited: Jan 26, 2023
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
    With all performance issues: run the profiler in the android build!
    Then check why it hangs
     
  3. Pool_Programmer

    Pool_Programmer

    Joined:
    Jun 20, 2017
    Posts:
    8
    Thank you for the great idea! I connected the profiler but I didn't see anything that stuck out that would cause this. Also, when testing without AVPro and going back to the regular VideoPlayer, I saw that the stuttering went away!

    I have found now that when I build the app for release, it stutters, and when I build as a "Development Build", it does NOT stutter (regardless of whether the profiler is attached). What could be going on that this one checkbox would make such a huge difference?
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
    Hmm that's weird, and impossible to profile if it works in a dev build...
    Maybe make a bug report?
     
  5. Pool_Programmer

    Pool_Programmer

    Joined:
    Jun 20, 2017
    Posts:
    8
    Sorry, just wanted to add some additional info...

    When building for Release, what's really happening is that the entire app is hanging. I look around when the video pauses and I see the blackness around my rendered view that should normally be in front of me at all times.

    When I build for Development Build, the app no longer hangs. I've been testing with 4k videos, but I tested an 8k video just for kicks, and that one seems to buffer quite a bit, but when it pauses from buffering the app doesn't hang. When I look around I still see the video and I never see the blackness outside the rendered view.

    The only difference between the hanging and not hanging is that one checkbox.

    Yeah, suppose I should file a bug report. This is wild.
     
  6. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
    How do you load and play the file?
     
  7. Pool_Programmer

    Pool_Programmer

    Joined:
    Jun 20, 2017
    Posts:
    8
    I'm loading completely through the url variable on the VideoPlayer. I just fill it with the address of where the video I want to stream is and then call VideoPlayer.Play().