ffmpeg-resampler.texi 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. \input texinfo @c -*- texinfo -*-
  2. @settitle FFmpeg Resampler Documentation
  3. @titlepage
  4. @center @titlefont{FFmpeg Resampler Documentation}
  5. @end titlepage
  6. @top
  7. @contents
  8. @chapter Description
  9. @c man begin DESCRIPTION
  10. The FFmpeg resampler provides an high-level interface to the
  11. libswresample library audio resampling utilities. In particular it
  12. allows to perform audio resampling, audio channel layout rematrixing,
  13. and convert audio format and packing layout.
  14. @c man end DESCRIPTION
  15. @chapter Resampler Options
  16. @c man begin RESAMPLER OPTIONS
  17. The audio resampler supports the following named options.
  18. Options may be set by specifying -@var{option} @var{value} in the
  19. FFmpeg tools, @var{option}=@var{value} for the aresample filter,
  20. by setting the value explicitly in the
  21. @code{SwrContext} options or using the @file{libavutil/opt.h} API for
  22. programmatic use.
  23. @table @option
  24. @item ich, in_channel_count
  25. Set the number of input channels. Default value is 0. Setting this
  26. value is not mandatory if the corresponding channel layout
  27. @option{in_channel_layout} is set.
  28. @item och, out_channel_count
  29. Set the number of output channels. Default value is 0. Setting this
  30. value is not mandatory if the corresponding channel layout
  31. @option{out_channel_layout} is set.
  32. @item uch, used_channel_count
  33. Set the number of used channels. Default value is 0. This option is
  34. only used for special remapping.
  35. @item isr, in_sample_rate
  36. Set the input sample rate. Default value is 0.
  37. @item osr, out_sample_rate
  38. Set the output sample rate. Default value is 0.
  39. @item isf, in_sample_fmt
  40. Specify the input sample format. It is set by default to @code{none}.
  41. @item osf, out_sample_fmt
  42. Specify the output sample format. It is set by default to @code{none}.
  43. @item tsf, internal_sample_fmt
  44. Set the internal sample format. Default value is @code{none}.
  45. @item icl, in_channel_layout
  46. Set the input channel layout.
  47. @item ocl, out_channel_layout
  48. Set the output channel layout.
  49. @item clev, center_mix_level
  50. Set center mix level. It is a value expressed in deciBel, and must be
  51. inclusively included between -32 and +32.
  52. @item slev, surround_mix_level
  53. Set surround mix level. It is a value expressed in deciBel, and must
  54. be inclusively included between -32 and +32.
  55. @item lfe_mix_evel
  56. Set LFE mix level.
  57. @item rmvol, rematrix_volume
  58. Set rematrix volume. Default value is 1.0.
  59. @item flags, swr_flags
  60. Set flags used by the converter. Default value is 0.
  61. It supports the following individual flags:
  62. @table @option
  63. @item res
  64. force resampling
  65. @end table
  66. @item dither_scale
  67. Set the dither scale. Default value is 1.
  68. @item dither_method
  69. Set dither method. Default value is 0.
  70. Supported values:
  71. @table @samp
  72. @item rectangular
  73. select rectangular dither
  74. @item triangular
  75. select triangular dither
  76. @item triangular_hp
  77. select triangular dither with high pass
  78. @end table
  79. @item resampler
  80. Set resampling engine. Default value is swr.
  81. Supported values:
  82. @table @samp
  83. @item swr
  84. select the native SW Resampler; filter options precision and cheby are not
  85. applicable in this case.
  86. @item soxr
  87. select the SoX Resampler (where available); compensation, and filter options
  88. filter_size, phase_shift, filter_type & kaiser_beta, are not applicable in this
  89. case.
  90. @end table
  91. @item filter_size
  92. For swr only, set resampling filter size, default value is 32.
  93. @item phase_shift
  94. For swr only, set resampling phase shift, default value is 10, must be included
  95. between 0 and 30.
  96. @item linear_interp
  97. Use Linear Interpolation if set to 1, default value is 0.
  98. @item cutoff
  99. Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
  100. value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
  101. (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
  102. @item precision
  103. For soxr only, the precision in bits to which the resampled signal will be
  104. calculated. The default value of 20 (which, with suitable dithering, is
  105. appropriate for a destination bit-depth of 16) gives SoX's 'High Quality'; a
  106. value of 28 gives SoX's 'Very High Quality'.
  107. @item cheby
  108. For soxr only, selects passband rolloff none (Chebyshev) & higher-precision
  109. approximation for 'irrational' ratios. Default value is 0.
  110. @item async
  111. For swr only, simple 1 parameter audio sync to timestamps using stretching,
  112. squeezing, filling and trimming. Setting this to 1 will enable filling and
  113. trimming, larger values represent the maximum amount in samples that the data
  114. may be stretched or squeezed for each second.
  115. Default value is 0, thus no compensation is applied to make the samples match
  116. the audio timestamps.
  117. @item min_comp
  118. For swr only, set the minimum difference between timestamps and audio data (in
  119. seconds) to trigger stretching/squeezing/filling or trimming of the
  120. data to make it match the timestamps. The default is that
  121. stretching/squeezing/filling and trimming is disabled
  122. (@option{min_comp} = @code{FLT_MAX}).
  123. @item min_hard_comp
  124. For swr only, set the minimum difference between timestamps and audio data (in
  125. seconds) to trigger adding/dropping samples to make it match the
  126. timestamps. This option effectively is a threshold to select between
  127. hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
  128. all compensation is by default disabled through @option{min_comp}.
  129. The default is 0.1.
  130. @item comp_duration
  131. For swr only, set duration (in seconds) over which data is stretched/squeezed
  132. to make it match the timestamps. Must be a non-negative double float value,
  133. default value is 1.0.
  134. @item max_soft_comp
  135. For swr only, set maximum factor by which data is stretched/squeezed to make it
  136. match the timestamps. Must be a non-negative double float value, default value
  137. is 0.
  138. @item matrix_encoding
  139. Select matrixed stereo encoding.
  140. It accepts the following values:
  141. @table @samp
  142. @item none
  143. select none
  144. @item dolby
  145. select Dolby
  146. @item dplii
  147. select Dolby Pro Logic II
  148. @end table
  149. Default value is @code{none}.
  150. @item filter_type
  151. For swr only, select resampling filter type. This only affects resampling
  152. operations.
  153. It accepts the following values:
  154. @table @samp
  155. @item cubic
  156. select cubic
  157. @item blackman_nuttall
  158. select Blackman Nuttall Windowed Sinc
  159. @item kaiser
  160. select Kaiser Windowed Sinc
  161. @end table
  162. @item kaiser_beta
  163. For swr only, set Kaiser Window Beta value. Must be an integer included between
  164. 2 and 16, default value is 9.
  165. @end table
  166. @c man end RESAMPLER OPTIONS
  167. @chapter See Also
  168. @ifhtml
  169. @url{ffmpeg.html,ffmpeg}, @url{ffplay.html,ffplay}, @url{ffprobe.html,ffprobe}, @url{ffserver.html,ffserver},
  170. @url{libswresample.html,libswresample}
  171. @end ifhtml
  172. @ifnothtml
  173. ffmpeg(1), ffplay(1), ffprobe(1), ffserver(1), libswresample(3)
  174. @end ifnothtml
  175. @include authors.texi
  176. @ignore
  177. @setfilename ffmpeg-resampler
  178. @settitle FFmpeg Resampler
  179. @end ignore
  180. @bye