1 @chapter Filtergraph description
2 @c man begin FILTERGRAPH DESCRIPTION
4 A filtergraph is a directed graph of connected filters. It can contain
5 cycles, and there can be multiple links between a pair of
6 filters. Each link has one input pad on one side connecting it to one
7 filter from which it takes its input, and one output pad on the other
8 side connecting it to the one filter accepting its output.
10 Each filter in a filtergraph is an instance of a filter class
11 registered in the application, which defines the features and the
12 number of input and output pads of the filter.
14 A filter with no input pads is called a "source", a filter with no
15 output pads is called a "sink".
17 @anchor{Filtergraph syntax}
18 @section Filtergraph syntax
20 A filtergraph can be represented using a textual representation, which is
21 recognized by the @option{-filter}/@option{-vf} and @option{-filter_complex}
22 options in @command{ffmpeg} and @option{-vf} in @command{ffplay}, and by the
23 @code{avfilter_graph_parse()}/@code{avfilter_graph_parse2()} function defined in
24 @file{libavfilter/avfiltergraph.h}.
26 A filterchain consists of a sequence of connected filters, each one
27 connected to the previous one in the sequence. A filterchain is
28 represented by a list of ","-separated filter descriptions.
30 A filtergraph consists of a sequence of filterchains. A sequence of
31 filterchains is represented by a list of ";"-separated filterchain
34 A filter is represented by a string of the form:
35 [@var{in_link_1}]...[@var{in_link_N}]@var{filter_name}=@var{arguments}[@var{out_link_1}]...[@var{out_link_M}]
37 @var{filter_name} is the name of the filter class of which the
38 described filter is an instance of, and has to be the name of one of
39 the filter classes registered in the program.
40 The name of the filter class is optionally followed by a string
43 @var{arguments} is a string which contains the parameters used to
44 initialize the filter instance, and are described in the filter
47 The list of arguments can be quoted using the character "'" as initial
48 and ending mark, and the character '\' for escaping the characters
49 within the quoted text; otherwise the argument string is considered
50 terminated when the next special character (belonging to the set
51 "[]=;,") is encountered.
53 The name and arguments of the filter are optionally preceded and
54 followed by a list of link labels.
55 A link label allows to name a link and associate it to a filter output
56 or input pad. The preceding labels @var{in_link_1}
57 ... @var{in_link_N}, are associated to the filter input pads,
58 the following labels @var{out_link_1} ... @var{out_link_M}, are
59 associated to the output pads.
61 When two link labels with the same name are found in the
62 filtergraph, a link between the corresponding input and output pad is
65 If an output pad is not labelled, it is linked by default to the first
66 unlabelled input pad of the next filter in the filterchain.
67 For example in the filterchain:
69 nullsrc, split[L1], [L2]overlay, nullsink
71 the split filter instance has two output pads, and the overlay filter
72 instance two input pads. The first output pad of split is labelled
73 "L1", the first input pad of overlay is labelled "L2", and the second
74 output pad of split is linked to the second input pad of overlay,
75 which are both unlabelled.
77 In a complete filterchain all the unlabelled filter input and output
78 pads must be connected. A filtergraph is considered valid if all the
79 filter input and output pads of all the filterchains are connected.
81 Libavfilter will automatically insert scale filters where format
82 conversion is required. It is possible to specify swscale flags
83 for those automatically inserted scalers by prepending
84 @code{sws_flags=@var{flags};}
85 to the filtergraph description.
87 Follows a BNF description for the filtergraph syntax:
89 @var{NAME} ::= sequence of alphanumeric characters and '_'
90 @var{LINKLABEL} ::= "[" @var{NAME} "]"
91 @var{LINKLABELS} ::= @var{LINKLABEL} [@var{LINKLABELS}]
92 @var{FILTER_ARGUMENTS} ::= sequence of chars (eventually quoted)
93 @var{FILTER} ::= [@var{LINKNAMES}] @var{NAME} ["=" @var{ARGUMENTS}] [@var{LINKNAMES}]
94 @var{FILTERCHAIN} ::= @var{FILTER} [,@var{FILTERCHAIN}]
95 @var{FILTERGRAPH} ::= [sws_flags=@var{flags};] @var{FILTERCHAIN} [;@var{FILTERGRAPH}]
98 @c man end FILTERGRAPH DESCRIPTION
100 @chapter Audio Filters
101 @c man begin AUDIO FILTERS
103 When you configure your FFmpeg build, you can disable any of the
104 existing filters using @code{--disable-filters}.
105 The configure output will show the audio filters included in your
108 Below is a description of the currently available audio filters.
112 Convert the input audio format to the specified formats.
114 The filter accepts a string of the form:
115 "@var{sample_format}:@var{channel_layout}".
117 @var{sample_format} specifies the sample format, and can be a string or the
118 corresponding numeric value defined in @file{libavutil/samplefmt.h}. Use 'p'
119 suffix for a planar sample format.
121 @var{channel_layout} specifies the channel layout, and can be a string
122 or the corresponding number value defined in @file{libavutil/audioconvert.h}.
124 The special parameter "auto", signifies that the filter will
125 automatically select the output format depending on the output filter.
127 Some examples follow.
131 Convert input to float, planar, stereo:
137 Convert input to unsigned 8-bit, automatically select out channel layout:
145 Convert the input audio to one of the specified formats. The framework will
146 negotiate the most appropriate format to minimize conversions.
148 The filter accepts the following named parameters:
152 A comma-separated list of requested sample formats.
155 A comma-separated list of requested sample rates.
157 @item channel_layouts
158 A comma-separated list of requested channel layouts.
162 If a parameter is omitted, all values are allowed.
164 For example to force the output to either unsigned 8-bit or signed 16-bit stereo:
166 aformat=sample_fmts\=u8\,s16:channel_layouts\=stereo
171 Merge two or more audio streams into a single multi-channel stream.
173 The filter accepts the following named options:
178 Set the number of inputs. Default is 2.
182 If the channel layouts of the inputs are disjoint, and therefore compatible,
183 the channel layout of the output will be set accordingly and the channels
184 will be reordered as necessary. If the channel layouts of the inputs are not
185 disjoint, the output will have all the channels of the first input then all
186 the channels of the second input, in that order, and the channel layout of
187 the output will be the default value corresponding to the total number of
190 For example, if the first input is in 2.1 (FL+FR+LF) and the second input
191 is FC+BL+BR, then the output will be in 5.1, with the channels in the
192 following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
193 first input, b1 is the first channel of the second input).
195 On the other hand, if both input are in stereo, the output channels will be
196 in the default order: a1, a2, b1, b2, and the channel layout will be
197 arbitrarily set to 4.0, which may or may not be the expected value.
199 All inputs must have the same sample rate, and format.
201 If inputs do not have the same duration, the output will stop with the
204 Example: merge two mono files into a stereo stream:
206 amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
209 Example: multiple merges:
212 amovie=input.mkv:si=0 [a0];
213 amovie=input.mkv:si=1 [a1];
214 amovie=input.mkv:si=2 [a2];
215 amovie=input.mkv:si=3 [a3];
216 amovie=input.mkv:si=4 [a4];
217 amovie=input.mkv:si=5 [a5];
218 [a0][a1][a2][a3][a4][a5] amerge=inputs=6" -c:a pcm_s16le output.mkv
223 Mixes multiple audio inputs into a single output.
227 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
229 will mix 3 input audio streams to a single output with the same duration as the
230 first input and a dropout transition time of 3 seconds.
232 The filter accepts the following named parameters:
236 Number of inputs. If unspecified, it defaults to 2.
239 How to determine the end-of-stream.
243 Duration of longest input. (default)
246 Duration of shortest input.
249 Duration of first input.
253 @item dropout_transition
254 Transition time, in seconds, for volume renormalization when an input
255 stream ends. The default value is 2 seconds.
261 Pass the audio source unchanged to the output.
265 Resample the input audio to the specified sample rate.
267 The filter accepts exactly one parameter, the output sample rate. If not
268 specified then the filter will automatically convert between its input
269 and output sample rates.
271 For example, to resample the input audio to 44100Hz:
276 @section asetnsamples
278 Set the number of samples per each output audio frame.
280 The last output packet may contain a different number of samples, as
281 the filter will flush all the remaining samples when the input audio
284 The filter accepts parameters as a list of @var{key}=@var{value} pairs,
289 @item nb_out_samples, n
290 Set the number of frames per each output audio frame. The number is
291 intended as the number of samples @emph{per each channel}.
292 Default value is 1024.
295 If set to 1, the filter will pad the last audio frame with zeroes, so
296 that the last frame will contain the same number of samples as the
297 previous ones. Default value is 1.
300 For example, to set the number of per-frame samples to 1234 and
301 disable padding for the last frame, use:
303 asetnsamples=n=1234:p=0
308 Show a line containing various information for each input audio frame.
309 The input audio is not modified.
311 The shown line contains a sequence of key/value pairs of the form
312 @var{key}:@var{value}.
314 A description of each shown parameter follows:
318 sequential number of the input frame, starting from 0
321 presentation TimeStamp of the input frame, expressed as a number of
322 time base units. The time base unit depends on the filter input pad, and
323 is usually 1/@var{sample_rate}.
326 presentation TimeStamp of the input frame, expressed as a number of
330 position of the frame in the input stream, -1 if this information in
331 unavailable and/or meaningless (for example in case of synthetic audio)
337 channel layout description
340 number of samples (per each channel) contained in the filtered frame
343 sample rate for the audio frame
346 Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame
349 Adler-32 checksum (printed in hexadecimal) for each input frame plane,
350 expressed in the form "[@var{c0} @var{c1} @var{c2} @var{c3} @var{c4} @var{c5}
356 Split input audio into several identical outputs.
358 The filter accepts a single parameter which specifies the number of outputs. If
359 unspecified, it defaults to 2.
363 [in] asplit [out0][out1]
366 will create two separate outputs from the same input.
368 To create 3 or more outputs, you need to specify the number of
371 [in] asplit=3 [out0][out1][out2]
375 ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
377 will create 5 copies of the input audio.
382 Forward two audio streams and control the order the buffers are forwarded.
384 The argument to the filter is an expression deciding which stream should be
385 forwarded next: if the result is negative, the first stream is forwarded; if
386 the result is positive or zero, the second stream is forwarded. It can use
387 the following variables:
391 number of buffers forwarded so far on each stream
393 number of samples forwarded so far on each stream
395 current timestamp of each stream
398 The default value is @code{t1-t2}, which means to always forward the stream
399 that has a smaller timestamp.
401 Example: stress-test @code{amerge} by randomly sending buffers on the wrong
402 input, while avoiding too much of a desynchronization:
404 amovie=file.ogg [a] ; amovie=file.mp3 [b] ;
405 [a] [b] astreamsync=(2*random(1))-1+tanh(5*(t1-t2)) [a2] [b2] ;
413 The filter accepts exactly one parameter, the audio tempo. If not
414 specified then the filter will assume nominal 1.0 tempo. Tempo must
415 be in the [0.5, 2.0] range.
417 For example, to slow down audio to 80% tempo:
422 For example, to speed up audio to 125% tempo:
429 Make audio easier to listen to on headphones.
431 This filter adds `cues' to 44.1kHz stereo (i.e. audio CD format) audio
432 so that when listened to on headphones the stereo image is moved from
433 inside your head (standard for headphones) to outside and in front of
434 the listener (standard for speakers).
440 Mix channels with specific gain levels. The filter accepts the output
441 channel layout followed by a set of channels definitions.
443 This filter is also designed to remap efficiently the channels of an audio
446 The filter accepts parameters of the form:
447 "@var{l}:@var{outdef}:@var{outdef}:..."
451 output channel layout or number of channels
454 output channel specification, of the form:
455 "@var{out_name}=[@var{gain}*]@var{in_name}[+[@var{gain}*]@var{in_name}...]"
458 output channel to define, either a channel name (FL, FR, etc.) or a channel
459 number (c0, c1, etc.)
462 multiplicative coefficient for the channel, 1 leaving the volume unchanged
465 input channel to use, see out_name for details; it is not possible to mix
466 named and numbered input channels
469 If the `=' in a channel specification is replaced by `<', then the gains for
470 that specification will be renormalized so that the total is 1, thus
471 avoiding clipping noise.
473 @subsection Mixing examples
475 For example, if you want to down-mix from stereo to mono, but with a bigger
476 factor for the left channel:
478 pan=1:c0=0.9*c0+0.1*c1
481 A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
484 pan=stereo: FL < FL + 0.5*FC + 0.6*BL + 0.6*SL : FR < FR + 0.5*FC + 0.6*BR + 0.6*SR
487 Note that @command{ffmpeg} integrates a default down-mix (and up-mix) system
488 that should be preferred (see "-ac" option) unless you have very specific
491 @subsection Remapping examples
493 The channel remapping will be effective if, and only if:
496 @item gain coefficients are zeroes or ones,
497 @item only one input per channel output,
500 If all these conditions are satisfied, the filter will notify the user ("Pure
501 channel mapping detected"), and use an optimized and lossless method to do the
504 For example, if you have a 5.1 source and want a stereo audio stream by
505 dropping the extra channels:
507 pan="stereo: c0=FL : c1=FR"
510 Given the same source, you can also switch front left and front right channels
511 and keep the input channel layout:
513 pan="5.1: c0=c1 : c1=c0 : c2=c2 : c3=c3 : c4=c4 : c5=c5"
516 If the input is a stereo audio stream, you can mute the front left channel (and
517 still keep the stereo channel layout) with:
522 Still with a stereo audio stream input, you can copy the right channel in both
523 front left and right:
525 pan="stereo: c0=FR : c1=FR"
528 @section silencedetect
530 Detect silence in an audio stream.
532 This filter logs a message when it detects that the input audio volume is less
533 or equal to a noise tolerance value for a duration greater or equal to the
534 minimum detected noise duration.
536 The printed times and duration are expressed in seconds.
540 Set silence duration until notification (default is 2 seconds).
543 Set noise tolerance. Can be specified in dB (in case "dB" is appended to the
544 specified value) or amplitude ratio. Default is -60dB, or 0.001.
547 Detect 5 seconds of silence with -50dB noise tolerance:
549 silencedetect=n=-50dB:d=5
552 Complete example with @command{ffmpeg} to detect silence with 0.0001 noise
553 tolerance in @file{silence.mp3}:
555 ffmpeg -f lavfi -i amovie=silence.mp3,silencedetect=noise=0.0001 -f null -
560 Adjust the input audio volume.
562 The filter accepts exactly one parameter @var{vol}, which expresses
563 how the audio volume will be increased or decreased.
565 Output values are clipped to the maximum value.
567 If @var{vol} is expressed as a decimal number, the output audio
568 volume is given by the relation:
570 @var{output_volume} = @var{vol} * @var{input_volume}
573 If @var{vol} is expressed as a decimal number followed by the string
574 "dB", the value represents the requested change in decibels of the
575 input audio power, and the output audio volume is given by the
578 @var{output_volume} = 10^(@var{vol}/20) * @var{input_volume}
581 Otherwise @var{vol} is considered an expression and its evaluated
582 value is used for computing the output audio volume according to the
585 Default value for @var{vol} is 1.0.
591 Half the input audio volume:
596 The above example is equivalent to:
602 Decrease input audio power by 12 decibels:
609 Synchronize audio data with timestamps by squeezing/stretching it and/or
610 dropping samples/adding silence when needed.
612 The filter accepts the following named parameters:
616 Enable stretching/squeezing the data to make it match the timestamps.
619 Minimum difference between timestamps and audio data (in seconds) to trigger
620 adding/dropping samples.
623 Maximum compensation in samples per second.
627 @section channelsplit
628 Split each channel in input audio stream into a separate output stream.
630 This filter accepts the following named parameters:
633 Channel layout of the input stream. Default is "stereo".
636 For example, assuming a stereo input MP3 file
638 ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
640 will create an output Matroska file with two audio streams, one containing only
641 the left channel and the other the right channel.
643 To split a 5.1 WAV file into per-channel files
645 ffmpeg -i in.wav -filter_complex
646 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
647 -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
648 front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
653 Remap input channels to new locations.
655 This filter accepts the following named parameters:
658 Channel layout of the output stream.
661 Map channels from input to output. The argument is a comma-separated list of
662 mappings, each in the @code{@var{in_channel}-@var{out_channel}} or
663 @var{in_channel} form. @var{in_channel} can be either the name of the input
664 channel (e.g. FL for front left) or its index in the input channel layout.
665 @var{out_channel} is the name of the output channel or its index in the output
666 channel layout. If @var{out_channel} is not given then it is implicitly an
667 index, starting with zero and increasing by one for each mapping.
670 If no mapping is present, the filter will implicitly map input channels to
671 output channels preserving index.
673 For example, assuming a 5.1+downmix input MOV file
675 ffmpeg -i in.mov -filter 'channelmap=map=DL-FL\,DR-FR' out.wav
677 will create an output WAV file tagged as stereo from the downmix channels of
680 To fix a 5.1 WAV improperly encoded in AAC's native channel order
682 ffmpeg -i in.wav -filter 'channelmap=1\,2\,0\,5\,3\,4:channel_layout=5.1' out.wav
686 Join multiple input streams into one multi-channel stream.
688 The filter accepts the following named parameters:
692 Number of input streams. Defaults to 2.
695 Desired output channel layout. Defaults to stereo.
698 Map channels from inputs to output. The argument is a comma-separated list of
699 mappings, each in the @code{@var{input_idx}.@var{in_channel}-@var{out_channel}}
700 form. @var{input_idx} is the 0-based index of the input stream. @var{in_channel}
701 can be either the name of the input channel (e.g. FL for front left) or its
702 index in the specified input stream. @var{out_channel} is the name of the output
706 The filter will attempt to guess the mappings when those are not specified
707 explicitly. It does so by first trying to find an unused matching input channel
708 and if that fails it picks the first unused input channel.
710 E.g. to join 3 inputs (with properly set channel layouts)
712 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
715 To build a 5.1 output from 6 single-channel streams:
717 ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
718 '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'
723 Convert the audio sample format, sample rate and channel layout. This filter is
724 not meant to be used directly.
726 @c man end AUDIO FILTERS
728 @chapter Audio Sources
729 @c man begin AUDIO SOURCES
731 Below is a description of the currently available audio sources.
735 Buffer audio frames, and make them available to the filter chain.
737 This source is mainly intended for a programmatic use, in particular
738 through the interface defined in @file{libavfilter/asrc_abuffer.h}.
740 It accepts the following mandatory parameters:
741 @var{sample_rate}:@var{sample_fmt}:@var{channel_layout}
746 The sample rate of the incoming audio buffers.
749 The sample format of the incoming audio buffers.
750 Either a sample format name or its corresponging integer representation from
751 the enum AVSampleFormat in @file{libavutil/samplefmt.h}
754 The channel layout of the incoming audio buffers.
755 Either a channel layout name from channel_layout_map in
756 @file{libavutil/audioconvert.c} or its corresponding integer representation
757 from the AV_CH_LAYOUT_* macros in @file{libavutil/audioconvert.h}
763 abuffer=44100:s16p:stereo
766 will instruct the source to accept planar 16bit signed stereo at 44100Hz.
767 Since the sample format with name "s16p" corresponds to the number
768 6 and the "stereo" channel layout corresponds to the value 0x3, this is
776 Generate an audio signal specified by an expression.
778 This source accepts in input one or more expressions (one for each
779 channel), which are evaluated and used to generate a corresponding
782 It accepts the syntax: @var{exprs}[::@var{options}].
783 @var{exprs} is a list of expressions separated by ":", one for each
784 separate channel. In case the @var{channel_layout} is not
785 specified, the selected channel layout depends on the number of
786 provided expressions.
788 @var{options} is an optional sequence of @var{key}=@var{value} pairs,
791 The description of the accepted options follows.
795 @item channel_layout, c
796 Set the channel layout. The number of channels in the specified layout
797 must be equal to the number of specified expressions.
800 Set the minimum duration of the sourced audio. See the function
801 @code{av_parse_time()} for the accepted format.
802 Note that the resulting duration may be greater than the specified
803 duration, as the generated audio is always cut at the end of a
806 If not specified, or the expressed duration is negative, the audio is
807 supposed to be generated forever.
810 Set the number of samples per channel per each output frame,
814 Specify the sample rate, default to 44100.
817 Each expression in @var{exprs} can contain the following constants:
821 number of the evaluated sample, starting from 0
824 time of the evaluated sample expressed in seconds, starting from 0
843 Generate a sin signal with frequency of 440 Hz, set sample rate to
846 aevalsrc="sin(440*2*PI*t)::s=8000"
850 Generate a two channels signal, specify the channel layout (Front
851 Center + Back Center) explicitly:
853 aevalsrc="sin(420*2*PI*t):cos(430*2*PI*t)::c=FC|BC"
857 Generate white noise:
859 aevalsrc="-2+random(0)"
863 Generate an amplitude modulated signal:
865 aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)"
869 Generate 2.5 Hz binaural beats on a 360 Hz carrier:
871 aevalsrc="0.1*sin(2*PI*(360-2.5/2)*t) : 0.1*sin(2*PI*(360+2.5/2)*t)"
878 Read an audio stream from a movie container.
880 It accepts the syntax: @var{movie_name}[:@var{options}] where
881 @var{movie_name} is the name of the resource to read (not necessarily
882 a file but also a device or a stream accessed through some protocol),
883 and @var{options} is an optional sequence of @var{key}=@var{value}
884 pairs, separated by ":".
886 The description of the accepted options follows.
891 Specify the format assumed for the movie to read, and can be either
892 the name of a container or an input device. If not specified the
893 format is guessed from @var{movie_name} or by probing.
896 Specify the seek point in seconds, the frames will be output
897 starting from this seek point, the parameter is evaluated with
898 @code{av_strtod} so the numerical value may be suffixed by an IS
899 postfix. Default value is "0".
901 @item stream_index, si
902 Specify the index of the audio stream to read. If the value is -1,
903 the best suited audio stream will be automatically selected. Default
910 Null audio source, return unprocessed audio frames. It is mainly useful
911 as a template and to be employed in analysis / debugging tools, or as
912 the source for filters which ignore the input data (for example the sox
915 It accepts an optional sequence of @var{key}=@var{value} pairs,
918 The description of the accepted options follows.
923 Specify the sample rate, and defaults to 44100.
925 @item channel_layout, cl
927 Specify the channel layout, and can be either an integer or a string
928 representing a channel layout. The default value of @var{channel_layout}
931 Check the channel_layout_map definition in
932 @file{libavcodec/audioconvert.c} for the mapping between strings and
933 channel layout values.
936 Set the number of samples per requested frames.
940 Follow some examples:
942 # set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
943 anullsrc=r=48000:cl=4
946 anullsrc=r=48000:cl=mono
950 Buffer audio frames, and make them available to the filter chain.
952 This source is not intended to be part of user-supplied graph descriptions but
953 for insertion by calling programs through the interface defined in
954 @file{libavfilter/buffersrc.h}.
956 It accepts the following named parameters:
960 Timebase which will be used for timestamps of submitted frames. It must be
961 either a floating-point number or in @var{numerator}/@var{denominator} form.
967 Name of the sample format, as returned by @code{av_get_sample_fmt_name()}.
970 Channel layout of the audio data, in the form that can be accepted by
971 @code{av_get_channel_layout()}.
974 All the parameters need to be explicitly defined.
976 @c man end AUDIO SOURCES
979 @c man begin AUDIO SINKS
981 Below is a description of the currently available audio sinks.
985 Buffer audio frames, and make them available to the end of filter chain.
987 This sink is mainly intended for programmatic use, in particular
988 through the interface defined in @file{libavfilter/buffersink.h}.
990 It requires a pointer to an AVABufferSinkContext structure, which
991 defines the incoming buffers' formats, to be passed as the opaque
992 parameter to @code{avfilter_init_filter} for initialization.
996 Null audio sink, do absolutely nothing with the input audio. It is
997 mainly useful as a template and to be employed in analysis / debugging
1000 @section abuffersink
1001 This sink is intended for programmatic use. Frames that arrive on this sink can
1002 be retrieved by the calling program using the interface defined in
1003 @file{libavfilter/buffersink.h}.
1005 This filter accepts no parameters.
1007 @c man end AUDIO SINKS
1009 @chapter Video Filters
1010 @c man begin VIDEO FILTERS
1012 When you configure your FFmpeg build, you can disable any of the
1013 existing filters using @code{--disable-filters}.
1014 The configure output will show the video filters included in your
1017 Below is a description of the currently available video filters.
1021 Draw ASS (Advanced Substation Alpha) subtitles on top of input video
1022 using the libass library.
1024 To enable compilation of this filter you need to configure FFmpeg with
1025 @code{--enable-libass}.
1027 This filter accepts the syntax: @var{ass_filename}[:@var{options}],
1028 where @var{ass_filename} is the filename of the ASS file to read, and
1029 @var{options} is an optional sequence of @var{key}=@var{value} pairs,
1032 A description of the accepted options follows.
1036 Specifies the size of the original video, the video for which the ASS file
1037 was composed. Due to a misdesign in ASS aspect ratio arithmetic, this is
1038 necessary to correctly scale the fonts if the aspect ratio has been changed.
1041 For example, to render the file @file{sub.ass} on top of the input
1042 video, use the command:
1049 Compute the bounding box for the non-black pixels in the input frame
1052 This filter computes the bounding box containing all the pixels with a
1053 luminance value greater than the minimum allowed value.
1054 The parameters describing the bounding box are printed on the filter
1057 @section blackdetect
1059 Detect video intervals that are (almost) completely black. Can be
1060 useful to detect chapter transitions, commercials, or invalid
1061 recordings. Output lines contains the time for the start, end and
1062 duration of the detected black interval expressed in seconds.
1064 In order to display the output lines, you need to set the loglevel at
1065 least to the AV_LOG_INFO value.
1067 This filter accepts a list of options in the form of
1068 @var{key}=@var{value} pairs separated by ":". A description of the
1069 accepted options follows.
1072 @item black_min_duration, d
1073 Set the minimum detected black duration expressed in seconds. It must
1074 be a non-negative floating point number.
1076 Default value is 2.0.
1078 @item picture_black_ratio_th, pic_th
1079 Set the threshold for considering a picture "black".
1080 Express the minimum value for the ratio:
1082 @var{nb_black_pixels} / @var{nb_pixels}
1085 for which a picture is considered black.
1086 Default value is 0.98.
1088 @item pixel_black_th, pix_th
1089 Set the threshold for considering a pixel "black".
1091 The threshold expresses the maximum pixel luminance value for which a
1092 pixel is considered "black". The provided value is scaled according to
1093 the following equation:
1095 @var{absolute_threshold} = @var{luminance_minimum_value} + @var{pixel_black_th} * @var{luminance_range_size}
1098 @var{luminance_range_size} and @var{luminance_minimum_value} depend on
1099 the input video format, the range is [0-255] for YUV full-range
1100 formats and [16-235] for YUV non full-range formats.
1102 Default value is 0.10.
1105 The following example sets the maximum pixel threshold to the minimum
1106 value, and detects only black intervals of 2 or more seconds:
1108 blackdetect=d=2:pix_th=0.00
1113 Detect frames that are (almost) completely black. Can be useful to
1114 detect chapter transitions or commercials. Output lines consist of
1115 the frame number of the detected frame, the percentage of blackness,
1116 the position in the file if known or -1 and the timestamp in seconds.
1118 In order to display the output lines, you need to set the loglevel at
1119 least to the AV_LOG_INFO value.
1121 The filter accepts the syntax:
1123 blackframe[=@var{amount}:[@var{threshold}]]
1126 @var{amount} is the percentage of the pixels that have to be below the
1127 threshold, and defaults to 98.
1129 @var{threshold} is the threshold below which a pixel value is
1130 considered black, and defaults to 32.
1134 Apply boxblur algorithm to the input video.
1136 This filter accepts the parameters:
1137 @var{luma_radius}:@var{luma_power}:@var{chroma_radius}:@var{chroma_power}:@var{alpha_radius}:@var{alpha_power}
1139 Chroma and alpha parameters are optional, if not specified they default
1140 to the corresponding values set for @var{luma_radius} and
1143 @var{luma_radius}, @var{chroma_radius}, and @var{alpha_radius} represent
1144 the radius in pixels of the box used for blurring the corresponding
1145 input plane. They are expressions, and can contain the following
1149 the input width and height in pixels
1152 the input chroma image width and height in pixels
1155 horizontal and vertical chroma subsample values. For example for the
1156 pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
1159 The radius must be a non-negative number, and must not be greater than
1160 the value of the expression @code{min(w,h)/2} for the luma and alpha planes,
1161 and of @code{min(cw,ch)/2} for the chroma planes.
1163 @var{luma_power}, @var{chroma_power}, and @var{alpha_power} represent
1164 how many times the boxblur filter is applied to the corresponding
1167 Some examples follow:
1172 Apply a boxblur filter with luma, chroma, and alpha radius
1179 Set luma radius to 2, alpha and chroma radius to 0
1185 Set luma and chroma radius to a fraction of the video dimension
1187 boxblur=min(h\,w)/10:1:min(cw\,ch)/10:1
1192 @section colormatrix
1194 The colormatrix filter allows conversion between any of the following color
1195 space: BT.709 (@var{bt709}), BT.601 (@var{bt601}), SMPTE-240M (@var{smpte240m})
1196 and FCC (@var{fcc}).
1198 The syntax of the parameters is @var{source}:@var{destination}:
1201 colormatrix=bt601:smpte240m
1206 Copy the input source unchanged to the output. Mainly useful for
1211 Crop the input video to @var{out_w}:@var{out_h}:@var{x}:@var{y}:@var{keep_aspect}
1213 The @var{keep_aspect} parameter is optional, if specified and set to a
1214 non-zero value will force the output display aspect ratio to be the
1215 same of the input, by changing the output sample aspect ratio.
1217 The @var{out_w}, @var{out_h}, @var{x}, @var{y} parameters are
1218 expressions containing the following constants:
1222 the computed values for @var{x} and @var{y}. They are evaluated for
1226 the input width and height
1229 same as @var{in_w} and @var{in_h}
1232 the output (cropped) width and height
1235 same as @var{out_w} and @var{out_h}
1238 same as @var{iw} / @var{ih}
1241 input sample aspect ratio
1244 input display aspect ratio, it is the same as (@var{iw} / @var{ih}) * @var{sar}
1247 horizontal and vertical chroma subsample values. For example for the
1248 pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
1251 the number of input frame, starting from 0
1254 the position in the file of the input frame, NAN if unknown
1257 timestamp expressed in seconds, NAN if the input timestamp is unknown
1261 The @var{out_w} and @var{out_h} parameters specify the expressions for
1262 the width and height of the output (cropped) video. They are
1263 evaluated just at the configuration of the filter.
1265 The default value of @var{out_w} is "in_w", and the default value of
1266 @var{out_h} is "in_h".
1268 The expression for @var{out_w} may depend on the value of @var{out_h},
1269 and the expression for @var{out_h} may depend on @var{out_w}, but they
1270 cannot depend on @var{x} and @var{y}, as @var{x} and @var{y} are
1271 evaluated after @var{out_w} and @var{out_h}.
1273 The @var{x} and @var{y} parameters specify the expressions for the
1274 position of the top-left corner of the output (non-cropped) area. They
1275 are evaluated for each frame. If the evaluated value is not valid, it
1276 is approximated to the nearest valid value.
1278 The default value of @var{x} is "(in_w-out_w)/2", and the default
1279 value for @var{y} is "(in_h-out_h)/2", which set the cropped area at
1280 the center of the input image.
1282 The expression for @var{x} may depend on @var{y}, and the expression
1283 for @var{y} may depend on @var{x}.
1285 Follow some examples:
1287 # crop the central input area with size 100x100
1290 # crop the central input area with size 2/3 of the input video
1291 "crop=2/3*in_w:2/3*in_h"
1293 # crop the input video central square
1296 # delimit the rectangle with the top-left corner placed at position
1297 # 100:100 and the right-bottom corner corresponding to the right-bottom
1298 # corner of the input image.
1299 crop=in_w-100:in_h-100:100:100
1301 # crop 10 pixels from the left and right borders, and 20 pixels from
1302 # the top and bottom borders
1303 "crop=in_w-2*10:in_h-2*20"
1305 # keep only the bottom right quarter of the input image
1306 "crop=in_w/2:in_h/2:in_w/2:in_h/2"
1308 # crop height for getting Greek harmony
1309 "crop=in_w:1/PHI*in_w"
1312 "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)"
1314 # erratic camera effect depending on timestamp
1315 "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)"
1317 # set x depending on the value of y
1318 "crop=in_w/2:in_h/2:y:10+10*sin(n/10)"
1323 Auto-detect crop size.
1325 Calculate necessary cropping parameters and prints the recommended
1326 parameters through the logging system. The detected dimensions
1327 correspond to the non-black area of the input video.
1329 It accepts the syntax:
1331 cropdetect[=@var{limit}[:@var{round}[:@var{reset}]]]
1337 Threshold, which can be optionally specified from nothing (0) to
1338 everything (255), defaults to 24.
1341 Value which the width/height should be divisible by, defaults to
1342 16. The offset is automatically adjusted to center the video. Use 2 to
1343 get only even dimensions (needed for 4:2:2 video). 16 is best when
1344 encoding to most video codecs.
1347 Counter that determines after how many frames cropdetect will reset
1348 the previously detected largest video area and start over to detect
1349 the current optimal crop area. Defaults to 0.
1351 This can be useful when channel logos distort the video area. 0
1352 indicates never reset and return the largest area encountered during
1358 Suppress a TV station logo by a simple interpolation of the surrounding
1359 pixels. Just set a rectangle covering the logo and watch it disappear
1360 (and sometimes something even uglier appear - your mileage may vary).
1362 The filter accepts parameters as a string of the form
1363 "@var{x}:@var{y}:@var{w}:@var{h}:@var{band}", or as a list of
1364 @var{key}=@var{value} pairs, separated by ":".
1366 The description of the accepted parameters follows.
1371 Specify the top left corner coordinates of the logo. They must be
1375 Specify the width and height of the logo to clear. They must be
1379 Specify the thickness of the fuzzy edge of the rectangle (added to
1380 @var{w} and @var{h}). The default value is 4.
1383 When set to 1, a green rectangle is drawn on the screen to simplify
1384 finding the right @var{x}, @var{y}, @var{w}, @var{h} parameters, and
1385 @var{band} is set to 4. The default value is 0.
1389 Some examples follow.
1394 Set a rectangle covering the area with top left corner coordinates 0,0
1395 and size 100x77, setting a band of size 10:
1397 delogo=0:0:100:77:10
1401 As the previous example, but use named options:
1403 delogo=x=0:y=0:w=100:h=77:band=10
1410 Attempt to fix small changes in horizontal and/or vertical shift. This
1411 filter helps remove camera shake from hand-holding a camera, bumping a
1412 tripod, moving on a vehicle, etc.
1414 The filter accepts parameters as a string of the form
1415 "@var{x}:@var{y}:@var{w}:@var{h}:@var{rx}:@var{ry}:@var{edge}:@var{blocksize}:@var{contrast}:@var{search}:@var{filename}"
1417 A description of the accepted parameters follows.
1422 Specify a rectangular area where to limit the search for motion
1424 If desired the search for motion vectors can be limited to a
1425 rectangular area of the frame defined by its top left corner, width
1426 and height. These parameters have the same meaning as the drawbox
1427 filter which can be used to visualise the position of the bounding
1430 This is useful when simultaneous movement of subjects within the frame
1431 might be confused for camera motion by the motion vector search.
1433 If any or all of @var{x}, @var{y}, @var{w} and @var{h} are set to -1
1434 then the full frame is used. This allows later options to be set
1435 without specifying the bounding box for the motion vector search.
1437 Default - search the whole frame.
1440 Specify the maximum extent of movement in x and y directions in the
1441 range 0-64 pixels. Default 16.
1444 Specify how to generate pixels to fill blanks at the edge of the
1445 frame. An integer from 0 to 3 as follows:
1448 Fill zeroes at blank locations
1450 Original image at blank locations
1452 Extruded edge value at blank locations
1454 Mirrored edge at blank locations
1457 The default setting is mirror edge at blank locations.
1460 Specify the blocksize to use for motion search. Range 4-128 pixels,
1464 Specify the contrast threshold for blocks. Only blocks with more than
1465 the specified contrast (difference between darkest and lightest
1466 pixels) will be considered. Range 1-255, default 125.
1469 Specify the search strategy 0 = exhaustive search, 1 = less exhaustive
1470 search. Default - exhaustive search.
1473 If set then a detailed log of the motion search is written to the
1480 Draw a colored box on the input image.
1482 It accepts the syntax:
1484 drawbox=@var{x}:@var{y}:@var{width}:@var{height}:@var{color}
1490 Specify the top left corner coordinates of the box. Default to 0.
1493 Specify the width and height of the box, if 0 they are interpreted as
1494 the input width and height. Default to 0.
1497 Specify the color of the box to write, it can be the name of a color
1498 (case insensitive match) or a 0xRRGGBB[AA] sequence.
1501 Follow some examples:
1503 # draw a black box around the edge of the input image
1506 # draw a box with color red and an opacity of 50%
1507 drawbox=10:20:200:60:red@@0.5"
1512 Draw text string or text from specified file on top of video using the
1513 libfreetype library.
1515 To enable compilation of this filter you need to configure FFmpeg with
1516 @code{--enable-libfreetype}.
1518 The filter also recognizes strftime() sequences in the provided text
1519 and expands them accordingly. Check the documentation of strftime().
1521 The filter accepts parameters as a list of @var{key}=@var{value} pairs,
1524 The description of the accepted parameters follows.
1529 Used to draw a box around text using background color.
1530 Value should be either 1 (enable) or 0 (disable).
1531 The default value of @var{box} is 0.
1534 The color to be used for drawing box around text.
1535 Either a string (e.g. "yellow") or in 0xRRGGBB[AA] format
1536 (e.g. "0xff00ff"), possibly followed by an alpha specifier.
1537 The default value of @var{boxcolor} is "white".
1540 Set an expression which specifies if the text should be drawn. If the
1541 expression evaluates to 0, the text is not drawn. This is useful for
1542 specifying that the text should be drawn only when specific conditions
1545 Default value is "1".
1547 See below for the list of accepted constants and functions.
1550 If true, check and fix text coords to avoid clipping.
1553 The color to be used for drawing fonts.
1554 Either a string (e.g. "red") or in 0xRRGGBB[AA] format
1555 (e.g. "0xff000033"), possibly followed by an alpha specifier.
1556 The default value of @var{fontcolor} is "black".
1559 The font file to be used for drawing text. Path must be included.
1560 This parameter is mandatory.
1563 The font size to be used for drawing text.
1564 The default value of @var{fontsize} is 16.
1567 Flags to be used for loading the fonts.
1569 The flags map the corresponding flags supported by libfreetype, and are
1570 a combination of the following values:
1577 @item vertical_layout
1578 @item force_autohint
1581 @item ignore_global_advance_width
1583 @item ignore_transform
1590 Default value is "render".
1592 For more information consult the documentation for the FT_LOAD_*
1596 The color to be used for drawing a shadow behind the drawn text. It
1597 can be a color name (e.g. "yellow") or a string in the 0xRRGGBB[AA]
1598 form (e.g. "0xff00ff"), possibly followed by an alpha specifier.
1599 The default value of @var{shadowcolor} is "black".
1601 @item shadowx, shadowy
1602 The x and y offsets for the text shadow position with respect to the
1603 position of the text. They can be either positive or negative
1604 values. Default value for both is "0".
1607 The size in number of spaces to use for rendering the tab.
1611 Set the initial timecode representation in "hh:mm:ss[:;.]ff"
1612 format. It can be used with or without text parameter. @var{timecode_rate}
1613 option must be specified.
1615 @item timecode_rate, rate, r
1616 Set the timecode frame rate (timecode only).
1619 The text string to be drawn. The text must be a sequence of UTF-8
1621 This parameter is mandatory if no file is specified with the parameter
1625 A text file containing text to be drawn. The text must be a sequence
1626 of UTF-8 encoded characters.
1628 This parameter is mandatory if no text string is specified with the
1629 parameter @var{text}.
1631 If both @var{text} and @var{textfile} are specified, an error is thrown.
1634 The expressions which specify the offsets where text will be drawn
1635 within the video frame. They are relative to the top/left border of the
1638 The default value of @var{x} and @var{y} is "0".
1640 See below for the list of accepted constants and functions.
1643 The parameters for @var{x} and @var{y} are expressions containing the
1644 following constants and functions:
1648 input display aspect ratio, it is the same as (@var{w} / @var{h}) * @var{sar}
1651 horizontal and vertical chroma subsample values. For example for the
1652 pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
1655 the height of each text line
1663 @item max_glyph_a, ascent
1664 the maximum distance from the baseline to the highest/upper grid
1665 coordinate used to place a glyph outline point, for all the rendered
1667 It is a positive value, due to the grid's orientation with the Y axis
1670 @item max_glyph_d, descent
1671 the maximum distance from the baseline to the lowest grid coordinate
1672 used to place a glyph outline point, for all the rendered glyphs.
1673 This is a negative value, due to the grid's orientation, with the Y axis
1677 maximum glyph height, that is the maximum height for all the glyphs
1678 contained in the rendered text, it is equivalent to @var{ascent} -
1682 maximum glyph width, that is the maximum width for all the glyphs
1683 contained in the rendered text
1686 the number of input frame, starting from 0
1688 @item rand(min, max)
1689 return a random number included between @var{min} and @var{max}
1692 input sample aspect ratio
1695 timestamp expressed in seconds, NAN if the input timestamp is unknown
1698 the height of the rendered text
1701 the width of the rendered text
1704 the x and y offset coordinates where the text is drawn.
1706 These parameters allow the @var{x} and @var{y} expressions to refer
1707 each other, so you can for example specify @code{y=x/dar}.
1710 If libavfilter was built with @code{--enable-fontconfig}, then
1711 @option{fontfile} can be a fontconfig pattern or omitted.
1713 Some examples follow.
1718 Draw "Test Text" with font FreeSerif, using the default values for the
1719 optional parameters.
1722 drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
1726 Draw 'Test Text' with font FreeSerif of size 24 at position x=100
1727 and y=50 (counting from the top-left corner of the screen), text is
1728 yellow with a red box around it. Both the text and the box have an
1732 drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
1733 x=100: y=50: fontsize=24: fontcolor=yellow@@0.2: box=1: boxcolor=red@@0.2"
1736 Note that the double quotes are not necessary if spaces are not used
1737 within the parameter list.
1740 Show the text at the center of the video frame:
1742 drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h-line_h)/2"
1746 Show a text line sliding from right to left in the last row of the video
1747 frame. The file @file{LONG_LINE} is assumed to contain a single line
1750 drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t"
1754 Show the content of file @file{CREDITS} off the bottom of the frame and scroll up.
1756 drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t"
1760 Draw a single green letter "g", at the center of the input video.
1761 The glyph baseline is placed at half screen height.
1763 drawtext="fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent"
1767 Show text for 1 second every 3 seconds:
1769 drawtext="fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:draw=lt(mod(t\\,3)\\,1):text='blink'"
1773 Use fontconfig to set the font. Note that the colons need to be escaped.
1775 drawtext='fontfile=Linux Libertine O-40\\:style=Semibold:text=FFmpeg'
1780 For more information about libfreetype, check:
1781 @url{http://www.freetype.org/}.
1783 For more information about fontconfig, check:
1784 @url{http://freedesktop.org/software/fontconfig/fontconfig-user.html}.
1788 Apply fade-in/out effect to input video.
1790 It accepts the parameters:
1791 @var{type}:@var{start_frame}:@var{nb_frames}[:@var{options}]
1793 @var{type} specifies if the effect type, can be either "in" for
1794 fade-in, or "out" for a fade-out effect.
1796 @var{start_frame} specifies the number of the start frame for starting
1797 to apply the fade effect.
1799 @var{nb_frames} specifies the number of frames for which the fade
1800 effect has to last. At the end of the fade-in effect the output video
1801 will have the same intensity as the input video, at the end of the
1802 fade-out transition the output video will be completely black.
1804 @var{options} is an optional sequence of @var{key}=@var{value} pairs,
1805 separated by ":". The description of the accepted options follows.
1812 @item start_frame, s
1813 See @var{start_frame}.
1816 See @var{nb_frames}.
1819 If set to 1, fade only alpha channel, if one exists on the input.
1823 A few usage examples follow, usable too as test scenarios.
1825 # fade in first 30 frames of video
1828 # fade out last 45 frames of a 200-frame video
1831 # fade in first 25 frames and fade out last 25 frames of a 1000-frame video
1832 fade=in:0:25, fade=out:975:25
1834 # make first 5 frames black, then fade in from frame 5-24
1837 # fade in alpha over first 25 frames of video
1838 fade=in:0:25:alpha=1
1843 Transform the field order of the input video.
1845 It accepts one parameter which specifies the required field order that
1846 the input interlaced video will be transformed to. The parameter can
1847 assume one of the following values:
1851 output bottom field first
1853 output top field first
1856 Default value is "tff".
1858 Transformation is achieved by shifting the picture content up or down
1859 by one line, and filling the remaining line with appropriate picture content.
1860 This method is consistent with most broadcast field order converters.
1862 If the input video is not flagged as being interlaced, or it is already
1863 flagged as being of the required output field order then this filter does
1864 not alter the incoming video.
1866 This filter is very useful when converting to or from PAL DV material,
1867 which is bottom field first.
1871 ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
1876 Buffer input images and send them when they are requested.
1878 This filter is mainly useful when auto-inserted by the libavfilter
1881 The filter does not take parameters.
1885 Convert the input video to one of the specified pixel formats.
1886 Libavfilter will try to pick one that is supported for the input to
1889 The filter accepts a list of pixel format names, separated by ":",
1890 for example "yuv420p:monow:rgb24".
1892 Some examples follow:
1894 # convert the input video to the format "yuv420p"
1897 # convert the input video to any of the formats in the list
1898 format=yuv420p:yuv444p:yuv410p
1903 Convert the video to specified constant framerate by duplicating or dropping
1904 frames as necessary.
1906 This filter accepts the following named parameters:
1910 Desired output framerate.
1917 Apply a frei0r effect to the input video.
1919 To enable compilation of this filter you need to install the frei0r
1920 header and configure FFmpeg with @code{--enable-frei0r}.
1922 The filter supports the syntax:
1924 @var{filter_name}[@{:|=@}@var{param1}:@var{param2}:...:@var{paramN}]
1927 @var{filter_name} is the name to the frei0r effect to load. If the
1928 environment variable @env{FREI0R_PATH} is defined, the frei0r effect
1929 is searched in each one of the directories specified by the colon
1930 separated list in @env{FREIOR_PATH}, otherwise in the standard frei0r
1931 paths, which are in this order: @file{HOME/.frei0r-1/lib/},
1932 @file{/usr/local/lib/frei0r-1/}, @file{/usr/lib/frei0r-1/}.
1934 @var{param1}, @var{param2}, ... , @var{paramN} specify the parameters
1935 for the frei0r effect.
1937 A frei0r effect parameter can be a boolean (whose values are specified
1938 with "y" and "n"), a double, a color (specified by the syntax
1939 @var{R}/@var{G}/@var{B}, @var{R}, @var{G}, and @var{B} being float
1940 numbers from 0.0 to 1.0) or by an @code{av_parse_color()} color
1941 description), a position (specified by the syntax @var{X}/@var{Y},
1942 @var{X} and @var{Y} being float numbers) and a string.
1944 The number and kind of parameters depend on the loaded effect. If an
1945 effect parameter is not specified the default value is set.
1947 Some examples follow:
1951 Apply the distort0r effect, set the first two double parameters:
1953 frei0r=distort0r:0.5:0.01
1957 Apply the colordistance effect, takes a color as first parameter:
1959 frei0r=colordistance:0.2/0.3/0.4
1960 frei0r=colordistance:violet
1961 frei0r=colordistance:0x112233
1965 Apply the perspective effect, specify the top left and top right image
1968 frei0r=perspective:0.2/0.2:0.8/0.2
1972 For more information see:
1973 @url{http://frei0r.dyne.org}
1977 Fix the banding artifacts that are sometimes introduced into nearly flat
1978 regions by truncation to 8bit color depth.
1979 Interpolate the gradients that should go where the bands are, and
1982 This filter is designed for playback only. Do not use it prior to
1983 lossy compression, because compression tends to lose the dither and
1984 bring back the bands.
1986 The filter takes two optional parameters, separated by ':':
1987 @var{strength}:@var{radius}
1989 @var{strength} is the maximum amount by which the filter will change
1990 any one pixel. Also the threshold for detecting nearly flat
1991 regions. Acceptable values range from .51 to 255, default value is
1992 1.2, out-of-range values will be clipped to the valid range.
1994 @var{radius} is the neighborhood to fit the gradient to. A larger
1995 radius makes for smoother gradients, but also prevents the filter from
1996 modifying the pixels near detailed regions. Acceptable values are
1997 8-32, default value is 16, out-of-range values will be clipped to the
2001 # default parameters
2010 Flip the input video horizontally.
2012 For example to horizontally flip the input video with @command{ffmpeg}:
2014 ffmpeg -i in.avi -vf "hflip" out.avi
2019 High precision/quality 3d denoise filter. This filter aims to reduce
2020 image noise producing smooth images and making still images really
2021 still. It should enhance compressibility.
2023 It accepts the following optional parameters:
2024 @var{luma_spatial}:@var{chroma_spatial}:@var{luma_tmp}:@var{chroma_tmp}
2028 a non-negative float number which specifies spatial luma strength,
2031 @item chroma_spatial
2032 a non-negative float number which specifies spatial chroma strength,
2033 defaults to 3.0*@var{luma_spatial}/4.0
2036 a float number which specifies luma temporal strength, defaults to
2037 6.0*@var{luma_spatial}/4.0
2040 a float number which specifies chroma temporal strength, defaults to
2041 @var{luma_tmp}*@var{chroma_spatial}/@var{luma_spatial}
2046 Interlaceing detect filter. This filter tries to detect if the input is
2047 interlaced or progressive. Top or bottom field first.
2049 @section lut, lutrgb, lutyuv
2051 Compute a look-up table for binding each pixel component input value
2052 to an output value, and apply it to input video.
2054 @var{lutyuv} applies a lookup table to a YUV input video, @var{lutrgb}
2055 to an RGB input video.
2057 These filters accept in input a ":"-separated list of options, which
2058 specify the expressions used for computing the lookup table for the
2059 corresponding pixel component values.
2061 The @var{lut} filter requires either YUV or RGB pixel formats in
2062 input, and accepts the options:
2065 first pixel component
2067 second pixel component
2069 third pixel component
2071 fourth pixel component, corresponds to the alpha component
2074 The exact component associated to each option depends on the format in
2077 The @var{lutrgb} filter requires RGB pixel formats in input, and
2078 accepts the options:
2090 The @var{lutyuv} filter requires YUV pixel formats in input, and
2091 accepts the options:
2094 Y/luminance component
2103 The expressions can contain the following constants and functions:
2107 the input width and height
2110 input value for the pixel component
2113 the input value clipped in the @var{minval}-@var{maxval} range
2116 maximum value for the pixel component
2119 minimum value for the pixel component
2122 the negated value for the pixel component value clipped in the
2123 @var{minval}-@var{maxval} range , it corresponds to the expression
2124 "maxval-clipval+minval"
2127 the computed value in @var{val} clipped in the
2128 @var{minval}-@var{maxval} range
2130 @item gammaval(gamma)
2131 the computed gamma correction value of the pixel component value
2132 clipped in the @var{minval}-@var{maxval} range, corresponds to the
2134 "pow((clipval-minval)/(maxval-minval)\,@var{gamma})*(maxval-minval)+minval"
2138 All expressions default to "val".
2140 Some examples follow:
2142 # negate input video
2143 lutrgb="r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val"
2144 lutyuv="y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val"
2146 # the above is the same as
2147 lutrgb="r=negval:g=negval:b=negval"
2148 lutyuv="y=negval:u=negval:v=negval"
2153 # remove chroma components, turns the video into a graytone image
2154 lutyuv="u=128:v=128"
2156 # apply a luma burning effect
2159 # remove green and blue components
2162 # set a constant alpha channel value on input
2163 format=rgba,lutrgb=a="maxval-minval/2"
2165 # correct luminance gamma by a 0.5 factor
2166 lutyuv=y=gammaval(0.5)
2171 Apply an MPlayer filter to the input video.
2173 This filter provides a wrapper around most of the filters of
2176 This wrapper is considered experimental. Some of the wrapped filters
2177 may not work properly and we may drop support for them, as they will
2178 be implemented natively into FFmpeg. Thus you should avoid
2179 depending on them when writing portable scripts.
2181 The filters accepts the parameters:
2182 @var{filter_name}[:=]@var{filter_params}
2184 @var{filter_name} is the name of a supported MPlayer filter,
2185 @var{filter_params} is a string containing the parameters accepted by
2188 The list of the currently supported filters follows:
2237 The parameter syntax and behavior for the listed filters are the same
2238 of the corresponding MPlayer filters. For detailed instructions check
2239 the "VIDEO FILTERS" section in the MPlayer manual.
2241 Some examples follow:
2243 # adjust gamma, brightness, contrast
2246 # tweak hue and saturation
2250 See also mplayer(1), @url{http://www.mplayerhq.hu/}.
2256 This filter accepts an integer in input, if non-zero it negates the
2257 alpha component (if available). The default value in input is 0.
2261 Force libavfilter not to use any of the specified pixel formats for the
2262 input to the next filter.
2264 The filter accepts a list of pixel format names, separated by ":",
2265 for example "yuv420p:monow:rgb24".
2267 Some examples follow:
2269 # force libavfilter to use a format different from "yuv420p" for the
2270 # input to the vflip filter
2271 noformat=yuv420p,vflip
2273 # convert the input video to any of the formats not contained in the list
2274 noformat=yuv420p:yuv444p:yuv410p
2279 Pass the video source unchanged to the output.
2283 Apply video transform using libopencv.
2285 To enable this filter install libopencv library and headers and
2286 configure FFmpeg with @code{--enable-libopencv}.
2288 The filter takes the parameters: @var{filter_name}@{:=@}@var{filter_params}.
2290 @var{filter_name} is the name of the libopencv filter to apply.
2292 @var{filter_params} specifies the parameters to pass to the libopencv
2293 filter. If not specified the default values are assumed.
2295 Refer to the official libopencv documentation for more precise
2297 @url{http://opencv.willowgarage.com/documentation/c/image_filtering.html}
2299 Follows the list of supported libopencv filters.
2304 Dilate an image by using a specific structuring element.
2305 This filter corresponds to the libopencv function @code{cvDilate}.
2307 It accepts the parameters: @var{struct_el}:@var{nb_iterations}.
2309 @var{struct_el} represents a structuring element, and has the syntax:
2310 @var{cols}x@var{rows}+@var{anchor_x}x@var{anchor_y}/@var{shape}
2312 @var{cols} and @var{rows} represent the number of columns and rows of
2313 the structuring element, @var{anchor_x} and @var{anchor_y} the anchor
2314 point, and @var{shape} the shape for the structuring element, and
2315 can be one of the values "rect", "cross", "ellipse", "custom".
2317 If the value for @var{shape} is "custom", it must be followed by a
2318 string of the form "=@var{filename}". The file with name
2319 @var{filename} is assumed to represent a binary image, with each
2320 printable character corresponding to a bright pixel. When a custom
2321 @var{shape} is used, @var{cols} and @var{rows} are ignored, the number
2322 or columns and rows of the read file are assumed instead.
2324 The default value for @var{struct_el} is "3x3+0x0/rect".
2326 @var{nb_iterations} specifies the number of times the transform is
2327 applied to the image, and defaults to 1.
2329 Follow some example:
2331 # use the default values
2334 # dilate using a structuring element with a 5x5 cross, iterate two times
2335 ocv=dilate=5x5+2x2/cross:2
2337 # read the shape from the file diamond.shape, iterate two times
2338 # the file diamond.shape may contain a pattern of characters like this:
2344 # the specified cols and rows are ignored (but not the anchor point coordinates)
2345 ocv=0x0+2x2/custom=diamond.shape:2
2350 Erode an image by using a specific structuring element.
2351 This filter corresponds to the libopencv function @code{cvErode}.
2353 The filter accepts the parameters: @var{struct_el}:@var{nb_iterations},
2354 with the same syntax and semantics as the @ref{dilate} filter.
2358 Smooth the input video.
2360 The filter takes the following parameters:
2361 @var{type}:@var{param1}:@var{param2}:@var{param3}:@var{param4}.
2363 @var{type} is the type of smooth filter to apply, and can be one of
2364 the following values: "blur", "blur_no_scale", "median", "gaussian",
2365 "bilateral". The default value is "gaussian".
2367 @var{param1}, @var{param2}, @var{param3}, and @var{param4} are
2368 parameters whose meanings depend on smooth type. @var{param1} and
2369 @var{param2} accept integer positive values or 0, @var{param3} and
2370 @var{param4} accept float values.
2372 The default value for @var{param1} is 3, the default value for the
2373 other parameters is 0.
2375 These parameters correspond to the parameters assigned to the
2376 libopencv function @code{cvSmooth}.
2381 Overlay one video on top of another.
2383 It takes two inputs and one output, the first input is the "main"
2384 video on which the second input is overlayed.
2386 It accepts the parameters: @var{x}:@var{y}[:@var{options}].
2388 @var{x} is the x coordinate of the overlayed video on the main video,
2389 @var{y} is the y coordinate. @var{x} and @var{y} are expressions containing
2390 the following parameters:
2393 @item main_w, main_h
2394 main input width and height
2397 same as @var{main_w} and @var{main_h}
2399 @item overlay_w, overlay_h
2400 overlay input width and height
2403 same as @var{overlay_w} and @var{overlay_h}
2406 @var{options} is an optional list of @var{key}=@var{value} pairs,
2409 The description of the accepted options follows.
2413 If set to 1, force the filter to accept inputs in the RGB
2414 color space. Default value is 0.
2417 Be aware that frames are taken from each input video in timestamp
2418 order, hence, if their initial timestamps differ, it is a a good idea
2419 to pass the two inputs through a @var{setpts=PTS-STARTPTS} filter to
2420 have them begin in the same zero timestamp, as it does the example for
2421 the @var{movie} filter.
2423 Follow some examples:
2425 # draw the overlay at 10 pixels from the bottom right
2426 # corner of the main video.
2427 overlay=main_w-overlay_w-10:main_h-overlay_h-10
2429 # insert a transparent PNG logo in the bottom left corner of the input
2430 ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
2432 # insert 2 different transparent PNG logos (second logo on bottom
2434 ffmpeg -i input -i logo1 -i logo2 -filter_complex
2435 'overlay=10:H-h-10,overlay=W-w-10:H-h-10' output
2437 # add a transparent color layer on top of the main video,
2438 # WxH specifies the size of the main input to the overlay filter
2439 color=red@.3:WxH [over]; [in][over] overlay [out]
2441 # play an original video and a filtered version (here with the deshake filter)
2443 ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
2445 # the previous example is the same as:
2446 ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
2449 You can chain together more overlays but the efficiency of such
2450 approach is yet to be tested.
2454 Add paddings to the input image, and places the original input at the
2455 given coordinates @var{x}, @var{y}.
2457 It accepts the following parameters:
2458 @var{width}:@var{height}:@var{x}:@var{y}:@var{color}.
2460 The parameters @var{width}, @var{height}, @var{x}, and @var{y} are
2461 expressions containing the following constants:
2465 the input video width and height
2468 same as @var{in_w} and @var{in_h}
2471 the output width and height, that is the size of the padded area as
2472 specified by the @var{width} and @var{height} expressions
2475 same as @var{out_w} and @var{out_h}
2478 x and y offsets as specified by the @var{x} and @var{y}
2479 expressions, or NAN if not yet specified
2482 same as @var{iw} / @var{ih}
2485 input sample aspect ratio
2488 input display aspect ratio, it is the same as (@var{iw} / @var{ih}) * @var{sar}
2491 horizontal and vertical chroma subsample values. For example for the
2492 pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
2495 Follows the description of the accepted parameters.
2500 Specify the size of the output image with the paddings added. If the
2501 value for @var{width} or @var{height} is 0, the corresponding input size
2502 is used for the output.
2504 The @var{width} expression can reference the value set by the
2505 @var{height} expression, and vice versa.
2507 The default value of @var{width} and @var{height} is 0.
2511 Specify the offsets where to place the input image in the padded area
2512 with respect to the top/left border of the output image.
2514 The @var{x} expression can reference the value set by the @var{y}
2515 expression, and vice versa.
2517 The default value of @var{x} and @var{y} is 0.
2521 Specify the color of the padded area, it can be the name of a color
2522 (case insensitive match) or a 0xRRGGBB[AA] sequence.
2524 The default value of @var{color} is "black".
2528 Some examples follow:
2531 # Add paddings with color "violet" to the input video. Output video
2532 # size is 640x480, the top-left corner of the input video is placed at
2534 pad=640:480:0:40:violet
2536 # pad the input to get an output with dimensions increased bt 3/2,
2537 # and put the input video at the center of the padded area
2538 pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
2540 # pad the input to get a squared output with size equal to the maximum
2541 # value between the input width and height, and put the input video at
2542 # the center of the padded area
2543 pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
2545 # pad the input to get a final w/h ratio of 16:9
2546 pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
2548 # for anamorphic video, in order to set the output display aspect ratio,
2549 # it is necessary to use sar in the expression, according to the relation:
2550 # (ih * X / ih) * sar = output_dar
2551 # X = output_dar / sar
2552 pad="ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2"
2554 # double output size and put the input video in the bottom-right
2555 # corner of the output padded area
2556 pad="2*iw:2*ih:ow-iw:oh-ih"
2559 @section pixdesctest
2561 Pixel format descriptor test filter, mainly useful for internal
2562 testing. The output video should be equal to the input video.
2566 format=monow, pixdesctest
2569 can be used to test the monowhite pixel format descriptor definition.
2573 Suppress a TV station logo, using an image file to determine which
2574 pixels comprise the logo. It works by filling in the pixels that
2575 comprise the logo with neighboring pixels.
2577 This filter requires one argument which specifies the filter bitmap
2578 file, which can be any image format supported by libavformat. The
2579 width and height of the image file must match those of the video
2580 stream being processed.
2582 Pixels in the provided bitmap image with a value of zero are not
2583 considered part of the logo, non-zero pixels are considered part of
2584 the logo. If you use white (255) for the logo and black (0) for the
2585 rest, you will be safe. For making the filter bitmap, it is
2586 recommended to take a screen capture of a black frame with the logo
2587 visible, and then using a threshold filter followed by the erode
2588 filter once or twice.
2590 If needed, little splotches can be fixed manually. Remember that if
2591 logo pixels are not covered, the filter quality will be much
2592 reduced. Marking too many pixels as part of the logo does not hurt as
2593 much, but it will increase the amount of blurring needed to cover over
2594 the image and will destroy more information than necessary, and extra
2595 pixels will slow things down on a large logo.
2599 Scale the input video to @var{width}:@var{height}[:@var{interl}=@{1|-1@}] and/or convert the image format.
2601 The scale filter forces the output display aspect ratio to be the same
2602 of the input, by changing the output sample aspect ratio.
2604 The parameters @var{width} and @var{height} are expressions containing
2605 the following constants:
2609 the input width and height
2612 same as @var{in_w} and @var{in_h}
2615 the output (cropped) width and height
2618 same as @var{out_w} and @var{out_h}
2621 same as @var{iw} / @var{ih}
2624 input sample aspect ratio
2627 input display aspect ratio, it is the same as (@var{iw} / @var{ih}) * @var{sar}
2630 horizontal and vertical chroma subsample values. For example for the
2631 pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
2634 If the input image format is different from the format requested by
2635 the next filter, the scale filter will convert the input to the
2638 If the value for @var{width} or @var{height} is 0, the respective input
2639 size is used for the output.
2641 If the value for @var{width} or @var{height} is -1, the scale filter will
2642 use, for the respective output size, a value that maintains the aspect
2643 ratio of the input image.
2645 The default value of @var{width} and @var{height} is 0.
2647 Valid values for the optional parameter @var{interl} are:
2651 force interlaced aware scaling
2654 select interlaced aware scaling depending on whether the source frames
2655 are flagged as interlaced or not
2658 Unless @var{interl} is set to one of the above options, interlaced scaling will not be used.
2660 Some examples follow:
2662 # scale the input video to a size of 200x100.
2665 # scale the input to 2x
2667 # the above is the same as
2670 # scale the input to 2x with forced interlaced scaling
2671 scale=2*iw:2*ih:interl=1
2673 # scale the input to half size
2676 # increase the width, and set the height to the same size
2679 # seek for Greek harmony
2683 # increase the height, and set the width to 3/2 of the height
2686 # increase the size, but make the size a multiple of the chroma
2687 scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
2689 # increase the width to a maximum of 500 pixels, keep the same input aspect ratio
2690 scale='min(500\, iw*3/2):-1'
2694 Select frames to pass in output.
2696 It accepts in input an expression, which is evaluated for each input
2697 frame. If the expression is evaluated to a non-zero value, the frame
2698 is selected and passed to the output, otherwise it is discarded.
2700 The expression can contain the following constants:
2704 the sequential number of the filtered frame, starting from 0
2707 the sequential number of the selected frame, starting from 0
2709 @item prev_selected_n
2710 the sequential number of the last selected frame, NAN if undefined
2713 timebase of the input timestamps
2716 the PTS (Presentation TimeStamp) of the filtered video frame,
2717 expressed in @var{TB} units, NAN if undefined
2720 the PTS (Presentation TimeStamp) of the filtered video frame,
2721 expressed in seconds, NAN if undefined
2724 the PTS of the previously filtered video frame, NAN if undefined
2726 @item prev_selected_pts
2727 the PTS of the last previously filtered video frame, NAN if undefined
2729 @item prev_selected_t
2730 the PTS of the last previously selected video frame, NAN if undefined
2733 the PTS of the first video frame in the video, NAN if undefined
2736 the time of the first video frame in the video, NAN if undefined
2739 the type of the filtered frame, can assume one of the following
2751 @item interlace_type
2752 the frame interlace type, can assume one of the following values:
2755 the frame is progressive (not interlaced)
2757 the frame is top-field-first
2759 the frame is bottom-field-first
2763 1 if the filtered frame is a key-frame, 0 otherwise
2766 the position in the file of the filtered frame, -1 if the information
2767 is not available (e.g. for synthetic video)
2770 value between 0 and 1 to indicate a new scene; a low value reflects a low
2771 probability for the current frame to introduce a new scene, while a higher
2772 value means the current frame is more likely to be one (see the example below)
2776 The default value of the select expression is "1".
2778 Some examples follow:
2781 # select all frames in input
2784 # the above is the same as:
2790 # select only I-frames
2791 select='eq(pict_type\,I)'
2793 # select one frame every 100
2794 select='not(mod(n\,100))'
2796 # select only frames contained in the 10-20 time interval
2797 select='gte(t\,10)*lte(t\,20)'
2799 # select only I frames contained in the 10-20 time interval
2800 select='gte(t\,10)*lte(t\,20)*eq(pict_type\,I)'
2802 # select frames with a minimum distance of 10 seconds
2803 select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
2806 Complete example to create a mosaic of the first scenes:
2809 ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
2812 Comparing @var{scene} against a value between 0.3 and 0.5 is generally a sane
2815 @section setdar, setsar
2817 The @code{setdar} filter sets the Display Aspect Ratio for the filter
2820 This is done by changing the specified Sample (aka Pixel) Aspect
2821 Ratio, according to the following equation:
2823 @var{DAR} = @var{HORIZONTAL_RESOLUTION} / @var{VERTICAL_RESOLUTION} * @var{SAR}
2826 Keep in mind that the @code{setdar} filter does not modify the pixel
2827 dimensions of the video frame. Also the display aspect ratio set by
2828 this filter may be changed by later filters in the filterchain,
2829 e.g. in case of scaling or if another "setdar" or a "setsar" filter is
2832 The @code{setsar} filter sets the Sample (aka Pixel) Aspect Ratio for
2833 the filter output video.
2835 Note that as a consequence of the application of this filter, the
2836 output display aspect ratio will change according to the equation
2839 Keep in mind that the sample aspect ratio set by the @code{setsar}
2840 filter may be changed by later filters in the filterchain, e.g. if
2841 another "setsar" or a "setdar" filter is applied.
2843 The @code{setdar} and @code{setsar} filters accept a parameter string
2844 which represents the wanted aspect ratio. The parameter can
2845 be a floating point number string, an expression, or a string of the form
2846 @var{num}:@var{den}, where @var{num} and @var{den} are the numerator
2847 and denominator of the aspect ratio. If the parameter is not
2848 specified, it is assumed the value "0:1".
2850 For example to change the display aspect ratio to 16:9, specify:
2855 The example above is equivalent to:
2860 To change the sample aspect ratio to 10:11, specify:
2867 Force field for the output video frame.
2869 The @code{setfield} filter marks the interlace type field for the
2870 output frames. It does not change the input frame, but only sets the
2871 corresponding property, which affects how the frame is treated by
2872 following filters (e.g. @code{fieldorder} or @code{yadif}).
2874 It accepts a string parameter, which can assume the following values:
2877 Keep the same field property.
2880 Mark the frame as bottom-field-first.
2883 Mark the frame as top-field-first.
2886 Mark the frame as progressive.
2891 Change the PTS (presentation timestamp) of the input video frames.
2893 Accept in input an expression evaluated through the eval API, which
2894 can contain the following constants:
2898 the presentation timestamp in input
2901 the count of the input frame, starting from 0.
2904 the PTS of the first video frame
2907 tell if the current frame is interlaced
2910 original position in the file of the frame, or undefined if undefined
2911 for the current frame
2921 Some examples follow:
2924 # start counting PTS from zero
2936 # fixed rate 25 fps with some jitter
2937 setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
2942 Set the timebase to use for the output frames timestamps.
2943 It is mainly useful for testing timebase configuration.
2945 It accepts in input an arithmetic expression representing a rational.
2946 The expression can contain the constants "AVTB" (the
2947 default timebase), and "intb" (the input timebase).
2949 The default value for the input is "intb".
2951 Follow some examples.
2954 # set the timebase to 1/25
2957 # set the timebase to 1/10
2960 #set the timebase to 1001/1000
2963 #set the timebase to 2*intb
2966 #set the default timebase value
2972 Show a line containing various information for each input video frame.
2973 The input video is not modified.
2975 The shown line contains a sequence of key/value pairs of the form
2976 @var{key}:@var{value}.
2978 A description of each shown parameter follows:
2982 sequential number of the input frame, starting from 0
2985 Presentation TimeStamp of the input frame, expressed as a number of
2986 time base units. The time base unit depends on the filter input pad.
2989 Presentation TimeStamp of the input frame, expressed as a number of
2993 position of the frame in the input stream, -1 if this information in
2994 unavailable and/or meaningless (for example in case of synthetic video)
3000 sample aspect ratio of the input frame, expressed in the form
3004 size of the input frame, expressed in the form
3005 @var{width}x@var{height}
3008 interlaced mode ("P" for "progressive", "T" for top field first, "B"
3009 for bottom field first)
3012 1 if the frame is a key frame, 0 otherwise
3015 picture type of the input frame ("I" for an I-frame, "P" for a
3016 P-frame, "B" for a B-frame, "?" for unknown type).
3017 Check also the documentation of the @code{AVPictureType} enum and of
3018 the @code{av_get_picture_type_char} function defined in
3019 @file{libavutil/avutil.h}.
3022 Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame
3024 @item plane_checksum
3025 Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
3026 expressed in the form "[@var{c0} @var{c1} @var{c2} @var{c3}]"
3031 Pass the images of input video on to next video filter as multiple
3035 ffmpeg -i in.avi -vf "slicify=32" out.avi
3038 The filter accepts the slice height as parameter. If the parameter is
3039 not specified it will use the default value of 16.
3041 Adding this in the beginning of filter chains should make filtering
3042 faster due to better use of the memory cache.
3046 Split input video into several identical outputs.
3048 The filter accepts a single parameter which specifies the number of outputs. If
3049 unspecified, it defaults to 2.
3053 ffmpeg -i INPUT -filter_complex split=5 OUTPUT
3055 will create 5 copies of the input video.
3059 [in] split [splitout1][splitout2];
3060 [splitout1] crop=100:100:0:0 [cropout];
3061 [splitout2] pad=200:200:100:100 [padout];
3064 will create two separate outputs from the same input, one cropped and
3069 Scale the input by 2x and smooth using the Super2xSaI (Scale and
3070 Interpolate) pixel art scaling algorithm.
3072 Useful for enlarging pixel art images without reducing sharpness.
3078 Select the most representative frame in a given sequence of consecutive frames.
3080 It accepts as argument the frames batch size to analyze (default @var{N}=100);
3081 in a set of @var{N} frames, the filter will pick one of them, and then handle
3082 the next batch of @var{N} frames until the end.
3084 Since the filter keeps track of the whole frames sequence, a bigger @var{N}
3085 value will result in a higher memory usage, so a high value is not recommended.
3087 The following example extract one picture each 50 frames:
3092 Complete example of a thumbnail creation with @command{ffmpeg}:
3094 ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
3099 Tile several successive frames together.
3101 It accepts as argument the tile size (i.e. the number of lines and columns)
3102 in the form "@var{w}x@var{h}".
3104 For example, produce 8×8 PNG tiles of all keyframes (@option{-skip_frame
3107 ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
3109 The @option{-vsync 0} is necessary to prevent @command{ffmpeg} from
3110 duplicating each output frame to accomodate the originally detected frame
3115 Perform various types of temporal field interlacing.
3117 Frames are counted starting from 1, so the first input frame is
3120 This filter accepts a single parameter specifying the mode. Available
3125 Move odd frames into the upper field, even into the lower field,
3126 generating a double height frame at half framerate.
3129 Only output even frames, odd frames are dropped, generating a frame with
3130 unchanged height at half framerate.
3133 Only output odd frames, even frames are dropped, generating a frame with
3134 unchanged height at half framerate.
3137 Expand each frame to full height, but pad alternate lines with black,
3138 generating a frame with double height at the same input framerate.
3140 @item interleave_top, 4
3141 Interleave the upper field from odd frames with the lower field from
3142 even frames, generating a frame with unchanged height at half framerate.
3144 @item interleave_bottom, 5
3145 Interleave the lower field from odd frames with the upper field from
3146 even frames, generating a frame with unchanged height at half framerate.
3148 @item interlacex2, 6
3149 Double frame rate with unchanged height. Frames are inserted each
3150 containing the second temporal field from the previous input frame and
3151 the first temporal field from the next input frame. This mode relies on
3152 the top_field_first flag. Useful for interlaced video displays with no
3153 field synchronisation.
3156 Numeric values are deprecated but are accepted for backward
3157 compatibility reasons.
3159 Default mode is @code{merge}.
3163 Transpose rows with columns in the input video and optionally flip it.
3165 It accepts a parameter representing an integer, which can assume the
3170 Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
3178 Rotate by 90 degrees clockwise, that is:
3186 Rotate by 90 degrees counterclockwise, that is:
3194 Rotate by 90 degrees clockwise and vertically flip, that is:
3204 Sharpen or blur the input video.
3206 It accepts the following parameters:
3207 @var{luma_msize_x}:@var{luma_msize_y}:@var{luma_amount}:@var{chroma_msize_x}:@var{chroma_msize_y}:@var{chroma_amount}
3209 Negative values for the amount will blur the input video, while positive
3210 values will sharpen. All parameters are optional and default to the
3211 equivalent of the string '5:5:1.0:5:5:0.0'.
3216 Set the luma matrix horizontal size. It can be an integer between 3
3217 and 13, default value is 5.
3220 Set the luma matrix vertical size. It can be an integer between 3
3221 and 13, default value is 5.
3224 Set the luma effect strength. It can be a float number between -2.0
3225 and 5.0, default value is 1.0.
3227 @item chroma_msize_x
3228 Set the chroma matrix horizontal size. It can be an integer between 3
3229 and 13, default value is 5.
3231 @item chroma_msize_y
3232 Set the chroma matrix vertical size. It can be an integer between 3
3233 and 13, default value is 5.
3236 Set the chroma effect strength. It can be a float number between -2.0
3237 and 5.0, default value is 0.0.
3242 # Strong luma sharpen effect parameters
3245 # Strong blur of both luma and chroma parameters
3246 unsharp=7:7:-2:7:7:-2
3248 # Use the default values with @command{ffmpeg}
3249 ffmpeg -i in.avi -vf "unsharp" out.mp4
3254 Flip the input video vertically.
3257 ffmpeg -i in.avi -vf "vflip" out.avi
3262 Deinterlace the input video ("yadif" means "yet another deinterlacing
3265 It accepts the optional parameters: @var{mode}:@var{parity}:@var{auto}.
3267 @var{mode} specifies the interlacing mode to adopt, accepts one of the
3272 output 1 frame for each frame
3274 output 1 frame for each field
3276 like 0 but skips spatial interlacing check
3278 like 1 but skips spatial interlacing check
3283 @var{parity} specifies the picture field parity assumed for the input
3284 interlaced video, accepts one of the following values:
3288 assume top field first
3290 assume bottom field first
3292 enable automatic detection
3295 Default value is -1.
3296 If interlacing is unknown or decoder does not export this information,
3297 top field first will be assumed.
3299 @var{auto} specifies if deinterlacer should trust the interlaced flag
3300 and only deinterlace frames marked as interlaced
3304 deinterlace all frames
3306 only deinterlace frames marked as interlaced
3311 @c man end VIDEO FILTERS
3313 @chapter Video Sources
3314 @c man begin VIDEO SOURCES
3316 Below is a description of the currently available video sources.
3320 Buffer video frames, and make them available to the filter chain.
3322 This source is mainly intended for a programmatic use, in particular
3323 through the interface defined in @file{libavfilter/vsrc_buffer.h}.
3325 It accepts a list of options in the form of @var{key}=@var{value} pairs
3326 separated by ":". A descroption of the accepted options follows.
3331 Specify the size (width and height) of the buffered video frames.
3334 A string representing the pixel format of the buffered video frames.
3335 It may be a number corresponding to a pixel format, or a pixel format
3339 Specify the timebase assumed by the timestamps of the buffered frames.
3342 Specify the frame rate expected for the video stream.
3345 Specify the sample aspect ratio assumed by the video frames.
3348 Specify the optional parameters to be used for the scale filter which
3349 is automatically inserted when an input change is detected in the
3350 input size or format.
3355 buffer=size=320x240:pix_fmt=yuv410p:time_base=1/24:pixel_aspect=1/1
3358 will instruct the source to accept video frames with size 320x240 and
3359 with format "yuv410p", assuming 1/24 as the timestamps timebase and
3360 square pixels (1:1 sample aspect ratio).
3361 Since the pixel format with name "yuv410p" corresponds to the number 6
3362 (check the enum PixelFormat definition in @file{libavutil/pixfmt.h}),
3363 this example corresponds to:
3365 buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
3368 Alternatively, the options can be specified as a flat string, but this
3369 syntax is deprecated:
3371 @var{width}:@var{height}:@var{pix_fmt}:@var{time_base.num}:@var{time_base.den}:@var{pixel_aspect.num}:@var{pixel_aspect.den}[:@var{sws_param}]
3375 Create a pattern generated by an elementary cellular automaton.
3377 The initial state of the cellular automaton can be defined through the
3378 @option{filename}, and @option{pattern} options. If such options are
3379 not specified an initial state is created randomly.
3381 At each new frame a new row in the video is filled with the result of
3382 the cellular automaton next generation. The behavior when the whole
3383 frame is filled is defined by the @option{scroll} option.
3385 This source accepts a list of options in the form of
3386 @var{key}=@var{value} pairs separated by ":". A description of the
3387 accepted options follows.
3391 Read the initial cellular automaton state, i.e. the starting row, from
3393 In the file, each non-whitespace character is considered an alive
3394 cell, a newline will terminate the row, and further characters in the
3395 file will be ignored.
3398 Read the initial cellular automaton state, i.e. the starting row, from
3399 the specified string.
3401 Each non-whitespace character in the string is considered an alive
3402 cell, a newline will terminate the row, and further characters in the
3403 string will be ignored.
3406 Set the video rate, that is the number of frames generated per second.
3409 @item random_fill_ratio, ratio
3410 Set the random fill ratio for the initial cellular automaton row. It
3411 is a floating point number value ranging from 0 to 1, defaults to
3414 This option is ignored when a file or a pattern is specified.
3416 @item random_seed, seed
3417 Set the seed for filling randomly the initial row, must be an integer
3418 included between 0 and UINT32_MAX. If not specified, or if explicitly
3419 set to -1, the filter will try to use a good random seed on a best
3423 Set the cellular automaton rule, it is a number ranging from 0 to 255.
3424 Default value is 110.
3427 Set the size of the output video.
3429 If @option{filename} or @option{pattern} is specified, the size is set
3430 by default to the width of the specified initial state row, and the
3431 height is set to @var{width} * PHI.
3433 If @option{size} is set, it must contain the width of the specified
3434 pattern string, and the specified pattern will be centered in the
3437 If a filename or a pattern string is not specified, the size value
3438 defaults to "320x518" (used for a randomly generated initial state).
3441 If set to 1, scroll the output upward when all the rows in the output
3442 have been already filled. If set to 0, the new generated row will be
3443 written over the top row just after the bottom row is filled.
3446 @item start_full, full
3447 If set to 1, completely fill the output with generated rows before
3448 outputting the first frame.
3449 This is the default behavior, for disabling set the value to 0.
3452 If set to 1, stitch the left and right row edges together.
3453 This is the default behavior, for disabling set the value to 0.
3456 @subsection Examples
3460 Read the initial state from @file{pattern}, and specify an output of
3463 cellauto=f=pattern:s=200x400
3467 Generate a random initial row with a width of 200 cells, with a fill
3470 cellauto=ratio=2/3:s=200x200
3474 Create a pattern generated by rule 18 starting by a single alive cell
3475 centered on an initial row with width 100:
3477 cellauto=p=@@:s=100x400:full=0:rule=18
3481 Specify a more elaborated initial pattern:
3483 cellauto=p='@@@@ @@ @@@@':s=100x400:full=0:rule=18
3490 Provide an uniformly colored input.
3492 This source accepts list of options in the form of
3493 @var{key}=@var{value} pairs separated by ":".
3495 Alternatively, it accepts a string in the form
3496 @var{color}:@var{size}:@var{rate}, but this syntax is
3499 Follows the description of the accepted parameters.
3504 Specify the color of the source. It can be the name of a color (case
3505 insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an
3506 alpha specifier. The default value is "black".
3509 Specify the size of the sourced video, it may be a string of the form
3510 @var{width}x@var{height}, or the name of a size abbreviation. The
3511 default value is "320x240".
3514 Specify the frame rate of the sourced video, as the number of frames
3515 generated per second. It has to be a string in the format
3516 @var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float
3517 number or a valid video frame rate abbreviation. The default value is
3522 For example the following graph description will generate a red source
3523 with an opacity of 0.2, with size "qcif" and a frame rate of 10
3524 frames per second, which will be overlayed over the source connected
3525 to the pad with identifier "in".
3528 "color=c=red@@0.2:s=qcif:r=10 [color]; [in][color] overlay [out]"
3533 Read a video stream from a movie container.
3535 It accepts the syntax: @var{movie_name}[:@var{options}] where
3536 @var{movie_name} is the name of the resource to read (not necessarily
3537 a file but also a device or a stream accessed through some protocol),
3538 and @var{options} is an optional sequence of @var{key}=@var{value}
3539 pairs, separated by ":".
3541 The description of the accepted options follows.
3545 @item format_name, f
3546 Specifies the format assumed for the movie to read, and can be either
3547 the name of a container or an input device. If not specified the
3548 format is guessed from @var{movie_name} or by probing.
3550 @item seek_point, sp
3551 Specifies the seek point in seconds, the frames will be output
3552 starting from this seek point, the parameter is evaluated with
3553 @code{av_strtod} so the numerical value may be suffixed by an IS
3554 postfix. Default value is "0".
3556 @item stream_index, si
3557 Specifies the index of the video stream to read. If the value is -1,
3558 the best suited video stream will be automatically selected. Default
3562 Specifies how many times to read the video stream in sequence.
3563 If the value is less than 1, the stream will be read again and again.
3564 Default value is "1".
3566 Note that when the movie is looped the source timestamps are not
3567 changed, so it will generate non monotonically increasing timestamps.
3570 This filter allows to overlay a second video on top of main input of
3571 a filtergraph as shown in this graph:
3573 input -----------> deltapts0 --> overlay --> output
3576 movie --> scale--> deltapts1 -------+
3579 Some examples follow:
3581 # skip 3.2 seconds from the start of the avi file in.avi, and overlay it
3582 # on top of the input labelled as "in".
3583 movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie];
3584 [in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
3586 # read from a video4linux2 device, and overlay it on top of the input
3588 movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie];
3589 [in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
3595 Generate various test patterns, as generated by the MPlayer test filter.
3597 The size of the generated video is fixed, and is 256x256.
3598 This source is useful in particular for testing encoding features.
3600 This source accepts an optional sequence of @var{key}=@var{value} pairs,
3601 separated by ":". The description of the accepted options follows.
3606 Specify the frame rate of the sourced video, as the number of frames
3607 generated per second. It has to be a string in the format
3608 @var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float
3609 number or a valid video frame rate abbreviation. The default value is
3613 Set the video duration of the sourced video. The accepted syntax is:
3618 See also the function @code{av_parse_time()}.
3620 If not specified, or the expressed duration is negative, the video is
3621 supposed to be generated forever.
3625 Set the number or the name of the test to perform. Supported tests are:
3640 Default value is "all", which will cycle through the list of all tests.
3643 For example the following:
3648 will generate a "dc_luma" test pattern.
3652 Provide a frei0r source.
3654 To enable compilation of this filter you need to install the frei0r
3655 header and configure FFmpeg with @code{--enable-frei0r}.
3657 The source supports the syntax:
3659 @var{size}:@var{rate}:@var{src_name}[@{=|:@}@var{param1}:@var{param2}:...:@var{paramN}]
3662 @var{size} is the size of the video to generate, may be a string of the
3663 form @var{width}x@var{height} or a frame size abbreviation.
3664 @var{rate} is the rate of the video to generate, may be a string of
3665 the form @var{num}/@var{den} or a frame rate abbreviation.
3666 @var{src_name} is the name to the frei0r source to load. For more
3667 information regarding frei0r and how to set the parameters read the
3668 section @ref{frei0r} in the description of the video filters.
3670 For example, to generate a frei0r partik0l source with size 200x200
3671 and frame rate 10 which is overlayed on the overlay filter main input:
3673 frei0r_src=200x200:10:partik0l=1234 [overlay]; [in][overlay] overlay
3678 Generate a life pattern.
3680 This source is based on a generalization of John Conway's life game.
3682 The sourced input represents a life grid, each pixel represents a cell
3683 which can be in one of two possible states, alive or dead. Every cell
3684 interacts with its eight neighbours, which are the cells that are
3685 horizontally, vertically, or diagonally adjacent.
3687 At each interaction the grid evolves according to the adopted rule,
3688 which specifies the number of neighbor alive cells which will make a
3689 cell stay alive or born. The @option{rule} option allows to specify
3692 This source accepts a list of options in the form of
3693 @var{key}=@var{value} pairs separated by ":". A description of the
3694 accepted options follows.
3698 Set the file from which to read the initial grid state. In the file,
3699 each non-whitespace character is considered an alive cell, and newline
3700 is used to delimit the end of each row.
3702 If this option is not specified, the initial grid is generated
3706 Set the video rate, that is the number of frames generated per second.
3709 @item random_fill_ratio, ratio
3710 Set the random fill ratio for the initial random grid. It is a
3711 floating point number value ranging from 0 to 1, defaults to 1/PHI.
3712 It is ignored when a file is specified.
3714 @item random_seed, seed
3715 Set the seed for filling the initial random grid, must be an integer
3716 included between 0 and UINT32_MAX. If not specified, or if explicitly
3717 set to -1, the filter will try to use a good random seed on a best
3723 A rule can be specified with a code of the kind "S@var{NS}/B@var{NB}",
3724 where @var{NS} and @var{NB} are sequences of numbers in the range 0-8,
3725 @var{NS} specifies the number of alive neighbor cells which make a
3726 live cell stay alive, and @var{NB} the number of alive neighbor cells
3727 which make a dead cell to become alive (i.e. to "born").
3728 "s" and "b" can be used in place of "S" and "B", respectively.
3730 Alternatively a rule can be specified by an 18-bits integer. The 9
3731 high order bits are used to encode the next cell state if it is alive
3732 for each number of neighbor alive cells, the low order bits specify
3733 the rule for "borning" new cells. Higher order bits encode for an
3734 higher number of neighbor cells.
3735 For example the number 6153 = @code{(12<<9)+9} specifies a stay alive
3736 rule of 12 and a born rule of 9, which corresponds to "S23/B03".
3738 Default value is "S23/B3", which is the original Conway's game of life
3739 rule, and will keep a cell alive if it has 2 or 3 neighbor alive
3740 cells, and will born a new cell if there are three alive cells around
3744 Set the size of the output video.
3746 If @option{filename} is specified, the size is set by default to the
3747 same size of the input file. If @option{size} is set, it must contain
3748 the size specified in the input file, and the initial grid defined in
3749 that file is centered in the larger resulting area.
3751 If a filename is not specified, the size value defaults to "320x240"
3752 (used for a randomly generated initial grid).
3755 If set to 1, stitch the left and right grid edges together, and the
3756 top and bottom edges also. Defaults to 1.
3759 Set cell mold speed. If set, a dead cell will go from @option{death_color} to
3760 @option{mold_color} with a step of @option{mold}. @option{mold} can have a
3761 value from 0 to 255.
3764 Set the color of living (or new born) cells.
3767 Set the color of dead cells. If @option{mold} is set, this is the first color
3768 used to represent a dead cell.
3771 Set mold color, for definitely dead and moldy cells.
3774 @subsection Examples
3778 Read a grid from @file{pattern}, and center it on a grid of size
3781 life=f=pattern:s=300x300
3785 Generate a random grid of size 200x200, with a fill ratio of 2/3:
3787 life=ratio=2/3:s=200x200
3791 Specify a custom rule for evolving a randomly generated grid:
3797 Full example with slow death effect (mold) using @command{ffplay}:
3799 ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16
3803 @section nullsrc, rgbtestsrc, testsrc
3805 The @code{nullsrc} source returns unprocessed video frames. It is
3806 mainly useful to be employed in analysis / debugging tools, or as the
3807 source for filters which ignore the input data.
3809 The @code{rgbtestsrc} source generates an RGB test pattern useful for
3810 detecting RGB vs BGR issues. You should see a red, green and blue
3811 stripe from top to bottom.
3813 The @code{testsrc} source generates a test video pattern, showing a
3814 color pattern, a scrolling gradient and a timestamp. This is mainly
3815 intended for testing purposes.
3817 These sources accept an optional sequence of @var{key}=@var{value} pairs,
3818 separated by ":". The description of the accepted options follows.
3823 Specify the size of the sourced video, it may be a string of the form
3824 @var{width}x@var{height}, or the name of a size abbreviation. The
3825 default value is "320x240".
3828 Specify the frame rate of the sourced video, as the number of frames
3829 generated per second. It has to be a string in the format
3830 @var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float
3831 number or a valid video frame rate abbreviation. The default value is
3835 Set the sample aspect ratio of the sourced video.
3838 Set the video duration of the sourced video. The accepted syntax is:
3840 [-]HH[:MM[:SS[.m...]]]
3843 See also the function @code{av_parse_time()}.
3845 If not specified, or the expressed duration is negative, the video is
3846 supposed to be generated forever.
3849 Set the number of decimals to show in the timestamp, only used in the
3850 @code{testsrc} source.
3852 The displayed timestamp value will correspond to the original
3853 timestamp value multiplied by the power of 10 of the specified
3854 value. Default value is 0.
3857 For example the following:
3859 testsrc=duration=5.3:size=qcif:rate=10
3862 will generate a video with a duration of 5.3 seconds, with size
3863 176x144 and a frame rate of 10 frames per second.
3865 If the input content is to be ignored, @code{nullsrc} can be used. The
3866 following command generates noise in the luminance plane by employing
3867 the @code{mp=geq} filter:
3869 nullsrc=s=256x256, mp=geq=random(1)*255:128:128
3872 @c man end VIDEO SOURCES
3874 @chapter Video Sinks
3875 @c man begin VIDEO SINKS
3877 Below is a description of the currently available video sinks.
3881 Buffer video frames, and make them available to the end of the filter
3884 This sink is mainly intended for a programmatic use, in particular
3885 through the interface defined in @file{libavfilter/buffersink.h}.
3887 It does not require a string parameter in input, but you need to
3888 specify a pointer to a list of supported pixel formats terminated by
3889 -1 in the opaque parameter provided to @code{avfilter_init_filter}
3890 when initializing this sink.
3894 Null video sink, do absolutely nothing with the input video. It is
3895 mainly useful as a template and to be employed in analysis / debugging
3898 @c man end VIDEO SINKS
3900 @chapter Transmedia Filters
3901 @c man begin TRANSMEDIA FILTERS
3903 Below is a description of the currently available transmedia filters.
3907 Convert input audio to a video output, representing the samples waves.
3909 The filter accepts the following named parameters:
3913 Set the number of samples which are printed on the same column. A
3914 larger value will decrease the frame rate. Must be a positive
3915 integer. This option can be set only if the value for @var{rate}
3916 is not explicitly specified.
3919 Set the (approximate) output frame rate. This is done by setting the
3920 option @var{n}. Default value is "25".
3923 Specify the video size for the output. Default value is "600x240".
3926 Some examples follow.
3929 Output the input file audio and the corresponding video representation
3932 amovie=a.mp3,asplit[out0],showwaves[out1]
3936 Create a synthetic signal and show it with showwaves, forcing a
3937 framerate of 30 frames per second:
3939 aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
3943 @c man end TRANSMEDIA FILTERS