计算丢包、抖动和延迟
我正在将 rtsp 视频流式传输到 Android。
如何计算丢包、抖动或延迟等网络指标?
I am streaming an rtsp video to Android.
How could I calculate network metrics like packet loss, jitter or delay?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我可以回答丢包和抖动问题。
对于丢包:仅计算丢失的序列。保留最后一个数据包的序列,看看是否有超过 1 的步数。
如果网络中进行了重新排序,则需要将先前的序列保留在内存窗口中,并在数据包到达时将其填充,然后检查丢失的序列。
对于抖动 - 只需保留客户端接收数据包的时间,并计算数据包的实际接收时间和预期接收时间之间的平均差(假设您可以预测数据包的预期接收时间 - 例如,如果您有一个常数FPS)。
I can answer that for packet loss and jitter.
For packet loss: Just count missed sequences. Keep the sequence of the last packet, and see if you have steps of more than 1.
If you have reordering in your network, you will need to keep in a memory window previous sequences and fill it up as packets arrive, then check missed sequences.
For jitter - just keep the times where your client receives packets, and calculate the average difference between the actual received time and the expected received time of packets (assuming you can predict the expected receive time of packets - for example, if you have a constant FPS).
Wireshark 对嗅探到的数据包进行 RTP 统计计算。
Wireshark has RTP statistics calculation for sniffed packets.