Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

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

Discussion in '2022.1 Beta' started by UDN_e7666fec-2cb5-4cfe-a678-e5e5ba6ec4ce, Feb 26, 2022.

  1. UDN_e7666fec-2cb5-4cfe-a678-e5e5ba6ec4ce

    UDN_e7666fec-2cb5-4cfe-a678-e5e5ba6ec4ce

    Joined:
    Jul 21, 2017
    Posts:
    8
    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

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5.  
    6. public class WebCamManager : MonoBehaviour
    7. {
    8.     // Use this for initialization
    9.     void Start () {
    10.         GetWebCam();
    11.     }
    12.  
    13.     void GetWebCam(){
    14.         WebCamTexture webcamTexture = new WebCamTexture ();
    15.  
    16.         #if (Unity_IOS || UNITY_ANDROID) && !UNITY_EDITOR
    17.  
    18.         for (int i = 0; i < WebCamTexture.devices.Length; i++) {
    19.             if (!WebCamTexture.devices [i].isFrontFacing) {
    20.                 webcamTexture.deviceName = WebCamTexture.devices [i].name;
    21.                 break;
    22.             }
    23.         }
    24.         #endif
    25.         #if UNITY_EDITOR
    26.         for (int i = 0; i < WebCamTexture.devices.Length; i++) {
    27.             Debug.Log(WebCamTexture.devices[i].name);
    28.             if(WebCamTexture.devices[i].name != null){
    29.                  webcamTexture.deviceName = WebCamTexture.devices[i].name;
    30.             }
    31.         }
    32.         #endif
    33.  
    34.         Renderer _renderer = this.GetComponent<Renderer>();
    35.         _renderer.material.mainTexture = webcamTexture;
    36.         webcamTexture.Play();
    37.     }
    38. }

    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 .
     

    Attached Files:

  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    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.
     
  3. UDN_e7666fec-2cb5-4cfe-a678-e5e5ba6ec4ce

    UDN_e7666fec-2cb5-4cfe-a678-e5e5ba6ec4ce

    Joined:
    Jul 21, 2017
    Posts:
    8
    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
     
  4. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
  5. UDN_e7666fec-2cb5-4cfe-a678-e5e5ba6ec4ce

    UDN_e7666fec-2cb5-4cfe-a678-e5e5ba6ec4ce

    Joined:
    Jul 21, 2017
    Posts:
    8
  6. 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
     
  7. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    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.