Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Selecting Specific UnityCapture Devices in pyvirtualcam #121

Open
Mo18769 opened this issue Mar 18, 2024 · 4 comments
Open

Issue with Selecting Specific UnityCapture Devices in pyvirtualcam #121

Mo18769 opened this issue Mar 18, 2024 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@Mo18769
Copy link

Mo18769 commented Mar 18, 2024

Environment

Operating System: Windows 11
Python Version: 3.12.2
pyvirtualcam Version: Latest
Virtual Camera Used: UnityCapture
Virtual Camera Version: Latest

Describe the bug

I'm encountering a bug when using pyvirtualcam with multiple UnityCapture devices. Specifically, after installing 10 UnityCapture devices and attempting to select and use a device other than the first one through pyvirtualcam, none of the devices function as intended. Instead, all UnityCapture devices mirror the output designated only for the first device.

To Reproduce

  1. Install multiple UnityCapture devices (e.g., 10 devices).
  2. Attempt to use a specific device (other than the first one) using the following script:
frame = np.zeros((480, 640, 3), np.uint8)  
frame[:] = (255, 255, 0)  # yellow

with pyvirtualcam.Camera(width=640, height=480, fps=20, backend="unitycapture", device="Unity Video Capture #2") as cam:
    print(f'Using virtual camera: {cam.device}')
    while True:
        cam.send(frame)
        cam.sleep_until_next_frame()
  1. Running a script intended for the first UnityCapture device subsequently affects all devices:
frame = np.zeros((480, 640, 3), np.uint8)  
frame[:] = (255, 0, 0)  # red

with pyvirtualcam.Camera(width=640, height=480, fps=20, backend="unitycapture", device="Unity Video Capture") as cam:
    print(f'Using virtual camera: {cam.device}')
    while True:
        cam.send(frame)
        cam.sleep_until_next_frame()
@letmaik letmaik added the help wanted Extra attention is needed label Mar 26, 2024
@zeeblaze
Copy link

zeeblaze commented Jul 4, 2024

Environment

Operating System: Windows 11 Python Version: 3.12.2 pyvirtualcam Version: Latest Virtual Camera Used: UnityCapture Virtual Camera Version: Latest

Describe the bug

I'm encountering a bug when using pyvirtualcam with multiple UnityCapture devices. Specifically, after installing 10 UnityCapture devices and attempting to select and use a device other than the first one through pyvirtualcam, none of the devices function as intended. Instead, all UnityCapture devices mirror the output designated only for the first device.

To Reproduce

  1. Install multiple UnityCapture devices (e.g., 10 devices).
  2. Attempt to use a specific device (other than the first one) using the following script:
frame = np.zeros((480, 640, 3), np.uint8)  
frame[:] = (255, 255, 0)  # yellow

with pyvirtualcam.Camera(width=640, height=480, fps=20, backend="unitycapture", device="Unity Video Capture #2") as cam:
    print(f'Using virtual camera: {cam.device}')
    while True:
        cam.send(frame)
        cam.sleep_until_next_frame()
  1. Running a script intended for the first UnityCapture device subsequently affects all devices:
frame = np.zeros((480, 640, 3), np.uint8)  
frame[:] = (255, 0, 0)  # red

with pyvirtualcam.Camera(width=640, height=480, fps=20, backend="unitycapture", device="Unity Video Capture") as cam:
    print(f'Using virtual camera: {cam.device}')
    while True:
        cam.send(frame)
        cam.sleep_until_next_frame()

To use a specific unity virtual camera, you have to install different ones with different names...if you install different cameras with same name, you will encounter this kind of error, pyvirtualcam send to the specific name, so if the names are the same, all will have same mirrored output.

@thiv31
Copy link

thiv31 commented Oct 7, 2024

Hello @Mo18769 , same problem here. Did you find a solution?

@Mo18769
Copy link
Author

Mo18769 commented Oct 9, 2024

Hello @Mo18769 , same problem here. Did you find a solution?

You have to use the one pull request of unity Capture and build it yourself...

schellingb/UnityCapture#36

I think i hosted it on this subdomain:
webcam.mrtz.nl

@thiv31
Copy link

thiv31 commented Oct 9, 2024

Thank you so much @Mo18769 . It works !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants