Most probably a pyvirtualcam issue. I solved it by manually specifying the device at initialization. For the example below, /dev/video4; if video4 is taken (ls /dev
), pick another one. More details (assumes Ubuntu):
- Set the device when loading v4l2loopback (
video_nr
)
$ sudo modprobe -r v4l2loopback && sudo modprobe v4l2loopback devices=1 video_nr=4 card_label="Virtual" exclusive_caps=1 max_buffers=2
- Check you can open the device
$ v4l2-ctl --list-devices -d4 # it should NOT say 'Cannot open device /dev/video4'
$ gst-launch-1.0 videotestsrc ! v4l2sink device=/dev/video4 # additional check
- Set the (same) device for pyvirtualwebcam
with pyvirtualcam.Camera(width=1280, height=720, fps=5, device='/dev/video4') as cam
If you cannot open the stream (2. fails), you could try compiling v4l2loopback as instructed here:
https://github.com/umlaeute/v4l2loopback
Make sure you have loaded the (new) module, it will probably end up in the extra
folder (as opposed to the one from apt
)
$ modinfo v4l2loopback
should return something like
filename: /lib/modules/5.16.xxx-generic/extra/v4l2loopback.ko
If not, manally delete the old .ko and run depmod again sudo depmod -a