Mattia
Mattia

Reputation: 219

How to calculate latency (or delay) from statistics?

I would to calculate latency time of a running audio/video call.

According to these parameters of RTCStatsReport object, how can I retrieve the delay time?

latency = packetsize / delay + bandwidth 

Upvotes: 4

Views: 4374

Answers (1)

tomtheengineer
tomtheengineer

Reputation: 4277

I think what you want is the RTT (round-trip time), which is available as "googRtt" in Chrome. You can see it if you go to chrome://webrtc-internals or you can get it programmatically via the stats interface: https://webrtc.github.io/samples/src/content/peerconnection/constraints/ (click the capture and connect button and then scroll down to the statistics).

Note that two of the reports should have googRtt in them: one is for audio and the other for video.

Upvotes: 5

Related Questions