Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between inbound-rtp & remote-inbound-rtp in the results we get from webrtc getstats?

I have been trying to figure out a way to calculate the following: Bandwidth, Latency, Current Upload, and Download speed. And have been confused with the values I am getting for the INBOUND-RTP, OUTBOUND-RTP, & REMOTE-INBOUND-RTP.

In my head, I was thinking about inbound-rtp as a collection of stats for all incoming data. which apparently is wrong, since different stats for that type always stays Zero

The current setup uses chrome as a 2 connecting Clients, and a Media Server, with client instances running on "localhost"

enter image description here

like image 902
Harshwardhan Avatar asked Dec 02 '22 09:12

Harshwardhan


2 Answers

The terminology used on MDN is a bit terse, so here's a rephrasing that I hope is helpful to solve your problem! Block quotes taken from MDN & clarified below. For an even terser description, also see the W3C definitions.

outbound-rtp

An RTCOutboundRtpStreamStats object giving statistics about an outbound RTP stream being sent from the RTCPeerConnection.

This stats report is based on your outgoing data stream to your peers. This is the measurement taken from the perspective of just that oubound RTP stream, which is why information that involves your peers (round trip time, jitter, etc.) is missing, because those can only be measured with an understanding of the peer's processing of your stream.

inbound-rtp

Statistics about an inbound RTP stream that's currently in use by this RTCPeerConnection, in an RTCInboundRtpStreamStats object.

By contrast to the Outbound RTP statistics, this stats report contains data about the inbound data stream you are receiving from your peer(s). Notice that if you do not have any connected peers your call to getStats does not include this report type at all.

remote-inbound-rtp

Contains statistics about the remote endpoint's inbound RTP stream; that stream corresponds to the local endpoint's outbound RTP stream. Using this RTCRemoteInboundRtpStreamStats object, you can learn how the well the remote peer is receiving data.

This stats report provides details about your outbound rtp stream from the perspective of the remote connection. That is to say that this stats report provides an analysis about your outbound-rtp stream from the perspective of the remote server that is handling your stream on the other side.

like image 101
Ben Avatar answered Dec 20 '22 22:12

Ben


I'm on the MDN writing team at Mozilla and happened upon this just now. I've taken some of the information from this conversation and applied it back to the article about RTCStatsType. There's more to improve there still, but I wanted to thank you for that insight!

Always feel free to sign up for an MDN account and update any content you see that's inaccurate or incomplete! Or you can file an issue and we'll see what we can do.

like image 44
Eric Shepherd Avatar answered Dec 20 '22 23:12

Eric Shepherd