Broadcast Errors // StreamRelay Lab
RTMP Ingest TCP Window Stalls & writeQueueSize Overflows
When publisher bitrate spikes above 8-12 Mbps over long-haul TCP, small socket buffers and undersized writeQueueSize cause OBS to drop frames and reset RTMP.
Measured MediaMTX & FFmpeg Telemetry
RTMP runs over single-stream TCP port 1935. If packet loss or slow downstream readers backpressure MediaMTX’s internal ring buffer (default writeQueueSize: 512), publisher packets stall or disconnect.
| Subsystem / Signal | Measured Target | Operational Impact |
|---|---|---|
| Default writeQueueSize | 512 packets | Too small for 8-12 Mbps 60fps bursts |
| Hardened writeQueueSize | 2048 - 4096 packets | Absorbs transient RTT jitter cleanly |
| Required Keyframe Interval | 2 seconds (GOP) | Mandatory for clean HLS/WHEP switching |
Step-by-Step Triage & Config Remediation
- Raise writeQueueSize to 2048+: Increase writeQueueSize in mediamtx.yml to absorb micro-bursts from 8-12 Mbps streams.
- Enforce 2-second Keyframe Interval: Set OBS Keyframe Interval = 2s; irregular keyframes break LL-HLS part boundaries.
- Switch congested ingest to SRT :8890: If trans-Atlantic TCP RTMP drops frames, send SRT over UDP :8890 with 200 ms ARQ latency.
# mediamtx.yml RTMP ingest resilience writeQueueSize: 2048 rtmp: yes rtmpAddress: :1935 readTimeout: 15s writeTimeout: 15s
Diagnostic FAQ
Does raising writeQueueSize consume much RAM?
Increasing writeQueueSize from 512 to 2048 adds only a few megabytes per active path inside Go MediaMTX.
Should I encrypt RTMP with RTMPS or use SRT?
SRT with passphrase encryption (:8890) handles packet loss and jitter far better than TCP-based RTMPS over public internet links.