I’m using mediasoup in an Express project to build a video conferencing application. However, I’m facing an intermittent issue where a peer joins the room but cannot see/hear others (video/audio streams from other peers are not displayed). The issue is resolved when the peer refreshes the page. Here are the details of my problem:
Problem Description
When a peer joins the room, they do not receive video/audio streams from other peers.
The names of other peers are visible, but the streams are missing (displayed as “black squares”).
The issue is resolved when the peer refreshes the page.
Mediasoup Logs
I enabled mediasoup logs, and here are the errors I’m seeing:
2025-02-03T08:54:13.764Z mediasoup:WARN:Channel [pid:1436684] RTC::Producer::ReceiveRtpPacket() | no stream found for received packet [ssrc:603892996]
2025-02-03T08:58:58.305Z mediasoup:WARN:Channel [pid:1436684] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:731891105, payloadType:97]
2025-02-03T08:58:58.737Z mediasoup:WARN:Channel [pid:1436684] RTC::Producer::ReceiveRtpPacket() | no stream found for received packet [ssrc:731891105]
2025-02-03T08:59:24.627Z mediasoup:WARN:Channel [pid:1436684] RTC::Producer::ReceiveRtpPacket() | no stream found for received packet [ssrc:1189021310]
2025-02-03T08:59:25.430Z mediasoup:WARN:Channel [pid:1436684] RTC::Producer::ReceiveRtpPacket() | no stream found for received packet [ssrc:3901521563]
2025-02-03T08:59:27.005Z mediasoup:WARN:Channel [pid:1436684] RTC::Producer::ReceiveRtpPacket() | no stream found for received packet [ssrc:2881710948]
2025-02-03T08:59:53.510Z mediasoup:WARN:Channel [pid:1436684] RTC::IceServer::OnTimer() | ICE consent expired due to timeout, moving to ‘disconnected’ state
2025-02-03T08:59:54.540Z mediasoup:WARN:Channel [pid:1436684] RTC::WebRtcTransport::SendSctpData() | DTLS not connected, cannot send SCTP data
Context
mediasoup version: v3
Environment: Node.js with Express
Browser: Chrome (latest version)
mediasoup configuration: I’m using a standard configuration for WebRTC transports and routers.
Hypotheses
Based on the logs, I suspect the issue might be related to:
SSRC desynchronization: RTP packets are not correctly associated with streams.
DTLS/SCTP connection issues: The DTLS or SCTP connection is not established properly.
Bandwidth instability: Bandwidth fluctuations might be causing interruptions.
ICE connection issues: The ICE connection is timing out or failing.
Question
Do you have any ideas about what could be causing this issue?
How can I better diagnose and resolve this problem?
Are there any best practices for handling SSRC, DTLS/SCTP connections, or bandwidth issues in mediasoup?
You will see same “errors” if you check the logs when everything goes fine.
Yours is probably a “browser auto-play policy” issue (Google it please). And check chrome://webrtc-stats to verify that, indeed, RTP is being received for those streams.
Thanks for your suggestion! While I agree that the browser’s autoplay policy can often be the cause of problems like this, I don’t think it’s the primary cause in my case. Here’s why:
Random Occurrence: The problem occurs randomly, even with peers who are familiar with the application and have already successfully logged in several times.
If you like, I can give you the media logs for the peer who has this error… but I can’t see anything wrong, the producers are well created, the consumers too…
There must be necessarily something wrong in your server or client code and perhaps transports or consumers creation is not robust and fails randomly. I cannot guess why. But I guarantee it’s not a bug in mediasoup libraries.