2022.1.0b10 obs-virtualcam not work with Unity-base application

that this is a problem that Unity can and should solve on their end. Software-only video sources, like the OBS Virtual Camera, do not use DevicePath. Relying on DevicePath seems to not be recommended,

OBS 27.2.1
Other software can be called, but Unity

using System.Collections;
using System.Collections.Generic;
using UnityEngine;


public class WebCamManager : MonoBehaviour
{
    // Use this for initialization 
    void Start () { 
        GetWebCam();
    }

    void GetWebCam(){
        WebCamTexture webcamTexture = new WebCamTexture (); 

        #if (Unity_IOS || UNITY_ANDROID) && !UNITY_EDITOR

        for (int i = 0; i < WebCamTexture.devices.Length; i++) { 
            if (!WebCamTexture.devices [i].isFrontFacing) { 
                webcamTexture.deviceName = WebCamTexture.devices [i].name; 
                break; 
            }
        }
        #endif
        #if UNITY_EDITOR
        for (int i = 0; i < WebCamTexture.devices.Length; i++) { 
            Debug.Log(WebCamTexture.devices[i].name);
            if(WebCamTexture.devices[i].name != null){
                 webcamTexture.deviceName = WebCamTexture.devices[i].name;
            }
        }
        #endif
 
        Renderer _renderer = this.GetComponent<Renderer>(); 
        _renderer.material.mainTexture = webcamTexture; 
        webcamTexture.Play(); 
    }
}

The old solution:
OBS 25
Release OBS-VirtualCam 1.2.1 · CatxFish/obs-virtual-cam (github.com)

  • Remove dummy device path to avoid conflict with Skype desktop

If you want to use obs-virtualcam with Unity-base application , please use reg_path.reg to manually add dummy device .

7928539--1012513--error.png

Hi,

Could you please submit a bug report for this issue? Please include information that explains what behavior you’re expecting, what actually happens, and what you did before it broke.

Operating System Info
Windows 10
OBS Studio Version
27.2.3
Expected Behavior
i want to use obs-virtualcam with Unity-base application ,
Software-only video sources, like the OBS Virtual Camera, do not use DevicePath
Current Behavior
ERROR - Could not find specified video device
Steps to Reproduce
1.OBS 27
2.use obs-virtualcam with Unity-base application ,
The code is in the first post

Please use the bug reporter: Unity QA: Building quality with passion

I submitted it. Why can’t I find it? Do I need to go to the mailbox to confirm that it will be displayed? My email is out of service

It doesn’t work like that. After you submit your bug report:

  • you will get an email that your report is received and there will be an URL to the fogbugz page where you can check on your report
  • someone at Unity will try to recreate your bug and will decide if it is really a bug, user error or behavior by design, you will get an email about this decision
  • if it’s deemed a bug, that someone will open an issue in the issuetracker (most of the time, there are some rare cases when they only track problems internally), which will appear on the issuetracker and becomes visible for the public
2 Likes

Could you please resubmit the report with a working email account and a note saying that the previous report should be dismissed? QA has to be able to communicate with you in case they have follow-up questions.