RTCRtpStreamStats

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.

Properties

The RTCRtpStreamStats dictionary is based on RTCStats, and inherits its properties. In addition, some or all of the following properties are available.

Standard fields included for all media types

codecId
A DOMString which uniquely identifies the object which was inspected to produce the RTCCodecStats object associated with this RTP stream.
kind
A DOMString 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.
ssrc
The 32-bit integer which identifies the source of the RTP packets this RTCRtpStreamStats object covers. This value is generated per the RFC 3550 specification.
trackId
A DOMString which uniquely identifies the RTCMediaStreamTrackStats object representing the associated MediaStreamTrack. This is not the same as the value of MediaStreamTrack.id.
transportId
A DOMString uniquely identifying the object which was inspected to produce the RTCTransportStats object associated with this RTP stream.

Obsolete fields

mediaType
Renamed to kind in the specification in February 2018. See Browser compatibility in RTCRtpStreamStats.kind to determine when browsers made the transition.

Local-only measurements

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.

firCount
A count of the total number of Full Intra Request (FIR) packets received by the sender. This statistic is only available to the device which is receiving the stream and is only available for video tracks. A FIR packet is sent by the receiving end of the stream when it falls behind or has lost packets and is unable to continue decoding the stream; the sending end of the stream receives the FIR packet and responds by sending a full frame instead of a delta frame, thereby letting the receiver "catch up." The higher this number is, the more often a problem of this nature arose, which can be a sign of network congestion or an overburdened receiving device.
nackCount
The number of times the receiver notified the sender that one or more RTP packets has been lost by sending a Negative ACKnowledgement (NACK, also called "Generic NACK") packet to the sender. This value is only available to the receiver.
pliCount
The number of times the receiving end of the stream sent a Picture Loss Indiciation (PLI) packet to the sender, indicating that it has lost some amount of encoded video data for one or more frames. Only the receiver has this value, and it's only valid for video tracks.
qpSum
The sum of the Quantization Parameter (QP) values associated with every frame received to date on the video track described by this RTCRtpStreamStats 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
The number of times the receiver notified the sender that one or more consecutive (in scan order) encoded video macroblocks have been lost or corrupted; this notification is sent by the receiver to the sender using a Slice Loss Indication (SLI) packet. This is a fairly technical part of how codecs work and while the higher this value is, the more errors occurred in the stream, generally most of the time this value is only interesting to very intensively hardcore media developers.

Specifications

Specification Status Comment
Identifiers for WebRTC's Statistics API
The definition of 'RTCRtpStreamStats' in that specification.
Candidate Recommendation Initial definition.

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
RTCRtpStreamStatsChrome No support NoEdge No support NoFirefox Full support 63
Full support 63
Full support 27
Alternate Name
Alternate Name Uses the non-standard name: RTCRTPStreamStats
IE No support NoOpera No support NoSafari ? WebView Android No support NoChrome Android No support NoFirefox Android Full support 63
Full support 63
Full support 27
Alternate Name
Alternate Name Uses the non-standard name: RTCRTPStreamStats
Opera Android No support NoSafari iOS ? Samsung Internet Android No support No
codecIdChrome No support NoEdge No support NoFirefox Full support 27IE No support NoOpera No support NoSafari ? WebView Android No support NoChrome Android No support NoFirefox Android Full support 27Opera Android No support NoSafari iOS ? Samsung Internet Android No support No
firCountChrome No support NoEdge No support NoFirefox Full support 55IE No support NoOpera No support NoSafari ? WebView Android No support NoChrome Android No support NoFirefox Android Full support 55Opera Android No support NoSafari iOS ? Samsung Internet Android No support No
isRemote
Deprecated
Chrome No support NoEdge No support NoFirefox Full support 27
Notes
Full support 27
Notes
Notes In Firefox 28, a default value of false was added for isRemote, to match a specification update.
IE No support NoOpera No support NoSafari ? WebView Android No support NoChrome Android No support NoFirefox Android Full support 27
Notes
Full support 27
Notes
Notes In Firefox 28, a default value of false was added for isRemote, to match a specification update.
Opera Android No support NoSafari iOS ? Samsung Internet Android No support No
kindChrome No support NoEdge No support NoFirefox Full support 63IE No support NoOpera No support NoSafari ? WebView Android No support NoChrome Android No support NoFirefox Android Full support 63Opera Android No support NoSafari iOS ? Samsung Internet Android No support No
mediaTrackId
Deprecated
Chrome No support NoEdge No support NoFirefox Full support 27IE No support NoOpera No support NoSafari ? WebView Android No support NoChrome Android No support NoFirefox Android Full support 27Opera Android No support NoSafari iOS ? Samsung Internet Android No support No
mediaType
Deprecated
Chrome No support NoEdge No support NoFirefox Full support 34IE No support NoOpera No support NoSafari ? WebView Android No support NoChrome Android No support NoFirefox Android Full support 34Opera Android No support NoSafari iOS ? Samsung Internet Android No support No
nackCountChrome No support NoEdge No support NoFirefox Full support 55IE No support NoOpera No support NoSafari ? WebView Android No support NoChrome Android No support NoFirefox Android Full support 55Opera Android No support NoSafari iOS ? Samsung Internet Android No support No
pliCountChrome No support NoEdge No support NoFirefox Full support 55IE No support NoOpera No support NoSafari ? WebView Android No support NoChrome Android No support NoFirefox Android Full support 55Opera Android No support NoSafari iOS ? Samsung Internet Android No support No
qpSumChrome No support NoEdge No support NoFirefox Full support 66IE No support NoOpera No support NoSafari ? WebView Android No support NoChrome Android No support NoFirefox Android Full support 66Opera Android No support NoSafari iOS ? Samsung Internet Android No support No
remoteId
Deprecated
Chrome No support NoEdge No support NoFirefox Full support 27IE No support NoOpera No support NoSafari ? WebView Android No support NoChrome Android No support NoFirefox Android Full support 27Opera Android No support NoSafari iOS ? Samsung Internet Android No support No
sliCountChrome No support NoEdge No support NoFirefox No support NoIE No support NoOpera No support NoSafari ? WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS ? Samsung Internet Android No support No
ssrcChrome No support NoEdge No support NoFirefox Full support 27IE No support NoOpera No support NoSafari ? WebView Android No support NoChrome Android No support NoFirefox Android Full support 27Opera Android No support NoSafari iOS ? Samsung Internet Android No support No
transportIdChrome No support NoEdge No support NoFirefox Full support 27IE No support NoOpera No support NoSafari ? WebView Android No support NoChrome Android No support NoFirefox Android Full support 27Opera Android No support NoSafari iOS ? Samsung Internet Android No support No

Legend

Full support
Full support
No support
No support
Compatibility unknown
Compatibility unknown
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.
See implementation notes.
See implementation notes.
Uses a non-standard name.
Uses a non-standard name.