Skip to content

Config reference

Every setting is optional. Leave one out and Nyquist uses the default listed here, so an empty nyquist.toml works just fine. You can change all of them from the Settings page in the panel, by hand or over the API, see Editing the config.

Write durations like "500ms", "30s", "10m", "12h" or "7d", and mix units if you want, like "1h 30m". PIDs can be written in hex, like 0x100. nyquist check explains anything it doesn’t like.

Streams, templates and users live in the same file. Streams, Templates and Users and access cover those.

Most settings apply the moment you save or reload. The ones that shape listeners and the media pipeline wait for a restart, and the panel shows a banner naming their sections until you do.

Section Applies
[server] After a restart
[access] Right away
[names] Right away
[panel] Right away
[api] Right away
[packager] After a restart
[mpegts] After a restart
[http] Right away
[viewers] Right away
[history] After a restart
[ingest] After a restart
[sources] Right away
[rtmp] static_app right away, the rest after a restart
[srt] After a restart
[log] Right away

Listeners. Where Nyquist listens for the panel, the API, playback and encoders.

[server]
http = ["0.0.0.0:8080"]
rtmp = ["0.0.0.0:1935"]
srt = ["0.0.0.0:5090"]
Setting Default Applies What it does
http ["0.0.0.0:8080"] After a restart Addresses for the panel, the API and playback.
rtmp ["0.0.0.0:1935"] After a restart Addresses encoders publish to over RTMP, an empty list turns RTMP off.
srt ["0.0.0.0:5090"] After a restart Addresses encoders publish to over SRT, an empty list turns SRT off.

Logins. Logins, sessions and lockouts for the panel and the API.

[access]
min_password_length = 8
session_idle = "12h"
session_max = "7d"
lockout_attempts = 10
lockout_window = "10m"
session_cookie = "nyquist_session"
basic_auth_cache = "5m"
tracked_clients = 10000
setup_code_length = 12
Setting Default Applies What it does
min_password_length 8 Right away The shortest password a panel or API user can have. From 1 to 1024 characters.
session_idle "12h" Right away Logs a panel session out after this long without a visit. At least 1ms.
session_max "7d" Right away Logs a panel session out after this long, busy or not, and it’s how long the cookie lives too. At least 1ms.
lockout_attempts 10 Right away Wrong passwords from one address before it gets locked out. From 1 to 4294967295 attempts.
lockout_window "10m" Right away How long failed logins count and how long a lockout lasts. At least 1ms.

The rest are tuning knobs most setups never need to touch:

Setting Default Applies What it does
session_cookie "nyquist_session" Right away Name of the login cookie, give each Nyquist on the same host its own since cookies ignore ports.
basic_auth_cache "5m" Right away Remembers a correct basic auth login this long so scripts skip the slow password check, 0s turns it off.
tracked_clients 10000 Right away Addresses and remembered logins Nyquist keeps before it clears out the oldest ones. At least 1.
setup_code_length 12 Right away Characters in the one time setup code a fresh server prints in its log. From 1 to 128 characters.

Names. How long stream and user names can get.

[names]
max_stream_length = 256
max_user_length = 64

These are tuning knobs most setups never need to touch:

Setting Default Applies What it does
max_stream_length 256 Right away The longest a stream name can get, slashes included. At least 1.
max_user_length 64 Right away The longest a user name can get. At least 1.

Panel. The admin panel at /admin.

[panel]
enabled = true
docs_url = "https://nyquist.miu.studio"
generated_password_length = 20
stream_refresh = "2s"
server_refresh = "5s"
Setting Default Applies What it does
enabled true Right away Turn it off and /admin answers 404, the API keeps working.

The rest are tuning knobs most setups never need to touch:

Setting Default Applies What it does
docs_url "https://nyquist.miu.studio" Right away Where the docs link in the panel points, leave it empty to hide the link.
generated_password_length 20 Right away Length of the passwords the panel makes up, it can’t be shorter than the shortest password. From 1 to 1024 characters.
stream_refresh "2s" Right away How often stream pages update. At least 1ms.
server_refresh "5s" Right away How often the panel checks on the server and its settings. At least 1ms.

API. The REST API. Your users live in this section too, as [[api.user]] entries the panel and the API look after for you.

[api]
max_body_bytes = 1048576

These are tuning knobs most setups never need to touch:

Setting Default Applies What it does
max_body_bytes 1048576 Right away Biggest request body the API takes, keep it comfortably above the size of your nyquist.toml. From 1 to 16777216 bytes.

HLS and DASH. How streams get cut up for HLS, LL-HLS and DASH.

[packager]
segment_duration = "2s"
part_duration = "500ms"
window_segments = 6
idle_timeout = "10m"
part_history_segments = 4
max_segment_duration = "10s"
max_segment_bytes = 67108864
jump_threshold = "10s"
wait_grace = "2s"
ts_cache_segments = 12
idle_check = "10s"
Setting Default Applies What it does
segment_duration "2s" After a restart Target length of HLS and DASH segments. At least 1ms.
part_duration "500ms" After a restart Target length of LL-HLS parts, it can’t be longer than a segment. At least 1ms.
window_segments 6 After a restart Segments a live playlist lists. At least 1.

The rest are tuning knobs most setups never need to touch:

Setting Default Applies What it does
idle_timeout "10m" After a restart Stops packaging a stream nobody asked for in this long. At least 1ms.
part_history_segments 4 After a restart Recent segments that keep their LL-HLS parts. At least 1.
max_segment_duration "10s" After a restart Cuts a segment this long even without a keyframe, it can’t be shorter than the segment length. At least 1ms.
max_segment_bytes 67108864 After a restart Cuts a segment once it gets this big. At least 1.
jump_threshold "10s" After a restart Timestamp jumps bigger than this start a fresh timeline. At least 1s.
wait_grace "2s" After a restart Extra time a waiting playlist or part request gets on top of three segment lengths.
ts_cache_segments 12 After a restart Plain HLS .ts segments kept ready to serve again.
idle_check "10s" After a restart How often Nyquist looks for streams nobody watches. At least 1ms.
dash_update_period automatic After a restart DASH minimumUpdatePeriod, automatic means one segment. At least 1ms.
dash_presentation_delay automatic After a restart DASH suggestedPresentationDelay, automatic means three target durations. At least 1ms.
dash_min_buffer automatic After a restart DASH minBufferTime, automatic means one target duration. At least 1ms.

MPEG-TS. The MPEG-TS output, both the endless stream and plain HLS .ts segments.

[mpegts]
video_pid = 0x100
audio_pid = 0x101
pmt_pid = 0x1000
program_number = 1
transport_stream_id = 1
idle_timeout = "30s"
psi_interval = "100ms"
pcr_interval = "40ms"
pcr_delay = "700ms"
max_forward_jump = "10s"
max_backward_jump = "2s"
buffer_chunks = 4096
gop_cache_chunks = 4096
gop_cache_bytes = 67108864
idle_check = "5s"
Setting Default Applies What it does
video_pid 0x100 After a restart PID of the video track. From 0x0010 to 0x1ffe.
audio_pid 0x101 After a restart PID of the audio track. From 0x0010 to 0x1ffe.
pmt_pid 0x1000 After a restart PID of the program map table. From 0x0010 to 0x1ffe.
program_number 1 After a restart Program number in the PAT and PMT. From 1 to 65535.
transport_stream_id 1 After a restart Transport stream ID in the PAT. Up to 65535.

The rest are tuning knobs most setups never need to touch:

Setting Default Applies What it does
idle_timeout "30s" After a restart Stops an output nobody watched for this long. At least 1ms.
psi_interval "100ms" After a restart How often the PAT and PMT repeat. At least 1ms.
pcr_interval "40ms" After a restart How often the clock reference goes out. From 1ms to 100ms.
pcr_delay "700ms" After a restart How far the clock reference runs behind the timestamps, which gives players a head start.
max_forward_jump "10s" After a restart Timestamp jumps forward bigger than this get smoothed over. At least 1ms.
max_backward_jump "2s" After a restart Timestamp jumps back bigger than this get smoothed over. At least 1ms.
buffer_chunks 4096 After a restart Chunks buffered per output for viewers that fall behind. From 1 to 1048576 chunks.
gop_cache_chunks 4096 After a restart Chunks of the latest GOP kept so new viewers start on a keyframe.
gop_cache_bytes 67108864 After a restart Bytes of the latest GOP kept so new viewers start on a keyframe.
idle_check "5s" After a restart How often Nyquist looks for outputs nobody watches. At least 1ms.

Playback headers. Headers on playback responses. An empty value leaves the header out.

[http]
allow_origin = "*"
manifest_cache = "no-cache"
segment_cache = "max-age=60"
stream_cache = "no-cache"
Setting Default Applies What it does
allow_origin "*" Right away Access-Control-Allow-Origin for playback, so players on other sites can fetch your streams.

The rest are tuning knobs most setups never need to touch:

Setting Default Applies What it does
manifest_cache "no-cache" Right away Cache-Control for HLS playlists and DASH manifests.
segment_cache "max-age=60" Right away Cache-Control for segments, parts and init files.
stream_cache "no-cache" Right away Cache-Control for the endless MPEG-TS stream.

Viewers. How viewers get counted.

[viewers]
tracking = "urls"
idle_timeout = "30s"
max_sessions = 100000
max_listed = 1000
max_user_agent_length = 256
idle_check = "5s"
Setting Default Applies What it does
tracking "urls" Right away With urls every player gets a session id in its playlist links and counts on its own, with address the links stay the same for caches and CDNs. One of urls or address.
idle_timeout "30s" Right away Ends an HLS or DASH session after this long without a request. At least 1ms.

The rest are tuning knobs most setups never need to touch:

Setting Default Applies What it does
max_sessions 100000 Right away Sessions tracked at the same time, past this new viewers still play but don’t get counted. From 1 to 1048576 sessions.
max_listed 1000 Right away Most sessions /api/v1/sessions lists at once, newest first. From 1 to 1048576 sessions.
max_user_agent_length 256 Right away Characters of each player’s user agent kept for the sessions list, 0 keeps none. Up to 4096 characters.
idle_check "5s" Right away How often idle sessions get cleared out. At least 1ms.

History. The short usage history behind the charts in the panel and /api/v1/history. It lives in memory, so it starts fresh after a restart.

[history]
interval = "5s"
span = "1h"
Setting Default Applies What it does
interval "5s" After a restart How often a usage sample gets taken, the output bitrate is measured over this stretch too. At least 1ms.
span "1h" After a restart How far back the usage history goes, it can’t be shorter than the sample interval. At least 1ms.

Incoming video. What happens to video on the way in.

[ingest]
buffer_frames = 8192
gop_cache_frames = 4096
gop_cache_bytes = 67108864
max_pending_frames = 600
max_pending_span = "3s"
bitrate_window = "2s"

These are tuning knobs most setups never need to touch:

Setting Default Applies What it does
buffer_frames 8192 After a restart Frames buffered per stream for readers that fall behind. From 1 to 1048576 frames.
gop_cache_frames 4096 After a restart Frames of the latest GOP kept so new viewers start on a keyframe.
gop_cache_bytes 67108864 After a restart Bytes of the latest GOP kept so new viewers start on a keyframe.
max_pending_frames 600 After a restart Frames held back while waiting for a stream’s second track to show up. At least 1.
max_pending_span "3s" After a restart Longest wait for a stream’s second track. At least 1ms.
bitrate_window "2s" After a restart Stretch of video the incoming bitrate is measured over. At least 1ms.

Sources and failover. Pulled sources, backups and how streams fail over between them.

[sources]
timeout = "5s"
fail_back = true
fail_back_after = "10s"
connect_timeout = "10s"
retry_delay = "1s"
max_retry_delay = "30s"
hls_start_segments = 3
max_download_bytes = 67108864
udp_buffer = 2097152
Setting Default Applies What it does
timeout "5s" Right away How long the source a stream follows can go without sending video before Nyquist moves on to the next one, and how long the stream stays live while another one takes over. At least 1ms.
fail_back true Right away Switches back to a source higher up the list once it works again.
fail_back_after "10s" Right away How long a higher source has to send video without trouble before the stream goes back to it.
connect_timeout "10s" Right away Time a pull gets to connect and start sending video, and the longest an HLS pull waits for a playlist or a segment. At least 1ms.

The rest are tuning knobs most setups never need to touch:

Setting Default Applies What it does
retry_delay "1s" Right away Pause before a pull that failed tries again, it doubles after every failure in a row. At least 1ms.
max_retry_delay "30s" Right away Longest pause between tries of a pull that keeps failing, it can’t be shorter than the retry delay. At least 1ms.
hls_start_segments 3 Right away Segments from the end of a live playlist an HLS pull starts with, more give a bigger cushion and fewer get closer to live. From 1 to 64 segments.
max_download_bytes 67108864 Right away Biggest playlist or segment an HLS pull downloads, so a broken server can’t fill up memory. From 1 to 1073741824 bytes.
udp_buffer 2097152 Right away Receive buffer Nyquist asks the system for on UDP sources, Linux caps it at net.core.rmem_max. From 1 to 268435456 bytes.

RTMP. The RTMP server encoders publish to.

[rtmp]
static_app = "static"
max_connections = 10000
idle_timeout = "30s"
handshake_timeout = "10s"
publish_timeout = "30s"
shutdown_timeout = "10s"
closing_timeout = "2s"
accept_retry = "100ms"
read_buffer = 65536
chunk_size = 4096
window_ack_size = 2500000
peer_bandwidth = 2500000
max_pending_media = 8388608
Setting Default Applies What it does
static_app "static" Right away RTMP app name that publishes to streams without a slash in their name.
max_connections 10000 After a restart RTMP connections at the same time. At least 1.
idle_timeout "30s" After a restart Drops a connection that goes quiet this long. At least 1ms.

The rest are tuning knobs most setups never need to touch:

Setting Default Applies What it does
handshake_timeout "10s" After a restart Time a new connection gets to finish the handshake. At least 1ms.
publish_timeout "30s" After a restart Longest a publish request waits for an answer. At least 1ms.
shutdown_timeout "10s" After a restart Time connections get to wrap up when Nyquist stops. At least 1ms.
closing_timeout "2s" After a restart Time Nyquist spends saying goodbye to a closing connection. At least 1ms.
accept_retry "100ms" After a restart Pause before trying again when the system won’t hand over a new connection. At least 1ms.
read_buffer 65536 After a restart Bytes read from a connection in one go. From 1 to 16777216 bytes.
chunk_size 4096 After a restart Chunk size Nyquist sends with. From 128 to 16777215 bytes.
window_ack_size 2500000 After a restart Acknowledgement window Nyquist asks clients for. From 1 to 4294967295 bytes.
peer_bandwidth 2500000 After a restart Bandwidth limit Nyquist tells clients to stay under. From 1 to 4294967295 bytes.
max_pending_media 8388608 After a restart Media bytes a client can send before its publish gets an answer. At least 1.

SRT. The SRT listeners encoders publish to.

[srt]
latency = "120ms"
max_connections = 1000
payload_size = 1316
backlog = 128
receive_queue = 1024
Setting Default Applies What it does
latency "120ms" After a restart SRT latency, more of it rides out rougher networks. Up to 24d 20h 31m 23s 647ms.
max_connections 1000 After a restart SRT connections at the same time. At least 1.

The rest are tuning knobs most setups never need to touch:

Setting Default Applies What it does
payload_size 1316 After a restart Payload bytes per packet, a multiple of 188 keeps MPEG-TS packets whole. From 1 to 1456 bytes.
backlog 128 After a restart Callers that can wait to be accepted. From 1 to 65536 callers.
receive_queue 1024 After a restart Messages a connection can queue up. From 1 to 65536 messages.

Log. How chatty the log is.

[log]
level = "info"
Setting Default Applies What it does
level "info" Right away How chatty the log is, RUST_LOG wins over this when it’s set. One of off, error, warn, info, debug or trace.