opusenc(1) | opus-tools | opusenc(1) |
opusenc - encode audio into the Opus format
opusenc [ -h ] [ -V ] [ --help-picture ] [ --quiet ] [ --bitrate kbit/s ] [ --vbr ] [ --cvbr ] [ --hard-cbr ] [ --music ] [ --speech ] [ --comp complexity ] [ --framesize 2.5, 5, 10, 20, 40, 60 ] [ --expect-loss pct ] [ --downmix-mono ] [ --downmix-stereo ] [ --no-phase-inv ] [ --max-delay ms ] [ --title 'track title' ] [ --artist author ] [ --album 'album title' ] [ --tracknumber 'track number' ] [ --genre genre ] [ --date YYYY-MM-DD ] [ --comment tag=value ] [ --picture filename|specification ] [ --padding n ] [ --discard-comments ] [ --discard-pictures ] [ --raw ] [ --raw-bits bits/sample ] [ --raw-rate Hz ] [ --raw-chan N ] [ --raw-endianness flag ] [ --ignorelength ] [ --serial serial number ] [ --save-range file ] [ --set-ctl-int ctl=value ] input.wav output.opus
opusenc reads audio data in Wave, AIFF, FLAC, Ogg/FLAC, or raw PCM format and encodes it into an Ogg Opus stream. If the input file is "-" audio data is read from stdin. Likewise, if the output file is "-" the Ogg Opus stream is written to stdout.
Unless quieted opusenc displays fancy statistics about the encoding progress.
In VBR mode this specifies the average rate for a large and diverse collection of audio. In CVBR and Hard-CBR mode it specifies the specific output bitrate.
The default for input with a sample rate of 44.1 kHz or higher is 64 kbit/s per mono stream and 96 kbit/s per coupled pair.
In VBR mode the bitrate may go up and down freely depending on the content to achieve more consistent quality.
Outputs to a specific bitrate. This mode is analogous to CBR in AAC/MP3 encoders and managed mode in Vorbis coders. This delivers less consistent quality than VBR mode but consistent bitrate.
With hard-cbr every frame will be exactly the same size, similar to how speech codecs work. This delivers lower overall quality but is useful where bitrate changes might leak data in encrypted channels or on synchronous transports.
Tuning impacts lower bitrates that involve tradeoffs between speech clarity and musical accuracy, and has no impact at bitrates typically used for high quality music encoding.
Tuning impacts lower bitrates that involve tradeoffs between speech clarity and musical accuracy, and has no impact at bitrates typically used for high quality music encoding.
Either a filename for the artwork or a more complete specification form can be used. The picture is added to a METADATA_BLOCK_PICTURE comment field similar to what is used in FLAC. The specification is a string whose parts are separated by | (pipe) characters. Some parts may be left empty to invoke default values. Passing a plain filename is just shorthand for the "||||filename" specification.
The format of specification is [type]|[media-type]|[description]|[widthxheightxdepth[/colors]]|filename
type is an optional number describing the nature of the picture. Defined values are from one of:
0: Other
1: 32x32 pixel 'file icon' (PNG only)
2: Other file icon
3: Cover (front)
4: Cover (back)
5: Leaflet page
6: Media (e.g., label side of a CD)
7: Lead artist/lead performer/soloist
8: Artist/performer
9: Conductor
10: Band/Orchestra
11: Composer
12: Lyricist/text writer
13: Recording location
14: During recording
15: During performance
16: Movie/video screen capture
17: A bright colored fish
18: Illustration
19: Band/artist logotype
20: Publisher/studio logotype
The default is 3 (front cover). More than one --picture option can be specified to attach multiple pictures. There may only be one picture each of type 1 and 2 in a file.
media-type is optional and is now ignored.
description is optional. The default is an empty string.
The next part specifies the resolution and color information, but is now ignored.
filename is the path to the picture file to be imported.
Simplest usage. Take input as input.wav and produce output as output.opus:
Produce a very high quality encode with a target rate of 160 kbit/s:
Record and send a live stream to an Icecast HTTP streaming server using oggfwd:
While it is possible to use opusenc for low latency streaming
(e.g. with --max-delay set to 0 and netcat instead of Icecast) it's not
really designed for this, and the Ogg container and TCP transport aren't the
best tools for that application. Shell pipelines themselves will often have
high buffering. The ability to set framesizes as low as 2.5 ms in opusenc
mostly exists to try out the quality of the format with low latency
settings, but not really for actual low latency usage.
Interactive usage should use UDP/RTP directly.
Gregory Maxwell <greg@xiph.org>
opusdec(1), opusinfo(1), oggfwd(1)
2012-08-31 | Xiph.Org Foundation |