![]() ![]() As v4l2loopback is a kernel module, we do this by registering it inside the kernel with the proper params. So, the first thing we have to do is create the virtual devices we’re going to use. This module creates virtual video devices that normal applications will read as if they were ordinary devices, but the video stream will not come from some piece of hardware, but instead from another application or service. The key component that made all of this possible is v4l2looback. Finally, we could open that output device using virtually any normal application that uses a video device (like Cheese, Gstreamer, VLC or even the web browser). Once we got the desired effect, we will write the frame to a virtual device that will be created by the module Video For Linux Loopback ( v4l2loopback). Then, using OpenCV, we will fetch the image data, frame by frame, and convert it to grayscale. The source of the video is a normal webcam connected through USB, which means that the Video For Linux ( v4l2) subsystem will take the control there. I’ve created a repository with all the code explained in this recipe, so, if you want to download it using git:įirst of all, let me explain in more detail what we will do here. I used Ubuntu 20.04 LTSīasic knowledge of programming in C++ and OpenCV, Makefile (and also Python, JavaScript, HTML and CSS, if you want to delve a little bit deeper), plus some familiarity with system administration.Īll the libraries and tools used in the example: We will open the result with Google Chrome, Cheese and Gstreamer.įor this tutorial, I used (and you will need):Ī GNU/Linux system. Here, we will source the video feed from a USB webcam, convert it to grayscale (to give an example), and then send it to a video device, making it available for other software. This is a recipe of how we could achieve this very result. OPENCV INTERLACING IMAGE SOFTWAREAny other software (such as a web browser, Skype, Meet, Teams, Zoom…) could use the processed video seamlessly. OPENCV INTERLACING IMAGE HOW TODid you ever wonder how to create a virtual camera from a custom video source? Well, may be not, but nevertheless this is a very interesting project to do! Imagine that you can fetch the video from a RTSP source (or from a file), process it with OpenCV (adding some interesting filters), and then provide the result to the whole system, just like a normal USB webcam. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |