aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2013-04-06 01:43:01 +0200
committerTimothy Gu <timothygu99@gmail.com>2013-08-28 09:35:20 -0700
commit19382a2a1062d153d5ae8738022991749335bbe6 (patch)
tree069d6e7aa5b666b407c14490573386df8d620512 /doc
parent57588cda7bec6fe2df72feacf143a8ef3f5ab3fe (diff)
downloadffmpeg-19382a2a1062d153d5ae8738022991749335bbe6.tar.gz
doc/filters: review introductory example and explanation
In particular, fix wrong vertical mirroring command, and clarify and extend explanation. Based on a patch by littlebat <dashing.meng@gmail.com>. Should fix trac ticket #2413. (cherry picked from commit 215ca864759a54f45265a51ac57dbfd75cb23da2) Signed-off-by: Timothy Gu <timothygu99@gmail.com> Conflicts: doc/filters.texi
Diffstat (limited to 'doc')
-rw-r--r--doc/filters.texi39
1 files changed, 23 insertions, 16 deletions
diff --git a/doc/filters.texi b/doc/filters.texi
index 9d6c2b86e5..ce7bbb45f8 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -3,10 +3,10 @@
Filtering in FFmpeg is enabled through the libavfilter library.
-In libavfilter, it is possible for filters to have multiple inputs and
-multiple outputs.
-To illustrate the sorts of things that are possible, we can
-use a complex filter graph. For example, the following one:
+In libavfilter, a filter can have multiple inputs and multiple
+outputs.
+To illustrate the sorts of things that are possible, we consider the
+following filtergraph.
@example
input --> split ---------------------> overlay --> output
@@ -15,25 +15,32 @@ input --> split ---------------------> overlay --> output
+-----> crop --> vflip -------+
@end example
-splits the stream in two streams, sends one stream through the crop filter
-and the vflip filter before merging it back with the other stream by
-overlaying it on top. You can use the following command to achieve this:
+This filtergraph splits the input stream in two streams, sends one
+stream through the crop filter and the vflip filter before merging it
+back with the other stream by overlaying it on top. You can use the
+following command to achieve this:
@example
-ffmpeg -i input -vf "[in] split [T1], [T2] overlay=0:H/2 [out]; [T1] crop=iw:ih/2:0:ih/2, vflip [T2]" output
+ffmpeg -i INPUT -vf "split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2" OUTPUT
@end example
The result will be that in output the top half of the video is mirrored
onto the bottom half.
-Filters are loaded using the @var{-vf} or @var{-af} option passed to
-@command{ffmpeg} or to @command{ffplay}. Filters in the same linear
-chain are separated by commas. In our example, @var{split,
-overlay} are in one linear chain, and @var{crop, vflip} are in
-another. The points where the linear chains join are labeled by names
-enclosed in square brackets. In our example, that is @var{[T1]} and
-@var{[T2]}. The special labels @var{[in]} and @var{[out]} are the points
-where video is input and output.
+Filters in the same linear chain are separated by commas, and distinct
+linear chains of filters are separated by semicolons. In our example,
+@var{crop,vflip} are in one linear chain, @var{split} and
+@var{overlay} are separately in another. The points where the linear
+chains join are labelled by names enclosed in square brackets. In the
+example, the split filter generates two outputs that are associated to
+the labels @var{[main]} and @var{[tmp]}.
+
+The stream sent to the second output of @var{split}, labelled as
+@var{[tmp]}, is processed through the @var{crop} filter, which crops
+away the lower half part of the video, and then vertically flipped. The
+@var{overlay} filter takes in input the first unchanged output of the
+split filter (which was labelled as @var{[main]}), and overlay on its
+lower half the output generated by the @var{crop,vflip} filterchain.
Some filters take in input a list of parameters: they are specified
after the filter name and an equal sign, and are separated from each other