opusenc.1 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. .\" Process this file with
  2. .\" groff -man -Tascii opusenc.1
  3. .\"
  4. .TH opusenc 1 2012-08-31 "Xiph.Org Foundation" "opus-tools"
  5. .SH NAME
  6. opusenc \- encode audio into the Opus format
  7. .SH SYNOPSIS
  8. .B opusenc
  9. [
  10. .B -h
  11. ] [
  12. .B -V
  13. ] [
  14. .B --bitrate
  15. .I kbit/sec
  16. ] [
  17. .B --vbr
  18. ] [
  19. .B --cvbr
  20. ] [
  21. .B --hard-cbr
  22. ] [
  23. .B --comp
  24. .I complexity
  25. ] [
  26. .B --framesize
  27. .I 2.5, 5, 10, 20, 40, 60
  28. ] [
  29. .B --expect-loss
  30. .I pct
  31. ] [
  32. .B --downmix-mono
  33. ] [
  34. .B --downmix-stereo
  35. ] [
  36. .B --max-delay
  37. .I ms
  38. ] [
  39. .B --serial
  40. .I serial number
  41. ] [
  42. .B --save-range
  43. .I file
  44. ] [
  45. .B --set-ctl-int
  46. .I ctl=value
  47. ] [
  48. .B --comment
  49. .I tag=value
  50. ] [
  51. .B --artist
  52. .I author
  53. ] [
  54. .B --title
  55. .I 'track title'
  56. ] [
  57. .B --album
  58. .I 'album title'
  59. ] [
  60. .B --date
  61. .I YYYY-MM-DD
  62. ] [
  63. .B --genre
  64. .I genre
  65. ] [
  66. .B --raw
  67. ] [
  68. .B --raw-bits
  69. .I bits/sample
  70. ] [
  71. .B --raw-rate
  72. .I Hz
  73. ] [
  74. .B --raw-chan
  75. .I N
  76. ] [
  77. .B --raw-endianness
  78. .I flag
  79. ] [
  80. .B --ignorelength
  81. ]
  82. .I input.wav
  83. .I output.opus
  84. .SH DESCRIPTION
  85. .B opusenc
  86. reads audio data in either raw, Wave, or AIFF format and encodes it into an
  87. Opus stream. If the input file is "-" audio data is read from stdin.
  88. Likewise, if the output file is "-" opus data is written to stdout.
  89. Unless quieted
  90. .B opusenc
  91. displays fancy statistics about the encoding progress.
  92. .SH OPTIONS
  93. .IP "-h, --help"
  94. Show command help
  95. .IP "-V, --version"
  96. Show the version number
  97. .IP "--bitrate N.nnn"
  98. Encoding bitrate in kbit/sec (6-256 per channel)
  99. .br
  100. Default for >=44.1kHz input is 64kbps per mono stream, 96kbps per coupled pair.
  101. .IP "--vbr"
  102. Use variable bitrate encoding (default)
  103. .IP "--cvbr"
  104. Use constrained variable bitrate encoding
  105. .IP "--hard-cbr"
  106. Use hard constant bitrate encoding
  107. .IP "--comp N"
  108. Encoding computational complexity (0-10, default: 10). Zero gives the
  109. fastest encodes but lower quality, while 10 gives the highest quality
  110. but slower encoding.
  111. .IP "--framesize N"
  112. Maximum frame size in milliseconds (2.5, 5, 10, 20, 40, 60, default: 20)
  113. .br
  114. Smaller framesizes achieve lower latency but less quality at a given
  115. bitrate.
  116. .br
  117. Sizes greater than 20ms are only interesting at fairly low
  118. bitrates.
  119. .IP "--expect-loss N"
  120. Percentage packet loss to expect (default: 0)
  121. .IP "--downmix-mono"
  122. Downmix to mono
  123. .IP "--downmix-stereo"
  124. Downmix to stereo (if >2 channels input)
  125. .IP "--max-delay N"
  126. Maximum container delay in milliseconds (0-1000, default: 1000)
  127. .IP "--serial n"
  128. Forces the stream serial number to a specified value (instead of being random).
  129. This is used to make the encoder deterministic for testing and is not generally recommended.
  130. .IP "--save-range file"
  131. Saves check values for every frame to a file
  132. .IP "--set-ctl-int x=y"
  133. Pass the encoder control x with value y (advanced)
  134. Preface with s: to direct the ctl to multistream s
  135. .br
  136. This may be used multiple times
  137. .IP "--comment tag=value"
  138. Add an extra comment. This may be used multiple times, and all
  139. instances will be added to each of the input files specified. The argument
  140. should be in the form "tag=value".
  141. See the vorbis-comment specification for well known tag names:
  142. http://www.xiph.org/vorbis/doc/v-comment.html
  143. .IP "--artist artist"
  144. Set the artist comment field to
  145. .I artist
  146. .IP "--title title"
  147. Set the track title comment field to
  148. .I title
  149. .IP "--album album"
  150. Set the album or collection title field to
  151. .I album
  152. .IP "--date YYYY-MM-DD"
  153. Set the date comment field to
  154. .I YYYY-MM-DD
  155. .IP "--genre genre"
  156. Set the genre comment field to
  157. .I genre
  158. .IP "--raw"
  159. Raw (headerless) PCM input
  160. .IP "--raw-bits N"
  161. Set bits/sample for raw input (default: 16)
  162. .IP "--raw-rate N"
  163. Set sampling rate for raw input (default: 48000)
  164. .IP "--raw-chan N"
  165. Set number of channels for raw input (default: 2)
  166. .IP "--raw-endianness [0/1]"
  167. Set the endianness for raw input: 1 for bigendian, 0 for little (defaults to 0)
  168. .IP "--ignorelength"
  169. Always ignore the datalength in Wave headers. Opusenc automatically ignores
  170. the length when its implausible (very small or very large) but some STDIN
  171. usage may still need this option to avoid truncation.
  172. .SH EXAMPLES
  173. Simplest usage. Take input as input.wav and produce output as output.opus:
  174. .RS
  175. opusenc input.wav output.opus
  176. .RE
  177. .PP
  178. Produce a very high quality encode with a target rate of 160kbps:
  179. .RS
  180. opusenc --bitrate 160 input.wav output.opus
  181. .RE
  182. .PP
  183. Record and send a live stream to an Icecast HTTP streaming server using oggfwd:
  184. .RS
  185. arecord -c 2 -r 48000 -twav - | opusenc --bitrate 96 - - | oggfwd icecast.somewhere.org 8000 password /stream.opus
  186. .RE
  187. .PP
  188. .SH NOTES
  189. While it is possible to use opusenc for low latency streaming (e.g. with --max-delay set to 0
  190. and netcat instead of Icecast) it's not really designed for this, and the Ogg container
  191. and TCP transport aren't the best tools for that application. Shell
  192. pipelines themselves will often have high buffering. The ability to set
  193. framesizes as low as 2.5 ms in opusenc mostly exists to try out the quality
  194. of the format with low latency settings, but not really for actual low
  195. latency usage.
  196. .br
  197. Interactive usage should use UDP/RTP directly.
  198. .SH AUTHORS
  199. .br
  200. Gregory Maxwell <greg@xiph.org>
  201. .SH SEE ALSO
  202. .BR opusdec (1),
  203. .BR opusinfo (1),
  204. .BR oggfwd (1)