Hi,
I’m trying to show “virtual camera” image on Unity.
The examples of virtual camera are OBS Virtual Camera, XSplit VCam, NVIDIA Broadcast, etc.
It is not cinemachine function.
First, I searched webcamera devices by WebCamTexture.devices, and played WebCamTexture object.
for (int i = 0; i < WebCamTexture.devices.Length; i++) {
var device = WebCamTexture.devices*;*
Debug.Log ("Device Found: {i}, {device.name}");*
*}*
*int DeviceID = 3;*
*string deviceName = WebCamTexture.devices[DeviceID].name;*
*Debug.Log (“Initializing Device: {DeviceID}, {deviceName}”);
var webcamTexture = new WebCamTexture (deviceName);
webcamTexture.Play ();
Debug.Log ($“Initialized Device: {DeviceID}, {deviceName}”);
As a result, the all virtual cameras and physical cameras were listed, but the WebCamTexture object occured below error on WebCamTexture.Play() only virtual cameras.
Device Found: 0, Logicool BRIO <= Physical web-camera
Device Found: 1, OBS-Camera
Device Found: 2, Camera (NVIDIA Broadcast)
Device Found: 3, OBS Virtual Camera <= Selected virtual camera
Initializing Device: 3, OBS Virtual Camera
ERROR - Could not find specified video device <=UnityEngine.WebCamTexture:Play()
Initialized Device: 3, OBS Virtual Camera
So I checked virtual camera images can be displayed on another software(ex: Microsoft Teams, Discord, etc) to check the virutal camera are valid.
Finally, the virtual camera images are displayable on these software, therefore I found the virtual camera’s and physical camera device are valid.
Does anyone have informations of this trouble and have another solution?
And this trouble is happend only me?
Environment
- Windows 10
- Unity 2020.1.10f.1
- OBS 26.0.2