The RTCRtpStreamStats dictionary is returned by the RTCPeerConnection.getStats(), RTCRtpSender.getStats(), and RTCRtpReceiver.getStats() methods to provide detailed statistics about WebRTC connectivity. While the dictionary has a base set of properties that are present in each of these cases, there are also additional properties added depending on which interface the method is called on.
RTCRtpStreamStats is the base class for all RTP-related statistics reports. It's based on RTCStats and adds the following additional fields.
Note: This interface was called RTCRTPStreamStats until a specification update in the spring of 2017. Check the Browser compatibility table to know if and when the name change was implemented in specific browsers.
The RTCRtpStreamStats dictionary is based on RTCStats, and inherits its properties. In addition, some or all of the following properties are available.
codecIdDOMString which uniquely identifies the object which was inspected to produce the RTCCodecStats object associated with this RTP stream.kindDOMString whose value is "audio" if the associated MediaStreamTrack is audio-only or "video" if the track contains video. This value will match that of the media type indicated by RTCCodecStats.codec, as well as the track's kind property. Previously called mediaType.ssrcRTCRtpStreamStats object covers. This value is generated per the RFC 3550 specification.trackIdDOMString which uniquely identifies the RTCMediaStreamTrackStats object representing the associated MediaStreamTrack. This is not the same as the value of MediaStreamTrack.id.transportIdDOMString uniquely identifying the object which was inspected to produce the RTCTransportStats object associated with this RTP stream.mediaTypekind in the specification in February 2018. See Browser compatibility in RTCRtpStreamStats.kind to determine when browsers made the transition.These properties are computed locally, and are only available to the device receiving the media stream. Their primary purpose is to examine the error resiliency of the connection, as they provide information about lost packets, lost frames, and how heavily compressed the data is.
firCountnackCountpliCountqpSumRTCRtpStreamStats object. In general, the higher this number is, the more heavily compressed the video track was. Combined with RTCReceivedRtpStreamStats.framesDecoded or RTCSentRtpStreamStats.framesEncoded, you can approximate the average QP over those frames, keeping in mind that codecs often vary the quantizer values even within frames. Also keep in mind that the values of QP can vary from codec to codec, so this value is only potentially useful when compared against the same codec.sliCount| Specification | Status | Comment |
|---|---|---|
| Identifiers for WebRTC's Statistics API The definition of 'RTCRtpStreamStats' in that specification. | Candidate Recommendation | Initial definition. |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | No | ? | 63
|
No | No | ? |
codecId |
No | ? | 27 | No | No | ? |
firCount |
No | ? | 55 | No | No | ? |
isRemote
|
No | ? | 27
|
No | No | ? |
kind |
No | ? | 63 | No | No | ? |
mediaTrackId
|
No | ? | 27 | No | No | ? |
mediaType
|
No | ? | 34 | No | No | ? |
nackCount |
No | ? | 55 | No | No | ? |
pliCount |
No | ? | 55 | No | No | ? |
qpSum |
No | ? | No | No | No | ? |
remoteId
|
No | ? | 27 | No | No | ? |
sliCount |
No | ? | No | No | No | ? |
ssrc |
No | ? | 27 | No | No | ? |
transportId |
No | ? | 27 | No | No | ? |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | No | No | ? | 63
|
No | ? | ? |
codecId |
No | No | ? | 27 | No | ? | ? |
firCount |
No | No | ? | 55 | No | ? | ? |
isRemote
|
No | No | ? | 27
|
No | ? | ? |
kind |
No | No | ? | 63 | No | ? | ? |
mediaTrackId
|
No | No | ? | 27 | No | ? | ? |
mediaType
|
No | No | ? | 34 | No | ? | ? |
nackCount |
No | No | ? | 55 | No | ? | ? |
pliCount |
No | No | ? | 55 | No | ? | ? |
qpSum |
No | No | ? | No | No | ? | ? |
remoteId
|
No | No | ? | 27 | No | ? | ? |
sliCount |
No | No | ? | No | No | ? | ? |
ssrc |
No | No | ? | 27 | No | ? | ? |
transportId |
No | No | ? | 27 | No | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpStreamStats