Closed ghost closed 3 years ago
Your source file is not the same as in the git repo (the "droid" should not be there).
Please run git checkout virtual_webcam.py
to restore the original file.
git checkout virtual_webcam.py
after running git checkout virtual_webcam.py and runnning the virtual_webcam.py
❯ /usr/bin/python /home/adminodchryz/virtual_webcam_background/virtual_webcam.py ─╯
Reloading config.
Traceback (most recent call last):
File "/home/adminodchryz/virtual_webcam_background/virtual_webcam.py", line 101, in
❯ virtualcam ─╯ [ERROR:0] global /tmp/pip-req-build-6179nsls/opencv/modules/videoio/src/cap.cpp (140) open VIDEOIO(CV_IMAGES): raised OpenCV exception:
OpenCV(4.4.0) /tmp/pip-req-build-6179nsls/opencv/modules/videoio/src/cap_images.cpp:293: error: (-215:Assertion failed) !_filename.empty() in function 'open'
Failed to reduce capture buffer size. Latency will be higher!
Traceback (most recent call last):
File "/home/adminodchryz/virtual_webcam_background/virtual_webcam.py", line 101, in
Copy config.yaml.example to config.yaml and set the parameters. See the readme and https://virtual-webcam.com/configuration.html
i've already done that, still not working
Make sure you loaded the v4l2loopback Kernel Module and to get the real and fake webcam device ids right. Your useraccount also needs to be able to read from/write to the devices.
ive loaded the kernel module just like the instruction in the repo, then copied the created the config.yaml, and when its not working ive done a research and found out the website of yours, so I reloaded the kernel module using video_nr=0 instead of video_nr=2 but still not be able to work it out
You have two devices, which you can find with ls -l /dev/video*
. One is the fake cam, the other one the real one. they are probably owned by the group "video" and your user must be in this group (log out and in again after changing the groups of your user) to use the devices.
I am getting the same errors, but it is intermittent. I thought it might be related to not having all the dependencies or something like that. To rule out inconsistencies, each time I try to get this program to work after a reboot I rerun all the setup steps. I have included my config.yaml below in case that is somehow causing the issues since I do have to change the real_video_device parameter and I do make it passed this error message.
The fake cam is listed as a video device as shown in the screenshot below. This was an attempt with my C920 but I have also tried a Brio webcam as well.
width: 1280
height: 720
fps: 30
internal_resolution: 0.5
multiplier: 0.5
segmentation_threshold: 0.75
blur: 3
erode: 10
dilate: 10
virtual_video_device: "/dev/video10"
real_video_device: "/dev/video0"
average_masks: 3
mjpeg: False
layers:
- "empty": [["image", "background.jpg"]]
- "foreground": []
For full transparency I have yet to get this program to actually work but I frequently get to a stage where there are no more error messages before I have to give up. Been trying for the past 3 days.
Are you sure that's the config you used?
The error message looks like virtual_video_device
is unset.
you can try to add before like 101 (the line in the error message)
print(config['virtual_video_device'])
This should print the device from your config, but the error message looks like it will output a KeyError
(.get
replaces non-existent entries with None
)
closed due to inactivity
Hi!, just want to ask how to fix this, whenever i try to run virtualcam im getting this error, i open the directory on code to inspect and there is a class pointing to FakeWebcam from pyfakewebcam.py, but code also says that it is an invalid syntax
edit: I've set an alias virtualcam for the script so that i can call it without going to the directory