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!
-vo=xv
You shouldn't use this vo, it's deprecated and only intended for old potato PCs. Use
--gpu-context=x11vk
or--gpu-context=x11egl
instead for x11 vulkan or x11 opengl respectively.You should also instead use tools like
xwaylandvideobridge
instead.