https://github.com/e04/obs-srt-bridge
displays live SRT connection statistics in OBS Studio and automatically switches scenes based on connection health
https://github.com/e04/obs-srt-bridge
obs-studio
Last synced: 4 months ago
JSON representation
displays live SRT connection statistics in OBS Studio and automatically switches scenes based on connection health
- Host: GitHub
- URL: https://github.com/e04/obs-srt-bridge
- Owner: e04
- License: mit
- Created: 2025-06-29T10:04:04.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-08-25T12:56:48.000Z (10 months ago)
- Last Synced: 2025-08-25T14:50:34.578Z (10 months ago)
- Topics: obs-studio
- Language: TypeScript
- Homepage:
- Size: 54.7 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# obs-srt-bridge
A bridge that allows OBS Studio to display live **SRT** (Secure Reliable Transport) connection statistics and automatically switch scenes based on connection health.
The project consists of a tiny Go server that embeds a React single-page application which is loaded in OBS as a _Browser Source_.
## The `go-irl` Stack
`obs-srt-bridge` is a core component of **[go-irl](https://github.com/e04/go-irl)**, a complete, modern streaming stack designed for robust IRL broadcasting.
If you are looking for an easier setup with more advanced features, consider using `go-irl`. It bundles `obs-srt-bridge` with other essential tools (`srt-live-reporter`, `go-srtla`) and provides a simple, one-command launcher.
## Features
- **Live SRT Statistics Display**: Real-time monitoring of SRT connection quality and statistics.
- **Multiple Display Types**: Choose between simple text display, graph visualization, or no display.
- **Automatic Scene Switching**: Automatically switches OBS scenes based on connection health.
- Switches to the "online" scene when SRT connection is stable and healthy.
- Switches to the "offline" scene when connection is lost or experiencing issues.
- Configurable scene names via URL parameters.
- **Reliable Scene Switching Based on Packet Loss**: Unlike tools that only monitor bitrate, this bridge utilizes detailed SRT statistics such as packet loss. This enables more intelligent and accurate switching decisions, correctly identifying connection health issues that simpler methods might miss.
## Download
You can download prebuilt binaries from the [Releases](https://github.com/e04/obs-srt-bridge/releases/).
## Run
```bash
$ ./obs-srt-bridge -port 9999
```
Leave the process running while OBS is open.
### Command-line flags
| Flag | Default | Description |
| ------- | ------- | --------------------------------------------- |
| `-port` | `9999` | HTTP port that serves the browser source HTML |
## Adding the Browser Source to OBS
1. In OBS Studio choose **+ → Browser Source**.
2. Enter the URL shown when you started the program, for example:
- `http://localhost:9999/app?type=simple&wsport=8888&onlineSceneName=ONLINE&offlineSceneName=OFFLINE`
3. **For automatic scene switching**: If you are using the `onlineSceneName` and `offlineSceneName` parameters, you must set the **Page permission** to **Advanced access** in the Browser Source properties. This allows the application to control OBS scene switching.
- Also, please **uncheck** `Restart playback when source becomes active` in your UDP/SRT ingest media source properties to prevent playback issues during scene switching.
All query parameters are optional:
| Parameter | Default | Meaning |
| ------------------ | --------- | -------------------------------------------------------------------------------------------------------------------------- |
| `type` | `simple` | `simple`, `graph` or `none` |
| `wsport` | `8888` | Port where your SRT statistics WebSocket is listening (use [srt-live-reporter](https://github.com/e04/srt-live-reporter) ) |
| `onlineSceneName` | `ONLINE` | Scene name to switch to when the connection is healthy |
| `offlineSceneName` | `OFFLINE` | Scene name to switch to when the connection is lost or poor |
### `type` Details
| type | |
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| simple |
|
| graph |
|
| none | (none, just for switching scene) |
**Metric Explanations (left to right):**
- Bitrate (Mbps)
- RTT (ms)
- Packet Loss (%)
## Build
```bash
# Clone
$ git clone https://github.com/e04/obs-srt-bridge.git
$ cd obs-srt-bridge
# 1. Build the Browser Source bundle
$ cd frontend
$ npm ci # installs dependencies
$ npm run build # outputs to frontend/dist
$ cd ..
# 2. Build the Go binary (this embeds the bundle produced above)
$ go build -o obs-srt-bridge
```
## License
This project is released under the terms of the **MIT License**. See the [LICENSE](LICENSE) file for details.