How do I verify packets-lost in rtpbin
Hi!
I want to write an application to analyze the performance of a pipeline streaming live video over RTP, I want to find out how many packets gets lost, among other things. I have attached the source code to this issue. The output from this application is:
$ ./target/release/rtp-analyzer
[2861218137] [10.0.3.34:34813] bitrate: 1263 kb/s, packets: 529, lost: 29 (5.48%), total: 572 kB
[2230382417] [10.0.3.34:50983] bitrate: 44 kb/s, packets: 234, lost: 0 (0.00%), total: 27 kB
[2861218137] [10.0.3.34:34813] bitrate: 1023 kb/s, packets: 1053, lost: 65 (6.17%), total: 1138 kB
[2230382417] [10.0.3.34:50983] bitrate: 43 kb/s, packets: 470, lost: 0 (0.00%), total: 54 kB
[2861218137] [10.0.3.34:34813] bitrate: 1044 kb/s, packets: 1610, lost: 67 (4.16%), total: 1750 kB
[2230382417] [10.0.3.34:50983] bitrate: 43 kb/s, packets: 704, lost: 0 (0.00%), total: 82 kB
[2861218137] [10.0.3.34:34813] bitrate: 949 kb/s, packets: 2169, lost: 67 (3.09%), total: 2364 kB
[2230382417] [10.0.3.34:50983] bitrate: 43 kb/s, packets: 938, lost: 0 (0.00%), total: 109 kB
[2861218137] [10.0.3.34:34813] bitrate: 1061 kb/s, packets: 2727, lost: 67 (2.46%), total: 2977 kB
[2230382417] [10.0.3.34:50983] bitrate: 43 kb/s, packets: 1173, lost: 0 (0.00%), total: 136 kB
[2861218137] [10.0.3.34:34813] bitrate: 946 kb/s, packets: 3265, lost: 88 (2.70%), total: 3563 kB
[2230382417] [10.0.3.34:50983] bitrate: 43 kb/s, packets: 1408, lost: 0 (0.00%), total: 164 kB
[2861218137] [10.0.3.34:34813] bitrate: 1032 kb/s, packets: 3801, lost: 109 (2.87%), total: 4146 kB
[2230382417] [10.0.3.34:50983] bitrate: 43 kb/s, packets: 1643, lost: 0 (0.00%), total: 191 kB
[2861218137] [10.0.3.34:34813] bitrate: 940 kb/s, packets: 4356, lost: 109 (2.50%), total: 4757 kB
[2230382417] [10.0.3.34:50983] bitrate: 43 kb/s, packets: 1877, lost: 0 (0.00%), total: 218 kB
[2861218137] [10.0.3.34:34813] bitrate: 1057 kb/s, packets: 4911, lost: 109 (2.22%), total: 5368 kB
And I often end up with a packet loss of around ~1%. Which for running on my local network seems very high. When I perform RTP stream analysis with Wireshark it reports 0% packet loss. And the same when I use ffmpeg with a SDP file:
ffmpeg -protocol_whitelist "file,rtp,udp" -i low-latency-test.sdp -y -vcodec copy -acodec copy test.flv
No, or almost no RTP packets reported missing. And using vlc with the same sdp file I get no frames loss in the statistics. Am I doing something fishy, or could it be something fishy with how rtpbin/rtpsource calculates packet loss?
Thank you!