Range is between 0 and 1.
@end table
+@subsection Commands
+
+This filter supports the all above options as @ref{commands}.
+
@section acontrast
Simple audio dynamic range compression/expansion filter.
@anchor{afir}
@section afir
-Apply an arbitrary Frequency Impulse Response filter.
+Apply an arbitrary Finite Impulse Response filter.
This filter is designed for applying long FIR filters,
up to 60 seconds long.
room equalization, cross talk cancellation, wavefield synthesis,
auralization, ambiophonics, ambisonics and spatialization.
-This filter uses the second stream as FIR coefficients.
-If the second stream holds a single channel, it will be used
+This filter uses the streams higher than first one as FIR coefficients.
+If the non-first stream holds a single channel, it will be used
for all input channels in the first stream, otherwise
-the number of channels in the second stream must be same as
+the number of channels in the non-first stream must be same as
the number of channels in the first stream.
It accepts the following parameters:
@item minp
Set minimal partition size used for convolution. Default is @var{8192}.
-Allowed range is from @var{8} to @var{32768}.
+Allowed range is from @var{1} to @var{32768}.
Lower values decreases latency at cost of higher CPU usage.
@item maxp
Set maximal partition size used for convolution. Default is @var{8192}.
Allowed range is from @var{8} to @var{32768}.
Lower values may increase CPU usage.
+
+@item nbirs
+Set number of input impulse responses streams which will be switchable at runtime.
+Allowed range is from @var{1} to @var{32}. Default is @var{1}.
+
+@item ir
+Set IR stream which will be used for convolution, starting from @var{0}, should always be
+lower than supplied value by @code{nbirs} option. Default is @var{0}.
+This option can be changed at runtime via @ref{commands}.
@end table
@subsection Examples
It accepts the following parameters:
@table @option
-@item sample_fmts
+@item sample_fmts, f
A '|'-separated list of requested sample formats.
-@item sample_rates
+@item sample_rates, r
A '|'-separated list of requested sample rates.
-@item channel_layouts
+@item channel_layouts, cl
A '|'-separated list of requested channel layouts.
See @ref{channel layout syntax,,the Channel Layout section in the ffmpeg-utils(1) manual,ffmpeg-utils}
@item channels, c
Specify which channels to filter, by default all available are filtered.
+
+@item normalize, n
+Normalize biquad coefficients, by default is disabled.
+Enabling it will normalize magnitude response at DC to 0dB.
@end table
@subsection Commands
@end itemize
+@section axcorrelate
+Calculate normalized cross-correlation between two input audio streams.
+
+Resulted samples are always between -1 and 1 inclusive.
+If result is 1 it means two input samples are highly correlated in that selected segment.
+Result 0 means they are not correlated at all.
+If result is -1 it means two input samples are out of phase, which means they cancel each
+other.
+
+The filter accepts the following options:
+
+@table @option
+@item size
+Set size of segment over which cross-correlation is calculated.
+Default is 256. Allowed range is from 2 to 131072.
+
+@item algo
+Set algorithm for cross-correlation. Can be @code{slow} or @code{fast}.
+Default is @code{slow}. Fast algorithm assumes mean values over any given segment
+are always zero and thus need much less calculations to make.
+This is generally not true, but is valid for typical audio streams.
+@end table
+
+@subsection Examples
+
+@itemize
+@item
+Calculate correlation between channels in stereo audio stream:
+@example
+ffmpeg -i stereo.wav -af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav
+@end example
+@end itemize
+
@section bandpass
Apply a two-pole Butterworth band-pass filter with central
@item channels, c
Specify which channels to filter, by default all available are filtered.
+
+@item normalize, n
+Normalize biquad coefficients, by default is disabled.
+Enabling it will normalize magnitude response at DC to 0dB.
@end table
@subsection Commands
@item channels, c
Specify which channels to filter, by default all available are filtered.
+
+@item normalize, n
+Normalize biquad coefficients, by default is disabled.
+Enabling it will normalize magnitude response at DC to 0dB.
@end table
@subsection Commands
@item channels, c
Specify which channels to filter, by default all available are filtered.
+
+@item normalize, n
+Normalize biquad coefficients, by default is disabled.
+Enabling it will normalize magnitude response at DC to 0dB.
@end table
@subsection Commands
@item mix, m
How much to use filtered signal in output. Default is 1.
Range is between 0 and 1.
+
+@item channels, c
+Specify which channels to filter, by default all available are filtered.
+
+@item normalize, n
+Normalize biquad coefficients, by default is disabled.
+Enabling it will normalize magnitude response at DC to 0dB.
@end table
@section bs2b
Enable clipping. By default is enabled.
@end table
+@subsection Commands
+
+This filter supports the all above options as @ref{commands}.
+
@section dcshift
Apply a DC shift to the audio.
frame.
In general, smaller parameters result in stronger compression, and vice versa.
Values below 3.0 are not recommended, because audible distortion may appear.
+
+@item threshold, t
+Set the target threshold value. This specifies the lowest permissible
+magnitude level for the audio input which will be normalized.
+If input frame volume is above this value frame will be normalized.
+Otherwise frame may not be normalized at all. The default value is set
+to 0, which means all input frames will be normalized.
+This option is mostly useful if digital noise is not wanted to be amplified.
@end table
+@subsection Commands
+
+This filter supports the all above options as @ref{commands}.
+
@section earwax
Make audio easier to listen to on headphones.
@item channels, c
Specify which channels to filter, by default all available are filtered.
+
+@item normalize, n
+Normalize biquad coefficients, by default is disabled.
+Enabling it will normalize magnitude response at DC to 0dB.
@end table
@subsection Examples
Enable clipping. By default is enabled.
@end table
+@subsection Commands
+
+This filter supports the all above options as @ref{commands}.
+
@section firequalizer
Apply FIR Equalization using arbitrary frequency response.
@item channels, c
Specify which channels to filter, by default all available are filtered.
+
+@item normalize, n
+Normalize biquad coefficients, by default is disabled.
+Enabling it will normalize magnitude response at DC to 0dB.
@end table
@subsection Commands
@item channels, c
Specify which channels to filter, by default all available are filtered.
+
+@item normalize, n
+Normalize biquad coefficients, by default is disabled.
+Enabling it will normalize magnitude response at DC to 0dB.
@end table
@subsection Examples
Range is between 0 and 1.
@end table
+@subsection Commands
+
+This filter supports the all above options as @ref{commands}.
+
@subsection Examples
@itemize
or equal to a noise tolerance value for a duration greater or equal to the
minimum detected noise duration.
-The printed times and duration are expressed in seconds.
+The printed times and duration are expressed in seconds. The
+@code{lavfi.silence_start} or @code{lavfi.silence_start.X} metadata key
+is set on the first frame whose timestamp equals or exceeds the detection
+duration and it contains the timestamp of the first frame of the silence.
+
+The @code{lavfi.silence_duration} or @code{lavfi.silence_duration.X}
+and @code{lavfi.silence_end} or @code{lavfi.silence_end.X} metadata
+keys are set on the first frame after the silence. If @option{mono} is
+enabled, and each channel is evaluated separately, the @code{.X}
+suffixed keys are used, and @code{X} corresponds to the channel number.
The filter accepts the following options:
specified value) or amplitude ratio. Default is -60dB, or 0.001.
@item duration, d
-Set silence duration until notification (default is 2 seconds).
+Set silence duration until notification (default is 2 seconds). See
+@ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
+for the accepted syntax.
@item mono, m
Process each channel separately, instead of combined. By default is disabled.
Set level of input signal of original channel. Default is 0.8.
@end table
+@subsection Commands
+
+This filter supports the all above options except @code{delay} as @ref{commands}.
+
@section superequalizer
Apply 18 band equalizer.
@item channels, c
Specify which channels to filter, by default all available are filtered.
+
+@item normalize, n
+Normalize biquad coefficients, by default is disabled.
+Enabling it will normalize magnitude response at DC to 0dB.
@end table
@subsection Commands
Default value for @var{replaygain_preamp} is 0.0.
+@item replaygain_noclip
+Prevent clipping by limiting the gain applied.
+
+Default value for @var{replaygain_noclip} is 1.
+
@item eval
Set when the volume expression is evaluated.
If the specified expression is not valid, it is kept at its current
value.
-@item replaygain_noclip
-Prevent clipping by limiting the gain applied.
-
-Default value for @var{replaygain_noclip} is 1.
-
@end table
@subsection Examples
will continue processing other side of frames if they are equal or bellow thresholds.
@end table
+@subsection Commands
+This filter supports same @ref{commands} as options except option @code{s}.
+The command accepts the same syntax of the corresponding option.
+
@section avgblur
Apply average blur filter.
Set the minimal luminance value. Default is @code{16}.
@end table
+@section bilateral
+Apply bilateral filter, spatial smoothing while preserving edges.
+
+The filter accepts the following options:
+@table @option
+@item sigmaS
+Set sigma of gaussian function to calculate spatial weight.
+Allowed range is 0 to 10. Default is 0.1.
+
+@item sigmaR
+Set sigma of gaussian function to calculate range weight.
+Allowed range is 0 to 1. Default is 0.1.
+
+@item planes
+Set planes to filter. Default is first only.
+@end table
+
@section bitplanenoise
Show and measure bit plane noise.
This can be used to pass exact YUV values as hexadecimal numbers.
@end table
+@subsection Commands
+This filter supports same @ref{commands} as options.
+The command accepts the same syntax of the corresponding option.
+
+If the specified expression is not valid, it is kept at its current
+value.
+
@section chromakey
YUV colorspace color/chroma keying.
This can be used to pass exact YUV values as hexadecimal numbers.
@end table
+@subsection Commands
+This filter supports same @ref{commands} as options.
+The command accepts the same syntax of the corresponding option.
+
+If the specified expression is not valid, it is kept at its current
+value.
+
@subsection Examples
@itemize
Set edge mode, can be @var{smear}, default, or @var{warp}.
@end table
+@subsection Commands
+
+This filter supports the all above options as @ref{commands}.
+
@section ciescope
Display CIE color diagram with pixels overlaid onto it.
Adjust red, green and blue highlights (brightest pixels).
Allowed ranges for options are @code{[-1.0, 1.0]}. Defaults are @code{0}.
+
+@item pl
+Preserve lightness when changing color balance. Default is disabled.
@end table
@subsection Examples
@end example
@end itemize
+@subsection Commands
+
+This filter supports the all above options as @ref{commands}.
+
@section colorchannelmixer
Adjust video input frames by re-mixing color channels.
@item opacity
Set background opacity.
+
+@item format
+Set display number format. Can be @code{hex}, or @code{dec}. Default is @code{hex}.
@end table
@section dctdnoiz
If 0, plane will remain unchanged.
@end table
+@subsection Commands
+
+This filter supports the all above options as @ref{commands}.
+
@section deflicker
Remove temporal frame luminance variations.
6 7 8
@end table
+@subsection Commands
+
+This filter supports the all above options as @ref{commands}.
+
@section displace
Displace pixels as indicated by second and third input stream.
@end example
@end itemize
+@section dnn_processing
+
+Do image processing with deep neural networks. It works together with another filter
+which converts the pixel format of the Frame to what the dnn network requires.
+
+The filter accepts the following options:
+
+@table @option
+@item dnn_backend
+Specify which DNN backend to use for model loading and execution. This option accepts
+the following values:
+
+@table @samp
+@item native
+Native implementation of DNN loading and execution.
+
+@item tensorflow
+TensorFlow backend. To enable this backend you
+need to install the TensorFlow for C library (see
+@url{https://www.tensorflow.org/install/install_c}) and configure FFmpeg with
+@code{--enable-libtensorflow}
+@end table
+
+Default value is @samp{native}.
+
+@item model
+Set path to model file specifying network architecture and its parameters.
+Note that different backends use different file formats. TensorFlow and native
+backend can load files for only its format.
+
+Native model file (.model) can be generated from TensorFlow model file (.pb) by using tools/python/convert.py
+
+@item input
+Set the input name of the dnn network.
+
+@item output
+Set the output name of the dnn network.
+
+@end table
+
+@itemize
+@item
+Halve the red channle of the frame with format rgb24:
+@example
+ffmpeg -i input.jpg -vf format=rgb24,dnn_processing=model=halve_first_channel.model:input=dnn_in:output=dnn_out:dnn_backend=native out.native.png
+@end example
+
+@item
+Halve the pixel value of the frame with format gray32f:
+@example
+ffmpeg -i input.jpg -vf format=grayf32,dnn_processing=model=halve_gray_float.model:input=dnn_in:output=dnn_out:dnn_backend=native -y out.native.png
+@end example
+
+@end itemize
+
@section drawbox
Draw a colored box on the input image.
If the specified expression is not valid, it is kept at its current
value.
-@section drawgrid
-
-Draw a grid on the input image.
+@anchor{drawgraph}
+@section drawgraph
+Draw a graph using input video metadata.
It accepts the following parameters:
@table @option
-@item x
-@item y
-The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
+@item m1
+Set 1st frame metadata key from which metadata values will be used to draw a graph.
-@item width, w
-@item height, h
-The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
-input width and height, respectively, minus @code{thickness}, so image gets
-framed. Default to 0.
+@item fg1
+Set 1st foreground color expression.
-@item color, c
-Specify the color of the grid. For the general syntax of this option,
-check the @ref{color syntax,,"Color" section in the ffmpeg-utils manual,ffmpeg-utils}. If the special
-value @code{invert} is used, the grid color is the same as the
-video with inverted luma.
+@item m2
+Set 2nd frame metadata key from which metadata values will be used to draw a graph.
-@item thickness, t
-The expression which sets the thickness of the grid line. Default value is @code{1}.
+@item fg2
+Set 2nd foreground color expression.
-See below for the list of accepted constants.
+@item m3
+Set 3rd frame metadata key from which metadata values will be used to draw a graph.
-@item replace
-Applicable if the input has alpha. With @code{1} the pixels of the painted grid
-will overwrite the video's color and alpha pixels.
-Default is @code{0}, which composites the grid onto the input, leaving the video's alpha intact.
-@end table
+@item fg3
+Set 3rd foreground color expression.
-The parameters for @var{x}, @var{y}, @var{w} and @var{h} and @var{t} are expressions containing the
-following constants:
+@item m4
+Set 4th frame metadata key from which metadata values will be used to draw a graph.
-@table @option
-@item dar
-The input display aspect ratio, it is the same as (@var{w} / @var{h}) * @var{sar}.
+@item fg4
+Set 4th foreground color expression.
-@item hsub
-@item vsub
-horizontal and vertical chroma subsample values. For example for the
-pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
+@item min
+Set minimal value of metadata value.
-@item in_h, ih
-@item in_w, iw
-The input grid cell width and height.
+@item max
+Set maximal value of metadata value.
-@item sar
-The input sample aspect ratio.
+@item bg
+Set graph background color. Default is white.
-@item x
-@item y
-The x and y coordinates of some point of grid intersection (meant to configure offset).
+@item mode
+Set graph mode.
-@item w
-@item h
-The width and height of the drawn cell.
+Available values for mode is:
+@table @samp
+@item bar
+@item dot
+@item line
+@end table
-@item t
-The thickness of the drawn cell.
+Default is @code{line}.
-These constants allow the @var{x}, @var{y}, @var{w}, @var{h} and @var{t} expressions to refer to
-each other, so you may for example specify @code{y=x/dar} or @code{h=w/dar}.
+@item slide
+Set slide mode.
-@end table
+Available values for slide is:
+@table @samp
+@item frame
+Draw new frame when right border is reached.
-@subsection Examples
+@item replace
+Replace old columns with new ones.
-@itemize
-@item
-Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
-@example
-drawgrid=width=100:height=100:thickness=2:color=red@@0.5
-@end example
+@item scroll
+Scroll from right to left.
+
+@item rscroll
+Scroll from left to right.
+
+@item picture
+Draw single picture.
+@end table
+
+Default is @code{frame}.
+
+@item size
+Set size of graph video. For the syntax of this option, check the
+@ref{video size syntax,,"Video size" section in the ffmpeg-utils manual,ffmpeg-utils}.
+The default value is @code{900x256}.
+
+@item rate, r
+Set the output frame rate. Default value is @code{25}.
+
+The foreground color expressions can use the following variables:
+@table @option
+@item MIN
+Minimal value of metadata value.
+
+@item MAX
+Maximal value of metadata value.
+
+@item VAL
+Current metadata key value.
+@end table
+
+The color is defined as 0xAABBGGRR.
+@end table
+
+Example using metadata from @ref{signalstats} filter:
+@example
+signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
+@end example
+
+Example using metadata from @ref{ebur128} filter:
+@example
+ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5
+@end example
+
+@section drawgrid
+
+Draw a grid on the input image.
+
+It accepts the following parameters:
+
+@table @option
+@item x
+@item y
+The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
+
+@item width, w
+@item height, h
+The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
+input width and height, respectively, minus @code{thickness}, so image gets
+framed. Default to 0.
+
+@item color, c
+Specify the color of the grid. For the general syntax of this option,
+check the @ref{color syntax,,"Color" section in the ffmpeg-utils manual,ffmpeg-utils}. If the special
+value @code{invert} is used, the grid color is the same as the
+video with inverted luma.
+
+@item thickness, t
+The expression which sets the thickness of the grid line. Default value is @code{1}.
+
+See below for the list of accepted constants.
+
+@item replace
+Applicable if the input has alpha. With @code{1} the pixels of the painted grid
+will overwrite the video's color and alpha pixels.
+Default is @code{0}, which composites the grid onto the input, leaving the video's alpha intact.
+@end table
+
+The parameters for @var{x}, @var{y}, @var{w} and @var{h} and @var{t} are expressions containing the
+following constants:
+
+@table @option
+@item dar
+The input display aspect ratio, it is the same as (@var{w} / @var{h}) * @var{sar}.
+
+@item hsub
+@item vsub
+horizontal and vertical chroma subsample values. For example for the
+pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
+
+@item in_h, ih
+@item in_w, iw
+The input grid cell width and height.
+
+@item sar
+The input sample aspect ratio.
+
+@item x
+@item y
+The x and y coordinates of some point of grid intersection (meant to configure offset).
+
+@item w
+@item h
+The width and height of the drawn cell.
+
+@item t
+The thickness of the drawn cell.
+
+These constants allow the @var{x}, @var{y}, @var{w}, @var{h} and @var{t} expressions to refer to
+each other, so you may for example specify @code{y=x/dar} or @code{h=w/dar}.
+
+@end table
+
+@subsection Examples
+
+@itemize
+@item
+Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
+@example
+drawgrid=width=100:height=100:thickness=2:color=red@@0.5
+@end example
@item
Draw a white 3x3 grid with an opacity of 50%:
drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a
@end example
+@item
+Plot special @var{lavf.image2dec.source_basename} metadata onto each frame if
+such metadata exists. Otherwise, plot the string "NA". Note that image2 demuxer
+must have option @option{-export_path_metadata 1} for the special metadata fields
+to be available for filters.
+@example
+drawtext="fontsize=20:fontcolor=white:fontfile=FreeSans.ttf:text='%@{metadata\:lavf.image2dec.source_basename\:NA@}':x=10:y=10"
+@end example
+
@end itemize
For more information about libfreetype, check:
6 7 8
@end table
+@subsection Commands
+
+This filter supports the all above options as @ref{commands}.
+
@section extractplanes
Extract color channel components from input video stream into
Set color for pixels in fixed mode. Default is @var{black}.
@end table
+@subsection Commands
+This filter supports same @ref{commands} as options.
+The command accepts the same syntax of the corresponding option.
+
+If the specified expression is not valid, it is kept at its current
+value.
+
@section find_rect
Find a rectangular object
Set freeze duration until notification (default is 2 seconds).
@end table
+@section freezeframes
+
+Freeze video frames.
+
+This filter freezes video frames using frame from 2nd input.
+
+The filter accepts the following options:
+
+@table @option
+@item first
+Set number of first frame from which to start freeze.
+
+@item last
+Set number of last frame from which to end freeze.
+
+@item replace
+Set number of frame from 2nd input which will be used instead of replaced frames.
+@end table
+
@anchor{frei0r}
@section frei0r
@end itemize
-@section graphmonitor, agraphmonitor
+@anchor{graphmonitor}
+@section graphmonitor
Show various filtergraph stats.
With this filter one can debug complete filtergraph.
@code{strong}. It defaults to @code{none}.
@end table
+@anchor{histogram}
@section histogram
Compute and draw a color distribution histogram for the input video.
@var{luma_tmp}*@var{chroma_spatial}/@var{luma_spatial}.
@end table
+@subsection Commands
+This filter supports same @ref{commands} as options.
+The command accepts the same syntax of the corresponding option.
+
+If the specified expression is not valid, it is kept at its current
+value.
+
@anchor{hwdownload}
@section hwdownload
Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is @code{0}.
@end table
+@subsection Commands
+
+This filter supports the all above options as @ref{commands}.
+
@section inflate
Apply inflate effect to the video.
If 0, plane will remain unchanged.
@end table
+@subsection Commands
+
+This filter supports the all above options as @ref{commands}.
+
@section interlace
Simple interlacing filter from progressive contents. This interleaves upper (or
@table @option
@item model_path
Set the model path which is to be used for SVM.
-Default value: @code{"vmaf_v0.6.1.pkl"}
+Default value: @code{"/usr/local/share/model/vmaf_v0.6.1.pkl"}
@item log_path
Set the file path to be used to store logs.
@item phone_model
Invokes the phone model which will generate VMAF scores higher than in the
regular model, which is more suitable for laptop, TV, etc. viewing conditions.
+Default value: @code{false}
@item psnr
Enables computing psnr along with vmaf.
+Default value: @code{false}
@item ssim
Enables computing ssim along with vmaf.
+Default value: @code{false}
@item ms_ssim
Enables computing ms_ssim along with vmaf.
+Default value: @code{false}
@item pool
-Set the pool method (mean, min or harmonic mean) to be used for computing vmaf.
+Set the pool method to be used for computing vmaf.
+Options are @code{min}, @code{harmonic_mean} or @code{mean} (default).
@item n_threads
Set number of threads to be used when computing vmaf.
+Default value: @code{0}, which makes use of all available logical processors.
@item n_subsample
Set interval for frame subsampling used when computing vmaf.
+Default value: @code{1}
@item enable_conf_interval
Enables confidence interval.
+Default value: @code{false}
@end table
This filter also supports the @ref{framesync} options.
+@subsection Examples
+@itemize
+@item
On the below examples the input file @file{main.mpg} being processed is
compared with the reference file @file{ref.mpg}.
ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf -f null -
@end example
+@item
Example with options:
@example
ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf="psnr=1:log_fmt=json" -f null -
@end example
+@item
+Example with options and different containers:
+@example
+ffmpeg -i main.mpg -i ref.mkv -lavfi "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]libvmaf=psnr=1:log_fmt=json" -f null -
+@end example
+@end itemize
+
@section limiter
Limits the pixel components values to the specified range [min, max].
@item tolerance
Set the range of luma values to be keyed out.
-Default value is @code{0}.
+Default value is @code{0.01}.
@item softness
Set the range of softness. Default value is @code{0}.
Use this to control gradual transition from zero to full transparency.
@end table
+@subsection Commands
+This filter supports same @ref{commands} as options.
+The command accepts the same syntax of the corresponding option.
+
+If the specified expression is not valid, it is kept at its current
+value.
+
@section lut, lutrgb, lutyuv
Compute a look-up table for binding each pixel component input value
By default value 0xf, all planes will be processed.
@end table
+@section maskedmax
+
+Merge the second and third input stream into output stream using absolute differences
+between second input stream and first input stream and absolute difference between
+third input stream and first input stream. The picked value will be from second input
+stream if second absolute difference is greater than first one or from third input stream
+otherwise.
+
+This filter accepts the following options:
+@table @option
+@item planes
+Set which planes will be processed as bitmap, unprocessed planes will be
+copied from first stream.
+By default value 0xf, all planes will be processed.
+@end table
+
@section maskedmerge
Merge the first input stream with the second input stream using per pixel
By default value 0xf, all planes will be processed.
@end table
+@section maskedmin
+
+Merge the second and third input stream into output stream using absolute differences
+between second input stream and first input stream and absolute difference between
+third input stream and first input stream. The picked value will be from second input
+stream if second absolute difference is less than first one or from third input stream
+otherwise.
+
+This filter accepts the following options:
+@table @option
+@item planes
+Set which planes will be processed as bitmap, unprocessed planes will be
+copied from first stream.
+By default value 0xf, all planes will be processed.
+@end table
+
@section maskfun
Create mask from input video.
optimal individual vectors. Default value is 1.
@end table
+@section median
+
+Pick median pixel from certain rectangle defined by radius.
+
+This filter accepts the following options:
+
+@table @option
+@item radius
+Set horizontal radius size. Default value is @code{1}.
+Allowed range is integer from 1 to 127.
+
+@item planes
+Set which planes to process. Default is @code{15}, which is all available planes.
+
+@item radiusV
+Set vertical radius size. Default value is @code{0}.
+Allowed range is integer from 0 to 127.
+If it is 0, value will be picked from horizontal @code{radius} option.
+@end table
+
+@subsection Commands
+This filter supports same @ref{commands} as options.
+The command accepts the same syntax of the corresponding option.
+
+If the specified expression is not valid, it is kept at its current
+value.
+
@section mergeplanes
Merge color channel components from several video streams.
@end table
+@subsection Commands
+This filter supports same @ref{commands} as options, excluding @var{smoothing} option.
+The command accepts the same syntax of the corresponding option.
+
+If the specified expression is not valid, it is kept at its current
+value.
+
@subsection Examples
Stretch video contrast to use the full dynamic range, with no temporal
Draw scope. By default is enabled.
@end table
+@subsection Commands
+This filter supports same @ref{commands} as options.
+The command accepts the same syntax of the corresponding option.
+
+If the specified expression is not valid, it is kept at its current
+value.
+
@subsection Examples
@itemize
Lower is stricter.
@item skip
-Set how many pixels to skip when sampling frames. Defalt is 1.
+Set how many pixels to skip when sampling frames. Default is 1.
Allowed range is from 1 to 1024.
@item bypass
channels.
@end table
+@subsection Examples
+@itemize
+@item
For example:
@example
movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
reference file @file{ref_movie.mpg}. The PSNR of each individual frame
is stored in @file{stats.log}.
+@item
+Another example with different containers:
+@example
+ffmpeg -i main.mpg -i ref.mkv -lavfi "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]psnr" -f null -
+@end example
+@end itemize
+
@anchor{pullup}
@section pullup
@item scan_max
Set the line to end scanning for EIA-608 data. Default is @code{29}.
-@item mac
-Set minimal acceptable amplitude change for sync codes detection.
-Default is @code{0.2}. Allowed range is @code{[0.001 - 1]}.
-
@item spw
Set the ratio of width reserved for sync code detection.
-Default is @code{0.27}. Allowed range is @code{[0.01 - 0.7]}.
-
-@item mhd
-Set the max peaks height difference for sync code detection.
-Default is @code{0.1}. Allowed range is @code{[0.0 - 0.5]}.
-
-@item mpd
-Set max peaks period difference for sync code detection.
-Default is @code{0.1}. Allowed range is @code{[0.0 - 0.5]}.
-
-@item msd
-Set the first two max start code bits differences.
-Default is @code{0.02}. Allowed range is @code{[0.0 - 0.5]}.
-
-@item bhd
-Set the minimum ratio of bits height compared to 3rd start code bit.
-Default is @code{0.75}. Allowed range is @code{[0.01 - 1]}.
-
-@item th_w
-Set the white color threshold. Default is @code{0.35}. Allowed range is @code{[0.1 - 1]}.
-
-@item th_b
-Set the black color threshold. Default is @code{0.15}. Allowed range is @code{[0.0 - 0.5]}.
+Default is @code{0.27}. Allowed range is @code{[0.1 - 0.7]}.
@item chp
Enable checking the parity bit. In the event of a parity error, the filter will output
@code{0x00} for that character. Default is false.
@item lp
-Lowpass lines prior to further processing. Default is disabled.
+Lowpass lines prior to further processing. Default is enabled.
@end table
@subsection Examples
Set edge mode, can be @var{smear}, default, or @var{warp}.
@end table
+@subsection Commands
+
+This filter supports the all above options as @ref{commands}.
+
@section roberts
Apply roberts cross operator to input video stream.
@item ovsub
horizontal and vertical output chroma subsample values. For example for the
pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
-@end table
-@subsection Examples
+@item n
+The (sequential) number of the input frame, starting from 0.
+Only available with @code{eval=frame}.
-@itemize
-@item
+@item t
+The presentation timestamp of the input frame, expressed as a number of
+seconds. Only available with @code{eval=frame}.
+
+@item pos
+The position (byte offset) of the frame in the input stream, or NaN if
+this information is unavailable and/or meaningless (for example in case of synthetic video).
+Only available with @code{eval=frame}.
+@end table
+
+@subsection Examples
+
+@itemize
+@item
Scale the input video to a size of 200x100
@example
scale=w=200:h=100
@item lanczos
@end table
+@item force_original_aspect_ratio
+Enable decreasing or increasing output video width or height if necessary to
+keep the original aspect ratio. Possible values:
+
+@table @samp
+@item disable
+Scale the video as specified and disable this feature.
+
+@item decrease
+The output video dimensions will automatically be decreased if needed.
+
+@item increase
+The output video dimensions will automatically be increased if needed.
+
+@end table
+
+One useful instance of this option is that when you know a specific device's
+maximum allowed resolution, you can use this to limit the output video to
+that, while retaining the aspect ratio. For example, device A allows
+1280x720 playback, and your video is 1920x800. Using this option (set it to
+decrease) and specifying 1280x720 to the command line makes the output
+1280x533.
+
+Please note that this is a different thing than specifying -1 for @option{w}
+or @option{h}, you still need to specify the output resolution for this option
+to work.
+
+@item force_divisible_by
+Ensures that both the output dimensions, width and height, are divisible by the
+given integer when used together with @option{force_original_aspect_ratio}. This
+works similar to using @code{-n} in the @option{w} and @option{h} options.
+
+This option respects the value set for @option{force_original_aspect_ratio},
+increasing or decreasing the resolution accordingly. The video's aspect ratio
+may be slightly modified.
+
+This option can be handy if you need to have a video fit within or exceed
+a defined resolution using @option{force_original_aspect_ratio} but also have
+encoder restrictions on width or height divisibility.
+
@end table
@section scale2ref
The main input video's horizontal and vertical chroma subsample values.
For example for the pixel format "yuv422p" @var{hsub} is 2 and @var{vsub}
is 1.
+
+@item main_n
+The (sequential) number of the main input frame, starting from 0.
+Only available with @code{eval=frame}.
+
+@item main_t
+The presentation timestamp of the main input frame, expressed as a number of
+seconds. Only available with @code{eval=frame}.
+
+@item main_pos
+The position (byte offset) of the frame in the main input stream, or NaN if
+this information is unavailable and/or meaningless (for example in case of synthetic video).
+Only available with @code{eval=frame}.
@end table
@subsection Examples
@end example
@end itemize
+@subsection Commands
+
+This filter supports the following commands:
+@table @option
+@item width, w
+@item height, h
+Set the output video dimension expression.
+The command accepts the same syntax of the corresponding option.
+
+If the specified expression is not valid, it is kept at its current
+value.
+@end table
+
@section scroll
Scroll input video horizontally and/or vertically by constant speed.
@item plane_checksum
The Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
expressed in the form "[@var{c0} @var{c1} @var{c2} @var{c3}]".
+
+@item mean
+The mean value of pixels in each plane of the input frame, expressed in the form
+"[@var{mean0} @var{mean1} @var{mean2} @var{mean3}]".
+
+@item stdev
+The standard deviation of pixel values in each plane of the input frame, expressed
+in the form "[@var{stdev0} @var{stdev1} @var{stdev2} @var{stdev3}]".
+
@end table
@section showpalette
@code{0} (not enabled).
@end table
+@subsection Commands
+
+This filter supports the following commands:
+@table @option
+@item level
+@item quality
+Same as quality option. And the command accepts the @code{max} same as the @code{6}.
+@end table
+
@section sr
Scale the input by applying one of the super-resolution methods based on
This filter also supports the @ref{framesync} options.
+@subsection Examples
+@itemize
+@item
For example:
@example
movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
reference file @file{ref_movie.mpg}. The SSIM of each individual frame
is stored in @file{stats.log}.
+@item
Another example with both psnr and ssim at same time:
@example
ffmpeg -i main.mpg -i ref.mpg -lavfi "ssim;[0:v][1:v]psnr" -f null -
@end example
+@item
+Another example with different containers:
+@example
+ffmpeg -i main.mpg -i ref.mkv -lavfi "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]ssim" -f null -
+@end example
+@end itemize
+
@section stereo3d
Convert between different stereoscopic image formats.
16p: 33333334
@end example
+@section thistogram
+
+Compute and draw a color distribution histogram for the input video across time.
+
+Unlike @ref{histogram} video filter which only shows histogram of single input frame
+at certain time, this filter shows also past histograms of number of frames defined
+by @code{width} option.
+
+The computed histogram is a representation of the color component
+distribution in an image.
+
+The filter accepts the following options:
+
+@table @option
+@item width, w
+Set width of single color component output. Default value is @code{0}.
+Value of @code{0} means width will be picked from input video.
+This also set number of passed histograms to keep.
+Allowed range is [0, 8192].
+
+@item display_mode, d
+Set display mode.
+It accepts the following values:
+@table @samp
+@item stack
+Per color component graphs are placed below each other.
+
+@item parade
+Per color component graphs are placed side by side.
+
+@item overlay
+Presents information identical to that in the @code{parade}, except
+that the graphs representing color components are superimposed directly
+over one another.
+@end table
+Default is @code{stack}.
+
+@item levels_mode, m
+Set mode. Can be either @code{linear}, or @code{logarithmic}.
+Default is @code{linear}.
+
+@item components, c
+Set what color components to display.
+Default is @code{7}.
+
+@item bgopacity, b
+Set background opacity. Default is @code{0.9}.
+
+@item envelope, e
+Show envelope. Default is disabled.
+
+@item ecolor, ec
+Set envelope color. Default is @code{gold}.
+@end table
+
@section threshold
Apply threshold effect to video stream.
This will slightly less reduce interlace 'twitter' and Moire
patterning but better retain detail and subjective sharpness impression.
+@item bypass_il
+Bypass already interlaced frames, only adjust the frame rate.
@end table
-Vertical low-pass filtering can only be enabled for @option{mode}
-@var{interleave_top} and @var{interleave_bottom}.
+Vertical low-pass filtering and bypassing already interlaced frames can only be
+enabled for @option{mode} @var{interleave_top} and @var{interleave_bottom}.
@end table
It accepts the following values:
@table @samp
@item gray
+@item tint
Gray values are displayed on graph, higher brightness means more pixels have
same component color value on location in graph. This is the default mode.
@item none
@item green
@item color
+@item invert
@end table
@item opacity, o
@item 709
@end table
Default is auto.
+
+@item tint0, t0
+@item tint1, t1
+Set color tint for gray/tint vectorscope mode. By default both options are zero.
+This means no tint, and output will remain gray.
@end table
@anchor{vidstabdetect}
At end it will output number of frames detected as having variable delta pts,
and ones with constant delta pts.
-If there was frames with variable delta, than it will also show min and max delta
-encountered.
+If there was frames with variable delta, than it will also show min, max and
+average delta encountered.
@section vibrance
otherwise colors will be less saturated, more towards gray.
@end table
+@subsection Commands
+
+This filter supports the all above options as @ref{commands}.
+
@anchor{vignette}
@section vignette
@section vmafmotion
-Obtain the average vmaf motion score of a video.
-It is one of the component filters of VMAF.
+Obtain the average VMAF motion score of a video.
+It is one of the component metrics of VMAF.
The obtained average motion score is printed through the logging system.
-In the below example the input file @file{ref.mpg} is being processed and score
-is computed.
+The filter accepts the following options:
+
+@table @option
+@item stats_file
+If specified, the filter will use the named file to save the motion score of
+each frame with respect to the previous frame.
+When filename equals "-" the data is sent to standard output.
+@end table
+Example:
@example
-ffmpeg -i ref.mpg -lavfi vmafmotion -f null -
+ffmpeg -i ref.mpg -vf vmafmotion -f null -
@end example
@section vstack
@item bgopacity, b
Set background opacity.
+
+@item tint0, t0
+@item tint1, t1
+Set tint for output.
+Only used with lowpass filter and when display is not overlay and input
+pixel formats are not RGB.
@end table
@section weave, doubleweave
The default value is @code{all}.
@end table
+@section yaepblur
+
+Apply blur filter while preserving edges ("yaepblur" means "yet another edge preserving blur filter").
+The algorithm is described in
+"J. S. Lee, Digital image enhancement and noise filtering by use of local statistics, IEEE Trans. Pattern Anal. Mach. Intell. PAMI-2, 1980."
+
+It accepts the following parameters:
+
+@table @option
+@item radius, r
+Set the window radius. Default value is 3.
+
+@item planes, p
+Set which planes to filter. Default is only the first plane.
+
+@item sigma, s
+Set blur strength. Default value is 128.
+@end table
+
+@subsection Commands
+This filter supports same @ref{commands} as options.
+
@section zoompan
Apply Zoom & Pan effect.
pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
@end table
+@subsection Commands
+
+This filter supports the following commands:
@table @option
+@item width, w
+@item height, h
+Set the output video dimension expression.
+The command accepts the same syntax of the corresponding option.
+
+If the specified expression is not valid, it is kept at its current
+value.
@end table
@c man end VIDEO FILTERS
Default value is @code{0}.
@item y
-Set the x coordinate of the overlaid video on the main video.
+Set the y coordinate of the overlaid video on the main video.
Default value is @code{0}.
@end table
@c man end OPENCL VIDEO FILTERS
+@chapter VAAPI Video Filters
+@c man begin VAAPI VIDEO FILTERS
+
+VAAPI Video filters are usually used with VAAPI decoder and VAAPI encoder. Below is a description of VAAPI video filters.
+
+To enable compilation of these filters you need to configure FFmpeg with
+@code{--enable-vaapi}.
+
+To use vaapi filters, you need to setup the vaapi device correctly. For more information, please read @url{https://trac.ffmpeg.org/wiki/Hardware/VAAPI}
+
+@section tonemap_vappi
+
+Perform HDR(High Dynamic Range) to SDR(Standard Dynamic Range) conversion with tone-mapping.
+It maps the dynamic range of HDR10 content to the SDR content.
+It currently only accepts HDR10 as input.
+
+It accepts the following parameters:
+
+@table @option
+@item format
+Specify the output pixel format.
+
+Currently supported formats are:
+@table @var
+@item p010
+@item nv12
+@end table
+
+Default is nv12.
+
+@item primaries, p
+Set the output color primaries.
+
+Default is same as input.
+
+@item transfer, t
+Set the output transfer characteristics.
+
+Default is bt709.
+
+@item matrix, m
+Set the output colorspace matrix.
+
+Default is same as input.
+
+@end table
+
+@subsection Example
+
+@itemize
+@item
+Convert HDR(HDR10) video to bt2020-transfer-characteristic p010 format
+@example
+tonemap_vaapi=format=p010:t=bt2020-10
+@end example
+@end itemize
+
+@c man end VAAPI VIDEO FILTERS
+
@chapter Video Sources
@c man begin VIDEO SOURCES
The sample (pixel) aspect ratio of the input video.
@item sws_param
-Specify the optional parameters to be used for the scale filter which
-is automatically inserted when an input change is detected in the
-input size or format.
+This option is deprecated and ignored. Prepend @code{sws_flags=@var{flags};}
+to the filtergraph description to specify swscale flags for automatically
+inserted scalers. See @ref{Filtergraph syntax}.
@item hw_frames_ctx
When using a hardware pixel format, this should be a reference to an
Alternatively, the options can be specified as a flat string, but this
syntax is deprecated:
-@var{width}:@var{height}:@var{pix_fmt}:@var{time_base.num}:@var{time_base.den}:@var{pixel_aspect.num}:@var{pixel_aspect.den}[:@var{sws_param}]
+@var{width}:@var{height}:@var{pix_fmt}:@var{time_base.num}:@var{time_base.den}:@var{pixel_aspect.num}:@var{pixel_aspect.den}
@section cellauto
@item ring2
@item all
+@item max_frames, m
+Set the maximum number of frames generated for each test, default value is 30.
+
@end table
Default value is "all", which will cycle through the list of all tests.
by white color.
@end table
+@section adrawgraph
+Draw a graph using input audio metadata.
+
+See @ref{drawgraph}
+
+@section agraphmonitor
+
+See @ref{graphmonitor}.
+
@section ahistogram
Convert input audio to a video output, displaying the volume histogram.
Close the current segment and step to the next one
@end table
-@section drawgraph, adrawgraph
-
-Draw a graph using input video or audio metadata.
-
-It accepts the following parameters:
-
-@table @option
-@item m1
-Set 1st frame metadata key from which metadata values will be used to draw a graph.
-
-@item fg1
-Set 1st foreground color expression.
-
-@item m2
-Set 2nd frame metadata key from which metadata values will be used to draw a graph.
-
-@item fg2
-Set 2nd foreground color expression.
-
-@item m3
-Set 3rd frame metadata key from which metadata values will be used to draw a graph.
-
-@item fg3
-Set 3rd foreground color expression.
-
-@item m4
-Set 4th frame metadata key from which metadata values will be used to draw a graph.
-
-@item fg4
-Set 4th foreground color expression.
-
-@item min
-Set minimal value of metadata value.
-
-@item max
-Set maximal value of metadata value.
-
-@item bg
-Set graph background color. Default is white.
-
-@item mode
-Set graph mode.
-
-Available values for mode is:
-@table @samp
-@item bar
-@item dot
-@item line
-@end table
-
-Default is @code{line}.
-
-@item slide
-Set slide mode.
-
-Available values for slide is:
-@table @samp
-@item frame
-Draw new frame when right border is reached.
-
-@item replace
-Replace old columns with new ones.
-
-@item scroll
-Scroll from right to left.
-
-@item rscroll
-Scroll from left to right.
-
-@item picture
-Draw single picture.
-@end table
-
-Default is @code{frame}.
-
-@item size
-Set size of graph video. For the syntax of this option, check the
-@ref{video size syntax,,"Video size" section in the ffmpeg-utils manual,ffmpeg-utils}.
-The default value is @code{900x256}.
-
-The foreground color expressions can use the following variables:
-@table @option
-@item MIN
-Minimal value of metadata value.
-
-@item MAX
-Maximal value of metadata value.
-
-@item VAL
-Current metadata key value.
-@end table
-
-The color is defined as 0xAABBGGRR.
-@end table
-
-Example using metadata from @ref{signalstats} filter:
-@example
-signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
-@end example
-
-Example using metadata from @ref{ebur128} filter:
-@example
-ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5
-@end example
-
@anchor{ebur128}
@section ebur128
for standard output. If @code{file} option is not set, output is written to the log
with AV_LOG_INFO loglevel.
+@item direct
+Reduces buffering in print mode when output is written to a URL set using @var{file}.
+
@end table
@subsection Examples