RTP SSRC collision detected: terminating stream
ID: communication/rtp-ssrc-collision-detected
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| FFmpeg 6.1 | active | — | — | — |
| GStreamer 1.22.0 | active | — | — | — |
| WebRTC (libwebrtc M120) | active | — | — | — |
| Janus 1.2.0 | active | — | — | — |
| MediaSoup 3.10.0 | active | — | — | — |
Root Cause
Two or more RTP participants in the same session are using the same Synchronization Source (SSRC) identifier, causing the RTP stack to terminate one stream to resolve the collision as per RFC 3550 section 8.1.
generic中文
同一RTP会话中的两个或多个参与者使用了相同的同步源(SSRC)标识符,导致RTP堆栈终止其中一个流以解决冲突,如RFC 3550第8.1节所述。
Official Documentation
https://www.rfc-editor.org/rfc/rfc3550#section-8.1Workarounds
-
85% success Ensure each RTP participant generates a random SSRC using a cryptographically secure random number generator: in C with GStreamer, set 'gst_rtp_buffer_set_ssrc(buffer, g_random_int())'.
Ensure each RTP participant generates a random SSRC using a cryptographically secure random number generator: in C with GStreamer, set 'gst_rtp_buffer_set_ssrc(buffer, g_random_int())'.
-
80% success Use RTCP to detect and resolve collisions automatically: enable RTCP support in both sender and receiver, and implement the collision resolution logic from RFC 3550 section 8.2 (send BYE and re-randomize SSRC).
Use RTCP to detect and resolve collisions automatically: enable RTCP support in both sender and receiver, and implement the collision resolution logic from RFC 3550 section 8.2 (send BYE and re-randomize SSRC).
中文步骤
Ensure each RTP participant generates a random SSRC using a cryptographically secure random number generator: in C with GStreamer, set 'gst_rtp_buffer_set_ssrc(buffer, g_random_int())'.
Use RTCP to detect and resolve collisions automatically: enable RTCP support in both sender and receiver, and implement the collision resolution logic from RFC 3550 section 8.2 (send BYE and re-randomize SSRC).
Dead Ends
Common approaches that don't work:
-
Manually assign a fixed SSRC value in the RTP sender configuration
95% fail
Static SSRC assignment guarantees collisions if multiple senders use the same value; RFC requires SSRC to be randomly chosen to minimize collision probability.
-
Disable SSRC collision detection in the RTP stack
90% fail
Disabling collision detection violates RFC 3550 and can cause undetected stream corruption, packet loss, and audio/video desynchronization.
-
Increase the RTP buffer size to absorb the collision
85% fail
Buffer size does not affect SSRC collisions; it only affects jitter handling and packet reordering.