Friday, March 24, 2017

create video device from display

1- install the package
$ sudo apt-get install v4l2loopback

2- create video device:  /dev/video3 /dev/video4 and /dev/video5
$ sudo modprobe v4l2loopback video_nr=3,4,5 card_label="video 3","video 4 ","video 5"

-if you create video device with the command below, it won't work
$ sudo  mknod /dev/video2 c 81 2
$ sudo setfacl -m u:user2:rw /dev/video2


3- now we can create video device from display :3 with the following command
$ ffmpeg -f x11grab -r 15 -s 800x600 -i :3.0+0,0 -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video4

4- then we can use vlc to play that video device
$ vlc v4l2:///dev/video4

- screenshot of the playback

No comments:

Post a Comment