libobs-sources

Crates.iolibobs-sources
lib.rslibobs-sources
version0.1.1
sourcesrc
created_at2024-08-05 09:05:38.382342
updated_at2024-09-18 08:54:55.703461
descriptionA helper crate to create sources for OBS
homepage
repositoryhttps://github.com/sshcrack/libobs-rs
max_upload_size
id1325696
size24,882
Hendrik Lind (sshcrack)

documentation

README

libOBS Sources

This crate makes it really easy to create new sources for OBS Studio using the libobs crate.

Example

// 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!
Commit count: 0

cargo fmt