You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Dominik Nakamura 222329dedb
Bump up version number to 0.9.1
2 years ago
.github Slightly adjust CI step names 3 years ago
examples Revert changes on the simple example 3 years ago
src Fix deserializing of `TextGdiPlusProperties` and `TextFreetype2Properties` 2 years ago
tests Switch from chrono to time crate 2 years ago
.editorconfig Check all feature combinations in the CI 3 years ago
.gitignore Upload coverage to GitHub Pages instead of codecov 3 years ago
CHANGELOG.md Bump up version number to 0.9.1 2 years ago
Cargo.toml Bump up version number to 0.9.1 2 years ago
Justfile Use latest Justfile from the v5-api branch 2 years ago
LICENSE Initial commit 3 years ago
README.md Bump up version number to 0.9.1 2 years ago
deny.toml Adjust cargo-deny for when run with all-features 3 years ago
release.toml Update cargo-release config 2 years ago
rustfmt.toml Configure rustfmt for consistent use formatting 3 years ago

README.md

OBWS - The obws (obvious) remote control library for OBS

Build Status Repository Documentation Code Coverage

Remote control OBS with the obs-websocket plugin from Rust 🦀.

V5 support

The upcoming obs-websocket v5 is already being worked on and most features are supported. Check out the v5-api branch for more information on how to use it.

A new version will be released shortly after the relese of obs-websocket. Currently waiting on missing docs and eventual breaking changes before the release.

Usage

Add obws to your project with cargo add obws (needs cargo-edit) or add it manually to your Cargo.toml:

[dependencies]
obws = "0.9.1"

In addition, you will need to use the latest tokio runtime to use this library as it makes heavy use of async/await and is bound to this runtime.

Example

Here we connect to a OBS instance, get some version information and log in to access the whole API and lastly print out a list of available scenes.

For more usage instructions see the docs or check out the examples.

use anyhow::Result;
use obws::Client;

#[tokio::main]
async fn main() -> Result<()> {
    /// Connect to the OBS instance through obs-websocket.
    let client = Client::connect("localhost", 4444).await?;

    /// Get and print out version information of OBS and obs-websocket.
    let version = client.general().get_version().await?;
    println!("{:#?}", version);

    /// Optionally log-in (if enabled in obs-websocket) to allow other APIs and receive events.
    client.login(Some("password")).await?;

    /// Get a list of available scenes and print them out.
    let scene_list = client.scenes().get_scene_list().await?;
    println!("{:#?}", scene_list);

    Ok(())
}

License

This project is licensed under MIT License (or http://opensource.org/licenses/MIT).