freemocap / skellycam

The camera back-end for the `freemocap` project - or - An easy and efficient way to connect to one or more cameras and record synchronized videos💀📸
GNU Affero General Public License v3.0
19 stars 6 forks source link

Detect Virtual Cameras using CAP_DSHOW #25

Closed mprib closed 1 year ago

mprib commented 1 year ago

This revised code uses the behavior of a virtual camera capture object connected via CAP_DSHOW to identify it and remove it from the list of legitimate cameras.

In testing on my setup, a CAP_DSHOW virtual camera can be set to any resolution, so this Pull Request flags virtual cameras as those that will accept a resolution change to 599x599.

This is distinct from the behavior of a CAP_ANY virtual camera that can only be set to one resolution.

While the CAP_ANY backend allows quick determination of possible resolutions the CAP_DSHOW backend is more time intensive (~ 1 second per tested resolution). I have removed the resolution verification code from this PR for simplicity's sake.

The CAP_ANY behavior may be useful for performing camera/resolution validation on MacOS and linux, but I'm not currently set up to test this implementation so leave for a future time.


Tested on: Windows 10

Webcams tested: Logitech Webcam C930e, Logitech C310 HD WebCam, HD Webcam eMeet C960, Razer Kiyo Pro

Virtual Camera: OBS