From Hydrogenaudio Knowledgebase
Jump to: navigation, search

Developer(s) Xiph.Org Foundation
Release information
Initial release
Stable release 2.88
Preview release
Operating system Windows, Linux
Additional information
Use Encoder
License LGPL

oggenc is the official (Ogg) Vorbis encoder by the Xiph.Org Foundation. It is part of vorbis-tools.

oggenc2 is an enhanced version of oggenc developed by John33. Features compression from lossless files (Monkey's 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.

BlackSword (of the Ogg Vorbis Acceleration Project) has created a highly-optimized version of oggenc2 as part of his Lancer suite.


Most of the time, oggenc may be replaced by oggenc2, as the latter recognizes the former's switches.

If the application that uses oggenc is hard-coded to find "oggenc.exe" (or its equivalent in *nix), you can simply rename "oggenc2.exe" to "oggenc.exe" and overwrite the original "oggenc.exe".

Command-line usage[edit]

Usage: oggenc2 [options] input.wav [...]

 -Q, --quiet          Produce no output to stderr
 -h, --help           Print this help text
 -k, --skeleton       Adds an Ogg Skeleton bitstream
 -r, --raw            Raw mode. Input files are read directly as PCM data
 -F, --raw-format=n   Set format for raw input. Default is 1 for
                      Standard PCM; use 3 for IEEE Float.
 -B, --raw-bits=n     Set bits/sample for raw input. Default is 16,
                      32 assumed for IEEE Float.
 -C, --raw-chan=n     Set number of channels for raw input. Default is 2
 -R, --raw-rate=n     Set samples/sec for raw input. Default is 44100
 --raw-endianness     1 for bigendian, 0 for little (defaults to 0)
 -b, --bitrate        Choose a nominal bitrate to encode at. Attempt
                      to encode at a bitrate averaging this. Takes an
                      argument in kbps. By default, this produces a VBR
                      encoding, equivalent to using -q or --quality.
                      See the --managed option to use a managed bitrate
                      targetting the selected bitrate.
 --managed            Enable the bitrate management engine. This will allow
                      much greater control over the precise bitrate(s) used,
                      but encoding will be much slower. Don't use it unless
                      you have a strong need for detailed control over
                      bitrate, such as for streaming.
 -m, --min-bitrate    Specify a minimum bitrate (in kbps). Useful for
                      encoding for a fixed-size channel.
 -M, --max-bitrate    Specify a maximum bitrate in kbps. Useful for
                      streaming applications.
 --advanced-encode-option option=value
                      Sets an advanced encoder option to the given value.
                      The valid options (and their values) are documented
                      in the man page supplied with this program. They are
                      for advanced users only, and should be used with
 -q, --quality        Specify quality between -2 (low) and 10 (high),
                      instead of specifying a particular bitrate.
                      This is the normal mode of operation.
                      Fractional qualities (e.g. 2.75) are permitted
                      The default quality level is 3.
 --resample n         Resample input data to sampling rate n (Hz)
 -S, --converter      Specify the resampling engine to be used.
                      Options are: 0 (Best), 1 (Medium) & 2 (Fast).
 --downmix            Downmix stereo to mono. Only allowed on stereo
 --scale n            Scale input data to n (n = between 0.00 and 1.00)
 --FLAC-scale n       Scale input data using FLAC Replaygain Tags where:
                      c = 1 to use Title Replaygain value, and
                      c = 2 to use Album Replaygain value.
 -s, --serial         Specify a serial number for the stream. If encoding
                      multiple files, this will be incremented for each
                      stream after the first.
 --discard-comments   Prevents comments in FLAC and Ogg FLAC files from
                      being copied to the output Ogg Vorbis file.
 --ignorelength       Ignore the datalength in wav headers. This will allow
                      support for files > 4GB and STDIN data streams.

 -o, --output=fn      Write file to fn (only valid in single-file mode)
 -n, --names=string   Produce filenames as this string, with %a, %t, %l,
                      %n, %d replaced by artist, title, album, track number,
                      and date, respectively (see below for specifying these).
                      %% gives a literal %.
 -X, --name-remove=s  Remove the specified characters from parameters to the
                      -n format string. Useful to ensure legal filenames.
 -P, --name-replace=s Replace characters removed by --name-remove with the
                      characters specified. If this string is shorter than the
                      --name-remove list or is not specified, the extra
                      characters are just removed.
                      Default settings for the above two arguments are platform
 --utf8               Tells oggenc that the command line parameters date,
                      title, album, artist, genre, and comment are already in
                      UTF8. On windows, this switch applies to file names too.
 -c, --comment=c      Add the given string as an extra comment. This may be
                      used multiple times. The argument should be in the
                      format "tag=value".
 -d, --date           Date for track (usually date of performance)
 -N, --tracknum       Track number for this track
 -t, --title          Title for this track
 -l, --album          Name of album
 -a, --artist         Name of artist
 -G, --genre          Genre of track
 -L, --lyrics         Include lyrics from given file (.srt or .lrc format)
 -Y, --lyrics-language  Sets the language for the lyrics
                      If multiple input files are given, then multiple
                      instances of the previous five arguments will be used,
                      in the order they are given. If fewer titles are
                      specified than files, OggEnc will print a warning, and
                      reuse the final one for the remaining files. If fewer
                      track numbers are given, the remaining files will be
                      unnumbered. For the others, the final tag will be reused
                      for all others without warning (so you can specify a date
                      once, for example, and have it used for all the files)

External links[edit]