Statistics
| Branch: | Revision:

ffmpeg / doc / filters.texi @ f59e9eaf

History | View | Annotate | Download (9.27 KB)

1
@chapter Audio Filters
2
@c man begin AUDIO FILTERS
3

    
4
When you configure your FFmpeg build, you can disable any of the
5
existing filters using --disable-filters.
6
The configure output will show the audio filters included in your
7
build.
8

    
9
Below is a description of the currently available audio filters.
10

    
11
@c man end AUDIO FILTERS
12

    
13
@chapter Video Filters
14
@c man begin VIDEO FILTERS
15

    
16
When you configure your FFmpeg build, you can disable any of the
17
existing filters using --disable-filters.
18
The configure output will show the video filters included in your
19
build.
20

    
21
Below is a description of the currently available video filters.
22

    
23
@section crop
24

    
25
Crop the input video to @var{x}:@var{y}:@var{width}:@var{height}.
26

    
27
@example
28
./ffmpeg -i in.avi -vf "crop=0:0:0:240" out.avi
29
@end example
30

    
31
@var{x} and @var{y} specify the position of the top-left corner of the
32
output (non-cropped) area.
33

    
34
The default value of @var{x} and @var{y} is 0.
35

    
36
The @var{width} and @var{height} parameters specify the width and height
37
of the output (non-cropped) area.
38

    
39
A value of 0 is interpreted as the maximum possible size contained in
40
the area delimited by the top-left corner at position x:y.
41

    
42
For example the parameters:
43

    
44
@example
45
"crop=100:100:0:0"
46
@end example
47

    
48
will delimit the rectangle with the top-left corner placed at position
49
100:100 and the right-bottom corner corresponding to the right-bottom
50
corner of the input image.
51

    
52
The default value of @var{width} and @var{height} is 0.
53

    
54
@section format
55

    
56
Convert the input video to one of the specified pixel formats.
57
Libavfilter will try to pick one that is supported for the input to
58
the next filter.
59

    
60
The filter accepts a list of pixel format names, separated by ``:'',
61
for example ``yuv420p:monow:rgb24''.
62

    
63
The following command:
64

    
65
@example
66
./ffmpeg -i in.avi -vf "format=yuv420p" out.avi
67
@end example
68

    
69
will convert the input video to the format ``yuv420p''.
70

    
71
@section hflip
72

    
73
Flip the input video horizontally.
74

    
75
For example to horizontally flip the video in input with
76
@file{ffmpeg}:
77
@example
78
ffmpeg -i in.avi -vf "hflip" out.avi
79
@end example
80

    
81
@section noformat
82

    
83
Force libavfilter not to use any of the specified pixel formats for the
84
input to the next filter.
85

    
86
The filter accepts a list of pixel format names, separated by ``:'',
87
for example ``yuv420p:monow:rgb24''.
88

    
89
The following command:
90

    
91
@example
92
./ffmpeg -i in.avi -vf "noformat=yuv420p, vflip" out.avi
93
@end example
94

    
95
will make libavfilter use a format different from ``yuv420p'' for the
96
input to the vflip filter.
97

    
98
@section null
99

    
100
Pass the source unchanged to the output.
101

    
102
@section pad
103

    
104
Add paddings to the input image, and places the original input at the
105
given coordinates @var{x}, @var{y}.
106

    
107
It accepts the following parameters:
108
@var{width}:@var{height}:@var{x}:@var{y}:@var{color}.
109

    
110
Follows the description of the accepted parameters.
111

    
112
@table @option
113
@item width, height
114

    
115
Specify the size of the output image with the paddings added. If the
116
value for @var{width} or @var{height} is 0, the corresponding input size
117
is used for the output.
118

    
119
The default value of @var{width} and @var{height} is 0.
120

    
121
@item x, y
122

    
123
Specify the offsets where to place the input image in the padded area
124
with respect to the top/left border of the output image.
125

    
126
The default value of @var{x} and @var{y} is 0.
127

    
128
@item color
129

    
130
Specify the color of the padded area, it can be the name of a color
131
(case insensitive match) or a 0xRRGGBB[AA] sequence.
132

    
133
The default value of @var{color} is ``black''.
134

    
135
@end table
136

    
137
@section pixdesctest
138

    
139
Pixel format descriptor test filter, mainly useful for internal
140
testing. The output video should be equal to the input video.
141

    
142
For example:
143
@example
144
format=monow, pixdesctest
145
@end example
146

    
147
can be used to test the monowhite pixel format descriptor definition.
148

    
149
@section scale
150

    
151
Scale the input video to @var{width}:@var{height} and/or convert the image format.
152

    
153
For example the command:
154

    
155
@example
156
./ffmpeg -i in.avi -vf "scale=200:100" out.avi
157
@end example
158

    
159
will scale the input video to a size of 200x100.
160

    
161
If the input image format is different from the format requested by
162
the next filter, the scale filter will convert the input to the
163
requested format.
164

    
165
If the value for @var{width} or @var{height} is 0, the respective input
166
size is used for the output.
167

    
168
If the value for @var{width} or @var{height} is -1, the scale filter will
169
use, for the respective output size, a value that maintains the aspect
170
ratio of the input image.
171

    
172
The default value of @var{width} and @var{height} is 0.
173

    
174
@section slicify
175

    
176
Pass the images of input video on to next video filter as multiple
177
slices.
178

    
179
@example
180
./ffmpeg -i in.avi -vf "slicify=32" out.avi
181
@end example
182

    
183
The filter accepts the slice height as parameter. If the parameter is
184
not specified it will use the default value of 16.
185

    
186
Adding this in the beginning of filter chains should make filtering
187
faster due to better use of the memory cache.
188

    
189
@section unsharp
190

    
191
Sharpen or blur the input video.
192

    
193
It accepts the following parameters:
194
@var{luma_msize_x}:@var{luma_msize_y}:@var{luma_amount}:@var{chroma_msize_x}:@var{chroma_msize_y}:@var{chroma_amount}
195

    
196
Negative values for the amount will blur the input video, while positive
197
values will sharpen. All parameters are optional and default to the
198
equivalent of the string '5:5:1.0:0:0:0.0'.
199

    
200
@table @option
201

    
202
@item luma_msize_x
203
Set the luma matrix horizontal size. It can be an integer between 3
204
and 13, default value is 5.
205

    
206
@item luma_msize_y
207
Set the luma matrix vertical size. It can be an integer between 3
208
and 13, default value is 5.
209

    
210
@item luma_amount
211
Set the luma effect strength. It can be a float number between -2.0
212
and 5.0, default value is 1.0.
213

    
214
@item chroma_msize_x
215
Set the chroma matrix horizontal size. It can be an integer between 3
216
and 13, default value is 0.
217

    
218
@item chroma_msize_y
219
Set the chroma matrix vertical size. It can be an integer between 3
220
and 13, default value is 0.
221

    
222
@item luma_amount
223
Set the chroma effect strength. It can be a float number between -2.0
224
and 5.0, default value is 0.0.
225

    
226
@end table
227

    
228
@example
229
# Strong luma sharpen effect parameters
230
unsharp=7:7:2.5
231

    
232
# Strong blur of both luma and chroma parameters
233
unsharp=7:7:-2:7:7:-2
234

    
235
# Use the default values with @command{ffmpeg}
236
./ffmpeg -i in.avi -vf "unsharp" out.mp4
237
@end example
238

    
239
@section vflip
240

    
241
Flip the input video vertically.
242

    
243
@example
244
./ffmpeg -i in.avi -vf "vflip" out.avi
245
@end example
246

    
247
@c man end VIDEO FILTERS
248

    
249
@chapter Video Sources
250
@c man begin VIDEO SOURCES
251

    
252
Below is a description of the currently available video sources.
253

    
254
@section buffer
255

    
256
Buffer video frames, and make them available to the filter chain.
257

    
258
This source is mainly intended for a programmatic use, in particular
259
through the interface defined in @file{libavfilter/vsrc_buffer.h}.
260

    
261
It accepts the following parameters:
262
@var{width}:@var{height}:@var{pix_fmt_string}
263

    
264
All the parameters need to be explicitely defined.
265

    
266
Follows the list of the accepted parameters.
267

    
268
@table @option
269

    
270
@item width, height
271
Specify the width and height of the buffered video frames.
272

    
273
@item pix_fmt_string
274

    
275
A string representing the pixel format of the buffered video frames.
276
It may be a number corresponding to a pixel format, or a pixel format
277
name.
278

    
279
@end table
280

    
281
For example:
282
@example
283
buffer=320:240:yuv410p
284
@end example
285

    
286
will instruct the source to accept video frames with size 320x240 and
287
with format "yuv410p". Since the pixel format with name "yuv410p"
288
corresponds to the number 6 (check the enum PixelFormat definition in
289
@file{libavutil/pixfmt.h}), this example corresponds to:
290
@example
291
buffer=320:240:6
292
@end example
293

    
294
@section color
295

    
296
Provide an uniformly colored input.
297

    
298
It accepts the following parameters:
299
@var{color}:@var{frame_size}:@var{frame_rate}
300

    
301
Follows the description of the accepted parameters.
302

    
303
@table @option
304

    
305
@item color
306
Specify the color of the source. It can be the name of a color (case
307
insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an
308
alpha specifier. The default value is "black".
309

    
310
@item frame_size
311
Specify the size of the sourced video, it may be a string of the form
312
@var{width}x@var{heigth}, or the name of a size abbreviation. The
313
default value is "320x240".
314

    
315
@item frame_rate
316
Specify the frame rate of the sourced video, as the number of frames
317
generated per second. It has to be a string in the format
318
@var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float
319
number or a valid video frame rate abbreviation. The default value is
320
"25".
321

    
322
@end table
323

    
324
For example the following graph description will generate a red source
325
with an opacity of 0.2, with size "qcif" and a frame rate of 10
326
frames per second, which will be overlayed over the source connected
327
to the pad with identifier "in".
328

    
329
@example
330
"color=red@@0.2:qcif:10 [color]; [in][color] overlay [out]"
331
@end example
332

    
333
@section nullsrc
334

    
335
Null video source, never return images. It is mainly useful as a
336
template and to be employed in analysis / debugging tools.
337

    
338
It accepts as optional parameter a string of the form
339
@var{width}:@var{height}, where @var{width} and @var{height} specify the size of
340
the configured source.
341

    
342
The default values of @var{width} and @var{height} are respectively 352
343
and 288 (corresponding to the CIF size format).
344

    
345
@c man end VIDEO SOURCES
346

    
347
@chapter Video Sinks
348
@c man begin VIDEO SINKS
349

    
350
Below is a description of the currently available video sinks.
351

    
352
@section nullsink
353

    
354
Null video sink, do absolutely nothing with the input video. It is
355
mainly useful as a template and to be employed in analysis / debugging
356
tools.
357

    
358
@c man end VIDEO SINKS
359