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

framesEncoded exists only for video?

Open fippo opened this issue 4 years ago • 2 comments

https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-framesencoded says

Only exists for video

However, https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-totalencodetime does not have that restriction (even though it is missing in Chrome for audio) and we typically say that you can calculate the average by dividing the encodetime by the number of frames. Note that for most audio codecs the number of frames per packet is 1 (speex being one of the few exceptions iirc)

So how does one calculate the average time spent on encoding/decoding for audio?

fippo avatar May 18 '20 16:05 fippo

My read would be to rephrase the text under totalencodetime as "for codecs with frames, such as video, you can divide by....". For audio, I think the natural number to divide by is the number of samples encoded (~= elapsed time).

alvestrand avatar May 19 '20 09:05 alvestrand

agree with the suggestion made by @alvestrand

vr000m avatar Jul 02 '20 09:07 vr000m