1 \input texinfo @c -*- texinfo -*-
3 @settitle Libavfilter Documentation
5 @center @titlefont{Libavfilter Documentation}
14 Libavfilter is the filtering API of FFmpeg. It is the substitute of the
15 now deprecated 'vhooks' and started as a Google Summer of Code project.
17 Audio filtering integration into the main FFmpeg repository is a work in
18 progress, so audio API and ABI should not be considered stable yet.
22 In libavfilter, it is possible for filters to have multiple inputs and
24 To illustrate the sorts of things that are possible, we can
25 use a complex filter graph. For example, the following one:
28 input --> split --> fifo -----------------------> overlay --> output
31 +------> fifo --> crop --> vflip --------+
34 splits the stream in two streams, sends one stream through the crop filter
35 and the vflip filter before merging it back with the other stream by
36 overlaying it on top. You can use the following command to achieve this:
39 ffmpeg -i input -vf "[in] split [T1], fifo, [T2] overlay=0:H/2 [out]; [T1] fifo, crop=iw:ih/2:0:ih/2, vflip [T2]" output
42 The result will be that in output the top half of the video is mirrored
45 Video filters are loaded using the @var{-vf} option passed to
46 @command{ffmpeg} or to @command{ffplay}. Filters in the same linear
47 chain are separated by commas. In our example, @var{split, fifo,
48 overlay} are in one linear chain, and @var{fifo, crop, vflip} are in
49 another. The points where the linear chains join are labeled by names
50 enclosed in square brackets. In our example, that is @var{[T1]} and
51 @var{[T2]}. The magic labels @var{[in]} and @var{[out]} are the points
52 where video is input and output.
54 Some filters take in input a list of parameters: they are specified
55 after the filter name and an equal sign, and are separated each other
58 There exist so-called @var{source filters} that do not have a video
59 input, and we expect in the future some @var{sink filters} that will
60 not have video output.
64 The @file{graph2dot} program included in the FFmpeg @file{tools}
65 directory can be used to parse a filter graph description and issue a
66 corresponding textual representation in the dot language.
73 to see how to use @file{graph2dot}.
75 You can then pass the dot description to the @file{dot} program (from
76 the graphviz suite of programs) and obtain a graphical representation
79 For example the sequence of commands:
81 echo @var{GRAPH_DESCRIPTION} | \
82 tools/graph2dot -o graph.tmp && \
83 dot -Tpng graph.tmp -o graph.png && \
87 can be used to create and display an image representing the graph
88 described by the @var{GRAPH_DESCRIPTION} string.