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 @c man end FILTERGRAPH DESCRIPTION
311 @chapter Audio Filters
312 @c man begin AUDIO FILTERS
314 When you configure your FFmpeg build, you can disable any of the
315 existing filters using @code{--disable-filters}.
316 The configure output will show the audio filters included in your
319 Below is a description of the currently available audio filters.
323 A compressor is mainly used to reduce the dynamic range of a signal.
324 Especially modern music is mostly compressed at a high ratio to
325 improve the overall loudness. It's done to get the highest attention
326 of a listener, "fatten" the sound and bring more "power" to the track.
327 If a signal is compressed too much it may sound dull or "dead"
328 afterwards or it may start to "pump" (which could be a powerful effect
329 but can also destroy a track completely).
330 The right compression is the key to reach a professional sound and is
331 the high art of mixing and mastering. Because of its complex settings
332 it may take a long time to get the right feeling for this kind of effect.
334 Compression is done by detecting the volume above a chosen level
335 @code{threshold} and dividing it by the factor set with @code{ratio}.
336 So if you set the threshold to -12dB and your signal reaches -6dB a ratio
337 of 2:1 will result in a signal at -9dB. Because an exact manipulation of
338 the signal would cause distortion of the waveform the reduction can be
339 levelled over the time. This is done by setting "Attack" and "Release".
340 @code{attack} determines how long the signal has to rise above the threshold
341 before any reduction will occur and @code{release} sets the time the signal
342 has to fall below the threshold to reduce the reduction again. Shorter signals
343 than the chosen attack time will be left untouched.
344 The overall reduction of the signal can be made up afterwards with the
345 @code{makeup} setting. So compressing the peaks of a signal about 6dB and
346 raising the makeup to this level results in a signal twice as loud than the
347 source. To gain a softer entry in the compression the @code{knee} flattens the
348 hard edge at the threshold in the range of the chosen decibels.
350 The filter accepts the following options:
354 Set input gain. Default is 1. Range is between 0.015625 and 64.
357 If a signal of second stream rises above this level it will affect the gain
358 reduction of the first stream.
359 By default it is 0.125. Range is between 0.00097563 and 1.
362 Set a ratio by which the signal is reduced. 1:2 means that if the level
363 rose 4dB above the threshold, it will be only 2dB above after the reduction.
364 Default is 2. Range is between 1 and 20.
367 Amount of milliseconds the signal has to rise above the threshold before gain
368 reduction starts. Default is 20. Range is between 0.01 and 2000.
371 Amount of milliseconds the signal has to fall below the threshold before
372 reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
375 Set the amount by how much signal will be amplified after processing.
376 Default is 2. Range is from 1 and 64.
379 Curve the sharp knee around the threshold to enter gain reduction more softly.
380 Default is 2.82843. Range is between 1 and 8.
383 Choose if the @code{average} level between all channels of input stream
384 or the louder(@code{maximum}) channel of input stream affects the
385 reduction. Default is @code{average}.
388 Should the exact signal be taken in case of @code{peak} or an RMS one in case
389 of @code{rms}. Default is @code{rms} which is mostly smoother.
392 How much to use compressed signal in output. Default is 1.
393 Range is between 0 and 1.
398 Apply cross fade from one input audio stream to another input audio stream.
399 The cross fade is applied for specified duration near the end of first stream.
401 The filter accepts the following options:
405 Specify the number of samples for which the cross fade effect has to last.
406 At the end of the cross fade effect the first input audio will be completely
407 silent. Default is 44100.
410 Specify the duration of the cross fade effect. See
411 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
412 for the accepted syntax.
413 By default the duration is determined by @var{nb_samples}.
414 If set this option is used instead of @var{nb_samples}.
417 Should first stream end overlap with second stream start. Default is enabled.
420 Set curve for cross fade transition for first stream.
423 Set curve for cross fade transition for second stream.
425 For description of available curve types see @ref{afade} filter description.
432 Cross fade from one input to another:
434 ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
438 Cross fade from one input to another but without overlapping:
440 ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
446 Delay one or more audio channels.
448 Samples in delayed channel are filled with silence.
450 The filter accepts the following option:
454 Set list of delays in milliseconds for each channel separated by '|'.
455 At least one delay greater than 0 should be provided.
456 Unused delays will be silently ignored. If number of given delays is
457 smaller than number of channels all remaining channels will not be delayed.
464 Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
465 the second channel (and any other channels that may be present) unchanged.
473 Apply echoing to the input audio.
475 Echoes are reflected sound and can occur naturally amongst mountains
476 (and sometimes large buildings) when talking or shouting; digital echo
477 effects emulate this behaviour and are often used to help fill out the
478 sound of a single instrument or vocal. The time difference between the
479 original signal and the reflection is the @code{delay}, and the
480 loudness of the reflected signal is the @code{decay}.
481 Multiple echoes can have different delays and decays.
483 A description of the accepted parameters follows.
487 Set input gain of reflected signal. Default is @code{0.6}.
490 Set output gain of reflected signal. Default is @code{0.3}.
493 Set list of time intervals in milliseconds between original signal and reflections
494 separated by '|'. Allowed range for each @code{delay} is @code{(0 - 90000.0]}.
495 Default is @code{1000}.
498 Set list of loudnesses of reflected signals separated by '|'.
499 Allowed range for each @code{decay} is @code{(0 - 1.0]}.
500 Default is @code{0.5}.
507 Make it sound as if there are twice as many instruments as are actually playing:
509 aecho=0.8:0.88:60:0.4
513 If delay is very short, then it sound like a (metallic) robot playing music:
519 A longer delay will sound like an open air concert in the mountains:
521 aecho=0.8:0.9:1000:0.3
525 Same as above but with one more mountain:
527 aecho=0.8:0.9:1000|1800:0.3|0.25
532 Audio emphasis filter creates or restores material directly taken from LPs or
533 emphased CDs with different filter curves. E.g. to store music on vinyl the
534 signal has to be altered by a filter first to even out the disadvantages of
535 this recording medium.
536 Once the material is played back the inverse filter has to be applied to
537 restore the distortion of the frequency response.
539 The filter accepts the following options:
549 Set filter mode. For restoring material use @code{reproduction} mode, otherwise
550 use @code{production} mode. Default is @code{reproduction} mode.
553 Set filter type. Selects medium. Can be one of the following:
565 select Compact Disc (CD).
571 select 50µs (FM-KF).
573 select 75µs (FM-KF).
579 Modify an audio signal according to the specified expressions.
581 This filter accepts one or more expressions (one for each channel),
582 which are evaluated and used to modify a corresponding audio signal.
584 It accepts the following parameters:
588 Set the '|'-separated expressions list for each separate channel. If
589 the number of input channels is greater than the number of
590 expressions, the last specified expression is used for the remaining
593 @item channel_layout, c
594 Set output channel layout. If not specified, the channel layout is
595 specified by the number of expressions. If set to @samp{same}, it will
596 use by default the same input channel layout.
599 Each expression in @var{exprs} can contain the following constants and functions:
603 channel number of the current expression
606 number of the evaluated sample, starting from 0
612 time of the evaluated sample expressed in seconds
615 @item nb_out_channels
616 input and output number of channels
619 the value of input channel with number @var{CH}
622 Note: this filter is slow. For faster processing you should use a
631 aeval=val(ch)/2:c=same
635 Invert phase of the second channel:
644 Apply fade-in/out effect to input audio.
646 A description of the accepted parameters follows.
650 Specify the effect type, can be either @code{in} for fade-in, or
651 @code{out} for a fade-out effect. Default is @code{in}.
653 @item start_sample, ss
654 Specify the number of the start sample for starting to apply the fade
655 effect. Default is 0.
658 Specify the number of samples for which the fade effect has to last. At
659 the end of the fade-in effect the output audio will have the same
660 volume as the input audio, at the end of the fade-out transition
661 the output audio will be silence. Default is 44100.
664 Specify the start time of the fade effect. Default is 0.
665 The value must be specified as a time duration; see
666 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
667 for the accepted syntax.
668 If set this option is used instead of @var{start_sample}.
671 Specify the duration of the fade effect. See
672 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
673 for the accepted syntax.
674 At the end of the fade-in effect the output audio will have the same
675 volume as the input audio, at the end of the fade-out transition
676 the output audio will be silence.
677 By default the duration is determined by @var{nb_samples}.
678 If set this option is used instead of @var{nb_samples}.
681 Set curve for fade transition.
683 It accepts the following values:
686 select triangular, linear slope (default)
688 select quarter of sine wave
690 select half of sine wave
692 select exponential sine wave
696 select inverted parabola
710 select inverted quarter of sine wave
712 select inverted half of sine wave
714 select double-exponential seat
716 select double-exponential sigmoid
724 Fade in first 15 seconds of audio:
730 Fade out last 25 seconds of a 900 seconds audio:
732 afade=t=out:st=875:d=25
739 Set output format constraints for the input audio. The framework will
740 negotiate the most appropriate format to minimize conversions.
742 It accepts the following parameters:
746 A '|'-separated list of requested sample formats.
749 A '|'-separated list of requested sample rates.
751 @item channel_layouts
752 A '|'-separated list of requested channel layouts.
754 See @ref{channel layout syntax,,the Channel Layout section in the ffmpeg-utils(1) manual,ffmpeg-utils}
755 for the required syntax.
758 If a parameter is omitted, all values are allowed.
760 Force the output to either unsigned 8-bit or signed 16-bit stereo
762 aformat=sample_fmts=u8|s16:channel_layouts=stereo
767 A gate is mainly used to reduce lower parts of a signal. This kind of signal
768 processing reduces disturbing noise between useful signals.
770 Gating is done by detecting the volume below a chosen level @var{threshold}
771 and divide it by the factor set with @var{ratio}. The bottom of the noise
772 floor is set via @var{range}. Because an exact manipulation of the signal
773 would cause distortion of the waveform the reduction can be levelled over
774 time. This is done by setting @var{attack} and @var{release}.
776 @var{attack} determines how long the signal has to fall below the threshold
777 before any reduction will occur and @var{release} sets the time the signal
778 has to raise above the threshold to reduce the reduction again.
779 Shorter signals than the chosen attack time will be left untouched.
783 Set input level before filtering.
784 Default is 1. Allowed range is from 0.015625 to 64.
787 Set the level of gain reduction when the signal is below the threshold.
788 Default is 0.06125. Allowed range is from 0 to 1.
791 If a signal rises above this level the gain reduction is released.
792 Default is 0.125. Allowed range is from 0 to 1.
795 Set a ratio about which the signal is reduced.
796 Default is 2. Allowed range is from 1 to 9000.
799 Amount of milliseconds the signal has to rise above the threshold before gain
801 Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
804 Amount of milliseconds the signal has to fall below the threshold before the
805 reduction is increased again. Default is 250 milliseconds.
806 Allowed range is from 0.01 to 9000.
809 Set amount of amplification of signal after processing.
810 Default is 1. Allowed range is from 1 to 64.
813 Curve the sharp knee around the threshold to enter gain reduction more softly.
814 Default is 2.828427125. Allowed range is from 1 to 8.
817 Choose if exact signal should be taken for detection or an RMS like one.
818 Default is rms. Can be peak or rms.
821 Choose if the average level between all channels or the louder channel affects
823 Default is average. Can be average or maximum.
828 The limiter prevents input signal from raising over a desired threshold.
829 This limiter uses lookahead technology to prevent your signal from distorting.
830 It means that there is a small delay after signal is processed. Keep in mind
831 that the delay it produces is the attack time you set.
833 The filter accepts the following options:
837 Set input gain. Default is 1.
840 Set output gain. Default is 1.
843 Don't let signals above this level pass the limiter. Default is 1.
846 The limiter will reach its attenuation level in this amount of time in
847 milliseconds. Default is 5 milliseconds.
850 Come back from limiting to attenuation 1.0 in this amount of milliseconds.
851 Default is 50 milliseconds.
854 When gain reduction is always needed ASC takes care of releasing to an
855 average reduction level rather than reaching a reduction of 0 in the release
859 Select how much the release time is affected by ASC, 0 means nearly no changes
860 in release time while 1 produces higher release times.
863 Auto level output signal. Default is enabled.
864 This normalizes audio back to 0dB if enabled.
867 Depending on picked setting it is recommended to upsample input 2x or 4x times
868 with @ref{aresample} before applying this filter.
872 Apply a two-pole all-pass filter with central frequency (in Hz)
873 @var{frequency}, and filter-width @var{width}.
874 An all-pass filter changes the audio's frequency to phase relationship
875 without changing its frequency to amplitude relationship.
877 The filter accepts the following options:
884 Set method to specify band-width of filter.
897 Specify the band-width of a filter in width_type units.
903 Merge two or more audio streams into a single multi-channel stream.
905 The filter accepts the following options:
910 Set the number of inputs. Default is 2.
914 If the channel layouts of the inputs are disjoint, and therefore compatible,
915 the channel layout of the output will be set accordingly and the channels
916 will be reordered as necessary. If the channel layouts of the inputs are not
917 disjoint, the output will have all the channels of the first input then all
918 the channels of the second input, in that order, and the channel layout of
919 the output will be the default value corresponding to the total number of
922 For example, if the first input is in 2.1 (FL+FR+LF) and the second input
923 is FC+BL+BR, then the output will be in 5.1, with the channels in the
924 following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
925 first input, b1 is the first channel of the second input).
927 On the other hand, if both input are in stereo, the output channels will be
928 in the default order: a1, a2, b1, b2, and the channel layout will be
929 arbitrarily set to 4.0, which may or may not be the expected value.
931 All inputs must have the same sample rate, and format.
933 If inputs do not have the same duration, the output will stop with the
940 Merge two mono files into a stereo stream:
942 amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
946 Multiple merges assuming 1 video stream and 6 audio streams in @file{input.mkv}:
948 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
954 Mixes multiple audio inputs into a single output.
956 Note that this filter only supports float samples (the @var{amerge}
957 and @var{pan} audio filters support many formats). If the @var{amix}
958 input has integer samples then @ref{aresample} will be automatically
959 inserted to perform the conversion to float samples.
963 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
965 will mix 3 input audio streams to a single output with the same duration as the
966 first input and a dropout transition time of 3 seconds.
968 It accepts the following parameters:
972 The number of inputs. If unspecified, it defaults to 2.
975 How to determine the end-of-stream.
979 The duration of the longest input. (default)
982 The duration of the shortest input.
985 The duration of the first input.
989 @item dropout_transition
990 The transition time, in seconds, for volume renormalization when an input
991 stream ends. The default value is 2 seconds.
997 High-order parametric multiband equalizer for each channel.
999 It accepts the following parameters:
1003 This option string is in format:
1004 "c@var{chn} f=@var{cf} w=@var{w} g=@var{g} t=@var{f} | ..."
1005 Each equalizer band is separated by '|'.
1009 Set channel number to which equalization will be applied.
1010 If input doesn't have that channel the entry is ignored.
1013 Set central frequency for band.
1014 If input doesn't have that frequency the entry is ignored.
1017 Set band width in hertz.
1020 Set band gain in dB.
1023 Set filter type for band, optional, can be:
1027 Butterworth, this is default.
1038 With this option activated frequency response of anequalizer is displayed
1042 Set video stream size. Only useful if curves option is activated.
1045 Set max gain that will be displayed. Only useful if curves option is activated.
1046 Setting this to reasonable value allows to display gain which is derived from
1047 neighbour bands which are too close to each other and thus produce higher gain
1048 when both are activated.
1051 Set frequency scale used to draw frequency response in video output.
1052 Can be linear or logarithmic. Default is logarithmic.
1055 Set color for each channel curve which is going to be displayed in video stream.
1056 This is list of color names separated by space or by '|'.
1057 Unrecognised or missing colors will be replaced by white color.
1060 @subsection Examples
1064 Lower gain by 10 of central frequency 200Hz and width 100 Hz
1065 for first 2 channels using Chebyshev type 1 filter:
1067 anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
1071 @subsection Commands
1073 This filter supports the following commands:
1076 Alter existing filter parameters.
1077 Syntax for the commands is : "@var{fN}|f=@var{freq}|w=@var{width}|g=@var{gain}"
1079 @var{fN} is existing filter number, starting from 0, if no such filter is available
1081 @var{freq} set new frequency parameter.
1082 @var{width} set new width parameter in herz.
1083 @var{gain} set new gain parameter in dB.
1085 Full filter invocation with asendcmd may look like this:
1086 asendcmd=c='4.0 anequalizer change 0|f=200|w=50|g=1',anequalizer=...
1091 Pass the audio source unchanged to the output.
1095 Pad the end of an audio stream with silence.
1097 This can be used together with @command{ffmpeg} @option{-shortest} to
1098 extend audio streams to the same length as the video stream.
1100 A description of the accepted options follows.
1104 Set silence packet size. Default value is 4096.
1107 Set the number of samples of silence to add to the end. After the
1108 value is reached, the stream is terminated. This option is mutually
1109 exclusive with @option{whole_len}.
1112 Set the minimum total number of samples in the output audio stream. If
1113 the value is longer than the input audio length, silence is added to
1114 the end, until the value is reached. This option is mutually exclusive
1115 with @option{pad_len}.
1118 If neither the @option{pad_len} nor the @option{whole_len} option is
1119 set, the filter will add silence to the end of the input stream
1122 @subsection Examples
1126 Add 1024 samples of silence to the end of the input:
1132 Make sure the audio output will contain at least 10000 samples, pad
1133 the input with silence if required:
1135 apad=whole_len=10000
1139 Use @command{ffmpeg} to pad the audio input with silence, so that the
1140 video stream will always result the shortest and will be converted
1141 until the end in the output file when using the @option{shortest}
1144 ffmpeg -i VIDEO -i AUDIO -filter_complex "[1:0]apad" -shortest OUTPUT
1149 Add a phasing effect to the input audio.
1151 A phaser filter creates series of peaks and troughs in the frequency spectrum.
1152 The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
1154 A description of the accepted parameters follows.
1158 Set input gain. Default is 0.4.
1161 Set output gain. Default is 0.74
1164 Set delay in milliseconds. Default is 3.0.
1167 Set decay. Default is 0.4.
1170 Set modulation speed in Hz. Default is 0.5.
1173 Set modulation type. Default is triangular.
1175 It accepts the following values:
1184 Audio pulsator is something between an autopanner and a tremolo.
1185 But it can produce funny stereo effects as well. Pulsator changes the volume
1186 of the left and right channel based on a LFO (low frequency oscillator) with
1187 different waveforms and shifted phases.
1188 This filter have the ability to define an offset between left and right
1189 channel. An offset of 0 means that both LFO shapes match each other.
1190 The left and right channel are altered equally - a conventional tremolo.
1191 An offset of 50% means that the shape of the right channel is exactly shifted
1192 in phase (or moved backwards about half of the frequency) - pulsator acts as
1193 an autopanner. At 1 both curves match again. Every setting in between moves the
1194 phase shift gapless between all stages and produces some "bypassing" sounds with
1195 sine and triangle waveforms. The more you set the offset near 1 (starting from
1196 the 0.5) the faster the signal passes from the left to the right speaker.
1198 The filter accepts the following options:
1202 Set input gain. By default it is 1. Range is [0.015625 - 64].
1205 Set output gain. By default it is 1. Range is [0.015625 - 64].
1208 Set waveform shape the LFO will use. Can be one of: sine, triangle, square,
1209 sawup or sawdown. Default is sine.
1212 Set modulation. Define how much of original signal is affected by the LFO.
1215 Set left channel offset. Default is 0. Allowed range is [0 - 1].
1218 Set right channel offset. Default is 0.5. Allowed range is [0 - 1].
1221 Set pulse width. Default is 1. Allowed range is [0 - 2].
1224 Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz.
1227 Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing
1231 Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing
1235 Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used
1236 if timing is set to hz.
1242 Resample the input audio to the specified parameters, using the
1243 libswresample library. If none are specified then the filter will
1244 automatically convert between its input and output.
1246 This filter is also able to stretch/squeeze the audio data to make it match
1247 the timestamps or to inject silence / cut out audio to make it match the
1248 timestamps, do a combination of both or do neither.
1250 The filter accepts the syntax
1251 [@var{sample_rate}:]@var{resampler_options}, where @var{sample_rate}
1252 expresses a sample rate and @var{resampler_options} is a list of
1253 @var{key}=@var{value} pairs, separated by ":". See the
1254 ffmpeg-resampler manual for the complete list of supported options.
1256 @subsection Examples
1260 Resample the input audio to 44100Hz:
1266 Stretch/squeeze samples to the given timestamps, with a maximum of 1000
1267 samples per second compensation:
1269 aresample=async=1000
1273 @section asetnsamples
1275 Set the number of samples per each output audio frame.
1277 The last output packet may contain a different number of samples, as
1278 the filter will flush all the remaining samples when the input audio
1281 The filter accepts the following options:
1285 @item nb_out_samples, n
1286 Set the number of frames per each output audio frame. The number is
1287 intended as the number of samples @emph{per each channel}.
1288 Default value is 1024.
1291 If set to 1, the filter will pad the last audio frame with zeroes, so
1292 that the last frame will contain the same number of samples as the
1293 previous ones. Default value is 1.
1296 For example, to set the number of per-frame samples to 1234 and
1297 disable padding for the last frame, use:
1299 asetnsamples=n=1234:p=0
1304 Set the sample rate without altering the PCM data.
1305 This will result in a change of speed and pitch.
1307 The filter accepts the following options:
1310 @item sample_rate, r
1311 Set the output sample rate. Default is 44100 Hz.
1316 Show a line containing various information for each input audio frame.
1317 The input audio is not modified.
1319 The shown line contains a sequence of key/value pairs of the form
1320 @var{key}:@var{value}.
1322 The following values are shown in the output:
1326 The (sequential) number of the input frame, starting from 0.
1329 The presentation timestamp of the input frame, in time base units; the time base
1330 depends on the filter input pad, and is usually 1/@var{sample_rate}.
1333 The presentation timestamp of the input frame in seconds.
1336 position of the frame in the input stream, -1 if this information in
1337 unavailable and/or meaningless (for example in case of synthetic audio)
1346 The sample rate for the audio frame.
1349 The number of samples (per channel) in the frame.
1352 The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar
1353 audio, the data is treated as if all the planes were concatenated.
1355 @item plane_checksums
1356 A list of Adler-32 checksums for each data plane.
1362 Display time domain statistical information about the audio channels.
1363 Statistics are calculated and displayed for each audio channel and,
1364 where applicable, an overall figure is also given.
1366 It accepts the following option:
1369 Short window length in seconds, used for peak and trough RMS measurement.
1370 Default is @code{0.05} (50 milliseconds). Allowed range is @code{[0.1 - 10]}.
1374 Set metadata injection. All the metadata keys are prefixed with @code{lavfi.astats.X},
1375 where @code{X} is channel number starting from 1 or string @code{Overall}. Default is
1378 Available keys for each channel are:
1409 For example full key look like this @code{lavfi.astats.1.DC_offset} or
1410 this @code{lavfi.astats.Overall.Peak_count}.
1412 For description what each key means read below.
1415 Set number of frame after which stats are going to be recalculated.
1416 Default is disabled.
1419 A description of each shown parameter follows:
1423 Mean amplitude displacement from zero.
1426 Minimal sample level.
1429 Maximal sample level.
1431 @item Min difference
1432 Minimal difference between two consecutive samples.
1434 @item Max difference
1435 Maximal difference between two consecutive samples.
1437 @item Mean difference
1438 Mean difference between two consecutive samples.
1439 The average of each difference between two consecutive samples.
1443 Standard peak and RMS level measured in dBFS.
1447 Peak and trough values for RMS level measured over a short window.
1450 Standard ratio of peak to RMS level (note: not in dB).
1453 Flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
1454 (i.e. either @var{Min level} or @var{Max level}).
1457 Number of occasions (not the number of samples) that the signal attained either
1458 @var{Min level} or @var{Max level}.
1461 Overall bit depth of audio. Number of bits used for each sample.
1466 Synchronize audio data with timestamps by squeezing/stretching it and/or
1467 dropping samples/adding silence when needed.
1469 This filter is not built by default, please use @ref{aresample} to do squeezing/stretching.
1471 It accepts the following parameters:
1475 Enable stretching/squeezing the data to make it match the timestamps. Disabled
1476 by default. When disabled, time gaps are covered with silence.
1479 The minimum difference between timestamps and audio data (in seconds) to trigger
1480 adding/dropping samples. The default value is 0.1. If you get an imperfect
1481 sync with this filter, try setting this parameter to 0.
1484 The maximum compensation in samples per second. Only relevant with compensate=1.
1485 The default value is 500.
1488 Assume that the first PTS should be this value. The time base is 1 / sample
1489 rate. This allows for padding/trimming at the start of the stream. By default,
1490 no assumption is made about the first frame's expected PTS, so no padding or
1491 trimming is done. For example, this could be set to 0 to pad the beginning with
1492 silence if an audio stream starts after the video stream or to trim any samples
1493 with a negative PTS due to encoder delay.
1501 The filter accepts exactly one parameter, the audio tempo. If not
1502 specified then the filter will assume nominal 1.0 tempo. Tempo must
1503 be in the [0.5, 2.0] range.
1505 @subsection Examples
1509 Slow down audio to 80% tempo:
1515 To speed up audio to 125% tempo:
1523 Trim the input so that the output contains one continuous subpart of the input.
1525 It accepts the following parameters:
1528 Timestamp (in seconds) of the start of the section to keep. I.e. the audio
1529 sample with the timestamp @var{start} will be the first sample in the output.
1532 Specify time of the first audio sample that will be dropped, i.e. the
1533 audio sample immediately preceding the one with the timestamp @var{end} will be
1534 the last sample in the output.
1537 Same as @var{start}, except this option sets the start timestamp in samples
1541 Same as @var{end}, except this option sets the end timestamp in samples instead
1545 The maximum duration of the output in seconds.
1548 The number of the first sample that should be output.
1551 The number of the first sample that should be dropped.
1554 @option{start}, @option{end}, and @option{duration} are expressed as time
1555 duration specifications; see
1556 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
1558 Note that the first two sets of the start/end options and the @option{duration}
1559 option look at the frame timestamp, while the _sample options simply count the
1560 samples that pass through the filter. So start/end_pts and start/end_sample will
1561 give different results when the timestamps are wrong, inexact or do not start at
1562 zero. Also note that this filter does not modify the timestamps. If you wish
1563 to have the output timestamps start at zero, insert the asetpts filter after the
1566 If multiple start or end options are set, this filter tries to be greedy and
1567 keep all samples that match at least one of the specified constraints. To keep
1568 only the part that matches all the constraints at once, chain multiple atrim
1571 The defaults are such that all the input is kept. So it is possible to set e.g.
1572 just the end values to keep everything before the specified time.
1577 Drop everything except the second minute of input:
1579 ffmpeg -i INPUT -af atrim=60:120
1583 Keep only the first 1000 samples:
1585 ffmpeg -i INPUT -af atrim=end_sample=1000
1592 Apply a two-pole Butterworth band-pass filter with central
1593 frequency @var{frequency}, and (3dB-point) band-width width.
1594 The @var{csg} option selects a constant skirt gain (peak gain = Q)
1595 instead of the default: constant 0dB peak gain.
1596 The filter roll off at 6dB per octave (20dB per decade).
1598 The filter accepts the following options:
1602 Set the filter's central frequency. Default is @code{3000}.
1605 Constant skirt gain if set to 1. Defaults to 0.
1608 Set method to specify band-width of filter.
1621 Specify the band-width of a filter in width_type units.
1626 Apply a two-pole Butterworth band-reject filter with central
1627 frequency @var{frequency}, and (3dB-point) band-width @var{width}.
1628 The filter roll off at 6dB per octave (20dB per decade).
1630 The filter accepts the following options:
1634 Set the filter's central frequency. Default is @code{3000}.
1637 Set method to specify band-width of filter.
1650 Specify the band-width of a filter in width_type units.
1655 Boost or cut the bass (lower) frequencies of the audio using a two-pole
1656 shelving filter with a response similar to that of a standard
1657 hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
1659 The filter accepts the following options:
1663 Give the gain at 0 Hz. Its useful range is about -20
1664 (for a large cut) to +20 (for a large boost).
1665 Beware of clipping when using a positive gain.
1668 Set the filter's central frequency and so can be used
1669 to extend or reduce the frequency range to be boosted or cut.
1670 The default value is @code{100} Hz.
1673 Set method to specify band-width of filter.
1686 Determine how steep is the filter's shelf transition.
1691 Apply a biquad IIR filter with the given coefficients.
1692 Where @var{b0}, @var{b1}, @var{b2} and @var{a0}, @var{a1}, @var{a2}
1693 are the numerator and denominator coefficients respectively.
1696 Bauer stereo to binaural transformation, which improves headphone listening of
1697 stereo audio records.
1699 It accepts the following parameters:
1703 Pre-defined crossfeed level.
1707 Default level (fcut=700, feed=50).
1710 Chu Moy circuit (fcut=700, feed=60).
1713 Jan Meier circuit (fcut=650, feed=95).
1718 Cut frequency (in Hz).
1727 Remap input channels to new locations.
1729 It accepts the following parameters:
1731 @item channel_layout
1732 The channel layout of the output stream.
1735 Map channels from input to output. The argument is a '|'-separated list of
1736 mappings, each in the @code{@var{in_channel}-@var{out_channel}} or
1737 @var{in_channel} form. @var{in_channel} can be either the name of the input
1738 channel (e.g. FL for front left) or its index in the input channel layout.
1739 @var{out_channel} is the name of the output channel or its index in the output
1740 channel layout. If @var{out_channel} is not given then it is implicitly an
1741 index, starting with zero and increasing by one for each mapping.
1744 If no mapping is present, the filter will implicitly map input channels to
1745 output channels, preserving indices.
1747 For example, assuming a 5.1+downmix input MOV file,
1749 ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
1751 will create an output WAV file tagged as stereo from the downmix channels of
1754 To fix a 5.1 WAV improperly encoded in AAC's native channel order
1756 ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
1759 @section channelsplit
1761 Split each channel from an input audio stream into a separate output stream.
1763 It accepts the following parameters:
1765 @item channel_layout
1766 The channel layout of the input stream. The default is "stereo".
1769 For example, assuming a stereo input MP3 file,
1771 ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
1773 will create an output Matroska file with two audio streams, one containing only
1774 the left channel and the other the right channel.
1776 Split a 5.1 WAV file into per-channel files:
1778 ffmpeg -i in.wav -filter_complex
1779 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
1780 -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
1781 front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
1786 Add a chorus effect to the audio.
1788 Can make a single vocal sound like a chorus, but can also be applied to instrumentation.
1790 Chorus resembles an echo effect with a short delay, but whereas with echo the delay is
1791 constant, with chorus, it is varied using using sinusoidal or triangular modulation.
1792 The modulation depth defines the range the modulated delay is played before or after
1793 the delay. Hence the delayed sound will sound slower or faster, that is the delayed
1794 sound tuned around the original one, like in a chorus where some vocals are slightly
1797 It accepts the following parameters:
1800 Set input gain. Default is 0.4.
1803 Set output gain. Default is 0.4.
1806 Set delays. A typical delay is around 40ms to 60ms.
1818 @subsection Examples
1824 chorus=0.7:0.9:55:0.4:0.25:2
1830 chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
1834 Fuller sounding chorus with three delays:
1836 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
1841 Compress or expand the audio's dynamic range.
1843 It accepts the following parameters:
1849 A list of times in seconds for each channel over which the instantaneous level
1850 of the input signal is averaged to determine its volume. @var{attacks} refers to
1851 increase of volume and @var{decays} refers to decrease of volume. For most
1852 situations, the attack time (response to the audio getting louder) should be
1853 shorter than the decay time, because the human ear is more sensitive to sudden
1854 loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
1855 a typical value for decay is 0.8 seconds.
1856 If specified number of attacks & decays is lower than number of channels, the last
1857 set attack/decay will be used for all remaining channels.
1860 A list of points for the transfer function, specified in dB relative to the
1861 maximum possible signal amplitude. Each key points list must be defined using
1862 the following syntax: @code{x0/y0|x1/y1|x2/y2|....} or
1863 @code{x0/y0 x1/y1 x2/y2 ....}
1865 The input values must be in strictly increasing order but the transfer function
1866 does not have to be monotonically rising. The point @code{0/0} is assumed but
1867 may be overridden (by @code{0/out-dBn}). Typical values for the transfer
1868 function are @code{-70/-70|-60/-20}.
1871 Set the curve radius in dB for all joints. It defaults to 0.01.
1874 Set the additional gain in dB to be applied at all points on the transfer
1875 function. This allows for easy adjustment of the overall gain.
1879 Set an initial volume, in dB, to be assumed for each channel when filtering
1880 starts. This permits the user to supply a nominal level initially, so that, for
1881 example, a very large gain is not applied to initial signal levels before the
1882 companding has begun to operate. A typical value for audio which is initially
1883 quiet is -90 dB. It defaults to 0.
1886 Set a delay, in seconds. The input audio is analyzed immediately, but audio is
1887 delayed before being fed to the volume adjuster. Specifying a delay
1888 approximately equal to the attack/decay times allows the filter to effectively
1889 operate in predictive rather than reactive mode. It defaults to 0.
1893 @subsection Examples
1897 Make music with both quiet and loud passages suitable for listening to in a
1900 compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
1903 Another example for audio with whisper and explosion parts:
1905 compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
1909 A noise gate for when the noise is at a lower level than the signal:
1911 compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
1915 Here is another noise gate, this time for when the noise is at a higher level
1916 than the signal (making it, in some ways, similar to squelch):
1918 compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
1922 2:1 compression starting at -6dB:
1924 compand=points=-80/-80|-6/-6|0/-3.8|20/3.5
1928 2:1 compression starting at -9dB:
1930 compand=points=-80/-80|-9/-9|0/-5.3|20/2.9
1934 2:1 compression starting at -12dB:
1936 compand=points=-80/-80|-12/-12|0/-6.8|20/1.9
1940 2:1 compression starting at -18dB:
1942 compand=points=-80/-80|-18/-18|0/-9.8|20/0.7
1946 3:1 compression starting at -15dB:
1948 compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2
1954 compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
1960 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
1964 Hard limiter at -6dB:
1966 compand=attacks=0:points=-80/-80|-6/-6|20/-6
1970 Hard limiter at -12dB:
1972 compand=attacks=0:points=-80/-80|-12/-12|20/-12
1976 Hard noise gate at -35 dB:
1978 compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20
1984 compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
1988 @section compensationdelay
1990 Compensation Delay Line is a metric based delay to compensate differing
1991 positions of microphones or speakers.
1993 For example, you have recorded guitar with two microphones placed in
1994 different location. Because the front of sound wave has fixed speed in
1995 normal conditions, the phasing of microphones can vary and depends on
1996 their location and interposition. The best sound mix can be achieved when
1997 these microphones are in phase (synchronized). Note that distance of
1998 ~30 cm between microphones makes one microphone to capture signal in
1999 antiphase to another microphone. That makes the final mix sounding moody.
2000 This filter helps to solve phasing problems by adding different delays
2001 to each microphone track and make them synchronized.
2003 The best result can be reached when you take one track as base and
2004 synchronize other tracks one by one with it.
2005 Remember that synchronization/delay tolerance depends on sample rate, too.
2006 Higher sample rates will give more tolerance.
2008 It accepts the following parameters:
2012 Set millimeters distance. This is compensation distance for fine tuning.
2016 Set cm distance. This is compensation distance for tightening distance setup.
2020 Set meters distance. This is compensation distance for hard distance setup.
2024 Set dry amount. Amount of unprocessed (dry) signal.
2028 Set wet amount. Amount of processed (wet) signal.
2032 Set temperature degree in Celsius. This is the temperature of the environment.
2037 Apply a DC shift to the audio.
2039 This can be useful to remove a DC offset (caused perhaps by a hardware problem
2040 in the recording chain) from the audio. The effect of a DC offset is reduced
2041 headroom and hence volume. The @ref{astats} filter can be used to determine if
2042 a signal has a DC offset.
2046 Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift
2050 Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is
2051 used to prevent clipping.
2055 Dynamic Audio Normalizer.
2057 This filter applies a certain amount of gain to the input audio in order
2058 to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in
2059 contrast to more "simple" normalization algorithms, the Dynamic Audio
2060 Normalizer *dynamically* re-adjusts the gain factor to the input audio.
2061 This allows for applying extra gain to the "quiet" sections of the audio
2062 while avoiding distortions or clipping the "loud" sections. In other words:
2063 The Dynamic Audio Normalizer will "even out" the volume of quiet and loud
2064 sections, in the sense that the volume of each section is brought to the
2065 same target level. Note, however, that the Dynamic Audio Normalizer achieves
2066 this goal *without* applying "dynamic range compressing". It will retain 100%
2067 of the dynamic range *within* each section of the audio file.
2071 Set the frame length in milliseconds. In range from 10 to 8000 milliseconds.
2072 Default is 500 milliseconds.
2073 The Dynamic Audio Normalizer processes the input audio in small chunks,
2074 referred to as frames. This is required, because a peak magnitude has no
2075 meaning for just a single sample value. Instead, we need to determine the
2076 peak magnitude for a contiguous sequence of sample values. While a "standard"
2077 normalizer would simply use the peak magnitude of the complete file, the
2078 Dynamic Audio Normalizer determines the peak magnitude individually for each
2079 frame. The length of a frame is specified in milliseconds. By default, the
2080 Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has
2081 been found to give good results with most files.
2082 Note that the exact frame length, in number of samples, will be determined
2083 automatically, based on the sampling rate of the individual input audio file.
2086 Set the Gaussian filter window size. In range from 3 to 301, must be odd
2087 number. Default is 31.
2088 Probably the most important parameter of the Dynamic Audio Normalizer is the
2089 @code{window size} of the Gaussian smoothing filter. The filter's window size
2090 is specified in frames, centered around the current frame. For the sake of
2091 simplicity, this must be an odd number. Consequently, the default value of 31
2092 takes into account the current frame, as well as the 15 preceding frames and
2093 the 15 subsequent frames. Using a larger window results in a stronger
2094 smoothing effect and thus in less gain variation, i.e. slower gain
2095 adaptation. Conversely, using a smaller window results in a weaker smoothing
2096 effect and thus in more gain variation, i.e. faster gain adaptation.
2097 In other words, the more you increase this value, the more the Dynamic Audio
2098 Normalizer will behave like a "traditional" normalization filter. On the
2099 contrary, the more you decrease this value, the more the Dynamic Audio
2100 Normalizer will behave like a dynamic range compressor.
2103 Set the target peak value. This specifies the highest permissible magnitude
2104 level for the normalized audio input. This filter will try to approach the
2105 target peak magnitude as closely as possible, but at the same time it also
2106 makes sure that the normalized signal will never exceed the peak magnitude.
2107 A frame's maximum local gain factor is imposed directly by the target peak
2108 magnitude. The default value is 0.95 and thus leaves a headroom of 5%*.
2109 It is not recommended to go above this value.
2112 Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0.
2113 The Dynamic Audio Normalizer determines the maximum possible (local) gain
2114 factor for each input frame, i.e. the maximum gain factor that does not
2115 result in clipping or distortion. The maximum gain factor is determined by
2116 the frame's highest magnitude sample. However, the Dynamic Audio Normalizer
2117 additionally bounds the frame's maximum gain factor by a predetermined
2118 (global) maximum gain factor. This is done in order to avoid excessive gain
2119 factors in "silent" or almost silent frames. By default, the maximum gain
2120 factor is 10.0, For most inputs the default value should be sufficient and
2121 it usually is not recommended to increase this value. Though, for input
2122 with an extremely low overall volume level, it may be necessary to allow even
2123 higher gain factors. Note, however, that the Dynamic Audio Normalizer does
2124 not simply apply a "hard" threshold (i.e. cut off values above the threshold).
2125 Instead, a "sigmoid" threshold function will be applied. This way, the
2126 gain factors will smoothly approach the threshold value, but never exceed that
2130 Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled.
2131 By default, the Dynamic Audio Normalizer performs "peak" normalization.
2132 This means that the maximum local gain factor for each frame is defined
2133 (only) by the frame's highest magnitude sample. This way, the samples can
2134 be amplified as much as possible without exceeding the maximum signal
2135 level, i.e. without clipping. Optionally, however, the Dynamic Audio
2136 Normalizer can also take into account the frame's root mean square,
2137 abbreviated RMS. In electrical engineering, the RMS is commonly used to
2138 determine the power of a time-varying signal. It is therefore considered
2139 that the RMS is a better approximation of the "perceived loudness" than
2140 just looking at the signal's peak magnitude. Consequently, by adjusting all
2141 frames to a constant RMS value, a uniform "perceived loudness" can be
2142 established. If a target RMS value has been specified, a frame's local gain
2143 factor is defined as the factor that would result in exactly that RMS value.
2144 Note, however, that the maximum local gain factor is still restricted by the
2145 frame's highest magnitude sample, in order to prevent clipping.
2148 Enable channels coupling. By default is enabled.
2149 By default, the Dynamic Audio Normalizer will amplify all channels by the same
2150 amount. This means the same gain factor will be applied to all channels, i.e.
2151 the maximum possible gain factor is determined by the "loudest" channel.
2152 However, in some recordings, it may happen that the volume of the different
2153 channels is uneven, e.g. one channel may be "quieter" than the other one(s).
2154 In this case, this option can be used to disable the channel coupling. This way,
2155 the gain factor will be determined independently for each channel, depending
2156 only on the individual channel's highest magnitude sample. This allows for
2157 harmonizing the volume of the different channels.
2160 Enable DC bias correction. By default is disabled.
2161 An audio signal (in the time domain) is a sequence of sample values.
2162 In the Dynamic Audio Normalizer these sample values are represented in the
2163 -1.0 to 1.0 range, regardless of the original input format. Normally, the
2164 audio signal, or "waveform", should be centered around the zero point.
2165 That means if we calculate the mean value of all samples in a file, or in a
2166 single frame, then the result should be 0.0 or at least very close to that
2167 value. If, however, there is a significant deviation of the mean value from
2168 0.0, in either positive or negative direction, this is referred to as a
2169 DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic
2170 Audio Normalizer provides optional DC bias correction.
2171 With DC bias correction enabled, the Dynamic Audio Normalizer will determine
2172 the mean value, or "DC correction" offset, of each input frame and subtract
2173 that value from all of the frame's sample values which ensures those samples
2174 are centered around 0.0 again. Also, in order to avoid "gaps" at the frame
2175 boundaries, the DC correction offset values will be interpolated smoothly
2176 between neighbouring frames.
2179 Enable alternative boundary mode. By default is disabled.
2180 The Dynamic Audio Normalizer takes into account a certain neighbourhood
2181 around each frame. This includes the preceding frames as well as the
2182 subsequent frames. However, for the "boundary" frames, located at the very
2183 beginning and at the very end of the audio file, not all neighbouring
2184 frames are available. In particular, for the first few frames in the audio
2185 file, the preceding frames are not known. And, similarly, for the last few
2186 frames in the audio file, the subsequent frames are not known. Thus, the
2187 question arises which gain factors should be assumed for the missing frames
2188 in the "boundary" region. The Dynamic Audio Normalizer implements two modes
2189 to deal with this situation. The default boundary mode assumes a gain factor
2190 of exactly 1.0 for the missing frames, resulting in a smooth "fade in" and
2191 "fade out" at the beginning and at the end of the input, respectively.
2194 Set the compress factor. In range from 0.0 to 30.0. Default is 0.0.
2195 By default, the Dynamic Audio Normalizer does not apply "traditional"
2196 compression. This means that signal peaks will not be pruned and thus the
2197 full dynamic range will be retained within each local neighbourhood. However,
2198 in some cases it may be desirable to combine the Dynamic Audio Normalizer's
2199 normalization algorithm with a more "traditional" compression.
2200 For this purpose, the Dynamic Audio Normalizer provides an optional compression
2201 (thresholding) function. If (and only if) the compression feature is enabled,
2202 all input frames will be processed by a soft knee thresholding function prior
2203 to the actual normalization process. Put simply, the thresholding function is
2204 going to prune all samples whose magnitude exceeds a certain threshold value.
2205 However, the Dynamic Audio Normalizer does not simply apply a fixed threshold
2206 value. Instead, the threshold value will be adjusted for each individual
2208 In general, smaller parameters result in stronger compression, and vice versa.
2209 Values below 3.0 are not recommended, because audible distortion may appear.
2214 Make audio easier to listen to on headphones.
2216 This filter adds `cues' to 44.1kHz stereo (i.e. audio CD format) audio
2217 so that when listened to on headphones the stereo image is moved from
2218 inside your head (standard for headphones) to outside and in front of
2219 the listener (standard for speakers).
2225 Apply a two-pole peaking equalisation (EQ) filter. With this
2226 filter, the signal-level at and around a selected frequency can
2227 be increased or decreased, whilst (unlike bandpass and bandreject
2228 filters) that at all other frequencies is unchanged.
2230 In order to produce complex equalisation curves, this filter can
2231 be given several times, each with a different central frequency.
2233 The filter accepts the following options:
2237 Set the filter's central frequency in Hz.
2240 Set method to specify band-width of filter.
2253 Specify the band-width of a filter in width_type units.
2256 Set the required gain or attenuation in dB.
2257 Beware of clipping when using a positive gain.
2260 @subsection Examples
2263 Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
2265 equalizer=f=1000:width_type=h:width=200:g=-10
2269 Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2:
2271 equalizer=f=1000:width_type=q:width=1:g=2,equalizer=f=100:width_type=q:width=2:g=-5
2275 @section extrastereo
2277 Linearly increases the difference between left and right channels which
2278 adds some sort of "live" effect to playback.
2280 The filter accepts the following option:
2284 Sets the difference coefficient (default: 2.5). 0.0 means mono sound
2285 (average of both channels), with 1.0 sound will be unchanged, with
2286 -1.0 left and right channels will be swapped.
2289 Enable clipping. By default is enabled.
2293 Apply a flanging effect to the audio.
2295 The filter accepts the following options:
2299 Set base delay in milliseconds. Range from 0 to 30. Default value is 0.
2302 Set added swep delay in milliseconds. Range from 0 to 10. Default value is 2.
2305 Set percentage regeneration (delayed signal feedback). Range from -95 to 95.
2309 Set percentage of delayed signal mixed with original. Range from 0 to 100.
2310 Default value is 71.
2313 Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5.
2316 Set swept wave shape, can be @var{triangular} or @var{sinusoidal}.
2317 Default value is @var{sinusoidal}.
2320 Set swept wave percentage-shift for multi channel. Range from 0 to 100.
2321 Default value is 25.
2324 Set delay-line interpolation, @var{linear} or @var{quadratic}.
2325 Default is @var{linear}.
2330 Apply a high-pass filter with 3dB point frequency.
2331 The filter can be either single-pole, or double-pole (the default).
2332 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
2334 The filter accepts the following options:
2338 Set frequency in Hz. Default is 3000.
2341 Set number of poles. Default is 2.
2344 Set method to specify band-width of filter.
2357 Specify the band-width of a filter in width_type units.
2358 Applies only to double-pole filter.
2359 The default is 0.707q and gives a Butterworth response.
2364 Join multiple input streams into one multi-channel stream.
2366 It accepts the following parameters:
2370 The number of input streams. It defaults to 2.
2372 @item channel_layout
2373 The desired output channel layout. It defaults to stereo.
2376 Map channels from inputs to output. The argument is a '|'-separated list of
2377 mappings, each in the @code{@var{input_idx}.@var{in_channel}-@var{out_channel}}
2378 form. @var{input_idx} is the 0-based index of the input stream. @var{in_channel}
2379 can be either the name of the input channel (e.g. FL for front left) or its
2380 index in the specified input stream. @var{out_channel} is the name of the output
2384 The filter will attempt to guess the mappings when they are not specified
2385 explicitly. It does so by first trying to find an unused matching input channel
2386 and if that fails it picks the first unused input channel.
2388 Join 3 inputs (with properly set channel layouts):
2390 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
2393 Build a 5.1 output from 6 single-channel streams:
2395 ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
2396 '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'
2402 Load a LADSPA (Linux Audio Developer's Simple Plugin API) plugin.
2404 To enable compilation of this filter you need to configure FFmpeg with
2405 @code{--enable-ladspa}.
2409 Specifies the name of LADSPA plugin library to load. If the environment
2410 variable @env{LADSPA_PATH} is defined, the LADSPA plugin is searched in
2411 each one of the directories specified by the colon separated list in
2412 @env{LADSPA_PATH}, otherwise in the standard LADSPA paths, which are in
2413 this order: @file{HOME/.ladspa/lib/}, @file{/usr/local/lib/ladspa/},
2414 @file{/usr/lib/ladspa/}.
2417 Specifies the plugin within the library. Some libraries contain only
2418 one plugin, but others contain many of them. If this is not set filter
2419 will list all available plugins within the specified library.
2422 Set the '|' separated list of controls which are zero or more floating point
2423 values that determine the behavior of the loaded plugin (for example delay,
2425 Controls need to be defined using the following syntax:
2426 c0=@var{value0}|c1=@var{value1}|c2=@var{value2}|..., where
2427 @var{valuei} is the value set on the @var{i}-th control.
2428 Alternatively they can be also defined using the following syntax:
2429 @var{value0}|@var{value1}|@var{value2}|..., where
2430 @var{valuei} is the value set on the @var{i}-th control.
2431 If @option{controls} is set to @code{help}, all available controls and
2432 their valid ranges are printed.
2434 @item sample_rate, s
2435 Specify the sample rate, default to 44100. Only used if plugin have
2439 Set the number of samples per channel per each output frame, default
2440 is 1024. Only used if plugin have zero inputs.
2443 Set the minimum duration of the sourced audio. See
2444 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
2445 for the accepted syntax.
2446 Note that the resulting duration may be greater than the specified duration,
2447 as the generated audio is always cut at the end of a complete frame.
2448 If not specified, or the expressed duration is negative, the audio is
2449 supposed to be generated forever.
2450 Only used if plugin have zero inputs.
2454 @subsection Examples
2458 List all available plugins within amp (LADSPA example plugin) library:
2464 List all available controls and their valid ranges for @code{vcf_notch}
2465 plugin from @code{VCF} library:
2467 ladspa=f=vcf:p=vcf_notch:c=help
2471 Simulate low quality audio equipment using @code{Computer Music Toolkit} (CMT)
2474 ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
2478 Add reverberation to the audio using TAP-plugins
2479 (Tom's Audio Processing plugins):
2481 ladspa=file=tap_reverb:tap_reverb
2485 Generate white noise, with 0.2 amplitude:
2487 ladspa=file=cmt:noise_source_white:c=c0=.2
2491 Generate 20 bpm clicks using plugin @code{C* Click - Metronome} from the
2492 @code{C* Audio Plugin Suite} (CAPS) library:
2494 ladspa=file=caps:Click:c=c1=20'
2498 Apply @code{C* Eq10X2 - Stereo 10-band equaliser} effect:
2500 ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
2504 Increase volume by 20dB using fast lookahead limiter from Steve Harris
2505 @code{SWH Plugins} collection:
2507 ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
2511 Attenuate low frequencies using Multiband EQ from Steve Harris
2512 @code{SWH Plugins} collection:
2514 ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
2518 @subsection Commands
2520 This filter supports the following commands:
2523 Modify the @var{N}-th control value.
2525 If the specified value is not valid, it is ignored and prior one is kept.
2530 Apply a low-pass filter with 3dB point frequency.
2531 The filter can be either single-pole or double-pole (the default).
2532 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
2534 The filter accepts the following options:
2538 Set frequency in Hz. Default is 500.
2541 Set number of poles. Default is 2.
2544 Set method to specify band-width of filter.
2557 Specify the band-width of a filter in width_type units.
2558 Applies only to double-pole filter.
2559 The default is 0.707q and gives a Butterworth response.
2565 Mix channels with specific gain levels. The filter accepts the output
2566 channel layout followed by a set of channels definitions.
2568 This filter is also designed to efficiently remap the channels of an audio
2571 The filter accepts parameters of the form:
2572 "@var{l}|@var{outdef}|@var{outdef}|..."
2576 output channel layout or number of channels
2579 output channel specification, of the form:
2580 "@var{out_name}=[@var{gain}*]@var{in_name}[+[@var{gain}*]@var{in_name}...]"
2583 output channel to define, either a channel name (FL, FR, etc.) or a channel
2584 number (c0, c1, etc.)
2587 multiplicative coefficient for the channel, 1 leaving the volume unchanged
2590 input channel to use, see out_name for details; it is not possible to mix
2591 named and numbered input channels
2594 If the `=' in a channel specification is replaced by `<', then the gains for
2595 that specification will be renormalized so that the total is 1, thus
2596 avoiding clipping noise.
2598 @subsection Mixing examples
2600 For example, if you want to down-mix from stereo to mono, but with a bigger
2601 factor for the left channel:
2603 pan=1c|c0=0.9*c0+0.1*c1
2606 A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
2607 7-channels surround:
2609 pan=stereo| FL < FL + 0.5*FC + 0.6*BL + 0.6*SL | FR < FR + 0.5*FC + 0.6*BR + 0.6*SR
2612 Note that @command{ffmpeg} integrates a default down-mix (and up-mix) system
2613 that should be preferred (see "-ac" option) unless you have very specific
2616 @subsection Remapping examples
2618 The channel remapping will be effective if, and only if:
2621 @item gain coefficients are zeroes or ones,
2622 @item only one input per channel output,
2625 If all these conditions are satisfied, the filter will notify the user ("Pure
2626 channel mapping detected"), and use an optimized and lossless method to do the
2629 For example, if you have a 5.1 source and want a stereo audio stream by
2630 dropping the extra channels:
2632 pan="stereo| c0=FL | c1=FR"
2635 Given the same source, you can also switch front left and front right channels
2636 and keep the input channel layout:
2638 pan="5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5"
2641 If the input is a stereo audio stream, you can mute the front left channel (and
2642 still keep the stereo channel layout) with:
2647 Still with a stereo audio stream input, you can copy the right channel in both
2648 front left and right:
2650 pan="stereo| c0=FR | c1=FR"
2655 ReplayGain scanner filter. This filter takes an audio stream as an input and
2656 outputs it unchanged.
2657 At end of filtering it displays @code{track_gain} and @code{track_peak}.
2661 Convert the audio sample format, sample rate and channel layout. It is
2662 not meant to be used directly.
2665 Apply time-stretching and pitch-shifting with librubberband.
2667 The filter accepts the following options:
2671 Set tempo scale factor.
2674 Set pitch scale factor.
2677 Set transients detector.
2678 Possible values are:
2687 Possible values are:
2696 Possible values are:
2703 Set processing window size.
2704 Possible values are:
2713 Possible values are:
2720 Enable formant preservation when shift pitching.
2721 Possible values are:
2729 Possible values are:
2738 Possible values are:
2745 @section sidechaincompress
2747 This filter acts like normal compressor but has the ability to compress
2748 detected signal using second input signal.
2749 It needs two input streams and returns one output stream.
2750 First input stream will be processed depending on second stream signal.
2751 The filtered signal then can be filtered with other filters in later stages of
2752 processing. See @ref{pan} and @ref{amerge} filter.
2754 The filter accepts the following options:
2758 Set input gain. Default is 1. Range is between 0.015625 and 64.
2761 If a signal of second stream raises above this level it will affect the gain
2762 reduction of first stream.
2763 By default is 0.125. Range is between 0.00097563 and 1.
2766 Set a ratio about which the signal is reduced. 1:2 means that if the level
2767 raised 4dB above the threshold, it will be only 2dB above after the reduction.
2768 Default is 2. Range is between 1 and 20.
2771 Amount of milliseconds the signal has to rise above the threshold before gain
2772 reduction starts. Default is 20. Range is between 0.01 and 2000.
2775 Amount of milliseconds the signal has to fall below the threshold before
2776 reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
2779 Set the amount by how much signal will be amplified after processing.
2780 Default is 2. Range is from 1 and 64.
2783 Curve the sharp knee around the threshold to enter gain reduction more softly.
2784 Default is 2.82843. Range is between 1 and 8.
2787 Choose if the @code{average} level between all channels of side-chain stream
2788 or the louder(@code{maximum}) channel of side-chain stream affects the
2789 reduction. Default is @code{average}.
2792 Should the exact signal be taken in case of @code{peak} or an RMS one in case
2793 of @code{rms}. Default is @code{rms} which is mainly smoother.
2796 Set sidechain gain. Default is 1. Range is between 0.015625 and 64.
2799 How much to use compressed signal in output. Default is 1.
2800 Range is between 0 and 1.
2803 @subsection Examples
2807 Full ffmpeg example taking 2 audio inputs, 1st input to be compressed
2808 depending on the signal of 2nd input and later compressed signal to be
2809 merged with 2nd input:
2811 ffmpeg -i main.flac -i sidechain.flac -filter_complex "[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress[compr];[compr][mix]amerge"
2815 @section sidechaingate
2817 A sidechain gate acts like a normal (wideband) gate but has the ability to
2818 filter the detected signal before sending it to the gain reduction stage.
2819 Normally a gate uses the full range signal to detect a level above the
2821 For example: If you cut all lower frequencies from your sidechain signal
2822 the gate will decrease the volume of your track only if not enough highs
2823 appear. With this technique you are able to reduce the resonation of a
2824 natural drum or remove "rumbling" of muted strokes from a heavily distorted
2826 It needs two input streams and returns one output stream.
2827 First input stream will be processed depending on second stream signal.
2829 The filter accepts the following options:
2833 Set input level before filtering.
2834 Default is 1. Allowed range is from 0.015625 to 64.
2837 Set the level of gain reduction when the signal is below the threshold.
2838 Default is 0.06125. Allowed range is from 0 to 1.
2841 If a signal rises above this level the gain reduction is released.
2842 Default is 0.125. Allowed range is from 0 to 1.
2845 Set a ratio about which the signal is reduced.
2846 Default is 2. Allowed range is from 1 to 9000.
2849 Amount of milliseconds the signal has to rise above the threshold before gain
2851 Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
2854 Amount of milliseconds the signal has to fall below the threshold before the
2855 reduction is increased again. Default is 250 milliseconds.
2856 Allowed range is from 0.01 to 9000.
2859 Set amount of amplification of signal after processing.
2860 Default is 1. Allowed range is from 1 to 64.
2863 Curve the sharp knee around the threshold to enter gain reduction more softly.
2864 Default is 2.828427125. Allowed range is from 1 to 8.
2867 Choose if exact signal should be taken for detection or an RMS like one.
2868 Default is rms. Can be peak or rms.
2871 Choose if the average level between all channels or the louder channel affects
2873 Default is average. Can be average or maximum.
2876 Set sidechain gain. Default is 1. Range is from 0.015625 to 64.
2879 @section silencedetect
2881 Detect silence in an audio stream.
2883 This filter logs a message when it detects that the input audio volume is less
2884 or equal to a noise tolerance value for a duration greater or equal to the
2885 minimum detected noise duration.
2887 The printed times and duration are expressed in seconds.
2889 The filter accepts the following options:
2893 Set silence duration until notification (default is 2 seconds).
2896 Set noise tolerance. Can be specified in dB (in case "dB" is appended to the
2897 specified value) or amplitude ratio. Default is -60dB, or 0.001.
2900 @subsection Examples
2904 Detect 5 seconds of silence with -50dB noise tolerance:
2906 silencedetect=n=-50dB:d=5
2910 Complete example with @command{ffmpeg} to detect silence with 0.0001 noise
2911 tolerance in @file{silence.mp3}:
2913 ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
2917 @section silenceremove
2919 Remove silence from the beginning, middle or end of the audio.
2921 The filter accepts the following options:
2925 This value is used to indicate if audio should be trimmed at beginning of
2926 the audio. A value of zero indicates no silence should be trimmed from the
2927 beginning. When specifying a non-zero value, it trims audio up until it
2928 finds non-silence. Normally, when trimming silence from beginning of audio
2929 the @var{start_periods} will be @code{1} but it can be increased to higher
2930 values to trim all audio up to specific count of non-silence periods.
2931 Default value is @code{0}.
2933 @item start_duration
2934 Specify the amount of time that non-silence must be detected before it stops
2935 trimming audio. By increasing the duration, bursts of noises can be treated
2936 as silence and trimmed off. Default value is @code{0}.
2938 @item start_threshold
2939 This indicates what sample value should be treated as silence. For digital
2940 audio, a value of @code{0} may be fine but for audio recorded from analog,
2941 you may wish to increase the value to account for background noise.
2942 Can be specified in dB (in case "dB" is appended to the specified value)
2943 or amplitude ratio. Default value is @code{0}.
2946 Set the count for trimming silence from the end of audio.
2947 To remove silence from the middle of a file, specify a @var{stop_periods}
2948 that is negative. This value is then treated as a positive value and is
2949 used to indicate the effect should restart processing as specified by
2950 @var{start_periods}, making it suitable for removing periods of silence
2951 in the middle of the audio.
2952 Default value is @code{0}.
2955 Specify a duration of silence that must exist before audio is not copied any
2956 more. By specifying a higher duration, silence that is wanted can be left in
2958 Default value is @code{0}.
2960 @item stop_threshold
2961 This is the same as @option{start_threshold} but for trimming silence from
2963 Can be specified in dB (in case "dB" is appended to the specified value)
2964 or amplitude ratio. Default value is @code{0}.
2967 This indicate that @var{stop_duration} length of audio should be left intact
2968 at the beginning of each period of silence.
2969 For example, if you want to remove long pauses between words but do not want
2970 to remove the pauses completely. Default value is @code{0}.
2974 @subsection Examples
2978 The following example shows how this filter can be used to start a recording
2979 that does not contain the delay at the start which usually occurs between
2980 pressing the record button and the start of the performance:
2982 silenceremove=1:5:0.02
2988 SOFAlizer uses head-related transfer functions (HRTFs) to create virtual
2989 loudspeakers around the user for binaural listening via headphones (audio
2990 formats up to 9 channels supported).
2991 The HRTFs are stored in SOFA files (see @url{http://www.sofacoustics.org/} for a database).
2992 SOFAlizer is developed at the Acoustics Research Institute (ARI) of the
2993 Austrian Academy of Sciences.
2995 To enable compilation of this filter you need to configure FFmpeg with
2996 @code{--enable-netcdf}.
2998 The filter accepts the following options:
3002 Set the SOFA file used for rendering.
3005 Set gain applied to audio. Value is in dB. Default is 0.
3008 Set rotation of virtual loudspeakers in deg. Default is 0.
3011 Set elevation of virtual speakers in deg. Default is 0.
3014 Set distance in meters between loudspeakers and the listener with near-field
3015 HRTFs. Default is 1.
3018 Set processing type. Can be @var{time} or @var{freq}. @var{time} is
3019 processing audio in time domain which is slow but gives high quality output.
3020 @var{freq} is processing audio in frequency domain which is fast but gives
3021 mediocre output. Default is @var{freq}.
3024 @section stereotools
3026 This filter has some handy utilities to manage stereo signals, for converting
3027 M/S stereo recordings to L/R signal while having control over the parameters
3028 or spreading the stereo image of master track.
3030 The filter accepts the following options:
3034 Set input level before filtering for both channels. Defaults is 1.
3035 Allowed range is from 0.015625 to 64.
3038 Set output level after filtering for both channels. Defaults is 1.
3039 Allowed range is from 0.015625 to 64.
3042 Set input balance between both channels. Default is 0.
3043 Allowed range is from -1 to 1.
3046 Set output balance between both channels. Default is 0.
3047 Allowed range is from -1 to 1.
3050 Enable softclipping. Results in analog distortion instead of harsh digital 0dB
3051 clipping. Disabled by default.
3054 Mute the left channel. Disabled by default.
3057 Mute the right channel. Disabled by default.
3060 Change the phase of the left channel. Disabled by default.
3063 Change the phase of the right channel. Disabled by default.
3066 Set stereo mode. Available values are:
3070 Left/Right to Left/Right, this is default.
3073 Left/Right to Mid/Side.
3076 Mid/Side to Left/Right.
3079 Left/Right to Left/Left.
3082 Left/Right to Right/Right.
3085 Left/Right to Left + Right.
3088 Left/Right to Right/Left.
3092 Set level of side signal. Default is 1.
3093 Allowed range is from 0.015625 to 64.
3096 Set balance of side signal. Default is 0.
3097 Allowed range is from -1 to 1.
3100 Set level of the middle signal. Default is 1.
3101 Allowed range is from 0.015625 to 64.
3104 Set middle signal pan. Default is 0. Allowed range is from -1 to 1.
3107 Set stereo base between mono and inversed channels. Default is 0.
3108 Allowed range is from -1 to 1.
3111 Set delay in milliseconds how much to delay left from right channel and
3112 vice versa. Default is 0. Allowed range is from -20 to 20.
3115 Set S/C level. Default is 1. Allowed range is from 1 to 100.
3118 Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360.
3121 @section stereowiden
3123 This filter enhance the stereo effect by suppressing signal common to both
3124 channels and by delaying the signal of left into right and vice versa,
3125 thereby widening the stereo effect.
3127 The filter accepts the following options:
3131 Time in milliseconds of the delay of left signal into right and vice versa.
3132 Default is 20 milliseconds.
3135 Amount of gain in delayed signal into right and vice versa. Gives a delay
3136 effect of left signal in right output and vice versa which gives widening
3137 effect. Default is 0.3.
3140 Cross feed of left into right with inverted phase. This helps in suppressing
3141 the mono. If the value is 1 it will cancel all the signal common to both
3142 channels. Default is 0.3.
3145 Set level of input signal of original channel. Default is 0.8.
3150 Boost or cut treble (upper) frequencies of the audio using a two-pole
3151 shelving filter with a response similar to that of a standard
3152 hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
3154 The filter accepts the following options:
3158 Give the gain at whichever is the lower of ~22 kHz and the
3159 Nyquist frequency. Its useful range is about -20 (for a large cut)
3160 to +20 (for a large boost). Beware of clipping when using a positive gain.
3163 Set the filter's central frequency and so can be used
3164 to extend or reduce the frequency range to be boosted or cut.
3165 The default value is @code{3000} Hz.
3168 Set method to specify band-width of filter.
3181 Determine how steep is the filter's shelf transition.
3186 Sinusoidal amplitude modulation.
3188 The filter accepts the following options:
3192 Modulation frequency in Hertz. Modulation frequencies in the subharmonic range
3193 (20 Hz or lower) will result in a tremolo effect.
3194 This filter may also be used as a ring modulator by specifying
3195 a modulation frequency higher than 20 Hz.
3196 Range is 0.1 - 20000.0. Default value is 5.0 Hz.
3199 Depth of modulation as a percentage. Range is 0.0 - 1.0.
3200 Default value is 0.5.
3205 Sinusoidal phase modulation.
3207 The filter accepts the following options:
3211 Modulation frequency in Hertz.
3212 Range is 0.1 - 20000.0. Default value is 5.0 Hz.
3215 Depth of modulation as a percentage. Range is 0.0 - 1.0.
3216 Default value is 0.5.
3221 Adjust the input audio volume.
3223 It accepts the following parameters:
3227 Set audio volume expression.
3229 Output values are clipped to the maximum value.
3231 The output audio volume is given by the relation:
3233 @var{output_volume} = @var{volume} * @var{input_volume}
3236 The default value for @var{volume} is "1.0".
3239 This parameter represents the mathematical precision.
3241 It determines which input sample formats will be allowed, which affects the
3242 precision of the volume scaling.
3246 8-bit fixed-point; this limits input sample format to U8, S16, and S32.
3248 32-bit floating-point; this limits input sample format to FLT. (default)
3250 64-bit floating-point; this limits input sample format to DBL.
3254 Choose the behaviour on encountering ReplayGain side data in input frames.
3258 Remove ReplayGain side data, ignoring its contents (the default).
3261 Ignore ReplayGain side data, but leave it in the frame.
3264 Prefer the track gain, if present.
3267 Prefer the album gain, if present.
3270 @item replaygain_preamp
3271 Pre-amplification gain in dB to apply to the selected replaygain gain.
3273 Default value for @var{replaygain_preamp} is 0.0.
3276 Set when the volume expression is evaluated.
3278 It accepts the following values:
3281 only evaluate expression once during the filter initialization, or
3282 when the @samp{volume} command is sent
3285 evaluate expression for each incoming frame
3288 Default value is @samp{once}.
3291 The volume expression can contain the following parameters.
3295 frame number (starting at zero)
3298 @item nb_consumed_samples
3299 number of samples consumed by the filter
3301 number of samples in the current frame
3303 original frame position in the file
3309 PTS at start of stream
3311 time at start of stream
3317 last set volume value
3320 Note that when @option{eval} is set to @samp{once} only the
3321 @var{sample_rate} and @var{tb} variables are available, all other
3322 variables will evaluate to NAN.
3324 @subsection Commands
3326 This filter supports the following commands:
3329 Modify the volume expression.
3330 The command accepts the same syntax of the corresponding option.
3332 If the specified expression is not valid, it is kept at its current
3334 @item replaygain_noclip
3335 Prevent clipping by limiting the gain applied.
3337 Default value for @var{replaygain_noclip} is 1.
3341 @subsection Examples
3345 Halve the input audio volume:
3349 volume=volume=-6.0206dB
3352 In all the above example the named key for @option{volume} can be
3353 omitted, for example like in:
3359 Increase input audio power by 6 decibels using fixed-point precision:
3361 volume=volume=6dB:precision=fixed
3365 Fade volume after time 10 with an annihilation period of 5 seconds:
3367 volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
3371 @section volumedetect
3373 Detect the volume of the input video.
3375 The filter has no parameters. The input is not modified. Statistics about
3376 the volume will be printed in the log when the input stream end is reached.
3378 In particular it will show the mean volume (root mean square), maximum
3379 volume (on a per-sample basis), and the beginning of a histogram of the
3380 registered volume values (from the maximum value to a cumulated 1/1000 of
3383 All volumes are in decibels relative to the maximum PCM value.
3385 @subsection Examples
3387 Here is an excerpt of the output:
3389 [Parsed_volumedetect_0 @ 0xa23120] mean_volume: -27 dB
3390 [Parsed_volumedetect_0 @ 0xa23120] max_volume: -4 dB
3391 [Parsed_volumedetect_0 @ 0xa23120] histogram_4db: 6
3392 [Parsed_volumedetect_0 @ 0xa23120] histogram_5db: 62
3393 [Parsed_volumedetect_0 @ 0xa23120] histogram_6db: 286
3394 [Parsed_volumedetect_0 @ 0xa23120] histogram_7db: 1042
3395 [Parsed_volumedetect_0 @ 0xa23120] histogram_8db: 2551
3396 [Parsed_volumedetect_0 @ 0xa23120] histogram_9db: 4609
3397 [Parsed_volumedetect_0 @ 0xa23120] histogram_10db: 8409
3403 The mean square energy is approximately -27 dB, or 10^-2.7.
3405 The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
3407 There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
3410 In other words, raising the volume by +4 dB does not cause any clipping,
3411 raising it by +5 dB causes clipping for 6 samples, etc.
3413 @c man end AUDIO FILTERS
3415 @chapter Audio Sources
3416 @c man begin AUDIO SOURCES
3418 Below is a description of the currently available audio sources.
3422 Buffer audio frames, and make them available to the filter chain.
3424 This source is mainly intended for a programmatic use, in particular
3425 through the interface defined in @file{libavfilter/asrc_abuffer.h}.
3427 It accepts the following parameters:
3431 The timebase which will be used for timestamps of submitted frames. It must be
3432 either a floating-point number or in @var{numerator}/@var{denominator} form.
3435 The sample rate of the incoming audio buffers.
3438 The sample format of the incoming audio buffers.
3439 Either a sample format name or its corresponding integer representation from
3440 the enum AVSampleFormat in @file{libavutil/samplefmt.h}
3442 @item channel_layout
3443 The channel layout of the incoming audio buffers.
3444 Either a channel layout name from channel_layout_map in
3445 @file{libavutil/channel_layout.c} or its corresponding integer representation
3446 from the AV_CH_LAYOUT_* macros in @file{libavutil/channel_layout.h}
3449 The number of channels of the incoming audio buffers.
3450 If both @var{channels} and @var{channel_layout} are specified, then they
3455 @subsection Examples
3458 abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
3461 will instruct the source to accept planar 16bit signed stereo at 44100Hz.
3462 Since the sample format with name "s16p" corresponds to the number
3463 6 and the "stereo" channel layout corresponds to the value 0x3, this is
3466 abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
3471 Generate an audio signal specified by an expression.
3473 This source accepts in input one or more expressions (one for each
3474 channel), which are evaluated and used to generate a corresponding
3477 This source accepts the following options:
3481 Set the '|'-separated expressions list for each separate channel. In case the
3482 @option{channel_layout} option is not specified, the selected channel layout
3483 depends on the number of provided expressions. Otherwise the last
3484 specified expression is applied to the remaining output channels.
3486 @item channel_layout, c
3487 Set the channel layout. The number of channels in the specified layout
3488 must be equal to the number of specified expressions.
3491 Set the minimum duration of the sourced audio. See
3492 @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
3493 for the accepted syntax.
3494 Note that the resulting duration may be greater than the specified
3495 duration, as the generated audio is always cut at the end of a
3498 If not specified, or the expressed duration is negative, the audio is
3499 supposed to be generated forever.
3502 Set the number of samples per channel per each output frame,
3505 @item sample_rate, s
3506 Specify the sample rate, default to 44100.
3509 Each expression in @var{exprs} can contain the following constants:
3513 number of the evaluated sample, starting from 0
3516 time of the evaluated sample expressed in seconds, starting from 0
3523 @subsection Examples
3533 Generate a sin signal with frequency of 440 Hz, set sample rate to
3536 aevalsrc="sin(440*2*PI*t):s=8000"
3540 Generate a two channels signal, specify the channel layout (Front
3541 Center + Back Center) explicitly:
3543 aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC"
3547 Generate white noise:
3549 aevalsrc="-2+random(0)"
3553 Generate an amplitude modulated signal:
3555 aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)"
3559 Generate 2.5 Hz binaural beats on a 360 Hz carrier:
3561 aevalsrc="0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)"
3568 The null audio source, return unprocessed audio frames. It is mainly useful
3569 as a template and to be employed in analysis / debugging tools, or as
3570 the source for filters which ignore the input data (for example the sox
3573 This source accepts the following options:
3577 @item channel_layout, cl
3579 Specifies the channel layout, and can be either an integer or a string
3580 representing a channel layout. The default value of @var{channel_layout}
3583 Check the channel_layout_map definition in
3584 @file{libavutil/channel_layout.c} for the mapping between strings and
3585 channel layout values.
3587 @item sample_rate, r
3588 Specifies the sample rate, and defaults to 44100.
3591 Set the number of samples per requested frames.
3595 @subsection Examples
3599 Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
3601 anullsrc=r=48000:cl=4
3605 Do the same operation with a more obvious syntax:
3607 anullsrc=r=48000:cl=mono
3611 All the parameters need to be explicitly defined.
3615 Synthesize a voice utterance using the libflite library.
3617 To enable compilation of this filter you need to configure FFmpeg with
3618 @code{--enable-libflite}.
3620 Note that the flite library is not thread-safe.
3622 The filter accepts the following options:
3627 If set to 1, list the names of the available voices and exit
3628 immediately. Default value is 0.
3631 Set the maximum number of samples per frame. Default value is 512.
3634 Set the filename containing the text to speak.
3637 Set the text to speak.
3640 Set the voice to use for the speech synthesis. Default value is
3641 @code{kal}. See also the @var{list_voices} option.
3644 @subsection Examples
3648 Read from file @file{speech.txt}, and synthesize the text using the
3649 standard flite voice:
3651 flite=textfile=speech.txt
3655 Read the specified text selecting the @code{slt} voice:
3657 flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
3661 Input text to ffmpeg:
3663 ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
3667 Make @file{ffplay} speak the specified text, using @code{flite} and
3668 the @code{lavfi} device:
3670 ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
3674 For more information about libflite, check:
3675 @url{http://www.speech.cs.cmu.edu/flite/}
3679 Generate a noise audio signal.
3681 The filter accepts the following options:
3684 @item sample_rate, r
3685 Specify the sample rate. Default value is 48000 Hz.
3688 Specify the amplitude (0.0 - 1.0) of the generated audio stream. Default value
3692 Specify the duration of the generated audio stream. Not specifying this option
3693 results in noise with an infinite length.
3695 @item color, colour, c
3696 Specify the color of noise. Available noise colors are white, pink, and brown.
3697 Default color is white.
3700 Specify a value used to seed the PRNG.
3703 Set the number of samples per each output frame, default is 1024.
3706 @subsection Examples
3711 Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate and an amplitude of 0.5:
3713 anoisesrc=d=60:c=pink:r=44100:a=0.5
3719 Generate an audio signal made of a sine wave with amplitude 1/8.
3721 The audio signal is bit-exact.
3723 The filter accepts the following options:
3728 Set the carrier frequency. Default is 440 Hz.
3730 @item beep_factor, b
3731 Enable a periodic beep every second with frequency @var{beep_factor} times
3732 the carrier frequency. Default is 0, meaning the beep is disabled.
3734 @item sample_rate, r
3735 Specify the sample rate, default is 44100.
3738 Specify the duration of the generated audio stream.
3740 @item samples_per_frame
3741 Set the number of samples per output frame.
3743 The expression can contain the following constants:
3747 The (sequential) number of the output audio frame, starting from 0.
3750 The PTS (Presentation TimeStamp) of the output audio frame,
3751 expressed in @var{TB} units.
3754 The PTS of the output audio frame, expressed in seconds.
3757 The timebase of the output audio frames.
3760 Default is @code{1024}.
3763 @subsection Examples
3768 Generate a simple 440 Hz sine wave:
3774 Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
3778 sine=frequency=220:beep_factor=4:duration=5
3782 Generate a 1 kHz sine wave following @code{1602,1601,1602,1601,1602} NTSC
3785 sine=1000:samples_per_frame='st(0,mod(n,5)); 1602-not(not(eq(ld(0),1)+eq(ld(0),3)))'
3789 @c man end AUDIO SOURCES
3791 @chapter Audio Sinks
3792 @c man begin AUDIO SINKS
3794 Below is a description of the currently available audio sinks.
3796 @section abuffersink
3798 Buffer audio frames, and make them available to the end of filter chain.
3800 This sink is mainly intended for programmatic use, in particular
3801 through the interface defined in @file{libavfilter/buffersink.h}
3802 or the options system.
3804 It accepts a pointer to an AVABufferSinkContext structure, which
3805 defines the incoming buffers' formats, to be passed as the opaque
3806 parameter to @code{avfilter_init_filter} for initialization.
3809 Null audio sink; do absolutely nothing with the input audio. It is
3810 mainly useful as a template and for use in analysis / debugging
3813 @c man end AUDIO SINKS
3815 @chapter Video Filters
3816 @c man begin VIDEO FILTERS
3818 When you configure your FFmpeg build, you can disable any of the
3819 existing filters using @code{--disable-filters}.
3820 The configure output will show the video filters included in your
3823 Below is a description of the currently available video filters.
3825 @section alphaextract
3827 Extract the alpha component from the input as a grayscale video. This
3828 is especially useful with the @var{alphamerge} filter.
3832 Add or replace the alpha component of the primary input with the
3833 grayscale value of a second input. This is intended for use with
3834 @var{alphaextract} to allow the transmission or storage of frame
3835 sequences that have alpha in a format that doesn't support an alpha
3838 For example, to reconstruct full frames from a normal YUV-encoded video
3839 and a separate video created with @var{alphaextract}, you might use:
3841 movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
3844 Since this filter is designed for reconstruction, it operates on frame
3845 sequences without considering timestamps, and terminates when either
3846 input reaches end of stream. This will cause problems if your encoding
3847 pipeline drops frames. If you're trying to apply an image as an
3848 overlay to a video stream, consider the @var{overlay} filter instead.
3852 Same as the @ref{subtitles} filter, except that it doesn't require libavcodec
3853 and libavformat to work. On the other hand, it is limited to ASS (Advanced
3854 Substation Alpha) subtitles files.
3856 This filter accepts the following option in addition to the common options from
3857 the @ref{subtitles} filter:
3861 Set the shaping engine
3863 Available values are:
3866 The default libass shaping engine, which is the best available.
3868 Fast, font-agnostic shaper that can do only substitutions
3870 Slower shaper using OpenType for substitutions and positioning
3873 The default is @code{auto}.
3877 Apply an Adaptive Temporal Averaging Denoiser to the video input.
3879 The filter accepts the following options:
3883 Set threshold A for 1st plane. Default is 0.02.
3884 Valid range is 0 to 0.3.
3887 Set threshold B for 1st plane. Default is 0.04.
3888 Valid range is 0 to 5.
3891 Set threshold A for 2nd plane. Default is 0.02.
3892 Valid range is 0 to 0.3.
3895 Set threshold B for 2nd plane. Default is 0.04.
3896 Valid range is 0 to 5.
3899 Set threshold A for 3rd plane. Default is 0.02.
3900 Valid range is 0 to 0.3.
3903 Set threshold B for 3rd plane. Default is 0.04.
3904 Valid range is 0 to 5.
3906 Threshold A is designed to react on abrupt changes in the input signal and
3907 threshold B is designed to react on continuous changes in the input signal.
3910 Set number of frames filter will use for averaging. Default is 33. Must be odd
3911 number in range [5, 129].
3916 Compute the bounding box for the non-black pixels in the input frame
3919 This filter computes the bounding box containing all the pixels with a
3920 luminance value greater than the minimum allowed value.
3921 The parameters describing the bounding box are printed on the filter
3924 The filter accepts the following option:
3928 Set the minimal luminance value. Default is @code{16}.
3931 @section blackdetect
3933 Detect video intervals that are (almost) completely black. Can be
3934 useful to detect chapter transitions, commercials, or invalid
3935 recordings. Output lines contains the time for the start, end and
3936 duration of the detected black interval expressed in seconds.
3938 In order to display the output lines, you need to set the loglevel at
3939 least to the AV_LOG_INFO value.
3941 The filter accepts the following options:
3944 @item black_min_duration, d
3945 Set the minimum detected black duration expressed in seconds. It must
3946 be a non-negative floating point number.
3948 Default value is 2.0.
3950 @item picture_black_ratio_th, pic_th
3951 Set the threshold for considering a picture "black".
3952 Express the minimum value for the ratio:
3954 @var{nb_black_pixels} / @var{nb_pixels}
3957 for which a picture is considered black.
3958 Default value is 0.98.
3960 @item pixel_black_th, pix_th
3961 Set the threshold for considering a pixel "black".
3963 The threshold expresses the maximum pixel luminance value for which a
3964 pixel is considered "black". The provided value is scaled according to
3965 the following equation:
3967 @var{absolute_threshold} = @var{luminance_minimum_value} + @var{pixel_black_th} * @var{luminance_range_size}
3970 @var{luminance_range_size} and @var{luminance_minimum_value} depend on
3971 the input video format, the range is [0-255] for YUV full-range
3972 formats and [16-235] for YUV non full-range formats.
3974 Default value is 0.10.
3977 The following example sets the maximum pixel threshold to the minimum
3978 value, and detects only black intervals of 2 or more seconds:
3980 blackdetect=d=2:pix_th=0.00
3985 Detect frames that are (almost) completely black. Can be useful to
3986 detect chapter transitions or commercials. Output lines consist of
3987 the frame number of the detected frame, the percentage of blackness,
3988 the position in the file if known or -1 and the timestamp in seconds.
3990 In order to display the output lines, you need to set the loglevel at
3991 least to the AV_LOG_INFO value.
3993 It accepts the following parameters:
3998 The percentage of the pixels that have to be below the threshold; it defaults to
4001 @item threshold, thresh
4002 The threshold below which a pixel value is considered black; it defaults to
4007 @section blend, tblend
4009 Blend two video frames into each other.
4011 The @code{blend} filter takes two input streams and outputs one
4012 stream, the first input is the "top" layer and second input is
4013 "bottom" layer. Output terminates when shortest input terminates.
4015 The @code{tblend} (time blend) filter takes two consecutive frames
4016 from one single stream, and outputs the result obtained by blending
4017 the new frame on top of the old frame.
4019 A description of the accepted options follows.
4027 Set blend mode for specific pixel component or all pixel components in case
4028 of @var{all_mode}. Default value is @code{normal}.
4030 Available values for component modes are:
4068 Set blend opacity for specific pixel component or all pixel components in case
4069 of @var{all_opacity}. Only used in combination with pixel component blend modes.
4076 Set blend expression for specific pixel component or all pixel components in case
4077 of @var{all_expr}. Note that related mode options will be ignored if those are set.
4079 The expressions can use the following variables:
4083 The sequential number of the filtered frame, starting from @code{0}.
4087 the coordinates of the current sample
4091 the width and height of currently filtered plane
4095 Width and height scale depending on the currently filtered plane. It is the
4096 ratio between the corresponding luma plane number of pixels and the current
4097 plane ones. E.g. for YUV4:2:0 the values are @code{1,1} for the luma plane, and
4098 @code{0.5,0.5} for chroma planes.
4101 Time of the current frame, expressed in seconds.
4104 Value of pixel component at current location for first video frame (top layer).
4107 Value of pixel component at current location for second video frame (bottom layer).
4111 Force termination when the shortest input terminates. Default is
4112 @code{0}. This option is only defined for the @code{blend} filter.
4115 Continue applying the last bottom frame after the end of the stream. A value of
4116 @code{0} disable the filter after the last frame of the bottom layer is reached.
4117 Default is @code{1}. This option is only defined for the @code{blend} filter.
4120 @subsection Examples
4124 Apply transition from bottom layer to top layer in first 10 seconds:
4126 blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
4130 Apply 1x1 checkerboard effect:
4132 blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
4136 Apply uncover left effect:
4138 blend=all_expr='if(gte(N*SW+X,W),A,B)'
4142 Apply uncover down effect:
4144 blend=all_expr='if(gte(Y-N*SH,0),A,B)'
4148 Apply uncover up-left effect:
4150 blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
4154 Display differences between the current and the previous frame:
4156 tblend=all_mode=difference128
4162 Apply a boxblur algorithm to the input video.
4164 It accepts the following parameters:
4168 @item luma_radius, lr
4169 @item luma_power, lp
4170 @item chroma_radius, cr
4171 @item chroma_power, cp
4172 @item alpha_radius, ar
4173 @item alpha_power, ap
4177 A description of the accepted options follows.
4180 @item luma_radius, lr
4181 @item chroma_radius, cr
4182 @item alpha_radius, ar
4183 Set an expression for the box radius in pixels used for blurring the
4184 corresponding input plane.
4186 The radius value must be a non-negative number, and must not be
4187 greater than the value of the expression @code{min(w,h)/2} for the
4188 luma and alpha planes, and of @code{min(cw,ch)/2} for the chroma
4191 Default value for @option{luma_radius} is "2". If not specified,
4192 @option{chroma_radius} and @option{alpha_radius} default to the
4193 corresponding value set for @option{luma_radius}.
4195 The expressions can contain the following constants:
4199 The input width and height in pixels.
4203 The input chroma image width and height in pixels.
4207 The horizontal and vertical chroma subsample values. For example, for the
4208 pixel format "yuv422p", @var{hsub} is 2 and @var{vsub} is 1.
4211 @item luma_power, lp
4212 @item chroma_power, cp
4213 @item alpha_power, ap
4214 Specify how many times the boxblur filter is applied to the
4215 corresponding plane.
4217 Default value for @option{luma_power} is 2. If not specified,
4218 @option{chroma_power} and @option{alpha_power} default to the
4219 corresponding value set for @option{luma_power}.
4221 A value of 0 will disable the effect.
4224 @subsection Examples
4228 Apply a boxblur filter with the luma, chroma, and alpha radii
4231 boxblur=luma_radius=2:luma_power=1
4236 Set the luma radius to 2, and alpha and chroma radius to 0:
4238 boxblur=2:1:cr=0:ar=0
4242 Set the luma and chroma radii to a fraction of the video dimension:
4244 boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
4249 YUV colorspace color/chroma keying.
4251 The filter accepts the following options:
4255 The color which will be replaced with transparency.
4258 Similarity percentage with the key color.
4260 0.01 matches only the exact key color, while 1.0 matches everything.
4265 0.0 makes pixels either fully transparent, or not transparent at all.
4267 Higher values result in semi-transparent pixels, with a higher transparency
4268 the more similar the pixels color is to the key color.
4271 Signals that the color passed is already in YUV instead of RGB.
4273 Litteral colors like "green" or "red" don't make sense with this enabled anymore.
4274 This can be used to pass exact YUV values as hexadecimal numbers.
4277 @subsection Examples
4281 Make every green pixel in the input image transparent:
4283 ffmpeg -i input.png -vf chromakey=green out.png
4287 Overlay a greenscreen-video on top of a static black background.
4289 ffmpeg -f lavfi -i color=c=black:s=1280x720 -i video.mp4 -shortest -filter_complex "[1:v]chromakey=0x70de77:0.1:0.2[ckout];[0:v][ckout]overlay[out]" -map "[out]" output.mkv
4295 Visualize information exported by some codecs.
4297 Some codecs can export information through frames using side-data or other
4298 means. For example, some MPEG based codecs export motion vectors through the
4299 @var{export_mvs} flag in the codec @option{flags2} option.
4301 The filter accepts the following option:
4305 Set motion vectors to visualize.
4307 Available flags for @var{mv} are:
4311 forward predicted MVs of P-frames
4313 forward predicted MVs of B-frames
4315 backward predicted MVs of B-frames
4319 Display quantization parameters using the chroma planes
4322 @subsection Examples
4326 Visualizes multi-directionals MVs from P and B-Frames using @command{ffplay}:
4328 ffplay -flags2 +export_mvs input.mpg -vf codecview=mv=pf+bf+bb
4332 @section colorbalance
4333 Modify intensity of primary colors (red, green and blue) of input frames.
4335 The filter allows an input frame to be adjusted in the shadows, midtones or highlights
4336 regions for the red-cyan, green-magenta or blue-yellow balance.
4338 A positive adjustment value shifts the balance towards the primary color, a negative
4339 value towards the complementary color.
4341 The filter accepts the following options:
4347 Adjust red, green and blue shadows (darkest pixels).
4352 Adjust red, green and blue midtones (medium pixels).
4357 Adjust red, green and blue highlights (brightest pixels).
4359 Allowed ranges for options are @code{[-1.0, 1.0]}. Defaults are @code{0}.
4362 @subsection Examples
4366 Add red color cast to shadows:
4373 RGB colorspace color keying.
4375 The filter accepts the following options:
4379 The color which will be replaced with transparency.
4382 Similarity percentage with the key color.
4384 0.01 matches only the exact key color, while 1.0 matches everything.
4389 0.0 makes pixels either fully transparent, or not transparent at all.
4391 Higher values result in semi-transparent pixels, with a higher transparency
4392 the more similar the pixels color is to the key color.
4395 @subsection Examples
4399 Make every green pixel in the input image transparent:
4401 ffmpeg -i input.png -vf colorkey=green out.png
4405 Overlay a greenscreen-video on top of a static background image.
4407 ffmpeg -i background.png -i video.mp4 -filter_complex "[1:v]colorkey=0x3BBD1E:0.3:0.2[ckout];[0:v][ckout]overlay[out]" -map "[out]" output.flv
4411 @section colorlevels
4413 Adjust video input frames using levels.
4415 The filter accepts the following options:
4422 Adjust red, green, blue and alpha input black point.
4423 Allowed ranges for options are @code{[-1.0, 1.0]}. Defaults are @code{0}.
4429 Adjust red, green, blue and alpha input white point.
4430 Allowed ranges for options are @code{[-1.0, 1.0]}. Defaults are @code{1}.
4432 Input levels are used to lighten highlights (bright tones), darken shadows
4433 (dark tones), change the balance of bright and dark tones.
4439 Adjust red, green, blue and alpha output black point.
4440 Allowed ranges for options are @code{[0, 1.0]}. Defaults are @code{0}.
4446 Adjust red, green, blue and alpha output white point.
4447 Allowed ranges for options are @code{[0, 1.0]}. Defaults are @code{1}.
4449 Output levels allows manual selection of a constrained output level range.
4452 @subsection Examples
4456 Make video output darker:
4458 colorlevels=rimin=0.058:gimin=0.058:bimin=0.058
4464 colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96
4468 Make video output lighter:
4470 colorlevels=rimax=0.902:gimax=0.902:bimax=0.902
4474 Increase brightness:
4476 colorlevels=romin=0.5:gomin=0.5:bomin=0.5
4480 @section colorchannelmixer
4482 Adjust video input frames by re-mixing color channels.
4484 This filter modifies a color channel by adding the values associated to
4485 the other channels of the same pixels. For example if the value to
4486 modify is red, the output value will be:
4488 @var{red}=@var{red}*@var{rr} + @var{blue}*@var{rb} + @var{green}*@var{rg} + @var{alpha}*@var{ra}
4491 The filter accepts the following options:
4498 Adjust contribution of input red, green, blue and alpha channels for output red channel.
4499 Default is @code{1} for @var{rr}, and @code{0} for @var{rg}, @var{rb} and @var{ra}.
4505 Adjust contribution of input red, green, blue and alpha channels for output green channel.
4506 Default is @code{1} for @var{gg}, and @code{0} for @var{gr}, @var{gb} and @var{ga}.
4512 Adjust contribution of input red, green, blue and alpha channels for output blue channel.
4513 Default is @code{1} for @var{bb}, and @code{0} for @var{br}, @var{bg} and @var{ba}.
4519 Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
4520 Default is @code{1} for @var{aa}, and @code{0} for @var{ar}, @var{ag} and @var{ab}.
4522 Allowed ranges for options are @code{[-2.0, 2.0]}.
4525 @subsection Examples
4529 Convert source to grayscale:
4531 colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
4534 Simulate sepia tones:
4536 colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
4540 @section colormatrix
4542 Convert color matrix.
4544 The filter accepts the following options:
4549 Specify the source and destination color matrix. Both values must be
4552 The accepted values are:
4568 For example to convert from BT.601 to SMPTE-240M, use the command:
4570 colormatrix=bt601:smpte240m
4575 Copy the input source unchanged to the output. This is mainly useful for
4580 Crop the input video to given dimensions.
4582 It accepts the following parameters:
4586 The width of the output video. It defaults to @code{iw}.
4587 This expression is evaluated only once during the filter
4588 configuration, or when the @samp{w} or @samp{out_w} command is sent.
4591 The height of the output video. It defaults to @code{ih}.
4592 This expression is evaluated only once during the filter
4593 configuration, or when the @samp{h} or @samp{out_h} command is sent.
4596 The horizontal position, in the input video, of the left edge of the output
4597 video. It defaults to @code{(in_w-out_w)/2}.
4598 This expression is evaluated per-frame.
4601 The vertical position, in the input video, of the top edge of the output video.
4602 It defaults to @code{(in_h-out_h)/2}.
4603 This expression is evaluated per-frame.
4606 If set to 1 will force the output display aspect ratio
4607 to be the same of the input, by changing the output sample aspect
4608 ratio. It defaults to 0.
4611 The @var{out_w}, @var{out_h}, @var{x}, @var{y} parameters are
4612 expressions containing the following constants:
4617 The computed values for @var{x} and @var{y}. They are evaluated for
4622 The input width and height.
4626 These are the same as @var{in_w} and @var{in_h}.
4630 The output (cropped) width and height.
4634 These are the same as @var{out_w} and @var{out_h}.
4637 same as @var{iw} / @var{ih}
4640 input sample aspect ratio
4643 input display aspect ratio, it is the same as (@var{iw} / @var{ih}) * @var{sar}
4647 horizontal and vertical chroma subsample values. For example for the
4648 pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
4651 The number of the input frame, starting from 0.
4654 the position in the file of the input frame, NAN if unknown
4657 The timestamp expressed in seconds. It's NAN if the input timestamp is unknown.
4661 The expression for @var{out_w} may depend on the value of @var{out_h},
4662 and the expression for @var{out_h} may depend on @var{out_w}, but they
4663 cannot depend on @var{x} and @var{y}, as @var{x} and @var{y} are
4664 evaluated after @var{out_w} and @var{out_h}.
4666 The @var{x} and @var{y} parameters specify the expressions for the
4667 position of the top-left corner of the output (non-cropped) area. They
4668 are evaluated for each frame. If the evaluated value is not valid, it
4669 is approximated to the nearest valid value.
4671 The expression for @var{x} may depend on @var{y}, and the expression
4672 for @var{y} may depend on @var{x}.
4674 @subsection Examples
4678 Crop area with size 100x100 at position (12,34).
4683 Using named options, the example above becomes:
4685 crop=w=100:h=100:x=12:y=34
4689 Crop the central input area with size 100x100:
4695 Crop the central input area with size 2/3 of the input video:
4697 crop=2/3*in_w:2/3*in_h
4701 Crop the input video central square:
4708 Delimit the rectangle with the top-left corner placed at position
4709 100:100 and the right-bottom corner corresponding to the right-bottom
4710 corner of the input image.
4712 crop=in_w-100:in_h-100:100:100
4716 Crop 10 pixels from the left and right borders, and 20 pixels from
4717 the top and bottom borders
4719 crop=in_w-2*10:in_h-2*20
4723 Keep only the bottom right quarter of the input image:
4725 crop=in_w/2:in_h/2:in_w/2:in_h/2
4729 Crop height for getting Greek harmony:
4731 crop=in_w:1/PHI*in_w
4735 Apply trembling effect:
4737 crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)
4741 Apply erratic camera effect depending on timestamp:
4743 crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)"
4747 Set x depending on the value of y:
4749 crop=in_w/2:in_h/2:y:10+10*sin(n/10)
4753 @subsection Commands
4755 This filter supports the following commands:
4761 Set width/height of the output video and the horizontal/vertical position
4763 The command accepts the same syntax of the corresponding option.
4765 If the specified expression is not valid, it is kept at its current
4771 Auto-detect the crop size.
4773 It calculates the necessary cropping parameters and prints the
4774 recommended parameters via the logging system. The detected dimensions
4775 correspond to the non-black area of the input video.
4777 It accepts the following parameters:
4782 Set higher black value threshold, which can be optionally specified
4783 from nothing (0) to everything (255 for 8bit based formats). An intensity
4784 value greater to the set value is considered non-black. It defaults to 24.
4785 You can also specify a value between 0.0 and 1.0 which will be scaled depending
4786 on the bitdepth of the pixel format.
4789 The value which the width/height should be divisible by. It defaults to
4790 16. The offset is automatically adjusted to center the video. Use 2 to
4791 get only even dimensions (needed for 4:2:2 video). 16 is best when
4792 encoding to most video codecs.
4794 @item reset_count, reset
4795 Set the counter that determines after how many frames cropdetect will
4796 reset the previously detected largest video area and start over to
4797 detect the current optimal crop area. Default value is 0.
4799 This can be useful when channel logos distort the video area. 0
4800 indicates 'never reset', and returns the largest area encountered during
4807 Apply color adjustments using curves.
4809 This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
4810 component (red, green and blue) has its values defined by @var{N} key points
4811 tied from each other using a smooth curve. The x-axis represents the pixel
4812 values from the input frame, and the y-axis the new pixel values to be set for
4815 By default, a component curve is defined by the two points @var{(0;0)} and
4816 @var{(1;1)}. This creates a straight line where each original pixel value is
4817 "adjusted" to its own value, which means no change to the image.
4819 The filter allows you to redefine these two points and add some more. A new
4820 curve (using a natural cubic spline interpolation) will be define to pass
4821 smoothly through all these new coordinates. The new defined points needs to be
4822 strictly increasing over the x-axis, and their @var{x} and @var{y} values must
4823 be in the @var{[0;1]} interval. If the computed curves happened to go outside
4824 the vector spaces, the values will be clipped accordingly.
4826 If there is no key point defined in @code{x=0}, the filter will automatically
4827 insert a @var{(0;0)} point. In the same way, if there is no key point defined
4828 in @code{x=1}, the filter will automatically insert a @var{(1;1)} point.
4830 The filter accepts the following options:
4834 Select one of the available color presets. This option can be used in addition
4835 to the @option{r}, @option{g}, @option{b} parameters; in this case, the later
4836 options takes priority on the preset values.
4837 Available presets are:
4840 @item color_negative
4843 @item increase_contrast
4845 @item linear_contrast
4846 @item medium_contrast
4848 @item strong_contrast
4851 Default is @code{none}.
4853 Set the master key points. These points will define a second pass mapping. It
4854 is sometimes called a "luminance" or "value" mapping. It can be used with
4855 @option{r}, @option{g}, @option{b} or @option{all} since it acts like a
4856 post-processing LUT.
4858 Set the key points for the red component.
4860 Set the key points for the green component.
4862 Set the key points for the blue component.
4864 Set the key points for all components (not including master).
4865 Can be used in addition to the other key points component
4866 options. In this case, the unset component(s) will fallback on this
4867 @option{all} setting.
4869 Specify a Photoshop curves file (@code{.acv}) to import the settings from.
4872 To avoid some filtergraph syntax conflicts, each key points list need to be
4873 defined using the following syntax: @code{x0/y0 x1/y1 x2/y2 ...}.
4875 @subsection Examples
4879 Increase slightly the middle level of blue:
4881 curves=blue='0.5/0.58'
4887 curves=r='0/0.11 .42/.51 1/0.95':g='0.50/0.48':b='0/0.22 .49/.44 1/0.8'
4889 Here we obtain the following coordinates for each components:
4892 @code{(0;0.11) (0.42;0.51) (1;0.95)}
4894 @code{(0;0) (0.50;0.48) (1;1)}
4896 @code{(0;0.22) (0.49;0.44) (1;0.80)}
4900 The previous example can also be achieved with the associated built-in preset:
4902 curves=preset=vintage
4912 Use a Photoshop preset and redefine the points of the green component:
4914 curves=psfile='MyCurvesPresets/purple.acv':green='0.45/0.53'
4920 Denoise frames using 2D DCT (frequency domain filtering).
4922 This filter is not designed for real time.
4924 The filter accepts the following options:
4928 Set the noise sigma constant.
4930 This @var{sigma} defines a hard threshold of @code{3 * sigma}; every DCT
4931 coefficient (absolute value) below this threshold with be dropped.
4933 If you need a more advanced filtering, see @option{expr}.
4935 Default is @code{0}.
4938 Set number overlapping pixels for each block. Since the filter can be slow, you
4939 may want to reduce this value, at the cost of a less effective filter and the
4940 risk of various artefacts.
4942 If the overlapping value doesn't permit processing the whole input width or
4943 height, a warning will be displayed and according borders won't be denoised.
4945 Default value is @var{blocksize}-1, which is the best possible setting.
4948 Set the coefficient factor expression.
4950 For each coefficient of a DCT block, this expression will be evaluated as a
4951 multiplier value for the coefficient.
4953 If this is option is set, the @option{sigma} option will be ignored.
4955 The absolute value of the coefficient can be accessed through the @var{c}
4959 Set the @var{blocksize} using the number of bits. @code{1<<@var{n}} defines the
4960 @var{blocksize}, which is the width and height of the processed blocks.
4962 The default value is @var{3} (8x8) and can be raised to @var{4} for a
4963 @var{blocksize} of 16x16. Note that changing this setting has huge consequences
4964 on the speed processing. Also, a larger block size does not necessarily means a
4968 @subsection Examples
4970 Apply a denoise with a @option{sigma} of @code{4.5}:
4975 The same operation can be achieved using the expression system:
4977 dctdnoiz=e='gte(c, 4.5*3)'
4980 Violent denoise using a block size of @code{16x16}:
4987 Remove banding artifacts from input video.
4988 It works by replacing banded pixels with average value of referenced pixels.
4990 The filter accepts the following options:
4997 Set banding detection threshold for each plane. Default is 0.02.
4998 Valid range is 0.00003 to 0.5.
4999 If difference between current pixel and reference pixel is less than threshold,
5000 it will be considered as banded.
5003 Banding detection range in pixels. Default is 16. If positive, random number
5004 in range 0 to set value will be used. If negative, exact absolute value
5006 The range defines square of four pixels around current pixel.
5009 Set direction in radians from which four pixel will be compared. If positive,
5010 random direction from 0 to set direction will be picked. If negative, exact of
5011 absolute value will be picked. For example direction 0, -PI or -2*PI radians
5012 will pick only pixels on same row and -PI/2 will pick only pixels on same
5016 If enabled, current pixel is compared with average value of all four
5017 surrounding pixels. The default is enabled. If disabled current pixel is
5018 compared with all four surrounding pixels. The pixel is considered banded
5019 if only all four differences with surrounding pixels are less than threshold.
5025 Drop duplicated frames at regular intervals.
5027 The filter accepts the following options:
5031 Set the number of frames from which one will be dropped. Setting this to
5032 @var{N} means one frame in every batch of @var{N} frames will be dropped.
5033 Default is @code{5}.
5036 Set the threshold for duplicate detection. If the difference metric for a frame
5037 is less than or equal to this value, then it is declared as duplicate. Default
5041 Set scene change threshold. Default is @code{15}.
5045 Set the size of the x and y-axis blocks used during metric calculations.
5046 Larger blocks give better noise suppression, but also give worse detection of
5047 small movements. Must be a power of two. Default is @code{32}.
5050 Mark main input as a pre-processed input and activate clean source input
5051 stream. This allows the input to be pre-processed with various filters to help
5052 the metrics calculation while keeping the frame selection lossless. When set to
5053 @code{1}, the first stream is for the pre-processed input, and the second
5054 stream is the clean source from where the kept frames are chosen. Default is
5058 Set whether or not chroma is considered in the metric calculations. Default is
5064 Apply deflate effect to the video.
5066 This filter replaces the pixel by the local(3x3) average by taking into account
5067 only values lower than the pixel.
5069 It accepts the following options:
5076 Limit the maximum change for each plane, default is 65535.
5077 If 0, plane will remain unchanged.
5082 Remove judder produced by partially interlaced telecined content.
5084 Judder can be introduced, for instance, by @ref{pullup} filter. If the original
5085 source was partially telecined content then the output of @code{pullup,dejudder}
5086 will have a variable frame rate. May change the recorded frame rate of the
5087 container. Aside from that change, this filter will not affect constant frame
5090 The option available in this filter is:
5094 Specify the length of the window over which the judder repeats.
5096 Accepts any integer greater than 1. Useful values are: