Obs plugins

From damionrashford/media-os · View interactive version

Obs plugins is an AI agent skill from the GitHub repository damionrashford/media-os. OBS plugin authoring and ecosystem: scaffold a new C++ plugin from obs-plugintemplate (CMake, cross-platform GitHub Actions CI), register obs_source_info / obs_output_info / obs_encoder_info / obs_service_info, implement obs_module_load / obs_module_unload with OBS_DECLARE_MODULE, plus install / con

How to use this skill

Skill file

OBS Plugins

Context: $ARGUMENTS

Quick start

When to use

Not this skill: writing Python/Lua scripts that run inside OBS → use obs-scripting. Programmatically editing profile/scene-collection files → use obs-config. Controlling a running OBS via WebSocket → use obs-websocket.

MANDATORY — verify APIs before quoting them

Before claiming any function signature, struct field, or macro exists, run:

# If you have the obs-docs skill installed separately, use its search command search --query "<name>" --limit 5

Step 1 — Scaffold from obs-plugintemplate

obs-plugintemplate is the only officially recommended starting point. It ships cross-platform CMake presets (macOS / Windows / Linux) and GitHub Actions CI that builds, signs (optional), and packages the plugin for each OS.

uv run ${CLAUDE_SKILL_DIR}/scripts/plugins.py scaffold \
  --name my-plugin \
  --author "Your Name" \
  --bundle-id com.yourname.my-plugin \
  --description "My custom OBS source" \
  --outdir ~/src

Or manually:

git clone https://github.com/obsproject/obs-plugintemplate.git my-plugin
cd my-plugin
# Edit buildspec.json: name, version, author, website, description, id (bundle id)
# Edit CMakePresets.json if you want to pin a different OBS version
./.github/scripts/bootstrap.sh    # MUST run AFTER you edit buildspec.json

Critical: run bootstrap.sh after — not before — editing buildspec.json. Running it first generates paths tied to the literal string obs-plugintemplate.

Step 2 — Implement a source / output / encoder / service

Minimal video input source (src/plugin-main.c):

#include <obs-module.h>

OBS_DECLARE_MODULE()
OBS_MODULE_USE_DEFAULT_LOCALE("my-plugin", "en-US")

static const char *src_get_name(void *unused) {
    (void)unused;
    return obs_module_text("MySourceName");
}

static void *src_create(obs_data_t *settings, obs_source_t *source) {
    (void)settings; (void)source;
    return bzalloc(sizeof(struct { int unused; }));
}

static void src_destroy(void *data)          { bfree(data); }
static uint32_t src_width(void *data)        { (void)data; return 1920; }
static uint32_t src_height(void *data)       { (void)data; return 1080; }
static void src_render(void *data, gs_effect_t *eff) {
    (void)data; (void)eff;
    /* gs_* graphics-thread calls only */
}

static struct obs_source_info my_src = {
    .id             = "my_src",
    .type           = OBS_SOURCE_TYPE_INPUT,
    .output_flags   = OBS_SOURCE_VIDEO | OBS_SOURCE_CUSTOM_DRAW | OBS_SOURCE_SRGB,
    .get_name       = src_get_name,
    .create         = src_create,
    .destroy        = src_destroy,
    .get_width      = src_width,
    .get_height     = src_height,
    .video_render   = src_render,
};

bool obs_module_load(void) {
    obs_register_source(&my_src);
    return true;      /* return false to refuse loading (e.g. missing dep) */
}

void obs_module_unload(void) { /* global cleanup */ }

For output / encoder / service, fill obs_output_info / obs_encoder_info / obs_service_info and call obs_register_output / obs_register_encoder / obs_register_service respectively. Full field list in references/plugins.md.

Properties (settings dialog UI) — build in a get_properties callback:

static obs_properties_t *src_properties(void *data) {
    obs_properties_t *p = obs_properties_create();
    obs_properties_add_int(p, "width",  obs_module_text("Width"),  16, 4096, 1);
    obs_properties_add_text(p, "label", obs_module_text("Label"), OBS_TEXT_DEFAULT);
    obs_property_t *list = obs_properties_add_list(p, "mode",
        obs_module_text("Mode"), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
    obs_property_list_add_int(list, obs_module_text("Fast"), 0);
    obs_property_list_add_int(list, obs_module_text("HQ"),   1);
    return p;
}

Locale — put strings in data/locale/en-US.ini as MySourceName=My Source and reference with obs_module_text("MySourceName"). The locale file must match the locale string in OBS_MODULE_USE_DEFAULT_LOCALE.

Step 3 — Build

uv run ${CLAUDE_SKILL_DIR}/scripts/plugins.py build --path ~/src/my-plugin

Or raw CMake:

| Platform | Configure | Build |

|---|---|---|

| macOS | cmake --preset macos | cmake --build --preset macos --config RelWithDebInfo |

| Windows | cmake --preset windows-x64 | cmake --build --preset windows-x64 --config RelWithDebInfo |

| Linux | cmake --preset ubuntu-x86_64 | cmake --build --preset ubuntu-x86_64 --config RelWithDebInfo |

Step 4 — Install locally

uv run ${CLAUDE_SKILL_DIR}/scripts/plugins.py install-local --path ~/src/my-plugin

Per-user install paths:

Verify in OBS: Help -> Log Files -> View Current Log and search for your plugin name.

Step 5 — Install a community plugin

uv run ${CLAUDE_SKILL_DIR}/scripts/plugins.py install-community --plugin streamfx
uv run ${CLAUDE_SKILL_DIR}/scripts/plugins.py install-community --plugin asc
uv run ${CLAUDE_SKILL_DIR}/scripts/plugins.py install-community --plugin move
uv run ${CLAUDE_SKILL_DIR}/scripts/plugins.py install-community --plugin ndi
uv run ${CLAUDE_SKILL_DIR}/scripts/plugins.py install-community --plugin source-record
uv run ${CLAUDE_SKILL_DIR}/scripts/plugins.py install-community --plugin backtrack
uv run ${CLAUDE_SKILL_DIR}/scripts/plugins.py install-community --plugin obs-websocket

| Plugin | Repo | Purpose |

|---|---|---|

| obs-websocket | bundled in OBS 28+; else https://github.com/obsproject/obs-websocket | Remote-control API on :4455 |

| StreamFX | https://github.com/Xaymar/obs-StreamFX (archived; community forks exist) | Advanced filters, blending, shaders |

| Advanced Scene Switcher | https://github.com/WarmUpTill/SceneSwitcher | Macro-based scene automation |

| Move (Exeldro) | https://github.com/exeldro/obs-move-transition | Animated filter transitions |

| NDI | https://github.com/obs-ndi/obs-ndi | NewTek NDI in/out (requires NDI Runtime) |

| Source Record | https://github.com/exeldro/obs-source-record | Per-source recording |

| Backtrack | https://github.com/exeldro/obs-backtrack | Instant-replay time-shift buffer |

Available scripts

Reference docs

Gotchas

Examples

Example 1: Scaffold + build + install a new source plugin on macOS

uv run ${CLAUDE_SKILL_DIR}/scripts/plugins.py scaffold \
  --name obs-my-src --author "Alice" --bundle-id com.alice.obs-my-src \
  --description "Experimental source" --outdir ~/src
uv run ${CLAUDE_SKILL_DIR}/scripts/plugins.py build --path ~/src/obs-my-src
uv run ${CLAUDE_SKILL_DIR}/scripts/plugins.py install-local --path ~/src/obs-my-src
# Launch OBS, check Help -> Log Files -> View Current Log for the plugin's name.

Example 2: Install Move + Advanced Scene Switcher on an existing OBS install

uv run ${CLAUDE_SKILL_DIR}/scripts/plugins.py install-community --plugin move
uv run ${CLAUDE_SKILL_DIR}/scripts/plugins.py install-community --plugin asc
uv run ${CLAUDE_SKILL_DIR}/scripts/plugins.py list-installed

Example 3: Minimal filter skeleton

Change type to OBS_SOURCE_TYPE_FILTER and implement filter_video (sync) or filter_audio. Drop get_width / get_height — filters inherit from their parent.

Troubleshooting

"Module not found" / plugin silently missing from OBS

Cause: install path wrong, or ABI mismatch (plugin built against a different OBS major).

Solution: list-installed to confirm path. Rebuild against the installed OBS version; match OBS_STUDIO_VERSION in buildspec.json.

macOS: "<plugin> is damaged and can't be opened"

Cause: quarantine xattr on an unsigned plugin bundle.

Solution: sudo xattr -rd com.apple.quarantine ~/Library/Application\ Support/obs-studio/plugins/<name>.plugin.

Linker error: multiple definition of `obs_module_*`

Cause: two translation units each invoked OBS_DECLARE_MODULE().

Solution: keep it in one .c only.

OBS logs: "Required OBS plugin version mismatch"

Cause: the plugin declared a minimum OBS version higher than the host.

Solution: rebuild with a lower target in buildspec.json, or upgrade OBS.

NDI plugin loads but no NDI sources appear

Cause: NDI Runtime (separate install) missing or outdated.

Solution: install the NDI Runtime from https://ndi.video/sdk/ and restart OBS.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.