OpenCV output on V4l2

。_饼干妹妹 提交于 2019-12-05 21:04:32

The question is 8 month old, but if you still need an answer (I suppose your OS is Linux):

  1. Install v4l2 loopback module

    1.1. Load and configure it linux: i.e. modprobe.conf: options v4l2loopback video_nr=22,23

  2. Use such C++/OpenCV code: gist

    2.1. Setup device using ioctl() call

    2.2. Write raw RGB data to this device (i.e. /dev/video23)

    2.3. Use it as regular v4l2 device (i.e. webcam or vlc v4l2:///dev/video23)

more: You can use ffmpeg with v4l2 loopback: ffmpeg -f x11grab -r 12 -s 1920x1080 -i :0.0+0,0 -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 -vf 'scale=800:600' /dev/video22

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