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
12 input --> split ---------------------> overlay --> output
15 +-----> crop --> vflip -------+
18 This filtergraph splits the input stream in two streams, sends one
19 stream through the crop filter and the vflip filter before merging it
20 back with the other stream by overlaying it on top. You can use the
21 following command to achieve this:
24 ffmpeg -i INPUT -vf "split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2" OUTPUT
27 The result will be that in output the top half of the video is mirrored
30 Filters in the same linear chain are separated by commas, and distinct
31 linear chains of filters are separated by semicolons. In our example,
32 @var{crop,vflip} are in one linear chain, @var{split} and
33 @var{overlay} are separately in another. The points where the linear
34 chains join are labelled by names enclosed in square brackets. In the
35 example, the split filter generates two outputs that are associated to
36 the labels @var{[main]} and @var{[tmp]}.
38 The stream sent to the second output of @var{split}, labelled as
39 @var{[tmp]}, is processed through the @var{crop} filter, which crops
40 away the lower half part of the video, and then vertically flipped. The
41 @var{overlay} filter takes in input the first unchanged output of the
42 split filter (which was labelled as @var{[main]}), and overlay on its
43 lower half the output generated by the @var{crop,vflip} filterchain.
45 Some filters take in input a list of parameters: they are specified
46 after the filter name and an equal sign, and are separated from each other
49 There exist so-called @var{source filters} that do not have an
50 audio/video input, and @var{sink filters} that will not have audio/video
53 @c man end FILTERING INTRODUCTION
56 @c man begin GRAPH2DOT
58 The @file{graph2dot} program included in the FFmpeg @file{tools}
59 directory can be used to parse a filtergraph description and issue a
60 corresponding textual representation in the dot language.
67 to see how to use @file{graph2dot}.
69 You can then pass the dot description to the @file{dot} program (from
70 the graphviz suite of programs) and obtain a graphical representation
73 For example the sequence of commands:
75 echo @var{GRAPH_DESCRIPTION} | \
76 tools/graph2dot -o graph.tmp && \
77 dot -Tpng graph.tmp -o graph.png && \
81 can be used to create and display an image representing the graph
82 described by the @var{GRAPH_DESCRIPTION} string. Note that this string must be
83 a complete self-contained graph, with its inputs and outputs explicitly defined.
84 For example if your command line is of the form:
86 ffmpeg -i infile -vf scale=640:360 outfile
88 your @var{GRAPH_DESCRIPTION} string will need to be of the form:
90 nullsrc,scale=640:360,nullsink
92 you may also need to set the @var{nullsrc} parameters and add a @var{format}
93 filter in order to simulate a specific input file.
97 @chapter Filtergraph description
98 @c man begin FILTERGRAPH DESCRIPTION
100 A filtergraph is a directed graph of connected filters. It can contain
101 cycles, and there can be multiple links between a pair of
102 filters. Each link has one input pad on one side connecting it to one
103 filter from which it takes its input, and one output pad on the other
104 side connecting it to the one filter accepting its output.
106 Each filter in a filtergraph is an instance of a filter class
107 registered in the application, which defines the features and the
108 number of input and output pads of the filter.
110 A filter with no input pads is called a "source", a filter with no
111 output pads is called a "sink".
113 @anchor{Filtergraph syntax}
114 @section Filtergraph syntax
116 A filtergraph can be represented using a textual representation, which is
117 recognized by the @option{-filter}/@option{-vf} and @option{-filter_complex}
118 options in @command{ffmpeg} and @option{-vf} in @command{ffplay}, and by the
119 @code{avfilter_graph_parse()}/@code{avfilter_graph_parse2()} function defined in
120 @file{libavfilter/avfilter.h}.
122 A filterchain consists of a sequence of connected filters, each one
123 connected to the previous one in the sequence. A filterchain is
124 represented by a list of ","-separated filter descriptions.
126 A filtergraph consists of a sequence of filterchains. A sequence of
127 filterchains is represented by a list of ";"-separated filterchain
130 A filter is represented by a string of the form:
131 [@var{in_link_1}]...[@var{in_link_N}]@var{filter_name}=@var{arguments}[@var{out_link_1}]...[@var{out_link_M}]
133 @var{filter_name} is the name of the filter class of which the
134 described filter is an instance of, and has to be the name of one of
135 the filter classes registered in the program.
136 The name of the filter class is optionally followed by a string
139 @var{arguments} is a string which contains the parameters used to
140 initialize the filter instance. It may have one of the following forms:
144 A ':'-separated list of @var{key=value} pairs.
147 A ':'-separated list of @var{value}. In this case, the keys are assumed to be
148 the option names in the order they are declared. E.g. the @code{fade} filter
149 declares three options in this order -- @option{type}, @option{start_frame} and
150 @option{nb_frames}. Then the parameter list @var{in:0:30} means that the value
151 @var{in} is assigned to the option @option{type}, @var{0} to
152 @option{start_frame} and @var{30} to @option{nb_frames}.
155 A ':'-separated list of mixed direct @var{value} and long @var{key=value}
156 pairs. The direct @var{value} must precede the @var{key=value} pairs, and
157 follow the same constraints order of the previous point. The following
158 @var{key=value} pairs can be set in any preferred order.
162 If the option value itself is a list of items (e.g. the @code{format} filter
163 takes a list of pixel formats), the items in the list are usually separated by
166 The list of arguments can be quoted using the character "'" as initial
167 and ending mark, and the character '\' for escaping the characters
168 within the quoted text; otherwise the argument string is considered
169 terminated when the next special character (belonging to the set
170 "[]=;,") is encountered.
172 The name and arguments of the filter are optionally preceded and
173 followed by a list of link labels.
174 A link label allows to name a link and associate it to a filter output
175 or input pad. The preceding labels @var{in_link_1}
176 ... @var{in_link_N}, are associated to the filter input pads,
177 the following labels @var{out_link_1} ... @var{out_link_M}, are
178 associated to the output pads.
180 When two link labels with the same name are found in the
181 filtergraph, a link between the corresponding input and output pad is
184 If an output pad is not labelled, it is linked by default to the first
185 unlabelled input pad of the next filter in the filterchain.
186 For example in the filterchain:
188 nullsrc, split[L1], [L2]overlay, nullsink
190 the split filter instance has two output pads, and the overlay filter
191 instance two input pads. The first output pad of split is labelled
192 "L1", the first input pad of overlay is labelled "L2", and the second
193 output pad of split is linked to the second input pad of overlay,
194 which are both unlabelled.
196 In a complete filterchain all the unlabelled filter input and output
197 pads must be connected. A filtergraph is considered valid if all the
198 filter input and output pads of all the filterchains are connected.
200 Libavfilter will automatically insert scale filters where format
201 conversion is required. It is possible to specify swscale flags
202 for those automatically inserted scalers by prepending
203 @code{sws_flags=@var{flags};}
204 to the filtergraph description.
206 Follows a BNF description for the filtergraph syntax:
208 @var{NAME} ::= sequence of alphanumeric characters and '_'
209 @var{LINKLABEL} ::= "[" @var{NAME} "]"
210 @var{LINKLABELS} ::= @var{LINKLABEL} [@var{LINKLABELS}]
211 @var{FILTER_ARGUMENTS} ::= sequence of chars (eventually quoted)
212 @var{FILTER} ::= [@var{LINKLABELS}] @var{NAME} ["=" @var{FILTER_ARGUMENTS}] [@var{LINKLABELS}]
213 @var{FILTERCHAIN} ::= @var{FILTER} [,@var{FILTERCHAIN}]
214 @var{FILTERGRAPH} ::= [sws_flags=@var{flags};] @var{FILTERCHAIN} [;@var{FILTERGRAPH}]
217 @section Notes on filtergraph escaping
219 Some filter arguments require the use of special characters, typically
220 @code{:} to separate key=value pairs in a named options list. In this
221 case the user should perform a first level escaping when specifying
222 the filter arguments. For example, consider the following literal
223 string to be embedded in the @ref{drawtext} filter arguments:
225 this is a 'string': may contain one, or more, special characters
228 Since @code{:} is special for the filter arguments syntax, it needs to
229 be escaped, so you get:
231 text=this is a \'string\'\: may contain one, or more, special characters
234 A second level of escaping is required when embedding the filter
235 arguments in a filtergraph description, in order to escape all the
236 filtergraph special characters. Thus the example above becomes:
238 drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
241 Finally an additional level of escaping may be needed when writing the
242 filtergraph description in a shell command, which depends on the
243 escaping rules of the adopted shell. For example, assuming that
244 @code{\} is special and needs to be escaped with another @code{\}, the
245 previous string will finally result in:
247 -vf "drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters"
250 Sometimes, it might be more convenient to employ quoting in place of
251 escaping. For example the string:
253 Caesar: tu quoque, Brute, fili mi
256 Can be quoted in the filter arguments as:
258 text='Caesar: tu quoque, Brute, fili mi'
261 And finally inserted in a filtergraph like:
263 drawtext=text=\'Caesar: tu quoque\, Brute\, fili mi\'
266 See the ``Quoting and escaping'' section in the ffmpeg-utils manual
267 for more information about the escaping and quoting rules adopted by
270 @chapter Timeline editing
272 Some filters support a generic @option{enable} option. For the filters
273 supporting timeline editing, this option can be set to an expression which is
274 evaluated before sending a frame to the filter. If the evaluation is non-zero,
275 the filter will be enabled, otherwise the frame will be sent unchanged to the
276 next filter in the filtergraph.
278 The expression accepts the following values:
281 timestamp expressed in seconds, NAN if the input timestamp is unknown
284 sequential number of the input frame, starting from 0
287 the position in the file of the input frame, NAN if unknown
290 Additionally, these filters support an @option{enable} command that can be used
291 to re-define the expression.
293 Like any other filtering option, the @option{enable} option follows the same
296 For example, to enable a blur filter (@ref{smartblur}) from 10 seconds to 3
297 minutes, and a @ref{curves} filter starting at 3 seconds:
299 smartblur = enable='between(t,10,3*60)',
300 curves = enable='gte(t,3)' : preset=cross_process
303 @c man end FILTERGRAPH DESCRIPTION
305 @chapter Audio Filters
306 @c man begin AUDIO FILTERS
308 When you configure your FFmpeg build, you can disable any of the
309 existing filters using @code{--disable-filters}.
310 The configure output will show the audio filters included in your
313 Below is a description of the currently available audio filters.
317 Convert the input audio format to the specified formats.
319 @emph{This filter is deprecated. Use @ref{aformat} instead.}
321 The filter accepts a string of the form:
322 "@var{sample_format}:@var{channel_layout}".
324 @var{sample_format} specifies the sample format, and can be a string or the
325 corresponding numeric value defined in @file{libavutil/samplefmt.h}. Use 'p'
326 suffix for a planar sample format.
328 @var{channel_layout} specifies the channel layout, and can be a string
329 or the corresponding number value defined in @file{libavutil/channel_layout.h}.
331 The special parameter "auto", signifies that the filter will
332 automatically select the output format depending on the output filter.
338 Convert input to float, planar, stereo:
344 Convert input to unsigned 8-bit, automatically select out channel layout:
352 Apply echoing to the input audio.
354 Echoes are reflected sound and can occur naturally amongst mountains
355 (and sometimes large buildings) when talking or shouting; digital echo
356 effects emulate this behaviour and are often used to help fill out the
357 sound of a single instrument or vocal. The time difference between the
358 original signal and the reflection is the @code{delay}, and the
359 loudness of the reflected signal is the @code{decay}.
360 Multiple echoes can have different delays and decays.
362 A description of the accepted parameters follows.
366 Set input gain of reflected signal. Default is @code{0.6}.
369 Set output gain of reflected signal. Default is @code{0.3}.
372 Set list of time intervals in milliseconds between original signal and reflections
373 separated by '|'. Allowed range for each @code{delay} is @code{(0 - 90000.0]}.
374 Default is @code{1000}.
377 Set list of loudnesses of reflected signals separated by '|'.
378 Allowed range for each @code{decay} is @code{(0 - 1.0]}.
379 Default is @code{0.5}.
386 Make it sound as if there are twice as many instruments as are actually playing:
388 aecho=0.8:0.88:60:0.4
392 If delay is very short, then it sound like a (metallic) robot playing music:
398 A longer delay will sound like an open air concert in the mountains:
400 aecho=0.8:0.9:1000:0.3
404 Same as above but with one more mountain:
406 aecho=0.8:0.9:1000|1800:0.3|0.25
412 Apply fade-in/out effect to input audio.
414 A description of the accepted parameters follows.
418 Specify the effect type, can be either @code{in} for fade-in, or
419 @code{out} for a fade-out effect. Default is @code{in}.
421 @item start_sample, ss
422 Specify the number of the start sample for starting to apply the fade
423 effect. Default is 0.
426 Specify the number of samples for which the fade effect has to last. At
427 the end of the fade-in effect the output audio will have the same
428 volume as the input audio, at the end of the fade-out transition
429 the output audio will be silence. Default is 44100.
432 Specify time for starting to apply the fade effect. Default is 0.
433 The accepted syntax is:
435 [-]HH[:MM[:SS[.m...]]]
438 See also the function @code{av_parse_time()}.
439 If set this option is used instead of @var{start_sample} one.
442 Specify the duration for which the fade effect has to last. Default is 0.
443 The accepted syntax is:
445 [-]HH[:MM[:SS[.m...]]]
448 See also the function @code{av_parse_time()}.
449 At the end of the fade-in effect the output audio will have the same
450 volume as the input audio, at the end of the fade-out transition
451 the output audio will be silence.
452 If set this option is used instead of @var{nb_samples} one.
455 Set curve for fade transition.
457 It accepts the following values:
460 select triangular, linear slope (default)
462 select quarter of sine wave
464 select half of sine wave
466 select exponential sine wave
470 select inverted parabola
486 Fade in first 15 seconds of audio:
492 Fade out last 25 seconds of a 900 seconds audio:
494 afade=t=out:st=875:d=25
501 Set output format constraints for the input audio. The framework will
502 negotiate the most appropriate format to minimize conversions.
504 The filter accepts the following named parameters:
508 A '|'-separated list of requested sample formats.
511 A '|'-separated list of requested sample rates.
513 @item channel_layouts
514 A '|'-separated list of requested channel layouts.
518 If a parameter is omitted, all values are allowed.
520 For example to force the output to either unsigned 8-bit or signed 16-bit stereo:
522 aformat=sample_fmts=u8|s16:channel_layouts=stereo
527 Apply a two-pole all-pass filter with central frequency (in Hz)
528 @var{frequency}, and filter-width @var{width}.
529 An all-pass filter changes the audio's frequency to phase relationship
530 without changing its frequency to amplitude relationship.
532 The filter accepts the following options:
539 Set method to specify band-width of filter.
552 Specify the band-width of a filter in width_type units.
557 Merge two or more audio streams into a single multi-channel stream.
559 The filter accepts the following options:
564 Set the number of inputs. Default is 2.
568 If the channel layouts of the inputs are disjoint, and therefore compatible,
569 the channel layout of the output will be set accordingly and the channels
570 will be reordered as necessary. If the channel layouts of the inputs are not
571 disjoint, the output will have all the channels of the first input then all
572 the channels of the second input, in that order, and the channel layout of
573 the output will be the default value corresponding to the total number of
576 For example, if the first input is in 2.1 (FL+FR+LF) and the second input
577 is FC+BL+BR, then the output will be in 5.1, with the channels in the
578 following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
579 first input, b1 is the first channel of the second input).
581 On the other hand, if both input are in stereo, the output channels will be
582 in the default order: a1, a2, b1, b2, and the channel layout will be
583 arbitrarily set to 4.0, which may or may not be the expected value.
585 All inputs must have the same sample rate, and format.
587 If inputs do not have the same duration, the output will stop with the
594 Merge two mono files into a stereo stream:
596 amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
600 Multiple merges assuming 1 video stream and 6 audio streams in @file{input.mkv}:
602 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
608 Mixes multiple audio inputs into a single output.
612 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
614 will mix 3 input audio streams to a single output with the same duration as the
615 first input and a dropout transition time of 3 seconds.
617 The filter accepts the following named parameters:
621 Number of inputs. If unspecified, it defaults to 2.
624 How to determine the end-of-stream.
628 Duration of longest input. (default)
631 Duration of shortest input.
634 Duration of first input.
638 @item dropout_transition
639 Transition time, in seconds, for volume renormalization when an input
640 stream ends. The default value is 2 seconds.
646 Pass the audio source unchanged to the output.
650 Pad the end of a audio stream with silence, this can be used together with
651 -shortest to extend audio streams to the same length as the video stream.
654 Add a phasing effect to the input audio.
656 A phaser filter creates series of peaks and troughs in the frequency spectrum.
657 The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
659 A description of the accepted parameters follows.
663 Set input gain. Default is 0.4.
666 Set output gain. Default is 0.74
669 Set delay in milliseconds. Default is 3.0.
672 Set decay. Default is 0.4.
675 Set modulation speed in Hz. Default is 0.5.
678 Set modulation type. Default is triangular.
680 It accepts the following values:
690 Resample the input audio to the specified parameters, using the
691 libswresample library. If none are specified then the filter will
692 automatically convert between its input and output.
694 This filter is also able to stretch/squeeze the audio data to make it match
695 the timestamps or to inject silence / cut out audio to make it match the
696 timestamps, do a combination of both or do neither.
698 The filter accepts the syntax
699 [@var{sample_rate}:]@var{resampler_options}, where @var{sample_rate}
700 expresses a sample rate and @var{resampler_options} is a list of
701 @var{key}=@var{value} pairs, separated by ":". See the
702 ffmpeg-resampler manual for the complete list of supported options.
708 Resample the input audio to 44100Hz:
714 Stretch/squeeze samples to the given timestamps, with a maximum of 1000
715 samples per second compensation:
721 @section asetnsamples
723 Set the number of samples per each output audio frame.
725 The last output packet may contain a different number of samples, as
726 the filter will flush all the remaining samples when the input audio
729 The filter accepts the following options:
733 @item nb_out_samples, n
734 Set the number of frames per each output audio frame. The number is
735 intended as the number of samples @emph{per each channel}.
736 Default value is 1024.
739 If set to 1, the filter will pad the last audio frame with zeroes, so
740 that the last frame will contain the same number of samples as the
741 previous ones. Default value is 1.
744 For example, to set the number of per-frame samples to 1234 and
745 disable padding for the last frame, use:
747 asetnsamples=n=1234:p=0
752 Set the sample rate without altering the PCM data.
753 This will result in a change of speed and pitch.
755 The filter accepts the following options:
759 Set the output sample rate. Default is 44100 Hz.
764 Show a line containing various information for each input audio frame.
765 The input audio is not modified.
767 The shown line contains a sequence of key/value pairs of the form
768 @var{key}:@var{value}.
770 A description of each shown parameter follows:
774 sequential number of the input frame, starting from 0
777 Presentation timestamp of the input frame, in time base units; the time base
778 depends on the filter input pad, and is usually 1/@var{sample_rate}.
781 presentation timestamp of the input frame in seconds
784 position of the frame in the input stream, -1 if this information in
785 unavailable and/or meaningless (for example in case of synthetic audio)
794 sample rate for the audio frame
797 number of samples (per channel) in the frame
800 Adler-32 checksum (printed in hexadecimal) of the audio data. For planar audio
801 the data is treated as if all the planes were concatenated.
803 @item plane_checksums
804 A list of Adler-32 checksums for each data plane.
809 Display time domain statistical information about the audio channels.
810 Statistics are calculated and displayed for each audio channel and,
811 where applicable, an overall figure is also given.
813 The filter accepts the following option:
816 Short window length in seconds, used for peak and trough RMS measurement.
817 Default is @code{0.05} (50 miliseconds). Allowed range is @code{[0.1 - 10]}.
820 A description of each shown parameter follows:
824 Mean amplitude displacement from zero.
827 Minimal sample level.
830 Maximal sample level.
834 Standard peak and RMS level measured in dBFS.
838 Peak and trough values for RMS level measured over a short window.
841 Standard ratio of peak to RMS level (note: not in dB).
844 Flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
845 (i.e. either @var{Min level} or @var{Max level}).
848 Number of occasions (not the number of samples) that the signal attained either
849 @var{Min level} or @var{Max level}.
854 Forward two audio streams and control the order the buffers are forwarded.
856 The filter accepts the following options:
860 Set the expression deciding which stream should be
861 forwarded next: if the result is negative, the first stream is forwarded; if
862 the result is positive or zero, the second stream is forwarded. It can use
863 the following variables:
867 number of buffers forwarded so far on each stream
869 number of samples forwarded so far on each stream
871 current timestamp of each stream
874 The default value is @code{t1-t2}, which means to always forward the stream
875 that has a smaller timestamp.
880 Stress-test @code{amerge} by randomly sending buffers on the wrong
881 input, while avoiding too much of a desynchronization:
883 amovie=file.ogg [a] ; amovie=file.mp3 [b] ;
884 [a] [b] astreamsync=(2*random(1))-1+tanh(5*(t1-t2)) [a2] [b2] ;
890 Synchronize audio data with timestamps by squeezing/stretching it and/or
891 dropping samples/adding silence when needed.
893 This filter is not built by default, please use @ref{aresample} to do squeezing/stretching.
895 The filter accepts the following named parameters:
899 Enable stretching/squeezing the data to make it match the timestamps. Disabled
900 by default. When disabled, time gaps are covered with silence.
903 Minimum difference between timestamps and audio data (in seconds) to trigger
904 adding/dropping samples. Default value is 0.1. If you get non-perfect sync with
905 this filter, try setting this parameter to 0.
908 Maximum compensation in samples per second. Relevant only with compensate=1.
912 Assume the first pts should be this value. The time base is 1 / sample rate.
913 This allows for padding/trimming at the start of stream. By default, no
914 assumption is made about the first frame's expected pts, so no padding or
915 trimming is done. For example, this could be set to 0 to pad the beginning with
916 silence if an audio stream starts after the video stream or to trim any samples
917 with a negative pts due to encoder delay.
925 The filter accepts exactly one parameter, the audio tempo. If not
926 specified then the filter will assume nominal 1.0 tempo. Tempo must
927 be in the [0.5, 2.0] range.
933 Slow down audio to 80% tempo:
939 To speed up audio to 125% tempo:
947 Trim the input so that the output contains one continuous subpart of the input.
949 This filter accepts the following options:
952 Timestamp (in seconds) of the start of the kept section. I.e. the audio sample
953 with the timestamp @var{start} will be the first sample in the output.
956 Timestamp (in seconds) of the first audio sample that will be dropped. I.e. the
957 audio sample immediately preceding the one with the timestamp @var{end} will be
958 the last sample in the output.
961 Same as @var{start}, except this option sets the start timestamp in samples
965 Same as @var{end}, except this option sets the end timestamp in samples instead
969 Maximum duration of the output in seconds.
972 Number of the first sample that should be passed to output.
975 Number of the first sample that should be dropped.
978 Note that the first two sets of the start/end options and the @option{duration}
979 option look at the frame timestamp, while the _sample options simply count the
980 samples that pass through the filter. So start/end_pts and start/end_sample will
981 give different results when the timestamps are wrong, inexact or do not start at
982 zero. Also note that this filter does not modify the timestamps. If you wish
983 that the output timestamps start at zero, insert the asetpts filter after the
986 If multiple start or end options are set, this filter tries to be greedy and
987 keep all samples that match at least one of the specified constraints. To keep
988 only the part that matches all the constraints at once, chain multiple atrim
991 The defaults are such that all the input is kept. So it is possible to set e.g.
992 just the end values to keep everything before the specified time.
997 drop everything except the second minute of input
999 ffmpeg -i INPUT -af atrim=60:120
1003 keep only the first 1000 samples
1005 ffmpeg -i INPUT -af atrim=end_sample=1000
1012 Apply a two-pole Butterworth band-pass filter with central
1013 frequency @var{frequency}, and (3dB-point) band-width width.
1014 The @var{csg} option selects a constant skirt gain (peak gain = Q)
1015 instead of the default: constant 0dB peak gain.
1016 The filter roll off at 6dB per octave (20dB per decade).
1018 The filter accepts the following options:
1022 Set the filter's central frequency. Default is @code{3000}.
1025 Constant skirt gain if set to 1. Defaults to 0.
1028 Set method to specify band-width of filter.
1041 Specify the band-width of a filter in width_type units.
1046 Apply a two-pole Butterworth band-reject filter with central
1047 frequency @var{frequency}, and (3dB-point) band-width @var{width}.
1048 The filter roll off at 6dB per octave (20dB per decade).
1050 The filter accepts the following options:
1054 Set the filter's central frequency. Default is @code{3000}.
1057 Set method to specify band-width of filter.
1070 Specify the band-width of a filter in width_type units.
1075 Boost or cut the bass (lower) frequencies of the audio using a two-pole
1076 shelving filter with a response similar to that of a standard
1077 hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
1079 The filter accepts the following options:
1083 Give the gain at 0 Hz. Its useful range is about -20
1084 (for a large cut) to +20 (for a large boost).
1085 Beware of clipping when using a positive gain.
1088 Set the filter's central frequency and so can be used
1089 to extend or reduce the frequency range to be boosted or cut.
1090 The default value is @code{100} Hz.
1093 Set method to specify band-width of filter.
1106 Determine how steep is the filter's shelf transition.
1111 Apply a biquad IIR filter with the given coefficients.
1112 Where @var{b0}, @var{b1}, @var{b2} and @var{a0}, @var{a1}, @var{a2}
1113 are the numerator and denominator coefficients respectively.
1117 Remap input channels to new locations.
1119 This filter accepts the following named parameters:
1121 @item channel_layout
1122 Channel layout of the output stream.
1125 Map channels from input to output. The argument is a '|'-separated list of
1126 mappings, each in the @code{@var{in_channel}-@var{out_channel}} or
1127 @var{in_channel} form. @var{in_channel} can be either the name of the input
1128 channel (e.g. FL for front left) or its index in the input channel layout.
1129 @var{out_channel} is the name of the output channel or its index in the output
1130 channel layout. If @var{out_channel} is not given then it is implicitly an
1131 index, starting with zero and increasing by one for each mapping.
1134 If no mapping is present, the filter will implicitly map input channels to
1135 output channels preserving index.
1137 For example, assuming a 5.1+downmix input MOV file
1139 ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
1141 will create an output WAV file tagged as stereo from the downmix channels of
1144 To fix a 5.1 WAV improperly encoded in AAC's native channel order
1146 ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:channel_layout=5.1' out.wav
1149 @section channelsplit
1151 Split each channel in input audio stream into a separate output stream.
1153 This filter accepts the following named parameters:
1155 @item channel_layout
1156 Channel layout of the input stream. Default is "stereo".
1159 For example, assuming a stereo input MP3 file
1161 ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
1163 will create an output Matroska file with two audio streams, one containing only
1164 the left channel and the other the right channel.
1166 To split a 5.1 WAV file into per-channel files
1168 ffmpeg -i in.wav -filter_complex
1169 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
1170 -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
1171 front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
1177 Make audio easier to listen to on headphones.
1179 This filter adds `cues' to 44.1kHz stereo (i.e. audio CD format) audio
1180 so that when listened to on headphones the stereo image is moved from
1181 inside your head (standard for headphones) to outside and in front of
1182 the listener (standard for speakers).
1188 Apply a two-pole peaking equalisation (EQ) filter. With this
1189 filter, the signal-level at and around a selected frequency can
1190 be increased or decreased, whilst (unlike bandpass and bandreject
1191 filters) that at all other frequencies is unchanged.
1193 In order to produce complex equalisation curves, this filter can
1194 be given several times, each with a different central frequency.
1196 The filter accepts the following options:
1200 Set the filter's central frequency in Hz.
1203 Set method to specify band-width of filter.
1216 Specify the band-width of a filter in width_type units.
1219 Set the required gain or attenuation in dB.
1220 Beware of clipping when using a positive gain.
1225 Apply a high-pass filter with 3dB point frequency.
1226 The filter can be either single-pole, or double-pole (the default).
1227 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
1229 The filter accepts the following options:
1233 Set frequency in Hz. Default is 3000.
1236 Set number of poles. Default is 2.
1239 Set method to specify band-width of filter.
1252 Specify the band-width of a filter in width_type units.
1253 Applies only to double-pole filter.
1254 The default is 0.707q and gives a Butterworth response.
1259 Join multiple input streams into one multi-channel stream.
1261 The filter accepts the following named parameters:
1265 Number of input streams. Defaults to 2.
1267 @item channel_layout
1268 Desired output channel layout. Defaults to stereo.
1271 Map channels from inputs to output. The argument is a '|'-separated list of
1272 mappings, each in the @code{@var{input_idx}.@var{in_channel}-@var{out_channel}}
1273 form. @var{input_idx} is the 0-based index of the input stream. @var{in_channel}
1274 can be either the name of the input channel (e.g. FL for front left) or its
1275 index in the specified input stream. @var{out_channel} is the name of the output
1279 The filter will attempt to guess the mappings when those are not specified
1280 explicitly. It does so by first trying to find an unused matching input channel
1281 and if that fails it picks the first unused input channel.
1283 E.g. to join 3 inputs (with properly set channel layouts)
1285 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
1288 To build a 5.1 output from 6 single-channel streams:
1290 ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
1291 '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'
1297 Apply a low-pass filter with 3dB point frequency.
1298 The filter can be either single-pole or double-pole (the default).
1299 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
1301 The filter accepts the following options:
1305 Set frequency in Hz. Default is 500.
1308 Set number of poles. Default is 2.
1311 Set method to specify band-width of filter.
1324 Specify the band-width of a filter in width_type units.
1325 Applies only to double-pole filter.
1326 The default is 0.707q and gives a Butterworth response.
1331 Mix channels with specific gain levels. The filter accepts the output
1332 channel layout followed by a set of channels definitions.
1334 This filter is also designed to remap efficiently the channels of an audio
1337 The filter accepts parameters of the form:
1338 "@var{l}:@var{outdef}:@var{outdef}:..."
1342 output channel layout or number of channels
1345 output channel specification, of the form:
1346 "@var{out_name}=[@var{gain}*]@var{in_name}[+[@var{gain}*]@var{in_name}...]"
1349 output channel to define, either a channel name (FL, FR, etc.) or a channel
1350 number (c0, c1, etc.)
1353 multiplicative coefficient for the channel, 1 leaving the volume unchanged
1356 input channel to use, see out_name for details; it is not possible to mix
1357 named and numbered input channels
1360 If the `=' in a channel specification is replaced by `<', then the gains for
1361 that specification will be renormalized so that the total is 1, thus
1362 avoiding clipping noise.
1364 @subsection Mixing examples
1366 For example, if you want to down-mix from stereo to mono, but with a bigger
1367 factor for the left channel:
1369 pan=1:c0=0.9*c0+0.1*c1
1372 A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
1373 7-channels surround:
1375 pan=stereo: FL < FL + 0.5*FC + 0.6*BL + 0.6*SL : FR < FR + 0.5*FC + 0.6*BR + 0.6*SR
1378 Note that @command{ffmpeg} integrates a default down-mix (and up-mix) system
1379 that should be preferred (see "-ac" option) unless you have very specific
1382 @subsection Remapping examples
1384 The channel remapping will be effective if, and only if:
1387 @item gain coefficients are zeroes or ones,
1388 @item only one input per channel output,
1391 If all these conditions are satisfied, the filter will notify the user ("Pure
1392 channel mapping detected"), and use an optimized and lossless method to do the
1395 For example, if you have a 5.1 source and want a stereo audio stream by
1396 dropping the extra channels:
1398 pan="stereo: c0=FL : c1=FR"
1401 Given the same source, you can also switch front left and front right channels
1402 and keep the input channel layout:
1404 pan="5.1: c0=c1 : c1=c0 : c2=c2 : c3=c3 : c4=c4 : c5=c5"
1407 If the input is a stereo audio stream, you can mute the front left channel (and
1408 still keep the stereo channel layout) with:
1413 Still with a stereo audio stream input, you can copy the right channel in both
1414 front left and right:
1416 pan="stereo: c0=FR : c1=FR"
1421 Convert the audio sample format, sample rate and channel layout. This filter is
1422 not meant to be used directly.
1424 @section silencedetect
1426 Detect silence in an audio stream.
1428 This filter logs a message when it detects that the input audio volume is less
1429 or equal to a noise tolerance value for a duration greater or equal to the
1430 minimum detected noise duration.
1432 The printed times and duration are expressed in seconds.
1434 The filter accepts the following options:
1438 Set silence duration until notification (default is 2 seconds).
1441 Set noise tolerance. Can be specified in dB (in case "dB" is appended to the
1442 specified value) or amplitude ratio. Default is -60dB, or 0.001.
1445 @subsection Examples
1449 Detect 5 seconds of silence with -50dB noise tolerance:
1451 silencedetect=n=-50dB:d=5
1455 Complete example with @command{ffmpeg} to detect silence with 0.0001 noise
1456 tolerance in @file{silence.mp3}:
1458 ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
1464 Boost or cut treble (upper) frequencies of the audio using a two-pole
1465 shelving filter with a response similar to that of a standard
1466 hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
1468 The filter accepts the following options:
1472 Give the gain at whichever is the lower of ~22 kHz and the
1473 Nyquist frequency. Its useful range is about -20 (for a large cut)
1474 to +20 (for a large boost). Beware of clipping when using a positive gain.
1477 Set the filter's central frequency and so can be used
1478 to extend or reduce the frequency range to be boosted or cut.
1479 The default value is @code{3000} Hz.
1482 Set method to specify band-width of filter.
1495 Determine how steep is the filter's shelf transition.
1500 Adjust the input audio volume.
1502 The filter accepts the following options:
1507 Expresses how the audio volume will be increased or decreased.
1509 Output values are clipped to the maximum value.
1511 The output audio volume is given by the relation:
1513 @var{output_volume} = @var{volume} * @var{input_volume}
1516 Default value for @var{volume} is 1.0.
1519 Set the mathematical precision.
1521 This determines which input sample formats will be allowed, which affects the
1522 precision of the volume scaling.
1526 8-bit fixed-point; limits input sample format to U8, S16, and S32.
1528 32-bit floating-point; limits input sample format to FLT. (default)
1530 64-bit floating-point; limits input sample format to DBL.
1534 @subsection Examples
1538 Halve the input audio volume:
1542 volume=volume=-6.0206dB
1545 In all the above example the named key for @option{volume} can be
1546 omitted, for example like in:
1552 Increase input audio power by 6 decibels using fixed-point precision:
1554 volume=volume=6dB:precision=fixed
1558 @section volumedetect
1560 Detect the volume of the input video.
1562 The filter has no parameters. The input is not modified. Statistics about
1563 the volume will be printed in the log when the input stream end is reached.
1565 In particular it will show the mean volume (root mean square), maximum
1566 volume (on a per-sample basis), and the beginning of an histogram of the
1567 registered volume values (from the maximum value to a cumulated 1/1000 of
1570 All volumes are in decibels relative to the maximum PCM value.
1572 @subsection Examples
1574 Here is an excerpt of the output:
1576 [Parsed_volumedetect_0 @ 0xa23120] mean_volume: -27 dB
1577 [Parsed_volumedetect_0 @ 0xa23120] max_volume: -4 dB
1578 [Parsed_volumedetect_0 @ 0xa23120] histogram_4db: 6
1579 [Parsed_volumedetect_0 @ 0xa23120] histogram_5db: 62
1580 [Parsed_volumedetect_0 @ 0xa23120] histogram_6db: 286
1581 [Parsed_volumedetect_0 @ 0xa23120] histogram_7db: 1042
1582 [Parsed_volumedetect_0 @ 0xa23120] histogram_8db: 2551
1583 [Parsed_volumedetect_0 @ 0xa23120] histogram_9db: 4609
1584 [Parsed_volumedetect_0 @ 0xa23120] histogram_10db: 8409
1590 The mean square energy is approximately -27 dB, or 10^-2.7.
1592 The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
1594 There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
1597 In other words, raising the volume by +4 dB does not cause any clipping,
1598 raising it by +5 dB causes clipping for 6 samples, etc.
1600 @c man end AUDIO FILTERS
1602 @chapter Audio Sources
1603 @c man begin AUDIO SOURCES
1605 Below is a description of the currently available audio sources.
1609 Buffer audio frames, and make them available to the filter chain.
1611 This source is mainly intended for a programmatic use, in particular
1612 through the interface defined in @file{libavfilter/asrc_abuffer.h}.
1614 It accepts the following named parameters:
1619 Timebase which will be used for timestamps of submitted frames. It must be
1620 either a floating-point number or in @var{numerator}/@var{denominator} form.
1623 The sample rate of the incoming audio buffers.
1626 The sample format of the incoming audio buffers.
1627 Either a sample format name or its corresponging integer representation from
1628 the enum AVSampleFormat in @file{libavutil/samplefmt.h}
1630 @item channel_layout
1631 The channel layout of the incoming audio buffers.
1632 Either a channel layout name from channel_layout_map in
1633 @file{libavutil/channel_layout.c} or its corresponding integer representation
1634 from the AV_CH_LAYOUT_* macros in @file{libavutil/channel_layout.h}
1637 The number of channels of the incoming audio buffers.
1638 If both @var{channels} and @var{channel_layout} are specified, then they
1643 @subsection Examples
1646 abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
1649 will instruct the source to accept planar 16bit signed stereo at 44100Hz.
1650 Since the sample format with name "s16p" corresponds to the number
1651 6 and the "stereo" channel layout corresponds to the value 0x3, this is
1654 abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
1659 Generate an audio signal specified by an expression.
1661 This source accepts in input one or more expressions (one for each
1662 channel), which are evaluated and used to generate a corresponding
1665 This source accepts the following options:
1669 Set the '|'-separated expressions list for each separate channel. In case the
1670 @option{channel_layout} option is not specified, the selected channel layout
1671 depends on the number of provided expressions.
1673 @item channel_layout, c
1674 Set the channel layout. The number of channels in the specified layout
1675 must be equal to the number of specified expressions.
1678 Set the minimum duration of the sourced audio. See the function
1679 @code{av_parse_time()} for the accepted format.
1680 Note that the resulting duration may be greater than the specified
1681 duration, as the generated audio is always cut at the end of a
1684 If not specified, or the expressed duration is negative, the audio is
1685 supposed to be generated forever.
1688 Set the number of samples per channel per each output frame,
1691 @item sample_rate, s
1692 Specify the sample rate, default to 44100.
1695 Each expression in @var{exprs} can contain the following constants:
1699 number of the evaluated sample, starting from 0
1702 time of the evaluated sample expressed in seconds, starting from 0
1709 @subsection Examples
1719 Generate a sin signal with frequency of 440 Hz, set sample rate to
1722 aevalsrc="sin(440*2*PI*t):s=8000"
1726 Generate a two channels signal, specify the channel layout (Front
1727 Center + Back Center) explicitly:
1729 aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC"
1733 Generate white noise:
1735 aevalsrc="-2+random(0)"
1739 Generate an amplitude modulated signal:
1741 aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)"
1745 Generate 2.5 Hz binaural beats on a 360 Hz carrier:
1747 aevalsrc="0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)"
1754 Null audio source, return unprocessed audio frames. It is mainly useful
1755 as a template and to be employed in analysis / debugging tools, or as
1756 the source for filters which ignore the input data (for example the sox
1759 This source accepts the following options:
1763 @item channel_layout, cl
1765 Specify the channel layout, and can be either an integer or a string
1766 representing a channel layout. The default value of @var{channel_layout}
1769 Check the channel_layout_map definition in
1770 @file{libavutil/channel_layout.c} for the mapping between strings and
1771 channel layout values.
1773 @item sample_rate, r
1774 Specify the sample rate, and defaults to 44100.
1777 Set the number of samples per requested frames.
1781 @subsection Examples
1785 Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
1787 anullsrc=r=48000:cl=4
1791 Do the same operation with a more obvious syntax:
1793 anullsrc=r=48000:cl=mono
1797 All the parameters need to be explicitly defined.
1801 Synthesize a voice utterance using the libflite library.
1803 To enable compilation of this filter you need to configure FFmpeg with
1804 @code{--enable-libflite}.
1806 Note that the flite library is not thread-safe.
1808 The filter accepts the following options:
1813 If set to 1, list the names of the available voices and exit
1814 immediately. Default value is 0.
1817 Set the maximum number of samples per frame. Default value is 512.
1820 Set the filename containing the text to speak.
1823 Set the text to speak.
1826 Set the voice to use for the speech synthesis. Default value is
1827 @code{kal}. See also the @var{list_voices} option.
1830 @subsection Examples
1834 Read from file @file{speech.txt}, and synthetize the text using the
1835 standard flite voice:
1837 flite=textfile=speech.txt
1841 Read the specified text selecting the @code{slt} voice:
1843 flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
1847 Input text to ffmpeg:
1849 ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
1853 Make @file{ffplay} speak the specified text, using @code{flite} and
1854 the @code{lavfi} device:
1856 ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
1860 For more information about libflite, check:
1861 @url{http://www.speech.cs.cmu.edu/flite/}
1865 Generate an audio signal made of a sine wave with amplitude 1/8.
1867 The audio signal is bit-exact.
1869 The filter accepts the following options:
1874 Set the carrier frequency. Default is 440 Hz.
1876 @item beep_factor, b
1877 Enable a periodic beep every second with frequency @var{beep_factor} times
1878 the carrier frequency. Default is 0, meaning the beep is disabled.
1880 @item sample_rate, s
1881 Specify the sample rate, default is 44100.
1884 Specify the duration of the generated audio stream.
1886 @item samples_per_frame
1887 Set the number of samples per output frame, default is 1024.
1890 @subsection Examples
1895 Generate a simple 440 Hz sine wave:
1901 Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
1905 sine=frequency=220:beep_factor=4:duration=5
1910 @c man end AUDIO SOURCES
1912 @chapter Audio Sinks
1913 @c man begin AUDIO SINKS
1915 Below is a description of the currently available audio sinks.
1917 @section abuffersink
1919 Buffer audio frames, and make them available to the end of filter chain.
1921 This sink is mainly intended for programmatic use, in particular
1922 through the interface defined in @file{libavfilter/buffersink.h}
1923 or the options system.
1925 It accepts a pointer to an AVABufferSinkContext structure, which
1926 defines the incoming buffers' formats, to be passed as the opaque
1927 parameter to @code{avfilter_init_filter} for initialization.
1931 Null audio sink, do absolutely nothing with the input audio. It is
1932 mainly useful as a template and to be employed in analysis / debugging
1935 @c man end AUDIO SINKS
1937 @chapter Video Filters
1938 @c man begin VIDEO FILTERS
1940 When you configure your FFmpeg build, you can disable any of the
1941 existing filters using @code{--disable-filters}.
1942 The configure output will show the video filters included in your
1945 Below is a description of the currently available video filters.
1947 @section alphaextract
1949 Extract the alpha component from the input as a grayscale video. This
1950 is especially useful with the @var{alphamerge} filter.
1954 Add or replace the alpha component of the primary input with the
1955 grayscale value of a second input. This is intended for use with
1956 @var{alphaextract} to allow the transmission or storage of frame
1957 sequences that have alpha in a format that doesn't support an alpha
1960 For example, to reconstruct full frames from a normal YUV-encoded video
1961 and a separate video created with @var{alphaextract}, you might use:
1963 movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
1966 Since this filter is designed for reconstruction, it operates on frame
1967 sequences without considering timestamps, and terminates when either
1968 input reaches end of stream. This will cause problems if your encoding
1969 pipeline drops frames. If you're trying to apply an image as an
1970 overlay to a video stream, consider the @var{overlay} filter instead.
1974 Same as the @ref{subtitles} filter, except that it doesn't require libavcodec
1975 and libavformat to work. On the other hand, it is limited to ASS (Advanced
1976 Substation Alpha) subtitles files.
1980 Compute the bounding box for the non-black pixels in the input frame
1983 This filter computes the bounding box containing all the pixels with a
1984 luminance value greater than the minimum allowed value.
1985 The parameters describing the bounding box are printed on the filter
1988 The filter accepts the following option:
1992 Set the minimal luminance value. Default is @code{16}.
1995 @section blackdetect
1997 Detect video intervals that are (almost) completely black. Can be
1998 useful to detect chapter transitions, commercials, or invalid
1999 recordings. Output lines contains the time for the start, end and
2000 duration of the detected black interval expressed in seconds.
2002 In order to display the output lines, you need to set the loglevel at
2003 least to the AV_LOG_INFO value.
2005 The filter accepts the following options:
2008 @item black_min_duration, d
2009 Set the minimum detected black duration expressed in seconds. It must
2010 be a non-negative floating point number.
2012 Default value is 2.0.
2014 @item picture_black_ratio_th, pic_th
2015 Set the threshold for considering a picture "black".
2016 Express the minimum value for the ratio:
2018 @var{nb_black_pixels} / @var{nb_pixels}
2021 for which a picture is considered black.
2022 Default value is 0.98.
2024 @item pixel_black_th, pix_th
2025 Set the threshold for considering a pixel "black".
2027 The threshold expresses the maximum pixel luminance value for which a
2028 pixel is considered "black". The provided value is scaled according to
2029 the following equation:
2031 @var{absolute_threshold} = @var{luminance_minimum_value} + @var{pixel_black_th} * @var{luminance_range_size}
2034 @var{luminance_range_size} and @var{luminance_minimum_value} depend on
2035 the input video format, the range is [0-255] for YUV full-range
2036 formats and [16-235] for YUV non full-range formats.
2038 Default value is 0.10.
2041 The following example sets the maximum pixel threshold to the minimum
2042 value, and detects only black intervals of 2 or more seconds:
2044 blackdetect=d=2:pix_th=0.00
2049 Detect frames that are (almost) completely black. Can be useful to
2050 detect chapter transitions or commercials. Output lines consist of
2051 the frame number of the detected frame, the percentage of blackness,
2052 the position in the file if known or -1 and the timestamp in seconds.
2054 In order to display the output lines, you need to set the loglevel at
2055 least to the AV_LOG_INFO value.
2057 The filter accepts the following options:
2062 Set the percentage of the pixels that have to be below the threshold, defaults
2065 @item threshold, thresh
2066 Set the threshold below which a pixel value is considered black, defaults to
2073 Blend two video frames into each other.
2075 It takes two input streams and outputs one stream, the first input is the
2076 "top" layer and second input is "bottom" layer.
2077 Output terminates when shortest input terminates.
2079 A description of the accepted options follows.
2087 Set blend mode for specific pixel component or all pixel components in case
2088 of @var{all_mode}. Default value is @code{normal}.
2090 Available values for component modes are:
2123 Set blend opacity for specific pixel component or all pixel components in case
2124 of @var{all_opacity}. Only used in combination with pixel component blend modes.
2131 Set blend expression for specific pixel component or all pixel components in case
2132 of @var{all_expr}. Note that related mode options will be ignored if those are set.
2134 The expressions can use the following variables:
2138 The sequential number of the filtered frame, starting from @code{0}.
2142 the coordinates of the current sample
2146 the width and height of currently filtered plane
2150 Width and height scale depending on the currently filtered plane. It is the
2151 ratio between the corresponding luma plane number of pixels and the current
2152 plane ones. E.g. for YUV4:2:0 the values are @code{1,1} for the luma plane, and
2153 @code{0.5,0.5} for chroma planes.
2156 Time of the current frame, expressed in seconds.
2159 Value of pixel component at current location for first video frame (top layer).
2162 Value of pixel component at current location for second video frame (bottom layer).
2166 Force termination when the shortest input terminates. Default is @code{0}.
2168 Continue applying the last bottom frame after the end of the stream. A value of
2169 @code{0} disable the filter after the last frame of the bottom layer is reached.
2170 Default is @code{1}.
2173 @subsection Examples
2177 Apply transition from bottom layer to top layer in first 10 seconds:
2179 blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
2183 Apply 1x1 checkerboard effect:
2185 blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
2191 Apply boxblur algorithm to the input video.
2193 The filter accepts the following options:
2197 @item luma_radius, lr
2198 @item luma_power, lp
2199 @item chroma_radius, cr
2200 @item chroma_power, cp
2201 @item alpha_radius, ar
2202 @item alpha_power, ap
2206 A description of the accepted options follows.
2209 @item luma_radius, lr
2210 @item chroma_radius, cr
2211 @item alpha_radius, ar
2212 Set an expression for the box radius in pixels used for blurring the
2213 corresponding input plane.
2215 The radius value must be a non-negative number, and must not be
2216 greater than the value of the expression @code{min(w,h)/2} for the
2217 luma and alpha planes, and of @code{min(cw,ch)/2} for the chroma
2220 Default value for @option{luma_radius} is "2". If not specified,
2221 @option{chroma_radius} and @option{alpha_radius} default to the
2222 corresponding value set for @option{luma_radius}.
2224 The expressions can contain the following constants:
2228 the input width and height in pixels
2232 the input chroma image width and height in pixels
2236 horizontal and vertical chroma subsample values. For example for the
2237 pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
2240 @item luma_power, lp
2241 @item chroma_power, cp
2242 @item alpha_power, ap
2243 Specify how many times the boxblur filter is applied to the
2244 corresponding plane.
2246 Default value for @option{luma_power} is 2. If not specified,
2247 @option{chroma_power} and @option{alpha_power} default to the
2248 corresponding value set for @option{luma_power}.
2250 A value of 0 will disable the effect.
2253 @subsection Examples
2257 Apply a boxblur filter with luma, chroma, and alpha radius
2260 boxblur=luma_radius=2:luma_power=1
2265 Set luma radius to 2, alpha and chroma radius to 0:
2267 boxblur=2:1:cr=0:ar=0
2271 Set luma and chroma radius to a fraction of the video dimension:
2273 boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
2277 @section colorbalance
2278 Modify intensity of primary colors (red, green and blue) of input frames.
2280 The filter allows an input frame to be adjusted in the shadows, midtones or highlights
2281 regions for the red-cyan, green-magenta or blue-yellow balance.
2283 A positive adjustment value shifts the balance towards the primary color, a negative
2284 value towards the complementary color.
2286 The filter accepts the following options:
2292 Adjust red, green and blue shadows (darkest pixels).
2297 Adjust red, green and blue midtones (medium pixels).
2302 Adjust red, green and blue highlights (brightest pixels).
2304 Allowed ranges for options are @code{[-1.0, 1.0]}. Defaults are @code{0}.
2307 @subsection Examples
2311 Add red color cast to shadows:
2317 @section colorchannelmixer
2319 Adjust video input frames by re-mixing color channels.
2321 This filter modifies a color channel by adding the values associated to
2322 the other channels of the same pixels. For example if the value to
2323 modify is red, the output value will be:
2325 @var{red}=@var{red}*@var{rr} + @var{blue}*@var{rb} + @var{green}*@var{rg} + @var{alpha}*@var{ra}
2328 The filter accepts the following options:
2335 Adjust contribution of input red, green, blue and alpha channels for output red channel.
2336 Default is @code{1} for @var{rr}, and @code{0} for @var{rg}, @var{rb} and @var{ra}.
2342 Adjust contribution of input red, green, blue and alpha channels for output green channel.
2343 Default is @code{1} for @var{gg}, and @code{0} for @var{gr}, @var{gb} and @var{ga}.
2349 Adjust contribution of input red, green, blue and alpha channels for output blue channel.
2350 Default is @code{1} for @var{bb}, and @code{0} for @var{br}, @var{bg} and @var{ba}.
2356 Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
2357 Default is @code{1} for @var{aa}, and @code{0} for @var{ar}, @var{ag} and @var{ab}.
2359 Allowed ranges for options are @code{[-2.0, 2.0]}.
2362 @subsection Examples
2366 Convert source to grayscale:
2368 colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
2372 @section colormatrix
2374 Convert color matrix.
2376 The filter accepts the following options:
2381 Specify the source and destination color matrix. Both values must be
2384 The accepted values are:
2400 For example to convert from BT.601 to SMPTE-240M, use the command:
2402 colormatrix=bt601:smpte240m
2407 Copy the input source unchanged to the output. Mainly useful for
2412 Crop the input video to given dimensions.
2414 The filter accepts the following options:
2418 Width of the output video. It defaults to @code{iw}.
2419 This expression is evaluated only once during the filter
2423 Height of the output video. It defaults to @code{ih}.
2424 This expression is evaluated only once during the filter
2428 Horizontal position, in the input video, of the left edge of the output video.
2429 It defaults to @code{(in_w-out_w)/2}.
2430 This expression is evaluated per-frame.
2433 Vertical position, in the input video, of the top edge of the output video.
2434 It defaults to @code{(in_h-out_h)/2}.
2435 This expression is evaluated per-frame.
2438 If set to 1 will force the output display aspect ratio
2439 to be the same of the input, by changing the output sample aspect
2440 ratio. It defaults to 0.
2443 The @var{out_w}, @var{out_h}, @var{x}, @var{y} parameters are
2444 expressions containing the following constants:
2449 the computed values for @var{x} and @var{y}. They are evaluated for
2454 the input width and height
2458 same as @var{in_w} and @var{in_h}
2462 the output (cropped) width and height
2466 same as @var{out_w} and @var{out_h}
2469 same as @var{iw} / @var{ih}
2472 input sample aspect ratio
2475 input display aspect ratio, it is the same as (@var{iw} / @var{ih}) * @var{sar}
2479 horizontal and vertical chroma subsample values. For example for the
2480 pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
2483 the number of input frame, starting from 0
2486 the position in the file of the input frame, NAN if unknown
2489 timestamp expressed in seconds, NAN if the input timestamp is unknown
2493 The expression for @var{out_w} may depend on the value of @var{out_h},
2494 and the expression for @var{out_h} may depend on @var{out_w}, but they
2495 cannot depend on @var{x} and @var{y}, as @var{x} and @var{y} are
2496 evaluated after @var{out_w} and @var{out_h}.
2498 The @var{x} and @var{y} parameters specify the expressions for the
2499 position of the top-left corner of the output (non-cropped) area. They
2500 are evaluated for each frame. If the evaluated value is not valid, it
2501 is approximated to the nearest valid value.
2503 The expression for @var{x} may depend on @var{y}, and the expression
2504 for @var{y} may depend on @var{x}.
2506 @subsection Examples
2510 Crop area with size 100x100 at position (12,34).
2515 Using named options, the example above becomes:
2517 crop=w=100:h=100:x=12:y=34
2521 Crop the central input area with size 100x100:
2527 Crop the central input area with size 2/3 of the input video:
2529 crop=2/3*in_w:2/3*in_h
2533 Crop the input video central square:
2540 Delimit the rectangle with the top-left corner placed at position
2541 100:100 and the right-bottom corner corresponding to the right-bottom
2542 corner of the input image:
2544 crop=in_w-100:in_h-100:100:100
2548 Crop 10 pixels from the left and right borders, and 20 pixels from
2549 the top and bottom borders
2551 crop=in_w-2*10:in_h-2*20
2555 Keep only the bottom right quarter of the input image:
2557 crop=in_w/2:in_h/2:in_w/2:in_h/2
2561 Crop height for getting Greek harmony:
2563 crop=in_w:1/PHI*in_w
2567 Appply trembling effect:
2569 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)
2573 Apply erratic camera effect depending on timestamp:
2575 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)"
2579 Set x depending on the value of y:
2581 crop=in_w/2:in_h/2:y:10+10*sin(n/10)
2587 Auto-detect crop size.
2589 Calculate necessary cropping parameters and prints the recommended
2590 parameters through the logging system. The detected dimensions
2591 correspond to the non-black area of the input video.
2593 The filter accepts the following options:
2598 Set higher black value threshold, which can be optionally specified
2599 from nothing (0) to everything (255). An intensity value greater
2600 to the set value is considered non-black. Default value is 24.
2603 Set the value for which the width/height should be divisible by. The
2604 offset is automatically adjusted to center the video. Use 2 to get
2605 only even dimensions (needed for 4:2:2 video). 16 is best when
2606 encoding to most video codecs. Default value is 16.
2608 @item reset_count, reset
2609 Set the counter that determines after how many frames cropdetect will
2610 reset the previously detected largest video area and start over to
2611 detect the current optimal crop area. Default value is 0.
2613 This can be useful when channel logos distort the video area. 0
2614 indicates never reset and return the largest area encountered during
2621 Apply color adjustments using curves.
2623 This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
2624 component (red, green and blue) has its values defined by @var{N} key points
2625 tied from each other using a smooth curve. The x-axis represents the pixel
2626 values from the input frame, and the y-axis the new pixel values to be set for
2629 By default, a component curve is defined by the two points @var{(0;0)} and
2630 @var{(1;1)}. This creates a straight line where each original pixel value is
2631 "adjusted" to its own value, which means no change to the image.
2633 The filter allows you to redefine these two points and add some more. A new
2634 curve (using a natural cubic spline interpolation) will be define to pass
2635 smoothly through all these new coordinates. The new defined points needs to be
2636 strictly increasing over the x-axis, and their @var{x} and @var{y} values must
2637 be in the @var{[0;1]} interval. If the computed curves happened to go outside
2638 the vector spaces, the values will be clipped accordingly.
2640 If there is no key point defined in @code{x=0}, the filter will automatically
2641 insert a @var{(0;0)} point. In the same way, if there is no key point defined
2642 in @code{x=1}, the filter will automatically insert a @var{(1;1)} point.
2644 The filter accepts the following options:
2648 Select one of the available color presets. This option can be used in addition
2649 to the @option{r}, @option{g}, @option{b} parameters; in this case, the later
2650 options takes priority on the preset values.
2651 Available presets are:
2654 @item color_negative
2657 @item increase_contrast
2659 @item linear_contrast
2660 @item medium_contrast
2662 @item strong_contrast
2665 Default is @code{none}.
2667 Set the master key points. These points will define a second pass mapping. It
2668 is sometimes called a "luminance" or "value" mapping. It can be used with
2669 @option{r}, @option{g}, @option{b} or @option{all} since it acts like a
2670 post-processing LUT.
2672 Set the key points for the red component.
2674 Set the key points for the green component.
2676 Set the key points for the blue component.
2678 Set the key points for all components (not including master).
2679 Can be used in addition to the other key points component
2680 options. In this case, the unset component(s) will fallback on this
2681 @option{all} setting.
2683 Specify a Photoshop curves file (@code{.asv}) to import the settings from.
2686 To avoid some filtergraph syntax conflicts, each key points list need to be
2687 defined using the following syntax: @code{x0/y0 x1/y1 x2/y2 ...}.
2689 @subsection Examples
2693 Increase slightly the middle level of blue:
2695 curves=blue='0.5/0.58'
2701 curves=r='0/0.11 .42/.51 1/0.95':g='0.50/0.48':b='0/0.22 .49/.44 1/0.8'
2703 Here we obtain the following coordinates for each components:
2706 @code{(0;0.11) (0.42;0.51) (1;0.95)}
2708 @code{(0;0) (0.50;0.48) (1;1)}
2710 @code{(0;0.22) (0.49;0.44) (1;0.80)}
2714 The previous example can also be achieved with the associated built-in preset:
2716 curves=preset=vintage
2726 Use a Photoshop preset and redefine the points of the green component:
2728 curves=psfile='MyCurvesPresets/purple.asv':green='0.45/0.53'
2734 Denoise frames using 2D DCT (frequency domain filtering).
2736 This filter is not designed for real time and can be extremely slow.
2738 The filter accepts the following options:
2742 Set the noise sigma constant.
2744 This @var{sigma} defines a hard threshold of @code{3 * sigma}; every DCT
2745 coefficient (absolute value) below this threshold with be dropped.
2747 If you need a more advanced filtering, see @option{expr}.
2749 Default is @code{0}.
2752 Set number overlapping pixels for each block. Each block is of size
2753 @code{16x16}. Since the filter can be slow, you may want to reduce this value,
2754 at the cost of a less effective filter and the risk of various artefacts.
2756 If the overlapping value doesn't allow to process the whole input width or
2757 height, a warning will be displayed and according borders won't be denoised.
2759 Default value is @code{15}.
2762 Set the coefficient factor expression.
2764 For each coefficient of a DCT block, this expression will be evaluated as a
2765 multiplier value for the coefficient.
2767 If this is option is set, the @option{sigma} option will be ignored.
2769 The absolute value of the coefficient can be accessed through the @var{c}
2773 @subsection Examples
2775 Apply a denoise with a @option{sigma} of @code{4.5}:
2780 The same operation can be achieved using the expression system:
2782 dctdnoiz=e='gte(c, 4.5*3)'
2788 Drop duplicated frames at regular intervals.
2790 The filter accepts the following options:
2794 Set the number of frames from which one will be dropped. Setting this to
2795 @var{N} means one frame in every batch of @var{N} frames will be dropped.
2796 Default is @code{5}.
2799 Set the threshold for duplicate detection. If the difference metric for a frame
2800 is less than or equal to this value, then it is declared as duplicate. Default
2804 Set scene change threshold. Default is @code{15}.
2808 Set the size of the x and y-axis blocks used during metric calculations.
2809 Larger blocks give better noise suppression, but also give worse detection of
2810 small movements. Must be a power of two. Default is @code{32}.
2813 Mark main input as a pre-processed input and activate clean source input
2814 stream. This allows the input to be pre-processed with various filters to help
2815 the metrics calculation while keeping the frame selection lossless. When set to
2816 @code{1}, the first stream is for the pre-processed input, and the second
2817 stream is the clean source from where the kept frames are chosen. Default is
2821 Set whether or not chroma is considered in the metric calculations. Default is
2827 Suppress a TV station logo by a simple interpolation of the surrounding
2828 pixels. Just set a rectangle covering the logo and watch it disappear
2829 (and sometimes something even uglier appear - your mileage may vary).
2831 This filter accepts the following options:
2836 Specify the top left corner coordinates of the logo. They must be
2841 Specify the width and height of the logo to clear. They must be
2845 Specify the thickness of the fuzzy edge of the rectangle (added to
2846 @var{w} and @var{h}). The default value is 4.
2849 When set to 1, a green rectangle is drawn on the screen to simplify
2850 finding the right @var{x}, @var{y}, @var{w}, and @var{h} parameters.
2851 The default value is 0.
2855 @subsection Examples
2859 Set a rectangle covering the area with top left corner coordinates 0,0
2860 and size 100x77, setting a band of size 10:
2862 delogo=x=0:y=0:w=100:h=77:band=10
2869 Attempt to fix small changes in horizontal and/or vertical shift. This
2870 filter helps remove camera shake from hand-holding a camera, bumping a
2871 tripod, moving on a vehicle, etc.
2873 The filter accepts the following options:
2881 Specify a rectangular area where to limit the search for motion
2883 If desired the search for motion vectors can be limited to a
2884 rectangular area of the frame defined by its top left corner, width
2885 and height. These parameters have the same meaning as the drawbox
2886 filter which can be used to visualise the position of the bounding
2889 This is useful when simultaneous movement of subjects within the frame
2890 might be confused for camera motion by the motion vector search.
2892 If any or all of @var{x}, @var{y}, @var{w} and @var{h} are set to -1
2893 then the full frame is used. This allows later options to be set
2894 without specifying the bounding box for the motion vector search.
2896 Default - search the whole frame.
2900 Specify the maximum extent of movement in x and y directions in the
2901 range 0-64 pixels. Default 16.
2904 Specify how to generate pixels to fill blanks at the edge of the
2905 frame. Available values are:
2908 Fill zeroes at blank locations
2910 Original image at blank locations
2912 Extruded edge value at blank locations
2914 Mirrored edge at blank locations
2916 Default value is @samp{mirror}.
2919 Specify the blocksize to use for motion search. Range 4-128 pixels,
2923 Specify the contrast threshold for blocks. Only blocks with more than
2924 the specified contrast (difference between darkest and lightest
2925 pixels) will be considered. Range 1-255, default 125.
2928 Specify the search strategy. Available values are:
2931 Set exhaustive search
2933 Set less exhaustive search.
2935 Default value is @samp{exhaustive}.
2938 If set then a detailed log of the motion search is written to the
2942 If set to 1, specify using OpenCL capabilities, only available if
2943 FFmpeg was configured with @code{--enable-opencl}. Default value is 0.
2949 Draw a colored box on the input image.
2951 This filter accepts the following options:
2956 The expressions which specify the top left corner coordinates of the box. Default to 0.
2960 The expressions which specify the width and height of the box, if 0 they are interpreted as
2961 the input width and height. Default to 0.
2964 Specify the color of the box to write, it can be the name of a color
2965 (case insensitive match) or a 0xRRGGBB[AA] sequence. If the special
2966 value @code{invert} is used, the box edge color is the same as the
2967 video with inverted luma.
2970 The expression which sets the thickness of the box edge. Default value is @code{3}.
2972 See below for the list of accepted constants.
2975 The parameters for @var{x}, @var{y}, @var{w} and @var{h} and @var{t} are expressions containing the
2976 following constants:
2980 The input display aspect ratio, it is the same as (@var{w} / @var{h}) * @var{sar}.
2984 horizontal and vertical chroma subsample values. For example for the
2985 pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
2989 The input width and height.
2992 The input sample aspect ratio.
2996 The x and y offset coordinates where the box is drawn.
3000 The width and height of the drawn box.
3003 The thickness of the drawn box.
3005 These constants allow the @var{x}, @var{y}, @var{w}, @var{h} and @var{t} expressions to refer to
3006 each other, so you may for example specify @code{y=x/dar} or @code{h=w/dar}.
3010 @subsection Examples
3014 Draw a black box around the edge of the input image:
3020 Draw a box with color red and an opacity of 50%:
3022 drawbox=10:20:200:60:red@@0.5
3025 The previous example can be specified as:
3027 drawbox=x=10:y=20:w=200:h=60:color=red@@0.5
3031 Fill the box with pink color:
3033 drawbox=x=10:y=10:w=100:h=100:color=pink@@0.5:t=max
3037 Draw a 2-pixel red 2.40:1 mask:
3039 drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
3045 Draw a grid on the input image.
3047 This filter accepts the following options:
3052 The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
3056 The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
3057 input width and height, respectively, minus @code{thickness}, so image gets
3058 framed. Default to 0.
3061 Specify the color of the grid, it can be the name of a color
3062 (case insensitive match) or a 0xRRGGBB[AA] sequence. If the special
3063 value @code{invert} is used, the grid color is the same as the
3064 video with inverted luma.
3065 Note that you can append opacity value (in range of 0.0 - 1.0)
3066 to color name after @@ sign.
3069 The expression which sets the thickness of the grid line. Default value is @code{1}.
3071 See below for the list of accepted constants.
3074 The parameters for @var{x}, @var{y}, @var{w} and @var{h} and @var{t} are expressions containing the
3075 following constants:
3079 The input display aspect ratio, it is the same as (@var{w} / @var{h}) * @var{sar}.
3083 horizontal and vertical chroma subsample values. For example for the
3084 pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
3088 The input grid cell width and height.
3091 The input sample aspect ratio.
3095 The x and y coordinates of some point of grid intersection (meant to configure offset).
3099 The width and height of the drawn cell.
3102 The thickness of the drawn cell.
3104 These constants allow the @var{x}, @var{y}, @var{w}, @var{h} and @var{t} expressions to refer to
3105 each other, so you may for example specify @code{y=x/dar} or @code{h=w/dar}.
3109 @subsection Examples
3113 Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
3115 drawgrid=width=100:height=100:thickness=2:color=red@@0.5
3119 Draw a white 3x3 grid with an opacity of 50%:
3121 drawgrid=w=iw/3:h=ih/3:t=2:c=white@@0.5
3128 Draw text string or text from specified file on top of video using the
3129 libfreetype library.
3131 To enable compilation of this filter you need to configure FFmpeg with
3132 @code{--enable-libfreetype}.
3136 The description of the accepted parameters follows.
3141 Used to draw a box around text using background color.
3142 Value should be either 1 (enable) or 0 (disable).
3143 The default value of @var{box} is 0.
3146 The color to be used for drawing box around text.
3147 Either a string (e.g. "yellow") or in 0xRRGGBB[AA] format
3148 (e.g. "0xff00ff"), possibly followed by an alpha specifier.
3149 The default value of @var{boxcolor} is "white".
3152 Set an expression which specifies if the text should be drawn. If the
3153 expression evaluates to 0, the text is not drawn. This is useful for
3154 specifying that the text should be drawn only when specific conditions
3157 Default value is "1".
3159 See below for the list of accepted constants and functions.
3162 Select how the @var{text} is expanded. Can be either @code{none},
3163 @code{strftime} (deprecated) or
3164 @code{normal} (default). See the @ref{drawtext_expansion, Text expansion} section
3168 If true, check and fix text coords to avoid clipping.
3171 The color to be used for drawing fonts.
3172 Either a string (e.g. "red") or in 0xRRGGBB[AA] format
3173 (e.g. "0xff000033"), possibly followed by an alpha specifier.
3174 The default value of @var{fontcolor} is "black".
3177 The font file to be used for drawing text. Path must be included.
3178 This parameter is mandatory.
3181 The font size to be used for drawing text.
3182 The default value of @var{fontsize} is 16.
3185 Flags to be used for loading the fonts.
3187 The flags map the corresponding flags supported by libfreetype, and are
3188 a combination of the following values:
3195 @item vertical_layout
3196 @item force_autohint
3199 @item ignore_global_advance_width
3201 @item ignore_transform
3207 Default value is "render".
3209 For more information consult the documentation for the FT_LOAD_*
3213 The color to be used for drawing a shadow behind the drawn text. It
3214 can be a color name (e.g. "yellow") or a string in the 0xRRGGBB[AA]
3215 form (e.g. "0xff00ff"), possibly followed by an alpha specifier.
3216 The default value of @var{shadowcolor} is "black".
3220 The x and y offsets for the text shadow position with respect to the
3221 position of the text. They can be either positive or negative
3222 values. Default value for both is "0".
3225 The starting frame number for the n/frame_num variable. The default value
3229 The size in number of spaces to use for rendering the tab.
3233 Set the initial timecode representation in "hh:mm:ss[:;.]ff"
3234 format. It can be used with or without text parameter. @var{timecode_rate}
3235 option must be specified.
3237 @item timecode_rate, rate, r
3238 Set the timecode frame rate (timecode only).
3241 The text string to be drawn. The text must be a sequence of UTF-8
3243 This parameter is mandatory if no file is specified with the parameter
3247 A text file containing text to be drawn. The text must be a sequence
3248 of UTF-8 encoded characters.
3250 This parameter is mandatory if no text string is specified with the
3251 parameter @var{text}.
3253 If both @var{text} and @var{textfile} are specified, an error is thrown.
3256 If set to 1, the @var{textfile} will be reloaded before each frame.
3257 Be sure to update it atomically, or it may be read partially, or even fail.
3261 The expressions which specify the offsets where text will be drawn
3262 within the video frame. They are relative to the top/left border of the
3265 The default value of @var{x} and @var{y} is "0".
3267 See below for the list of accepted constants and functions.
3270 The parameters for @var{x} and @var{y} are expressions containing the
3271 following constants and functions:
3275 input display aspect ratio, it is the same as (@var{w} / @var{h}) * @var{sar}
3279 horizontal and vertical chroma subsample values. For example for the
3280 pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
3283 the height of each text line
3291 @item max_glyph_a, ascent
3292 the maximum distance from the baseline to the highest/upper grid
3293 coordinate used to place a glyph outline point, for all the rendered
3295 It is a positive value, due to the grid's orientation with the Y axis
3298 @item max_glyph_d, descent
3299 the maximum distance from the baseline to the lowest grid coordinate
3300 used to place a glyph outline point, for all the rendered glyphs.
3301 This is a negative value, due to the grid's orientation, with the Y axis
3305 maximum glyph height, that is the maximum height for all the glyphs
3306 contained in the rendered text, it is equivalent to @var{ascent} -
3310 maximum glyph width, that is the maximum width for all the glyphs
3311 contained in the rendered text
3314 the number of input frame, starting from 0
3316 @item rand(min, max)
3317 return a random number included between @var{min} and @var{max}
3320 input sample aspect ratio
3323 timestamp expressed in seconds, NAN if the input timestamp is unknown
3326 the height of the rendered text
3329 the width of the rendered text
3333 the x and y offset coordinates where the text is drawn.
3335 These parameters allow the @var{x} and @var{y} expressions to refer
3336 each other, so you can for example specify @code{y=x/dar}.
3339 If libavfilter was built with @code{--enable-fontconfig}, then
3340 @option{fontfile} can be a fontconfig pattern or omitted.
3342 @anchor{drawtext_expansion}
3343 @subsection Text expansion
3345 If @option{expansion} is set to @code{strftime},
3346 the filter recognizes strftime() sequences in the provided text and
3347 expands them accordingly. Check the documentation of strftime(). This
3348 feature is deprecated.
3350 If @option{expansion} is set to @code{none}, the text is printed verbatim.
3352 If @option{expansion} is set to @code{normal} (which is the default),
3353 the following expansion mechanism is used.
3355 The backslash character '\', followed by any character, always expands to
3356 the second character.
3358 Sequence of the form @code{%@{...@}} are expanded. The text between the
3359 braces is a function name, possibly followed by arguments separated by ':'.
3360 If the arguments contain special characters or delimiters (':' or '@}'),
3361 they should be escaped.
3363 Note that they probably must also be escaped as the value for the
3364 @option{text} option in the filter argument string and as the filter
3365 argument in the filtergraph description, and possibly also for the shell,
3366 that makes up to four levels of escaping; using a text file avoids these
3369 The following functions are available:
3374 The expression evaluation result.
3376 It must take one argument specifying the expression to be evaluated,
3377 which accepts the same constants and functions as the @var{x} and
3378 @var{y} values. Note that not all constants should be used, for
3379 example the text size is not known when evaluating the expression, so
3380 the constants @var{text_w} and @var{text_h} will have an undefined
3384 The time at which the filter is running, expressed in UTC.
3385 It can accept an argument: a strftime() format string.
3388 The time at which the filter is running, expressed in the local time zone.
3389 It can accept an argument: a strftime() format string.
3392 Frame metadata. It must take one argument specifying metadata key.
3395 The frame number, starting from 0.
3398 A 1 character description of the current picture type.
3401 The timestamp of the current frame, in seconds, with microsecond accuracy.
3405 @subsection Examples
3409 Draw "Test Text" with font FreeSerif, using the default values for the
3410 optional parameters.
3413 drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
3417 Draw 'Test Text' with font FreeSerif of size 24 at position x=100
3418 and y=50 (counting from the top-left corner of the screen), text is
3419 yellow with a red box around it. Both the text and the box have an
3423 drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
3424 x=100: y=50: fontsize=24: fontcolor=yellow@@0.2: box=1: boxcolor=red@@0.2"
3427 Note that the double quotes are not necessary if spaces are not used
3428 within the parameter list.
3431 Show the text at the center of the video frame:
3433 drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h-line_h)/2"
3437 Show a text line sliding from right to left in the last row of the video
3438 frame. The file @file{LONG_LINE} is assumed to contain a single line
3441 drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t"
3445 Show the content of file @file{CREDITS} off the bottom of the frame and scroll up.
3447 drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t"
3451 Draw a single green letter "g", at the center of the input video.
3452 The glyph baseline is placed at half screen height.
3454 drawtext="fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent"
3458 Show text for 1 second every 3 seconds:
3460 drawtext="fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:draw=lt(mod(t\,3)\,1):text='blink'"
3464 Use fontconfig to set the font. Note that the colons need to be escaped.
3466 drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
3470 Print the date of a real-time encoding (see strftime(3)):
3472 drawtext='fontfile=FreeSans.ttf:text=%@{localtime:%a %b %d %Y@}'
3477 For more information about libfreetype, check:
3478 @url{http://www.freetype.org/}.
3480 For more information about fontconfig, check:
3481 @url{http://freedesktop.org/software/fontconfig/fontconfig-user.html}.
3485 Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
3487 The filter accepts the following options:
3492 Set low and high threshold values used by the Canny thresholding
3495 The high threshold selects the "strong" edge pixels, which are then
3496 connected through 8-connectivity with the "weak" edge pixels selected
3497 by the low threshold.
3499 @var{low} and @var{high} threshold values must be choosen in the range
3500 [0,1], and @var{low} should be lesser or equal to @var{high}.
3502 Default value for @var{low} is @code{20/255}, and default value for @var{high}
3508 edgedetect=low=0.1:high=0.4
3511 @section extractplanes
3513 Extract color channel components from input video stream into
3514 separate grayscale video streams.
3516 The filter accepts the following option:
3520 Set plane(s) to extract.
3522 Available values for planes are:
3533 Choosing planes not available in the input will result in an error.
3534 That means you cannot select @code{r}, @code{g}, @code{b} planes
3535 with @code{y}, @code{u}, @code{v} planes at same time.
3538 @subsection Examples
3542 Extract luma, u and v color channel component from input video frame
3543 into 3 grayscale outputs:
3545 ffmpeg -i video.avi -filter_complex 'extractplanes=y+u+v[y][u][v]' -map '[y]' y.avi -map '[u]' u.avi -map '[v]' v.avi
3551 Apply fade-in/out effect to input video.
3553 This filter accepts the following options:
3557 The effect type -- can be either "in" for fade-in, or "out" for a fade-out
3559 Default is @code{in}.
3561 @item start_frame, s
3562 Specify the number of the start frame for starting to apply the fade
3563 effect. Default is 0.
3566 The number of frames for which the fade effect has to last. At the end of the
3567 fade-in effect the output video will have the same intensity as the input video,
3568 at the end of the fade-out transition the output video will be completely black.
3572 If set to 1, fade only alpha channel, if one exists on the input.
3575 @item start_time, st
3576 Specify the timestamp (in seconds) of the frame to start to apply the fade
3577 effect. If both start_frame and start_time are specified, the fade will start at
3578 whichever comes last. Default is 0.
3581 The number of seconds for which the fade effect has to last. At the end of the
3582 fade-in effect the output video will have the same intensity as the input video,
3583 at the end of the fade-out transition the output video will be completely black.
3584 If both duration and nb_frames are specified, duration is used. Default is 0.
3587 @subsection Examples
3591 Fade in first 30 frames of video:
3596 The command above is equivalent to:
3602 Fade out last 45 frames of a 200-frame video:
3605 fade=type=out:start_frame=155:nb_frames=45
3609 Fade in first 25 frames and fade out last 25 frames of a 1000-frame video:
3611 fade=in:0:25, fade=out:975:25
3615 Make first 5 frames black, then fade in from frame 5-24:
3621 Fade in alpha over first 25 frames of video:
3623 fade=in:0:25:alpha=1
3627 Make first 5.5 seconds black, then fade in for 0.5 seconds:
3629 fade=t=in:st=5.5:d=0.5
3636 Extract a single field from an interlaced image using stride
3637 arithmetic to avoid wasting CPU time. The output frames are marked as
3640 The filter accepts the following options:
3644 Specify whether to extract the top (if the value is @code{0} or
3645 @code{top}) or the bottom field (if the value is @code{1} or
3651 Field matching filter for inverse telecine. It is meant to reconstruct the
3652 progressive frames from a telecined stream. The filter does not drop duplicated
3653 frames, so to achieve a complete inverse telecine @code{fieldmatch} needs to be
3654 followed by a decimation filter such as @ref{decimate} in the filtergraph.
3656 The separation of the field matching and the decimation is notably motivated by
3657 the possibility of inserting a de-interlacing filter fallback between the two.
3658 If the source has mixed telecined and real interlaced content,
3659 @code{fieldmatch} will not be able to match fields for the interlaced parts.
3660 But these remaining combed frames will be marked as interlaced, and thus can be
3661 de-interlaced by a later filter such as @ref{yadif} before decimation.
3663 In addition to the various configuration options, @code{fieldmatch} can take an
3664 optional second stream, activated through the @option{ppsrc} option. If
3665 enabled, the frames reconstruction will be based on the fields and frames from
3666 this second stream. This allows the first input to be pre-processed in order to
3667 help the various algorithms of the filter, while keeping the output lossless
3668 (assuming the fields are matched properly). Typically, a field-aware denoiser,
3669 or brightness/contrast adjustments can help.
3671 Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
3672 and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
3673 which @code{fieldmatch} is based on. While the semantic and usage are very
3674 close, some behaviour and options names can differ.
3676 The filter accepts the following options:
3680 Specify the assumed field order of the input stream. Available values are:
3684 Auto detect parity (use FFmpeg's internal parity value).
3686 Assume bottom field first.
3688 Assume top field first.
3691 Note that it is sometimes recommended not to trust the parity announced by the
3694 Default value is @var{auto}.
3697 Set the matching mode or strategy to use. @option{pc} mode is the safest in the
3698 sense that it won't risk creating jerkiness due to duplicate frames when
3699 possible, but if there are bad edits or blended fields it will end up
3700 outputting combed frames when a good match might actually exist. On the other
3701 hand, @option{pcn_ub} mode is the most risky in terms of creating jerkiness,
3702 but will almost always find a good frame if there is one. The other values are
3703 all somewhere in between @option{pc} and @option{pcn_ub} in terms of risking
3704 jerkiness and creating duplicate frames versus finding good matches in sections
3705 with bad edits, orphaned fields, blended fields, etc.
3707 More details about p/c/n/u/b are available in @ref{p/c/n/u/b meaning} section.
3709 Available values are:
3713 2-way matching (p/c)
3715 2-way matching, and trying 3rd match if still combed (p/c + n)
3717 2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
3719 2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
3720 still combed (p/c + n + u/b)
3722 3-way matching (p/c/n)
3724 3-way matching, and trying 4th/5th matches if all 3 of the original matches are
3725 detected as combed (p/c/n + u/b)
3728 The parenthesis at the end indicate the matches that would be used for that
3729 mode assuming @option{order}=@var{tff} (and @option{field} on @var{auto} or
3732 In terms of speed @option{pc} mode is by far the fastest and @option{pcn_ub} is
3735 Default value is @var{pc_n}.
3738 Mark the main input stream as a pre-processed input, and enable the secondary
3739 input stream as the clean source to pick the fields from. See the filter
3740 introduction for more details. It is similar to the @option{clip2} feature from
3743 Default value is @code{0} (disabled).
3746 Set the field to match from. It is recommended to set this to the same value as
3747 @option{order} unless you experience matching failures with that setting. In
3748 certain circumstances changing the field that is used to match from can have a
3749 large impact on matching performance. Available values are:
3753 Automatic (same value as @option{order}).
3755 Match from the bottom field.
3757 Match from the top field.
3760 Default value is @var{auto}.
3763 Set whether or not chroma is included during the match comparisons. In most
3764 cases it is recommended to leave this enabled. You should set this to @code{0}
3765 only if your clip has bad chroma problems such as heavy rainbowing or other
3766 artifacts. Setting this to @code{0} could also be used to speed things up at
3767 the cost of some accuracy.
3769 Default value is @code{1}.
3773 These define an exclusion band which excludes the lines between @option{y0} and
3774 @option{y1} from being included in the field matching decision. An exclusion
3775 band can be used to ignore subtitles, a logo, or other things that may
3776 interfere with the matching. @option{y0} sets the starting scan line and
3777 @option{y1} sets the ending line; all lines in between @option{y0} and
3778 @option{y1} (including @option{y0} and @option{y1}) will be ignored. Setting
3779 @option{y0} and @option{y1} to the same value will disable the feature.
3780 @option{y0} and @option{y1} defaults to @code{0}.
3783 Set the scene change detection threshold as a percentage of maximum change on
3784 the luma plane. Good values are in the @code{[8.0, 14.0]} range. Scene change
3785 detection is only relevant in case @option{combmatch}=@var{sc}. The range for
3786 @option{scthresh} is @code{[0.0, 100.0]}.
3788 Default value is @code{12.0}.
3791 When @option{combatch} is not @var{none}, @code{fieldmatch} will take into
3792 account the combed scores of matches when deciding what match to use as the
3793 final match. Available values are:
3797 No final matching based on combed scores.
3799 Combed scores are only used when a scene change is detected.
3801 Use combed scores all the time.
3804 Default is @var{sc}.
3807 Force @code{fieldmatch} to calculate the combed metrics for certain matches and
3808 print them. This setting is known as @option{micout} in TFM/VFM vocabulary.
3809 Available values are:
3813 No forced calculation.
3815 Force p/c/n calculations.
3817 Force p/c/n/u/b calculations.
3820 Default value is @var{none}.
3823 This is the area combing threshold used for combed frame detection. This
3824 essentially controls how "strong" or "visible" combing must be to be detected.
3825 Larger values mean combing must be more visible and smaller values mean combing
3826 can be less visible or strong and still be detected. Valid settings are from
3827 @code{-1} (every pixel will be detected as combed) to @code{255} (no pixel will
3828 be detected as combed). This is basically a pixel difference value. A good
3829 range is @code{[8, 12]}.
3831 Default value is @code{9}.
3834 Sets whether or not chroma is considered in the combed frame decision. Only
3835 disable this if your source has chroma problems (rainbowing, etc.) that are
3836 causing problems for the combed frame detection with chroma enabled. Actually,
3837 using @option{chroma}=@var{0} is usually more reliable, except for the case
3838 where there is chroma only combing in the source.
3840 Default value is @code{0}.
3844 Respectively set the x-axis and y-axis size of the window used during combed
3845 frame detection. This has to do with the size of the area in which
3846 @option{combpel} pixels are required to be detected as combed for a frame to be
3847 declared combed. See the @option{combpel} parameter description for more info.
3848 Possible values are any number that is a power of 2 starting at 4 and going up
3851 Default value is @code{16}.
3854 The number of combed pixels inside any of the @option{blocky} by
3855 @option{blockx} size blocks on the frame for the frame to be detected as
3856 combed. While @option{cthresh} controls how "visible" the combing must be, this
3857 setting controls "how much" combing there must be in any localized area (a
3858 window defined by the @option{blockx} and @option{blocky} settings) on the
3859 frame. Minimum value is @code{0} and maximum is @code{blocky x blockx} (at
3860 which point no frames will ever be detected as combed). This setting is known
3861 as @option{MI} in TFM/VFM vocabulary.
3863 Default value is @code{80}.
3866 @anchor{p/c/n/u/b meaning}
3867 @subsection p/c/n/u/b meaning
3869 @subsubsection p/c/n
3871 We assume the following telecined stream:
3874 Top fields: 1 2 2 3 4
3875 Bottom fields: 1 2 3 4 4
3878 The numbers correspond to the progressive frame the fields relate to. Here, the
3879 first two frames are progressive, the 3rd and 4th are combed, and so on.
3881 When @code{fieldmatch} is configured to run a matching from bottom
3882 (@option{field}=@var{bottom}) this is how this input stream get transformed:
3887 B 1 2 3 4 4 <-- matching reference
3896 As a result of the field matching, we can see that some frames get duplicated.
3897 To perform a complete inverse telecine, you need to rely on a decimation filter
3898 after this operation. See for instance the @ref{decimate} filter.
3900 The same operation now matching from top fields (@option{field}=@var{top})
3905 T 1 2 2 3 4 <-- matching reference
3915 In these examples, we can see what @var{p}, @var{c} and @var{n} mean;
3916 basically, they refer to the frame and field of the opposite parity:
3919 @item @var{p} matches the field of the opposite parity in the previous frame
3920 @item @var{c} matches the field of the opposite parity in the current frame
3921 @item @var{n} matches the field of the opposite parity in the next frame
3926 The @var{u} and @var{b} matching are a bit special in the sense that they match
3927 from the opposite parity flag. In the following examples, we assume that we are
3928 currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
3929 'x' is placed above and below each matched fields.
3931 With bottom matching (@option{field}=@var{bottom}):
3936 Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
3937 Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
3945 With top matching (@option{field}=@var{top}):
3950 Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
3951 Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
3959 @subsection Examples
3961 Simple IVTC of a top field first telecined stream:
3963 fieldmatch=order=tff:combmatch=none, decimate
3966 Advanced IVTC, with fallback on @ref{yadif} for still combed frames:
3968 fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
3973 Transform the field order of the input video.
3975 This filter accepts the following options:
3980 Output field order. Valid values are @var{tff} for top field first or @var{bff}
3981 for bottom field first.
3984 Default value is @samp{tff}.
3986 Transformation is achieved by shifting the picture content up or down
3987 by one line, and filling the remaining line with appropriate picture content.
3988 This method is consistent with most broadcast field order converters.
3990 If the input video is not flagged as being interlaced, or it is already
3991 flagged as being of the required output field order then this filter does
3992 not alter the incoming video.
3994 This filter is very useful when converting to or from PAL DV material,
3995 which is bottom field first.
3999 ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
4004 Buffer input images and send them when they are requested.
4006 This filter is mainly useful when auto-inserted by the libavfilter
4009 The filter does not take parameters.
4014 Convert the input video to one of the specified pixel formats.
4015 Libavfilter will try to pick one that is supported for the input to
4018 This filter accepts the following parameters:
4022 A '|'-separated list of pixel format names, for example
4023 "pix_fmts=yuv420p|monow|rgb24".
4027 @subsection Examples
4031 Convert the input video to the format @var{yuv420p}
4033 format=pix_fmts=yuv420p
4036 Convert the input video to any of the formats in the list
4038 format=pix_fmts=yuv420p|yuv444p|yuv410p
4044 Convert the video to specified constant frame rate by duplicating or dropping
4045 frames as necessary.
4047 This filter accepts the following named parameters:
4051 Desired output frame rate. The default is @code{25}.
4056 Possible values are:
4059 zero round towards 0
4063 round towards -infinity
4065 round towards +infinity
4069 The default is @code{near}.
4073 Alternatively, the options can be specified as a flat string:
4074 @var{fps}[:@var{round}].
4076 See also the @ref{setpts} filter.
4078 @subsection Examples
4082 A typical usage in order to set the fps to 25:
4088 Sets the fps to 24, using abbreviation and rounding method to round to nearest:
4090 fps=fps=film:round=near
4096 Select one frame every N-th frame.
4098 This filter accepts the following option:
4101 Select frame after every @code{step} frames.
4102 Allowed values are positive integers higher than 0. Default value is @code{1}.
4108 Apply a frei0r effect to the input video.
4110 To enable compilation of this filter you need to install the frei0r
4111 header and configure FFmpeg with @code{--enable-frei0r}.
4113 This filter accepts the following options:
4118 The name to the frei0r effect to load. If the environment variable
4119 @env{FREI0R_PATH} is defined, the frei0r effect is searched in each one of the
4120 directories specified by the colon separated list in @env{FREIOR_PATH},
4121 otherwise in the standard frei0r paths, which are in this order:
4122 @file{HOME/.frei0r-1/lib/}, @file{/usr/local/lib/frei0r-1/},
4123 @file{/usr/lib/frei0r-1/}.
4126 A '|'-separated list of parameters to pass to the frei0r effect.
4130 A frei0r effect parameter can be a boolean (whose values are specified
4131 with "y" and "n"), a double, a color (specified by the syntax
4132 @var{R}/@var{G}/@var{B}, @var{R}, @var{G}, and @var{B} being float
4133 numbers from 0.0 to 1.0) or by an @code{av_parse_color()} color
4134 description), a position (specified by the syntax @var{X}/@var{Y},
4135 @var{X} and @var{Y} being float numbers) and a string.
4137 The number and kind of parameters depend on the loaded effect. If an
4138 effect parameter is not specified the default value is set.
4140 @subsection Examples
4144 Apply the distort0r effect, set the first two double parameters:
4146 frei0r=filter_name=distort0r:filter_params=0.5|0.01
4150 Apply the colordistance effect, take a color as first parameter:
4152 frei0r=colordistance:0.2/0.3/0.4
4153 frei0r=colordistance:violet
4154 frei0r=colordistance:0x112233
4158 Apply the perspective effect, specify the top left and top right image
4161 frei0r=perspective:0.2/0.2|0.8/0.2
4165 For more information see:
4166 @url{http://frei0r.dyne.org}
4170 The filter accepts the following options:
4174 Set the luminance expression.
4176 Set the chrominance blue expression.
4178 Set the chrominance red expression.
4180 Set the alpha expression.
4182 Set the red expression.
4184 Set the green expression.
4186 Set the blue expression.
4189 The colorspace is selected according to the specified options. If one
4190 of the @option{lum_expr}, @option{cb_expr}, or @option{cr_expr}
4191 options is specified, the filter will automatically select a YCbCr
4192 colorspace. If one of the @option{red_expr}, @option{green_expr}, or
4193 @option{blue_expr} options is specified, it will select an RGB
4196 If one of the chrominance expression is not defined, it falls back on the other
4197 one. If no alpha expression is specified it will evaluate to opaque value.
4198 If none of chrominance expressions are specified, they will evaluate
4199 to the luminance expression.
4201 The expressions can use the following variables and functions:
4205 The sequential number of the filtered frame, starting from @code{0}.