What does the expected packet loss option in libopus (ffmpeg) actually do to the encoded file?

1

I am encoding some files into the opus format in ffmpeg using the VoIP application setting (this is for research).

One of the parameters you can set is Expected Packet Loss (%). I understand the principles behind packet loss, however, I can't work out what this setting actually does to the resulting file, as there is no transmission taking place.

Any insight would be appreciated.

Ling979

Posted 2017-08-14T11:17:35.617

Reputation: 13

Answers

1

The more packet loss you specify, the more redunant data is encoded in the file to be able to cope with it.

http://blogs.asterisk.org/2017/04/12/asterisk-opus-packet-loss-fec/

As mentioned FEC, is added in-band by an Opus encoder, but only after being configured to do so. A previous post already discusses all the available options you can set on the encoder, so be sure to check that out if you haven’t already. Here though we’ll discuss some of those options and how they work in combination to make it so the encoder includes FEC data. As stated in the Opus FAQ several conditions must be met before the encoder will add error correction to frames:

  • The feature must be enabled. The “fec” option must be set for a defined format (note, options for codec Opus for Asterisk can be set in in codecs.conf ). This option defaults to “no”, so if you don’t specifically enable it Asterisk will not include FEC data when encoding.
  • The encoder must be told to expect loss. This means an estimated packet loss percentage must also be specified. Setting this shifts the threshold at which the encoder will start to include FEC data. The higher the number the lower the threshold.
  • The codec must be operating in a mode conducive to lower bandwidths. Make sure the maximum bandwidth is set to narrow or medium. This can be achieved by adjusting the “max_bandwidth” option. You can do this either directly by setting the option itself, or indirectly by setting the “max_playback_rate” option to 16khz or less.

Don’t forget to make sure both sides have negotiated for FEC. If everything is properly set up, but one side does not offer FEC (“useinbandfec=yes“) then it will not be enabled.

Magnus

Posted 2017-08-14T11:17:35.617

Reputation: 1 548