shithub: opus-tools

Download patch

ref: 2de4633eb9b480932d7f81ba99c170556fd99b7b
parent: 58448f98d152f3d4c23cc452b6803292ab745557
author: Gregory Maxwell <[email protected]>
date: Sun May 27 22:09:23 EDT 2012

Starter manpages for opusenc/opusdec/opusinfo.

Also make the opusdec help show --quiet.

--- a/Makefile.am
+++ b/Makefile.am
@@ -10,11 +10,14 @@
 
 opusenc_SOURCES = src/opus_header.c src/opusenc.c src/resample.c src/audio-in.c src/diag_range.c
 opusenc_LDADD = $(OGG_LIBS) $(Opus_LIBS) -lm
+opusenc_MANS = man/opusenc.1
 
 opusdec_SOURCES = src/opus_header.c src/wav_io.c src/wave_out.c src/opusdec.c src/resample.c src/diag_range.c
 opusdec_LDADD = $(OGG_LIBS) $(Opus_LIBS) $(OSS_LIBS) -lm
+opusdec_MANS = man/opusdec.1
 
 opusinfo_SOURCES = src/opus_header.c src/opusinfo.c src/info_opus.c
 opusinfo_LDADD = $(OGG_LIBS)
+opusinfo_MANS = man/opusinfo.1
 
 #TESTS = FIXME
--- /dev/null
+++ b/man/opusdec.1
@@ -1,0 +1,115 @@
+.\" Process this file with
+.\" groff -man -Tascii opusdec.1
+.\"
+.TH opusdec 1 2012-05-28 "Xiph.Org Foundation" "opus-tools"
+
+.SH NAME
+opusdec \- decode audio from Opus format to WAV (or simple audio output)
+
+.SH SYNOPSIS
+.B opusdec
+[
+.B -hv
+] [
+.B --mono
+] [
+.B --stereo
+] [
+.B --rate Hz
+] [
+.B --no-dither
+] [
+.B --packet-loss pct
+] [
+.B --save-rae file
+]
+[
+.B output.wav
+]
+
+.SH DESCRIPTION
+
+.B opusdec
+decodes Opus files into PCM Wave (uncompressed) files.
+
+If the input file is specified as
+.B "-"
+, then
+.B opusdec
+will read from stdin. Likewise, an output filename of
+.B "-"
+will cause output to be to stdout.
+
+If no output is specified
+.B opusdec
+will attempt to play the audio in realtime if it supports
+audio playback on your system.
+
+.SH "OPTIONS"
+.IP "-h, --help"
+Print help message.
+.IP "-V, --version"
+Display version information.
+.IP "--quiet"
+Suppresses program output.
+.IP "--mono"
+Force decoding in mono
+.IP "--stereo"
+Force decoding in stereo
+.IP "--rate"
+Force decoding at sampling rate n Hz
+.IP "--no-dither"
+Do not dither 16-bit output
+.IP "--packet-loss"
+Simulate n % random Opus packet loss
+.IP "--save-range"
+Saves check values for every frame to a file
+
+.SH EXAMPLES
+Decode a file
+.B input.opus
+to
+.B output.wav
+.RS
+opusdec input.opus output.wav
+.RE
+
+Play a file
+.B input.opus
+and force output at 48000 regardless of
+the original sampling rate
+.br
+.I (48kHz output may be faster, due to avoiding resampling and some sound hardware produces higher quality output when run at 48kHz)
+.RS
+opusdec --rate 48000 input.opus
+.RE
+
+Reencode a high bitrate Opus file to a lower rate
+.RS
+opusdec input.opus - | opusenc --bitrate 64 - output.opus
+.RE
+
+Play a http stream
+.B http://icecast.somwhere.org:8000/stream.opus
+with the help of curl on a system with pulseaudio
+.br
+.I (press ctrl-c to quit)
+.RS
+curl http://icecast.somwhere.org:8000/stream.opus | padsp opusdec -
+.RE
+
+.SH AUTHORS
+.br
+Jean-Marc Valin <[email protected]>
+Gregory Maxwell <[email protected]>
+
+.SH BUGS
+
+Opusdec does not currently reject all invalid files which it should reject.
+It also doesn't provide very helpful output for the corrupted files it
+does reject, use \fBopusinfo\fR(1) for somewhat better diagnostics.
+
+.SH SEE ALSO
+
+.PP
+\fBopusenc\fR(1), \fBopusinfo\fR(1)
--- /dev/null
+++ b/man/opusenc.1
@@ -1,0 +1,194 @@
+.\" Process this file with
+.\" groff -man -Tascii opusenc.1
+.\"
+.TH opusenc 1 2012-05-28 "Xiph.Org Foundation" "opus-tools"
+
+.SH NAME
+opusenc \- encode audio into the Opus format
+
+.SH SYNOPSIS
+.B opusenc
+[
+.B -v
+] [
+.B -h
+] [
+.B --speech
+] [
+.B --music
+] [
+.B --bitrate
+.I kbit/sec
+] [
+.B --vbr
+] [
+.B --cvbr
+] [
+.B --hard-cbr
+] [
+.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 --max-ogg-delay
+.I ms
+] [
+.B --save-range
+.I file
+] [
+.B --set-ctl-int
+.I ctl=value
+] [
+.B --uncoupled
+] [
+.B --comment
+.I tag=value
+] [
+.B --artist
+.I author
+] [
+.B --title
+.I track title
+] [
+.B --raw
+] [
+.B --raw-bits
+.I bits/sample
+] [
+.B --raw-rate
+.I Hz
+] [
+.B --raw-chan
+.I N
+] [
+.B --raw-endianness
+.I flag
+]
+.I input.wav
+.I output.opus
+
+.SH DESCRIPTION
+.B opusenc
+reads audio data in either raw, Wave, or AIFF format and encodes it into an
+Opus stream. If the input file is "-" audio data is read from stdin,
+likewise if the output file is "-" opus data is written to stdout.
+
+Unless quieted
+.B opusenc
+displays fancy statistics about the encoding progress.
+
+.SH OPTIONS
+.IP "-h, --help"
+Show command help.
+.IP "-v, --version"
+Show the version number.
+.IP "--speech"
+Optimize for speech
+.IP "--music"
+Optimize for music
+.IP "--bitrate N.nnn"
+Encoding bit-rate in kbit/sec (6-256 per-channel)
+.IP "--vbr"
+Use variable bitrate encoding (default)
+.IP "--cvbr"
+Use constrained variable bitrate encoding
+.IP "--hard-cbr"
+Use hard constant bitrate encoding
+.IP "--comp N"
+Encoding computational complexity (0-10, default: 10)
+.IP "--framesize N"
+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"
+Percentage packet loss to expect (default: 0)
+.IP "--downmix-mono"
+Downmix to mono
+.IP "--downmix-stereo"
+Downmix to to stereo (if >2 channels input)
+.IP "--max-ogg-delay N"
+Maximum container delay in milliseconds (0-1000, default: 1000)
+.IP "--save-range file"
+Saves 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
+This may be used multiple times
+.IP "--uncoupled"
+Use one mono stream per channel
+.IP "--comment tag=value"
+Add 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".
+See the vorbis-comment specification for well known tag names:
+http://www.xiph.org/vorbis/doc/v-comment.html
+.IP "--artist artist"
+Set the artist comment field in the comments to
+.I artist.
+.IP "--title title"
+Set the track title comment field to
+.I title.
+.IP "--raw"
+Raw (headerless) PCM input
+.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 bigendian, 0 for little (defaults to 0)
+
+.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 160kbps:
+.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-ogg-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 <[email protected]>
+
+.SH SEE ALSO
+
+.PP
+\fBopusdec\fR(1), \fBopusinfo\fR(1), \fBoggfwd\fR(1)
--- /dev/null
+++ b/man/opusinfo.1
@@ -1,0 +1,68 @@
+.\" Process this file with
+.\" groff -man -Tascii opusinfo.1
+.\"
+.TH opusinfo 1 2012-05-28 "Xiph.Org Foundation" "opus-tools"
+
+.SH NAME
+opusinfo \- gives information about Opus files and does extensive validity checking
+
+.SH SYNOPSIS
+.B opusinfo
+[
+.B -q
+] [
+.B -v
+] [
+.B -h
+]
+.I file1.opus
+.B ...
+.I fileN.opus
+
+.SH DESCRIPTION
+.B opusinfo
+reads one or more Opus files and prints information about stream contents
+(including chained and/or multiplexed streams) to standard output. It will
+detect (but not correct) a wide range of common defects, with many
+additional checks specifically for Opus streams.
+
+For all stream types
+.B opusinfo
+will print the filename being processed, the stream serial numbers, and various
+common error conditions.
+
+For
+.B Opus
+streams, information including the version used for encoding, number of channels
+and other header information, the bitrate and playback length, the contents of the
+comment header, and general statistics about the stream are printed.
+
+Opusinfo is a fork of \fBogginfo\fR(1) with the non-opus parts largely removed.
+
+.SH OPTIONS
+.IP -h
+Show a help and usage message.
+.IP -q
+Quiet mode. This may be specified multiple times. Doing so once will remove
+the detailed informative messages, twice will remove warnings as well.
+.IP -v
+Verbose mode. At the current time, this does not do anything.
+
+.SH NOTES
+
+There are many kinds of errored, invalid, non-normative or otherwise
+unwise stream constructions which opusinfo will not produce warnings
+on. Passing opusinfo with flying colors is not certification of the
+correctness of a stream. Future versions may detect more error
+conditions.
+
+.SH AUTHORS
+.br
+Michael Smith <[email protected]>
+.br
+Gregory Maxwell <[email protected]>
+
+.SH SEE ALSO
+
+.PP
+\fBopusdec\fR(1), \fBopusenc\fR(1)
--- a/src/opusdec.c
+++ b/src/opusdec.c
@@ -384,6 +384,7 @@
    printf (" -V                    Verbose mode (show bit-rate)\n");
    printf (" -h, --help            This help\n");
    printf (" -v, --version         Version information\n");
+   printf (" --quiet               Quiet mode\n");
    printf ("\n");
 }