Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. =encoding utf8
  2.  
  3. =head1 NAME
  4.  
  5. ffmpeg-resampler - FFmpeg Resampler
  6.  
  7. =head1 DESCRIPTION
  8.  
  9.  
  10. The FFmpeg resampler provides a high-level interface to the
  11. libswresample library audio resampling utilities. In particular it
  12. allows one to perform audio resampling, audio channel layout rematrixing,
  13. and convert audio format and packing layout.
  14.  
  15.  
  16.  
  17. =head1 RESAMPLER OPTIONS
  18.  
  19.  
  20. The audio resampler supports the following named options.
  21.  
  22. Options may be set by specifying -I<option> I<value> in the
  23. FFmpeg tools, I<option>=I<value> for the aresample filter,
  24. by setting the value explicitly in the
  25. C<SwrContext> options or using the F<libavutil/opt.h> API for
  26. programmatic use.
  27.  
  28.  
  29. =over 4
  30.  
  31.  
  32.  
  33. =item B<ich, in_channel_count>
  34.  
  35. Set the number of input channels. Default value is 0. Setting this
  36. value is not mandatory if the corresponding channel layout
  37. B<in_channel_layout> is set.
  38.  
  39.  
  40. =item B<och, out_channel_count>
  41.  
  42. Set the number of output channels. Default value is 0. Setting this
  43. value is not mandatory if the corresponding channel layout
  44. B<out_channel_layout> is set.
  45.  
  46.  
  47. =item B<uch, used_channel_count>
  48.  
  49. Set the number of used input channels. Default value is 0. This option is
  50. only used for special remapping.
  51.  
  52.  
  53. =item B<isr, in_sample_rate>
  54.  
  55. Set the input sample rate. Default value is 0.
  56.  
  57.  
  58. =item B<osr, out_sample_rate>
  59.  
  60. Set the output sample rate. Default value is 0.
  61.  
  62.  
  63. =item B<isf, in_sample_fmt>
  64.  
  65. Specify the input sample format. It is set by default to C<none>.
  66.  
  67.  
  68. =item B<osf, out_sample_fmt>
  69.  
  70. Specify the output sample format. It is set by default to C<none>.
  71.  
  72.  
  73. =item B<tsf, internal_sample_fmt>
  74.  
  75. Set the internal sample format. Default value is C<none>.
  76. This will automatically be chosen when it is not explicitly set.
  77.  
  78.  
  79. =item B<icl, in_channel_layout>
  80.  
  81.  
  82. =item B<ocl, out_channel_layout>
  83.  
  84. Set the input/output channel layout.
  85.  
  86. See B<the Channel Layout section in the ffmpeg-utils(1) manual>
  87. for the required syntax.
  88.  
  89.  
  90. =item B<clev, center_mix_level>
  91.  
  92. Set the center mix level. It is a value expressed in deciBel, and must be
  93. in the interval [-32,32].
  94.  
  95.  
  96. =item B<slev, surround_mix_level>
  97.  
  98. Set the surround mix level. It is a value expressed in deciBel, and must
  99. be in the interval [-32,32].
  100.  
  101.  
  102. =item B<lfe_mix_level>
  103.  
  104. Set LFE mix into non LFE level. It is used when there is a LFE input but no
  105. LFE output. It is a value expressed in deciBel, and must
  106. be in the interval [-32,32].
  107.  
  108.  
  109. =item B<rmvol, rematrix_volume>
  110.  
  111. Set rematrix volume. Default value is 1.0.
  112.  
  113.  
  114. =item B<rematrix_maxval>
  115.  
  116. Set maximum output value for rematrixing.
  117. This can be used to prevent clipping vs. preventing volumn reduction
  118. A value of 1.0 prevents cliping.
  119.  
  120.  
  121. =item B<flags, swr_flags>
  122.  
  123. Set flags used by the converter. Default value is 0.
  124.  
  125. It supports the following individual flags:
  126.  
  127. =over 4
  128.  
  129.  
  130. =item B<res>
  131.  
  132. force resampling, this flag forces resampling to be used even when the
  133. input and output sample rates match.
  134.  
  135. =back
  136.  
  137.  
  138.  
  139. =item B<dither_scale>
  140.  
  141. Set the dither scale. Default value is 1.
  142.  
  143.  
  144. =item B<dither_method>
  145.  
  146. Set dither method. Default value is 0.
  147.  
  148. Supported values:
  149.  
  150. =over 4
  151.  
  152.  
  153. =item B<rectangular>
  154.  
  155. select rectangular dither
  156.  
  157. =item B<triangular>
  158.  
  159. select triangular dither
  160.  
  161. =item B<triangular_hp>
  162.  
  163. select triangular dither with high pass
  164.  
  165. =item B<lipshitz>
  166.  
  167. select lipshitz noise shaping dither
  168.  
  169. =item B<shibata>
  170.  
  171. select shibata noise shaping dither
  172.  
  173. =item B<low_shibata>
  174.  
  175. select low shibata noise shaping dither
  176.  
  177. =item B<high_shibata>
  178.  
  179. select high shibata noise shaping dither
  180.  
  181. =item B<f_weighted>
  182.  
  183. select f-weighted noise shaping dither
  184.  
  185. =item B<modified_e_weighted>
  186.  
  187. select modified-e-weighted noise shaping dither
  188.  
  189. =item B<improved_e_weighted>
  190.  
  191. select improved-e-weighted noise shaping dither
  192.  
  193.  
  194. =back
  195.  
  196.  
  197.  
  198. =item B<resampler>
  199.  
  200. Set resampling engine. Default value is swr.
  201.  
  202. Supported values:
  203.  
  204. =over 4
  205.  
  206.  
  207. =item B<swr>
  208.  
  209. select the native SW Resampler; filter options precision and cheby are not
  210. applicable in this case.
  211.  
  212. =item B<soxr>
  213.  
  214. select the SoX Resampler (where available); compensation, and filter options
  215. filter_size, phase_shift, filter_type & kaiser_beta, are not applicable in this
  216. case.
  217.  
  218. =back
  219.  
  220.  
  221.  
  222. =item B<filter_size>
  223.  
  224. For swr only, set resampling filter size, default value is 32.
  225.  
  226.  
  227. =item B<phase_shift>
  228.  
  229. For swr only, set resampling phase shift, default value is 10, and must be in
  230. the interval [0,30].
  231.  
  232.  
  233. =item B<linear_interp>
  234.  
  235. Use Linear Interpolation if set to 1, default value is 0.
  236.  
  237.  
  238. =item B<cutoff>
  239.  
  240. Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
  241. value between 0 and 1.  Default value is 0.97 with swr, and 0.91 with soxr
  242. (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
  243.  
  244.  
  245. =item B<precision>
  246.  
  247. For soxr only, the precision in bits to which the resampled signal will be
  248. calculated.  The default value of 20 (which, with suitable dithering, is
  249. appropriate for a destination bit-depth of 16) gives SoX's 'High Quality'; a
  250. value of 28 gives SoX's 'Very High Quality'.
  251.  
  252.  
  253. =item B<cheby>
  254.  
  255. For soxr only, selects passband rolloff none (Chebyshev) & higher-precision
  256. approximation for 'irrational' ratios. Default value is 0.
  257.  
  258.  
  259. =item B<async>
  260.  
  261. For swr only, simple 1 parameter audio sync to timestamps using stretching,
  262. squeezing, filling and trimming. Setting this to 1 will enable filling and
  263. trimming, larger values represent the maximum amount in samples that the data
  264. may be stretched or squeezed for each second.
  265. Default value is 0, thus no compensation is applied to make the samples match
  266. the audio timestamps.
  267.  
  268.  
  269. =item B<first_pts>
  270.  
  271. For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
  272. This allows for padding/trimming at the start of stream. By default, no
  273. assumption is made about the first frame's expected pts, so no padding or
  274. trimming is done. For example, this could be set to 0 to pad the beginning with
  275. silence if an audio stream starts after the video stream or to trim any samples
  276. with a negative pts due to encoder delay.
  277.  
  278.  
  279. =item B<min_comp>
  280.  
  281. For swr only, set the minimum difference between timestamps and audio data (in
  282. seconds) to trigger stretching/squeezing/filling or trimming of the
  283. data to make it match the timestamps. The default is that
  284. stretching/squeezing/filling and trimming is disabled
  285. (B<min_comp> = C<FLT_MAX>).
  286.  
  287.  
  288. =item B<min_hard_comp>
  289.  
  290. For swr only, set the minimum difference between timestamps and audio data (in
  291. seconds) to trigger adding/dropping samples to make it match the
  292. timestamps.  This option effectively is a threshold to select between
  293. hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
  294. all compensation is by default disabled through B<min_comp>.
  295. The default is 0.1.
  296.  
  297.  
  298. =item B<comp_duration>
  299.  
  300. For swr only, set duration (in seconds) over which data is stretched/squeezed
  301. to make it match the timestamps. Must be a non-negative double float value,
  302. default value is 1.0.
  303.  
  304.  
  305. =item B<max_soft_comp>
  306.  
  307. For swr only, set maximum factor by which data is stretched/squeezed to make it
  308. match the timestamps. Must be a non-negative double float value, default value
  309. is 0.
  310.  
  311.  
  312. =item B<matrix_encoding>
  313.  
  314. Select matrixed stereo encoding.
  315.  
  316. It accepts the following values:
  317.  
  318. =over 4
  319.  
  320.  
  321. =item B<none>
  322.  
  323. select none
  324.  
  325. =item B<dolby>
  326.  
  327. select Dolby
  328.  
  329. =item B<dplii>
  330.  
  331. select Dolby Pro Logic II
  332.  
  333. =back
  334.  
  335.  
  336. Default value is C<none>.
  337.  
  338.  
  339. =item B<filter_type>
  340.  
  341. For swr only, select resampling filter type. This only affects resampling
  342. operations.
  343.  
  344. It accepts the following values:
  345.  
  346. =over 4
  347.  
  348.  
  349. =item B<cubic>
  350.  
  351. select cubic
  352.  
  353. =item B<blackman_nuttall>
  354.  
  355. select Blackman Nuttall Windowed Sinc
  356.  
  357. =item B<kaiser>
  358.  
  359. select Kaiser Windowed Sinc
  360.  
  361. =back
  362.  
  363.  
  364.  
  365. =item B<kaiser_beta>
  366.  
  367. For swr only, set Kaiser Window Beta value. Must be an integer in the
  368. interval [2,16], default value is 9.
  369.  
  370.  
  371. =item B<output_sample_bits>
  372.  
  373. For swr only, set number of used output sample bits for dithering. Must be an integer in the
  374. interval [0,64], default value is 0, which means it's not used.
  375.  
  376.  
  377. =back
  378.  
  379.  
  380.  
  381.  
  382. =head1 SEE ALSO
  383.  
  384.  
  385.  
  386. ffmpeg(1), ffplay(1), ffprobe(1), ffserver(1), libswresample(3)
  387.  
  388.  
  389. =head1 AUTHORS
  390.  
  391.  
  392. The FFmpeg developers.
  393.  
  394. For details about the authorship, see the Git history of the project
  395. (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
  396. B<git log> in the FFmpeg source directory, or browsing the
  397. online repository at E<lt>B<http://source.ffmpeg.org>E<gt>.
  398.  
  399. Maintainers for the specific components are listed in the file
  400. F<MAINTAINERS> in the source code tree.
  401.  
  402.  
  403.  
  404.