Broadcast Errors // StreamRelay Lab
WebRTC WHEP UDP ICE Port Drop & Symmetric NAT Timeouts
Sub-second MediaMTX WHEP playback requires viewers to complete ICE UDP handshakes on port 8189—if UFW or NAT drops UDP, browsers hang at ICE checking.
Measured MediaMTX & FFmpeg Telemetry
Modern MediaMTX defaults to multiplexing all WebRTC ICE traffic onto a single UDP socket (webrtcLocalUDPAddress: :8189). However, cloud firewalls frequently leave only TCP 80/443/8889 open, or Docker NAT hides the host public IP from ICE candidates.
| Subsystem / Signal | Measured Target | Operational Impact |
|---|---|---|
| WHEP Sub-Second Target | 180 - 350 ms glass-to-glass | Requires UDP :8189 reachability |
| Blocked UDP Fallback | ICE Failed / 5-15s stall | Browsers reject private Docker 172.17.x.x IPs |
| Go MediaMTX WHEP Overhead | +45 - 80 MB RSS | Handles DTLS/SRTP fan-out natively |
Step-by-Step Triage & Config Remediation
- Open UDP 8189 and TCP 8889: Allow ufw allow 8189/udp and 8889/tcp (or proxy WHEP signaling over HTTPS 443 while keeping UDP 8189 direct).
- Set webrtcAdditionalHosts: Add your public VDS IPv4 address to webrtcAdditionalHosts in mediamtx.yml so Docker does not advertise internal bridge IPs.
- Disable B-frames on WebRTC ingest: Configure OBS with bframes=0 (zerolatency) so WebRTC browsers decode frames in strict order without micro-stutters.
# mediamtx.yml WebRTC WHEP working block webrtc: yes webrtcAddress: :8889 webrtcEncryption: no webrtcLocalUDPAddress: :8189 webrtcAdditionalHosts: [203.0.113.10]
Diagnostic FAQ
Can Cloudflare Orange Cloud proxy WebRTC UDP 8189?
No. Standard HTTP proxies cannot forward raw WebRTC UDP media packets on port 8189; point your WHEP media host or DNS-only A record directly at the VDS IP.
Why does WebRTC stutter on Chrome when OBS uses default settings?
Default OBS H.264 profiles enable 2 B-frames, which WebRTC decoders reorder with jitter. Set B-Frames = 0 in OBS for WHEP.