DEV Community

Brandon Rozek
Brandon Rozek

Posted on • Originally published at brandonrozek.com on

V4l2 Webcam

In Linux you can create a fake webcam by making use of the v4l2loopback kernel module.

To install,

sudo apt install v4l2loopback-dkms

Enter fullscreen mode Exit fullscreen mode

If you already had an existing module, remove it so we can customize it.

sudo modprobe -r v4l2loopback

Enter fullscreen mode Exit fullscreen mode

Then create the file /etc/modprobe.d/fakecam.conf and add the following line

options v4l2loopback devices=1 video_nr=20 card_label=fakecam exclusive_caps=1

Enter fullscreen mode Exit fullscreen mode

The value of video_nr must be larger than the amount of cameras in your system. I wouldn’t have more than 10 webcams plugged into my system, so I set it to 20.

Then load back up the kernel module

sudo modprobe v4l2loopback

Enter fullscreen mode Exit fullscreen mode

Now when you open up Chrome, Skype, etc, you should see a new device labeled “fakecam”.

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay