Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stream-failover-relay

License: CC0-1.0

Pass-through stream relay that remuxes without transcoding and automatically fails over to a fallback input (another live source and/or a local file) when the primary stream goes down.

stream-failover-relay is a tool when you want:

  • Low CPU load, zero GPU load and zero quality loss (no transcoding).
  • Low latency.
  • Always-on output for downstream consumers.
  • A clean automatic switch to a "standby" stream ("BRB", slate, countdown, etc.).

How it works

  • Relays a stream from primary input → output without transcoding (packet copy / remux).
  • Detects primary failure (disconnect, timeout, "no packets for N seconds", etc.).
  • Switches to fallback: a backup live URL or a local media file.
  • Returns to primary once it’s healthy again.

What it does not do

  • No video/audio transcoding, scaling, overlays, filters, or bitrate adaptation. But if you need any of that, please create a ticket, I have other projects that do just that.

Quick start

stream-failover-relay \
    rtmp://my.server/live/main \
    /opt/brb.flv \
    rtmp://remote.server/live/out \

Here rtmp://my.server/live/main will be the primary source, /opt/brb.flv the BRB placeholder, and rtmp://remote.server/live/out the output destination.

Caveats

Both sources (primary and fallback) must have the same properties:

  • Resolution.
  • FPS.
  • Codecs.
  • Audio frame Rate.
  • Audio channels.
  • etc.

Install

Go to Releases and download the executable you need.

Build from the source

apt install -y libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev
git clone https://github.com/xaionaro-go/stream-failover-relay
cd stream-failover-relay
go build ./cmd/stream-failover-relay

About

Pass-through stream (RTMP, RTSP, SRT, ...) relay with automatic failover to a backup stream or looping file when the primary source drops

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages