On Wayland, x11grab won't work because there is no direct access to the display like in Xorg. Instead, you'll need to use PipeWire and wf-recorder or obs-v4l2sink.
Solution Using PipeWire (wf-recorder and v4l2loopback)
1. Install required dependencies (if not already installed):
sudo apt install wf-recorder v4l2loopback-utils v4l2loopback-dkms
2. Load the v4l2loopback module (if not already loaded):
sudo modprobe v4l2loopback devices=1 video_nr=10 card_label="Virtual Camera" exclusive_caps=1
This creates /dev/video10, which you will use as your virtual camera.
3. Capture the second monitor and send it to /dev/video10:
wf-recorder -o HDMI-A-1 -f - | ffmpeg -i - -f v4l2 -vcodec rawvideo -pix_fmt yuv420p /dev/video10
Replace HDMI-A-1 with your monitor's correct name. Find your available outputs with:
swaymsg -t get_outputs
4. Verify the virtual camera in Zoom:
Start Zoom, and in the camera settings, select "Virtual Camera."
---
Alternative Solution Using obs-v4l2sink (If You Use OBS)
If you're using OBS, you can install the obs-v4l2sink plugin to achieve the same effect by redirecting an OBS scene to a virtual camera.
---
Thanks,
Alexander
Sent from my Google Pixel 7 Pro