Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write on a virtual webcam in Linux?

I want to capture a video from a real webcam, apply filters with openCv and write the filtered video on a virtual webcam, to stream it on web.

I don't have problem with the first 2 points, but I don't know how I can write on a virtual webcam.

It's possible?

How can I do it?

I use openCv with C++ on Debian. Thanks

like image 339
user1275896 Avatar asked May 03 '12 12:05

user1275896


People also ask

How do I access my webcam on Linux?

Open your terminal ( Ctrl + Alt + T ). Type cheese . if cheese is already installed then it will prompt cheese with webcam on. Now you can use your webcam.

Does OBS virtual camera work on Linux?

In this video we're setting up a virtual camera in OBS on Linux. You can use this to send your OBS output to applications like Skype, Zoom, Discord, Teams, and Jitsi.


1 Answers

Well, actually this is possible. A quick and dirty way to do this is to use WebcamStudio. That will create a new video device (e.g., /device/video2) that other programs see as a normal video device and can take its input from desktop, so you just set it up to capture a part of the screen that OpenCV's output is shown there.

A better but more technical way is to use the V4L2 loop back module. This way you can simply pipe the output of OpenCV to the module which is seen as a regular video device by the other programs. See the readme at the bottom of this page: https://github.com/umlaeute/v4l2loopback and the wiki page: https://github.com/umlaeute/v4l2loopback/wiki for more information.

Hope that helps.

like image 116
fireant Avatar answered Oct 01 '22 17:10

fireant