[英]Is there a way to get the throughput or latency of a WebRTC stream from a RTCPeerConnection?
I want to calculate either the latency or throughput of a receiving stream for WebRTC. 我想计算WebRTC接收流的延迟或吞吐量。 I know there is the getStats()
but I can't seem to find an easy way of doing it. 我知道有getStats()
但是我似乎找不到简单的方法。 Any ideas? 有任何想法吗?
https://webrtc.github.io/samples/src/content/peerconnection/bandwidth/ gives an example of how to use the getStats API to measure the bitrate of a video stream. https://webrtc.github.io/samples/src/content/peerconnection/bandwidth/提供了有关如何使用getStats API来测量视频流比特率的示例。 The general pattern is to call getStats twice in a time interval and divide the difference in the counts by the time difference. 通常的模式是在一个时间间隔内两次调用getStats,然后将计数差除以时间差。
https://webrtc.github.io/samples/src/content/peerconnection/constraints/ shows a more complete list of what statistics are available. https://webrtc.github.io/samples/src/content/peerconnection/constraints/显示了可用统计信息的更完整列表。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.