allo- / virtual_webcam_background

Use a virtual webcam background and overlays with body-pix and v4l2loopback
GNU General Public License v3.0
306 stars 47 forks source link

Getting errors when running the virtual_webcam.py script #57

Closed naowalrahman closed 3 years ago

naowalrahman commented 3 years ago

While trying to install this, everything was working until I ran virtual_webcam.py to start the program. For some reason, I always get this error: image Any ideas as to why, and the fixes for it?

kevingatera commented 3 years ago

Same here, maybe there's something we're doing wrong?

allo- commented 3 years ago

Looks like you do not have the rights to access the v4l2loopback device or specified the wrong device in the configuration.

Please check:

kevingatera commented 3 years ago

Yeah you're right. Turns out the virtual_video_device in config.yaml was wrong. I tried each of the video devices in /dev until I found the right one. I am trying to add a background to a droidcam webcam feed, and it works! Albeit, slowly, very slowly.

allo- commented 3 years ago

I guess it's time for a FAQ and Troubleshooting section.

naowalrahman commented 3 years ago

Ok, so I am the admin account, so it's definitely allowed to write to the device. How do I set parameters while loading v4l2loopback, and how do I check if virtual_video_device is created (sorry I'm kind of a newbie to this stuff)?

allo- commented 3 years ago

As root:

modprobe v4l2loopback exclusive_caps=1 video_nr=10
ls -l /dev/video*

You should now see a video10 device and your webcam, if it is plugged in. Have a look at the group name (e.g. "video") As a user check with groups if you're in the group. Otherwise add your user to the group and re-login.

Now you should be able to use video10 as virtual device and the webcam device as real device using your normal user account.