I have log consumer.score on the console and its score is 10 as in the screen short.
my client side producer code and consumer code are:
Everything look fine on the console by media stream is not playing.
I have log consumer.score on the console and its score is 10 as in the screen short.
my client side producer code and consumer code are:
It is highly recommended to consume with paused: true
and resume once client confirms consumer is created on the other side and is ready to receive data: https://mediasoup.org/documentation/v3/mediasoup/api/#transport-consume
I have created consumer with paused in server and resuming when client side consumer is ready.
Then go to chrome://webrtc-internals/
to see if any media is flowing in or out, whether there is any data flowing at all.
On checking hrome://webrtc-internals/
data is flowing through sending end but on receiving end no data is flowing.
Then WebRTC connection must not be established properly.
Mediasoup dose not shows any error so how can I check what’s the problem?
Start with ICE candidate pairs, see if there is any connected. If there is and connection works, double check application logic, there must be an error somewhere.
Have you enabled ICE logs in mediasoup? Have you checked ICE status in your Transports?
Don’t expect magic from mediasoup if you do nothing to monitor it.
Thanks for the replay. My problem got solved. I don’t know what was the problem I write my code form scratch for consumer. Now its working…
I’m getting a similar issue here and I do have ICE/DTLS logs enabled. Here’s what I’m seeing:
INFO [2021-01-04 17:39:12 PM] (ffa2f8fc): Started query RtpCapabilities
INFO [2021-01-04 17:39:12 PM] (ffa2f8fc): Parameters: { room: '#general' }
mediasoup:Worker getResourceUsage() +9s
mediasoup:Channel request() [method:worker.getResourceUsage, id:11] +8s
mediasoup:Worker getResourceUsage() +0ms
mediasoup:Channel request() [method:worker.getResourceUsage, id:3] +0ms
mediasoup:Worker getResourceUsage() +1ms
mediasoup:Channel request() [method:worker.getResourceUsage, id:3] +1ms
mediasoup:Worker getResourceUsage() +0ms
mediasoup:Channel request() [method:worker.getResourceUsage, id:3] +0ms
INFO [2021-01-04 17:39:12 PM] (ffa2f8fc): Completed query RtpCapabilities
mediasoup:Channel request succeeded [method:worker.getResourceUsage, id:11] +2ms
mediasoup:Channel request succeeded [method:worker.getResourceUsage, id:3] +0ms
mediasoup:Channel request succeeded [method:worker.getResourceUsage, id:3] +0ms
mediasoup:Channel request succeeded [method:worker.getResourceUsage, id:3] +0ms
INFO [2021-01-04 17:39:12 PM] (69d4e6b3): Started mutation ConnectVoice
INFO [2021-01-04 17:39:12 PM] (69d4e6b3): Parameters: { room: '#general' }
mediasoup:Worker getResourceUsage() +16ms
mediasoup:Channel request() [method:worker.getResourceUsage, id:12] +14ms
mediasoup:Worker getResourceUsage() +1ms
mediasoup:Channel request() [method:worker.getResourceUsage, id:4] +1ms
mediasoup:Worker getResourceUsage() +0ms
mediasoup:Channel request() [method:worker.getResourceUsage, id:4] +0ms
mediasoup:Worker getResourceUsage() +0ms
mediasoup:Channel request() [method:worker.getResourceUsage, id:4] +0ms
mediasoup:Router createWebRtcTransport() +9s
mediasoup:Channel request() [method:router.createWebRtcTransport, id:13] +1ms
mediasoup:Channel request succeeded [method:worker.getResourceUsage, id:12] +0ms
mediasoup:Channel request succeeded [method:worker.getResourceUsage, id:4] +0ms
mediasoup:Channel request succeeded [method:worker.getResourceUsage, id:4] +0ms
mediasoup:Channel request succeeded [method:worker.getResourceUsage, id:4] +0ms
mediasoup:Channel request succeeded [method:router.createWebRtcTransport, id:13] +0ms
mediasoup:Transport constructor() +8s
mediasoup:WebRtcTransport constructor() +9s
mediasoup:Transport setMaxIncomingBitrate() [bitrate:1500000] +0ms
mediasoup:Channel request() [method:transport.setMaxIncomingBitrate, id:14] +1ms
mediasoup:Channel request succeeded [method:transport.setMaxIncomingBitrate, id:14] +0ms
mediasoup:Router createWebRtcTransport() +2ms
mediasoup:Channel request() [method:router.createWebRtcTransport, id:15] +0ms
mediasoup:Channel request succeeded [method:router.createWebRtcTransport, id:15] +0ms
mediasoup:Transport constructor() +1ms
mediasoup:WebRtcTransport constructor() +1ms
mediasoup:Transport setMaxIncomingBitrate() [bitrate:1500000] +0ms
mediasoup:Channel request() [method:transport.setMaxIncomingBitrate, id:16] +1ms
mediasoup:Channel request succeeded [method:transport.setMaxIncomingBitrate, id:16] +0ms
INFO [2021-01-04 17:39:12 PM] (69d4e6b3): Completed mutation ConnectVoice
INFO [2021-01-04 17:39:12 PM] (f25adb8c): Started query ActiveProducers
INFO [2021-01-04 17:39:12 PM] (f25adb8c): Parameters: { room: '#general' }
INFO [2021-01-04 17:39:12 PM] (644ebf51): Started mutation Connected
INFO [2021-01-04 17:39:12 PM] (644ebf51): Parameters: {
dtlsParameters: { role: 'server', fingerprints: [ [Object] ] },
room: '#general'
}
mediasoup:WebRtcTransport connect() +89ms
mediasoup:Channel request() [method:transport.connect, id:17] +88ms
mediasoup:Channel request succeeded [method:transport.connect, id:17] +0ms
mediasoup:WebRtcTransport connect() +0ms
mediasoup:Channel request() [method:transport.connect, id:18] +0ms
mediasoup:Channel request succeeded [method:transport.connect, id:18] +1ms
INFO [2021-01-04 17:39:12 PM] (644ebf51): Completed mutation Connected
INFO [2021-01-04 17:39:12 PM] (f25adb8c): Completed query ActiveProducers
mediasoup:Channel [pid:81301] RTC::IceServer::HandleTuple() | transition from state 'new' to 'connected' +11ms
mediasoup:Channel [pid:81301] RTC::WebRtcTransport::OnIceServerSelectedTuple() | ICE selected tuple +0ms
mediasoup:Channel [pid:81301] RTC::WebRtcTransport::OnIceServerConnected() | ICE connected +0ms
mediasoup:Channel [pid:81301] RTC::WebRtcTransport::MayRunDtlsTransport() | running DTLS transport in local role 'client' +0ms
mediasoup:Channel [pid:81301] RTC::WebRtcTransport::OnDtlsTransportConnecting() | DTLS connecting +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::Run() | running [role:client] +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | DTLS handshake start +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'before SSL initialization'] +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write client hello'] +1ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | role: client, waiting:'SSLv3/TLS write client hello'] +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write client hello'] +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS read server hello'] +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS read server certificate'] +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS read server key exchange'] +1ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS read server certificate request'] +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS read server done'] +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write client certificate'] +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write client key exchange'] +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write certificate verify'] +1ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write change cipher spec'] +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write finished'] +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | role: client, waiting:'SSLv3/TLS write finished'] +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write finished'] +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS read change cipher spec'] +1ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS read finished'] +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::OnSslInfo() | DTLS handshake done +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::CheckRemoteFingerprint() | valid remote fingerprint +0ms
mediasoup:Channel [pid:81301] RTC::DtlsTransport::GetNegotiatedSrtpCryptoSuite() | chosen SRTP crypto suite: SRTP_AES128_CM_SHA1_80 +0ms
mediasoup:Channel [pid:81301] RTC::WebRtcTransport::OnDtlsTransportConnected() | DTLS connected +0ms
INFO [2021-01-04 17:39:12 PM] (df10594b): Started mutation Produce
INFO [2021-01-04 17:39:12 PM] (df10594b): Parameters: {
kind: 'video',
rtpParameters: {
codecs: [ [Object] ],
headerExtensions: [
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object]
],
encodings: [ [Object] ],
rtcp: { cname: '+qKimZZOrSIubugO', reducedSize: true },
mid: '0'
},
room: '#general'
}
mediasoup:Transport produce() +143ms
mediasoup:Channel request() [method:transport.produce, id:19] +39ms
mediasoup:Channel request succeeded [method:transport.produce, id:19] +0ms
mediasoup:Producer constructor() +9s
mediasoup:Channel [pid:81301] RTC::IceServer::HandleTuple() | transition from state 'connected' to 'completed' +6ms
mediasoup:Channel [pid:81301] RTC::WebRtcTransport::OnIceServerCompleted() | ICE completed +0ms
INFO [2021-01-04 17:39:12 PM] (09c3b997): Started mutation Consume
INFO [2021-01-04 17:39:12 PM] (09c3b997): Parameters: {
producerId: '0ebed28a-7c5c-4293-b91f-e501639a7eba',
rtpCapabilities: {
__typename: 'Capabilities',
codecs: [
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object]
],
headerExtensions: [
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object]
]
}
}
mediasoup:Transport consume() +9ms
mediasoup:Channel request() [method:transport.consume, id:20] +3ms
mediasoup:Channel request succeeded [method:transport.consume, id:20] +1ms
mediasoup:Consumer constructor() +0ms
INFO [2021-01-04 17:39:12 PM] (09c3b997): Completed mutation Consume
mediasoup:WARN:Channel [pid:81301] RTC::IceServer::ProcessStunPacket() | wrong authentication in STUN Binding Request => 401 +0ms
mediasoup:WARN:Channel [pid:81301] RTC::IceServer::ProcessStunPacket() | wrong authentication in STUN Binding Request => 401 +49ms
INFO [2021-01-04 17:39:13 PM] (df10594b): Completed mutation Produce
That STUN error is then spammed a bunch more times and finally stops. I’m developing locally so here’s the WebRTC options I’m using to create each transport:
"maxIncomingBitrate": 1500000,
"initialAvailableOutgoingBitrate": 1000000,
"listenIps": [
{
"ip": "0.0.0.0",
"announcedIp": "192.168.1.207"
}
]
My chrome://webrtc-internals also seems to be exchanging data, so I think the RTC connection is solid I just can’t seem to get the actual data to come through…
401 isn’t looking good. Any chance sending/receiving transports got mixed? They should be separate both client-side and server-side.
@nazar-pc Thanks so much! It turns out that I had the producer/consumer transport params mixed up. I’m still getting an error, but I think that’s due to me not using HTTPS locally.
mediasoup:Channel [pid:74923] RTC::WebRtcTransport::OnDtlsTransportConnecting() | DTLS connecting +0ms
mediasoup:Channel [pid:74923] RTC::DtlsTransport::Run() | running [role:client] +0ms
mediasoup:Channel [pid:74923] RTC::DtlsTransport::OnSslInfo() | DTLS handshake start +0ms
mediasoup:Channel [pid:74923] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'before SSL initialization'] +0ms
mediasoup:Channel [pid:74923] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write client hello'] +0ms
mediasoup:Channel [pid:74923] RTC::DtlsTransport::OnSslInfo() | role: client, waiting:'SSLv3/TLS write client hello'] +0ms
mediasoup:Channel [pid:74923] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write client hello'] +0ms
mediasoup:Channel [pid:74923] RTC::DtlsTransport::OnSslInfo() | sending DTLS fatal alert: unexpected_message +0ms
mediasoup:Channel [pid:74923] RTC::DtlsTransport::OnSslInfo() | role: client, waiting:'error'] +0ms
mediasoup:ERROR:Channel [pid:74923 RTC::DtlsTransport::CheckStatus() | OpenSSL error [desc:'SSL status: SSL_ERROR_SSL', error:'error:141A10F4:SSL routines:ossl_statem_client_read_transition:unexpected message'] +0ms
mediasoup:WARN:Channel [pid:74923] RTC::DtlsTransport::CheckStatus() | connection failed +0ms
mediasoup:WARN:Channel [pid:74923] RTC::DtlsTransport::Reset() | resetting DTLS transport +1ms
mediasoup:WARN:Channel [pid:74923] RTC::WebRtcTransport::OnDtlsTransportFailed() | DTLS failed +0ms
mediasoup:WARN:Channel [pid:74923] RTC::WebRtcTransport::OnDtlsDataReceived() | Transport is not 'connecting' or 'connected', ignoring received DTLS data +3ms
Again, thanks so much for your help. This project is a perfect solution to the problem we have.
I got past the last error but I’m still having issues with the video actually playing in the element. All my logs look clear, but I still get nothing in the stream.
mediasoup:Router createWebRtcTransport() +12ms
mediasoup:Channel request() [method:router.createWebRtcTransport, id:2636] +0ms
mediasoup:Channel request succeeded [method:router.createWebRtcTransport, id:2636] +0ms
mediasoup:Transport constructor() +3ms
mediasoup:WebRtcTransport constructor() +3ms
mediasoup:Transport setMaxIncomingBitrate() [bitrate:1500000] +0ms
mediasoup:Channel request() [method:transport.setMaxIncomingBitrate, id:2637] +1ms
mediasoup:Channel request succeeded [method:transport.setMaxIncomingBitrate, id:2637] +0ms
INFO [2021-01-11 19:04:16 PM] (8e1ad38f): Completed mutation ConnectVoice
INFO [2021-01-11 19:04:17 PM] (ccb15bb5): Started query ActiveProducers
INFO [2021-01-11 19:04:17 PM] (ccb15bb5): Parameters: { room: '#general' }
INFO [2021-01-11 19:04:17 PM] (dcaea7b5): Started mutation Connected
INFO [2021-01-11 19:04:17 PM] (dcaea7b5): Parameters: {
dtlsParameters: { role: 'server', fingerprints: [ [Object] ] },
room: '#general'
}
mediasoup:WebRtcTransport connect() +227ms
mediasoup:Channel request() [method:transport.connect, id:2638] +226ms
mediasoup:Channel request succeeded [method:transport.connect, id:2638] +1ms
mediasoup:WebRtcTransport connect() +1ms
mediasoup:Channel request() [method:transport.connect, id:2639] +0ms
mediasoup:Channel request succeeded [method:transport.connect, id:2639] +0ms
INFO [2021-01-11 19:04:17 PM] (dcaea7b5): Completed mutation Connected
mediasoup:Channel [pid:70373] RTC::IceServer::HandleTuple() | transition from state 'new' to 'connected' +12ms
mediasoup:Channel [pid:70373] RTC::WebRtcTransport::OnIceServerSelectedTuple() | ICE selected tuple +0ms
mediasoup:Channel [pid:70373] RTC::WebRtcTransport::OnIceServerConnected() | ICE connected +1ms
mediasoup:Channel [pid:70373] RTC::WebRtcTransport::MayRunDtlsTransport() | running DTLS transport in local role 'client' +0ms
mediasoup:Channel [pid:70373] RTC::WebRtcTransport::OnDtlsTransportConnecting() | DTLS connecting +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::Run() | running [role:client] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | DTLS handshake start +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'before SSL initialization'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write client hello'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | role: client, waiting:'SSLv3/TLS write client hello'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write client hello'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS read server hello'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS read server certificate'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS read server key exchange'] +1ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS read server certificate request'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS read server done'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write client certificate'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write client key exchange'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write certificate verify'] +1ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write change cipher spec'] +1ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write finished'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | role: client, waiting:'SSLv3/TLS write finished'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write finished'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS read change cipher spec'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS read finished'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | DTLS handshake done +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::CheckRemoteFingerprint() | valid remote fingerprint +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::GetNegotiatedSrtpCryptoSuite() | chosen SRTP crypto suite: SRTP_AES128_CM_SHA1_80 +0ms
mediasoup:Channel [pid:70373] RTC::WebRtcTransport::OnDtlsTransportConnected() | DTLS connected +0ms
INFO [2021-01-11 19:04:17 PM] (ccb15bb5): Completed query ActiveProducers
mediasoup:Channel [pid:70373] RTC::IceServer::HandleTuple() | transition from state 'connected' to 'completed' +46ms
mediasoup:Channel [pid:70373] RTC::WebRtcTransport::OnIceServerCompleted() | ICE completed +0ms
INFO [2021-01-11 19:04:17 PM] (4f6a439c): Started mutation Produce
INFO [2021-01-11 19:04:17 PM] (4f6a439c): Parameters: {
kind: 'video',
rtpParameters: {
codecs: [ [Object] ],
headerExtensions: [
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object]
],
encodings: [ [Object] ],
rtcp: { cname: 'aieZQheRoF/wlnCH', reducedSize: true },
mid: '0'
},
room: '#general'
}
mediasoup:Transport produce() +457ms
mediasoup:Channel request() [method:transport.produce, id:2640] +167ms
mediasoup:Channel request succeeded [method:transport.produce, id:2640] +1ms
mediasoup:Producer constructor() +5s
INFO [2021-01-11 19:04:17 PM] (e88efb3b): Started mutation Consume
INFO [2021-01-11 19:04:17 PM] (e88efb3b): Parameters: {
producerId: '33b7ecef-92dd-45fc-8de2-9742d2f1815d',
rtpCapabilities: {
__typename: 'Capabilities',
codecs: [
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object]
],
headerExtensions: [
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object]
]
}
}
mediasoup:Transport consume() +35ms
mediasoup:Channel request() [method:transport.consume, id:2641] +34ms
mediasoup:Channel request succeeded [method:transport.consume, id:2641] +0ms
mediasoup:Consumer constructor() +5s
INFO [2021-01-11 19:04:17 PM] (e88efb3b): Completed mutation Consume
mediasoup:Channel [pid:70373] RTC::IceServer::HandleTuple() | transition from state 'new' to 'connected' +14ms
mediasoup:Channel [pid:70373] RTC::WebRtcTransport::OnIceServerSelectedTuple() | ICE selected tuple +0ms
mediasoup:Channel [pid:70373] RTC::WebRtcTransport::OnIceServerConnected() | ICE connected +0ms
mediasoup:Channel [pid:70373] RTC::WebRtcTransport::MayRunDtlsTransport() | running DTLS transport in local role 'client' +0ms
mediasoup:Channel [pid:70373] RTC::WebRtcTransport::OnDtlsTransportConnecting() | DTLS connecting +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::Run() | running [role:client] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | DTLS handshake start +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'before SSL initialization'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write client hello'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | role: client, waiting:'SSLv3/TLS write client hello'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write client hello'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | sending DTLS fatal alert: unexpected_message +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | role: client, waiting:'error'] +0ms
mediasoup:ERROR:Channel [pid:70373 RTC::DtlsTransport::CheckStatus() | OpenSSL error [desc:'SSL status: SSL_ERROR_SSL', error:'error:141A10F4:SSL routines:ossl_statem_client_read_transition:unexpected message'] +5s
mediasoup:WARN:Channel [pid:70373] RTC::DtlsTransport::CheckStatus() | connection failed +5s
mediasoup:WARN:Channel [pid:70373] RTC::DtlsTransport::Reset() | resetting DTLS transport +0ms
mediasoup:WARN:Channel [pid:70373] RTC::WebRtcTransport::OnDtlsTransportFailed() | DTLS failed +0ms
mediasoup:WARN:Channel [pid:70373] RTC::WebRtcTransport::OnDtlsDataReceived() | Transport is not 'connecting' or 'connected', ignoring received DTLS data +0ms
INFO [2021-01-11 19:04:17 PM] (4f6a439c): Completed mutation Produce
mediasoup:Channel [pid:70373] RTC::IceServer::HandleTuple() | transition from state 'connected' to 'completed' +49ms
mediasoup:Channel [pid:70373] RTC::WebRtcTransport::OnIceServerCompleted() | ICE completed +0ms
mediasoup:Channel [pid:70373] RTC::WebRtcTransport::MayRunDtlsTransport() | running DTLS transport in local role 'client' +0ms
mediasoup:Channel [pid:70373] RTC::WebRtcTransport::OnDtlsTransportConnecting() | DTLS connecting +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::Run() | running [role:client] +1ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | DTLS handshake start +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'before SSL initialization'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write client hello'] +0ms
mediasoup:Channel [pid:70373] RTC::DtlsTransport::OnSslInfo() | role: client, waiting:'SSLv3/TLS write client hello'] +0ms
INFO [2021-01-11 19:04:17 PM] (3b1cc8d9): Started mutation Consuming
INFO [2021-01-11 19:04:17 PM] (3b1cc8d9): Parameters: {}
mediasoup:Consumer resume() +159ms
mediasoup:Channel request() [method:consumer.resume, id:2642] +95ms
mediasoup:Channel request succeeded [method:consumer.resume, id:2642] +0ms
INFO [2021-01-11 19:04:17 PM] (3b1cc8d9): Completed mutation Consuming
I’m even getting a MediaStreamTrack back from the transport!
MediaStreamTrack {kind: "video", id: "1580a522-2578-4ce1-981f-1ad1a171e6da", label: "1580a522-2578-4ce1-981f-1ad1a171e6da", enabled: true, muted: false, …}
What am I doing wrong here?
Do you call .play()
on the video element then?
Something like this is sufficient to make it play automatically:
video.onloadedmetadata = () => {
video.play();
};
@nazar-pc I do have that, but I might have been wrong about the errors in the log. Here’s what I’m seeing:
mediasoup:Channel [pid:62683] RTC::DtlsTransport::OnSslInfo() | DTLS handshake start +0ms
mediasoup:Channel [pid:62683] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'before SSL initialization'] +0ms
mediasoup:Channel [pid:62683] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write client hello'] +0ms
mediasoup:Channel [pid:62683] RTC::DtlsTransport::OnSslInfo() | role: client, waiting:'SSLv3/TLS write client hello'] +0ms
mediasoup:Channel [pid:62683] RTC::DtlsTransport::OnSslInfo() | [role:client, action:'SSLv3/TLS write client hello'] +0ms
mediasoup:Channel [pid:62683] RTC::DtlsTransport::OnSslInfo() | sending DTLS fatal alert: unexpected_message +0ms
mediasoup:Channel [pid:62683] RTC::DtlsTransport::OnSslInfo() | role: client, waiting:'error'] +0ms
mediasoup:ERROR:Channel [pid:62683 RTC::DtlsTransport::CheckStatus() | OpenSSL error [desc:'SSL status: SSL_ERROR_SSL', error:'error:141A10F4:SSL routines:ossl_statem_client_read_transition:unexpected message'] +239ms
mediasoup:WARN:Channel [pid:62683] RTC::DtlsTransport::CheckStatus() | connection failed +239ms
mediasoup:WARN:Channel [pid:62683] RTC::DtlsTransport::Reset() | resetting DTLS transport +0ms
mediasoup:WARN:Channel [pid:62683] RTC::WebRtcTransport::OnDtlsTransportFailed() | DTLS failed +0ms
mediasoup:WARN:Channel [pid:62683] RTC::WebRtcTransport::OnDtlsDataReceived() | Transport is not 'connecting' or 'connected', ignoring received DTLS data +0ms
Unexpected message indicates there is still some issue with what is signaled where
@nazar-pc Ah that makes sense. It wasn’t very clear in the documentation how the consumer transport is supposed to work. I’ve been creating a producer and consumer transport when a user connects to the room, then recalling that same consumer transport whenever another user wants to talk with the aforementioned one. I’m not sure if this is the correct approach.
edit: I forgot to mention that I am indeed seeing WebRTC traffic passing through my browser. When I open chrome://webrtc-internals, I can see both inbound and outbound packets on the graph. This indicates to me that something is going somewhere, but I’m not sure where it is.
I guess I’ll try to figure out where I’ve been “crossing the streams”…
Better think of the server and client transports as local and remote parts of one virtual entity. I.e. each transport object on the client side should have a dedicated counterpart on the server side.
@snnz i kinda thought that’s what i was doing. when the FE app gets a message from the BE that a new user has joined, it then creates the recv transport on the client-side using the transport options given to me by the server. Then I call consume()
on that transport.
Here’s my code for what happens when the server gets the word that a user wants to consume another producer’s stream:
consume: async (
_parent: Mutation,
args: MutationConsumeArgs,
{ voice, user, db }: SharedContext
): Promise<Consumer | null> => {
if (!user) throw new AuthenticationError('You must be signed in')
// this was created when the remote user connected
const transport = voice.getConsumer(user.id)
const options: ConsumerOptions = { ...args, paused: true }
try {
const consumer = await transport.consume(options)
voice.registerConsumer(user.id, consumer)
return consumer as Consumer
} catch (error) {
if (!error.message.match(/Producer with id/)) throw error
await db.collection('producers').deleteMany({ id: options.producerId })
return null
}
},
The arguments given:
export type MutationConsumeArgs = {
producerId: Scalars['String'];
rtpCapabilities?: Maybe<Scalars['Parameters']>;
};