| Crates.io | sc-cap |
| lib.rs | sc-cap |
| version | 0.2.0 |
| created_at | 2025-10-16 15:55:51.758763+00 |
| updated_at | 2025-10-25 14:22:13.475974+00 |
| description | Modern, high-performance screen capture library for Rust. Cross-platform. |
| homepage | |
| repository | https://github.com/cijiugechu/sc-cap |
| max_upload_size | |
| id | 1886346 |
| size | 221,663 |
sc-cap
A Rust library for high-quality screen capture that leverages native OS APIs for optimal performance!
We found most of Rust's tooling around screen capture either very outdated, non-performant or platform-specific. This project is our attempt to change that. Contributions, PRs and Issues are most welcome!
If you want to contribute code, here's a quick primer:
cargo run.win, mac and linux modules.use sc_cap::{
capturer::{Point, Area, Size, Capturer, Options},
frame::Frame,
};
fn main() {
// Check if the platform is supported
if !sc_cap::is_supported() {
println!("❌ Platform not supported");
return;
}
// Check if we have permission to capture screen
// If we don't, request it.
if !sc_cap::has_permission() {
println!("❌ Permission not granted. Requesting permission...");
if !sc_cap::request_permission() {
println!("❌ Permission denied");
return;
}
}
// Get recording targets
let targets = sc_cap::get_all_targets();
println!("Targets: {:?}", targets);
// All your displays and windows are targets
// You can filter this and capture the one you need.
// Create Options
let options = Options {
fps: 60,
target: None, // None captures the primary display
show_cursor: true,
show_highlight: true,
excluded_targets: None,
output_type: sc_cap::frame::FrameType::BGRAFrame,
output_resolution: sc_cap::capturer::Resolution::_720p,
crop_area: Some(Area {
origin: Point { x: 0.0, y: 0.0 },
size: Size {
width: 2000.0,
height: 1000.0,
},
}),
..Default::default()
};
// Create Capturer
let mut capturer = Capturer::build(options).unwrap();
// Start Capture
capturer.start_capture();
let mut input = String::new();
std::io::stdin().read_line(&mut input).unwrap();
// Stop Capture
capturer.stop_capture();
}
The code in this repository is open-sourced under the MIT license, though it may be relying on dependencies that are licensed differently. Please consult their documentation for exact terms.
Pranav Joglekar 💻 |
Siddharth 💻 |
Rohan Punjani 💻 |
NiiightmareXD 💻 |
MAlba124 💻 |
Anubhav Singhal 💻 |
Vasu Sharma 💻 |
This project builds on top of the fabulous work done by: