RTCOutboundRtpStreamStats
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 RTCOutboundRtpStreamStats
dictionary of the WebRTC API is used to report metrics and statistics related to an outbound RTP stream being sent by an RTCRtpSender
.
The statistics can be obtained by iterating the RTCStatsReport
returned by RTCPeerConnection.getStats()
or RTCRtpSender.getStats()
until you find a report with the type
of outbound-rtp
.
Instance properties
averageRtcpInterval
-
A floating-point value indicating the average RTCP interval between two consecutive compound RTCP packets.
framesEncoded
-
The number of frames that have been successfully encoded so far for sending on this RTP stream. Only valid for video streams.
perDscpPacketsSent
-
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
RTCRtpSender
has transmitted for this source for each Differentiated Services Code Point (DSCP). qualityLimitationDurations
Experimental-
A record mapping each of the quality limitation reasons in the
RTCRemoteInboundRtpStreamStats
enumeration to a floating-point value indicating the number of seconds the stream has spent with its quality limited for that reason. qualityLimitationReason
Experimental-
One of the string
none
,cpu
,bandwidth
, orother
, explaining why the resolution and/or frame rate is being limited for this RTP stream. Valid only for video streams. remoteId
-
A string which identifies the
RTCRemoteInboundRtpStreamStats
object that provides statistics for the remote peer for this same SSRC. This ID is stable across multiple calls togetStats()
. retransmittedBytesSent
-
The total number of bytes that have been retransmitted for this source as of the time the statistics were sampled. These retransmitted bytes comprise the packets included in the value returned by
retransmittedPacketsSent
. retransmittedPacketsSent
-
The total number of packets that have needed to be retransmitted for this source as of the time the statistics were sampled. These retransmitted packets are included in the value returned by
packetsSent
. senderId
-
The
id
of theRTCAudioSenderStats
orRTCVideoSenderStats
object containing statistics about this stream'sRTCRtpSender
. sliCount
-
An integer indicating the number of times this sender received a Slice Loss Indication (SLI) frame from the remote peer, indicating that one or more consecutive video macroblocks have been lost or corrupted. Available only for video streams.
targetBitrate
-
A value indicating the bit rate the
RTCRtpSender
's codec is configured to attempt to achieve in its output media. totalEncodedBytesTarget
Experimental-
A cumulative sum of the target frame sizes (the targeted maximum size of the frame in bytes when the codec is asked to compress it) for all of the frames encoded so far. This will likely differ from the total of the actual frame sizes.
totalEncodeTime
-
A floating-point value indicating the total number of seconds that have been spent encoding the frames encoded so far by this
RTCRtpSender
. trackId
-
The
id
of theRTCSenderAudioTrackAttachmentStats
orRTCSenderVideoTrackAttachmentStats
object containing the current track attachment to theRTCRtpSender
responsible for this 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.
nackCount
-
An integer value indicating the total number of Negative ACKnowledgement (NACK) packets this
RTCRtpSender
has received from the remoteRTCRtpReceiver
. qpSum
-
A 64-bit value containing the sum of the QP values for every frame encoded by this
RTCRtpSender
. Valid only for video streams.
Common RTP stream statistics
codecId
Optional-
A string that uniquely identifies the object that 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
-
A positive integer that identifies the SSRC of the RTP packets in this stream.
transportId
Optional-
A string that uniquely identifies 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
"outbound-rtp"
, indicating the type of statistics that the object contains.
Examples
Specifications
Specification |
---|
Identifiers for WebRTC's Statistics API # dom-rtcstatstype-outbound-rtp |
Browser compatibility
BCD tables only load in the browser