Native Android Mixed Reality Capture

This guide describes how to add and configure mixed reality capture support for your native Android application. Native mixed reality capture is supported for Oculus Quest only.

The OVRMRCLib library is available for download on the OVRMRCLib download page.

Oculus provides OVRMRCLib to our native development packages that can be used to load a camera configuration file and encode / stream MRC output over Wi-Fi to OBS. Details about these processes can be found in Mixed Reality Capture Tool.


To add OVRMrcLib to your native Android project:

  1. Include Shim/OVR_Mrc_Shim.h and Shim/OVR_Mrc_Shim.cpp in your project
  2. Call ovrm_LoadSharedLibrary(nullptr) to initiate the service
  3. Call ovrm_GetAPIs().Func() to access low-level functions
  4. Call ovrm_UnloadSharedLibrary() to terminate the service

Initialize MRC Service

To initialize the service:

  1. Initialize the Oculus Mobile SDK
  2. Call ovrm_Initialize()
  3. Configure your graphics API
  4. ovrm_ConfigureGLES() // if GLES
  5. ovrm_ConfigureVulkan() and ovrm_SetAvailableQueueIndexVulkan() // if Vulkan
  6. Call ovrm_SetMrcActivationMode()
  7. Call ovrm_SetMrcInputVideoBufferType() and ovrm_SetMrcAudioSampleRate()

In Loop / Capture

To run the service in your game loop:

  1. Call ovrm_Update()
  2. Call ovrm_GetMrcActivationMode()
  3. If MRC mode is activated:
  4. Call ovrm_GetExternalCameraCount(), ovrm_GetExternalCameraIntrinsics(), and ovrm_GetExternalCameraExtrinsics()
  5. Construct or update your virtual camera(s)
  6. Render to your virtual camera(s). You may interleave the foreground and background images for performance.
  7. Then, every other frame: 1. Call ovrm_SyncMrcFrame() with the syncId from the last ovrm_EncodeXXX() 2. Call ovrm_EncodeMrcFrame() or ovrm_EncodeMrcFrameWithDualTextures() to submit the RenderTexture handle of the virtual camera.

Terminate the Service

To terminate the service:

  1. Call ovrm_Shutdown()

OVRMRCLib Reference

The OVRMRCLib download contains a local web-based reference you can use for additional information on each API. To open, navigate to OVRMRCLib / Doc / html and open index.html in any browser.