Intent to Prototype: MediaStreamTrack Stats (Audio)

383 views
Skip to first unread message

Henrik Boström

unread,
Nov 13, 2023, 10:04:31 AM11/13/23
to blink-dev, Harald Alvestrand, Olga Sharonova
Contact emails

Specification
https://w3c.github.io/mediacapture-extensions/#the-mediastreamtrackaudiostats-interface

Summary

The `track.stats` API allows an application to measure quality related to the capturing of a MediaStreamTrack (getUserMedia). This API has already shipped for video tracks (Chrome Status, Intent to Ship). This intent relates to the audio version of the same API, which has similar metrics plus input latency metrics.


The spec is actively under development. It currently contains frame counters (like the video counterpart) which in the audio case allows calculating ratio of dropped audio which is a measure of capture glitches. There is also a PR in review which will add current input latency and a follow-up issue to add min/max/avg latency.

Blink component
Blink>GetUserMedia

Motivation
The motivation is similar to that of video stats, but this time it is audio related.

Quality measurements are important to understand user reports that app gets (e.g. in Google Meet, users may file bugs containing quality dumps) and A/B experiments to understand how features impact quality (e.g. adding heavy video processing in an app may impact audio quality). Latency may be useful for audio processing. Together with WebRTC metrics, capture metrics help provide context as to which parts of the pipeline are contributing to quality in what way.


TAG review status
N/A small addition to existing spec and the `track.stats` API shape has already shipped for video.

Risks
Interoperability and Compatibility

Risk is relatively small since this is a stats API. The MediaStreamTrack functions whether or not you can measure quality related properties of the track.


Gecko: No signal
WebKit: No signal
Web developers: Positive
Other signals:

WebView application risks

None



Debuggability

None


Is this feature fully tested by web-platform-tests?
Test coverage will be added as part of implementation, including which metrics are supported by the browser. In addition to WPTs, correctness of quality metrics may require browser tests e.g. for fake devices.

Link to entry on the Chrome Platform Status

Yoav Weiss

unread,
Nov 14, 2023, 2:12:41 AM11/14/23
to Henrik Boström, blink-dev, Harald Alvestrand, Olga Sharonova
On Mon, Nov 13, 2023 at 4:04 PM Henrik Boström <hb...@chromium.org> wrote:
Contact emails

Specification
https://w3c.github.io/mediacapture-extensions/#the-mediastreamtrackaudiostats-interface

Summary

The `track.stats` API allows an application to measure quality related to the capturing of a MediaStreamTrack (getUserMedia). This API has already shipped for video tracks (Chrome Status, Intent to Ship). This intent relates to the audio version of the same API, which has similar metrics plus input latency metrics.


The spec is actively under development. It currently contains frame counters (like the video counterpart) which in the audio case allows calculating ratio of dropped audio which is a measure of capture glitches. There is also a PR in review which will add current input latency and a follow-up issue to add min/max/avg latency.

Blink component
Blink>GetUserMedia

Motivation
The motivation is similar to that of video stats, but this time it is audio related.

Quality measurements are important to understand user reports that app gets (e.g. in Google Meet, users may file bugs containing quality dumps) and A/B experiments to understand how features impact quality (e.g. adding heavy video processing in an app may impact audio quality). Latency may be useful for audio processing. Together with WebRTC metrics, capture metrics help provide context as to which parts of the pipeline are contributing to quality in what way.


TAG review status
N/A small addition to existing spec and the `track.stats` API shape has already shipped for video.

Risks
Interoperability and Compatibility

Risk is relatively small since this is a stats API. The MediaStreamTrack functions whether or not you can measure quality related properties of the track.


Gecko: No signal
WebKit: No signal

Have we reached out?
 
Web developers: Positive

Any links?
 
Other signals:

WebView application risks

None



Debuggability

None


Is this feature fully tested by web-platform-tests?
Test coverage will be added as part of implementation, including which metrics are supported by the browser. In addition to WPTs, correctness of quality metrics may require browser tests e.g. for fake devices.

Link to entry on the Chrome Platform Status

--
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/bb6c1af3-9eb3-4c6f-a136-dee709b7f906n%40chromium.org.

Henrik Boström

unread,
Nov 14, 2023, 3:57:40 AM11/14/23
to blink-dev, Yoav Weiss, blink-dev, Harald Alvestrand, Olga Sharonova, Henrik Boström
On Tuesday, November 14, 2023 at 8:12:41 AM UTC+1 Yoav Weiss wrote:
On Mon, Nov 13, 2023 at 4:04 PM Henrik Boström <hb...@chromium.org> wrote:

Specification
https://w3c.github.io/mediacapture-extensions/#the-mediastreamtrackaudiostats-interface

Summary

The `track.stats` API allows an application to measure quality related to the capturing of a MediaStreamTrack (getUserMedia). This API has already shipped for video tracks (Chrome Status, Intent to Ship). This intent relates to the audio version of the same API, which has similar metrics plus input latency metrics.


The spec is actively under development. It currently contains frame counters (like the video counterpart) which in the audio case allows calculating ratio of dropped audio which is a measure of capture glitches. There is also a PR in review which will add current input latency and a follow-up issue to add min/max/avg latency.

Blink component
Blink>GetUserMedia

Motivation
The motivation is similar to that of video stats, but this time it is audio related.

Quality measurements are important to understand user reports that app gets (e.g. in Google Meet, users may file bugs containing quality dumps) and A/B experiments to understand how features impact quality (e.g. adding heavy video processing in an app may impact audio quality). Latency may be useful for audio processing. Together with WebRTC metrics, capture metrics help provide context as to which parts of the pipeline are contributing to quality in what way.


TAG review status
N/A small addition to existing spec and the `track.stats` API shape has already shipped for video.

Risks
Interoperability and Compatibility

Risk is relatively small since this is a stats API. The MediaStreamTrack functions whether or not you can measure quality related properties of the track.


Gecko: No signal
WebKit: No signal

Have we reached out?

The spec is still being worked on and I have not officially reached out, but representatives from both Mozilla and Apple are part of the WG discussions.
On the video stats side (same API shape but not the same metrics), Mozilla was positive and Apple was unresponsive.

At the moment, there is a disagreement about whether or not frame dropping is worth measuring but we are in agreement - at least Google and Mozilla - that capture input latency is something we want to have, but the PR needs more work to get the definition right before it can be merged. This sends both positive and negative signals, but I do not have an official statement yet.
 
 
Web developers: Positive

Any links?

I don't have any links but I've been told that web developers have been "asking for input latency metrics for years".
On behalf of Google, Google Meet web developers are asking for both dropped frames ratio metrics and input latency metrics, so I am developing these PRs together with the WebRTC audio experts who requested them.

 
Other signals:

WebView application risks

None



Debuggability

None


Is this feature fully tested by web-platform-tests?
Test coverage will be added as part of implementation, including which metrics are supported by the browser. In addition to WPTs, correctness of quality metrics may require browser tests e.g. for fake devices.

Link to entry on the Chrome Platform Status

--
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+unsubscribe@chromium.org.

Philipp Hancke

unread,
Nov 15, 2023, 6:14:16 AM11/15/23
to Henrik Boström, blink-dev, Yoav Weiss, Harald Alvestrand, Olga Sharonova, Philipp Hancke
[snip]
 
Web developers: Positive

Any links?

I don't have any links but I've been told that web developers have been "asking for input latency metrics for years".
On behalf of Google, Google Meet web developers are asking for both dropped frames ratio metrics and input latency metrics, so I am developing these PRs together with the WebRTC audio experts who requested them.

I've asked my Microsoft Teams Web audio folks and they look forward  to being able to measure capture glitches this way.
Nobody likes audio glitches and I hope this will help reduce them and/or identifying devices which are more prone.

Michael Fröhlich

unread,
Nov 15, 2023, 10:50:19 AM11/15/23
to blink-dev, philipp...@googlemail.com, blink-dev, yoav...@chromium.org, Harald Alvestrand, ol...@chromium.org, Philipp Hancke, Henrik Boström
We (GoTo) would also be interested in have dropped frame counts as well as input latency counts. Thanks for adding this.

Michael Hagar

unread,
Nov 16, 2023, 11:39:27 AM11/16/23
to blink-dev, Michael Fröhlich, philipp...@googlemail.com, blink-dev, yoav...@chromium.org, Harald Alvestrand, ol...@chromium.org, Philipp Hancke, Henrik Boström
Zoom is interested in this as well - it is critical for us to understand where in our audio pipeline that frames have been dropped.

Would this be supported for audio tracks in all MediaStream contexts, or just the stream obtained via `getUserMedia`? In particular, I would love if we could also get these statistics for audio tracks on a stream obtained via WebAudio's `createMediaStreamDestination` (https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createMediaStreamDestination).

Henrik Boström

unread,
Nov 17, 2023, 5:16:56 AM11/17/23
to blink-dev, michae...@zoom.us, michael....@logmein.com, philipp...@googlemail.com, blink-dev, Yoav Weiss, Harald Alvestrand, Olga Sharonova, Philipp Hancke, Henrik Boström
Thanks for the feedback from developers.

On Thursday, November 16, 2023 at 5:39:27 PM UTC+1 michae...@zoom.us wrote:
Zoom is interested in this as well - it is critical for us to understand where in our audio pipeline that frames have been dropped.

Would this be supported for audio tracks in all MediaStream contexts, or just the stream obtained via `getUserMedia`? In particular, I would love if we could also get these statistics for audio tracks on a stream obtained via WebAudio's `createMediaStreamDestination` (https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createMediaStreamDestination).

The audio stats API is currently only specified for getUserMedia() sourced tracks. It might be worth discussing stats for more tracks in the future once the spec and implementation is stable (I personally thought about getDisplayMedia() as well, which we support in the video stats case), but we're currently keeping the scope limited to reduce complexity.
Reply all
Reply to author
Forward
0 new messages