Difference between revisions of "Recommended Ogg Vorbis"

From Hydrogenaudio Knowledgebase
Jump to: navigation, search
m (Added link for Channel Coupling and Noise Normalization)
(bitrate at q-1)
Line 88: Line 88:
 
| -q -2 || ~32 || ~32 - ~64 || yes || yes || (1)
 
| -q -2 || ~32 || ~32 - ~64 || yes || yes || (1)
 
|- style="background-color: #cccccc;"
 
|- style="background-color: #cccccc;"
| -q -1 || ~45 || ~45 - ~64 || yes || yes ||  
+
| -q -1 || ~48 || ~48 - ~64 || yes || yes || (2)
 
|-  
 
|-  
 
| -q 0 || ~64 || ~64 - ~80 || yes || yes ||  
 
| -q 0 || ~64 || ~64 - ~80 || yes || yes ||  
 
|- style="background-color: #cccccc;"
 
|- style="background-color: #cccccc;"
| -q 1 || ~80 || ~80 - ~96 || yes || yes || (2)
+
| -q 1 || ~80 || ~80 - ~96 || yes || yes || (3)
 
|-   
 
|-   
 
| -q 2 || ~96 || ~96 - ~112 || yes || yes ||   
 
| -q 2 || ~96 || ~96 - ~112 || yes || yes ||   
Line 100: Line 100:
 
| -q 4 || ~128 || ~128 - ~160 || yes || yes ||  
 
| -q 4 || ~128 || ~128 - ~160 || yes || yes ||  
 
|- style="background-color: #cccccc;"
 
|- style="background-color: #cccccc;"
| -q 5 || ~160 || ~160 - ~192 || yes || yes || (3)   
+
| -q 5 || ~160 || ~160 - ~192 || yes || yes || (4)   
 
|-  
 
|-  
 
| -q 6 || ~192 || ~192 - ~224 || no || yes ||  
 
| -q 6 || ~192 || ~192 - ~224 || no || yes ||  
Line 115: Line 115:
  
 
'' '''(1)''' Only supported on aoTuVb4 and newer ''<br>
 
'' '''(1)''' Only supported on aoTuVb4 and newer ''<br>
'' '''(2)''' Reports seem to indicate that aoTuVb4.51 <font style="color:red;">-q 1.5</font> provides good quality for streaming ''<br>
+
'' '''(2)''' Bitrate of 48 kbit/s is only for aoTuVb4 and newer. Earlier versions and Xiph.org versions use a bitrate of 45 kbit/s ''<br>
'' '''(3)''' Most people agree <font style="color:red;">-q 5</font> achieves transparency''
+
'' '''(3)''' Reports seem to indicate that aoTuVb4.51 <font style="color:red;">-q 1.5</font> provides good quality for streaming ''<br>
 +
'' '''(4)''' Most people agree <font style="color:red;">-q 5</font> achieves transparency''
  
 
=Advanced Encoder Settings=
 
=Advanced Encoder Settings=

Revision as of 13:26, 10 January 2006

Fish logo.png

Vorbis, being a continuously developed standard, improves all the time. Plus, being an open (i.e. patent-free) standard, it has many 'third-parties' that produces, and most of the time, improves, its utilities.

Here you can find some guidelines on which utilities to use, and what settings will provide you with the best quality.


History

(For a highly detailed description of Vorbis history, check out OggZealot's Ogg Vorbis Historic where Monty also adds a few more details too). Ogg Vorbis reached version 1.0 in July 2002. It is the official Xiph.org encoder (the one you get from vorbis.com). HA codec developer, Garf, did his own tunings, based on version 1.0 to produce GT3b1 and GT3b2. Both encoders showed improved pre echo handling for q values of 5 to 10. It was later judged in an internal listening test that GT3b1 was the better of the two. There was a minor bugfix update earlier that year in March, which only appeared in the CVS at Xiph.org. This consisted of very minor bug fixes, which do more to correct odd problems that may occur rather than improving quality, including (garbled noise output and gaps in streams). This was referred to as Post 1.0 CVS. Quality problems that mainly affected low bitrates were later addressed in a new bugfix (1.0.1) that was released.

Post 1.0.1 CVS was released late December 2003 by Monty at Xiph, and includes a true CBR template. In order to simplify the situation where we had two encoders (1.0.1 and GT3b1), OggDropXPd developer John33 merged the sources to give us GT3b2. Once the 128 kbps multiformat test was completed, Aoyumi's aoTuV Vorbis tuning was determined to be the best Vorbis encoder. After the success of aoTuV beta 2 encoder, Xiph.Org merged their tunings into the official CVS branch to produce the long-awaited Vorbis 1.1. Aoyumi's later release of aoTuV beta 4 encoder as of November 2005 significantly improves Vorbis' quality while enhancing the compression. It is now the recommended encoder by 3rd party developers at Hydrogenaudio. Aoyumi's latest is aoTuV beta 4.5 (later bugfixed with aoTuV beta 4.51) released in December 2005, which improves low bit-rate quality even more. However, it is still undergoing peer review before it becomes the recommended encoder. Near the end of 2005, after aoTuV beta 4.51 is released, Xiph.org released Vorbis 1.1.2, which only provides bugfixes to Vorbis 1.1.1 (a merging of Vorbis 1.1 with aoTuV beta 3). So, although this is the 'official' version, it is not recommended.

Note: Xiph.org does not maintain the binaries, but rather provides newest updates and releases to libogg and libvorbis, etc.

Recommended Vorbis Encoders

(adapted from Recommended Encoder and Settings post compiled by QuantumKnot)

Windows binaries

John33's oggenc2.8 is a special version of the Ogg Vorbis encoder. "Features include compression from lossless files (Monkeys Audio, LPAC, FLAC, OptimFROG, WavPack and Shorten - requires presence of decoders), and the ability to specify 'padding' in the headers for subsequent insertion of Tags." (from Ogg Vorbis page at rarewares)

If you prefer a nice drag-and-drop interface, then you can try John33's OggDropXPd (Windows only). "Features include compression from lossless files (Monkey's Audio, LPAC, FLAC and OptimFROG), auto-tagging, renaming of encoded files, setting of advanced encoder parameters, use of VorbisGain tags on decode, Playlist (.m3u) creation, and others." (from Ogg Vorbis page at rarewares)

(work in progress, guide will be completed soon)

Linux binaries

The static GCC 4 binary was compiled by QuantumKnot.

3rd party source code

  • aoTuV Homepage -- contains modified source code written in C and downloads of binaries.

The source-code contains modifications mostly to the psychacoustics model and bitrate allocation, i.e psy.c and bitrate.c

These are other Ogg Vorbis encoders that were tuned by 3rd party developers (outside of Xiph.Org).

aoTuV beta 4 Now the recommended encoder

Developed by Aoyumi and based on libvorbis 1.1.1, many people have reported this encoder to give better quality at low to medium bitrates. It includes a -q -2 option for the lowest bitrate. According to guruboolez' latest listening test on classical music, aoTuV beta 4 performed magnificently well at -q 6!! (see Aoyumi's website for information above)

aoTuV beta 4.51 The latest encoder

Many HydrogenAudio enthusiasts report that this version gives even better quality for low bit-rates. -q 1.5 becomes acceptable, even good enough, and -q 4 is now near-transparent! However, more peer review is needed before this version becomes the recommended encoder.

Optimized binaries

These are highly optimized encoders developed by the Ogg Vorbis Acceleration Project that are much faster than the standard binary builds with negligible to nearly no effects on audio quality, including speed up routines, i.e mdct.c

See Lancer Information and downloads page above.

Note: Output of Lancer may be slightly different from output of 'standard' aoTuV. This is due to the difference of floating-point rounding: Lancer uses 64-bit SSE, while standard aoTuV uses 80-bit FP. This difference, however, should not be audible at all. In fact, tests have proven that playback of Lancer's output is indistinguishable from playback of standard aoTuV output.

Recommended Encoder Settings

Refer to the table below. For best results, start at -q 4 and ABX your way up.
Ultimately, the best -q setting will depend on your specific needs. Feel free to experiment.

General Command Line Usage:

oggenc -q n inputfile.wav  
where n is a number from -1 to 10
e.g. oggenc -q 5 inputfile.wav
Note: Most standard oggenc binaries can input FLACs as well !

It should be noted that Vorbis supports fractional numbers, e.g. 5.50 (or 5,50, depending on where the tool is compiled.)


Switch VBR target
(kbit/s)
VBR range
(kbit/s)
Channel
Coupling
Noise
Normalization
Note
-q -2 ~32 ~32 - ~64 yes yes (1)
-q -1 ~48 ~48 - ~64 yes yes (2)
-q 0 ~64 ~64 - ~80 yes yes
-q 1 ~80 ~80 - ~96 yes yes (3)
-q 2 ~96 ~96 - ~112 yes yes
-q 3 ~112 ~112 - ~128 yes yes
-q 4 ~128 ~128 - ~160 yes yes
-q 5 ~160 ~160 - ~192 yes yes (4)
-q 6 ~192 ~192 - ~224 no yes
-q 7 ~224 ~224 - ~256 no no
-q 8 ~256 ~256 - ~320 no no
-q 9 ~320 ~320 - ~500 no no
-q 10 ~500 ~500 - ~1000 no no


(1) Only supported on aoTuVb4 and newer
(2) Bitrate of 48 kbit/s is only for aoTuVb4 and newer. Earlier versions and Xiph.org versions use a bitrate of 45 kbit/s
(3) Reports seem to indicate that aoTuVb4.51 -q 1.5 provides good quality for streaming
(4) Most people agree -q 5 achieves transparency

Advanced Encoder Settings

Reducing Pre-echo

This is applicable with Vorbis 1.1; it may not be applicable to aoTuVb4 or aoTuVb4.51.

Generally, using the recommended settings above will give the best quality. However, there may be cases where Vorbis 1.1 will fail to reproduce sharp attacks or transients in your music, causing pre echo. In which case, you can use the impulse_noisetune advanced encode switch:

oggenc -q n --advanced-encode-option impulse_noisetune=p inputfile.wav
where p is a number from 0 to -15


Note that the lower the number (toward -15) for impulse_noisetune, the higher the bitrate will fluctuate in passages of music filled with transient attacks (and the final average bitrate may be much higher than the nominal). Therefore, you should try a small value to start off (say -5) and see if you get acceptable quality. If not, tweak it lower.

Reducing noise due to microattacks

This is only valid for some Vorbis encoders that are marked as having impulse_trigger_profile.

There are certain parts of some types of music, called "microattacks", where Vorbis will produce a noise (sort of like a puff of steam), which is due to inaccuracies in the block-switching algorithm. Because the attacks are so fine and close together, Vorbis doesn't switch to short blocks enough which "smears" the reproduction.

By default (with no additional switches), Vorbis selects a different profile for block switching (lower means less switching, higher means higher switching) and the default values are shown in the table below:

Quality Profile   Quality Profile
-1 0 5 2.5
0 1 6 2.7
1 1 7 3
2 1.5 8 3.7
3 2 9 4
4 2 10 4

If you encounter this problem on microattacks, you may try the impulse_trigger_profile advanced encode switch, which will change (increase) the profile to your desired value.

oggenc -q n --advanced-encode-option impulse_trigger_profile=r inputfile.wav
where r is a number from 0 to 4, fractions accepted.


Notes:

  • There is the possibility that relaxed block switching (higher profiles) may cause other quality problems and create suboptimal Vorbis files. So use sparingly and with caution. If in doubt, leave impulse_trigger_profile on default (that is, don't use it at all)
  • Setting the profile too high will make Vorbis switch to short blocks more often, which will lead to higher bitrate fluctuations. So be conservative.
  • This settings has no effect on reducing the level of pre-echo. It can be said to only reduce the likelihood of pre-echo, but the amount of pre-echo is tuned using the impulse_noisetune switch instead.
  • You may try profiles 5 and 6 as substitutes for 3 and 4. Profile 5 and 6 came from 3 and 4 in GT3b2.


You can use both impulse_noisetune and impulse_trigger_profile at the same time, but you will need separate switches, e.g.

oggenc -q n --advanced-encode-option impulse_noisetune=p
  --advanced-encode-option impulse_trigger_profile=r inputfile.wav