stream-failover-relay

command module
v0.0.0-...-6e91e02 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2025 License: CC0-1.0 Imports: 26 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

stream-failover-relay

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL