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.

223 lines
6.9KB

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