webrtc-stats icon indicating copy to clipboard operation
webrtc-stats copied to clipboard

Adding SVC-related stats fields

Open aboba opened this issue 2 years ago • 2 comments

Transferred from https://github.com/w3c/webrtc-svc/issues/72

It would be nice to have SVC-related fields in WebRTC stats.

For example, adding the DOMString scalabilityMode field of RTCOutboundRtpStreamStats to indicate which scalability mode is used by the current encoding would be helpful for debugging SVC-related issues.

aboba avatar Sep 08 '22 03:09 aboba

There was an earlier attempt to add SVC to stats which never landed, the reason for closing was that the SVC APIs had not been fleshed out yet so adding stats was a bit premature (or at least that was argued): https://github.com/w3c/webrtc-stats/pull/559/files

I'm happy to add SVC stats, but what is the status on SVC APIs?

henbos avatar Sep 08 '22 08:09 henbos

modulo where this resides, I think adding the scalability mode is non-controversial. The SVC-layer stats were a bit more ambiguous, if someone has implementation expereience, reviewing the open PR #559 would be helpful.

vr000m avatar Oct 04 '22 10:10 vr000m

In my opinion, per-layer (spatial or temporal) stats require a lot of work. Let's start with the simplest one.

For example, how about adding three fields to RTCOutboundRTPStreamStats?

spatialLayerCount: For SVC, returns the number of spatial layers configured. Returns 1 for simulcast or unicast. temporalLayerCount: Returns the number of configured temporal layers. (We can mix simulcast and temporal scalability in VP8 or H.264.) spatialLayerActiveCount: For SVC, returns the number of spatial layers currently in use. May be less than spatialLayerCount due to bandwidth limitations. Returns 1 for simulcast or unicast.

I don't know if it is possible to change the number of temporary layers at runtime.

https://webrtc-review.googlesource.com/c/src/+/285420 is a prototype implementation in libwebrtc.

bc-lee avatar Nov 29 '22 07:11 bc-lee

I think for starter, we should expose the same string that is used in get/setParameters() and in fact I think a lot of other properties can be deducted from there (see diagrams).

We might want to expose other metrics too, but this one seem like powerful and low hanging. Evan has a CL in review that we could land pretty soon if this PR gets approved

henbos avatar Nov 29 '22 09:11 henbos

Yes, it was only after I wrote the comment and uploaded my CL that I realized that there is a similar CL. I'll wait for the changes to RTCOutboundRtpStreamStats.scalabilityMode to be merged.

bc-lee avatar Nov 29 '22 09:11 bc-lee