LinuxAlternative

Linux · Sound & Video

v4l2loopback

v4l2loopback creates virtual video devices that let you stream or share video between applications on Linux.

Open sourceFree
Be the first to rate
License
GPL-2.0
Latest version
0.15.4

What is v4l2loopback?

v4l2loopback is a Linux kernel module that enables the creation of virtual video4linux (V4L2) devices. These devices act like real cameras but are fed by software, allowing apps to send video to other apps as if from a physical webcam. It's been in active development for years and is widely used in production environments, from streaming setups to video conferencing tools.

This tool is for Linux users who need fine-grained control over video routing—streamers, developers, or anyone integrating video into custom workflows. It's especially useful when apps like Zoom or Discord need to receive video from sources like OBS, MPV, or custom scripts. Unlike Windows, where virtual cameras are often plug-and-play, Linux requires this kind of low-level module to achieve the same.

Compared to OBS VirtualCam on Windows, v4l2loopback feels more technical and less polished—but also more flexible. It doesn’t come with a GUI; you manage it via command line or through tools that support it. Once set up, it works reliably and integrates well with existing Linux multimedia pipelines like GStreamer or FFmpeg.

Best for: Users who need a flexible, system-level virtual camera for Linux video routing.

Key features of v4l2loopback

  • Creates virtual V4L2 video devices
  • Supports multiple virtual cameras at once
  • Works with any application that uses V4L2
  • Can stream from FFmpeg, OBS, GStreamer, and more
  • Supports various pixel formats including MJPEG and YUV
  • Allows dynamic loading and unloading of devices
  • Enables video routing between applications
  • Configurable resolution and frame rate

Pros

  • Highly reliable and stable once configured
  • Deep integration with Linux video stack
  • Used in production and automated systems
  • Actively maintained with regular updates
  • Works with a wide range of software

Cons

  • Requires manual setup and kernel module loading
  • No graphical interface—configuration is command-line only
  • May need recompilation after kernel updates
  • Not enabled by default on most distributions

Windows programs v4l2loopback replaces

How to install v4l2loopback on Linux

Ubuntu / Mintsudo apt install v4l2loopback
Debiansudo apt install v4l2loopback
Arch / Manjarosudo pacman -S v4l2loopback-dkms
openSUSEsudo zypper install v4l2loopback

Tips for Windows users

Coming from OBS VirtualCam on Windows, expect more setup work. First, install and load the v4l2loopback module—many distros have it in packages. Then configure a device node (e.g., /dev/video2). In OBS, use the v4l2sink output or a plugin to send video there. Other apps like Zoom will see it as a normal camera. You won’t get automatic start/stop, so manage the module lifecycle manually or via scripts.

v4l2loopback: frequently asked questions

How do I install v4l2loopback on Ubuntu?

On Ubuntu, run 'sudo apt install v4l2loopback-dkms'. Reboot or load the module with 'modprobe v4l2loopback'. Check if /dev/video* appears.

Why doesn't my app see the virtual camera?

Ensure the module is loaded and the device node exists. Some apps only scan for cameras at startup—restart the app after creating the device.

Can I use v4l2loopback with OBS Studio?

Yes. Use the 'v4l2sink' GStreamer element or the obs-v4l2sink plugin to route OBS output to a v4l2loopback device.

Does it work with Wayland?

The virtual device works, but screen sharing via pipewire may not detect it. Use XWayland or route via v4l2loopback-compatible tools.

Updated