tshino/softcam

Suggestion: support multiple virtual cameras with different parameters

Queequeg92 opened this issue · 2 comments

Hi tshino,
Thanks for your great work!
If softcam supports multiple virtual cameras with different parameters, it would be very flexible for the users.
Please consider my suggestion.
Thank you!

tshino commented

Thanks for your interest!

Actually, I was thinking about such functionality.
Unfortunately, it seems that there is no way in Windows for apps to create multiple (unlimited number of) virtual cameras using regular APIs. This applies to this library too, which means it is impossible for a library to provide an API to create multiple webcams freely.

I have investigated OBS Studio in the past. It provides multiple virtual cameras as a built-in feature. I wondered how it works. I found that 10 (or so) cameras have been created on the system during the installation of OBS Studio itself. The number of cameras installed cannot be changed after the installation.

Based on the observation, it seems possible for us to take the same way as follows:

When a user wants to use multiple webcams using softcam, in the installation process of softcam.dll, 10 or an arbitrary number of virtual cameras are registered to the system. Each one has a different name such as Softcam 1, Softcam 2, ... Softcam 10. Then softcam provides API to specify which camera to attach for the newly opening upstream.

I think this would be totally possible. It can be done by copy-pasting the relevant codes like the filter name and GUIDs in the library.

Hello @tshino, i found your repo and i need this functionality too) This functionality exists in https://github.com/schellingb/UnityCapture (abandoned repo) and it works with software that can access builtin camera.