How to Set Up Unreal Media Server for Low-Latency Live StreamsLow-latency streaming is critical for live events, interactive broadcasts, remote production, and any scenario where audience interaction or near-real-time monitoring matters. Unreal Media Server (UMS) is a Windows-based streamer that supports multiple protocols (SRT, RTMP, WebRTC, RTSP, HLS, MPEG-TS, and more) and is often chosen for low-latency workflows because of its WebRTC and SRT capabilities. This guide walks through planning, installation, configuration, and optimization steps to set up Unreal Media Server specifically for low-latency live streaming.
What “low latency” means here
Latency refers to the time between when a video frame is captured at the source and when a viewer sees it. For many interactive uses, “low latency” means under 1 second (WebRTC/SRT can approach sub-second); for live sports or one-way viewing, 1–5 seconds may be acceptable. The steps below target sub-second to a few-second latency using WebRTC and SRT where appropriate.
Prerequisites
- Windows server or workstation (Windows ⁄11, Windows Server 2016/2019/2022). UMS is Windows-only.
- Network with adequate upload bandwidth (bitrate × number of simultaneous viewers + overhead). For a single 3 Mbps stream, allow ~4 Mbps upload.
- Static public IP or reliable NAT with port forwarding if behind a router.
- Unreal Media Server installer (download from the official site; use the latest stable release).
- Optional: SSL certificate for secure WebRTC (TLS) or use UMS built-in self-signed option for tests.
- A source encoder (OBS Studio, vMix, hardware encoders) supporting RTMP/SRT/WebRTC as needed.
- Optional: TURN server if you expect many WebRTC clients behind strict NATs or corporate networks.
Installation
- Download the latest Unreal Media Server for Windows from the official site.
- Run the installer and follow the prompts. Choose default folders unless you have a separate storage or network setup.
- After installation, run the Unreal Media Server application or service. The server has both a GUI console and a web admin interface (usually on port 8081 by default).
Basic Server Configuration
- Open the UMS web admin interface (http://
:8081) or the local GUI. - Go to the General Settings and set:
- Server name and description.
- Bind addresses: choose the public IP or 0.0.0.0 to listen on all interfaces.
- Ports: confirm default streaming ports (RTMP 1935, HTTP ⁄8080, WebRTC ⁄443 if using TLS). Change if needed to match your network.
- Configure logging and retention as required for troubleshooting.
Choosing Protocols for Low Latency
- WebRTC: Best for sub-second latency to browsers and mobile clients. Native support in modern browsers and optimized for low-latency, two-way communication.
- SRT: Great for contribution (encoder → server) with low latency and packet-recovery over unreliable networks. Works well for encoder-to-server and server-to-server links.
- RTMP: Useful for encoder compatibility, but not optimal for end viewer low-latency; often used as an ingest method.
- HLS/DASH: Not suitable for sub-second latency; used for wide device compatibility but higher latency (3–30+ seconds).
- WebSocket-based players and proprietary low-latency options: possible in some setups, but WebRTC and SRT are recommended.
For low-latency live streaming target WebRTC for viewers and SRT for contribution where possible.
Setting Up a Low-Latency Ingest (SRT / RTMP)
Option A — SRT Ingest (preferred for unreliable networks):
- In your encoder (hardware or software that supports SRT), set mode to caller/listener as appropriate. For direct push to UMS choose “Caller” mode if UMS is in listener mode.
- In UMS, enable SRT input and configure a listener port (e.g., 10080). Ensure firewall/port-forwarding allows inbound UDP on that port.
- Use an SRT URL like: srt://your.server.ip:10080?streamid=your_stream_key
- Verify the connection in the UMS dashboard. SRT allows tuning of latency buffer (latency= parameter) and packet retransmission settings — lower the latency parameter to approach real-time but balance with link quality.
Option B — RTMP Ingest (easiest, slightly higher latency):
- Configure your encoder to stream to rtmp://your.server.ip/live/streamkey (or whatever application/stream name you set in UMS).
- Confirm the server accepts the RTMP connection and shows the live feed.
Enabling WebRTC for Viewer Delivery
- In UMS admin, enable WebRTC streaming. Configure TLS:
- For production, upload a valid SSL certificate (recommended ports: 443 for HTTPS/WebRTC).
- For testing, the built-in self-signed cert can work but will prompt warnings in browsers.
- Create a publish point (application) for the incoming stream (e.g., /live) and ensure it is mapped to be deliverable to WebRTC clients.
- Configure ICE/STUN/TURN:
- Set a STUN server (public STUN like stun.l.google.com:19302) to help with NAT traversal.
- If many clients are behind restrictive NATs, configure a TURN server and add its credentials to UMS so WebRTC can route through TURN when direct peer connection fails.
- CORS and allowed origins: set allowed domains for player pages to avoid cross-origin issues.
Player Setup (Browser / Mobile)
- Use a WebRTC-capable playback page (UMS includes example player pages). For browsers, use getUserMedia peer connections for two-way or simple play-only connections.
- For mobile apps, use native WebRTC libraries (iOS: WebRTC.framework, Android: libwebrtc) or use players that support WebRTC.
- Use a connection offer/answer handshake with signaling handled by UMS. The sample HTML/JS provided by UMS demonstrates the flow.
Latency Tuning & Optimization
Network and server tuning are the biggest levers for latency:
- Encoder settings:
- Use constant bitrate (CBR) or constrained VBR suitable to your upload capacity.
- Choose keyframe (IDR) interval of 1–2 seconds for quick recovery; 1s often helps reduce perceived latency.
- Use hardware encoding (NVENC, QuickSync) to reduce encode time.
- UMS buffer and protocol settings:
- For SRT: lower the latency parameter (e.g., 50–300 ms) to reduce buffer; increase only if packet loss is excessive.
- For WebRTC: minimize audio and video jitter buffers; UMS settings expose some of these.
- Network:
- Ensure minimal hops between encoder and server; colocate encoder or use a nearby cloud region.
- Use QoS and prioritize RTP/SRT/WebRTC traffic if you control network equipment.
- Avoid high network saturation; leave headroom for retransmissions and signaling.
- Video parameters:
- Lower resolution and bitrate when aiming for ultra-low latency (e.g., 720p30 @ 2.5–4 Mbps), or 480p for constrained networks.
- Use faster presets (x264 ultrafast/veryfast or hardware encoder) to reduce encode latency.
- Client-side:
- Keep player buffer settings low; disable additional buffering in the player if possible.
- For web pages, avoid long reconnection/backoff timers for quick recovery.
- Monitoring:
- Monitor round-trip time (RTT), packet loss, and jitter. Adjust SRT latency and WebRTC ICE candidate settings based on metrics.
- Use UMS logs and stats to identify bottlenecks.
Scalability and Distribution
If you expect many concurrent viewers:
- Use UMS server clusters or multiple UMS instances and set up server-side replication or stream pulling to distribute load.
- Use SRT or WebRTC server-to-server links to move streams to edge servers near viewers.
- Consider a hybrid: UMS for ultra-low-latency interactive segments; HLS or CMAF Low-Latency for large-scale passive audiences (UMS can transmux for broader compatibility).
- Use a CDN that supports WebRTC or a low-latency CDN with SRT/WEbRTC peering if available.
Comparison (quick):
Use-case | Recommended ingest | Recommended delivery |
---|---|---|
Interactive browser viewers | SRT / RTMP from encoder | WebRTC |
Remote encoder contribution over unreliable net | SRT | WebRTC/SRT to clients |
Large-scale passive viewers | RTMP/SRT ingest | HLS / LL-CMAF (higher latency but scalable) |
Security and Access Control
- Use secure TLS for WebRTC and HTTPS player pages. Install a valid certificate for production.
- Require stream keys or authentication for publishers (UMS supports token-based auth).
- Limit published applications to known IPs or use ACLs where possible.
- Regularly update UMS to the latest version to get security fixes.
Common Troubleshooting
- No video in browser:
- Check that WebRTC is enabled and TLS cert is valid.
- Verify STUN/TURN settings and ICE candidate exchange.
- Confirm the stream is published and visible in UMS admin.
- High latency despite settings:
- Inspect network jitter and packet loss. Increase SRT latency slightly or improve network.
- Check encoder keyframe interval and encoding latency (use faster presets).
- Viewer dropouts at scale:
- Check server CPU/network saturation; scale out with more UMS instances or edge servers.
- NAT/firewall issues:
- Open required ports (TCP/UDP for SRT, HTTPS/WebRTC). Use TURN for strict NATs.
Example Minimal Workflow (Practical Steps)
- Install UMS on a Windows server with public IP.
- Configure SRT listener on port 10080 in UMS.
- Configure WebRTC with a valid TLS certificate and STUN server.
- In OBS set SRT mode to “caller” and stream to srt://your.server.ip:10080?streamid=live/stream01 and set latency parameter to 120.
- In UMS map the incoming stream path live/stream01 to the WebRTC application.
- Use the UMS sample WebRTC player page on https://your.server/ to connect and verify sub-second to ~1s latency.
- Monitor stats and adjust SRT/WebRTC buffers and encoder settings until you reach the target latency.
Final Notes
- WebRTC + SRT is the modern combo for low-latency, resilient live streaming: SRT for contribution and WebRTC for end-user delivery.
- Achieving sub-second latency requires tuning across encoder, network, server, and player — there’s no single switch.
- Test under realistic conditions (multiple viewers, real network constraints) and iterate on encoder bitrate, keyframe interval, and buffer sizes.
If you want, I can create a step-by-step checklist tailored to your exact encoder (OBS/vMix/hardware) and server environment or produce the sample HTML/JS WebRTC player configured for your server — tell me which encoder and whether you have a public IP or NAT.
Leave a Reply