Ffmpeg Filters
Ffmpeg Filters
About
News
Download
Documentation
Community
o
Mailing Lists
IRC
Forums
Bug Reports
Wiki
Developers
o
Source Code
Contribute
FATE
Code Coverage
More
o
Donate
Hire Developers
Contact
Security
Legal
1 Description
2 Filtering Introduction
3 graph2dot
4 Filtergraph description
o
5 Timeline editing
6 Audio Filters
o
6.1 acompressor
6.2 acrossfade
6.2.1 Examples
6.3 acrusher
6.4 adelay
6.5 aecho
6.6 aemphasis
6.7 aeval
6.8 afade
6.9 afftfilt
6.10 aformat
6.11 agate
6.12 alimiter
6.13 allpass
6.14 aloop
6.15 amerge
6.16 amix
6.17 anequalizer
6.4.1 Examples
6.5.1 Examples
6.7.1 Examples
6.8.1 Examples
6.9.1 Examples
6.15.1 Examples
6.17.1 Examples
6.17.2 Commands
6.18 anull
6.19 apad
6.20 aphaser
6.21 apulsator
6.22 aresample
6.23 areverse
6.24 asetnsamples
6.25 asetrate
6.26 ashowinfo
6.27 astats
6.28 asyncts
6.29 atempo
6.30 atrim
6.31 bandpass
6.32 bandreject
6.33 bass
6.34 biquad
6.35 bs2b
6.36 channelmap
6.37 channelsplit
6.38 chorus
6.39 compand
6.40 compensationdelay
6.41 crystalizer
6.42 dcshift
6.43 dynaudnorm
6.44 earwax
6.45 equalizer
6.46 extrastereo
6.47 firequalizer
6.19.1 Examples
6.22.1 Examples
6.23.1 Examples
6.29.1 Examples
6.38.1 Examples
6.39.1 Examples
6.45.1 Examples
6.48 flanger
6.49 hdcd
6.50 highpass
6.51 join
6.52 ladspa
6.52.1 Examples
6.52.2 Commands
6.53 loudnorm
6.54 lowpass
6.55 pan
6.56 replaygain
6.57 resample
6.58 rubberband
6.59 sidechaincompress
6.60 sidechaingate
6.61 silencedetect
6.62 silenceremove
6.63 sofalizer
6.64 stereotools
6.65 stereowiden
6.66 treble
6.67 tremolo
6.68 vibrato
6.69 volume
6.62.1 Examples
6.63.1 Examples
6.64.1 Examples
6.69.1 Commands
6.69.2 Examples
6.70 volumedetect
6.70.1 Examples
7 Audio Sources
o
7.1 abuffer
7.2 aevalsrc
7.3 anullsrc
7.4 flite
7.5 anoisesrc
7.6 sine
6.61.1 Examples
6.59.1 Examples
6.47.1 Examples
7.1.1 Examples
7.2.1 Examples
7.3.1 Examples
7.4.1 Examples
7.5.1 Examples
7.6.1 Examples
8 Audio Sinks
o
8.1 abuffersink
8.2 anullsink
9 Video Filters
o
9.1 alphaextract
9.2 alphamerge
9.3 ass
9.4 atadenoise
9.5 avgblur
9.6 bbox
9.7 bitplanenoise
9.8 blackdetect
9.9 blackframe
9.11 boxblur
9.12 bwdif
9.13 chromakey
9.14 ciescope
9.15 codecview
9.16 colorbalance
9.17 colorkey
9.18 colorlevels
9.19 colorchannelmixer
9.20 colormatrix
9.21 colorspace
9.22 convolution
9.23 copy
9.24 coreimage
9.25 crop
9.10.1 Examples
9.11.1 Examples
9.13.1 Examples
9.15.1 Examples
9.16.1 Examples
9.17.1 Examples
9.18.1 Examples
9.19.1 Examples
9.22.1 Examples
9.24.1 Examples
9.25.1 Examples
9.25.2 Commands
9.26 cropdetect
9.27 curves
9.28 datascope
9.29 dctdnoiz
9.30 deband
9.31 decimate
9.32 deflate
9.33 dejudder
9.34 delogo
9.35 deshake
9.36 detelecine
9.37 dilation
9.38 displace
9.39 drawbox
9.40 drawgrid
9.41 drawtext
9.27.1 Examples
9.29.1 Examples
9.34.1 Examples
9.38.1 Examples
9.39.1 Examples
9.40.1 Examples
9.41.1 Syntax
9.41.3 Examples
9.42 edgedetect
9.43 eq
9.44 erosion
9.45 extractplanes
9.42.1 Examples
9.43.1 Commands
9.45.1 Examples
9.46 elbg
9.47 fade
9.48 fftfilt
9.49 field
9.50 fieldhint
9.51 fieldmatch
9.47.1 Examples
9.48.1 Examples
9.52 fieldorder
9.54 find_rect
9.55 cover_rect
9.56 format
9.57 fps
9.58 framepack
9.59 framerate
9.60 framestep
9.61 frei0r
9.62 fspp
9.63 gblur
9.64 geq
9.65 gradfun
9.66 haldclut
9.51.1.1 p/c/n
9.51.1.2 u/b
9.51.2 Examples
9.54.1 Examples
9.55.1 Examples
9.56.1 Examples
9.57.1 Examples
9.61.1 Examples
9.64.1 Examples
9.65.1 Examples
9.66.1 Workflow examples
9.67 hflip
9.68 histeq
9.69 histogram
9.70 hqdn3d
9.71 hwupload_cuda
9.72 hqx
9.73 hstack
9.74 hue
9.69.1 Examples
9.74.1 Examples
9.74.2 Commands
9.75 hysteresis
9.76 idet
9.77 il
9.78 inflate
9.79 interlace
9.80 kerndeint
9.81 lenscorrection
9.82 loop
9.83 lut3d
9.80.1 Examples
9.81.1 Options
9.84.1 Examples
9.85 lut2
9.86 maskedclamp
9.87 maskedmerge
9.88 mcdeint
9.89 mergeplanes
9.90 mestimate
9.91 minterpolate
9.92 mpdecimate
9.93 negate
9.94 nlmeans
9.95 nnedi
9.96 noformat
9.97 noise
9.98 null
9.99 ocr
9.100 ocv
9.85.1 Examples
9.89.1 Examples
9.96.1 Examples
9.97.1 Examples
9.100.1 dilate
9.100.2 erode
9.100.3 smooth
9.101 overlay
9.101.1 Commands
9.101.2 Examples
9.102 owdenoise
9.103 pad
9.104 palettegen
9.105 paletteuse
9.106 perspective
9.107 phase
9.108 pixdesctest
9.109 pp
9.110 pp7
9.111 prewitt
9.112 psnr
9.113 pullup
9.114 qp
9.115 random
9.116 readvitc
9.117 remap
9.118 removegrain
9.119 removelogo
9.120 repeatfields
9.121 reverse
9.122 rotate
9.103.1 Examples
9.104.1 Examples
9.105.1 Examples
9.109.1 Examples
9.114.1 Examples
9.116.1 Examples
9.121.1 Examples
9.122.1 Examples
9.122.2 Commands
9.123 sab
9.124 scale
9.124.1 Options
9.124.2 Examples
9.124.3 Commands
9.125 scale_npp
9.126 scale2ref
9.127 selectivecolor
9.128 separatefields
9.130 setfield
9.131 showinfo
9.132 showpalette
9.133 shuffleframes
9.134 shuffleplanes
9.135 signalstats
9.136 smartblur
9.137 ssim
9.138 stereo3d
9.126.1 Examples
9.127.1 Examples
9.129.1 Examples
9.133.1 Examples
9.134.1 Examples
9.135.1 Examples
9.138.1 Examples
9.139.1 Commands
9.139.2 Examples
9.140 sobel
9.141 spp
9.142 subtitles
9.143 super2xsai
9.144 swaprect
9.145 swapuv
9.146 telecine
9.147 thumbnail
9.148 tile
9.149 tinterlace
9.150 transpose
9.151 trim
9.152 unsharp
9.153 uspp
9.154 vaguedenoiser
9.155 vectorscope
9.156 vidstabdetect
9.157 vidstabtransform
9.147.1 Examples
9.148.1 Examples
9.152.1 Examples
9.156.1 Examples
9.157.1 Options
9.157.2 Examples
9.158 vflip
9.159 vignette
9.159.1 Expressions
9.159.2 Examples
9.160 vstack
9.161 w3fdif
9.162 waveform
9.163 weave
9.164 xbr
9.165 yadif
9.166 zoompan
9.163.1 Examples
9.166.1 Examples
9.167 zscale
10.1 buffer
10.2 cellauto
10.3 coreimagesrc
10.4 mandelbrot
10.5 mptestsrc
10.6 frei0r_src
10.7 life
10.8 allrgb, allyuv, color, haldclutsrc, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc
9.167.1 Options
10 Video Sources
10.2.1 Examples
10.3.1 Examples
10.7.1 Examples
10.8.1 Commands
11 Video Sinks
o
11.1 buffersink
11.2 nullsink
12 Multimedia Filters
o
12.1 ahistogram
12.2 aphasemeter
12.3 avectorscope
12.5 concat
12.7 ebur128
12.3.1 Examples
12.4.1 Examples
12.5.1 Examples
12.7.1 Examples
12.8.1 Examples
12.9.1 Examples
12.12.1 Examples
12.13.2 Examples
12.16 showcqt
12.17 showfreqs
12.18 showspectrum
12.19 showspectrumpic
12.20 showvolume
12.21 showwaves
12.22 showwavespic
12.24 spectrumsynth
12.14.1 Examples
12.15.1 Examples
12.16.1 Examples
12.18.1 Examples
12.19.1 Examples
12.21.1 Examples
12.22.1 Examples
12.24.1 Examples
12.25.1 Examples
13 Multimedia Sources
o
13.1 amovie
13.2 movie
14 See Also
15 Authors
13.2.1 Examples
13.2.2 Commands
1 Description
This document describes filters, sources, and sinks provided by the libavfilter library.
2 Filtering Introduction
Filtering in FFmpeg is enabled through the libavfilter library.
In libavfilter, a filter can have multiple inputs and multiple outputs. To illustrate the sorts of things that are possible, we consider the following
filtergraph.
[main]
input --> split ---------------------> overlay --> output
|
|[tmp]
^
[flip]|
This filtergraph splits the input stream in two streams, then sends one stream through the crop filter and the vflip filter, before merging it back
with the other stream by overlaying it on top. You can use the following command to achieve this:
ffmpeg -i INPUT -vf "split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2" OUTPUT
The result will be that the top half of the video is mirrored onto the bottom half of the output video.
Filters in the same linear chain are separated by commas, and distinct linear chains of filters are separated by semicolons. In our example,
crop,vflip are in one linear chain, split and overlay are separately in another. The points where the linear chains join are labelled by names
enclosed in square brackets. In the example, the split filter generates two outputs that are associated to the labels [main] and [tmp].
The stream sent to the second output of split, labelled as [tmp], is processed through the crop filter, which crops away the lower half part of
the video, and then vertically flipped. The overlay filter takes in input the first unchanged output of the split filter (which was labelled as
[main]), and overlay on its lower half the output generated by the crop,vflip filterchain.
Some filters take in input a list of parameters: they are specified after the filter name and an equal sign, and are separated from each other by
a colon.
There exist so-called source filters that do not have an audio/video input, and sink filters that will not have audio/video output.
3 graph2dot
The graph2dot program included in the FFmpeg tools directory can be used to parse a filtergraph description and issue a corresponding
textual representation in the dot language.
Invoke the command:
graph2dot -h
can be used to create and display an image representing the graph described by the GRAPH_DESCRIPTION string. Note that this string must be
a complete self-contained graph, with its inputs and outputs explicitly defined. For example if your command line is of the form:
ffmpeg -i infile -vf scale=640:360 outfile
nullsrc,scale=640:360,nullsink
you may also need to set the nullsrc parameters and add a format filter in order to simulate a specific input file.
4 Filtergraph description
A filtergraph is a directed graph of connected filters. It can contain cycles, and there can be multiple links between a pair of filters. Each link
has one input pad on one side connecting it to one filter from which it takes its input, and one output pad on the other side connecting it to
one filter accepting its output.
Each filter in a filtergraph is an instance of a filter class registered in the application, which defines the features and the number of input and
output pads of the filter.
A filter with no input pads is called a "source", and a filter with no output pads is called a "sink".
A :-separated list of value. In this case, the keys are assumed to be the option names in the order they are declared. E.g. the fade
filter declares three options in this order type, start_frame and nb_frames. Then the parameter list in:0:30 means that the value in
is assigned to the option type, 0 to start_frame and 30 to nb_frames.
A :-separated list of mixed direct value and long key=value pairs. The direct value must precede the key=value pairs, and follow
the same constraints order of the previous point. The following key=value pairs can be set in any preferred order.
If the option value itself is a list of items (e.g. the format filter takes a list of pixel formats), the items in the list are usually separated by |.
The list of arguments can be quoted using the character ' as initial and ending mark, and the character \ for escaping the characters within
the quoted text; otherwise the argument string is considered terminated when the next special character (belonging to the set []=;,) is
encountered.
The name and arguments of the filter are optionally preceded and followed by a list of link labels. A link label allows one to name a link and
associate it to a filter output or input pad. The preceding labels in_link_1 ... in_link_N, are associated to the filter input pads, the following
labels out_link_1 ... out_link_M, are associated to the output pads.
When two link labels with the same name are found in the filtergraph, a link between the corresponding input and output pad is created.
If an output pad is not labelled, it is linked by default to the first unlabelled input pad of the next filter in the filterchain. For example in the
filterchain
nullsrc, split[L1], [L2]overlay, nullsink
the split filter instance has two output pads, and the overlay filter instance two input pads. The first output pad of split is labelled "L1", the first
input pad of overlay is labelled "L2", and the second output pad of split is linked to the second input pad of overlay, which are both unlabelled.
In a filter description, if the input label of the first filter is not specified, "in" is assumed; if the output label of the last filter is not specified,
"out" is assumed.
In a complete filterchain all the unlabelled filter input and output pads must be connected. A filtergraph is considered valid if all the filter input
and output pads of all the filterchains are connected.
Libavfilter will automatically insert scale filters where format conversion is required. It is possible to specify swscale flags for those
automatically inserted scalers by prepending sws_flags=flags; to the filtergraph description.
Here is a BNF description of the filtergraph syntax:
NAME
LINKLABEL
LINKLABELS
A first level escaping affects the content of each filter option value, which may contain the special character : used to separate values, or one
of the escaping characters \'.
A second level escaping affects the whole filter description, which may contain the escaping characters \' or the special characters [],; used by
the filtergraph description.
Finally, when you specify a filtergraph on a shell commandline, you need to perform a third level escaping for the shell special characters
contained within it.
For example, consider the following string to be embedded in the drawtext filter description text value:
this is a 'string': may contain one, or more, special characters
This string contains the ' special escaping character, and the : special character, so it needs to be escaped in this way:
text=this is a \'string\'\: may contain one, or more, special characters
A second level of escaping is required when embedding the filter description in a filtergraph description, in order to escape all the filtergraph
special characters. Thus the example above becomes:
drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
(note that in addition to the \' escaping special characters, also , needs to be escaped).
Finally an additional level of escaping is needed when writing the filtergraph description in a shell command, which depends on the escaping
rules of the adopted shell. For example, assuming that \ is special and needs to be escaped with another \, the previous string will finally result
in:
-vf "drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters"
5 Timeline editing
Some filters support a generic enable option. For the filters supporting timeline editing, this option can be set to an expression which is
evaluated before sending a frame to the filter. If the evaluation is non-zero, the filter will be enabled, otherwise the frame will be sent
unchanged to the next filter in the filtergraph.
The expression accepts the following values:
t
timestamp expressed in seconds, NAN if the input timestamp is unknown
n
sequential number of the input frame, starting from 0
pos
the position in the file of the input frame, NAN if unknown
w
h
width and height of the input frame if video
Additionally, these filters support an enable command that can be used to re-define the expression.
Like any other filtering option, the enable option follows the same rules.
For example, to enable a blur filter (smartblur) from 10 seconds to 3 minutes, and a curves filter starting at 3 seconds:
smartblur = enable='between(t,10,3*60)',
curves
= enable='gte(t,3)' : preset=cross_process
6 Audio Filters
When you configure your FFmpeg build, you can disable any of the existing filters using --disable-filters. The configure output will
show the audio filters included in your build.
Below is a description of the currently available audio filters.
6.1 acompressor
A compressor is mainly used to reduce the dynamic range of a signal. Especially modern music is mostly compressed at a high
ratio to improve the overall loudness. Its done to get the highest attention of a listener, "fatten" the sound and bring more "power"
to the track. If a signal is compressed too much it may sound dull or "dead" afterwards or it may start to "pump" (which could be a
powerful effect but can also destroy a track completely). The right compression is the key to reach a professional sound and is the
high art of mixing and mastering. Because of its complex settings it may take a long time to get the right feeling for this kind of
effect.
Compression is done by detecting the volume above a chosen level threshold and dividing it by the factor set with ratio. So if you
set the threshold to -12dB and your signal reaches -6dB a ratio of 2:1 will result in a signal at -9dB. Because an exact manipulation
of the signal would cause distortion of the waveform the reduction can be levelled over the time. This is done by setting "Attack"
and "Release". attack determines how long the signal has to rise above the threshold before any reduction will occur and release
sets the time the signal has to fall below the threshold to reduce the reduction again. Shorter signals than the chosen attack time
will be left untouched. The overall reduction of the signal can be made up afterwards with the makeup setting. So compressing the
peaks of a signal about 6dB and raising the makeup to this level results in a signal twice as loud than the source. To gain a softer
entry in the compression the knee flattens the hard edge at the threshold in the range of the chosen decibels.
The filter accepts the following options:
level_in
Set input gain. Default is 1. Range is between 0.015625 and 64.
threshold
If a signal of second stream rises above this level it will affect the gain reduction of the first stream. By default it is 0.125. Range is
between 0.00097563 and 1.
ratio
Set a ratio by which the signal is reduced. 1:2 means that if the level rose 4dB above the threshold, it will be only 2dB above after
the reduction. Default is 2. Range is between 1 and 20.
attack
Amount of milliseconds the signal has to rise above the threshold before gain reduction starts. Default is 20. Range is between 0.01
and 2000.
release
Amount of milliseconds the signal has to fall below the threshold before reduction is decreased again. Default is 250. Range is
between 0.01 and 9000.
makeup
Set the amount by how much signal will be amplified after processing. Default is 2. Range is from 1 and 64.
knee
Curve the sharp knee around the threshold to enter gain reduction more softly. Default is 2.82843. Range is between 1 and 8.
link
Choose if the average level between all channels of input stream or the louder( maximum) channel of input stream affects the
reduction. Default is average.
detection
Should the exact signal be taken in case of peak or an RMS one in case of rms. Default is rms which is mostly smoother.
mix
How much to use compressed signal in output. Default is 1. Range is between 0 and 1.
6.2 acrossfade
Apply cross fade from one input audio stream to another input audio stream. The cross fade is applied
for specified duration near the end of first stream.
The filter accepts the following options:
nb_samples, ns
Specify the number of samples for which the cross fade effect has to last. At the end of the cross fade effect the first input audio
will be completely silent. Default is 44100.
duration, d
Specify the duration of the cross fade effect. See (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual for the
accepted syntax. By default the duration is determined by nb_samples. If set this option is used instead of nb_samples.
overlap, o
Should first stream end overlap with second stream start. Default is enabled.
curve1
Set curve for cross fade transition for first stream.
curve2
Set curve for cross fade transition for second stream.
For description of available curve types see afade filter description.
6.2.1 Examples
-filter_complex
6.3 acrusher
Reduce audio bit resolution.
This filter is bit crusher with enhanced functionality. A bit crusher is used to audibly
reduce number of bits an audio signal is sampled with. This doesnt change the bit
depth at all, it just produces the effect. Material reduced in bit depth sounds more harsh
and "digital". This filter is able to even round to continous values instead of discrete bit
depths. Additionally it has a D/C offset which results in different crushing of the lower
and the upper half of the signal. An Anti-Aliasing setting is able to produce "softer"
crushing sounds.
Another feature of this filter is the logarithmic mode. This setting switches from linear
distances between bits to logarithmic ones. The result is a much more "natural"
sounding crusher which doesnt gate low signals for example. The human ear has a
logarithmic perception, too so this kind of crushing is much more pleasant. Logarithmic
crushing is also able to get anti-aliased.
The filter accepts the following options:
level_in
Set level in.
level_out
Set level out.
bits
Set bit reduction.
mix
Set mixing ammount.
mode
Can be linear: lin or logarithmic: log.
dc
Set DC.
aa
Set anti-aliasing.
samples
Set sample reduction.
lfo
Enable LFO. By default disabled.
lforange
Set LFO range.
lforate
Set LFO rate.
6.4 adelay
Delay one or more audio channels.
Samples in delayed channel are filled with silence.
The filter accepts the following option:
delays
Set list of delays in milliseconds for each channel separated by |. At least one delay greater than 0 should be provided. Unused
delays will be silently ignored. If number of given delays is smaller than number of channels all remaining channels will not be
delayed. If you want to delay exact number of samples, append S to number.
6.4.1 Examples
6.5 aecho
Apply echoing to the input audio.
Echoes are reflected sound and can occur naturally
amongst mountains (and sometimes large buildings)
when talking or shouting; digital echo effects emulate
this behaviour and are often used to help fill out the
sound of a single instrument or vocal. The time
difference between the original signal and the
reflection is the delay, and the loudness of the
reflected signal is the decay. Multiple echoes can have
different delays and decays.
A description of the accepted parameters follows.
in_gain
Set input gain of reflected signal. Default is 0.6.
out_gain
6.5.1 Examples
6.6 aemphasis
Audio emphasis filter creates or restores
material directly taken from LPs or
emphased CDs with different filter curves.
E.g. to store music on vinyl the signal has
to be altered by a filter first to even out
the disadvantages of this recording
medium. Once the material is played back
the inverse filter has to be applied to
restore the distortion of the frequency
response.
The filter accepts the following options:
level_in
Set input gain.
level_out
Set output gain.
mode
Set filter mode. For restoring material use reproduction mode, otherwise use production mode. Default is reproduction mode.
type
Set filter type. Selects medium. Can be one of the following:
col
select Columbia.
emi
select EMI.
bsi
select BSI (78RPM).
riaa
select RIAA.
cd
select Compact Disc (CD).
50fm
select 50s (FM).
75fm
select 75s (FM).
50kf
select 50s (FM-KF).
75kf
select 75s (FM-KF).
6.7 aeval
Modify
an
according to
expressions.
audio
signal
the specified
the
following
exprs
Set the |-separated expressions list for each separate channel. If the number of input channels is greater than the number of
expressions, the last specified expression is used for the remaining output channels.
channel_layout, c
Set output channel layout. If not specified, the channel layout is specified by the number of expressions. If set to same, it will use
by default the same input channel layout.
Each expression in exprs
can contain the following
constants and functions:
ch
channel number of the current expression
n
number of the evaluated sample, starting from 0
s
sample rate
t
time of the evaluated sample expressed in seconds
nb_in_chann
els
nb_out_chan
nels
input and output number of channels
val(CH)
the value of input channel with number CH
Note:
this
filter is
slow. For
faster
processi
ng you
should
use
a
dedicate
d filter.
6.7.1
Exam
ples
Ha
lf
vol
um
e:
ae
val
=v
al(
ch)
/2:
c=
sa
me
Inv
ert
ph
as
e
of
th
e
se
co
nd
ch
an
nel
:
ae
val
=v
al(
0)|val
(1)
6.8
afad
e
Apply
fadein/out
effect to
input
audio.
A
descripti
on
of
the
accepte
d
paramet
ers
follows.
type, t
Specify the effect type, can be either in for fade-in, or out for a fade-out effect. Default is in.
start
_sam
ple,
ss
Specify the number of the start sample for starting to apply the fade effect. Default is 0.
nb
_s
a
m
pl
es
,
ns
Specify the number of samples for which the fade effect has to last. At the end of the fade-in effect the output audio will have the
same volume as the input audio, at the end of the fade-out transition the output audio will be silence. Default is 44100.
s
t
a
r
t
_
t
i
m
e
,
s
t
Specify the start time of the fade effect. Default is 0. The value must be specified as a time duration; see (ffmpeg-utils)the Time
duration section in the ffmpeg-utils(1) manual for the accepted syntax. If set this option is used instead of start_sample.
du
rat
io
n,
d
Specify the duration of the fade effect. See (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual for the accepted
syntax. At the end of the fade-in effect the output audio will have the same volume as the input audio, at the end of the fade-out
transition the output audio will be silence. By default the duration is determined by nb_samples. If set this option is used instead of
nb_samples.
curve
Set curve for fade transition.
It accepts the following values:
tri
select triangular, linear slope (default)
qsin
select quarter of sine wave
hsin
select half of sine wave
esin
select exponential sine wave
log
select logarithmic
ipar
select inverted parabola
qua
select quadratic
cub
select cubic
squ
select square root
cbr
select cubic root
par
select parabola
exp
select exponential
iqsin
select inverted quarter of sine wave
ihsin
select inverted half of sine wave
dese
select double-exponential seat
desi
select double-exponential sigmoid
6.8.1
Exam
ples
Fade in
first 15
seconds
of audio:
afade=t=
in:ss=0:d
=15
Fade out
last
25
seconds
of a 900
seconds
audio:
afade=t=
out:st=8
75:d=25
6.9
afftfi
lt
Apply
arbitrary
expressi
ons
to
samples
in
frequenc
y
domain.
real
Set frequency domain real expression for each separate channel separated by |. Default is "1". If the number of input channels is
greater than the number of expressions, the last specified expression is used for the remaining output channels.
imag
Set frequency domain imaginary expression for each separate channel separated by |. If not set, real option is used.
Each expression in real and imag can contain the following constants:
sr
sample rate
b
current frequency bin number
nb
number of available bins
ch
channel number of the current expression
chs
number of channels
pts
current frame pts
win_size
Set window size.
It accepts the following values:
w16
w32
w64
w128
w256
w512
w1024
w2048
w4096
w8192
w16384
w32768
w65536
Default is w4096
win_func
Set window function. Default is hann.
overlap
Set window overlap. If set to 1, the recommended overlap for selected window function will be picked. Default is 0.75.
6.9.1 Examples
Leave almost on
frequencies in au
afftfilt="1clip((b/nb)*b,0,1)"
6.10
aformat
Set
output
forma
constraints
for
the
input
audio.
The
framework
wil
negotiate the mos
appropriate format to
minimize conversions.
If a parameter is om
values are allowed.
aformat=sample_fmts=u
s16:channel_layouts=ste
6.11 agate
6.12 alimite
Depending on picked s
with aresample before
6.13 allpass
6.14 aloop
Loop audio samples.
6.15 amerge
6.15.1 Example
amovie=left.wav [
Multiple merges a
ffmpeg -i input.
output.mkv
6.16 amix
ffmpeg -i INPUT1 -i IN
OUTPUT
6.17 anequa
High-order parametric
w
Set band width in hertz.
g
Set band gain in dB.
t
Set filter type for band, optional, can be:
0
Butterworth, this is default.
1
Chebyshev type 1.
2
Chebyshev type 2.
curves
With this option activated frequency response of anequalizer is displayed in video stream.
size
Set video stream size. Only useful if curves option is activated.
mgain
Set max gain that will be displayed. Only useful if curves option is activated. Setting this to reasonable value allows to display gain
which is derived from neighbour bands which are too close to each other and thus produce higher gain when both are activated.
fscale
Set frequency scale used to draw frequency response in video output. Can be linear or logarithmic. Default is logarithmic.
colors
Set color for each channel curve which is going to be displayed in video stream. This is list of color names separated by space or by
|. Unrecognised or missing colors will be replaced by white color.
6.17.1 Example
Lower gain by 10
anequalizer=c0 f=
6.17.2 Comman
6.18 anull
6.19 apad
6.19.1 Example
apad=pad_len=10
apad=whole_len=1
6.20 aphase
A description of the ac
in_gain
Set input gain. Default is 0.4.
out_gain
Set output gain. Default is 0.74
delay
Set delay in milliseconds. Default is 3.0.
decay
Set decay. Default is 0.4.
speed
Set modulation speed in Hz. Default is 0.5.
type
Set modulation type. Default is triangular.
It accepts the following values:
triangular, t
sinusoidal, s
6.21 apulsat
Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used if timing is set to hz.
6.22 aresam
6.22.1 Example
aresample=44100
Stretch/squeeze s
aresample=async=
6.23 arevers
Reverse an audio clip.
6.23.1 Example
atrim=end=5,arev
6.24 asetnsa
asetnsamples=n=1234:p
6.25 asetrat
6.26 ashowi
The presentation timestamp of the input frame, in time base units; the time base depends on the filter input pad, and is usually
1/sample_rate.
pts_time
The presentation timestamp of the input frame in seconds.
pos
position of the frame in the input stream, -1 if this information in unavailable and/or meaningless (for example in case of synthetic
audio)
fmt
The sample format.
chlayout
The channel layout.
rate
The sample rate for the audio frame.
nb_samples
The number of samples (per channel) in the frame.
checksum
The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar audio, the data is treated as if all the planes were
concatenated.
plane_checksums
A list of Adler-32 checksums for each data plane.
6.27 astats
A description of each s
DC offset
Mean amplitude displacement from zero.
Min level
Minimal sample level.
Max level
Maximal sample level.
Min difference
Minimal difference between two consecutive samples.
Max difference
Maximal difference between two consecutive samples.
Mean difference
Mean difference between two consecutive samples. The average of each difference between two consecutive samples.
Peak level dB
RMS level dB
Standard peak and RMS level measured in dBFS.
RMS peak dB
RMS trough dB
Peak and trough values for RMS level measured over a short window.
Crest factor
Standard ratio of peak to RMS level (note: not in dB).
Flat factor
Flatness (i.e. consecutive samples with the same value) of the signal at its peak levels (i.e. either Min level or Max level).
Peak count
Number of occasions (not the number of samples) that the signal attained either Min level or Max level.
Bit depth
Overall bit depth of audio. Number of bits used for each sample.
6.28 asyncts
6.29 atempo
Adjust audio tempo.
6.29.1 Example
atempo=0.8
To speed up audio
atempo=1.25
6.30 atrim
Drop everything e
6.31 bandpa
6.32 bandre
6.33 bass
s
slope
width, w
Determine how steep is the filters shelf transition.
6.34 biquad
6.35 bs2b
6.36 channe
Remap input channels
map
Map channels from input to output. The argument is a |-separated list of mappings, each in the in_channel-out_channel or
in_channel form. in_channel can be either the name of the input channel (e.g. FL for front left) or its index in the input channel
layout. out_channel is the name of the output channel or its index in the output channel layout. If out_channel is not given then it is
implicitly an index, starting with zero and increasing by one for each mapping.
If no mapping is presen
6.37 channe
'channelsplit=channel_la
side_right.wav
6.38 chorus
Add a chorus effect to
Chorus resembles an e
tuned around the origin
A single delay:
chorus=0.7:0.9:55:0.4:0.25:2
Two delays:
chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
A list of times in seconds for each channel over which the instantaneous level of the input signal is averaged to determine its
volume. attacks refers to increase of volume and decays refers to decrease of volume. For most situations, the attack time
(response to the audio getting louder) should be shorter than the decay time, because the human ear is more sensitive to sudden
loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and a typical value for decay is 0.8 seconds. If specified
number of attacks & decays is lower than number of channels, the last set attack/decay will be used for all remaining channels.
A list of points for the transfer function, specified in dB relative to the maximum possible signal amplitude. Each key points list must
be defined using the following syntax: x0/y0|x1/y1|x2/y2|.... or x0/y0 x1/y1 x2/y2 ....
The input values must be in strictly increasing order but the transfer function does not have to be monotonically rising. The point
0/0 is assumed but may be overridden (by 0/out-dBn). Typical values for the transfer function are -70/-70|-60/-20.
Set the curve radius in dB for all joints. It defaults to 0.01.
Set the additional gain in dB to be applied at all points on the transfer function. This allows for easy adjustment of the overall gain.
It defaults to 0.
Set an initial volume, in dB, to be assumed for each channel when filtering starts. This permits the user to supply a nominal level
initially, so that, for example, a very large gain is not applied to initial signal levels before the companding has begun to operate. A
typical value for audio which is initially quiet is -90 dB. It defaults to 0.
Set a delay, in seconds. The input audio is analyzed immediately, but audio is delayed before being fed to the volume adjuster.
Specifying a delay approximately equal to the attack/decay times allows the filter to effectively operate in predictive rather than
reactive mode. It defaults to 0.
Make music with both quiet and loud passages suitable for listening to in a noisy environment:
compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
A noise gate for when the noise is at a lower level than the signal:
compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
Here is another noise gate, this time for when the noise is at a higher level than the signal (making it, in some ways, similar to
compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
Compressor/Gate:
compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
Expander:
compand=attacks=0:points=-80/-169|-54/-80|-49.5/-64.6|-41.1/-41.1|-25.8/-15|-10.8/-4.5|0/0|20/8.3
Soft limiter:
compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
er microphone. That makes the final mix sounding moody. This filter helps to solve phasing problems by adding different delays to each microphone track and make
Set millimeters distance. This is compensation distance for fine tuning. Default is 0.
Set cm distance. This is compensation distance for tightening distance setup. Default is 0.
Set meters distance. This is compensation distance for hard distance setup. Default is 0.
Set dry amount. Amount of unprocessed (dry) signal. Default is 0.
Set wet amount. Amount of processed (wet) signal. Default is 1.
Set temperature degree in Celsius. This is the temperature of the environment. Default is 20.
Sets the intensity of effect (default: 2.0). Must be in range between 0.0 (unchanged sound) to 10.0 (maximum effect).
Enable clipping. By default is enabled.
Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift the audio.
Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is used to prevent clipping.
ds: The Dynamic Audio Normalizer will "even out" the volume of quiet and loud sections, in the sense that the volume of each section is brought to the same target
Set the frame length in milliseconds. In range from 10 to 8000 milliseconds. Default is 500 milliseconds. The Dynamic Audio
Normalizer processes the input audio in small chunks, referred to as frames. This is required, because a peak magnitude has no
meaning for just a single sample value. Instead, we need to determine the peak magnitude for a contiguous sequence of sample
values. While a "standard" normalizer would simply use the peak magnitude of the complete file, the Dynamic Audio Normalizer
determines the peak magnitude individually for each frame. The length of a frame is specified in milliseconds. By default, the
Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has been found to give good results with most files. Note
that the exact frame length, in number of samples, will be determined automatically, based on the sampling rate of the individual
input audio file.
Set the Gaussian filter window size. In range from 3 to 301, must be odd number. Default is 31. Probably the most important
parameter of the Dynamic Audio Normalizer is the window size of the Gaussian smoothing filter. The filters window size is specified
in frames, centered around the current frame. For the sake of simplicity, this must be an odd number. Consequently, the default
value of 31 takes into account the current frame, as well as the 15 preceding frames and the 15 subsequent frames. Using a larger
window results in a stronger smoothing effect and thus in less gain variation, i.e. slower gain adaptation. Conversely, using a
smaller window results in a weaker smoothing effect and thus in more gain variation, i.e. faster gain adaptation. In other words, the
more you increase this value, the more the Dynamic Audio Normalizer will behave like a "traditional" normalization filter. On the
contrary, the more you decrease this value, the more the Dynamic Audio Normalizer will behave like a dynamic range compressor.
Set the target peak value. This specifies the highest permissible magnitude level for the normalized audio input. This filter will try to
approach the target peak magnitude as closely as possible, but at the same time it also makes sure that the normalized signal will
never exceed the peak magnitude. A frames maximum local gain factor is imposed directly by the target peak magnitude. The
default value is 0.95 and thus leaves a headroom of 5%*. It is not recommended to go above this value.
Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0. The Dynamic Audio Normalizer determines the maximum
possible (local) gain factor for each input frame, i.e. the maximum gain factor that does not result in clipping or distortion. The
maximum gain factor is determined by the frames highest magnitude sample. However, the Dynamic Audio Normalizer additionally
bounds the frames maximum gain factor by a predetermined (global) maximum gain factor. This is done in order to avoid
excessive gain factors in "silent" or almost silent frames. By default, the maximum gain factor is 10.0, For most inputs the default
value should be sufficient and it usually is not recommended to increase this value. Though, for input with an extremely low overall
volume level, it may be necessary to allow even higher gain factors. Note, however, that the Dynamic Audio Normalizer does not
simply apply a "hard" threshold (i.e. cut off values above the threshold). Instead, a "sigmoid" threshold function will be applied. This
way, the gain factors will smoothly approach the threshold value, but never exceed that value.
Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled. By default, the Dynamic Audio Normalizer performs "peak"
normalization. This means that the maximum local gain factor for each frame is defined (only) by the frames highest magnitude
sample. This way, the samples can be amplified as much as possible without exceeding the maximum signal level, i.e. without
clipping. Optionally, however, the Dynamic Audio Normalizer can also take into account the frames root mean square, abbreviated
RMS. In electrical engineering, the RMS is commonly used to determine the power of a time-varying signal. It is therefore
considered that the RMS is a better approximation of the "perceived loudness" than just looking at the signals peak magnitude.
Consequently, by adjusting all frames to a constant RMS value, a uniform "perceived loudness" can be established. If a target RMS
value has been specified, a frames local gain factor is defined as the factor that would result in exactly that RMS value. Note,
however, that the maximum local gain factor is still restricted by the frames highest magnitude sample, in order to prevent
clipping.
Enable channels coupling. By default is enabled. By default, the Dynamic Audio Normalizer will amplify all channels by the same
amount. This means the same gain factor will be applied to all channels, i.e. the maximum possible gain factor is determined by the
"loudest" channel. However, in some recordings, it may happen that the volume of the different channels is uneven, e.g. one
channel may be "quieter" than the other one(s). In this case, this option can be used to disable the channel coupling. This way, the
gain factor will be determined independently for each channel, depending only on the individual channels highest magnitude
sample. This allows for harmonizing the volume of the different channels.
Enable DC bias correction. By default is disabled. An audio signal (in the time domain) is a sequence of sample values. In the
Dynamic Audio Normalizer these sample values are represented in the -1.0 to 1.0 range, regardless of the original input format.
Normally, the audio signal, or "waveform", should be centered around the zero point. That means if we calculate the mean value of
all samples in a file, or in a single frame, then the result should be 0.0 or at least very close to that value. If, however, there is a
significant deviation of the mean value from 0.0, in either positive or negative direction, this is referred to as a DC bias or DC offset.
Since a DC bias is clearly undesirable, the Dynamic Audio Normalizer provides optional DC bias correction. With DC bias correction
enabled, the Dynamic Audio Normalizer will determine the mean value, or "DC correction" offset, of each input frame and subtract
that value from all of the frames sample values which ensures those samples are centered around 0.0 again. Also, in order to avoid
"gaps" at the frame boundaries, the DC correction offset values will be interpolated smoothly between neighbouring frames.
Enable alternative boundary mode. By default is disabled. The Dynamic Audio Normalizer takes into account a certain
neighbourhood around each frame. This includes the preceding frames as well as the subsequent frames. However, for the
"boundary" frames, located at the very beginning and at the very end of the audio file, not all neighbouring frames are available. In
particular, for the first few frames in the audio file, the preceding frames are not known. And, similarly, for the last few frames in
the audio file, the subsequent frames are not known. Thus, the question arises which gain factors should be assumed for the
missing frames in the "boundary" region. The Dynamic Audio Normalizer implements two modes to deal with this situation. The
default boundary mode assumes a gain factor of exactly 1.0 for the missing frames, resulting in a smooth "fade in" and "fade out"
at the beginning and at the end of the input, respectively.
Set the compress factor. In range from 0.0 to 30.0. Default is 0.0. By default, the Dynamic Audio Normalizer does not apply
"traditional" compression. This means that signal peaks will not be pruned and thus the full dynamic range will be retained within
each local neighbourhood. However, in some cases it may be desirable to combine the Dynamic Audio Normalizers normalization
algorithm with a more "traditional" compression. For this purpose, the Dynamic Audio Normalizer provides an optional compression
(thresholding) function. If (and only if) the compression feature is enabled, all input frames will be processed by a soft knee
thresholding function prior to the actual normalization process. Put simply, the thresholding function is going to prune all samples
whose magnitude exceeds a certain threshold value. However, the Dynamic Audio Normalizer does not simply apply a fixed
threshold value. Instead, the threshold value will be adjusted for each individual frame. In general, smaller parameters result in
stronger compression, and vice versa. Values below 3.0 are not recommended, because audible distortion may appear.
s
slope
Specify the band-width of a filter in width_type units.
Set the required gain or attenuation in dB. Beware of clipping when using a positive gain.
Sets the difference coefficient (default: 2.5). 0.0 means mono sound (average of both channels), with 1.0 sound will be unchanged,
with -1.0 left and right channels will be swapped.
Enable clipping. By default is enabled.
Set gain curve equation (in dB). The expression can contain variables:
f
the evaluated frequency
sr
sample rate
ch
channel number, set to 0 when multichannels evaluation is disabled
chid
channel id, see libavutil/channel_layout.h, set to the first channel id when multichannels evaluation is disabled
chs
number of channels
chlayout
channel_layout, see libavutil/channel_layout.h
and functions:
gain_interpolate(f)
interpolate gain on frequency f based on gain_entry
cubic_interpolate(f)
same as gain_interpolate, but smoother
This option is also available as command. Default is gain_interpolate(f).
Set gain entry for gain_interpolate function. The expression can contain functions:
entry(f, g)
store gain entry at frequency f with value g
This option is also available as command.
Set filter delay in seconds. Higher value means more accurate. Default is 0.01.
Set filter accuracy in Hz. Lower value means more accurate. Default is 5.
Set window function. Acceptable values are:
rectangular
rectangular window, useful when gain curve is already smooth
hann
hann window (default)
hamming
hamming window
blackman
blackman window
nuttall3
3-terms continuous 1st derivative nuttall window
mnuttall3
minimum 3-terms discontinuous nuttall window
nuttall
4-terms continuous 1st derivative nuttall window
bnuttall
minimum 4-terms discontinuous nuttall (blackman-nuttall) window
bharris
blackman-harris window
tukey
tukey window
If enabled, use fixed number of audio samples. This improves speed when filtering with large delay. Default is disabled.
Enable multichannels evaluation on gain. Default is disabled.
Enable zero phase mode by subtracting timestamp to compensate delay. Default is disabled.
Set scale used by gain. Acceptable values are:
linlin
linear frequency, linear gain
linlog
linear frequency, logarithmic (in dB) gain (default)
loglin
logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain
loglog
logarithmic frequency, logarithmic gain
Set file for dumping, suitable for gnuplot.
Set scale for dumpfile. Acceptable values are same with scale option. Default is linlog.
custom equalization:
firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)'
Modes are:
0, off
Disabled
1, lle
Gain adjustment level at each sample
2, pe
Samples where peak extend occurs
3, cdt
Samples where the code detect timer is active
4, tgm
Samples where the target gain does not match between channels
Specifies the name of LADSPA plugin library to load. If the environment variable LADSPA_PATH is defined, the LADSPA plugin is
searched in each one of the directories specified by the colon separated list in LADSPA_PATH, otherwise in the standard LADSPA
paths, which are in this order: HOME/.ladspa/lib/, /usr/local/lib/ladspa/, /usr/lib/ladspa/.
Specifies the plugin within the library. Some libraries contain only one plugin, but others contain many of them. If this is not set
filter will list all available plugins within the specified library.
Set the | separated list of controls which are zero or more floating point values that determine the behavior of the loaded plugin
(for example delay, threshold or gain). Controls need to be defined using the following syntax: c0=value0|c1=value1|c2=value2|...,
where valuei is the value set on the i-th control. Alternatively they can be also defined using the following syntax: value0|value1|
value2|..., where valuei is the value set on the i-th control. If controls is set to help, all available controls and their valid ranges are
printed.
Specify the sample rate, default to 44100. Only used if plugin have zero inputs.
Set the number of samples per channel per each output frame, default is 1024. Only used if plugin have zero inputs.
Set the minimum duration of the sourced audio. See (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual for the
accepted syntax. Note that the resulting duration may be greater than the specified duration, as the generated audio is always cut
at the end of a complete frame. If not specified, or the expressed duration is negative, the audio is supposed to be generated
forever. Only used if plugin have zero inputs.
List all available plugins within amp (LADSPA example plugin) library:
ladspa=file=amp
List all available controls and their valid ranges for vcf_notch plugin from VCF library:
ladspa=f=vcf:p=vcf_notch:c=help
Simulate low quality audio equipment using Computer Music Toolkit (CMT) plugin library:
ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
Add reverberation to the audio using TAP-plugins (Toms Audio Processing plugins):
ladspa=file=tap_reverb:tap_reverb
Generate 20 bpm clicks using plugin C* Click - Metronome from the C* Audio Plugin Suite (CAPS) library:
ladspa=file=caps:Click:c=c1=20'
Increase volume by 20dB using fast lookahead limiter from Steve Harris SWH Plugins collection:
ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
Attenuate low frequencies using Multiband EQ from Steve Harris SWH Plugins collection:
ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
Set integrated loudness target. Range is -70.0 - -5.0. Default value is -24.0.
Set loudness range target. Range is 1.0 - 20.0. Default value is 7.0.
Set maximum true peak. Range is -9.0 - +0.0. Default value is -2.0.
Measured IL of input file. Range is -99.0 - +0.0.
Measured LRA of input file. Range is 0.0 - 99.0.
Measured true peak of input file. Range is -99.0 - +99.0.
Measured threshold of input file. Range is -99.0 - +0.0.
Set offset gain. Gain is applied before the true-peak limiter. Range is -99.0 - +99.0. Default is +0.0.
Normalize linearly if possible. measured_I, measured_LRA, measured_TP, and measured_thresh must also to be specified in order to
use this mode. Options are true or false. Default is true.
Treat mono input files as "dual-mono". If a mono file is intended for playback on a stereo system, its EBU R128 measurement will be
perceptually incorrect. If set to true, this option will compensate for this effect. Multi-channel input files are not affected by this
option. Options are true or false. Default is false.
Set print format for stats. Options are summary, json, or none. Default value is none.
am will be processed depending on second stream signal. The filtered signal then can be filtered with other filters in later stages of processing. See pan and amerge
Full ffmpeg example taking 2 audio inputs, 1st input to be compressed depending on the signal of 2nd input and later compressed
gate uses the full range signal to detect a level above the threshold. For example: If you cut all lower frequencies from your sidechain signal the gate will decrease
of muted strokes from a heavily distorted guitar. It needs two input streams and returns one output stream. First input stream will be processed depending on second
Set input level before filtering. Default is 1. Allowed range is from 0.015625 to 64.
Set the level of gain reduction when the signal is below the threshold. Default is 0.06125. Allowed range is from 0 to 1.
If a signal rises above this level the gain reduction is released. Default is 0.125. Allowed range is from 0 to 1.
Set a ratio about which the signal is reduced. Default is 2. Allowed range is from 1 to 9000.
Amount of milliseconds the signal has to rise above the threshold before gain reduction stops. Default is 20 milliseconds. Allowed
range is from 0.01 to 9000.
Amount of milliseconds the signal has to fall below the threshold before the reduction is increased again. Default is 250
milliseconds. Allowed range is from 0.01 to 9000.
Set amount of amplification of signal after processing. Default is 1. Allowed range is from 1 to 64.
Curve the sharp knee around the threshold to enter gain reduction more softly. Default is 2.828427125. Allowed range is from 1 to
8.
Choose if exact signal should be taken for detection or an RMS like one. Default is rms. Can be peak or rms.
Choose if the average level between all channels or the louder channel affects the reduction. Default is average. Can be average or
maximum.
Set sidechain gain. Default is 1. Range is from 0.015625 to 64.
Complete example with ffmpeg to detect silence with 0.0001 noise tolerance in silence.mp3:
ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
This value is used to indicate if audio should be trimmed at beginning of the audio. A value of zero indicates no silence should be
trimmed from the beginning. When specifying a non-zero value, it trims audio up until it finds non-silence. Normally, when trimming
silence from beginning of audio the start_periods will be 1 but it can be increased to higher values to trim all audio up to specific
count of non-silence periods. Default value is 0.
Specify the amount of time that non-silence must be detected before it stops trimming audio. By increasing the duration, bursts of
noises can be treated as silence and trimmed off. Default value is 0.
This indicates what sample value should be treated as silence. For digital audio, a value of 0 may be fine but for audio recorded
from analog, you may wish to increase the value to account for background noise. Can be specified in dB (in case "dB" is appended
to the specified value) or amplitude ratio. Default value is 0.
Set the count for trimming silence from the end of audio. To remove silence from the middle of a file, specify a stop_periods that is
negative. This value is then treated as a positive value and is used to indicate the effect should restart processing as specified by
start_periods, making it suitable for removing periods of silence in the middle of the audio. Default value is 0.
Specify a duration of silence that must exist before audio is not copied any more. By specifying a higher duration, silence that is
wanted can be left in the audio. Default value is 0.
This is the same as start_threshold but for trimming silence from the end of audio. Can be specified in dB (in case "dB" is appended
to the specified value) or amplitude ratio. Default value is 0.
This indicates that stop_duration length of audio should be left intact at the beginning of each period of silence. For example, if you
want to remove long pauses between words but do not want to remove the pauses completely. Default value is 0.
Set how is silence detected. Can be rms or peak. Second is faster and works better with digital silence which is exactly 0. Default
value is rms.
Set ratio used to calculate size of window for detecting silence. Default value is 0.02. Allowed range is from 0 to 10.
The following example shows how this filter can be used to start a recording that does not contain the delay at the start which
e:
silenceremove=1:5:0.02
Trim all silence encountered from beginning to end where there is more than 1 second of silence in audio:
silenceremove=0:0:0:-1:1:-90dB
the user for binaural listening via headphones (audio formats up to 9 channels supported). The HRTFs are stored in SOFA files (see http://www.sofacoustics.org/ for a
ademy of Sciences.
Using ClubFritz12 sofa file and bigger radius with small rotation:
sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
Similar as above but with custom speaker positions for front left, front right, rear left and rear right and also with custom gain:
"sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=2:speakers=FL 45|FR 315|RL 135|RR 225:gain=28"
ng M/S stereo recordings to L/R signal while having control over the parameters or spreading the stereo image of master track.
Set input level before filtering for both channels. Defaults is 1. Allowed range is from 0.015625 to 64.
Set output level after filtering for both channels. Defaults is 1. Allowed range is from 0.015625 to 64.
Set input balance between both channels. Default is 0. Allowed range is from -1 to 1.
Set output balance between both channels. Default is 0. Allowed range is from -1 to 1.
Enable softclipping. Results in analog distortion instead of harsh digital 0dB clipping. Disabled by default.
Mute the left channel. Disabled by default.
Mute the right channel. Disabled by default.
Change the phase of the left channel. Disabled by default.
Change the phase of the right channel. Disabled by default.
es
Apply karaoke like effect:
stereotools=mlev=0.015625
widen
e stereo effect by suppressing signal common to both channels and by delaying the signal of left into right and vice versa, thereby widening the stereo effect.
following options:
Time in milliseconds of the delay of left signal into right and vice versa. Default is 20 milliseconds.
Amount of gain in delayed signal into right and vice versa. Gives a delay effect of left signal in right output and vice versa which
gives widening effect. Default is 0.3.
Cross feed of left into right with inverted phase. This helps in suppressing the mono. If the value is 1 it will cancel all the signal
common to both channels. Default is 0.3.
Set level of input signal of original channel. Default is 0.8.
treble
ut treble (upper) frequencies of the audio using a two-pole shelving filter with a response similar to that of a standard hi-fis tone-controls. This is also known as
qualisation (EQ).
Give the gain at whichever is the lower of ~22 kHz and the Nyquist frequency. Its useful range is about -20 (for a large cut) to +20
(for a large boost). Beware of clipping when using a positive gain.
ncy, f
Set the filters central frequency and so can be used to extend or reduce the frequency range to be boosted or cut. The default
value is 3000 Hz.
h_type
Set method to specify band-width of filter.
h
Hz
q
Q-Factor
o
octave
s
slope
idth, w
Determine how steep is the filters shelf transition.
6.67 tremolo
Sinusoidal amplitude modulation.
The filter accepts the following options:
f
Modulation frequency in Hertz. Modulation frequencies in the subharmonic range (20 Hz or lower) will result in a tremolo effect. This
filter may also be used as a ring modulator by specifying a modulation frequency higher than 20 Hz. Range is 0.1 - 20000.0. Default
value is 5.0 Hz.
d
Depth of modulation as a percentage. Range is 0.0 - 1.0. Default value is 0.5.
6.68 vibrato
Sinusoidal phase modulation.
The filter accepts the following options:
f
Modulation frequency in Hertz. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
d
Depth of modulation as a percentage. Range is 0.0 - 1.0. Default value is 0.5.
6.69 volume
Adjust the input audio volume.
It accepts the following parameters:
volume
Set audio volume expression.
Output values are clipped to the maximum value.
The output audio volume is given by the relation:
output_volume = volume * input_volume
track
Prefer the track gain, if present.
album
Prefer the album gain, if present.
replaygain_preamp
Pre-amplification gain in dB to apply to the selected replaygain gain.
Default value for replaygain_preamp is 0.0.
eval
Set when the volume expression is evaluated.
It accepts the following values:
once
only evaluate expression once during the filter initialization, or when the volume command is sent
frame
evaluate expression for each incoming frame
Default value is once.
The volume expression can contain the following parameters.
n
frame number (starting at zero)
nb_channels
number of channels
nb_consumed_samples
number of samples consumed by the filter
nb_samples
number of samples in the current frame
pos
original frame position in the file
pts
frame PTS
sample_rate
sample rate
startpts
PTS at start of stream
startt
time at start of stream
t
frame time
tb
timestamp timebase
volume
last set volume value
Note that when eval is set to once only the sample_rate and tb variables are available, all other
variables will evaluate to NAN.
6.69.1 Commands
This filter supports the following commands:
volume
Modify the volume 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.
replaygain_noclip
Prevent clipping by limiting the gain applied.
Default value for replaygain_noclip is 1.
6.69.2 Examples
volume=volume=0.5
volume=volume=1/2
volume=volume=-6.0206dB
In all the above example the named key for volume can be omitted, for example like in:
volume=0.5
volume=volume=6dB:precision=fixed
volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
6.70 volumedetect
Detect the volume of the input video.
The filter has no parameters. The input is not modified. Statistics about the volume will be printed
in the log when the input stream end is reached.
In particular it will show the mean volume (root mean square), maximum volume (on a per-sample
basis), and the beginning of a histogram of the registered volume values (from the maximum
value to a cumulated 1/1000 of the samples).
All volumes are in decibels relative to the maximum PCM value.
6.70.1 Examples
Here is an excerpt of the output:
[Parsed_volumedetect_0 0xa23120] mean_volume: -27 dB
[Parsed_volumedetect_0 0xa23120] max_volume: -4 dB
[Parsed_volumedetect_0 0xa23120] histogram_4db: 6
[Parsed_volumedetect_0 0xa23120] histogram_5db: 62
[Parsed_volumedetect_0 0xa23120] histogram_6db: 286
[Parsed_volumedetect_0 0xa23120] histogram_7db: 1042
[Parsed_volumedetect_0 0xa23120] histogram_8db: 2551
[Parsed_volumedetect_0 0xa23120] histogram_9db: 4609
[Parsed_volumedetect_0 0xa23120] histogram_10db: 8409
It means that:
In other words, raising the volume by +4 dB does not cause any clipping, raising it by +5 dB
causes clipping for 6 samples, etc.
7 Audio Sources
Below is a description of the currently available audio sources.
7.1 abuffer
Buffer audio frames, and make them available to the filter chain.
This source is mainly intended for a programmatic use, in particular through the interface defined
in libavfilter/asrc_abuffer.h.
It accepts the following parameters:
time_base
The timebase which will be used for timestamps of submitted frames. It must be either a floating-point number or in
numerator/denominator form.
sample_rate
The sample rate of the incoming audio buffers.
sample_fmt
The sample format of the incoming audio buffers. Either a sample format name or its corresponding integer representation from the
enum AVSampleFormat in libavutil/samplefmt.h
The channel layout of
libavutil/channel_layout.c
libavutil/channel_layout.h
the
or
channel_layout
incoming audio buffers. Either a channel
its
corresponding
integer
representation
layout
from
in
in
channels
The number of channels of the incoming audio buffers. If both channels and channel_layout are specified, then they must be
consistent.
7.1.1 Examples
abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
will instruct the source to accept planar 16bit signed stereo at 44100Hz. Since the
sample format with name "s16p" corresponds to the number 6 and the "stereo"
channel layout corresponds to the value 0x3, this is equivalent to:
abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
7.2 aevalsrc
Generate an audio signal specified by an expression.
This source accepts in input one or more expressions (one for each channel), which
are evaluated and used to generate a corresponding audio signal.
This source accepts the following options:
exprs
Set the |-separated expressions list for each separate channel. In case the channel_layout option is not specified, the selected
channel layout depends on the number of provided expressions. Otherwise the last specified expression is applied to the remaining
output channels.
channel_layout, c
Set the channel layout. The number of channels in the specified layout must be equal to the number of specified expressions.
duration, d
Set the minimum duration of the sourced audio. See (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual for the
accepted syntax. Note that the resulting duration may be greater than the specified duration, as the generated audio is always cut
at the end of a complete frame.
If not specified, or the expressed duration is negative, the audio is supposed to be generated forever.
nb_samples, n
Set the number of samples per channel per each output frame, default to 1024.
sample_rate, s
Specify the sample rate, default to 44100.
Each expression in exprs can contain the following constants:
n
number of the evaluated sample, starting from 0
t
time of the evaluated sample expressed in seconds, starting from 0
s
sample rate
7.2.1 Examples
Generate silence:
aevalsrc=0
aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC"
aevalsrc="-2+random(0)"
aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)"
7.3 anullsrc
The null audio source, return unprocessed audio frames. It is
mainly useful as a template and to be employed in analysis /
debugging tools, or as the source for filters which ignore the
input data (for example the sox synth filter).
This source accepts the following options:
channel_layout, cl
Specifies the channel layout, and can be either an integer or a string representing a channel layout. The default value of
channel_layout is "stereo".
Check the channel_layout_map definition in libavutil/channel_layout.c for the mapping between strings and channel layout values.
sample_rate, r
Specifies the sample rate, and defaults to 44100.
nb_samples, n
Set the number of samples per requested frames.
7.3.1 Examples
7.4 flite
Synthesize a voice utterance using the libflite library.
To enable compilation of this filter you need to
configure FFmpeg with --enable-libflite.
Note that the flite library is not thread-safe.
The filter accepts the following options:
list_voices
If set to 1, list the names of the available voices and exit immediately. Default value is 0.
nb_samples, n
Set the maximum number of samples per frame. Default value is 512.
textfile
Set the filename containing the text to speak.
text
Set the text to speak.
voice, v
Set the voice to use for the speech synthesis. Default value is kal. See also the list_voices option.
7.4.1 Examples
flite=textfile=speech.txt
flite=text='So
ffmpeg
-f lavfi -i flite=text='So
fare thee well, poor devil of a
Sub-Sub,
whose
commentator I am':voice=slt
7.5 anoisesrc
Generate a noise audio signal.
The filter
options:
accepts
the
following
sample_rate, r
Specify the sample rate. Default value is 48000 Hz.
amplitude, a
Specify the amplitude (0.0 - 1.0) of the generated audio stream. Default value is 1.0.
duration, d
Specify the duration of the generated audio stream. Not specifying this option results in noise with an infinite length.
color, colour, c
Specify the color of noise. Available noise colors are white, pink, and brown. Default color is white.
seed, s
Specify a value used to seed the PRNG.
nb_samples, n
Set the number of samples per each output frame, default is 1024.
7.5.1
Examples
Generate
60
seconds
of
pink
noise,
with
a
44.1 kHz
sampling
rate and
an
amplitude
of 0.5:
anoisesrc=
d=60:c=pi
nk:r=4410
0:a=0.5
7.6 sine
Generate an audio
signal made of a sine
wave with amplitude
1/8.
7.6.
1
Exa
mpl
es
G
e
n
e
r
a
t
e
a
si
m
p
l
e
4
4
0
H
z
si
n
e
w
a
v
e
:
sin
e
G
e
n
e
r
a
t
e
a
2
2
0
H
z
si
n
e
w
a
v
e
w
it
h
a
8
8
0
H
z
b
e
e
p
e
a
c
h
s
e
c
o
n
d
,
f
o
r
5
s
e
c
o
n
d
s
:
sin
e
=
2
2
0
:
4
:
d
=
5
sin
e
=
f
=
2
2
0
:
b
=
4
:
d
=
5
sin
e
=
fr
e
q
u
e
n
c
y
=
2
2
0
:
b
e
e
p
_f
a
c
t
o
r
=
4
:
d
u
r
a
ti
o
n
=
5
G
e
n
e
r
a
t
e
a
1
k
H
z
si
n
e
w
a
v
e
f
o
ll
o
w
i
n
g
1
6
0
2
,
1
6
0
1
,
1
6
0
2
,
1
6
0
1
,
1
6
0
2
N
T
S
C
p
a
tt
e
r
n
:
sin
e
=
1
0
0
0
:s
a
m
pl
e
s
_
p
e
r_
fr
a
m
e
=
's
t(
0
,
m
o
d
(
n
,
5
))
;
1
6
0
2
n
o
t(
n
o
t(
e
q
(l
d
(
0
),
1
)
+
e
q
(l
d
(
0
),
3
))
)'
8
Au
di
o
Si
nk
s
Below
is
a
descri
ption
of the
current
ly
availa
ble
audio
sinks.
8.1
abu
ffer
sin
k
Buffer
audio
frames
, and
make
them
availa
ble to
the
end of
filter
chain.
This
sink is
mainly
intend
ed for
progra
mmati
c use,
in
particu
lar
throug
h the
interfa
ce
define
d
in
libavfil
ter/bu
ffersin
k.h or
the
option
s
system
.
It
accept
s
a
pointer
to an
AVABu
fferSin
kConte
xt
structu
re,
which
define
s the
incomi
ng
buffers
format
s,
to
be
passed
as the
opaqu
e
param
eter to
avfilter
_init_filt
er for
initializ
ation.
8.2
anu
llsi
nk
Null
audio
sink;
do
absolu
tely
nothin
g with
the
input
audio.
It
is
mainly
useful
as
a
templa
te and
for use
in
analysi
s
/
debug
ging
tools.
9
Vi
de
o
Fil
ter
s
When
you
config
ure
your
FFmpe
g
build,
you
can
disable
any of
the
existin
g
filters
using
--disabl
efilters.
The
config
ure
output
will
show
the
video
filters
includ
ed in
your
build.
Below
is
a
descri
ption
of the
current
ly
availa
ble
video
filters.
9.1
alp
hae
xtr
act
Extract
the
alpha
compo
nent
from
the
input
as
a
graysc
ale
video.
This is
especi
ally
useful
with
the
alpha
merge
filter.
9.2
alp
ha
me
rge
Add or
replac
e the
alpha
compo
nent of
the
primar
y input
with
the
graysc
ale
value
of
a
second
input.
This is
intend
ed for
use
with
alphae
xtract
to
allow
the
transm
ission
or
storag
e
of
frame
seque
nces
that
have
alpha
in
a
format
that
doesn
t
suppor
t
an
alpha
chann
el.
For
examp
le, to
recons
truct
full
frames
from a
normal
YUVencod
ed
video
and a
separa
te
video
create
d with
alphae
xtract,
you
might
use:
movie=
in_alph
a.mkv
[alpha];
[in]
[alpha]
alpham
erge
[out]
Since
this
filter is
design
ed for
recons
tructio
n,
it
operat
es on
frame
seque
nces
withou
t
consid
ering
timest
amps,
and
termin
ates
when
either
input
reache
s end
of
stream
. This
will
cause
proble
ms
if
your
encodi
ng
pipelin
e
drops
frames
.
If
youre
trying
to
apply
an
image
as an
overla
y to a
video
stream
,
consid
er the
overla
y filter
instea
d.
9.3
ass
Same
as the
subtitl
es
filter,
except
that it
doesn
t
require
libavco
dec
and
libavfo
rmat
to
work.
On the
other
hand,
it
is
limited
to ASS
(Advan
ced
Substa
tion
Alpha)
subtitl
es
files.
This
filter
accept
s the
followi
ng
option
in
additio
n
to
the
comm
on
option
s from
the
subtitl
es
filter:
shapi
ng
Set the shaping engine
Available values are:
auto
The default libass shaping engine, which is the best available.
simple
Fast, font-agnostic shaper that can do only substitutions
complex
Slower shaper using OpenType for substitutions and positioning
The default is auto.
9.
4
at
a
d
e
n
oi
se
App
ly
an
Ada
ptiv
e
Tem
por
al
Ave
ragi
ng
Den
oise
r to
the
vide
o
inp
ut.
The
filte
r
acc
epts
the
follo
win
g
opti
ons:
0a
Set threshold A for 1st plane. Default is 0.02. Valid range is 0 to 0.3.
0
b
Set threshold B for 1st plane. Default is 0.04. Valid range is 0 to 5.
1
a
Set threshold A for 2nd plane. Default is 0.02. Valid range is 0 to 0.3.
1b
Set threshold B for 2nd plane. Default is 0.04. Valid range is 0 to 5.
2a
Set threshold A for 3rd plane. Default is 0.02. Valid range is 0 to 0.3.
2b
Set threshold B for 3rd plane. Default is 0.04. Valid range is 0 to 5.
Threshold A is designed to react on abrupt changes in the input signal and threshold B is designed to react on continuous changes
in the input signal.
s
Set number of frames filter will use for averaging. Default is 33. Must be odd number in range [5, 129].
p
Set what planes of frame filter will use for averaging. Default is all.
9.5
avgblur
Apply average blur
filter.
The filter accepts
the
following
options:
sizeX
Set horizontal kernel size.
planes
Set which planes to filter. By default all planes are filtered.
sizeY
Set vertical kernel size, if zero it will be same as sizeX. Default is 0.
9.6 bbox
9.7
bitplanenois
The
filter
accept
following options:
bitplane
Set which plane to analyze. Default is 1.
filter
Filter out noisy pixels from bitplane set above. Default is disabled.
9.8 blackdet
accepts
black_min_duration,
Set the minimum detected black duration expressed in seconds. It must be a non-negative floating point number.
Default value is 2.0.
picture_black_ratio_t
Set the threshold for considering a picture "black". Express the minimum value for the ratio:
nb_black_pixels / nb_pixels
pixel_black_th, pix_t
Set the threshold for considering a pixel "black".
The threshold expresses the maximum pixel luminance value for which a pixel is considered "black". The provided value is scaled
according to the following equation:
absolute_threshold = luminance_minimum_value + pixel_black_th * luminance_range_size
luminance_range_size and luminance_minimum_value depend on the input video format, the range is [0-255] for YUV full-range
formats and [16-235] for YUV non full-range formats.
Default value is 0.10.
blackdetect=d=2:pix_th=
9.9 blackfra
9.10 blend,
9.10.1 Example
Apply transition
seconds:
blend=all_expr='A
blend=all_expr='if
blend=all_expr='if
Apply uncover do
blend=all_expr='if
Apply uncover up
blend=all_expr='if
Split diagonally v
side:
blend=all_expr=if(
Display difference
tblend=all_mode=
9.11 boxblur
luma_radius, lr
luma_power, lp
chroma_radius, cr
chroma_power, cp
alpha_radius, ar
alpha_power, ap
A description of the ac
luma_radius, lr
chroma_radius, cr
alpha_radius, ar
Set an expression for the box radius in pixels used for blurring the corresponding input plane.
The radius value must be a non-negative number, and must not be greater than the value of the expression min(w,h)/2 for the luma
and alpha planes, and of min(cw,ch)/2 for the chroma planes.
Default value for luma_radius is "2". If not specified, chroma_radius and alpha_radius default to the corresponding value set for
luma_radius.
The expressions can contain the following constants:
w
h
The input width and height in pixels.
cw
ch
The input chroma image width and height in pixels.
hsub
vsub
The horizontal and vertical chroma subsample values. For example, for the pixel format "yuv422p", hsub is 2 and vsub is 1.
luma_power, lp
chroma_power, cp
alpha_power, ap
Specify how many times the boxblur filter is applied to the corresponding plane.
Default value for luma_power is 2. If not specified, chroma_power and alpha_power default to the corresponding value set for
luma_power.
A value of 0 will disable the effect.
9.11.1 Example
Apply a boxblur fi
boxblur=luma_rad
boxblur=2:1
boxblur=2:1:cr=0:
boxblur=luma_rad
,ch)/10:chroma_po
9.12 bwdif
9.13 chroma
9.13.1 Example
ffmpeg -i input.png
Overlay a greens
ffmpeg -f lavfi
"[1:v]chromakey=0
9.14 ciescop
9.15 codecv
Visualize information e
9.15.1 Example
Visualize forward
Visualize multi-di
9.16 colorba
9.16.1 Example
colorbalance=rs=.
9.17 colorke
9.17.1 Example
ffmpeg -i input.png
Overlay a greens
ffmpeg -i backgrou
9.18 colorlev
9.18.1 Example
colorlevels=rimin=
Increase contrast
colorlevels=rimin=
colorlevels=rimax=
Increase brightne
colorlevels=romin=
9.19 colorch
red=red*rr + blue*rb + g
rg
rb
ra
Adjust contribution of input red, green, blue and alpha channels for output red channel. Default is 1 for rr, and 0 for rg, rb and ra.
gr
gg
gb
ga
Adjust contribution of input red, green, blue and alpha channels for output green channel. Default is 1 for gg, and 0 for gr, gb and
ga.
br
bg
bb
ba
Adjust contribution of input red, green, blue and alpha channels for output blue channel. Default is 1 for bb, and 0 for br, bg and ba.
ar
ag
ab
aa
Adjust contribution of input red, green, blue and alpha channels for output alpha channel. Default is 1 for aa, and 0 for ar, ag and
ab.
Allowed ranges for options are [-2.0, 2.0].
9.19.1 Example
Convert source to
colorchannelmixer
Simulate sepia to
colorchannelmixer
9.20 colorm
Convert color matrix.
colormatrix=bt601:smpt
9.21 colorsp
bt601-6-625
BT.601-6 625
bt709
BT.709
smpte170m
SMPTE-170M
smpte240m
SMPTE-240M
bt2020
BT.2020
space
Specify output colorspace.
The accepted values are:
bt709
BT.709
fcc
FCC
bt470bg
BT.470BG or BT.601-6 625
smpte170m
SMPTE-170M or BT.601-6 525
smpte240m
SMPTE-240M
bt2020ncl
BT.2020 with non-constant luminance
trc
Specify output transfer characteristics.
The accepted values are:
bt709
BT.709
gamma22
Constant gamma of 2.2
gamma28
Constant gamma of 2.8
smpte170m
SMPTE-170M, BT.601-6 625 or BT.601-6 525
smpte240m
SMPTE-240M
bt2020-10
BT.2020 for 10-bits content
bt2020-12
BT.2020 for 12-bits content
primaries
Specify output color primaries.
The accepted values are:
bt709
BT.709
bt470m
BT.470M
bt470bg
BT.470BG or BT.601-6 625
smpte170m
SMPTE-170M or BT.601-6 525
smpte240m
SMPTE-240M
bt2020
BT.2020
range
Specify output color range.
The accepted values are:
mpeg
MPEG (restricted) range
jpeg
JPEG (full) range
format
Specify output color format.
The accepted values are:
yuv420p
YUV 4:2:0 planar 8-bits
yuv420p10
YUV 4:2:0 planar 10-bits
yuv420p12
YUV 4:2:0 planar 12-bits
yuv422p
YUV 4:2:2 planar 8-bits
yuv422p10
YUV 4:2:2 planar 10-bits
yuv422p12
YUV 4:2:2 planar 12-bits
yuv444p
YUV 4:4:4 planar 8-bits
yuv444p10
YUV 4:4:4 planar 10-bits
yuv444p12
YUV 4:4:4 planar 12-bits
fast
Do a fast conversion, which skips gamma/primary correction. This will take significantly less CPU, but will be mathematically
incorrect. To get output compatible with that produced by the colormatrix filter, use fast=1.
dither
Specify dithering mode.
The accepted values are:
none
No dithering
fsb
Floyd-Steinberg dithering
wpadapt
Whitepoint adaptation mode.
The accepted values are:
bradford
Bradford whitepoint adaptation
vonkries
von Kries whitepoint adaptation
identity
identity whitepoint adaptation (i.e. no whitepoint adaptation)
iall
Override all input properties at once. Same accepted values as all.
ispace
Override input colorspace. Same accepted values as space.
iprimaries
Override input color primaries. Same accepted values as primaries.
itrc
Override input transfer characteristics. Same accepted values as trc.
irange
Override input color range. Same accepted values as range.
colorspace=smpte240m
9.22 convolu
Apply convolution 3x3
9.22.1 Example
Apply sharpen:
convolution="0 -1
Apply blur:
convolution="1 1 1
convolution="0 0 0
convolution="0 1 0
Apply emboss:
convolution="-2 -1
9.23 copy
Copy the input source
9.24 coreim
Video filtering on GPU
Hardware acceleration
processing. It depends
There are many filters
filter
Specify all filters by their respective name and options. Use list_filters to determine all valid filter names and options. Numerical
options are specified by a float value and are automatically clamped to their respective value range. Vector and color options have
to be specified by a list of space separated float values. Character escaping has to be done. A special option name default is
available to use default options for a filter.
It is required to specify either default or at least one of the filter options. All omitted options are used with their default values. The
syntax of the filter string is as follows:
filter=<NAME>@<OPTION>=<VALUE>[@<OPTION>=<VALUE>][@...][#<NAME>@<OPTION>=<VALUE>[@<OPTION>=<VALUE>][@...]]
[#...]
output_rect
Specify a rectangle where the output of the filter chain is copied into the input image. It is given by a list of space separated float
values:
output_rect=x\ y\ width\ height
If not given, the output rectangle equals the dimensions of the input image. The output rectangle is automatically cropped at the
borders of the input image. Negative values are valid for each component.
9.24.1 Example
coreimage=list_filt
coreimage=filter=
coreimage=filter=
ffmpeg -f lavfi -i nu
9.25 crop
9.25.1 Example
crop=100:100:12:3
crop=w=100:h=100:x=1
crop=100:100
crop=2/3*in_w:2/3
crop=out_w=in_h
crop=in_h
crop=in_w-100:in_
crop=in_w-2*10:in
crop=in_w/2:in_h/2
crop=in_w:1/PHI*in
Apply trembling e
crop=in_w/2:in_h/2
crop=in_w/2:in_h/2
Set x depending
crop=in_w/2:in_h/2
9.25.2 Comman
9.26 cropde
9.27 curves
By default, a compone
9.27.1 Example
Increase slightly
curves=blue='0/0
Vintage effect:
curves=r='0/0.11
green
(0;0) (0.50;0.48) (1;1)
blue
(0;0.22) (0.49;0.44) (1;0.80)
curves=preset=vin
Or simply:
curves=vintage
Use a Photoshop
curves=psfile='My
ffmpeg -f lavfi -i co
gnuplot -p /tmp/cu
9.28 datasco
9.29 dctdno
9.29.1 Example
dctdnoiz=e='gte(c, 4.5*3
9.30 deband
9.31 decima
Limit the maximum change for each plane, default is 65535. If 0, plane will remain unchanged.
Specify the length of the window over which the judder repeats.
Accepts any integer greater than 1. Useful values are:
4
If the original was telecined from 24 to 30 fps (Film to NTSC).
5
If the original was telecined from 25 to 30 fps (PAL to NTSC).
20
If a mixture of the two.
The default is 4.
Specify the top left corner coordinates of the logo. They must be specified.
Specify the width and height of the logo to clear. They must be specified.
Specify the thickness of the fuzzy edge of the rectangle (added to w and h). The default value is 1. This option is deprecated,
setting higher values should no longer be necessary and is not recommended.
When set to 1, a green rectangle is drawn on the screen to simplify finding the right x, y, w, and h parameters. The default value is
0.
The rectangle is drawn on the outermost pixels which will be (partly) replaced with interpolated values. The values of the next
pixels immediately outside this rectangle in each direction will be used to compute the interpolated pixel values inside the
rectangle.
Set a rectangle covering the area with top left corner coordinates 0,0 and size 100x77, and a band of size 10:
delogo=x=0:y=0:w=100:h=77:band=10
Specify a rectangular area where to limit the search for motion vectors. If desired the search for motion vectors can be limited to a
rectangular area of the frame defined by its top left corner, width and height. These parameters have the same meaning as the
drawbox filter which can be used to visualise the position of the bounding box.
This is useful when simultaneous movement of subjects within the frame might be confused for camera motion by the motion
vector search.
If any or all of x, y, w and h are set to -1 then the full frame is used. This allows later options to be set without specifying the
bounding box for the motion vector search.
Default - search the whole frame.
Specify the maximum extent of movement in x and y directions in the range 0-64 pixels. Default 16.
Specify how to generate pixels to fill blanks at the edge of the frame. Available values are:
blank, 0
Fill zeroes at blank locations
original, 1
Original image at blank locations
clamp, 2
Extruded edge value at blank locations
mirror, 3
Mirrored edge at blank locations
Default value is mirror.
Specify the blocksize to use for motion search. Range 4-128 pixels, default 8.
Specify the contrast threshold for blocks. Only blocks with more than the specified contrast (difference between darkest and
lightest pixels) will be considered. Range 1-255, default 125.
Specify the search strategy. Available values are:
exhaustive, 0
Set exhaustive search
less, 1
Set less exhaustive search.
Default value is exhaustive.
If set then a detailed log of the motion search is written to the specified file.
If set to 1, specify using OpenCL capabilities, only available if FFmpeg was configured with --enable-opencl. Default value is 0.
top, t
top field first
bottom, b
bottom field first The default value is top.
A string of numbers representing the pulldown pattern you wish to apply. The default value is 23.
A number representing position of the first frame with respect to the telecine pattern. This is to be used if the stream is cut. The
default value is 0.
Limit the maximum change for each plane, default is 65535. If 0, plane will remain unchanged.
Flag which specifies the pixel to refer to. Default is 255 i.e. all eight pixels are used.
Flags to local 3x3 coordinates maps like this:
12345678
-i
INPUT
-f
lavfi
-i
nullsrc=s=hd720,lutrgb=128:128:128
-f
lavfi
-i
The expressions which specify the top left corner coordinates of the box. It defaults to 0.
The expressions which specify the width and height of the box; if 0 they are interpreted as the input width and height. It defaults to
0.
Specify the color of the box to write. For the general syntax of this option, check the "Color" section in the ffmpeg-utils manual. If
the special value invert is used, the box edge color is the same as the video with inverted luma.
The expression which sets the thickness of the box edge. Default value is 3.
See below for the list of accepted constants.
horizontal and vertical chroma subsample values. For example for the pixel format "yuv422p" hsub is 2 and vsub is 1.
The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
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 thickness, so image gets framed. Default to 0.
Specify the color of the grid. For the general syntax of this option, check the "Color" section in the ffmpeg-utils manual. If the
special value invert is used, the grid color is the same as the video with inverted luma.
The expression which sets the thickness of the grid line. Default value is 1.
See below for the list of accepted constants.
horizontal and vertical chroma subsample values. For example for the pixel format "yuv422p" hsub is 2 and vsub is 1.
The x and y coordinates of some point of grid intersection (meant to configure offset).
Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
drawgrid=width=100:height=100:thickness=2:[email protected]
Used to draw a box around text using the background color. The value must be either 1 (enable) or 0 (disable). The default value of
box is 0.
Set the width of the border to be drawn around the box using boxcolor. The default value of boxborderw is 0.
The color to be used for drawing box around text. For the syntax of this option, check the "Color" section in the ffmpeg-utils manual.
The default value of boxcolor is "white".
Set the width of the border to be drawn around the text using bordercolor. The default value of borderw is 0.
Set the color to be used for drawing border around text. For the syntax of this option, check the "Color" section in the ffmpeg-utils
manual.
The default value of bordercolor is "black".
Select how the text is expanded. Can be either none, strftime (deprecated) or normal (default). See the Text expansion section below
for details.
If true, check and fix text coords to avoid clipping.
The color to be used for drawing fonts. For the syntax of this option, check the "Color" section in the ffmpeg-utils manual.
The default value of fontcolor is "black".
String which is expanded the same way as text to obtain dynamic fontcolor value. By default this option has empty value and is not
processed. When this option is set, it overrides fontcolor option.
The font family to be used for drawing text. By default Sans.
The font file to be used for drawing text. The path must be included. This parameter is mandatory if the fontconfig support is
disabled.
This option does not exist, please see the timeline system
Draw the text applying alpha blending. The value can be a number between 0.0 and 1.0. The expression accepts the same
variables x, y as well. The default value is 1. Please see fontcolor_expr.
The font size to be used for drawing text. The default value of fontsize is 16.
If set to 1, attempt to shape the text (for example, reverse the order of right-to-left text and join Arabic characters) before drawing
it. Otherwise, just draw the text exactly as given. By default 1 (if supported).
The flags to be used for loading the fonts.
The flags map the corresponding flags supported by libfreetype, and are a combination of the following values:
default
no_scale
no_hinting
render
no_bitmap
vertical_layout
force_autohint
crop_bitmap
pedantic
ignore_global_advance_width
no_recurse
ignore_transform
monochrome
linear_design
no_autohint
Default value is "default".
For more information consult the documentation for the FT_LOAD_* libfreetype flags.
The color to be used for drawing a shadow behind the drawn text. For the syntax of this option, check the "Color" section in the
ffmpeg-utils manual.
The default value of shadowcolor is "black".
The x and y offsets for the text shadow position with respect to the position of the text. They can be either positive or negative
values. The default value for both is "0".
The starting frame number for the n/frame_num variable. The default value is "0".
The size in number of spaces to use for rendering the tab. Default value is 4.
Set the initial timecode representation in "hh:mm:ss[:;.]ff" format. It can be used with or without text parameter. timecode_rate
option must be specified.
Set the timecode frame rate (timecode only).
The text string to be drawn. The text must be a sequence of UTF-8 encoded characters. This parameter is mandatory if no file is
specified with the parameter textfile.
A text file containing text to be drawn. The text must be a sequence of UTF-8 encoded characters.
This parameter is mandatory if no text string is specified with the parameter text.
If both text and textfile are specified, an error is thrown.
If set to 1, the textfile will be reloaded before each frame. Be sure to update it atomically, or it may be read partially, or even fail.
The expressions which specify the offsets where text will be drawn within the video frame. They are relative to the top/left border of
the output image.
The default value of x and y is "0".
See below for the list of accepted constants and functions.
horizontal and vertical chroma subsample values. For example for the pixel format "yuv422p" hsub is 2 and vsub is 1.
the height of each text line
the input height
the input width
the maximum distance from the baseline to the highest/upper grid coordinate used to place a glyph outline point, for all the
rendered glyphs. It is a positive value, due to the grids orientation with the Y axis upwards.
the maximum distance from the baseline to the lowest grid coordinate used to place a glyph outline point, for all the rendered
glyphs. This is a negative value, due to the grids orientation, with the Y axis upwards.
maximum glyph height, that is the maximum height for all the glyphs contained in the rendered text, it is equivalent to ascent descent.
maximum glyph width, that is the maximum width for all the glyphs contained in the rendered text
the number of input frame, starting from 0
return a random number included between min and max
The input sample aspect ratio.
timestamp expressed in seconds, NAN if the input timestamp is unknown
the height of the rendered text
the width of the rendered text
be escaped.
of escaping; using a text file avoids these problems.
Draw "Test Text" with font FreeSerif, using the default values for the optional parameters.
drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
Draw Test Text with font FreeSerif of size 24 at position x=100 and y=50 (counting from the top-left corner of the screen), text is
Show the text at a random position, switching to a new position every 30 seconds:
drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello
world':x=if(eq(mod(t\,30)\,0)\,rand(0\,(w-text_w))\,x):y=if(eq(mod(t\,30)\,0)\,rand(0\,
Show a text line sliding from right to left in the last row of the video frame. The file LONG_LINE is assumed to contain a single line
drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t"
Show the content of file CREDITS off the bottom of the frame and scroll up.
drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t"
Draw a single green letter "g", at the center of the input video. The glyph baseline is placed at half screen height.
drawtext="fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent"
Use fontconfig to set the font. Note that the colons need to be escaped.
drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
Set low and high threshold values used by the Canny thresholding algorithm.
The high threshold selects the "strong" edge pixels, which are then connected through 8-connectivity with the "weak" edge pixels
selected by the low threshold.
low and high threshold values must be chosen in the range [0,1], and low should be lesser or equal to high.
Default value for low is 20/255, and default value for high is 50/255.
Define the drawing mode.
wires
Draw white/gray wires on black background.
colormix
Mix the colors to create a paint/cartoon effect.
Default value is wires.
Standard edge detection with custom values for the hysteresis thresholding:
edgedetect=low=0.1:high=0.4
Set the contrast expression. The value must be a float value in range -2.0 to 2.0. The default value is "1".
Set the brightness expression. The value must be a float value in range -1.0 to 1.0. The default value is "0".
Set the saturation expression. The value must be a float in range 0.0 to 3.0. The default value is "1".
Set the gamma expression. The value must be a float in range 0.1 to 10.0. The default value is "1".
Set the gamma expression for red. The value must be a float in range 0.1 to 10.0. The default value is "1".
Set the gamma expression for green. The value must be a float in range 0.1 to 10.0. The default value is "1".
Set the gamma expression for blue. The value must be a float in range 0.1 to 10.0. The default value is "1".
Set the gamma weight expression. It can be used to reduce the effect of a high gamma value on bright image areas, e.g. keep
them from getting overamplified and just plain white. The value must be a float in range 0.0 to 1.0. A value of 0.0 turns the gamma
correction all the way down while 1.0 leaves it at its full strength. Default is "1".
Set when the expressions for brightness, contrast, saturation and gamma expressions are evaluated.
It accepts the following values:
init
only evaluate expressions once during the filter initialization or when a command is processed
frame
evaluate expressions for each incoming frame
Default value is init.
Limit the maximum change for each plane, default is 65535. If 0, plane will remain unchanged.
Flag which specifies the pixel to refer to. Default is 255 i.e. all eight pixels are used.
Flags to local 3x3 coordinates maps like this:
12345678
Extract luma, u and v color channel component from input video frame into 3 grayscale outputs:
ffmpeg -i video.avi -filter_complex 'extractplanes=y+u+v[y][u][v]' -map '[y]' y.avi -map '[u]' u.avi -map '[v]' v.avi
Set codebook length. The value must be a positive integer, and represents the number of distinct output colors. Default value is
256.
Set the maximum number of iterations to apply for computing the optimal mapping. The higher the value the better the result and
the higher the computation time. Default value is 1.
Set a random seed, must be an integer included between 0 and UINT32_MAX. If not specified, or if explicitly set to -1, the filter will
try to use a good random seed on a best effort basis.
Set pal8 output pixel format. This option does not work with codebook length greater than 256.
The effect type can be either "in" for a fade-in, or "out" for a fade-out effect. Default is in.
Specify the number of the frame to start applying the fade effect at. Default is 0.
The number of frames that the fade effect lasts. At the end of the fade-in effect, the output video will have the same intensity as
the input video. At the end of the fade-out transition, the output video will be filled with the selected color. Default is 25.
If set to 1, fade only alpha channel, if one exists on the input. Default value is 0.
Specify the timestamp (in seconds) of the frame to start to apply the fade effect. If both start_frame and start_time are specified,
the fade will start at whichever comes last. Default is 0.
The number of seconds for which the fade effect has to last. At the end of the fade-in effect the output video will have the same
intensity as the input video, at the end of the fade-out transition the output video will be filled with the selected color. If both
duration and nb_frames are specified, duration is used. Default is 0 (nb_frames is used by default).
Specify the color of the fade. Default is "black".
Fade in the first 25 frames and fade out the last 25 frames of a 1000-frame video:
fade=in:0:25, fade=out:975:25
Make the first 5 frames yellow, then fade in from frame 5-24:
fade=in:5:20:color=yellow
Make the first 5.5 seconds black, then fade in for 0.5 seconds:
fade=t=in:st=5.5:d=0.5
Adjust the dc value (gain) of the luma plane of the image. The filter accepts an integer value in range 0 to 1000. The default value is
set to 0.
Adjust the dc value (gain) of the 1st chroma plane of the image. The filter accepts an integer value in range 0 to 1000. The default
value is set to 0.
Adjust the dc value (gain) of the 2nd chroma plane of the image. The filter accepts an integer value in range 0 to 1000. The default
value is set to 0.
Set the frequency domain weight expression for the luma plane.
Set the frequency domain weight expression for the 1st chroma plane.
Set the frequency domain weight expression for the 2nd chroma plane.
The filter accepts the following variables:
High-pass:
fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)'
Low-pass:
fftfilt=dc_Y=0:weight_Y='squish((Y+X)/100-1)'
Sharpen:
fftfilt=dc_Y=0:weight_Y='1+squish(1-(Y+X)/100)'
Blur:
fftfilt=dc_Y=0:weight_Y='exp(-4 * ((Y+X)/(W+H)))'
avoid wasting CPU time. The output frames are marked as non-interlaced.
Specify whether to extract the top (if the value is 0 or top) or the bottom field (if the value is 1 or bottom).
bottom field
tom field
truct the progressive frames from a telecined stream. The filter does not drop duplicated frames, so to achieve a complete inverse telecine fieldmatch needs to be
ph.
ably motivated by the possibility of inserting a de-interlacing filter fallback between the two. If the source has mixed telecined and real interlaced content, fieldmatch
se remaining combed frames will be marked as interlaced, and thus can be de-interlaced by a later filter such as yadif before decimation.
take an optional second stream, activated through the ppsrc option. If enabled, the frames reconstruction will be based on the fields and frames from this second
er to help the various algorithms of the filter, while keeping the output lossless (assuming the fields are matched properly). Typically, a field-aware denoiser, or
AviSynth project) and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from which fieldmatch is based on. While the semantic and usage are very
e input. If your input has mixed telecined (30fps) and progressive content with a lower framerate like 24fps use the following filterchain to produce the necessary cfr
Specify the assumed field order of the input stream. Available values are:
auto
Auto detect parity (use FFmpegs internal parity value).
bff
Assume bottom field first.
tff
Assume top field first.
Note that it is sometimes recommended not to trust the parity announced by the stream.
Default value is auto.
Set the matching mode or strategy to use. pc mode is the safest in the sense that it wont risk creating jerkiness due to duplicate
frames when possible, but if there are bad edits or blended fields it will end up outputting combed frames when a good match
might actually exist. On the other hand, pcn_ub mode is the most risky in terms of creating jerkiness, but will almost always find a
good frame if there is one. The other values are all somewhere in between pc and pcn_ub in terms of risking jerkiness and creating
duplicate frames versus finding good matches in sections with bad edits, orphaned fields, blended fields, etc.
More details about p/c/n/u/b are available in p/c/n/u/b meaning section.
Available values are:
pc
2-way matching (p/c)
pc_n
2-way matching, and trying 3rd match if still combed (p/c + n)
pc_u
2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
pc_n_ub
2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if still combed (p/c + n + u/b)
pcn
3-way matching (p/c/n)
pcn_ub
3-way matching, and trying 4th/5th matches if all 3 of the original matches are detected as combed (p/c/n + u/b)
The parenthesis at the end indicate the matches that would be used for that mode assuming order=tf (and field
on auto or top).
In terms of speed pc mode is by far the fastest and pcn_ub is the slowest.
Default value is pc_n.
meaning
Mark the main input stream as a pre-processed input, and enable the secondary input stream as the clean source to pick the fields
from. See the filter introduction for more details. It is similar to the clip2 feature from VFM/TFM.
Default value is 0 (disabled).
Set the field to match from. It is recommended to set this to the same value as order unless you experience matching failures with
that setting. In certain circumstances changing the field that is used to match from can have a large impact on matching
performance. Available values are:
auto
Automatic (same value as order).
bottom
Match from the bottom field.
top
Match from the top field.
Default value is auto.
Set whether or not chroma is included during the match comparisons. In most cases it is recommended to leave this enabled. You
should set this to 0 only if your clip has bad chroma problems such as heavy rainbowing or other artifacts. Setting this to 0 could
also be used to speed things up at the cost of some accuracy.
Default value is 1.
These define an exclusion band which excludes the lines between y0 and y1 from being included in the field matching decision. An
exclusion band can be used to ignore subtitles, a logo, or other things that may interfere with the matching. y0 sets the starting
scan line and y1 sets the ending line; all lines in between y0 and y1 (including y0 and y1) will be ignored. Setting y0 and y1 to the
same value will disable the feature. y0 and y1 defaults to 0.
Set the scene change detection threshold as a percentage of maximum change on the luma plane. Good values are in the [8.0,
14.0] range. Scene change detection is only relevant in case combmatch=sc. The range for scthresh is [0.0, 100.0].
Default value is 12.0.
When combatch is not none, fieldmatch will take into account the combed scores of matches when deciding what match to use as
the final match. Available values are:
none
No final matching based on combed scores.
sc
Combed scores are only used when a scene change is detected.
full
Use combed scores all the time.
Default is sc.
Force fieldmatch to calculate the combed metrics for certain matches and print them. This setting is known as micout in TFM/VFM
vocabulary. Available values are:
none
No forced calculation.
pcn
Force p/c/n calculations.
pcnub
Force p/c/n/u/b calculations.
Default value is none.
This is the area combing threshold used for combed frame detection. This essentially controls how "strong" or "visible" combing
must be to be detected. Larger values mean combing must be more visible and smaller values mean combing can be less visible or
strong and still be detected. Valid settings are from -1 (every pixel will be detected as combed) to 255 (no pixel will be detected as
combed). This is basically a pixel difference value. A good range is [8, 12].
Default value is 9.
Sets whether or not chroma is considered in the combed frame decision. Only disable this if your source has chroma problems
(rainbowing, etc.) that are causing problems for the combed frame detection with chroma enabled. Actually, using chroma=0 is
usually more reliable, except for the case where there is chroma only combing in the source.
Default value is 0.
Respectively set the x-axis and y-axis size of the window used during combed frame detection. This has to do with the size of the
area in which combpel pixels are required to be detected as combed for a frame to be declared combed. See the combpel
parameter description for more info. Possible values are any number that is a power of 2 starting at 4 and going up to 512.
Default value is 16.
The number of combed pixels inside any of the blocky by blockx size blocks on the frame for the frame to be detected as combed.
While cthresh controls how "visible" the combing must be, this setting controls "how much" combing there must be in any localized
area (a window defined by the blockx and blocky settings) on the frame. Minimum value is 0 and maximum is blocky x blockx (at
which point no frames will ever be detected as combed). This setting is known as MI in TFM/VFM vocabulary.
Default value is 80.
elecined stream:
o the progressive frame the fields relate to. Here, the first two frames are progressive, the 3rd and 4th are combed, and so on.
red to run a matching from bottom (field=bottom) this is how this input stream get transformed:
matching reference
atching, we can see that some frames get duplicated. To perform a complete inverse telecine, you need to rely on a decimation filter after this operation. See for
er.
matching reference
n see what p, c and n mean; basically, they refer to the frame and field of the opposite parity:
p matches the field of the opposite parity in the previous frame
c matches the field of the opposite parity in the current frame
n matches the field of the opposite parity in the next frame
a bit special in the sense that they match from the opposite parity flag. In the following examples, we assume that we are currently matching the 2nd frame (Top:2,
e match, a x is placed above and below each matched fields.
ld=bottom):
n
x
122
x
122
123
122
123
top):
n
123
122
122
123
122
123
123
match=none, decimate
er
rameters:
The output field order. Valid values are tf for top field first or bf for bottom field first.
done by shifting the picture content up or down by one line, and filling the remaining line with appropriate picture content. This method is consistent with most
onverters.
flagged as being interlaced, or it is already flagged as being of the required output field order, then this filter does not alter the incoming video.
order=bff" out.dv
fo
eters.
ct
ct
options:
Filepath of the object image, needs to be in gray8.
Detection threshold, default is 0.5.
Number of mipmaps, default is 3.
xmax, ymax
Specifies the rectangle in which to search.
xamples
over_rect
tangular object
he following options:
Filepath of the optional cover image, needs to be in yuv420.
Set covering mode.
It accepts the following values:
cover
cover it by the supplied image
blur
cover it by interpolating the surrounding pixels
Default value is blur.
5.1 Examples
6 format
rt the input video to one of the specified pixel formats. Libavfilter will try to pick one that is suitable as input to the next filter.
mts
A |-separated list of pixel format names, such as "pix_fmts=yuv420p|monow|rgb24".
56.1 Examples
format=pix_fmts=yuv420p
.57 fps
nvert the video to specified constant frame rate by duplicating or dropping frames as necessary.
s
The desired output frame rate. The default is 25.
round
Rounding method.
Possible values are:
zero
zero round towards 0
inf
round away from 0
down
round towards -infinity
up
round towards +infinity
near
round to nearest
The default is near.
start_time
Assume the first PTS should be the given value, in seconds. This allows for padding/trimming at the start of stream. By default, no
assumption is made about the first frames expected PTS, so no padding or trimming is done. For example, this could be set to 0 to
pad the beginning with duplicates of the first frame if a video stream starts after the audio stream or to trim any frames with a
negative PTS.
Alternatively, the options can be specified as a flat string: fps[:round].
See also the setpts filter.
9.57.1 Examples
fps=fps=25
Sets the fps to 24, using abbreviation and rounding method to round to nearest:
fps=fps=film:round=near
9.58 framepack
Pack two different video streams into a stereoscopic video, setting proper metadata on supported codecs. The two views should have the same size and
framerate and processing will stop when the shorter video ends. Please note that you may conveniently adjust view properties with the scale and fps filters.
It accepts the following parameters:
format
The desired packing format. Supported values are:
sbs
The views are next to each other (default).
tab
The views are on top of each other.
lines
The views are packed by line.
columns
The views are packed by column.
frameseq
The views are temporally interleaved.
Some examples:
# Convert left and right views into a frame-sequential video
ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
# Convert views into a side-by-side video with the same output resolution as the input
ffmpeg -i LEFT -i RIGHT -filter_complex [0:v]scale=w=iw/2[left],[1:v]scale=w=iw/2[right],[left][right]framepack=sbs OUTPUT
9.59 framerate
Change the frame rate by interpolating new video output frames from the source frames.
This filter is not designed to function correctly with interlaced media. If you wish to change the frame rate of interlaced media then you are required to
deinterlace before this filter and re-interlace after this filter.
A description of the accepted options follows.
fps
Specify the output frames per second. This option can also be specified as a value alone. The default is 50.
interp_start
Specify the start of a range where the output frame will be created as a linear interpolation of two frames. The range is [ 0-255], the
default is 15.
interp_end
Specify the end of a range where the output frame will be created as a linear interpolation of two frames. The range is [ 0-255], the
default is 240.
scene
Specify the level at which a scene change is detected as a value between 0 and 100 to indicate a new scene; a low value reflects a
low probability for the current frame to introduce a new scene, while a higher value means the current frame is more likely to be
one. The default is 7.
flags
Specify flags influencing the filter process.
Available value for flags is:
scene_change_detect, scd
Enable scene change detection using the value of the option scene. This flag is enabled by default.
9.60 framestep
Select one frame every N-th frame.
This filter accepts the following option:
step
Select frame after every step frames. Allowed values are positive integers higher than 0. Default value is 1.
9.61 frei0r
Apply a frei0r effect to the input video.
To enable the compilation of this filter, you need to install the frei0r header and configure FFmpeg with --enable-frei0r.
It accepts the following parameters:
filter_name
The name of the frei0r effect to load. If the environment variable FREI0R_PATH is defined, the frei0r effect is searched for in each of
the directories specified by the colon-separated list in FREIOR_PATH. Otherwise, the standard frei0r paths are searched, in this order:
HOME/.frei0r-1/lib/, /usr/local/lib/frei0r-1/, /usr/lib/frei0r-1/.
filter_params
A |-separated list of parameters to pass to the frei0r effect.
A frei0r effect parameter can be a boolean (its value is either "y" or "n"), a double, a color (specified as R/G/B, where R, G, and B are
floating point numbers between 0.0 and 1.0, inclusive) or by a color description specified in the "Color" section in the ffmpeg-utils
manual), a position (specified as X/Y, where X and Y are floating point numbers) and/or a string.
The number and types of parameters depend on the loaded effect. If an effect parameter is not specified, the default value is set.
9.61.1 Examples
Apply the distort0r effect, setting the first two double parameters:
frei0r=filter_name=distort0r:filter_params=0.5|0.01
frei0r=colordistance:0.2/0.3/0.4
frei0r=colordistance:violet
frei0r=colordistance:0x112233
Apply the perspective effect, specifying the top left and top right image positions:
frei0r=perspective:0.2/0.2|0.8/0.2
9.62 fspp
Apply fast and simple postprocessing. It is a faster version of spp.
It splits (I)DCT into horizontal/vertical passes. Unlike the simple post- processing filter, one of them is performed once per block, not
per pixel. This allows for much higher speed.
The filter accepts the following options:
quality
Set quality. This option defines the number of levels for averaging. It accepts an integer in the range 4-5. Default value is 4.
qp
Force a constant quantization parameter. It accepts an integer in range 0-63. If not set, the filter will use the QP from the video
stream (if available).
strength
Set filter strength. It accepts an integer in range -15 to 32. Lower values mean more details but also more artifacts, while higher
values make the image smoother but also blurrier. Default value is 0 PSNR optimal.
use_bframe_qp
Enable the use of the QP from the B-Frames if set to 1. Using this option may cause flicker since the B-Frames have often larger QP.
Default is 0 (not enabled).
9.63 gblur
Apply Gaussian blur filter.
The filter accepts the following options:
sigma
Set horizontal sigma, standard deviation of Gaussian blur. Default is 0.5.
steps
Set number of steps for Gaussian approximation. Defauls is 1.
planes
Set which planes to filter. By default all planes are filtered.
sigmaV
Set vertical sigma, if negative it will be same as sigma. Default is -1.
9.64 geq
The filter accepts the following options:
lum_expr, lum
Set the luminance expression.
cb_expr, cb
Set the chrominance blue expression.
cr_expr, cr
Set the chrominance red expression.
alpha_expr, a
Set the alpha expression.
red_expr, r
Set the red expression.
green_expr, g
Set the green expression.
blue_expr, b
Set the blue expression.
The colorspace is selected according to the specified options. If one of the lum_expr,
cb_expr, or cr_expr options is specified, the filter will automatically select a YCbCr
colorspace. If one of the red_expr, green_expr, or blue_expr options is specified, it will
select an RGB colorspace.
If one of the chrominance expression is not defined, it falls back on the other one. If no
alpha expression is specified it will evaluate to opaque value. If none of chrominance
expressions are specified, they will evaluate to the luminance expression.
The expressions can use the following variables and functions:
N
The sequential number of the filtered frame, starting from 0.
X
Y
The coordinates of the current sample.
W
H
The width and height of the image.
SW
SH
Width and height scale depending on the currently filtered plane. It is the ratio between the corresponding luma plane number of
pixels and the current plane ones. E.g. for YUV4:2:0 the values are 1,1 for the luma plane, and 0.5,0.5 for chroma planes.
T
Time of the current frame, expressed in seconds.
p(x, y)
Return the value of the pixel at location (x,y) of the current plane.
lum(x, y)
Return the value of the pixel at location (x,y) of the luminance plane.
cb(x, y)
Return the value of the pixel at location (x,y) of the blue-difference chroma plane. Return 0 if there is no such plane.
cr(x, y)
Return the value of the pixel at location (x,y) of the red-difference chroma plane. Return 0 if there is no such plane.
r(x, y)
g(x, y)
b(x, y)
Return the value of the pixel at location (x,y) of the red/green/blue component. Return 0 if there is no such component.
alpha(x, y)
Return the value of the pixel at location (x,y) of the alpha plane. Return 0 if there is no such plane.
For functions, if x and y are outside the area, the value will
be automatically clipped to the closer edge.
9.64.1 Examples
geq=p(W-X\,Y)
9.65 gradfun
Fix the banding artifacts that are sometimes introduced
into nearly flat regions by truncation to 8-bit color depth.
Interpolate the gradients that should go where the bands
are, and dither them.
It is designed for playback only. Do not use it prior to lossy
compression, because compression tends to lose the dither
and bring back the bands.
It accepts the following parameters:
strength
The maximum amount by which the filter will change any one pixel. This is also the threshold for detecting nearly flat regions.
Acceptable values range from .51 to 64; the default value is 1.2. Out-of-range values will be clipped to the valid range.
radius
The neighborhood to fit the gradient to. A larger radius makes for smoother gradients, but also prevents the filter from modifying
the pixels near detailed regions. Acceptable values are 8-32; the default value is 16. Out-of-range values will be clipped to the valid
range.
Alternatively, the options can be specified as a flat
string: strength[:radius]
9.65.1 Examples
9.66 haldclut
Apply a Hald CLUT to a video stream.
First input is the video stream to process, and second
one is the Hald CLUT. The Hald CLUT input can be a
simple picture or a complete video stream.
The filter accepts the following options:
shortest
Force termination when the shortest input terminates. Default is 0.
repeatlast
Continue applying the last CLUT after the end of the stream. A value of 0 disable the filter after the last frame of the CLUT is
reached. Default is 1.
haldclut also has the same interpolation options
as lut3d (both filters share the same internals).
-vf
overlay=W-320:h,
9.67 hflip
Flip the input video horizontally.
For example, to horizontally flip the input video
with ffmpeg:
ffmpeg -i in.avi -vf "hflip" out.avi
9.68 histeq
This filter applies a global color histogram
equalization on a per-frame basis.
It can be used to correct video that has a
compressed range of pixel intensities. The filter
redistributes the pixel intensities to equalize
their distribution across the intensity range. It
9.69 histogram
Compute and draw a color distribution
histogram for the input video.
The
computed
histogram
is
a
representation of the color component
distribution in an image.
Standard histogram displays the color
components distribution in an image.
Displays color graph for each color
component. Shows distribution of the Y,
U, V, A or R, G, B components,
depending on input format, in the
current frame. Below each graph a
color component scale meter is shown.
The filter accepts the following options:
level_height
Set height of level. Default value is 200. Allowed range is [50, 2048].
scale_height
Set height of color scale. Default value is 12. Allowed range is [0, 40].
display_mode
Set display mode. It accepts the following values:
parade
Per color component graphs are placed below each other.
overlay
Presents information identical to that in the parade, except that the graphs representing color components are superimposed
directly over one another.
Default is parade.
levels_mode
Set mode. Can be either linear, or logarithmic. Default is linear.
components
Set what color components to display. Default is 7.
fgopacity
Set foreground opacity. Default is 0.7.
bgopacity
Set background opacity. Default is 0.5.
9.69.1
Examples
Calculat
e
and
draw
histogra
m:
ffplay -i
input -vf
histogra
m
9.70
hqdn3d
This is a high
precision/quality 3d
denoise filter. It
aims
to
reduce
image
noise,
producing smooth
images and making
still images really
still.
It
should
enhance
compressibility.
It
accepts
the
following optional
parameters:
luma_spatial
A non-negative floating point number which specifies spatial luma strength. It defaults to 4.0.
chroma_spatial
A non-negative floating point number which specifies spatial chroma strength. It defaults to 3.0*luma_spatial/4.0.
luma_tmp
A floating point number which specifies luma temporal strength. It defaults to 6.0*luma_spatial/4.0.
chroma_t
mp
A floating point number which specifies chroma temporal strength. It defaults to luma_tmp*chroma_spatial/luma_spatial.
9.71
hwu
ploa
d_cu
da
Upload
system
memory
frames
to
a
CUDA
device.
It
accepts
the
followin
g
optional
paramet
ers:
device
The number of the CUDA device to use
9.
72
hq
x
Apply
a
highqualit
y
mag
nifica
tion
filter
desig
ned
for
pixel
art.
This
filter
was
origi
nally
creat
ed by
Maxi
m
Stepi
n.
It
acce
pts
the
follo
wing
optio
n:
n
Set the scaling dimension: 2 for hq2x, 3 for hq3x and 4 for hq4x. Default is 3.
9
.
7
3
h
s
t
a
c
k
St
ac
k
in
pu
t
vi
de
os
ho
riz
on
tal
ly.
All
str
ea
m
s
m
us
t
be
of
sa
m
e
pi
xe
l
for
m
at
an
d
of
sa
m
e
he
ig
ht.
No
te
th
at
thi
s
filt
er
is
fa
st
er
th
an
us
in
g
ov
erl
ay
an
d
pa
d
filt
er
to
cr
ea
te
sa
m
e
ou
tp
ut.
Th
e
filt
er
ac
ce
pt
th
e
fol
lo
wi
ng
op
tio
n:
in
p
ut
s
Set number of input streams. Default is 2.
s
h
o
r
t
e
s
t
If set to 1, force the output to terminate when the shortest input terminates. Default value is 0.
9.
7
4
h
u
e
Mo
dif
y
the
hu
e
an
d/o
r
the
sat
ura
tio
n
of
the
inp
ut.
It
acc
ept
s
the
foll
owi
ng
par
am
ete
rs:
h
Specify the hue angle as a number of degrees. It accepts an expression, and defaults to "0".
s
Specify the saturation in the [-10,10] range. It accepts an expression and defaults to "1".
H
Specify the hue angle as a number of radians. It accepts an expression, and defaults to "0".
b
Specify the brightness in the [-10,10] range. It accepts an expression and defaults to "0".
h and H are
mutually
exclusive, and
cant
be
specified
at
the same time.
The b, h, H
and s option
values
are
expressions
containing the
following
constants:
n
frame count of the input frame starting from 0
pts
presentation timestamp of the input frame expressed in time base units
r
frame rate of the input video, NAN if the input frame rate is unknown
t
timestamp expressed in seconds, NAN if the input timestamp is unknown
tb
time base of the input video
9.74.1 Example
Same
comm
expressing
the
radians:
hue=H=PI/2:s=1
Apply a 3 second
fade-in effect sta
hue="s=min(t/3\,1
hue="s=min(0\, max((t1))"
Apply a 3 second
fade-out effect s
seconds:
hue="s=max(0\,
t)/3))"
hue="s=max(0\,
(START+DURATION-t)/DU
9.74.2 Comman
9.75 hystere
9.76 idet
single.current_frame
Detected type of current frame using single-frame detection. One of: tff (top field first), bff (bottom field first), progressive, or
undetermined
single.tff
Cumulative number of frames detected as top field first using single-frame detection.
multiple.tff
Cumulative number of frames detected as top field first using multiple-frame detection.
single.bff
Cumulative number of frames detected as bottom field first using single-frame detection.
multiple.current_fra
Detected type of current frame using multiple-frame detection. One of: tff (top field first), bff (bottom field first), progressive,
or undetermined
multiple.bff
Cumulative number of frames detected as bottom field first using multiple-frame detection.
single.progressive
Cumulative number of frames detected as progressive using single-frame detection.
multiple.progressive
Cumulative number of frames detected as progressive using multiple-frame detection.
single.undetermined
Cumulative number of frames that could not be classified using single-frame detection.
multiple.undetermin
Cumulative number of frames that could not be classified using multiple-frame detection.
repeated.current_fra
Which field in the current frame is repeated from the last. One of neither, top, or bottom.
repeated.neither
Cumulative number of frames with no repeated field.
repeated.top
Cumulative number of frames with the top field repeated from the previous frames top field.
repeated.bottom
Cumulative number of frames with the bottom field repeated from the previous frames bottom field.
analyze_interlaced_fl
When this is not 0 then idet will use the specified number of frames to determine if the interlaced flag is accurate, it will not count
undetermined frames. If the flag is found to be accurate it will be used without any further computations, if it is found to be
inaccurate it will be cleared without any further computations. This allows inserting the idet filter as a low computational method to
clean up the interlaced flag
9.77 il
Deinterleave or interle
9.78 inflate
9.79 interlac
Original
Frame 'j'
Frame 'j+1
==========
==
Line 0 -------------------->
Line 1
Line 1 ---
Line 2 --------------------Line 3
...
Line 3 --...
9.80 kernde
9.80.1 Example
kerndeint=thresh=
Enable additional
kerndeint=sharp=
Paint processed p
kerndeint=map=1
9.81 lenscor
9.81.1 Options
9.82 loop
Loop video frames.
9.83 lut3d
Apply a 3D LUT to an in
9.84.1 Example
lutrgb="r=maxval+
lutyuv="y=maxva
lutrgb="r=negval:g=neg
lutyuv="y=negval:u=ne
Negate luminanc
lutyuv=y=negval
Remove chroma c
lutyuv="u=128:v=
lutyuv="y=2*val"
Remove green an
lutrgb="g=0:b=0"
format=rgba,lutrgb
Correct luminanc
lutyuv=y=gamma
lutyuv=y='bitand(
Technicolor like e
lutyuv=u='(val-ma
9.85 lut2
9.85.1 Example
Highlight differen
lut2='ifnot(x-y,0,po
Highlight differen
lut2='ifnot(x-y,0,po
9.86 masked
9.87 masked
9.88 mcdein
Apply motion-compens
9.89 mergep
9.89.1 Example
[a0][a1][a2]merge
[a0][a1]mergeplan
format=yuva444p,
format=yuv420p,m
format=rgb24,mer
9.90 mestim
9.91 minterp
9.92 mpdeci
A description of the ac
max
Set the maximum number of consecutive frames which can be dropped (if positive), or the minimum interval between dropped
frames (if negative). If the value is 0, the frame is dropped unregarding the number of previous sequentially dropped frames.
Default value is 0.
hi
lo
frac
Set the dropping threshold values.
Values for hi and 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 hi, and if no more than frac blocks (1
meaning the whole image) differ by more than a threshold of lo.
Default value for hi is 64*12, default value for lo is 64*5, and default value for frac is 0.33.
9.93 negate
Negate input video.
It accepts an integer in
9.94 nlmean
9.95 nnedi
9.96 noform
Force libavfilter not to
9.96.1 Example
Force libavfilter to
noformat=pix_fmts
noformat=yuv420p
9.97 noise
all_seed
c0_seed
c1_seed
c2_seed
c3_seed
Set noise seed for specific pixel component or all pixel components in case of all_seed. Default value is 123457.
all_strength, alls
c0_strength, c0s
c1_strength, c1s
c2_strength, c2s
c3_strength, c3s
Set noise strength for specific pixel component or all pixel components in case all_strength. Default value is 0. Allowed range is [0,
100].
all_flags, allf
c0_flags, c0f
c1_flags, c1f
c2_flags, c2f
c3_flags, c3f
Set pixel component flags or set flags for all components if all_flags. Available values for component flags are:
a
averaged temporal noise (smoother)
p
mix random noise with a (semi)regular pattern
t
temporal noise (noise pattern changes between frames)
u
uniform noise (gaussian otherwise)
9.97.1 Example
9.98 null
9.99 ocr
9.100 ocv
9.100.1 dilate
struct_el represents a s
ocv=filter_name=dilate:
ocv=dilate:0x0+2x2/cus
9.100.2 erode
9.100.3 smooth
9.101 overla
A description of the ac
x
y
Set the expression for the x and y coordinates of the overlaid video on the main video. Default value is "0" for both expressions. In
case the expression is invalid, it is set to a huge value (meaning that the overlay will not be displayed within the output visible
area).
eof_action
The action to take when EOF is encountered on the secondary input; it accepts one of the following values:
repeat
Repeat the last frame (the default).
endall
End both streams.
pass
Pass the main input through.
eval
Set when the expressions for x, and y are evaluated.
It accepts the following values:
init
only evaluate expressions once during the filter initialization or when a command is processed
frame
evaluate expressions for each incoming frame
Default value is frame.
shortest
If set to 1, force the output to terminate when the shortest input terminates. Default value is 0.
Set the format for the output video.
It accepts the following values:
yuv420
force YUV420 output
yuv422
force YUV422 output
yuv444
force YUV444 output
rgb
force RGB output
Default value is yuv420.
If set to 1, force the filter to accept inputs in the RGB color space. Default value is 0. This option is deprecated, use format instead.
If set to 1, force the filter to draw the last overlay frame over the main input until the end of the stream. A value of 0 disables this
behavior. Default value is 1.
The computed values for x and y. They are evaluated for each new frame.
horizontal and vertical chroma subsample values of the output format. For example for the pixel format "yuv422p" hsub is 2 and
vsub is 1.
the number of input frame, starting from 0
the position in the file of the input frame, NAN if unknown
The timestamp, expressed in seconds. Its NAN if the input timestamp is unknown.
Modify the x and y of the overlay input. The command accepts the same syntax of the corresponding option.
If the specified expression is not valid, it is kept at its current value.
Draw the overlay at 10 pixels from the bottom right corner of the main video:
overlay=main_w-overlay_w-10:main_h-overlay_h-10
Insert a transparent PNG logo in the bottom left corner of the input, using the ffmpeg tool with the -filter_complex option:
ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
Insert 2 different transparent PNG logos (second logo on bottom right corner) using the ffmpeg tool:
ffmpeg -i input -i logo1 -i logo2 -filter_complex 'overlay=x=10:y=H-h-10,overlay=x=W-w-10:y=H-h-10' output
Add a transparent color layer on top of the main video; WxH must specify the size of the main input to the overlay filter:
[email protected]:size=WxH [over]; [in][over] overlay [out]
Play an original video and a filtered version (here with the deshake filter) side by side using the ffplay tool:
ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
Make a sliding overlay appearing from the left to the right top part of the screen starting since time 2:
overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
overlay=shortest=1
[background+left];
'[in]split[split_main][split_delogo];[split_delogo]trim=start=360:end=371,delogo=0:0:640:480[delogoed];[split_main]
masked.avi
[mid0];
Set depth.
Larger depth values will denoise lower frequency components more, but slow down filtering.
Must be an int in the range 8-16, default is 8.
Set luma strength.
Must be a double value in the range 0-1000, default is 1.0.
Set chroma strength.
Must be a double value in the range 0-1000, default is 1.0.
Specify an expression for the size of the output image with the paddings added. If the value for width or height is 0, the
corresponding input size is used for the output.
The width expression can reference the value set by the height expression, and vice versa.
The default value of width and height is 0.
Specify the offsets to place the input image at within the padded area, with respect to the top/left border of the output image.
The x expression can reference the value set by the y expression, and vice versa.
The default value of x and y is 0.
Specify the color of the padded area. For the syntax of this option, check the "Color" section in the ffmpeg-utils manual.
The default value of color is "black".
The output width and height (the size of the padded area), as specified by the width and height expressions.
The x and y offsets as specified by the x and y expressions, or NAN if not yet specified.
same as iw / ih
input sample aspect ratio
input display aspect ratio, it is the same as (iw / ih) * sar
The horizontal and vertical chroma subsample values. For example for the pixel format "yuv422p" hsub is 2 and vsub is 1.
Add paddings with the color "violet" to the input video. The output video size is 640x480, and the top-left corner of the input video
pad=640:480:0:40:violet
Pad the input to get an output with dimensions increased by 3/2, and put the input video at the center of the padded area:
pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
Pad the input to get a squared output with size equal to the maximum value between the input width and height, and put the input
pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
In case of anamorphic video, in order to set the output display aspect correctly, it is necessary to use sar in the expression,
Double the output size and put the input video in the bottom-right corner of the output padded area:
pad="2*iw:2*ih:ow-iw:oh-ih"
Set the maximum number of colors to quantize in the palette. Note: the palette will still contain 256 colors; the unused palette
entries will be black.
Create a palette of 255 colors maximum and reserve the last one for transparency. Reserving the transparency color is useful for
GIF optimization. If not set, the maximum of colors in the palette will be 256. You probably want to disable this option for a
standalone image. Set by default.
Set statistics mode.
It accepts the following values:
full
Compute full frame histograms.
diff
Compute histograms only for the part that differs from previous frame. This might be relevant to give more importance to the
moving part of your input if the background is static.
single
Compute new histogram for each frame.
Default value is full.
Use a palette (generated for example with palettegen) to encode a GIF using ffmpeg:
ffmpeg -i input.mkv -i palette.png -lavfi paletteuse output.gif
Set coordinates expression for top left, top right, bottom left and bottom right corners. Default values are 0:0:W:0:0:H:W:H with
which perspective will remain unchanged. If the sense option is set to source, then the specified points will be sent to the corners of
the destination. If the sense option is set to destination, then the corners of the source will be sent to the specified coordinates.
The expressions can use the following variables:
W
H
the width and height of video frame.
in
Input frame count.
on
Output frame count.
Set interpolation for perspective correction.
It accepts the following values:
linear
cubic
Default value is linear.
Set interpretation of coordinate options.
It accepts the following values:
0, source
Send point in the source specified by the given coordinates to the corners of the destination.
1, destination
Send the corners of the source to the point in the destination specified by the given coordinates.
Default value is source.
Set when the expressions for coordinates x0,y0,...x3,y3 are evaluated.
It accepts the following values:
init
only evaluate expressions once during the filter initialization or when a command is processed
frame
evaluate expressions for each incoming frame
Default value is init.
Apply deblocking on luminance only, and switch vertical deblocking on or off automatically depending on available CPU time:
pp=hb|y/vb|a
Force a constant quantization parameter. It accepts an integer in range 0 to 63. If not set, the filter will use the QP from the video
stream (if available).
Set thresholding mode. Available modes are:
hard
Set hard thresholding.
soft
Set soft thresholding (better de-ringing effect, but likely blurrier).
medium
Set medium thresholding (good results, default).
Set which planes will be processed, unprocessed planes will be copied. By default value 0xf, all planes will be processed.
Set value which will be multiplied with filtered result.
Set value which will be added to filtered result.
If specified the filter will use the named file to save the PSNR of each individual frame. When filename equals "-" the data is sent to
standard output.
Specifies which version of the stats file format to use. Details of each format are written below. Default value is 1.
Determines whether the max value is output to the stats log. Default value is 0. Requires stats_version >= 2. If this is set and
stats_version < 2, the filter will return an error.
d progressive frames.
These options set the amount of "junk" to ignore at the left, right, top, and bottom of the image, respectively. Left and right are in
units of 8 pixels, while top and bottom are in units of 2 lines. The default is 8 pixels on each side.
Set the strict breaks. Setting this option to 1 will reduce the chances of filter generating an occasional mismatched frame, but it
may also cause an excessive number of frames to be dropped during high motion sequences. Conversely, setting it to -1 will make
filter match fields more easily. This may help processing of video where there is slight blurring between the fields, but may also
cause there to be interlaced frames in the output. Default value is 0.
Set the metric plane to use. It accepts the following values:
l
Use luma plane.
u
Use chroma blue plane.
v
Use chroma red plane.
This option may be set to use chroma plane instead of the default luma plane for doing filters computations. This may
improve accuracy on very clean source material, but more likely will decrease accuracy, especially if there is chroma noise
(rainbow effect) or any grayscale video. The main purpose of setting mp to a chroma plane is to reduce CPU load and make
pullup usable in realtime on slow machines.
Set size in number of frames of internal cache, in range from 2 to 512. Default is 30.
Set seed for random number generator, must be an integer included between 0 and UINT32_MAX. If not specified, or if explicitly set
to less than 0, the filter will try to use a good random seed on a best effort basis.
Set the maximum number of lines to scan for VITC data. If the value is set to -1 the full video frame is scanned. Default is 45.
Set the luma threshold for black. Accepts float numbers in the range [0.0,1.0], default value is 0.2. The value must be equal or less
than thr_w.
Set the luma threshold for white. Accepts float numbers in the range [0.0,1.0], default value is 0.6. The value must be equal or
greater than thr_b.
Detect and draw VITC data onto the video frame; if no valid VITC is detected, draw --:--:--:-- as a placeholder:
ffmpeg
-i
input.avi
-filter:v
'readvitc,drawtext=fontfile=FreeMono.ttf:text=%{metadata\\:lavfi.readvitc.tc_str\\:--\\\\\\:--\\\\\\:--\\\\\\:--}:x=(w-
Clips the pixel with the second minimum and maximum of the 8 neighbour pixels.
Clips the pixel with the third minimum and maximum of the 8 neighbour pixels.
Clips the pixel with the fourth minimum and maximum of the 8 neighbour pixels. This is equivalent to a median filter.
Line-sensitive clipping giving the minimal change.
Line-sensitive clipping, intermediate.
Line-sensitive clipping, intermediate.
Line-sensitive clipping, intermediate.
Line-sensitive clipping on a line where the neighbours pixels are the closest.
Replaces the target pixel with the closest neighbour.
[1 2 1] horizontal and vertical kernel blur.
Same as mode 11.
Bob mode, interpolates top field from the line where the neighbours pixels are the closest.
Bob mode, interpolates bottom field from the line where the neighbours pixels are the closest.
Bob mode, interpolates top field. Same as 13 but with a more complicated interpolation formula.
Bob mode, interpolates bottom field. Same as 14 but with a more complicated interpolation formula.
Clips the pixel with the minimum and maximum of respectively the maximum and minimum of each pair of opposite neighbour
pixels.
Line-sensitive clipping using opposite neighbours whose greatest distance from the current pixel is minimal.
Replaces the pixel with the average of its 8 neighbours.
Averages the 9 pixels ([1 1 1] horizontal and vertical blur).
Clips pixels using the averages of opposite neighbour.
Same as mode 21 but simpler and faster.
Small edge and halo removal, but reputed useless.
Similar as 23.
Set the filter bitmap file, which can be any image format supported by libavformat. The width and height of the image file must
match those of the video stream being processed.
go. If you use white (255) for the logo and black (0) for the rest, you will be safe. For making the filter bitmap, it is recommended to take a screen capture of a black
arking too many pixels as part of the logo does not hurt as much, but it will increase the amount of blurring needed to cover over the image and will destroy more
Set an expression for the angle by which to rotate the input video clockwise, expressed as a number of radians. A negative value
will result in a counter-clockwise rotation. By default it is set to "0".
This expression is evaluated for each frame.
Set the output width expression, default value is "iw". This expression is evaluated just once during configuration.
Set the output height expression, default value is "ih". This expression is evaluated just once during configuration.
Enable bilinear interpolation if set to 1, a value of 0 disables it. Default value is 1.
Set the color used to fill the output area not covered by the rotated image. For the general syntax of this option, check the "Color"
section in the ffmpeg-utils manual. If the special value "none" is selected then no background is printed (useful for example if the
background is never shown).
Default value is "black".
sequential number of the input frame, starting from 0. It is always NAN before the first frame is filtered.
time in seconds of the input frame, it is set to 0 when the filter is configured. It is always NAN before the first frame is filtered.
horizontal and vertical chroma subsample values. For example for the pixel format "yuv422p" hsub is 2 and vsub is 1.
the output width and height, that is the size of the padded area as specified by the width and height expressions
the minimal width/height required for completely containing the input video rotated by a radians.
These are only available when computing the out_w and out_h expressions.
rotate=PI/3+2*PI*t/T
Make the input video rotation oscillating with a period of T seconds and an amplitude of A radians:
rotate=A*sin(2*PI/T*t)
Rotate the video, output size is chosen so that the whole rotating input video is always completely contained in the output:
rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
Rotate the video, reduce the output size so that no background is ever shown:
rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
Set the angle 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.
Set luma blur filter strength, must be a value in range 0.1-4.0, default value is 1.0. A greater value will result in a more blurred
image, and in slower processing.
Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default value is 1.0.
Set luma maximum difference between pixels to still be considered, must be a value in the 0.1-100.0 range, default value is 1.0.
Set chroma blur filter strength, must be a value in range -0.9-4.0. A greater value will result in a more blurred image, and in slower
processing.
Set chroma pre-filter radius, must be a value in the -0.9-2.0 range.
Set chroma maximum difference between pixels to still be considered, must be a value in the -0.9-100.0 range.
ption value.
le scaler.
Set the output video dimension expression. Default value is the input dimension.
If the value is 0, the input width is used for the output.
If one of the values is -1, the scale filter will use a value that maintains the aspect ratio of the input image, calculated from the
other specified dimension. If both of them are -1, the input size is used
If one of the values is -n with n > 1, the scale filter will also use a value that maintains the aspect ratio of the input image,
calculated from the other specified dimension. After that it will, however, make sure that the calculated dimension is divisible by n
and adjust the value if necessary.
See below for the list of accepted constants for use in the dimension expression.
Specify when to evaluate width and height expression. It accepts the following values:
init
Only evaluate expressions once during the filter initialization or when a command is processed.
frame
Evaluate expressions for each incoming frame.
Default value is init.
Set the interlacing mode. It accepts the following values:
1
Force interlaced aware scaling.
0
Do not apply interlaced scaling.
-1
Select interlaced aware scaling depending on whether the source frames are flagged as interlaced or not.
Default value is 0.
Set libswscale scaling flags. See (ffmpeg-scaler)the ffmpeg-scaler manual for the complete list of values. If not explicitly specified
the filter applies the default flags.
Set libswscale input parameters for scaling algorithms that need them. See (ffmpeg-scaler)the ffmpeg-scaler manual for the
complete documentation. If not explicitly specified the filter applies empty parameters.
Set the video size. For the syntax of this option, check the (ffmpeg-utils)"Video size" section in the ffmpeg-utils manual.
smpte240m
Set color space conforming to SMPTE ST 240:1999.
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 w or h, you still need to specify the output resolution for this
option to work.
horizontal and vertical output chroma subsample values. For example for the pixel format "yuv422p" hsub is 2 and vsub is 1.
n as:
Increase the width, and set the height to the same size:
scale=3/2*iw:ow
Increase the height, and set the width to 3/2 of the height:
scale=w=3/2*oh:h=3/5*ih
Increase the size, making the size a multiple of the chroma subsample values:
scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
Increase the width to a maximum of 500 pixels, keeping the same aspect ratio as the input:
scale=w='min(500\, iw*3/2):h=-1'
mmands:
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.
mitives (libnpp) to perform scaling and/or pixel format conversion on CUDA video frames. Setting the output width and height works in the same way as for the scale
are accepted:
The pixel format of the output CUDA frames. If set to the string "same" (the default), the input format will be kept. Note that
automatic format negotiation and conversion is not yet supported for hardware frames
The interpolation algorithm used for resizing. One of the following:
nn
Nearest neighbour.
linear
cubic
cubic2p_bspline
2-parameter cubic (B=1, C=0)
cubic2p_catmullrom
2-parameter cubic (B=0, C=1/2)
cubic2p_b05c03
2-parameter cubic (B=1/2, C=3/10)
super
Supersampling
lanczos
ef
able options, scale2ref supports the same but uses the reference video instead of the main input as basis.
Scale a subtitle stream to match the main video in size before overlaying
'scale2ref[b][a];[a][b]overlay'
ecolor
ow and black (CMYK) to certain ranges of colors (such as "reds", "yellows", "greens", "cyans", ...). The adjustment range is defined by the "purity" of the color (that is,
.
wing options:
Select color correction method.
Available values are:
absolute
Specified adjustments are applied "as-is" (added/subtracted to original pixel component value).
relative
Specified adjustments are relative to the original component value.
Default is absolute.
Adjustments for red pixels (pixels where the red component is the maximum)
Adjustments for yellow pixels (pixels where the blue component is the minimum)
Adjustments for green pixels (pixels where the green component is the maximum)
Adjustments for cyan pixels (pixels where the red component is the minimum)
Adjustments for blue pixels (pixels where the blue component is the maximum)
s
Adjustments for magenta pixels (pixels where the green component is the minimum)
Adjustments for white pixels (pixels where all components are greater than 128)
trals
Adjustments for all pixels except pure black and pure white
lacks
Adjustments for black pixels (pixels where all components are lesser than 128)
psfile
Specify a Photoshop selective color file (.asv) to import the settings from.
All the adjustment settings (reds, yellows, ...) accept up to 4 space separated floating point adjustment values in the [-1,1] range, respectively to adjust the
amount of cyan, magenta, yellow and black for the pixels of its range.
9.127.1 Examples
Increase cyan by 50% and reduce yellow by 33% in every green areas, and increase magenta by 27% in blue areas:
selectivecolor=psfile=MySelectiveColorPresets/Misty.asv
9.128 separatefields
The separatefields takes a frame-based video input and splits each frame into its components fields, producing a new half height clip with twice the frame rate
and twice the frame count.
This filter use field-dominance information in frame to decide which of each pair of fields to place first in the output. If it gets it wrong use setfield filter before
separatefields filter.
Keep in mind that the setdar filter does not modify the pixel dimensions of the video frame. Also, the display aspect ratio set by this filter may be changed by
later filters in the filterchain, e.g. in case of scaling or if another "setdar" or a "setsar" filter is applied.
The setsar filter sets the Sample (aka Pixel) Aspect Ratio for the filter output video.
Note that as a consequence of the application of this filter, the output display aspect ratio will change according to the equation above.
Keep in mind that the sample aspect ratio set by the setsar filter may be changed by later filters in the filterchain, e.g. if another "setsar" or a "setdar" filter is
applied.
It accepts the following parameters:
r, ratio, dar (setdar only), sar (setsar only)
Set the aspect ratio used by the filter.
The parameter can be a floating point number string, an expression, or a string of the form num:den, where num and den are the
numerator and denominator of the aspect ratio. If the parameter is not specified, it is assumed the value "0". In case the form
"num:den" is used, the : character should be escaped.
max
Set the maximum integer value to use for expressing numerator and denominator when reducing the expressed aspect ratio to a
rational. Default value is 100.
The parameter sar is an expression containing the following constants:
E, PI, PHI
These are approximated values for the mathematical constants e (Eulers number), pi (Greek pi), and phi (the golden ratio).
w, h
The input width and height.
a
These are the same as w / h.
sar
The input sample aspect ratio.
dar
The input display aspect ratio. It is the same as (w / h) * sar.
hsub, vsub
Horizontal and vertical chroma subsample values. For example, for the pixel format "yuv422p" hsub is 2 and vsub is 1.
9.129.1 Examples
To change the display aspect ratio to 16:9, specify one of the following:
setdar=dar=1.77777
setdar=dar=16/9
To set a display aspect ratio of 16:9, and specify a maximum integer value of 1000 in the aspect ratio reduction, use the
command:
setdar=ratio=16/9:max=1000
9.130 setfield
Force field for the output video frame.
The setfield filter marks the interlace type field for the output frames. It does not change the input frame, but only sets the corresponding
property, which affects how the frame is treated by following filters (e.g. fieldorder or yadif).
The filter accepts the following options:
mode
Available values are:
auto
Keep the same field property.
bff
Mark the frame as bottom-field-first.
tff
Mark the frame as top-field-first.
prog
Mark the frame as progressive.
9.131 showinfo
Show a line containing various information for each input video frame. The input video is not modified.
The shown line contains a sequence of key/value pairs of the form key:value.
The following values are shown in the output:
n
The (sequential) number of the input frame, starting from 0.
pts
The Presentation TimeStamp of the input frame, expressed as a number of time base units. The time base unit depends on the filter
input pad.
pts_time
The Presentation TimeStamp of the input frame, expressed as a number of seconds.
pos
The position of the frame in the input stream, or -1 if this information is unavailable and/or meaningless (for example in case of
synthetic video).
fmt
The pixel format name.
sar
The sample aspect ratio of the input frame, expressed in the form num/den.
s
The size of the input frame. For the syntax of this option, check the (ffmpeg-utils)"Video size" section in the ffmpeg-utils manual.
i
The type of interlaced mode ("P" for "progressive", "T" for top field first, "B" for bottom field first).
iskey
This is 1 if the frame is a key frame, 0 otherwise.
type
The picture type of the input frame ("I" for an I-frame, "P" for a P-frame, "B" for a B-frame, or "?" for an unknown type). Also refer to
the documentation of the AVPictureType enum and of the av_get_picture_type_char function defined in libavutil/avutil.h.
checksum
The Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame.
plane_checksum
The Adler-32 checksum (printed in hexadecimal) of each plane of the input frame, expressed in the form "[c0 c1 c2 c3]".
9.132 showpalette
Displays the 256 colors palette of each frame. This filter is only relevant for pal8 pixel format frames.
It accepts the following option:
s
Set the size of the box used to represent one palette color entry. Default is 30 (for a 30x30 pixel box).
9.133 shuffleframes
Reorder and/or duplicate video frames.
It accepts the following parameters:
mapping
Set the destination indexes of input frames. This is space or | separated list of indexes that maps input frames to output frames.
Number of indexes also sets maximal value that each index may have.
The first frame has the index 0. The default is to keep the input unchanged.
9.133.1 Examples
Swap second and third frame of every three frames of the input:
ffmpeg -i INPUT -vf "shuffleframes=0 2 1" OUTPUT
Swap 10th and 1st frame of every ten frames of the input:
ffmpeg -i INPUT -vf "shuffleframes=9 1 2 3 4 5 6 7 8 0" OUTPUT
9.134 shuffleplanes
Reorder and/or duplicate video planes.
It accepts the following parameters:
map0
The index of the input plane to be used as the first output plane.
map1
The index of the input plane to be used as the second output plane.
map2
The index of the input plane to be used as the third output plane.
map3
The index of the input plane to be used as the fourth output plane.
The first plane has the index 0. The default is to keep the input unchanged.
9.134.1 Examples
9.135 signalstats
Evaluate various visual metrics that assist in determining issues associated with the
digitization of analog video media.
By default the filter will log these metadata values:
YMIN
Display the minimal Y value contained within the input frame. Expressed in range of [0-255].
YLOW
Display the Y value at the 10% percentile within the input frame. Expressed in range of [0-255].
YAVG
Display the average Y value within the input frame. Expressed in range of [0-255].
YHIGH
Display the Y value at the 90% percentile within the input frame. Expressed in range of [0-255].
YMAX
Display the maximum Y value contained within the input frame. Expressed in range of [0-255].
UMIN
Display the minimal U value contained within the input frame. Expressed in range of [0-255].
ULOW
Display the U value at the 10% percentile within the input frame. Expressed in range of [0-255].
UAVG
Display the average U value within the input frame. Expressed in range of [0-255].
UHIGH
Display the U value at the 90% percentile within the input frame. Expressed in range of [0-255].
UMAX
Display the maximum U value contained within the input frame. Expressed in range of [0-255].
VMIN
Display the minimal V value contained within the input frame. Expressed in range of [0-255].
VLOW
Display the V value at the 10% percentile within the input frame. Expressed in range of [0-255].
VAVG
Display the average V value within the input frame. Expressed in range of [0-255].
VHIGH
Display the V value at the 90% percentile within the input frame. Expressed in range of [0-255].
VMAX
Display the maximum V value contained within the input frame. Expressed in range of [0-255].
SATMIN
Display the minimal saturation value contained within the input frame. Expressed in range of [0-~181.02].
SATLOW
Display the saturation value at the 10% percentile within the input frame. Expressed in range of [0-~181.02].
SATAVG
Display the average saturation value within the input frame. Expressed in range of [0-~181.02].
SATHIGH
Display the saturation value at the 90% percentile within the input frame. Expressed in range of [0-~181.02].
SATMAX
Display the maximum saturation value contained within the input frame. Expressed in range of [0-~181.02].
HUEMED
Display the median value for hue within the input frame. Expressed in range of [0-360].
HUEAVG
Display the average value for hue within the input frame. Expressed in range of [0-360].
YDIF
Display the average of sample value difference between all values of the Y plane in the current frame and corresponding values of
the previous input frame. Expressed in range of [0-255].
UDIF
Display the average of sample value difference between all values of the U plane in the current frame and corresponding values of
the previous input frame. Expressed in range of [0-255].
VDIF
Display the average of sample value difference between all values of the V plane in the current frame and corresponding values of
the previous input frame. Expressed in range of [0-255].
YBITDEPTH
Display bit depth of Y plane in current frame. Expressed in range of [0-16].
UBITDEP
TH
Display bit depth of U plane in current frame. Expressed in range of [0-16].
VBITD
EPTH
Display bit depth of V plane in current frame. Expressed in range of [0-16].
The
filte
r
acc
ept
s
the
foll
owi
ng
opti
ons
:
sta
t
out
stat specify an additional form of image analysis. out output video with the specified type of pixel highlighted.
Both options accept the following values:
tout
Identify temporal outliers pixels. A temporal outlier is a pixel unlike the neighboring pixels of the same field. Examples of temporal
outliers include the results of video dropouts, head clogs, or tape tracking issues.
vrep
Identify vertical line repetition. Vertical line repetition includes similar rows of pixels within a frame. In born-digital video vertical
line repetition is common, but this pattern is uncommon in video digitized from an analog source. When it occurs in video that
results from the digitization of an analog source it can indicate concealment from a dropout compensator.
brng
Identify pixels that fall outside of legal broadcast range.
c
o
l
o
r
,
c
Set the highlight color for the out option. The default color is yellow.
9
.
1
3
5
.
1
E
x
a
m
p
l
e
s
O
ut
p
ut
d
at
a
of
v
ar
io
us
vi
d
e
o
m
et
ri
cs
:
ff
pr
ob
e
-f
la
vfi
m
ov
ie
=
ex
a
m
pl
e.
m
ov
,si
g
na
lst
at
s
=
"s
ta
t=
to
ut
+
vr
ep
+
br
n
g"
-s
ho
w
_fr
a
m
es
O
ut
p
ut
sp
ec
ifi
c
d
at
a
a
b
o
ut
th
e
m
in
i
m
u
m
a
n
d
m
a
xi
m
u
m
v
al
u
es
of
th
e
Y
pl
a
n
e
p
er
fr
a
m
e:
ff
pr
ob
e
-f
la
vfi
m
ov
ie
=
ex
a
m
pl
e.
m
ov
,si
g
na
lst
at
s
-s
ho
w
_e
nt
ri
es
fr
a
m
e_
ta
gs
=l
av
fi.
si
g
na
lst
at
s.
Y
M
A
X,
la
vfi
.si
g
na
lst
at
s.
Y
MI
N
Pl
a
y
b
ac
k
vi
d
e
o
w
hi
le
hi
g
hl
ig
ht
in
g
pi
x
el
s
th
at
ar
e
o
ut
si
d
e
of
br
o
a
d
ca
st
ra
n
g
e
in
re
d.
ff
pl
ay
ex
a
m
pl
e.
m
ov
-v
f
si
g
na
lst
at
s
=
"o
ut
=
br
n
g:
co
lo
r=
re
d"
Pl
a
y
b
ac
k
vi
d
e
o
wi
th
si
g
n
al
st
at
s
m
et
a
d
at
a
dr
a
w
n
o
v
er
th
e
fr
a
m
e.
ff
pl
ay
ex
a
m
pl
e.
m
ov
-v
f
si
g
na
lst
at
s
=
st
at
=
br
n
g
+
vr
ep
+t
ou
t,
dr
a
wt
ex
t=
fo
nt
fil
e
=
Fr
ee
Se
rif
.tt
f:t
ex
tfi
le
=
si
g
na
lst
at
_d
ra
wt
ex
t.t
xt
The contents
of
signalstat_dr
awtext.txt
used in the
command
are:
time
{pts:hms}
Y
(%
{metadata:la
vfi.signalstats.
YMIN}-%
{metadata:la
vfi.signalstats.
YMAX})
U
(%
{metadata:la
vfi.signalstats.
UMIN}-%
{metadata:la
vfi.signalstats.
UMAX})
V
(%
{metadata:la
vfi.signalstats.
VMIN}-%
{metadata:la
vfi.signalstats.
VMAX})
saturation
maximum: %
{metadata:la
vfi.signalstats.
SATMAX}
9
.
1
3
6
s
m
a
r
t
b
l
u
r
Bl
ur
th
e
in
p
ut
vi
d
e
o
wi
th
o
ut
i
m
p
ac
ti
n
g
th
e
o
ut
li
n
es
.
It
ac
ce
pt
s
th
e
fo
llo
wi
n
g
o
pt
io
ns
:
lu
m
a
_r
a
di
u
s,
lr
Set the luma radius. The option value must be a float number in the range [0.1,5.0] that specifies the variance of the gaussian filter
used to blur the image (slower if larger). Default value is 1.0.
lum
a_st
reng
th,
ls
Set the luma strength. The option value must be a float number in the range [-1.0,1.0] that configures the blurring. A value
included in [0.0,1.0] will blur the image whereas a value included in [-1.0,0.0] will sharpen the image. Default value is 1.0.
luma_t
hresho
ld, lt
Set the luma threshold used as a coefficient to determine whether a pixel should be blurred or not. The option value must be an
integer in the range [-30,30]. A value of 0 will filter all the image, a value included in [0,30] will filter flat areas and a value included
in [-30,0] will filter edges. Default value is 0.
chroma_r
adius, cr
Set the chroma radius. The option value must be a float number in the range [0.1,5.0] that specifies the variance of the gaussian
filter used to blur the image (slower if larger). Default value is 1.0.
chroma_str
ength, cs
Set the chroma strength. The option value must be a float number in the range [-1.0,1.0] that configures the blurring. A value
included in [0.0,1.0] will blur the image whereas a value included in [-1.0,0.0] will sharpen the image. Default value is 1.0.
chroma_thres
hold, ct
Set the chroma threshold used as a coefficient to determine whether a pixel should be blurred or not. The option value must be an
integer in the range [-30,30]. A value of 0 will filter all the image, a value included in [0,30] will filter flat areas and a value included
in [-30,0] will filter edges. Default value is 0.
If a chroma option
is not explicitly set,
the corresponding
luma value is set.
9.137
ssim
Obtain the SSIM
(Structural
SImilarity
Metric)
A description of each
shown
parameter
follows:
n
sequential number of the input frame, starting from 1
Y, U, V, R, G, B
SSIM of the compared frames for the component specified by the suffix.
All
SSIM of the compared frames for the whole frame.
dB
Same as above but in dB representation.
For example:
movie=ref_movie.mpg,
STARTPTS [main];
[main][ref]
ssim="stats_file=stats.lo
ffmpeg -i main.mpg -i re
"ssim;[0:v][1:v]psnr" -f n
9.138 stereo
Convert
between
stereoscopic image for
arbg
anaglyph red/blue gray (red filter on left eye, blue filter on right eye)
argg
anaglyph red/green gray (red filter on left eye, green filter on right eye)
arcg
anaglyph red/cyan gray (red filter on left eye, cyan filter on right eye)
arch
anaglyph red/cyan half colored (red filter on left eye, cyan filter on right eye)
arcc
anaglyph red/cyan color (red filter on left eye, cyan filter on right eye)
arcd
anaglyph red/cyan color optimized with the least squares projection of dubois (red filter on left eye, cyan filter on right eye)
agmg
anaglyph green/magenta gray (green filter on left eye, magenta filter on right eye)
agmh
anaglyph green/magenta half colored (green filter on left eye, magenta filter on right eye)
agmc
anaglyph green/magenta colored (green filter on left eye, magenta filter on right eye)
agmd
anaglyph green/magenta color optimized with the least squares projection of dubois (green filter on left eye, magenta filter on right
eye)
aybg
anaglyph yellow/blue gray (yellow filter on left eye, blue filter on right eye)
aybh
anaglyph yellow/blue half colored (yellow filter on left eye, blue filter on right eye)
aybc
anaglyph yellow/blue colored (yellow filter on left eye, blue filter on right eye)
aybd
anaglyph yellow/blue color optimized with the least squares projection of dubois (yellow filter on left eye, blue filter on right eye)
ml
mono output (left eye only)
mr
mono output (right eye only)
chl
checkerboard, left eye first
chr
checkerboard, right eye first
icl
interleaved columns, left eye first
icr
interleaved columns, right eye first
hdmi
HDMI frame pack
Default value is arcd.
9.138.1 Exampl
stereo3d=sbsl:ayb
stereo3d=abl:sbsr
9.139 stream
astreamsele
inputs
Set number of inputs. Default is 2.
map
Set input indexes to remap to outputs.
9.139.1 Comma
9.139.2 Exampl
Select first 5 se
time 2nd stream:
sendcmd='5.0
1',streamselect=in
Same as above, b
asendcmd='5.0
1',astreamselect=i
9.140 sobel
9.141 spp
9.142 subtit
To enable compilation
with --enable-libass. Th
and libavformat to c
(Advanced Substation
The filter accepts the f
filename, f
force_style
Override default style or script info parameters of the subtitles. It accepts a string containing ASS style format KEY=VALUE couples
separated by ",".
If the first key is not
filename.
subtitles=filename=sub.
subtitles=video.mkv:si=
subtitles=sub.srt:force_s
9.143 super
9.144 swapr
dar
input display aspect ratio, it is the same as (w / h) * sar
n
The number of the input frame, starting from 0.
t
The timestamp expressed in seconds. Its NAN if the input timestamp is unknown.
pos
the position in the file of the input frame, NAN if unknown
9.145 swapu
Swap U & V plane.
9.146 telecin
9.147 thumb
n
Set the frames batch size to analyze; in a set of n frames, the filter will pick one of them, and then handle the next batch of n
frames until the end. Default is 100.
Since the filter keeps t
not recommended.
9.147.1 Exampl
thumbnail=50
Complete examp
9.148 tile
9.148.1 Exampl
ffmpeg -skip_frame
Display 5 pictures
tile=3x2:nb_frame
9.149 tinter
Perform various types
Frame 2
Frame 3
Frame 4
11111
22222
33333
44444
11111
22222
33333
44444
11111
22222
33333
44444
11111
22222
33333
44444
Output:
11111
33333
22222
44444
11111
33333
22222
44444
11111
33333
22222
44444
11111
33333
22222
44444
drop_even, 1
Only output odd frames, even frames are dropped, generating a frame with unchanged height at half frame rate.
------> time
Input:
Frame 1
Frame 2
Frame 3
Frame 4
11111
22222
33333
44444
11111
22222
33333
44444
11111
22222
33333
44444
11111
22222
33333
44444
Output:
11111
33333
11111
33333
11111
33333
11111
33333
drop_odd, 2
Only output even frames, odd frames are dropped, generating a frame with unchanged height at half frame rate.
------> time
Input:
Frame 1
Frame 2
Frame 3
Frame 4
11111
22222
33333
44444
11111
22222
33333
44444
11111
22222
33333
44444
11111
22222
33333
44444
Output:
22222
44444
22222
44444
22222
44444
22222
44444
pad, 3
Expand each frame to full height, but pad alternate lines with black, generating a frame with double height at the same input frame
rate.
------> time
Input:
Frame 1
Frame 2
Frame 3
Frame 4
11111
22222
33333
44444
11111
22222
33333
44444
11111
22222
33333
44444
11111
22222
33333
44444
Output:
11111
.....
.....
22222
11111
.....
.....
22222
11111
.....
.....
22222
11111
.....
.....
22222
33333
.....
33333
.....
33333
.....
33333
.....
.....
44444
.....
44444
.....
44444
.....
44444
interleave_top, 4
Interleave the upper field from odd frames with the lower field from even frames, generating a frame with unchanged height at half
frame rate.
------> time
Input:
Frame 1
11111<11111
11111<11111
Frame 2
Frame 3
22222
33333<-
22222<22222
22222<-
33333
33333<33333
Frame 4
44444
44444<44444
44444<-
Output:
11111
33333
22222
44444
11111
33333
22222
44444
interleave_bottom, 5
Interleave the lower field from odd frames with the upper field from even frames, generating a frame with unchanged height at half
frame rate.
------> time
Input:
Frame 1
Frame 2
Frame 3
Frame 4
11111
22222<-
33333
44444<-
11111<11111
11111<-
22222
22222<22222
33333<33333
33333<-
44444
44444<44444
Output:
22222
44444
11111
33333
22222
44444
11111
33333
interlacex2, 6
Double frame rate with unchanged height. Frames are inserted each containing the second temporal field from the previous input
frame and the first temporal field from the next input frame. This mode relies on the top_field_first flag. Useful for interlaced video
displays with no field synchronisation.
------> time
Input:
Frame 1
Frame 2
11111
22222
11111
11111
11111
22222
22222
22222
Frame 3
33333
33333
33333
33333
Frame 4
44444
44444
44444
44444
Output:
11111 22222 22222 33333 33333 44444 44444
11111 11111 22222 22222 33333 33333 44444
11111 22222 22222 33333 33333 44444 44444
11111 11111 22222 22222 33333 33333 44444
mergex2, 7
Move odd frames into the upper field, even into the lower field, generating a double height frame at same frame rate.
------> time
Input:
Frame 1
Frame 2
Frame 3
Frame 4
11111
22222
33333
44444
11111
22222
33333
44444
11111
22222
33333
44444
11111
22222
33333
44444
11111
33333
33333
55555
22222
22222
44444
44444
11111
33333
33333
55555
22222
22222
44444
44444
11111
33333
33333
55555
22222
22222
44444
44444
11111
33333
33333
55555
22222
22222
44444
44444
Output:
Numeric values are deprecated but are accepted for backward compatibility reasons.
Default mode is merge.
flags
Specify flags influencing the filter process.
Available value for flags is:
low_pass_filter, vlfp
Enable vertical low-pass filtering in the filter. Vertical low-pass filtering is required when creating an interlaced destination from a
progressive source which contains high-frequency vertical detail. Filtering will reduce interlace twitter and Moire patterning.
Vertical low-pass filtering can only be enabled for mode interleave_top and interleave_bottom.
9.150 transp
L.l
. . -> . .
l.r
R.r
1, 5, clock
Rotate by 90 degrees clockwise, that is:
L.R
l.L
. . -> . .
l.r
r.R
2, 6, cclock
Rotate by 90 degrees counterclockwise, that is:
L.R
R.r
. . -> . .
l.r
L.l
3, 7, clock_flip
Rotate by 90 degrees clockwise and vertically flip, that is:
L.R
r.R
. . -> . .
l.r
l.L
For values between 4-7, the transposition is only done if the input video geometry is portrait and not landscape. These
values are deprecated, the passthrough option should be used instead.
Numerical values are deprecated, and should be dropped in favor of symbolic constants.
passthrough
Do not apply the transposition if the input geometry matches the one specified by the specified value. It accepts the following
values:
none
Always apply transposition.
portrait
Preserve portrait geometry (when height >= width).
landscape
Preserve landscape geometry (when width >= height).
Default value is none.
transpose=dir=1:passth
9.151 trim
Drop everything e
9.152 unsha
chroma_msize_x, cx
Set the chroma matrix horizontal size. It must be an odd integer between 3 and 23. The default value is 5.
chroma_msize_y, cy
Set the chroma matrix vertical size. It must be an odd integer between 3 and 23. The default value is 5.
chroma_amount, ca
Set the chroma effect strength. It must be a floating point number, reasonable values lay between -1.5 and 1.5.
Negative values will blur the input video, while positive values will sharpen it, a value of zero will disable the effect.
Default value is 0.0.
opencl
If set to 1, specify using OpenCL capabilities, only available if FFmpeg was configured with --enable-opencl. Default value is 0.
9.152.1 Exampl
unsharp=luma_ms
Apply a strong bl
unsharp=7:7:-2:7:7
9.153 uspp
9.154 vague
9.155 vector
mode, m
Set vectorscope mode.
It accepts the following values:
gray
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.
color
Gray values are displayed on graph. Surrounding pixels values which are not present in video frame are drawn in gradient of 2 color
components which are set by option x and y. The 3rd color component is static.
color2
Actual color components values present in video frame are displayed on graph.
color3
Similar as color2 but higher frequency of same values x and y on graph increases value of another color component, which is
luminance by default values of x and y.
color4
Actual colors present in video frame are displayed on graph. If two different colors map to same position on graph then color with
higher value of component not present in graph is picked.
color5
Gray values are displayed on graph. Similar to color but with 3rd color component picked from radial gradient.
x
Set which color component will be represented on X-axis. Default is 1.
y
Set which color component will be represented on Y-axis. Default is 2.
intensity, i
Set intensity, used by modes: gray, color, color3 and color5 for increasing brightness of color component which represents
frequency of (X, Y) location in graph.
envelope, e
none
No envelope, this is default.
instant
Instant envelope, even darkest single pixel will be clearly highlighted.
peak
Hold maximum and minimum values presented in graph over time. This way you can still spot out of range values without
constantly looking at vectorscope.
peak+instant
Peak and instant envelope combined together.
graticule, g
Set what kind of graticule to draw.
none
green
color
opacity, o
Set graticule opacity.
flags, f
Set graticule flags.
white
Draw graticule for white point.
black
Draw graticule for black point.
name
Draw color points short names.
bgopacity, b
Set background opacity.
lthreshold, l
Set low threshold for color component not represented on X or Y axis. Values lower than this value will be ignored. Default is 0. Note
this value is multiplied with actual max possible value one pixel component can have. So for 8-bit input and low threshold value of
0.1 actual threshold is 0.1 * 255 = 25.
hthreshold, h
Set high threshold for color component not represented on X or Y axis. Values higher than this value will be ignored. Default is 1.
Note this value is multiplied with actual max possible value one pixel component can have. So for 8-bit input and high threshold
value of 0.9 actual threshold is 0.9 * 255 = 230.
colorspace, c
Set what kind of colorspace to use when drawing graticule.
auto
601
709
Default is auto.
9.156 vidsta
To enable compilation
This filter accepts the f
result
Set the path to the file used to write the transforms information. Default value is transforms.trf.
shakiness
Set how shaky the video is and how quick the camera is. It accepts an integer in the range 1-10, a value of 1 means little shakiness,
a value of 10 means strong shakiness. Default value is 5.
accuracy
Set the accuracy of the detection process. It must be a value in the range 1-15. A value of 1 means low accuracy, a value of 15
means high accuracy. Default value is 15.
stepsize
Set stepsize of the search process. The region around minimum is scanned with 1 pixel resolution. Default value is 6.
mincontrast
Set minimum contrast. Below this value a local measurement field is discarded. Must be a floating point value in the range 0-1.
Default value is 0.3.
tripod
Set reference frame number for tripod mode.
If enabled, the motion of the frames is compared to a reference frame in the filtered stream, identified by the specified number. The
idea is to compensate all movements in a more-or-less static scene and keep the camera view absolutely still.
If set to 0, it is disabled. The frames are counted starting from 1.
show
Show fields and transforms in the resulting frames. It accepts an integer in the range 0-2. Default value is 0, which disables any
visualization.
9.156.1 Exampl
vidstabdetect
Analyze strongly
vidstabdetect=sha
vidstabdetect=sho
Analyze a video w
9.157 vidsta
Video stabilization/des
9.157.1 Options
input
Set path to the file used to read the transforms. Default value is transforms.trf.
smoothing
Set the number of frames (value*2 + 1) used for lowpass filtering the camera movements. Default value is 10.
For example a number of 10 means that 21 frames are used (10 in the past and 10 in the future) to smoothen the motion in the
video. A larger value leads to a smoother video, but limits the acceleration of the camera (pan/tilt movements). 0 is a special case
where a static camera is simulated.
optalgo
Set the camera path optimization algorithm.
Accepted values are:
gauss
gaussian kernel low-pass filter on camera motion (default)
avg
averaging on transformations
maxshift
Set maximal number of pixels to translate frames. Default value is -1, meaning no limit.
maxangle
Set maximal angle in radians (degree*PI/180) to rotate frames. Default value is -1, meaning no limit.
crop
Specify how to deal with borders that may be visible due to movement compensation.
Available values are:
keep
keep image information from previous frame (default)
black
fill the border black
invert
Invert transforms if set to 1. Default value is 0.
relative
Consider transforms as relative to previous frame if set to 1, absolute if set to 0. Default value is 0.
zoom
Set percentage to zoom. A positive value will result in a zoom-in effect, a negative value in a zoom-out effect. Default value is 0 (no
zoom).
optzoom
Set optimal zooming to avoid borders.
Accepted values are:
0
disabled
1
optimal static zoom value is determined (only very strong movements will lead to visible borders) (default)
2
optimal adaptive zoom value is determined (no borders will be visible), see zoomspeed
Note that the value given at zoom is added to the one calculated here.
zoomspeed
Set percent to zoom maximally each frame (enabled when optzoom is set to 2). Range is from 0 to 5, default value is 0.25.
interpol
Specify type of interpolation.
Available values are:
no
no interpolation
linear
linear only horizontal
bilinear
linear in both directions (default)
bicubic
cubic in both directions (slow)
tripod
Enable virtual tripod mode if set to 1, which is equivalent to relative=0:smoothing=0. Default value is 0.
Use also tripod option of vidstabdetect.
debug
Increase log verbosity if set to 1. Also the detected global motions are written to the temporary file global_motions.trf. Default
value is 0.
9.157.2 Exampl
ffmpeg -i inp.mpeg
Zoom in a bit mo
vidstabtransform=
vidstabtransform=
9.158 vflip
9.159 vignet
9.159.1 Express
9.159.2 Exampl
vignette=PI/4
Make a flickering
vignette='PI/4+ran
9.160 vstack
9.161 w3fdif
9.162 wavef
Set which color components to display. Default is 1, which means only luminance or red color component if input is in RGB
colorspace. If is set for example to 7 it will display all 3 (if) available color components.
none
No envelope, this is default.
instant
Instant envelope, minimum and maximum values presented in graph will be easily visible even with small step value.
peak
Hold minimum and maximum values presented in graph across time. This way you can still spot out of range values without
constantly looking at waveforms.
peak+instant
Peak and instant envelope combined together.
lowpass
No filtering, this is default.
flat
Luma and chroma combined together.
aflat
Similar as above, but shows difference between blue and red chroma.
chroma
Displays only chroma.
color
Displays actual color value on waveform.
acolor
Similar as above, but with luma showing frequency of chroma values.
Set which graticule to display.
none
Do not display graticule.
green
Display green graticule showing legal broadcast ranges.
Set graticule opacity.
Set graticule flags.
numbers
Draw numbers above lines. By default enabled.
dots
Draw dots instead of lines.
Set scale used for displaying graticule.
digital
millivolts
ire
Default is digital.
Set background opacity.
Set the scaling dimension: 2 for 2xBR, 3 for 3xBR and 4 for 4xBR. Default is 3.
Input width.
Input height.
Output width.
Output height.
Last calculated x and y position from x and y expression for current input frame.
x and y of last output frame of previous input frame or 0 when there was not yet such frame (first input frame).
Last calculated zoom from z expression for current input frame.
Last calculated zoom of last output frame of previous input frame.
Number of output frames for current input frame. Calculated from d expression for each input frame.
number of output frames created for previous input frame
Rational number: input width / input height
sample aspect ratio
display aspect ratio
Zoom-in up to 1.5 and pan at same time to some spot near center of picture:
zoompan=z='min(zoom+0.0015,1.5)':d=700:x='if(gte(zoom,1.5),x,x+1/a)':y='if(gte(zoom,1.5),y,y+1)':s=640x360
Set the output video dimension expression. Default value is the input dimension.
If the width or w is 0, the input width is used for the output. If the height or h is 0, the input height is used for the output.
If one of the values is -1, the zscale filter will use a value that maintains the aspect ratio of the input image, calculated from the
other specified dimension. If both of them are -1, the input size is used
If one of the values is -n with n > 1, the zscale filter will also use a value that maintains the aspect ratio of the input image,
calculated from the other specified dimension. After that it will, however, make sure that the calculated dimension is divisible by n
and adjust the value if necessary.
See below for the list of accepted constants for use in the dimension expression.
Set the video size. For the syntax of this option, check the (ffmpeg-utils)"Video size" section in the ffmpeg-utils manual.
Set the dither type.
Possible values are:
none
ordered
random
error_difusion
Default is none.
Set the resize filter type.
Possible values are:
point
bilinear
bicubic
spline16
spline36
lanczos
Default is bilinear.
Set the color range.
Possible values are:
input
limited
full
Default is same as input.
Set the color primaries.
Possible values are:
input
709
unspecified
170m
240m
2020
Default is same as input.
Set the transfer characteristics.
Possible values are:
input
709
unspecified
601
linear
2020_10
2020_12
Default is same as input.
Set the colorspace matrix.
Possible value are:
input
709
unspecified
470bg
170m
2020_ncl
2020_cl
Default is same as input.
Set the input color range.
Possible values are:
input
limited
full
Default is same as input.
Set the input color primaries.
Possible values are:
input
709
unspecified
170m
240m
2020
Default is same as input.
horizontal and vertical output chroma subsample values. For example for the pixel format "yuv422p" hsub is 2 and vsub is 1.
Specify the size (width and height) of the buffered video frames. For the syntax of this option, check the (ffmpeg-utils)"Video size"
section in the ffmpeg-utils manual.
The input video width.
The input video height.
A string representing the pixel format of the buffered video frames. It may be a number corresponding to a pixel format, or a pixel
format name.
Specify the timebase assumed by the timestamps of the buffered frames.
Specify the frame rate expected for the video stream.
The sample (pixel) aspect ratio of the input video.
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.
When using a hardware pixel format, this should be a reference to an AVHWFramesContext describing input frames.
Read the initial cellular automaton state, i.e. the starting row, from the specified file. In the file, each non-whitespace character is
considered an alive cell, a newline will terminate the row, and further characters in the file will be ignored.
Read the initial cellular automaton state, i.e. the starting row, from the specified string.
Each non-whitespace character in the string is considered an alive cell, a newline will terminate the row, and further characters in
the string will be ignored.
Set the video rate, that is the number of frames generated per second. Default is 25.
Set the random fill ratio for the initial cellular automaton row. It is a floating point number value ranging from 0 to 1, defaults to
1/PHI.
This option is ignored when a file or a pattern is specified.
Set the seed for filling randomly the initial row, must be an integer included between 0 and UINT32_MAX. If not specified, or if
explicitly set to -1, the filter will try to use a good random seed on a best effort basis.
Set the cellular automaton rule, it is a number ranging from 0 to 255. Default value is 110.
Set the size of the output video. For the syntax of this option, check the (ffmpeg-utils)"Video size" section in the ffmpeg-utils
manual.
If filename or pattern is specified, the size is set by default to the width of the specified initial state row, and the height is set to
width * PHI.
If size is set, it must contain the width of the specified pattern string, and the specified pattern will be centered in the larger row.
If a filename or a pattern string is not specified, the size value defaults to "320x518" (used for a randomly generated initial state).
If set to 1, scroll the output upward when all the rows in the output have been already filled. If set to 0, the new generated row will
be written over the top row just after the bottom row is filled. Defaults to 1.
If set to 1, completely fill the output with generated rows before outputting the first frame. This is the default behavior, for disabling
set the value to 0.
If set to 1, stitch the left and right row edges together. This is the default behavior, for disabling set the value to 0.
Read the initial state from pattern, and specify an output of size 200x400.
cellauto=f=pattern:s=200x400
Generate a random initial row with a width of 200 cells, with a fill ratio of 2/3:
cellauto=ratio=2/3:s=200x200
Create a pattern generated by rule 18 starting by a single alive cell centered on an initial row with width 100:
cellauto=p=@:s=100x400:full=0:rule=18
List all available generators along with all their respective options as well as possible minimum and maximum values along with the
default values.
list_generators=true
Specify the size of the sourced video. For the syntax of this option, check the (ffmpeg-utils)"Video size" section in the ffmpeg-utils
manual. The default value is 320x240.
Specify the frame rate of the sourced video, as the number of frames generated per second. It has to be a string in the format
frame_rate_num/frame_rate_den, an integer number, a floating point number or a valid video frame rate abbreviation. The default
value is "25".
Set the sample aspect ratio of the sourced video.
Set the duration of the sourced video. See (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual for the accepted
syntax.
If not specified, or the expressed duration is negative, the video is supposed to be generated forever.
Use CIQRCodeGenerator to create a QR code for the FFmpeg homepage, given as complete and escaped command-line for Apples
ffmpeg
-f
lavfi
-i
coreimagesrc=s=100x100:filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H
floating
point
value
between
-100
and
100.
Default
value
is
floating
point
value
between
-100
and
100.
Default
value
is
Specify the frame rate of the sourced video, as the number of frames generated per second. It has to be a string in the format
frame_rate_num/frame_rate_den, an integer number, a floating point number or a valid video frame rate abbreviation. The default
value is "25".
Set the duration of the sourced video. See (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual for the accepted
syntax.
If not specified, or the expressed duration is negative, the video is supposed to be generated forever.
Set the number or the name of the test to perform. Supported tests are:
dc_luma
dc_chroma
freq_luma
freq_chroma
amp_luma
amp_chroma
cbp
mv
ring1
ring2
all
Default value is "all", which will cycle through the list of all tests.
The size of the video to generate. For the syntax of this option, check the (ffmpeg-utils)"Video size" section in the ffmpeg-utils
manual.
The framerate of the generated video. It may be a string of the form num/den or a frame rate abbreviation.
The name to the frei0r source to load. For more information regarding frei0r and how to set the parameters, read the frei0r section
in the video filters documentation.
A |-separated list of parameters to pass to the frei0r source.
Set the file from which to read the initial grid state. In the file, each non-whitespace character is considered an alive cell, and
newline is used to delimit the end of each row.
If this option is not specified, the initial grid is generated randomly.
Set the video rate, that is the number of frames generated per second. Default is 25.
Set the random fill ratio for the initial random grid. It is a floating point number value ranging from 0 to 1, defaults to 1/PHI. It is
ignored when a file is specified.
Set the seed for filling the initial random grid, must be an integer included between 0 and UINT32_MAX. If not specified, or if
explicitly set to -1, the filter will try to use a good random seed on a best effort basis.
Set the life rule.
A rule can be specified with a code of the kind "SNS/BNB", where NS and NB are sequences of numbers in the range 0-8, NS
specifies the number of alive neighbor cells which make a live cell stay alive, and NB the number of alive neighbor cells which make
a dead cell to become alive (i.e. to "born"). "s" and "b" can be used in place of "S" and "B", respectively.
Alternatively a rule can be specified by an 18-bits integer. The 9 high order bits are used to encode the next cell state if it is alive
for each number of neighbor alive cells, the low order bits specify the rule for "borning" new cells. Higher order bits encode for an
higher number of neighbor cells. For example the number 6153 = (12<<9)+9 specifies a stay alive rule of 12 and a born rule of 9,
which corresponds to "S23/B03".
Default value is "S23/B3", which is the original Conways game of life rule, and will keep a cell alive if it has 2 or 3 neighbor alive
cells, and will born a new cell if there are three alive cells around a dead cell.
Set the size of the output video. For the syntax of this option, check the (ffmpeg-utils)"Video size" section in the ffmpeg-utils
manual.
If filename is specified, the size is set by default to the same size of the input file. If size is set, it must contain the size specified in
the input file, and the initial grid defined in that file is centered in the larger resulting area.
If a filename is not specified, the size value defaults to "320x240" (used for a randomly generated initial grid).
If set to 1, stitch the left and right grid edges together, and the top and bottom edges also. Defaults to 1.
Set cell mold speed. If set, a dead cell will go from death_color to mold_color with a step of mold. mold can have a value from 0 to
255.
Set the color of living (or new born) cells.
Set the color of dead cells. If mold is set, this is the first color used to represent a dead cell.
Set mold color, for definitely dead and moldy cells.
For the syntax of these 3 color options, check the "Color" section in the ffmpeg-utils manual.
Read a grid from pattern, and center it on a grid of size 300x300 pixels:
life=f=pattern:s=300x300
a format conversion.
Specify the color of the source, only available in the color source. For the syntax of this option, check the "Color" section in the
ffmpeg-utils manual.
Specify the level of the Hald CLUT, only available in the haldclutsrc source. A level of N generates a picture of N*N*N by N*N*N pixels
to be used as identity matrix for 3D lookup tables. Each component is coded on a 1/(N*N) scale.
Specify the size of the sourced video. For the syntax of this option, check the (ffmpeg-utils)"Video size" section in the ffmpeg-utils
manual. The default value is 320x240.
This option is not available with the haldclutsrc filter.
Specify the frame rate of the sourced video, as the number of frames generated per second. It has to be a string in the format
frame_rate_num/frame_rate_den, an integer number, a floating point number or a valid video frame rate abbreviation. The default
value is "25".
Set the sample aspect ratio of the sourced video.
Set the duration of the sourced video. See (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual for the accepted
syntax.
If not specified, or the expressed duration is negative, the video is supposed to be generated forever.
Set the number of decimals to show in the timestamp, only available in the testsrc source.
The displayed timestamp value will correspond to the original timestamp value multiplied by the power of 10 of the specified value.
Default value is 0.
d.
e geq filter:
Set the color of the created image. Accepts the same syntax of the corresponding color option.
ystem.
log
logarithmic
lin
linear
Default is log.
Set how much frames to accumulate in histogram. Defauls is 1. Setting this to -1 accumulates all frames.
Set histogram ratio of window height.
Set sonogram sliding.
It accepts the following values:
replace
replace old rows with new ones.
scroll
scroll from top to bottom.
Default is replace.
Specify the red, green, blue contrast. Default values are 2, 7 and 1. Allowed range is [0, 255].
Set color which will be used for drawing median phase. If color is none which is default, no median phase value will be drawn.
urrent audio frame. Value is in range [-1, 1]. The -1 means left and right channels are completely out of phase and 1 means channels are in phase.
signal, consisting of identical left and right signal, results in straight vertical line. Any stereo separation is visible as a deviation from this line, creating a Lissajous
right channels are out of phase.
Specify the red, green, blue and alpha contrast. Default values are 40, 160, 80 and 255. Allowed range is [0, 255].
Specify the red, green, blue and alpha fade. Default values are 15, 10, 5 and 5. Allowed range is [0, 255].
Set the zoom factor. Default value is 1. Allowed range is [1, 10].
Set the vectorscope drawing mode.
other.
segments must have the same number of streams of each type, and that will also be the number of streams at output.
utputs.
in the same order as the outputs, then the inputs for the second segment, etc.
on, for various reasons including codec frame size or sloppy authoring. For that reason, related synchronized streams (e.g. a video and its audio track) should be
the longest stream in each segment (except the last one), and if necessary pad shorter audio streams with silence.
stamp 0.
all segments; the filtering system will automatically select a common pixel format for video streams, and a common sample format, sample rate and channel layout
be converted explicitly by the user.
rame rate at output; be sure to configure the output file to handle it.
Concatenate an opening, an episode and an ending, all in bilingual version (video in stream 0, audio in streams 1 and 2):
ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
'[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
concat=n=3:v=1:a=2 [v] [a1] [a2]' \
-map '[v]' -map '[a1]' -map '[a2]' output.mkv
Concatenate two parts, handling audio and video separately, using the (a)movie sources, and adjusting the resolution:
movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
[v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
udio and video streams do not have exactly the same duration in the first file.
Set 1st frame metadata key from which metadata values will be used to draw a graph.
Set 1st foreground color expression.
Set 2nd frame metadata key from which metadata values will be used to draw a graph.
Set 2nd foreground color expression.
Set 3rd frame metadata key from which metadata values will be used to draw a graph.
Set 3rd foreground color expression.
Set 4th frame metadata key from which metadata values will be used to draw a graph.
Set 4th foreground color expression.
Set minimal value of metadata value.
Set maximal value of metadata value.
Set graph background color. Default is white.
Set graph mode.
Available values for mode is:
bar
dot
line
Default is line.
Set slide mode.
Available values for slide is:
frame
avfi.signalstats.YAVG:min=0:max=255
drawgraph=lavfi.r128.M:min=-120:max=5
r. This filter takes an audio stream as input and outputs it unchanged. By default, it logs a message at a frequency of 10Hz with the Momentary loudness (identified
ness (S), Integrated loudness (I) and Loudness Range (LRA).
deo output (see the video option) with a real time graph to observe the loudness evolution. The graphic contains the logged message mentioned above, so it is not
this option is set, unless the verbose logging is set. The main graphing area contains the short-term loudness (3 seconds of analysis), and the gauge on the right is
dness (400 milliseconds).
ollowing options:
Activate the video output. The audio stream is passed unchanged whether this option is set or no. The video stream will be the first
output stream if activated. Default is 0.
Set the video size. This option is for video only. For the syntax of this option, check the (ffmpeg-utils)"Video size" section in the
ffmpeg-utils manual. Default and minimum resolution is 640x480.
Set the EBU scale meter. Default is 9. Common values are 9 and 18, respectively for EBU scale meter +9 and EBU scale meter +18.
Any other integer value between this range is allowed.
Set metadata injection. If set to 1, the audio input will be segmented into 100ms output frames, each of them containing various
loudness information in metadata. All the metadata keys are prefixed with lavfi.r128..
Default is 0.
Force the frame logging level.
Available values are:
info
information logging level
verbose
verbose logging level
By default, the logging level is set to info. If the video or the metadata options are set, it switches to verbose.
Set peak mode(s).
Available modes can be cumulated (the option is a flag type). Possible values are:
none
Disable any peak mode (default).
sample
Enable sample-peak mode.
Simple peak mode looking for the higher sample value. It logs a message for sample-peak (identified by SPK).
true
Enable true-peak mode.
If enabled, the peak lookup is done on an over-sampled version of the input stream for better peak accuracy. It logs a message for
true-peak. (identified by TPK) and true-peak per frame (identified by FTPK). This mode requires a build with libswresample.
mono
Treat mono input files as "dual mono". If a mono file is intended for playback on a stereo system, its EBU R128 measurement will be
perceptually incorrect. If set to true, this option will compensate for this effect. Multi-channel input files are not affected by this
option.
nlaw
Set a specific pan law to be used for the measurement of dual mono files. This parameter is optional, and has a default value of
-3.01dB.
12.7.1 Examples
These filters read frames from several inputs and send the oldest queued frame to the output.
Input streams must have well defined, monotonically increasing frame timestamp values.
In order to submit one frame to output, these filters need to enqueue at least one frame for each input, so they cannot work in case one input is not yet terminated
and will not receive incoming frames.
For example consider the case when one input is a select filter which always drops input frames. The interleave filter will keep reading from that input, but it will never
be able to send new frames to output until the input sends an end-of-stream signal.
Also, depending on inputs synchronization, the filters will drop frames in case one input receives more frames than the other ones, and the queue is already filled.
nb_inputs, n
Set the number of different inputs, it is 2 by default.
12.8.1 Examples
function
Which function to use when comparing metadata value and value.
Can be one of following:
same_str
Values are interpreted
starts_with
Values are interpreted
less
Values are interpreted
equal
Values are interpreted
greater
Values are interpreted
expr
Values are interpreted
expr
Set expression which is used when function is set to expr. The expression is evaluated through the eval API and can contain the
following constants:
VALUE1
Float representation of value from metadata key.
VALUE2
Float representation of value as supplied by user in value option.
file
If specified in print mode, output is written to the named file. Instead of plain filename any writable url can be specified. Filename
- is a shorthand for standard output. If file option is not set, output is written to the log with AV_LOG_INFO loglevel.
12.9.1 Examples
Print all metadata values for frames with key lavfi.singnalstats.YDIF with values between 0 and 1.
signalstats,metadata=print:key=lavfi.signalstats.YDIF:value=0:function=expr:expr='between(VALUE1,0,1)'
silencedetect,ametadata=mode=print:file=metadata.txt
metadata=mode=print:file='pipe\:4'
pos
the position in the file of the filtered frame, -1 if the information is not available (e.g. for synthetic video)
scene (video only)
value between 0 and 1 to indicate a new scene; a low value reflects a low probability for the current frame to introduce a new
scene, while a higher value means the current frame is more likely to be one (see the example below)
concatdec_select
The concat demuxer can select only part of a concat input file by setting an inpoint and an outpoint, but the output packets may
not be entirely contained in the selected interval. By using this variable, it is possible to skip frames generated by the concat
demuxer which are not exactly contained in the selected interval.
This works by comparing the frame pts against the lavf.concat.start_time and the lavf.concat.duration packet metadata values
which are also present in the decoded frames.
The concatdec_select variable is -1 if the frame pts is at least start_time and either the duration metadata is missing or the frame
pts is less than start_time + duration, 0 otherwise, and NaN if the start_time metadata is missing.
That basically means that an input frame is selected if its pts is within the interval set by the concat demuxer.
The default value of the select expression is "1".
12.12.1 Examples
select
select=0
select='eq(pict_type\,I)'
select='not(mod(n\,100))'
select=between(t\,10\,20)
select=between(t\,10\,20)*eq(pict_type\,I)
select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
Use aselect to select only audio frames with samples number >
100:
aselect='gt(samples_n\,100)'
select='gt(scene\,0.4)',scale=160:120,tile
inserted between two audio filters, but apart from that they act the same
way.
The specification of commands can be provided in the filter arguments with
the commands option, or in a file specified by the filename option.
These filters accept the following options:
commands, c
Set the commands to be read and sent to the other filters.
filename, f
Set the filename of the commands to be read and sent to the other filters.
The time interval is specified by the START and END times. END is
optional and defaults to the maximum time.
The current frame time is considered within the specified interval if it
is included in the interval [START, END), that is when the time is
greater or equal to START and is lesser than END.
COMMANDS consists of a sequence of one or more command
specifications, separated by ",", relating to that interval. The syntax of
a command specification is given by:
[FLAGS] TARGET COMMAND ARG
FLAGS is optional and specifies the type of events relating to the time
interval which enable sending the specified command, and must be a
non-null sequence of identifier flags separated by "+" or "|" and
enclosed between "[" and "]".
The following flags are recognized:
enter
The command is sent when the current frame timestamp enters the specified interval. In other words, the command is sent when
the previous frame timestamp was not in the given interval, and the current is.
leave
The command is sent when the current frame timestamp leaves the specified interval. In other words, the command is sent when
the previous frame timestamp was in the given interval, and the current is not.
If FLAGS is not specified, a default value of [enter] is assumed.
TARGET specifies the target of the command, usually the name
of the filter class or a specific filter instance name.
COMMAND specifies the name of the command for the target
filter.
ARG is optional and specifies the optional list of argument for the
given COMMAND.
Between one interval specification and another, whitespaces, or
sequences of characters starting with # until the end of line, are
ignored and can be used to annotate comments.
A simplified BNF description of the commands specification
syntax follows:
COMMAND_FLAG ::= "enter" | "leave"
COMMAND_FLAGS ::= COMMAND_FLAG [(+|"|")COMMAND_FLAG]
COMMAND
[ARG]
COMMANDS
INTERVAL
INTERVALS
12.13.2 Examples
5.0-10.0
[enter]
drawtext
'fontfile=FreeSerif.ttf:text=hello world',
reinit
[enter]
'fontfile=FreeSerif.ttf:text=nocolor',
drawtext
reinit
drawtext
reinit
[leave] hue s 1,
[leave]
'fontfile=FreeSerif.ttf:text=color';
12.14.1
Exampl
es
S
t
a
r
t
c
o
u
n
t
i
n
g
P
T
S
f
r
o
m
z
e
r
o
set
p
t
s
=
P
T
S
S
T
A
R
T
P
T
S
A
p
p
l
y
f
a
s
t
m
o
t
i
o
n
e
f
f
e
c
t
:
set
p
t
s
=
0
.
5
*
P
T
S
A
p
p
l
y
s
l
o
w
m
o
t
i
o
n
e
f
f
e
c
t
:
set
p
t
s
=
2
.
0
*
P
T
S
S
e
t
f
i
x
e
d
r
a
t
e
o
f
2
5
f
r
a
m
e
s
p
e
r
s
e
c
o
n
d
:
set
p
t
s
=
N
/
(
2
5
*
T
B
)
S
e
t
f
i
x
e
d
r
a
t
e
2
5
f
p
s
w
i
t
h
s
o
m
e
j
i
t
t
e
r
:
set
p
t
s
=
'
1
/
(
2
5
*
T
B
)
*
(
N
+
0
.
0
5
*
s
i
n
(
N
*
2
*
P
I
/
2
5
)
)
'
A
p
p
l
y
a
n
o
f
f
s
e
t
o
f
1
0
s
e
c
o
n
d
s
t
o
t
h
e
i
n
p
u
t
P
T
S
:
set
p
t
s
=
P
T
S
+
1
0
/
T
B
G
e
n
e
r
a
t
e
t
i
m
e
s
t
a
m
p
s
f
r
o
m
a
"
l
i
v
e
s
o
u
r
c
e
"
a
n
d
r
e
b
a
s
e
o
n
t
o
t
h
e
c
u
r
r
e
n
t
t
i
m
e
b
a
s
e
:
set
p
t
s
=
'
(
R
T
C
T
I
M
E
R
T
C
S
T
A
R
T
)
/
(
T
B
*
1
0
0
0
0
0
0
)
'
G
e
n
e
r
a
t
e
t
i
m
e
s
t
a
m
p
s
b
y
c
o
u
n
t
i
n
g
s
a
m
p
l
e
s
:
as
e
t
p
t
s
=
N
/
S
R
/
T
B
12.15
settb
,
asett
b
Set
the
timebase
to use for
the output
frames
timestamp
s.
It
is
mainly
useful for
testing
timebase
configurati
on.
It accepts
the
following
parameter
s:
expr, tb
The expression which is evaluated into the output timebase.
The
value
for tb is
an
arithme
tic
expressi
on
represe
nting a
rational.
The
expressi
on can
contain
the
constan
ts
"AVTB"
(the
default
timebas
e),
"intb"
(the
input
timebas
e) and
"sr"
(the
sample
rate,
audio
only).
Default
value is
"intb".
12.15
.1
Exam
ples
Se
t
th
e
ti
m
eb
as
e
to
1/
25
:
set
tb
=e
xp
r=
1/
25
Se
t
th
e
ti
m
eb
as
e
to
1/
10
:
set
tb
=e
xp
r=
0.
1
Se
t
th
e
ti
m
eb
as
e
to
10
01
/1
00
0:
set
tb
=1
+0
.0
01
Se
t
th
e
ti
m
eb
as
e
to
2*
int
b:
set
tb
=2
*in
tb
Se
t
th
e
de
fa
ult
ti
m
eb
as
e
va
lu
e:
set
tb
=A
VT
B
12.
16
sho
wcq
t
Convert
input
audio to
a video
output
represe
nting
frequen
cy
spectru
m
logarith
mically
using
BrownPuckett
e
constan
t
Q
transfor
m
algorith
m with
direct
frequen
cy
domain
coeffici
ent
calculat
ion (but
the
transfor
m itself
is
not
really
constan
t
Q,
instead
the
Q
factor is
actually
variable
/clampe
d), with
musical
tone
scale,
from E0
to
D#10.
The
filter
accepts
the
followin
g
options:
size, s
Specify the video size for the output. It must be even. For the syntax of this option, check the (ffmpeg-utils)"Video size" section in
the ffmpeg-utils manual. Default value is 1920x1080.
fps,
rate,
r
Set the output frame rate. Default value is 25.
b
ar
_h
Set the bargraph height. It must be even. Default value is -1 which computes the bargraph height automatically.
a
x
i
s
_
h
Set the axis height. It must be even. Default value is -1 which computes the axis height automatically.
so
no_
h
Set the sonogram height. It must be even. Default value is -1 which computes the sonogram height automatically.
fullhd
Set the fullhd resolution. This option is deprecated, use size, s instead. Default value is 1.
sono_v,
volume
Specify the sonogram volume expression. It can contain variables:
bar_v
the bar_v evaluated expression
frequency, freq, f
the frequency where it is evaluated
timeclamp, tc
the value of timeclamp option
and functions:
a_weighting(f)
A-weighting of equal loudness
b_weighting(f)
B-weighting of equal loudness
c_weighting(f)
C-weighting of equal loudness.
Default value is 16.
bar_v,
volume2
Specify the bargraph volume expression. It can contain variables:
sono_v
the sono_v evaluated expression
frequency, freq, f
the frequency where it is evaluated
timeclamp, tc
the value of timeclamp option
and functions:
a_weighting(f)
A-weighting of equal loudness
b_weighting(f)
B-weighting of equal loudness
c_weighting(f)
C-weighting of equal loudness.
Default value is sono_v.
sono_g,
gamma
Specify the sonogram gamma. Lower gamma makes the spectrum more contrast, higher gamma makes the spectrum having more
range. Default value is 3. Acceptable range is [1, 7].
bar_g, gamma2
Specify the bargraph gamma. Default value is 1. Acceptable range is [1, 7].
timeclamp, tc
Specify the transform timeclamp. At low frequency, there is trade-off between accuracy in time domain and frequency domain. If
timeclamp is lower, event in time domain is represented more accurately (such as fast bass drum), otherwise event in frequency
domain is represented more accurately (such as bass guitar). Acceptable range is [0.1, 1]. Default value is 0.17.
basefreq
Specify the transform base frequency. Default value is 20.01523126408007475, which is frequency 50 cents below E0. Acceptable
range is [10, 100000].
endfreq
Specify the transform end frequency. Default value is 20495.59681441799654, which is frequency 50 cents above D#10. Acceptable
range is [10, 100000].
coeffclamp
This option is deprecated and ignored.
tlength
Specify the transform length in time domain. Use this option to control accuracy trade-off between time domain and frequency
domain at every frequency sample. It can contain variables:
frequency, freq, f
the frequency where it is evaluated
timeclamp, tc
the value of timeclamp option.
Default value is 384*tc/(384+tc*f).
count
Specify the transform count for every video frame. Default value is 6. Acceptable range is [1, 30].
fcount
Specify the transform count for every single pixel. Default value is 0, which makes it computed automatically. Acceptable range is
[0, 10].
fontfile
Specify font file for use with freetype to draw the axis. If not specified, use embedded font. Note that drawing with font file or
embedded font is not implemented with custom basefreq and endfreq, use axisfile option instead.
font
Specify fontconfig pattern. This has lower priority than fontfile. The : in the pattern may be replaced by | to avoid unnecessary
escaping.
fontcolor
Specify font color expression. This is arithmetic expression that should return integer value 0xRRGGBB. It can contain variables:
frequency, freq, f
the frequency where it is evaluated
timeclamp, tc
the value of timeclamp option
and functions:
midi(f)
midi number of frequency f, some midi numbers: E0(16), C1(24), C2(36), A4(69)
r(x), g(x), b(x)
red, green, and blue value of intensity x.
Default value is st(0, (midi(f)-59.5)/12); st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0)); r(1-ld(1)) + b(ld(1)) .
axisfile
Specify image file to draw the axis. This option override fontfile and fontcolor option.
axis, text
Enable/disable drawing text to the axis. If it is set to 0, drawing to the axis is disabled, ignoring fontfile and axisfile option. Default
value is 1.
csp
Set colorspace. The accepted values are:
unspecified
Unspecified (default)
bt709
BT.709
fcc
FCC
bt470bg
BT.470BG or BT.601-6 625
smpte170m
SMPTE-170M or BT.601-6 525
smpte240m
SMPTE-240M
bt2020ncl
BT.2020 with non-constant luminance
cscheme
Set spectrogram color scheme. This is list of floating point values with format left_r|left_g|left_b|right_r|right_g|right_b. The default is 1|
0.5|0|0|0.5|1.
12.16.1 Exampl
Playing audio wh
Same as above, b
ffplay
-f
lavfi
showcqt=fps=30:c
Playing at 1280x7
ffplay
-f
lavfi
showcqt=s=1280x
Disable sonogram
sono_h=0
asplit[a]
Same as above
domain:
asplit[a]
Custom volume:
bar_v=10:sono_v=
Custom gamma,
bar_g=2:sono_g=2
Custom tlength e
tc=0.33:tlength='s
+ 384*tc / (tc*f / ld
Custom fontcolo
others are colore
fontcolor='if(mod(
g(1))':fontfile=myf
font='Courier New
Custom frequenc
axisfile=myaxis.pn
12.17 showf
Set window overlap. In range [0, 1]. Default is 1, which means optimal overlap for selected window function will be picked.
averaging
Set time averaging. Setting this to 0 will display current maximal peaks. Default is 1, which means time averaging is disabled.
colors
Specify list of colors separated by space or by | which will be used to draw channel frequencies. Unrecognized or missing colors
will be replaced by white color.
cmode
Set channel display mode.
It accepts the following values:
combined
separate
Default is combined.
minamp
Set minimum amplitude used in log amplitude scaler.
12.18 shows
overlap
Set ratio of overlap window. Default value is 0. When value is 1 overlap is set to recommended size for specific window function
currently used.
gain
Set scale gain for calculating intensity color values. Default value is 1.
data
Set which data to display. Can be magnitude, default or phase.
rotation
Set color rotation, must be in [-1.0, 1.0] range. Default value is 0.
The usage is very simil
12.18.1 Exampl
showspectrum=s=
Complete examp
[a] showsp
12.19 shows
Specify the video size for the output. For the syntax of this option, check the (ffmpeg-utils)"Video size" section in the ffmpeg-utils
manual. Default value is 4096x2048.
mode
Specify display mode.
It accepts the following values:
combined
all channels are displayed in the same row
separate
all channels are displayed in separate rows
Default value is combined.
color
Specify display color mode.
It accepts the following values:
channel
each channel is displayed in a separate color
intensity
each channel is displayed using the same color scheme
rainbow
each channel is displayed using the rainbow color scheme
moreland
each channel is displayed using the moreland color scheme
nebulae
each channel is displayed using the nebulae color scheme
fire
each channel is displayed using the fire color scheme
fiery
each channel is displayed using the fiery color scheme
fruit
each channel is displayed using the fruit color scheme
cool
each channel is displayed using the cool color scheme
Default value is intensity.
scale
Specify scale used for calculating intensity color values.
It accepts the following values:
lin
linear
sqrt
square root, default
cbrt
cubic root
log
logarithmic
4thrt
4th root
5thrt
5th root
Default value is log.
saturation
Set saturation modifier for displayed colors. Negative values provide alternative color scheme. 0 is no saturation at all. Saturation
must be in [-10.0, 10.0] range. Default value is 1.
win_func
Set window function.
It accepts the following values:
rect
bartlett
hann
hanning
hamming
blackman
welch
flattop
bharris
bnuttall
bhann
sine
nuttall
lanczos
gauss
tukey
dolph
cauchy
parzen
poisson
Default value is hann.
orientation
Set orientation of time vs frequency axis. Can be vertical or horizontal. Default is vertical.
gain
Set scale gain for calculating intensity color values. Default value is 1.
legend
Draw time and frequency axes and legends. Default is enabled.
rotation
Set color rotation, must be in [-1.0, 1.0] range. Default value is 0.
12.19.1 Exampl
Extract an audio
ffmpeg -i audio.flac
12.20 showv
12.21 showw
line
Draw a vertical line for each sample.
p2p
Draw a point for each sample and a line between them.
cline
Draw a centered vertical line for each sample.
Default value is point.
n
Set the number of samples which are printed on the same column. A larger value will decrease the frame rate. Must be a positive
integer. This option can be set only if the value for rate is not explicitly specified.
rate, r
Set the (approximate) output frame rate. This is done by setting the option n. Default value is "25".
split_channels
Set if channels should be drawn separately or overlap. Default value is 0.
colors
Set colors separated by | which are going to be used for drawing of each channel.
scale
Set amplitude scale.
Available values are:
lin
Linear.
log
Logarithmic.
sqrt
Square root.
cbrt
Cubic root.
Default is linear.
12.21.1 Exampl
amovie=a.mp3,asp
Create a syntheti
aevalsrc=sin(1*2*P
12.22 showw
12.22.1 Exampl
Extract a channe
ffmpeg -i audio.flac
12.23 sideda
mode
Set mode of operation of the filter.
Can be one of the following:
select
Select every frame with side data of type.
delete
Delete side data of type. If type is not set, delete all side data in the frame.
type
Set side data type used with all modes. Must be set for select mode. For the list of frame side data types, refer to the
AVFrameSideDataType enum in libavutil/frame.h. For example, to choose AV_FRAME_DATA_PANSCAN side data, you must specify
PANSCAN.
12.24 spectr
12.24.1 Exampl
ffmpeg -i input.flac
ffmpeg -i input.flac
ffmpeg -i magnitud
12.25 split,
12.25.1 Exampl
To create 3 or mo
[splitout1] crop=10
[splitout2] pad=20
Create 5 copies o
12.26 zmq, a
COMMAND specifies th
ERROR_CODE ERROR_RE
MESSAGE
MESSAGE is optional.
12.26.1 Exampl
Look at tools/zmqsend
Consider the following
ffplay -dumpgraph 1 -f la
color=s=100x100:c=red
color=s=100x100:c=blu
nullsrc=s=200x100, zmq
[bg][l] overlay
[bg+l
[bg+l][r] overlay=x=100
echo Parsed_color_0 c ye
echo Parsed_color_1 c pi
13 Multim
Below is a description
13.1 amovie
13.2 movie
streams, s
Specifies the streams to read. Several streams can be specified, separated by "+". The source will then have as many outputs, in
the same order. The syntax is explained in the Stream specifiers section in the ffmpeg manual. Two special names, "dv" and "da"
specify respectively the default (best suited) video and audio stream. Default is "dv", or "da" if the filter is called as "amovie".
stream_index, si
Specifies the index of the video stream to read. If the value is -1, the most suitable video stream will be automatically selected. The
default value is "-1". Deprecated. If the filter is called "amovie", it will select audio instead of video.
loop
Specifies how many times to read the stream in sequence. If the value is less than 1, the stream will be read again and again.
Default value is "1".
Note that when the movie is looped the source timestamps are not changed, so it will generate non monotonically increasing
timestamps.
discontinuity
Specifies the time difference between frames above which the point is considered a timestamp discontinuity which is removed by
adjusting the later timestamps.
It allows overlaying a s
^
|
13.2.1 Example
movie=in.avi:seek
[in] setpts=PTS-ST
[main][over] overla
movie=/dev/video0
[in] setpts=PTS-ST
[main][over] overla
movie=dvd.vob:s=
13.2.2 Comman
stream_index: If stream_index is -1, a default stream is selected, and timestamp is automatically converted from
AV_TIME_BASE units to the stream specific time_base.
14 See Al
15 Author
This docume