Run Media Ingress
Media Ingress, a Vindral Bridge component, receives live streams over RTMP, SRT and MoQ and serves them to subscribers. In a Bridge setup it is the ingest point that encoders publish to, and Packager or a player subscribes to the streams it holds. Run it on its own, on premises or in the cloud.
This page runs Media Ingress standalone in Docker with a config.toml file in the current directory.
Bridge images are distributed by Vindral. Contact us for access, the image names and the current release tag.
Start the container
docker run \
-v "$(pwd)/config.toml:/app/config.toml" \
--network host \
--restart always \
--name media-ingress \
-d YOUR_MEDIA_INGRESS_IMAGE:YOUR_RELEASE_TAG -c /app/config.toml
Host networking keeps the listener ports and the client addresses intact. Check the logs with docker logs media-ingress.
Publish and play a stream
These examples use the ports from the example configuration and the stream key teststream. Replace localhost with the server's address when the encoder or player runs on another machine. A stream published over one protocol can be played over the others when they support its codecs. SRT playback carries H.264, HEVC and MPEG-2 video, so an AV1 stream published over MoQ or Enhanced RTMP plays over SRT without its video.
RTMP
- Publish from OBS: server
rtmp://localhost:1935/publish/, stream keyteststream. - Play in VLC or ffplay:
rtmp://localhost:1935/play/teststream.
SRT
SRT carries MPEG-TS. The SRT stream ID names the stream and says whether you publish or play:
| To | Stream ID |
|---|---|
| Publish | teststream, or #!::r=teststream,m=publish |
| Play | #!::r=teststream,m=request |
A plain stream ID publishes, so encoders that only take a URL work. A stream ID in the #!:: form with no m= plays.
Publish a test pattern with FFmpeg, then play it with ffplay:
ffmpeg -re -f lavfi -i testsrc2=size=1280x720:rate=25 -f lavfi -i sine=frequency=440 \
-c:v libx264 -preset veryfast -g 50 -c:a aac \
-f mpegts 'srt://localhost:3333?streamid=teststream'
ffplay 'srt://localhost:3333?streamid=#!::r=teststream,m=request'
In OBS, set the server to srt://localhost:3333?streamid=teststream and leave the stream key empty.
MoQ
Media Ingress serves MoQ over QUIC (WebTransport) on the [moq] port and over WebSocket on the [moq_ws] port. Use WebSocket where networks block QUIC. Packager subscribes to a stream with a moq source:
[[sources]]
id = "from-ingress"
source_type = "moq"
[sources.protocol_options]
url = "ws://YOUR_INGRESS_HOST:8087/voq/subscribe?id=teststream"
channel_id = "teststream"
transport_mode = "websocket"
Set channel_id to the stream key with each sk replaced by ci; for teststream the two are the same. The source receives the stream whose channel ID matches.
To publish to Media Ingress over MoQ, point a moq sink at /voq/publish on the same port. The stream key in the query string names the stream, and channel_id follows the same rule:
[[sinks]]
id = "to-ingress"
sink_type = "moq"
source_ids = ["encode"]
[sinks.protocol_options]
url = "ws://YOUR_INGRESS_HOST:8087/voq/publish?id=teststream"
channel_id = "teststream"
transport_mode = "websocket"
See the HTTP API for the endpoints and MoQ transport selection for the transport modes.
A standalone Media Ingress accepts any stream key for publishing and playback. Run it on a trusted network, or restrict the RTMP, SRT, MoQ and HTTP ports with a firewall so only your encoders and subscribers can reach them. The /metrics and /state endpoints include stream keys, so keep the HTTP port private too.
Configuration
Media Ingress reads a TOML file. Each section configures one listener or one part of the service. Add or remove listener sections to match the protocols you need.
The [logging], [http], [tls] and [common] sections are required, and [common] must set hostname, datacenter, adapter_speed_mbps and max_load. Media Ingress exits at startup if any of them is missing.
Example configuration
[rtmp]
host = "0.0.0.0"
port = 1935
enhanced_mode = true
# Set to true only behind a load balancer that sends the PROXY protocol header.
proxy_protocol = false
[srt]
host = "[::0]"
port = 3333
latency_receiver = 120
latency_sender = 0
idle_timeout = 5_000
level = "info"
[moq]
host = "0.0.0.0"
port = 7001
# Required for publishing and subscribing to MoQ over WebSocket.
# Without this section those endpoints are not served.
[moq_ws]
host = "0.0.0.0"
port = 8087
[http]
host = "0.0.0.0"
port = 8086
[logging]
level = "info"
mode = "fancy"
[common]
# Names that identify this instance in logs and metrics.
hostname = "ingress-01"
datacenter = "venue-a"
# Capacity: the network adapter speed and the share of it to use.
adapter_speed_mbps = 1000
max_load = 0.8
allowed_codecs = ["h264", "aac", "av1", "opus", "hevc"]
# Unique identifier for this instance. Defaults to a random UUIDv4.
# id = "some-unique-id"
# Connection handler timeout. Default 10s.
# connection_timeout = "10s"
[tls]
self_signed = { reload_interval_seconds = "3600" }
# Use a trusted certificate instead of a self-signed one:
# trusted = { cert_file_path = "/etc/media-ingress/certs/fullchain.pem", key_file_path = "/etc/media-ingress/certs/privkey.pem", reload_interval_seconds = "3600" }
Sections
| Section | Purpose |
|---|---|
[rtmp] | RTMP listener. enhanced_mode accepts Enhanced RTMP, which carries HEVC and AV1. proxy_protocol reads the client's address from a PROXY protocol header and defaults to true. The listener trusts any such header, so set it to false unless a load balancer in front adds the header; otherwise clients can fake the source address shown in logs, /state and metrics. |
[srt] | SRT listener. latency_receiver and latency_sender are in milliseconds; idle_timeout closes a silent connection after that many milliseconds. |
[moq] | MoQ listener over QUIC. |
[moq_ws] | MoQ over WebSocket, for networks that block QUIC. Served on its own port. See the HTTP API. |
[http] | Health, status, state and metrics endpoints. See the HTTP API. |
[logging] | Log level and format. |
[common] | Instance identity, capacity limits and the codecs it accepts. |
[tls] | Certificate for the TLS-based listeners: self-signed, or a trusted certificate from files. Certificates are reloaded at the interval you set. |
adapter_speed_mbps and max_load set when the instance reports itself as full on /status. With the values above, it reports full once inbound or outbound traffic passes 80% of a 1 Gbit/s adapter, so a load balancer that checks /status can send new streams to another instance.