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

Add stat to reflect the redundancy of FEC/RED data

Open minyuel opened this issue 7 years ago • 12 comments

It would be good to add receiver stats on how much/often FEC/RED data is received but not needed (since the data they try to protect are received)

minyuel avatar Aug 28 '17 13:08 minyuel

I think one can calculate the overhead of the FEC by comparing the FlexFEC track with the associated media tracks. packetsRepaired: tells you how many packets were repaired due to FEC.

There are several corner cases where the packetsSent > packetsReceived + packetsRepaired and not be equal. In those cases, either the FEC structure/XOR scheme was not tailored for the expected loss pattern, example, burst loss higher than expected.

vr000m avatar Aug 30 '17 08:08 vr000m

Thanks for the reply! Two questions:

  1. Which FlexFEC track did you refer to?
  2. How about non-flex FEC, like Opus inband FEC?

minyuel avatar Aug 30 '17 08:08 minyuel

https://tools.ietf.org/html/draft-ietf-payload-flexible-fec-scheme, we are going to push out a -06 version and I believe the one implemented in chrome is -03 version.

Isn't the in-band FEC for opus with every packet (i.e., it recovers a solitary packet loss)? AFAICT, this is not controlled from the application. If we could be control it from the application, it would make a lot of sense to measure it.

vr000m avatar Sep 07 '17 18:09 vr000m

I would be in favor of measuring it regardless of if it can be controlled by the application since it provides an indication of the quality of the rest of the audio stream. Also, I do believe the application can turn on or off in band FEC when using opus if it is giving a worse experience.

icydragons avatar Nov 22 '17 17:11 icydragons

@minyuel is on leave, expected back end of February.

alvestrand avatar Jan 03 '18 14:01 alvestrand

This might simply be asking for a "FEC packets received" counter.

alvestrand avatar Jan 03 '18 14:01 alvestrand

For in-band FEC, would fecPacketsReceived be enough? because we already have packetsRepaired. Maybe a corresponding fecPacketsSent

vr000m avatar Jan 03 '18 14:01 vr000m

@icydragons If this is a FEC packets sent/received we can create a PR.

henbos avatar Jan 03 '18 14:01 henbos

Hi,

Sorry for this late reply. I missed the earlier discussion until Harald brought this up again.

I would like to add a few comments.

  1. In my opinion, to measure both necessity and sufficiency of FEC, we may need "Fraction of audio that is recovered from FEC" and "Fraction of FEC that is received but unused". Both of these have been implemented (but not standardized) in WebRTC: googSecondaryDecodedRate and googSecondaryDiscardedRate, respectively.

  2. inband FEC of Opus is not on every packet. It is sent rather opportunistically. To quote "Packets that are determined to contain perceptually important speech information, such as onsets or transients, are encoded again at a lower bitrate and this re-encoded information is added to a subsequent packet."

  3. So far, application can turn on/off FEC by SDP, but cannot control the degree of FEC, which is supposed to be adaptive to the network conditions.

minyuel avatar Jan 04 '18 12:01 minyuel

@minyuel Assuming we add fecPacketsSent/Received, wouldn't the counters packetsReceived, packetsLost, packetsRepaired, and fecPacketsReceived help with calculating the rates in 1?

vr000m avatar Jan 10 '18 15:01 vr000m

@henbos to ping @minyuel to figure out if we've added enough stuff to close the bug.

alvestrand avatar May 16 '18 13:05 alvestrand

@balazskreith PTAL

vr000m avatar May 16 '18 13:05 vr000m