annotate ffmpeg/doc/ffmpeg-resampler.1 @ 13:844d341cf643 tip

Back up before ISMIR
author Yading Song <yading.song@eecs.qmul.ac.uk>
date Thu, 31 Oct 2013 13:17:06 +0000
parents 6840f77b83aa
children
rev   line source
yading@10 1 .\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
yading@10 2 .\"
yading@10 3 .\" Standard preamble:
yading@10 4 .\" ========================================================================
yading@10 5 .de Sp \" Vertical space (when we can't use .PP)
yading@10 6 .if t .sp .5v
yading@10 7 .if n .sp
yading@10 8 ..
yading@10 9 .de Vb \" Begin verbatim text
yading@10 10 .ft CW
yading@10 11 .nf
yading@10 12 .ne \\$1
yading@10 13 ..
yading@10 14 .de Ve \" End verbatim text
yading@10 15 .ft R
yading@10 16 .fi
yading@10 17 ..
yading@10 18 .\" Set up some character translations and predefined strings. \*(-- will
yading@10 19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
yading@10 20 .\" double quote, and \*(R" will give a right double quote. \*(C+ will
yading@10 21 .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
yading@10 22 .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
yading@10 23 .\" nothing in troff, for use with C<>.
yading@10 24 .tr \(*W-
yading@10 25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
yading@10 26 .ie n \{\
yading@10 27 . ds -- \(*W-
yading@10 28 . ds PI pi
yading@10 29 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
yading@10 30 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
yading@10 31 . ds L" ""
yading@10 32 . ds R" ""
yading@10 33 . ds C` ""
yading@10 34 . ds C' ""
yading@10 35 'br\}
yading@10 36 .el\{\
yading@10 37 . ds -- \|\(em\|
yading@10 38 . ds PI \(*p
yading@10 39 . ds L" ``
yading@10 40 . ds R" ''
yading@10 41 'br\}
yading@10 42 .\"
yading@10 43 .\" Escape single quotes in literal strings from groff's Unicode transform.
yading@10 44 .ie \n(.g .ds Aq \(aq
yading@10 45 .el .ds Aq '
yading@10 46 .\"
yading@10 47 .\" If the F register is turned on, we'll generate index entries on stderr for
yading@10 48 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
yading@10 49 .\" entries marked with X<> in POD. Of course, you'll have to process the
yading@10 50 .\" output yourself in some meaningful fashion.
yading@10 51 .ie \nF \{\
yading@10 52 . de IX
yading@10 53 . tm Index:\\$1\t\\n%\t"\\$2"
yading@10 54 ..
yading@10 55 . nr % 0
yading@10 56 . rr F
yading@10 57 .\}
yading@10 58 .el \{\
yading@10 59 . de IX
yading@10 60 ..
yading@10 61 .\}
yading@10 62 .\"
yading@10 63 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
yading@10 64 .\" Fear. Run. Save yourself. No user-serviceable parts.
yading@10 65 . \" fudge factors for nroff and troff
yading@10 66 .if n \{\
yading@10 67 . ds #H 0
yading@10 68 . ds #V .8m
yading@10 69 . ds #F .3m
yading@10 70 . ds #[ \f1
yading@10 71 . ds #] \fP
yading@10 72 .\}
yading@10 73 .if t \{\
yading@10 74 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
yading@10 75 . ds #V .6m
yading@10 76 . ds #F 0
yading@10 77 . ds #[ \&
yading@10 78 . ds #] \&
yading@10 79 .\}
yading@10 80 . \" simple accents for nroff and troff
yading@10 81 .if n \{\
yading@10 82 . ds ' \&
yading@10 83 . ds ` \&
yading@10 84 . ds ^ \&
yading@10 85 . ds , \&
yading@10 86 . ds ~ ~
yading@10 87 . ds /
yading@10 88 .\}
yading@10 89 .if t \{\
yading@10 90 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
yading@10 91 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
yading@10 92 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
yading@10 93 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
yading@10 94 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
yading@10 95 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
yading@10 96 .\}
yading@10 97 . \" troff and (daisy-wheel) nroff accents
yading@10 98 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
yading@10 99 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
yading@10 100 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
yading@10 101 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
yading@10 102 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
yading@10 103 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
yading@10 104 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
yading@10 105 .ds ae a\h'-(\w'a'u*4/10)'e
yading@10 106 .ds Ae A\h'-(\w'A'u*4/10)'E
yading@10 107 . \" corrections for vroff
yading@10 108 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
yading@10 109 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
yading@10 110 . \" for low resolution devices (crt and lpr)
yading@10 111 .if \n(.H>23 .if \n(.V>19 \
yading@10 112 \{\
yading@10 113 . ds : e
yading@10 114 . ds 8 ss
yading@10 115 . ds o a
yading@10 116 . ds d- d\h'-1'\(ga
yading@10 117 . ds D- D\h'-1'\(hy
yading@10 118 . ds th \o'bp'
yading@10 119 . ds Th \o'LP'
yading@10 120 . ds ae ae
yading@10 121 . ds Ae AE
yading@10 122 .\}
yading@10 123 .rm #[ #] #H #V #F C
yading@10 124 .\" ========================================================================
yading@10 125 .\"
yading@10 126 .IX Title "FFMPEG-RESAMPLER 1"
yading@10 127 .TH FFMPEG-RESAMPLER 1 "2013-04-21" " " " "
yading@10 128 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
yading@10 129 .\" way too many mistakes in technical documents.
yading@10 130 .if n .ad l
yading@10 131 .nh
yading@10 132 .SH "NAME"
yading@10 133 ffmpeg\-resampler \- FFmpeg Resampler
yading@10 134 .SH "DESCRIPTION"
yading@10 135 .IX Header "DESCRIPTION"
yading@10 136 The FFmpeg resampler provides an high-level interface to the
yading@10 137 libswresample library audio resampling utilities. In particular it
yading@10 138 allows to perform audio resampling, audio channel layout rematrixing,
yading@10 139 and convert audio format and packing layout.
yading@10 140 .SH "RESAMPLER OPTIONS"
yading@10 141 .IX Header "RESAMPLER OPTIONS"
yading@10 142 The audio resampler supports the following named options.
yading@10 143 .PP
yading@10 144 Options may be set by specifying \-\fIoption\fR \fIvalue\fR in the
yading@10 145 FFmpeg tools, \fIoption\fR=\fIvalue\fR for the aresample filter,
yading@10 146 by setting the value explicitly in the
yading@10 147 \&\f(CW\*(C`SwrContext\*(C'\fR options or using the \fIlibavutil/opt.h\fR \s-1API\s0 for
yading@10 148 programmatic use.
yading@10 149 .IP "\fBich, in_channel_count\fR" 4
yading@10 150 .IX Item "ich, in_channel_count"
yading@10 151 Set the number of input channels. Default value is 0. Setting this
yading@10 152 value is not mandatory if the corresponding channel layout
yading@10 153 \&\fBin_channel_layout\fR is set.
yading@10 154 .IP "\fBoch, out_channel_count\fR" 4
yading@10 155 .IX Item "och, out_channel_count"
yading@10 156 Set the number of output channels. Default value is 0. Setting this
yading@10 157 value is not mandatory if the corresponding channel layout
yading@10 158 \&\fBout_channel_layout\fR is set.
yading@10 159 .IP "\fBuch, used_channel_count\fR" 4
yading@10 160 .IX Item "uch, used_channel_count"
yading@10 161 Set the number of used input channels. Default value is 0. This option is
yading@10 162 only used for special remapping.
yading@10 163 .IP "\fBisr, in_sample_rate\fR" 4
yading@10 164 .IX Item "isr, in_sample_rate"
yading@10 165 Set the input sample rate. Default value is 0.
yading@10 166 .IP "\fBosr, out_sample_rate\fR" 4
yading@10 167 .IX Item "osr, out_sample_rate"
yading@10 168 Set the output sample rate. Default value is 0.
yading@10 169 .IP "\fBisf, in_sample_fmt\fR" 4
yading@10 170 .IX Item "isf, in_sample_fmt"
yading@10 171 Specify the input sample format. It is set by default to \f(CW\*(C`none\*(C'\fR.
yading@10 172 .IP "\fBosf, out_sample_fmt\fR" 4
yading@10 173 .IX Item "osf, out_sample_fmt"
yading@10 174 Specify the output sample format. It is set by default to \f(CW\*(C`none\*(C'\fR.
yading@10 175 .IP "\fBtsf, internal_sample_fmt\fR" 4
yading@10 176 .IX Item "tsf, internal_sample_fmt"
yading@10 177 Set the internal sample format. Default value is \f(CW\*(C`none\*(C'\fR.
yading@10 178 This will automatically be chosen when it is not explicitly set.
yading@10 179 .IP "\fBicl, in_channel_layout\fR" 4
yading@10 180 .IX Item "icl, in_channel_layout"
yading@10 181 Set the input channel layout.
yading@10 182 .IP "\fBocl, out_channel_layout\fR" 4
yading@10 183 .IX Item "ocl, out_channel_layout"
yading@10 184 Set the output channel layout.
yading@10 185 .IP "\fBclev, center_mix_level\fR" 4
yading@10 186 .IX Item "clev, center_mix_level"
yading@10 187 Set the center mix level. It is a value expressed in deciBel, and must be
yading@10 188 in the interval [\-32,32].
yading@10 189 .IP "\fBslev, surround_mix_level\fR" 4
yading@10 190 .IX Item "slev, surround_mix_level"
yading@10 191 Set the surround mix level. It is a value expressed in deciBel, and must
yading@10 192 be in the interval [\-32,32].
yading@10 193 .IP "\fBlfe_mix_level\fR" 4
yading@10 194 .IX Item "lfe_mix_level"
yading@10 195 Set \s-1LFE\s0 mix into non \s-1LFE\s0 level. It is used when there is a \s-1LFE\s0 input but no
yading@10 196 \&\s-1LFE\s0 output. It is a value expressed in deciBel, and must
yading@10 197 be in the interval [\-32,32].
yading@10 198 .IP "\fBrmvol, rematrix_volume\fR" 4
yading@10 199 .IX Item "rmvol, rematrix_volume"
yading@10 200 Set rematrix volume. Default value is 1.0.
yading@10 201 .IP "\fBflags, swr_flags\fR" 4
yading@10 202 .IX Item "flags, swr_flags"
yading@10 203 Set flags used by the converter. Default value is 0.
yading@10 204 .Sp
yading@10 205 It supports the following individual flags:
yading@10 206 .RS 4
yading@10 207 .IP "\fBres\fR" 4
yading@10 208 .IX Item "res"
yading@10 209 force resampling, this flag forces resampling to be used even when the
yading@10 210 input and output sample rates match.
yading@10 211 .RE
yading@10 212 .RS 4
yading@10 213 .RE
yading@10 214 .IP "\fBdither_scale\fR" 4
yading@10 215 .IX Item "dither_scale"
yading@10 216 Set the dither scale. Default value is 1.
yading@10 217 .IP "\fBdither_method\fR" 4
yading@10 218 .IX Item "dither_method"
yading@10 219 Set dither method. Default value is 0.
yading@10 220 .Sp
yading@10 221 Supported values:
yading@10 222 .RS 4
yading@10 223 .IP "\fBrectangular\fR" 4
yading@10 224 .IX Item "rectangular"
yading@10 225 select rectangular dither
yading@10 226 .IP "\fBtriangular\fR" 4
yading@10 227 .IX Item "triangular"
yading@10 228 select triangular dither
yading@10 229 .IP "\fBtriangular_hp\fR" 4
yading@10 230 .IX Item "triangular_hp"
yading@10 231 select triangular dither with high pass
yading@10 232 .IP "\fBlipshitz\fR" 4
yading@10 233 .IX Item "lipshitz"
yading@10 234 select lipshitz noise shaping dither
yading@10 235 .IP "\fBshibata\fR" 4
yading@10 236 .IX Item "shibata"
yading@10 237 select shibata noise shaping dither
yading@10 238 .IP "\fBlow_shibata\fR" 4
yading@10 239 .IX Item "low_shibata"
yading@10 240 select low shibata noise shaping dither
yading@10 241 .IP "\fBhigh_shibata\fR" 4
yading@10 242 .IX Item "high_shibata"
yading@10 243 select high shibata noise shaping dither
yading@10 244 .IP "\fBf_weighted\fR" 4
yading@10 245 .IX Item "f_weighted"
yading@10 246 select f\-weighted noise shaping dither
yading@10 247 .IP "\fBmodified_e_weighted\fR" 4
yading@10 248 .IX Item "modified_e_weighted"
yading@10 249 select modified-e-weighted noise shaping dither
yading@10 250 .IP "\fBimproved_e_weighted\fR" 4
yading@10 251 .IX Item "improved_e_weighted"
yading@10 252 select improved-e-weighted noise shaping dither
yading@10 253 .RE
yading@10 254 .RS 4
yading@10 255 .RE
yading@10 256 .IP "\fBresampler\fR" 4
yading@10 257 .IX Item "resampler"
yading@10 258 Set resampling engine. Default value is swr.
yading@10 259 .Sp
yading@10 260 Supported values:
yading@10 261 .RS 4
yading@10 262 .IP "\fBswr\fR" 4
yading@10 263 .IX Item "swr"
yading@10 264 select the native \s-1SW\s0 Resampler; filter options precision and cheby are not
yading@10 265 applicable in this case.
yading@10 266 .IP "\fBsoxr\fR" 4
yading@10 267 .IX Item "soxr"
yading@10 268 select the SoX Resampler (where available); compensation, and filter options
yading@10 269 filter_size, phase_shift, filter_type & kaiser_beta, are not applicable in this
yading@10 270 case.
yading@10 271 .RE
yading@10 272 .RS 4
yading@10 273 .RE
yading@10 274 .IP "\fBfilter_size\fR" 4
yading@10 275 .IX Item "filter_size"
yading@10 276 For swr only, set resampling filter size, default value is 32.
yading@10 277 .IP "\fBphase_shift\fR" 4
yading@10 278 .IX Item "phase_shift"
yading@10 279 For swr only, set resampling phase shift, default value is 10, and must be in
yading@10 280 the interval [0,30].
yading@10 281 .IP "\fBlinear_interp\fR" 4
yading@10 282 .IX Item "linear_interp"
yading@10 283 Use Linear Interpolation if set to 1, default value is 0.
yading@10 284 .IP "\fBcutoff\fR" 4
yading@10 285 .IX Item "cutoff"
yading@10 286 Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
yading@10 287 value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
yading@10 288 (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
yading@10 289 .IP "\fBprecision\fR" 4
yading@10 290 .IX Item "precision"
yading@10 291 For soxr only, the precision in bits to which the resampled signal will be
yading@10 292 calculated. The default value of 20 (which, with suitable dithering, is
yading@10 293 appropriate for a destination bit-depth of 16) gives SoX's 'High Quality'; a
yading@10 294 value of 28 gives SoX's 'Very High Quality'.
yading@10 295 .IP "\fBcheby\fR" 4
yading@10 296 .IX Item "cheby"
yading@10 297 For soxr only, selects passband rolloff none (Chebyshev) & higher-precision
yading@10 298 approximation for 'irrational' ratios. Default value is 0.
yading@10 299 .IP "\fBasync\fR" 4
yading@10 300 .IX Item "async"
yading@10 301 For swr only, simple 1 parameter audio sync to timestamps using stretching,
yading@10 302 squeezing, filling and trimming. Setting this to 1 will enable filling and
yading@10 303 trimming, larger values represent the maximum amount in samples that the data
yading@10 304 may be stretched or squeezed for each second.
yading@10 305 Default value is 0, thus no compensation is applied to make the samples match
yading@10 306 the audio timestamps.
yading@10 307 .IP "\fBfirst_pts\fR" 4
yading@10 308 .IX Item "first_pts"
yading@10 309 For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
yading@10 310 This allows for padding/trimming at the start of stream. By default, no
yading@10 311 assumption is made about the first frame's expected pts, so no padding or
yading@10 312 trimming is done. For example, this could be set to 0 to pad the beginning with
yading@10 313 silence if an audio stream starts after the video stream or to trim any samples
yading@10 314 with a negative pts due to encoder delay.
yading@10 315 .IP "\fBmin_comp\fR" 4
yading@10 316 .IX Item "min_comp"
yading@10 317 For swr only, set the minimum difference between timestamps and audio data (in
yading@10 318 seconds) to trigger stretching/squeezing/filling or trimming of the
yading@10 319 data to make it match the timestamps. The default is that
yading@10 320 stretching/squeezing/filling and trimming is disabled
yading@10 321 (\fBmin_comp\fR = \f(CW\*(C`FLT_MAX\*(C'\fR).
yading@10 322 .IP "\fBmin_hard_comp\fR" 4
yading@10 323 .IX Item "min_hard_comp"
yading@10 324 For swr only, set the minimum difference between timestamps and audio data (in
yading@10 325 seconds) to trigger adding/dropping samples to make it match the
yading@10 326 timestamps. This option effectively is a threshold to select between
yading@10 327 hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
yading@10 328 all compensation is by default disabled through \fBmin_comp\fR.
yading@10 329 The default is 0.1.
yading@10 330 .IP "\fBcomp_duration\fR" 4
yading@10 331 .IX Item "comp_duration"
yading@10 332 For swr only, set duration (in seconds) over which data is stretched/squeezed
yading@10 333 to make it match the timestamps. Must be a non-negative double float value,
yading@10 334 default value is 1.0.
yading@10 335 .IP "\fBmax_soft_comp\fR" 4
yading@10 336 .IX Item "max_soft_comp"
yading@10 337 For swr only, set maximum factor by which data is stretched/squeezed to make it
yading@10 338 match the timestamps. Must be a non-negative double float value, default value
yading@10 339 is 0.
yading@10 340 .IP "\fBmatrix_encoding\fR" 4
yading@10 341 .IX Item "matrix_encoding"
yading@10 342 Select matrixed stereo encoding.
yading@10 343 .Sp
yading@10 344 It accepts the following values:
yading@10 345 .RS 4
yading@10 346 .IP "\fBnone\fR" 4
yading@10 347 .IX Item "none"
yading@10 348 select none
yading@10 349 .IP "\fBdolby\fR" 4
yading@10 350 .IX Item "dolby"
yading@10 351 select Dolby
yading@10 352 .IP "\fBdplii\fR" 4
yading@10 353 .IX Item "dplii"
yading@10 354 select Dolby Pro Logic \s-1II\s0
yading@10 355 .RE
yading@10 356 .RS 4
yading@10 357 .Sp
yading@10 358 Default value is \f(CW\*(C`none\*(C'\fR.
yading@10 359 .RE
yading@10 360 .IP "\fBfilter_type\fR" 4
yading@10 361 .IX Item "filter_type"
yading@10 362 For swr only, select resampling filter type. This only affects resampling
yading@10 363 operations.
yading@10 364 .Sp
yading@10 365 It accepts the following values:
yading@10 366 .RS 4
yading@10 367 .IP "\fBcubic\fR" 4
yading@10 368 .IX Item "cubic"
yading@10 369 select cubic
yading@10 370 .IP "\fBblackman_nuttall\fR" 4
yading@10 371 .IX Item "blackman_nuttall"
yading@10 372 select Blackman Nuttall Windowed Sinc
yading@10 373 .IP "\fBkaiser\fR" 4
yading@10 374 .IX Item "kaiser"
yading@10 375 select Kaiser Windowed Sinc
yading@10 376 .RE
yading@10 377 .RS 4
yading@10 378 .RE
yading@10 379 .IP "\fBkaiser_beta\fR" 4
yading@10 380 .IX Item "kaiser_beta"
yading@10 381 For swr only, set Kaiser Window Beta value. Must be an integer in the
yading@10 382 interval [2,16], default value is 9.
yading@10 383 .SH "SEE ALSO"
yading@10 384 .IX Header "SEE ALSO"
yading@10 385 \&\fIffmpeg\fR\|(1), \fIffplay\fR\|(1), \fIffprobe\fR\|(1), \fIffserver\fR\|(1), \fIlibswresample\fR\|(3)
yading@10 386 .SH "AUTHORS"
yading@10 387 .IX Header "AUTHORS"
yading@10 388 The FFmpeg developers.
yading@10 389 .PP
yading@10 390 For details about the authorship, see the Git history of the project
yading@10 391 (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
yading@10 392 \&\fBgit log\fR in the FFmpeg source directory, or browsing the
yading@10 393 online repository at <\fBhttp://source.ffmpeg.org\fR>.
yading@10 394 .PP
yading@10 395 Maintainers for the specific components are listed in the file
yading@10 396 \&\fI\s-1MAINTAINERS\s0\fR in the source code tree.