mrayy / UnityCam

Unity3D Virtual webcam plugin, streams unity viewport contents to other applications as virtual camera
MIT License
501 stars 150 forks source link

UnityCam doesn't show up as a webcam in Unity #2

Closed momo-the-monster closed 7 years ago

momo-the-monster commented 7 years ago

When running a scene / compile app using UnityCam, I can see its output in some programs like Skype, but not in others like OBS and most importantly, Unity itself! Is it using a different method than the kind Unity is looking for?

mrayy commented 7 years ago

About not being played in Unity, thats true and its also applied to some other softwares as you mentioned. I guess you are using WebCamTexture to load the device, however unity doesn't accept virtual webcameras as a video source. I am still investigating the reason, and any other help from the community would be highly appreciated.

momo-the-monster commented 7 years ago

The virtual camera from XSplit is supported.

mrayy commented 7 years ago

I have double checked the issue and found what was causing the issue, The filter was not added to the registry. I did a quick fix to the code in DllRegisterServer() so the issue got resolved. Unity now can detect the virtual camera using WebCamTexture:

foreach (var d in WebCamTexture.devices) Debug.Log (d.name); int index=0;// change to camera index appeared Debug window tex = new WebCamTexture (WebCamTexture.devices [index].name,1280,720); tex.Play ();

momo-the-monster commented 7 years ago

Oh, awesome! Thank you! Verified that it works over here. This is such a help with my current project.