obs-kmscap - fast, super low overhead, display server agnostic, zero copy GPU screen capture for OBS
Posted by thepoke32@reddit | linux | View on Reddit | 6 comments
obs-kmscap is a display server-agnostic zero-copy screen capture plugin for Linux, which works by directly exporting textures from the screen's framebuffer using native system calls, in favor of double-copy XSHM capture, which is incredibly slow. Depending on your system, it might be potentially more performant than even Wayland Pipewire capture, since it bypasses the double compositing that Pipewire implicates and thus results in lower input lag overall. The idea started fromĀ w23's project, which does something very similar in concept, but hasn't received updates or support in years.
I am currently trying to test the plugin on a larger scale, and I would highly appreciate it if anyone tried it for themselves and gave me feedback. I am also curious about NVIDIA support, as I don't have an NVIDIA graphics card myself, but seeing as newer drivers have better DRM/KMS support (with nvidia-drm.modeset=1 as a kernel boot parameter) it makes me curious.
Twig6843@reddit
Wouldn't it be better to upstream this somehow?
Zamundaaa@reddit
No. kmsgrab should not be used at all, let alone upstream in any project. It's an unreliable hack that just causes problems.
TiZ_EX1@reddit
To answer both you and /u/KamFretoZ, this is very likely not suitable for upstreaming as it currently is because it requires a helper binary that needs to be given CAP_SYS_ADMIN in order to correctly function. I don't think OBS wants to sidestep system security like this, especially because compromising the helper binary would make for an attack vector.
KamFretoZ@reddit
Imo this would be better if it can be upstreamed.
LvS@reddit
Can you explain this?
dnu-pdjdjdidndjs@reddit
im not op but I don't think it's supposed to be true, the compositor should just duplicate the fd (handle) to dmabuf (the gpu buffer) to either the window or the screen output (before its given to DRM) and should be fully zero copy, but in practice it could be fucked up/broken who knows