oggenc(1)

๐ŸŒธ oggenc โ€” the Vorbis Tools manual, but make it cute ๐ŸŒธ

okay bestie, sit down, hydrate, because this is the oggenc(1) page from Vorbis Tools and it is a whole personality. it's long, so we're doing it in parts. part 1 is right here. let's go ๐Ÿ’…


โœจ NAME โœจ

oggenc โ€” encode audio into the Ogg Vorbis format ๐ŸŽงโœจ


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

oggenc [ -hrQ ] [ -B raw input sample size ] [ -C raw input number of
channels ] [ -R raw input samplerate ] [ -b nominal bitrate ] [ -m
minimum bitrate ] [ -M maximum bitrate ] [ -q quality ] [ --resample
frequency ] [ --downmix ] [ -s serial ] [ -o output_file ] [ -n pattern
] [ -c extra_comment ] [ -a artist ] [ -t title ] [ -l album ] [ -G
genre ] [ -L lyrics file ] [ -Y language-string ] input_files ...

๐Ÿ’– DESCRIPTION ๐Ÿ’–

so what does oggenc actually do, you ask? it reads audio data in either raw, Wave, or AIFF format and encodes it into an Ogg Vorbis stream. iconic behavior, no notes.

it may also read audio data from FLAC and Ogg FLAC files, but only depending on compile-time options โ€” so that's a "depends how it was built" situation, iykyk. ๐Ÿ™ˆ

if you pass the input file "-", the audio data gets read from stdin, and the Vorbis stream gets written to stdout โ€” unless you use the -o option to redirect the output somewhere else. very "pipes are a lifestyle" of it.

by default, disk files are output to Ogg Vorbis files of the same name, with the extension changed to ".ogg" or ".oga". this naming convention can be overridden by the -o option (when there's one file) or the -n option (when there are several files). and finally โ€” if none of these are available โ€” the output filename will be the input filename with the extension (that part after the final dot) replaced with ogg, so file.wav will become file.ogg. math is math. ๐Ÿงฎโœจ

optionally, lyrics may be embedded in the Ogg file, if Kate support was compiled in. ๐ŸŽค

โš ๏ธ heads up: note that some old players may fail to play streams with more than a single Vorbis stream (the so called "Vorbis I" simple profile). lowkey tragic but that's the lore. ๐Ÿ’€

๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

  • -h, --help โ€” show command help. the classic "help me help you" ๐Ÿ’…
  • -V, --version โ€” show the version number. โœจ
  • -r, --raw โ€” assume the input data is raw little-endian audio data with no header information. if you don't specify other options, it defaults to 44.1kHz stereo 16 bit. the next three options are how you change all that. ๐ŸŽš๏ธ
  • -B n, --raw-bits=n โ€” sets raw mode input sample size in bits. default is 16.
  • -C n, --raw-chan=n โ€” sets raw mode input number of channels. default is 2.
  • -R n, --raw-rate=n โ€” sets raw mode input samplerate. default is 44100.
  • --raw-endianness n โ€” sets raw mode endianness to big endian (1) or little endian (0). default is little endian.
  • --utf8 โ€” tells oggenc that the Vorbis Comments are already encoded as UTF-8. super useful in situations where the shell is using some other encoding. ๐ŸŒˆ
  • -k, --skeleton โ€” add a Skeleton bitstream. important if the output Ogg is intended to carry multiplexed or chained streams. the output file uses .oga as its file extension. ๐Ÿฆด
  • --ignorelength โ€” support for Wave files over 4 GB and stdin data streams. big file energy fr fr.
  • -Q, --quiet โ€” quiet mode. no messages are displayed. silence is golden, periodt. ๐Ÿคซ
  • -b n, --bitrate=n โ€” sets target bitrate to n (in kb/s). the encoder will attempt to encode at approximately this bitrate. by default, this remains a VBR encoding. see the --managed option to force a managed bitrate encoding at the selected bitrate. ๐Ÿ“Š
  • -m n, --min-bitrate=n โ€” sets minimum bitrate to n (in kb/s). enables bitrate management mode (see --managed).
  • -M n, --max-bitrate=n โ€” sets maximum bitrate to n (in kb/s). enables bitrate management mode (see --managed).
  • --managed โ€” set bitrate management mode. this turns off the normal VBR encoding, but allows hard or soft bitrate constraints to be enforced by the encoder. this mode is much slower, and may also be lower quality. it's primarily useful for creating files for streaming. so like, use it on purpose, not by accident ๐Ÿ’€
  • -q n, --quality=n โ€” sets encoding quality to n, between -1 (very low) and 10 (very high). this is the default mode of operation, with a default quality level of 3. fractional quality levels such as 2.5 are permitted. using this option lets the encoder select an appropriate bitrate based on your desired quality level. ๐ŸŽ€
  • --resample n โ€” resample input to the given sample rate (in Hz) before encoding. primarily useful for downsampling for lower-bitrate encoding. ๐ŸŒŠ
  • --downmix โ€” downmix input from stereo to mono (has no effect on non-stereo streams). useful for lower-bitrate encoding. ๐ŸŽงโžก๏ธ๐ŸŽต
  • --advanced-encode-option optionname=value โ€” sets an advanced option. see the Advanced Options section for details. (yes, that's a whole other section, stay tuned ๐Ÿ‘€)
  • -s, --serial โ€” forces a specific serial number in the output stream. this is primarily useful for testing. ๐Ÿ”ข
  • --discard-comments โ€” prevents comments in FLAC and Ogg FLAC files from being copied to the output Ogg Vorbis file. bye bye metadata ๐Ÿซถ
  • -o output_file, --output=output_file โ€” write the Ogg Vorbis stream to output_file (only valid if a single input file is specified). one file in, one file out, that's the rule ๐Ÿ’…
  • -n pattern, --names=pattern โ€” produce filenames as this string, with %g, %a, %l, %n, %t, %d replaced by genre, artist, album, track number, title, and date, respectively (see below for specifying these). also, %% gives a literal %. cute little template language fr fr. โœจ
  • -X, --name-remove=s โ€” remove the specified characters from parameters to the -n format string. this is useful to ensure legal filenames are generated. ๐Ÿงน
  • -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. the default settings for this option, and the -X option above, are platform specific (and chosen to ensure legal filenames are generated for each platform). ๐Ÿซถ
  • -c comment, --comment comment โ€” add the string comment as an extra comment. this may be used multiple times, and all instances will be added to each of the input files specified. the argument should be in the form "tag=value". ๐Ÿ’ฌ
  • -a artist, --artist artist โ€” set the artist comment field in the comments to artist.
  • -G genre, --genre genre โ€” set the genre comment field in the comments to genre.
  • -d date, --date date โ€” sets the date comment field to the given value. this should be the date of recording. ๐Ÿ“…
  • -N n, --tracknum n โ€” sets the track number comment field to the given value.
  • -t title, --title title โ€” set the track title comment field to title.
  • -l album, --album album โ€” set the album comment field to album. ๐Ÿ’ฟ
  • -L filename, --lyrics filename โ€” loads lyrics from filename and encodes them into a Kate stream multiplexed with the Vorbis stream. lyrics may be in LRC or SRT format, and should be encoded in UTF-8 or plain ASCII. other encodings may be converted using tools such as iconv or recode. alternatively, the same system as for comments will be used for conversion between encodings. so called "enhanced LRC" files are supported, and a simple karaoke style change will be saved with the lyrics. for more complex karaoke setups, kateenc(1) should be used instead. when embedding lyrics, the default output file extension is ".oga". ๐ŸŽคโœจ
note that adding lyrics to a stream will automatically enable Skeleton (see the -k option for more information about Skeleton). ๐Ÿฆด
  • -Y language-string, --lyrics-language language-string โ€” sets the language for the corresponding lyrics file to language-string. this should be an ISO 639-1 language code (eg, "en"), or a RFC 3066 language tag (eg, "en_US"), not a free form language name. players will typically recognize this standard tag and display the language name in your own language. ๐ŸŒ
note that the maximum length of this tag is 15 characters.

and one more thing before we move on, bestie โ€” ๐Ÿ“ข

note that the -a, -t, -l, -L, and -Y options can be given multiple times. they will be applied, one to each file, in the order given. if there are fewer album, title, or artist comments given than there are input files, oggenc will reuse the final one for the remaining files, and issue a warning in the case of repeated titles. โš ๏ธ

โœจ ADVANCED ENCODER OPTIONS โœจ

okay bestie, so oggenc lets you set a bunch of advanced encoder options using the --advanced-encode-option option. these are for very advanced users only, and you should approach them with caution. they may significantly degrade audio quality if misused. not all of these options are currently documented. iykyk ๐Ÿ’…

  • lowpass_frequency=N โ€” sets the lowpass frequency to N kHz. simple. iconic. โœจ
  • impulse_noisetune=N โ€” sets a noise floor bias N (range from -15. to 0.) for impulse blocks. a negative bias tells the encoder to pay special attention to the crispness of transients in the encoded audio. the tradeoff for better transient response is a higher bitrate. ngl that's the vibe. ๐ŸŽ€
  • bitrate_hard_max=N โ€” sets the allowed bitrate maximum for the encoded file to N kilobits per second. this bitrate may be exceeded only when there is spare bits in the bit reservoir; if the bit reservoir is exhausted, frames will be held under this value. this setting must be used with --managed to have any effect. periodt ๐Ÿ’€
  • bitrate_hard_min=N โ€” sets the allowed bitrate minimum for the encoded file to N kilobits per second. this bitrate may be underrun only when the bit reservoir is not full; if the bit reservoir is full, frames will be held over this value; if it's impossible to add bits constructively, the frame will be padded with zeroes. this setting must be used with --managed to have any effect. the way that bit reservoir works, fr fr. ๐ŸŒธ
  • bit_reservoir_bits=N โ€” sets the total size of the bit reservoir to N bits; the default size of the reservoir is equal to the nominal number of bits coded in one second (eg, a nominal 128kbps file will have a bit reservoir of 128000 bits by default). this option must be used with --managed to have any effect and affects only minimum and maximum bitrate management. average bitrate encoding with no hard bitrate boundaries does not use a bit reservoir. lowkey important. ๐Ÿฆ‹
  • bit_reservoir_bias=N โ€” sets the behavior bias of the bit reservoir (range: 0. to 1.). when set closer to 0, the bitrate manager attempts to hoard bits for future use in sudden bitrate increases (biasing toward better transient reproduction). when set closer to 1, the bitrate manager neglects transients in favor of using bits for homogenous passages. in the middle, the manager uses a balanced approach. the default setting is .2, thus biasing slightly toward transient reproduction. balanced queen ๐Ÿ‘‘
  • bitrate_average=N โ€” sets the average bitrate for the file to N kilobits per second. when used without hard minimum or maximum limits, this option selects reservoirless Average Bit Rate encoding, where the encoder attempts to perfectly track a desired bitrate, but imposes no strict momentary fluctuation limits. when used along with a minimum or maximum limit, the average bitrate still sets the average overall bitrate of the file, but will work within the bounds set by the bit reservoir. when the min, max and average bitrates are identical, oggenc produces Constant Bit Rate Vorbis data. iconic โœจ
  • bitrate_average_damping=N โ€” sets the reaction time for the average bitrate tracker to N seconds. this number represents the fastest reaction the bitrate tracker is allowed to make to hold the bitrate to the selected average. the faster the reaction time, the less momentary fluctuation in the bitrate but (generally) the lower quality the audio output. the slower the reaction time, the larger the ABR fluctuations, but (generally) the better the audio. when used along with min or max bitrate limits, this option directly affects how deep and how quickly the encoder will dip into its bit reservoir; the higher the number, the more demand on the bit reservoir.

the setting must be greater than zero and the useful range is approximately .05 to 10. the default is .75 seconds. no cap ๐Ÿ“

  • disable_coupling โ€” disables use of channel coupling for multichannel encoding. at present, the encoder will normally use channel coupling to further increase compression with stereo and 5.1 inputs. this option forces the encoder to encode each channel fully independently using neither lossy nor lossless coupling. main character energy ๐Ÿ’…

๐ŸŽ€ EXAMPLES ๐ŸŽ€

okay bestie, here are the examples. slay โœจ

Simplest version. produces output as somefile.ogg:

oggenc somefile.wav

Specifying an output filename:

oggenc somefile.wav -o out.ogg

Specifying a high-quality encoding averaging 256 kbps (but still VBR):

oggenc infile.wav -b 256 -o out.ogg

Specifying a maximum and average bitrate, and enforcing these:

oggenc infile.wav --managed -b 128 -M 160 -o out.ogg

Specifying quality rather than bitrate (to a very high quality mode):

oggenc infile.wav -q 6 -o out.ogg

Downsampling and downmixing to 11 kHz mono before encoding:

oggenc --resample 11025 --downmix infile.wav -q 1 -o out.ogg

Adding some info about the track:

oggenc somefile.wav -t "The track title" -a "artist who performed this" -l "name of album" -c "OTHERFIELD=contents of some other field not explicitly supported"

Adding embedded lyrics:

oggenc somefile.wav --lyrics lyrics.lrc --lyrics-language en -o out.oga

This encodes the three files, each with the same artist/album tag, but with different title tags on each one. The string given as an argument to -n is used to generate filenames, as shown in the section above. This example gives filenames like "The Tea Party - Touch.ogg":

oggenc -b 192 -a "The Tea Party" -l "Triptych" -t "Touch" track01.wav -t "Underground" track02.wav -t "Great Big Lie" track03.wav -n "%a - %t.ogg"

Encoding from stdin, to stdout (you can also use the various tagging options, like -t, -a, -l, etc.):

oggenc -

๐ŸŒŸ AUTHORS ๐ŸŒŸ

  • Program Author: Michael Smith <msmith@xiph.org>
  • Manpage Author: Stan Seibert <indigo@aztec.asu.edu>

๐Ÿ˜ญ BUGS ๐Ÿ˜ญ

reading type 3 Wave files (floating point samples) probably doesn't work other than on Intel (or other 32 bit, little endian machines). the way that is so specific, bestie. ๐Ÿ’€

๐Ÿซถ SEE ALSO ๐Ÿซถ

and that's the tea, bestie. this iconic page is from the Xiph.Org Foundation, dated 2008 October 05, and it's for oggenc(1). slay. ๐Ÿ’…โœจ