RTCInboundRtpStreamStats
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
The RTCInboundRtpStreamStats
dictionary of the WebRTC API is used to report statistics related to the receiving end of an RTP stream on the local end of the RTCPeerConnection
.
The statistics can be obtained by iterating the RTCStatsReport
returned by RTCPeerConnection.getStats()
or RTCRtpReceiver.getStats()
until you find a report with the type
of inbound-rtp
.
Instance properties
averageRtcpInterval
-
A floating-point value indicating the average RTCP interval between two consecutive compound RTCP packets.
bytesReceived
-
A 64-bit integer which indicates the total number of bytes that have been received so far for this media source.
fecPacketsDiscarded
-
An integer value indicating the number of RTP Forward Error Correction (FEC) packets which have been received for this source, for which the error correction payload was discarded.
fecPacketsReceived
-
An integer value indicating the total number of RTP FEC packets received for this source. This counter may also be incremented when FEC packets arrive in-band along with media content; this can happen with Opus, for example.
framesDecoded
-
A long integer value indicating the total number of frames of video which have been correctly decoded so far for this media source. This is the number of frames that would have been rendered if none were dropped. Only valid for video streams.
lastPacketReceivedTimestamp
-
A
DOMHighResTimeStamp
indicating the time at which the last packet was received for this source. Thetimestamp
property, on the other hand, indicates the time at which the statistics object was generated. nackCount
-
An integer value indicating the total number of Negative ACKnowledgement (NACK) packets this receiver has sent.
packetsDuplicated
-
An integer value indicating the total number of packets that have been discarded because they were duplicates. These packets are not counted by
packetsDiscarded
. packetsFailedDecryption
-
An integer totaling the number of RTP packets that could not be decrypted. These packets are not counted by
packetsDiscarded
. perDscpPacketsReceived
-
A record of key-value pairs with strings as the keys mapped to 32-bit integer values, each indicating the total number of packets this receiver has received on this RTP stream from this source for each Differentiated Services Code Point (DSCP).
receiverId
-
A string indicating which identifies the
RTCAudioReceiverStats
orRTCVideoReceiverStats
object associated with the stream's receiver. This ID is stable across multiple calls togetStats()
. remoteId
-
A string which identifies the
RTCRemoteOutboundRtpStreamStats
object that provides statistics for the remote peer for this same SSRC. This ID is stable across multiple calls togetStats()
. sliCount
-
An integer indicating the number of times the receiver sent a Slice Loss Indication (SLI) frame to the sender to tell it that one or more consecutive (in terms of scan order) video macroblocks have been lost or corrupted. Available only for video streams.
trackIdentifier
-
A string that contains the
id
value of theMediaStreamTrack
associated with the inbound stream. trackId
Deprecated-
A string which identifies the statistics object representing the receiving track; this object is one of two types:
RTCReceiverAudioTrackAttachmentStats
orRTCReceiverVideoTrackAttachmentStats
. This ID is stable across multiple calls togetStats()
.
Statistics measured at the receiver of an RTP stream
These statistics are measured at the receiving end of an RTP stream, regardless of whether it's local or remote.
packetsReceived
-
The total number of RTP packets received for this synchronizing source, including retransmissions.
packetsLost
-
The total number of RTP packets lost for this synchronizing source. Note that this can be negative if more packets are received than sent.
jitter
-
Packet jitter for this synchronizing source, measured in seconds.
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.
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.
qpSum
-
A 64-bit value containing the sum of the QP values for every frame decoded by this RTP receiver to date on the video track described by this statistics object. You can approximate the average QP per frame by dividing this value by
framesDecoded
, 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. Valid only for video streams.
Common RTP stream statistics
codecId
-
A string which uniquely identifies the object which was inspected to produce the
RTCCodecStats
object associated with this RTP stream. kind
-
A string indicating whether the
MediaStreamTrack
associated with the stream is an audio or a video track. ssrc
-
The 32-bit integer which identifies the source of the RTP packets this object provides. This value is generated per the RFC 3550 specification.
transportId
-
A string uniquely identifying the object which was inspected to produce the
RTCTransportStats
object associated with this RTP stream.
Common instance properties
The following properties are common to all WebRTC statistics objects.
id
-
A string that uniquely identifies the object that is being monitored to produce this set of statistics.
timestamp
-
A
DOMHighResTimeStamp
object indicating the time at which the sample was taken for this statistics object. type
-
A string with the value
"inbound-rtp"
, indicating the type of statistics that the object contains.
Examples
Specifications
Specification |
---|
Identifiers for WebRTC's Statistics API # dom-rtcstatstype-inbound-rtp |
Browser compatibility
BCD tables only load in the browser