Opus Codec Transcoding Support

Opus is an audio codec developed by the IETF that supports constant and variable bitrate encoding from 6 kbit/s to 510 kbit/s and sampling rates from 8 kHz (with 4 kHz bandwidth) to 48 kHz (with 20 kHz bandwidth, where the entire hearing range of the human auditory system can be reproduced). It incorporates technology from both Skype’s speech-oriented SILK codec and Xiph.Org’s low-latency CELT codec. This feature adds the Opus codec as well as support for transrating, transcoding, and pooled transcoding.

Opus can be adjusted seamlessly between high and low bit rates, and transitions internally between linear predictive coding at lower bit rates and transform coding at higher bit rates (as well as a hybrid for a short overlap). Opus has a very low algorithmic delay (26.5 ms by default), which is a necessity for use as part of a low audio latency communication link, which can permit natural conversation, networked music performances, or lip sync at live events. Opus permits trading-off quality or bit rate to achieve an even smaller algorithmic delay, down to 5 ms. Its delay is very low compared to well over 100 ms for popular music formats such as MP3, Ogg Vorbis, and HE-AAC; yet Opus performs very competitively with these formats in terms of quality across bit rates.

Opus Supported Options

Required SDP Parameters:
  • rate — Specifies the sampling frequency. This parameter is mapped to the RTP clock rate in “a=rtpmap”. The range is limited to and must be 48000 Hz.

Optional SDP Parameters:

  • maxplaybackrate — Specifies the maximum output sampling rate in Hz that the receiver is capable of rendering. The range is 8 kHz to 48 kHz; common values are 8, 12, 16, 24, and 48 kHz.
  • sprop-maxcapturerate — Specifies the maximum input sampling rate in Hz that the sender is likely to produce. The Vocallo OCT2224 DSP currently supports only 8000 and 16000 Hz for transcoding. The range is 8 kHz to 48 kHz; common values are 8, 12, 16, 24, and 48 kHz.
  • ptime — Specifies the packetization interval in milliseconds. The DSP supports packetization intervals of 10, 20, 40, 60, 80, and 100 ms. This parameter is mapped to “a=ptime” in the SDP. Possible values are 3, 5, 10, 20, 40, 60, or an arbitrary multiple of Opus frame sizes rounded up to the next full integer value up to a maximum value of 120. The default is 20 ms.
  • maxptime — Specifies the maximum packetization interval allowed. The default is 100 ms.
  • minptime — Specifies the minimum packetization interval allowed. The default is 20 ms.
  • maxaveragebitrate — Specifies the maximum average rate of bits received for a session in bits per second. Although the range is 6000 to 51000, only bit rates of 6000 to 30000 bps are transcodable by the DSP. A media profile configured with a value for maxaveragebitrate greater than 30000 is not transcodable and cannot be added on egress in the codec-policy element.
  • stereo — Specifies whether the decoder receives stereo or mono signals. The possible values are 0 (mono) and 1 (stereo). The default is 0.
  • sprop-stereo — Specifies whether the sender is likely to produce stereo audio. The possible values are 0 (mono) and 1 (stereo). The default is 0.
  • cbr — Specifies whether the decoder uses a constant or a variable bit rate. The possible values are 0 (variable bit rate) and 1 (constant bit rate). The default is 0.
  • useinbandfec — Specifies whether the Opus decoder supports Forward Error Correction (FEC). The possible values are 0 (no) and 1 (yes). The default is 1.
  • usedtx — Specifies whether the Opus decoder utilizes Discontinuous Transmission (DTX). The possible values are 0 (no) and 1 (yes). The default is 0.

The payload type is dynamic for this codec.

Sample media-profile configuration for adding Opus

Parameter Value
name opus
subname WB
media-type audio
payload-type 104
transport RTP/AVP
clock-rate 48000
req-bandwidth 0
frames-per-packet 0
parameters

maxplaybackrate=16000

sprop-maxcapturerate=16000

usedtx=0

average-rate-limit 5000
peak-rate-limit 0
max-burst-size 0
sdp-rate-limit-headroom 0
sdp-bandwidth enabled
police-rate 0
standard-pkt-rate 0

Monitoring and Debugging

CLI commands:
  • The show sipd codecs command is modified to add opus Count.
SNMP:
  • New SNMP OID apSysXCodeOPUSCapacity is added to transcoding utilization statistics as reported in the apSysMgmtGroupTrap. When utilization falls below 80%, the apSysMgmtGroupClearTrap is sent.
  • Opus realm statistic apCodecRealmCountOPUS is added to apCodecRealmStatsEntry.
Alarms:
  • Opus Transcoding Capacity Threshold Alarm — A warning level alarm that doesn't affect health is triggered when the Opus transcoding utilization exceeds 95% of capacity. The alarm is cleared when the Opus transcoding utilization falls below 80% of capacity.