W3cubDocs

/Web APIs

RTCInboundRtpStreamStats

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.

firCount

An integer value which indicates the total number of Full Intra Request (FIR) packets which this receiver has sent to the sender. This is an indicator of how often the stream has lagged, requiring frames to be skipped in order to catch up. This value is only available for video streams.

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. The timestamp 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 ACKnolwedgement (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).

pliCount

An integer specifying the number of times the receiver has notified the sender that some amount of encoded video data for one or more frames has been lost, using Picture Loss Indication (PLI) packets. This is only available for video streams.

qpSum

A 64-bit value containing the sum of the QP values for every frame decoded by this RTP receiver. You can determine the average QP per frame by dividing this value by framesDecoded. Valid only for video streams.

receiverId

A string indicating which identifies the RTCAudioReceiverStats or RTCVideoReceiverStats object associated with the stream's receiver. This ID is stable across multiple calls to getStats().

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 to getStats().

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 the MediaStreamTrack 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 or RTCReceiverVideoTrackAttachmentStats. This ID is stable across multiple calls to getStats().

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.

Standard fields included for all media types

codecId

A string which uniquely identifies the object which was inspected to produce the RTCCodecStats object associated with this RTP stream.

kind

A string 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 string which uniquely identifies the RTCMediaStreamTrackStats object representing the associated MediaStreamTrack. This is not the same as the value of MediaStreamTrack.id.

transportId

A string uniquely identifying the object which was inspected to produce the RTCTransportStats object associated with this RTP stream.

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 Indication (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 RTCInboundRtpStreamStats.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.

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

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
RTCInboundRtpStreamStats 79 79 27 No 66 11 79 79 27 57 11 12.0
audioLevel 86 86 106 No 72 14.1–16.3 86 86 106 61 No 14.0
bytesReceived 79 79 27 No 66 13.1 79 79 27 57 13.4 12.0
codecId 80 80 98 No 67 15.2–15.5 80 80 98 57 No 13.0
concealedSamples 86 86 104 No 72 14.1 86 86 104 61 14.5 14.0
concealmentEvents 86 86 106 No 72 14.1 86 86 106 61 14.5 14.0
fecPacketsDiscarded 81 81 106 No 68 14.1 81 81 106 58 14.5 13.0
fecPacketsReceived 81 81 106 No 68 14.1 81 81 106 58 14.5 13.0
headerBytesReceived 80 80 106 No 67 14.1 80 80 106 57 14.5 13.0
id 80 80 72 No 67 13.1 80 80 79 57 13.4 13.0
insertedSamplesForDeceleration 86 86 106 No 72 14.1 86 86 106 61 14.5 14.0
jitter 80 80 27 No 67 13.1 80 80 27 57 13.4 13.0
jitterBufferDelay 86 86 104 No 72 14.1 86 86 104 61 14.5 14.0
jitterBufferEmittedCount 86 86 104 No 72 14.1 86 86 104 61 14.5 14.0
jitterBufferMinimumDelay 105 105 No No 91 No 105 105 No 72 No 20.0
jitterBufferTargetDelay 105 105 No No 91 No 105 105 No 72 No 20.0
kind 80 80 63 No 67 14 80 80 63 57 14 13.0
lastPacketReceivedTimestamp 80 80 106 No 67 15.2–15.5 80 80 106 57 No 13.0
mid 105 105 No No 91 No 105 105 No 72 No 20.0
nackCount No No 55–96 No No No No No No No No No
packetsDiscarded 94 94 96 No 80 15.4 94 94 96 66 15.4 17.0
packetsLost 80 80 72 No 67 13.1 80 80 79 57 13.4 13.0
packetsReceived 80 80 72 No 67 13.1 80 80 79 57 13.4 13.0
playoutId 111 111 No No 97 No 111 111 No No No 22.0
remoteId 91 91 68 No 77 No 91 91 68 64 No 16.0
removedSamplesForAcceleration 86 86 106 No 72 14.1 86 86 106 61 14.5 14.0
silentConcealedSamples 86 86 104 No 72 14.1 86 86 104 61 14.5 14.0
ssrc 80 80 27 No 67 11 80 80 27 57 11 13.0
timestamp 80 80 72 No 67 13.1 80 80 79 57 13.4 13.0
totalAudioEnergy 86 86 106 No 72 14.1 86 86 106 61 14.5 14.0
totalSamplesDuration 86 86 106 No 72 14.1 86 86 106 61 14.5 14.0
totalSamplesReceived 86 86 104 No 72 14.1 86 86 104 61 14.5 14.0
trackIdentifier 105 105 111 No 91 16.4 105 105 111 72 16.4 20.0
transportId 80 80 No No 67 11 80 80 No 57 11 13.0
type 80 80 72 No 67 13.1 80 80 79 57 13.4 13.0

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RTCInboundRtpStreamStats