Amit Chowdhary
2014-May-13 05:36 UTC
[opus] How frequently should Opus Control Parameters be modified?
I am using Opus in a mobile VoIP client. I don?t intend to deliver audio beyond wide band but want to ensure the best possible quality even at low bandwidths and high packet loss rates. I am trying to feed RTCP information to opus, that is set its bit-rate and expected packet loss periodically. 1) Any suggestions on how often I should change the bit-rate and expected packet loss, (maybe even lower the audio bandwidth if the bit-rate available is below the sweet-spot for WB)? 2) How is the codec's performance affected every time a control parameter such as bit-rate or audio bandwidth is changed? Would doing this every second or every five seconds be a good idea? Or should this be done rarely? 3) I would also like to know about complexity and what would be a good value on mobile devices. In my understanding a high complexity will add delay (latency) to the codec, will it have any other bad effect? Will this delay be device dependent? I will test these values but getting an estimate of a good value to use on mobile clients would be nice. Thanks, Amit -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/opus/attachments/20140513/30672008/attachment.htm
Jean-Marc Valin
2014-May-13 06:58 UTC
[opus] How frequently should Opus Control Parameters be modified?
On 13/05/14 01:36 AM, Amit Chowdhary wrote:> 1) Any suggestions on how often I should change the bit-rate and > expected packet loss, (maybe even lower the audio bandwidth if the > bit-rate available is below the sweet-spot for WB)? > > 2) How is the codec's performance affected every time a control parameter > such as bit-rate or audio bandwidth is changed? > Would doing this every second or every five seconds be a good idea? > Or should this be done rarely?Opus is designed such that all its parameters can be changed on a frame-by-frame basis without causing transition artefacts. Whenever the available bitrate changes, just update the bitrate you ask for. However, it is *not* recommended to change the bandwidth manually, since the Opus encoder already has code to automatically adjust the bandwidth based on the bitrate available. In practice, the main parameters you may want to change at run-time are the bit-rate and the expected percentage of packet loss (and even for that one, a static value is usually fine if you don't have a good estimate).> 3) I would also like to know about complexity and what would be a good > value on mobile devices. In my understanding a high complexity will add > delay (latency) to the codec, will it have any other bad effect? > Will this delay be device dependent? I will test these values but getting > an estimate of a good value to use on mobile clients would be nice.Changing the complexity only affects the amount of CPU required for encoding. It does not change the delay of the codec unless the CPU is really slow. Just go with whatever complexity you can afford in your situation. Jean-Marc
Amit Chowdhary
2014-May-13 07:13 UTC
[opus] How frequently should Opus Control Parameters be modified?
Thanks a lot Jean for the elaborate and quick reply :) Amit On May 13, 2014, at 12:28 PM, Jean-Marc Valin <jmvalin at jmvalin.ca> wrote:> On 13/05/14 01:36 AM, Amit Chowdhary wrote: >> 1) Any suggestions on how often I should change the bit-rate and >> expected packet loss, (maybe even lower the audio bandwidth if the >> bit-rate available is below the sweet-spot for WB)? >> >> 2) How is the codec's performance affected every time a control parameter >> such as bit-rate or audio bandwidth is changed? >> Would doing this every second or every five seconds be a good idea? >> Or should this be done rarely? > > Opus is designed such that all its parameters can be changed on a > frame-by-frame basis without causing transition artefacts. Whenever the > available bitrate changes, just update the bitrate you ask for. However, > it is *not* recommended to change the bandwidth manually, since the Opus > encoder already has code to automatically adjust the bandwidth based on > the bitrate available. In practice, the main parameters you may want to > change at run-time are the bit-rate and the expected percentage of > packet loss (and even for that one, a static value is usually fine if > you don't have a good estimate). > >> 3) I would also like to know about complexity and what would be a good >> value on mobile devices. In my understanding a high complexity will add >> delay (latency) to the codec, will it have any other bad effect? >> Will this delay be device dependent? I will test these values but getting >> an estimate of a good value to use on mobile clients would be nice. > > Changing the complexity only affects the amount of CPU required for > encoding. It does not change the delay of the codec unless the CPU is > really slow. Just go with whatever complexity you can afford in your > situation. > > Jean-Marc