Skip to content

Richc/obs-bridge

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OBS Recording Scheduler

Applications that connect OBS Studio to a central website for remote control.

Available Platforms

  • 🐍 Python Bridge - Cross-platform command-line tool (Setup Guide)
  • 🍎 macOS App - Native macOS application (Bridge Documentation)
  • πŸͺŸ Windows App - Native Windows 11 application (Windows Documentation) A complete system for scheduling and remotely controlling OBS (Open Broadcaster Software) recording sessions. This monorepo contains multiple interconnected applications that work together to provide a comprehensive OBS remote control and scheduling solution.

🎯 Project Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         WebSocket          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Website   β”‚ ◄────────────────────────► β”‚  OBS Bridge      β”‚
β”‚  (Server)   β”‚     (Bridge initiates)     β”‚ (Your Platform)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                            β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                    β”‚
                                                    β”‚ Local
                                                    β”‚ WebSocket
                                                    β”‚
                                               β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”
                                               β”‚   OBS    β”‚
                                               β”‚  Studio  β”‚
                                               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
This system allows you to:

- **Schedule OBS recording sessions** through a web interface
- **Remotely control OBS instances** from anywhere via WebSocket
- **Manage multiple OBS installations** from a central control panel
- **Administer bookings, users, and schedules** through an admin dashboard

## πŸ“¦ Project Structure

This repository contains five main components:

### 1. **Bridge** (`/bridge`)

A **native macOS application** that connects OBS Studio to the central server for remote control.

**Tech Stack:** Swift, SwiftUI, macOS 13.0+

**Features:**

- Native macOS interface with real-time status indicators
- Secure credential storage
- Auto-connect on startup
- Activity logging
- Settings panel for easy configuration

**Getting Started:**

```bash
cd bridge
open OBSBridge.xcodeproj
# Build and run in Xcode (⌘R)

πŸ“– Full Documentation | Quick Start Guide

  • βœ… Connects OBS to your website (outbound connection, firewall friendly)
  • βœ… Remote control OBS from anywhere
  • βœ… Real time event streaming (scene changes, streaming status, etc.)
  • βœ… Supports multiple OBS commands
  • βœ… Automatic reconnection handling
  • βœ… Secure password authentication
  • βœ… Native applications for macOS and Windows with GUI
  • βœ… Cross-platform Python CLI version

Quick Start

For Windows 11 Users

πŸ‘‰ Windows Quick Start Guide

For macOS Users

πŸ‘‰ macOS Quick Start Guide

For Python/CLI Users

πŸ‘‰ Continue reading below for Python setup


Python Bridge Setup

Prerequisites


2. Server API (/server-api)

A NestJS-based backend that provides WebSocket and REST APIs for controlling OBS instances.

Tech Stack: NestJS, TypeScript, WebSocket, Express

Features:

  • WebSocket server for OBS client connections
  • REST API for sending commands to OBS
  • Client registration and management
  • Automatic health checks (ping every 30s)
  • Event handling from OBS
  • Demo control panel included

Getting Started:

cd server-api
npm install
npm run start:dev
# Server runs on http://localhost:8000

Key Endpoints:

  • ws://localhost:8000/obs - WebSocket endpoint
  • GET /api/clients - List connected clients
  • POST /api/command/:clientId - Send command to specific client
  • POST /api/action/:clientId/:action - Quick actions (start-stream, stop-stream, etc.)
  • GET /health - Health check

πŸ“– Full Documentation


3. Frontend (/frontend)

A React-based user interface for browsing schedules and booking recording sessions.

Tech Stack: React, TypeScript, Vite, Tailwind CSS, shadcn/ui

Features:

  • Interactive calendar for date selection
  • Available time slot browsing
  • OBS instance and scene selection
  • Responsive design with dark/light mode
  • User profile management

Getting Started:

cd frontend
npm install
npm run dev
# Open http://localhost:5173

πŸ“– Full Documentation


4. Admin Panel (/admin-panel)

A Next.js admin dashboard for managing bookings, users, schedules, and OBS instances.

Tech Stack: Next.js 14, TypeScript, React, Tailwind CSS, shadcn/ui

Features:

  • Booking management interface
  • User administration
  • Schedule configuration
  • OBS instance monitoring
  • Settings management

Getting Started:

cd admin-panel
npm install
npm run dev
# Open http://localhost:3000

πŸ“– Full Documentation


5. Python Bridge (Root: obs_bridge.py)

A Python-based alternative bridge for cross-platform OBS connectivity.

Tech Stack: Python 3.7+, obs-websocket-py

Features:

  • Cross-platform support (Windows, macOS, Linux)
  • Command-line interface
  • Automatic reconnection
  • Configuration via .env file

Getting Started:

# Install dependencies
pip install -r requirements.txt

# Configure
cp .env.example .env
# Edit .env with your settings

# Run
python obs_bridge.py

πŸ“– See Python Bridge Configuration below for details


πŸš€ Quick Start (Full System)

Get the entire system running in 5 minutes! See QUICKSTART.md for detailed instructions.

Prerequisites

  • OBS Studio 28+
  • Node.js 18+
  • Python 3.7+ (for Python bridge)
  • macOS 13+ (for native bridge app)

Minimal Setup

  1. Enable OBS WebSocket:

    • Open OBS β†’ Tools β†’ WebSocket Server Settings
    • Enable WebSocket server, set password, note port (4455)
  2. Start the API Server:

    cd server-api
    npm install && npm run start:dev
  3. Connect a Bridge:

    Option A - Python Bridge:

    # Configure .env with OBS settings
    python obs_bridge.py

    Option B - macOS Native App:

    cd bridge
    open OBSBridge.xcodeproj
    # Build and configure in Xcode
  4. Open Control Panel:

    http://localhost:8000
    

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         REST/WS           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Admin Panel     β”‚ ◄────────────────────────►│                  β”‚
β”‚  (Next.js)       β”‚                            β”‚   API Server     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                            β”‚   (NestJS)       β”‚
                                                β”‚                  β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         REST/WS           β”‚  Port: 8000      β”‚
β”‚  Frontend        β”‚ ◄────────────────────────►│                  β”‚
β”‚  (React)         β”‚                            β”‚  WebSocket: /obs β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                            β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                         β”‚
                                                         β”‚ WebSocket
                                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                              β”‚                     β”‚
                                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
                                    β”‚  Bridge        β”‚   β”‚  Bridge        β”‚
                                    β”‚  (macOS/Python)β”‚   β”‚  (macOS/Python)β”‚
                                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                             β”‚                    β”‚
                                             β”‚ Local WS           β”‚ Local WS
                                             β”‚                    β”‚
                                      β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
                                      β”‚ OBS Studio  β”‚      β”‚ OBS Studio  β”‚
                                      β”‚ Instance 1  β”‚      β”‚ Instance 2  β”‚
                                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”§ Configuration

Environment Variables

Python Bridge (.env):

OBS_HOST=localhost
OBS_PORT=4455
OBS_PASSWORD=your-password
WEBSITE_URL=ws://localhost:8000/obs
CLIENT_ID=obs-client-1

Server API:

PORT=8000

OBS Setup

  1. Open OBS Studio
  2. Tools β†’ WebSocket Server Settings
  3. Enable WebSocket server
  4. Set password and note port (default: 4455)
  5. Apply settings

πŸ“‘ API Documentation

OBS Commands

Send commands via REST API or WebSocket:

Common Commands:

  • StartStreaming - Start streaming
  • StopStreaming - Stop streaming
  • StartRecording - Start recording
  • StopRecording - Stop recording
  • GetStreamingStatus - Get current status
  • GetSceneList - List all scenes
  • SetCurrentScene - Switch scene

Example:

curl -X POST http://localhost:8000/api/action/my-client/start-stream

See server-api/README.md for complete API documentation.

πŸ› οΈ Development

Install All Dependencies

# Root dependencies (example server)
npm install

# Server API
cd server-api && npm install

# Frontend
cd ../frontend && npm install

# Admin Panel
cd ../admin-panel && npm install

# Python bridge
pip install -r requirements.txt

Running in Development

Each project has its own development server. Open separate terminals:

# Terminal 1 - API Server
cd server-api && npm run start:dev

# Terminal 2 - Frontend
cd frontend && npm run dev

# Terminal 3 - Admin Panel
cd admin-panel && npm run dev

# Terminal 4 - Python Bridge
python obs_bridge.py

πŸ§ͺ Testing

# Test OBS connection
cd bridge && ./test-obs-connection.sh

# Server API tests
cd server-api && npm run test

# Frontend tests
cd frontend && npm run test

πŸ“ Python Bridge Configuration

The Python bridge (obs_bridge.py) provides cross-platform OBS connectivity.

Installation:

pip install -r requirements.txt

Configuration:

cp .env.example .env
# Edit .env with your OBS and server settings

Usage:

python obs_bridge.py

Features:

  • Cross-platform (Windows, macOS, Linux)
  • Automatic reconnection
  • Event forwarding
  • Command execution
  • Secure authentication

πŸ” Troubleshooting

Bridge can't connect to OBS:

  • Ensure OBS is running
  • Verify WebSocket is enabled in OBS settings
  • Check password and port in configuration

API server not starting:

  • Check if port 8000 is available
  • Install dependencies: npm install
  • Check Node.js version (18+)

Frontend/Admin panel won't load:

  • Verify API server is running
  • Check browser console for errors
  • Clear browser cache

See individual project READMEs for detailed troubleshooting.

🀝 Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

πŸ“„ License

MIT

πŸ”— Additional Resources

πŸ“ž Support

For issues and questions:

About

OBS Bridge - A bridge for OBS Studio integration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 66.3%
  • Swift 10.9%
  • C# 10.1%
  • HTML 4.5%
  • Python 3.1%
  • CSS 1.7%
  • Other 3.4%