Crates.io | libobs-sources |
lib.rs | libobs-sources |
version | 0.1.1 |
source | src |
created_at | 2024-08-05 09:05:38.382342 |
updated_at | 2024-09-18 08:54:55.703461 |
description | A helper crate to create sources for OBS |
homepage | |
repository | https://github.com/sshcrack/libobs-rs |
max_upload_size | |
id | 1325696 |
size | 24,882 |
This crate makes it really easy to create new sources for OBS Studio using the libobs crate.
// Set up the obs context and output here (see libobs-new crate for more info)
let (mut context, output) = initialize_obs(rec_file);
let output = context.get_output(&output).unwrap();
let windows =
WindowCaptureSourceBuilder::get_windows(WindowSearchMode::ExcludeMinimized).unwrap();
let window = windows.into_iter().find(|w| {
w.class
.as_ref()
.is_some_and(|e| e.to_lowercase().contains("notepad"))
})
.unwrap();
WindowCaptureSourceBuilder::new("test_capture")
.set_window(&window)
.add_to_output(output, 0)
.unwrap();
// And the window capture source is added and captures the notepad window!