[FFmpeg-devel] Request : Management of duplicated RTP packets in rtpdec.c

Sylvain Fabre sylvain at lahiette.com
Thu Jun 9 15:24:58 CEST 2016

Hi all,

We are decoding a RTSP/RTP video caming from a camera behind a RF link + switch,. Somwehere in the network path, some RTP packets are "duplicated", probably by the RF link.

In terms of ffmpeg result, we get a lot of corrupted frames, and the following message each time a frame is corrupted : 
[h264 @ 0x7f95ac007d60] RTP: missed 1 packets - seq : 60937 60935

Note that the av_log call has beend modified to show the sequences numbers involved : 
av_log(s->st ? s->st->codec : NULL, AV_LOG_WARNING,
               "RTP: missed %d packets - seq : %d %d \n", s->queue->seq - s->seq - 1,  s->queue->seq, s->seq );

The "RTP: missed" warning is followed by decoding errors : 
[h264 @ 0x7fe8ac007d60] top block unavailable for requested intra mode at 21 0 
[h264 @ 0x7fe8ac007d60] error while decoding MB 21 0 
[h264 @ 0x7fe8ac007d60] concealing 1280 DC, 1280 AC, 1280 MV errors in I frame 
[h264 @ 0x7f95ac007d60] out of range intra chroma pred mode at 38 18 
[h264 @ 0x7f95ac007d60] error while decoding MB 38 18 
[h264 @ 0x7f95ac007d60] concealing 571 DC, 571 AC, 571 MV errors in I frame 

So, as a preliminary debug step, we added a small buffer of last seen RTP sequences numbers in the RTPStatistics structure, and we test the current seq number with the content of this buffer, just after the "RTP: missed ..." log. Each time a "RTP: missed..." occured, the sequence number has already been received.

But the code dealing with the RTP sequence and ordering queue in rtpdec.c is not completly clear for us and we would like to have some help regarding the management of this duplicated packet case. Any help or hints are welcome ! Note that  we can test ideas directly on site, we have such errors each minute.

Thanks for your support, 


More information about the ffmpeg-devel mailing list