Implement null video sink.
[libav.git] / doc / libavfilter.texi
CommitLineData
1f09ab5e
SS
1\input texinfo @c -*- texinfo -*-
2
dba755fa 3@settitle Libavfilter Documentation
1f09ab5e
SS
4@titlepage
5@sp 7
dba755fa 6@center @titlefont{Libavfilter Documentation}
1f09ab5e
SS
7@sp 3
8@end titlepage
9
10
11@chapter Introduction
12
13Libavfilter is the filtering API of FFmpeg. It is the substitute of the
14now deprecated 'vhooks' and started as a Google Summer of Code project.
15
16Integrating libavfilter into the main FFmpeg repository is a work in
17progress. If you wish to try the unfinished development code of
18libavfilter then check it out from the libavfilter repository into
19some directory of your choice by:
20
21@example
22 svn checkout svn://svn.ffmpeg.org/soc/libavfilter
23@end example
24
25And then read the README file in the top directory to learn how to
26integrate it into ffmpeg and ffplay.
27
28But note that there may still be serious bugs in the code and its API
29and ABI should not be considered stable yet!
30
f6112d7f
SS
31@chapter Tutorial
32
1f09ab5e
SS
33In libavfilter, it is possible for filters to have multiple inputs and
34multiple outputs.
35To illustrate the sorts of things that are possible, we can
36use a complex filter graph. For example, the following one:
37
38@example
39input --> split --> fifo -----------------------> overlay --> output
40 | ^
41 | |
42 +------> fifo --> crop --> vflip --------+
43@end example
44
45splits the stream in two streams, sends one stream through the crop filter
46and the vflip filter before merging it back with the other stream by
47overlaying it on top. You can use the following command to achieve this:
48
49@example
50./ffmpeg -i in.avi -s 240x320 -vfilters "[in] split [T1], fifo, [T2] overlay= 0:240 [out]; [T1] fifo, crop=0:0:-1:240, vflip [T2]
51@end example
52
53where input_video.avi has a vertical resolution of 480 pixels. The
54result will be that in output the top half of the video is mirrored
55onto the bottom half.
56
57Video filters are loaded using the @var{-vfilters} option passed to
58ffmpeg or to ffplay. Filters in the same linear chain are separated by
59commas. In our example, @var{split, fifo, overlay} are in one linear
60chain, and @var{fifo, crop, vflip} are in another. The points where
61the linear chains join are labeled by names enclosed in square
62brackets. In our example, that is @var{[T1]} and @var{[T2]}. The magic
63labels @var{[in]} and @var{[out]} are the points where video is input
64and output.
65
66Some filters take in input a list of parameters: they are specified
67after the filter name and an equal sign, and are separated each other
68by a semicolon.
69
70There exist so-called @var{source filters} that do not have a video
71input, and we expect in the future some @var{sink filters} that will
72not have video output.
73
74@chapter Available video filters
75
76When you configure your FFmpeg build, you can disable any of the
77existing video filters.
78The configure output will show the video filters included in your
79build.
80
81Below is a description of the currently available video filters.
82
190c1669
SS
83@section crop
84
85Crop the input video to x:y:width:height.
86
87@example
88./ffmpeg -i in.avi -vfilters "crop=0:0:0:240" out.avi
89@end example
90
91``x'' and ``y'' specify the position of the top-left corner of the
92output (non-cropped) area.
93
94The default value of ``x'' and ``y'' is 0.
95
debfab4a
SS
96The ``width'' and ``height'' parameters specify the width and height
97of the output (non-cropped) area.
190c1669
SS
98
99A value of 0 is interpreted as the maximum possible size contained in
100the area delimited by the top-left corner at position x:y.
101
102For example the parameters:
103
104@example
105"crop=100:100:0:0"
106@end example
107
108will delimit the rectangle with the top-left corner placed at position
109100:100 and the right-bottom corner corresponding to the right-bottom
110corner of the input image.
111
29b5a3aa 112The default value of ``width'' and ``height'' is 0.
190c1669 113
fcbed3c7
SS
114@section format
115
116Convert the input video to one of the specified pixel formats.
143e3aa0 117Libavfilter will try to pick one that is supported for the input to
fcbed3c7
SS
118the next filter.
119
143e3aa0
SS
120The filter accepts a list of pixel format names, separated by ``:'',
121for example ``yuv420p:monow:rgb24''.
fcbed3c7
SS
122
123The following command:
124
125@example
126./ffmpeg -i in.avi -vfilters "format=yuv420p" out.avi
127@end example
128
129will convert the input video to the format ``yuv420p''.
130
131@section noformat
132
143e3aa0 133Force libavfilter not to use any of the specified pixel formats for the
fcbed3c7
SS
134input to the next filter.
135
143e3aa0
SS
136The filter accepts a list of pixel format names, separated by ``:'',
137for example ``yuv420p:monow:rgb24''.
fcbed3c7
SS
138
139The following command:
140
141@example
142./ffmpeg -i in.avi -vfilters "noformat=yuv420p, vflip" out.avi
143@end example
144
143e3aa0 145will make libavfilter use a format different from ``yuv420p'' for the
fcbed3c7
SS
146input to the vflip filter.
147
415e6d29
SS
148@section null
149
150Pass the source unchanged to the output.
151
c3eabb7d
SS
152@section scale
153
154Scale the input video to width:height and/or convert the image format.
155
156For example the command:
157
158@example
159./ffmpeg -i in.avi -vfilters "scale=200:100" out.avi
160@end example
161
162will scale the input video to a size of 200x100.
163
164If the input image format is different from the format requested by
165the next filter, the scale filter will convert the input to the
166requested format.
167
168If the value for ``width'' or ``height'' is 0, the respective input
169size is used for the output.
170
171If the value for ``width'' or ``height'' is -1, the scale filter will
172use, for the respective output size, a value that maintains the aspect
173ratio of the input image.
174
175The default value of ``width'' and ``height'' is 0.
176
0c0ccc28
SS
177@section slicify
178
179Pass the images of input video on to next video filter as multiple
180slices.
181
182@example
183./ffmpeg -i in.avi -vfilters "slicify=32" out.avi
184@end example
185
186The filter accepts the slice height as parameter. If the parameter is
187not specified it will use the default value of 16.
188
189Adding this in the beginning of filter chains should make filtering
190faster due to better use of the memory cache.
191
c38ae71f
SS
192@section vflip
193
194Flip the input video vertically.
195
196@example
197./ffmpeg -i in.avi -vfilters "vflip" out.avi
198@end example
199
dd08b83c
SS
200@chapter Available video sources
201
202Below is a description of the currently available video sources.
203
204@section nullsrc
205
206Null video source, never return images. It is mainly useful as a
207template and to be employed in analysis / debugging tools.
208
209It accepts as optional parameter a string of the form
210``width:height'', where ``width'' and ``height'' specify the size of
211the configured source.
212
213The default values of ``width'' and ``height'' are respectively 352
214and 288 (corresponding to the CIF size format).
215
006aa1a4
SS
216@chapter Available video sinks
217
218Below is a description of the currently available video sinks.
219
220@section nullsink
221
222Null video sink, do absolutely nothing with the input video. It is
223mainly useful as a template and to be employed in analysis / debugging
224tools.
225
1f09ab5e 226@bye