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