not-matthias / obs-rs

Capture frames of any game using OBS.
MIT License
141 stars 23 forks source link

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.

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));
    }
}