How to write on a virtual webcam in Linux?

﹥>﹥吖頭↗ 提交于 2019-12-30 08:41:50

问题


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


回答1:


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 normal video device by other programs. See the readme at the bottom of this page: https://github.com/umlaeute/v4l2loopback and the wiki: https://github.com/umlaeute/v4l2loopback/wiki for more information.

Hope that help.



来源:https://stackoverflow.com/questions/10431588/how-to-write-on-a-virtual-webcam-in-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!