Skip to content

Video encoding and muxing through libobs in Rust

Notifications You must be signed in to change notification settings

joshprk/libobs-rs

Repository files navigation

libobs-rs

Simple and safe video recording through libobs.

Currently only tested on Windows. Linux and MacOS likely work, but they are untested. These will receive support later down the road.

The API is currently unstable and will definitely have breaking revisions in the future.

To build on Linux, you must install the libobs-dev package, as well as the bindgen dependencies.

sudo apt-get libobs-dev llvm-dev libclang-dev clang

Prerequisites

Make sure that the OBS binaries are in your target directory. There's even a tool to help you build OBS from source!
Install the tool

cargo install cargo-obs-build

Note

There is now a new bootstrapper that can download and install OBS binaries at runtime, which is useful for distributing applications without requiring users to install OBS separately. See the OBS Bootstrapper section for more details.

Add the following to your Cargo.toml

[package.metadata]
# The libobs version to use (can either be a specific version or "latest")
libobs-version="31.0.3"
# The directory in which to store the OBS build (optional)
# libobs-cache-dir="../obs-build"

Install OBS in your target directory. This uses the original signed OBS binaries.

# for debugging
cargo obs-build target/debug
# for release
cargo obs-build target/release
# for testing
cargo obs-build target/(debug|release)/deps

Quick Start

Below is an example that will record video-only footage of an exclusive fullscreen application. Note that the API is extremely limited right now, but you can already record both video and audio with full control over the output already. If you need more, libobs is exposed.

Examples are located in the examples directory. Documentation is also available for libobs-sources or libobs-wrapper.

About

Video encoding and muxing through libobs in Rust

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •