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.

232 lines
7.2KB

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