# OBS Studio Rust (obs-rust) > obs-studio-rust is an independent, hybrid Rust/C/C++ rewrite of OBS Studio that keeps the libobs C ABI, the obs-websocket v5 protocol and the plugin/scripting APIs compatible. It ships stable and beta builds for Windows, macOS and Linux, and a local MCP server for agents. Source: https://github.com/obs-rust/obs-studio. Core context bundle, generated 2026-11-23 from obs-studio@524486a44. Everything else: https://obs-rust.com/llms.txt (index) and https://obs-rust.com/llms-full.txt (all docs). ## Download Releases: stable obs-studio-rust-v1.0.0; beta obs-studio-rust-v1.0.1-beta.20261122. Install the stable release unless you need a fix that is only in the beta. Every file with its SHA-256: https://obs-rust.com/ai/docs/site-download.md Stable (obs-studio-rust-v1.0.0, https://github.com/obs-rust/obs-studio/releases/tag/obs-studio-rust-v1.0.0): OBS-Studio-Rust-1.0.0-linux-x86_64.AppImage, OBS-Studio-Rust-1.0.0-linux-x86_64.AppImage.zsync, OBS-Studio-Rust-1.0.0-linux-x86_64.flatpak, OBS-Studio-Rust-1.0.0-macos-arm64.dmg, OBS-Studio-Rust-1.0.0-macos-x86_64.dmg, OBS-Studio-Rust-1.0.0-ubuntu-26.04-x86_64.deb, OBS-Studio-Rust-1.0.0-windows-arm64.zip, OBS-Studio-Rust-1.0.0-windows-x64.zip Beta (obs-studio-rust-v1.0.1-beta.20261122, https://github.com/obs-rust/obs-studio/releases/tag/obs-studio-rust-v1.0.1-beta.20261122): OBS-Studio-Rust-1.0.1-beta.20261122-linux-x86_64.AppImage, OBS-Studio-Rust-1.0.1-beta.20261122-linux-x86_64.AppImage.zsync, OBS-Studio-Rust-1.0.1-beta.20261122-linux-x86_64.flatpak, OBS-Studio-Rust-1.0.1-beta.20261122-macos-arm64.dmg, OBS-Studio-Rust-1.0.1-beta.20261122-macos-x86_64.dmg, OBS-Studio-Rust-1.0.1-beta.20261122-ubuntu-26.04-x86_64.deb, OBS-Studio-Rust-1.0.1-beta.20261122-windows-arm64.msi, OBS-Studio-Rust-1.0.1-beta.20261122-windows-arm64.zip, OBS-Studio-Rust-1.0.1-beta.20261122-windows-x64.msi, OBS-Studio-Rust-1.0.1-beta.20261122-windows-x64.zip # Download OBS Studio Rust Two channels. **Stable** is recommended; **Beta** is the newest build from master. Verify a download with `sha256sum ` (Linux), `shasum -a 256 ` (macOS) or `Get-FileHash ` (Windows PowerShell); it must equal the SHA-256 listed. ## Stable: OBS-Studio-Rust v1.0.0 Tag `obs-studio-rust-v1.0.0`, published 2026-11-01. Recommended. The newest release that is not a prerelease. Release page: https://github.com/obs-rust/obs-studio/releases/tag/obs-studio-rust-v1.0.0 ### Windows (x64 · arm64) | Package | File | Size | SHA-256 | |---|---|---|---| | Portable · x64 | [OBS-Studio-Rust-1.0.0-windows-x64.zip](https://github.com/obs-rust/obs-studio/releases/download/obs-studio-rust-v1.0.0/OBS-Studio-Rust-1.0.0-windows-x64.zip) | 223 MB | `e07b77781519ae1c9cdcadb7444c13d26cc8fd04d4a3c18531808b24d52534c2` | | Portable · arm64 | [OBS-Studio-Rust-1.0.0-windows-arm64.zip](https://github.com/obs-rust/obs-studio/releases/download/obs-studio-rust-v1.0.0/OBS-Studio-Rust-1.0.0-windows-arm64.zip) | 200 MB | `3f54613f0462f8fbcd4bf33d68b7c54dee4453565dd484ff9ea1ba88121676cc` | ### macOS (Apple silicon · Intel) | Package | File | Size | SHA-256 | |---|---|---|---| | Apple silicon | [OBS-Studio-Rust-1.0.0-macos-arm64.dmg](https://github.com/obs-rust/obs-studio/releases/download/obs-studio-rust-v1.0.0/OBS-Studio-Rust-1.0.0-macos-arm64.dmg) | 229 MB | `ce528d7066c0c43e665d16cde5d67e7a3ae9f233add4e4d631e43b32f51173f6` | | Intel | [OBS-Studio-Rust-1.0.0-macos-x86_64.dmg](https://github.com/obs-rust/obs-studio/releases/download/obs-studio-rust-v1.0.0/OBS-Studio-Rust-1.0.0-macos-x86_64.dmg) | 245 MB | `6c7803016fe157d56ac5e84685b1a77572104f47fadbdbd3a92be34881328e7b` | ### Linux (x86_64) | Package | File | Size | SHA-256 | |---|---|---|---| | AppImage · any distro | [OBS-Studio-Rust-1.0.0-linux-x86_64.AppImage](https://github.com/obs-rust/obs-studio/releases/download/obs-studio-rust-v1.0.0/OBS-Studio-Rust-1.0.0-linux-x86_64.AppImage) | 107 MB | `ad525f5e6a4317971894caef01988c59b5e8978614fe200f80a0aebeb55173bf` | | .deb · Ubuntu 26.04 | [OBS-Studio-Rust-1.0.0-ubuntu-26.04-x86_64.deb](https://github.com/obs-rust/obs-studio/releases/download/obs-studio-rust-v1.0.0/OBS-Studio-Rust-1.0.0-ubuntu-26.04-x86_64.deb) | 181 MB | `38e8689cc1c4ed00c6750568966523e21feca79669f32a00092423712da1f5a3` | | Flatpak bundle | [OBS-Studio-Rust-1.0.0-linux-x86_64.flatpak](https://github.com/obs-rust/obs-studio/releases/download/obs-studio-rust-v1.0.0/OBS-Studio-Rust-1.0.0-linux-x86_64.flatpak) | 179 MB | `b63987244fd28a1a09cdbe3df93d4a3fa41cc8e35df2eab85f84e676865781d5` | ## Beta: OBS-Studio-Rust v1.0.1-beta.20261122 Tag `obs-studio-rust-v1.0.1-beta.20261122`, published 2026-11-22. Newest build from master: the latest fixes, less testing. Release page: https://github.com/obs-rust/obs-studio/releases/tag/obs-studio-rust-v1.0.1-beta.20261122 ### Windows (x64 · arm64) | Package | File | Size | SHA-256 | |---|---|---|---| | Installer · x64 | [OBS-Studio-Rust-1.0.1-beta.20261122-windows-x64.msi](https://github.com/obs-rust/obs-studio/releases/download/obs-studio-rust-v1.0.1-beta.20261122/OBS-Studio-Rust-1.0.1-beta.20261122-windows-x64.msi) | 191 MB | `506681504cf429effd71134c120f09697d9fe70e83fcf90023a4f84bfcc1d686` | | Installer · arm64 | [OBS-Studio-Rust-1.0.1-beta.20261122-windows-arm64.msi](https://github.com/obs-rust/obs-studio/releases/download/obs-studio-rust-v1.0.1-beta.20261122/OBS-Studio-Rust-1.0.1-beta.20261122-windows-arm64.msi) | 165 MB | `beae8ca6fe42ff8754d15d24b41ab5be5193fd7a727b4df3edd8f95b2c8d883e` | | Portable · x64 | [OBS-Studio-Rust-1.0.1-beta.20261122-windows-x64.zip](https://github.com/obs-rust/obs-studio/releases/download/obs-studio-rust-v1.0.1-beta.20261122/OBS-Studio-Rust-1.0.1-beta.20261122-windows-x64.zip) | 224 MB | `39abb5a9ff091cbe625abe1e22e9eff1a9f6659fa657faa31f433394a239d059` | | Portable · arm64 | [OBS-Studio-Rust-1.0.1-beta.20261122-windows-arm64.zip](https://github.com/obs-rust/obs-studio/releases/download/obs-studio-rust-v1.0.1-beta.20261122/OBS-Studio-Rust-1.0.1-beta.20261122-windows-arm64.zip) | 201 MB | `eaab8ecb8e949c12b3592cd99b01ff2f917a2b5d43cadc6d409f0828df7f4469` | ### macOS (Apple silicon · Intel) | Package | File | Size | SHA-256 | |---|---|---|---| | Apple silicon | [OBS-Studio-Rust-1.0.1-beta.20261122-macos-arm64.dmg](https://github.com/obs-rust/obs-studio/releases/download/obs-studio-rust-v1.0.1-beta.20261122/OBS-Studio-Rust-1.0.1-beta.20261122-macos-arm64.dmg) | 229 MB | `5cf9305efa85e99aa1fc5f61686a23e445bcd4eac7e63efa27b1a5c304105535` | | Intel | [OBS-Studio-Rust-1.0.1-beta.20261122-macos-x86_64.dmg](https://github.com/obs-rust/obs-studio/releases/download/obs-studio-rust-v1.0.1-beta.20261122/OBS-Studio-Rust-1.0.1-beta.20261122-macos-x86_64.dmg) | 245 MB | `01594a3db648e4b2ffd9eb610f2f8e1ac3eab39c9edf70408519ef2d075a3e8a` | ### Linux (x86_64) | Package | File | Size | SHA-256 | |---|---|---|---| | AppImage · any distro | [OBS-Studio-Rust-1.0.1-beta.20261122-linux-x86_64.AppImage](https://github.com/obs-rust/obs-studio/releases/download/obs-studio-rust-v1.0.1-beta.20261122/OBS-Studio-Rust-1.0.1-beta.20261122-linux-x86_64.AppImage) | 107 MB | `8bb128c33b9cb5c5b815d9f0a7a9af7654ebcca91a1ef6b7eaa7791c10b8c373` | | .deb · Ubuntu 26.04 | [OBS-Studio-Rust-1.0.1-beta.20261122-ubuntu-26.04-x86_64.deb](https://github.com/obs-rust/obs-studio/releases/download/obs-studio-rust-v1.0.1-beta.20261122/OBS-Studio-Rust-1.0.1-beta.20261122-ubuntu-26.04-x86_64.deb) | 181 MB | `a00365581d4ec3935dcda7d7e9d2781e177230b82c011b8b769b257126012f61` | | Flatpak bundle | [OBS-Studio-Rust-1.0.1-beta.20261122-linux-x86_64.flatpak](https://github.com/obs-rust/obs-studio/releases/download/obs-studio-rust-v1.0.1-beta.20261122/OBS-Studio-Rust-1.0.1-beta.20261122-linux-x86_64.flatpak) | 179 MB | `4da1ad46bc4f7a67053a93706e56029e8f65f3d14839aac9773c591231ab2248` | ## Install notes (from the project README) OBS-Studio-Rust is a **beta**. Every package is attached to a release in [releases](https://github.com/obs-rust/obs-studio/releases), named `OBS-Studio-Rust---.`: take the newest `obs-studio-rust-v*` release and the file for your OS and CPU. Each release also ships a `SHA256SUMS` file. It installs and runs **beside** upstream OBS Studio. It has its own app identity and keeps its settings in an `obs-studio-rust` folder inside the usual per-user config directory, so neither program overwrites the other. On its first start it copies upstream OBS's settings, profiles, scenes and plug-in settings without changing the originals; later upstream changes are not imported again. Windows and macOS are a new app identity, so the OS may ask for capture permissions again. ### Linux (x86_64) - **AppImage** — any distribution: `chmod +x OBS-Studio-Rust-*-linux-x86_64.AppImage`, then run it. The AppImage is tested on AlmaLinux 8 (the glibc 2.28 floor), Ubuntu 22.04, Ubuntu 24.04, Arch Linux and NixOS. On NixOS, see the AppImage entry in the Q&A below. - **.deb** — Ubuntu 26.04: `sudo apt install ./OBS-Studio-Rust-*-ubuntu-26.04-x86_64.deb`. It installs the GUI as `obs-studio-rust-gui`; `obs-studio-rust` is the obs-websocket command-line client. It keeps its settings in `~/.config/obs-studio-rust`. - **Flatpak bundle**: `flatpak install --user ./OBS-Studio-Rust-*-linux-x86_64.flatpak`, then `flatpak run io.github.obs_rust.OBSStudioRust`. It gets the Freedesktop runtime from Flathub and does not update itself yet: install the next release's bundle the same way. It is not on Flathub (`com.obsproject.Studio` there is upstream OBS Studio), so it installs as `io.github.obs_rust.OBSStudioRust`, beside upstream's rather than over it. Its settings are in `~/.var/app/io.github.obs_rust.OBSStudioRust/config/obs-studio`, and its plug-ins go in `~/.var/app/io.github.obs_rust.OBSStudioRust/data/obs-studio/plugins/`. To bring your scenes over from upstream's Flatpak, copy `~/.var/app/com.obsproject.Studio/config/obs-studio` to that config folder. ### macOS (arm64, x86_64) Open the `.dmg` for your CPU (`macos-arm64` on Apple silicon, `macos-x86_64` on Intel), copy `OBS-Studio-Rust.app` to Applications, and start it. Packages are signed and notarized when the project's release credentials are configured. For an unnotarized download, try opening the app once, then allow it in **System Settings → Privacy & Security → Open Anyway**; for a download you trust, the Terminal alternative is `xattr -dr com.apple.quarantine /Applications/OBS-Studio-Rust.app`, which removes quarantine from that app only (see [Apple's guidance](https://support.apple.com/102445)). Its settings are in `~/Library/Application Support/obs-studio-rust`. ### Windows (x64, arm64) **Installer (BETA):** run `OBS-Studio-Rust--windows-x64.msi` (or `-arm64.msi`). It lets you pick the install folder, adds an **OBS-Studio-Rust BETA** Start menu entry, and is removed from **Settings > Apps** (Add/Remove Programs); uninstalling leaves your settings in place. **Portable:** unpack the `.zip` for your CPU, then start `bin\64bit\obs64.exe` from the unpacked folder. SmartScreen warns on the first start: choose **More info**, then **Run anyway** if you trust the download. The `-symbols.zip` files are only for decoding crash dumps. Its settings are in `%APPDATA%\obs-studio-rust`. # Control OBS Studio Rust from code: WebSocket or MCP OBS Studio Rust can be driven two ways: obs-websocket from any machine that can reach OBS, or the MCP server on the OBS machine itself (Linux). ## Choose | You are writing | Use | Why | |---|---|---| | A tool, bot, overlay, Stream Deck action or any existing obs-websocket client | **obs-websocket v5** | The standard OBS remote-control protocol: 147 requests, 60 events, 7 enums. Existing clients work unchanged. | | An AI agent that should operate OBS through typed tools | **MCP server** | 30 typed tools with JSON Schema arguments and results; 13 are read-only. Errors are typed (`ToolError`) and `wait_for` blocks on a condition instead of polling. | ## obs-websocket v5 - Connect to `ws://:4455`: the OBS machine itself or any host that can reach it (the port is set in Tools → WebSocket Server Settings). A WebSocket client may run remotely. - Handshake: the server sends `Hello` (op 0); you reply `Identify` (op 1) with `rpcVersion: 1` and, if a password is set, `authentication = base64(sha256(base64(sha256(password + salt)) + challenge))`; the server answers `Identified` (op 2). Then send `Request` (op 6) messages and read `RequestResponse` (op 7). - First request: `{"op":6,"d":{"requestType":"GetVersion","requestId":"1"}}`. - Full reference: https://obs-rust.com/websocket/ (browsable, with a live console), https://obs-rust.com/websocket/protocol.json (machine-readable spec), https://obs-rust.com/ai/docs/obs-websocket-reference.md (markdown, one section per request). - Client libraries and runnable snippets: https://obs-rust.com/ai/docs/site-examples.md. ## MCP server - Linux only for now: the server is built from an obs-studio checkout and runs on Linux. It is local: it runs on the OBS machine, next to the agent. - The server speaks JSON-RPC over stdio (MCP protocol 2025-06-18). Client config, requirements and example sessions: https://obs-rust.com/mcp/index.md. - Tool list without starting the server: https://obs-rust.com/mcp/schema.json (tools/list + resources/list + ToolError). - A read-only allowlist for cautious clients: https://obs-rust.com/mcp/read-only-allowlist.json. # Examples: drive OBS Studio Rust from code Generated from https://obs-rust.com/examples/. Every snippet targets obs-websocket v5 on `ws://localhost:4455` unless it says MCP. ## Examples Working starting points for everything that talks to OBS: WebSocket clients, agents over MCP, scripts and native plugins. ### Hello, OBS **Rust** Install: `cargo add obws tokio --features tokio/full` ```rust use obws::Client; #[tokio::main] async fn main() -> obws::error::Result<()> { let client = Client::connect("127.0.0.1", 4455, Some("password")).await?; let v = client.general().version().await?; println!("OBS {} · websocket {}", v.obs_version, v.obs_web_socket_version); for scene in client.scenes().list().await?.scenes { println!("scene: {}", scene.id.name); } Ok(()) } ``` **Python** Install: `uv add obsws-python` ```python import obsws_python as obs cl = obs.ReqClient(host="127.0.0.1", port=4455, password="password", timeout=3) v = cl.get_version() print(f"OBS {v.obs_version} · websocket {v.obs_web_socket_version}") for scene in cl.get_scene_list().scenes: print("scene:", scene["sceneName"]) cl.set_current_program_scene("BRB") ``` **JavaScript** Install: `npm i obs-websocket-js` ```js import OBSWebSocket from 'obs-websocket-js'; const obs = new OBSWebSocket(); await obs.connect('ws://127.0.0.1:4455', 'password'); const { obsVersion, obsWebSocketVersion } = await obs.call('GetVersion'); console.log(`OBS ${obsVersion} · websocket ${obsWebSocketVersion}`); const { scenes } = await obs.call('GetSceneList'); scenes.forEach(s => console.log('scene:', s.sceneName)); await obs.call('SetCurrentProgramScene', { sceneName: 'BRB' }); ``` Connect, authenticate, read the version and switch scenes. Enable the server first under Tools → WebSocket Server Settings (default port 4455). Every request name and field is in the [API reference](https://obs-rust.com/websocket/), and you can try one live from that page before you write any code. ### Listen to events Events arrive as op 5 messages. Choose which categories you receive with the [EventSubscription](https://obs-rust.com/websocket/#EventSubscription) bitmask when you identify. **JavaScript** ```js obs.on('CurrentProgramSceneChanged', ({ sceneName }) => console.log('live:', sceneName)); obs.on('StreamStateChanged', ({ outputActive, outputState }) => console.log(outputState)); obs.on('InputMuteStateChanged', ({ inputName, inputMuted }) => console.log(`${inputName} ${inputMuted ? 'muted' : 'live'}`)); ``` **Python** ```python import obsws_python as obs ev = obs.EventClient(host="127.0.0.1", port=4455, password="password") def on_current_program_scene_changed(data): print("live:", data.scene_name) ev.callback.register(on_current_program_scene_changed) input("listening, press Enter to quit\n") ``` ### Raw handshake No client library needed. Here is the whole v5 protocol in about 25 lines: Hello (op 0), a SHA-256 challenge, Identify (op 1), Identified (op 2), and then requests (op 6) and responses (op 7). Install: `uv run --with websockets raw.py` ``` import asyncio, base64, hashlib, json, websockets def b64sha(s: str) -> str: return base64.b64encode(hashlib.sha256(s.encode()).digest()).decode() async def main(url="ws://127.0.0.1:4455", password="password"): async with websockets.connect(url) as ws: hello = json.loads(await ws.recv()) # op 0 ident = {"rpcVersion": 1} if auth := hello["d"].get("authentication"): secret = b64sha(password + auth["salt"]) ident["authentication"] = b64sha(secret + auth["challenge"]) await ws.send(json.dumps({"op": 1, "d": ident})) # Identify print(json.loads(await ws.recv())) # op 2 Identified await ws.send(json.dumps({"op": 6, "d": {"requestType": "GetStats", "requestId": "1"}})) while (msg := json.loads(await ws.recv()))["op"] != 7: pass # skip events print(json.dumps(msg["d"]["responseData"], indent=2)) asyncio.run(main()) ``` ### Batch requests op 8 sends several requests in one message, and OBS can run them on frame boundaries. `Sleep` with `sleepFrames` makes timed sequences: here, a cut to a scene, a wait of 60 frames, and a recording start. ``` { "op": 8, "d": { "requestId": "intro", "executionType": 1, // SerialFrame "requests": [ { "requestType": "SetCurrentProgramScene", "requestData": { "sceneName": "Intro" } }, { "requestType": "Sleep", "requestData": { "sleepFrames": 60 } }, { "requestType": "StartRecord" } ] } } ``` Execution types are in [RequestBatchExecutionType](https://obs-rust.com/websocket/#RequestBatchExecutionType). ### MCP for agents obs-studio-rust includes a Model Context Protocol server. An AI agent can list typed tools, start and stop outputs, inspect sources and wait for output, media or metric conditions, without screenshots or a GUI. It runs headless on Linux with Wayland or X11, and without either for control-only use. ``` # from an obs-studio checkout: build the libobs-enabled app, then talk JSON-RPC over stdio ./mcp --build printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | ./mcp --mcp # or serve on a unix socket and attach clients to it ./mcp --mcp-listen /run/user/1000/obs-control.sock ./mcp --mcp-attach /run/user/1000/obs-control.sock ``` The repo's `.mcp.json` already wires this up for Claude Code. Details: [mcp.md](https://github.com/obs-rust/obs-studio/blob/master/docs/rust-port/mcp.md) and [control-api.md](https://github.com/obs-rust/obs-studio/blob/master/docs/rust-port/control-api.md) (tools, schemas, metrics). ### OBS scripts Python and Lua scripts load from Tools → Scripts. The scripting API is unchanged, so existing scripts keep working. ``` import obspython as obs def script_description(): return "Logs every scene change." def on_event(event): if event == obs.OBS_FRONTEND_EVENT_SCENE_CHANGED: scene = obs.obs_frontend_get_current_scene() print("scene:", obs.obs_source_get_name(scene)) obs.obs_source_release(scene) def script_load(settings): obs.obs_frontend_add_event_callback(on_event) ``` Reference: [scripting](https://obs-rust.com/ai/docs/docs-sphinx-scripting.md) and [frontend API](https://obs-rust.com/ai/docs/docs-sphinx-reference-frontend-api.md). ### Native plugins The libobs C ABI is a compatibility contract. Plugins already compiled for OBS load in obs-studio-rust without a rebuild, and new plugins are written the same way. - [Plugin template](https://github.com/obs-rust/obs-plugintemplate): CMake skeleton with CI for Windows, macOS and Linux. - [Plugin guide](https://obs-rust.com/ai/docs/docs-sphinx-plugins.md): Sources, outputs, encoders and services: the module lifecycle and the registration structs. - [obs-avip](https://github.com/obs-rust/obs-avip): An NDI® source and output written in Rust, a drop-in for DistroAV. Use it as a reference plugin in Rust. ### Client libraries Any obs-websocket v5 client library should work. A few well-maintained ones: | Language | Library | Install | |---|---|---| | Rust | [obws](https://github.com/dnaka91/obws) | `cargo add obws` | | JavaScript / TS | [obs-websocket-js](https://github.com/obs-websocket-community-projects/obs-websocket-js) | `npm i obs-websocket-js` | | Python | [obsws-python](https://github.com/aatikturk/obsws-python) | `uv add obsws-python` | | Python (async) | [simpleobsws](https://github.com/IRLToolkit/simpleobsws) | `uv add simpleobsws` | | Go | [goobs](https://github.com/andreykaipov/goobs) | `go get github.com/andreykaipov/goobs` | | C# / .NET | [obs-websocket-dotnet](https://github.com/BarRaider/obs-websocket-dotnet) | `dotnet add package obs-websocket-dotnet` | Upstream's full list is in the [obs-websocket README](https://github.com/obsproject/obs-websocket#language-apis).

Download OBS-Studio-Rust for Windows    Download OBS-Studio-Rust for macOS    Download OBS-Studio-Rust for Linux

# obs-studio-rust > [!IMPORTANT] > **We’re unifying OBS into one hybrid Rust/C/C++ build.** > Prioritize migrating code to Rust and retiring the C/C++ implementations it replaces. > Each completed port becomes part of the application, with compatibility and parity > checks supporting the transition. [![OBS Rust Discord Server](https://img.shields.io/badge/Discord-OBS%20Rust-5865F2?logo=discord&logoColor=white)](https://discord.gg/6MWWX4x9pf) [![Reddit: r/ObsRust](https://img.shields.io/badge/Reddit-r%2FObsRust-FF4500?logo=reddit&logoColor=white)](https://www.reddit.com/r/ObsRust/) [![Discussions: got an idea?](docs/images/discussions.svg)](https://github.com/obs-rust/obs-studio/discussions) [![Contributor leaderboard workflow status](https://github.com/obs-rust/obs-studio/actions/workflows/leaderboard.yml/badge.svg?branch=master)](https://github.com/obs-rust/obs-studio/actions/workflows/leaderboard.yml) [![Merge queue for master](docs/images/merge-queue.svg)](https://github.com/obs-rust/obs-studio/queue/master)

obs-rust logo

This is an independent rewrite of the obsproject's obs-studio. Same obs studio, but without the bugs. AI generated issues and PRs welcome. Got an idea? [Start a conversation](https://github.com/obs-rust/obs-studio/discussions). **Want to help port OBS to Rust?** Paste this into your AI agent: ```bash PROMPT="/loop 10m https://raw.githubusercontent.com/obs-rust/obs-studio/refs/heads/master/.claude/skills/obs-worker/SKILL.md" claude --dangerously-skip-permissions "$PROMPT" ``` Using another agent? Paste this instead: ```text You are a worker in obs-rust/obs-studio, the Rust rewrite of OBS Studio. Take exactly one issue from claim to an open pull request, then stop. 1. Clone https://github.com/obs-rust/obs-studio if you are not in it. Read AGENTS.md, then .claude/skills/obs-worker/SKILL.md, and follow it. It sends you to docs/rust-port/coordination.md and docs/rust-port/testing-policy.md: read both before you code. 2. Pick one open issue from label:ready (fall back to label:needs-investigation). Skip any with a recent "Claiming:" comment or an open PR that names it. Comment "Claiming: #N" with a short plan. 3. Branch from master. Commit a failing test first (RED), then the fix that makes it pass (GREEN). Run ./lint. One PR per issue. 4. Open the PR against master, describing RED and GREEN. 5. Do not merge, never push to master, and never commit secrets. Report the PR URL and stop. Maintainers queue PRs; you don't. Stuck? Ask in the Discord linked in the README, or in Discussions. ``` # Install OBS-Studio-Rust is a **beta**. Every package is attached to a release in [releases](https://github.com/obs-rust/obs-studio/releases), named `OBS-Studio-Rust---.`: take the newest `obs-studio-rust-v*` release and the file for your OS and CPU. Each release also ships a `SHA256SUMS` file. It installs and runs **beside** upstream OBS Studio. It has its own app identity and keeps its settings in an `obs-studio-rust` folder inside the usual per-user config directory, so neither program overwrites the other. On its first start it copies upstream OBS's settings, profiles, scenes and plug-in settings without changing the originals; later upstream changes are not imported again. Windows and macOS are a new app identity, so the OS may ask for capture permissions again. ## Linux (x86_64) - **AppImage** — any distribution: `chmod +x OBS-Studio-Rust-*-linux-x86_64.AppImage`, then run it. The AppImage is tested on AlmaLinux 8 (the glibc 2.28 floor), Ubuntu 22.04, Ubuntu 24.04, Arch Linux and NixOS. On NixOS, see the AppImage entry in the Q&A below. - **.deb** — Ubuntu 26.04: `sudo apt install ./OBS-Studio-Rust-*-ubuntu-26.04-x86_64.deb`. It installs the GUI as `obs-studio-rust-gui`; `obs-studio-rust` is the obs-websocket command-line client. It keeps its settings in `~/.config/obs-studio-rust`. - **Flatpak bundle**: `flatpak install --user ./OBS-Studio-Rust-*-linux-x86_64.flatpak`, then `flatpak run io.github.obs_rust.OBSStudioRust`. It gets the Freedesktop runtime from Flathub and does not update itself yet: install the next release's bundle the same way. It is not on Flathub (`com.obsproject.Studio` there is upstream OBS Studio), so it installs as `io.github.obs_rust.OBSStudioRust`, beside upstream's rather than over it. Its settings are in `~/.var/app/io.github.obs_rust.OBSStudioRust/config/obs-studio`, and its plug-ins go in `~/.var/app/io.github.obs_rust.OBSStudioRust/data/obs-studio/plugins/`. To bring your scenes over from upstream's Flatpak, copy `~/.var/app/com.obsproject.Studio/config/obs-studio` to that config folder. ## macOS (arm64, x86_64) Open the `.dmg` for your CPU (`macos-arm64` on Apple silicon, `macos-x86_64` on Intel), copy `OBS-Studio-Rust.app` to Applications, and start it. Packages are signed and notarized when the project's release credentials are configured. For an unnotarized download, try opening the app once, then allow it in **System Settings → Privacy & Security → Open Anyway**; for a download you trust, the Terminal alternative is `xattr -dr com.apple.quarantine /Applications/OBS-Studio-Rust.app`, which removes quarantine from that app only (see [Apple's guidance](https://support.apple.com/102445)). Its settings are in `~/Library/Application Support/obs-studio-rust`. ## Windows (x64, arm64) **Installer (BETA):** run `OBS-Studio-Rust--windows-x64.msi` (or `-arm64.msi`). It lets you pick the install folder, adds an **OBS-Studio-Rust BETA** Start menu entry, and is removed from **Settings > Apps** (Add/Remove Programs); uninstalling leaves your settings in place. **Portable:** unpack the `.zip` for your CPU, then start `bin\64bit\obs64.exe` from the unpacked folder. SmartScreen warns on the first start: choose **More info**, then **Run anyway** if you trust the download. The `-symbols.zip` files are only for decoding crash dumps. Its settings are in `%APPDATA%\obs-studio-rust`. # Conversion progress How much of **libobs** is Rust — the part that has to be ported. The rest of the app can stay C++ in the hybrid build. Measured by [tools/conversion/measure.py](tools/conversion/measure.py); click the card for the full breakdown. [![converted to Rust, with source data date](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fobs-rust%2Fobs-studio%2Fleaderboard%2Fconversion-badge.json)](https://obs-rust.github.io/obs-studio/conversion.html) [![Conversion tracker refresh](https://github.com/obs-rust/obs-studio/actions/workflows/leaderboard.yml/badge.svg?branch=master)](https://github.com/obs-rust/obs-studio/actions/workflows/leaderboard.yml) The badge date identifies the measured source revision. If it stops advancing, check the refresh status beside it. [![libobs port progress, click for the full breakdown](https://raw.githubusercontent.com/obs-rust/obs-studio/leaderboard/conversion-minimal.jpg)](https://obs-rust.github.io/obs-studio/conversion.html) > [!TIP] > **Come talk to us on [Discord](https://discord.gg/6MWWX4x9pf).** We're a > new project, and the people building it are there. Ask a question, tell us > what works or breaks on your setup (AppImage, .deb, Flatpak, your plug-ins and > capture devices), suggest an idea, or follow the port as it lands. No > question is too small. # Features What OBS-Studio-Rust does differently from upstream OBS Studio, for a user: new features, changed behavior and fixed upstream bugs, by area, with links to the issues and pull requests. See the [features ledger](docs/features.md). # Fixing bugs with AI + Rust Want to fix one yourself? Contributors, human or AI-assisted, chat about ports and pull requests on [Discord](https://discord.gg/6MWWX4x9pf). https://github.com/user-attachments/assets/4d9af616-bd76-468e-93ac-ef8ef44a0efb # Launch speed 4.3× faster to the main window and 19% less memory on an NVIDIA streaming rig (#1168, #1170, #1171, #1172).

OBS-Rust launch speed: 4.09 s to 0.95 s, 307 to 250 MiB

# What users say Word for word, from comments on our issues and pull requests by people who are not maintainers or contributors here. Each one links to its comment. `tools/user_quotes.py` gathers them and a reviewer approves each one. > “Tested obs-rust 0.1.0-beta.20261018 (Linux AppImage, Fedora/Bazzite, kernel 7.2.9) with a fresh config and a copy of my scene collection with the truncated values put back: Elgato 4K X "framerate": 60 (NV12 2560x1440) and Logitech BRIO "framerate": 30 (MJPG 3840x2160). - The log shows Framerate: 60.00 fps for the 4K X, and v4l2-ctl --get-parm reports 60/1 (stock OBS ran it at 144). The BRIO shows 30.00 / 30/1. - Toggling Use Buffering on the 4K X did not restart the capture. - After saving, the collection holds "framerate": 4294967356 for the 4K X and 4294967326 for the BRIO. All three behaviors confirmed. Thanks for the fix!” > > — [jrsallee](https://github.com/jrsallee), [#1117](https://github.com/obs-rust/obs-studio/issues/1117#issuecomment-6250423489), 2026-10-18 > “@rdoupe Yep, it works with this fork.” > > — [Blayung](https://github.com/Blayung), [#349](https://github.com/obs-rust/obs-studio/issues/349#issuecomment-6233729979), 2026-10-17 > “It works! In both ways - channels are correct and the meter is synced. No worries! I appreciate your time and attention. Well done!” > > — [Ezriilc](https://github.com/Ezriilc), [#251](https://github.com/obs-rust/obs-studio/issues/251#issuecomment-6133348602), 2026-10-12 > “Can confirm that it does sanitise the filename correctly for recordings and replay buffer saves.” > > — [pricklythorn](https://github.com/pricklythorn), [#199](https://github.com/obs-rust/obs-studio/issues/199#issuecomment-6106432357), 2026-10-11 # Contributors leaderboard The top five, ranked by merged PRs only, credited to the original author even when a maintainer re-landed the work (counted once). Updated every 4 hours. [![obs-rust contributors leaderboard](https://raw.githubusercontent.com/obs-rust/obs-studio/leaderboard/leaderboard.jpg)](https://obs-rust.github.io/obs-studio/) [See all contributors](https://obs-rust.github.io/obs-studio/#all) # How CI works here Lots of people and AI agents work on this repo at the same time, so CI is built to do as little repeated work as possible: - **Every pull request gets an admission check.** A same-repository PR can use client evidence when both its author and the valid signer of final HEAD are verified active obs-rust members. Complete selected evidence lets Pull allocate just Event Data, CI Mode and CI Gate for compile/test admission. Forks, non-members, unsigned heads, unavailable membership lookups and missing or invalid evidence run the real selected checks, including six-target lint. - **The merge queue is the heavy gate.** It reruns all selected tests, native builds and links on the combined merge result, regardless of client trailers. Required check names stay unchanged; unavailable runners still block admission. - **The full build runs before each release.** Nightly and release CI builds and tests every platform, the full app, Flatpak and release packages. - **Local tooling is optional.** `./push` tries prooft first: complete lint, clippy and Dylint for Linux x64/arm64, Windows x64/arm64 MSVC and macOS x64/arm64, host tests, self-tests and validators. Swift is an optional separate gate when selected. Trailers are self-reported passes, not signed execution evidence. Sign the final commit after stamping; missing tools or a failed private-membership lookup use real PR CI. Strict refusal is opt-in with `PUSH_REQUIRE_ATTESTATION=1`. Legacy Local-Gate records remain diagnostic. - **Builds are cached and shared.** Rust builds go through `soldr`, which reuses compiled code across branches and machines. The full guide, with the tools, rules and commands, is in [docs/ci-tooling.md](docs/ci-tooling.md). If you're contributing, please read it before you push: it explains how to avoid overloading the shared machines and CI. # Q&A **Where can I get help, or report something that isn't quite a bug?** Join us on [Discord](https://discord.gg/6MWWX4x9pf): it's the quickest way to reach the people working on OBS Rust. For a reproducible bug, please also [file an issue](https://github.com/obs-rust/obs-studio/issues/new/choose); for longer ideas, [start a discussion](https://github.com/obs-rust/obs-studio/discussions). **Does OBS Rust support all of the plug-ins?** Yes. OBS Rust is fully backwards compatible with OBS Studio — the plug-ins you already have should work as-is. If you find one that doesn't, that's a bug: please [file an issue](https://github.com/obs-rust/obs-studio/issues/new/choose) and link it here so we can track it. **How do I install it on Linux?** See [Install](#install) above: the AppImage, the `.deb` and the Flatpak bundle, and where each one keeps its settings. **How do I run the AppImage on NixOS?** The simplest way is `appimage-run` (`programs.appimage.enable = true;`, then `appimage-run ./OBS-Studio-Rust-*.AppImage`). It gives the AppImage the paths a regular distribution has, and OBS renders on your GPU and finds NVENC. Running the AppImage directly works through nix-ld. Your configuration needs `hardware.graphics.enable = true;`, `programs.nix-ld.enable = true;` and Wayland among nix-ld's libraries: ```nix programs.nix-ld.libraries = with pkgs; [ wayland ]; ``` Without Wayland there, the AppImage stops at start and says so. You don't need to add `/run/opengl-driver/lib` or the keyboard layouts: the AppImage finds the driver libraries (for NVENC) and `/etc/X11/xkb` itself. **How do I install plug-ins for the AppImage?** The AppImage loads plug-ins from the same per-user folders as OBS Studio on Linux, so a plug-in you already installed for your own account is picked up as-is. To add one, unpack its Linux build into either of these folders: - `~/.local/share/obs-studio/plugins//`, with the module at `/.so` and its files under `/data/` (the current layout). - `~/.config/obs-studio/plugins//`, with the module at `/bin/64bit/.so` and its files under `/data/` (the older layout that many plug-in downloads still use). Then restart OBS Rust. **Tools → Plugin Manager** lists what loaded. Plug-ins installed system-wide by a distribution package (under `/usr/lib/obs-plugins` or `/usr/lib//obs-plugins`) are **not** loaded. They were built against that distribution's OBS and libraries, not the ones inside the AppImage. Use the plug-in's own Linux download instead. A plug-in with its own Qt windows must be built for a Qt 6 release no newer than the one in the AppImage. If a plug-in sits in one of those folders but doesn't load, run the AppImage from a terminal and the log will say why. Then file an issue as above. Want to see the original README from OBS Project? [Click here](README.upstream.md). # 🏆 OBS Project User Abuse Hall of Fame Bugs they confirmed, then closed. Features you relied on, then removed. Twelve upstream threads where users showed up in numbers and were turned away anyway. Six of them were closed as stale on a single afternoon. | | Issue | 💬 | Fate | |:-:|---|--:|---| | 🥇 | [Preview Stutter that appears in Streams/Recordings](https://github.com/obsproject/obs-studio/issues/4191) | 184 | locked (off-topic) | | 🥈 | [OBS Virtual Camera may affect built-in webcams](https://github.com/obsproject/obs-studio/issues/3555) | 87 | closed not planned, locked | | 🥉 | [Removal of --disable-shutdown-check breaks automated background workflows](https://github.com/obsproject/obs-studio/issues/12650) | 64 | closed not planned, locked | | 4 | [Dock Sizes are Reset the next time you open OBS.](https://github.com/obsproject/obs-studio/issues/2949) | 34 | closed not planned | | 5 | [Pause and Resume Recording Doubles or Triples CPU usage](https://github.com/obsproject/obs-studio/issues/3148) | 34 | closed not planned | **In their own words:** > **“No amount of "I don't like your answer" will change it.”** > — [#9285](https://github.com/obsproject/obs-studio/issues/9285#issuecomment-1677822114), to a user who said a downgrade fixed their dropped frames > **“However, if you refuse to follow the process, there is nothing we can do, and this report is not actionable.”** > — [#13685](https://github.com/obsproject/obs-studio/issues/13685#issuecomment-5052743359), in the same comment that admitted 32.2 had raised the driver minimum > **“[…] that decision has already been made.”** > — [#12650](https://github.com/obsproject/obs-studio/issues/12650#issuecomment-3368592277), on removing a flag users' setups depended on **[See all 12, every quote, and why each one made the cut →](docs/hall-of-fame.md)** # Agent instructions This repository is governed by the [Constitution of the obs-rust Project](https://github.com/obs-rust/constitution/blob/main/CONSTITUTION.md), which supersedes every other document here, this one included. This repository is being converted from C/C++ to Rust while keeping the public API (libobs C API/ABI, obs-websocket v5 protocol, frontend and scripting APIs) compatible. ## OBS WebSocket compatibility directive Preserve the existing C++ OBS WebSocket plugin in `plugins/obs-websocket` as a compatibility check for Rust OBS. Do not port it to Rust or modify it to accommodate the Rust implementation. Existing compiled plugin binaries must load and work through the preserved libobs C API/ABI, and existing clients must continue to work through the obs-websocket v5 protocol. Fix compatibility failures in Rust OBS. This directive supersedes earlier plans to port OBS WebSocket, including `docs/rust-port/websocket-port.md`. Changing this policy requires an explicit user request. ## Worker role Minimize Rust test executables: use one amalgamated binary for each category in the testing policy's category map. Eight categories are currently selected; preserve all assertions and required test tiers, and add cases as modules in the category's existing binary. See the [test binary policy](docs/rust-port/testing-policy.md#test-binary-budget). When you take an issue to work on (claim, port, fix, test, or build, lint, push and open a PR), you are a worker: invoke the `obs-worker` skill ([.claude/skills/obs-worker/SKILL.md](.claude/skills/obs-worker/SKILL.md)). Agents without skills read that file by hand. It walks the documents below in order, from rebase to merge queue. When the maintainer runs you as a worker on a timer (`/loop 10m take on the role of a worker that is looking for issues ...`), also invoke the `obs-worker-loop` skill ([.claude/skills/obs-worker-loop/SKILL.md](.claude/skills/obs-worker-loop/SKILL.md)): each tick moves your own PRs, checks master's health, then picks the next most important issue. Unlike the coordinator, you claim and do the work. ## Coordinator role When the maintainer runs you on a timer (`/loop 30m act as coordinator`, also called concierge or steward) to keep work moving while they are away, you are the coordinator, not a worker: invoke the `obs-coordinator` skill ([.claude/skills/obs-coordinator/SKILL.md](.claude/skills/obs-coordinator/SKILL.md)). Each tick, put every green PR into the merge queue; rebase PRs that were ejected from the queue, stacked PRs and PRs about to go in; push fixups; review PRs; answer questions; and close stalled follow-ups. Never claim or port an issue yourself. Each tick starts from the computed work list of the org-wide `obs-org-coordinator` skill in [obs-rust/.github](https://github.com/obs-rust/.github/tree/master/.claude/skills) (`uv run -m workflow.coordinator`), which covers every obs-rust repo; `obs-org-worker` is its worker counterpart. Claims, Ready and the board: [WORKFLOW.md](https://github.com/obs-rust/.github/blob/master/WORKFLOW.md). ## Mandatory reading Before porting any code, writing any test, or touching `rust/`, `Cargo.toml`, or `test/`, read and follow [docs/rust-port/testing-policy.md](docs/rust-port/testing-policy.md) exactly. It defines the four required test tiers (Rust unit tests, unchanged C tests against the Rust implementation, differential tests against the original C, and black-box protocol tests) and the per-unit workflow. Before writing a test, touching CI or the sanitizers, or chasing a failure that only shows on one host, read [docs/knowledge/index.md](docs/knowledge/index.md): what earlier workers learned the hard way, one concept per file. Where a lesson is a check, the check is the rule. Before picking up or filing an issue, or opening a PR, read [docs/rust-port/coordination.md](docs/rust-port/coordination.md): claim before coding, search open PRs first, target master, RED then GREEN commits. A PR with a user-visible change adds its line to [docs/features.md](docs/features.md) (the features ledger). Before adding, renaming or building C/C++/Objective-C sources, or touching `cmake/common/`, `cmake/pch/` or a `build/` group, read [BUILD.md](BUILD.md). Before building, testing or pushing, read [docs/ci-tooling.md](docs/ci-tooling.md): soldr, setup-soldr, bosn, act2, zackees/ci.yml, the local gate and CI attestation, and how to use them so many agents don't overload the shared machines and CI runners. ## Merge gate: PR CI `CI Gate ✅` on `obs-rust/obs-studio` remains the required merge check. Trusted fully attested same-repository member PRs use base-owned verification admission; the merge queue always executes its selected heavy lanes. Forks, non-members, unverified final heads, trust-surface edits and missing/invalid proofs or verifier/API errors retain real selected PR checks. All six supported targets receive clippy and Dylint on the client or in real PR fallback. Open a PR (a draft is fine) as soon as the RED test exists; a red CI run on a PR is expected, not a process failure. Do not build fork or self-hosted CI to pre-validate PRs. What stays mandatory: RED then GREEN, differential and Tier 2 coverage, and no edits to C tests or public headers. For focused CI/configuration fixes, record local RED evidence and push the RED and GREEN commits together when ready; a remote RED run is not required. Documentation-only updates do not need RED → GREEN tests. See [coordination.md](docs/rust-port/coordination.md#4-pull-requests). `ci-pre.yml` remains the general pre-work entry point on PRs. Only its cache janitor job skips PR events; it sweeps on master pushes. The merge queue sweeps last instead: `ci.yml`'s final `cache-janitor` job runs after every other job and evicts least recently used caches down to `[cache].budget`, so GitHub's own eviction never picks (#1854, zackees/ci.yml#405 `GEN-022`). Neither sweep is in the required-gate dependency graph. See [the pre-work policy](docs/ci-tooling.md#pre-work-cache-maintenance-and-cancellation). ## Local gate (recommended, not required) Local tooling is optional for contributors. `./push` tries prooft's complete client lanes first, then deprecated partial legacy evidence, then an unattested push. Strict refusal remains opt-in (`PUSH_REQUIRE_ATTESTATION=1`). Self-reported trailers establish accountability, not signed proof of execution. Fast admission requires authenticated active obs-rust membership for both PR author and valid signer of the exact final HEAD; private lookup denial runs real CI. Stamp first, then sign the final amended commit. Trust decisions and pins come from immutable PR BASE; head code and policy never decide skips. See [the admission contract](docs/ci-tooling.md#ci-attestation-skipping-whats-already-proven). Push through `./push`, not a bare `git push`. Legacy Local-Gate trailers alone cannot grant full admission. Source or history changes require fresh evidence. Environment failures: [troubleshooting](docs/rust-port/troubleshooting.md). - `./lint` (8 s): clang-format 22.1.3 and gersemi 0.25.0 pinned via uvx, rustfmt, clippy, and the repo Dylints (`dylints/*`). `./lint --fix` rewrites files. - `./unittest`: Rust Tiers 1-3, then Tier 2 (cmocka against hybrid libobs and the explicit C reference, one build in Docker; ~30-40 s warm thanks to zccache). - For legacy local-gate diagnostics, commit, then run `uvx --from git+https://github.com/zackees/ci.yml@a1917ce76598904ce515cd7eec83450c317ea6f2 ci-lint local-gate run`. This legacy path remains available for diagnostics; use complete client gates for fast admission and sign only after stamping. - Fallback PR execution runs the lanes its changed paths select (the `LANES` table in `ci/ci_scope.py`: Fast Gate always, plus a Linux-hosted Windows MSVC link of every test binary (`ci/windows_link_check.py`) on every non-docs PR and queue run, Tier 2 for libobs/linked crates/`test/cmocka/`, Qt for `frontend/`, a Linux build of only the touched `plugins/`/`shared/` targets; macOS/Windows only for their own platform files). The full OBS app builds never run from a PR path. No label changes what runs. A master push adds every lane a PR defers (Tier 2, Qt, the workspace tests) and runs the macOS/Windows Rust tests and Tier 2 only for paths that select them; it builds no OBS app. Schedule, workflow_dispatch, tags, release branches and the release gate run everything, including the macOS, Windows, Ubuntu and Flatpak app builds (#436). ## Quick rules - Security bugs come in two tiers ([SECURITY.md](SECURITY.md), "Two tiers"). Low risk (only trusted local input reaches it) is a normal public bug. High risk (a remote party can reach it, or it leaks credentials) is never a public issue, PR or branch: report it as a private advisory. Unsure → private (see obs-worker §2). After triage, follow the `obs-security-disclosure` skill ([.claude/skills/obs-security-disclosure/SKILL.md](.claude/skills/obs-security-disclosure/SKILL.md)): upstream gets embargoed advisories only in the numbered encrypted archives tracked at , so never report one upstream yourself. - Use `soldr cargo ...`, never bare `cargo`. `.claude/settings.json` wires `ci/hooks/tool_guard.py`, a PreToolUse hook that denies bare Rust tools and bare python/pip (clud sessions get the same rule from clud; `.clud/settings.json` turns on its soldr shims). It denies, after parsing the command: bare `cargo`, `cargo-clippy`, `cargo-fmt`, `clippy-driver`, `rustc`, `rustdoc`, `rustfmt`, `rustup`, `rust-gdb`, `rust-lldb`, `rust-analyzer`, `python`, `python3`, `pip`, `pip3`, also behind `FOO=bar`, `env`, `exec`, `sudo`, `time` or `bash -c`; text inside quoted arguments and heredoc bodies is never matched. Codex has no repo hook: follow the rule by hand. `ci/test_tool_guard.py` (part of `./lint`) also fails on bare Rust tools in `ci/` and `rust/tools/` shell scripts. - GitHub GraphQL goes through `uv run --no-project --script ci/gh_graphql.py` (same `-f`/`-F`/`--jq` arguments as `gh api graphql`), which routes it through the [ghd](https://github.com/forge-ci/ghd) caching daemon so agents share one budget. `ci/hooks/tool_guard.py` denies a bare `gh api graphql`, even in clud sessions, and `ci/test_tool_guard.py` (part of `./lint`) fails one written into a script, skill or doc. - Run Python through `uv run` (or `uvx`), never bare `python`/`python3`; standalone scripts use `#!/usr/bin/env -S uv run --script`. `ci/test_uv_run.py` (part of `./lint`) enforces it; see the testing policy's "Python runs through uv" rule. - **Bump `rust/libobs-rust/Cargo.toml` in the follow-up PR to every stable release.** Nightlies are `-beta.` and stables are ``, so a nightly only sorts *above* the stable it descends from while the crate is ahead of that stable. The release `check` job enforces it (`ci/check_release_version.py` refuses a version that does not sort after the newest stable), but the fix is always the same: bump the crate, e.g. to `1.0.1` after shipping `1.0.0`. - Pin `rust-toolchain.toml` to the latest Rust the CI soldr version supports natively, never beyond; bump it only after a soldr bump (see the testing policy). - Never edit existing C tests or public C headers to make a port pass. - Name crates, binaries and tags per [docs/rust-port/naming.md](docs/rust-port/naming.md) (`ci/test_naming.py` checks crates): `obs-` ports, product slug `obs-studio-rust`. - Don't move upstream C/C++ files to restructure: the upstream tree stays in place, Rust goes in the `rust/` workspace, and a fully ported C component is deleted, not moved. The one allowed copy of its C is the differential-test oracle under `rust/obs-c-oracle/legacy/` that the testing policy requires (Tier 3). See the layout section of [docs/rust-port/naming.md](docs/rust-port/naming.md) (#1051). The one rename allowed is in place, to the build-role names of [BUILD.md](BUILD.md) (`foo.c` to `foo.c.h`). - Native C/C++/Objective-C builds follow [BUILD.md](BUILD.md): explicit unity groups in each component's `build/`, one precompiled header per group that is each implementation file's only include, unity and PCH always on (`ci/test_build_groups.py`). - C/C++ host code stays in OS-named files (`obs-nix.c`, `platform-windows.cpp`, `win-capture/`, ...). Upstream files keep their names; new host files use `hosts//` folders or `*-host-.c` files, `` one of `windows`, `macos`, `linux`, `posix` (#1009). `ci/platform_ifdef_ratchet.py` (in `./lint`) fails a new host conditional or OS header in a shared file, and a platform file that names another OS. Shared libobs core calls host code through one interface per capability in `libobs/obs-host/.h` (`OBS_HOST_EXTERN`); a host implements it in its OS file, or its host file (`obs-nix.c.h`, ...) includes `obs-host/noop/.hpp` for a capability it lacks. - Host-specific code (`#[cfg(windows|unix|target_os..)]`, `cfg!()`, `std::os::*`, `libc::`, Win32) goes only in the crate's `src/platform/` (single `cfg_select!` in `platform/mod.rs`) or `src/ffi/`. A pre-expansion Dylint (`dylints/ban_platform_cfg_outside_boundary`) fails `./lint` otherwise; see the testing policy's "Platform boundary" rule. - Start every task by fetching and rebasing onto `origin/master` (`git fetch origin && git rebase --autostash origin/master`), so you build, test and diff against current master. See [coordination.md](docs/rust-port/coordination.md). - Every port starts RED (failing test against stubs) and ends GREEN. - Do not add new GitHub Actions workflow files without explicit sign-off. - Packaging changes (`build-aux/appimage/`, the Flatpak manifest, anything that decides what ships in a release artifact) must be covered by a test that runs the packaged artifact the way a user does, including a saved profile with the sources users depend on (screen capture, camera, microphone), not only a first start with an empty profile. `build-aux/appimage/test-appimage.sh` is that test for the AppImage; extend it when a change adds something loaded at runtime, and show it failing without the change (obs-rust/obs-studio#426). Security scans and release validation run nightly, outside PR/merge-group CI. GitHub CodeQL default setup stays disabled. See the merge queue admission policy in docs/ci-tooling.md before enabling CI integrations. # MCP control server From the repository root, build the libobs-enabled application with: ```sh ./mcp --build ``` The command prints the executable path, `target-mcp/debug/obs-studio-rust`. It first builds the release `libobs-rust` archive, then builds the application with `bundled-native`, passing the archive automatically. This separate target directory prevents an ordinary featureless application build from overwriting the MCP application. Install soldr as described in [CI tooling](../ci-tooling.md). On NixOS the launcher automatically enters the declared `ci/mcp-shell.nix` environment. This requires nix-shell and an available nixpkgs channel. The shell provides the compiler, FFmpeg, X11 development metadata and other native SDKs; no X server is required. Other hosts must have the native libobs development dependencies installed. Nix may fetch dependencies on the first invocation. `OBS_MCP_TARGET_DIR` optionally selects another build directory. `.mcp.json` runs `./mcp --mcp`. The launcher builds incrementally before starting the server; build diagnostics go to stderr and protocol traffic stays on stdout. With no arguments `./mcp` also starts the stdio server. For example: ```sh printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | ./mcp --mcp ``` The same launcher accepts socket arguments: ```sh ./mcp --mcp-listen /run/user/1000/obs-control.sock ./mcp --mcp-attach /run/user/1000/obs-control.sock ``` Keep the listening process's stdin open. The socket uses mode 0600; its parent directory must already exist. Attach proxies newline-delimited JSON-RPC over stdio. See [the control API](control-api.md) for tools, schemas and metrics. GUI/device validation belongs in bosn containers; these headless examples do not open a GUI or require a camera device. Run bootstrap regressions with: ```sh uv run --no-project python -m unittest ci.test_mcp_build ``` The launcher also builds EGL/Wayland OpenGL, linux-v4l2 (including its Pulse/PipeWire virtual mic), obs-ffmpeg (media source and AAC), and obs-x264 through obs-build. It sets OBS_MCP_GRAPHICS_MODULE, OBS_MCP_MODULE_BIN, OBS_MCP_MODULE_DATA and OBS_MCP_DATA_PATH from target-mcp/runtime/manifest.json; explicit overrides are preserved. Graphics/plugins are installed atomically so rebuilding for an attach client does not overwrite a listener's mapped libraries. Video requires a reachable Wayland compositor or X server. For display-free CI, run against a headless Wayland compositor (for example Weston with its headless backend); the EGL renderer is built with Wayland support. A container also needs explicit v4l2loopback device access and an isolated PipeWire server for an A/V measurement. A successful tools/list response alone does not prove video or device readiness. Record and stream tools require their corresponding output/service modules to be configured. Closing stdin shuts down the server cleanly. Existing Tier 4 coverage remains in `obs-tests-app` (`mcp_stdio`, feature `bundled-native`). # Control API Extend obs-mcp; preserve existing tool names, successful text/image payloads, headless stdio and the unchanged C++ obs-websocket plugin. New tools use `domain_verb`: `vcam_start`, `vcam_stop`, `vcam_status`, `vmic_status`, `media_restart`, `media_status`, `stats_get`, `stats_reset`, `wait_for`, `pipeline_dump`. ## Contract TypedTool declares serde/schemars input/output structs, NAME and ANNOTATIONS. Inputs reject unknown fields and default optional fields. The Tool adapter publishes inputSchema/outputSchema and returns structuredContent alongside JSON text (and screenshot image content). The committed schema snapshot must match schemas generated from the registered types. Backend additions use request and response structs, never positional multi-argument methods. Malformed requests and typed arguments are JSON-RPC errors. Domain failures return isError and ToolError {code, category, message, retryable}, using obs-websocket v5 codes: 600 ResourceNotFound, 207 NotReady, 604 InvalidResourceState and 702 RequestProcessingFailed. Categories are independent of numeric ranges. Read operations have readOnlyHint; start/stop are idempotent. ## State and measurements `wait_for {condition, timeout_ms}` first checks, then waits within the deadline; it returns {satisfied, elapsed_ms, last_value}. Condition is a typed enum: OutputState {output,state}, SourceActive {name}, MediaState {name,state}, StatAtMost {metric,value}. Start accepts optional wait for bounded auto-wait. Media uses obs_source_media_*; vcam uses virtualcam_output and its private proc_handler. stats_get reports per-stage render/vcam/vmic {live, latency_min_ns, latency_max_ns, frames_total, frames_dropped, xruns}, render counters and {av_offset_ms, measured_from}. Unmeasured values remain unavailable; queue estimates never masquerade as end-to-end measurements. stats_reset defines a new counter baseline. pipeline_dump reports the current graph. ## Attachment A loadable in-app module serves the same newline-delimited JSON-RPC Server on $XDG_RUNTIME_DIR/obs-studio-rust/control.sock (0600). It uses the running OBS instance; headless stdio still owns its own instance. `--mcp-attach [socket]` proxies stdio to that socket. Socket ownership and cleanup follow module lifecycle. OS code stays in src/platform or src/ffi. Windows named pipes require a follow-up; unsupported attachment returns a clear error. ## Delivery Parent #4444 has ordered native sub-issues: #4445 typed tools/errors/schema, #4446 device/media/stats, #4447 waiting, #4448 socket/module/proxy, #4449 fluent Rust client and ci/vcam_av_sync.py MCP transport. Each slice targets master from a fresh infra/control-api-* branch with RED then GREEN shared MCP tests. The client reuses server types; Python retains websocket and adds --transport mcp plus fallback. Real GUI/device validation runs only in bosn containers. ## Attach to the application Build `soldr cargo build -p obs-mcp-module` and install the resulting `libobs_mcp_module.so` in OBS's normal module search path. The module binds `$XDG_RUNTIME_DIR/obs-studio-rust/control.sock` with mode 0600 in a private directory. It shares the app's libobs and stops its worker on frontend scripting shutdown, before scene cleanup (EXIT is a fallback). It never starts a second OBS instance or changes the application's global coordinate mode. `obs-studio-rust --mcp-attach [socket]` relays stdio to that instance. The same newline JSON-RPC Server handles both transports. At most 32 clients share the control thread; requests are serial, bounded to 16 MiB per buffered frame. `wait_for` blocks the control thread, while OBS render/audio threads continue. Windows named pipes are unsupported pending #4455. For headless CI use `obs-studio-rust --mcp-listen [socket]` (native build). Keep its stdin open for the test's lifetime; EOF stops the socket and libobs. The attached backend resolves frontend scenes and output names on each call, preserves coordinate settings, and queues scene changes through the graphics thread so the frontend's UI mutation path cannot block shutdown. ## Clients and the A/V probe ```rust,ignore let obs = obs_mcp::client::Client::attach(Default::default())?; obs.vcam().start(obs_mcp::tools::control::StartInput { wait: true, ..Default::default() })?; obs.wait_for(condition).timeout_ms(5000).call()?; ``` `uv run --script ci/vcam_av_sync.py measure --transport mcp --mcp-socket PATH` creates a uniquely named media probe in the program scene, waits for playback, starts independent ffmpeg v4l2/PulseAudio capture, restarts the clip and reports A/V offset, per-path latency and `stats_get`. `source_remove` cleans up the probe. `--transport auto` (default) falls back to MCP only when the websocket connection cannot be opened. `--transport websocket` preserves the original path. Auth and protocol failures are surfaced rather than retried with a second transport. Capture timing is relative to the media restart response wall clock; the server keeps end-to-end offset null until an independent capture probe measures it. Run actual device capture only inside bosn. No GUI interaction is required. # obs-studio-rust MCP server reference (generated) MCP server `obs-mcp` 0.1.0, protocol 2025-06-18. Platform: Linux only for now. Local only: stdio (`./mcp --mcp`) or a unix socket (`--mcp-listen` / `--mcp-attach`). Built from source with `./mcp --build` in an obs-studio checkout. Machine-readable: https://obs-rust.com/mcp/schema.json. Client config (Claude Code, Cursor, Claude Desktop): ```json {"mcpServers": {"obs": {"command": "/path/to/obs-studio/mcp", "args": ["--mcp"]}}} ``` ## See tools Read the state of OBS without changing anything. ### scenes_list List the names of all scenes, in order. Annotations: {"destructiveHint": false, "idempotentHint": true, "openWorldHint": false, "readOnlyHint": true} Returns: - `scenes` array (required): Scene names in display order. ### scene_get_current Get the name of the current program scene, or null if none. Annotations: {"destructiveHint": false, "idempotentHint": true, "openWorldHint": false, "readOnlyHint": true} Returns: - `name` string | null: Null when there is no program scene. ### sources_list List all sources with their names and kind ids. Annotations: {"destructiveHint": false, "idempotentHint": true, "openWorldHint": false, "readOnlyHint": true} Returns: - `sources` array (required): Sources in stable order. ### scene_items_list List the items of a scene (bottom to top) with their id, source name, visibility, position, scale and rotation. Annotations: {"destructiveHint": false, "idempotentHint": true, "openWorldHint": false, "readOnlyHint": true} Arguments: - `scene` string (required): Scene name. Returns: - `items` array (required): Items bottom to top. - `scene` string (required): Scene name. ### screenshot Capture a PNG screenshot of a source, or of the program output when no source is named. Returns the image plus a text item {width, height, source} (source is null for the program output). The PNG has an alpha channel (RGBA): pixels nothing was drawn on, such as an empty scene, are fully transparent, which a viewer may show as white. A source only appears in the program output once it is an item of the program scene. Annotations: {"destructiveHint": false, "idempotentHint": true, "openWorldHint": false, "readOnlyHint": true} Arguments: - `height` integer | null: Height in pixels. - `source` string | null: Source to capture; omit for program output. - `width` integer | null: Width in pixels. Returns: - `data` string (required): PNG bytes encoded in base64. - `height` integer (required): Height in pixels. - `source` string | null: Source name, or null for program output. - `width` integer (required): Width in pixels. ### pipeline_dump pipeline dump: control and inspect OBS directly. Annotations: {"destructiveHint": false, "idempotentHint": true, "openWorldHint": false, "readOnlyHint": true} Returns: - `program` string | null: Program source name. - `sources` array (required): Source names in stable order. - `stats` object (required): Current pipeline measurements. - `vcam` object (required): Virtual output state. ## Compose tools Build and change scenes, sources and their layout. ### scene_create Create a new empty scene with the given name. When there is no program scene yet, the new scene becomes the current program scene. Annotations: {"destructiveHint": true, "idempotentHint": false, "openWorldHint": true, "readOnlyHint": false} Arguments: - `name` string (required): Scene name. Returns: - `name` string | null: Null when there is no program scene. ### scene_remove Remove the scene with the given name. Annotations: {"destructiveHint": true, "idempotentHint": false, "openWorldHint": true, "readOnlyHint": false} Arguments: - `name` string (required): Scene name. Returns: - `name` string | null: Null when there is no program scene. ### scene_set_current Make the named scene the current program scene. Annotations: {"destructiveHint": true, "idempotentHint": true, "openWorldHint": true, "readOnlyHint": false} Arguments: - `name` string (required): Scene name. Returns: - `name` string | null: Null when there is no program scene. ### source_create Create a source of the given kind with a name and settings. Give `scene` (and optionally `position`) to also add it to that scene as an item. Annotations: {"destructiveHint": true, "idempotentHint": false, "openWorldHint": true, "readOnlyHint": false} Arguments: - `kind` string (required): Source kind id. - `name` string (required): Unique name. - `position` object | null: Initial position (requires scene). - `scene` string | null: Scene receiving the source. - `settings` object (required): Kind-specific settings. Returns: - `item` integer | null: Created item id. - `kind` string (required): Source kind. - `name` string (required): Source name. - `scene` string | null: Scene receiving the new item. ### source_remove Remove a source and its references from scenes. Annotations: {"destructiveHint": true, "idempotentHint": false, "openWorldHint": true, "readOnlyHint": false} Arguments: - `name` string (required): Returns: - `name` string (required): Source name. ### source_set_settings Merge settings into an existing source's settings. Annotations: {"destructiveHint": true, "idempotentHint": false, "openWorldHint": true, "readOnlyHint": false} Arguments: - `name` string (required): Source name. - `settings` object (required): Kind-specific settings to merge. Returns: - `name` string (required): Source name. ### scene_item_add Add an existing source to a scene as a scene item, optionally at a position. A source only shows in the program output once it is an item of the program scene. Annotations: {"destructiveHint": true, "idempotentHint": false, "openWorldHint": true, "readOnlyHint": false} Arguments: - `position` object | null: Initial position. - `scene` string (required): Scene name. - `source` string (required): Source name. Returns: - `item` integer (required): Item id. - `position` object (required): Canvas position. - `rotation` number (required): Rotation in degrees. - `scale` object (required): Scale factors. - `scene` string | null: Present when an item was added. - `source` string (required): Source name. - `visible` boolean (required): Visibility. ### scene_item_set_transform Set the position, scale and/or rotation of a scene item, named by `item` (id from scene_items_list) or `source`. Annotations: {"destructiveHint": true, "idempotentHint": false, "openWorldHint": true, "readOnlyHint": false} Arguments: - `item` integer | null: Item id. - `position` object | null: New position. - `rotation` number | null: New rotation in degrees. - `scale` object | null: New scale. - `scene` string (required): Scene name. - `source` string | null: Source name instead of item id. Returns: - `item` integer | null: Item id when selected by id. - `scene` string (required): Scene name. - `source` string | null: Source name when selected by name. - `visible` boolean | null: Present for visibility changes. ### scene_item_set_visible Show or hide a scene item, named by `item` (id from scene_items_list) or `source`. Annotations: {"destructiveHint": true, "idempotentHint": true, "openWorldHint": true, "readOnlyHint": false} Arguments: - `item` integer | null: Item id. - `scene` string (required): Scene name. - `source` string | null: Source name instead of item id. - `visible` boolean (required): New visibility. Returns: - `item` integer | null: Item id when selected by id. - `scene` string (required): Scene name. - `source` string | null: Source name when selected by name. - `visible` boolean | null: Present for visibility changes. ## Go live tools Recording, streaming, the virtual camera and the virtual mic. ### record_start Start recording. Annotations: {"destructiveHint": true, "idempotentHint": true, "openWorldHint": true, "readOnlyHint": false} Arguments: - `timeout_ms` integer default 5000: Bounded wait deadline. - `wait` boolean default false: Wait for the output to report active. Returns: - `active` boolean (required): Whether the output is running. ### record_stop Stop recording. Annotations: {"destructiveHint": true, "idempotentHint": true, "openWorldHint": true, "readOnlyHint": false} Returns: - `active` boolean (required): Whether the output is running. ### record_status Report whether recording is active, with duration_ms and bytes where known. Annotations: {"destructiveHint": false, "idempotentHint": true, "openWorldHint": false, "readOnlyHint": true} Returns: - `active` boolean (required): Whether the output is running. - `bytes` integer | null: Bytes written or sent so far, where known. - `duration_ms` integer | null: Milliseconds since the output started, where known. ### stream_start Start streaming. Annotations: {"destructiveHint": true, "idempotentHint": true, "openWorldHint": true, "readOnlyHint": false} Arguments: - `timeout_ms` integer default 5000: Bounded wait deadline. - `wait` boolean default false: Wait for the output to report active. Returns: - `active` boolean (required): Whether the output is running. ### stream_stop Stop streaming. Annotations: {"destructiveHint": true, "idempotentHint": true, "openWorldHint": true, "readOnlyHint": false} Returns: - `active` boolean (required): Whether the output is running. ### stream_status Report whether streaming is active, with duration_ms and bytes where known. Annotations: {"destructiveHint": false, "idempotentHint": true, "openWorldHint": false, "readOnlyHint": true} Returns: - `active` boolean (required): Whether the output is running. - `bytes` integer | null: Bytes written or sent so far, where known. - `duration_ms` integer | null: Milliseconds since the output started, where known. ### vcam_start vcam start: control and inspect OBS directly. Annotations: {"destructiveHint": true, "idempotentHint": true, "openWorldHint": true, "readOnlyHint": false} Arguments: - `audio_enabled` boolean default true: Enable the paired microphone before a stopped output starts. - `audio_track` integer default 1: One-based OBS audio mix (1 through 6). - `timeout_ms` integer default 5000: Auto-wait deadline in milliseconds. - `wait` boolean default false: Wait until the output reports active. Returns: - `active` boolean (required): Video output is active. - `configured` boolean (required): Whether the registered output exists. - `vmic_active` boolean | null: Paired virtual microphone is active, when the plugin supports the query. ### vcam_stop vcam stop: control and inspect OBS directly. Annotations: {"destructiveHint": true, "idempotentHint": true, "openWorldHint": true, "readOnlyHint": false} Returns: - `active` boolean (required): Video output is active. - `configured` boolean (required): Whether the registered output exists. - `vmic_active` boolean | null: Paired virtual microphone is active, when the plugin supports the query. ### vcam_status vcam status: control and inspect OBS directly. Annotations: {"destructiveHint": false, "idempotentHint": true, "openWorldHint": false, "readOnlyHint": true} Returns: - `active` boolean (required): Video output is active. - `configured` boolean (required): Whether the registered output exists. - `vmic_active` boolean | null: Paired virtual microphone is active, when the plugin supports the query. ### vmic_status vmic status: control and inspect OBS directly. Annotations: {"destructiveHint": false, "idempotentHint": true, "openWorldHint": false, "readOnlyHint": true} Returns: - `active` boolean | null: Active according to virtualcam_audio; null means unsupported. - `source_name` string | null: Runtime source name, when known. ## Media tools Media sources. ### media_status media status: control and inspect OBS directly. Annotations: {"destructiveHint": false, "idempotentHint": true, "openWorldHint": false, "readOnlyHint": true} Arguments: - `name` string (required): Name of an existing media source. Returns: - `duration_ms` integer | null: Total duration, if known. - `name` string (required): Source name. - `position_ms` integer | null: Playback position, if known. - `state` "none" | "playing" | "opening" | "buffering" | "paused" | "stopped" | "ended" | "error" (required): Current media state. ### media_restart media restart: control and inspect OBS directly. Annotations: {"destructiveHint": true, "idempotentHint": false, "openWorldHint": true, "readOnlyHint": false} Arguments: - `name` string (required): Name of an existing media source. Returns: - `duration_ms` integer | null: Total duration, if known. - `name` string (required): Source name. - `position_ms` integer | null: Playback position, if known. - `state` "none" | "playing" | "opening" | "buffering" | "paused" | "stopped" | "ended" | "error" (required): Current media state. ## Measure tools Performance counters. ### stats_get stats get: control and inspect OBS directly. Annotations: {"destructiveHint": false, "idempotentHint": true, "openWorldHint": false, "readOnlyHint": true} Returns: - `end_to_end` object (required): End-to-end sync, with explicit provenance. - `render` object (required): Render counters. - `stages` object (required): Per-stage measured counters and bounds. ### stats_reset stats reset: control and inspect OBS directly. Annotations: {"destructiveHint": true, "idempotentHint": false, "openWorldHint": true, "readOnlyHint": false} Returns: - `end_to_end` object (required): End-to-end sync, with explicit provenance. - `render` object (required): Render counters. - `stages` object (required): Per-stage measured counters and bounds. ## Wait tools Block until a typed condition holds, without sleeping. ### wait_for Observe a typed condition immediately, then wait within timeout_ms. Returns the final typed value on timeout; unavailable metrics never satisfy a threshold. Annotations: {"destructiveHint": false, "idempotentHint": true, "openWorldHint": false, "readOnlyHint": true} Arguments: - `condition` output_state | source_active | media_state | stat_at_most (required): Condition to observe before waiting. - `timeout_ms` integer default 5000: Deadline in milliseconds; zero still observes once. Returns: - `elapsed_ms` integer (required): Monotonic elapsed time. - `last_value` object | object | object | object (required): Last observed value, including on timeout. - `satisfied` boolean (required): Condition met before the deadline. ## Resources - `obs://scenes` (application/json): The scene graph: the current program scene, every scene and every source. - `obs://stats` (application/json): OBS performance: fps, cpu_usage (percent) and dropped_frames. ## Errors Failed tool calls return `isError: true` with structuredContent `{code, category, message, retryable}` (ToolError); codes follow obs-websocket v5 status ranges. ## Example sessions ### Start recording when the scene is ready Switch scenes, wait for the camera to go live, then record. Writes only after it has looked. ``` # Handshake. The server speaks MCP 2025-06-18. > {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"agent","version":"1"}}} < {"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-06-18","serverInfo":{"name":"obs-mcp","version":"0.1.0"},"capabilities":{"tools":{},"resources":{}}}} > {"jsonrpc":"2.0","method":"notifications/initialized"} # Put the interview scene on program. > {"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"scene_set_current","arguments":{"name":"Interview"}}} < {"jsonrpc":"2.0","id":2,"result":{"content":[{"type":"text","text":"{\"name\":\"Interview\"}"}],"structuredContent":{"name":"Interview"},"isError":false}} # Don't guess with a sleep: block until the camera source is actually active, for up to 10 s. > {"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"wait_for","arguments":{"condition":{"type":"source_active","name":"Camera"},"timeout_ms":10000}}} < {"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"{\"satisfied\":true,\"elapsed_ms\":180,\"last_value\":{\"kind\":\"source\",\"present\":true,\"active\":true}}"}],"structuredContent":{"satisfied":true,"elapsed_ms":180,"last_value":{"kind":"source","present":true,"active":true}},"isError":false}} # The camera is live. Start recording and wait until the output is really active. > {"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"record_start","arguments":{"wait":true,"timeout_ms":5000}}} < {"jsonrpc":"2.0","id":4,"result":{"content":[{"type":"text","text":"{\"active\":true}"}],"structuredContent":{"active":true},"isError":false}} ``` ### Is the stream healthy? Three read-only calls, all allowed by the read-only allowlist. The agent also says what the server cannot tell it. ``` # Is the stream output running, and is it moving bytes? > {"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"stream_status","arguments":{}}} < {"jsonrpc":"2.0","id":2,"result":{"content":[{"type":"text","text":"{\"active\":true,\"duration_ms\":1804000,\"bytes\":1352000000}"}],"structuredContent":{"active":true,"duration_ms":1804000,"bytes":1352000000},"isError":false}} # Has the renderer dropped frames? A zero timeout makes wait_for a one-shot check. > {"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"wait_for","arguments":{"condition":{"type":"stat_at_most","metric":"render_frames_dropped","value":10},"timeout_ms":0}}} < {"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"{\"satisfied\":true,\"elapsed_ms\":0,\"last_value\":{\"kind\":\"stat\",\"metric\":\"render_frames_dropped\",\"value\":3}}"}],"structuredContent":{"satisfied":true,"elapsed_ms":0,"last_value":{"kind":"stat","metric":"render_frames_dropped","value":3}},"isError":false}} ``` This shows the output is active, bytes are moving (compare bytes across two calls) and the renderer keeps up. It does not show network drops, bitrate or reconnects: the server has no such field today, so an agent should not claim them. ### When it says no The unhappy branches. A typed ToolError gives the agent a code, a category and whether retrying makes sense. ``` # Wait for the camera, but it never comes up. > {"jsonrpc":"2.0","id":5,"method":"tools/call","params":{"name":"wait_for","arguments":{"condition":{"type":"source_active","name":"Camera"},"timeout_ms":3000}}} < {"jsonrpc":"2.0","id":5,"result":{"content":[{"type":"text","text":"{\"satisfied\":false,\"elapsed_ms\":3000,\"last_value\":{\"kind\":\"source\",\"present\":true,\"active\":false}}"}],"structuredContent":{"satisfied":false,"elapsed_ms":3000,"last_value":{"kind":"source","present":true,"active":false}},"isError":false}} # Not satisfied, so don't record. Report what was observed instead. Next, try the start anyway with a short timeout: > {"jsonrpc":"2.0","id":6,"method":"tools/call","params":{"name":"record_start","arguments":{"wait":true,"timeout_ms":1000}}} < {"jsonrpc":"2.0","id":6,"result":{"content":[{"type":"text","text":"{\"code\":207,\"category\":\"not_ready\",\"message\":\"output start timed out\",\"retryable\":true}"}],"structuredContent":{"code":207,"category":"not_ready","message":"output start timed out","retryable":true},"isError":true}} ``` The error object is ToolError from control-api.schema.json. Codes use the obs-websocket v5 status ranges. # Coordinating work: issues, claims and pull requests Many contributors here are AI agents working in parallel, including the maintainer's own automated runs. Every rule below exists because its absence has already cost duplicate work: two PRs for the same issue (#115/#119, #116/#118, #121/#123), five PRs superseded by a bot run porting units another agent had announced, and a PR merged into a feature branch instead of master (#68). Read [testing-policy.md](testing-policy.md) for *how* to port; this document covers *who does what, and when*. ## 1. Before starting anything 1. Search for existing work: - open PRs: `gh pr list --repo obs-rust/obs-studio --search ""` - the issue and its comments, including claim comments - the tracking issue's checklist (#4 lists the trackers) 2. If someone has claimed it and the claim is fresh (see 3), pick something else, or comment offering help. Do not open a parallel PR. 3. If there is no issue yet, file one first (section 5) and claim it. ## 2. Claiming The org-wide rules, commands and the definition of Ready are in [WORKFLOW.md](https://github.com/obs-rust/.github/blob/master/WORKFLOW.md); the claim bot is the org's reusable workflow (`.github/workflows/claim-bot.yaml` calls it). In short: - Only an issue labeled `ready` can be claimed for implementation (`P0` issues never wait). An underdefined one is researched first: comment `Claiming: investigation`, then `/ready` once it meets the definition of Ready. Maintainers (and the coordinator) triage new issues with `/ready` or `/investigate`. - Comment on the issue: `Claiming: ` followed by a short numbered plan (one unit per issue, one to three similar issues per PR, a big one alone; a call-site-wide warning class is one unit in any number of directories, see section 4) and when you expect to open the first PR. - The claim bot then **assigns you** and reacts 🚀 to your comment; you don't need any rights. It replies only to refuse: an issue that is not Ready, is blocked by an open issue, waits on a decision or is claimed by someone else, a takeover of a claim that isn't stale, or a `/reassign` from a non-maintainer. Automated runs skip issues that are assigned or have an open PR. - On a tracking issue, claim one checklist item, not the whole issue. - Claim only what you are working on now. There is no per-account limit (several agents may share one account); stale claims expire (section 3). - **Feature issues with open questions:** answer each open question in the claim comment under **Decisions:** (the default you will build and why), and order the PRs so the first one does not depend on an unresolved answer. A question with no safe default is posted as **Decision needed:** on the issue, and the work that depends on it waits for an answer. Use it only for that; a question with a safe default goes under **Decisions:**. - **Open decisions:** a line that starts with `Decision needed:` (bold or a heading marker before it is fine) makes the claim bot add the `decision-needed` label (🚀, silent), from anyone. From the claimant it also counts as `Blocked:` (section 3). Only a maintainer clears it, with a `Decided:` or `Decision:` comment (first line) or by removing the label; nobody else's progress and no sweep removes it. That answer also clears `human-review-needed`, and on a blocked claim it removes `claim-blocked` and mentions the claimant with the decision quoted, so the work resumes (#2212). The coordinator (obs-coordinator skill §3b) researches each open decision every tick: it answers with `Decided:` when the rules, docs or earlier decisions settle it, and otherwise moves the issue to `human-review-needed`, the list that waits on the human maintainer. The list of open decisions is [issues labeled `decision-needed`](https://github.com/obs-rust/obs-studio/issues?q=is%3Aopen+label%3Adecision-needed+sort%3Acreated-asc), oldest first. Non-public work never posts `Decision needed:` on a public issue; use a general `Blocked:` reason. ## 3. Keeping or releasing a claim - A claim goes stale after a period with no progress: no comment from the claimant on the issue, and no commit, comment or review on an open PR they opened that references it (a draft counts). | Issue | Stale after | |---|---| | normal | **24 hours** | | labeled `P0` or `critical` (crash, data loss, broken release or CI-blocking; maintainers set it) | **8 hours** | | labeled `claim-blocked` (the claimant set it; see below) | **7 days** after the last `Blocked:` comment | The hourly sweep then unassigns the claimant, without a comment. Anyone may take a stale claim by commenting `Taking over stale claim from @x`; the bot accepts it (🚀) only if the claim is stale. Commits on the old draft PR stay available: carry them over with `Co-Authored-By` (section 6). - When the work waits on something you don't control (a maintainer decision, another PR, coordinated non-public work), comment `Blocked: ` (or `/blocked `). Only the claimant can; the bot adds `claim-blocked` (🚀) and the claim lasts 7 days from that comment. A new `Blocked:` comment renews it; a takeover in the meantime is refused. A claimant's `Decision needed:` comment (section 2) blocks and renews the same way. Keep the reason general ("waiting on a maintainer", "waiting on #N", "waiting on non-public work"). Any other progress (an issue comment, a commit, comment or review on your PR) removes the label and the normal timer applies again, as do a release, handoff or `/reassign`. When the 7 days end without a renewal the sweep removes both labels, silently. - Maintainers (owner, member, collaborator) can move any claim with `/reassign @user`. The bot leaves issues labeled `claim-locked` alone; `claim-locked` wins over `claim-blocked`. - To stop, comment `Releasing ` and link any partial branch; the bot unassigns you (🚀). To hand the claim to someone instead of dropping it, name them in the same comment — `Releasing — handing it to @user`, `Handing over to @user`, `It's yours, @user` or `/handoff @user` — and the bot assigns `@user` instead (🚀), so nobody else can take the item in between. ## 4. Pull requests - **Base is `master`.** A stacked PR starts its description with `> **Stacked:** builds on #N; the new commits are …` and is retargeted to master before merge. Check the base before asking for a merge. - **One unit per PR.** Branch names: `port/`, `fix/-`, `test/`, `infra/`. - **Batch one to three similar issues into one PR.** A worker takes up to three issues that share a platform or an area (crate, plugin, workflow, test binary) and lands them as one PR, a RED then GREEN commit pair per issue, `Refs` naming each. Each issue stays one unit for review and revert; the batch only shares the PR, queue and master-push runs, so it costs a third of the CI. A big issue (a large port or subsystem such as the CEF work, `size:L` or larger) and breakage that blocks others go alone. See the `obs-worker-loop` skill §2. - **Mechanical warning work is one PR per warning class, in any number of directories.** A call-site-wide compiler warning (#516) is a single class: fix it in one PR, with the flag that surfaces it removed in the same change, and put a findings table grouped by directory in the description so the diff can still be reviewed in slices. A per-directory series is not a rule that appears anywhere else in these docs, it costs a full `Pull` run (~35 min) plus a merge-queue run per directory, and every flag-list edit invalidates the compile cache (#2689). Measure the class with `uv run ci/warning_findings.py --compdb --drop `: it replays only the affected translation units with `-fsyntax-only` and prints the findings grouped by directory, which is both the RED evidence and the inner loop. The default `--language c` keeps its C units; add `--language cxx` (or `all`) for a C++ class such as the frontend's, whose units the C-only selector filters out. The limits do not move — explicit casts or widened types only, no behaviour change, no per-file `-Wno-*`, never an existing C test or public header, and the pin goes away in the same PR as the fixes. **A PR lane's tree is not the whole set.** Many plugin and platform sources compile only in the app builds (#2678, #2710), so a pin-drop that is clean on a Tier 2 tree can still fail a `Scheduled` run. Enumerate the app's C units from its own build tree — configure only, seconds, no compile: `uv run build-aux/appimage/build.py --steps version,configure`, then `ninja -t compdb` in `build_ubuntu/` (or the app build's volume) and replay that compdb. Vendored trees the tree exempts with a target-scoped `-Wno-*` (`librtmp`, `libcaption`) report nothing while their pin is in the flag list; re-run with `--drop` on it to check them. - **Commit order:** characterization test (if the unit had none), then RED (failing test or `todo!()` core), then GREEN. The PR description names the RED commit, how it fails (test names or counts), and the GREEN result. - **Bug fixes need a failing test first.** If the bug needs live services (PipeWire, ScreenCaptureKit, a server), factor the decision into a small plain-C or Rust function and test that (as #109 did). - **Rebase on origin/master when you start.** Before claiming, coding or reviewing, run `git fetch origin && git rebase --autostash origin/master` so the work starts from current master. Later master changes are handled by the merge queue (below). - **PR CI is the merge gate.** Open the PR (a draft is fine) as soon as the RED test exists; a red CI run on a PR is expected. The local gate (AGENTS.md) is recommended, not required. Complete self-reported client gates and verified org-member author/final signer allow base-owned PR admission; forks, non-members, unverified heads, invalid/partial proofs and API/verifier errors run real selected checks, including all-six-target clippy/Dylint. Stamp first, then sign final HEAD. Strict client enforcement is opt-in. Do not build fork or self-hosted CI to pre-validate PRs. Local errors from your environment (soldr permissions, disk, Docker, host packages): [troubleshooting.md](troubleshooting.md). For a focused CI/configuration bug fix, local RED evidence plus a separate GREEN commit is sufficient: push both together when ready rather than requiring a remote RED run. Record both commands/results in the PR. This exception changes push timing, not the RED → GREEN requirement or the required gate. Documentation-only updates do not need RED → GREEN tests. - **Merge queue:** master merges go through GitHub's merge queue. Queue a green PR with `gh pr merge ` (or the "Merge when ready" button); the queue reruns PR CI on the merge result with current master, and the required `CI Gate ✅` check decides. You do not need to rebase by hand for unrelated master changes; rebase only when GitHub reports a conflict. The coordinator (obs-coordinator skill, §2) acts for the maintainer and also rebases a PR that was ejected from the queue, a stacked PR whose base landed, a PR about to go in behind the queue head that touches the same files, and a `docs/features.md` ledger conflict. A rebase changes the head, so it drops a local-gate stamp and PR CI runs the full Linux suite again. - **Submodules move forward only.** PR CI fails when a PR moves a submodule pointer (for example `plugins/obs-websocket`) to a commit that does not descend from master's pointer, which usually means a stale checkout. Run `git submodule update` before committing, or put `submodule:` in the PR title for a deliberate move back. Locally: `uv run ci/submodule_direction.py origin/master`. - **Fork PRs:** Actions asks a maintainer to approve workflow runs only for a first-time contributor's first PR (repository setting "Require approval for first-time contributors"). Once a PR of yours has merged, later fork PRs start CI as soon as they are opened. On a first PR, a maintainer approves the run; ping one in the PR if it waits more than a few hours. - **User-facing features need one real run.** A change to UI, protocol output or logging is not complete until the real app has run once with it (its Tier 4 test, or by hand), and the PR shows the observed output. #846 closed with every test green while the light it added called llvmpipe green (#929). Without such a run, use `Refs #N`. - **User-visible changes get a ledger line.** A PR that changes what a user sees or can do (behavior, a setting, UI, log output, a protocol field, a platform or package, or a fix for a bug a user can notice) adds or updates its line in [docs/features.md](../features.md) in the same PR. CI, tests, ports with no change in behavior and refactors do not (#1250). - `Fixes #N` only when the PR completes the issue; otherwise `Refs #N`, and tick the tracking-issue checkbox when it merges. - **Draft status:** mark the PR ready when it is ready. If you move a PR back to draft, say why in a comment. - **Rebasing someone else's PR** (maintainers, and the coordinator acting for them, may, for the rebases above and for mechanical fixups such as lint or formatting): push with `--force-with-lease`, and name the replaced head SHA in a comment. ## 5. Filing issues - **Security bugs:** apply the tiers in [SECURITY.md](../../SECURITY.md) ("Two tiers"). A high-risk one (a remote party can reach it, or it leaks credentials) is not an issue: don't file, claim or push it; report it privately and work on the private fork the maintainers open on the advisory. If unsure, report privately. A low-risk one is a normal public bug and may carry the `security` label. - **Bug:** use the bug template. Title `bug: : `; for a security bug, name the class in the symptom (`bug: obs-ffmpeg: use-after-free on seek`). Include file:line, a short excerpt, the class (OOB read, UAF, overflow, …), how it is reached, a proposed fix and a failing-test sketch. - **Upstream OBS bugs:** add `(upstream #N)` to the title and credit the reporter. - **Port:** use the port template. Title `rust: Port .c to `; state the phase, its position in the policy's port order, its dependencies and whether a characterization test exists. - **Meta, tracker and parent issues:** every work item is its own issue, linked as a native GitHub sub-issue of the parent (`gh api -X POST repos/obs-rust/obs-studio/issues//sub_issues -F sub_issue_id=`, where the id is `gh api repos/obs-rust/obs-studio/issues/ --jq .id`). Don't put the work into one big body as a tier list or checklist: nobody can claim, measure or close one line of it. The parent body says what the group is for, the rules that apply to every child and the suggested order, naming the sub-issues by number. A finding that comes later becomes a new sub-issue, not a new line in the parent (#3176). - **Oracle differences** (a stand-in behaving unlike libobs): their own issue, fixed before any port relies on that oracle (#79, #84, #145). - **Feature ideas and questions** are not issues: post ideas in [Discussions → Ideas](https://github.com/obs-rust/obs-studio/discussions/categories/ideas) and questions in Q&A. Issues are for bugs and claimable port or task work; an idea becomes an issue once it is agreed and someone can pick it up. ## 6. Collisions - If two PRs address the same issue, the claimed one wins; without a claim, the earlier one wins. The other author closes theirs with a link and offers any useful pieces (tests especially). Maintainers carry those over with `Co-Authored-By`. - Conflicting design choices between open PRs (for example U+FFFD substitution vs. rejecting a path) go to the tracking issue under a **Decision needed:** heading before either PR merges. ## 7. Closing - When an issue closes, leave a comment: what fixed it, what is left, and the follow-up issue for the rest. - A superseded PR is closed by its author (or a maintainer) with a link to the replacement. ## 8. Master branch protection (decisions for #139, #692 and #699) `master` blocks force pushes and deletion, including for administrators. By default, changes reach master through GitHub's merge queue (ruleset "master merge queue (#692)", whose merge method is squash: each PR lands as one commit). Queue a green PR with `gh pr merge `. Workers and contributors do not use `gh pr merge --admin` without explicit maintainer authorization under the bypass policy below, and never push to master. The coordinator never merges outside the queue, with `--admin` or otherwise. The queue reruns PR CI on the merge result with current master, and the one required check is `CI Gate ✅` (`ci.yml`). That job always reports: it requires selected queue jobs to execute successfully regardless of trailers or hosted proofs. PR skips require the immutable-base per-gate contract or proven path scope; missing verifier, fallback work or selected queue legs fails it. The cache janitor is maintenance and is excluded from this gate; see [the pre-work policy](../ci-tooling.md#pre-work-cache-maintenance-and-cancellation). Why the queue and not rebase-and-merge per PR (#699): over a day of queue runs (58 runs, 37 PRs), 57 runs were green and one PR was removed for a failed check, so a queued PR goes through on the first try. The delay came from 11 administrator merges that bypassed the queue: each moved master under it and rebuilt every queued group (up to 5 runs for one PR, about 65 minutes from queueing to merge against a 16-minute run). Requiring branches to be up to date instead would make every agent rebase and rerun CI after every merge, which gets slower with each agent added. So the queue is the normal path, and compiler/dependency caches (docs/ci-tooling.md) reduce rebuild cost while selected heavy checks always rerun. **Maintainer bypass.** It belongs to the maintainer, or to a worker the maintainer explicitly authorizes; never to the coordinator. The ruleset lets the repository admin role bypass it for pull requests only (`gh pr merge --admin --squash`; direct pushes stay blocked). It is for a maintainer landing a small, low-risk PR (docs, a bot or CI tweak) that should not wait for a CI run. It skips CI, and it moves master under every queued group, which then rebuilds. So bypass only when the queue is empty (`gh pr list --search "is:queued"` shows nothing); otherwise queue the PR and, if it must go first, jump it to the front, keeping CI (#930 E2): `uv run --no-project --script ci/gh_graphql.py -f query='mutation{enqueuePullRequest(input:{pullRequestId:"",jump:true}){mergeQueueEntry{position}}}'` (the PR's own `CI Gate ✅` must already be green; GitHub refuses a PR whose checks are pending or failing). Explicit maintainer instructions to admin-merge authorize an agent to use this exception; do not ask for the same authorization again. Recheck the queue immediately before merging. If it has entries, use the queue and jump-to-front path above to preserve their work. With an empty queue, a small docs or CI fix may use the authorized bypass. Run focused checks first; for a change to the workflow graph, wait for its PR `CI Gate ✅` to pass before bypassing the redundant merge-group run. Record the authorization, queue state and validation in the PR. Authorization for one landing does not grant a standing bypass for unrelated work. Each queue run's `CI Gate ✅` job summary shows its wall time, runner time and attempt number (`ci/queue_report.py`); an attempt 2 or later is a rebuild. If rebuilds after bypasses show up there, tighten this rule. In an emergency an administrator may set the ruleset's enforcement to "disabled", land the fix, and enable it again, saying so in the PR. The queue squash-merges, but the repository still allows merge commits (older history and an admin bypass may use them), so do not require linear history. Review this policy again if direct pushes are retired or the gate's CI reporting changes. Every PR still targets `master` as section 4 requires; GitHub branch protection cannot prevent an author from choosing another base, so check the base before merging. # Rust Port Testing Policy **Status:** Mandatory. Every change that ports C/C++ code to Rust MUST follow this policy exactly. If a rule cannot be followed for a specific unit, stop and record the exception on the tracking issue under **Decisions:** (the format [coordination.md](coordination.md) §2 uses) before writing code; do not silently deviate. ## Goal OBS Studio keeps its **existing public API**, but its internals are rewritten in Rust. Concretely, the following stay compatible: - The **libobs C API and ABI**: every `EXPORT` function signature, every public struct layout, and every public header under `libobs/`. Existing plugins and the frontend must compile against the unchanged headers and work unmodified. - The **obs-websocket v5 protocol**, byte-for-byte on the wire. - The frontend API (`obs-frontend-api`), scripting bindings, and the `window.obsstudio` browser-source API. ### Public and internal boundaries Public headers, exported symbols, opaque-handle behavior, and public struct layouts are compatibility contracts. `obs-internal.h` is a private header, not a public ABI contract: its layouts may change when the C users of a field have been ported or moved behind an internal accessor. Inventory those users before changing a field. Adapt remaining C callers in a separate, behavior-neutral commit or PR, with the existing C tests still passing; then port the isolated unit. Do not edit a public header or an existing C test to accommodate the Rust implementation. This distinction matters for Phase 6. Core files share `obs-internal.h` by direct field access, while `obs-data.h` exposes opaque handles whose layouts live only in `obs-data.c`. The first core seam is `obs-data.c`, after its C behavior has been characterized. Large files enter through the function extraction workflow below: extract a C unit verbatim and land that change before replacing the extracted file with Rust. The four tiers still apply to each resulting unit, including symbol parity and differential tests. Tests exist to prove two separate things: that the Rust code is correct, and that it is a drop-in replacement for the C code it replaces. One kind of test cannot prove both, so every ported unit carries the four tiers below. ## The four tiers ### Tier 1 — Rust unit tests (correctness of the Rust core) - Written in Rust with `#[test]`, against the **safe Rust API** (no `unsafe`, no FFI types). - Every assertion in the existing C test for that unit (if any) is ported 1:1 into Rust, in a test whose name references the C test it mirrors. - New edge cases are added here. - Run with `soldr cargo test`. ### Tier 2 — Existing C tests against the Rust implementation (API/ABI compatibility) - The existing C tests (`test/cmocka/*.c`, and any other C/C++ test for the unit) are **kept and never rewritten or edited** to accommodate the port. They are the compatibility check. - The Rust crate exports the original C symbols through a thin `#[no_mangle] pub extern "C"` shim with `#[repr(C)]` structs. The shim only converts types and delegates to the safe core; it contains no logic. - The **existing public C header is the source of truth** for the public ABI. Do not generate a replacement header or edit the public header as part of a port. Public struct layouts MUST match the C layout exactly, including any awkward field types (e.g. `uint8_t pos` stays `u8` at the C boundary even if the safe core uses `usize`). - A layout test MUST assert `size_of`, `align_of`, and every field offset of each `#[repr(C)]` struct against values measured from the real C header (via the oracle crate, see Tier 3). - The normal application builds, links and installs **hybrid `libobs`**: the completed Rust implementations plus unported C/C++. Replaced C sources are excluded from this target. Rust is required; a missing toolchain is an error. - Compatibility validation explicitly enables `OBS_BUILD_C_REFERENCE=ON` and builds `libobs-c-reference` as well. It is excluded from the default build, never installed, and shares the unported object library with production. Both binaries retain identical public symbols, file names and ABI versions. The unchanged tests pass against **both**: mode `OFF` loads the C reference, mode `ON` loads production hybrid `libobs`. These mode names belong to the test harness; branding does not select the implementation. - Each port moves its C file's `#include` into a ported unity group (`libobs/build/libobs.ported-*+.h.c`), selected by the canonical `libobs/build/source-sets.d/`, or registered in the port's own `libobs/build/ported-source-sets/.json` with any per-group compile options and headers (BUILD.md, #3236), so the port edits no shared CMake file. The reference keeps compiling that group; production links the Rust replacement. Keep C reference/oracle sources during migration; their exclusion from production does not end parity coverage. - Hybrid `libobs` MUST export exactly the C reference's dynamic symbols: no missing C symbols or leaked Rust internals. Keep platform export controls. - Run `rust/tools/linux-validate/run.py` to check both requirements. It builds once in Docker, runs the cmocka tests against each libobs, and diffs the exported symbols. PR CI's Tier 2 jobs run it and satisfy this requirement; paste its summary into the PR only if you ran it locally. - Tests for the C boundary are written in C (they already are). Do not add C++ tests for C APIs. - Memory that C code later frees or resizes (e.g. darray buffers) MUST be allocated with libobs `bmalloc`/`bfree`, declared once in `rust/obs-util/src/ffi/darray.rs`. - `bmalloc`/`bfree` are now the Rust bmem port (`rust/obs-util/src/ffi/bmem.rs`, re-exported from `ffi/darray.rs`). Under `cargo test`, the base/platform symbols they and the oracles need come from the oracle crate (`oracle/test_stubs.c`, `oracle/file_serializer_host.c`, `oracle/platform_conv_host.c` and the real `util/base-variadic.c`), linked by every obs-util test via `use obs_c_oracle as _;`. Oracle copies of C that is now ported (e.g. `util/utf8.c`) are compiled under `oracle_*` names so they never clash with the Rust shims. - C ABI shims for symbols libobs does not export (base.c internals, utf8) are listed in their FFI module's own fragment, `libobs/cmake/rust-hidden.d/-.txt`, instead of `rust-exports.d/`. `libobs/cmake/rust-hidden.cmake` (and `rust/obs-build`) generates the ELF version script (`local:`) and the macOS unexports list from the fragments and `rust-hidden-base.txt` at configure time; neither is committed, so ports never edit a shared list (#3233), and a fragment-only change runs CI on Linux only. `export_list.rs` checks that every shim is exported or hidden and that each fragment names only its module's shims. - Windows: Rust `#[no_mangle]` symbols are not dllexport, so every C ABI shim symbol is listed in `libobs/cmake/rust-exports.d/-.txt` (one fragment per FFI module, so ports don't edit a shared list), which `libobs/cmake/rust.cmake` turns into `/EXPORT:` linker options. `rust/obs-util/tests/platform/export_list.rs` fails if a fragment and the `#[unsafe(no_mangle)]` functions in its `rust//src/ffi/.rs` differ. - macOS: the generated `rust-unexports-macos.txt` hides Rust internals with `-unexported_symbols_list`. - CI: `.github/workflows/build-project.yaml` runs the Rust tests on Linux, macOS and Windows (job `rust-tests`). It runs `rust/tools/linux-validate/run.py` (job `rust-linux-tier2`) and `rust/tools/tier2-validate/validate.sh` / `validate.ps1` on macOS and Windows (job `rust-tier2`). Each OFF/ON pair must export identical symbol sets. ### Tier 3 — Differential tests against the original C (behavioral parity) - The original C source is compiled into the Rust test build as an **oracle** through the `rust/obs-c-oracle` crate (a dev-dependency only, built with the `cc` crate). Oracle symbols are renamed with an `oracle_` prefix by a wrapper `.c` file that `#define`s each exported name and then `#include`s the original source file. The original file is not copied or modified. - When the C ABI forces a behavior the safe API should not have (e.g. a `uint8_t` position that wraps), make the core generic over it rather than duplicating logic in the shim; see `Position` in `rust/obs-util/src/bitstream.rs`. - A `proptest` test feeds random inputs to both the oracle and the Rust shim and asserts identical outputs and identical observable state. - A mutation check is expected once per port: temporarily break the core and confirm the differential test fails, and say so in the PR. - Known, intentional differences from the C behavior (bug fixes) MUST be listed in the test file and in the tracking issue, and the property test must exclude exactly those inputs, no more. - When a C source is removed from the production tree, move that original source to `rust/obs-c-oracle/legacy/` (created by the first such removal; it is the one allowed copy of ported C) in the same change and update its oracle wrapper. Keep Tier 3 parity running; the production source's deletion does not end the behavioral baseline. See [release-criteria.md](release-criteria.md) for the release and rollback gates before removing a C implementation. ### Tier 4 — Black-box protocol tests (external network API) - Applies to obs-websocket and any other network-facing surface. - Written against the running server over the wire, independent of the implementation language. The suite MUST pass against the unchanged C++ obs-websocket plugin loaded by both libobs builds (the C reference and hybrid). The plugin is never ported (AGENTS.md). ## Required workflow for each ported unit 1. **RED:** commit the Tier 1 port of the existing test (and new edge cases) against stub implementations (`todo!()`), and show `soldr cargo test` failing. 2. **GREEN:** implement the safe Rust core until Tier 1 passes. 3. Add the C shim, the layout test, and the Tier 3 differential test. 4. Move the C file's `#include` into a ported group (`libobs/build/libobs.ported-*+.h.c`, [BUILD.md](../../BUILD.md)) and run `rust/tools/linux-validate/run.py`: the unchanged C tests pass against `libobs-c-reference` and hybrid `libobs`, and the exported symbol sets are identical. 5. Record every intentional behavior difference in the tracking issue. A port is not done until all applicable tiers pass. "Tier 1 passes" alone is not done. `CI Gate ✅` on `obs-rust/obs-studio` decides admission. Complete client evidence from a verified org-member PR author and final HEAD signer can replace selected PR checks under immutable-base policy; it is self-reported, not execution proof. The merge queue always executes the selected heavy tiers on the combined result. Missing/untrusted/partial/invalid proofs, forks and verifier/API errors retain real selected PR checks, including clippy/Dylint on all six supported targets. Client tooling is optional and strict refusal is opt-in; sign only after stamping. Open a PR (a draft is fine) once the RED commit exists and let CI run the tiers; running them locally first (`./lint`, `./unittest`, `local-gate run`) is recommended, not required. The tiers, RED then GREEN, and the ban on editing C tests or public headers stay mandatory. ## Extracting a function before porting it If the unit to port is one function inside a larger C file, Hybrid `libobs` cannot drop it, because the ported lists hold whole files. 1. First move the function verbatim into its own `.c` file in the same directory. 2. Use a separate, behavior-neutral commit/PR that contains no Rust and changes no signature, header, or behavior. 3. Add the new file to a libobs unity group (`libobs/build/`, [BUILD.md](../../BUILD.md)). 4. The unchanged C tests must pass. 5. Only then port the new file with the normal workflow, and move its `#include` into a ported group. Example: `os_get_path_extension` moves from `util/platform.c` to `util/path-extension.c`. ## Characterization tests for units without C tests If the C unit to port has no existing C test, Tier 2 has nothing to run. First add a cmocka characterization test `test/cmocka/test_.c` that pins the CURRENT C behavior, including odd or buggy behavior. Comment such cases as "characterized, not endorsed". - It lands in its own commit/PR BEFORE the port, contains no Rust, and passes against the C reference and hybrid `libobs` (nothing is swapped yet). - From then on it is an existing C test under Tier 2: the port may not edit it. Tier 1 ports its assertions 1:1 into Rust. - Register it in `test/cmocka/CMakeLists.txt` and add it to the `cmocka-tests` aggregate target like the others. - If the C source is not exported from libobs (e.g. `util/utf8.c`), compile that C source into the test executable, as `test_formatted_filename` does. The test must then be marked as characterizing the C source only: it cannot exercise the Rust swap until the symbol is reachable. - Use only portable behavior, or guard platform-specific cases with `#ifdef _WIN32` / `#ifndef _WIN32`. - Don't call `fail_msg()` in a test that Windows builds: it expands to cmocka's private `cm_print_error()`, which the Windows cmocka does not export, so the test fails to link (LNK2019, #1580, #1713). Print the diagnostic with `fprintf(stderr, ...)` and then call `fail()`. `ci/test_cmocka_windows_diagnostics.py` (Fast Gate) catches the call; it is a source check for this one symbol, not proof that the test links on Windows (#1739). - A PR's green checks prove only the lanes its paths selected. A shared `.c` test selects Linux Tier 2, not Windows or macOS, so don't claim a new test builds everywhere unless a native Tier 2 run built it. ### Port order for Phase 3 (pure leaf utilities) 1. `crc32` 2. `utf8` 3. `lexer.c` / `cf-lexer.c` / `cf-parser.c` 4. `text-lookup.c` 5. `dstr.c` 6. `base.c` (done: the variadic `blog`/`blogva`/`bcrash` stay in `util/base-variadic.c`). `cf-lexer.c` / `cf-parser.c` from step 3 are deferred to a follow-up. 7. `bmem.c` last: a wrong allocator breaks every other Tier 2 run. - The `utf8` and `dstr` Tier 3 parity tests MUST generate arbitrary byte strings, including invalid UTF-8. - The `bmem` port MUST match the 32-byte alignment, the `bmalloc`/`brealloc`/`bfree` hooks, and `bnum_allocs` accounting: `brealloc(NULL, n)` counts as an allocation, and `bfree(NULL)` does not decrement. ### Port order and rules for Phase 4 (stateful, I/O and platform utilities) The characterization tests `test_file_serializer`, `test_config_file`, `test_threading`, `test_task`, `test_pipe`, `test_profiler` and `test_platform` land first (the first Phase 4 PR) and are thereafter unchanged Tier 2 checks. 1. `file-serializer.c` and `buffered-file-serializer.c` 2. `config-file.c` 3. `task.c` 4. `profiler.c` (`source-profiler.c` is Phase 6 core work because it accesses `obs-internal.h` and source/graphics state directly) 5. `pipe.c` / `pipe-posix.c` / `pipe-windows.c` 6. `threading-posix.c` / `threading-windows.c` 7. `platform.c`, then `platform-nix*.c` / `platform-windows.c` - Every test that touches files uses its own temp directory, relative to the ctest working directory, and removes it in teardown. - No sleeps: synchronize on events, semaphores or joins. Before writing a test that waits for frames or audio, read [docs/knowledge/timing-tests.md](../knowledge/timing-tests.md): wait for the result, not a frame count, and when the `timing` resource lock applies. - Before writing a test that touches something OBS's destroy path frees, read [docs/knowledge/test-leaks.md](../knowledge/test-leaks.md): free exactly what that path frees, or the asan job fails on the leak. - Threading tests MUST be deterministic: 100 consecutive runs without a flake. Check it with the Tier 2 harness, which reruns the given tests in both the OFF and ON builds after the normal run, stopping at the first failure (`ctest --repeat until-fail:N`): `rust/tools/linux-validate/run.py --repeat 100 --tests 'test_threading|test_task'` (`tier2-validate/validate.sh` takes the same options on macOS; `validate.ps1 -Repeat 100 -Tests '...'` on Windows). - Linux Tier 2's [known-flaky registry](../../test/cmocka/known-flaky.txt) is a merge-queue shield for tracked flakes, not an exemption from that 100-run determinism rule for new threading tests. Every entry requires a test-name regex, an open issue number and a reason. The normal OFF/ON run retries its failed tests once only when every failure is registered; recovery emits a warning and step-summary line naming the test and issue. An unregistered failure or a second failure still fails the job. Remove entries when their tracking issues are resolved. Explicit `--repeat` determinism runs retain their first-failure behavior and never retry. - Tier 3 parity for I/O code runs the oracle and the Rust shim against separate temp directories and compares the resulting files byte for byte, plus the return values. - The `config-file` parity test MUST cover arbitrary INI input, including malformed lines. - The threading and task ports add a loom or stress-style Rust test on top of parity. - Per-OS files are ported per OS. A port is done only when that OS's Tier 2 passes in CI. ### Port order and rules for Phase 5 (beyond util) 1. Graphics math in crate `obs-graphics`: `vec2.c`, then `vec3.c`, `vec4.c`, `quat.c`, `matrix3.c`, `matrix4.c`, `plane.c`, `bounds.c`, `axisang.c`, `math-extra.c`. 2. `media-io` in crate `obs-media-io`. 3. obs-websocket Tier 4 suite against the unchanged C++ plugin. Preserve it as the compatibility check required by `AGENTS.md`; the earlier [port proposal](websocket-port.md) is superseded. - Tier 3 parity is exact bit equality (NaN == NaN) where the C is scalar and deterministic. Only where the C uses SIMD (`vec3`, `vec4`, `matrix4` via SIMDe) is a per-function ULP tolerance allowed; document it in the parity test file. - The bitstream parsers (`obs-avc.c`, `obs-hevc.c`, `obs-av1.c`) get cargo-fuzz differential targets against the C oracle. Each runs at least 1 hour with no mismatch outside documented exclusions. - These and the later targets (`nal_diff`, `config_ini_diff`) run nightly through the local runner described in [fuzzing.md](fuzzing.md). - Inputs that trigger C UB are excluded and listed. The `get_ue_golomb` UB is already fixed in C (#11, #17). - obs-websocket gets a Tier 4 black-box suite covering every v5 request type, events, the auth handshake and error codes. It MUST pass against the unchanged C++ plugin on both libobs builds; the plugin is never ported. ## Header-inline code (static inline functions and macros) Code that lives entirely in a public header as `static inline` functions or macros is compiled into every caller, so no symbol swap is possible. - Exemption: Tier 2 for such a unit is (a) a layout test of every public struct it defines (`size_of`, `align_of`, every field offset against the oracle) and (b) the unchanged C tests passing OFF and ON. - Do not modify the header. - Tier 1 and Tier 3 still apply. The Rust equivalent, which Rust ports use when they manipulate those structs, gets a 1:1 port of the C test plus a differential test. That test runs against oracle wrappers that instantiate the inline functions as non-inline `oracle_*` functions. - This currently covers `util/darray.h` (the `struct darray` layout is the contract), `util/deque.h` (`struct deque`), `util/serializer.h` (`struct serializer`), and the `static inline` helpers in `util/dstr.h` (the `struct dstr` layout is the contract). `util/dstr.c` itself is ported with the normal workflow. ## Python runs through uv Every Python invocation in this repo goes through `uv run` (or `uvx` for a tool pulled from a package), never bare `python` or `python3`: `uv run python -m unittest ci/test_x.py`, `uv run tools/leaderboard/generate.py`, `uv run --with pillow python docs/images/generate-logo-assets.py SOURCE`. This covers shell scripts, `./lint`, `./unittest`, `local-gate.toml`, workflows and composite actions (which set uv up with the `astral-sh/setup-uv` step already pinned in `build-project.yaml`), CMake `COMMAND`s, docstring usage lines and Markdown code. Standalone scripts start with `#!/usr/bin/env -S uv run --script` (with PEP 723 inline metadata when they need packages); a shebang naming a bare interpreter is not allowed. `ci/test_uv_run.py` scans every tracked file and fails on a bare invocation. Its small, commented allowlist covers only trees we do not own (`deps/`, `plugins/`). Do not extend it to dodge the rule. ## Layout and naming ```text Cargo.toml # workspace root, members = ["rust/*"] rust-toolchain.toml # pinned toolchain (required by soldr) libobs/cmake/rust.cmake # Corrosion import + whole-archive link into libobs libobs/cmake/rust-exports.d/ # C ABI shim symbols to export (Windows /EXPORT:), one file per FFI module libobs/cmake/rust-hidden.d/ # shims hidden from libobs, one file per FFI module libobs/cmake/rust-hidden-base.txt # Rust internals and C glue hidden on every linker libobs/cmake/rust-hidden.cmake # generates the ELF version script and macOS unexports list rust/ libobs-rust/ # the ONLY staticlib; re-exports every port's ffi tools/linux-validate/ # Docker harness for Tier 2 (not a crate) tools/tier2-validate/ # macOS/Windows Tier 2 (validate.sh, validate.ps1) obs-util/ # ports of libobs/util/* src/bitstream.rs # safe core (Tier 1 target) src/{path_extension,darray,array_serializer,crc32,utf8,lexer,text_lookup,dstr,bmem,cf_tokenizer}.rs # more safe cores src/ffi/bitstream.rs # extern "C" shim, #[repr(C)] types (Tier 2) src/ffi/*.rs # matching shims for the cores above src/platform/ # the only host-specific code (cfg_select!, unix/, windows/) tests/suite.rs # the one obs-util test binary (Utilities category; see Test binary budget) tests/containers/main.rs # a module of suite.rs, like config/, memory/, threading/, ... tests/containers/bitstream.rs # Tier 1: 1:1 port of test/cmocka/test_bitstream.c tests/containers/bitstream_layout.rs # Tier 2: struct layout vs. C header tests/containers/bitstream_parity.rs # Tier 3: proptest vs. C oracle obs-graphics/ # ports of libobs/graphics/* obs-media-io/ # ports of libobs/media-io/* ../dylints/ # repo Dylints run by ./lint (not workspace members) obs-c-oracle/ # dev-only: original C compiled with oracle_ prefix build.rs oracle/bitstream.c # #define renames + #include of libobs/util/bitstream.c oracle/{path_extension,array_serializer,darray,crc32,utf8,lexer,text_lookup,dstr,dstr_libc,bmem,test_stubs,platform_conv_host,cf_tokenizer}.c ``` Port crates are plain `rlib`s. Only `libobs-rust` is a `staticlib`: each staticlib embeds its own copy of `std`, so libobs must link exactly one. A new port crate is added as a dependency of `libobs-rust` and re-exported there. New libobs areas get their own crate under `rust/` named after the libobs directory (`obs-util`, `obs-graphics`, `obs-media-io`, ...). ## Test binary budget Minimize the number of Rust test executables that must be compiled and linked. Use **one amalgamated test binary per category**. The inventory below selects eight categories for the current workspace, including unit-test harness coverage and integration tests. Eight is the result of this grouping, not an allowance per crate. Prefer fewer when categories can share a harness without losing meaningful separation. The objective is fewer test compilation and link targets when building the whole suite. The category binaries replace existing per-crate unit-test harnesses and integration-test executables; they must not be added alongside them. Moving only integration tests while leaving the same library unit-test harnesses enabled does not complete consolidation. Production libraries remain dependencies of the shared harnesses and retain their normal builds. Do not compile an entire production source tree again through `include!` or `#[path]` just to put its tests into an amalgamated binary: that would duplicate the compilation we are trying to remove. The native build resolver is a narrow exception: its small private helper and test share one source module with the application harness, avoiding both a public test API and a second compilation of the entire build engine. | Category / selected binary | Existing suites and coverage to include | | --- | --- | | Utilities / `obs-util` library harness | All eight `obs-util` suites: config, containers, memory, platform, profiler, serializer, strings, threading; its inline platform tests; `obs-c-oracle/tests/oracle` oracle validation. | | Core state / `obs-tests-core` | `obs-data/tests/data`, `obs-properties/tests/properties`, `obs-hotkey/tests/hotkey`, `obs-callback/tests/callback`, `obs-mcp/tests/mcp`, `obs-missing-files/tests/missing_files`, `obs-output/tests/output`, `obs-encoder/tests/encoder`, `obs-scene/tests/scene`, `obs-audio-monitoring/tests/audio_monitoring`, `obs-audio-controls/tests/audio_controls`, `obs-core/tests/obs_core`, `obs-source/tests/source`, and `obs-source-seam/tests/source_seam`. | | Graphics / `obs-tests-graphics` | `obs-graphics/tests/linear`, `geometry`, and `shader`. | | Media I/O / `obs-media-io` library harness | `obs-media-io/tests/audio`, `video`, and inline `video_output` tests. | | Codecs and encoders / `obs-tests-codec` | `obs-codec/tests/codec` and `obs-nvenc/tests/nvenc`, including the NVENC plugin boundary coverage. | | GPU status / `obs-tests-gpu` | `obs-gpu-status/tests/gpu_status`, including frontend adapter boundary coverage. | | Preflight / `obs-tests-preflight` | `obs-preflight` CLI, FFI, and per-platform inline tests; `obs-preflight-ffi` boundary coverage. | | Application / `obs-tests-app` | `obs-studio-rust/tests/cli`, including its CLI, JSON, and WebSocket client checks; `obs-build` native compilation contracts and private resolver check; feature-gated native libobs and `obs-sys` bundled contracts. Preserve the C++ OBS WebSocket plugin as required by AGENTS.md. | Utilities and media use their library unit harness as the one category executable. Their existing integration suites are modules in that harness, so private unit tests retain access without extra binaries or exposed internals. The other six categories use explicit integration targets. `libobs-rust` remains the production aggregation library; its constituent behavior belongs to the categories above. `obs-c-oracle` remains a shared test dependency, not a separate executable. FFI adapters with no tests have no empty harness. Fuzz targets, benchmarks, documentation tests, and unchanged C compatibility executables retain their separate execution models. Thread-safe cases run with libtest's normal parallelism. Serialize tests sharing the profiler with their existing common lock. Tests that change process-wide allocation counters, logging callbacks, or the working directory must re-exec the same category executable with an exact test selector. Pipe-spawning oracle checks also re-exec first: their C pipe-to-CLOEXEC window must not overlap unrelated child spawns in this process. File-replacement parity checks re-exec too: a concurrent Windows child can inherit an open C stdio handle and prevent replacement after C closes it. Crash probes also re-exec before forking, so they cannot inherit live pipe handles from other tests. Do not serialize the whole suite or add another compiled binary to obtain a clean process. Use `module_path!()` for exact selectors so module regrouping cannot silently run zero child tests. The application category retains `libobs-integration` and `bundled-native` feature gates for expensive native contracts; these add cases to the same executable, not new executables. The preflight CLI parser lives in the safe engine's `cli` module, consumed by its real executable and tested in the shared preflight suite. Its ABI layout structs live in `ffi/types.rs`, consumed by the static C adapter and the layout tests. Neither production source needs to be included a second time in a test executable to retain those checks. - Use the category map above to choose the shared test binary. A new test file, test tier, feature, or crate does not by itself justify another executable. Put cases in modules included by the component's harness. - Keep every assertion, differential case, platform check, and required test tier. This policy reduces executable count, not test-case count. - Avoid empty or duplicate library/binary test harnesses. Disable them with `test = false` only after their coverage is included in a shared harness. - Count the harnesses Cargo actually builds for each supported platform, including automatically discovered targets. Report documentation tests and unchanged C compatibility executables separately; this Rust budget does not remove either kind of coverage. - Any necessary split must identify a distinct component or technical isolation requirement and document why the existing categories cannot accommodate it. Do not split binaries just because tests live in different source files or crates. `ci/test_binary_cap.py` discovers unit harnesses and integration targets from manifests without requiring a Rust toolchain or compiling anything, including implicit workspace path dependencies. It checks category ownership, rejects duplicate and missing categories, and rejects any extra unit or integration harness. Cargo metadata provides an independent inventory check enforced by the lint lane on build hosts. The guard runs through existing CI Python test discovery; `uv run ci/test_binary_cap.py --report` prints the inventory. Use `soldr cargo test --workspace --locked` for the full suite. For focused work, select the owning category, for example `soldr cargo test -p obs-data --test obs-tests-core properties::` or `soldr cargo test -p obs-util --lib tests::strings::`. A crate whose tests belong to another category no longer has a separate executable. The fast gate follows dev-dependencies too, so a change to that crate still selects the category owner; `ci/test_rust_scope.py` guards these relationships. Verify consolidation with Cargo's actual test target inventory and test discovery before and after: all existing cases must still be discovered on their supported platforms, and the old unit/integration targets must no longer be built. Measure full-suite compilation and linking separately from test execution. A smaller target count is the structural requirement; report timing evidence before claiming a speed improvement. ## Test time Decided on #2888. `ci/nextest.toml` gives every test a budget: nextest marks it SLOW at 10 s and fails it at 30 s (`slow-timeout = { period = "10s", terminate-after = 3 }`). The budget applies at the reduced parity level (PR, merge queue, master push); the `full` level (local runs, nightly, release) uses the `full` profile, which reports SLOW but times nothing out. - A new test takes about 5 s or less in the CI debug build. Choose proptest cases so that every branch is reached and every reported mutant is killed, not as many as possible. A new test is not a reason for an exception. - Proptest counts go through `obs_c_oracle::parity::cases(N)`; 2^32 sweeps through `obs_c_oracle::parity::sweep(range)`, and large fixed grids skip items with `obs_c_oracle::parity::keep(i)`. All three read `OBS_PARITY_CASES`: everything at `full`, a fixed tenth at `reduced`. Keep the edge values on every level, outside the sampled part. - A test that needs more time gets a named `[[profile.default.overrides]]` entry whose comment gives the reason and cites #2888 or its own issue (`ci/test_nextest_budget.py`). The native build test (real compiles) is one. - The budget covers nextest only. Tier 2 ctest and the `obs-c-oracle` benches are not under it. - Memory is reported, not capped: the PR's "Test cost" line (obs-worker §4) gives the longest run, the peak RSS over 20 to 50 runs and the test's own threads. ## Rules that apply everywhere - Use `soldr cargo ...`, never bare `cargo`. - The Rust toolchain is pinned in `rust-toolchain.toml` to the latest version natively supported by the soldr version CI uses (`version:` of the `setup-soldr` step in `.github/workflows/build-project.yaml`). Check what a soldr release supports in its own `rust-toolchain.toml` (zackees/soldr, at that tag). Never pin beyond it; bump the toolchain only together with, and after, a soldr bump that supports it. The Tier 2 Docker image installs the same pinned version (`rust/tools/linux-validate/run.py`). `./lint` enforces this: `ci/test_toolchain.py` holds the expected version (`SOLDR_SUPPORTED_RUST`) and fails if `rust-toolchain.toml`, the MSRV, or any Dockerfile, workflow or doc pin differs. - `soldr cargo clippy --all-targets -- -D warnings` and `soldr cargo fmt --check` must be clean. - **Cargo feature sets** (#2056). `--workspace` runs unify features, so they build each crate only with the union of what its dependents enable (for example `obs-util/gio` always on). `./lint` also runs clippy for each entry of `FEATURE_SETS` in `ci/local_gate.py`, and `./unittest` runs the `FEATURE_TEST_SETS` tests. `./lint` fails when a workspace feature is not built both on and off by some clippy run. A new Cargo feature therefore needs a `FEATURE_SETS` entry, or a `FEATURE_SET_EXEMPT` entry that says why not and where it is checked instead. - `unsafe` is allowed only in `src/ffi/` shims, in `obs-c-oracle`, and in the Tier 2/3 test files that call C ABI functions. Each `unsafe` block has a `// SAFETY:` comment. Every port crate denies the `unsafe_code` lint, so a safe core cannot use it: `allow` is written only where the C boundary is (the `ffi` module) and on the platform modules that must call the OS directly (`obs_util::platform::windows`, `obs-media-io`'s `platform::unix`, each saying why). Crates with no C boundary (`libobs-rust`, `obs-studio-rust`) `forbid` it outright. Keep it that way when adding a crate. - **Platform boundary** (#323). Host-specific code lives only in the crate's `src/platform/` module and in `src/ffi/` (the exported symbol set itself differs per OS). `src/platform/mod.rs` is the crate's single host-selection site: one `cfg_select!` that declares the per-OS children (`platform/unix.rs`, `platform/windows/`, ...) and re-exports a neutral API (types, functions, `const` flags, or a capability macro such as `with_audio_thread_port!` for items that exist only on some hosts). Everywhere else in `rust//src/`, host `#[cfg]`/`#[cfg_attr]`/`cfg!()` (`windows`, `unix`, `target_os`, `target_env`, `target_arch`, ...) and native paths (`std::os::{unix,windows,..}`, `libc::`, `windows_sys`) are errors. `dylints/ban_platform_cfg_outside_boundary` enforces this in `./lint` (`soldr cargo dylint --all -- --workspace --lib --bins`). It reads the source before cfg expansion, so code compiled out on Linux is checked too; that is what lets one Linux lint lane stand in for every OS. Out of scope: `obs-c-oracle`, `rust/tools`, and `tests/`. There is no allowlist: move the code into `platform/`, do not opt out. - Do not add new GitHub Actions workflow files without explicit sign-off from the maintainer. Hook tests into existing workflows instead. - Do not edit a public C header, an existing C test, or an exported function signature as part of a port. Changing the public API is a separate, explicitly approved decision with its own issue. # obs-websocket v5 protocol reference (generated) ## Enums ### EventSubscription - `None` = `0`: Subcription value used to disable all events. - `General` = `(1 << 0)`: Subscription value to receive events in the `General` category. - `Config` = `(1 << 1)`: Subscription value to receive events in the `Config` category. - `Scenes` = `(1 << 2)`: Subscription value to receive events in the `Scenes` category. - `Inputs` = `(1 << 3)`: Subscription value to receive events in the `Inputs` category. - `Transitions` = `(1 << 4)`: Subscription value to receive events in the `Transitions` category. - `Filters` = `(1 << 5)`: Subscription value to receive events in the `Filters` category. - `Outputs` = `(1 << 6)`: Subscription value to receive events in the `Outputs` category. - `SceneItems` = `(1 << 7)`: Subscription value to receive events in the `SceneItems` category. - `MediaInputs` = `(1 << 8)`: Subscription value to receive events in the `MediaInputs` category. - `Vendors` = `(1 << 9)`: Subscription value to receive the `VendorEvent` event. - `Ui` = `(1 << 10)`: Subscription value to receive events in the `Ui` category. - `Canvases` = `(1 << 11)`: Subscription value to receive events in the `Canvases` category. - `All` = `(General | Config | Scenes | Inputs | Transitions | Filters | Outputs | SceneItems | MediaInputs | Vendors | Ui | Canvases)`: Helper to receive all non-high-volume events. - `InputVolumeMeters` = `(1 << 16)`: Subscription value to receive the `InputVolumeMeters` high-volume event. - `InputActiveStateChanged` = `(1 << 17)`: Subscription value to receive the `InputActiveStateChanged` high-volume event. - `InputShowStateChanged` = `(1 << 18)`: Subscription value to receive the `InputShowStateChanged` high-volume event. - `SceneItemTransformChanged` = `(1 << 19)`: Subscription value to receive the `SceneItemTransformChanged` high-volume event. ### RequestBatchExecutionType - `None` = `-1`: Not a request batch. - `SerialRealtime` = `0`: A request batch which processes all requests serially, as fast as possible. Note: To introduce artificial delay, use the `Sleep` request and the `sleepMillis` request field. - `SerialFrame` = `1`: A request batch type which processes all requests serially, in sync with the graphics thread. Designed to provide high accuracy for animations. Note: To introduce artificial delay, use the `Sleep` request and the `sleepFrames` request field. - `Parallel` = `2`: A request batch type which processes all requests using all available threads in the thread pool. Note: This is mainly experimental, and only really shows its colors during requests which require lots of active processing, like `GetSourceScreenshot`. ### RequestStatus - `Unknown` = `0`: Unknown status, should never be used. - `NoError` = `10`: For internal use to signify a successful field check. - `Success` = `100`: The request has succeeded. - `MissingRequestType` = `203`: The `requestType` field is missing from the request data. - `UnknownRequestType` = `204`: The request type is invalid or does not exist. - `GenericError` = `205`: Generic error code. Note: A comment is required to be provided by obs-websocket. - `UnsupportedRequestBatchExecutionType` = `206`: The request batch execution type is not supported. - `NotReady` = `207`: The server is not ready to handle the request. Note: This usually occurs during OBS scene collection change or exit. Requests may be tried again after a delay if this code is given. - `MissingRequestField` = `300`: A required request field is missing. - `MissingRequestData` = `301`: The request does not have a valid requestData object. - `InvalidRequestField` = `400`: Generic invalid request field message. Note: A comment is required to be provided by obs-websocket. - `InvalidRequestFieldType` = `401`: A request field has the wrong data type. - `RequestFieldOutOfRange` = `402`: A request field (number) is outside of the allowed range. - `RequestFieldEmpty` = `403`: A request field (string or array) is empty and cannot be. - `TooManyRequestFields` = `404`: There are too many request fields (eg. a request takes two optionals, where only one is allowed at a time). - `OutputRunning` = `500`: An output is running and cannot be in order to perform the request. - `OutputNotRunning` = `501`: An output is not running and should be. - `OutputPaused` = `502`: An output is paused and should not be. - `OutputNotPaused` = `503`: An output is not paused and should be. - `OutputDisabled` = `504`: An output is disabled and should not be. - `StudioModeActive` = `505`: Studio mode is active and cannot be. - `StudioModeNotActive` = `506`: Studio mode is not active and should be. - `ResourceNotFound` = `600`: The resource was not found. Note: Resources are any kind of object in obs-websocket, like inputs, profiles, outputs, etc. - `ResourceAlreadyExists` = `601`: The resource already exists. - `InvalidResourceType` = `602`: The type of resource found is invalid. - `NotEnoughResources` = `603`: There are not enough instances of the resource in order to perform the request. - `InvalidResourceState` = `604`: The state of the resource is invalid. For example, if the resource is blocked from being accessed. - `InvalidInputKind` = `605`: The specified input (obs_source_t-OBS_SOURCE_TYPE_INPUT) had the wrong kind. - `ResourceNotConfigurable` = `606`: The resource does not support being configured. This is particularly relevant to transitions, where they do not always have changeable settings. - `InvalidFilterKind` = `607`: The specified filter (obs_source_t-OBS_SOURCE_TYPE_FILTER) had the wrong kind. - `ResourceCreationFailed` = `700`: Creating the resource failed. - `ResourceActionFailed` = `701`: Performing an action on the resource failed. - `RequestProcessingFailed` = `702`: Processing the request failed unexpectedly. Note: A comment is required to be provided by obs-websocket. - `CannotAct` = `703`: The combination of request fields cannot be used to perform an action. ### ObsOutputState - `OBS_WEBSOCKET_OUTPUT_UNKNOWN` = `OBS_WEBSOCKET_OUTPUT_UNKNOWN`: Unknown state. - `OBS_WEBSOCKET_OUTPUT_STARTING` = `OBS_WEBSOCKET_OUTPUT_STARTING`: The output is starting. - `OBS_WEBSOCKET_OUTPUT_STARTED` = `OBS_WEBSOCKET_OUTPUT_STARTED`: The input has started. - `OBS_WEBSOCKET_OUTPUT_STOPPING` = `OBS_WEBSOCKET_OUTPUT_STOPPING`: The output is stopping. - `OBS_WEBSOCKET_OUTPUT_STOPPED` = `OBS_WEBSOCKET_OUTPUT_STOPPED`: The output has stopped. - `OBS_WEBSOCKET_OUTPUT_RECONNECTING` = `OBS_WEBSOCKET_OUTPUT_RECONNECTING`: The output has disconnected and is reconnecting. - `OBS_WEBSOCKET_OUTPUT_RECONNECTED` = `OBS_WEBSOCKET_OUTPUT_RECONNECTED`: The output has reconnected successfully. - `OBS_WEBSOCKET_OUTPUT_PAUSED` = `OBS_WEBSOCKET_OUTPUT_PAUSED`: The output is now paused. - `OBS_WEBSOCKET_OUTPUT_RESUMED` = `OBS_WEBSOCKET_OUTPUT_RESUMED`: The output has been resumed (unpaused). ### ObsMediaInputAction - `OBS_WEBSOCKET_MEDIA_INPUT_ACTION_NONE` = `OBS_WEBSOCKET_MEDIA_INPUT_ACTION_NONE`: No action. - `OBS_WEBSOCKET_MEDIA_INPUT_ACTION_PLAY` = `OBS_WEBSOCKET_MEDIA_INPUT_ACTION_PLAY`: Play the media input. - `OBS_WEBSOCKET_MEDIA_INPUT_ACTION_PAUSE` = `OBS_WEBSOCKET_MEDIA_INPUT_ACTION_PAUSE`: Pause the media input. - `OBS_WEBSOCKET_MEDIA_INPUT_ACTION_STOP` = `OBS_WEBSOCKET_MEDIA_INPUT_ACTION_STOP`: Stop the media input. - `OBS_WEBSOCKET_MEDIA_INPUT_ACTION_RESTART` = `OBS_WEBSOCKET_MEDIA_INPUT_ACTION_RESTART`: Restart the media input. - `OBS_WEBSOCKET_MEDIA_INPUT_ACTION_NEXT` = `OBS_WEBSOCKET_MEDIA_INPUT_ACTION_NEXT`: Go to the next playlist item. - `OBS_WEBSOCKET_MEDIA_INPUT_ACTION_PREVIOUS` = `OBS_WEBSOCKET_MEDIA_INPUT_ACTION_PREVIOUS`: Go to the previous playlist item. ### WebSocketCloseCode - `DontClose` = `0`: For internal use only to tell the request handler not to perform any close action. - `UnknownReason` = `4000`: Unknown reason, should never be used. - `MessageDecodeError` = `4002`: The server was unable to decode the incoming websocket message. - `MissingDataField` = `4003`: A data field is required but missing from the payload. - `InvalidDataFieldType` = `4004`: A data field's value type is invalid. - `InvalidDataFieldValue` = `4005`: A data field's value is invalid. - `UnknownOpCode` = `4006`: The specified `op` was invalid or missing. - `NotIdentified` = `4007`: The client sent a websocket message without first sending `Identify` message. - `AlreadyIdentified` = `4008`: The client sent an `Identify` message while already identified. Note: Once a client has identified, only `Reidentify` may be used to change session parameters. - `AuthenticationFailed` = `4009`: The authentication attempt (via `Identify`) failed. - `UnsupportedRpcVersion` = `4010`: The server detected the usage of an old version of the obs-websocket RPC protocol. - `SessionInvalidated` = `4011`: The websocket session has been invalidated by the obs-websocket server. Note: This is the code used by the `Kick` button in the UI Session List. If you receive this code, you must not automatically reconnect. - `UnsupportedFeature` = `4012`: A requested feature is not supported due to hardware/software limitations. ### WebSocketOpCode - `Hello` = `0`: The initial message sent by obs-websocket to newly connected clients. - `Identify` = `1`: The message sent by a newly connected client to obs-websocket in response to a `Hello`. - `Identified` = `2`: The response sent by obs-websocket to a client after it has successfully identified with obs-websocket. - `Reidentify` = `3`: The message sent by an already-identified client to update identification parameters. - `Event` = `5`: The message sent by obs-websocket containing an event payload. - `Request` = `6`: The message sent by a client to obs-websocket to perform a request. - `RequestResponse` = `7`: The message sent by obs-websocket in response to a particular request from a client. - `RequestBatch` = `8`: The message sent by a client to obs-websocket to perform a batch of requests. - `RequestBatchResponse` = `9`: The message sent by obs-websocket in response to a particular batch of requests from a client. ## Requests ### GetCanvasList Category: canvases. Since 5.7.0. Complexity 3/5. Gets an array of canvases in OBS. Response fields: - `canvases` Array: Array of canvases ### GetPersistentData Category: config. Since 5.0.0. Complexity 2/5. Gets the value of a "slot" from the selected persistent data realm. Request fields: - `realm` String: The data realm to select. `OBS_WEBSOCKET_DATA_REALM_GLOBAL` or `OBS_WEBSOCKET_DATA_REALM_PROFILE` - `slotName` String: The name of the slot to retrieve data from Response fields: - `slotValue` Any: Value associated with the slot. `null` if not set ### SetPersistentData Category: config. Since 5.0.0. Complexity 2/5. Sets the value of a "slot" from the selected persistent data realm. Request fields: - `realm` String: The data realm to select. `OBS_WEBSOCKET_DATA_REALM_GLOBAL` or `OBS_WEBSOCKET_DATA_REALM_PROFILE` - `slotName` String: The name of the slot to retrieve data from - `slotValue` Any: The value to apply to the slot ### GetSceneCollectionList Category: config. Since 5.0.0. Complexity 1/5. Gets an array of all scene collections Response fields: - `currentSceneCollectionName` String: The name of the current scene collection - `sceneCollections` Array: Array of all available scene collections ### SetCurrentSceneCollection Category: config. Since 5.0.0. Complexity 1/5. Switches to a scene collection. Note: This will block until the collection has finished changing. Request fields: - `sceneCollectionName` String: Name of the scene collection to switch to ### CreateSceneCollection Category: config. Since 5.0.0. Complexity 1/5. Creates a new scene collection, switching to it in the process. Note: This will block until the collection has finished changing. Request fields: - `sceneCollectionName` String: Name for the new scene collection ### GetProfileList Category: config. Since 5.0.0. Complexity 1/5. Gets an array of all profiles Response fields: - `currentProfileName` String: The name of the current profile - `profiles` Array: Array of all available profiles ### SetCurrentProfile Category: config. Since 5.0.0. Complexity 1/5. Switches to a profile. Request fields: - `profileName` String: Name of the profile to switch to ### CreateProfile Category: config. Since 5.0.0. Complexity 1/5. Creates a new profile, switching to it in the process Request fields: - `profileName` String: Name for the new profile ### RemoveProfile Category: config. Since 5.0.0. Complexity 1/5. Removes a profile. If the current profile is chosen, it will change to a different profile first. Request fields: - `profileName` String: Name of the profile to remove ### GetProfileParameter Category: config. Since 5.0.0. Complexity 4/5. Gets a parameter from the current profile's configuration. Request fields: - `parameterCategory` String: Category of the parameter to get - `parameterName` String: Name of the parameter to get Response fields: - `parameterValue` String: Value associated with the parameter. `null` if not set and no default - `defaultParameterValue` String: Default value associated with the parameter. `null` if no default ### SetProfileParameter Category: config. Since 5.0.0. Complexity 4/5. Sets the value of a parameter in the current profile's configuration. Request fields: - `parameterCategory` String: Category of the parameter to set - `parameterName` String: Name of the parameter to set - `parameterValue` String: Value of the parameter to set. Use `null` to delete ### GetVideoSettings Category: config. Since 5.0.0. Complexity 2/5. Gets the current video settings. Note: To get the true FPS value, divide the FPS numerator by the FPS denominator. Example: `60000/1001` Response fields: - `fpsNumerator` Number: Numerator of the fractional FPS value - `fpsDenominator` Number: Denominator of the fractional FPS value - `baseWidth` Number: Width of the base (canvas) resolution in pixels - `baseHeight` Number: Height of the base (canvas) resolution in pixels - `outputWidth` Number: Width of the output resolution in pixels - `outputHeight` Number: Height of the output resolution in pixels ### SetVideoSettings Category: config. Since 5.0.0. Complexity 2/5. Sets the current video settings. Note: Fields must be specified in pairs. For example, you cannot set only `baseWidth` without needing to specify `baseHeight`. Request fields: - `fpsNumerator` Number (optional, default Not changed) restrictions: >= 1: Numerator of the fractional FPS value - `fpsDenominator` Number (optional, default Not changed) restrictions: >= 1: Denominator of the fractional FPS value - `baseWidth` Number (optional, default Not changed) restrictions: >= 1, <= 4096: Width of the base (canvas) resolution in pixels - `baseHeight` Number (optional, default Not changed) restrictions: >= 1, <= 4096: Height of the base (canvas) resolution in pixels - `outputWidth` Number (optional, default Not changed) restrictions: >= 1, <= 4096: Width of the output resolution in pixels - `outputHeight` Number (optional, default Not changed) restrictions: >= 1, <= 4096: Height of the output resolution in pixels ### GetStreamServiceSettings Category: config. Since 5.0.0. Complexity 4/5. Gets the current stream service settings (stream destination). Response fields: - `streamServiceType` String: Stream service type, like `rtmp_custom` or `rtmp_common` - `streamServiceSettings` Object: Stream service settings ### SetStreamServiceSettings Category: config. Since 5.0.0. Complexity 4/5. Sets the current stream service settings (stream destination). Note: Simple RTMP settings can be set with type `rtmp_custom` and the settings fields `server` and `key`. Request fields: - `streamServiceType` String: Type of stream service to apply. Example: `rtmp_common` or `rtmp_custom` - `streamServiceSettings` Object: Settings to apply to the service ### GetRecordDirectory Category: config. Since 5.0.0. Complexity 2/5. Gets the current directory that the record output is set to. Response fields: - `recordDirectory` String: Output directory ### SetRecordDirectory Category: config. Since 5.3.0. Complexity 2/5. Sets the current directory that the record output writes files to. Request fields: - `recordDirectory` String: Output directory ### GetSourceFilterKindList Category: filters. Since 5.4.0. Complexity 2/5. Gets an array of all available source filter kinds. Similar to `GetInputKindList` Response fields: - `sourceFilterKinds` Array: Array of source filter kinds ### GetSourceFilterList Category: filters. Since 5.0.0. Complexity 2/5. Gets an array of all of a source's filters. Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the source is in, if using the sourceName field - `sourceName` String (optional, default Unknown): Name of the source - `sourceUuid` String (optional, default Unknown): UUID of the source Response fields: - `filters` Array: Array of filters ### GetSourceFilterDefaultSettings Category: filters. Since 5.0.0. Complexity 3/5. Gets the default settings for a filter kind. Request fields: - `filterKind` String: Filter kind to get the default settings for Response fields: - `defaultFilterSettings` Object: Object of default settings for the filter kind ### CreateSourceFilter Category: filters. Since 5.0.0. Complexity 3/5. Creates a new filter, adding it to the specified source. Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the source is in, if using the sourceName field - `sourceName` String (optional, default Unknown): Name of the source to add the filter to - `sourceUuid` String (optional, default Unknown): UUID of the source to add the filter to - `filterName` String: Name of the new filter to be created - `filterKind` String: The kind of filter to be created - `filterSettings` Object (optional, default Default settings used): Settings object to initialize the filter with ### RemoveSourceFilter Category: filters. Since 5.0.0. Complexity 2/5. Removes a filter from a source. Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the source is in, if using the sourceName field - `sourceName` String (optional, default Unknown): Name of the source the filter is on - `sourceUuid` String (optional, default Unknown): UUID of the source the filter is on - `filterName` String: Name of the filter to remove ### SetSourceFilterName Category: filters. Since 5.0.0. Complexity 2/5. Sets the name of a source filter (rename). Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the source is in, if using the sourceName field - `sourceName` String (optional, default Unknown): Name of the source the filter is on - `sourceUuid` String (optional, default Unknown): UUID of the source the filter is on - `filterName` String: Current name of the filter - `newFilterName` String: New name for the filter ### GetSourceFilter Category: filters. Since 5.0.0. Complexity 2/5. Gets the info for a specific source filter. Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the source is in, if using the sourceName field - `sourceName` String (optional, default Unknown): Name of the source - `sourceUuid` String (optional, default Unknown): UUID of the source - `filterName` String: Name of the filter Response fields: - `filterEnabled` Boolean: Whether the filter is enabled - `filterIndex` Number: Index of the filter in the list, beginning at 0 - `filterKind` String: The kind of filter - `filterSettings` Object: Settings object associated with the filter ### SetSourceFilterIndex Category: filters. Since 5.0.0. Complexity 3/5. Sets the index position of a filter on a source. Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the source is in, if using the sourceName field - `sourceName` String (optional, default Unknown): Name of the source the filter is on - `sourceUuid` String (optional, default Unknown): UUID of the source the filter is on - `filterName` String: Name of the filter - `filterIndex` Number restrictions: >= 0: New index position of the filter ### SetSourceFilterSettings Category: filters. Since 5.0.0. Complexity 3/5. Sets the settings of a source filter. Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the source is in, if using the sourceName field - `sourceName` String (optional, default Unknown): Name of the source the filter is on - `sourceUuid` String (optional, default Unknown): UUID of the source the filter is on - `filterName` String: Name of the filter to set the settings of - `filterSettings` Object: Object of settings to apply - `overlay` Boolean (optional, default true): True == apply the settings on top of existing ones, False == reset the input to its defaults, then apply settings. ### SetSourceFilterEnabled Category: filters. Since 5.0.0. Complexity 3/5. Sets the enable state of a source filter. Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the source is in, if using the sourceName field - `sourceName` String (optional, default Unknown): Name of the source the filter is on - `sourceUuid` String (optional, default Unknown): UUID of the source the filter is on - `filterName` String: Name of the filter - `filterEnabled` Boolean: New enable state of the filter ### GetVersion Category: general. Since 5.0.0. Complexity 1/5. Gets data about the current plugin and RPC version. Response fields: - `obsVersion` String: Current OBS Studio version - `obsWebSocketVersion` String: Current obs-websocket version - `rpcVersion` Number: Current latest obs-websocket RPC version - `availableRequests` Array: Array of available RPC requests for the currently negotiated RPC version - `supportedImageFormats` Array: Image formats available in `GetSourceScreenshot` and `SaveSourceScreenshot` requests. - `platform` String: Name of the platform. Usually `windows`, `macos`, or `ubuntu` (linux flavor). Not guaranteed to be any of those - `platformDescription` String: Description of the platform, like `Windows 10 (10.0)` ### GetStats Category: general. Since 5.0.0. Complexity 2/5. requests). os_cpu_usage_info_query() updates it, and requests run in parallel on the thread pool. */ Gets statistics about OBS, obs-websocket, and the current session. Response fields: - `cpuUsage` Number: CPU usage of OBS in percent since this client's previous `GetStats` (since it connected, for the first) - `memoryUsage` Number: Amount of memory in MB currently being used by OBS - `availableDiskSpace` Number: Available disk space on the device being used for recording storage - `activeFps` Number: Current FPS being rendered - `averageFrameRenderTime` Number: Average time in milliseconds that OBS is taking to render a frame - `renderSkippedFrames` Number: Number of frames skipped by OBS in the render thread - `renderTotalFrames` Number: Total number of frames outputted by the render thread - `outputSkippedFrames` Number: Number of frames skipped by OBS in the output thread - `outputTotalFrames` Number: Total number of frames outputted by the output thread - `gpuAcceleration` Object: GPU acceleration status (`state` green/yellow/red, `adapter`, `detectedGpus`, `summary`, `causes`), or null when the frontend does not report it - `webSocketSessionIncomingMessages` Number: Total number of messages received by obs-websocket from the client - `webSocketSessionOutgoingMessages` Number: Total number of messages sent by obs-websocket to the client ### BroadcastCustomEvent Category: general. Since 5.0.0. Complexity 1/5. Broadcasts a `CustomEvent` to all WebSocket clients. Receivers are clients which are identified and subscribed. Request fields: - `eventData` Object: Data payload to emit to all receivers ### CallVendorRequest Category: general. Since 5.0.0. Complexity 3/5. Call a request registered to a vendor. A vendor is a unique name registered by a third-party plugin or script, which allows for custom requests and events to be added to obs-websocket. If a plugin or script implements vendor requests or events, documentation is expected to be provided with them. Request fields: - `vendorName` String: Name of the vendor to use - `requestType` String: The request type to call - `requestData` Object (optional, default {}): Object containing appropriate request data Response fields: - `vendorName` String: Echoed of `vendorName` - `requestType` String: Echoed of `requestType` - `responseData` Object: Object containing appropriate response data. {} if request does not provide any response data ### GetHotkeyList Category: general. Since 5.0.0. Complexity 4/5. Gets an array of all hotkey names in OBS. Note: Hotkey functionality in obs-websocket comes as-is, and we do not guarantee support if things are broken. In 9/10 usages of hotkey requests, there exists a better, more reliable method via other requests. Response fields: - `hotkeys` Array: Array of hotkey names ### TriggerHotkeyByName Category: general. Since 5.0.0. Complexity 4/5. Triggers a hotkey using its name. See `GetHotkeyList`. Note: Hotkey functionality in obs-websocket comes as-is, and we do not guarantee support if things are broken. In 9/10 usages of hotkey requests, there exists a better, more reliable method via other requests. Request fields: - `hotkeyName` String: Name of the hotkey to trigger - `contextName` String (optional, default Unknown): Name of context of the hotkey to trigger ### TriggerHotkeyByKeySequence Category: general. Since 5.0.0. Complexity 4/5. Triggers a hotkey using a sequence of keys. Note: Hotkey functionality in obs-websocket comes as-is, and we do not guarantee support if things are broken. In 9/10 usages of hotkey requests, there exists a better, more reliable method via other requests. Request fields: - `keyId` String (optional, default Not pressed): The OBS key ID to use. See https://github.com/obsproject/obs-studio/blob/master/libobs/obs-hotkeys.h - `keyModifiers` Object (optional, default Ignored): Object containing key modifiers to apply - `keyModifiers.shift` Boolean (optional, default Not pressed): Press Shift - `keyModifiers.control` Boolean (optional, default Not pressed): Press CTRL - `keyModifiers.alt` Boolean (optional, default Not pressed): Press ALT - `keyModifiers.command` Boolean (optional, default Not pressed): Press CMD (Mac) ### Sleep Category: general. Since 5.0.0. Complexity 2/5. Sleeps for a time duration or number of frames. Only available in request batches with types `SERIAL_REALTIME` or `SERIAL_FRAME`. Request fields: - `sleepMillis` Number (optional, default Unknown) restrictions: >= 0, <= 50000: Number of milliseconds to sleep for (if `SERIAL_REALTIME` mode) - `sleepFrames` Number (optional, default Unknown) restrictions: >= 0, <= 10000: Number of frames to sleep for (if `SERIAL_FRAME` mode) ### GetInputList Category: inputs. Since 5.0.0. Complexity 2/5. renders. Prune every scene now, as the frontend does after it removes a scene. The scenes are collected first, so no enumeration lock is held while a scene takes its video lock. */ Gets an array of all inputs in OBS. Request fields: - `inputKind` String (optional, default All kinds included): Restrict the array to only inputs of the specified kind Response fields: - `inputs` Array: Array of inputs ### GetInputKindList Category: inputs. Since 5.0.0. Complexity 2/5. Gets an array of all available input kinds in OBS. Request fields: - `unversioned` Boolean (optional, default false): True == Return all kinds as unversioned, False == Return with version suffixes (if available) Response fields: - `inputKinds` Array: Array of input kinds ### GetSpecialInputs Category: inputs. Since 5.0.0. Complexity 2/5. Gets the names of all special inputs. Response fields: - `desktop1` String: Name of the Desktop Audio input - `desktop2` String: Name of the Desktop Audio 2 input - `mic1` String: Name of the Mic/Auxiliary Audio input - `mic2` String: Name of the Mic/Auxiliary Audio 2 input - `mic3` String: Name of the Mic/Auxiliary Audio 3 input - `mic4` String: Name of the Mic/Auxiliary Audio 4 input ### CreateInput Category: inputs. Since 5.0.0. Complexity 3/5. Creates a new input, adding it as a scene item to the specified scene. Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene to add the input to as a scene item - `sceneUuid` String (optional, default Unknown): UUID of the scene to add the input to as a scene item - `inputName` String: Name of the new input to created - `inputKind` String: The kind of input to be created - `inputSettings` Object (optional, default Default settings used): Settings object to initialize the input with - `sceneItemEnabled` Boolean (optional, default True): Whether to set the created scene item to enabled or disabled Response fields: - `inputUuid` String: UUID of the newly created input - `sceneItemId` Number: ID of the newly created scene item ### RemoveInput Category: inputs. Since 5.0.0. Complexity 2/5. Removes an existing input. Note: Will immediately remove all associated scene items. Request fields: - `inputName` String (optional, default Unknown): Name of the input to remove - `inputUuid` String (optional, default Unknown): UUID of the input to remove ### SetInputName Category: inputs. Since 5.0.0. Complexity 2/5. Sets the name of an input (rename). Request fields: - `inputName` String (optional, default Unknown): Current input name - `inputUuid` String (optional, default Unknown): Current input UUID - `newInputName` String: New name for the input ### GetInputDefaultSettings Category: inputs. Since 5.0.0. Complexity 3/5. Gets the default settings for an input kind. Request fields: - `inputKind` String: Input kind to get the default settings for Response fields: - `defaultInputSettings` Object: Object of default settings for the input kind ### GetInputSettings Category: inputs. Since 5.0.0. Complexity 3/5. Gets the settings of an input. Note: Does not include defaults. To create the entire settings object, overlay `inputSettings` over the `defaultInputSettings` provided by `GetInputDefaultSettings`. Request fields: - `inputName` String (optional, default Unknown): Name of the input to get the settings of - `inputUuid` String (optional, default Unknown): UUID of the input to get the settings of Response fields: - `inputSettings` Object: Object of settings for the input - `inputKind` String: The kind of the input ### SetInputSettings Category: inputs. Since 5.0.0. Complexity 3/5. Sets the settings of an input. Request fields: - `inputName` String (optional, default Unknown): Name of the input to set the settings of - `inputUuid` String (optional, default Unknown): UUID of the input to set the settings of - `inputSettings` Object: Object of settings to apply - `overlay` Boolean (optional, default true): True == apply the settings on top of existing ones, False == reset the input to its defaults, then apply settings. ### GetInputMute Category: inputs. Since 5.0.0. Complexity 2/5. Gets the audio mute state of an input. Request fields: - `inputName` String (optional, default Unknown): Name of input to get the mute state of - `inputUuid` String (optional, default Unknown): UUID of input to get the mute state of Response fields: - `inputMuted` Boolean: Whether the input is muted ### SetInputMute Category: inputs. Since 5.0.0. Complexity 2/5. Sets the audio mute state of an input. Request fields: - `inputName` String (optional, default Unknown): Name of the input to set the mute state of - `inputUuid` String (optional, default Unknown): UUID of the input to set the mute state of - `inputMuted` Boolean: Whether to mute the input or not ### ToggleInputMute Category: inputs. Since 5.0.0. Complexity 2/5. Toggles the audio mute state of an input. Request fields: - `inputName` String (optional, default Unknown): Name of the input to toggle the mute state of - `inputUuid` String (optional, default Unknown): UUID of the input to toggle the mute state of Response fields: - `inputMuted` Boolean: Whether the input has been muted or unmuted ### GetInputVolume Category: inputs. Since 5.0.0. Complexity 3/5. Gets the current volume setting of an input. Request fields: - `inputName` String (optional, default Unknown): Name of the input to get the volume of - `inputUuid` String (optional, default Unknown): UUID of the input to get the volume of Response fields: - `inputVolumeMul` Number: Volume setting in mul - `inputVolumeDb` Number: Volume setting in dB ### SetInputVolume Category: inputs. Since 5.0.0. Complexity 3/5. Sets the volume setting of an input. Request fields: - `inputName` String (optional, default Unknown): Name of the input to set the volume of - `inputUuid` String (optional, default Unknown): UUID of the input to set the volume of - `inputVolumeMul` Number (optional, default `inputVolumeDb` should be specified) restrictions: >= 0, <= 20: Volume setting in mul - `inputVolumeDb` Number (optional, default `inputVolumeMul` should be specified) restrictions: >= -100, <= 26: Volume setting in dB ### GetInputAudioBalance Category: inputs. Since 5.0.0. Complexity 2/5. Gets the audio balance of an input. Request fields: - `inputName` String (optional, default Unknown): Name of the input to get the audio balance of - `inputUuid` String (optional, default Unknown): UUID of the input to get the audio balance of Response fields: - `inputAudioBalance` Number: Audio balance value from 0.0-1.0 ### SetInputAudioBalance Category: inputs. Since 5.0.0. Complexity 2/5. Sets the audio balance of an input. Request fields: - `inputName` String (optional, default Unknown): Name of the input to set the audio balance of - `inputUuid` String (optional, default Unknown): UUID of the input to set the audio balance of - `inputAudioBalance` Number restrictions: >= 0.0, <= 1.0: New audio balance value ### GetInputAudioSyncOffset Category: inputs. Since 5.0.0. Complexity 3/5. Gets the audio sync offset of an input. Note: The audio sync offset can be negative too! Request fields: - `inputName` String (optional, default Unknown): Name of the input to get the audio sync offset of - `inputUuid` String (optional, default Unknown): UUID of the input to get the audio sync offset of Response fields: - `inputAudioSyncOffset` Number: Audio sync offset in milliseconds ### SetInputAudioSyncOffset Category: inputs. Since 5.0.0. Complexity 3/5. Sets the audio sync offset of an input. Request fields: - `inputName` String (optional, default Unknown): Name of the input to set the audio sync offset of - `inputUuid` String (optional, default Unknown): UUID of the input to set the audio sync offset of - `inputAudioSyncOffset` Number restrictions: >= -950, <= 20000: New audio sync offset in milliseconds ### GetInputAudioMonitorType Category: inputs. Since 5.0.0. Complexity 2/5. Gets the audio monitor type of an input. The available audio monitor types are: - `OBS_MONITORING_TYPE_NONE` - `OBS_MONITORING_TYPE_MONITOR_ONLY` - `OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT` Request fields: - `inputName` String (optional, default Unknown): Name of the input to get the audio monitor type of - `inputUuid` String (optional, default Unknown): UUID of the input to get the audio monitor type of Response fields: - `monitorType` String: Audio monitor type ### SetInputAudioMonitorType Category: inputs. Since 5.0.0. Complexity 2/5. Sets the audio monitor type of an input. Request fields: - `inputName` String (optional, default Unknown): Name of the input to set the audio monitor type of - `inputUuid` String (optional, default Unknown): UUID of the input to set the audio monitor type of - `monitorType` String: Audio monitor type ### GetInputAudioTracks Category: inputs. Since 5.0.0. Complexity 2/5. Gets the enable state of all audio tracks of an input. Request fields: - `inputName` String (optional, default Unknown): Name of the input - `inputUuid` String (optional, default Unknown): UUID of the input Response fields: - `inputAudioTracks` Object: Object of audio tracks and associated enable states ### SetInputAudioTracks Category: inputs. Since 5.0.0. Complexity 2/5. Sets the enable state of audio tracks of an input. Request fields: - `inputName` String (optional, default Unknown): Name of the input - `inputUuid` String (optional, default Unknown): UUID of the input - `inputAudioTracks` Object: Track settings to apply ### GetInputDeinterlaceMode Category: inputs. Since 5.6.0. Complexity 2/5. Gets the deinterlace mode of an input. Deinterlace Modes: - `OBS_DEINTERLACE_MODE_DISABLE` - `OBS_DEINTERLACE_MODE_DISCARD` - `OBS_DEINTERLACE_MODE_RETRO` - `OBS_DEINTERLACE_MODE_BLEND` - `OBS_DEINTERLACE_MODE_BLEND_2X` - `OBS_DEINTERLACE_MODE_LINEAR` - `OBS_DEINTERLACE_MODE_LINEAR_2X` - `OBS_DEINTERLACE_MODE_YADIF` - `OBS_DEINTERLACE_MODE_YADIF_2X` Note: Deinterlacing functionality is restricted to async inputs only. Request fields: - `inputName` String (optional, default Unknown): Name of the input - `inputUuid` String (optional, default Unknown): UUID of the input Response fields: - `inputDeinterlaceMode` String: Deinterlace mode of the input ### SetInputDeinterlaceMode Category: inputs. Since 5.6.0. Complexity 2/5. Sets the deinterlace mode of an input. Note: Deinterlacing functionality is restricted to async inputs only. Request fields: - `inputName` String (optional, default Unknown): Name of the input - `inputUuid` String (optional, default Unknown): UUID of the input - `inputDeinterlaceMode` String: Deinterlace mode for the input ### GetInputDeinterlaceFieldOrder Category: inputs. Since 5.6.0. Complexity 2/5. Gets the deinterlace field order of an input. Deinterlace Field Orders: - `OBS_DEINTERLACE_FIELD_ORDER_TOP` - `OBS_DEINTERLACE_FIELD_ORDER_BOTTOM` Note: Deinterlacing functionality is restricted to async inputs only. Request fields: - `inputName` String (optional, default Unknown): Name of the input - `inputUuid` String (optional, default Unknown): UUID of the input Response fields: - `inputDeinterlaceFieldOrder` String: Deinterlace field order of the input ### SetInputDeinterlaceFieldOrder Category: inputs. Since 5.6.0. Complexity 2/5. Sets the deinterlace field order of an input. Note: Deinterlacing functionality is restricted to async inputs only. Request fields: - `inputName` String (optional, default Unknown): Name of the input - `inputUuid` String (optional, default Unknown): UUID of the input - `inputDeinterlaceFieldOrder` String: Deinterlace field order for the input ### GetInputPropertiesListPropertyItems Category: inputs. Since 5.0.0. Complexity 4/5. Gets the items of a list property from an input's properties. Note: Use this in cases where an input provides a dynamic, selectable list of items. For example, display capture, where it provides a list of available displays. Request fields: - `inputName` String (optional, default Unknown): Name of the input - `inputUuid` String (optional, default Unknown): UUID of the input - `propertyName` String: Name of the list property to get the items of Response fields: - `propertyItems` Array: Array of items in the list property ### PressInputPropertiesButton Category: inputs. Since 5.0.0. Complexity 4/5. Presses a button in the properties of an input. Some known `propertyName` values are: - `refreshnocache` - Browser source reload button Note: Use this in cases where there is a button in the properties of an input that cannot be accessed in any other way. For example, browser sources, where there is a refresh button. Request fields: - `inputName` String (optional, default Unknown): Name of the input - `inputUuid` String (optional, default Unknown): UUID of the input - `propertyName` String: Name of the button property to press ### GetMediaInputStatus Category: media inputs. Since 5.0.0. Complexity 2/5. Gets the status of a media input. Media States: - `OBS_MEDIA_STATE_NONE` - `OBS_MEDIA_STATE_PLAYING` - `OBS_MEDIA_STATE_OPENING` - `OBS_MEDIA_STATE_BUFFERING` - `OBS_MEDIA_STATE_PAUSED` - `OBS_MEDIA_STATE_STOPPED` - `OBS_MEDIA_STATE_ENDED` - `OBS_MEDIA_STATE_ERROR` Request fields: - `inputName` String (optional, default Unknown): Name of the media input - `inputUuid` String (optional, default Unknown): UUID of the media input Response fields: - `mediaState` String: State of the media input - `mediaDuration` Number: Total duration of the playing media in milliseconds. `null` if not playing - `mediaCursor` Number: Position of the cursor in milliseconds. `null` if not playing ### SetMediaInputCursor Category: media inputs. Since 5.0.0. Complexity 2/5. Sets the cursor position of a media input. This request does not perform bounds checking of the cursor position. Request fields: - `inputName` String (optional, default Unknown): Name of the media input - `inputUuid` String (optional, default Unknown): UUID of the media input - `mediaCursor` Number restrictions: >= 0: New cursor position to set ### OffsetMediaInputCursor Category: media inputs. Since 5.0.0. Complexity 2/5. Offsets the current cursor position of a media input by the specified value. This request does not perform bounds checking of the cursor position. Request fields: - `inputName` String (optional, default Unknown): Name of the media input - `inputUuid` String (optional, default Unknown): UUID of the media input - `mediaCursorOffset` Number: Value to offset the current cursor position by ### TriggerMediaInputAction Category: media inputs. Since 5.0.0. Complexity 2/5. Triggers an action on a media input. Request fields: - `inputName` String (optional, default Unknown): Name of the media input - `inputUuid` String (optional, default Unknown): UUID of the media input - `mediaAction` String: Identifier of the `ObsMediaInputAction` enum ### GetVirtualCamStatus Category: outputs. Since 5.0.0. Complexity 1/5. Gets the status of the virtualcam output. Response fields: - `outputActive` Boolean: Whether the output is active ### ToggleVirtualCam Category: outputs. Since 5.0.0. Complexity 1/5. Toggles the state of the virtualcam output. Response fields: - `outputActive` Boolean: Whether the output is active ### StartVirtualCam Category: outputs. Since 5.0.0. Complexity 1/5. Starts the virtualcam output. ### StopVirtualCam Category: outputs. Since 5.0.0. Complexity 1/5. Stops the virtualcam output. ### GetReplayBufferStatus Category: outputs. Since 5.0.0. Complexity 1/5. Gets the status of the replay buffer output. Response fields: - `outputActive` Boolean: Whether the output is active ### ToggleReplayBuffer Category: outputs. Since 5.0.0. Complexity 1/5. Toggles the state of the replay buffer output. Response fields: - `outputActive` Boolean: Whether the output is active ### StartReplayBuffer Category: outputs. Since 5.0.0. Complexity 1/5. Starts the replay buffer output. ### StopReplayBuffer Category: outputs. Since 5.0.0. Complexity 1/5. Stops the replay buffer output. ### SaveReplayBuffer Category: outputs. Since 5.0.0. Complexity 1/5. Saves the contents of the replay buffer output. ### GetLastReplayBufferReplay Category: outputs. Since 5.0.0. Complexity 2/5. Gets the filename of the last replay buffer save file. Response fields: - `savedReplayPath` String: File path ### GetOutputList Category: outputs. Since 5.0.0. Complexity 4/5. Gets the list of available outputs. Response fields: - `outputs` Array: Array of outputs ### GetOutputStatus Category: outputs. Since 5.0.0. Complexity 4/5. Gets the status of an output. Request fields: - `outputName` String: Output name Response fields: - `outputActive` Boolean: Whether the output is active - `outputReconnecting` Boolean: Whether the output is reconnecting - `outputTimecode` String: Current formatted timecode string for the output - `outputDuration` Number: Current duration in milliseconds for the output - `outputCongestion` Number: Congestion of the output - `outputBytes` Number: Number of bytes sent by the output - `outputSkippedFrames` Number: Number of frames skipped by the output's process - `outputTotalFrames` Number: Total number of frames delivered by the output's process ### ToggleOutput Category: outputs. Since 5.0.0. Complexity 4/5. Toggles the status of an output. Request fields: - `outputName` String: Output name Response fields: - `outputActive` Boolean: Whether the output is active ### StartOutput Category: outputs. Since 5.0.0. Complexity 4/5. Starts an output. Request fields: - `outputName` String: Output name ### StopOutput Category: outputs. Since 5.0.0. Complexity 4/5. Stops an output. Request fields: - `outputName` String: Output name ### GetOutputSettings Category: outputs. Since 5.0.0. Complexity 4/5. Gets the settings of an output. Request fields: - `outputName` String: Output name Response fields: - `outputSettings` Object: Output settings ### SetOutputSettings Category: outputs. Since 5.0.0. Complexity 4/5. Sets the settings of an output. Request fields: - `outputName` String: Output name - `outputSettings` Object: Output settings ### GetRecordStatus Category: record. Since 5.0.0. Complexity 2/5. Gets the status of the record output. Response fields: - `outputActive` Boolean: Whether the output is active - `outputPaused` Boolean: Whether the output is paused - `outputTimecode` String: Current formatted timecode string for the output - `outputDuration` Number: Current duration in milliseconds for the output - `outputBytes` Number: Number of bytes sent by the output ### ToggleRecord Category: record. Since 5.0.0. Complexity 1/5. Toggles the status of the record output. Response fields: - `outputActive` Boolean: The new active state of the output ### StartRecord Category: record. Since 5.0.0. Complexity 1/5. Starts the record output. ### StopRecord Category: record. Since 5.0.0. Complexity 1/5. Stops the record output. Response fields: - `outputPath` String: File name for the saved recording ### ToggleRecordPause Category: record. Since 5.0.0. Complexity 1/5. Toggles pause on the record output. ### PauseRecord Category: record. Since 5.0.0. Complexity 1/5. Pauses the record output. ### ResumeRecord Category: record. Since 5.0.0. Complexity 1/5. Resumes the record output. ### SplitRecordFile Category: record. Since 5.5.0. Complexity 2/5. Splits the current file being recorded into a new file. ### CreateRecordChapter Category: record. Since 5.5.0. Complexity 2/5. Adds a new chapter marker to the file currently being recorded. Note: As of OBS 30.2.0, the only file format supporting this feature is Hybrid MP4. Request fields: - `chapterName` String (optional, default Unknown): Name of the new chapter ### GetSceneItemList Category: scene items. Since 5.0.0. Complexity 3/5. Gets a list of all scene items in a scene. Scenes only Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene to get the items of - `sceneUuid` String (optional, default Unknown): UUID of the scene to get the items of Response fields: - `sceneItems` Array: Array of scene items in the scene ### GetGroupSceneItemList Category: scene items. Since 5.0.0. Complexity 3/5. Basically GetSceneItemList, but for groups. Using groups at all in OBS is discouraged, as they are very broken under the hood. Please use nested scenes instead. Groups only Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the group is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the group to get the items of - `sceneUuid` String (optional, default Unknown): UUID of the group to get the items of Response fields: - `sceneItems` Array: Array of scene items in the group ### GetSceneItemId Category: scene items. Since 5.0.0. Complexity 3/5. Searches a scene for a source, and returns its id. Scenes and Groups Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene or group is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene or group to search in - `sceneUuid` String (optional, default Unknown): UUID of the scene or group to search in - `sourceName` String: Name of the source to find - `searchOffset` Number (optional, default 0) restrictions: >= -1: Number of matches to skip during search. >= 0 means first forward. -1 means last (top) item Response fields: - `sceneItemId` Number: Numeric ID of the scene item ### GetSceneItemSource Category: scene items. Since 5.4.0. Complexity 3/5. Gets the source associated with a scene item. Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene the item is in - `sceneUuid` String (optional, default Unknown): UUID of the scene the item is in - `sceneItemId` Number restrictions: >= 0: Numeric ID of the scene item Response fields: - `sourceName` String: Name of the source associated with the scene item - `sourceUuid` String: UUID of the source associated with the scene item ### CreateSceneItem Category: scene items. Since 5.0.0. Complexity 3/5. Creates a new scene item using a source. Scenes only Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene to create the new item in - `sceneUuid` String (optional, default Unknown): UUID of the scene to create the new item in - `sourceName` String (optional, default Unknown): Name of the source to add to the scene - `sourceUuid` String (optional, default Unknown): UUID of the source to add to the scene - `sceneItemEnabled` Boolean (optional, default True): Enable state to apply to the scene item on creation Response fields: - `sceneItemId` Number: Numeric ID of the scene item ### RemoveSceneItem Category: scene items. Since 5.0.0. Complexity 3/5. Removes a scene item from a scene. Scenes only Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene the item is in - `sceneUuid` String (optional, default Unknown): UUID of the scene the item is in - `sceneItemId` Number restrictions: >= 0: Numeric ID of the scene item ### DuplicateSceneItem Category: scene items. Since 5.0.0. Complexity 3/5. Duplicates a scene item, copying all transform and crop info. Scenes only Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene the item is in - `sceneUuid` String (optional, default Unknown): UUID of the scene the item is in - `sceneItemId` Number restrictions: >= 0: Numeric ID of the scene item - `destinationSceneName` String (optional, default From scene is assumed): Name of the scene to create the duplicated item in - `destinationSceneUuid` String (optional, default From scene is assumed): UUID of the scene to create the duplicated item in Response fields: - `sceneItemId` Number: Numeric ID of the duplicated scene item ### GetSceneItemTransform Category: scene items. Since 5.0.0. Complexity 3/5. Gets the transform and crop info of a scene item. Scenes and Groups Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene the item is in - `sceneUuid` String (optional, default Unknown): UUID of the scene the item is in - `sceneItemId` Number restrictions: >= 0: Numeric ID of the scene item Response fields: - `sceneItemTransform` Object: Object containing scene item transform info ### SetSceneItemTransform Category: scene items. Since 5.0.0. Complexity 3/5. Sets the transform and crop info of a scene item. Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene the item is in - `sceneUuid` String (optional, default Unknown): UUID of the scene the item is in - `sceneItemId` Number restrictions: >= 0: Numeric ID of the scene item - `sceneItemTransform` Object: Object containing scene item transform info to update ### GetSceneItemEnabled Category: scene items. Since 5.0.0. Complexity 3/5. Gets the enable state of a scene item. Scenes and Groups Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene the item is in - `sceneUuid` String (optional, default Unknown): UUID of the scene the item is in - `sceneItemId` Number restrictions: >= 0: Numeric ID of the scene item Response fields: - `sceneItemEnabled` Boolean: Whether the scene item is enabled. `true` for enabled, `false` for disabled ### SetSceneItemEnabled Category: scene items. Since 5.0.0. Complexity 3/5. Sets the enable state of a scene item. Scenes and Groups Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene the item is in - `sceneUuid` String (optional, default Unknown): UUID of the scene the item is in - `sceneItemId` Number restrictions: >= 0: Numeric ID of the scene item - `sceneItemEnabled` Boolean: New enable state of the scene item ### GetSceneItemLocked Category: scene items. Since 5.0.0. Complexity 3/5. Gets the lock state of a scene item. Scenes and Groups Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene the item is in - `sceneUuid` String (optional, default Unknown): UUID of the scene the item is in - `sceneItemId` Number restrictions: >= 0: Numeric ID of the scene item Response fields: - `sceneItemLocked` Boolean: Whether the scene item is locked. `true` for locked, `false` for unlocked ### SetSceneItemLocked Category: scene items. Since 5.0.0. Complexity 3/5. Sets the lock state of a scene item. Scenes and Group Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene the item is in - `sceneUuid` String (optional, default Unknown): UUID of the scene the item is in - `sceneItemId` Number restrictions: >= 0: Numeric ID of the scene item - `sceneItemLocked` Boolean: New lock state of the scene item ### GetSceneItemIndex Category: scene items. Since 5.0.0. Complexity 3/5. Gets the index position of a scene item in a scene. An index of 0 is at the bottom of the source list in the UI. Scenes and Groups Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene the item is in - `sceneUuid` String (optional, default Unknown): UUID of the scene the item is in - `sceneItemId` Number restrictions: >= 0: Numeric ID of the scene item Response fields: - `sceneItemIndex` Number: Index position of the scene item ### SetSceneItemIndex Category: scene items. Since 5.0.0. Complexity 3/5. Sets the index position of a scene item in a scene. Scenes and Groups Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene the item is in - `sceneUuid` String (optional, default Unknown): UUID of the scene the item is in - `sceneItemId` Number restrictions: >= 0: Numeric ID of the scene item - `sceneItemIndex` Number restrictions: >= 0: New index position of the scene item ### GetSceneItemBlendMode Category: scene items. Since 5.0.0. Complexity 2/5. Gets the blend mode of a scene item. Blend modes: - `OBS_BLEND_NORMAL` - `OBS_BLEND_ADDITIVE` - `OBS_BLEND_SUBTRACT` - `OBS_BLEND_SCREEN` - `OBS_BLEND_MULTIPLY` - `OBS_BLEND_LIGHTEN` - `OBS_BLEND_DARKEN` Scenes and Groups Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene the item is in - `sceneUuid` String (optional, default Unknown): UUID of the scene the item is in - `sceneItemId` Number restrictions: >= 0: Numeric ID of the scene item Response fields: - `sceneItemBlendMode` String: Current blend mode ### SetSceneItemBlendMode Category: scene items. Since 5.0.0. Complexity 2/5. Sets the blend mode of a scene item. Scenes and Groups Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene the item is in - `sceneUuid` String (optional, default Unknown): UUID of the scene the item is in - `sceneItemId` Number restrictions: >= 0: Numeric ID of the scene item - `sceneItemBlendMode` String: New blend mode ### GetSceneList Category: scenes. Since 5.0.0. Complexity 2/5. Gets an array of scenes in OBS. Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scenes are in Response fields: - `currentProgramSceneName` String: Current program scene name. Can be `null` if non-main canvas or internal state desync - `currentProgramSceneUuid` String: Current program scene UUID. Can be `null` if non-main canvas or internal state desync - `currentPreviewSceneName` String: Current preview scene name. `null` if not in studio mode or non-main canvas - `currentPreviewSceneUuid` String: Current preview scene UUID. `null` if not in studio mode or non-main canvas - `scenes` Array: Array of scenes ### GetGroupList Category: scenes. Since 5.0.0. Complexity 2/5. Gets an array of all groups in OBS. Groups in OBS are actually scenes, but renamed and modified. In obs-websocket, we treat them as scenes where we can. Response fields: - `groups` Array: Array of group names ### GetCurrentProgramScene Category: scenes. Since 5.0.0. Complexity 1/5. Gets the current program scene. Note 1: This request is slated to have the `currentProgram`-prefixed fields removed from in an upcoming RPC version. Note 2: Canvases do not have any concept of a program or preview scene, so this request does not support canvases. Response fields: - `sceneName` String: Current program scene name. `null` if there is no program scene - `sceneUuid` String: Current program scene UUID. `null` if there is no program scene - `currentProgramSceneName` String: Current program scene name (Deprecated) - `currentProgramSceneUuid` String: Current program scene UUID (Deprecated) ### SetCurrentProgramScene Category: scenes. Since 5.0.0. Complexity 1/5. Sets the current program scene. Request fields: - `sceneName` String (optional, default Unknown): Scene name to set as the current program scene - `sceneUuid` String (optional, default Unknown): Scene UUID to set as the current program scene ### GetCurrentPreviewScene Category: scenes. Since 5.0.0. Complexity 1/5. Gets the current preview scene. Only available when studio mode is enabled. Note: This request is slated to have the `currentPreview`-prefixed fields removed from in an upcoming RPC version. Response fields: - `sceneName` String: Current preview scene name. `null` if there is no preview scene - `sceneUuid` String: Current preview scene UUID. `null` if there is no preview scene - `currentPreviewSceneName` String: Current preview scene name - `currentPreviewSceneUuid` String: Current preview scene UUID ### SetCurrentPreviewScene Category: scenes. Since 5.0.0. Complexity 1/5. Sets the current preview scene. Only available when studio mode is enabled. Request fields: - `sceneName` String (optional, default Unknown): Scene name to set as the current preview scene - `sceneUuid` String (optional, default Unknown): Scene UUID to set as the current preview scene ### CreateScene Category: scenes. Since 5.0.0. Complexity 2/5. Creates a new scene in OBS. Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas to create the new scene in. Leave default to assume main canvas - `sceneName` String: Name for the new scene Response fields: - `sceneUuid` String: UUID of the created scene ### RemoveScene Category: scenes. Since 5.0.0. Complexity 2/5. Removes a scene from OBS. Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene to remove - `sceneUuid` String (optional, default Unknown): UUID of the scene to remove ### SetSceneName Category: scenes. Since 5.0.0. Complexity 2/5. Sets the name of a scene (rename). Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene to be renamed - `sceneUuid` String (optional, default Unknown): UUID of the scene to be renamed - `newSceneName` String: New name for the scene ### GetSceneSceneTransitionOverride Category: scenes. Since 5.0.0. Complexity 2/5. Gets the scene transition overridden for a scene. Note: A transition UUID response field is not currently able to be implemented as of 2024-1-18. Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene - `sceneUuid` String (optional, default Unknown): UUID of the scene Response fields: - `transitionName` String: Name of the overridden scene transition, else `null` - `transitionDuration` Number: Duration of the overridden scene transition, else `null` ### SetSceneSceneTransitionOverride Category: scenes. Since 5.0.0. Complexity 2/5. Sets the scene transition overridden for a scene. Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the scene is in, if using the sceneName field - `sceneName` String (optional, default Unknown): Name of the scene - `sceneUuid` String (optional, default Unknown): UUID of the scene - `transitionName` String (optional, default Unchanged): Name of the scene transition to use as override. Specify `null` to remove - `transitionDuration` Number (optional, default Unchanged) restrictions: >= 50, <= 20000: Duration to use for any overridden transition. Specify `null` to remove ### GetSourceActive Category: sources. Since 5.0.0. Complexity 2/5. Gets the active and show state of a source. **Compatible with inputs and scenes.** Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the source is in, if using sourceName field - `sourceName` String (optional, default Unknown): Name of the source to get the active state of - `sourceUuid` String (optional, default Unknown): UUID of the source to get the active state of Response fields: - `videoActive` Boolean: Whether the source is showing in Program - `videoShowing` Boolean: Whether the source is showing in the UI (Preview, Projector, Properties) ### GetSourceScreenshot Category: sources. Since 5.0.0. Complexity 4/5. Gets a Base64-encoded screenshot of a source. The `imageWidth` and `imageHeight` parameters are treated as "scale to inner", meaning the smallest ratio will be used and the aspect ratio of the original resolution is kept. If `imageWidth` and `imageHeight` are not specified, the compressed image will use the full resolution of the source. **Compatible with inputs and scenes.** Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the source is in, if using sourceName field - `sourceName` String (optional, default Unknown): Name of the source to take a screenshot of - `sourceUuid` String (optional, default Unknown): UUID of the source to take a screenshot of - `imageFormat` String: Image compression format to use. Use `GetVersion` to get compatible image formats - `imageWidth` Number (optional, default Source value is used) restrictions: >= 8, <= 4096: Width to scale the screenshot to - `imageHeight` Number (optional, default Source value is used) restrictions: >= 8, <= 4096: Height to scale the screenshot to - `imageCompressionQuality` Number (optional, default -1) restrictions: >= -1, <= 100: Compression quality to use. 0 for high compression, 100 for uncompressed. -1 to use "default" (whatever that means, idk) Response fields: - `imageData` String: Base64-encoded screenshot ### SaveSourceScreenshot Category: sources. Since 5.0.0. Complexity 3/5. Saves a screenshot of a source to the filesystem. The `imageWidth` and `imageHeight` parameters are treated as "scale to inner", meaning the smallest ratio will be used and the aspect ratio of the original resolution is kept. If `imageWidth` and `imageHeight` are not specified, the compressed image will use the full resolution of the source. **Compatible with inputs and scenes.** Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the source is in, if using sourceName field - `sourceName` String (optional, default Unknown): Name of the source to take a screenshot of - `sourceUuid` String (optional, default Unknown): UUID of the source to take a screenshot of - `imageFormat` String: Image compression format to use. Use `GetVersion` to get compatible image formats - `imageFilePath` String: Path to save the screenshot file to. Eg. `C:\Users\user\Desktop\screenshot.png` - `imageWidth` Number (optional, default Source value is used) restrictions: >= 8, <= 4096: Width to scale the screenshot to - `imageHeight` Number (optional, default Source value is used) restrictions: >= 8, <= 4096: Height to scale the screenshot to - `imageCompressionQuality` Number (optional, default -1) restrictions: >= -1, <= 100: Compression quality to use. 0 for high compression, 100 for uncompressed. -1 to use "default" (whatever that means, idk) ### GetStreamStatus Category: stream. Since 5.0.0. Complexity 2/5. Gets the status of the stream output. Response fields: - `outputActive` Boolean: Whether the output is active - `outputReconnecting` Boolean: Whether the output is currently reconnecting - `outputTimecode` String: Current formatted timecode string for the output - `outputDuration` Number: Current duration in milliseconds for the output - `outputCongestion` Number: Congestion of the output - `outputBytes` Number: Number of bytes sent by the output - `outputSkippedFrames` Number: Number of frames skipped by the output's process - `outputTotalFrames` Number: Total number of frames delivered by the output's process ### ToggleStream Category: stream. Since 5.0.0. Complexity 1/5. Toggles the status of the stream output. Response fields: - `outputActive` Boolean: New state of the stream output ### StartStream Category: stream. Since 5.0.0. Complexity 1/5. Starts the stream output. ### StopStream Category: stream. Since 5.0.0. Complexity 1/5. Stops the stream output. ### SendStreamCaption Category: stream. Since 5.0.0. Complexity 2/5. Sends CEA-608 caption text over the stream output. Request fields: - `captionText` String: Caption text ### GetTransitionKindList Category: transitions. Since 5.0.0. Complexity 2/5. Gets an array of all available transition kinds. Similar to `GetInputKindList` Response fields: - `transitionKinds` Array: Array of transition kinds ### GetSceneTransitionList Category: transitions. Since 5.0.0. Complexity 3/5. Gets an array of all scene transitions in OBS. Response fields: - `currentSceneTransitionName` String: Name of the current scene transition. Can be null - `currentSceneTransitionUuid` String: UUID of the current scene transition. Can be null - `currentSceneTransitionKind` String: Kind of the current scene transition. Can be null - `transitions` Array: Array of transitions ### GetCurrentSceneTransition Category: transitions. Since 5.0.0. Complexity 2/5. Gets information about the current scene transition. Response fields: - `transitionName` String: Name of the transition - `transitionUuid` String: UUID of the transition - `transitionKind` String: Kind of the transition - `transitionFixed` Boolean: Whether the transition uses a fixed (unconfigurable) duration - `transitionDuration` Number: Configured transition duration in milliseconds. `null` if transition is fixed - `transitionConfigurable` Boolean: Whether the transition supports being configured - `transitionSettings` Object: Object of settings for the transition. `null` if transition is not configurable ### SetCurrentSceneTransition Category: transitions. Since 5.0.0. Complexity 2/5. Sets the current scene transition. Small note: While the namespace of scene transitions is generally unique, that uniqueness is not a guarantee as it is with other resources like inputs. Request fields: - `transitionName` String: Name of the transition to make active ### SetCurrentSceneTransitionDuration Category: transitions. Since 5.0.0. Complexity 2/5. Sets the duration of the current scene transition, if it is not fixed. Request fields: - `transitionDuration` Number restrictions: >= 50, <= 20000: Duration in milliseconds ### SetCurrentSceneTransitionSettings Category: transitions. Since 5.0.0. Complexity 3/5. Sets the settings of the current scene transition. Request fields: - `transitionSettings` Object: Settings object to apply to the transition. Can be `{}` - `overlay` Boolean (optional, default true): Whether to overlay over the current settings or replace them ### GetCurrentSceneTransitionCursor Category: transitions. Since 5.0.0. Complexity 2/5. Gets the cursor position of the current scene transition. Note: `transitionCursor` will return 1.0 when the transition is inactive. Response fields: - `transitionCursor` Number: Cursor position, between 0.0 and 1.0 ### TriggerStudioModeTransition Category: transitions. Since 5.0.0. Complexity 1/5. Triggers the current scene transition. Same functionality as the `Transition` button in studio mode. ### SetTBarPosition Category: transitions. Since 5.0.0. Complexity 3/5. Sets the position of the TBar. **Very important note**: This will be deprecated and replaced in a future version of obs-websocket. Request fields: - `position` Number restrictions: >= 0.0, <= 1.0: New position - `release` Boolean (optional, default `true`): Whether to release the TBar. Only set `false` if you know that you will be sending another position update ### GetStudioModeEnabled Category: ui. Since 5.0.0. Complexity 1/5. Gets whether studio is enabled. Response fields: - `studioModeEnabled` Boolean: Whether studio mode is enabled ### SetStudioModeEnabled Category: ui. Since 5.0.0. Complexity 1/5. Enables or disables studio mode Request fields: - `studioModeEnabled` Boolean: True == Enabled, False == Disabled ### OpenInputPropertiesDialog Category: ui. Since 5.0.0. Complexity 1/5. Opens the properties dialog of an input. Request fields: - `inputName` String (optional, default Unknown): Name of the input to open the dialog of - `inputUuid` String (optional, default Unknown): UUID of the input to open the dialog of ### OpenInputFiltersDialog Category: ui. Since 5.0.0. Complexity 1/5. Opens the filters dialog of an input. Request fields: - `inputName` String (optional, default Unknown): Name of the input to open the dialog of - `inputUuid` String (optional, default Unknown): UUID of the input to open the dialog of ### OpenInputInteractDialog Category: ui. Since 5.0.0. Complexity 1/5. Opens the interact dialog of an input. Request fields: - `inputName` String (optional, default Unknown): Name of the input to open the dialog of - `inputUuid` String (optional, default Unknown): UUID of the input to open the dialog of ### GetMonitorList Category: ui. Since 5.0.0. Complexity 2/5. Gets a list of connected monitors and information about them. Response fields: - `monitors` Array: a list of detected monitors with some information ### OpenVideoMixProjector Category: ui. Since 5.0.0. Complexity 3/5. Opens a projector for a specific output video mix. Mix types: - `OBS_WEBSOCKET_VIDEO_MIX_TYPE_PREVIEW` - `OBS_WEBSOCKET_VIDEO_MIX_TYPE_PROGRAM` - `OBS_WEBSOCKET_VIDEO_MIX_TYPE_MULTIVIEW` Note: This request serves to provide feature parity with 4.x. It is very likely to be changed/deprecated in a future release. Request fields: - `videoMixType` String: Type of mix to open - `monitorIndex` Number (optional, default -1: Opens projector in windowed mode): Monitor index, use `GetMonitorList` to obtain index - `projectorGeometry` String (optional, default N/A): Size/Position data for a windowed projector, in Qt Base64 encoded format. Mutually exclusive with `monitorIndex` ### OpenSourceProjector Category: ui. Since 5.0.0. Complexity 3/5. Opens a projector for a source. Note: This request serves to provide feature parity with 4.x. It is very likely to be changed/deprecated in a future release. Request fields: - `canvasUuid` String (optional, default Unknown): UUID of the canvas the source is in, if using the sourceName field - `sourceName` String (optional, default Unknown): Name of the source to open a projector for - `sourceUuid` String (optional, default Unknown): UUID of the source to open a projector for - `monitorIndex` Number (optional, default -1: Opens projector in windowed mode): Monitor index, use `GetMonitorList` to obtain index - `projectorGeometry` String (optional, default N/A): Size/Position data for a windowed projector, in Qt Base64 encoded format. Mutually exclusive with `monitorIndex` ## Events ### CanvasCreated Category: canvases. Subscription: Canvases. Since 5.7.0. A new canvas has been created. - `canvasName` String: Name of the new canvas - `canvasUuid` String: UUID of the new canvas ### CanvasRemoved Category: canvases. Subscription: Canvases. Since 5.7.0. A canvas has been removed. - `canvasName` String: Name of the removed canvas - `canvasUuid` String: UUID of the removed canvas ### CanvasNameChanged Category: canvases. Subscription: Canvases. Since 5.7.0. The name of a canvas has changed. - `canvasUuid` String: UUID of the canvas - `oldCanvasName` String: Old name of the canvas - `canvasName` String: New name of the canvas ### CurrentSceneCollectionChanging Category: config. Subscription: Config. Since 5.0.0. The current scene collection has begun changing. Note: We recommend using this event to trigger a pause of all polling requests, as performing any requests during a scene collection change is considered undefined behavior and can cause crashes! - `sceneCollectionName` String: Name of the current scene collection ### CurrentSceneCollectionChanged Category: config. Subscription: Config. Since 5.0.0. The current scene collection has changed. Note: If polling has been paused during `CurrentSceneCollectionChanging`, this is the que to restart polling. - `sceneCollectionName` String: Name of the new scene collection ### SceneCollectionListChanged Category: config. Subscription: Config. Since 5.0.0. The scene collection list has changed. - `sceneCollections` Array: Updated list of scene collections ### CurrentProfileChanging Category: config. Subscription: Config. Since 5.0.0. The current profile has begun changing. - `profileName` String: Name of the current profile ### CurrentProfileChanged Category: config. Subscription: Config. Since 5.0.0. The current profile has changed. - `profileName` String: Name of the new profile ### ProfileListChanged Category: config. Subscription: Config. Since 5.0.0. The profile list has changed. - `profiles` Array: Updated list of profiles ### SourceFilterListReindexed Category: filters. Subscription: Filters. Since 5.0.0. A source's filter list has been reindexed. - `sourceName` String: Name of the source - `filters` Array: Array of filter objects ### SourceFilterCreated Category: filters. Subscription: Filters. Since 5.0.0. A filter has been added to a source. - `sourceName` String: Name of the source the filter was added to - `filterName` String: Name of the filter - `filterKind` String: The kind of the filter - `filterIndex` Number: Index position of the filter - `filterSettings` Object: The settings configured to the filter when it was created - `defaultFilterSettings` Object: The default settings for the filter ### SourceFilterRemoved Category: filters. Subscription: Filters. Since 5.0.0. A filter has been removed from a source. - `sourceName` String: Name of the source the filter was on - `filterName` String: Name of the filter ### SourceFilterNameChanged Category: filters. Subscription: Filters. Since 5.0.0. The name of a source filter has changed. - `sourceName` String: The source the filter is on - `oldFilterName` String: Old name of the filter - `filterName` String: New name of the filter ### SourceFilterSettingsChanged Category: filters. Subscription: Filters. Since 5.4.0. An source filter's settings have changed (been updated). - `sourceName` String: Name of the source the filter is on - `filterName` String: Name of the filter - `filterSettings` Object: New settings object of the filter ### SourceFilterEnableStateChanged Category: filters. Subscription: Filters. Since 5.0.0. A source filter's enable state has changed. - `sourceName` String: Name of the source the filter is on - `filterName` String: Name of the filter - `filterEnabled` Boolean: Whether the filter is enabled ### ExitStarted Category: general. Subscription: General. Since 5.0.0. OBS has begun the shutdown process. ### InputCreated Category: inputs. Subscription: Inputs. Since 5.0.0. An input has been created. - `inputName` String: Name of the input - `inputUuid` String: UUID of the input - `inputKind` String: The kind of the input - `unversionedInputKind` String: The unversioned kind of input (aka no `_v2` stuff) - `inputKindCaps` Number: Bitflag value for the caps that an input supports. See obs_source_info.output_flags in the libobs docs - `inputSettings` Object: The settings configured to the input when it was created - `defaultInputSettings` Object: The default settings for the input ### InputRemoved Category: inputs. Subscription: Inputs. Since 5.0.0. An input has been removed. - `inputName` String: Name of the input - `inputUuid` String: UUID of the input ### InputNameChanged Category: inputs. Subscription: Inputs. Since 5.0.0. The name of an input has changed. - `inputUuid` String: UUID of the input - `oldInputName` String: Old name of the input - `inputName` String: New name of the input ### InputSettingsChanged Category: inputs. Subscription: Inputs. Since 5.4.0. An input's settings have changed (been updated). Note: On some inputs, changing values in the properties dialog will cause an immediate update. Pressing the "Cancel" button will revert the settings, resulting in another event being fired. - `inputName` String: Name of the input - `inputUuid` String: UUID of the input - `inputSettings` Object: New settings object of the input ### InputActiveStateChanged Category: inputs. Subscription: InputActiveStateChanged. Since 5.0.0. An input's active state has changed. When an input is active, it means it's being shown by the program feed. - `inputName` String: Name of the input - `inputUuid` String: UUID of the input - `videoActive` Boolean: Whether the input is active ### InputShowStateChanged Category: inputs. Subscription: InputShowStateChanged. Since 5.0.0. An input's show state has changed. When an input is showing, it means it's being shown by the preview or a dialog. - `inputName` String: Name of the input - `inputUuid` String: UUID of the input - `videoShowing` Boolean: Whether the input is showing ### InputMuteStateChanged Category: inputs. Subscription: Inputs. Since 5.0.0. An input's mute state has changed. - `inputName` String: Name of the input - `inputUuid` String: UUID of the input - `inputMuted` Boolean: Whether the input is muted ### InputVolumeChanged Category: inputs. Subscription: Inputs. Since 5.0.0. An input's volume level has changed. - `inputName` String: Name of the input - `inputUuid` String: UUID of the input - `inputVolumeMul` Number: New volume level multiplier - `inputVolumeDb` Number: New volume level in dB ### InputAudioBalanceChanged Category: inputs. Subscription: Inputs. Since 5.0.0. The audio balance value of an input has changed. - `inputName` String: Name of the input - `inputUuid` String: UUID of the input - `inputAudioBalance` Number: New audio balance value of the input ### InputAudioSyncOffsetChanged Category: inputs. Subscription: Inputs. Since 5.0.0. The sync offset of an input has changed. - `inputName` String: Name of the input - `inputUuid` String: UUID of the input - `inputAudioSyncOffset` Number: New sync offset in milliseconds ### InputAudioTracksChanged Category: inputs. Subscription: Inputs. Since 5.0.0. The audio tracks of an input have changed. - `inputName` String: Name of the input - `inputUuid` String: UUID of the input - `inputAudioTracks` Object: Object of audio tracks along with their associated enable states ### InputAudioMonitorTypeChanged Category: inputs. Subscription: Inputs. Since 5.0.0. The monitor type of an input has changed. Available types are: - `OBS_MONITORING_TYPE_NONE` - `OBS_MONITORING_TYPE_MONITOR_ONLY` - `OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT` - `inputName` String: Name of the input - `inputUuid` String: UUID of the input - `monitorType` String: New monitor type of the input ### InputVolumeMeters Category: inputs. Subscription: InputVolumeMeters. Since 5.0.0. A high-volume event providing volume levels of all active inputs every 50 milliseconds. - `inputs` Array: Array of active inputs with their associated volume levels ### MediaInputPlaybackStarted Category: media inputs. Subscription: MediaInputs. Since 5.0.0. A media input has started playing. - `inputName` String: Name of the input - `inputUuid` String: UUID of the input ### MediaInputPlaybackEnded Category: media inputs. Subscription: MediaInputs. Since 5.0.0. A media input has finished playing. - `inputName` String: Name of the input - `inputUuid` String: UUID of the input ### MediaInputActionTriggered Category: media inputs. Subscription: MediaInputs. Since 5.0.0. An action has been performed on an input. - `inputName` String: Name of the input - `inputUuid` String: UUID of the input - `mediaAction` String: Action performed on the input. See `ObsMediaInputAction` enum ### StreamStateChanged Category: outputs. Subscription: Outputs. Since 5.0.0. The state of the stream output has changed. - `outputActive` Boolean: Whether the output is active - `outputState` String: The specific state of the output ### RecordStateChanged Category: outputs. Subscription: Outputs. Since 5.0.0. The state of the record output has changed. - `outputActive` Boolean: Whether the output is active - `outputState` String: The specific state of the output - `outputPath` String: File name for the saved recording, if record stopped. `null` otherwise ### RecordFileChanged Category: outputs. Subscription: Outputs. Since 5.5.0. The record output has started writing to a new file. For example, when a file split happens. - `newOutputPath` String: File name that the output has begun writing to ### ReplayBufferStateChanged Category: outputs. Subscription: Outputs. Since 5.0.0. The state of the replay buffer output has changed. - `outputActive` Boolean: Whether the output is active - `outputState` String: The specific state of the output ### VirtualcamStateChanged Category: outputs. Subscription: Outputs. Since 5.0.0. The state of the virtualcam output has changed. - `outputActive` Boolean: Whether the output is active - `outputState` String: The specific state of the output ### ReplayBufferSaved Category: outputs. Subscription: Outputs. Since 5.0.0. The replay buffer has been saved. - `savedReplayPath` String: Path of the saved replay file ### SceneItemCreated Category: scene items. Subscription: SceneItems. Since 5.0.0. A scene item has been created. - `sceneName` String: Name of the scene the item was added to - `sceneUuid` String: UUID of the scene the item was added to - `sourceName` String: Name of the underlying source (input/scene) - `sourceUuid` String: UUID of the underlying source (input/scene) - `sceneItemId` Number: Numeric ID of the scene item - `sceneItemIndex` Number: Index position of the item ### SceneItemRemoved Category: scene items. Subscription: SceneItems. Since 5.0.0. A scene item has been removed. This event is not emitted when the scene the item is in is removed. - `sceneName` String: Name of the scene the item was removed from - `sceneUuid` String: UUID of the scene the item was removed from - `sourceName` String: Name of the underlying source (input/scene) - `sourceUuid` String: UUID of the underlying source (input/scene) - `sceneItemId` Number: Numeric ID of the scene item ### SceneItemListReindexed Category: scene items. Subscription: SceneItems. Since 5.0.0. A scene's item list has been reindexed. - `sceneName` String: Name of the scene - `sceneUuid` String: UUID of the scene - `sceneItems` Array: Array of scene item objects ### SceneItemEnableStateChanged Category: scene items. Subscription: SceneItems. Since 5.0.0. A scene item's enable state has changed. - `sceneName` String: Name of the scene the item is in - `sceneUuid` String: UUID of the scene the item is in - `sceneItemId` Number: Numeric ID of the scene item - `sceneItemEnabled` Boolean: Whether the scene item is enabled (visible) ### SceneItemLockStateChanged Category: scene items. Subscription: SceneItems. Since 5.0.0. A scene item's lock state has changed. - `sceneName` String: Name of the scene the item is in - `sceneUuid` String: UUID of the scene the item is in - `sceneItemId` Number: Numeric ID of the scene item - `sceneItemLocked` Boolean: Whether the scene item is locked ### SceneItemSelected Category: scene items. Subscription: SceneItems. Since 5.0.0. A scene item has been selected in the Ui. - `sceneName` String: Name of the scene the item is in - `sceneUuid` String: UUID of the scene the item is in - `sceneItemId` Number: Numeric ID of the scene item ### SceneItemTransformChanged Category: scene items. Subscription: SceneItemTransformChanged. Since 5.0.0. The transform/crop of a scene item has changed. - `sceneName` String: The name of the scene the item is in - `sceneUuid` String: The UUID of the scene the item is in - `sceneItemId` Number: Numeric ID of the scene item - `sceneItemTransform` Object: New transform/crop info of the scene item ### SceneCreated Category: scenes. Subscription: Scenes. Since 5.0.0. A new scene has been created. - `sceneName` String: Name of the new scene - `sceneUuid` String: UUID of the new scene - `isGroup` Boolean: Whether the new scene is a group ### SceneRemoved Category: scenes. Subscription: Scenes. Since 5.0.0. A scene has been removed. - `sceneName` String: Name of the removed scene - `sceneUuid` String: UUID of the removed scene - `isGroup` Boolean: Whether the scene was a group ### SceneNameChanged Category: scenes. Subscription: Scenes. Since 5.0.0. The name of a scene has changed. - `sceneUuid` String: UUID of the scene - `oldSceneName` String: Old name of the scene - `sceneName` String: New name of the scene ### CurrentProgramSceneChanged Category: scenes. Subscription: Scenes. Since 5.0.0. The current program scene has changed. - `sceneName` String: Name of the scene that was switched to - `sceneUuid` String: UUID of the scene that was switched to ### CurrentPreviewSceneChanged Category: scenes. Subscription: Scenes. Since 5.0.0. The current preview scene has changed. - `sceneName` String: Name of the scene that was switched to - `sceneUuid` String: UUID of the scene that was switched to ### SceneListChanged Category: scenes. Subscription: Scenes. Since 5.0.0. The list of scenes has changed. TODO: Make OBS fire this event when scenes are reordered. - `scenes` Array: Updated array of scenes ### CurrentSceneTransitionChanged Category: transitions. Subscription: Transitions. Since 5.0.0. The current scene transition has changed. - `transitionName` String: Name of the new transition - `transitionUuid` String: UUID of the new transition ### CurrentSceneTransitionDurationChanged Category: transitions. Subscription: Transitions. Since 5.0.0. The current scene transition duration has changed. - `transitionDuration` Number: Transition duration in milliseconds ### SceneTransitionStarted Category: transitions. Subscription: Transitions. Since 5.0.0. A scene transition has started. - `transitionName` String: Scene transition name - `transitionUuid` String: Scene transition UUID ### SceneTransitionEnded Category: transitions. Subscription: Transitions. Since 5.0.0. A scene transition has completed fully. Note: Does not appear to trigger when the transition is interrupted by the user. - `transitionName` String: Scene transition name - `transitionUuid` String: Scene transition UUID ### SceneTransitionVideoEnded Category: transitions. Subscription: Transitions. Since 5.0.0. A scene transition's video has completed fully. Useful for stinger transitions to tell when the video *actually* ends. `SceneTransitionEnded` only signifies the cut point, not the completion of transition playback. Note: Appears to be called by every transition, regardless of relevance. - `transitionName` String: Scene transition name - `transitionUuid` String: Scene transition UUID ### StudioModeStateChanged Category: ui. Subscription: Ui. Since 5.0.0. Studio mode has been enabled or disabled. - `studioModeEnabled` Boolean: True == Enabled, False == Disabled ### ScreenshotSaved Category: ui. Subscription: Ui. Since 5.1.0. A screenshot has been saved. Note: Triggered for the screenshot feature available in `Settings -> Hotkeys -> Screenshot Output` ONLY. Applications using `Get/SaveSourceScreenshot` should implement a `CustomEvent` if this kind of inter-client communication is desired. - `savedScreenshotPath` String: Path of the saved image file ### VendorEvent Category: general. Subscription: Vendors. Since 5.0.0. An event has been emitted from a vendor. A vendor is a unique name registered by a third-party plugin or script, which allows for custom requests and events to be added to obs-websocket. If a plugin or script implements vendor requests or events, documentation is expected to be provided with them. - `vendorName` String: Name of the vendor emitting the event - `eventType` String: Vendor-provided event typedef - `eventData` Object: Vendor-provided event data. {} if event does not provide any data ### CustomEvent Category: general. Subscription: General. Since 5.0.0. for every client, a client got the usage since any client's call. */ Custom event emitted by `BroadcastCustomEvent`. - `eventData` Object: Custom event data