]> git.sesse.net Git - ffmpeg/blobdiff - doc/filters.texi
Add SHA1s to APIChanges for av_dump_format, av_parse_time and av_find_info_tag
[ffmpeg] / doc / filters.texi
index e217f4e9061a5c85ce0367bc04056c1719c816cf..042ea13245cfbf3049720506ec284f0af457c6d3 100644 (file)
@@ -183,6 +183,11 @@ threshold, and defaults to 98.
 @var{threshold} is the threshold below which a pixel value is
 considered black, and defaults to 32.
 
+@section copy
+
+Copy the input source unchanged to the output. Mainly useful for
+testing purposes.
+
 @section crop
 
 Crop the input video to @var{out_w}:@var{out_h}:@var{x}:@var{y}.
@@ -261,7 +266,7 @@ crop=in_h
 # corner of the input image.
 crop=in_w-100:in_h-100:100:100
 
-# crop 10 pixels from the lefth and right borders, and 20 pixels from
+# crop 10 pixels from the left and right borders, and 20 pixels from
 # the top and bottom borders
 "crop=in_w-2*10:in_h-2*20"
 
@@ -274,7 +279,7 @@ crop=in_w-100:in_h-100:100:100
 # trembling effect
 "crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)"
 
-# erratic camera effect depending on timestamp and position
+# erratic camera effect depending on timestamp
 "crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)"
 
 # set x depending on the value of y
@@ -366,13 +371,14 @@ the next filter.
 The filter accepts a list of pixel format names, separated by ":",
 for example "yuv420p:monow:rgb24".
 
-The following command:
-
+Some examples follow:
 @example
-./ffmpeg -i in.avi -vf "format=yuv420p" out.avi
-@end example
+# convert the input video to the format "yuv420p"
+format=yuv420p
 
-will convert the input video to the format "yuv420p".
+# convert the input video to any of the formats in the list
+format=yuv420p:yuv444p:yuv410p
+@end example
 
 @anchor{frei0r}
 @section frei0r
@@ -499,14 +505,15 @@ input to the next filter.
 The filter accepts a list of pixel format names, separated by ":",
 for example "yuv420p:monow:rgb24".
 
-The following command:
-
+Some examples follow:
 @example
-./ffmpeg -i in.avi -vf "noformat=yuv420p, vflip" out.avi
-@end example
+# force libavfilter to use a format different from "yuv420p" for the
+# input to the vflip filter
+noformat=yuv420p,vflip
 
-will make libavfilter use a format different from "yuv420p" for the
-input to the vflip filter.
+# convert the input video to any of the formats not contained in the list
+noformat=yuv420p:yuv444p:yuv410p
+@end example
 
 @section null
 
@@ -532,6 +539,62 @@ informations:
 
 Follows the list of supported libopencv filters.
 
+@anchor{dilate}
+@subsection dilate
+
+Dilate an image by using a specific structuring element.
+This filter corresponds to the libopencv function @code{cvDilate}.
+
+It accepts the parameters: @var{struct_el}:@var{nb_iterations}.
+
+@var{struct_el} represents a structuring element, and has the syntax:
+@var{cols}x@var{rows}+@var{anchor_x}x@var{anchor_y}/@var{shape}
+
+@var{cols} and @var{rows} represent the number of colums and rows of
+the structuring element, @var{anchor_x} and @var{anchor_y} the anchor
+point, and @var{shape} the shape for the structuring element, and
+can be one of the values "rect", "cross", "ellipse", "custom".
+
+If the value for @var{shape} is "custom", it must be followed by a
+string of the form "=@var{filename}". The file with name
+@var{filename} is assumed to represent a binary image, with each
+printable character corresponding to a bright pixel. When a custom
+@var{shape} is used, @var{cols} and @var{rows} are ignored, the number
+or columns and rows of the read file are assumed instead.
+
+The default value for @var{struct_el} is "3x3+0x0/rect".
+
+@var{nb_iterations} specifies the number of times the transform is
+applied to the image, and defaults to 1.
+
+Follow some example:
+@example
+# use the default values
+ocv=dilate
+
+# dilate using a structuring element with a 5x5 cross, iterate two times
+ocv=dilate=5x5+2x2/cross:2
+
+# read the shape from the file diamond.shape, iterate two times
+# the file diamond.shape may contain a pattern of characters like this:
+#   *
+#  ***
+# *****
+#  ***
+#   *
+# the specified cols and rows are ignored (but not the anchor point coordinates)
+ocv=0x0+2x2/custom=diamond.shape:2
+@end example
+
+@subsection erode
+
+Erode an image by using a specific structuring element.
+This filter corresponds to the libopencv function @code{cvErode}.
+
+The filter accepts the parameters: @var{struct_el}:@var{nb_iterations},
+with the same meaning and use of those of the dilate filter
+(@pxref{dilate}).
+
 @subsection smooth
 
 Smooth the input video.
@@ -594,13 +657,13 @@ Follow some examples:
 overlay=main_w-overlay_w-10:main_h-overlay_h-10
 
 # insert a transparent PNG logo in the bottom left corner of the input
-movie=0:png:logo.png [logo];
+movie=logo.png [logo];
 [in][logo] overlay=10:main_h-overlay_h-10 [out]
 
 # insert 2 different transparent PNG logos (second logo on bottom
 # right corner):
-movie=0:png:logo1.png [logo1];
-movie=0:png:logo2.png [logo2];
+movie=logo1.png [logo1];
+movie=logo2.png [logo2];
 [in][logo1]       overlay=10:H-h-10 [in+logo1];
 [in+logo1][logo2] overlay=W-w-10:H-h-10 [out]
 
@@ -933,6 +996,8 @@ enable automatic detection
 @end table
 
 Default value is -1.
+If interlacing is unknown or decoder does not export this information,
+top field first will be assumed.
 
 @c man end VIDEO FILTERS
 
@@ -1023,6 +1088,61 @@ to the pad with identifier "in".
 "color=red@@0.2:qcif:10 [color]; [in][color] overlay [out]"
 @end example
 
+@section movie
+
+Read a video stream from a movie container.
+
+It accepts the syntax: @var{movie_name}[:@var{options}] where
+@var{movie_name} is the name of the resource to read (not necessarily
+a file but also a device or a stream accessed through some protocol),
+and @var{options} is an optional sequence of @var{key}=@var{value}
+pairs, separated by ":".
+
+The description of the accepted options follows.
+
+@table @option
+
+@item format_name, f
+Specifies the format assumed for the movie to read, and can be either
+the name of a container or an input device. If not specified the
+format is guessed from @var{movie_name} or by probing.
+
+@item seek_point, sp
+Specifies the seek point in seconds, the frames will be output
+starting from this seek point, the parameter is evaluated with
+@code{av_strtod} so the numerical value may be suffixed by an IS
+postfix. Default value is "0".
+
+@item stream_index, si
+Specifies the index of the video stream to read. If the value is -1,
+the best suited video stream will be automatically selected. Default
+value is "-1".
+
+@end table
+
+This filter allows to overlay a second video on top of main input of
+a filtergraph as shown in this graph:
+@example
+input -----------> deltapts0 --> overlay --> output
+                                    ^
+                                    |
+movie --> scale--> deltapts1 -------+
+@end example
+
+Some examples follow:
+@example
+# skip 3.2 seconds from the start of the avi file in.avi, and overlay it
+# on top of the input labelled as "in".
+movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie];
+[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
+
+# read from a video4linux2 device, and overlay it on top of the input
+# labelled as "in"
+movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie];
+[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
+
+@end example
+
 @section nullsrc
 
 Null video source, never return images. It is mainly useful as a