npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nukman-salim/pi-obs-controls

v1.0.1

Published

Control OBS Studio via WebSocket from Pi coding agent

Readme

Pi OBS Controls Skill Package

pi-package license

A complete, feature-rich skill package for Pi to control OBS Studio programmatically via WebSocket v5+.

This package enables Pi to manage scenes, control streaming/recording, toggle virtual cameras, adjust audio volumes, change source visibilities, capture screenshots, apply filters, and much more.


🚀 Features

  • Scene Management: List, switch, create, and remove scenes.
  • Recording & Streaming: Start, stop, pause, and resume. Retrieve stream/recording health and status.
  • Audio Controls: Mute/unmute and adjust volumes (in decibels) for microhpones and media inputs.
  • Source Management: Locate scene items, toggle visibility, add new inputs, and auto-fit/resize sources to canvas.
  • Filters & Transitions: List and manage source filters, switch transitions, and set transition durations.
  • Studio Mode: Toggle Studio Mode, set preview scenes, and trigger transitions.
  • Replay Buffer & Screenshots: Save replay buffers, and take/save high-quality screenshots from any source.
  • Custom Python SDK: Under the hood, this uses a robust, asynchronous Python client built on top of websockets.

📦 Installation

To install this package in your Pi environment, run:

# Install via npm (recommended)
pi install npm:@nukman-salim/pi-obs-controls

# Or install directly from Git
pi install git:github.com/YOUR_USERNAME/pi-obs-controls

⚙️ Setup & Prerequisites

1. Enable OBS WebSocket

  1. Open OBS Studio.
  2. Go to ToolsWebSocket Server Settings.
  3. Check Enable WebSocket Server.
  4. Take note of the Server Port (default: 4455) and the Server Password.

2. Install Python Dependencies

The skill requires the websockets Python library:

pip install websockets

3. Add Credentials

Create a .env file in the directory where you run Pi (or your skill execution environment) with your OBS WebSocket credentials:

OBS_HOST=localhost
OBS_PORT=4455
OBS_PASSWORD=your_secure_password

🛠️ Usage with Pi

Once installed, your Pi coding agent will automatically register the obs-controls skill. You can command Pi using natural language:

  • "Switch my active scene in OBS to 'Main Camera'."
  • "Start recording and toggle my microphone off."
  • "Show me the list of all current audio inputs and their volumes."
  • "Fit the 'Webcam' source in scene 'Gaming' to a 1920x1080 canvas."
  • "Take a screenshot of the OBS 'Game Capture' source and save it."

🐍 Standalone Python Usage

You can also import and use the underlying client directly in your own Python projects:

import asyncio
from skills.obs_controls.obs_controls import OBSWebSocketClient

async def main():
    # Initializes using environment variables (OBS_HOST, OBS_PORT, OBS_PASSWORD)
    client = OBSWebSocketClient()
    
    await client.connect()
    
    # Switch scene and start recording
    await client.set_current_scene("Main")
    await client.start_recording()
    
    # Check status
    status = await client.get_full_status()
    print(f"Active Scene: {status['current_scene']}")
    
    # Toggle mic mute
    await client.toggle_input_mute("Microphone")
    
    await client.disconnect()

if __name__ == "__main__":
    asyncio.run(main())

📂 API Reference (Summary of Key Helpers)

Scene & Source Control

  • set_current_scene(name) / get_scene_list()
  • set_source_visibility(scene, source_name, visible: bool)
  • fit_source_to_canvas(scene, source, width, height)
  • resize_source_percent(scene, source, percent)

Recording & Streaming

  • start_recording() / stop_recording() / pause_recording() / resume_recording()
  • start_streaming() / stop_streaming() / toggle_streaming()
  • start_virtual_cam() / stop_virtual_cam() / toggle_virtual_cam()

Audio Control

  • set_input_mute(name, mute: bool) / toggle_input_mute(name)
  • set_input_volume(name, db) (e.g. -10.0 dB)

Screenshots

  • save_source_screenshot(source, file_path, format="png", width=1920, height=1080)

📄 License

This package is open source and available under the MIT License.