schellingb / UnityCapture

Streams Unity rendered output to other Windows applications as virtual capture device

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use unique device path per registered camera

letmaik opened this issue · comments

RegSetValueExA(hKey, "DevicePath", 0, REG_SZ, (LPBYTE)"foo:bar", (DWORD)sizeof("foo:bar"));

Applications which use the device path to differentiate cameras stumble since every registered Unity Video Capture instance uses the same device id. OBS has no problems with it, but for example Zoom shows all cameras but only allows to select the first one. Skype only shows the first one.

Quoting from the Microsoft docs:

The "DevicePath" property is not a human-readable string, but is guaranteed to be unique for each video capture device on the system. You can use this property to distinguish between two or more instances of the same model of device.

To be honest though, I'm not sure if this hack is needed anymore. The virtual camera from OBS doesn't have a device path and works in all apps incl Skype. Maybe it got fixed at some point in Windows? The forum thread referenced in the code is 9 years old.

commented

Skype was indeed bugged/regressed when it started to require it, and it was fixed soon as you can read in the comments of the blog linked in the thread.
But unity still requires it.