webrtc-stats
webrtc-stats copied to clipboard
framesEncoded exists only for video?
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?
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).
agree with the suggestion made by @alvestrand