• Stars
    star
    133
  • Rank 266,300 (Top 6 %)
  • Language
    Rust
  • License
    MIT License
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Capture frames of any game using OBS.

obs-rs

Capture frames of any game using OBS.

Features

This projects uses the graphics-hook implementation from the obs-studio project, to capture frames of any game.

  • The graphics hook is signed and whitelisted by all anti-cheats as it's used by streamers and content creators as well.
  • Works for many graphics APIs (D3D9, D3D10, D3D11, Vulkan, ...) and thus also for many different games.
  • This implementation is extremely fast, because it only copies the pixels from the framebuffer. On my machine, this crate is almost 5 times faster compared to an implementation using BitBlt.

Example

use obs_client::Capture;

fn main() {
    simple_logger::SimpleLogger::new()
        .with_level(log::LevelFilter::Warn)
        .init()
        .unwrap();

    let mut capture = Capture::new("Rainbow Six");
    if capture.try_launch().is_err() {
        println!("Failed to launch the capture");
        return;
    }

    loop {
        let _ = capture.capture_frame::<u8>();
        std::thread::sleep(std::time::Duration::from_secs(5));
    }
}