PSA: Changes to RTP stats object lifetimes in getStats(), e.g. "inbound-rtp" now appearing after first packet is received

56 views
Skip to first unread message

Henrik Boström

unread,
Sep 1, 2025, 5:14:23 AMSep 1
to discuss-webrtc
Hello,

If you don't care about getStats() you can stop reading.

But if you do, then as of M141 there will be some changes as to when RTP stats objects appear in the getStats() report. The motivation for the change is to reduce the gap between browser implementations and to make chromium's implementation spec-compliant, see the Intent to Ship thread for more details.

In summary:

The most significant change is that "inbound-rtp" stats objects are created when the first packet is received for the SSRC, not then the SDP is set. Prior to this change, this stats object would be created when the SDP is set if the SSRC was signaled in the SDP, i.e. even if no packets have yet to be received. For use cases where the SSRC is not signalled though, this is a no-change in behavior.

For senders, "outbound-rtp" stats objects were previously created slightly too early, prior to the O/A negotiation completing. Now they are created when the SDP answer is set. Unlike the inbound case, the "outbound-rtp" stats object is not dependent on packet transmission, i.e you get one "outbound-rtp" per encoding that was negotiated even if no packets have been sent yet.

This decouples stats consumption from SSRC signaling, but it does mean that if you need to know the SSRC prior to receiving packets you'll have to examine the SDP rather than poll getStats().

Link One Group

unread,
Sep 2, 2025, 12:58:24 PMSep 2
to discuss...@googlegroups.com
Sounds like it should always have been that way. Funny because I'm currently determining what you've just determined. 

--
This list falls under the WebRTC Code of Conduct - https://webrtc.org/support/code-of-conduct.
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/discuss-webrtc/5500faf9-a518-4a2b-ac9f-3e6a682972b3n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages