WebCamTexture Camera error on Android phone

Hi guys,

I’ve wanted to play around with using my android camera with a unity application. The code is pretty straight forward and from pretty much every webcam/phone camera tutorial.

I got a Plane in my scene which has a script with those lines:

WebCamTexture webcamTexture = new WebCamTexture();
this.GetComponent<Renderer>().material.mainTexture = webcamTexture;
webcamTexture.Play();

This works fine in the Unity Editor, which displays my webcam.

If I transport it on my android phone (OnePlus 7T, Android 10) and start the App, the first (?) frame is rendered on that plane but nothing afterwards.
In logcat I got the following error:

2020.10.20 13:30:17.153 18556 18815 Error CameraCaptureSession android.hardware.camera2.CameraAccessException: CAMERA_ERROR (3): cancelRequest:486: Camera 0: Error clearing streaming request: Function not implemented (-38)

A better insight onto it is attached.

Since this is pretty much basic code, I don’t really understand why that is not working, when this code is literally used in tons of tutorial videos.

As always, thanks for your help!

1 Like

Update:
I’m using MRTK so the Camera itself already renders the background. I wanted to just take a photo of the background (or more like what the camera image would be). By checking some basic android guide they always used this WebCamTexture, but I got the feeling that I cant render the image that is already displayed to another WebCamTexture because maybe the Stream cant be accesed 2 times? Could that be the problem?
Is there anyway other way to take a picture while the MRTK camera is on?

1 Like

Hello, I also have this issue. Is there any update to solve this prob?