letmaik / pyvirtualcam

🎥 Send frames to a virtual camera from Python
GNU General Public License v2.0
452 stars 49 forks source link

OBS Virtual Camera not detected on Windows #72

Closed dalgibbard closed 2 years ago

dalgibbard commented 2 years ago

Describe the bug With OBS Virtual camera started, pyvirtualcam is not finding the OBS Device. Running /samples/simple.py reports:

Traceback (most recent call last):
  File "obs_vcam_test.py", line 4, in <module>
    with pyvirtualcam.Camera(width=1280, height=720, fps=20) as cam:
  File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\pyvirtualcam\camera.py", line 219, in __init__
    raise RuntimeError('\n'.join(errors))
RuntimeError: 'obs' backend: virtual camera output could not be started
'unitycapture' backend: No camera registered. Did you install any camera?

Looking at: https://github.com/letmaik/pyvirtualcam/blob/master/pyvirtualcam/native_windows_obs/virtual_output.h#L38 I see it looks up a registry key which is present on my machine: image

Note; yes it's an old python version; but i'm working with some Tensorflow 1.x code at the moment which needs it :) I've tested this with python 3.9.2 also, and get the same issue.

To Reproduce Run samples/simple.py

dalgibbard commented 2 years ago

OK nvm; it's me! I was starting the Virtual Camera in OBS thinking it needed to be running before I could send data. If I run the code with the Virtual Camera "stopped" in OBS, it works just fine. Thanks!