Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Real-Time Video Capture with Unity 5

natewincknatewinck Posts: 2

I'm attempting to record video live in-app similar to the way Tilt Brush works. In fact, Google published an article on how they were able to accomplish recording video with Unity on the Vive: https://medium.com/google-developers/real-time-image-capture-in-unity-458de1364a4c#.iq1ccomw9.

Unfortunately, the way they were able to make it work without having ~20ms refresh rates was by hacking the SteamVR render loop. The Oculus SDK doesn't allow for that as far as I know, so I tried every single event in Unity (https://docs.unity3d.com/Manual/ExecutionOrder.html) to try placing ReadPixels and GetPixels in places where the GPU wouldn't be used. None of them made the refresh rate go below the needed 10ms (or 0.5ms like what Google accomplished), though some events were clearly worse than others.

Does anybody have any ideas or solutions for how to record video in-app in real time using Unity as the game engine?



  • vrdavebvrdaveb Posts: 1,596 Oculus Staff
    You should be able to capture video with Ansel, AVPro, or FRAPS. All of these should work the same, whether or not your project uses VR.
  • natewincknatewinck Posts: 2
    I tried AVPro, but it limits the HMD frame rate to the rate at which you want to capture. That's not great when you're trying to hit 90fps. I tried modifying their code to use Coroutines but the result led to an unstable frame rate, and it caused a severe jump when starting/stopping recording (usually a 30ms+ hit).

    I'll have to look into Ansel, though that is only for NVIDIA graphics cards I believe. Do you know if there's a corollary for AMD GPUs?

    FRAPS is a program that runs as a separate app, correct? I'm needing something that runs in-app like AVPro and Ansel.

    Thanks vrdaveb!
Sign In or Register to comment.