| Crates.io | libobs-bootstrapper |
| lib.rs | libobs-bootstrapper |
| version | 0.3.0 |
| created_at | 2025-10-26 15:30:55.349037+00 |
| updated_at | 2026-01-05 13:26:30.466343+00 |
| description | Downloads OBS binaries at runtime and bootstraps libobs |
| homepage | |
| repository | https://github.com/libobs-rs/libobs-rs |
| max_upload_size | |
| id | 1901541 |
| size | 228,162 |
A utility crate for automatically downloading and installing OBS (Open Broadcaster Software) Studio binaries at runtime. This crate is part of the libobs-rs ecosystem and is designed to make distributing OBS-based applications easier by handling the setup of OBS binaries.
Note: This crate currently supports Windows and MacOS platforms. Refer to the libobs-wrapper documentation for Linux setup instructions here.
Add the crate to your dependencies:
[dependencies]
libobs-bootstrapper = "0.2.0"
Here's a simple example using the default console handler:
use std::{sync::Arc, time::Duration};
use libobs_bootstrapper::{
ObsBootstrapper, ObsBootstrapperOptions, ObsBootstrapperResult
};
use libobs_wrapper::{context::ObsContext, utils::StartupInfo};
#[tokio::main]
async fn main() {
env_logger::init();
println!("Starting OBS bootstrapper...");
let handler = ObsBootstrapProgress::new();
let res = ObsBootstrapper::bootstrap(&ObsBootstrapperOptions::default())
.await
.unwrap();
if matches!(res, ObsBootstrapperResult::Restart) {
println!("OBS has been downloaded and extracted. The application will now restart.");
return;
}
let context = ObsContext::new(StartupInfo::default()).unwrap();
handler.done();
println!("Done");
// Use the context here
// For example creating new obs data
context.data().unwrap();
}
You can implement your own progress handler for custom UI integration:
use indicatif::{ProgressBar, ProgressStyle};
use libobs_bootstrapper::status_handler::ObsBootstrapStatusHandler;
use std::{sync::Arc, time::Duration};
#[derive(Debug, Clone)]
struct CustomProgressHandler(Arc<ProgressBar>);
impl CustomProgressHandler {
pub fn new() -> Self {
let bar = ProgressBar::new(200).with_style(
ProgressStyle::default_bar()
.template("{msg}\n{wide_bar} {pos}/{len}")
.unwrap(),
);
bar.set_message("Initializing bootstrapper...");
Self(Arc::new(bar))
}
}
impl ObsBootstrapStatusHandler for CustomProgressHandler {
fn handle_downloading(&mut self, prog: f32, msg: String) -> anyhow::Result<()> {
self.0.set_message(msg);
self.0.set_position((prog * 100.0) as u64);
Ok(())
}
fn handle_extraction(&mut self, prog: f32, msg: String) -> anyhow::Result<()> {
self.0.set_message(msg);
self.0.set_position(100 + (prog * 100.0) as u64);
Ok(())
}
}
You can either:
a) RECOMMENDED enable the install_dummy_dll feature for this crate
b) Add a placeholder obs.dll file to your executable directory:
obs.dllCall ObsBootstrapper::bootstrap() at application startup
If ObsBootstrapperResult::Restart is returned:
The ObsBootstrapperOptions struct allows you to customize the bootstrapper:
let options = ObsBootstrapperOptions::default()
.with_repository("sshcrack/libobs-builds") // Custom repo
.with_update(true) // Force update check
.with_restart_after_update(true); // Auto restart
The crate provides the ObsBootstrapError enum for error handling:
GeneralError: Generic bootstrapper errorsDownloadError: Issues during OBS binary downloadExtractError: Problems extracting downloaded filesThis project is licensed under the MIT License - see the LICENSE file for details.