Nov 4, 4:28pm

On Linux, a V4L2 device is usually exclusive to one open file descriptor, so two apps can't both read /dev/videoN directly. The standard fix is a v4l2loopback virtual device: one process reads the real camera and writes the frames into the loopback device(s), which applications then open instead. (v4l2loopback user guide)

1. Install (Debian 13)

bash
sudo apt update
sudo apt install v4l2loopback-dkms v4l2loopback-utils linux-headers-$(uname -r)

2. Create a virtual device

bash
sudo modprobe v4l2loopback devices=1 video_nr=10 card_label="VirtualCam" exclusive_caps=1
  • video_nr=10 → creates /dev/video10
  • exclusive_caps=1 is required for Chrome/Chromium/WebRTC-based apps
  • Modern v4l2loopback (≥0.13, what Debian 13 ships) allows several apps to open the same loopback device at once (they all receive a broadcast copy), so one virtual device is usually enough (multiple consumers issue)

3. Feed the real camera into it

Pick the format your webcam actually supports (v4l2-ctl --list-formats-ext -d /dev/video0):

bash
ffmpeg -f v4l2 -input_format mjpeg -framerate 30 -video_size 1280x720 \
  -i /dev/video0 \
  -pix_fmt yuv420p -f v4l2 /dev/video10

4. Use it in both apps

In Cheese, OBS, browser (Google Meet/Zoom web), etc., select "VirtualCam" (or /dev/video10) instead of the physical camera. Both can open it simultaneously.

Make it persistent

bash
echo "v4l2loopback" | sudo tee /etc/modules-load.d/v4l2loopback.conf
echo "options v4l2loopback devices=1 video_nr=10 card_label=VirtualCam exclusive_caps=1" \
  | sudo tee /etc/modprobe.d/v4l2loopback.conf

Notes & alternatives

  • If you prefer GUI-only: OBS Studio with the "Start Virtual Camera" option uses v4l2loopback under the hood, but it's a one-consumer feed — it doesn't solve fan-out by itself.
  • If ffmpeg reports the loopback doesn't accept the format, match -pix_fmt to what v4l2-ctl --list-formats-ext -d /dev/video10 shows (usually yuv420p).
  • If you want N independent copies, create N devices (devices=2 video_nr=10,11) and use ffmpeg's tee muxer: -f tee "[f=v4l2]/dev/video10|[f=v4l2]/dev/video11".
  • GNOME on Wayland's PipeWire camera sharing doesn't help here: most desktop apps still open V4L2 devices directly, which is why the loopback is the reliable route.
Nov 4, 4:28pm

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.

Vibe can make mistakes. Check answers. Learn more