Recording User View While Unity App Accesses Camera

Give us as much detail as possible regarding the issue you’re experiencing:

6000.0.023f1:
1.12.0:
Android 10.0:
Windows:

I am working on an app for the magic leap 2 headset in Unity that utilizes the onboard camera for image capture. I would like to be able to record the user’s view for demonstration purposes however as you may know, doing so will cut the app’s access to the camera. It has been mentioned in some other threads that you can get around this limitation by separating the camera interfaces. There is very little information on how this is actually done however.
The thread I am referring to can be seen here:

The example script for using the ML camera containes the following lines:

//The identifier can either target the Main or CV cameras.
    private MLCamera.Identifier _identifier = MLCamera.Identifier.Main;

To access the CV cameras I swapped out the .Main identifier with .CV. However the issue persists, the app loses access to the camera when I start recording the user view.

Is there something else that must be done to the example camera scripts to get the desired behavior?

Thanks for any and all help.

What example camera script are you using? Are you using the one from the Magic Leap 2 Developer portal? Are you using any 3rd party assets? I recommend creating a scene and then using the basic camera example that is on the developer portal, then trying to record after the app starts.

I am using the photo capture script from this example post.

The script works fine for capturing images but when I begin recording it logs that it failed to access the camera.

You will need to edit the script on line 16 to change the camera identifier

If you look not so closely at my first post you will see that I already attempted this fix, and it did not work.

Can I please have a real solution from an actual developer.

Sorry, I might have misunderstood the issue.

Can you try using this camera capture script instead and verifying that the callback is made by adding a Debug.Log in the OnCaptureRawVideoFrameAvailable(...) function?