You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

266 lines
7.7KB

  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 input 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. This will automatically be chosen when it is not explicitly set.
  46. @item icl, in_channel_layout
  47. Set the input channel layout.
  48. @item ocl, out_channel_layout
  49. Set the output channel layout.
  50. @item clev, center_mix_level
  51. Set the center mix level. It is a value expressed in deciBel, and must be
  52. in the interval [-32,32].
  53. @item slev, surround_mix_level
  54. Set the surround mix level. It is a value expressed in deciBel, and must
  55. be in the interval [-32,32].
  56. @item lfe_mix_level
  57. Set LFE mix into non LFE level. It is used when there is a LFE input but no
  58. LFE output. It is a value expressed in deciBel, and must
  59. be in the interval [-32,32].
  60. @item rmvol, rematrix_volume
  61. Set rematrix volume. Default value is 1.0.
  62. @item flags, swr_flags
  63. Set flags used by the converter. Default value is 0.
  64. It supports the following individual flags:
  65. @table @option
  66. @item res
  67. force resampling, this flag forces resampling to be used even when the
  68. input and output sample rates match.
  69. @end table
  70. @item dither_scale
  71. Set the dither scale. Default value is 1.
  72. @item dither_method
  73. Set dither method. Default value is 0.
  74. Supported values:
  75. @table @samp
  76. @item rectangular
  77. select rectangular dither
  78. @item triangular
  79. select triangular dither
  80. @item triangular_hp
  81. select triangular dither with high pass
  82. @item lipshitz
  83. select lipshitz noise shaping dither
  84. @item shibata
  85. select shibata noise shaping dither
  86. @item low_shibata
  87. select low shibata noise shaping dither
  88. @item high_shibata
  89. select high shibata noise shaping dither
  90. @item f_weighted
  91. select f-weighted noise shaping dither
  92. @item modified_e_weighted
  93. select modified-e-weighted noise shaping dither
  94. @item improved_e_weighted
  95. select improved-e-weighted noise shaping dither
  96. @end table
  97. @item resampler
  98. Set resampling engine. Default value is swr.
  99. Supported values:
  100. @table @samp
  101. @item swr
  102. select the native SW Resampler; filter options precision and cheby are not
  103. applicable in this case.
  104. @item soxr
  105. select the SoX Resampler (where available); compensation, and filter options
  106. filter_size, phase_shift, filter_type & kaiser_beta, are not applicable in this
  107. case.
  108. @end table
  109. @item filter_size
  110. For swr only, set resampling filter size, default value is 32.
  111. @item phase_shift
  112. For swr only, set resampling phase shift, default value is 10, and must be in
  113. the interval [0,30].
  114. @item linear_interp
  115. Use Linear Interpolation if set to 1, default value is 0.
  116. @item cutoff
  117. Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
  118. value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
  119. (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
  120. @item precision
  121. For soxr only, the precision in bits to which the resampled signal will be
  122. calculated. The default value of 20 (which, with suitable dithering, is
  123. appropriate for a destination bit-depth of 16) gives SoX's 'High Quality'; a
  124. value of 28 gives SoX's 'Very High Quality'.
  125. @item cheby
  126. For soxr only, selects passband rolloff none (Chebyshev) & higher-precision
  127. approximation for 'irrational' ratios. Default value is 0.
  128. @item async
  129. For swr only, simple 1 parameter audio sync to timestamps using stretching,
  130. squeezing, filling and trimming. Setting this to 1 will enable filling and
  131. trimming, larger values represent the maximum amount in samples that the data
  132. may be stretched or squeezed for each second.
  133. Default value is 0, thus no compensation is applied to make the samples match
  134. the audio timestamps.
  135. @item first_pts
  136. For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
  137. This allows for padding/trimming at the start of stream. By default, no
  138. assumption is made about the first frame's expected pts, so no padding or
  139. trimming is done. For example, this could be set to 0 to pad the beginning with
  140. silence if an audio stream starts after the video stream or to trim any samples
  141. with a negative pts due to encoder delay.
  142. @item min_comp
  143. For swr only, set the minimum difference between timestamps and audio data (in
  144. seconds) to trigger stretching/squeezing/filling or trimming of the
  145. data to make it match the timestamps. The default is that
  146. stretching/squeezing/filling and trimming is disabled
  147. (@option{min_comp} = @code{FLT_MAX}).
  148. @item min_hard_comp
  149. For swr only, set the minimum difference between timestamps and audio data (in
  150. seconds) to trigger adding/dropping samples to make it match the
  151. timestamps. This option effectively is a threshold to select between
  152. hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
  153. all compensation is by default disabled through @option{min_comp}.
  154. The default is 0.1.
  155. @item comp_duration
  156. For swr only, set duration (in seconds) over which data is stretched/squeezed
  157. to make it match the timestamps. Must be a non-negative double float value,
  158. default value is 1.0.
  159. @item max_soft_comp
  160. For swr only, set maximum factor by which data is stretched/squeezed to make it
  161. match the timestamps. Must be a non-negative double float value, default value
  162. is 0.
  163. @item matrix_encoding
  164. Select matrixed stereo encoding.
  165. It accepts the following values:
  166. @table @samp
  167. @item none
  168. select none
  169. @item dolby
  170. select Dolby
  171. @item dplii
  172. select Dolby Pro Logic II
  173. @end table
  174. Default value is @code{none}.
  175. @item filter_type
  176. For swr only, select resampling filter type. This only affects resampling
  177. operations.
  178. It accepts the following values:
  179. @table @samp
  180. @item cubic
  181. select cubic
  182. @item blackman_nuttall
  183. select Blackman Nuttall Windowed Sinc
  184. @item kaiser
  185. select Kaiser Windowed Sinc
  186. @end table
  187. @item kaiser_beta
  188. For swr only, set Kaiser Window Beta value. Must be an integer in the
  189. interval [2,16], default value is 9.
  190. @end table
  191. @c man end RESAMPLER OPTIONS
  192. @chapter See Also
  193. @ifhtml
  194. @url{ffmpeg.html,ffmpeg}, @url{ffplay.html,ffplay}, @url{ffprobe.html,ffprobe}, @url{ffserver.html,ffserver},
  195. @url{libswresample.html,libswresample}
  196. @end ifhtml
  197. @ifnothtml
  198. ffmpeg(1), ffplay(1), ffprobe(1), ffserver(1), libswresample(3)
  199. @end ifnothtml
  200. @include authors.texi
  201. @ignore
  202. @setfilename ffmpeg-resampler
  203. @settitle FFmpeg Resampler
  204. @end ignore
  205. @bye