Intent to Ship: MediaStreamTrack Stats

339 views
Skip to first unread message

Henrik Boström

unread,
Oct 9, 2023, 10:16:28 AM10/9/23
to blink-dev, Harald Alvestrand
Contant emails:

Explainer:
This is a small addition to the MediaStreamTrack. The new `track.stats` attribute getter allows a JS app to obtain statistics of a track, which in the case of video refers to frame counters. For example, if you use getUserMedia() to open a camera at a specific frame rate setting, this API lets you know how many frames the camera is actually producing (e.g. frame rate may be lower in low light conditions or higher than the app wants due to HW capabilities) and how many frames, if any, are discarded or dropped by the user agent, which is useful for investigations and experiments (some concrete examples mentioned here).

Spec:
This is an extension spec, owned by the same working group who owns the main spec.

The spec and implementation currently only covers video frames, but similar audio frame counters are being considered for the future as well.

Summary:
Add frame counters to MediaStreamTrack.

Is this feature supported on all six Blink platforms?
Yes.

Measurements
Will add [Measure].

Risks
Compatibility: MediaStreamTrack is supported on all browsers and the new stats API is a read-only statistics API rather than core functionality, so interop risks should be relatively limited.

Signals from other implementers:
- Firefox: positive (request for position)
- Safari: no signal at the time of writing (request for position)

Ergonomics: Used together with MediaStreamTrack and WebRTC (RTCPeerConnection)

Activation: N/A

Web Platform Tests

Philip Jägenstedt

unread,
Oct 11, 2023, 8:49:27 AM10/11/23
to Henrik Boström, blink-dev, Harald Alvestrand
LGTM1, this is a minor addition to an existing API, was discussed in the WG at TPAC, and has a positive standards position from Mozilla.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/029c4aea-9a60-4e9e-bc9c-773cac617454n%40chromium.org.

Mike Taylor

unread,
Oct 11, 2023, 10:08:12 AM10/11/23
to Philip Jägenstedt, Henrik Boström, blink-dev, Harald Alvestrand

Mike Taylor

unread,
Oct 11, 2023, 10:09:32 AM10/11/23
to Philip Jägenstedt, Henrik Boström, blink-dev, Harald Alvestrand

Also, could you please create a chromestatus entry and request the various review gate bits?

Henrik Boström

unread,
Oct 11, 2023, 10:36:56 AM10/11/23
to blink-dev, Mike Taylor, blink-dev, Harald Alvestrand, Philip Jägenstedt, Henrik Boström

Chris Harrelson

unread,
Oct 11, 2023, 11:49:39 AM10/11/23
to Henrik Boström, blink-dev, Mike Taylor, Harald Alvestrand, Philip Jägenstedt, Henrik Boström
Reply all
Reply to author
Forward
0 new messages