Skip to content

pyvirtualcam not recognizing UnityCapture #128

@nothiin

Description

@nothiin
  • Operating system: Windows 11
  • Python version: 3.11.5
  • pyvirtualcam version: 0.12.0
  • Virtual camera (OBS, v4l2loopback, UnityCapture): UnityCapture
  • Virtual camera version: commit: 3ed54c3

Describe the bug
pyvirtualcam not recognizing UnityCapture

To Reproduce
cloned unitycapture repo, ran install.bat as admin , restarted PC, ran a test code and face this error -

import colorsys
import numpy as np
import pyvirtualcam


with pyvirtualcam.Camera(width=1280, height=720, fps=20, backend="unitycapture") as cam:
    print(f"Using virtual camera: {cam.device}")
    frame = np.zeros((cam.height, cam.width, 3), np.uint8)  # RGB
    while True:
        h, s, v = (cam.frames_sent % 100) / 100, 1.0, 1.0
        r, g, b = colorsys.hsv_to_rgb(h, s, v)
        frame[:] = (r * 255, g * 255, b * 255)
        cam.send(frame)
        cam.sleep_until_next_frame()
Traceback (most recent call last):
  File "c:\Users\Nothing\Downloads\All VS code projects\Test Projects\testwebcam.py", line 6, in <module>
    with pyvirtualcam.Camera(width=1280, height=720, fps=20, backend="unitycapture") as cam:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Nothing\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyvirtualcam\camera.py", line 219, in __init__
    raise RuntimeError('\n'.join(errors))
RuntimeError: 'unitycapture' backend: No camera registered. Did you install any camera?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions