]> git.sesse.net Git - ffmpeg/blobdiff - doc/filters.texi
lavfi/overlay: implement shortest option
[ffmpeg] / doc / filters.texi
index dea39dd1f271c9b5d4287f97cde7401cb88fc298..6b7ee89ac38c1447eb6aa9e34db120e414f7c58b 100644 (file)
@@ -2063,17 +2063,21 @@ playback.
 
 @section decimate
 
-This filter drops frames that do not differ greatly from the previous
-frame in order to reduce framerate.  The main use of this filter is
-for very-low-bitrate encoding (e.g. streaming over dialup modem), but
-it could in theory be used for fixing movies that were
-inverse-telecined incorrectly.
+Drop frames that do not differ greatly from the previous frame in
+order to reduce framerate.
 
-It accepts the following parameters:
-@var{max}:@var{hi}:@var{lo}:@var{frac}.
+The main use of this filter is for very-low-bitrate encoding
+(e.g. streaming over dialup modem), but it could in theory be used for
+fixing movies that were inverse-telecined incorrectly.
 
-@table @option
+The filter accepts parameters as a list of @var{key}=@var{value}
+pairs, separated by ":". If the key of the first options is omitted,
+the arguments are interpreted according to the syntax:
+@option{max}:@option{hi}:@option{lo}:@option{frac}.
+
+A description of the accepted options follows.
 
+@table @option
 @item max
 Set the maximum number of consecutive frames which can be dropped (if
 positive), or the minimum interval between dropped frames (if
@@ -2082,20 +2086,22 @@ number of previous sequentially dropped frames.
 
 Default value is 0.
 
-@item hi, lo, frac
+@item hi
+@item lo
+@item frac
 Set the dropping threshold values.
 
-Values for @var{hi} and @var{lo} are for 8x8 pixel blocks and
+Values for @option{hi} and @option{lo} are for 8x8 pixel blocks and
 represent actual pixel value differences, so a threshold of 64
 corresponds to 1 unit of difference for each pixel, or the same spread
 out differently over the block.
 
 A frame is a candidate for dropping if no 8x8 blocks differ by more
-than a threshold of @var{hi}, and if no more than @var{frac} blocks (1
-meaning the whole image) differ by more than a threshold of @var{lo}.
+than a threshold of @option{hi}, and if no more than @option{frac} blocks (1
+meaning the whole image) differ by more than a threshold of @option{lo}.
 
-Default value for @var{hi} is 64*12, default value for @var{lo} is
-64*5, and default value for @var{frac} is 0.33.
+Default value for @option{hi} is 64*12, default value for @option{lo} is
+64*5, and default value for @option{frac} is 0.33.
 @end table
 
 @section delogo
@@ -2224,10 +2230,12 @@ specified file.
 
 Draw a colored box on the input image.
 
-The filter accepts parameters as a list of @var{key}=@var{value} pairs,
-separated by ":".
+The filter accepts parameters as a list of @var{key}=@var{value}
+pairs, separated by ":". If the key of the first options is omitted,
+the arguments are interpreted according to the syntax
+@option{x}:@option{y}:@option{width}:@option{height}:@option{color}:@option{thickness}.
 
-The description of the accepted parameters follows.
+A description of the accepted options follows.
 
 @table @option
 @item x, y
@@ -2248,10 +2256,6 @@ video with inverted luma.
 Set the thickness of the box edge. Default value is @code{4}.
 @end table
 
-If the key of the first options is omitted, the arguments are
-interpreted according to the syntax
-@var{x}:@var{y}:@var{width}:@var{height}:@var{color}:@var{thickness}.
-
 Some examples follow:
 @itemize
 @item
@@ -3146,9 +3150,9 @@ chroma values in vectorscope, similar as @code{color} but actual chroma values
 are displayed.
 
 @item waveform
-per row/column luminance graph. In row mode the left side represents luma = 0
-and right side represents luma = 255. In column mode top side represends
-luma = 0 and bottom side represents luma = 255.
+per row/column color component graph. In row mode graph in the left side represents
+color component value 0 and right side represents value = 255. In column mode top
+side represents color component value = 0 and bottom side represents value = 255.
 @end table
 Default value is @code{levels}.
 
@@ -3169,6 +3173,38 @@ Default value is @code{10}. Allowed range is [1, 255].
 Set mode for @code{waveform}. Can be either @code{row}, or @code{column}.
 Default is @code{row}.
 
+@item display_mode
+Set display mode for @code{waveform} and @code{levels}.
+It accepts the following values:
+@table @samp
+@item parade
+Display separate graph for the color components side by side in
+@code{row} waveform mode or one below other in @code{column} waveform mode
+for @code{waveform} histogram mode. For @code{levels} histogram mode
+per color component graphs are placed one bellow other.
+
+This display mode in @code{waveform} histogram mode makes it easy to spot
+color casts in the highlights and shadows of an image, by comparing the
+contours of the top and the bottom of each waveform.
+Since whites, grays, and blacks are characterized by
+exactly equal amounts of red, green, and blue, neutral areas of the
+picture should display three waveforms of roughly equal width/height.
+If not, the correction is easy to make by making adjustments to level the
+three waveforms.
+
+@item overlay
+Presents information that's identical to that in the @code{parade}, except
+that the graphs representing color components are superimposed directly
+over one another.
+
+This display mode in @code{waveform} histogram mode can make it easier to spot
+the relative differences or similarities in overlapping areas of the color
+components that are supposed to be identical, such as neutral whites, grays,
+or blacks.
+@end table
+Default is @code{parade}.
+@end table
+
 @subsection Examples
 
 @itemize
@@ -3324,8 +3360,48 @@ If a parameter is omitted, it is kept at its current value.
 
 @section idet
 
-Interlaceing detect filter. This filter tries to detect if the input is
-interlaced or progressive. Top or bottom field first.
+Detect video interlacing type.
+
+This filter tries to detect if the input is interlaced or progressive,
+top or bottom field first.
+
+@section il
+
+Deinterleave or interleave fields.
+
+This filter allows to process interlaced images fields without
+deinterlacing them. Deinterleaving splits the input frame into 2
+fields (so called half pictures). Odd lines are moved to the top
+half of the output image, even lines to the bottom half.
+You can process (filter) them independently and then re-interleave them.
+
+It accepts a list of options in the form of @var{key}=@var{value} pairs
+separated by ":". A description of the accepted options follows.
+
+@table @option
+@item luma_mode, l
+@item chroma_mode, s
+@item alpha_mode, a
+Available values for @var{luma_mode}, @var{chroma_mode} and
+@var{alpha_mode} are:
+
+@table @samp
+@item none
+Do nothing.
+
+@item deinterleave, d
+Deinterleave fields, placing one above the other.
+
+@item interleave, i
+Interleave fields. Reverse the effect of deinterleaving.
+@end table
+Default value is @code{none}.
+
+@item luma_swap, ls
+@item chroma_swap, cs
+@item alpha_swap, as
+Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is @code{0}.
+@end table
 
 @section kerndeint
 
@@ -3553,18 +3629,14 @@ The list of the currently supported filters follows:
 @item dint
 @item divtc
 @item down3dright
-@item dsize
 @item eq2
 @item eq
 @item fil
 @item fspp
 @item harddup
-@item il
 @item ilpack
 @item ivtc
-@item kerndeint
 @item mcdeint
-@item noise
 @item ow
 @item perspective
 @item phase
@@ -3573,11 +3645,9 @@ The list of the currently supported filters follows:
 @item qp
 @item sab
 @item softpulldown
-@item softskip
 @item spp
 @item telecine
 @item tinterlace
-@item unsharp
 @item uspp
 @end table
 
@@ -3592,12 +3662,6 @@ Adjust gamma, brightness, contrast:
 @example
 mp=eq2=1.0:2:0.5
 @end example
-
-@item
-Add temporal noise to input video:
-@example
-mp=noise=20t
-@end example
 @end itemize
 
 See also mplayer(1), @url{http://www.mplayerhq.hu/}.
@@ -3627,6 +3691,57 @@ noformat=yuv420p,vflip
 noformat=yuv420p:yuv444p:yuv410p
 @end example
 
+@section noise
+
+Add noise on video input frame.
+
+This filter accepts a list of options in the form of @var{key}=@var{value}
+pairs separated by ":". A description of the accepted options follows.
+
+@table @option
+@item all_seed
+@item c0_seed
+@item c1_seed
+@item c2_seed
+@item c3_seed
+Set noise seed for specific pixel component or all pixel components in case
+of @var{all_seed}. Default value is @code{123457}.
+
+@item all_strength, as
+@item c0_strength, c0s
+@item c1_strength, c1s
+@item c2_strength, c2s
+@item c3_strength, c3s
+Set noise strength for specific pixel component or all pixel components in case
+@var{all_strength}. Default value is @code{0}. Allowed range is [0, 100].
+
+@item all_flags, af
+@item c0_flags, c0f
+@item c1_flags, c1f
+@item c2_flags, c2f
+@item c3_flags, c3f
+Set pixel component flags or set flags for all components if @var{all_flags}.
+Available values for component flags are:
+@table @samp
+@item a
+averaged temporal noise (smoother)
+@item p
+mix random noise with a (semi)regular pattern
+@item q
+higher quality (slightly better looking, slightly slower)
+@item t
+temporal noise (noise pattern changes between frames)
+@item u
+uniform noise (gaussian otherwise)
+@end table
+@end table
+
+Some examples follow:
+@example
+Add temporal and uniform noise to input video:
+noise=alls=20:allf=t+u
+@end example
+
 @section null
 
 Pass the video source unchanged to the output.
@@ -3766,6 +3881,10 @@ same as @var{overlay_w} and @var{overlay_h}
 @item rgb
 If set to 1, force the filter to accept inputs in the RGB
 color space. Default value is 0.
+
+@item shortest
+If set to 1, force the output to terminate when the shortest input
+terminates. Default value is 0.
 @end table
 
 Be aware that frames are taken from each input video in timestamp
@@ -3825,6 +3944,18 @@ The above command is the same as:
 ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
 @end example
 
+@item
+Compose output by putting two input videos side to side:
+@example
+ffmpeg -i left.avi -i right.avi -filter_complex "
+nullsrc=size=200x100 [background];
+[0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
+[1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
+[background][left]       overlay=shortest=1       [background+left];
+[background+left][right] overlay=shortest=1:x=100 [left+right]
+"
+@end example
+
 @item
 Chain several overlays in cascade:
 @example
@@ -4571,6 +4702,10 @@ Set the filename of the subtitle file to read. It must be specified.
 Specify the size of the original video, the video for which the ASS file
 was composed. Due to a misdesign in ASS aspect ratio arithmetic, this is
 necessary to correctly scale the fonts if the aspect ratio has been changed.
+
+@item charenc
+Set subtitles input character encoding. @code{subtitles} filter only. Only
+useful if not UTF-8.
 @end table
 
 If the first key is not specified, it is assumed that the first value
@@ -4849,51 +4984,52 @@ transpose=1:portrait
 
 Sharpen or blur the input video.
 
-It accepts the following parameters:
+This filter accepts parameters as a list of @var{key}=@var{value} pairs,
+separated by ":".
+
+If the key of the first options is omitted, the arguments are
+interpreted according to the syntax:
 @var{luma_msize_x}:@var{luma_msize_y}:@var{luma_amount}:@var{chroma_msize_x}:@var{chroma_msize_y}:@var{chroma_amount}
 
-Negative values for the amount will blur the input video, while positive
-values will sharpen. All parameters are optional and default to the
-equivalent of the string '5:5:1.0:5:5:0.0'.
+A description of the accepted options follows.
 
 @table @option
+@item luma_msize_x, lx
+@item chroma_msize_x, cx
+Set the luma/chroma matrix horizontal size. It must be an odd integer
+between 3 and 63, default value is 5.
 
-@item luma_msize_x
-Set the luma matrix horizontal size. It can be an integer between 3
-and 13, default value is 5.
-
-@item luma_msize_y
-Set the luma matrix vertical size. It can be an integer between 3
-and 13, default value is 5.
+@item luma_msize_y, ly
+@item chroma_msize_y, cy
+Set the luma/chroma matrix vertical size. It must be an odd integer
+between 3 and 63, default value is 5.
 
-@item luma_amount
-Set the luma effect strength. It can be a float number between -2.0
-and 5.0, default value is 1.0.
+@item luma_amount, la
+@item chroma_amount, ca
+Set the luma/chroma effect strength. It can be a float number,
+reasonable values lay between -1.5 and 1.5.
 
-@item chroma_msize_x
-Set the chroma matrix horizontal size. It can be an integer between 3
-and 13, default value is 5.
-
-@item chroma_msize_y
-Set the chroma matrix vertical size. It can be an integer between 3
-and 13, default value is 5.
-
-@item chroma_amount
-Set the chroma effect strength. It can be a float number between -2.0
-and 5.0, default value is 0.0.
+Negative values will blur the input video, while positive values will
+sharpen it, a value of zero will disable the effect.
 
+Default value is 1.0 for @option{luma_amount}, 0.0 for
+@option{chroma_amount}.
 @end table
 
+Some examples follow:
+@itemize
+@item
+Apply strong luma sharpen effect:
 @example
-# Strong luma sharpen effect parameters
 unsharp=7:7:2.5
+@end example
 
-# Strong blur of both luma and chroma parameters
+@item
+Apply strong blur of both luma and chroma parameters:
+@example
 unsharp=7:7:-2:7:7:-2
-
-# Use the default values with @command{ffmpeg}
-ffmpeg -i in.avi -vf "unsharp" out.mp4
 @end example
+@end itemize
 
 @section vflip