1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392
|
.\" Process this file with
.\" groff -man -Tascii opusenc.1
.\"
.TH opusenc 1 2012-08-31 "Xiph.Org Foundation" "opus-tools"
.SH NAME
opusenc \- encode audio into the Opus format
.SH SYNOPSIS
.B opusenc
[
.B -h
] [
.B -V
] [
.B --help-picture
] [
.B --quiet
] [
.B --bitrate
.I kbit/s
] [
.B --vbr
] [
.B --cvbr
] [
.B --hard-cbr
] [
.B --music
] [
.B --speech
] [
.B --comp
.I complexity
] [
.B --framesize
.I 2.5, 5, 10, 20, 40, 60
] [
.B --expect-loss
.I pct
] [
.B --downmix-mono
] [
.B --downmix-stereo
] [
.B --no-phase-inv
] [
.B --max-delay
.I ms
] [
.B --title
.I 'track title'
] [
.B --artist
.I author
] [
.B --album
.I 'album title'
] [
.B --tracknumber
.I 'track number'
] [
.B --genre
.I genre
] [
.B --date
.I YYYY-MM-DD
] [
.B --comment
.I tag=value
] [
.B --picture
.IB filename | specification
] [
.B --padding
.I n
] [
.B --discard-comments
] [
.B --discard-pictures
] [
.B --raw
] [
.B --raw-bits
.I bits/sample
] [
.B --raw-rate
.I Hz
] [
.B --raw-chan
.I N
] [
.B --raw-endianness
.I flag
] [
.B --ignorelength
] [
.B --serial
.I serial number
] [
.B --save-range
.I file
] [
.B --set-ctl-int
.I ctl=value
]
.I input.wav
.I output.opus
.SH DESCRIPTION
.B 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
.B opusenc
displays fancy statistics about the encoding progress.
.SH OPTIONS
.SS "General options"
.IP "-h, --help"
Show command help
.IP "-V, --version"
Show the version number
.IP "--help-picture"
Show help on attaching album art
.IP "--quiet"
Enable quiet mode. No messages are displayed.
.SS "Encoding options"
.IP "--bitrate N.nnn"
Set target bitrate in kbit/s (6-256 per channel)
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.
.IP "--vbr"
Use variable bitrate encoding (default)
In VBR mode the bitrate may go up and down freely depending on the content
to achieve more consistent quality.
.IP "--cvbr"
Use constrained variable bitrate encoding.
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.
.IP "--hard-cbr"
Use hard constant bitrate encoding.
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.
.IP "--music"
Override automatic detection and tune low bitrate encoding for music.
By default, music is detected automatically and the classification
may vary over time.
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.
.IP "--speech"
Override automatic detection and tune low bitrate encoding for speech.
By default, speech is detected automatically and the classification
may vary over time.
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.
.IP "--comp N"
Set encoding computational complexity (0-10, default: 10). Zero gives the
fastest encodes but lower quality, while 10 gives the highest quality
but slower encoding.
.IP "--framesize N"
Set maximum frame size in milliseconds (2.5, 5, 10, 20, 40, 60, default: 20)
.br
Smaller framesizes achieve lower latency but less quality at a given
bitrate.
.br
Sizes greater than 20ms are only interesting at fairly low
bitrates.
.IP "--expect-loss N"
Set expected packet loss in percent (default: 0)
.IP "--downmix-mono"
Downmix to mono
.IP "--downmix-stereo"
Downmix to stereo (if >2 channels input)
.IP "--no-phase-inv"
Disable use of phase inversion for intensity stereo. This trades some
stereo quality for a higher quality mono downmix, and is useful when
encoding stereo audio that is likely to be downmixed to mono after decoding.
.IP "--max-delay N"
Set maximum container delay in milliseconds (0-1000, default: 1000)
.SS "Metadata options"
.IP "--title title"
Set the track title comment field to
.I title
.IP "--artist artist"
Set the artist comment field to
.I artist.
This may be used multiple times to list contributing artists individually.
Note that some playback software does not display multiple artists gracefully.
.IP "--album album"
Set the album or collection title field to
.I album
.IP "--tracknumber N"
Set the track number comment field to
.I N
.IP "--date YYYY-MM-DD"
Set the date comment field to
.I YYYY-MM-DD.
This may be shortened to YYYY-MM or YYYY.
.IP "--genre genre"
Set the genre comment field to
.I genre.
This option may be specified multiple times to tag a track with
multiple overlapping genres.
.IP "--comment tag=value"
Add an extra comment. This may be used multiple times. The argument
should be in the form "tag=value".
See the vorbis-comment specification for well known tag names:
https://www.xiph.org/vorbis/doc/v-comment.html
.IP "--picture filename|specification"
Attach album art for the track.
Either a
.I filename
for the artwork or a more complete
.I specification
form can be used.
The picture is added to a
.B METADATA_BLOCK_PICTURE
comment field similar to what is used in
.SM FLAC.
The
.I 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
.I specification
is [\fBtype\fR]|[\fBmedia-type\fR]|[\fBdescription\fR]|[\fBwidth\fRx\fBheight\fRx\fBdepth\fR[/\fBcolors\fR]]|\fBfilename\fR
.I type
is an optional number describing the nature of the picture.
Defined values are from one of:
0: Other
.br
1: 32x32 pixel 'file icon' (PNG only)
.br
2: Other file icon
.br
3: Cover (front)
.br
4: Cover (back)
.br
5: Leaflet page
.br
6: Media (e.g., label side of a CD)
.br
7: Lead artist/lead performer/soloist
.br
8: Artist/performer
.br
9: Conductor
.br
10: Band/Orchestra
.br
11: Composer
.br
12: Lyricist/text writer
.br
13: Recording location
.br
14: During recording
.br
15: During performance
.br
16: Movie/video screen capture
.br
17: A bright colored fish
.br
18: Illustration
.br
19: Band/artist logotype
.br
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.
.I media-type
is optional and is now ignored.
.I description
is optional. The default is an empty string.
The next part specifies the resolution and color information, but
is now ignored.
.I filename
is the path to the picture file to be imported.
.IP "--padding n"
Reserve
.I n
extra bytes for metadata tags. This can make later tag editing more
efficient. Defaults to 512.
.IP "--discard-comments"
Don't propagate metadata tags from the input file.
.IP "--discard-pictures"
Don't propagate pictures or art from the input file.
.SS "Input options"
.IP "--raw"
Interpret input as raw PCM data without headers
.IP "--raw-bits N"
Set bits/sample for raw input (default: 16)
.IP "--raw-rate N"
Set sampling rate for raw input (default: 48000)
.IP "--raw-chan N"
Set number of channels for raw input (default: 2)
.IP "--raw-endianness [0/1]"
Set the endianness for raw input: 1 for big endian, 0 for little (default: 0)
.IP "--ignorelength"
Ignore the data length in Wave headers. Opusenc automatically ignores
the length when its implausible (very small or very large) but some STDIN
usage may still need this option to avoid truncation.
.SS "Diagnostic options"
.IP "--serial n"
Force use of a specific stream serial number, rather than one that is randomly generated.
This is used to make the encoder deterministic for testing and is not generally recommended.
.IP "--save-range file"
Save check values for every frame to a file
.IP "--set-ctl-int x=y"
Pass the encoder control x with value y (advanced).
Preface with s: to direct the ctl to multistream s
.br
This may be used multiple times
.SH EXAMPLES
Simplest usage. Take input as input.wav and produce output as output.opus:
.RS
opusenc input.wav output.opus
.RE
.PP
Produce a very high quality encode with a target rate of 160 kbit/s:
.RS
opusenc --bitrate 160 input.wav output.opus
.RE
.PP
Record and send a live stream to an Icecast HTTP streaming server using oggfwd:
.RS
arecord -c 2 -r 48000 -twav - | opusenc --bitrate 96 - - | oggfwd icecast.somewhere.org 8000 password /stream.opus
.RE
.PP
.SH NOTES
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.
.br
Interactive usage should use UDP/RTP directly.
.SH AUTHORS
.br
Gregory Maxwell <greg@xiph.org>
.SH SEE ALSO
.BR opusdec (1),
.BR opusinfo (1),
.BR oggfwd (1)
|