Temasys / AdapterJS

AdapterJS Javascript Polyfill and Tools for WebRTC - Skylink WebRTC
http://skylink.io/web
Other
430 stars 100 forks source link

How to get peer connections statistics #62

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hi.

Haven't found any info about getStats usage. Could you help me, how to correctly call getStats method in peer connection?

Thanks.

johache commented 9 years ago

Hi. We are still based on Chrome's implementation of getStats. The prototype is: PC::getStats(successCallback);

For example peerConnection.getStats(function(stats) { var results = stats.result(); ... });

We used to have an example here: https://github.com/Temasys/Google-WebRTC-Samples/tree/master/samples/web/content/munge-sdp-stats I'm not sure it is quite up to date though.

marcinag commented 9 years ago

Hi,

I played a bit with the statistics and it seems to me that I can only see the statistics from the received video track. In my application, I'm running a p2p session between 2 users.

Here is the stat object we get:

{ Timestamp: "1438100065133.217"
bytesReceived: "1565969"
googCaptureStartNtpTimeMs: "3647088844748"
googCurrentDelayMs: "72"
googDecodeMs: "2"
googFirsSent: "0"
googFrameHeightReceived: "480"
googFrameRateDecoded: "0"
googFrameRateOutput: "0"
googFrameRateReceived: "31"
googFrameWidthReceived: "640"
googJitterBufferMs: "50"
googMaxDecodeMs: "12"
googMinPlayoutDelayMs: "0"
googNacksSent: "0"
googPlisSent: "0"
googRenderDelayMs: "10"
googTargetDelayMs: "72"
googTrackId: "e1a561fe-798e-4204-96cb-62c3d0958db2"
packetsLost: "0"
packetsReceived: "1645"
ssrc: "2988131868"
transportId: "Channel-audio-1"
type: "ssrc" }

Thanks for help.