| Crates.io | libobs-wrapper |
| lib.rs | libobs-wrapper |
| version | 9.0.4+32.0.2 |
| created_at | 2024-08-05 08:54:35.362247+00 |
| updated_at | 2026-01-07 22:33:23.635305+00 |
| description | A safe wrapper around libobs |
| homepage | |
| repository | https://github.com/libobs-rs/libobs-rs |
| max_upload_size | |
| id | 1325691 |
| size | 446,484 |
A safe, ergonomic Rust wrapper around the OBS (Open Broadcaster Software) Studio library. This crate provides a high-level interface for recording and streaming functionality using OBS's powerful capabilities, without having to deal with unsafe C/C++ code directly.
The library needs OBS binaries in your target directory for Windows and MacOS.
If you want to target Linux, you'll need to build and install OBS Studio from source. This can be done on Ubuntu using the cargo-obs-build tool (using cargo obs-build install), or by following the official OBS build instructions. Users of your application can just install OBS Studio via their package manager directly (tested and working for version 30+ on Ubuntu)
For Windows and Macos, there are multiple ways to set this up:
Install the cargo-obs-build tool:
cargo install cargo-obs-build
Add the following to your Cargo.toml:
[package.metadata]
# The libobs version to use (can either be a specific version or "latest")
# If not specified, the version will be selected based on the libobs crate version.
# libobs-version = "31.0.3"
# Optional: The directory to store the OBS build
# libobs-cache-dir = "../obs-build"
Install OBS in your target directory:
# For debug builds
cargo obs-build build --out-dir target/debug
# For release builds
cargo obs-build build --out-dir target/release
# For testing
cargo obs-build build --out-dir target/(debug|release)/deps
More details can be found in the cargo-obs-build documentation.
For applications that need to bundle OBS binaries or handle runtime installation, we recommend using the libobs-bootstrapper crate.
This separate crate provides functionality to download and install OBS binaries at runtime, which is particularly useful for distributing applications without requiring users to install OBS separately.
See the libobs-bootstrapper documentation for detailed setup instructions and examples of implementing custom progress handlers.
For more advanced usage examples, check out:
For even easier handling, consider using the libobs-simple crate which
builds on top of this wrapper.
no_blocking_drops - Spawns a tokio thread using tokio::task::spawn_blocking, so drops don't block your Application (experimental, make sure you have a tokio runtime running)generate_bindings - When enabled, forces the underlying bindings from libobs to generate instead of using the cached ones.color-logger - Enables coloring for the console. On by default.dialog_crash_handler - Adds a default crash handler, which shows the error and an option to copy the stacktrace to the clipboard. On by default. If turned off, OBS crashes will be reported via stderr, unless logging_crash_handler is enabled, in which case they will be reported via log::error!.logging_crash_handler - Sets the non-dialog_crash_handler default crash handler to report crashes via log::error!, instead of through stderr.If you're experiencing crashes or missing DLL errors:
The library handles most memory management automatically, but you should avoid resetting the OBS context repeatedly as this can cause small memory leaks (due to an OBS limitation). There is 1 memory leak caused by obs_add_data_path (which is called internally from this lib). Unfortunately, this memory leak can not be fixed because of how OBS internally works.
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.