Capture frames of any game using OBS.
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
.
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));
}
}