How stalexteam/restream_go works
restream-controller is a continuous OBS-to-many-platform relay. OBS publishes one RTMP or SRT feed; the controller routes per-platform tracks, switches each output between live and prepared backup media without ending its connection, and pushes to enabled platforms. The dashboard manages sources, platforms, groups, and settings and reports status. The graph includes ingest, probing, per-platform processing, fallback, media management, and runtime control. Some subsystem links are documented only at a high level; those are dashed where source-level evidence was not shown.
Main entry points: pipeline.go Platform pipeline · server.go HTTP and commands · app.go App lifecycle · manager.go Control manager
Components 21
Runtime control
- Daemon entry
main.go - App lifecycle
internal/app/app.go - Control manager
internal/control/manager.go
Ingest and routing
- MediaMTX
- Relay readback
internal/ingest/readback.go - Track router
internal/route/route.go - TS demux
internal/wire/ts/demux.go
Platform delivery
- Platform machine
internal/platform/machine.go - Platform pipeline
internal/platform/pipeline.go - Media probing
internal/probe/probe.go - Timeline switcher
internal/timeline/switcher.go - Backup player
internal/fallback/player.go - Backup preparation
internal/fallback/preparer.go - RTMP egress
internal/egress/rtmp_push.go
Dashboard and media
- HTTP and commands
internal/api/server.go - Dashboard UI
internal/web/dashboard/dashboard.js - Settings UI
internal/web/dashboard/config.js - Media library
internal/media/store.go
Other components
- OBS publisher
- Streaming platforms
- Dashboard operator
Connections 25
- Daemon entry → App lifecycle: starts
main.go - App lifecycle → Control manager: creates
internal/app/app.go - App lifecycle → HTTP and commands: serves through
internal/app/app.go - App lifecycle → MediaMTX: starts and watches
internal/app/app.go - HTTP and commands → Control manager: handles commands
- Control manager → Platform machine: instantiates
internal/control/manager.go - Platform machine → Platform pipeline: owns pipeline
- OBS publisher → MediaMTX: publishes feed
README.md - MediaMTX → Relay readback: provides readback
- Platform pipeline → Relay readback: builds relay args
internal/platform/pipeline.go - Platform pipeline → TS demux: demuxes transport
- Platform pipeline → Track router: selects tracks
internal/platform/pipeline.go - Platform pipeline → Timeline switcher: forwards media tags
internal/platform/pipeline.go - Platform pipeline → Backup player: creates backup player
internal/platform/pipeline.go - Platform pipeline → Backup preparation: prepares backup
internal/platform/pipeline.go - Backup player → Timeline switcher: emits backup stream
internal/fallback/player.go - Platform pipeline → Media probing: probes sources
- Platform pipeline → RTMP egress: pushes output
- RTMP egress → Streaming platforms: streams to
README.md - Timeline switcher → Streaming platforms: keeps output continuous
README.md - Dashboard operator → Dashboard UI: manages stream
README.md - Dashboard UI → HTTP and commands: sends commands
- Settings UI → HTTP and commands: configures service
- HTTP and commands → Media library: uploads and serves files
internal/api/server.go - HTTP and commands → Dashboard UI: serves dashboard