How to write on a virtual webcam in Linux?

后端 未结 2 868
眼角桃花
眼角桃花 2021-01-04 05:51

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

相关标签:
2条回答
  • 2021-01-04 06:30

    You can also use a combination of v4l2loopback, OBS Studio and obs-v4l2sink.

    Use OBS Studio to capture video from your device, then obs-v4l2sink is a small plugin that writes output into /dev/video* of your choice.

    https://github.com/umlaeute/v4l2loopback/wiki/OBS-Studio

    https://github.com/CatxFish/obs-v4l2sink

    0 讨论(0)
  • 2021-01-04 06:42

    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 help.

    0 讨论(0)
提交回复
热议问题