warning: Very cursed
- wf-recorder
- mpv
- wayland
- have multiple workspaces
- go into a workspace dedicated for workaround
- open 2 terminals
- in one terminal type this command:
wf-recorder --muxer=mpegts --codec=libx264 --file=udp://0.0.0.0:1111
- in other terminal type this command:
mpv -vo=xv udp://0.0.0.0:1111 --no-cache --untimed --no-demuxer-thread --video-sync=audio --vd-lavc-threads=1
- in discord select the mpv window for screen sharing
- profit $$$
well its kinda dumb but since discord runs in xwayland mode instead of native wayland it can only screenshare xwayland apps, so we have to run mpv in x11 mode for discord to see it and we capture the wayland screen using wf-recorder and output that to a udp uri, add a bunch of latency crap to mpv to lower it and voila you have a working wayland screen viewer!
Thanks for the help!
Also, you could merge both lines to run them in one terminal / one line:
mpv -vo=xv udp://0.0.0.0:1111 --no-cache --untimed --no-demuxer-thread --video-sync=audio --vd-lavc-threads=1 & wf-recorder --muxer=mpegts --codec=libx264 --file=udp://0.0.0.0:1111