- Home /
Problems with webcam
I have 2 webcams, both work on discord so I know they work. On one webcam, unity detects it, but I get "ERROR - Could not find specified video device", even if I set "deviceName" to it's name.
The other one, unity doesn't even detect.
The one that unity detects is a virtual web cam for obs, and the other one is a ps3 eye camera (i use cl eye driver)
I have windows 7, and am using latest unity version.
edit - i switched back to a 32bit version of unity and the ps3 eye camera is detected now, but it just shows black in unity. and the obs virtual camera gives the same error
my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CamTest : MonoBehaviour
{
static WebCamTexture webCam;
void Start()
{webCam = new WebCamTexture();
GetComponent<Renderer>().material.mainTexture=webCam;
webCam.Play();
Debug.Log(WebCamTexture.devices.Length);
for (int i=0; i<WebCamTexture.devices.Length; i++) {
Debug.Log(WebCamTexture.devices[i].name); }
}
}
The debug.logs give me a "1" for the length, looping through the array only returns "OBS-camera".
Could it be something to do with the webcams I'm using?
Answer by mellooow9 · May 02, 2020 at 11:19 PM
Okay I found why the ps3eye wasn't working. I needed a 32 bit version of unity for it to work.
Then it was still black in unity, but closing discord fixed it. I guess only one app can use the camera at once.
For the obs virtual camera, it still doesn't work. I read somewhere that it just won't work with unity, so maybe it's that.
Your answer
Follow this Question
Related Questions
Efficient way to Capture Webcam image stream? 0 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How to access a Webcam Moniker 0 Answers
Access to WebCam denied - UWP unity app,Access denied to WebCam in UWP project 1 Answer