Home/News | About | Download | Documentation | Forum | Bug Reports | Contact | Donations | Consulting | Projects | Legal | Security | FATE

This forum has not been maintained for a long time and will probably get deleted in the near future.
For faster responses to your questions, please use StackOverflow instead and tag your questions with "FFmpeg".
If you need a backup of the posts from this forum, please contact me directly.

Detecting dropped RTP packets

Discussions about problems encountered using ffprobe.
Forum rules
FFmpeg is in a state of perpetual development and we do not currently have the person power to backport fixes to official releases. As such, if you wish to query or report a bug, you must try with the latest development branch revision of FFmpeg to confirm the issue still exists. The latest FFmpeg can be downloaded from here: http://www.ffmpeg.org/download.html

Detecting dropped RTP packets

Postby dbrb2 » Sun Feb 07, 2016 8:38 pm

I have some live streams that are occasionally subject to dodgy comms - which leads to dropped packets. This is obvious to the human eye, as it results in all kinds of image breakup, but I am having difficulty detecting it automatically...

I am trying to find a way to join any given stream and, on the basis of a few seconds capture, give an indication of the amount of packet loss

Using ffprobe I can run a capture, and it will show me an output similar to:

Code: Select all
[NULL @ 0x24400c0] RTP: missed 3 packets
[sdp @ 0x2439400] max delay reached. need to consume packet
[NULL @ 0x24400c0] RTP: missed 2 packets
[sdp @ 0x2439400] max delay reached. need to consume packet
[NULL @ 0x24400c0] RTP: missed 2 packets

Which is confirmed if I have tshark running at the same time (missing RTP sequence numbers)

I could grep the above to get the total number of drops for a given capture period

Code: Select all
<ffmpeg command> | grep -o 'missed [0-9]*' | sed 's/missed//g'";

But that is of limited use without knowing the total number of RTP packets in the first place (from which I could calculate percentage loss)

If this is not possible, I could still use the total number od dropped RTP packets as an indicator of possible problems...but these absolute values would only be comparable if every call to

Code: Select all
ffprobe <video>

ran for the same number of input packets (or time) - and I can't find out for sure what decides how long this probe runs for...

By using various ffprobe parameters - such as -show_packets - I can find out detailed information about the packets that /are/ successfully received, but it can not (that I have found) give me either a total for dropped packets, nor a total of all packets received

For example I have tried:

ffprobe -show_streams -count packets <source>

But (presumably) since the stream has no end all this gives me is a continuous output with no summary....without -count_packets the summary appears, but with no packet count...

Any suggestions for how I might achieve what I am trying to do?
Posts: 29
Joined: Fri Dec 14, 2012 11:50 am

Return to ffprobe

Who is online

Users browsing this forum: No registered users and 1 guest