Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FF35 RTCOutboundRtpStreamStats updates #37722

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
946459b
RTCOutboundRtpStreamStats.averageRtcpInterval - remove (not implemented)
hamishwillee Jan 20, 2025
7340ea4
RTCOutboundRtpStreamStats.perDscpPacketsSent - remove (not implemented)
hamishwillee Jan 20, 2025
978ae7c
RTCOutboundRtpStreamStats.sliCount - remove (not implemented)
hamishwillee Jan 20, 2025
2524a92
RTCOutboundRtpStreamStats.trackId - remove (not implemented)
hamishwillee Jan 20, 2025
d61304f
RTCOutboundRtpStreamStats.mid - add
hamishwillee Jan 20, 2025
ec832a6
RTCOutboundRtpStreamStats.rid - add
hamishwillee Jan 20, 2025
69daac9
RTCOutboundRtpStreamStats.rid - add tidy
hamishwillee Jan 20, 2025
075ad46
RTCOutboundRtpStreamStats.active - add
hamishwillee Jan 20, 2025
9c28b5c
RTCOutboundRtpStreamStats.frameHeight - add
hamishwillee Jan 20, 2025
ad0b486
RTCOutboundRtpStreamStats.frameWidth - add
hamishwillee Jan 20, 2025
efa74a1
RTCOutboundRtpStreamStats.framesPerSecond - add
hamishwillee Jan 20, 2025
5612ef9
RTCOutboundRtpStreamStats.framesSent - add
hamishwillee Jan 20, 2025
09979b0
RTCOutboundRtpStreamStats.HeaderBytesSent - add
hamishwillee Jan 20, 2025
9e701e4
RTCOutboundRtpStreamStats.keyFramesEncoded - add
hamishwillee Jan 20, 2025
1cca1be
RTCOutboundRtpStreamStats.mediaSourceId - add
hamishwillee Jan 20, 2025
e74973c
RTCOutboundRtpStreamStats.qualityLimitationDurations - add
hamishwillee Jan 20, 2025
1510f06
RTCOutboundRtpStreamStats.qualityLimitationDurations - add / tidy
hamishwillee Jan 20, 2025
9469ae0
RTCOutboundRtpStreamStats.qualityLimitationReason - add
hamishwillee Jan 20, 2025
d10c450
RTCOutboundRtpStreamStats.retransmittedBytesSent - add
hamishwillee Jan 20, 2025
2029ad8
RTCOutboundRtpStreamStats.retransmittedPacketsSent - add
hamishwillee Jan 20, 2025
c5d00c9
RTCOutboundRtpStreamStats.remodeId - layout only
hamishwillee Jan 20, 2025
77ee07d
RTCOutboundRtpStreamStats.scalabilityMode - add
hamishwillee Jan 21, 2025
9933a01
RTCOutboundRtpStreamStats.targetBitrate - add
hamishwillee Jan 21, 2025
6146ab1
RTCOutboundRtpStreamStats.totalEncodeTime - add
hamishwillee Jan 21, 2025
b86dab0
RTCOutboundRtpStreamStats.totalEncodedBytesTarget - add
hamishwillee Jan 21, 2025
63f7929
RTCOutboundRtpStreamStats.totalPacketSendDelay - add
hamishwillee Jan 21, 2025
8115aac
RTCOutboundRtpStreamStats.bytesSent - add
hamishwillee Jan 21, 2025
e1de986
RTCOutboundRtpStreamStats.packetsSent - add
hamishwillee Jan 21, 2025
fe74fab
Fix up parent page
hamishwillee Jan 21, 2025
2ff95ca
mid - minor tweak
hamishwillee Jan 21, 2025
688bfc1
Code review suggestions plus consistent undefined for audio media
hamishwillee Feb 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion files/en-us/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9893,10 +9893,14 @@
/en-US/docs/Web/API/RTCOfferAnswerOptions/voiceActivityDetection /en-US/docs/Web/API/RTCPeerConnection/createAnswer
/en-US/docs/Web/API/RTCOfferOptions /en-US/docs/Web/API/RTCPeerConnection/createOffer
/en-US/docs/Web/API/RTCOfferOptions/iceRestart /en-US/docs/Web/API/RTCPeerConnection/createOffer
/en-US/docs/Web/API/RTCOutboundRtpStreamStats/averageRtcpInterval /en-US/docs/Web/API/RTCOutboundRtpStreamStats
/en-US/docs/Web/API/RTCOutboundRtpStreamStats/firCount /en-US/docs/Web/API/RTCOutboundRtpStreamStats
/en-US/docs/Web/API/RTCOutboundRtpStreamStats/lastPacketSentTimestamp /en-US/docs/Web/API/RTCOutboundRtpStreamStats
/en-US/docs/Web/API/RTCOutboundRtpStreamStats/perDscpPacketsReceived /en-US/docs/Web/API/RTCOutboundRtpStreamStats/perDscpPacketsSent
/en-US/docs/Web/API/RTCOutboundRtpStreamStats/perDscpPacketsReceived /en-US/docs/Web/API/RTCOutboundRtpStreamStats
/en-US/docs/Web/API/RTCOutboundRtpStreamStats/perDscpPacketsSent /en-US/docs/Web/API/RTCOutboundRtpStreamStats
/en-US/docs/Web/API/RTCOutboundRtpStreamStats/pliCount /en-US/docs/Web/API/RTCOutboundRtpStreamStats
/en-US/docs/Web/API/RTCOutboundRtpStreamStats/sliCount /en-US/docs/Web/API/RTCOutboundRtpStreamStats
/en-US/docs/Web/API/RTCOutboundRtpStreamStats/trackId /en-US/docs/Web/API/RTCOutboundRtpStreamStats
/en-US/docs/Web/API/RTCPeerConnection.addStream /en-US/docs/Web/API/RTCPeerConnection/addStream
/en-US/docs/Web/API/RTCPeerConnection.close /en-US/docs/Web/API/RTCPeerConnection/close
/en-US/docs/Web/API/RTCPeerConnection.getIdentityAssertion /en-US/docs/Web/API/RTCPeerConnection/getIdentityAssertion
Expand Down
16 changes: 0 additions & 16 deletions files/en-us/_wikihistory.json
Original file line number Diff line number Diff line change
Expand Up @@ -53774,10 +53774,6 @@
"modified": "2020-10-15T22:17:14.806Z",
"contributors": ["Sheppy"]
},
"Web/API/RTCOutboundRtpStreamStats/averageRtcpInterval": {
"modified": "2020-10-15T22:17:15.805Z",
"contributors": ["Sheppy"]
},
"Web/API/RTCOutboundRtpStreamStats/framesEncoded": {
"modified": "2020-10-15T22:17:15.823Z",
"contributors": ["Sheppy"]
Expand All @@ -53786,10 +53782,6 @@
"modified": "2020-10-15T22:17:14.809Z",
"contributors": ["Sheppy"]
},
"Web/API/RTCOutboundRtpStreamStats/perDscpPacketsSent": {
"modified": "2020-10-15T22:17:15.897Z",
"contributors": ["Sheppy"]
},
"Web/API/RTCOutboundRtpStreamStats/qpSum": {
"modified": "2020-10-15T22:17:16.058Z",
"contributors": ["Sheppy"]
Expand All @@ -53802,14 +53794,6 @@
"modified": "2020-10-15T22:17:16.621Z",
"contributors": ["Sheppy"]
},
"Web/API/RTCOutboundRtpStreamStats/sliCount": {
"modified": "2020-10-15T22:17:16.518Z",
"contributors": ["Sheppy"]
},
"Web/API/RTCOutboundRtpStreamStats/trackId": {
"modified": "2020-10-15T22:17:16.946Z",
"contributors": ["Sheppy"]
},
"Web/API/RTCPeerConnection": {
"modified": "2020-12-14T09:30:15.422Z",
"contributors": [
Expand Down
26 changes: 26 additions & 0 deletions files/en-us/web/api/rtcoutboundrtpstreamstats/active/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: "RTCOutboundRtpStreamStats: active property"
short-title: active
slug: Web/API/RTCOutboundRtpStreamStats/active
page-type: web-api-instance-property
browser-compat: api.RTCStatsReport.type_outbound-rtp.active
---

{{APIRef("WebRTC")}}

The **`active`** property of the {{domxref("RTCOutboundRtpStreamStats")}} dictionary is a boolean that indicates whether this RTP stream is configured to be sent, or is disabled.

For example, this would be be `false` if the track corresponding to the the stream had its {{domxref("MediaStreamTrack.enabled")}} property set to `false`.
Note that an active stream may still not be sending if, for example, the stream is limited by network conditions.

## Value

`true` if the stream is enabled for sending, `false` otherwise.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: "RTCOutboundRtpStreamStats: bytesSent property"
short-title: bytesSent
slug: Web/API/RTCOutboundRtpStreamStats/bytesSent
page-type: web-api-instance-property
browser-compat: api.RTCStatsReport.type_outbound-rtp.bytesSent
---

{{APIRef("WebRTC")}}

The **`bytesSent`** property of the {{domxref("RTCOutboundRtpStreamStats")}} dictionary indicates the total number of payload bytes sent on this stream ({{domxref("RTCDataChannel")}}).

The value includes bytes in retransmitted payload bytes.
It does not include headers or padding.

## Value

A positive integer.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: "RTCOutboundRtpStreamStats: frameHeight property"
short-title: frameHeight
slug: Web/API/RTCOutboundRtpStreamStats/frameHeight
page-type: web-api-instance-property
browser-compat: api.RTCStatsReport.type_outbound-rtp.frameHeight
---

{{APIRef("WebRTC")}}

The **`frameHeight`** property of the {{domxref("RTCOutboundRtpStreamStats")}} dictionary is a positive integer that indicates the height of the last encoded frame, in pixels.

Note that the resolution of the encoded frame may be lower than that of the media source, which is provided in {{domxref("RTCVideoSourceStats.height")}}.

> [!NOTE]
> The property is undefined for audio streams, and before the first frame is encoded.

## Value

A positive integer.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: "RTCOutboundRtpStreamStats: framesPerSecond property"
short-title: framesPerSecond
slug: Web/API/RTCOutboundRtpStreamStats/framesPerSecond
page-type: web-api-instance-property
browser-compat: api.RTCStatsReport.type_outbound-rtp.framesPerSecond
---

{{APIRef("WebRTC")}}

The **`framesPerSecond`** property of the {{domxref("RTCOutboundRtpStreamStats")}} dictionary indicates the number of encoded frames sent in the last second.

Note that this may be lower than the media source frame rate, which is provided in {{domxref("RTCVideoSourceStats.framesPerSecond")}}.

> [!NOTE]
> The value does not exist for audio, or before the first second of encoding.

## Value

A positive number.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: "RTCOutboundRtpStreamStats: framesSent property"
short-title: framesSent
slug: Web/API/RTCOutboundRtpStreamStats/framesSent
page-type: web-api-instance-property
browser-compat: api.RTCStatsReport.type_outbound-rtp.framesSent
---

{{APIRef("WebRTC")}}

The **`framesSent`** property of the {{domxref("RTCOutboundRtpStreamStats")}} dictionary indicates the total number of encoded frames sent on this RTP stream over its lifetime.

Note that this may be lower than the total number of media source frames, which is provided in {{domxref("RTCVideoSourceStats.frames")}}.

> [!NOTE]
> The value does not exist for audio.

## Value

A positive number.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: "RTCOutboundRtpStreamStats: frameWidth property"
short-title: frameWidth
slug: Web/API/RTCOutboundRtpStreamStats/frameWidth
page-type: web-api-instance-property
browser-compat: api.RTCStatsReport.type_outbound-rtp.frameWidth
---

{{APIRef("WebRTC")}}

The **`frameWidth`** property of the {{domxref("RTCOutboundRtpStreamStats")}} dictionary is a positive integer that indicates the width of the last encoded frame, in pixels.

Note that the resolution of the encoded frame may be lower than that of the media source, which is provided in {{domxref("RTCVideoSourceStats.width")}}.

> [!NOTE]
> The value does not exist for audio, or before the first frame is encoded.

## Value

A positive integer.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: "RTCOutboundRtpStreamStats: headerBytesSent property"
short-title: headerBytesSent
slug: Web/API/RTCOutboundRtpStreamStats/headerBytesSent
page-type: web-api-instance-property
browser-compat: api.RTCStatsReport.type_outbound-rtp.headerBytesSent
---

{{APIRef("WebRTC")}}

The **`headerBytesSent`** property of the {{domxref("RTCOutboundRtpStreamStats")}} dictionary indicates the total number of RTP header and padding bytes sent for this [synchronization source (SSRC)](/en-US/docs/Web/API/RTCOutboundRtpStreamStats/ssrc).

Note that the total number of bytes sent as payload over the transport is equal to: `headerBytesSent` + {{domxref("RTCOutboundRtpStreamStats.bytesSent","bytesSent")}}.

## Value

A positive integer.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
89 changes: 61 additions & 28 deletions files/en-us/web/api/rtcoutboundrtpstreamstats/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,78 @@ The statistics can be obtained by iterating the {{domxref("RTCStatsReport")}} re

## Instance properties

- {{domxref("RTCOutboundRtpStreamStats.averageRtcpInterval", "averageRtcpInterval")}}
- : A floating-point value indicating the average {{Glossary("RTCP")}} interval between two consecutive compound RTCP packets.
- {{domxref("RTCOutboundRtpStreamStats.active", "active")}}
- : A boolean that indicates whether this RTP stream is configured to be sent, or is disabled.
- {{domxref("RTCOutboundRtpStreamStats.frameHeight", "frameHeight")}}
- : An integer indicating the height of the last encoded frame, in pixels.
_Undefined for audio streams._
- {{domxref("RTCOutboundRtpStreamStats.frameWidth", "frameWidth")}}
- : An integer indicating the width of the last encoded frame, in pixels.
_Undefined for audio streams._
- {{domxref("RTCOutboundRtpStreamStats.framesEncoded", "framesEncoded")}}
- : The number of frames that have been successfully encoded so far for sending on this RTP stream. _Only valid for video streams._
- {{domxref("RTCOutboundRtpStreamStats.perDscpPacketsSent", "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).
- : The number of frames that have been successfully encoded so far for sending on this RTP stream.
_Undefined for audio streams._
- {{domxref("RTCOutboundRtpStreamStats.framesPerSecond", "framesPerSecond")}}
- : A number that represents the encoded frames sent in the last second.
_Undefined for audio streams._
- {{domxref("RTCOutboundRtpStreamStats.framesSent", "framesSent")}}
- : A positive integer that represents the total number of encoded frames sent on this RTP stream.
_Undefined for audio streams._
- {{domxref("RTCOutboundRtpStreamStats.headerBytesSent", "headerBytesSent")}}
- : A positive integer that represents the total number of RTP header and padding bytes sent for this SSRC.
- {{domxref("RTCOutboundRtpStreamStats.keyFramesEncoded", "keyFramesEncoded")}}
- : A positive integer that represents the total number of key frames successfully encoded in this RTP media stream.
_Undefined for audio streams._
- {{domxref("RTCOutboundRtpStreamStats.mediaSourceId", "mediaSourceId")}}
- : A string that represents the id of the stats object of the track currently attached to the sender of this stream.
- {{domxref("RTCOutboundRtpStreamStats.mid", "mid")}}
- : A string that uniquely identifies the pairing of source and destination of the transceiver's stream.
This is the value of the corresponding {{domxref("RTCRtpTransceiver.mid")}} unless that is null, in which case the statistic property is not present.
- {{domxref("RTCOutboundRtpStreamStats.nackCount", "nackCount")}}
- : An integer value indicating the total number of Negative ACKnowledgement (NACK) packets this `RTCRtpSender` has received from the remote {{domxref("RTCRtpReceiver")}}.
This locally-computed value provides an indication of the error resiliency of the connection.
- {{domxref("RTCOutboundRtpStreamStats.qpSum", "qpSum")}}
- : A 64-bit value containing the sum of the QP values for every frame encoded by this {{domxref("RTCRtpSender")}}.
This locally-computed value provides an indication of how heavily compressed the data is.
_Undefined for audio streams._
- {{domxref("RTCOutboundRtpStreamStats.qualityLimitationDurations", "qualityLimitationDurations")}} {{experimental_inline}}
- : A record mapping each of the quality limitation reasons in the {{domxref("RTCRemoteInboundRtpStreamStats")}} enumeration to a floating-point value indicating the number of seconds the stream has spent with its quality limited for that reason.
- : A map of the reasons that a media stream's resolution or framerate has been reduced, and the time that the quality was reduced for each reason.
_Undefined for audio streams._
- {{domxref("RTCOutboundRtpStreamStats.qualityLimitationReason", "qualityLimitationReason")}} {{experimental_inline}}
- : One of the string `none`, `cpu`, `bandwidth`, or `other`, explaining why the resolution and/or frame rate is being limited for this RTP stream. _Valid only for video streams_.
- : A string indicating the reason why the stream is being quality-limited.
One of: `none`, `cpu`, `bandwidth`, or `other`.
_Undefined for audio streams._
- {{domxref("RTCOutboundRtpStreamStats.remoteId", "remoteId")}}
- : A string which identifies the {{domxref("RTCRemoteInboundRtpStreamStats")}} object that provides statistics for the remote peer for this same SSRC. This ID is stable across multiple calls to `getStats()`.
- : A string which identifies the {{domxref("RTCRemoteInboundRtpStreamStats")}} object that provides statistics for the remote peer for this same SSRC.
This ID is stable across multiple calls to `getStats()`.
- {{domxref("RTCOutboundRtpStreamStats.retransmittedBytesSent", "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 {{domxref("RTCInboundRtpStreamStats.retransmittedPacketsSent", "retransmittedPacketsSent")}}.
- : A positive integer that represents the total number of payload bytes retransmitted for the source associated with this stream.
- {{domxref("RTCOutboundRtpStreamStats.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 {{domxref("RTCInboundRtpStreamStats.packetsSent", "packetsSent")}}.
- {{domxref("RTCOutboundRtpStreamStats.senderId", "senderId")}}
- : The {{domxref("RTCOutboundRtpStreamStats.id", "id")}} of the {{domxref("RTCAudioSenderStats")}} or {{domxref("RTCVideoSenderStats")}} object containing statistics about this stream's {{domxref("RTCRtpSender")}}.
- {{domxref("RTCOutboundRtpStreamStats.sliCount", "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.
- : A positive integer that represents the total number of packets retransmitted for the source associated with this stream.
- {{domxref("RTCOutboundRtpStreamStats.rid", "rid")}}
- : A string that indicates the RTP stream ID for a corresponding video stream.
- {{domxref("RTCOutboundRtpStreamStats.scalabilityMode", "scalabilityMode")}}
- : A string that represents the scalability mode for the RTP stream, if one has been configured.
- {{domxref("RTCOutboundRtpStreamStats.targetBitrate", "targetBitrate")}}
- : A value indicating the bit rate the `RTCRtpSender`'s codec is configured to attempt to achieve in its output media.
- {{domxref("RTCOutboundRtpStreamStats.totalEncodedBytesTarget", "totalEncodedBytesTarget")}} {{experimental_inline}}
- : 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.
- : A number that represents the bit rate that the `RTCRtpSender`'s codec is currently attempting to achieve for the stream.
- {{domxref("RTCOutboundRtpStreamStats.totalEncodeTime", "totalEncodeTime")}}
- : A floating-point value indicating the total number of seconds that have been spent encoding the frames encoded so far by this {{domxref("RTCRtpSender")}}.
- {{domxref("RTCOutboundRtpStreamStats.trackId", "trackId")}}
- : The {{domxref("RTCOutboundRtpStreamStats.id", "id")}} of the {{domxref("RTCSenderAudioTrackAttachmentStats")}} or {{domxref("RTCSenderVideoTrackAttachmentStats")}} object containing the current track attachment to the {{domxref("RTCRtpSender")}} responsible for this stream.
- : A number that represents the total number of seconds that have been spent encoding the frames encoded for this stream {{domxref("RTCRtpSender")}}.
_Undefined for audio streams._
- {{domxref("RTCOutboundRtpStreamStats.totalEncodedBytesTarget", "totalEncodedBytesTarget")}} {{experimental_inline}}
- : A cumulative sum of the _target_ frame sizes for all of the frames encoded so far.
This will likely differ from the total of the _actual_ frame sizes.
_Undefined for audio streams._
- {{domxref("RTCOutboundRtpStreamStats.totalPacketSendDelay", "totalPacketSendDelay")}}
- : A number that represents the total time in seconds that packets have spent buffered locally before being transmitted.

### Local-only measurements
### Sent RTP stream statistics

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.
<!-- RTCSentRtpStreamStats -->

- {{domxref("RTCOutboundRtpStreamStats.nackCount", "nackCount")}}
- : An integer value indicating the total number of Negative ACKnowledgement (NACK) packets this `RTCRtpSender` has received from the remote {{domxref("RTCRtpReceiver")}}.
- {{domxref("RTCOutboundRtpStreamStats.qpSum", "qpSum")}}
- : A 64-bit value containing the sum of the QP values for every frame encoded by this {{domxref("RTCRtpSender")}}.
_Valid only for video streams._
- {{domxref("RTCOutboundRtpStreamStats.bytesSent", "bytesSent")}} {{optional_inline}}
- : A positive integer indicating the total number of bytes sent for this SSRC, including retransmissions. <!-- [RFC3550] section 6.4.1 -->
- {{domxref("RTCOutboundRtpStreamStats.packetsSent", "packetsSent")}} {{optional_inline}}
- : A positive integer indicating the total number of RTP packets sent for this SSRC, including retransmissions. <!-- [RFC3550] section 6.4.1 -->

### Common RTP stream statistics

Expand Down
Loading