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