So im having a room conference app, backend using express socket.io and mediasoup - frontend using vuejs/nuxtjs
im getting this log when producing
2024-05-06T14:32:21.261Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | DTLS handshake start
2024-05-06T14:32:21.264Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'before SSL initialization']
2024-05-06T14:32:21.265Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | role: server, waiting:'before SSL initialization']
2024-05-06T14:32:21.313Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'before SSL initialization']
2024-05-06T14:32:21.314Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS read client hello']
2024-05-06T14:32:21.315Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS write server hello']
2024-05-06T14:32:21.315Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS write certificate']
2024-05-06T14:32:21.315Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS write key exchange']
2024-05-06T14:32:21.315Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS write certificate request']
2024-05-06T14:32:21.315Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS write server done']
2024-05-06T14:32:21.316Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | role: server, waiting:'SSLv3/TLS write server done']
2024-05-06T14:32:21.367Z mediasoup:Transport produce()
2024-05-06T14:32:21.383Z mediasoup:Channel request() [method:TRANSPORT_PRODUCE]
2024-05-06T14:32:21.385Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS write server done']
2024-05-06T14:32:21.386Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS read client certificate']
2024-05-06T14:32:21.387Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS read client key exchange']
2024-05-06T14:32:21.387Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS read certificate verify']
2024-05-06T14:32:21.388Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS read change cipher spec']
2024-05-06T14:32:21.389Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS read finished']
2024-05-06T14:32:21.389Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS write change cipher spec']
2024-05-06T14:32:21.390Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS write finished']
2024-05-06T14:32:21.390Z mediasoup:Channel [pid:1865127] RTC::DtlsTransport::OnSslInfo() | DTLS handshake done
2024-05-06T14:32:21.391Z mediasoup:Channel [pid:1865127] RTC::IceServer::HandleTuple() | transition from state 'connected' to 'completed' [hasUseCandidate:true, hasNomination:false, nomination:0]
2024-05-06T14:32:21.392Z mediasoup:Channel [pid:1865127] RTC::WebRtcTransport::OnIceServerCompleted() | ICE completed
2024-05-06T14:32:21.392Z mediasoup:Channel request succeeded [method:TRANSPORT_PRODUCE, id:4]
2024-05-06T14:32:21.393Z mediasoup:Channel [pid:1865127] RTC::Transport::HandleRequest() | enabling TransportCongestionControlServer with transport-cc
2024-05-06T14:32:21.395Z mediasoup:Producer constructor()
e[0;36mMongoose:e[0m rooms.findOne({ _id: ObjectId("6630f88a91de63832788a033") }, {})
2024-05-06T14:32:21.653Z mediasoup:Channel [pid:1865127] RTC::WebRtcTransport::OnRtpDataReceived() | ignoring RTP packet while DTLS not connected
then it just goes and ignore the RTP packet.
i create worker, room and webRtcServer for each room.
async function createRouterAndWorker(size: number): Promise<{
worker: types.Worker<types.AppData>;
router: types.Router<types.AppData>;
webRtcServer: types.WebRtcServer<types.AppData>;
}> {
const worker = await createWorker({
logLevel: 'debug',
logTags:
[
'info',
'ice',
'dtls',
'rtp',
'srtp',
'rtcp',
'rtx',
'bwe',
'score',
'simulcast',
'svc',
'sctp',
'message'
]
});
setInterval(async () => {
const usage = await worker.getResourceUsage();
console.log('mediasoup Worker resource usage [pid:%d]: %o', worker.pid, usage);
const dump = await worker.dump();
console.log('mediasoup Worker dump [pid:%d]: %o', worker.pid, dump);
}, 120000);
const router = await worker.createRouter({
mediaCodecs: [
{
kind: 'audio',
mimeType: 'audio/opus',
clockRate: 48000,
channels: 2,
},
{
kind: 'video',
mimeType: 'video/VP8',
clockRate: 90000,
parameters: {
'x-google-start-bitrate': 1000,
},
},
{
kind: 'video',
mimeType: 'video/VP9',
clockRate: 90000,
parameters: {
'profile-id': 2,
'x-google-start-bitrate': 1000
}
},
{
kind: 'video',
mimeType: 'video/h264',
clockRate: 90000,
parameters: {
'packetization-mode': 1,
'profile-level-id': '4d0032',
'level-asymmetry-allowed': 1,
'x-google-start-bitrate': 1000
}
},
{
kind: 'video',
mimeType: 'video/h264',
clockRate: 90000,
parameters: {
'packetization-mode': 1,
'profile-level-id': '42e01f',
'level-asymmetry-allowed': 1,
'x-google-start-bitrate': 1000
}
}
],
});
const webRtcServer = await worker.createWebRtcServer({
listenInfos:
[
{
protocol: 'udp',
ip: '0.0.0.0',
announcedAddress: process.env.EXTERNAL_IP,
port: 40000 + size
},
{
protocol: 'tcp',
ip: '0.0.0.0',
announcedAddress: process.env.EXTERNAL_IP,
port: 40000 + size
}
]
})
return { worker, router, webRtcServer }
}