I have no much time this days, but i was starting to do block by block of code.
And i realize i miss in my call a call il the receiveTransport.on connect event to send dtlsParameters to the connect event back end.
Like he do in his code line 213: mediasoup/index.js at main · jamalag/mediasoup · GitHub
And in the back end line: 165: mediasoup/app.js at main · jamalag/mediasoup · GitHub
i tough i had something but nothing work
There is no way to debug and know where the problem come from ?
can the problem come from the fact i don’t use
dtlsCertificateFile
for my worker and server ?
I have added debug mod for mediasoup.
When i create my producer and then create and consume as a consumer i have this log:
mediasoup:Channel [pid:66] RTC::WebRtcTransport::OnRtcpDataReceived() | ignoring RTCP packet while DTLS not connecte
This person has this kind of issue as well.
It is mentioned in the above topic that certificate is not required leave it empty.
Brother, you are not supposed to get into these troubles, the mediasoup api is smooth to work with. Not sure, what kind of issue you are facing.
I can take a look at your code if you are willing, just make a minimal demo, remove everything specific to your project, and send it.
I have made debugging, like when i click on a button the server tell me if producer is sending media or not, he’s not sending any media.
I try to figure out where the problem come from.
I debugged this in back end to know if producer is producing media:
if (producer.paused === false) {
console.log('Producer is currently producing media');
} else {
console.log('Producer is currently not producing media');
}
I reach the first console.log.
But producer is not sending any media.
Being paused and not sending media can be both separate things. When we do pause we intentionally stop media but there can be scenarios where producer is not paused but still media is not flowing due to bad setup. You need to check with consumer as well.
Brother discussing like this will not lead us to the destination. I hope you understand.
I try to debug and resolve my issue
How would you debug this and make this work then ?
i don’t know if this code make sense for debugging:
const encodingParameters = (producer as any).encodingParameters;
// Check that the encodingParameters object is not empty or null
if (encodingParameters) {
console.log('Producer encoding parameters are set up correctly');
// Verify encoding parameters as needed
} else {
console.log('Producer encoding parameters are not set up correctly');
}
For what i have in my debbuging:
When i do this transport is connected:
transport.on('dtlsstatechange', dtlsState => {
console.log('dtlsstatechange ');
console.log(dtlsState); // Return connected
if (dtlsState === 'closed') {
console.log('dtlsstatechange transport closed');
transport.close();
}
})
-Producer is sending media when i do t his:
const stats = await this.transports.get(transportConnect.transport.transportOptions.id).getStats();
const inboundRtpStats = stats.filter((s) => s.type === "inbound-rtp");
if (inboundRtpStats.length > 0) {
console.log("Producer is sending media");
} else {
console.log("Producer is not sending any media");
}
But when i do :
const encodingParameters = (producer as any).encodingParameters;
// Check that the encodingParameters object is not empty or null
if (encodingParameters) {
console.log('Producer encoding parameters are set up correctly');
// Verify encoding parameters as needed
} else {
console.log('Producer encoding parameters are not set up correctly');
}
encoding parameters are not set up correctly.
And when i do this:
const stats = await this.transports.get(transportConnect.transport.transportOptions.id).getStats();
const isTransportActive = stats.some(stat => stat.type === 'transport' && stat.state === 'connected');
if (isTransportActive) {
console.log('Transport is active');
} else {
console.log('Transport is not active');
}
My transport is not active here, but dtlsstatechange said i am connected.
For more information, when i restart my back end server, in the front end, the “connectionstatechange” switch from connected to failed, so it keep track of the connection.
And i have for my producer:
ICE state changed to completed
When i listen event:
transport.on("icestatechange", (iceState) => {
console.log(`ICE state changed to ${iceState}`);
});
So that mean my producer is fully well configured normally…
And in my debugging (native debug mod of mediasoup), when i try to stream with my producer i have this every X seconds or minutes:
mediasoup:Channel [pid:137] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:3069649007, seq:57682]
It means it should work ?
But, if yes, why in my previous code it reach console.log where Transport is not active and it reach producer is not sending media?
Here is a screenshot of my terminal:
I have my skills, send it over, I will give it a try.
Stop copying and pasting code and learn how to write it yourself. You’ll learn more and ask less. Also a week of investment? We’ve spent years many of us, get a fucking life… You’re disposable.
(Binary is always beautiful, your first lesson JNZ)

