1 @chapter Filtering Introduction
2 @c man begin FILTERING INTRODUCTION
4 Filtering in FFmpeg is enabled through the libavfilter library.
6 In libavfilter, a filter can have multiple inputs and multiple
8 To illustrate the sorts of things that are possible, we consider the
13 input --> split ---------------------> overlay --> output
16 +-----> crop --> vflip -------+
19 This filtergraph splits the input stream in two streams, then sends one
20 stream through the crop filter and the vflip filter, before merging it
21 back with the other stream by overlaying it on top. You can use the
22 following command to achieve this:
25 ffmpeg -i INPUT -vf "split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2" OUTPUT
28 The result will be that the top half of the video is mirrored
29 onto the bottom half of the output video.
31 Filters in the same linear chain are separated by commas, and distinct
32 linear chains of filters are separated by semicolons. In our example,
33 @var{crop,vflip} are in one linear chain, @var{split} and
34 @var{overlay} are separately in another. The points where the linear
35 chains join are labelled by names enclosed in square brackets. In the
36 example, the split filter generates two outputs that are associated to
37 the labels @var{[main]} and @var{[tmp]}.
39 The stream sent to the second output of @var{split}, labelled as
40 @var{[tmp]}, is processed through the @var{crop} filter, which crops
41 away the lower half part of the video, and then vertically flipped. The
42 @var{overlay} filter takes in input the first unchanged output of the
43 split filter (which was labelled as @var{[main]}), and overlay on its
44 lower half the output generated by the @var{crop,vflip} filterchain.
46 Some filters take in input a list of parameters: they are specified
47 after the filter name and an equal sign, and are separated from each other
50 There exist so-called @var{source filters} that do not have an
51 audio/video input, and @var{sink filters} that will not have audio/video
54 @c man end FILTERING INTRODUCTION
57 @c man begin GRAPH2DOT
59 The @file{graph2dot} program included in the FFmpeg @file{tools}
60 directory can be used to parse a filtergraph description and issue a
61 corresponding textual representation in the dot language.
68 to see how to use @file{graph2dot}.
70 You can then pass the dot description to the @file{dot} program (from
71 the graphviz suite of programs) and obtain a graphical representation
74 For example the sequence of commands:
76 echo @var{GRAPH_DESCRIPTION} | \
77 tools/graph2dot -o graph.tmp && \
78 dot -Tpng graph.tmp -o graph.png && \
82 can be used to create and display an image representing the graph
83 described by the @var{GRAPH_DESCRIPTION} string. Note that this string must be
84 a complete self-contained graph, with its inputs and outputs explicitly defined.
85 For example if your command line is of the form:
87 ffmpeg -i infile -vf scale=640:360 outfile
89 your @var{GRAPH_DESCRIPTION} string will need to be of the form:
91 nullsrc,scale=640:360,nullsink
93 you may also need to set the @var{nullsrc} parameters and add a @var{format}
94 filter in order to simulate a specific input file.
98 @chapter Filtergraph description
99 @c man begin FILTERGRAPH DESCRIPTION
101 A filtergraph is a directed graph of connected filters. It can contain
102 cycles, and there can be multiple links between a pair of
103 filters. Each link has one input pad on one side connecting it to one
104 filter from which it takes its input, and one output pad on the other
105 side connecting it to one filter accepting its output.
107 Each filter in a filtergraph is an instance of a filter class
108 registered in the application, which defines the features and the
109 number of input and output pads of the filter.
111 A filter with no input pads is called a "source", and a filter with no
112 output pads is called a "sink".
114 @anchor{Filtergraph syntax}
115 @section Filtergraph syntax
117 A filtergraph has a textual representation, which is recognized by the
118 @option{-filter}/@option{-vf}/@option{-af} and
119 @option{-filter_complex} options in @command{ffmpeg} and
120 @option{-vf}/@option{-af} in @command{ffplay}, and by the
121 @code{avfilter_graph_parse_ptr()} function defined in
122 @file{libavfilter/avfilter.h}.
124 A filterchain consists of a sequence of connected filters, each one
125 connected to the previous one in the sequence. A filterchain is
126 represented by a list of ","-separated filter descriptions.
128 A filtergraph consists of a sequence of filterchains. A sequence of
129 filterchains is represented by a list of ";"-separated filterchain
132 A filter is represented by a string of the form:
133 [@var{in_link_1}]...[@var{in_link_N}]@var{filter_name}@@@var{id}=@var{arguments}[@var{out_link_1}]...[@var{out_link_M}]
135 @var{filter_name} is the name of the filter class of which the
136 described filter is an instance of, and has to be the name of one of
137 the filter classes registered in the program optionally followed by "@@@var{id}".
138 The name of the filter class is optionally followed by a string
141 @var{arguments} is a string which contains the parameters used to
142 initialize the filter instance. It may have one of two forms:
146 A ':'-separated list of @var{key=value} pairs.
149 A ':'-separated list of @var{value}. In this case, the keys are assumed to be
150 the option names in the order they are declared. E.g. the @code{fade} filter
151 declares three options in this order -- @option{type}, @option{start_frame} and
152 @option{nb_frames}. Then the parameter list @var{in:0:30} means that the value
153 @var{in} is assigned to the option @option{type}, @var{0} to
154 @option{start_frame} and @var{30} to @option{nb_frames}.
157 A ':'-separated list of mixed direct @var{value} and long @var{key=value}
158 pairs. The direct @var{value} must precede the @var{key=value} pairs, and
159 follow the same constraints order of the previous point. The following
160 @var{key=value} pairs can be set in any preferred order.
164 If the option value itself is a list of items (e.g. the @code{format} filter
165 takes a list of pixel formats), the items in the list are usually separated by
168 The list of arguments can be quoted using the character @samp{'} as initial
169 and ending mark, and the character @samp{\} for escaping the characters
170 within the quoted text; otherwise the argument string is considered
171 terminated when the next special character (belonging to the set
172 @samp{[]=;,}) is encountered.
174 The name and arguments of the filter are optionally preceded and
175 followed by a list of link labels.
176 A link label allows one to name a link and associate it to a filter output
177 or input pad. The preceding labels @var{in_link_1}
178 ... @var{in_link_N}, are associated to the filter input pads,
179 the following labels @var{out_link_1} ... @var{out_link_M}, are
180 associated to the output pads.
182 When two link labels with the same name are found in the
183 filtergraph, a link between the corresponding input and output pad is
186 If an output pad is not labelled, it is linked by default to the first
187 unlabelled input pad of the next filter in the filterchain.
188 For example in the filterchain
190 nullsrc, split[L1], [L2]overlay, nullsink
192 the split filter instance has two output pads, and the overlay filter
193 instance two input pads. The first output pad of split is labelled
194 "L1", the first input pad of overlay is labelled "L2", and the second
195 output pad of split is linked to the second input pad of overlay,
196 which are both unlabelled.
198 In a filter description, if the input label of the first filter is not
199 specified, "in" is assumed; if the output label of the last filter is not
200 specified, "out" is assumed.
202 In a complete filterchain all the unlabelled filter input and output
203 pads must be connected. A filtergraph is considered valid if all the
204 filter input and output pads of all the filterchains are connected.
206 Libavfilter will automatically insert @ref{scale} filters where format
207 conversion is required. It is possible to specify swscale flags
208 for those automatically inserted scalers by prepending
209 @code{sws_flags=@var{flags};}
210 to the filtergraph description.
212 Here is a BNF description of the filtergraph syntax:
214 @var{NAME} ::= sequence of alphanumeric characters and '_'
215 @var{FILTER_NAME} ::= @var{NAME}["@@"@var{NAME}]
216 @var{LINKLABEL} ::= "[" @var{NAME} "]"
217 @var{LINKLABELS} ::= @var{LINKLABEL} [@var{LINKLABELS}]
218 @var{FILTER_ARGUMENTS} ::= sequence of chars (possibly quoted)
219 @var{FILTER} ::= [@var{LINKLABELS}] @var{FILTER_NAME} ["=" @var{FILTER_ARGUMENTS}] [@var{LINKLABELS}]
220 @var{FILTERCHAIN} ::= @var{FILTER} [,@var{FILTERCHAIN}]
221 @var{FILTERGRAPH} ::= [sws_flags=@var{flags};] @var{FILTERCHAIN} [;@var{FILTERGRAPH}]
224 @anchor{filtergraph escaping}
225 @section Notes on filtergraph escaping
227 Filtergraph description composition entails several levels of
228 escaping. See @ref{quoting_and_escaping,,the "Quoting and escaping"
229 section in the ffmpeg-utils(1) manual,ffmpeg-utils} for more
230 information about the employed escaping procedure.
232 A first level escaping affects the content of each filter option
233 value, which may contain the special character @code{:} used to
234 separate values, or one of the escaping characters @code{\'}.
236 A second level escaping affects the whole filter description, which
237 may contain the escaping characters @code{\'} or the special
238 characters @code{[],;} used by the filtergraph description.
240 Finally, when you specify a filtergraph on a shell commandline, you
241 need to perform a third level escaping for the shell special
242 characters contained within it.
244 For example, consider the following string to be embedded in
245 the @ref{drawtext} filter description @option{text} value:
247 this is a 'string': may contain one, or more, special characters
250 This string contains the @code{'} special escaping character, and the
251 @code{:} special character, so it needs to be escaped in this way:
253 text=this is a \'string\'\: may contain one, or more, special characters
256 A second level of escaping is required when embedding the filter
257 description in a filtergraph description, in order to escape all the
258 filtergraph special characters. Thus the example above becomes:
260 drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
262 (note that in addition to the @code{\'} escaping special characters,
263 also @code{,} needs to be escaped).
265 Finally an additional level of escaping is needed when writing the
266 filtergraph description in a shell command, which depends on the
267 escaping rules of the adopted shell. For example, assuming that
268 @code{\} is special and needs to be escaped with another @code{\}, the
269 previous string will finally result in:
271 -vf "drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters"
274 @chapter Timeline editing
276 Some filters support a generic @option{enable} option. For the filters
277 supporting timeline editing, this option can be set to an expression which is
278 evaluated before sending a frame to the filter. If the evaluation is non-zero,
279 the filter will be enabled, otherwise the frame will be sent unchanged to the
280 next filter in the filtergraph.
282 The expression accepts the following values:
285 timestamp expressed in seconds, NAN if the input timestamp is unknown
288 sequential number of the input frame, starting from 0
291 the position in the file of the input frame, NAN if unknown
295 width and height of the input frame if video
298 Additionally, these filters support an @option{enable} command that can be used
299 to re-define the expression.
301 Like any other filtering option, the @option{enable} option follows the same
304 For example, to enable a blur filter (@ref{smartblur}) from 10 seconds to 3
305 minutes, and a @ref{curves} filter starting at 3 seconds:
307 smartblur = enable='between(t,10,3*60)',
308 curves = enable='gte(t,3)' : preset=cross_process
311 See @code{ffmpeg -filters} to view which filters have timeline support.
313 @c man end FILTERGRAPH DESCRIPTION
316 @chapter Options for filters with several inputs (framesync)
317 @c man begin OPTIONS FOR FILTERS WITH SEVERAL INPUTS
319 Some filters with several inputs support a common set of options.
320 These options can only be set by name, not with the short notation.
324 The action to take when EOF is encountered on the secondary input; it accepts
325 one of the following values:
329 Repeat the last frame (the default).
333 Pass the main input through.
337 If set to 1, force the output to terminate when the shortest input
338 terminates. Default value is 0.
341 If set to 1, force the filter to extend the last frame of secondary streams
342 until the end of the primary stream. A value of 0 disables this behavior.
346 @c man end OPTIONS FOR FILTERS WITH SEVERAL INPUTS
348 @chapter Audio Filters
349 @c man begin AUDIO FILTERS
351 When you configure your FFmpeg build, you can disable any of the
352 existing filters using @code{--disable-filters}.
353 The configure output will show the audio filters included in your
356 Below is a description of the currently available audio filters.
360 A compressor is mainly used to reduce the dynamic range of a signal.
361 Especially modern music is mostly compressed at a high ratio to
362 improve the overall loudness. It's done to get the highest attention
363 of a listener, "fatten" the sound and bring more "power" to the track.
364 If a signal is compressed too much it may sound dull or "dead"
365 afterwards or it may start to "pump" (which could be a powerful effect
366 but can also destroy a track completely).
367 The right compression is the key to reach a professional sound and is
368 the high art of mixing and mastering. Because of its complex settings
369 it may take a long time to get the right feeling for this kind of effect.
371 Compression is done by detecting the volume above a chosen level
372 @code{threshold} and dividing it by the factor set with @code{ratio}.
373 So if you set the threshold to -12dB and your signal reaches -6dB a ratio
374 of 2:1 will result in a signal at -9dB. Because an exact manipulation of
375 the signal would cause distortion of the waveform the reduction can be
376 levelled over the time. This is done by setting "Attack" and "Release".
377 @code{attack} determines how long the signal has to rise above the threshold
378 before any reduction will occur and @code{release} sets the time the signal
379 has to fall below the threshold to reduce the reduction again. Shorter signals
380 than the chosen attack time will be left untouched.
381 The overall reduction of the signal can be made up afterwards with the
382 @code{makeup} setting. So compressing the peaks of a signal about 6dB and
383 raising the makeup to this level results in a signal twice as loud than the
384 source. To gain a softer entry in the compression the @code{knee} flattens the
385 hard edge at the threshold in the range of the chosen decibels.
387 The filter accepts the following options:
391 Set input gain. Default is 1. Range is between 0.015625 and 64.
394 If a signal of stream rises above this level it will affect the gain
396 By default it is 0.125. Range is between 0.00097563 and 1.
399 Set a ratio by which the signal is reduced. 1:2 means that if the level
400 rose 4dB above the threshold, it will be only 2dB above after the reduction.
401 Default is 2. Range is between 1 and 20.
404 Amount of milliseconds the signal has to rise above the threshold before gain
405 reduction starts. Default is 20. Range is between 0.01 and 2000.
408 Amount of milliseconds the signal has to fall below the threshold before
409 reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
412 Set the amount by how much signal will be amplified after processing.
413 Default is 1. Range is from 1 to 64.
416 Curve the sharp knee around the threshold to enter gain reduction more softly.
417 Default is 2.82843. Range is between 1 and 8.
420 Choose if the @code{average} level between all channels of input stream
421 or the louder(@code{maximum}) channel of input stream affects the
422 reduction. Default is @code{average}.
425 Should the exact signal be taken in case of @code{peak} or an RMS one in case
426 of @code{rms}. Default is @code{rms} which is mostly smoother.
429 How much to use compressed signal in output. Default is 1.
430 Range is between 0 and 1.
434 Simple audio dynamic range commpression/expansion filter.
436 The filter accepts the following options:
440 Set contrast. Default is 33. Allowed range is between 0 and 100.
445 Copy the input audio source unchanged to the output. This is mainly useful for
450 Apply cross fade from one input audio stream to another input audio stream.
451 The cross fade is applied for specified duration near the end of first stream.
453 The filter accepts the following options:
457 Specify the number of samples for which the cross fade effect has to last.
458 At the end of the cross fade effect the first input audio will be completely
459 silent. Default is 44100.
462 Specify the duration of the cross fade effect. See
463 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
464 for the accepted syntax.
465 By default the duration is determined by @var{nb_samples}.
466 If set this option is used instead of @var{nb_samples}.
469 Should first stream end overlap with second stream start. Default is enabled.
472 Set curve for cross fade transition for first stream.
475 Set curve for cross fade transition for second stream.
477 For description of available curve types see @ref{afade} filter description.
484 Cross fade from one input to another:
486 ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
490 Cross fade from one input to another but without overlapping:
492 ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
497 Split audio stream into several bands.
499 This filter splits audio stream into two or more frequency ranges.
500 Summing all streams back will give flat output.
502 The filter accepts the following options:
506 Set split frequencies. Those must be positive and increasing.
509 Set filter order, can be @var{2nd}, @var{4th} or @var{8th}.
510 Default is @var{4th}.
515 Reduce audio bit resolution.
517 This filter is bit crusher with enhanced functionality. A bit crusher
518 is used to audibly reduce number of bits an audio signal is sampled
519 with. This doesn't change the bit depth at all, it just produces the
520 effect. Material reduced in bit depth sounds more harsh and "digital".
521 This filter is able to even round to continuous values instead of discrete
523 Additionally it has a D/C offset which results in different crushing of
524 the lower and the upper half of the signal.
525 An Anti-Aliasing setting is able to produce "softer" crushing sounds.
527 Another feature of this filter is the logarithmic mode.
528 This setting switches from linear distances between bits to logarithmic ones.
529 The result is a much more "natural" sounding crusher which doesn't gate low
530 signals for example. The human ear has a logarithmic perception,
531 so this kind of crushing is much more pleasant.
532 Logarithmic crushing is also able to get anti-aliased.
534 The filter accepts the following options:
550 Can be linear: @code{lin} or logarithmic: @code{log}.
559 Set sample reduction.
562 Enable LFO. By default disabled.
573 Delay audio filtering until a given wallclock timestamp. See the @ref{cue}
577 Remove impulsive noise from input audio.
579 Samples detected as impulsive noise are replaced by interpolated samples using
580 autoregressive modelling.
584 Set window size, in milliseconds. Allowed range is from @code{10} to
585 @code{100}. Default value is @code{55} milliseconds.
586 This sets size of window which will be processed at once.
589 Set window overlap, in percentage of window size. Allowed range is from
590 @code{50} to @code{95}. Default value is @code{75} percent.
591 Setting this to a very high value increases impulsive noise removal but makes
592 whole process much slower.
595 Set autoregression order, in percentage of window size. Allowed range is from
596 @code{0} to @code{25}. Default value is @code{2} percent. This option also
597 controls quality of interpolated samples using neighbour good samples.
600 Set threshold value. Allowed range is from @code{1} to @code{100}.
601 Default value is @code{2}.
602 This controls the strength of impulsive noise which is going to be removed.
603 The lower value, the more samples will be detected as impulsive noise.
606 Set burst fusion, in percentage of window size. Allowed range is @code{0} to
607 @code{10}. Default value is @code{2}.
608 If any two samples deteced as noise are spaced less than this value then any
609 sample inbetween those two samples will be also detected as noise.
614 It accepts the following values:
617 Select overlap-add method. Even not interpolated samples are slightly
618 changed with this method.
621 Select overlap-save method. Not interpolated samples remain unchanged.
624 Default value is @code{a}.
628 Remove clipped samples from input audio.
630 Samples detected as clipped are replaced by interpolated samples using
631 autoregressive modelling.
635 Set window size, in milliseconds. Allowed range is from @code{10} to @code{100}.
636 Default value is @code{55} milliseconds.
637 This sets size of window which will be processed at once.
640 Set window overlap, in percentage of window size. Allowed range is from @code{50}
641 to @code{95}. Default value is @code{75} percent.
644 Set autoregression order, in percentage of window size. Allowed range is from
645 @code{0} to @code{25}. Default value is @code{8} percent. This option also controls
646 quality of interpolated samples using neighbour good samples.
649 Set threshold value. Allowed range is from @code{1} to @code{100}.
650 Default value is @code{10}. Higher values make clip detection less aggressive.
653 Set size of histogram used to detect clips. Allowed range is from @code{100} to @code{9999}.
654 Default value is @code{1000}. Higher values make clip detection less aggressive.
659 It accepts the following values:
662 Select overlap-add method. Even not interpolated samples are slightly changed
666 Select overlap-save method. Not interpolated samples remain unchanged.
669 Default value is @code{a}.
674 Delay one or more audio channels.
676 Samples in delayed channel are filled with silence.
678 The filter accepts the following option:
682 Set list of delays in milliseconds for each channel separated by '|'.
683 Unused delays will be silently ignored. If number of given delays is
684 smaller than number of channels all remaining channels will not be delayed.
685 If you want to delay exact number of samples, append 'S' to number.
692 Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
693 the second channel (and any other channels that may be present) unchanged.
699 Delay second channel by 500 samples, the third channel by 700 samples and leave
700 the first channel (and any other channels that may be present) unchanged.
706 @section aderivative, aintegral
708 Compute derivative/integral of audio stream.
710 Applying both filters one after another produces original audio.
714 Apply echoing to the input audio.
716 Echoes are reflected sound and can occur naturally amongst mountains
717 (and sometimes large buildings) when talking or shouting; digital echo
718 effects emulate this behaviour and are often used to help fill out the
719 sound of a single instrument or vocal. The time difference between the
720 original signal and the reflection is the @code{delay}, and the
721 loudness of the reflected signal is the @code{decay}.
722 Multiple echoes can have different delays and decays.
724 A description of the accepted parameters follows.
728 Set input gain of reflected signal. Default is @code{0.6}.
731 Set output gain of reflected signal. Default is @code{0.3}.
734 Set list of time intervals in milliseconds between original signal and reflections
735 separated by '|'. Allowed range for each @code{delay} is @code{(0 - 90000.0]}.
736 Default is @code{1000}.
739 Set list of loudness of reflected signals separated by '|'.
740 Allowed range for each @code{decay} is @code{(0 - 1.0]}.
741 Default is @code{0.5}.
748 Make it sound as if there are twice as many instruments as are actually playing:
750 aecho=0.8:0.88:60:0.4
754 If delay is very short, then it sound like a (metallic) robot playing music:
760 A longer delay will sound like an open air concert in the mountains:
762 aecho=0.8:0.9:1000:0.3
766 Same as above but with one more mountain:
768 aecho=0.8:0.9:1000|1800:0.3|0.25
773 Audio emphasis filter creates or restores material directly taken from LPs or
774 emphased CDs with different filter curves. E.g. to store music on vinyl the
775 signal has to be altered by a filter first to even out the disadvantages of
776 this recording medium.
777 Once the material is played back the inverse filter has to be applied to
778 restore the distortion of the frequency response.
780 The filter accepts the following options:
790 Set filter mode. For restoring material use @code{reproduction} mode, otherwise
791 use @code{production} mode. Default is @code{reproduction} mode.
794 Set filter type. Selects medium. Can be one of the following:
806 select Compact Disc (CD).
812 select 50µs (FM-KF).
814 select 75µs (FM-KF).
820 Modify an audio signal according to the specified expressions.
822 This filter accepts one or more expressions (one for each channel),
823 which are evaluated and used to modify a corresponding audio signal.
825 It accepts the following parameters:
829 Set the '|'-separated expressions list for each separate channel. If
830 the number of input channels is greater than the number of
831 expressions, the last specified expression is used for the remaining
834 @item channel_layout, c
835 Set output channel layout. If not specified, the channel layout is
836 specified by the number of expressions. If set to @samp{same}, it will
837 use by default the same input channel layout.
840 Each expression in @var{exprs} can contain the following constants and functions:
844 channel number of the current expression
847 number of the evaluated sample, starting from 0
853 time of the evaluated sample expressed in seconds
856 @item nb_out_channels
857 input and output number of channels
860 the value of input channel with number @var{CH}
863 Note: this filter is slow. For faster processing you should use a
872 aeval=val(ch)/2:c=same
876 Invert phase of the second channel:
885 Apply fade-in/out effect to input audio.
887 A description of the accepted parameters follows.
891 Specify the effect type, can be either @code{in} for fade-in, or
892 @code{out} for a fade-out effect. Default is @code{in}.
894 @item start_sample, ss
895 Specify the number of the start sample for starting to apply the fade
896 effect. Default is 0.
899 Specify the number of samples for which the fade effect has to last. At
900 the end of the fade-in effect the output audio will have the same
901 volume as the input audio, at the end of the fade-out transition
902 the output audio will be silence. Default is 44100.
905 Specify the start time of the fade effect. Default is 0.
906 The value must be specified as a time duration; see
907 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
908 for the accepted syntax.
909 If set this option is used instead of @var{start_sample}.
912 Specify the duration of the fade effect. See
913 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
914 for the accepted syntax.
915 At the end of the fade-in effect the output audio will have the same
916 volume as the input audio, at the end of the fade-out transition
917 the output audio will be silence.
918 By default the duration is determined by @var{nb_samples}.
919 If set this option is used instead of @var{nb_samples}.
922 Set curve for fade transition.
924 It accepts the following values:
927 select triangular, linear slope (default)
929 select quarter of sine wave
931 select half of sine wave
933 select exponential sine wave
937 select inverted parabola
951 select inverted quarter of sine wave
953 select inverted half of sine wave
955 select double-exponential seat
957 select double-exponential sigmoid
959 select logistic sigmoid
967 Fade in first 15 seconds of audio:
973 Fade out last 25 seconds of a 900 seconds audio:
975 afade=t=out:st=875:d=25
980 Denoise audio samples with FFT.
982 A description of the accepted parameters follows.
986 Set the noise reduction in dB, allowed range is 0.01 to 97.
987 Default value is 12 dB.
990 Set the noise floor in dB, allowed range is -80 to -20.
991 Default value is -50 dB.
996 It accepts the following values:
1005 Select shellac noise.
1008 Select custom noise, defined in @code{bn} option.
1010 Default value is white noise.
1014 Set custom band noise for every one of 15 bands.
1015 Bands are separated by ' ' or '|'.
1018 Set the residual floor in dB, allowed range is -80 to -20.
1019 Default value is -38 dB.
1022 Enable noise tracking. By default is disabled.
1023 With this enabled, noise floor is automatically adjusted.
1026 Enable residual tracking. By default is disabled.
1029 Set the output mode.
1031 It accepts the following values:
1034 Pass input unchanged.
1037 Pass noise filtered out.
1042 Default value is @var{o}.
1046 @subsection Commands
1048 This filter supports the following commands:
1050 @item sample_noise, sn
1051 Start or stop measuring noise profile.
1052 Syntax for the command is : "start" or "stop" string.
1053 After measuring noise profile is stopped it will be
1054 automatically applied in filtering.
1056 @item noise_reduction, nr
1057 Change noise reduction. Argument is single float number.
1058 Syntax for the command is : "@var{noise_reduction}"
1060 @item noise_floor, nf
1061 Change noise floor. Argument is single float number.
1062 Syntax for the command is : "@var{noise_floor}"
1064 @item output_mode, om
1065 Change output mode operation.
1066 Syntax for the command is : "i", "o" or "n" string.
1070 Apply arbitrary expressions to samples in frequency domain.
1074 Set frequency domain real expression for each separate channel separated
1075 by '|'. Default is "1".
1076 If the number of input channels is greater than the number of
1077 expressions, the last specified expression is used for the remaining
1081 Set frequency domain imaginary expression for each separate channel
1082 separated by '|'. If not set, @var{real} option is used.
1084 Each expression in @var{real} and @var{imag} can contain the following
1092 current frequency bin number
1095 number of available bins
1098 channel number of the current expression
1110 It accepts the following values:
1126 Default is @code{w4096}
1129 Set window function. Default is @code{hann}.
1132 Set window overlap. If set to 1, the recommended overlap for selected
1133 window function will be picked. Default is @code{0.75}.
1136 @subsection Examples
1140 Leave almost only low frequencies in audio:
1142 afftfilt="1-clip((b/nb)*b,0,1)"
1149 Apply an arbitrary Frequency Impulse Response filter.
1151 This filter is designed for applying long FIR filters,
1152 up to 60 seconds long.
1154 It can be used as component for digital crossover filters,
1155 room equalization, cross talk cancellation, wavefield synthesis,
1156 auralization, ambiophonics and ambisonics.
1158 This filter uses second stream as FIR coefficients.
1159 If second stream holds single channel, it will be used
1160 for all input channels in first stream, otherwise
1161 number of channels in second stream must be same as
1162 number of channels in first stream.
1164 It accepts the following parameters:
1168 Set dry gain. This sets input gain.
1171 Set wet gain. This sets final output gain.
1174 Set Impulse Response filter length. Default is 1, which means whole IR is processed.
1177 Enable applying gain measured from power of IR.
1179 Set which approach to use for auto gain measurement.
1183 Do not apply any gain.
1186 select peak gain, very conservative approach. This is default value.
1189 select DC gain, limited application.
1192 select gain to noise approach, this is most popular one.
1196 Set gain to be applied to IR coefficients before filtering.
1197 Allowed range is 0 to 1. This gain is applied after any gain applied with @var{gtype} option.
1200 Set format of IR stream. Can be @code{mono} or @code{input}.
1201 Default is @code{input}.
1204 Set max allowed Impulse Response filter duration in seconds. Default is 30 seconds.
1205 Allowed range is 0.1 to 60 seconds.
1208 Show IR frequency reponse, magnitude(magenta) and phase(green) and group delay(yellow) in additional video stream.
1209 By default it is disabled.
1212 Set for which IR channel to display frequency response. By default is first channel
1213 displayed. This option is used only when @var{response} is enabled.
1216 Set video stream size. This option is used only when @var{response} is enabled.
1219 Set video stream frame rate. This option is used only when @var{response} is enabled.
1222 @subsection Examples
1226 Apply reverb to stream using mono IR file as second input, complete command using ffmpeg:
1228 ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav
1235 Set output format constraints for the input audio. The framework will
1236 negotiate the most appropriate format to minimize conversions.
1238 It accepts the following parameters:
1242 A '|'-separated list of requested sample formats.
1245 A '|'-separated list of requested sample rates.
1247 @item channel_layouts
1248 A '|'-separated list of requested channel layouts.
1250 See @ref{channel layout syntax,,the Channel Layout section in the ffmpeg-utils(1) manual,ffmpeg-utils}
1251 for the required syntax.
1254 If a parameter is omitted, all values are allowed.
1256 Force the output to either unsigned 8-bit or signed 16-bit stereo
1258 aformat=sample_fmts=u8|s16:channel_layouts=stereo
1263 A gate is mainly used to reduce lower parts of a signal. This kind of signal
1264 processing reduces disturbing noise between useful signals.
1266 Gating is done by detecting the volume below a chosen level @var{threshold}
1267 and dividing it by the factor set with @var{ratio}. The bottom of the noise
1268 floor is set via @var{range}. Because an exact manipulation of the signal
1269 would cause distortion of the waveform the reduction can be levelled over
1270 time. This is done by setting @var{attack} and @var{release}.
1272 @var{attack} determines how long the signal has to fall below the threshold
1273 before any reduction will occur and @var{release} sets the time the signal
1274 has to rise above the threshold to reduce the reduction again.
1275 Shorter signals than the chosen attack time will be left untouched.
1279 Set input level before filtering.
1280 Default is 1. Allowed range is from 0.015625 to 64.
1283 Set the level of gain reduction when the signal is below the threshold.
1284 Default is 0.06125. Allowed range is from 0 to 1.
1287 If a signal rises above this level the gain reduction is released.
1288 Default is 0.125. Allowed range is from 0 to 1.
1291 Set a ratio by which the signal is reduced.
1292 Default is 2. Allowed range is from 1 to 9000.
1295 Amount of milliseconds the signal has to rise above the threshold before gain
1297 Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
1300 Amount of milliseconds the signal has to fall below the threshold before the
1301 reduction is increased again. Default is 250 milliseconds.
1302 Allowed range is from 0.01 to 9000.
1305 Set amount of amplification of signal after processing.
1306 Default is 1. Allowed range is from 1 to 64.
1309 Curve the sharp knee around the threshold to enter gain reduction more softly.
1310 Default is 2.828427125. Allowed range is from 1 to 8.
1313 Choose if exact signal should be taken for detection or an RMS like one.
1314 Default is @code{rms}. Can be @code{peak} or @code{rms}.
1317 Choose if the average level between all channels or the louder channel affects
1319 Default is @code{average}. Can be @code{average} or @code{maximum}.
1324 Apply an arbitrary Infinite Impulse Response filter.
1326 It accepts the following parameters:
1330 Set numerator/zeros coefficients.
1333 Set denominator/poles coefficients.
1345 Set coefficients format.
1351 Z-plane zeros/poles, cartesian (default)
1353 Z-plane zeros/poles, polar radians
1355 Z-plane zeros/poles, polar degrees
1359 Set kind of processing.
1360 Can be @code{d} - direct or @code{s} - serial cascading. Defauls is @code{s}.
1363 Set filtering precision.
1367 double-precision floating-point (default)
1369 single-precision floating-point
1377 Show IR frequency reponse, magnitude and phase in additional video stream.
1378 By default it is disabled.
1381 Set for which IR channel to display frequency response. By default is first channel
1382 displayed. This option is used only when @var{response} is enabled.
1385 Set video stream size. This option is used only when @var{response} is enabled.
1388 Coefficients in @code{tf} format are separated by spaces and are in ascending
1391 Coefficients in @code{zp} format are separated by spaces and order of coefficients
1392 doesn't matter. Coefficients in @code{zp} format are complex numbers with @var{i}
1395 Different coefficients and gains can be provided for every channel, in such case
1396 use '|' to separate coefficients or gains. Last provided coefficients will be
1397 used for all remaining channels.
1399 @subsection Examples
1403 Apply 2 pole elliptic notch at arround 5000Hz for 48000 Hz sample rate:
1405 aiir=k=1:z=7.957584807809675810E-1 -2.575128568908332300 3.674839853930788710 -2.57512875289799137 7.957586296317130880E-1:p=1 -2.86950072432325953 3.63022088054647218 -2.28075678147272232 6.361362326477423500E-1:f=tf:r=d
1409 Same as above but in @code{zp} format:
1411 aiir=k=0.79575848078096756:z=0.80918701+0.58773007i 0.80918701-0.58773007i 0.80884700+0.58784055i 0.80884700-0.58784055i:p=0.63892345+0.59951235i 0.63892345-0.59951235i 0.79582691+0.44198673i 0.79582691-0.44198673i:f=zp:r=s
1417 The limiter prevents an input signal from rising over a desired threshold.
1418 This limiter uses lookahead technology to prevent your signal from distorting.
1419 It means that there is a small delay after the signal is processed. Keep in mind
1420 that the delay it produces is the attack time you set.
1422 The filter accepts the following options:
1426 Set input gain. Default is 1.
1429 Set output gain. Default is 1.
1432 Don't let signals above this level pass the limiter. Default is 1.
1435 The limiter will reach its attenuation level in this amount of time in
1436 milliseconds. Default is 5 milliseconds.
1439 Come back from limiting to attenuation 1.0 in this amount of milliseconds.
1440 Default is 50 milliseconds.
1443 When gain reduction is always needed ASC takes care of releasing to an
1444 average reduction level rather than reaching a reduction of 0 in the release
1448 Select how much the release time is affected by ASC, 0 means nearly no changes
1449 in release time while 1 produces higher release times.
1452 Auto level output signal. Default is enabled.
1453 This normalizes audio back to 0dB if enabled.
1456 Depending on picked setting it is recommended to upsample input 2x or 4x times
1457 with @ref{aresample} before applying this filter.
1461 Apply a two-pole all-pass filter with central frequency (in Hz)
1462 @var{frequency}, and filter-width @var{width}.
1463 An all-pass filter changes the audio's frequency to phase relationship
1464 without changing its frequency to amplitude relationship.
1466 The filter accepts the following options:
1470 Set frequency in Hz.
1473 Set method to specify band-width of filter.
1488 Specify the band-width of a filter in width_type units.
1491 Specify which channels to filter, by default all available are filtered.
1494 @subsection Commands
1496 This filter supports the following commands:
1499 Change allpass frequency.
1500 Syntax for the command is : "@var{frequency}"
1503 Change allpass width_type.
1504 Syntax for the command is : "@var{width_type}"
1507 Change allpass width.
1508 Syntax for the command is : "@var{width}"
1515 The filter accepts the following options:
1519 Set the number of loops. Setting this value to -1 will result in infinite loops.
1523 Set maximal number of samples. Default is 0.
1526 Set first sample of loop. Default is 0.
1532 Merge two or more audio streams into a single multi-channel stream.
1534 The filter accepts the following options:
1539 Set the number of inputs. Default is 2.
1543 If the channel layouts of the inputs are disjoint, and therefore compatible,
1544 the channel layout of the output will be set accordingly and the channels
1545 will be reordered as necessary. If the channel layouts of the inputs are not
1546 disjoint, the output will have all the channels of the first input then all
1547 the channels of the second input, in that order, and the channel layout of
1548 the output will be the default value corresponding to the total number of
1551 For example, if the first input is in 2.1 (FL+FR+LF) and the second input
1552 is FC+BL+BR, then the output will be in 5.1, with the channels in the
1553 following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
1554 first input, b1 is the first channel of the second input).
1556 On the other hand, if both input are in stereo, the output channels will be
1557 in the default order: a1, a2, b1, b2, and the channel layout will be
1558 arbitrarily set to 4.0, which may or may not be the expected value.
1560 All inputs must have the same sample rate, and format.
1562 If inputs do not have the same duration, the output will stop with the
1565 @subsection Examples
1569 Merge two mono files into a stereo stream:
1571 amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
1575 Multiple merges assuming 1 video stream and 6 audio streams in @file{input.mkv}:
1577 ffmpeg -i input.mkv -filter_complex "[0:1][0:2][0:3][0:4][0:5][0:6] amerge=inputs=6" -c:a pcm_s16le output.mkv
1583 Mixes multiple audio inputs into a single output.
1585 Note that this filter only supports float samples (the @var{amerge}
1586 and @var{pan} audio filters support many formats). If the @var{amix}
1587 input has integer samples then @ref{aresample} will be automatically
1588 inserted to perform the conversion to float samples.
1592 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
1594 will mix 3 input audio streams to a single output with the same duration as the
1595 first input and a dropout transition time of 3 seconds.
1597 It accepts the following parameters:
1601 The number of inputs. If unspecified, it defaults to 2.
1604 How to determine the end-of-stream.
1608 The duration of the longest input. (default)
1611 The duration of the shortest input.
1614 The duration of the first input.
1618 @item dropout_transition
1619 The transition time, in seconds, for volume renormalization when an input
1620 stream ends. The default value is 2 seconds.
1623 Specify weight of each input audio stream as sequence.
1624 Each weight is separated by space. By default all inputs have same weight.
1629 Multiply first audio stream with second audio stream and store result
1630 in output audio stream. Multiplication is done by multiplying each
1631 sample from first stream with sample at same position from second stream.
1633 With this element-wise multiplication one can create amplitude fades and
1634 amplitude modulations.
1636 @section anequalizer
1638 High-order parametric multiband equalizer for each channel.
1640 It accepts the following parameters:
1644 This option string is in format:
1645 "c@var{chn} f=@var{cf} w=@var{w} g=@var{g} t=@var{f} | ..."
1646 Each equalizer band is separated by '|'.
1650 Set channel number to which equalization will be applied.
1651 If input doesn't have that channel the entry is ignored.
1654 Set central frequency for band.
1655 If input doesn't have that frequency the entry is ignored.
1658 Set band width in hertz.
1661 Set band gain in dB.
1664 Set filter type for band, optional, can be:
1668 Butterworth, this is default.
1679 With this option activated frequency response of anequalizer is displayed
1683 Set video stream size. Only useful if curves option is activated.
1686 Set max gain that will be displayed. Only useful if curves option is activated.
1687 Setting this to a reasonable value makes it possible to display gain which is derived from
1688 neighbour bands which are too close to each other and thus produce higher gain
1689 when both are activated.
1692 Set frequency scale used to draw frequency response in video output.
1693 Can be linear or logarithmic. Default is logarithmic.
1696 Set color for each channel curve which is going to be displayed in video stream.
1697 This is list of color names separated by space or by '|'.
1698 Unrecognised or missing colors will be replaced by white color.
1701 @subsection Examples
1705 Lower gain by 10 of central frequency 200Hz and width 100 Hz
1706 for first 2 channels using Chebyshev type 1 filter:
1708 anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
1712 @subsection Commands
1714 This filter supports the following commands:
1717 Alter existing filter parameters.
1718 Syntax for the commands is : "@var{fN}|f=@var{freq}|w=@var{width}|g=@var{gain}"
1720 @var{fN} is existing filter number, starting from 0, if no such filter is available
1722 @var{freq} set new frequency parameter.
1723 @var{width} set new width parameter in herz.
1724 @var{gain} set new gain parameter in dB.
1726 Full filter invocation with asendcmd may look like this:
1727 asendcmd=c='4.0 anequalizer change 0|f=200|w=50|g=1',anequalizer=...
1732 Pass the audio source unchanged to the output.
1736 Pad the end of an audio stream with silence.
1738 This can be used together with @command{ffmpeg} @option{-shortest} to
1739 extend audio streams to the same length as the video stream.
1741 A description of the accepted options follows.
1745 Set silence packet size. Default value is 4096.
1748 Set the number of samples of silence to add to the end. After the
1749 value is reached, the stream is terminated. This option is mutually
1750 exclusive with @option{whole_len}.
1753 Set the minimum total number of samples in the output audio stream. If
1754 the value is longer than the input audio length, silence is added to
1755 the end, until the value is reached. This option is mutually exclusive
1756 with @option{pad_len}.
1759 If neither the @option{pad_len} nor the @option{whole_len} option is
1760 set, the filter will add silence to the end of the input stream
1763 @subsection Examples
1767 Add 1024 samples of silence to the end of the input:
1773 Make sure the audio output will contain at least 10000 samples, pad
1774 the input with silence if required:
1776 apad=whole_len=10000
1780 Use @command{ffmpeg} to pad the audio input with silence, so that the
1781 video stream will always result the shortest and will be converted
1782 until the end in the output file when using the @option{shortest}
1785 ffmpeg -i VIDEO -i AUDIO -filter_complex "[1:0]apad" -shortest OUTPUT
1790 Add a phasing effect to the input audio.
1792 A phaser filter creates series of peaks and troughs in the frequency spectrum.
1793 The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
1795 A description of the accepted parameters follows.
1799 Set input gain. Default is 0.4.
1802 Set output gain. Default is 0.74
1805 Set delay in milliseconds. Default is 3.0.
1808 Set decay. Default is 0.4.
1811 Set modulation speed in Hz. Default is 0.5.
1814 Set modulation type. Default is triangular.
1816 It accepts the following values:
1825 Audio pulsator is something between an autopanner and a tremolo.
1826 But it can produce funny stereo effects as well. Pulsator changes the volume
1827 of the left and right channel based on a LFO (low frequency oscillator) with
1828 different waveforms and shifted phases.
1829 This filter have the ability to define an offset between left and right
1830 channel. An offset of 0 means that both LFO shapes match each other.
1831 The left and right channel are altered equally - a conventional tremolo.
1832 An offset of 50% means that the shape of the right channel is exactly shifted
1833 in phase (or moved backwards about half of the frequency) - pulsator acts as
1834 an autopanner. At 1 both curves match again. Every setting in between moves the
1835 phase shift gapless between all stages and produces some "bypassing" sounds with
1836 sine and triangle waveforms. The more you set the offset near 1 (starting from
1837 the 0.5) the faster the signal passes from the left to the right speaker.
1839 The filter accepts the following options:
1843 Set input gain. By default it is 1. Range is [0.015625 - 64].
1846 Set output gain. By default it is 1. Range is [0.015625 - 64].
1849 Set waveform shape the LFO will use. Can be one of: sine, triangle, square,
1850 sawup or sawdown. Default is sine.
1853 Set modulation. Define how much of original signal is affected by the LFO.
1856 Set left channel offset. Default is 0. Allowed range is [0 - 1].
1859 Set right channel offset. Default is 0.5. Allowed range is [0 - 1].
1862 Set pulse width. Default is 1. Allowed range is [0 - 2].
1865 Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz.
1868 Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing
1872 Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing
1876 Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used
1877 if timing is set to hz.
1883 Resample the input audio to the specified parameters, using the
1884 libswresample library. If none are specified then the filter will
1885 automatically convert between its input and output.
1887 This filter is also able to stretch/squeeze the audio data to make it match
1888 the timestamps or to inject silence / cut out audio to make it match the
1889 timestamps, do a combination of both or do neither.
1891 The filter accepts the syntax
1892 [@var{sample_rate}:]@var{resampler_options}, where @var{sample_rate}
1893 expresses a sample rate and @var{resampler_options} is a list of
1894 @var{key}=@var{value} pairs, separated by ":". See the
1895 @ref{Resampler Options,,"Resampler Options" section in the
1896 ffmpeg-resampler(1) manual,ffmpeg-resampler}
1897 for the complete list of supported options.
1899 @subsection Examples
1903 Resample the input audio to 44100Hz:
1909 Stretch/squeeze samples to the given timestamps, with a maximum of 1000
1910 samples per second compensation:
1912 aresample=async=1000
1918 Reverse an audio clip.
1920 Warning: This filter requires memory to buffer the entire clip, so trimming
1923 @subsection Examples
1927 Take the first 5 seconds of a clip, and reverse it.
1929 atrim=end=5,areverse
1933 @section asetnsamples
1935 Set the number of samples per each output audio frame.
1937 The last output packet may contain a different number of samples, as
1938 the filter will flush all the remaining samples when the input audio
1941 The filter accepts the following options:
1945 @item nb_out_samples, n
1946 Set the number of frames per each output audio frame. The number is
1947 intended as the number of samples @emph{per each channel}.
1948 Default value is 1024.
1951 If set to 1, the filter will pad the last audio frame with zeroes, so
1952 that the last frame will contain the same number of samples as the
1953 previous ones. Default value is 1.
1956 For example, to set the number of per-frame samples to 1234 and
1957 disable padding for the last frame, use:
1959 asetnsamples=n=1234:p=0
1964 Set the sample rate without altering the PCM data.
1965 This will result in a change of speed and pitch.
1967 The filter accepts the following options:
1970 @item sample_rate, r
1971 Set the output sample rate. Default is 44100 Hz.
1976 Show a line containing various information for each input audio frame.
1977 The input audio is not modified.
1979 The shown line contains a sequence of key/value pairs of the form
1980 @var{key}:@var{value}.
1982 The following values are shown in the output:
1986 The (sequential) number of the input frame, starting from 0.
1989 The presentation timestamp of the input frame, in time base units; the time base
1990 depends on the filter input pad, and is usually 1/@var{sample_rate}.
1993 The presentation timestamp of the input frame in seconds.
1996 position of the frame in the input stream, -1 if this information in
1997 unavailable and/or meaningless (for example in case of synthetic audio)
2006 The sample rate for the audio frame.
2009 The number of samples (per channel) in the frame.
2012 The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar
2013 audio, the data is treated as if all the planes were concatenated.
2015 @item plane_checksums
2016 A list of Adler-32 checksums for each data plane.
2022 Display time domain statistical information about the audio channels.
2023 Statistics are calculated and displayed for each audio channel and,
2024 where applicable, an overall figure is also given.
2026 It accepts the following option:
2029 Short window length in seconds, used for peak and trough RMS measurement.
2030 Default is @code{0.05} (50 milliseconds). Allowed range is @code{[0.01 - 10]}.
2034 Set metadata injection. All the metadata keys are prefixed with @code{lavfi.astats.X},
2035 where @code{X} is channel number starting from 1 or string @code{Overall}. Default is
2038 Available keys for each channel are:
2074 For example full key look like this @code{lavfi.astats.1.DC_offset} or
2075 this @code{lavfi.astats.Overall.Peak_count}.
2077 For description what each key means read below.
2080 Set number of frame after which stats are going to be recalculated.
2081 Default is disabled.
2084 A description of each shown parameter follows:
2088 Mean amplitude displacement from zero.
2091 Minimal sample level.
2094 Maximal sample level.
2096 @item Min difference
2097 Minimal difference between two consecutive samples.
2099 @item Max difference
2100 Maximal difference between two consecutive samples.
2102 @item Mean difference
2103 Mean difference between two consecutive samples.
2104 The average of each difference between two consecutive samples.
2106 @item RMS difference
2107 Root Mean Square difference between two consecutive samples.
2111 Standard peak and RMS level measured in dBFS.
2115 Peak and trough values for RMS level measured over a short window.
2118 Standard ratio of peak to RMS level (note: not in dB).
2121 Flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
2122 (i.e. either @var{Min level} or @var{Max level}).
2125 Number of occasions (not the number of samples) that the signal attained either
2126 @var{Min level} or @var{Max level}.
2129 Overall bit depth of audio. Number of bits used for each sample.
2132 Measured dynamic range of audio in dB.
2134 @item Zero crossings
2135 Number of points where the waveform crosses the zero level axis.
2137 @item Zero crossings rate
2138 Rate of Zero crossings and number of audio samples.
2145 The filter accepts exactly one parameter, the audio tempo. If not
2146 specified then the filter will assume nominal 1.0 tempo. Tempo must
2147 be in the [0.5, 100.0] range.
2149 Note that tempo greater than 2 will skip some samples rather than
2150 blend them in. If for any reason this is a concern it is always
2151 possible to daisy-chain several instances of atempo to achieve the
2152 desired product tempo.
2154 @subsection Examples
2158 Slow down audio to 80% tempo:
2164 To speed up audio to 300% tempo:
2170 To speed up audio to 300% tempo by daisy-chaining two atempo instances:
2172 atempo=sqrt(3),atempo=sqrt(3)
2178 Trim the input so that the output contains one continuous subpart of the input.
2180 It accepts the following parameters:
2183 Timestamp (in seconds) of the start of the section to keep. I.e. the audio
2184 sample with the timestamp @var{start} will be the first sample in the output.
2187 Specify time of the first audio sample that will be dropped, i.e. the
2188 audio sample immediately preceding the one with the timestamp @var{end} will be
2189 the last sample in the output.
2192 Same as @var{start}, except this option sets the start timestamp in samples
2196 Same as @var{end}, except this option sets the end timestamp in samples instead
2200 The maximum duration of the output in seconds.
2203 The number of the first sample that should be output.
2206 The number of the first sample that should be dropped.
2209 @option{start}, @option{end}, and @option{duration} are expressed as time
2210 duration specifications; see
2211 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
2213 Note that the first two sets of the start/end options and the @option{duration}
2214 option look at the frame timestamp, while the _sample options simply count the
2215 samples that pass through the filter. So start/end_pts and start/end_sample will
2216 give different results when the timestamps are wrong, inexact or do not start at
2217 zero. Also note that this filter does not modify the timestamps. If you wish
2218 to have the output timestamps start at zero, insert the asetpts filter after the
2221 If multiple start or end options are set, this filter tries to be greedy and
2222 keep all samples that match at least one of the specified constraints. To keep
2223 only the part that matches all the constraints at once, chain multiple atrim
2226 The defaults are such that all the input is kept. So it is possible to set e.g.
2227 just the end values to keep everything before the specified time.
2232 Drop everything except the second minute of input:
2234 ffmpeg -i INPUT -af atrim=60:120
2238 Keep only the first 1000 samples:
2240 ffmpeg -i INPUT -af atrim=end_sample=1000
2247 Apply a two-pole Butterworth band-pass filter with central
2248 frequency @var{frequency}, and (3dB-point) band-width width.
2249 The @var{csg} option selects a constant skirt gain (peak gain = Q)
2250 instead of the default: constant 0dB peak gain.
2251 The filter roll off at 6dB per octave (20dB per decade).
2253 The filter accepts the following options:
2257 Set the filter's central frequency. Default is @code{3000}.
2260 Constant skirt gain if set to 1. Defaults to 0.
2263 Set method to specify band-width of filter.
2278 Specify the band-width of a filter in width_type units.
2281 Specify which channels to filter, by default all available are filtered.
2284 @subsection Commands
2286 This filter supports the following commands:
2289 Change bandpass frequency.
2290 Syntax for the command is : "@var{frequency}"
2293 Change bandpass width_type.
2294 Syntax for the command is : "@var{width_type}"
2297 Change bandpass width.
2298 Syntax for the command is : "@var{width}"
2303 Apply a two-pole Butterworth band-reject filter with central
2304 frequency @var{frequency}, and (3dB-point) band-width @var{width}.
2305 The filter roll off at 6dB per octave (20dB per decade).
2307 The filter accepts the following options:
2311 Set the filter's central frequency. Default is @code{3000}.
2314 Set method to specify band-width of filter.
2329 Specify the band-width of a filter in width_type units.
2332 Specify which channels to filter, by default all available are filtered.
2335 @subsection Commands
2337 This filter supports the following commands:
2340 Change bandreject frequency.
2341 Syntax for the command is : "@var{frequency}"
2344 Change bandreject width_type.
2345 Syntax for the command is : "@var{width_type}"
2348 Change bandreject width.
2349 Syntax for the command is : "@var{width}"
2352 @section bass, lowshelf
2354 Boost or cut the bass (lower) frequencies of the audio using a two-pole
2355 shelving filter with a response similar to that of a standard
2356 hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
2358 The filter accepts the following options:
2362 Give the gain at 0 Hz. Its useful range is about -20
2363 (for a large cut) to +20 (for a large boost).
2364 Beware of clipping when using a positive gain.
2367 Set the filter's central frequency and so can be used
2368 to extend or reduce the frequency range to be boosted or cut.
2369 The default value is @code{100} Hz.
2372 Set method to specify band-width of filter.
2387 Determine how steep is the filter's shelf transition.
2390 Specify which channels to filter, by default all available are filtered.
2393 @subsection Commands
2395 This filter supports the following commands:
2398 Change bass frequency.
2399 Syntax for the command is : "@var{frequency}"
2402 Change bass width_type.
2403 Syntax for the command is : "@var{width_type}"
2407 Syntax for the command is : "@var{width}"
2411 Syntax for the command is : "@var{gain}"
2416 Apply a biquad IIR filter with the given coefficients.
2417 Where @var{b0}, @var{b1}, @var{b2} and @var{a0}, @var{a1}, @var{a2}
2418 are the numerator and denominator coefficients respectively.
2419 and @var{channels}, @var{c} specify which channels to filter, by default all
2420 available are filtered.
2422 @subsection Commands
2424 This filter supports the following commands:
2432 Change biquad parameter.
2433 Syntax for the command is : "@var{value}"
2437 Bauer stereo to binaural transformation, which improves headphone listening of
2438 stereo audio records.
2440 To enable compilation of this filter you need to configure FFmpeg with
2441 @code{--enable-libbs2b}.
2443 It accepts the following parameters:
2447 Pre-defined crossfeed level.
2451 Default level (fcut=700, feed=50).
2454 Chu Moy circuit (fcut=700, feed=60).
2457 Jan Meier circuit (fcut=650, feed=95).
2462 Cut frequency (in Hz).
2471 Remap input channels to new locations.
2473 It accepts the following parameters:
2476 Map channels from input to output. The argument is a '|'-separated list of
2477 mappings, each in the @code{@var{in_channel}-@var{out_channel}} or
2478 @var{in_channel} form. @var{in_channel} can be either the name of the input
2479 channel (e.g. FL for front left) or its index in the input channel layout.
2480 @var{out_channel} is the name of the output channel or its index in the output
2481 channel layout. If @var{out_channel} is not given then it is implicitly an
2482 index, starting with zero and increasing by one for each mapping.
2484 @item channel_layout
2485 The channel layout of the output stream.
2488 If no mapping is present, the filter will implicitly map input channels to
2489 output channels, preserving indices.
2491 @subsection Examples
2495 For example, assuming a 5.1+downmix input MOV file,
2497 ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
2499 will create an output WAV file tagged as stereo from the downmix channels of
2503 To fix a 5.1 WAV improperly encoded in AAC's native channel order
2505 ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
2509 @section channelsplit
2511 Split each channel from an input audio stream into a separate output stream.
2513 It accepts the following parameters:
2515 @item channel_layout
2516 The channel layout of the input stream. The default is "stereo".
2518 A channel layout describing the channels to be extracted as separate output streams
2519 or "all" to extract each input channel as a separate stream. The default is "all".
2521 Choosing channels not present in channel layout in the input will result in an error.
2524 @subsection Examples
2528 For example, assuming a stereo input MP3 file,
2530 ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
2532 will create an output Matroska file with two audio streams, one containing only
2533 the left channel and the other the right channel.
2536 Split a 5.1 WAV file into per-channel files:
2538 ffmpeg -i in.wav -filter_complex
2539 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
2540 -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
2541 front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
2546 Extract only LFE from a 5.1 WAV file:
2548 ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1:channels=LFE[LFE]'
2549 -map '[LFE]' lfe.wav
2554 Add a chorus effect to the audio.
2556 Can make a single vocal sound like a chorus, but can also be applied to instrumentation.
2558 Chorus resembles an echo effect with a short delay, but whereas with echo the delay is
2559 constant, with chorus, it is varied using using sinusoidal or triangular modulation.
2560 The modulation depth defines the range the modulated delay is played before or after
2561 the delay. Hence the delayed sound will sound slower or faster, that is the delayed
2562 sound tuned around the original one, like in a chorus where some vocals are slightly
2565 It accepts the following parameters:
2568 Set input gain. Default is 0.4.
2571 Set output gain. Default is 0.4.
2574 Set delays. A typical delay is around 40ms to 60ms.
2586 @subsection Examples
2592 chorus=0.7:0.9:55:0.4:0.25:2
2598 chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
2602 Fuller sounding chorus with three delays:
2604 chorus=0.5:0.9:50|60|40:0.4|0.32|0.3:0.25|0.4|0.3:2|2.3|1.3
2609 Compress or expand the audio's dynamic range.
2611 It accepts the following parameters:
2617 A list of times in seconds for each channel over which the instantaneous level
2618 of the input signal is averaged to determine its volume. @var{attacks} refers to
2619 increase of volume and @var{decays} refers to decrease of volume. For most
2620 situations, the attack time (response to the audio getting louder) should be
2621 shorter than the decay time, because the human ear is more sensitive to sudden
2622 loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
2623 a typical value for decay is 0.8 seconds.
2624 If specified number of attacks & decays is lower than number of channels, the last
2625 set attack/decay will be used for all remaining channels.
2628 A list of points for the transfer function, specified in dB relative to the
2629 maximum possible signal amplitude. Each key points list must be defined using
2630 the following syntax: @code{x0/y0|x1/y1|x2/y2|....} or
2631 @code{x0/y0 x1/y1 x2/y2 ....}
2633 The input values must be in strictly increasing order but the transfer function
2634 does not have to be monotonically rising. The point @code{0/0} is assumed but
2635 may be overridden (by @code{0/out-dBn}). Typical values for the transfer
2636 function are @code{-70/-70|-60/-20|1/0}.
2639 Set the curve radius in dB for all joints. It defaults to 0.01.
2642 Set the additional gain in dB to be applied at all points on the transfer
2643 function. This allows for easy adjustment of the overall gain.
2647 Set an initial volume, in dB, to be assumed for each channel when filtering
2648 starts. This permits the user to supply a nominal level initially, so that, for
2649 example, a very large gain is not applied to initial signal levels before the
2650 companding has begun to operate. A typical value for audio which is initially
2651 quiet is -90 dB. It defaults to 0.
2654 Set a delay, in seconds. The input audio is analyzed immediately, but audio is
2655 delayed before being fed to the volume adjuster. Specifying a delay
2656 approximately equal to the attack/decay times allows the filter to effectively
2657 operate in predictive rather than reactive mode. It defaults to 0.
2661 @subsection Examples
2665 Make music with both quiet and loud passages suitable for listening to in a
2668 compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
2671 Another example for audio with whisper and explosion parts:
2673 compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
2677 A noise gate for when the noise is at a lower level than the signal:
2679 compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
2683 Here is another noise gate, this time for when the noise is at a higher level
2684 than the signal (making it, in some ways, similar to squelch):
2686 compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
2690 2:1 compression starting at -6dB:
2692 compand=points=-80/-80|-6/-6|0/-3.8|20/3.5
2696 2:1 compression starting at -9dB:
2698 compand=points=-80/-80|-9/-9|0/-5.3|20/2.9
2702 2:1 compression starting at -12dB:
2704 compand=points=-80/-80|-12/-12|0/-6.8|20/1.9
2708 2:1 compression starting at -18dB:
2710 compand=points=-80/-80|-18/-18|0/-9.8|20/0.7
2714 3:1 compression starting at -15dB:
2716 compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2
2722 compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
2728 compand=attacks=0:points=-80/-169|-54/-80|-49.5/-64.6|-41.1/-41.1|-25.8/-15|-10.8/-4.5|0/0|20/8.3
2732 Hard limiter at -6dB:
2734 compand=attacks=0:points=-80/-80|-6/-6|20/-6
2738 Hard limiter at -12dB:
2740 compand=attacks=0:points=-80/-80|-12/-12|20/-12
2744 Hard noise gate at -35 dB:
2746 compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20
2752 compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
2756 @section compensationdelay
2758 Compensation Delay Line is a metric based delay to compensate differing
2759 positions of microphones or speakers.
2761 For example, you have recorded guitar with two microphones placed in
2762 different location. Because the front of sound wave has fixed speed in
2763 normal conditions, the phasing of microphones can vary and depends on
2764 their location and interposition. The best sound mix can be achieved when
2765 these microphones are in phase (synchronized). Note that distance of
2766 ~30 cm between microphones makes one microphone to capture signal in
2767 antiphase to another microphone. That makes the final mix sounding moody.
2768 This filter helps to solve phasing problems by adding different delays
2769 to each microphone track and make them synchronized.
2771 The best result can be reached when you take one track as base and
2772 synchronize other tracks one by one with it.
2773 Remember that synchronization/delay tolerance depends on sample rate, too.
2774 Higher sample rates will give more tolerance.
2776 It accepts the following parameters:
2780 Set millimeters distance. This is compensation distance for fine tuning.
2784 Set cm distance. This is compensation distance for tightening distance setup.
2788 Set meters distance. This is compensation distance for hard distance setup.
2792 Set dry amount. Amount of unprocessed (dry) signal.
2796 Set wet amount. Amount of processed (wet) signal.
2800 Set temperature degree in Celsius. This is the temperature of the environment.
2805 Apply headphone crossfeed filter.
2807 Crossfeed is the process of blending the left and right channels of stereo
2809 It is mainly used to reduce extreme stereo separation of low frequencies.
2811 The intent is to produce more speaker like sound to the listener.
2813 The filter accepts the following options:
2817 Set strength of crossfeed. Default is 0.2. Allowed range is from 0 to 1.
2818 This sets gain of low shelf filter for side part of stereo image.
2819 Default is -6dB. Max allowed is -30db when strength is set to 1.
2822 Set soundstage wideness. Default is 0.5. Allowed range is from 0 to 1.
2823 This sets cut off frequency of low shelf filter. Default is cut off near
2824 1550 Hz. With range set to 1 cut off frequency is set to 2100 Hz.
2827 Set input gain. Default is 0.9.
2830 Set output gain. Default is 1.
2833 @section crystalizer
2834 Simple algorithm to expand audio dynamic range.
2836 The filter accepts the following options:
2840 Sets the intensity of effect (default: 2.0). Must be in range between 0.0
2841 (unchanged sound) to 10.0 (maximum effect).
2844 Enable clipping. By default is enabled.
2848 Apply a DC shift to the audio.
2850 This can be useful to remove a DC offset (caused perhaps by a hardware problem
2851 in the recording chain) from the audio. The effect of a DC offset is reduced
2852 headroom and hence volume. The @ref{astats} filter can be used to determine if
2853 a signal has a DC offset.
2857 Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift
2861 Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is
2862 used to prevent clipping.
2866 Measure audio dynamic range.
2868 DR values of 14 and higher is found in very dynamic material. DR of 8 to 13
2869 is found in transition material. And anything less that 8 have very poor dynamics
2870 and is very compressed.
2872 The filter accepts the following options:
2876 Set window length in seconds used to split audio into segments of equal length.
2877 Default is 3 seconds.
2881 Dynamic Audio Normalizer.
2883 This filter applies a certain amount of gain to the input audio in order
2884 to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in
2885 contrast to more "simple" normalization algorithms, the Dynamic Audio
2886 Normalizer *dynamically* re-adjusts the gain factor to the input audio.
2887 This allows for applying extra gain to the "quiet" sections of the audio
2888 while avoiding distortions or clipping the "loud" sections. In other words:
2889 The Dynamic Audio Normalizer will "even out" the volume of quiet and loud
2890 sections, in the sense that the volume of each section is brought to the
2891 same target level. Note, however, that the Dynamic Audio Normalizer achieves
2892 this goal *without* applying "dynamic range compressing". It will retain 100%
2893 of the dynamic range *within* each section of the audio file.
2897 Set the frame length in milliseconds. In range from 10 to 8000 milliseconds.
2898 Default is 500 milliseconds.
2899 The Dynamic Audio Normalizer processes the input audio in small chunks,
2900 referred to as frames. This is required, because a peak magnitude has no
2901 meaning for just a single sample value. Instead, we need to determine the
2902 peak magnitude for a contiguous sequence of sample values. While a "standard"
2903 normalizer would simply use the peak magnitude of the complete file, the
2904 Dynamic Audio Normalizer determines the peak magnitude individually for each
2905 frame. The length of a frame is specified in milliseconds. By default, the
2906 Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has
2907 been found to give good results with most files.
2908 Note that the exact frame length, in number of samples, will be determined
2909 automatically, based on the sampling rate of the individual input audio file.
2912 Set the Gaussian filter window size. In range from 3 to 301, must be odd
2913 number. Default is 31.
2914 Probably the most important parameter of the Dynamic Audio Normalizer is the
2915 @code{window size} of the Gaussian smoothing filter. The filter's window size
2916 is specified in frames, centered around the current frame. For the sake of
2917 simplicity, this must be an odd number. Consequently, the default value of 31
2918 takes into account the current frame, as well as the 15 preceding frames and
2919 the 15 subsequent frames. Using a larger window results in a stronger
2920 smoothing effect and thus in less gain variation, i.e. slower gain
2921 adaptation. Conversely, using a smaller window results in a weaker smoothing
2922 effect and thus in more gain variation, i.e. faster gain adaptation.
2923 In other words, the more you increase this value, the more the Dynamic Audio
2924 Normalizer will behave like a "traditional" normalization filter. On the
2925 contrary, the more you decrease this value, the more the Dynamic Audio
2926 Normalizer will behave like a dynamic range compressor.
2929 Set the target peak value. This specifies the highest permissible magnitude
2930 level for the normalized audio input. This filter will try to approach the
2931 target peak magnitude as closely as possible, but at the same time it also
2932 makes sure that the normalized signal will never exceed the peak magnitude.
2933 A frame's maximum local gain factor is imposed directly by the target peak
2934 magnitude. The default value is 0.95 and thus leaves a headroom of 5%*.
2935 It is not recommended to go above this value.
2938 Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0.
2939 The Dynamic Audio Normalizer determines the maximum possible (local) gain
2940 factor for each input frame, i.e. the maximum gain factor that does not
2941 result in clipping or distortion. The maximum gain factor is determined by
2942 the frame's highest magnitude sample. However, the Dynamic Audio Normalizer
2943 additionally bounds the frame's maximum gain factor by a predetermined
2944 (global) maximum gain factor. This is done in order to avoid excessive gain
2945 factors in "silent" or almost silent frames. By default, the maximum gain
2946 factor is 10.0, For most inputs the default value should be sufficient and
2947 it usually is not recommended to increase this value. Though, for input
2948 with an extremely low overall volume level, it may be necessary to allow even
2949 higher gain factors. Note, however, that the Dynamic Audio Normalizer does
2950 not simply apply a "hard" threshold (i.e. cut off values above the threshold).
2951 Instead, a "sigmoid" threshold function will be applied. This way, the
2952 gain factors will smoothly approach the threshold value, but never exceed that
2956 Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled.
2957 By default, the Dynamic Audio Normalizer performs "peak" normalization.
2958 This means that the maximum local gain factor for each frame is defined
2959 (only) by the frame's highest magnitude sample. This way, the samples can
2960 be amplified as much as possible without exceeding the maximum signal
2961 level, i.e. without clipping. Optionally, however, the Dynamic Audio
2962 Normalizer can also take into account the frame's root mean square,
2963 abbreviated RMS. In electrical engineering, the RMS is commonly used to
2964 determine the power of a time-varying signal. It is therefore considered
2965 that the RMS is a better approximation of the "perceived loudness" than
2966 just looking at the signal's peak magnitude. Consequently, by adjusting all
2967 frames to a constant RMS value, a uniform "perceived loudness" can be
2968 established. If a target RMS value has been specified, a frame's local gain
2969 factor is defined as the factor that would result in exactly that RMS value.
2970 Note, however, that the maximum local gain factor is still restricted by the
2971 frame's highest magnitude sample, in order to prevent clipping.
2974 Enable channels coupling. By default is enabled.
2975 By default, the Dynamic Audio Normalizer will amplify all channels by the same
2976 amount. This means the same gain factor will be applied to all channels, i.e.
2977 the maximum possible gain factor is determined by the "loudest" channel.
2978 However, in some recordings, it may happen that the volume of the different
2979 channels is uneven, e.g. one channel may be "quieter" than the other one(s).
2980 In this case, this option can be used to disable the channel coupling. This way,
2981 the gain factor will be determined independently for each channel, depending
2982 only on the individual channel's highest magnitude sample. This allows for
2983 harmonizing the volume of the different channels.
2986 Enable DC bias correction. By default is disabled.
2987 An audio signal (in the time domain) is a sequence of sample values.
2988 In the Dynamic Audio Normalizer these sample values are represented in the
2989 -1.0 to 1.0 range, regardless of the original input format. Normally, the
2990 audio signal, or "waveform", should be centered around the zero point.
2991 That means if we calculate the mean value of all samples in a file, or in a
2992 single frame, then the result should be 0.0 or at least very close to that
2993 value. If, however, there is a significant deviation of the mean value from
2994 0.0, in either positive or negative direction, this is referred to as a
2995 DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic
2996 Audio Normalizer provides optional DC bias correction.
2997 With DC bias correction enabled, the Dynamic Audio Normalizer will determine
2998 the mean value, or "DC correction" offset, of each input frame and subtract
2999 that value from all of the frame's sample values which ensures those samples
3000 are centered around 0.0 again. Also, in order to avoid "gaps" at the frame
3001 boundaries, the DC correction offset values will be interpolated smoothly
3002 between neighbouring frames.
3005 Enable alternative boundary mode. By default is disabled.
3006 The Dynamic Audio Normalizer takes into account a certain neighbourhood
3007 around each frame. This includes the preceding frames as well as the
3008 subsequent frames. However, for the "boundary" frames, located at the very
3009 beginning and at the very end of the audio file, not all neighbouring
3010 frames are available. In particular, for the first few frames in the audio
3011 file, the preceding frames are not known. And, similarly, for the last few
3012 frames in the audio file, the subsequent frames are not known. Thus, the
3013 question arises which gain factors should be assumed for the missing frames
3014 in the "boundary" region. The Dynamic Audio Normalizer implements two modes
3015 to deal with this situation. The default boundary mode assumes a gain factor
3016 of exactly 1.0 for the missing frames, resulting in a smooth "fade in" and
3017 "fade out" at the beginning and at the end of the input, respectively.
3020 Set the compress factor. In range from 0.0 to 30.0. Default is 0.0.
3021 By default, the Dynamic Audio Normalizer does not apply "traditional"
3022 compression. This means that signal peaks will not be pruned and thus the
3023 full dynamic range will be retained within each local neighbourhood. However,
3024 in some cases it may be desirable to combine the Dynamic Audio Normalizer's
3025 normalization algorithm with a more "traditional" compression.
3026 For this purpose, the Dynamic Audio Normalizer provides an optional compression
3027 (thresholding) function. If (and only if) the compression feature is enabled,
3028 all input frames will be processed by a soft knee thresholding function prior
3029 to the actual normalization process. Put simply, the thresholding function is
3030 going to prune all samples whose magnitude exceeds a certain threshold value.
3031 However, the Dynamic Audio Normalizer does not simply apply a fixed threshold
3032 value. Instead, the threshold value will be adjusted for each individual
3034 In general, smaller parameters result in stronger compression, and vice versa.
3035 Values below 3.0 are not recommended, because audible distortion may appear.
3040 Make audio easier to listen to on headphones.
3042 This filter adds `cues' to 44.1kHz stereo (i.e. audio CD format) audio
3043 so that when listened to on headphones the stereo image is moved from
3044 inside your head (standard for headphones) to outside and in front of
3045 the listener (standard for speakers).
3051 Apply a two-pole peaking equalisation (EQ) filter. With this
3052 filter, the signal-level at and around a selected frequency can
3053 be increased or decreased, whilst (unlike bandpass and bandreject
3054 filters) that at all other frequencies is unchanged.
3056 In order to produce complex equalisation curves, this filter can
3057 be given several times, each with a different central frequency.
3059 The filter accepts the following options:
3063 Set the filter's central frequency in Hz.
3066 Set method to specify band-width of filter.
3081 Specify the band-width of a filter in width_type units.
3084 Set the required gain or attenuation in dB.
3085 Beware of clipping when using a positive gain.
3088 Specify which channels to filter, by default all available are filtered.
3091 @subsection Examples
3094 Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
3096 equalizer=f=1000:t=h:width=200:g=-10
3100 Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2:
3102 equalizer=f=1000:t=q:w=1:g=2,equalizer=f=100:t=q:w=2:g=-5
3106 @subsection Commands
3108 This filter supports the following commands:
3111 Change equalizer frequency.
3112 Syntax for the command is : "@var{frequency}"
3115 Change equalizer width_type.
3116 Syntax for the command is : "@var{width_type}"
3119 Change equalizer width.
3120 Syntax for the command is : "@var{width}"
3123 Change equalizer gain.
3124 Syntax for the command is : "@var{gain}"
3127 @section extrastereo
3129 Linearly increases the difference between left and right channels which
3130 adds some sort of "live" effect to playback.
3132 The filter accepts the following options:
3136 Sets the difference coefficient (default: 2.5). 0.0 means mono sound
3137 (average of both channels), with 1.0 sound will be unchanged, with
3138 -1.0 left and right channels will be swapped.
3141 Enable clipping. By default is enabled.
3144 @section firequalizer
3145 Apply FIR Equalization using arbitrary frequency response.
3147 The filter accepts the following option:
3151 Set gain curve equation (in dB). The expression can contain variables:
3154 the evaluated frequency
3158 channel number, set to 0 when multichannels evaluation is disabled
3160 channel id, see libavutil/channel_layout.h, set to the first channel id when
3161 multichannels evaluation is disabled
3165 channel_layout, see libavutil/channel_layout.h
3170 @item gain_interpolate(f)
3171 interpolate gain on frequency f based on gain_entry
3172 @item cubic_interpolate(f)
3173 same as gain_interpolate, but smoother
3175 This option is also available as command. Default is @code{gain_interpolate(f)}.
3178 Set gain entry for gain_interpolate function. The expression can
3182 store gain entry at frequency f with value g
3184 This option is also available as command.
3187 Set filter delay in seconds. Higher value means more accurate.
3188 Default is @code{0.01}.
3191 Set filter accuracy in Hz. Lower value means more accurate.
3192 Default is @code{5}.
3195 Set window function. Acceptable values are:
3198 rectangular window, useful when gain curve is already smooth
3200 hann window (default)
3206 3-terms continuous 1st derivative nuttall window
3208 minimum 3-terms discontinuous nuttall window
3210 4-terms continuous 1st derivative nuttall window
3212 minimum 4-terms discontinuous nuttall (blackman-nuttall) window
3214 blackman-harris window
3220 If enabled, use fixed number of audio samples. This improves speed when
3221 filtering with large delay. Default is disabled.
3224 Enable multichannels evaluation on gain. Default is disabled.
3227 Enable zero phase mode by subtracting timestamp to compensate delay.
3228 Default is disabled.
3231 Set scale used by gain. Acceptable values are:
3234 linear frequency, linear gain
3236 linear frequency, logarithmic (in dB) gain (default)
3238 logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain
3240 logarithmic frequency, logarithmic gain
3244 Set file for dumping, suitable for gnuplot.
3247 Set scale for dumpfile. Acceptable values are same with scale option.
3251 Enable 2-channel convolution using complex FFT. This improves speed significantly.
3252 Default is disabled.
3255 Enable minimum phase impulse response. Default is disabled.
3258 @subsection Examples
3263 firequalizer=gain='if(lt(f,1000), 0, -INF)'
3266 lowpass at 1000 Hz with gain_entry:
3268 firequalizer=gain_entry='entry(1000,0); entry(1001, -INF)'
3271 custom equalization:
3273 firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)'
3276 higher delay with zero phase to compensate delay:
3278 firequalizer=delay=0.1:fixed=on:zero_phase=on
3281 lowpass on left channel, highpass on right channel:
3283 firequalizer=gain='if(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))'
3284 :gain_entry='entry(1000, 0); entry(1001,-INF); entry(1e6+1000,0)':multi=on
3289 Apply a flanging effect to the audio.
3291 The filter accepts the following options:
3295 Set base delay in milliseconds. Range from 0 to 30. Default value is 0.
3298 Set added sweep delay in milliseconds. Range from 0 to 10. Default value is 2.
3301 Set percentage regeneration (delayed signal feedback). Range from -95 to 95.
3305 Set percentage of delayed signal mixed with original. Range from 0 to 100.
3306 Default value is 71.
3309 Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5.
3312 Set swept wave shape, can be @var{triangular} or @var{sinusoidal}.
3313 Default value is @var{sinusoidal}.
3316 Set swept wave percentage-shift for multi channel. Range from 0 to 100.
3317 Default value is 25.
3320 Set delay-line interpolation, @var{linear} or @var{quadratic}.
3321 Default is @var{linear}.
3325 Apply Haas effect to audio.
3327 Note that this makes most sense to apply on mono signals.
3328 With this filter applied to mono signals it give some directionality and
3329 stretches its stereo image.
3331 The filter accepts the following options:
3335 Set input level. By default is @var{1}, or 0dB
3338 Set output level. By default is @var{1}, or 0dB.
3341 Set gain applied to side part of signal. By default is @var{1}.
3344 Set kind of middle source. Can be one of the following:
3354 Pick middle part signal of stereo image.
3357 Pick side part signal of stereo image.
3361 Change middle phase. By default is disabled.
3364 Set left channel delay. By default is @var{2.05} milliseconds.
3367 Set left channel balance. By default is @var{-1}.
3370 Set left channel gain. By default is @var{1}.
3373 Change left phase. By default is disabled.
3376 Set right channel delay. By defaults is @var{2.12} milliseconds.
3379 Set right channel balance. By default is @var{1}.
3382 Set right channel gain. By default is @var{1}.
3385 Change right phase. By default is enabled.
3390 Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with
3391 embedded HDCD codes is expanded into a 20-bit PCM stream.
3393 The filter supports the Peak Extend and Low-level Gain Adjustment features
3394 of HDCD, and detects the Transient Filter flag.
3397 ffmpeg -i HDCD16.flac -af hdcd OUT24.flac
3400 When using the filter with wav, note the default encoding for wav is 16-bit,
3401 so the resulting 20-bit stream will be truncated back to 16-bit. Use something
3402 like @command{-acodec pcm_s24le} after the filter to get 24-bit PCM output.
3404 ffmpeg -i HDCD16.wav -af hdcd OUT16.wav
3405 ffmpeg -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav
3408 The filter accepts the following options:
3411 @item disable_autoconvert
3412 Disable any automatic format conversion or resampling in the filter graph.
3414 @item process_stereo
3415 Process the stereo channels together. If target_gain does not match between
3416 channels, consider it invalid and use the last valid target_gain.
3419 Set the code detect timer period in ms.
3422 Always extend peaks above -3dBFS even if PE isn't signaled.
3425 Replace audio with a solid tone and adjust the amplitude to signal some
3426 specific aspect of the decoding process. The output file can be loaded in
3427 an audio editor alongside the original to aid analysis.
3429 @code{analyze_mode=pe:force_pe=true} can be used to see all samples above the PE level.
3436 Gain adjustment level at each sample
3438 Samples where peak extend occurs
3440 Samples where the code detect timer is active
3442 Samples where the target gain does not match between channels
3448 Apply head-related transfer functions (HRTFs) to create virtual
3449 loudspeakers around the user for binaural listening via headphones.
3450 The HRIRs are provided via additional streams, for each channel
3451 one stereo input stream is needed.
3453 The filter accepts the following options:
3457 Set mapping of input streams for convolution.
3458 The argument is a '|'-separated list of channel names in order as they
3459 are given as additional stream inputs for filter.
3460 This also specify number of input streams. Number of input streams
3461 must be not less than number of channels in first stream plus one.
3464 Set gain applied to audio. Value is in dB. Default is 0.
3467 Set processing type. Can be @var{time} or @var{freq}. @var{time} is
3468 processing audio in time domain which is slow.
3469 @var{freq} is processing audio in frequency domain which is fast.
3470 Default is @var{freq}.
3473 Set custom gain for LFE channels. Value is in dB. Default is 0.
3476 Set size of frame in number of samples which will be processed at once.
3477 Default value is @var{1024}. Allowed range is from 1024 to 96000.
3480 Set format of hrir stream.
3481 Default value is @var{stereo}. Alternative value is @var{multich}.
3482 If value is set to @var{stereo}, number of additional streams should
3483 be greater or equal to number of input channels in first input stream.
3484 Also each additional stream should have stereo number of channels.
3485 If value is set to @var{multich}, number of additional streams should
3486 be exactly one. Also number of input channels of additional stream
3487 should be equal or greater than twice number of channels of first input
3491 @subsection Examples
3495 Full example using wav files as coefficients with amovie filters for 7.1 downmix,
3496 each amovie filter use stereo file with IR coefficients as input.
3497 The files give coefficients for each position of virtual loudspeaker:
3499 ffmpeg -i input.wav -lavfi-complex "amovie=azi_270_ele_0_DFC.wav[sr],amovie=azi_90_ele_0_DFC.wav[sl],amovie=azi_225_ele_0_DFC.wav[br],amovie=azi_135_ele_0_DFC.wav[bl],amovie=azi_0_ele_0_DFC.wav,asplit[fc][lfe],amovie=azi_35_ele_0_DFC.wav[fl],amovie=azi_325_ele_0_DFC.wav[fr],[a:0][fl][fr][fc][lfe][bl][br][sl][sr]headphone=FL|FR|FC|LFE|BL|BR|SL|SR"
3504 Full example using wav files as coefficients with amovie filters for 7.1 downmix,
3505 but now in @var{multich} @var{hrir} format.
3507 ffmpeg -i input.wav -lavfi-complex "amovie=minp.wav[hrirs],[a:0][hrirs]headphone=map=FL|FR|FC|LFE|BL|BR|SL|SR:hrir=multich"
3514 Apply a high-pass filter with 3dB point frequency.
3515 The filter can be either single-pole, or double-pole (the default).
3516 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
3518 The filter accepts the following options:
3522 Set frequency in Hz. Default is 3000.
3525 Set number of poles. Default is 2.
3528 Set method to specify band-width of filter.
3543 Specify the band-width of a filter in width_type units.
3544 Applies only to double-pole filter.
3545 The default is 0.707q and gives a Butterworth response.
3548 Specify which channels to filter, by default all available are filtered.
3551 @subsection Commands
3553 This filter supports the following commands:
3556 Change highpass frequency.
3557 Syntax for the command is : "@var{frequency}"
3560 Change highpass width_type.
3561 Syntax for the command is : "@var{width_type}"
3564 Change highpass width.
3565 Syntax for the command is : "@var{width}"
3570 Join multiple input streams into one multi-channel stream.
3572 It accepts the following parameters:
3576 The number of input streams. It defaults to 2.
3578 @item channel_layout
3579 The desired output channel layout. It defaults to stereo.
3582 Map channels from inputs to output. The argument is a '|'-separated list of
3583 mappings, each in the @code{@var{input_idx}.@var{in_channel}-@var{out_channel}}
3584 form. @var{input_idx} is the 0-based index of the input stream. @var{in_channel}
3585 can be either the name of the input channel (e.g. FL for front left) or its
3586 index in the specified input stream. @var{out_channel} is the name of the output
3590 The filter will attempt to guess the mappings when they are not specified
3591 explicitly. It does so by first trying to find an unused matching input channel
3592 and if that fails it picks the first unused input channel.
3594 Join 3 inputs (with properly set channel layouts):
3596 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
3599 Build a 5.1 output from 6 single-channel streams:
3601 ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
3602 'join=inputs=6:channel_layout=5.1:map=0.0-FL|1.0-FR|2.0-FC|3.0-SL|4.0-SR|5.0-LFE'
3608 Load a LADSPA (Linux Audio Developer's Simple Plugin API) plugin.
3610 To enable compilation of this filter you need to configure FFmpeg with
3611 @code{--enable-ladspa}.
3615 Specifies the name of LADSPA plugin library to load. If the environment
3616 variable @env{LADSPA_PATH} is defined, the LADSPA plugin is searched in
3617 each one of the directories specified by the colon separated list in
3618 @env{LADSPA_PATH}, otherwise in the standard LADSPA paths, which are in
3619 this order: @file{HOME/.ladspa/lib/}, @file{/usr/local/lib/ladspa/},
3620 @file{/usr/lib/ladspa/}.
3623 Specifies the plugin within the library. Some libraries contain only
3624 one plugin, but others contain many of them. If this is not set filter
3625 will list all available plugins within the specified library.
3628 Set the '|' separated list of controls which are zero or more floating point
3629 values that determine the behavior of the loaded plugin (for example delay,
3631 Controls need to be defined using the following syntax:
3632 c0=@var{value0}|c1=@var{value1}|c2=@var{value2}|..., where
3633 @var{valuei} is the value set on the @var{i}-th control.
3634 Alternatively they can be also defined using the following syntax:
3635 @var{value0}|@var{value1}|@var{value2}|..., where
3636 @var{valuei} is the value set on the @var{i}-th control.
3637 If @option{controls} is set to @code{help}, all available controls and
3638 their valid ranges are printed.
3640 @item sample_rate, s
3641 Specify the sample rate, default to 44100. Only used if plugin have
3645 Set the number of samples per channel per each output frame, default
3646 is 1024. Only used if plugin have zero inputs.
3649 Set the minimum duration of the sourced audio. See
3650 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
3651 for the accepted syntax.
3652 Note that the resulting duration may be greater than the specified duration,
3653 as the generated audio is always cut at the end of a complete frame.
3654 If not specified, or the expressed duration is negative, the audio is
3655 supposed to be generated forever.
3656 Only used if plugin have zero inputs.
3660 @subsection Examples
3664 List all available plugins within amp (LADSPA example plugin) library:
3670 List all available controls and their valid ranges for @code{vcf_notch}
3671 plugin from @code{VCF} library:
3673 ladspa=f=vcf:p=vcf_notch:c=help
3677 Simulate low quality audio equipment using @code{Computer Music Toolkit} (CMT)
3680 ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
3684 Add reverberation to the audio using TAP-plugins
3685 (Tom's Audio Processing plugins):
3687 ladspa=file=tap_reverb:tap_reverb
3691 Generate white noise, with 0.2 amplitude:
3693 ladspa=file=cmt:noise_source_white:c=c0=.2
3697 Generate 20 bpm clicks using plugin @code{C* Click - Metronome} from the
3698 @code{C* Audio Plugin Suite} (CAPS) library:
3700 ladspa=file=caps:Click:c=c1=20'
3704 Apply @code{C* Eq10X2 - Stereo 10-band equaliser} effect:
3706 ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
3710 Increase volume by 20dB using fast lookahead limiter from Steve Harris
3711 @code{SWH Plugins} collection:
3713 ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
3717 Attenuate low frequencies using Multiband EQ from Steve Harris
3718 @code{SWH Plugins} collection:
3720 ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
3724 Reduce stereo image using @code{Narrower} from the @code{C* Audio Plugin Suite}
3727 ladspa=caps:Narrower
3731 Another white noise, now using @code{C* Audio Plugin Suite} (CAPS) library:
3733 ladspa=caps:White:.2
3737 Some fractal noise, using @code{C* Audio Plugin Suite} (CAPS) library:
3739 ladspa=caps:Fractal:c=c1=1
3743 Dynamic volume normalization using @code{VLevel} plugin:
3745 ladspa=vlevel-ladspa:vlevel_mono
3749 @subsection Commands
3751 This filter supports the following commands:
3754 Modify the @var{N}-th control value.
3756 If the specified value is not valid, it is ignored and prior one is kept.
3761 EBU R128 loudness normalization. Includes both dynamic and linear normalization modes.
3762 Support for both single pass (livestreams, files) and double pass (files) modes.
3763 This algorithm can target IL, LRA, and maximum true peak. To accurately detect true peaks,
3764 the audio stream will be upsampled to 192 kHz unless the normalization mode is linear.
3765 Use the @code{-ar} option or @code{aresample} filter to explicitly set an output sample rate.
3767 The filter accepts the following options:
3771 Set integrated loudness target.
3772 Range is -70.0 - -5.0. Default value is -24.0.
3775 Set loudness range target.
3776 Range is 1.0 - 20.0. Default value is 7.0.
3779 Set maximum true peak.
3780 Range is -9.0 - +0.0. Default value is -2.0.
3782 @item measured_I, measured_i
3783 Measured IL of input file.
3784 Range is -99.0 - +0.0.
3786 @item measured_LRA, measured_lra
3787 Measured LRA of input file.
3788 Range is 0.0 - 99.0.
3790 @item measured_TP, measured_tp
3791 Measured true peak of input file.
3792 Range is -99.0 - +99.0.
3794 @item measured_thresh
3795 Measured threshold of input file.
3796 Range is -99.0 - +0.0.
3799 Set offset gain. Gain is applied before the true-peak limiter.
3800 Range is -99.0 - +99.0. Default is +0.0.
3803 Normalize linearly if possible.
3804 measured_I, measured_LRA, measured_TP, and measured_thresh must also
3805 to be specified in order to use this mode.
3806 Options are true or false. Default is true.
3809 Treat mono input files as "dual-mono". If a mono file is intended for playback
3810 on a stereo system, its EBU R128 measurement will be perceptually incorrect.
3811 If set to @code{true}, this option will compensate for this effect.
3812 Multi-channel input files are not affected by this option.
3813 Options are true or false. Default is false.
3816 Set print format for stats. Options are summary, json, or none.
3817 Default value is none.
3822 Apply a low-pass filter with 3dB point frequency.
3823 The filter can be either single-pole or double-pole (the default).
3824 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
3826 The filter accepts the following options:
3830 Set frequency in Hz. Default is 500.
3833 Set number of poles. Default is 2.
3836 Set method to specify band-width of filter.
3851 Specify the band-width of a filter in width_type units.
3852 Applies only to double-pole filter.
3853 The default is 0.707q and gives a Butterworth response.
3856 Specify which channels to filter, by default all available are filtered.
3859 @subsection Examples
3862 Lowpass only LFE channel, it LFE is not present it does nothing:
3868 @subsection Commands
3870 This filter supports the following commands:
3873 Change lowpass frequency.
3874 Syntax for the command is : "@var{frequency}"
3877 Change lowpass width_type.
3878 Syntax for the command is : "@var{width_type}"
3881 Change lowpass width.
3882 Syntax for the command is : "@var{width}"
3887 Load a LV2 (LADSPA Version 2) plugin.
3889 To enable compilation of this filter you need to configure FFmpeg with
3890 @code{--enable-lv2}.
3894 Specifies the plugin URI. You may need to escape ':'.
3897 Set the '|' separated list of controls which are zero or more floating point
3898 values that determine the behavior of the loaded plugin (for example delay,
3900 If @option{controls} is set to @code{help}, all available controls and
3901 their valid ranges are printed.
3903 @item sample_rate, s
3904 Specify the sample rate, default to 44100. Only used if plugin have
3908 Set the number of samples per channel per each output frame, default
3909 is 1024. Only used if plugin have zero inputs.
3912 Set the minimum duration of the sourced audio. See
3913 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
3914 for the accepted syntax.
3915 Note that the resulting duration may be greater than the specified duration,
3916 as the generated audio is always cut at the end of a complete frame.
3917 If not specified, or the expressed duration is negative, the audio is
3918 supposed to be generated forever.
3919 Only used if plugin have zero inputs.
3922 @subsection Examples
3926 Apply bass enhancer plugin from Calf:
3928 lv2=p=http\\\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=2
3932 Apply vinyl plugin from Calf:
3934 lv2=p=http\\\\://calf.sourceforge.net/plugins/Vinyl:c=drone=0.2|aging=0.5
3938 Apply bit crusher plugin from ArtyFX:
3940 lv2=p=http\\\\://www.openavproductions.com/artyfx#bitta:c=crush=0.3
3945 Multiband Compress or expand the audio's dynamic range.
3947 The input audio is divided into bands using 4th order Linkwitz-Riley IIRs.
3948 This is akin to the crossover of a loudspeaker, and results in flat frequency
3949 response when absent compander action.
3951 It accepts the following parameters:
3955 This option syntax is:
3956 attack,decay,[attack,decay..] soft-knee points crossover_frequency [delay [initial_volume [gain]]] | attack,decay ...
3957 For explanation of each item refer to compand filter documentation.
3963 Mix channels with specific gain levels. The filter accepts the output
3964 channel layout followed by a set of channels definitions.
3966 This filter is also designed to efficiently remap the channels of an audio
3969 The filter accepts parameters of the form:
3970 "@var{l}|@var{outdef}|@var{outdef}|..."
3974 output channel layout or number of channels
3977 output channel specification, of the form:
3978 "@var{out_name}=[@var{gain}*]@var{in_name}[(+-)[@var{gain}*]@var{in_name}...]"
3981 output channel to define, either a channel name (FL, FR, etc.) or a channel
3982 number (c0, c1, etc.)
3985 multiplicative coefficient for the channel, 1 leaving the volume unchanged
3988 input channel to use, see out_name for details; it is not possible to mix
3989 named and numbered input channels
3992 If the `=' in a channel specification is replaced by `<', then the gains for
3993 that specification will be renormalized so that the total is 1, thus
3994 avoiding clipping noise.
3996 @subsection Mixing examples
3998 For example, if you want to down-mix from stereo to mono, but with a bigger
3999 factor for the left channel:
4001 pan=1c|c0=0.9*c0+0.1*c1
4004 A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
4005 7-channels surround:
4007 pan=stereo| FL < FL + 0.5*FC + 0.6*BL + 0.6*SL | FR < FR + 0.5*FC + 0.6*BR + 0.6*SR
4010 Note that @command{ffmpeg} integrates a default down-mix (and up-mix) system
4011 that should be preferred (see "-ac" option) unless you have very specific
4014 @subsection Remapping examples
4016 The channel remapping will be effective if, and only if:
4019 @item gain coefficients are zeroes or ones,
4020 @item only one input per channel output,
4023 If all these conditions are satisfied, the filter will notify the user ("Pure
4024 channel mapping detected"), and use an optimized and lossless method to do the
4027 For example, if you have a 5.1 source and want a stereo audio stream by
4028 dropping the extra channels:
4030 pan="stereo| c0=FL | c1=FR"
4033 Given the same source, you can also switch front left and front right channels
4034 and keep the input channel layout:
4036 pan="5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5"
4039 If the input is a stereo audio stream, you can mute the front left channel (and
4040 still keep the stereo channel layout) with:
4045 Still with a stereo audio stream input, you can copy the right channel in both
4046 front left and right:
4048 pan="stereo| c0=FR | c1=FR"
4053 ReplayGain scanner filter. This filter takes an audio stream as an input and
4054 outputs it unchanged.
4055 At end of filtering it displays @code{track_gain} and @code{track_peak}.
4059 Convert the audio sample format, sample rate and channel layout. It is
4060 not meant to be used directly.
4063 Apply time-stretching and pitch-shifting with librubberband.
4065 To enable compilation of this filter, you need to configure FFmpeg with
4066 @code{--enable-librubberband}.
4068 The filter accepts the following options:
4072 Set tempo scale factor.
4075 Set pitch scale factor.
4078 Set transients detector.
4079 Possible values are:
4088 Possible values are:
4097 Possible values are:
4104 Set processing window size.
4105 Possible values are:
4114 Possible values are:
4121 Enable formant preservation when shift pitching.
4122 Possible values are:
4130 Possible values are:
4139 Possible values are:
4146 @section sidechaincompress
4148 This filter acts like normal compressor but has the ability to compress
4149 detected signal using second input signal.
4150 It needs two input streams and returns one output stream.
4151 First input stream will be processed depending on second stream signal.
4152 The filtered signal then can be filtered with other filters in later stages of
4153 processing. See @ref{pan} and @ref{amerge} filter.
4155 The filter accepts the following options:
4159 Set input gain. Default is 1. Range is between 0.015625 and 64.
4162 If a signal of second stream raises above this level it will affect the gain
4163 reduction of first stream.
4164 By default is 0.125. Range is between 0.00097563 and 1.
4167 Set a ratio about which the signal is reduced. 1:2 means that if the level
4168 raised 4dB above the threshold, it will be only 2dB above after the reduction.
4169 Default is 2. Range is between 1 and 20.
4172 Amount of milliseconds the signal has to rise above the threshold before gain
4173 reduction starts. Default is 20. Range is between 0.01 and 2000.
4176 Amount of milliseconds the signal has to fall below the threshold before
4177 reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
4180 Set the amount by how much signal will be amplified after processing.
4181 Default is 1. Range is from 1 to 64.
4184 Curve the sharp knee around the threshold to enter gain reduction more softly.
4185 Default is 2.82843. Range is between 1 and 8.
4188 Choose if the @code{average} level between all channels of side-chain stream
4189 or the louder(@code{maximum}) channel of side-chain stream affects the
4190 reduction. Default is @code{average}.
4193 Should the exact signal be taken in case of @code{peak} or an RMS one in case
4194 of @code{rms}. Default is @code{rms} which is mainly smoother.
4197 Set sidechain gain. Default is 1. Range is between 0.015625 and 64.
4200 How much to use compressed signal in output. Default is 1.
4201 Range is between 0 and 1.
4204 @subsection Examples
4208 Full ffmpeg example taking 2 audio inputs, 1st input to be compressed
4209 depending on the signal of 2nd input and later compressed signal to be
4210 merged with 2nd input:
4212 ffmpeg -i main.flac -i sidechain.flac -filter_complex "[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress[compr];[compr][mix]amerge"
4216 @section sidechaingate
4218 A sidechain gate acts like a normal (wideband) gate but has the ability to
4219 filter the detected signal before sending it to the gain reduction stage.
4220 Normally a gate uses the full range signal to detect a level above the
4222 For example: If you cut all lower frequencies from your sidechain signal
4223 the gate will decrease the volume of your track only if not enough highs
4224 appear. With this technique you are able to reduce the resonation of a
4225 natural drum or remove "rumbling" of muted strokes from a heavily distorted
4227 It needs two input streams and returns one output stream.
4228 First input stream will be processed depending on second stream signal.
4230 The filter accepts the following options:
4234 Set input level before filtering.
4235 Default is 1. Allowed range is from 0.015625 to 64.
4238 Set the level of gain reduction when the signal is below the threshold.
4239 Default is 0.06125. Allowed range is from 0 to 1.
4242 If a signal rises above this level the gain reduction is released.
4243 Default is 0.125. Allowed range is from 0 to 1.
4246 Set a ratio about which the signal is reduced.
4247 Default is 2. Allowed range is from 1 to 9000.
4250 Amount of milliseconds the signal has to rise above the threshold before gain
4252 Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
4255 Amount of milliseconds the signal has to fall below the threshold before the
4256 reduction is increased again. Default is 250 milliseconds.
4257 Allowed range is from 0.01 to 9000.
4260 Set amount of amplification of signal after processing.
4261 Default is 1. Allowed range is from 1 to 64.
4264 Curve the sharp knee around the threshold to enter gain reduction more softly.
4265 Default is 2.828427125. Allowed range is from 1 to 8.
4268 Choose if exact signal should be taken for detection or an RMS like one.
4269 Default is rms. Can be peak or rms.
4272 Choose if the average level between all channels or the louder channel affects
4274 Default is average. Can be average or maximum.
4277 Set sidechain gain. Default is 1. Range is from 0.015625 to 64.
4280 @section silencedetect
4282 Detect silence in an audio stream.
4284 This filter logs a message when it detects that the input audio volume is less
4285 or equal to a noise tolerance value for a duration greater or equal to the
4286 minimum detected noise duration.
4288 The printed times and duration are expressed in seconds.
4290 The filter accepts the following options:
4294 Set noise tolerance. Can be specified in dB (in case "dB" is appended to the
4295 specified value) or amplitude ratio. Default is -60dB, or 0.001.
4298 Set silence duration until notification (default is 2 seconds).
4301 Process each channel separately, instead of combined. By default is disabled.
4304 @subsection Examples
4308 Detect 5 seconds of silence with -50dB noise tolerance:
4310 silencedetect=n=-50dB:d=5
4314 Complete example with @command{ffmpeg} to detect silence with 0.0001 noise
4315 tolerance in @file{silence.mp3}:
4317 ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
4321 @section silenceremove
4323 Remove silence from the beginning, middle or end of the audio.
4325 The filter accepts the following options:
4329 This value is used to indicate if audio should be trimmed at beginning of
4330 the audio. A value of zero indicates no silence should be trimmed from the
4331 beginning. When specifying a non-zero value, it trims audio up until it
4332 finds non-silence. Normally, when trimming silence from beginning of audio
4333 the @var{start_periods} will be @code{1} but it can be increased to higher
4334 values to trim all audio up to specific count of non-silence periods.
4335 Default value is @code{0}.
4337 @item start_duration
4338 Specify the amount of time that non-silence must be detected before it stops
4339 trimming audio. By increasing the duration, bursts of noises can be treated
4340 as silence and trimmed off. Default value is @code{0}.
4342 @item start_threshold
4343 This indicates what sample value should be treated as silence. For digital
4344 audio, a value of @code{0} may be fine but for audio recorded from analog,
4345 you may wish to increase the value to account for background noise.
4346 Can be specified in dB (in case "dB" is appended to the specified value)
4347 or amplitude ratio. Default value is @code{0}.
4350 Specify max duration of silence at beginning that will be kept after
4351 trimming. Default is 0, which is equal to trimming all samples detected
4355 Specify mode of detection of silence end in start of multi-channel audio.
4356 Can be @var{any} or @var{all}. Default is @var{any}.
4357 With @var{any}, any sample that is detected as non-silence will cause
4358 stopped trimming of silence.
4359 With @var{all}, only if all channels are detected as non-silence will cause
4360 stopped trimming of silence.
4363 Set the count for trimming silence from the end of audio.
4364 To remove silence from the middle of a file, specify a @var{stop_periods}
4365 that is negative. This value is then treated as a positive value and is
4366 used to indicate the effect should restart processing as specified by
4367 @var{start_periods}, making it suitable for removing periods of silence
4368 in the middle of the audio.
4369 Default value is @code{0}.
4372 Specify a duration of silence that must exist before audio is not copied any
4373 more. By specifying a higher duration, silence that is wanted can be left in
4375 Default value is @code{0}.
4377 @item stop_threshold
4378 This is the same as @option{start_threshold} but for trimming silence from
4380 Can be specified in dB (in case "dB" is appended to the specified value)
4381 or amplitude ratio. Default value is @code{0}.
4384 Specify max duration of silence at end that will be kept after
4385 trimming. Default is 0, which is equal to trimming all samples detected
4389 Specify mode of detection of silence start in end of multi-channel audio.
4390 Can be @var{any} or @var{all}. Default is @var{any}.
4391 With @var{any}, any sample that is detected as non-silence will cause
4392 stopped trimming of silence.
4393 With @var{all}, only if all channels are detected as non-silence will cause
4394 stopped trimming of silence.
4397 Set how is silence detected. Can be @code{rms} or @code{peak}. Second is faster
4398 and works better with digital silence which is exactly 0.
4399 Default value is @code{rms}.
4402 Set duration in number of seconds used to calculate size of window in number
4403 of samples for detecting silence.
4404 Default value is @code{0.02}. Allowed range is from @code{0} to @code{10}.
4407 @subsection Examples
4411 The following example shows how this filter can be used to start a recording
4412 that does not contain the delay at the start which usually occurs between
4413 pressing the record button and the start of the performance:
4415 silenceremove=start_periods=1:start_duration=5:start_threshold=0.02
4419 Trim all silence encountered from beginning to end where there is more than 1
4420 second of silence in audio:
4422 silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB
4428 SOFAlizer uses head-related transfer functions (HRTFs) to create virtual
4429 loudspeakers around the user for binaural listening via headphones (audio
4430 formats up to 9 channels supported).
4431 The HRTFs are stored in SOFA files (see @url{http://www.sofacoustics.org/} for a database).
4432 SOFAlizer is developed at the Acoustics Research Institute (ARI) of the
4433 Austrian Academy of Sciences.
4435 To enable compilation of this filter you need to configure FFmpeg with
4436 @code{--enable-libmysofa}.
4438 The filter accepts the following options:
4442 Set the SOFA file used for rendering.
4445 Set gain applied to audio. Value is in dB. Default is 0.
4448 Set rotation of virtual loudspeakers in deg. Default is 0.
4451 Set elevation of virtual speakers in deg. Default is 0.
4454 Set distance in meters between loudspeakers and the listener with near-field
4455 HRTFs. Default is 1.
4458 Set processing type. Can be @var{time} or @var{freq}. @var{time} is
4459 processing audio in time domain which is slow.
4460 @var{freq} is processing audio in frequency domain which is fast.
4461 Default is @var{freq}.
4464 Set custom positions of virtual loudspeakers. Syntax for this option is:
4465 <CH> <AZIM> <ELEV>[|<CH> <AZIM> <ELEV>|...].
4466 Each virtual loudspeaker is described with short channel name following with
4467 azimuth and elevation in degrees.
4468 Each virtual loudspeaker description is separated by '|'.
4469 For example to override front left and front right channel positions use:
4470 'speakers=FL 45 15|FR 345 15'.
4471 Descriptions with unrecognised channel names are ignored.
4474 Set custom gain for LFE channels. Value is in dB. Default is 0.
4477 @subsection Examples
4481 Using ClubFritz6 sofa file:
4483 sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
4487 Using ClubFritz12 sofa file and bigger radius with small rotation:
4489 sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
4493 Similar as above but with custom speaker positions for front left, front right, back left and back right
4494 and also with custom gain:
4496 "sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=2:speakers=FL 45|FR 315|BL 135|BR 225:gain=28"
4500 @section stereotools
4502 This filter has some handy utilities to manage stereo signals, for converting
4503 M/S stereo recordings to L/R signal while having control over the parameters
4504 or spreading the stereo image of master track.
4506 The filter accepts the following options:
4510 Set input level before filtering for both channels. Defaults is 1.
4511 Allowed range is from 0.015625 to 64.
4514 Set output level after filtering for both channels. Defaults is 1.
4515 Allowed range is from 0.015625 to 64.
4518 Set input balance between both channels. Default is 0.
4519 Allowed range is from -1 to 1.
4522 Set output balance between both channels. Default is 0.
4523 Allowed range is from -1 to 1.
4526 Enable softclipping. Results in analog distortion instead of harsh digital 0dB
4527 clipping. Disabled by default.
4530 Mute the left channel. Disabled by default.
4533 Mute the right channel. Disabled by default.
4536 Change the phase of the left channel. Disabled by default.
4539 Change the phase of the right channel. Disabled by default.
4542 Set stereo mode. Available values are:
4546 Left/Right to Left/Right, this is default.
4549 Left/Right to Mid/Side.
4552 Mid/Side to Left/Right.
4555 Left/Right to Left/Left.
4558 Left/Right to Right/Right.
4561 Left/Right to Left + Right.
4564 Left/Right to Right/Left.
4567 Mid/Side to Left/Left.
4570 Mid/Side to Right/Right.
4574 Set level of side signal. Default is 1.
4575 Allowed range is from 0.015625 to 64.
4578 Set balance of side signal. Default is 0.
4579 Allowed range is from -1 to 1.
4582 Set level of the middle signal. Default is 1.
4583 Allowed range is from 0.015625 to 64.
4586 Set middle signal pan. Default is 0. Allowed range is from -1 to 1.
4589 Set stereo base between mono and inversed channels. Default is 0.
4590 Allowed range is from -1 to 1.
4593 Set delay in milliseconds how much to delay left from right channel and
4594 vice versa. Default is 0. Allowed range is from -20 to 20.
4597 Set S/C level. Default is 1. Allowed range is from 1 to 100.
4600 Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360.
4602 @item bmode_in, bmode_out
4603 Set balance mode for balance_in/balance_out option.
4605 Can be one of the following:
4609 Classic balance mode. Attenuate one channel at time.
4610 Gain is raised up to 1.
4613 Similar as classic mode above but gain is raised up to 2.
4616 Equal power distribution, from -6dB to +6dB range.
4620 @subsection Examples
4624 Apply karaoke like effect:
4626 stereotools=mlev=0.015625
4630 Convert M/S signal to L/R:
4632 "stereotools=mode=ms>lr"
4636 @section stereowiden
4638 This filter enhance the stereo effect by suppressing signal common to both
4639 channels and by delaying the signal of left into right and vice versa,
4640 thereby widening the stereo effect.
4642 The filter accepts the following options:
4646 Time in milliseconds of the delay of left signal into right and vice versa.
4647 Default is 20 milliseconds.
4650 Amount of gain in delayed signal into right and vice versa. Gives a delay
4651 effect of left signal in right output and vice versa which gives widening
4652 effect. Default is 0.3.
4655 Cross feed of left into right with inverted phase. This helps in suppressing
4656 the mono. If the value is 1 it will cancel all the signal common to both
4657 channels. Default is 0.3.
4660 Set level of input signal of original channel. Default is 0.8.
4663 @section superequalizer
4664 Apply 18 band equalizer.
4666 The filter accepts the following options:
4673 Set 131Hz band gain.
4675 Set 185Hz band gain.
4677 Set 262Hz band gain.
4679 Set 370Hz band gain.
4681 Set 523Hz band gain.
4683 Set 740Hz band gain.
4685 Set 1047Hz band gain.
4687 Set 1480Hz band gain.
4689 Set 2093Hz band gain.
4691 Set 2960Hz band gain.
4693 Set 4186Hz band gain.
4695 Set 5920Hz band gain.
4697 Set 8372Hz band gain.
4699 Set 11840Hz band gain.
4701 Set 16744Hz band gain.
4703 Set 20000Hz band gain.
4707 Apply audio surround upmix filter.
4709 This filter allows to produce multichannel output from audio stream.
4711 The filter accepts the following options:
4715 Set output channel layout. By default, this is @var{5.1}.
4717 See @ref{channel layout syntax,,the Channel Layout section in the ffmpeg-utils(1) manual,ffmpeg-utils}
4718 for the required syntax.
4721 Set input channel layout. By default, this is @var{stereo}.
4723 See @ref{channel layout syntax,,the Channel Layout section in the ffmpeg-utils(1) manual,ffmpeg-utils}
4724 for the required syntax.
4727 Set input volume level. By default, this is @var{1}.
4730 Set output volume level. By default, this is @var{1}.
4733 Enable LFE channel output if output channel layout has it. By default, this is enabled.
4736 Set LFE low cut off frequency. By default, this is @var{128} Hz.
4739 Set LFE high cut off frequency. By default, this is @var{256} Hz.
4742 Set front center input volume. By default, this is @var{1}.
4745 Set front center output volume. By default, this is @var{1}.
4748 Set LFE input volume. By default, this is @var{1}.
4751 Set LFE output volume. By default, this is @var{1}.
4754 @section treble, highshelf
4756 Boost or cut treble (upper) frequencies of the audio using a two-pole
4757 shelving filter with a response similar to that of a standard
4758 hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
4760 The filter accepts the following options:
4764 Give the gain at whichever is the lower of ~22 kHz and the
4765 Nyquist frequency. Its useful range is about -20 (for a large cut)
4766 to +20 (for a large boost). Beware of clipping when using a positive gain.
4769 Set the filter's central frequency and so can be used
4770 to extend or reduce the frequency range to be boosted or cut.
4771 The default value is @code{3000} Hz.
4774 Set method to specify band-width of filter.
4789 Determine how steep is the filter's shelf transition.
4792 Specify which channels to filter, by default all available are filtered.
4795 @subsection Commands
4797 This filter supports the following commands:
4800 Change treble frequency.
4801 Syntax for the command is : "@var{frequency}"
4804 Change treble width_type.
4805 Syntax for the command is : "@var{width_type}"
4808 Change treble width.
4809 Syntax for the command is : "@var{width}"
4813 Syntax for the command is : "@var{gain}"
4818 Sinusoidal amplitude modulation.
4820 The filter accepts the following options:
4824 Modulation frequency in Hertz. Modulation frequencies in the subharmonic range
4825 (20 Hz or lower) will result in a tremolo effect.
4826 This filter may also be used as a ring modulator by specifying
4827 a modulation frequency higher than 20 Hz.
4828 Range is 0.1 - 20000.0. Default value is 5.0 Hz.
4831 Depth of modulation as a percentage. Range is 0.0 - 1.0.
4832 Default value is 0.5.
4837 Sinusoidal phase modulation.
4839 The filter accepts the following options:
4843 Modulation frequency in Hertz.
4844 Range is 0.1 - 20000.0. Default value is 5.0 Hz.
4847 Depth of modulation as a percentage. Range is 0.0 - 1.0.
4848 Default value is 0.5.
4853 Adjust the input audio volume.
4855 It accepts the following parameters:
4859 Set audio volume expression.
4861 Output values are clipped to the maximum value.
4863 The output audio volume is given by the relation:
4865 @var{output_volume} = @var{volume} * @var{input_volume}
4868 The default value for @var{volume} is "1.0".
4871 This parameter represents the mathematical precision.
4873 It determines which input sample formats will be allowed, which affects the
4874 precision of the volume scaling.
4878 8-bit fixed-point; this limits input sample format to U8, S16, and S32.
4880 32-bit floating-point; this limits input sample format to FLT. (default)
4882 64-bit floating-point; this limits input sample format to DBL.
4886 Choose the behaviour on encountering ReplayGain side data in input frames.
4890 Remove ReplayGain side data, ignoring its contents (the default).
4893 Ignore ReplayGain side data, but leave it in the frame.
4896 Prefer the track gain, if present.
4899 Prefer the album gain, if present.
4902 @item replaygain_preamp
4903 Pre-amplification gain in dB to apply to the selected replaygain gain.
4905 Default value for @var{replaygain_preamp} is 0.0.
4908 Set when the volume expression is evaluated.
4910 It accepts the following values:
4913 only evaluate expression once during the filter initialization, or
4914 when the @samp{volume} command is sent
4917 evaluate expression for each incoming frame
4920 Default value is @samp{once}.
4923 The volume expression can contain the following parameters.
4927 frame number (starting at zero)
4930 @item nb_consumed_samples
4931 number of samples consumed by the filter
4933 number of samples in the current frame
4935 original frame position in the file
4941 PTS at start of stream
4943 time at start of stream
4949 last set volume value
4952 Note that when @option{eval} is set to @samp{once} only the
4953 @var{sample_rate} and @var{tb} variables are available, all other
4954 variables will evaluate to NAN.
4956 @subsection Commands
4958 This filter supports the following commands:
4961 Modify the volume expression.
4962 The command accepts the same syntax of the corresponding option.
4964 If the specified expression is not valid, it is kept at its current
4966 @item replaygain_noclip
4967 Prevent clipping by limiting the gain applied.
4969 Default value for @var{replaygain_noclip} is 1.
4973 @subsection Examples
4977 Halve the input audio volume:
4981 volume=volume=-6.0206dB
4984 In all the above example the named key for @option{volume} can be
4985 omitted, for example like in:
4991 Increase input audio power by 6 decibels using fixed-point precision:
4993 volume=volume=6dB:precision=fixed
4997 Fade volume after time 10 with an annihilation period of 5 seconds:
4999 volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
5003 @section volumedetect
5005 Detect the volume of the input video.
5007 The filter has no parameters. The input is not modified. Statistics about
5008 the volume will be printed in the log when the input stream end is reached.
5010 In particular it will show the mean volume (root mean square), maximum
5011 volume (on a per-sample basis), and the beginning of a histogram of the
5012 registered volume values (from the maximum value to a cumulated 1/1000 of
5015 All volumes are in decibels relative to the maximum PCM value.
5017 @subsection Examples
5019 Here is an excerpt of the output:
5021 [Parsed_volumedetect_0 @ 0xa23120] mean_volume: -27 dB
5022 [Parsed_volumedetect_0 @ 0xa23120] max_volume: -4 dB
5023 [Parsed_volumedetect_0 @ 0xa23120] histogram_4db: 6
5024 [Parsed_volumedetect_0 @ 0xa23120] histogram_5db: 62
5025 [Parsed_volumedetect_0 @ 0xa23120] histogram_6db: 286
5026 [Parsed_volumedetect_0 @ 0xa23120] histogram_7db: 1042
5027 [Parsed_volumedetect_0 @ 0xa23120] histogram_8db: 2551
5028 [Parsed_volumedetect_0 @ 0xa23120] histogram_9db: 4609
5029 [Parsed_volumedetect_0 @ 0xa23120] histogram_10db: 8409
5035 The mean square energy is approximately -27 dB, or 10^-2.7.
5037 The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
5039 There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
5042 In other words, raising the volume by +4 dB does not cause any clipping,
5043 raising it by +5 dB causes clipping for 6 samples, etc.
5045 @c man end AUDIO FILTERS
5047 @chapter Audio Sources
5048 @c man begin AUDIO SOURCES
5050 Below is a description of the currently available audio sources.
5054 Buffer audio frames, and make them available to the filter chain.
5056 This source is mainly intended for a programmatic use, in particular
5057 through the interface defined in @file{libavfilter/asrc_abuffer.h}.
5059 It accepts the following parameters:
5063 The timebase which will be used for timestamps of submitted frames. It must be
5064 either a floating-point number or in @var{numerator}/@var{denominator} form.
5067 The sample rate of the incoming audio buffers.
5070 The sample format of the incoming audio buffers.
5071 Either a sample format name or its corresponding integer representation from
5072 the enum AVSampleFormat in @file{libavutil/samplefmt.h}
5074 @item channel_layout
5075 The channel layout of the incoming audio buffers.
5076 Either a channel layout name from channel_layout_map in
5077 @file{libavutil/channel_layout.c} or its corresponding integer representation
5078 from the AV_CH_LAYOUT_* macros in @file{libavutil/channel_layout.h}
5081 The number of channels of the incoming audio buffers.
5082 If both @var{channels} and @var{channel_layout} are specified, then they
5087 @subsection Examples
5090 abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
5093 will instruct the source to accept planar 16bit signed stereo at 44100Hz.
5094 Since the sample format with name "s16p" corresponds to the number
5095 6 and the "stereo" channel layout corresponds to the value 0x3, this is
5098 abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
5103 Generate an audio signal specified by an expression.
5105 This source accepts in input one or more expressions (one for each
5106 channel), which are evaluated and used to generate a corresponding
5109 This source accepts the following options:
5113 Set the '|'-separated expressions list for each separate channel. In case the
5114 @option{channel_layout} option is not specified, the selected channel layout
5115 depends on the number of provided expressions. Otherwise the last
5116 specified expression is applied to the remaining output channels.
5118 @item channel_layout, c
5119 Set the channel layout. The number of channels in the specified layout
5120 must be equal to the number of specified expressions.
5123 Set the minimum duration of the sourced audio. See
5124 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}