Dealing with text streams is a fundamental skill for the Linux power user. You can sort, merge, and search text files easily from the command line. What if you could do the same thing with video? Well, you can. Maybe you want to add a logo to a webcam feed before sending it to a conference app. Maybe you want to blur, color-correct, or annotate video in real time. Or perhaps you want to inject prerecorded video into Zoom while pretending it is a live camera. Linux can do all of this, and the key ingredient is usually the same: a loopback video device.

The basic idea is simple. Instead of an application reading directly from /dev/video0, you create a fake camera device using the v4l2loopback kernel module. Your software pipeline writes processed video into the fake camera, and applications read from it as if it were a normal webcam. The result is surprisingly powerful.

Loopback Cameras

The first step is to install the loopback driver. On many distributions, this is packaged already. On Debian or Ubuntu, you’d install the v4l2loopback-dkms package. On OpenSUSE it’s probably v4l2loopback-kmp-default if you’re using the usual kernel.

Unless your distro automatically loads the module, you’ll do it yourself and tell the driver how many fake cameras to make. You’ll also need to tell it where to put them. Here, I’m asking for a single camera at /dev/video10 named VirtualCam: