sipsorcery
sipsorcery copied to clipboard
Not receiving RTP events or reports
I am streaming from my server to the browser using webrtc and FFMPEG. I am trying to figure out if I am getting packet loss indicators from the browser and then trigger a keyframe from my encoding function.
Problem is that I am not getting any callbacks triggered on (peerConnection.OnReceiveReport, peerConnection.OnRtpEvent, peerConnection.OnRtpPacketReceived). I even tried the examples and it doesn't seem to get triggered there either.
This was fairly easy to do in rust, with the same frontend codebase, so I am certain there must be something here that I can do as well. Has this functionality been disabled?
The RTCP support in this library is incomplete. SIP doesn't use RTCP much whereas WebRTC goes crazy with it.
The RTCP report types supported are here.
// Only call OnReceiveRTCPPacket for supported RTCPCompoundPacket types
if (buffer[1] == (byte)RTCPReportTypesEnum.SR ||
buffer[1] == (byte)RTCPReportTypesEnum.RR ||
buffer[1] == (byte)RTCPReportTypesEnum.SDES ||
buffer[1] == (byte)RTCPReportTypesEnum.BYE ||
buffer[1] == (byte)RTCPReportTypesEnum.PSFB ||
buffer[1] == (byte)RTCPReportTypesEnum.RTPFB)
{
OnReceiveRTCPPacket(localPort, remoteEndPoint, buffer);
}
If the RTCP control packet you're looking for is not one of those then you should still get a warning log message.
RTP events are typically DTMF tones. They're hardly ever used in WebRTC given data channels are a much better way to transmit any kind fo data.