libdrmtap
Safe Rust wrapper for libdrmtap — DRM/KMS screen capture for Linux.
Capture the screen at the kernel level: login screens, Wayland, headless — no user prompts.
⚠️ Testing Status
Tested on
virtio_gpu(QEMU/Parallels VMs) only.Intel, AMD, and Nvidia backends are implemented but not yet validated on real hardware. If you test on real GPUs, please report results.
Example
use DrmTap;
Features
DrmTap::open()— auto-detect GPU and displaygrab()— zero-copy DMA-BUF fd (for hardware encoders)grab_mapped()— mmap'd pixel data (for software access)get_cursor()— cursor position + ARGB imagelist_displays()— enumerate connected monitorsdisplays_changed()— hotplug detection
Requirements
- Linux with DRM/KMS
libdrmtapC library installed- For unprivileged capture:
drmtap-helperwithcap_sys_admin+ep
License
MIT