[Live-devel] RTP timeout because of RTCP dummy packets
Andrej Nichelmann
andrej.nichelmann at mobotix.com
Tue Sep 26 07:04:03 PDT 2017
Hi Ross,
I have an Axis ONVIF camera here (pretty new model: P5635-E Mk II) which gives me a RTP session timeout with the current live555 version if I try to stream over RTP/UDP. After some Wireshark debugging, I have found out that the problem is located in this code (RTSPClient.cpp):
// Hack: To increase the likelihood of UDP packets from the server reaching us,
// if we're behind a NAT, send a few 'dummy' UDP packets to the server now.
// (We do this on both our RTP port and our RTCP port.)
Groupsock* gs1 = NULL; Groupsock* gs2 = NULL;
if (subsession.rtpSource() != NULL) gs1 = subsession.rtpSource()->RTPgs();
if (subsession.rtcpInstance() != NULL) gs2 = subsession.rtcpInstance()->RTCPgs();
u_int32_t const dummy = 0xFEEDFACE;
for (unsigned i = 0; i < numDummyPackets; ++i) {
if (gs1 != NULL) gs1->output(envir(), (unsigned char*)&dummy, sizeof dummy);
if (gs2 != NULL) gs2->output(envir(), (unsigned char*)&dummy, sizeof dummy);
}
If I comment out the sending of dummy UDP packets over the RTCP port, everything works fine (in fact, in a very old live555 version the dummy packets were send over the RTP port only). So would you say, that this a problem of the RTSP server on the camera or is this hack in the live555 outdated and needs to be replaced with a better solution? Do I have to expect other problems other than the one described in your comment if I comment out the sending of the dummy packets over RTCP?
Best regards,
Andrej Nichelmann
More information about the live-devel
mailing list