I am trying to create a loopback device from my webcam to be accessible from both Zoom and a browser. I created three v4l2loopback devices:
sudo modprobe v4l2loopback devices=3 video_nr=10,11,12 card_label="Loopback_1","Loopback_2","Virtual_cam" exclusive_caps=1,1,0
followed by:
ffmpeg -i /dev/video0 -f v4l2 -vcodec rawvideo -pix_fmt yuv420p /dev/video10 -f v4l2 /dev/video11
Both devices are detected by Chrome, yet not seen by either Zoom nor Firefox.
Following advice on other questions on stackoverflow I tried setting the device properties using v4l2loopback-ctl, using v4l2loopback-ctl set-caps "video/x-raw,format=UYVY,width=640,height=480" /dev/video10
, and got in response:
Setting pipeline to PAUSED ... ERROR: Pipeline doesn't want to pause. ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Device '/dev/video10' is not a output device. Additional debug info: v4l2_calls.c(636): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Capabilities: 0x85208000 Setting pipeline to NULL ... Freeing pipeline ... output to /dev/video10 failed
I also tried using gst-launch-1.0:
gst-launch-1.0 v4l2src device=/dev/video0 ! v4l2sink device=/dev/video10
which tells me that /dev/video10 is not an output device:
Setting pipeline to PAUSED ... ERROR: Pipeline doesn't want to pause. ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Device '/dev/video10' is not a output device. Additional debug info: v4l2_calls.c(636): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Capabilities: 0x85208000 Setting pipeline to NULL ... Freeing pipeline ...
I am running Xubuntu 20.04, kernel version 5.4.0-52-generic, with v4l2loopback-dkms v.0.12.3-1ubuntu0.1, and v4l2loopback-utils.
My goal here is to get a device to be consumed by a desktop Node.js server which will open up a web app using xdg-open
(thus the need for both Chrome AND Firefox), which will output a processed videostream that could be consumed by a video chat app, such as Zoom or Jitsi.
Any help will be greatly appreciated.