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