Skip to content

Commit 9dd28ca

Browse files
hamishwilleegithub-actions[bot]wbamberg
authored
Ff142 RTCInboundRtpStreamStats fixes (#40495)
* RTCInboundRtpStreamStats - update to only supported members (placholders) * RTCInboundRtpStreamStats.keyFramesDecoded - add * RTCInboundRtpStreamStats.headerBytesReceived - add * RTCInboundRtpStreamStats.frameHeight/.frameWidth - add * RTCInboundRtpStreamStats.framesPerSecond - add * RTCInboundRtpStreamStats.framesReceived - add * RTCInboundRtpStreamStats.audioLevel - add * RTCInboundRtpStreamStats.totalAudioEnergy * RTCInboundRtpStreamStats.concealedSamples * RTCInboundRtpStreamStats.concealmentEvents * RTCInboundRtpStreamStats.estimatedPlayoutTimestamp * RTCInboundRtpStreamStats.silentConcealedSamples * RTCInboundRtpStreamStats.framesAssembledFromMultiplePackets add * RTCInboundRtpStreamStats.totalAssemblyTime add * RTCInboundRtpStreamStats.freezeCount add * RTCInboundRtpStreamStats.insertedSamplesForDeceleration add * RTCInboundRtpStreamStats.jitterBufferDelay add * Improve inserted/removedSamples * Jitter related stats * RTCInboundRtpStreamStats.packetsDiscarded add * RTCInboundRtpStreamStats.packetsLost add * RTCInboundRtpStreamStats.packetsReceived add * RTCInboundRtpStreamStats.pauseCount add * RTCInboundRtpStreamStats.totalPausesDuration add * RTCInboundRtpStreamStats.playoutId add * RTCInboundRtpStreamStats.totalDecodeTime add * RTCInboundRtpStreamStats tidy a few * Update files/en-us/web/api/rtcinboundrtpstreamstats/playoutid/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * totalFreezesDuration - add * totalInterFrameDelay - add * totalProcessingDelay - add * totalSamplesDuration - add * totalSamplesReceived - add * totalSquaredInterFrameDelay - add * trackIdentifier - add * accel/decel fixes * RTCInboundRtpStreamStats.averageRtcpInterval - delete/redirect RTCInboundRtpStreamStats/receiverId - delete/redirect RTCInboundRtpStreamStats.packetsFailedDecryption - delete/redirect RTCInboundRtpStreamStats/packetsDuplicated - delete/redirect RTCInboundRtpStreamStats/perDscpPacketsReceived - delete/redirect RTCInboundRtpStreamStats.sliCount - delete/redirect * Try revert screwed up _wikihistory.json * playoutid fix * Apply suggestions from code review Co-authored-by: wbamberg <[email protected]> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: wbamberg <[email protected]>
1 parent 610e4ea commit 9dd28ca

File tree

54 files changed

+1374
-384
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1374
-384
lines changed

files/en-us/_redirects.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9981,9 +9981,15 @@
99819981
/en-US/docs/Web/API/RTCIceTransport/onselectedcandidatepairchange /en-US/docs/Web/API/RTCIceTransport/selectedcandidatepairchange_event
99829982
/en-US/docs/Web/API/RTCIceTransport/onstatechange /en-US/docs/Web/API/RTCIceTransport/statechange_event
99839983
/en-US/docs/Web/API/RTCIceTransportState /en-US/docs/Web/API/RTCIceTransport/state
9984+
/en-US/docs/Web/API/RTCInboundRtpStreamStats/averageRtcpInterval /en-US/docs/Web/API/RTCInboundRtpStreamStats
99849985
/en-US/docs/Web/API/RTCInboundRtpStreamStats/firCount /en-US/docs/Web/API/RTCInboundRtpStreamStats
99859986
/en-US/docs/Web/API/RTCInboundRtpStreamStats/lastPacketReceivedTimesta /en-US/docs/Web/API/RTCInboundRtpStreamStats/lastPacketReceivedTimestamp
9987+
/en-US/docs/Web/API/RTCInboundRtpStreamStats/packetsDuplicated /en-US/docs/Web/API/RTCInboundRtpStreamStats
9988+
/en-US/docs/Web/API/RTCInboundRtpStreamStats/packetsFailedDecryption /en-US/docs/Web/API/RTCInboundRtpStreamStats
9989+
/en-US/docs/Web/API/RTCInboundRtpStreamStats/perDscpPacketsReceived /en-US/docs/Web/API/RTCInboundRtpStreamStats
99869990
/en-US/docs/Web/API/RTCInboundRtpStreamStats/pliCount /en-US/docs/Web/API/RTCInboundRtpStreamStats
9991+
/en-US/docs/Web/API/RTCInboundRtpStreamStats/receiverId /en-US/docs/Web/API/RTCInboundRtpStreamStats
9992+
/en-US/docs/Web/API/RTCInboundRtpStreamStats/sliCount /en-US/docs/Web/API/RTCInboundRtpStreamStats
99879993
/en-US/docs/Web/API/RTCInboundRtpStreamStats/trackId /en-US/docs/Web/API/RTCInboundRtpStreamStats
99889994
/en-US/docs/Web/API/RTCOfferAnswerOptions /en-US/docs/Web/API/RTCPeerConnection/createAnswer
99899995
/en-US/docs/Web/API/RTCOfferAnswerOptions/voiceActivityDetection /en-US/docs/Web/API/RTCPeerConnection/createAnswer

files/en-us/glossary/jitter/index.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,15 @@ sidebar: glossarysidebar
88
**Jitter** is the term used in computer networking to refer to [packet delay variation](https://en.wikipedia.org/wiki/Packet_delay_variation) — the variance in the rate at which packets arrive at a destination (the average of the squared difference from the mean packet arrival rate).
99

1010
"High jitter" indicates that packets are arriving at significantly varying rates, possibly due to network congestion, packet loss, and routing of packets in a stream through different paths.
11-
1211
High jitter can significantly degrade the performance of real-time web applications, including voice/video streaming and online gaming.
12+
13+
## Jitter buffer
14+
15+
Network protocols and applications, such as WebRTC, use a "jitter buffer" to mitigate the effects of packet delay variation.
16+
Jitter buffers temporarily store incoming packets and then release them at a steady, synchronized rate.
17+
They may also use forward error correction to fix corrupted packets, re-request missing packets, [insert audio samples to conceal missing packets](https://en.wikipedia.org/wiki/Packet_loss_concealment), slow down or speed up sample playout, and so on.
18+
This process smooths out the arrival times of packets and ensures a more consistent playout of real-time audio and video.
19+
20+
## See also
21+
22+
- [How WebRTC's NetEQ Jitter Buffer Provides Smooth Audio](https://webrtchacks.com/how-webrtcs-neteq-jitter-buffer-provides-smooth-audio/#post-4560-_mv3ivinthkf5) (webrtchacks.com, June 2025)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: "RTCInboundRtpStreamStats: audioLevel property"
3+
short-title: audioLevel
4+
slug: Web/API/RTCInboundRtpStreamStats/audioLevel
5+
page-type: web-api-instance-property
6+
browser-compat: api.RTCStatsReport.type_inbound-rtp.audioLevel
7+
---
8+
9+
{{APIRef("WebRTC")}}
10+
11+
The **`audioLevel`** property of the {{domxref("RTCInboundRtpStreamStats")}} dictionary indicates the audio level of the received (remote) track.
12+
13+
The `audioLevel` is averaged over some small interval, using the algorithm described under {{domxref("RTCInboundRtpStreamStats.totalAudioEnergy","totalAudioEnergy")}}.
14+
The interval used is implementation dependent.
15+
16+
> [!NOTE]
17+
> The value is undefined for video streams.
18+
19+
## Value
20+
21+
A real number.
22+
23+
The value is between 0..1 (linear), where 1.0 represents 0 dBov ([decibels relative to full scale (DBFS)](https://en.wikipedia.org/wiki/DBFS)), 0 represents silence, and 0.5 represents approximately 6 dB SPL change in the [sound pressure level](https://en.wikipedia.org/wiki/Sound_pressure#Sound_pressure_level) from 0 dBov.
24+
25+
26+
## Specifications
27+
28+
{{Specifications}}
29+
30+
## Browser compatibility
31+
32+
{{Compat}}
33+
34+
## See also
35+
36+
- {{domxref("RTCAudioSourceStats.audioLevel")}} for audio levels of local tracks (that are being sent)

files/en-us/web/api/rtcinboundrtpstreamstats/averagertcpinterval/index.md

Lines changed: 0 additions & 39 deletions
This file was deleted.

files/en-us/web/api/rtcinboundrtpstreamstats/bytesreceived/index.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,19 @@ browser-compat: api.RTCStatsReport.type_inbound-rtp.bytesReceived
88

99
{{APIRef("WebRTC")}}
1010

11-
The {{domxref("RTCInboundRtpStreamStats")}} dictionary's
12-
**`bytesReceived`** property is an integer value which
13-
indicates the total number of bytes received so far from this synchronization source
14-
(SSRC).
11+
The **`bytesReceived`** property of the {{domxref("RTCInboundRtpStreamStats")}} dictionary indicates the total number of bytes received so far from this synchronization source (SSRC), not including header and padding bytes.
1512

16-
## Value
17-
18-
An unsigned integer value indicating the total number of bytes received so far on this
19-
RTP stream, not including header and padding bytes. This value can be used to calculate
20-
an approximation of the average media data rate:
13+
The value can be used to calculate an approximation of the average media data rate:
2114

2215
```js
2316
avgDataRate = rtcInboundRtpStreamStats.bytesReceived / elapsedTime;
2417
```
2518

26-
This value gets reset to zero if the sender's SSRC identifier changes for any reason.
19+
The property value is reset to zero if the sender's SSRC identifier changes for any reason.
20+
21+
## Value
22+
23+
An positive integer.
2724

2825
## Specifications
2926

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: "RTCInboundRtpStreamStats: concealedSamples property"
3+
short-title: concealedSamples
4+
slug: Web/API/RTCInboundRtpStreamStats/concealedSamples
5+
page-type: web-api-instance-property
6+
browser-compat: api.RTCStatsReport.type_inbound-rtp.concealedSamples
7+
---
8+
9+
{{APIRef("WebRTC")}}
10+
11+
The **`concealedSamples`** property of the {{domxref("RTCInboundRtpStreamStats")}} dictionary indicates the total number of concealed samples for the received audio track over the lifetime of this stats object.
12+
13+
A concealed sample is a sample that was lost or arrived too late to be played out, and therefore had to be replaced with a locally generated synthesized sample.
14+
Note that lost samples are reported in {{domxref("RTCInboundRtpStreamStats.packetsLost", "packetsLost")}}, while late packets are reported in {{domxref("RTCInboundRtpStreamStats.fecPacketsDiscarded", "fecPacketsDiscarded")}}.
15+
16+
> [!NOTE]
17+
> The value is undefined for video streams.
18+
19+
## Value
20+
21+
A positive integer.
22+
23+
## Specifications
24+
25+
{{Specifications}}
26+
27+
## Browser compatibility
28+
29+
{{Compat}}
30+
31+
## See also
32+
33+
- {{domxref("RTCInboundRtpStreamStats.silentConcealedSamples")}}
34+
- {{domxref("RTCInboundRtpStreamStats.concealmentEvents")}}
35+
- [Packet loss concealment](https://en.wikipedia.org/wiki/Packet_loss_concealment) on Wikipedia
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: "RTCInboundRtpStreamStats: concealmentEvents property"
3+
short-title: concealmentEvents
4+
slug: Web/API/RTCInboundRtpStreamStats/concealmentEvents
5+
page-type: web-api-instance-property
6+
browser-compat: api.RTCStatsReport.type_inbound-rtp.concealmentEvents
7+
---
8+
9+
{{APIRef("WebRTC")}}
10+
11+
The **`concealmentEvents`** property of the {{domxref("RTCInboundRtpStreamStats")}} dictionary indicates the total number of concealment events for the received audio track over the lifetime of this stats object.
12+
13+
A concealed sample is a sample that was lost or arrived too late to be played out, and therefore had to be replaced with a locally generated synthesized sample.
14+
Any number of consecutive concealed samples following a non-concealed sample comprise a single concealment event.
15+
The value in this property will therefore be less than or equal to {{domxref("RTCInboundRtpStreamStats.concealedSamples", "concealedSamples")}}, which counts every sample.
16+
17+
> [!NOTE]
18+
> The value is undefined for video streams.
19+
20+
## Value
21+
22+
A positive integer.
23+
24+
## Specifications
25+
26+
{{Specifications}}
27+
28+
## Browser compatibility
29+
30+
{{Compat}}
31+
32+
## See also
33+
34+
- {{domxref("RTCInboundRtpStreamStats.concealedSamples")}}
35+
- {{domxref("RTCInboundRtpStreamStats.silentConcealedSamples")}}
36+
- [Packet loss concealment](https://en.wikipedia.org/wiki/Packet_loss_concealment) on Wikipedia
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: "RTCInboundRtpStreamStats: estimatedPlayoutTimestamp property"
3+
short-title: estimatedPlayoutTimestamp
4+
slug: Web/API/RTCInboundRtpStreamStats/estimatedPlayoutTimestamp
5+
page-type: web-api-instance-property
6+
browser-compat: api.RTCStatsReport.type_inbound-rtp.estimatedPlayoutTimestamp
7+
---
8+
9+
{{APIRef("WebRTC")}}
10+
11+
The **`estimatedPlayoutTimestamp`** property of the {{domxref("RTCInboundRtpStreamStats")}} dictionary indicates the estimated playout time of this receiver's track.
12+
13+
This is the [Network Time Protocol (NTP)](https://en.wikipedia.org/wiki/Network_Time_Protocol) timestamp of the last playable audio sample or video frame that has a known timestamp, extrapolated with the time elapsed since it was ready to be played out.
14+
In other words, it is the estimated current playout time of the track in the NTP clock time of the sender, and can be present even if there is no audio currently playing.
15+
16+
This can be used to estimate how much audio and video tracks from the same source are out of sync.
17+
18+
## Value
19+
20+
A {{domxref("DOMHighResTimeStamp")}}.
21+
22+
## Specifications
23+
24+
{{Specifications}}
25+
26+
## Browser compatibility
27+
28+
{{Compat}}

files/en-us/web/api/rtcinboundrtpstreamstats/fecpacketsdiscarded/index.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,15 @@ browser-compat: api.RTCStatsReport.type_inbound-rtp.fecPacketsDiscarded
88

99
{{APIRef("WebRTC")}}
1010

11-
The **`fecPacketsDiscarded`** property
12-
of the {{domxref("RTCInboundRtpStreamStats")}} dictionary is a numeric value
13-
indicating the number of {{Glossary("RTP")}} Forward Error Correction (FEC) packets
14-
that have been discarded.
11+
The **`fecPacketsDiscarded`** property of the {{domxref("RTCInboundRtpStreamStats")}} dictionary indicates the number of {{Glossary("RTP")}} Forward Error Correction (FEC) packets that have been discarded.
1512

16-
## Value
13+
A FEC packet provides parity information that can be used to attempt to reconstruct RTP data packets which have been corrupted in transit.
14+
This kind of packet might be discarded if all the packets that it covers have already been received or recovered using another FEC packet, or if the FEC packet arrived outside the recovery window and the lost RTP packets have already been skipped during playback as a result.
15+
The value of {{domxref("RTCInboundRtpStreamStats/fecPacketsReceived","fecPacketsReceived")}} includes these discarded packets.
1716

18-
An unsigned integer value indicating how many FEC packets have been received whose
19-
error correction payload has been discarded.
17+
## Value
2018

21-
This can happen if all the packets covered by the FEC packet have already been received
22-
or recovered using another FEC packet, or if the FEC packet arrived outside the recovery
23-
window and the lost RTP packets have already been skipped during playback as a result.
24-
The value of `fecPacketsReceived` includes these discarded packets.
19+
An positive integer value.
2520

2621
## Specifications
2722

files/en-us/web/api/rtcinboundrtpstreamstats/fecpacketsreceived/index.md

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,29 @@ browser-compat: api.RTCStatsReport.type_inbound-rtp.fecPacketsReceived
88

99
{{APIRef("WebRTC")}}
1010

11-
The **`fecPacketsReceived`** property
12-
of the {{domxref("RTCInboundRtpStreamStats")}} dictionary indicates how many
13-
Forward Error Correction (FEC) packets have been received by this RTP receiver
14-
from the remote peer.
11+
The **`fecPacketsReceived`** property of the {{domxref("RTCInboundRtpStreamStats")}} dictionary indicates how many Forward Error Correction (FEC) packets have been received by this RTP receiver from the remote peer.
1512

16-
An FEC packet provides parity information which can
17-
be used to attempt to reconstruct RTP data packets which have been corrupted in
18-
transit.
13+
A FEC packet provides parity information that can be used to attempt to reconstruct RTP data packets which have been corrupted in transit.
1914

2015
## Value
2116

22-
An unsigned integer value which indicates the total number of FEC packets which have
23-
been received from the remote peer during this RTP session. Forward Error Correction
24-
uses an exclusive-or method to perform parity checks on the received data.
17+
An positive integer value.
2518

26-
By using the FEC parity information to attempt to reconstruct damaged packets, it is
27-
possible to avoid the need to retransmit damaged packets, which in turn helps to
28-
reduce lag, or the need to skip damaged frames entirely.
19+
## Description
2920

30-
> [!NOTE]
31-
> This counter may also be incremented when FEC packets arrive
32-
> in-band along with media content; this can happen with Opus, for example.
21+
This property indicates the total number of FEC packets which have been received from the remote peer during this RTP session.
22+
23+
Forward Error Correction uses an exclusive-or method to perform parity checks on the received data.
24+
By using the FEC parity information to attempt to reconstruct damaged packets, it is possible to avoid the need to retransmit damaged packets, which in turn helps to reduce lag, or the need to skip damaged frames entirely.
3325

34-
## Usage notes
26+
> [!NOTE]
27+
> This counter may also be incremented when FEC packets arrive in-band along with media content; this can happen with Opus, for example.
3528
36-
It's possible that a subset of the FEC packets which have been received were discarded
37-
instead of being used. This can happen if the packets covered by the FEC packets have
38-
already been received successfully or have already been reconstructed using a
39-
previously-received FEC packet. This may also happen if the FEC packet arrives outside
40-
the window of time in which the client will attempt to use it.
29+
It's possible that a subset of the FEC packets which have been received were discarded instead of being used.
30+
This can happen if the packets covered by the FEC packets have already been received successfully or have already been reconstructed using a previously-received FEC packet.
31+
This may also happen if the FEC packet arrives outside the window of time in which the client will attempt to use it.
4132

42-
If you wish to know how many of the received packets were discarded, you can examine
43-
the value of {{domxref("RTCInboundRtpStreamStats.fecPacketsDiscarded", "fecPacketsDiscarded")}}.
33+
If you wish to know how many of the received packets were discarded, you can examine the value of {{domxref("RTCInboundRtpStreamStats.fecPacketsDiscarded", "fecPacketsDiscarded")}}.
4434

4535
## Specifications
4636

0 commit comments

Comments
 (0)