Skip to content

Sources and backups

Every stream in Nyquist gets its video from one or more sources. An encoder can push to it, Nyquist can pull it from another server, copy another stream or even make up a test card on its own. You list the sources in the stream’s inputs, and the order matters: the first one is the main source and the rest are backups, tried from top to bottom.

[[stream]]
name = "sports/main"
inputs = [
"publish://",
"srt://198.51.100.20:9000?streamid=sports&passphrase=YOUR_PASSPHRASE",
"fake://",
]

Here the studio encoder pushes to sports/main. If it stops, Nyquist pulls the same channel over SRT from another site, and if that’s down too, viewers get a test card instead of an error. Once the encoder is back and steady, the stream switches back to it.

Leave inputs out and a stream just takes an encoder (publish://), like it always did. Streams covers everything else a stream has, like its name, title and password.

No matter where the video comes from, the stream behaves the same: HLS, LL-HLS, DASH and MPEG-TS playback, copies and viewer counting all work exactly like they do for an encoder.

Your encoder sends video over RTMP or SRT, with the stream name and its password, see Publishing:

  • RTMP: server rtmp://YOUR_SERVER/sports, stream key main?password=YOUR_PASSWORD
  • SRT: srt://YOUR_SERVER:5090 with the stream id #!::r=sports/main,m=publish,s=YOUR_PASSWORD

Only one encoder can push to a stream at a time. Want a second encoder as a backup? Have it push to a stream of its own and list that one as a copy:// backup.

A stream without a password takes any encoder. If it follows a template (template = "events") and has no password of its own, it takes the template’s password instead. The panel warns you about streams anyone can push to.

inputs = ["copy://news/channel_one"]

Mirrors another stream. It shares the exact same frames, no extra work, but gets its own name, outputs and access rules. Copies can have backups like anything else, and if you rename the stream being copied, its copies follow along. Streams that copy each other in a circle get refused, since they’d just chase their own tail.

inputs = ["publish://", "fake://"]

A moving 720p test card with a tone, made by Nyquist itself, no encoder or FFmpeg needed. It’s great as the last backup, so viewers see something instead of an error, and for trying out players and the panel.

inputs = ["rtmp://192.0.2.10/live/sports"]
inputs = ["rtmp://origin.example:1936/live/sports?token=YOUR_TOKEN"]

rtmp://HOST[:PORT]/APP/NAME plays the stream NAME from the app APP, port 1935 if you leave it out. Anything after ? goes along with the stream name, which is how most servers take tokens.

inputs = ["srt://198.51.100.20:9000"]
inputs = ["srt://198.51.100.20:9000?streamid=sports&passphrase=YOUR_PASSPHRASE&latency=200"]

srt://HOST:PORT calls an SRT listener and reads MPEG-TS from it. It takes three optional extras:

Option What it does
streamid The stream id the other side asks for, plain or in the #!:: style.
passphrase For encrypted links, 10 to 79 characters.
latency In milliseconds (latency=200) or as a duration (latency=1s). Left out, it’s latency from [srt].

Write a literal & or % in a value as %26 and %25.

hls:// and hlss://, follow an HLS playlist

Section titled “hls:// and hlss://, follow an HLS playlist”
inputs = ["hls://192.0.2.10/live/sports/index.m3u8"]
inputs = ["hlss://user:YOUR_PASSWORD@cdn.example/sports/index.m3u8"]

hls:// fetches over HTTP and hlss:// over HTTPS. Nyquist follows the live playlist, downloads new segments as they show up and plays them out at their real pace. It handles MPEG-TS and fragmented MP4 (CMAF) segments, discontinuities and redirects. Given a playlist with several variants, it picks the one with the highest bandwidth. A user and password before the host turn into basic auth, sent only to that host.

It starts hls_start_segments from the end of the playlist, so there’s a little cushion. If the playlist stops moving for a target duration plus timeout, Nyquist starts over. Encrypted playlists and byte range segments aren’t supported yet.

tshttp:// and tshttps://, an MPEG-TS stream over HTTP

Section titled “tshttp:// and tshttps://, an MPEG-TS stream over HTTP”
inputs = ["tshttp://192.0.2.10:8080/live/sports/mpegts"]

Reads an endless MPEG-TS stream over HTTP or HTTPS, like the /mpegts link of another Nyquist.

inputs = ["udp://239.255.0.1:5000"]
inputs = ["udp://198.51.100.7@239.255.0.1:5000?interface=192.0.2.10"]
inputs = ["udp://0.0.0.0:5000"]

udp://ADDRESS:PORT with a multicast address joins that group. Put a source in front (SOURCE@GROUP) for a source specific join, so only that sender gets through. interface= picks the network card: its own address for IPv4 groups, its name or index for IPv6 ones. With a unicast address Nyquist simply listens there, and a source in front only lets that sender in.

MPEG-TS wrapped in RTP works too, Nyquist takes the RTP header off by itself.

Pulls only run while a stream lists them. The main source always runs, and a backup only starts once everything above it is down, so backups don’t eat bandwidth while they aren’t needed. A source counts as down when it failed, when it went quiet, or when it took longer than connect_timeout to get going. An encoder source counts as down while no encoder is connected.

The stream follows one source at a time, the active one. When it stops sending video for timeout, or drops out completely, Nyquist moves on to the next source that’s sending. Switches always happen on a keyframe, and the timestamps carry on right where the last source left off, so players just keep going. If nothing else is ready yet, the stream stays live for up to timeout while a backup gets started or the same source comes back. Only when nothing shows up does the stream go offline.

Sources higher up the list keep getting retried while a backup is on air. Pulls that fail wait retry_delay before trying again, then twice as long after every failure in a row, up to max_retry_delay. Once a higher source has been sending steadily for fail_back_after, the stream goes back to it and the backup stops. Set fail_back = false to stay on the backup until it fails itself.

Kicking a stream’s publisher from the panel or with DELETE /api/v1/publishers/NAME works on whatever source is active: encoders get disconnected, pulls and copies reconnect, and a backup takes over in the meantime.

Changing a stream’s inputs keeps the sources that stay in the list running, so you can add or reorder backups without a hiccup.

The stream page in the panel lists every source with its state, and so does GET /api/v1/streams/NAME:

"sources": [
{ "url": "publish://", "kind": "publish", "state": "failed", "error": "the encoder sent nothing for 5s", "since": "2026-11-27T10:15:02Z" },
{ "url": "srt://198.51.100.20:9000?streamid=sports&passphrase=***", "kind": "srt", "state": "active", "error": null, "since": "2026-11-27T10:15:03Z" },
{ "url": "fake://", "kind": "fake", "state": "idle", "error": null, "since": "2026-11-27T10:12:40Z" }
]
State Means
active Feeds the stream right now. While the stream is live, exactly one source is active.
standby Sends video and is ready to take over.
connecting On its way, or waiting for its first frames.
failed Something went wrong, error says what. Pulls get another try soon.
idle Not running, like a backup that isn’t needed or an encoder that isn’t connected.

Passwords and passphrases always show up as *** in there. Admins see the real thing in the stream’s settings, viewers never do.

The publisher of a stream (in the panel and in /api/v1/publishers) is the active source: its protocol (rtmp, srt, hls, tshttp, udp, copy or fake) and the address it comes from, when there is one.

The knobs live in [sources], and the config reference lists them with their defaults and limits. They apply right away, and running pulls pick up changes the next time they connect.

  • timeout: how long the active source can go without sending a frame before Nyquist moves on, and how long the stream stays live while another source takes over.
  • connect_timeout: time a pull gets to connect and start sending video, and the longest an HLS pull waits for a playlist or a segment.
  • retry_delay and max_retry_delay: the first pause before a failed pull tries again, and the longest one, since the pause doubles after every failure in a row.
  • fail_back and fail_back_after: whether the stream goes back to a source higher up the list, and how long that source has to send video without trouble first.
  • hls_start_segments: how many segments from the end of a live playlist an HLS pull starts with.
  • max_download_bytes: the biggest playlist or segment an HLS pull downloads.
  • udp_buffer: the receive buffer Nyquist asks for on UDP sources. Linux caps it at net.core.rmem_max, raise that too for big multicast streams.

A few more settings come from elsewhere: SRT pulls use latency, payload_size and receive_queue from [srt], RTMP pulls use window_ack_size and read_buffer from [rtmp], and every source goes through [ingest] like an encoder does. Those need a restart, like the rest of their sections.

The API has more examples. PUT /api/v1/streams/NAME replaces a whole stream. PATCH only changes what you send, and null takes an optional setting out ("inputs": null goes back to just publish://):

Terminal window
curl -u admin:YOUR_PASSWORD -X PATCH http://192.0.2.10:8080/api/v1/streams/sports/main \
-H 'content-type: application/json' \
-d '{"inputs": ["publish://", "hlss://cdn.example/sports/index.m3u8", "fake://"]}'

A new name renames the stream. It moves in the config file, copy:// sources in other streams follow it, and whatever feeds it gets disconnected and comes back under the new name. Encoders need the new stream key, of course. A name that’s already taken gets a 409.

Source URLs Nyquist can’t use get refused with a 422 that says what’s wrong, and nyquist check and the config editor in the panel point at the exact line.