Virtual Camera for OpenCV using V4L2Loopback

Overview

Did 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. Any other software (such as a web browser, Skype, Meet, Teams, Zoom…) could use the processed video seamlessly.

This is a recipe of how we could achieve this very result. 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. We will open the result with Google Chrome, Cheese and Gstreamer.

Continue reading