Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
waycap-rs
A high-level Wayland screen capture library with hardware-accelerated encoding for Linux environments.
Features
- Hardware-accelerated video encoding (VAAPI for Intel/AMD, NVENC for NVIDIA)
- Audio capture with Opus encoding
- Copy-Free video encoding leveraging PipeWire's DMA Buffers
- Multiple quality presets for various use cases
- Cursor visibility control
- Simple, ergonomic API for easy integration
Requirements
- Linux with Wayland display server
- XDG Desktop Portal
- PipeWire
- VA-API compatible hardware for VAAPI encoding
- CUDA compatible hardware for NVENC encoding
Installation
Add this to your Cargo.toml:
[]
# Default: VAAPI only (Intel/AMD)
= "3.0.0"
= "0.8.4"
# NVIDIA only
= { = "3.0.0", = false, = ["nvidia", "vulkan"] }
# Support both, auto-detect GPU at runtime
= { = "3.0.0", = ["nvidia", "vulkan"] }
Cargo Features
| Feature | Default | Description |
|---|---|---|
vaapi |
yes | Intel/AMD hardware encoding via VAAPI |
nvidia |
no | NVIDIA hardware encoding via NVENC/CUDA |
vulkan |
no | Vulkan interop for DMA-BUF (use with nvidia) |
egl |
no | EGL/OpenGL interop alternative to vulkan (use with nvidia) |
vulkan and egl are mutually exclusive. nvidia requires one of them.
Example Usage
use ;
use CaptureBuilder;
use ;
Primary Use Case: WayCap
This library was created primarily to support the development of WayCap -- a low-latency screen recorder targeting Wayland Linux DEs. waycap-rs originally lived within this application but was broken out to split library and application logic, you can read more about that project over at its github page
https://github.com/Adonca2203/WayCap
Contributing
Contributions are always welcome and encouraged, look around for any open issues you want to tackle and feel free to open a PR/Issue yourself.
Build Requirements
If you would like to contribute, the following system dependencies are needed to compile the application:
- Wayland Desktop Environment
- pipewire
- ffmpeg
- pkgconf
- Rust installation. Get it here
Installation of Dependencies example: Arch Linux
After installing the required dependencies you can clone and compile with
To run any of the examples, you can do so with
# Default (VAAPI — Intel/AMD)
# NVIDIA only
# Both encoders, auto-detect GPU
Please run the examples before making a PR, to test and debug your changes.
Areas for Improvement:
- Any optimizations for the library's core capture logic.
- Documentation around the public facing APIs.
- Bug Reports via github Issues
- Platform Testing as I am currently limited by my hardware
Pull Request Guidelines
- Fork the repository based off the
mainbranch. - Write clear and well documented code with comments where appropriate.
- Create new unit tests if applicable.
- Add new code examples in
/examplesif applicable. - Include references to the issue you are resolving in the PR.