FFmpeg SRT Listener Setup in 2026: srt://:9000?mode=listener, Restreaming, and Low Latency

Published on

FFmpeg SRT listener on a VPS: mode=listener URLs, UDP firewall rules, latency tuning, stream-copy restreams, systemd, and fixes for bind errors and packet loss.

Written by Jochem – Infrastructure Engineer at Space-Node – 5-10 years experience in game server hosting, VPS infrastructure, and 24/7 streaming solutions. Read author bio →

FFmpeg SRT setup is one of the most practical ways to get a stable ingest from the public internet into your VPS. The ffmpeg srt listener output pattern lets your server wait on a port while your field encoder connects out, which fits NAT-heavy uplinks at venues, homes, and mobile rigs.

This guide walks through listener versus caller modes, the exact srt://:9000?mode=listener style URLs, firewall configuration, restream pipelines, low-latency tuning, and troubleshooting. If you host with Space-Node, you can run these examples on a small Linux VPS once UDP is allowed for your chosen port.

SRT modes: listener versus caller

SRT connections have two roles:

  • Caller: the side that initiates the connection to a remote IP and port.
  • Listener: the side that binds a local port and waits for an incoming SRT handshake.

For mobile or home encoders behind carrier-grade NAT, listener on the VPS is popular. Your phone or backpack encoder calls out to a fixed datacenter IP, which avoids needing inbound ports on the home connection.

The reverse also works: VPS as caller to a listener on a device you control, but that device must be reachable. Many teams standardize on listener on the server for simplicity.

FFmpeg as an SRT listener: core syntax

A minimal listener that receives SRT and prints stream info (replace 9000 as needed):

ffmpeg -loglevel info -i 'srt://0.0.0.0:9000?mode=listener' -f null -

Notes:

  • 0.0.0.0 binds all interfaces. You can bind a specific private IP if your host uses multiple NICs.
  • mode=listener is the critical query parameter for this role.
  • Port must be free and allowed by the firewall.

To receive and restream to RTMP (example destination URL is placeholder):

ffmpeg -re -i 'srt://0.0.0.0:9000?mode=listener&latency=200000' \
  -c copy -f flv "rtmp://live.example.com/app/streamkey"

Latency in SRT is measured in microseconds in many FFmpeg builds. 200000 is 200 ms. Lower values reduce delay but punish jittery networks.

Caller example for symmetry

If your VPS connects to a remote listener instead:

ffmpeg -i 'srt://203.0.113.50:9000?mode=caller&latency=200000' -c copy -f flv "rtmp://..."

Compare the two URLs mentally: listener binds locally, caller targets a remote host.

Practical restream patterns

Stream copy when codecs align

If your encoder sends H.264 and AAC in a container FFmpeg can read, -c copy avoids re-encoding:

  • Saves CPU on the VPS.
  • Preserves quality from the source.

Platforms differ on B-frame and keyframe expectations. If a destination rejects the stream, you may need a transcode or encoder profile changes at the source.

Duplicate outputs with tee

You can fan out to multiple RTMP endpoints. One readable pattern is tee in FFmpeg; exact syntax varies by build. When in doubt, run two FFmpeg processes reading from the same SRT listener using a media proxy or ffmpeg with filter_complex and tee, or use a small dedicated restream tool. For reliability, many operators prefer one parent FFmpeg that outputs to tee or run nginx-rtmp or OvenMediaEngine as the fan-out layer.

For a single-server approach without extra services, a pragmatic option is ffmpeg per destination from a local UDP or RTMP loopback produced by a first-stage receiver. Pick the architecture you can restart cleanly under systemd.

Recording a sidecar file

Add a second output mapping in your command plan, or run a parallel FFmpeg that ingests the same SRT on another port using srt-live-transmit or similar if you need isolation. Simplicity beats cleverness on show day.

Low-latency streaming setup

Latency is the sum of encoder buffer, network, SRT latency, FFmpeg mux, and platform ingest buffer.

Practical tuning:

  • Lower latency in the SRT URL in small steps (for example 120 ms to 200 ms) until you see drops, then back off slightly.
  • Match keyframe interval at the encoder to your platform guidance (often 2 s for RTMP-style paths).
  • Avoid -re unless you intentionally want to pace input; for live ingest it can add delay depending on chain. Many listener examples omit -re for true live input.

Test with ping and packet loss tools from the encoder network. SRT helps, but it cannot invent bandwidth.

Firewall configuration

SRT uses UDP for the media path in typical FFmpeg usage.

On ufw (Ubuntu), allow the port:

sudo ufw allow 9000/udp
sudo ufw reload

On firewalld (RHEL family):

sudo firewall-cmd --permanent --add-port=9000/udp
sudo firewall-cmd --reload

Also verify:

  • Cloud security groups or provider firewalls in the control panel. Missing UDP there is the most common "works at home, fails in prod" issue.
  • NAT hairpinning if you test from the same host incorrectly.

Passphrase and security

For production ingest, use a passphrase so random scanners cannot connect:

ffmpeg -i 'srt://0.0.0.0:9000?mode=listener&passphrase=yourlongsecret&pbkeylen=16' ...

Rotate secrets when staff changes. Pair with IP allow lists on the firewall when sources have fixed IPs.

Troubleshooting common issues

Bind failed or address already in use

Another process holds the port. Check with:

ss -ulpn | grep 9000

Stop stale FFmpeg or change the port consistently on encoder and server.

Connection established but black video

Often codec or pixel format mismatch at the mux stage, or the destination requires AAC audio while you send Opus. Inspect with:

ffprobe 'srt://0.0.0.0:9000?mode=listener'

Let it run a few seconds to print streams.

Packet loss and stutter

Raise latency slightly, reduce bitrate from the encoder, or fix Wi-Fi. LTE without external antenna can be marginal for high bitrate 1080p.

High CPU on the VPS

You probably transcoded by accident. Confirm -c copy in the path. If you must transcode, scale vCPU on the host. Space-Node VPS plans can be resized when you outgrow a relay-only box.

IPv6-only clients

If your encoder path is IPv6 and the VPS is IPv4-only (or the reverse), handshake fails. Align stacks or use a dual-stack host and DNS.

systemd: keep the listener alive

A minimal unit sketch (adapt paths and users):

[Unit]
Description=FFmpeg SRT listener relay
After=network-online.target

[Service]
ExecStart=/usr/bin/ffmpeg -nostdin -loglevel warning \
  -i 'srt://0.0.0.0:9000?mode=listener&latency=200000' \
  -c copy -f flv "rtmp://live.example.com/app/streamkey"
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

Reload systemd, enable the unit, and check journalctl for FFmpeg errors.

When FFmpeg alone is not enough

At high scale, consider dedicated media servers with connection management, API hooks, and adaptive egress. For many creators and small broadcasters, FFmpeg SRT listener on a VPS remains the sweet spot for cost and control.

Version checks that save hours

Before you paste commands from old forum threads, confirm:

  • ffmpeg -version lists libsrt or the SRT feature you expect.
  • Your distro did not ship a minimal FFmpeg without protocols you need.

If SRT is missing, install a full build from the vendor documentation for your OS, or use a static build you trust. Space-Node Linux images are standard enough that apt or the project's own repo usually suffices, but always verify in one shell session before you automate.

Logging you can read under stress

Use -loglevel warning or -loglevel error in production to avoid disk spam, but during setup run -loglevel info long enough to see:

  • Handshake success or failure codes.
  • Dropped packet counters if exposed by your build.

Redirect to a file only when needed; rotate logs so a weekend test does not fill /.

Bandwidth math for operators

If your encoder sends 10 Mbps average to the VPS, then copy to two RTMP targets often means 20 Mbps egress from the VPS, plus protocol overhead. Add 10 to 20 percent headroom for retransmits and bursts. If numbers do not fit your plan, lower bitrate or reduce destinations.

Testing from a second machine

Loopback tests on the same server can hide NAT and path MTU issues. From a second VPS or home connection, run a short caller test into your listener with a known test pattern (color bars from a hardware encoder, or lavfi from another FFmpeg). This mirrors real life better than localhost alone.

FAQ

What does srt://:9000?mode=listener mean?

The empty host shorthand often implies listen on all interfaces on port 9000 in listener mode. Some tools require 0.0.0.0 explicitly. If one fails, try the other with your FFmpeg build.

Listener or caller for IRL streaming?

Listener on the VPS is common when the encoder is on LTE or home internet without port forwarding. Caller on the VPS works when the receiving device is publicly reachable.

Is SRT always UDP?

In typical FFmpeg deployments you should assume UDP and open UDP ports. Always confirm with your FFmpeg and libsrt build docs if you use experimental modes.

Why use microsecond latency values?

SRT parameters historically use microseconds for latency in many URLs. 200000 equals 200 ms. Read your version's docs if defaults change.

Can I use the same VPS for games and SRT?

Yes, if CPU and bandwidth headroom exist. Isolate services with firewall rules and separate ports so a game panel restart does not collide with your ingest.


Jochem is an Infrastructure Engineer at Space-Node. Commands are examples: replace keys, hosts, and ports before production use.

About the Author

Jochem – Infrastructure Engineer at Space-Node – Expert in game server hosting, VPS infrastructure, and 24/7 streaming solutions with 5-10 years experience.

Since 2023
500+ servers hosted
4.8/5 avg rating

I specialize in Minecraft, FiveM, Rust, and 24/7 streaming infrastructure, operating enterprise-grade AMD Ryzen 9 hardware in Netherlands datacenters.

View my full bio and credentials →

Start Streaming in Minutes

Join content creators worldwide who trust our streaming infrastructure. Setup is instant and support is always available.

FFmpeg SRT Listener Setup in 2026: srt://:9000?mode=listener, Restreaming, and Low Latency