Skip to content

Conversation

hamishwillee
Copy link
Collaborator

@hamishwillee hamishwillee commented Jul 22, 2025

This fixes up the RTCInboundRtpStreamStats to match the BCD as per FF142, which adds support for some more properties.

RTC is hard IMO, and the specs are not easy. A lot of this is nothing more than the spec. A little of it is. For example, I did learn some interesting things about the jitter buffer and associated stats in https://webrtchacks.com/how-webrtcs-neteq-jitter-buffer-provides-smooth-audio/

Contributes to mdn/mdn#384

Related docs work can be tracked in #40478

Removals (not in BCD): averageRtcpInterval, firCount, lastPacketReceivedTimestamp, packetsDuplicated, packetsFailedDecryption, perDscpPacketsReceived, pliCount, receiverId, sliCount,

Copy link
Contributor

github-actions bot commented Jul 22, 2025

Preview URLs (47 pages)
Flaws (7)

Note! 42 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/API/RTCInboundRtpStreamStats
Title: RTCInboundRtpStreamStats
Flaw count: 1

  • macros:
    • Can't resolve /en-US/docs/Web/API/RTCAudioPlayoutStats

URL: /en-US/docs/Web/API/RTCInboundRtpStreamStats/playoutId
Title: RTCInboundRtpStreamStats: playoutId property
Flaw count: 2

  • macros:
    • Can't resolve /en-US/docs/Web/API/RTCAudioPlayoutStats/id
    • Can't resolve /en-US/docs/Web/API/RTCAudioPlayoutStats

URL: /en-US/docs/Web/API/RTCInboundRtpStreamStats/qpSum
Title: RTCInboundRtpStreamStats: qpSum property
Flaw count: 2

  • macros:
    • Can't resolve /en-US/docs/Web/API/RTCReceivedRtpStreamStats/framesDecoded
    • Can't resolve /en-US/docs/Web/API/RTCSentRtpStreamStats/framesEncoded

URL: /en-US/docs/Web/API/RTCInboundRtpStreamStats/totalInterFrameDelay
Title: RTCInboundRtpStreamStats: totalInterFrameDelay property
Flaw count: 1

  • macros:
    • Can't resolve /en-US/docs/Web/API/RTCInboundRtpStreamStats/framesRendered

URL: /en-US/docs/Web/API/RTCInboundRtpStreamStats/totalSquaredInterFrameDelay
Title: RTCInboundRtpStreamStats: totalSquaredInterFrameDelay property
Flaw count: 1

  • macros:
    • Can't resolve /en-US/docs/Web/API/RTCInboundRtpStreamStats/framesRendered
External URLs (12)

URL: /en-US/docs/Glossary/Jitter
Title: Jitter


URL: /en-US/docs/Web/API/RTCInboundRtpStreamStats/audioLevel
Title: RTCInboundRtpStreamStats: audioLevel property


URL: /en-US/docs/Web/API/RTCInboundRtpStreamStats/concealedSamples
Title: RTCInboundRtpStreamStats: concealedSamples property


URL: /en-US/docs/Web/API/RTCInboundRtpStreamStats/concealmentEvents
Title: RTCInboundRtpStreamStats: concealmentEvents property


URL: /en-US/docs/Web/API/RTCInboundRtpStreamStats/estimatedPlayoutTimestamp
Title: RTCInboundRtpStreamStats: estimatedPlayoutTimestamp property


URL: /en-US/docs/Web/API/RTCInboundRtpStreamStats/insertedSamplesForDeceleration
Title: RTCInboundRtpStreamStats: insertedSamplesForDeceleration property


URL: /en-US/docs/Web/API/RTCInboundRtpStreamStats/qpSum
Title: RTCInboundRtpStreamStats: qpSum property


URL: /en-US/docs/Web/API/RTCInboundRtpStreamStats/removedSamplesForAcceleration
Title: RTCInboundRtpStreamStats: removedSamplesForAcceleration property


URL: /en-US/docs/Web/API/RTCInboundRtpStreamStats/silentConcealedSamples
Title: RTCInboundRtpStreamStats: silentConcealedSamples property

(comment last updated: 2025-08-15 01:41:41)

@github-actions github-actions bot added size/l [PR only] 501-1000 LoC changed and removed size/m [PR only] 51-500 LoC changed labels Jul 22, 2025
@hamishwillee hamishwillee changed the title Ff142 rtcinboundrtpstreamstats fixes Ff142 RTCInboundRtpStreamStats fixes Jul 22, 2025
@hamishwillee hamishwillee removed the size/l [PR only] 501-1000 LoC changed label Jul 22, 2025
@github-actions github-actions bot added the size/l [PR only] 501-1000 LoC changed label Jul 22, 2025
@hamishwillee hamishwillee force-pushed the ff142_rtcinboundrtpstreamstats_fixes branch from 51a0ae6 to c05ddd2 Compare July 25, 2025 06:20
@github-actions github-actions bot added size/xl [PR only] >1000 LoC changed and removed size/l [PR only] 501-1000 LoC changed labels Jul 25, 2025
@hamishwillee hamishwillee force-pushed the ff142_rtcinboundrtpstreamstats_fixes branch from 11836de to 253ee5f Compare July 29, 2025 07:17
@github-actions github-actions bot added Content:Glossary Glossary entries merge conflicts 🚧 [PR only] labels Jul 29, 2025
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@hamishwillee hamishwillee force-pushed the ff142_rtcinboundrtpstreamstats_fixes branch from 7b68da0 to c326b31 Compare August 4, 2025 02:38
@github-actions github-actions bot removed the merge conflicts 🚧 [PR only] label Aug 4, 2025
Comment on lines +17 to +19
Speeding up or slowing down the audio (as tracked with {{domxref("RTCInboundRtpStreamStats.insertedSamplesForDeceleration","insertedSamplesForDeceleration")}}) may result in audible warbling or other distortion.
The totals at the end of the call also give you some indication of how many samples or seconds were impacted, and `removedSamplesForAcceleration` can be correlated with {{domxref("RTCInboundRtpStreamStats/totalSamplesReceived","totalSamplesReceived")}} to get a relative measure of acceleration.
Logging `insertedSamplesForDeceleration` and `removedSamplesForAcceleration` in timeslices can be helpful for isolating the times at which the problem occurred and you can then correlate other metrics in the same timeslice to determine likely causes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a hard one to get info about. The information here comes from the discussion in w3c/webrtc-stats#809 (comment) - it is duplicated in the decel. property.

@hamishwillee hamishwillee marked this pull request as ready for review August 4, 2025 06:02
@hamishwillee hamishwillee requested review from a team as code owners August 4, 2025 06:02
@hamishwillee hamishwillee requested review from sideshowbarker and wbamberg and removed request for a team August 4, 2025 06:02
@hamishwillee hamishwillee force-pushed the ff142_rtcinboundrtpstreamstats_fixes branch from ab64e7d to 5ad7997 Compare August 10, 2025 23:21
@hamishwillee
Copy link
Collaborator Author

@wbamberg Would be great to get a review when you have time. I'm away for a few weeks after next week so hoping to have it ready before then.

@sideshowbarker sideshowbarker removed request for a team and sideshowbarker August 11, 2025 18:29
@wbamberg
Copy link
Collaborator

@wbamberg Would be great to get a review when you have time. I'm away for a few weeks after next week so hoping to have it ready before then.

Sorry, looking now.

Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a few little comments, but since I'll be away for the rest of this week, and I think you're away after the end of the week, I'll approve this so you can merge after making the updates, assuming you think they are worth doing. I think most of them should be pretty clear cut.

@hamishwillee
Copy link
Collaborator Author

Thanks very much for the review and approval @wbamberg - appreciate how "not fun" it is. All the suggestions made sense and have been integrated.

On the plus side, the stats todo list is starting to look a little less horrible mdn/mdn#384 (comment)

@hamishwillee hamishwillee merged commit 9dd28ca into mdn:main Aug 15, 2025
8 checks passed
estelle pushed a commit that referenced this pull request Aug 19, 2025
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Glossary Glossary entries Content:WebAPI Web API docs size/xl [PR only] >1000 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants