1

I have a setup with 2 monitors. I'm on Manjaro, I installed v4l2loopback from AUR (here is github link: https://github.com/umlaeute/v4l2loopback)and it works great, no problem there. But my question is how to specify which monitor I want it to use? What I did was:

$ sudo modprobe v4l2loopback exclusive_caps=1
$ ffmpeg -f x11grab -r xllgrab -r 15 -s 1920x1080 -i :0.0+0,0 -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0

And sure it works greater, but I want to stream a different monitor. How can I do that? Also (its a PC and I never had any cameras so /video0 is the fake webcam:

$ v4l2-ctl --list-devices
Dummy video device (0x0000) (platform:v4l2loopback-000):
        /dev/video0

The one with a DP (DisplayPort) is the one I want to stream

$ xrandr --listmonitors
Monitors: 2
 0: +*DP-4 1920/480x1080/270+1920+0  DP-4
 1: +HDMI-0 1920/531x1080/299+0+0  HDMI-0
John
  • 197

1 Answers1

1

The ffmpeg-all man page says x11grab takes an option,

 [<hostname>]:<display_number>.<screen_number>[+<x_offset>,<y_offset>]

which in your case is :0.0+0,0 and determines what to grab. Depending on your configuration, you can try :0.1+0,0 for a second screen or :0.0+1920,0 for an offset in a single virtual screen, or even :1.0+0,0 for a second display.

meuh
  • 51,383