libopus


libopus Opus Interactive Audio Codec encoder wrapper.

Requires the presence of the libopus headers and library during configuration. You need to explicitly configure the build with --enable-libopus.

Most libopus options are modelled after the opusenc utility from opus-tools. The following is an option mapping chart describing options supported by the libopus wrapper, and their opusenc-equivalent in parentheses.

'b (bitrate)'

Set the bit rate in bits/s. FFmpeg's 'b' option is expressed in bits/s, while opusenc's 'bitrate' in kilobits/s.

'vbr (vbr, hard-cbr, and cvbr)'

Set VBR mode. The FFmpeg 'vbr' option has the following valid arguments, with the opusenc equivalent options in parentheses:

'off (hard-cbr)'

Use constant bit rate encoding.

'on (vbr)'

Use variable bit rate encoding (the default).

'constrained (cvbr)'

Use constrained variable bit rate encoding.

'compression_level (comp)'

Set encoding algorithm complexity. Valid options are integers in the 0-10 range. 0 gives the fastest encodes but lower quality, while 10 gives the highest quality but slowest encoding. The default is 10.

'frame_duration (framesize)'

Set maximum frame size, or duration of a frame in milliseconds. The argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller frame sizes achieve lower latency but less quality at a given bitrate. Sizes greater than 20ms are only interesting at fairly low bitrates. The default is 20ms.

'packet_loss (expect-loss)'

Set expected packet loss percentage. The default is 0.

'application (N.A.)'

Set intended application type. Valid options are listed below:

'voip'

Favor improved speech intelligibility.

'audio'

Favor faithfulness to the input (the default).

'lowdelay'

Restrict to only the lowest delay modes.

'cutoff (N.A.)'

Set cutoff bandwidth in Hz. The argument must be exactly one of the following: 4000, 6000, 8000, 12000, or 20000, corresponding to narrowband, mediumband, wideband, super wideband, and fullband respectively. The default is 0 (cutoff disabled).

'mapping_family (mapping_family)'

Set channel mapping family to be used by the encoder. The default value of -1 uses mapping family 0 for mono and stereo inputs, and mapping family 1 otherwise. The default also disables the surround masking and LFE bandwidth optimzations in libopus, and requires that the input contains 8 channels or fewer.

Other values include 0 for mono and stereo, 1 for surround sound with masking and LFE bandwidth optimizations, and 255 for independent streams with an unspecified channel layout.

'apply_phase_inv (N.A.) (requires libopus >= 1.2)'

If set to 0, disables the use of phase inversion for intensity stereo, improving the quality of mono downmixes, but slightly reducing normal stereo quality. The default is 1 (phase inversion enabled).