Quest(android) external camera webcamTexture and device
Hi,
I'm trying to use an external Intel RealSense D435i camera connected to my Oculus Quest (android), but the quad gameobject is not displaying the webcamtexture when running stand-alone with the camera connected in the quest USB port. I have already received help from Intel, and the camera is requesting permission, as well as making a request for photos and video. However, when I load the .apk on the Quest, the quad gameobject is showing the blank hourglass. Because I have very little experience with android, I don't know how to log/debug any errors that occur when my Quest isn't connected to the computer. Anyone know how WebCamTextureToMatHelper.cs is supposed to find the camera device on the quest/android? The code seems to imply that it's built in. When I build the .apk I have the camera's device name entered into requestedDeviceName, and it seems to work when connected to just my PC.

Any ideas on how to solve this issue?
EDIT: I have also tried a build with the device name empty but quad also does not display the camera feed this way.
Here is how the script locates the device and assigns the webcamTexture:
` // Creates the camera var devices = WebCamTexture.devices; if (!String.IsNullOrEmpty(requestedDeviceName)) { int requestedDeviceIndex = -1; if (Int32.TryParse(requestedDeviceName, out requestedDeviceIndex)) { if (requestedDeviceIndex >= 0 && requestedDeviceIndex < devices.Length) { webCamDevice = devices[requestedDeviceIndex];
if (avoidAndroidFrontCameraLowLightIssue && webCamDevice.isFrontFacing == true)
requestedFPS = 15f;
if (requestedFPS < 0)
{
webCamTexture = new WebCamTexture(webCamDevice.name, requestedWidth, requestedHeight);
}
else
{
webCamTexture = new WebCamTexture(webCamDevice.name, requestedWidth, requestedHeight, (int)requestedFPS);
}
}
}
else
{
for (int cameraIndex = 0; cameraIndex < devices.Length; cameraIndex++)
{
if (devices[cameraIndex].name == requestedDeviceName)
{
webCamDevice = devices[cameraIndex];
if (avoidAndroidFrontCameraLowLightIssue && webCamDevice.isFrontFacing == true)
requestedFPS = 15f;
if (requestedFPS < 0)
{
webCamTexture = new WebCamTexture(webCamDevice.name, requestedWidth, requestedHeight);
}
else
{
webCamTexture = new WebCamTexture(webCamDevice.name, requestedWidth, requestedHeight, (int)requestedFPS);
}
break;
}
}
}
if (webCamTexture == null)
Debug.Log("Cannot find camera device " + requestedDeviceName + ".");
}
if (webCamTexture == null)
{
// Checks how many and which cameras are available on the device
for (int cameraIndex = 0; cameraIndex < devices.Length; cameraIndex++)
{
#if UNITY_2018_3_OR_NEWER if (devices[cameraIndex].kind != WebCamKind.ColorAndDepth && devices[cameraIndex].isFrontFacing == requestedIsFrontFacing) #else if (devices[cameraIndex].isFrontFacing == requestedIsFrontFacing) #endif { webCamDevice = devices[cameraIndex];
if (avoidAndroidFrontCameraLowLightIssue && webCamDevice.isFrontFacing == true)
requestedFPS = 15f;
if (requestedFPS < 0)
{
webCamTexture = new WebCamTexture(webCamDevice.name, requestedWidth, requestedHeight);
}
else
{
webCamTexture = new WebCamTexture(webCamDevice.name, requestedWidth, requestedHeight, (int)requestedFPS);
}
break;
}
}
}
if (webCamTexture == null)
{
if (devices.Length > 0)
{
webCamDevice = devices[1];
if (avoidAndroidFrontCameraLowLightIssue && webCamDevice.isFrontFacing == true)
requestedFPS = 15f;
if (requestedFPS < 0)
{
webCamTexture = new WebCamTexture(webCamDevice.name, requestedWidth, requestedHeight);
}
else
{
webCamTexture = new WebCamTexture(webCamDevice.name, requestedWidth, requestedHeight, (int)requestedFPS);
}
}
else
{
isInitWaiting = false;
initCoroutine = null;
if (onErrorOccurred != null)
onErrorOccurred.Invoke(ErrorCode.CAMERA_DEVICE_NOT_EXIST);
yield break;
}
}`
I may be wrong about this as I have limited knowledge about what you want to achieve, but in general, I don't think it is possible to get video from a UVC device (USB web camera) connected to an Android device in the Unity app Android platform. WebCamTextureToMatHelper.cs will only work with cameras that Unity's WebCamTexture API can find.
After some research, I found the following project. I have not tried it. https://github.com/saki4510t/UVC4UnityAndroid