ffmpeg-resampler.1 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. .\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
  2. .\"
  3. .\" Standard preamble:
  4. .\" ========================================================================
  5. .de Sp \" Vertical space (when we can't use .PP)
  6. .if t .sp .5v
  7. .if n .sp
  8. ..
  9. .de Vb \" Begin verbatim text
  10. .ft CW
  11. .nf
  12. .ne \\$1
  13. ..
  14. .de Ve \" End verbatim text
  15. .ft R
  16. .fi
  17. ..
  18. .\" Set up some character translations and predefined strings. \*(-- will
  19. .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
  20. .\" double quote, and \*(R" will give a right double quote. \*(C+ will
  21. .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
  22. .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
  23. .\" nothing in troff, for use with C<>.
  24. .tr \(*W-
  25. .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
  26. .ie n \{\
  27. . ds -- \(*W-
  28. . ds PI pi
  29. . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
  30. . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
  31. . ds L" ""
  32. . ds R" ""
  33. . ds C` ""
  34. . ds C' ""
  35. 'br\}
  36. .el\{\
  37. . ds -- \|\(em\|
  38. . ds PI \(*p
  39. . ds L" ``
  40. . ds R" ''
  41. . ds C`
  42. . ds C'
  43. 'br\}
  44. .\"
  45. .\" Escape single quotes in literal strings from groff's Unicode transform.
  46. .ie \n(.g .ds Aq \(aq
  47. .el .ds Aq '
  48. .\"
  49. .\" If the F register is >0, we'll generate index entries on stderr for
  50. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  51. .\" entries marked with X<> in POD. Of course, you'll have to process the
  52. .\" output yourself in some meaningful fashion.
  53. .\"
  54. .\" Avoid warning from groff about undefined register 'F'.
  55. .de IX
  56. ..
  57. .nr rF 0
  58. .if \n(.g .if rF .nr rF 1
  59. .if (\n(rF:(\n(.g==0)) \{\
  60. . if \nF \{\
  61. . de IX
  62. . tm Index:\\$1\t\\n%\t"\\$2"
  63. ..
  64. . if !\nF==2 \{\
  65. . nr % 0
  66. . nr F 2
  67. . \}
  68. . \}
  69. .\}
  70. .rr rF
  71. .\"
  72. .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
  73. .\" Fear. Run. Save yourself. No user-serviceable parts.
  74. . \" fudge factors for nroff and troff
  75. .if n \{\
  76. . ds #H 0
  77. . ds #V .8m
  78. . ds #F .3m
  79. . ds #[ \f1
  80. . ds #] \fP
  81. .\}
  82. .if t \{\
  83. . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
  84. . ds #V .6m
  85. . ds #F 0
  86. . ds #[ \&
  87. . ds #] \&
  88. .\}
  89. . \" simple accents for nroff and troff
  90. .if n \{\
  91. . ds ' \&
  92. . ds ` \&
  93. . ds ^ \&
  94. . ds , \&
  95. . ds ~ ~
  96. . ds /
  97. .\}
  98. .if t \{\
  99. . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
  100. . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
  101. . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
  102. . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
  103. . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
  104. . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
  105. .\}
  106. . \" troff and (daisy-wheel) nroff accents
  107. .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
  108. .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
  109. .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
  110. .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
  111. .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
  112. .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
  113. .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
  114. .ds ae a\h'-(\w'a'u*4/10)'e
  115. .ds Ae A\h'-(\w'A'u*4/10)'E
  116. . \" corrections for vroff
  117. .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
  118. .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
  119. . \" for low resolution devices (crt and lpr)
  120. .if \n(.H>23 .if \n(.V>19 \
  121. \{\
  122. . ds : e
  123. . ds 8 ss
  124. . ds o a
  125. . ds d- d\h'-1'\(ga
  126. . ds D- D\h'-1'\(hy
  127. . ds th \o'bp'
  128. . ds Th \o'LP'
  129. . ds ae ae
  130. . ds Ae AE
  131. .\}
  132. .rm #[ #] #H #V #F C
  133. .\" ========================================================================
  134. .\"
  135. .IX Title "FFMPEG-RESAMPLER 1"
  136. .TH FFMPEG-RESAMPLER 1 " " " " " "
  137. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  138. .\" way too many mistakes in technical documents.
  139. .if n .ad l
  140. .nh
  141. .SH "NAME"
  142. ffmpeg\-resampler \- FFmpeg Resampler
  143. .SH "DESCRIPTION"
  144. .IX Header "DESCRIPTION"
  145. The FFmpeg resampler provides a high-level interface to the
  146. libswresample library audio resampling utilities. In particular it
  147. allows one to perform audio resampling, audio channel layout rematrixing,
  148. and convert audio format and packing layout.
  149. .SH "RESAMPLER OPTIONS"
  150. .IX Header "RESAMPLER OPTIONS"
  151. The audio resampler supports the following named options.
  152. .PP
  153. Options may be set by specifying \-\fIoption\fR \fIvalue\fR in the
  154. FFmpeg tools, \fIoption\fR=\fIvalue\fR for the aresample filter,
  155. by setting the value explicitly in the
  156. \&\f(CW\*(C`SwrContext\*(C'\fR options or using the \fIlibavutil/opt.h\fR \s-1API\s0 for
  157. programmatic use.
  158. .IP "\fBich, in_channel_count\fR" 4
  159. .IX Item "ich, in_channel_count"
  160. Set the number of input channels. Default value is 0. Setting this
  161. value is not mandatory if the corresponding channel layout
  162. \&\fBin_channel_layout\fR is set.
  163. .IP "\fBoch, out_channel_count\fR" 4
  164. .IX Item "och, out_channel_count"
  165. Set the number of output channels. Default value is 0. Setting this
  166. value is not mandatory if the corresponding channel layout
  167. \&\fBout_channel_layout\fR is set.
  168. .IP "\fBuch, used_channel_count\fR" 4
  169. .IX Item "uch, used_channel_count"
  170. Set the number of used input channels. Default value is 0. This option is
  171. only used for special remapping.
  172. .IP "\fBisr, in_sample_rate\fR" 4
  173. .IX Item "isr, in_sample_rate"
  174. Set the input sample rate. Default value is 0.
  175. .IP "\fBosr, out_sample_rate\fR" 4
  176. .IX Item "osr, out_sample_rate"
  177. Set the output sample rate. Default value is 0.
  178. .IP "\fBisf, in_sample_fmt\fR" 4
  179. .IX Item "isf, in_sample_fmt"
  180. Specify the input sample format. It is set by default to \f(CW\*(C`none\*(C'\fR.
  181. .IP "\fBosf, out_sample_fmt\fR" 4
  182. .IX Item "osf, out_sample_fmt"
  183. Specify the output sample format. It is set by default to \f(CW\*(C`none\*(C'\fR.
  184. .IP "\fBtsf, internal_sample_fmt\fR" 4
  185. .IX Item "tsf, internal_sample_fmt"
  186. Set the internal sample format. Default value is \f(CW\*(C`none\*(C'\fR.
  187. This will automatically be chosen when it is not explicitly set.
  188. .IP "\fBicl, in_channel_layout\fR" 4
  189. .IX Item "icl, in_channel_layout"
  190. .PD 0
  191. .IP "\fBocl, out_channel_layout\fR" 4
  192. .IX Item "ocl, out_channel_layout"
  193. .PD
  194. Set the input/output channel layout.
  195. .Sp
  196. See \fBthe Channel Layout section in the \fBffmpeg\-utils\fB\|(1) manual\fR
  197. for the required syntax.
  198. .IP "\fBclev, center_mix_level\fR" 4
  199. .IX Item "clev, center_mix_level"
  200. Set the center mix level. It is a value expressed in deciBel, and must be
  201. in the interval [\-32,32].
  202. .IP "\fBslev, surround_mix_level\fR" 4
  203. .IX Item "slev, surround_mix_level"
  204. Set the surround mix level. It is a value expressed in deciBel, and must
  205. be in the interval [\-32,32].
  206. .IP "\fBlfe_mix_level\fR" 4
  207. .IX Item "lfe_mix_level"
  208. Set \s-1LFE\s0 mix into non \s-1LFE\s0 level. It is used when there is a \s-1LFE\s0 input but no
  209. \&\s-1LFE\s0 output. It is a value expressed in deciBel, and must
  210. be in the interval [\-32,32].
  211. .IP "\fBrmvol, rematrix_volume\fR" 4
  212. .IX Item "rmvol, rematrix_volume"
  213. Set rematrix volume. Default value is 1.0.
  214. .IP "\fBrematrix_maxval\fR" 4
  215. .IX Item "rematrix_maxval"
  216. Set maximum output value for rematrixing.
  217. This can be used to prevent clipping vs. preventing volume reduction.
  218. A value of 1.0 prevents clipping.
  219. .IP "\fBflags, swr_flags\fR" 4
  220. .IX Item "flags, swr_flags"
  221. Set flags used by the converter. Default value is 0.
  222. .Sp
  223. It supports the following individual flags:
  224. .RS 4
  225. .IP "\fBres\fR" 4
  226. .IX Item "res"
  227. force resampling, this flag forces resampling to be used even when the
  228. input and output sample rates match.
  229. .RE
  230. .RS 4
  231. .RE
  232. .IP "\fBdither_scale\fR" 4
  233. .IX Item "dither_scale"
  234. Set the dither scale. Default value is 1.
  235. .IP "\fBdither_method\fR" 4
  236. .IX Item "dither_method"
  237. Set dither method. Default value is 0.
  238. .Sp
  239. Supported values:
  240. .RS 4
  241. .IP "\fBrectangular\fR" 4
  242. .IX Item "rectangular"
  243. select rectangular dither
  244. .IP "\fBtriangular\fR" 4
  245. .IX Item "triangular"
  246. select triangular dither
  247. .IP "\fBtriangular_hp\fR" 4
  248. .IX Item "triangular_hp"
  249. select triangular dither with high pass
  250. .IP "\fBlipshitz\fR" 4
  251. .IX Item "lipshitz"
  252. select Lipshitz noise shaping dither.
  253. .IP "\fBshibata\fR" 4
  254. .IX Item "shibata"
  255. select Shibata noise shaping dither.
  256. .IP "\fBlow_shibata\fR" 4
  257. .IX Item "low_shibata"
  258. select low Shibata noise shaping dither.
  259. .IP "\fBhigh_shibata\fR" 4
  260. .IX Item "high_shibata"
  261. select high Shibata noise shaping dither.
  262. .IP "\fBf_weighted\fR" 4
  263. .IX Item "f_weighted"
  264. select f\-weighted noise shaping dither
  265. .IP "\fBmodified_e_weighted\fR" 4
  266. .IX Item "modified_e_weighted"
  267. select modified-e-weighted noise shaping dither
  268. .IP "\fBimproved_e_weighted\fR" 4
  269. .IX Item "improved_e_weighted"
  270. select improved-e-weighted noise shaping dither
  271. .RE
  272. .RS 4
  273. .RE
  274. .IP "\fBresampler\fR" 4
  275. .IX Item "resampler"
  276. Set resampling engine. Default value is swr.
  277. .Sp
  278. Supported values:
  279. .RS 4
  280. .IP "\fBswr\fR" 4
  281. .IX Item "swr"
  282. select the native \s-1SW\s0 Resampler; filter options precision and cheby are not
  283. applicable in this case.
  284. .IP "\fBsoxr\fR" 4
  285. .IX Item "soxr"
  286. select the SoX Resampler (where available); compensation, and filter options
  287. filter_size, phase_shift, exact_rational, filter_type & kaiser_beta, are not
  288. applicable in this case.
  289. .RE
  290. .RS 4
  291. .RE
  292. .IP "\fBfilter_size\fR" 4
  293. .IX Item "filter_size"
  294. For swr only, set resampling filter size, default value is 32.
  295. .IP "\fBphase_shift\fR" 4
  296. .IX Item "phase_shift"
  297. For swr only, set resampling phase shift, default value is 10, and must be in
  298. the interval [0,30].
  299. .IP "\fBlinear_interp\fR" 4
  300. .IX Item "linear_interp"
  301. Use linear interpolation when enabled (the default). Disable it if you want
  302. to preserve speed instead of quality when exact_rational fails.
  303. .IP "\fBexact_rational\fR" 4
  304. .IX Item "exact_rational"
  305. For swr only, when enabled, try to use exact phase_count based on input and
  306. output sample rate. However, if it is larger than \f(CW\*(C`1 << phase_shift\*(C'\fR,
  307. the phase_count will be \f(CW\*(C`1 << phase_shift\*(C'\fR as fallback. Default is enabled.
  308. .IP "\fBcutoff\fR" 4
  309. .IX Item "cutoff"
  310. Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
  311. value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
  312. (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
  313. .IP "\fBprecision\fR" 4
  314. .IX Item "precision"
  315. For soxr only, the precision in bits to which the resampled signal will be
  316. calculated. The default value of 20 (which, with suitable dithering, is
  317. appropriate for a destination bit-depth of 16) gives SoX's 'High Quality'; a
  318. value of 28 gives SoX's 'Very High Quality'.
  319. .IP "\fBcheby\fR" 4
  320. .IX Item "cheby"
  321. For soxr only, selects passband rolloff none (Chebyshev) & higher-precision
  322. approximation for 'irrational' ratios. Default value is 0.
  323. .IP "\fBasync\fR" 4
  324. .IX Item "async"
  325. For swr only, simple 1 parameter audio sync to timestamps using stretching,
  326. squeezing, filling and trimming. Setting this to 1 will enable filling and
  327. trimming, larger values represent the maximum amount in samples that the data
  328. may be stretched or squeezed for each second.
  329. Default value is 0, thus no compensation is applied to make the samples match
  330. the audio timestamps.
  331. .IP "\fBfirst_pts\fR" 4
  332. .IX Item "first_pts"
  333. For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
  334. This allows for padding/trimming at the start of stream. By default, no
  335. assumption is made about the first frame's expected pts, so no padding or
  336. trimming is done. For example, this could be set to 0 to pad the beginning with
  337. silence if an audio stream starts after the video stream or to trim any samples
  338. with a negative pts due to encoder delay.
  339. .IP "\fBmin_comp\fR" 4
  340. .IX Item "min_comp"
  341. For swr only, set the minimum difference between timestamps and audio data (in
  342. seconds) to trigger stretching/squeezing/filling or trimming of the
  343. data to make it match the timestamps. The default is that
  344. stretching/squeezing/filling and trimming is disabled
  345. (\fBmin_comp\fR = \f(CW\*(C`FLT_MAX\*(C'\fR).
  346. .IP "\fBmin_hard_comp\fR" 4
  347. .IX Item "min_hard_comp"
  348. For swr only, set the minimum difference between timestamps and audio data (in
  349. seconds) to trigger adding/dropping samples to make it match the
  350. timestamps. This option effectively is a threshold to select between
  351. hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
  352. all compensation is by default disabled through \fBmin_comp\fR.
  353. The default is 0.1.
  354. .IP "\fBcomp_duration\fR" 4
  355. .IX Item "comp_duration"
  356. For swr only, set duration (in seconds) over which data is stretched/squeezed
  357. to make it match the timestamps. Must be a non-negative double float value,
  358. default value is 1.0.
  359. .IP "\fBmax_soft_comp\fR" 4
  360. .IX Item "max_soft_comp"
  361. For swr only, set maximum factor by which data is stretched/squeezed to make it
  362. match the timestamps. Must be a non-negative double float value, default value
  363. is 0.
  364. .IP "\fBmatrix_encoding\fR" 4
  365. .IX Item "matrix_encoding"
  366. Select matrixed stereo encoding.
  367. .Sp
  368. It accepts the following values:
  369. .RS 4
  370. .IP "\fBnone\fR" 4
  371. .IX Item "none"
  372. select none
  373. .IP "\fBdolby\fR" 4
  374. .IX Item "dolby"
  375. select Dolby
  376. .IP "\fBdplii\fR" 4
  377. .IX Item "dplii"
  378. select Dolby Pro Logic \s-1II\s0
  379. .RE
  380. .RS 4
  381. .Sp
  382. Default value is \f(CW\*(C`none\*(C'\fR.
  383. .RE
  384. .IP "\fBfilter_type\fR" 4
  385. .IX Item "filter_type"
  386. For swr only, select resampling filter type. This only affects resampling
  387. operations.
  388. .Sp
  389. It accepts the following values:
  390. .RS 4
  391. .IP "\fBcubic\fR" 4
  392. .IX Item "cubic"
  393. select cubic
  394. .IP "\fBblackman_nuttall\fR" 4
  395. .IX Item "blackman_nuttall"
  396. select Blackman Nuttall windowed sinc
  397. .IP "\fBkaiser\fR" 4
  398. .IX Item "kaiser"
  399. select Kaiser windowed sinc
  400. .RE
  401. .RS 4
  402. .RE
  403. .IP "\fBkaiser_beta\fR" 4
  404. .IX Item "kaiser_beta"
  405. For swr only, set Kaiser window beta value. Must be a double float value in the
  406. interval [2,16], default value is 9.
  407. .IP "\fBoutput_sample_bits\fR" 4
  408. .IX Item "output_sample_bits"
  409. For swr only, set number of used output sample bits for dithering. Must be an integer in the
  410. interval [0,64], default value is 0, which means it's not used.
  411. .SH "SEE ALSO"
  412. .IX Header "SEE ALSO"
  413. \&\fBffmpeg\fR\|(1), \fBffplay\fR\|(1), \fBffprobe\fR\|(1), \fBlibswresample\fR\|(3)
  414. .SH "AUTHORS"
  415. .IX Header "AUTHORS"
  416. The FFmpeg developers.
  417. .PP
  418. For details about the authorship, see the Git history of the project
  419. (https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
  420. \&\fBgit log\fR in the FFmpeg source directory, or browsing the
  421. online repository at <\fBhttps://git.ffmpeg.org/ffmpeg\fR>.
  422. .PP
  423. Maintainers for the specific components are listed in the file
  424. \&\fI\s-1MAINTAINERS\s0\fR in the source code tree.