OSDN Git Service

Remove reference to the libavfilter soc SVN repo, update libavfilter status description
[coroid/ffmpeg_saccubus.git] / doc / libavfilter.texi
1 \input texinfo @c -*- texinfo -*-
2
3 @settitle Libavfilter Documentation
4 @titlepage
5 @center @titlefont{Libavfilter Documentation}
6 @end titlepage
7
8 @top
9
10 @contents
11
12 @chapter Introduction
13
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.
16
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.
19
20 @chapter Tutorial
21
22 In libavfilter, it is possible for filters to have multiple inputs and
23 multiple outputs.
24 To illustrate the sorts of things that are possible, we can
25 use a complex filter graph. For example, the following one:
26
27 @example
28 input --> split --> fifo -----------------------> overlay --> output
29             |                                        ^
30             |                                        |
31             +------> fifo --> crop --> vflip --------+
32 @end example
33
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:
37
38 @example
39 ./ffmpeg -i in.avi -s 240x320 -vf "[in] split [T1], fifo, [T2] overlay= 0:240 [out]; [T1] fifo, crop=0:0:-1:240, vflip [T2]
40 @end example
41
42 where input_video.avi has a vertical resolution of 480 pixels. The
43 result will be that in output the top half of the video is mirrored
44 onto the bottom half.
45
46 Video filters are loaded using the @var{-vf} option passed to
47 ffmpeg or to ffplay. Filters in the same linear chain are separated by
48 commas. In our example, @var{split, fifo, overlay} are in one linear
49 chain, and @var{fifo, crop, vflip} are in another. The points where
50 the linear chains join are labeled by names enclosed in square
51 brackets. In our example, that is @var{[T1]} and @var{[T2]}. The magic
52 labels @var{[in]} and @var{[out]} are the points where video is input
53 and output.
54
55 Some filters take in input a list of parameters: they are specified
56 after the filter name and an equal sign, and are separated each other
57 by a semicolon.
58
59 There exist so-called @var{source filters} that do not have a video
60 input, and we expect in the future some @var{sink filters} that will
61 not have video output.
62
63 @chapter graph2dot
64
65 The @file{graph2dot} program included in the FFmpeg @file{tools}
66 directory can be used to parse a filter graph description and issue a
67 corresponding textual representation in the dot language.
68
69 Invoke the command:
70 @example
71 graph2dot -h
72 @end example
73
74 to see how to use @file{graph2dot}.
75
76 You can then pass the dot description to the @file{dot} program (from
77 the graphviz suite of programs) and obtain a graphical representation
78 of the filter graph.
79
80 For example the sequence of commands:
81 @example
82 echo @var{GRAPH_DESCRIPTION} | \
83 tools/graph2dot -o graph.tmp && \
84 dot -Tpng graph.tmp -o graph.png && \
85 display graph.png
86 @end example
87
88 can be used to create and display an image representing the graph
89 described by the @var{GRAPH_DESCRIPTION} string.
90
91 @include filters.texi
92
93 @bye