yading@10
|
1 =head1 NAME
|
yading@10
|
2
|
yading@10
|
3 ffmpeg-resampler - FFmpeg Resampler
|
yading@10
|
4
|
yading@10
|
5 =head1 DESCRIPTION
|
yading@10
|
6
|
yading@10
|
7
|
yading@10
|
8 The FFmpeg resampler provides an high-level interface to the
|
yading@10
|
9 libswresample library audio resampling utilities. In particular it
|
yading@10
|
10 allows to perform audio resampling, audio channel layout rematrixing,
|
yading@10
|
11 and convert audio format and packing layout.
|
yading@10
|
12
|
yading@10
|
13
|
yading@10
|
14
|
yading@10
|
15 =head1 RESAMPLER OPTIONS
|
yading@10
|
16
|
yading@10
|
17
|
yading@10
|
18 The audio resampler supports the following named options.
|
yading@10
|
19
|
yading@10
|
20 Options may be set by specifying -I<option> I<value> in the
|
yading@10
|
21 FFmpeg tools, I<option>=I<value> for the aresample filter,
|
yading@10
|
22 by setting the value explicitly in the
|
yading@10
|
23 C<SwrContext> options or using the F<libavutil/opt.h> API for
|
yading@10
|
24 programmatic use.
|
yading@10
|
25
|
yading@10
|
26
|
yading@10
|
27 =over 4
|
yading@10
|
28
|
yading@10
|
29
|
yading@10
|
30
|
yading@10
|
31 =item B<ich, in_channel_count>
|
yading@10
|
32
|
yading@10
|
33 Set the number of input channels. Default value is 0. Setting this
|
yading@10
|
34 value is not mandatory if the corresponding channel layout
|
yading@10
|
35 B<in_channel_layout> is set.
|
yading@10
|
36
|
yading@10
|
37
|
yading@10
|
38 =item B<och, out_channel_count>
|
yading@10
|
39
|
yading@10
|
40 Set the number of output channels. Default value is 0. Setting this
|
yading@10
|
41 value is not mandatory if the corresponding channel layout
|
yading@10
|
42 B<out_channel_layout> is set.
|
yading@10
|
43
|
yading@10
|
44
|
yading@10
|
45 =item B<uch, used_channel_count>
|
yading@10
|
46
|
yading@10
|
47 Set the number of used input channels. Default value is 0. This option is
|
yading@10
|
48 only used for special remapping.
|
yading@10
|
49
|
yading@10
|
50
|
yading@10
|
51 =item B<isr, in_sample_rate>
|
yading@10
|
52
|
yading@10
|
53 Set the input sample rate. Default value is 0.
|
yading@10
|
54
|
yading@10
|
55
|
yading@10
|
56 =item B<osr, out_sample_rate>
|
yading@10
|
57
|
yading@10
|
58 Set the output sample rate. Default value is 0.
|
yading@10
|
59
|
yading@10
|
60
|
yading@10
|
61 =item B<isf, in_sample_fmt>
|
yading@10
|
62
|
yading@10
|
63 Specify the input sample format. It is set by default to C<none>.
|
yading@10
|
64
|
yading@10
|
65
|
yading@10
|
66 =item B<osf, out_sample_fmt>
|
yading@10
|
67
|
yading@10
|
68 Specify the output sample format. It is set by default to C<none>.
|
yading@10
|
69
|
yading@10
|
70
|
yading@10
|
71 =item B<tsf, internal_sample_fmt>
|
yading@10
|
72
|
yading@10
|
73 Set the internal sample format. Default value is C<none>.
|
yading@10
|
74 This will automatically be chosen when it is not explicitly set.
|
yading@10
|
75
|
yading@10
|
76
|
yading@10
|
77 =item B<icl, in_channel_layout>
|
yading@10
|
78
|
yading@10
|
79 Set the input channel layout.
|
yading@10
|
80
|
yading@10
|
81
|
yading@10
|
82 =item B<ocl, out_channel_layout>
|
yading@10
|
83
|
yading@10
|
84 Set the output channel layout.
|
yading@10
|
85
|
yading@10
|
86
|
yading@10
|
87 =item B<clev, center_mix_level>
|
yading@10
|
88
|
yading@10
|
89 Set the center mix level. It is a value expressed in deciBel, and must be
|
yading@10
|
90 in the interval [-32,32].
|
yading@10
|
91
|
yading@10
|
92
|
yading@10
|
93 =item B<slev, surround_mix_level>
|
yading@10
|
94
|
yading@10
|
95 Set the surround mix level. It is a value expressed in deciBel, and must
|
yading@10
|
96 be in the interval [-32,32].
|
yading@10
|
97
|
yading@10
|
98
|
yading@10
|
99 =item B<lfe_mix_level>
|
yading@10
|
100
|
yading@10
|
101 Set LFE mix into non LFE level. It is used when there is a LFE input but no
|
yading@10
|
102 LFE output. It is a value expressed in deciBel, and must
|
yading@10
|
103 be in the interval [-32,32].
|
yading@10
|
104
|
yading@10
|
105
|
yading@10
|
106 =item B<rmvol, rematrix_volume>
|
yading@10
|
107
|
yading@10
|
108 Set rematrix volume. Default value is 1.0.
|
yading@10
|
109
|
yading@10
|
110
|
yading@10
|
111 =item B<flags, swr_flags>
|
yading@10
|
112
|
yading@10
|
113 Set flags used by the converter. Default value is 0.
|
yading@10
|
114
|
yading@10
|
115 It supports the following individual flags:
|
yading@10
|
116
|
yading@10
|
117 =over 4
|
yading@10
|
118
|
yading@10
|
119
|
yading@10
|
120 =item B<res>
|
yading@10
|
121
|
yading@10
|
122 force resampling, this flag forces resampling to be used even when the
|
yading@10
|
123 input and output sample rates match.
|
yading@10
|
124
|
yading@10
|
125 =back
|
yading@10
|
126
|
yading@10
|
127
|
yading@10
|
128
|
yading@10
|
129 =item B<dither_scale>
|
yading@10
|
130
|
yading@10
|
131 Set the dither scale. Default value is 1.
|
yading@10
|
132
|
yading@10
|
133
|
yading@10
|
134 =item B<dither_method>
|
yading@10
|
135
|
yading@10
|
136 Set dither method. Default value is 0.
|
yading@10
|
137
|
yading@10
|
138 Supported values:
|
yading@10
|
139
|
yading@10
|
140 =over 4
|
yading@10
|
141
|
yading@10
|
142
|
yading@10
|
143 =item B<rectangular>
|
yading@10
|
144
|
yading@10
|
145 select rectangular dither
|
yading@10
|
146
|
yading@10
|
147 =item B<triangular>
|
yading@10
|
148
|
yading@10
|
149 select triangular dither
|
yading@10
|
150
|
yading@10
|
151 =item B<triangular_hp>
|
yading@10
|
152
|
yading@10
|
153 select triangular dither with high pass
|
yading@10
|
154
|
yading@10
|
155 =item B<lipshitz>
|
yading@10
|
156
|
yading@10
|
157 select lipshitz noise shaping dither
|
yading@10
|
158
|
yading@10
|
159 =item B<shibata>
|
yading@10
|
160
|
yading@10
|
161 select shibata noise shaping dither
|
yading@10
|
162
|
yading@10
|
163 =item B<low_shibata>
|
yading@10
|
164
|
yading@10
|
165 select low shibata noise shaping dither
|
yading@10
|
166
|
yading@10
|
167 =item B<high_shibata>
|
yading@10
|
168
|
yading@10
|
169 select high shibata noise shaping dither
|
yading@10
|
170
|
yading@10
|
171 =item B<f_weighted>
|
yading@10
|
172
|
yading@10
|
173 select f-weighted noise shaping dither
|
yading@10
|
174
|
yading@10
|
175 =item B<modified_e_weighted>
|
yading@10
|
176
|
yading@10
|
177 select modified-e-weighted noise shaping dither
|
yading@10
|
178
|
yading@10
|
179 =item B<improved_e_weighted>
|
yading@10
|
180
|
yading@10
|
181 select improved-e-weighted noise shaping dither
|
yading@10
|
182
|
yading@10
|
183
|
yading@10
|
184 =back
|
yading@10
|
185
|
yading@10
|
186
|
yading@10
|
187
|
yading@10
|
188 =item B<resampler>
|
yading@10
|
189
|
yading@10
|
190 Set resampling engine. Default value is swr.
|
yading@10
|
191
|
yading@10
|
192 Supported values:
|
yading@10
|
193
|
yading@10
|
194 =over 4
|
yading@10
|
195
|
yading@10
|
196
|
yading@10
|
197 =item B<swr>
|
yading@10
|
198
|
yading@10
|
199 select the native SW Resampler; filter options precision and cheby are not
|
yading@10
|
200 applicable in this case.
|
yading@10
|
201
|
yading@10
|
202 =item B<soxr>
|
yading@10
|
203
|
yading@10
|
204 select the SoX Resampler (where available); compensation, and filter options
|
yading@10
|
205 filter_size, phase_shift, filter_type & kaiser_beta, are not applicable in this
|
yading@10
|
206 case.
|
yading@10
|
207
|
yading@10
|
208 =back
|
yading@10
|
209
|
yading@10
|
210
|
yading@10
|
211
|
yading@10
|
212 =item B<filter_size>
|
yading@10
|
213
|
yading@10
|
214 For swr only, set resampling filter size, default value is 32.
|
yading@10
|
215
|
yading@10
|
216
|
yading@10
|
217 =item B<phase_shift>
|
yading@10
|
218
|
yading@10
|
219 For swr only, set resampling phase shift, default value is 10, and must be in
|
yading@10
|
220 the interval [0,30].
|
yading@10
|
221
|
yading@10
|
222
|
yading@10
|
223 =item B<linear_interp>
|
yading@10
|
224
|
yading@10
|
225 Use Linear Interpolation if set to 1, default value is 0.
|
yading@10
|
226
|
yading@10
|
227
|
yading@10
|
228 =item B<cutoff>
|
yading@10
|
229
|
yading@10
|
230 Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
|
yading@10
|
231 value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
|
yading@10
|
232 (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
|
yading@10
|
233
|
yading@10
|
234
|
yading@10
|
235 =item B<precision>
|
yading@10
|
236
|
yading@10
|
237 For soxr only, the precision in bits to which the resampled signal will be
|
yading@10
|
238 calculated. The default value of 20 (which, with suitable dithering, is
|
yading@10
|
239 appropriate for a destination bit-depth of 16) gives SoX's 'High Quality'; a
|
yading@10
|
240 value of 28 gives SoX's 'Very High Quality'.
|
yading@10
|
241
|
yading@10
|
242
|
yading@10
|
243 =item B<cheby>
|
yading@10
|
244
|
yading@10
|
245 For soxr only, selects passband rolloff none (Chebyshev) & higher-precision
|
yading@10
|
246 approximation for 'irrational' ratios. Default value is 0.
|
yading@10
|
247
|
yading@10
|
248
|
yading@10
|
249 =item B<async>
|
yading@10
|
250
|
yading@10
|
251 For swr only, simple 1 parameter audio sync to timestamps using stretching,
|
yading@10
|
252 squeezing, filling and trimming. Setting this to 1 will enable filling and
|
yading@10
|
253 trimming, larger values represent the maximum amount in samples that the data
|
yading@10
|
254 may be stretched or squeezed for each second.
|
yading@10
|
255 Default value is 0, thus no compensation is applied to make the samples match
|
yading@10
|
256 the audio timestamps.
|
yading@10
|
257
|
yading@10
|
258
|
yading@10
|
259 =item B<first_pts>
|
yading@10
|
260
|
yading@10
|
261 For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
|
yading@10
|
262 This allows for padding/trimming at the start of stream. By default, no
|
yading@10
|
263 assumption is made about the first frame's expected pts, so no padding or
|
yading@10
|
264 trimming is done. For example, this could be set to 0 to pad the beginning with
|
yading@10
|
265 silence if an audio stream starts after the video stream or to trim any samples
|
yading@10
|
266 with a negative pts due to encoder delay.
|
yading@10
|
267
|
yading@10
|
268
|
yading@10
|
269 =item B<min_comp>
|
yading@10
|
270
|
yading@10
|
271 For swr only, set the minimum difference between timestamps and audio data (in
|
yading@10
|
272 seconds) to trigger stretching/squeezing/filling or trimming of the
|
yading@10
|
273 data to make it match the timestamps. The default is that
|
yading@10
|
274 stretching/squeezing/filling and trimming is disabled
|
yading@10
|
275 (B<min_comp> = C<FLT_MAX>).
|
yading@10
|
276
|
yading@10
|
277
|
yading@10
|
278 =item B<min_hard_comp>
|
yading@10
|
279
|
yading@10
|
280 For swr only, set the minimum difference between timestamps and audio data (in
|
yading@10
|
281 seconds) to trigger adding/dropping samples to make it match the
|
yading@10
|
282 timestamps. This option effectively is a threshold to select between
|
yading@10
|
283 hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
|
yading@10
|
284 all compensation is by default disabled through B<min_comp>.
|
yading@10
|
285 The default is 0.1.
|
yading@10
|
286
|
yading@10
|
287
|
yading@10
|
288 =item B<comp_duration>
|
yading@10
|
289
|
yading@10
|
290 For swr only, set duration (in seconds) over which data is stretched/squeezed
|
yading@10
|
291 to make it match the timestamps. Must be a non-negative double float value,
|
yading@10
|
292 default value is 1.0.
|
yading@10
|
293
|
yading@10
|
294
|
yading@10
|
295 =item B<max_soft_comp>
|
yading@10
|
296
|
yading@10
|
297 For swr only, set maximum factor by which data is stretched/squeezed to make it
|
yading@10
|
298 match the timestamps. Must be a non-negative double float value, default value
|
yading@10
|
299 is 0.
|
yading@10
|
300
|
yading@10
|
301
|
yading@10
|
302 =item B<matrix_encoding>
|
yading@10
|
303
|
yading@10
|
304 Select matrixed stereo encoding.
|
yading@10
|
305
|
yading@10
|
306 It accepts the following values:
|
yading@10
|
307
|
yading@10
|
308 =over 4
|
yading@10
|
309
|
yading@10
|
310
|
yading@10
|
311 =item B<none>
|
yading@10
|
312
|
yading@10
|
313 select none
|
yading@10
|
314
|
yading@10
|
315 =item B<dolby>
|
yading@10
|
316
|
yading@10
|
317 select Dolby
|
yading@10
|
318
|
yading@10
|
319 =item B<dplii>
|
yading@10
|
320
|
yading@10
|
321 select Dolby Pro Logic II
|
yading@10
|
322
|
yading@10
|
323 =back
|
yading@10
|
324
|
yading@10
|
325
|
yading@10
|
326 Default value is C<none>.
|
yading@10
|
327
|
yading@10
|
328
|
yading@10
|
329 =item B<filter_type>
|
yading@10
|
330
|
yading@10
|
331 For swr only, select resampling filter type. This only affects resampling
|
yading@10
|
332 operations.
|
yading@10
|
333
|
yading@10
|
334 It accepts the following values:
|
yading@10
|
335
|
yading@10
|
336 =over 4
|
yading@10
|
337
|
yading@10
|
338
|
yading@10
|
339 =item B<cubic>
|
yading@10
|
340
|
yading@10
|
341 select cubic
|
yading@10
|
342
|
yading@10
|
343 =item B<blackman_nuttall>
|
yading@10
|
344
|
yading@10
|
345 select Blackman Nuttall Windowed Sinc
|
yading@10
|
346
|
yading@10
|
347 =item B<kaiser>
|
yading@10
|
348
|
yading@10
|
349 select Kaiser Windowed Sinc
|
yading@10
|
350
|
yading@10
|
351 =back
|
yading@10
|
352
|
yading@10
|
353
|
yading@10
|
354
|
yading@10
|
355 =item B<kaiser_beta>
|
yading@10
|
356
|
yading@10
|
357 For swr only, set Kaiser Window Beta value. Must be an integer in the
|
yading@10
|
358 interval [2,16], default value is 9.
|
yading@10
|
359
|
yading@10
|
360
|
yading@10
|
361 =back
|
yading@10
|
362
|
yading@10
|
363
|
yading@10
|
364
|
yading@10
|
365
|
yading@10
|
366 =head1 SEE ALSO
|
yading@10
|
367
|
yading@10
|
368
|
yading@10
|
369
|
yading@10
|
370 ffmpeg(1), ffplay(1), ffprobe(1), ffserver(1), libswresample(3)
|
yading@10
|
371
|
yading@10
|
372
|
yading@10
|
373 =head1 AUTHORS
|
yading@10
|
374
|
yading@10
|
375
|
yading@10
|
376 The FFmpeg developers.
|
yading@10
|
377
|
yading@10
|
378 For details about the authorship, see the Git history of the project
|
yading@10
|
379 (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
|
yading@10
|
380 B<git log> in the FFmpeg source directory, or browsing the
|
yading@10
|
381 online repository at E<lt>B<http://source.ffmpeg.org>E<gt>.
|
yading@10
|
382
|
yading@10
|
383 Maintainers for the specific components are listed in the file
|
yading@10
|
384 F<MAINTAINERS> in the source code tree.
|
yading@10
|
385
|
yading@10
|
386
|
yading@10
|
387
|