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{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.
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{LINKLABEL} ::= "[" @var{NAME} "]"
216 @var{LINKLABELS} ::= @var{LINKLABEL} [@var{LINKLABELS}]
217 @var{FILTER_ARGUMENTS} ::= sequence of chars (possibly quoted)
218 @var{FILTER} ::= [@var{LINKLABELS}] @var{NAME} ["=" @var{FILTER_ARGUMENTS}] [@var{LINKLABELS}]
219 @var{FILTERCHAIN} ::= @var{FILTER} [,@var{FILTERCHAIN}]
220 @var{FILTERGRAPH} ::= [sws_flags=@var{flags};] @var{FILTERCHAIN} [;@var{FILTERGRAPH}]
223 @section Notes on filtergraph escaping
225 Filtergraph description composition entails several levels of
226 escaping. See @ref{quoting_and_escaping,,the "Quoting and escaping"
227 section in the ffmpeg-utils(1) manual,ffmpeg-utils} for more
228 information about the employed escaping procedure.
230 A first level escaping affects the content of each filter option
231 value, which may contain the special character @code{:} used to
232 separate values, or one of the escaping characters @code{\'}.
234 A second level escaping affects the whole filter description, which
235 may contain the escaping characters @code{\'} or the special
236 characters @code{[],;} used by the filtergraph description.
238 Finally, when you specify a filtergraph on a shell commandline, you
239 need to perform a third level escaping for the shell special
240 characters contained within it.
242 For example, consider the following string to be embedded in
243 the @ref{drawtext} filter description @option{text} value:
245 this is a 'string': may contain one, or more, special characters
248 This string contains the @code{'} special escaping character, and the
249 @code{:} special character, so it needs to be escaped in this way:
251 text=this is a \'string\'\: may contain one, or more, special characters
254 A second level of escaping is required when embedding the filter
255 description in a filtergraph description, in order to escape all the
256 filtergraph special characters. Thus the example above becomes:
258 drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
260 (note that in addition to the @code{\'} escaping special characters,
261 also @code{,} needs to be escaped).
263 Finally an additional level of escaping is needed when writing the
264 filtergraph description in a shell command, which depends on the
265 escaping rules of the adopted shell. For example, assuming that
266 @code{\} is special and needs to be escaped with another @code{\}, the
267 previous string will finally result in:
269 -vf "drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters"
272 @chapter Timeline editing
274 Some filters support a generic @option{enable} option. For the filters
275 supporting timeline editing, this option can be set to an expression which is
276 evaluated before sending a frame to the filter. If the evaluation is non-zero,
277 the filter will be enabled, otherwise the frame will be sent unchanged to the
278 next filter in the filtergraph.
280 The expression accepts the following values:
283 timestamp expressed in seconds, NAN if the input timestamp is unknown
286 sequential number of the input frame, starting from 0
289 the position in the file of the input frame, NAN if unknown
293 width and height of the input frame if video
296 Additionally, these filters support an @option{enable} command that can be used
297 to re-define the expression.
299 Like any other filtering option, the @option{enable} option follows the same
302 For example, to enable a blur filter (@ref{smartblur}) from 10 seconds to 3
303 minutes, and a @ref{curves} filter starting at 3 seconds:
305 smartblur = enable='between(t,10,3*60)',
306 curves = enable='gte(t,3)' : preset=cross_process
309 See @code{ffmpeg -filters} to view which filters have timeline support.
311 @c man end FILTERGRAPH DESCRIPTION
313 @chapter Audio Filters
314 @c man begin AUDIO FILTERS
316 When you configure your FFmpeg build, you can disable any of the
317 existing filters using @code{--disable-filters}.
318 The configure output will show the audio filters included in your
321 Below is a description of the currently available audio filters.
325 A compressor is mainly used to reduce the dynamic range of a signal.
326 Especially modern music is mostly compressed at a high ratio to
327 improve the overall loudness. It's done to get the highest attention
328 of a listener, "fatten" the sound and bring more "power" to the track.
329 If a signal is compressed too much it may sound dull or "dead"
330 afterwards or it may start to "pump" (which could be a powerful effect
331 but can also destroy a track completely).
332 The right compression is the key to reach a professional sound and is
333 the high art of mixing and mastering. Because of its complex settings
334 it may take a long time to get the right feeling for this kind of effect.
336 Compression is done by detecting the volume above a chosen level
337 @code{threshold} and dividing it by the factor set with @code{ratio}.
338 So if you set the threshold to -12dB and your signal reaches -6dB a ratio
339 of 2:1 will result in a signal at -9dB. Because an exact manipulation of
340 the signal would cause distortion of the waveform the reduction can be
341 levelled over the time. This is done by setting "Attack" and "Release".
342 @code{attack} determines how long the signal has to rise above the threshold
343 before any reduction will occur and @code{release} sets the time the signal
344 has to fall below the threshold to reduce the reduction again. Shorter signals
345 than the chosen attack time will be left untouched.
346 The overall reduction of the signal can be made up afterwards with the
347 @code{makeup} setting. So compressing the peaks of a signal about 6dB and
348 raising the makeup to this level results in a signal twice as loud than the
349 source. To gain a softer entry in the compression the @code{knee} flattens the
350 hard edge at the threshold in the range of the chosen decibels.
352 The filter accepts the following options:
356 Set input gain. Default is 1. Range is between 0.015625 and 64.
359 If a signal of second stream rises above this level it will affect the gain
360 reduction of the first stream.
361 By default it is 0.125. Range is between 0.00097563 and 1.
364 Set a ratio by which the signal is reduced. 1:2 means that if the level
365 rose 4dB above the threshold, it will be only 2dB above after the reduction.
366 Default is 2. Range is between 1 and 20.
369 Amount of milliseconds the signal has to rise above the threshold before gain
370 reduction starts. Default is 20. Range is between 0.01 and 2000.
373 Amount of milliseconds the signal has to fall below the threshold before
374 reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
377 Set the amount by how much signal will be amplified after processing.
378 Default is 2. Range is from 1 and 64.
381 Curve the sharp knee around the threshold to enter gain reduction more softly.
382 Default is 2.82843. Range is between 1 and 8.
385 Choose if the @code{average} level between all channels of input stream
386 or the louder(@code{maximum}) channel of input stream affects the
387 reduction. Default is @code{average}.
390 Should the exact signal be taken in case of @code{peak} or an RMS one in case
391 of @code{rms}. Default is @code{rms} which is mostly smoother.
394 How much to use compressed signal in output. Default is 1.
395 Range is between 0 and 1.
400 Copy the input audio source unchanged to the output. This is mainly useful for
405 Apply cross fade from one input audio stream to another input audio stream.
406 The cross fade is applied for specified duration near the end of first stream.
408 The filter accepts the following options:
412 Specify the number of samples for which the cross fade effect has to last.
413 At the end of the cross fade effect the first input audio will be completely
414 silent. Default is 44100.
417 Specify the duration of the cross fade effect. See
418 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
419 for the accepted syntax.
420 By default the duration is determined by @var{nb_samples}.
421 If set this option is used instead of @var{nb_samples}.
424 Should first stream end overlap with second stream start. Default is enabled.
427 Set curve for cross fade transition for first stream.
430 Set curve for cross fade transition for second stream.
432 For description of available curve types see @ref{afade} filter description.
439 Cross fade from one input to another:
441 ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
445 Cross fade from one input to another but without overlapping:
447 ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
453 Reduce audio bit resolution.
455 This filter is bit crusher with enhanced functionality. A bit crusher
456 is used to audibly reduce number of bits an audio signal is sampled
457 with. This doesn't change the bit depth at all, it just produces the
458 effect. Material reduced in bit depth sounds more harsh and "digital".
459 This filter is able to even round to continuous values instead of discrete
461 Additionally it has a D/C offset which results in different crushing of
462 the lower and the upper half of the signal.
463 An Anti-Aliasing setting is able to produce "softer" crushing sounds.
465 Another feature of this filter is the logarithmic mode.
466 This setting switches from linear distances between bits to logarithmic ones.
467 The result is a much more "natural" sounding crusher which doesn't gate low
468 signals for example. The human ear has a logarithmic perception, too
469 so this kind of crushing is much more pleasant.
470 Logarithmic crushing is also able to get anti-aliased.
472 The filter accepts the following options:
488 Can be linear: @code{lin} or logarithmic: @code{log}.
497 Set sample reduction.
500 Enable LFO. By default disabled.
511 Delay one or more audio channels.
513 Samples in delayed channel are filled with silence.
515 The filter accepts the following option:
519 Set list of delays in milliseconds for each channel separated by '|'.
520 At least one delay greater than 0 should be provided.
521 Unused delays will be silently ignored. If number of given delays is
522 smaller than number of channels all remaining channels will not be delayed.
523 If you want to delay exact number of samples, append 'S' to number.
530 Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
531 the second channel (and any other channels that may be present) unchanged.
537 Delay second channel by 500 samples, the third channel by 700 samples and leave
538 the first channel (and any other channels that may be present) unchanged.
546 Apply echoing to the input audio.
548 Echoes are reflected sound and can occur naturally amongst mountains
549 (and sometimes large buildings) when talking or shouting; digital echo
550 effects emulate this behaviour and are often used to help fill out the
551 sound of a single instrument or vocal. The time difference between the
552 original signal and the reflection is the @code{delay}, and the
553 loudness of the reflected signal is the @code{decay}.
554 Multiple echoes can have different delays and decays.
556 A description of the accepted parameters follows.
560 Set input gain of reflected signal. Default is @code{0.6}.
563 Set output gain of reflected signal. Default is @code{0.3}.
566 Set list of time intervals in milliseconds between original signal and reflections
567 separated by '|'. Allowed range for each @code{delay} is @code{(0 - 90000.0]}.
568 Default is @code{1000}.
571 Set list of loudnesses of reflected signals separated by '|'.
572 Allowed range for each @code{decay} is @code{(0 - 1.0]}.
573 Default is @code{0.5}.
580 Make it sound as if there are twice as many instruments as are actually playing:
582 aecho=0.8:0.88:60:0.4
586 If delay is very short, then it sound like a (metallic) robot playing music:
592 A longer delay will sound like an open air concert in the mountains:
594 aecho=0.8:0.9:1000:0.3
598 Same as above but with one more mountain:
600 aecho=0.8:0.9:1000|1800:0.3|0.25
605 Audio emphasis filter creates or restores material directly taken from LPs or
606 emphased CDs with different filter curves. E.g. to store music on vinyl the
607 signal has to be altered by a filter first to even out the disadvantages of
608 this recording medium.
609 Once the material is played back the inverse filter has to be applied to
610 restore the distortion of the frequency response.
612 The filter accepts the following options:
622 Set filter mode. For restoring material use @code{reproduction} mode, otherwise
623 use @code{production} mode. Default is @code{reproduction} mode.
626 Set filter type. Selects medium. Can be one of the following:
638 select Compact Disc (CD).
644 select 50µs (FM-KF).
646 select 75µs (FM-KF).
652 Modify an audio signal according to the specified expressions.
654 This filter accepts one or more expressions (one for each channel),
655 which are evaluated and used to modify a corresponding audio signal.
657 It accepts the following parameters:
661 Set the '|'-separated expressions list for each separate channel. If
662 the number of input channels is greater than the number of
663 expressions, the last specified expression is used for the remaining
666 @item channel_layout, c
667 Set output channel layout. If not specified, the channel layout is
668 specified by the number of expressions. If set to @samp{same}, it will
669 use by default the same input channel layout.
672 Each expression in @var{exprs} can contain the following constants and functions:
676 channel number of the current expression
679 number of the evaluated sample, starting from 0
685 time of the evaluated sample expressed in seconds
688 @item nb_out_channels
689 input and output number of channels
692 the value of input channel with number @var{CH}
695 Note: this filter is slow. For faster processing you should use a
704 aeval=val(ch)/2:c=same
708 Invert phase of the second channel:
717 Apply fade-in/out effect to input audio.
719 A description of the accepted parameters follows.
723 Specify the effect type, can be either @code{in} for fade-in, or
724 @code{out} for a fade-out effect. Default is @code{in}.
726 @item start_sample, ss
727 Specify the number of the start sample for starting to apply the fade
728 effect. Default is 0.
731 Specify the number of samples for which the fade effect has to last. At
732 the end of the fade-in effect the output audio will have the same
733 volume as the input audio, at the end of the fade-out transition
734 the output audio will be silence. Default is 44100.
737 Specify the start time of the fade effect. Default is 0.
738 The value must be specified as a time duration; see
739 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
740 for the accepted syntax.
741 If set this option is used instead of @var{start_sample}.
744 Specify the duration of the fade effect. See
745 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
746 for the accepted syntax.
747 At the end of the fade-in effect the output audio will have the same
748 volume as the input audio, at the end of the fade-out transition
749 the output audio will be silence.
750 By default the duration is determined by @var{nb_samples}.
751 If set this option is used instead of @var{nb_samples}.
754 Set curve for fade transition.
756 It accepts the following values:
759 select triangular, linear slope (default)
761 select quarter of sine wave
763 select half of sine wave
765 select exponential sine wave
769 select inverted parabola
783 select inverted quarter of sine wave
785 select inverted half of sine wave
787 select double-exponential seat
789 select double-exponential sigmoid
797 Fade in first 15 seconds of audio:
803 Fade out last 25 seconds of a 900 seconds audio:
805 afade=t=out:st=875:d=25
810 Apply arbitrary expressions to samples in frequency domain.
814 Set frequency domain real expression for each separate channel separated
815 by '|'. Default is "1".
816 If the number of input channels is greater than the number of
817 expressions, the last specified expression is used for the remaining
821 Set frequency domain imaginary expression for each separate channel
822 separated by '|'. If not set, @var{real} option is used.
824 Each expression in @var{real} and @var{imag} can contain the following
832 current frequency bin number
835 number of available bins
838 channel number of the current expression
850 It accepts the following values:
866 Default is @code{w4096}
869 Set window function. Default is @code{hann}.
872 Set window overlap. If set to 1, the recommended overlap for selected
873 window function will be picked. Default is @code{0.75}.
880 Leave almost only low frequencies in audio:
882 afftfilt="1-clip((b/nb)*b,0,1)"
888 Apply an arbitrary Frequency Impulse Response filter.
890 This filter is designed for applying long FIR filters,
891 up to 30 seconds long.
893 It can be used as component for digital crossover filters,
894 room equalization, cross talk cancellation, wavefield synthesis,
895 auralization, ambiophonics and ambisonics.
897 This filter uses second stream as FIR coefficients.
898 If second stream holds single channel, it will be used
899 for all input channels in first stream, otherwise
900 number of channels in second stream must be same as
901 number of channels in first stream.
903 It accepts the following parameters:
907 Set dry gain. This sets input gain.
910 Set wet gain. This sets final output gain.
913 Set Impulse Response filter length. Default is 1, which means whole IR is processed.
916 Enable applying gain measured from power of IR.
923 Apply reverb to stream using mono IR file as second input, complete command using ffmpeg:
925 ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav
932 Set output format constraints for the input audio. The framework will
933 negotiate the most appropriate format to minimize conversions.
935 It accepts the following parameters:
939 A '|'-separated list of requested sample formats.
942 A '|'-separated list of requested sample rates.
944 @item channel_layouts
945 A '|'-separated list of requested channel layouts.
947 See @ref{channel layout syntax,,the Channel Layout section in the ffmpeg-utils(1) manual,ffmpeg-utils}
948 for the required syntax.
951 If a parameter is omitted, all values are allowed.
953 Force the output to either unsigned 8-bit or signed 16-bit stereo
955 aformat=sample_fmts=u8|s16:channel_layouts=stereo
960 A gate is mainly used to reduce lower parts of a signal. This kind of signal
961 processing reduces disturbing noise between useful signals.
963 Gating is done by detecting the volume below a chosen level @var{threshold}
964 and dividing it by the factor set with @var{ratio}. The bottom of the noise
965 floor is set via @var{range}. Because an exact manipulation of the signal
966 would cause distortion of the waveform the reduction can be levelled over
967 time. This is done by setting @var{attack} and @var{release}.
969 @var{attack} determines how long the signal has to fall below the threshold
970 before any reduction will occur and @var{release} sets the time the signal
971 has to rise above the threshold to reduce the reduction again.
972 Shorter signals than the chosen attack time will be left untouched.
976 Set input level before filtering.
977 Default is 1. Allowed range is from 0.015625 to 64.
980 Set the level of gain reduction when the signal is below the threshold.
981 Default is 0.06125. Allowed range is from 0 to 1.
984 If a signal rises above this level the gain reduction is released.
985 Default is 0.125. Allowed range is from 0 to 1.
988 Set a ratio by which the signal is reduced.
989 Default is 2. Allowed range is from 1 to 9000.
992 Amount of milliseconds the signal has to rise above the threshold before gain
994 Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
997 Amount of milliseconds the signal has to fall below the threshold before the
998 reduction is increased again. Default is 250 milliseconds.
999 Allowed range is from 0.01 to 9000.
1002 Set amount of amplification of signal after processing.
1003 Default is 1. Allowed range is from 1 to 64.
1006 Curve the sharp knee around the threshold to enter gain reduction more softly.
1007 Default is 2.828427125. Allowed range is from 1 to 8.
1010 Choose if exact signal should be taken for detection or an RMS like one.
1011 Default is @code{rms}. Can be @code{peak} or @code{rms}.
1014 Choose if the average level between all channels or the louder channel affects
1016 Default is @code{average}. Can be @code{average} or @code{maximum}.
1021 The limiter prevents an input signal from rising over a desired threshold.
1022 This limiter uses lookahead technology to prevent your signal from distorting.
1023 It means that there is a small delay after the signal is processed. Keep in mind
1024 that the delay it produces is the attack time you set.
1026 The filter accepts the following options:
1030 Set input gain. Default is 1.
1033 Set output gain. Default is 1.
1036 Don't let signals above this level pass the limiter. Default is 1.
1039 The limiter will reach its attenuation level in this amount of time in
1040 milliseconds. Default is 5 milliseconds.
1043 Come back from limiting to attenuation 1.0 in this amount of milliseconds.
1044 Default is 50 milliseconds.
1047 When gain reduction is always needed ASC takes care of releasing to an
1048 average reduction level rather than reaching a reduction of 0 in the release
1052 Select how much the release time is affected by ASC, 0 means nearly no changes
1053 in release time while 1 produces higher release times.
1056 Auto level output signal. Default is enabled.
1057 This normalizes audio back to 0dB if enabled.
1060 Depending on picked setting it is recommended to upsample input 2x or 4x times
1061 with @ref{aresample} before applying this filter.
1065 Apply a two-pole all-pass filter with central frequency (in Hz)
1066 @var{frequency}, and filter-width @var{width}.
1067 An all-pass filter changes the audio's frequency to phase relationship
1068 without changing its frequency to amplitude relationship.
1070 The filter accepts the following options:
1074 Set frequency in Hz.
1077 Set method to specify band-width of filter.
1090 Specify the band-width of a filter in width_type units.
1093 Specify which channels to filter, by default all available are filtered.
1100 The filter accepts the following options:
1104 Set the number of loops.
1107 Set maximal number of samples.
1110 Set first sample of loop.
1116 Merge two or more audio streams into a single multi-channel stream.
1118 The filter accepts the following options:
1123 Set the number of inputs. Default is 2.
1127 If the channel layouts of the inputs are disjoint, and therefore compatible,
1128 the channel layout of the output will be set accordingly and the channels
1129 will be reordered as necessary. If the channel layouts of the inputs are not
1130 disjoint, the output will have all the channels of the first input then all
1131 the channels of the second input, in that order, and the channel layout of
1132 the output will be the default value corresponding to the total number of
1135 For example, if the first input is in 2.1 (FL+FR+LF) and the second input
1136 is FC+BL+BR, then the output will be in 5.1, with the channels in the
1137 following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
1138 first input, b1 is the first channel of the second input).
1140 On the other hand, if both input are in stereo, the output channels will be
1141 in the default order: a1, a2, b1, b2, and the channel layout will be
1142 arbitrarily set to 4.0, which may or may not be the expected value.
1144 All inputs must have the same sample rate, and format.
1146 If inputs do not have the same duration, the output will stop with the
1149 @subsection Examples
1153 Merge two mono files into a stereo stream:
1155 amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
1159 Multiple merges assuming 1 video stream and 6 audio streams in @file{input.mkv}:
1161 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
1167 Mixes multiple audio inputs into a single output.
1169 Note that this filter only supports float samples (the @var{amerge}
1170 and @var{pan} audio filters support many formats). If the @var{amix}
1171 input has integer samples then @ref{aresample} will be automatically
1172 inserted to perform the conversion to float samples.
1176 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
1178 will mix 3 input audio streams to a single output with the same duration as the
1179 first input and a dropout transition time of 3 seconds.
1181 It accepts the following parameters:
1185 The number of inputs. If unspecified, it defaults to 2.
1188 How to determine the end-of-stream.
1192 The duration of the longest input. (default)
1195 The duration of the shortest input.
1198 The duration of the first input.
1202 @item dropout_transition
1203 The transition time, in seconds, for volume renormalization when an input
1204 stream ends. The default value is 2 seconds.
1208 @section anequalizer
1210 High-order parametric multiband equalizer for each channel.
1212 It accepts the following parameters:
1216 This option string is in format:
1217 "c@var{chn} f=@var{cf} w=@var{w} g=@var{g} t=@var{f} | ..."
1218 Each equalizer band is separated by '|'.
1222 Set channel number to which equalization will be applied.
1223 If input doesn't have that channel the entry is ignored.
1226 Set central frequency for band.
1227 If input doesn't have that frequency the entry is ignored.
1230 Set band width in hertz.
1233 Set band gain in dB.
1236 Set filter type for band, optional, can be:
1240 Butterworth, this is default.
1251 With this option activated frequency response of anequalizer is displayed
1255 Set video stream size. Only useful if curves option is activated.
1258 Set max gain that will be displayed. Only useful if curves option is activated.
1259 Setting this to a reasonable value makes it possible to display gain which is derived from
1260 neighbour bands which are too close to each other and thus produce higher gain
1261 when both are activated.
1264 Set frequency scale used to draw frequency response in video output.
1265 Can be linear or logarithmic. Default is logarithmic.
1268 Set color for each channel curve which is going to be displayed in video stream.
1269 This is list of color names separated by space or by '|'.
1270 Unrecognised or missing colors will be replaced by white color.
1273 @subsection Examples
1277 Lower gain by 10 of central frequency 200Hz and width 100 Hz
1278 for first 2 channels using Chebyshev type 1 filter:
1280 anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
1284 @subsection Commands
1286 This filter supports the following commands:
1289 Alter existing filter parameters.
1290 Syntax for the commands is : "@var{fN}|f=@var{freq}|w=@var{width}|g=@var{gain}"
1292 @var{fN} is existing filter number, starting from 0, if no such filter is available
1294 @var{freq} set new frequency parameter.
1295 @var{width} set new width parameter in herz.
1296 @var{gain} set new gain parameter in dB.
1298 Full filter invocation with asendcmd may look like this:
1299 asendcmd=c='4.0 anequalizer change 0|f=200|w=50|g=1',anequalizer=...
1304 Pass the audio source unchanged to the output.
1308 Pad the end of an audio stream with silence.
1310 This can be used together with @command{ffmpeg} @option{-shortest} to
1311 extend audio streams to the same length as the video stream.
1313 A description of the accepted options follows.
1317 Set silence packet size. Default value is 4096.
1320 Set the number of samples of silence to add to the end. After the
1321 value is reached, the stream is terminated. This option is mutually
1322 exclusive with @option{whole_len}.
1325 Set the minimum total number of samples in the output audio stream. If
1326 the value is longer than the input audio length, silence is added to
1327 the end, until the value is reached. This option is mutually exclusive
1328 with @option{pad_len}.
1331 If neither the @option{pad_len} nor the @option{whole_len} option is
1332 set, the filter will add silence to the end of the input stream
1335 @subsection Examples
1339 Add 1024 samples of silence to the end of the input:
1345 Make sure the audio output will contain at least 10000 samples, pad
1346 the input with silence if required:
1348 apad=whole_len=10000
1352 Use @command{ffmpeg} to pad the audio input with silence, so that the
1353 video stream will always result the shortest and will be converted
1354 until the end in the output file when using the @option{shortest}
1357 ffmpeg -i VIDEO -i AUDIO -filter_complex "[1:0]apad" -shortest OUTPUT
1362 Add a phasing effect to the input audio.
1364 A phaser filter creates series of peaks and troughs in the frequency spectrum.
1365 The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
1367 A description of the accepted parameters follows.
1371 Set input gain. Default is 0.4.
1374 Set output gain. Default is 0.74
1377 Set delay in milliseconds. Default is 3.0.
1380 Set decay. Default is 0.4.
1383 Set modulation speed in Hz. Default is 0.5.
1386 Set modulation type. Default is triangular.
1388 It accepts the following values:
1397 Audio pulsator is something between an autopanner and a tremolo.
1398 But it can produce funny stereo effects as well. Pulsator changes the volume
1399 of the left and right channel based on a LFO (low frequency oscillator) with
1400 different waveforms and shifted phases.
1401 This filter have the ability to define an offset between left and right
1402 channel. An offset of 0 means that both LFO shapes match each other.
1403 The left and right channel are altered equally - a conventional tremolo.
1404 An offset of 50% means that the shape of the right channel is exactly shifted
1405 in phase (or moved backwards about half of the frequency) - pulsator acts as
1406 an autopanner. At 1 both curves match again. Every setting in between moves the
1407 phase shift gapless between all stages and produces some "bypassing" sounds with
1408 sine and triangle waveforms. The more you set the offset near 1 (starting from
1409 the 0.5) the faster the signal passes from the left to the right speaker.
1411 The filter accepts the following options:
1415 Set input gain. By default it is 1. Range is [0.015625 - 64].
1418 Set output gain. By default it is 1. Range is [0.015625 - 64].
1421 Set waveform shape the LFO will use. Can be one of: sine, triangle, square,
1422 sawup or sawdown. Default is sine.
1425 Set modulation. Define how much of original signal is affected by the LFO.
1428 Set left channel offset. Default is 0. Allowed range is [0 - 1].
1431 Set right channel offset. Default is 0.5. Allowed range is [0 - 1].
1434 Set pulse width. Default is 1. Allowed range is [0 - 2].
1437 Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz.
1440 Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing
1444 Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing
1448 Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used
1449 if timing is set to hz.
1455 Resample the input audio to the specified parameters, using the
1456 libswresample library. If none are specified then the filter will
1457 automatically convert between its input and output.
1459 This filter is also able to stretch/squeeze the audio data to make it match
1460 the timestamps or to inject silence / cut out audio to make it match the
1461 timestamps, do a combination of both or do neither.
1463 The filter accepts the syntax
1464 [@var{sample_rate}:]@var{resampler_options}, where @var{sample_rate}
1465 expresses a sample rate and @var{resampler_options} is a list of
1466 @var{key}=@var{value} pairs, separated by ":". See the
1467 @ref{Resampler Options,,the "Resampler Options" section in the
1468 ffmpeg-resampler(1) manual,ffmpeg-resampler}
1469 for the complete list of supported options.
1471 @subsection Examples
1475 Resample the input audio to 44100Hz:
1481 Stretch/squeeze samples to the given timestamps, with a maximum of 1000
1482 samples per second compensation:
1484 aresample=async=1000
1490 Reverse an audio clip.
1492 Warning: This filter requires memory to buffer the entire clip, so trimming
1495 @subsection Examples
1499 Take the first 5 seconds of a clip, and reverse it.
1501 atrim=end=5,areverse
1505 @section asetnsamples
1507 Set the number of samples per each output audio frame.
1509 The last output packet may contain a different number of samples, as
1510 the filter will flush all the remaining samples when the input audio
1513 The filter accepts the following options:
1517 @item nb_out_samples, n
1518 Set the number of frames per each output audio frame. The number is
1519 intended as the number of samples @emph{per each channel}.
1520 Default value is 1024.
1523 If set to 1, the filter will pad the last audio frame with zeroes, so
1524 that the last frame will contain the same number of samples as the
1525 previous ones. Default value is 1.
1528 For example, to set the number of per-frame samples to 1234 and
1529 disable padding for the last frame, use:
1531 asetnsamples=n=1234:p=0
1536 Set the sample rate without altering the PCM data.
1537 This will result in a change of speed and pitch.
1539 The filter accepts the following options:
1542 @item sample_rate, r
1543 Set the output sample rate. Default is 44100 Hz.
1548 Show a line containing various information for each input audio frame.
1549 The input audio is not modified.
1551 The shown line contains a sequence of key/value pairs of the form
1552 @var{key}:@var{value}.
1554 The following values are shown in the output:
1558 The (sequential) number of the input frame, starting from 0.
1561 The presentation timestamp of the input frame, in time base units; the time base
1562 depends on the filter input pad, and is usually 1/@var{sample_rate}.
1565 The presentation timestamp of the input frame in seconds.
1568 position of the frame in the input stream, -1 if this information in
1569 unavailable and/or meaningless (for example in case of synthetic audio)
1578 The sample rate for the audio frame.
1581 The number of samples (per channel) in the frame.
1584 The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar
1585 audio, the data is treated as if all the planes were concatenated.
1587 @item plane_checksums
1588 A list of Adler-32 checksums for each data plane.
1594 Display time domain statistical information about the audio channels.
1595 Statistics are calculated and displayed for each audio channel and,
1596 where applicable, an overall figure is also given.
1598 It accepts the following option:
1601 Short window length in seconds, used for peak and trough RMS measurement.
1602 Default is @code{0.05} (50 milliseconds). Allowed range is @code{[0.1 - 10]}.
1606 Set metadata injection. All the metadata keys are prefixed with @code{lavfi.astats.X},
1607 where @code{X} is channel number starting from 1 or string @code{Overall}. Default is
1610 Available keys for each channel are:
1641 For example full key look like this @code{lavfi.astats.1.DC_offset} or
1642 this @code{lavfi.astats.Overall.Peak_count}.
1644 For description what each key means read below.
1647 Set number of frame after which stats are going to be recalculated.
1648 Default is disabled.
1651 A description of each shown parameter follows:
1655 Mean amplitude displacement from zero.
1658 Minimal sample level.
1661 Maximal sample level.
1663 @item Min difference
1664 Minimal difference between two consecutive samples.
1666 @item Max difference
1667 Maximal difference between two consecutive samples.
1669 @item Mean difference
1670 Mean difference between two consecutive samples.
1671 The average of each difference between two consecutive samples.
1675 Standard peak and RMS level measured in dBFS.
1679 Peak and trough values for RMS level measured over a short window.
1682 Standard ratio of peak to RMS level (note: not in dB).
1685 Flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
1686 (i.e. either @var{Min level} or @var{Max level}).
1689 Number of occasions (not the number of samples) that the signal attained either
1690 @var{Min level} or @var{Max level}.
1693 Overall bit depth of audio. Number of bits used for each sample.
1700 The filter accepts exactly one parameter, the audio tempo. If not
1701 specified then the filter will assume nominal 1.0 tempo. Tempo must
1702 be in the [0.5, 2.0] range.
1704 @subsection Examples
1708 Slow down audio to 80% tempo:
1714 To speed up audio to 125% tempo:
1722 Trim the input so that the output contains one continuous subpart of the input.
1724 It accepts the following parameters:
1727 Timestamp (in seconds) of the start of the section to keep. I.e. the audio
1728 sample with the timestamp @var{start} will be the first sample in the output.
1731 Specify time of the first audio sample that will be dropped, i.e. the
1732 audio sample immediately preceding the one with the timestamp @var{end} will be
1733 the last sample in the output.
1736 Same as @var{start}, except this option sets the start timestamp in samples
1740 Same as @var{end}, except this option sets the end timestamp in samples instead
1744 The maximum duration of the output in seconds.
1747 The number of the first sample that should be output.
1750 The number of the first sample that should be dropped.
1753 @option{start}, @option{end}, and @option{duration} are expressed as time
1754 duration specifications; see
1755 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
1757 Note that the first two sets of the start/end options and the @option{duration}
1758 option look at the frame timestamp, while the _sample options simply count the
1759 samples that pass through the filter. So start/end_pts and start/end_sample will
1760 give different results when the timestamps are wrong, inexact or do not start at
1761 zero. Also note that this filter does not modify the timestamps. If you wish
1762 to have the output timestamps start at zero, insert the asetpts filter after the
1765 If multiple start or end options are set, this filter tries to be greedy and
1766 keep all samples that match at least one of the specified constraints. To keep
1767 only the part that matches all the constraints at once, chain multiple atrim
1770 The defaults are such that all the input is kept. So it is possible to set e.g.
1771 just the end values to keep everything before the specified time.
1776 Drop everything except the second minute of input:
1778 ffmpeg -i INPUT -af atrim=60:120
1782 Keep only the first 1000 samples:
1784 ffmpeg -i INPUT -af atrim=end_sample=1000
1791 Apply a two-pole Butterworth band-pass filter with central
1792 frequency @var{frequency}, and (3dB-point) band-width width.
1793 The @var{csg} option selects a constant skirt gain (peak gain = Q)
1794 instead of the default: constant 0dB peak gain.
1795 The filter roll off at 6dB per octave (20dB per decade).
1797 The filter accepts the following options:
1801 Set the filter's central frequency. Default is @code{3000}.
1804 Constant skirt gain if set to 1. Defaults to 0.
1807 Set method to specify band-width of filter.
1820 Specify the band-width of a filter in width_type units.
1823 Specify which channels to filter, by default all available are filtered.
1828 Apply a two-pole Butterworth band-reject filter with central
1829 frequency @var{frequency}, and (3dB-point) band-width @var{width}.
1830 The filter roll off at 6dB per octave (20dB per decade).
1832 The filter accepts the following options:
1836 Set the filter's central frequency. Default is @code{3000}.
1839 Set method to specify band-width of filter.
1852 Specify the band-width of a filter in width_type units.
1855 Specify which channels to filter, by default all available are filtered.
1860 Boost or cut the bass (lower) frequencies of the audio using a two-pole
1861 shelving filter with a response similar to that of a standard
1862 hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
1864 The filter accepts the following options:
1868 Give the gain at 0 Hz. Its useful range is about -20
1869 (for a large cut) to +20 (for a large boost).
1870 Beware of clipping when using a positive gain.
1873 Set the filter's central frequency and so can be used
1874 to extend or reduce the frequency range to be boosted or cut.
1875 The default value is @code{100} Hz.
1878 Set method to specify band-width of filter.
1891 Determine how steep is the filter's shelf transition.
1894 Specify which channels to filter, by default all available are filtered.
1899 Apply a biquad IIR filter with the given coefficients.
1900 Where @var{b0}, @var{b1}, @var{b2} and @var{a0}, @var{a1}, @var{a2}
1901 are the numerator and denominator coefficients respectively.
1902 and @var{channels}, @var{c} specify which channels to filter, by default all
1903 available are filtered.
1906 Bauer stereo to binaural transformation, which improves headphone listening of
1907 stereo audio records.
1909 It accepts the following parameters:
1913 Pre-defined crossfeed level.
1917 Default level (fcut=700, feed=50).
1920 Chu Moy circuit (fcut=700, feed=60).
1923 Jan Meier circuit (fcut=650, feed=95).
1928 Cut frequency (in Hz).
1937 Remap input channels to new locations.
1939 It accepts the following parameters:
1942 Map channels from input to output. The argument is a '|'-separated list of
1943 mappings, each in the @code{@var{in_channel}-@var{out_channel}} or
1944 @var{in_channel} form. @var{in_channel} can be either the name of the input
1945 channel (e.g. FL for front left) or its index in the input channel layout.
1946 @var{out_channel} is the name of the output channel or its index in the output
1947 channel layout. If @var{out_channel} is not given then it is implicitly an
1948 index, starting with zero and increasing by one for each mapping.
1950 @item channel_layout
1951 The channel layout of the output stream.
1954 If no mapping is present, the filter will implicitly map input channels to
1955 output channels, preserving indices.
1957 For example, assuming a 5.1+downmix input MOV file,
1959 ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
1961 will create an output WAV file tagged as stereo from the downmix channels of
1964 To fix a 5.1 WAV improperly encoded in AAC's native channel order
1966 ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
1969 @section channelsplit
1971 Split each channel from an input audio stream into a separate output stream.
1973 It accepts the following parameters:
1975 @item channel_layout
1976 The channel layout of the input stream. The default is "stereo".
1979 For example, assuming a stereo input MP3 file,
1981 ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
1983 will create an output Matroska file with two audio streams, one containing only
1984 the left channel and the other the right channel.
1986 Split a 5.1 WAV file into per-channel files:
1988 ffmpeg -i in.wav -filter_complex
1989 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
1990 -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
1991 front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
1996 Add a chorus effect to the audio.
1998 Can make a single vocal sound like a chorus, but can also be applied to instrumentation.
2000 Chorus resembles an echo effect with a short delay, but whereas with echo the delay is
2001 constant, with chorus, it is varied using using sinusoidal or triangular modulation.
2002 The modulation depth defines the range the modulated delay is played before or after
2003 the delay. Hence the delayed sound will sound slower or faster, that is the delayed
2004 sound tuned around the original one, like in a chorus where some vocals are slightly
2007 It accepts the following parameters:
2010 Set input gain. Default is 0.4.
2013 Set output gain. Default is 0.4.
2016 Set delays. A typical delay is around 40ms to 60ms.
2028 @subsection Examples
2034 chorus=0.7:0.9:55:0.4:0.25:2
2040 chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
2044 Fuller sounding chorus with three delays:
2046 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
2051 Compress or expand the audio's dynamic range.
2053 It accepts the following parameters:
2059 A list of times in seconds for each channel over which the instantaneous level
2060 of the input signal is averaged to determine its volume. @var{attacks} refers to
2061 increase of volume and @var{decays} refers to decrease of volume. For most
2062 situations, the attack time (response to the audio getting louder) should be
2063 shorter than the decay time, because the human ear is more sensitive to sudden
2064 loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
2065 a typical value for decay is 0.8 seconds.
2066 If specified number of attacks & decays is lower than number of channels, the last
2067 set attack/decay will be used for all remaining channels.
2070 A list of points for the transfer function, specified in dB relative to the
2071 maximum possible signal amplitude. Each key points list must be defined using
2072 the following syntax: @code{x0/y0|x1/y1|x2/y2|....} or
2073 @code{x0/y0 x1/y1 x2/y2 ....}
2075 The input values must be in strictly increasing order but the transfer function
2076 does not have to be monotonically rising. The point @code{0/0} is assumed but
2077 may be overridden (by @code{0/out-dBn}). Typical values for the transfer
2078 function are @code{-70/-70|-60/-20}.
2081 Set the curve radius in dB for all joints. It defaults to 0.01.
2084 Set the additional gain in dB to be applied at all points on the transfer
2085 function. This allows for easy adjustment of the overall gain.
2089 Set an initial volume, in dB, to be assumed for each channel when filtering
2090 starts. This permits the user to supply a nominal level initially, so that, for
2091 example, a very large gain is not applied to initial signal levels before the
2092 companding has begun to operate. A typical value for audio which is initially
2093 quiet is -90 dB. It defaults to 0.
2096 Set a delay, in seconds. The input audio is analyzed immediately, but audio is
2097 delayed before being fed to the volume adjuster. Specifying a delay
2098 approximately equal to the attack/decay times allows the filter to effectively
2099 operate in predictive rather than reactive mode. It defaults to 0.
2103 @subsection Examples
2107 Make music with both quiet and loud passages suitable for listening to in a
2110 compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
2113 Another example for audio with whisper and explosion parts:
2115 compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
2119 A noise gate for when the noise is at a lower level than the signal:
2121 compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
2125 Here is another noise gate, this time for when the noise is at a higher level
2126 than the signal (making it, in some ways, similar to squelch):
2128 compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
2132 2:1 compression starting at -6dB:
2134 compand=points=-80/-80|-6/-6|0/-3.8|20/3.5
2138 2:1 compression starting at -9dB:
2140 compand=points=-80/-80|-9/-9|0/-5.3|20/2.9
2144 2:1 compression starting at -12dB:
2146 compand=points=-80/-80|-12/-12|0/-6.8|20/1.9
2150 2:1 compression starting at -18dB:
2152 compand=points=-80/-80|-18/-18|0/-9.8|20/0.7
2156 3:1 compression starting at -15dB:
2158 compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2
2164 compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
2170 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
2174 Hard limiter at -6dB:
2176 compand=attacks=0:points=-80/-80|-6/-6|20/-6
2180 Hard limiter at -12dB:
2182 compand=attacks=0:points=-80/-80|-12/-12|20/-12
2186 Hard noise gate at -35 dB:
2188 compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20
2194 compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
2198 @section compensationdelay
2200 Compensation Delay Line is a metric based delay to compensate differing
2201 positions of microphones or speakers.
2203 For example, you have recorded guitar with two microphones placed in
2204 different location. Because the front of sound wave has fixed speed in
2205 normal conditions, the phasing of microphones can vary and depends on
2206 their location and interposition. The best sound mix can be achieved when
2207 these microphones are in phase (synchronized). Note that distance of
2208 ~30 cm between microphones makes one microphone to capture signal in
2209 antiphase to another microphone. That makes the final mix sounding moody.
2210 This filter helps to solve phasing problems by adding different delays
2211 to each microphone track and make them synchronized.
2213 The best result can be reached when you take one track as base and
2214 synchronize other tracks one by one with it.
2215 Remember that synchronization/delay tolerance depends on sample rate, too.
2216 Higher sample rates will give more tolerance.
2218 It accepts the following parameters:
2222 Set millimeters distance. This is compensation distance for fine tuning.
2226 Set cm distance. This is compensation distance for tightening distance setup.
2230 Set meters distance. This is compensation distance for hard distance setup.
2234 Set dry amount. Amount of unprocessed (dry) signal.
2238 Set wet amount. Amount of processed (wet) signal.
2242 Set temperature degree in Celsius. This is the temperature of the environment.
2246 @section crystalizer
2247 Simple algorithm to expand audio dynamic range.
2249 The filter accepts the following options:
2253 Sets the intensity of effect (default: 2.0). Must be in range between 0.0
2254 (unchanged sound) to 10.0 (maximum effect).
2257 Enable clipping. By default is enabled.
2261 Apply a DC shift to the audio.
2263 This can be useful to remove a DC offset (caused perhaps by a hardware problem
2264 in the recording chain) from the audio. The effect of a DC offset is reduced
2265 headroom and hence volume. The @ref{astats} filter can be used to determine if
2266 a signal has a DC offset.
2270 Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift
2274 Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is
2275 used to prevent clipping.
2279 Dynamic Audio Normalizer.
2281 This filter applies a certain amount of gain to the input audio in order
2282 to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in
2283 contrast to more "simple" normalization algorithms, the Dynamic Audio
2284 Normalizer *dynamically* re-adjusts the gain factor to the input audio.
2285 This allows for applying extra gain to the "quiet" sections of the audio
2286 while avoiding distortions or clipping the "loud" sections. In other words:
2287 The Dynamic Audio Normalizer will "even out" the volume of quiet and loud
2288 sections, in the sense that the volume of each section is brought to the
2289 same target level. Note, however, that the Dynamic Audio Normalizer achieves
2290 this goal *without* applying "dynamic range compressing". It will retain 100%
2291 of the dynamic range *within* each section of the audio file.
2295 Set the frame length in milliseconds. In range from 10 to 8000 milliseconds.
2296 Default is 500 milliseconds.
2297 The Dynamic Audio Normalizer processes the input audio in small chunks,
2298 referred to as frames. This is required, because a peak magnitude has no
2299 meaning for just a single sample value. Instead, we need to determine the
2300 peak magnitude for a contiguous sequence of sample values. While a "standard"
2301 normalizer would simply use the peak magnitude of the complete file, the
2302 Dynamic Audio Normalizer determines the peak magnitude individually for each
2303 frame. The length of a frame is specified in milliseconds. By default, the
2304 Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has
2305 been found to give good results with most files.
2306 Note that the exact frame length, in number of samples, will be determined
2307 automatically, based on the sampling rate of the individual input audio file.
2310 Set the Gaussian filter window size. In range from 3 to 301, must be odd
2311 number. Default is 31.
2312 Probably the most important parameter of the Dynamic Audio Normalizer is the
2313 @code{window size} of the Gaussian smoothing filter. The filter's window size
2314 is specified in frames, centered around the current frame. For the sake of
2315 simplicity, this must be an odd number. Consequently, the default value of 31
2316 takes into account the current frame, as well as the 15 preceding frames and
2317 the 15 subsequent frames. Using a larger window results in a stronger
2318 smoothing effect and thus in less gain variation, i.e. slower gain
2319 adaptation. Conversely, using a smaller window results in a weaker smoothing
2320 effect and thus in more gain variation, i.e. faster gain adaptation.
2321 In other words, the more you increase this value, the more the Dynamic Audio
2322 Normalizer will behave like a "traditional" normalization filter. On the
2323 contrary, the more you decrease this value, the more the Dynamic Audio
2324 Normalizer will behave like a dynamic range compressor.
2327 Set the target peak value. This specifies the highest permissible magnitude
2328 level for the normalized audio input. This filter will try to approach the
2329 target peak magnitude as closely as possible, but at the same time it also
2330 makes sure that the normalized signal will never exceed the peak magnitude.
2331 A frame's maximum local gain factor is imposed directly by the target peak
2332 magnitude. The default value is 0.95 and thus leaves a headroom of 5%*.
2333 It is not recommended to go above this value.
2336 Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0.
2337 The Dynamic Audio Normalizer determines the maximum possible (local) gain
2338 factor for each input frame, i.e. the maximum gain factor that does not
2339 result in clipping or distortion. The maximum gain factor is determined by
2340 the frame's highest magnitude sample. However, the Dynamic Audio Normalizer
2341 additionally bounds the frame's maximum gain factor by a predetermined
2342 (global) maximum gain factor. This is done in order to avoid excessive gain
2343 factors in "silent" or almost silent frames. By default, the maximum gain
2344 factor is 10.0, For most inputs the default value should be sufficient and
2345 it usually is not recommended to increase this value. Though, for input
2346 with an extremely low overall volume level, it may be necessary to allow even
2347 higher gain factors. Note, however, that the Dynamic Audio Normalizer does
2348 not simply apply a "hard" threshold (i.e. cut off values above the threshold).
2349 Instead, a "sigmoid" threshold function will be applied. This way, the
2350 gain factors will smoothly approach the threshold value, but never exceed that
2354 Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled.
2355 By default, the Dynamic Audio Normalizer performs "peak" normalization.
2356 This means that the maximum local gain factor for each frame is defined
2357 (only) by the frame's highest magnitude sample. This way, the samples can
2358 be amplified as much as possible without exceeding the maximum signal
2359 level, i.e. without clipping. Optionally, however, the Dynamic Audio
2360 Normalizer can also take into account the frame's root mean square,
2361 abbreviated RMS. In electrical engineering, the RMS is commonly used to
2362 determine the power of a time-varying signal. It is therefore considered
2363 that the RMS is a better approximation of the "perceived loudness" than
2364 just looking at the signal's peak magnitude. Consequently, by adjusting all
2365 frames to a constant RMS value, a uniform "perceived loudness" can be
2366 established. If a target RMS value has been specified, a frame's local gain
2367 factor is defined as the factor that would result in exactly that RMS value.
2368 Note, however, that the maximum local gain factor is still restricted by the
2369 frame's highest magnitude sample, in order to prevent clipping.
2372 Enable channels coupling. By default is enabled.
2373 By default, the Dynamic Audio Normalizer will amplify all channels by the same
2374 amount. This means the same gain factor will be applied to all channels, i.e.
2375 the maximum possible gain factor is determined by the "loudest" channel.
2376 However, in some recordings, it may happen that the volume of the different
2377 channels is uneven, e.g. one channel may be "quieter" than the other one(s).
2378 In this case, this option can be used to disable the channel coupling. This way,
2379 the gain factor will be determined independently for each channel, depending
2380 only on the individual channel's highest magnitude sample. This allows for
2381 harmonizing the volume of the different channels.
2384 Enable DC bias correction. By default is disabled.
2385 An audio signal (in the time domain) is a sequence of sample values.
2386 In the Dynamic Audio Normalizer these sample values are represented in the
2387 -1.0 to 1.0 range, regardless of the original input format. Normally, the
2388 audio signal, or "waveform", should be centered around the zero point.
2389 That means if we calculate the mean value of all samples in a file, or in a
2390 single frame, then the result should be 0.0 or at least very close to that
2391 value. If, however, there is a significant deviation of the mean value from
2392 0.0, in either positive or negative direction, this is referred to as a
2393 DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic
2394 Audio Normalizer provides optional DC bias correction.
2395 With DC bias correction enabled, the Dynamic Audio Normalizer will determine
2396 the mean value, or "DC correction" offset, of each input frame and subtract
2397 that value from all of the frame's sample values which ensures those samples
2398 are centered around 0.0 again. Also, in order to avoid "gaps" at the frame
2399 boundaries, the DC correction offset values will be interpolated smoothly
2400 between neighbouring frames.
2403 Enable alternative boundary mode. By default is disabled.
2404 The Dynamic Audio Normalizer takes into account a certain neighbourhood
2405 around each frame. This includes the preceding frames as well as the
2406 subsequent frames. However, for the "boundary" frames, located at the very
2407 beginning and at the very end of the audio file, not all neighbouring
2408 frames are available. In particular, for the first few frames in the audio
2409 file, the preceding frames are not known. And, similarly, for the last few
2410 frames in the audio file, the subsequent frames are not known. Thus, the
2411 question arises which gain factors should be assumed for the missing frames
2412 in the "boundary" region. The Dynamic Audio Normalizer implements two modes
2413 to deal with this situation. The default boundary mode assumes a gain factor
2414 of exactly 1.0 for the missing frames, resulting in a smooth "fade in" and
2415 "fade out" at the beginning and at the end of the input, respectively.
2418 Set the compress factor. In range from 0.0 to 30.0. Default is 0.0.
2419 By default, the Dynamic Audio Normalizer does not apply "traditional"
2420 compression. This means that signal peaks will not be pruned and thus the
2421 full dynamic range will be retained within each local neighbourhood. However,
2422 in some cases it may be desirable to combine the Dynamic Audio Normalizer's
2423 normalization algorithm with a more "traditional" compression.
2424 For this purpose, the Dynamic Audio Normalizer provides an optional compression
2425 (thresholding) function. If (and only if) the compression feature is enabled,
2426 all input frames will be processed by a soft knee thresholding function prior
2427 to the actual normalization process. Put simply, the thresholding function is
2428 going to prune all samples whose magnitude exceeds a certain threshold value.
2429 However, the Dynamic Audio Normalizer does not simply apply a fixed threshold
2430 value. Instead, the threshold value will be adjusted for each individual
2432 In general, smaller parameters result in stronger compression, and vice versa.
2433 Values below 3.0 are not recommended, because audible distortion may appear.
2438 Make audio easier to listen to on headphones.
2440 This filter adds `cues' to 44.1kHz stereo (i.e. audio CD format) audio
2441 so that when listened to on headphones the stereo image is moved from
2442 inside your head (standard for headphones) to outside and in front of
2443 the listener (standard for speakers).
2449 Apply a two-pole peaking equalisation (EQ) filter. With this
2450 filter, the signal-level at and around a selected frequency can
2451 be increased or decreased, whilst (unlike bandpass and bandreject
2452 filters) that at all other frequencies is unchanged.
2454 In order to produce complex equalisation curves, this filter can
2455 be given several times, each with a different central frequency.
2457 The filter accepts the following options:
2461 Set the filter's central frequency in Hz.
2464 Set method to specify band-width of filter.
2477 Specify the band-width of a filter in width_type units.
2480 Set the required gain or attenuation in dB.
2481 Beware of clipping when using a positive gain.
2484 Specify which channels to filter, by default all available are filtered.
2487 @subsection Examples
2490 Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
2492 equalizer=f=1000:width_type=h:width=200:g=-10
2496 Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2:
2498 equalizer=f=1000:width_type=q:width=1:g=2,equalizer=f=100:width_type=q:width=2:g=-5
2502 @section extrastereo
2504 Linearly increases the difference between left and right channels which
2505 adds some sort of "live" effect to playback.
2507 The filter accepts the following options:
2511 Sets the difference coefficient (default: 2.5). 0.0 means mono sound
2512 (average of both channels), with 1.0 sound will be unchanged, with
2513 -1.0 left and right channels will be swapped.
2516 Enable clipping. By default is enabled.
2519 @section firequalizer
2520 Apply FIR Equalization using arbitrary frequency response.
2522 The filter accepts the following option:
2526 Set gain curve equation (in dB). The expression can contain variables:
2529 the evaluated frequency
2533 channel number, set to 0 when multichannels evaluation is disabled
2535 channel id, see libavutil/channel_layout.h, set to the first channel id when
2536 multichannels evaluation is disabled
2540 channel_layout, see libavutil/channel_layout.h
2545 @item gain_interpolate(f)
2546 interpolate gain on frequency f based on gain_entry
2547 @item cubic_interpolate(f)
2548 same as gain_interpolate, but smoother
2550 This option is also available as command. Default is @code{gain_interpolate(f)}.
2553 Set gain entry for gain_interpolate function. The expression can
2557 store gain entry at frequency f with value g
2559 This option is also available as command.
2562 Set filter delay in seconds. Higher value means more accurate.
2563 Default is @code{0.01}.
2566 Set filter accuracy in Hz. Lower value means more accurate.
2567 Default is @code{5}.
2570 Set window function. Acceptable values are:
2573 rectangular window, useful when gain curve is already smooth
2575 hann window (default)
2581 3-terms continuous 1st derivative nuttall window
2583 minimum 3-terms discontinuous nuttall window
2585 4-terms continuous 1st derivative nuttall window
2587 minimum 4-terms discontinuous nuttall (blackman-nuttall) window
2589 blackman-harris window
2595 If enabled, use fixed number of audio samples. This improves speed when
2596 filtering with large delay. Default is disabled.
2599 Enable multichannels evaluation on gain. Default is disabled.
2602 Enable zero phase mode by subtracting timestamp to compensate delay.
2603 Default is disabled.
2606 Set scale used by gain. Acceptable values are:
2609 linear frequency, linear gain
2611 linear frequency, logarithmic (in dB) gain (default)
2613 logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain
2615 logarithmic frequency, logarithmic gain
2619 Set file for dumping, suitable for gnuplot.
2622 Set scale for dumpfile. Acceptable values are same with scale option.
2626 Enable 2-channel convolution using complex FFT. This improves speed significantly.
2627 Default is disabled.
2630 @subsection Examples
2635 firequalizer=gain='if(lt(f,1000), 0, -INF)'
2638 lowpass at 1000 Hz with gain_entry:
2640 firequalizer=gain_entry='entry(1000,0); entry(1001, -INF)'
2643 custom equalization:
2645 firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)'
2648 higher delay with zero phase to compensate delay:
2650 firequalizer=delay=0.1:fixed=on:zero_phase=on
2653 lowpass on left channel, highpass on right channel:
2655 firequalizer=gain='if(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))'
2656 :gain_entry='entry(1000, 0); entry(1001,-INF); entry(1e6+1000,0)':multi=on
2661 Apply a flanging effect to the audio.
2663 The filter accepts the following options:
2667 Set base delay in milliseconds. Range from 0 to 30. Default value is 0.
2670 Set added swep delay in milliseconds. Range from 0 to 10. Default value is 2.
2673 Set percentage regeneration (delayed signal feedback). Range from -95 to 95.
2677 Set percentage of delayed signal mixed with original. Range from 0 to 100.
2678 Default value is 71.
2681 Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5.
2684 Set swept wave shape, can be @var{triangular} or @var{sinusoidal}.
2685 Default value is @var{sinusoidal}.
2688 Set swept wave percentage-shift for multi channel. Range from 0 to 100.
2689 Default value is 25.
2692 Set delay-line interpolation, @var{linear} or @var{quadratic}.
2693 Default is @var{linear}.
2698 Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with
2699 embedded HDCD codes is expanded into a 20-bit PCM stream.
2701 The filter supports the Peak Extend and Low-level Gain Adjustment features
2702 of HDCD, and detects the Transient Filter flag.
2705 ffmpeg -i HDCD16.flac -af hdcd OUT24.flac
2708 When using the filter with wav, note the default encoding for wav is 16-bit,
2709 so the resulting 20-bit stream will be truncated back to 16-bit. Use something
2710 like @command{-acodec pcm_s24le} after the filter to get 24-bit PCM output.
2712 ffmpeg -i HDCD16.wav -af hdcd OUT16.wav
2713 ffmpeg -i HDCD16.wav -af hdcd -acodec pcm_s24le OUT24.wav
2716 The filter accepts the following options:
2719 @item disable_autoconvert
2720 Disable any automatic format conversion or resampling in the filter graph.
2722 @item process_stereo
2723 Process the stereo channels together. If target_gain does not match between
2724 channels, consider it invalid and use the last valid target_gain.
2727 Set the code detect timer period in ms.
2730 Always extend peaks above -3dBFS even if PE isn't signaled.
2733 Replace audio with a solid tone and adjust the amplitude to signal some
2734 specific aspect of the decoding process. The output file can be loaded in
2735 an audio editor alongside the original to aid analysis.
2737 @code{analyze_mode=pe:force_pe=true} can be used to see all samples above the PE level.
2744 Gain adjustment level at each sample
2746 Samples where peak extend occurs
2748 Samples where the code detect timer is active
2750 Samples where the target gain does not match between channels
2756 Apply a high-pass filter with 3dB point frequency.
2757 The filter can be either single-pole, or double-pole (the default).
2758 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
2760 The filter accepts the following options:
2764 Set frequency in Hz. Default is 3000.
2767 Set number of poles. Default is 2.
2770 Set method to specify band-width of filter.
2783 Specify the band-width of a filter in width_type units.
2784 Applies only to double-pole filter.
2785 The default is 0.707q and gives a Butterworth response.
2788 Specify which channels to filter, by default all available are filtered.
2793 Join multiple input streams into one multi-channel stream.
2795 It accepts the following parameters:
2799 The number of input streams. It defaults to 2.
2801 @item channel_layout
2802 The desired output channel layout. It defaults to stereo.
2805 Map channels from inputs to output. The argument is a '|'-separated list of
2806 mappings, each in the @code{@var{input_idx}.@var{in_channel}-@var{out_channel}}
2807 form. @var{input_idx} is the 0-based index of the input stream. @var{in_channel}
2808 can be either the name of the input channel (e.g. FL for front left) or its
2809 index in the specified input stream. @var{out_channel} is the name of the output
2813 The filter will attempt to guess the mappings when they are not specified
2814 explicitly. It does so by first trying to find an unused matching input channel
2815 and if that fails it picks the first unused input channel.
2817 Join 3 inputs (with properly set channel layouts):
2819 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
2822 Build a 5.1 output from 6 single-channel streams:
2824 ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
2825 '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'
2831 Load a LADSPA (Linux Audio Developer's Simple Plugin API) plugin.
2833 To enable compilation of this filter you need to configure FFmpeg with
2834 @code{--enable-ladspa}.
2838 Specifies the name of LADSPA plugin library to load. If the environment
2839 variable @env{LADSPA_PATH} is defined, the LADSPA plugin is searched in
2840 each one of the directories specified by the colon separated list in
2841 @env{LADSPA_PATH}, otherwise in the standard LADSPA paths, which are in
2842 this order: @file{HOME/.ladspa/lib/}, @file{/usr/local/lib/ladspa/},
2843 @file{/usr/lib/ladspa/}.
2846 Specifies the plugin within the library. Some libraries contain only
2847 one plugin, but others contain many of them. If this is not set filter
2848 will list all available plugins within the specified library.
2851 Set the '|' separated list of controls which are zero or more floating point
2852 values that determine the behavior of the loaded plugin (for example delay,
2854 Controls need to be defined using the following syntax:
2855 c0=@var{value0}|c1=@var{value1}|c2=@var{value2}|..., where
2856 @var{valuei} is the value set on the @var{i}-th control.
2857 Alternatively they can be also defined using the following syntax:
2858 @var{value0}|@var{value1}|@var{value2}|..., where
2859 @var{valuei} is the value set on the @var{i}-th control.
2860 If @option{controls} is set to @code{help}, all available controls and
2861 their valid ranges are printed.
2863 @item sample_rate, s
2864 Specify the sample rate, default to 44100. Only used if plugin have
2868 Set the number of samples per channel per each output frame, default
2869 is 1024. Only used if plugin have zero inputs.
2872 Set the minimum duration of the sourced audio. See
2873 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
2874 for the accepted syntax.
2875 Note that the resulting duration may be greater than the specified duration,
2876 as the generated audio is always cut at the end of a complete frame.
2877 If not specified, or the expressed duration is negative, the audio is
2878 supposed to be generated forever.
2879 Only used if plugin have zero inputs.
2883 @subsection Examples
2887 List all available plugins within amp (LADSPA example plugin) library:
2893 List all available controls and their valid ranges for @code{vcf_notch}
2894 plugin from @code{VCF} library:
2896 ladspa=f=vcf:p=vcf_notch:c=help
2900 Simulate low quality audio equipment using @code{Computer Music Toolkit} (CMT)
2903 ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
2907 Add reverberation to the audio using TAP-plugins
2908 (Tom's Audio Processing plugins):
2910 ladspa=file=tap_reverb:tap_reverb
2914 Generate white noise, with 0.2 amplitude:
2916 ladspa=file=cmt:noise_source_white:c=c0=.2
2920 Generate 20 bpm clicks using plugin @code{C* Click - Metronome} from the
2921 @code{C* Audio Plugin Suite} (CAPS) library:
2923 ladspa=file=caps:Click:c=c1=20'
2927 Apply @code{C* Eq10X2 - Stereo 10-band equaliser} effect:
2929 ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
2933 Increase volume by 20dB using fast lookahead limiter from Steve Harris
2934 @code{SWH Plugins} collection:
2936 ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
2940 Attenuate low frequencies using Multiband EQ from Steve Harris
2941 @code{SWH Plugins} collection:
2943 ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
2947 @subsection Commands
2949 This filter supports the following commands:
2952 Modify the @var{N}-th control value.
2954 If the specified value is not valid, it is ignored and prior one is kept.
2959 EBU R128 loudness normalization. Includes both dynamic and linear normalization modes.
2960 Support for both single pass (livestreams, files) and double pass (files) modes.
2961 This algorithm can target IL, LRA, and maximum true peak.
2963 The filter accepts the following options:
2967 Set integrated loudness target.
2968 Range is -70.0 - -5.0. Default value is -24.0.
2971 Set loudness range target.
2972 Range is 1.0 - 20.0. Default value is 7.0.
2975 Set maximum true peak.
2976 Range is -9.0 - +0.0. Default value is -2.0.
2978 @item measured_I, measured_i
2979 Measured IL of input file.
2980 Range is -99.0 - +0.0.
2982 @item measured_LRA, measured_lra
2983 Measured LRA of input file.
2984 Range is 0.0 - 99.0.
2986 @item measured_TP, measured_tp
2987 Measured true peak of input file.
2988 Range is -99.0 - +99.0.
2990 @item measured_thresh
2991 Measured threshold of input file.
2992 Range is -99.0 - +0.0.
2995 Set offset gain. Gain is applied before the true-peak limiter.
2996 Range is -99.0 - +99.0. Default is +0.0.
2999 Normalize linearly if possible.
3000 measured_I, measured_LRA, measured_TP, and measured_thresh must also
3001 to be specified in order to use this mode.
3002 Options are true or false. Default is true.
3005 Treat mono input files as "dual-mono". If a mono file is intended for playback
3006 on a stereo system, its EBU R128 measurement will be perceptually incorrect.
3007 If set to @code{true}, this option will compensate for this effect.
3008 Multi-channel input files are not affected by this option.
3009 Options are true or false. Default is false.
3012 Set print format for stats. Options are summary, json, or none.
3013 Default value is none.
3018 Apply a low-pass filter with 3dB point frequency.
3019 The filter can be either single-pole or double-pole (the default).
3020 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
3022 The filter accepts the following options:
3026 Set frequency in Hz. Default is 500.
3029 Set number of poles. Default is 2.
3032 Set method to specify band-width of filter.
3045 Specify the band-width of a filter in width_type units.
3046 Applies only to double-pole filter.
3047 The default is 0.707q and gives a Butterworth response.
3050 Specify which channels to filter, by default all available are filtered.
3053 @subsection Examples
3056 Lowpass only LFE channel, it LFE is not present it does nothing:
3065 Mix channels with specific gain levels. The filter accepts the output
3066 channel layout followed by a set of channels definitions.
3068 This filter is also designed to efficiently remap the channels of an audio
3071 The filter accepts parameters of the form:
3072 "@var{l}|@var{outdef}|@var{outdef}|..."
3076 output channel layout or number of channels
3079 output channel specification, of the form:
3080 "@var{out_name}=[@var{gain}*]@var{in_name}[(+-)[@var{gain}*]@var{in_name}...]"
3083 output channel to define, either a channel name (FL, FR, etc.) or a channel
3084 number (c0, c1, etc.)
3087 multiplicative coefficient for the channel, 1 leaving the volume unchanged
3090 input channel to use, see out_name for details; it is not possible to mix
3091 named and numbered input channels
3094 If the `=' in a channel specification is replaced by `<', then the gains for
3095 that specification will be renormalized so that the total is 1, thus
3096 avoiding clipping noise.
3098 @subsection Mixing examples
3100 For example, if you want to down-mix from stereo to mono, but with a bigger
3101 factor for the left channel:
3103 pan=1c|c0=0.9*c0+0.1*c1
3106 A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
3107 7-channels surround:
3109 pan=stereo| FL < FL + 0.5*FC + 0.6*BL + 0.6*SL | FR < FR + 0.5*FC + 0.6*BR + 0.6*SR
3112 Note that @command{ffmpeg} integrates a default down-mix (and up-mix) system
3113 that should be preferred (see "-ac" option) unless you have very specific
3116 @subsection Remapping examples
3118 The channel remapping will be effective if, and only if:
3121 @item gain coefficients are zeroes or ones,
3122 @item only one input per channel output,
3125 If all these conditions are satisfied, the filter will notify the user ("Pure
3126 channel mapping detected"), and use an optimized and lossless method to do the
3129 For example, if you have a 5.1 source and want a stereo audio stream by
3130 dropping the extra channels:
3132 pan="stereo| c0=FL | c1=FR"
3135 Given the same source, you can also switch front left and front right channels
3136 and keep the input channel layout:
3138 pan="5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5"
3141 If the input is a stereo audio stream, you can mute the front left channel (and
3142 still keep the stereo channel layout) with:
3147 Still with a stereo audio stream input, you can copy the right channel in both
3148 front left and right:
3150 pan="stereo| c0=FR | c1=FR"
3155 ReplayGain scanner filter. This filter takes an audio stream as an input and
3156 outputs it unchanged.
3157 At end of filtering it displays @code{track_gain} and @code{track_peak}.
3161 Convert the audio sample format, sample rate and channel layout. It is
3162 not meant to be used directly.
3165 Apply time-stretching and pitch-shifting with librubberband.
3167 The filter accepts the following options:
3171 Set tempo scale factor.
3174 Set pitch scale factor.
3177 Set transients detector.
3178 Possible values are:
3187 Possible values are:
3196 Possible values are:
3203 Set processing window size.
3204 Possible values are:
3213 Possible values are:
3220 Enable formant preservation when shift pitching.
3221 Possible values are:
3229 Possible values are:
3238 Possible values are:
3245 @section sidechaincompress
3247 This filter acts like normal compressor but has the ability to compress
3248 detected signal using second input signal.
3249 It needs two input streams and returns one output stream.
3250 First input stream will be processed depending on second stream signal.
3251 The filtered signal then can be filtered with other filters in later stages of
3252 processing. See @ref{pan} and @ref{amerge} filter.
3254 The filter accepts the following options:
3258 Set input gain. Default is 1. Range is between 0.015625 and 64.
3261 If a signal of second stream raises above this level it will affect the gain
3262 reduction of first stream.
3263 By default is 0.125. Range is between 0.00097563 and 1.
3266 Set a ratio about which the signal is reduced. 1:2 means that if the level
3267 raised 4dB above the threshold, it will be only 2dB above after the reduction.
3268 Default is 2. Range is between 1 and 20.
3271 Amount of milliseconds the signal has to rise above the threshold before gain
3272 reduction starts. Default is 20. Range is between 0.01 and 2000.
3275 Amount of milliseconds the signal has to fall below the threshold before
3276 reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
3279 Set the amount by how much signal will be amplified after processing.
3280 Default is 2. Range is from 1 and 64.
3283 Curve the sharp knee around the threshold to enter gain reduction more softly.
3284 Default is 2.82843. Range is between 1 and 8.
3287 Choose if the @code{average} level between all channels of side-chain stream
3288 or the louder(@code{maximum}) channel of side-chain stream affects the
3289 reduction. Default is @code{average}.
3292 Should the exact signal be taken in case of @code{peak} or an RMS one in case
3293 of @code{rms}. Default is @code{rms} which is mainly smoother.
3296 Set sidechain gain. Default is 1. Range is between 0.015625 and 64.
3299 How much to use compressed signal in output. Default is 1.
3300 Range is between 0 and 1.
3303 @subsection Examples
3307 Full ffmpeg example taking 2 audio inputs, 1st input to be compressed
3308 depending on the signal of 2nd input and later compressed signal to be
3309 merged with 2nd input:
3311 ffmpeg -i main.flac -i sidechain.flac -filter_complex "[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress[compr];[compr][mix]amerge"
3315 @section sidechaingate
3317 A sidechain gate acts like a normal (wideband) gate but has the ability to
3318 filter the detected signal before sending it to the gain reduction stage.
3319 Normally a gate uses the full range signal to detect a level above the
3321 For example: If you cut all lower frequencies from your sidechain signal
3322 the gate will decrease the volume of your track only if not enough highs
3323 appear. With this technique you are able to reduce the resonation of a
3324 natural drum or remove "rumbling" of muted strokes from a heavily distorted
3326 It needs two input streams and returns one output stream.
3327 First input stream will be processed depending on second stream signal.
3329 The filter accepts the following options:
3333 Set input level before filtering.
3334 Default is 1. Allowed range is from 0.015625 to 64.
3337 Set the level of gain reduction when the signal is below the threshold.
3338 Default is 0.06125. Allowed range is from 0 to 1.
3341 If a signal rises above this level the gain reduction is released.
3342 Default is 0.125. Allowed range is from 0 to 1.
3345 Set a ratio about which the signal is reduced.
3346 Default is 2. Allowed range is from 1 to 9000.
3349 Amount of milliseconds the signal has to rise above the threshold before gain
3351 Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
3354 Amount of milliseconds the signal has to fall below the threshold before the
3355 reduction is increased again. Default is 250 milliseconds.
3356 Allowed range is from 0.01 to 9000.
3359 Set amount of amplification of signal after processing.
3360 Default is 1. Allowed range is from 1 to 64.
3363 Curve the sharp knee around the threshold to enter gain reduction more softly.
3364 Default is 2.828427125. Allowed range is from 1 to 8.
3367 Choose if exact signal should be taken for detection or an RMS like one.
3368 Default is rms. Can be peak or rms.
3371 Choose if the average level between all channels or the louder channel affects
3373 Default is average. Can be average or maximum.
3376 Set sidechain gain. Default is 1. Range is from 0.015625 to 64.
3379 @section silencedetect
3381 Detect silence in an audio stream.
3383 This filter logs a message when it detects that the input audio volume is less
3384 or equal to a noise tolerance value for a duration greater or equal to the
3385 minimum detected noise duration.
3387 The printed times and duration are expressed in seconds.
3389 The filter accepts the following options:
3393 Set silence duration until notification (default is 2 seconds).
3396 Set noise tolerance. Can be specified in dB (in case "dB" is appended to the
3397 specified value) or amplitude ratio. Default is -60dB, or 0.001.
3400 @subsection Examples
3404 Detect 5 seconds of silence with -50dB noise tolerance:
3406 silencedetect=n=-50dB:d=5
3410 Complete example with @command{ffmpeg} to detect silence with 0.0001 noise
3411 tolerance in @file{silence.mp3}:
3413 ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
3417 @section silenceremove
3419 Remove silence from the beginning, middle or end of the audio.
3421 The filter accepts the following options:
3425 This value is used to indicate if audio should be trimmed at beginning of
3426 the audio. A value of zero indicates no silence should be trimmed from the
3427 beginning. When specifying a non-zero value, it trims audio up until it
3428 finds non-silence. Normally, when trimming silence from beginning of audio
3429 the @var{start_periods} will be @code{1} but it can be increased to higher
3430 values to trim all audio up to specific count of non-silence periods.
3431 Default value is @code{0}.
3433 @item start_duration
3434 Specify the amount of time that non-silence must be detected before it stops
3435 trimming audio. By increasing the duration, bursts of noises can be treated
3436 as silence and trimmed off. Default value is @code{0}.
3438 @item start_threshold
3439 This indicates what sample value should be treated as silence. For digital
3440 audio, a value of @code{0} may be fine but for audio recorded from analog,
3441 you may wish to increase the value to account for background noise.
3442 Can be specified in dB (in case "dB" is appended to the specified value)
3443 or amplitude ratio. Default value is @code{0}.
3446 Set the count for trimming silence from the end of audio.
3447 To remove silence from the middle of a file, specify a @var{stop_periods}
3448 that is negative. This value is then treated as a positive value and is
3449 used to indicate the effect should restart processing as specified by
3450 @var{start_periods}, making it suitable for removing periods of silence
3451 in the middle of the audio.
3452 Default value is @code{0}.
3455 Specify a duration of silence that must exist before audio is not copied any
3456 more. By specifying a higher duration, silence that is wanted can be left in
3458 Default value is @code{0}.
3460 @item stop_threshold
3461 This is the same as @option{start_threshold} but for trimming silence from
3463 Can be specified in dB (in case "dB" is appended to the specified value)
3464 or amplitude ratio. Default value is @code{0}.
3467 This indicates that @var{stop_duration} length of audio should be left intact
3468 at the beginning of each period of silence.
3469 For example, if you want to remove long pauses between words but do not want
3470 to remove the pauses completely. Default value is @code{0}.
3473 Set how is silence detected. Can be @code{rms} or @code{peak}. Second is faster
3474 and works better with digital silence which is exactly 0.
3475 Default value is @code{rms}.
3478 Set ratio used to calculate size of window for detecting silence.
3479 Default value is @code{0.02}. Allowed range is from @code{0} to @code{10}.
3482 @subsection Examples
3486 The following example shows how this filter can be used to start a recording
3487 that does not contain the delay at the start which usually occurs between
3488 pressing the record button and the start of the performance:
3490 silenceremove=1:5:0.02
3494 Trim all silence encountered from beginning to end where there is more than 1
3495 second of silence in audio:
3497 silenceremove=0:0:0:-1:1:-90dB
3503 SOFAlizer uses head-related transfer functions (HRTFs) to create virtual
3504 loudspeakers around the user for binaural listening via headphones (audio
3505 formats up to 9 channels supported).
3506 The HRTFs are stored in SOFA files (see @url{http://www.sofacoustics.org/} for a database).
3507 SOFAlizer is developed at the Acoustics Research Institute (ARI) of the
3508 Austrian Academy of Sciences.
3510 To enable compilation of this filter you need to configure FFmpeg with
3511 @code{--enable-netcdf}.
3513 The filter accepts the following options:
3517 Set the SOFA file used for rendering.
3520 Set gain applied to audio. Value is in dB. Default is 0.
3523 Set rotation of virtual loudspeakers in deg. Default is 0.
3526 Set elevation of virtual speakers in deg. Default is 0.
3529 Set distance in meters between loudspeakers and the listener with near-field
3530 HRTFs. Default is 1.
3533 Set processing type. Can be @var{time} or @var{freq}. @var{time} is
3534 processing audio in time domain which is slow.
3535 @var{freq} is processing audio in frequency domain which is fast.
3536 Default is @var{freq}.
3539 Set custom positions of virtual loudspeakers. Syntax for this option is:
3540 <CH> <AZIM> <ELEV>[|<CH> <AZIM> <ELEV>|...].
3541 Each virtual loudspeaker is described with short channel name following with
3542 azimuth and elevation in degreees.
3543 Each virtual loudspeaker description is separated by '|'.
3544 For example to override front left and front right channel positions use:
3545 'speakers=FL 45 15|FR 345 15'.
3546 Descriptions with unrecognised channel names are ignored.
3549 @subsection Examples
3553 Using ClubFritz6 sofa file:
3555 sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
3559 Using ClubFritz12 sofa file and bigger radius with small rotation:
3561 sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
3565 Similar as above but with custom speaker positions for front left, front right, back left and back right
3566 and also with custom gain:
3568 "sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=2:speakers=FL 45|FR 315|BL 135|BR 225:gain=28"
3572 @section stereotools
3574 This filter has some handy utilities to manage stereo signals, for converting
3575 M/S stereo recordings to L/R signal while having control over the parameters
3576 or spreading the stereo image of master track.
3578 The filter accepts the following options:
3582 Set input level before filtering for both channels. Defaults is 1.
3583 Allowed range is from 0.015625 to 64.
3586 Set output level after filtering for both channels. Defaults is 1.
3587 Allowed range is from 0.015625 to 64.
3590 Set input balance between both channels. Default is 0.
3591 Allowed range is from -1 to 1.
3594 Set output balance between both channels. Default is 0.
3595 Allowed range is from -1 to 1.
3598 Enable softclipping. Results in analog distortion instead of harsh digital 0dB
3599 clipping. Disabled by default.
3602 Mute the left channel. Disabled by default.
3605 Mute the right channel. Disabled by default.
3608 Change the phase of the left channel. Disabled by default.
3611 Change the phase of the right channel. Disabled by default.
3614 Set stereo mode. Available values are:
3618 Left/Right to Left/Right, this is default.
3621 Left/Right to Mid/Side.
3624 Mid/Side to Left/Right.
3627 Left/Right to Left/Left.
3630 Left/Right to Right/Right.
3633 Left/Right to Left + Right.
3636 Left/Right to Right/Left.
3640 Set level of side signal. Default is 1.
3641 Allowed range is from 0.015625 to 64.
3644 Set balance of side signal. Default is 0.
3645 Allowed range is from -1 to 1.
3648 Set level of the middle signal. Default is 1.
3649 Allowed range is from 0.015625 to 64.
3652 Set middle signal pan. Default is 0. Allowed range is from -1 to 1.
3655 Set stereo base between mono and inversed channels. Default is 0.
3656 Allowed range is from -1 to 1.
3659 Set delay in milliseconds how much to delay left from right channel and
3660 vice versa. Default is 0. Allowed range is from -20 to 20.
3663 Set S/C level. Default is 1. Allowed range is from 1 to 100.
3666 Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360.
3669 @subsection Examples
3673 Apply karaoke like effect:
3675 stereotools=mlev=0.015625
3679 Convert M/S signal to L/R:
3681 "stereotools=mode=ms>lr"
3685 @section stereowiden
3687 This filter enhance the stereo effect by suppressing signal common to both
3688 channels and by delaying the signal of left into right and vice versa,
3689 thereby widening the stereo effect.
3691 The filter accepts the following options:
3695 Time in milliseconds of the delay of left signal into right and vice versa.
3696 Default is 20 milliseconds.
3699 Amount of gain in delayed signal into right and vice versa. Gives a delay
3700 effect of left signal in right output and vice versa which gives widening
3701 effect. Default is 0.3.
3704 Cross feed of left into right with inverted phase. This helps in suppressing
3705 the mono. If the value is 1 it will cancel all the signal common to both
3706 channels. Default is 0.3.
3709 Set level of input signal of original channel. Default is 0.8.
3714 Boost or cut treble (upper) frequencies of the audio using a two-pole
3715 shelving filter with a response similar to that of a standard
3716 hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
3718 The filter accepts the following options:
3722 Give the gain at whichever is the lower of ~22 kHz and the
3723 Nyquist frequency. Its useful range is about -20 (for a large cut)
3724 to +20 (for a large boost). Beware of clipping when using a positive gain.
3727 Set the filter's central frequency and so can be used
3728 to extend or reduce the frequency range to be boosted or cut.
3729 The default value is @code{3000} Hz.
3732 Set method to specify band-width of filter.
3745 Determine how steep is the filter's shelf transition.
3748 Specify which channels to filter, by default all available are filtered.
3753 Sinusoidal amplitude modulation.
3755 The filter accepts the following options:
3759 Modulation frequency in Hertz. Modulation frequencies in the subharmonic range
3760 (20 Hz or lower) will result in a tremolo effect.
3761 This filter may also be used as a ring modulator by specifying
3762 a modulation frequency higher than 20 Hz.
3763 Range is 0.1 - 20000.0. Default value is 5.0 Hz.
3766 Depth of modulation as a percentage. Range is 0.0 - 1.0.
3767 Default value is 0.5.
3772 Sinusoidal phase modulation.
3774 The filter accepts the following options:
3778 Modulation frequency in Hertz.
3779 Range is 0.1 - 20000.0. Default value is 5.0 Hz.
3782 Depth of modulation as a percentage. Range is 0.0 - 1.0.
3783 Default value is 0.5.
3788 Adjust the input audio volume.
3790 It accepts the following parameters:
3794 Set audio volume expression.
3796 Output values are clipped to the maximum value.
3798 The output audio volume is given by the relation:
3800 @var{output_volume} = @var{volume} * @var{input_volume}
3803 The default value for @var{volume} is "1.0".
3806 This parameter represents the mathematical precision.
3808 It determines which input sample formats will be allowed, which affects the
3809 precision of the volume scaling.
3813 8-bit fixed-point; this limits input sample format to U8, S16, and S32.
3815 32-bit floating-point; this limits input sample format to FLT. (default)
3817 64-bit floating-point; this limits input sample format to DBL.
3821 Choose the behaviour on encountering ReplayGain side data in input frames.
3825 Remove ReplayGain side data, ignoring its contents (the default).
3828 Ignore ReplayGain side data, but leave it in the frame.
3831 Prefer the track gain, if present.
3834 Prefer the album gain, if present.
3837 @item replaygain_preamp
3838 Pre-amplification gain in dB to apply to the selected replaygain gain.
3840 Default value for @var{replaygain_preamp} is 0.0.
3843 Set when the volume expression is evaluated.
3845 It accepts the following values:
3848 only evaluate expression once during the filter initialization, or
3849 when the @samp{volume} command is sent
3852 evaluate expression for each incoming frame
3855 Default value is @samp{once}.
3858 The volume expression can contain the following parameters.
3862 frame number (starting at zero)
3865 @item nb_consumed_samples
3866 number of samples consumed by the filter
3868 number of samples in the current frame
3870 original frame position in the file
3876 PTS at start of stream
3878 time at start of stream
3884 last set volume value
3887 Note that when @option{eval} is set to @samp{once} only the
3888 @var{sample_rate} and @var{tb} variables are available, all other
3889 variables will evaluate to NAN.
3891 @subsection Commands
3893 This filter supports the following commands:
3896 Modify the volume expression.
3897 The command accepts the same syntax of the corresponding option.
3899 If the specified expression is not valid, it is kept at its current
3901 @item replaygain_noclip
3902 Prevent clipping by limiting the gain applied.
3904 Default value for @var{replaygain_noclip} is 1.
3908 @subsection Examples
3912 Halve the input audio volume:
3916 volume=volume=-6.0206dB
3919 In all the above example the named key for @option{volume} can be
3920 omitted, for example like in:
3926 Increase input audio power by 6 decibels using fixed-point precision:
3928 volume=volume=6dB:precision=fixed
3932 Fade volume after time 10 with an annihilation period of 5 seconds:
3934 volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
3938 @section volumedetect
3940 Detect the volume of the input video.
3942 The filter has no parameters. The input is not modified. Statistics about
3943 the volume will be printed in the log when the input stream end is reached.
3945 In particular it will show the mean volume (root mean square), maximum
3946 volume (on a per-sample basis), and the beginning of a histogram of the
3947 registered volume values (from the maximum value to a cumulated 1/1000 of
3950 All volumes are in decibels relative to the maximum PCM value.
3952 @subsection Examples
3954 Here is an excerpt of the output:
3956 [Parsed_volumedetect_0 @ 0xa23120] mean_volume: -27 dB
3957 [Parsed_volumedetect_0 @ 0xa23120] max_volume: -4 dB
3958 [Parsed_volumedetect_0 @ 0xa23120] histogram_4db: 6
3959 [Parsed_volumedetect_0 @ 0xa23120] histogram_5db: 62
3960 [Parsed_volumedetect_0 @ 0xa23120] histogram_6db: 286
3961 [Parsed_volumedetect_0 @ 0xa23120] histogram_7db: 1042
3962 [Parsed_volumedetect_0 @ 0xa23120] histogram_8db: 2551
3963 [Parsed_volumedetect_0 @ 0xa23120] histogram_9db: 4609
3964 [Parsed_volumedetect_0 @ 0xa23120] histogram_10db: 8409
3970 The mean square energy is approximately -27 dB, or 10^-2.7.
3972 The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
3974 There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
3977 In other words, raising the volume by +4 dB does not cause any clipping,
3978 raising it by +5 dB causes clipping for 6 samples, etc.
3980 @c man end AUDIO FILTERS
3982 @chapter Audio Sources
3983 @c man begin AUDIO SOURCES
3985 Below is a description of the currently available audio sources.
3989 Buffer audio frames, and make them available to the filter chain.
3991 This source is mainly intended for a programmatic use, in particular
3992 through the interface defined in @file{libavfilter/asrc_abuffer.h}.
3994 It accepts the following parameters:
3998 The timebase which will be used for timestamps of submitted frames. It must be
3999 either a floating-point number or in @var{numerator}/@var{denominator} form.
4002 The sample rate of the incoming audio buffers.
4005 The sample format of the incoming audio buffers.
4006 Either a sample format name or its corresponding integer representation from
4007 the enum AVSampleFormat in @file{libavutil/samplefmt.h}
4009 @item channel_layout
4010 The channel layout of the incoming audio buffers.
4011 Either a channel layout name from channel_layout_map in
4012 @file{libavutil/channel_layout.c} or its corresponding integer representation
4013 from the AV_CH_LAYOUT_* macros in @file{libavutil/channel_layout.h}
4016 The number of channels of the incoming audio buffers.
4017 If both @var{channels} and @var{channel_layout} are specified, then they
4022 @subsection Examples
4025 abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
4028 will instruct the source to accept planar 16bit signed stereo at 44100Hz.
4029 Since the sample format with name "s16p" corresponds to the number
4030 6 and the "stereo" channel layout corresponds to the value 0x3, this is
4033 abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
4038 Generate an audio signal specified by an expression.
4040 This source accepts in input one or more expressions (one for each
4041 channel), which are evaluated and used to generate a corresponding
4044 This source accepts the following options:
4048 Set the '|'-separated expressions list for each separate channel. In case the
4049 @option{channel_layout} option is not specified, the selected channel layout
4050 depends on the number of provided expressions. Otherwise the last
4051 specified expression is applied to the remaining output channels.
4053 @item channel_layout, c
4054 Set the channel layout. The number of channels in the specified layout
4055 must be equal to the number of specified expressions.
4058 Set the minimum duration of the sourced audio. See
4059 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
4060 for the accepted syntax.
4061 Note that the resulting duration may be greater than the specified
4062 duration, as the generated audio is always cut at the end of a
4065 If not specified, or the expressed duration is negative, the audio is
4066 supposed to be generated forever.
4069 Set the number of samples per channel per each output frame,
4072 @item sample_rate, s
4073 Specify the sample rate, default to 44100.
4076 Each expression in @var{exprs} can contain the following constants:
4080 number of the evaluated sample, starting from 0
4083 time of the evaluated sample expressed in seconds, starting from 0
4090 @subsection Examples
4100 Generate a sin signal with frequency of 440 Hz, set sample rate to
4103 aevalsrc="sin(440*2*PI*t):s=8000"
4107 Generate a two channels signal, specify the channel layout (Front
4108 Center + Back Center) explicitly:
4110 aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC"
4114 Generate white noise:
4116 aevalsrc="-2+random(0)"
4120 Generate an amplitude modulated signal:
4122 aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)"
4126 Generate 2.5 Hz binaural beats on a 360 Hz carrier:
4128 aevalsrc="0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)"
4135 The null audio source, return unprocessed audio frames. It is mainly useful
4136 as a template and to be employed in analysis / debugging tools, or as
4137 the source for filters which ignore the input data (for example the sox
4140 This source accepts the following options:
4144 @item channel_layout, cl
4146 Specifies the channel layout, and can be either an integer or a string
4147 representing a channel layout. The default value of @var{channel_layout}
4150 Check the channel_layout_map definition in
4151 @file{libavutil/channel_layout.c} for the mapping between strings and
4152 channel layout values.
4154 @item sample_rate, r
4155 Specifies the sample rate, and defaults to 44100.
4158 Set the number of samples per requested frames.
4162 @subsection Examples
4166 Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
4168 anullsrc=r=48000:cl=4
4172 Do the same operation with a more obvious syntax:
4174 anullsrc=r=48000:cl=mono
4178 All the parameters need to be explicitly defined.
4182 Synthesize a voice utterance using the libflite library.