MCPcopy Index your code
hub / github.com/CapSoftware/scap

github.com/CapSoftware/scap @v0.0.8

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0.8 ↗ · + Follow
156 symbols 261 edges 21 files 18 documented · 12% updated 11mo agov0.1.0-beta.1 · 2025-08-04★ 62237 open issues

Browse by type

Functions 112 Types & classes 44
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Github banner

Discord Twitter GitHub Repo stars docs.rs Crates.io MSRV

A Rust library for high-quality screen capture that leverages native OS APIs for optimal performance!

  1. macOS: ScreenCaptureKit
  2. Windows: Windows.Graphics.Capture
  3. Linux: Pipewire

features

  1. Cross-platform across Windows, Mac and Linux!
  2. Checks for support and recording permissions.
  3. Query list of captureable targets (displays and windows).
  4. Exclude certain targets from being captured.

contributing

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:

  1. Clone the repo and run it with cargo run.
  2. Explore the API and library code in lib.rs.
  3. Platform-specific code lives in the win, mac and linux modules.
  4. The main.rs is a small program that "consumes" the library, for easy testing.

usage

use scap::{
    capturer::{Point, Area, Size, Capturer, Options},
    frame::Frame,
};

fn main() {
    // Check if the platform is supported
    if !scap::is_supported() {
        println!("❌ Platform not supported");
        return;
    }

    // Check if we have permission to capture screen
    // If we don't, request it.
    if !scap::has_permission() {
        println!("❌ Permission not granted. Requesting permission...");
        if !scap::request_permission() {
            println!("❌ Permission denied");
            return;
        }
    }

    // Get recording targets
    let targets = scap::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: scap::frame::FrameType::BGRAFrame,
        output_resolution: scap::capturer::Resolution::_720p,
        source_rect: 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::new(options);

    // Start Capture
    capturer.start_capture();

    let mut input = String::new();
    std::io::stdin().read_line(&mut input).unwrap();

    // Stop Capture
    capturer.stop_capture();
}

license

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.

contributors

Pranav Joglekar Pranav Joglekar 💻 Siddharth Siddharth 💻 Rohan Punjani Rohan Punjani 💻 NiiightmareXD NiiightmareXD 💻 MAlba124 MAlba124 💻 Anubhav Singhal Anubhav Singhal 💻 Vasu Sharma Vasu Sharma 💻

credits

This project builds on top of the fabulous work done by:

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 58
Function 54
Class 35
Enum 7
Interface 2

Languages

Rust100%

Modules by API surface

src/capturer/engine/linux/portal.rs24 symbols
src/capturer/engine/mac/pixel_buffer.rs19 symbols
src/frame/mod.rs17 symbols
src/capturer/mod.rs17 symbols
src/capturer/engine/win/mod.rs13 symbols
src/capturer/engine/linux/mod.rs11 symbols
src/capturer/engine/mac/mod.rs9 symbols
src/targets/mod.rs7 symbols
src/capturer/engine/mod.rs7 symbols
src/targets/mac/mod.rs5 symbols
src/capturer/engine/mac/pixelformat.rs5 symbols
src/targets/win/mod.rs4 symbols

For agents

$ claude mcp add scap \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page