Opus Recommended Settings: Difference between revisions

From XiphWiki
Jump to navigation Jump to search
m (expand VoIP range to cover narrowband bitrates, link to detailed table)
m (→‎Usage Table: get rid of our copy of the HA table, but keep link to it.)
Line 110: Line 110:
|}
|}


== Usage Table ==
The '''[http://wiki.hydrogenaud.io/index.php?title=Opus HydrogenAudio]''' wiki also has some great information on Opus and its usage.
The following table has '''rough''' guidelines to help you get your required quality, file size or latency. The table is originally taken from the '''[http://wiki.hydrogenaud.io/index.php?title=Opus HydrogenAudio]''' wiki, which has some great information on Opus and its usage.
 
{| class="wikitable" style="text-align:center"
|-
!Bitrate target
!Music quality notes
!Use cases/notes/competitive codecs
|-
!6 kbps
|Poor, muffled sound but intelligible lyrics.
| -
|-
!8 kbps
|Poor, muffled but OK for bitrate
| -
|-
!14 to 16 kbps
|Fairly Poor but OK for bitrate
|Perhaps acceptable for incidental music
|-
!22 to 24 kbps
|Fair but OK for bitrate
|OK for incidental music
|-
!32 kbps
|Moderately good mono, reasonably bright treble (c.f. mono cassette)
|Good for podcasts, audiobooks, CELT-only poss for music. Competitor HE-AAC@32kbps is stereo full-band but with annoying artifacts.
|-
!36 to 40 kbps
|Moderately good stereo, reasonably bright treble (c.f. stereo cassette)
|Stereo podcasts, audiobooks, very low bitrate music
|-
!48 kbps
|Full bandwidth stereo music, some artifacts, rarely nasty
|Stereo podcasts, audiobooks, low bitrate music
|-
!64 kbps
|Full bandwidth stereo music, nice sound, detectable differences to original (mostly 'not annoying')
|Music storage & streaming. Beat HE-AAC, Vorbis, MP3 in [http://people.xiph.org/~greg/opus/ha2011/ listening test]
|-
!96 kbps
|Full bandwidth stereo music, good quality approaching transparency
|Music storage & high quality streaming. Beat LC-AAC, Vorbis, MP3 in [http://listening-test.coresv.net/results.htm listening test]
|-
!112 kbps
|Fairly close to transparency (needs more testing)
|Music storage & high quality streaming. Very low-latency stereo networked music performance/jam sessions at OK quality (see below table)
|-
!128 kbps
|Very close to transparency (needs more testing). Most modern codecs competitive (AAC-LC, Vorbis, MP3)
|Music storage & streaming. Future download music sales.
|-
!256 kbps
|Transparent with very low chance of artifacts (a few killer samples still detectable). Most old & new lossy codecs competitive.
|Music storage & streaming, dedicated limited-bandwidth audio links (e.g. wireless, [http://en.wikipedia.org/wiki/Bluetooth_profile#Advanced_Audio_Distribution_Profile_.28A2DP.29 A2DP-bluetooth] type links).
|-
!510 kbps
|Maximum possible stereo bitrate target (actual rate often less than 510 for default frame size). At these bitrates, you probably want to be using [[FLAC]]...
|Music storage, dedicated limited-bitrate audio links (e.g. wireless, minimum latency high quality audio. LossyWAV and WavPack lossy are very competitive for storage, and WavPack lossy --blocksize=256 may be competitive with minimum latency mode also.
|-
!>510 kbps
|Above Opus bitrate range allowed for stereo sources.
|Settle for 510kbps or use [[FLAC]].
|-
|}

Revision as of 17:29, 27 June 2016

Depending on what kinds of sounds you want to encode with Opus, you should use different bitrate (quality) settings.

The settings in the table below are meant to start you off with a decent tradeoff between good quality and small filesize (or bitrate usage, if you're streaming).

You should test the suggested bitrate by actually listening to your encoded audio and then tweaking the bitrate:

  • down if you think the quality is good, but the filesize (or bitrate) is too big
  • up if you think the quality is bad, and you can afford having bigger files (or bitrate)
Use Case Channels Bitrate (Kb/s) Notes
Ham radio 1 (mono) use Codec 2 Opus only supports bitrates down to 6 Kb/s.
VoIP 1 10-24 10 Kb/s will deliver narrowband most of the time, 24 Kb/s should give fullband.
More details in the relevant table further down this page.
Audiobooks / Podcasts 1 24 bitrates from here on up tend to deliver fullband audio.
2 (stereo) 32
Music Streaming / Radio 2 64-92
Music Storage 2 92-128 Opus at 128 KB/s (VBR) is pretty much transparent
6 (5.1 surround) 128-256 for surround sound, Opus uses surround-sound bitrate allocation
8 (7.1 surround) 256-450
Music Archiving any use FLAC if you are archiving audio, use a lossless audio format to prevent generation loss

Technical Details

For the more technical Opus users, here are some details to help you fine-tune your decision on which bitrate best fits your needs.

Mono or Stereo

Opus tends to start downmixing stereo inputs to mono from roughly 30 Kb/s and lower. You can check the details in the opus_encoder.c source file.

You can force downmixing at any bitrate by using the following command-line parameters:

--downmix-mono - downmixes input channels to mono

--downmix-stereo - downmixes input channels to stereo (if there are more than 2 e.g. if your input is surround sound)

Bandwidth Transition Thresholds

The following table shows where Opus decides to switch between its different audio frequency bandwidths. This could be useful if you are encoding audio that has already been bandpassed, or should go through a bandpass filter (e.g. VoIP speech).

The table was copied from the opus_encoder.c source file.

(bitrates in Kb/s) Mono Stereo
Voice Music Voice Music
NBMB 11 ± 1 12 ± 1 11 ± 1 12 ± 2
MB ↔ WB 14 ± 1 15 ± 1 14 ± 2 18 ± 2
WB ↔ SWB 17 ± 1 18 ± 1 21 ± 2 21 ± 2
SWB ↔ FB 21 ± 1 22 ± 2 28 ± 2 30 ± 2

The HydrogenAudio wiki also has some great information on Opus and its usage.