Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

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