‘0.1’

Table of Contents

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]|
            +-----> crop --> vflip -------+

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

to see how to use graph2dot.

You can then pass the dot description to the dot program (from the graphviz suite of programs) and obtain a graphical representation of the filtergraph.

For example the sequence of commands:

echo GRAPH_DESCRIPTION | \
tools/graph2dot -o graph.tmp && \
dot -Tpng graph.tmp -o graph.png && \
display graph.png

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

your GRAPH_DESCRIPTION string will need to be of the form:

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”.

4.1 Filtergraph syntax

A filtergraph has a textual representation, which is recognized by the -filter/-vf/-af and -filter_complex options in ffmpeg and -vf/-af in ffplay, and by the avfilter_graph_parse_ptr() function defined in libavfilter/avfilter.h.

A filterchain consists of a sequence of connected filters, each one connected to the previous one in the sequence. A filterchain is represented by a list of “,”-separated filter descriptions.

A filtergraph consists of a sequence of filterchains. A sequence of filterchains is represented by a list of “;”-separated filterchain descriptions.

A filter is represented by a string of the form: [in_link_1]...[in_link_N]filter_name@id=arguments[out_link_1]...[out_link_M]

filter_name is the name of the filter class of which the described filter is an instance of, and has to be the name of one of the filter classes registered in the program optionally followed by “@id”. The name of the filter class is optionally followed by a string “=arguments”.

arguments is a string which contains the parameters used to initialize the filter instance. It may have one of two forms:

  • A ’:’-separated list of key=value pairs.
  • 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.

A special syntax implemented in the ffmpeg CLI tool allows loading option values from files. This is done be prepending a slash ’/’ to the option name, then the supplied value is interpreted as a path from which the actual value is loaded. E.g.

ffmpeg -i <INPUT> -vf drawtext=/text=/tmp/some_text <OUTPUT>

will load the text to be drawn from /tmp/some_text. API users wishing to implement a similar feature should use the avfilter_graph_segment_*() functions together with custom IO code.

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.

Leading and trailing whitespaces (space, tabs, or line feeds) separating tokens in the filtergraph specification are ignored. This means that the filtergraph can be expressed using empty lines and spaces to improve readability.

For example, the filtergraph:

testsrc,split[L1],hflip[L2];[L1][L2] hstack

can be represented as:

testsrc,
split [L1], hflip [L2];

[L1][L2] hstack

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             ::= sequence of alphanumeric characters and '_'
FILTER_NAME      ::= NAME["@"NAME]
LINKLABEL        ::= "[" NAME "]"
LINKLABELS       ::= LINKLABEL [LINKLABELS]
FILTER_ARGUMENTS ::= sequence of chars (possibly quoted)
FILTER           ::= [LINKLABELS] FILTER_NAME ["=" FILTER_ARGUMENTS] [LINKLABELS]
FILTERCHAIN      ::= FILTER [,FILTERCHAIN]
FILTERGRAPH      ::= [sws_flags=flags;] FILTERCHAIN [;FILTERGRAPH]

4.2 Notes on filtergraph escaping

Filtergraph description composition entails several levels of escaping. See the “Quoting and escaping” section in the ffmpeg-utils(1) manual for more information about the employed escaping procedure.

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"

In order to avoid cumbersome escaping when using a commandline tool accepting a filter specification as input, it is advisable to avoid direct inclusion of the filter or options specification in the shell.

For example, in case of the drawtext filter, you might prefer to use the textfile option in place of text to specify the text to render.

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; deprecated, do not use

‘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

See ffmpeg -filters to view which filters have timeline support.

6 Changing options at runtime with a command

Some options can be changed during the operation of the filter using a command. These options are marked ’T’ on the output of ffmpeg -h filter=<name of filter>. The name of the command is the name of the option and the argument is the new value.

7 Options for filters with several inputs (framesync)

Some filters with several inputs support a common set of options. These options can only be set by name, not with the short notation.

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.

shortest : If set to 1, force the output to terminate when the shortest input terminates. Default value is 0.

repeatlast : If set to 1, force the filter to extend the last frame of secondary streams until the end of the primary stream. A value of 0 disables this behavior. Default value is 1.

ts_sync_mode : How strictly to sync streams based on secondary input timestamps; it accepts one of the following values:

`default`
:   Frame from secondary input with the nearest lower or equal timestamp to the
    primary input frame.

`nearest`
:   Frame from secondary input with the absolute nearest timestamp to the primary
    input frame.

8 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.

8.1 aap

Apply Affine Projection algorithm to the first audio stream using the second audio stream.

This adaptive filter is used to estimate unknown audio based on multiple input audio samples. Affine projection algorithm can make trade-offs between computation complexity with convergence speed.

A description of the accepted options follows.

order : Set the filter order.

projection : Set the projection order.

mu : Set the filter mu.

delta : Set the coefficient to initialize internal covariance matrix.

out_mode : Set the filter output samples. It accepts the following values:

`i`
:   Pass the 1st input.

`d`
:   Pass the 2nd input.

`o`
:   Pass difference between desired, 2nd input and error signal estimate.

`n`
:   Pass difference between input, 1st input and error signal estimate.

`e`
:   Pass error signal estimated samples.

    Default value is o.

precision : Set which precision to use when processing samples.

`auto`
:   Auto pick internal sample format depending on other filters.

`float`
:   Always use single-floating point precision sample format.

`double`
:   Always use double-floating point precision sample format.

8.2 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. It’s 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.

mode : Set mode of compressor operation. Can be upward or downward. Default is downward.

threshold : If a signal of stream rises above this level it will affect the gain reduction. 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 1. Range is from 1 to 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.

8.2.1 Commands

This filter supports the all above options as commands.

8.3 acontrast

Simple audio dynamic range compression/expansion filter.

The filter accepts the following options:

contrast : Set contrast. Default is 33. Allowed range is between 0 and 100.

8.4 acopy

Copy the input audio source unchanged to the output. This is mainly useful for testing purposes.

8.5 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:

inputs, n : Specify the number of inputs to crossfade. When crossfading multiple inputs, each input will be concatenated and crossfaded in sequence, similar to the concat filter. Default is 2.

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 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](#afade) filter description.

8.5.1 Examples

  • Cross fade from one input to another:

ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac - Cross fade from one input to another but without overlapping:

ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac

Concatenate multiple inputs with cross fade between each:

ffmpeg -i first.flac -i second.flac -i third.flac -filter_complex acrossfade=n=3 output.flac

8.6 acrossover

Split audio stream into several bands.

This filter splits audio stream into two or more frequency ranges. Summing all streams back will give flat output.

The filter accepts the following options:

split : Set split frequencies. Those must be positive and increasing.

order : Set filter order for each band split. This controls filter roll-off or steepness of filter transfer function. Available values are:

‘`2nd`’
:   12 dB per octave.

‘`4th`’
:   24 dB per octave.

‘`6th`’
:   36 dB per octave.

‘`8th`’
:   48 dB per octave.

‘`10th`’
:   60 dB per octave.

‘`12th`’
:   72 dB per octave.

‘`14th`’
:   84 dB per octave.

‘`16th`’
:   96 dB per octave.

‘`18th`’
:   108 dB per octave.

‘`20th`’
:   120 dB per octave.

Default is 4th.

level : Set input gain level. Allowed range is from 0 to 1. Default value is 1.

gains : Set output gain for each band. Default value is 1 for all bands.

precision : Set which precision to use when processing samples.

`auto`
:   Auto pick internal sample format depending on other filters.

`float`
:   Always use single-floating point precision sample format.

`double`
:   Always use double-floating point precision sample format.

Default value is `auto`.

8.6.1 Examples

  • Split input audio stream into two bands (low and high) with split frequency of 1500 Hz, each band will be in separate stream:

ffmpeg -i in.flac -filter_complex 'acrossover=split=1500[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav - Same as above, but with higher filter order:

ffmpeg -i in.flac -filter_complex 'acrossover=split=1500:order=8th[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav - Same as above, but also with additional middle band (frequencies between 1500 and 8000):

ffmpeg -i in.flac -filter_complex 'acrossover=split=1500 8000:order=8th[LOW][MID][HIGH]' -map '[LOW]' low.wav -map '[MID]' mid.wav -map '[HIGH]' high.wav

8.7 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 doesn’t 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 continuous 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 doesn’t gate low signals for example. The human ear has a logarithmic perception, 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 amount.

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.

8.7.1 Commands

This filter supports the all above options as commands.

8.8 acue

Delay audio filtering until a given wallclock timestamp. See the cue filter.

8.9 adeclick

Remove impulsive noise from input audio.

Samples detected as impulsive noise are replaced by interpolated samples using autoregressive modelling.

window, w : Set window size, in milliseconds. Allowed range is from 10 to 100. Default value is 55 milliseconds. This sets size of window which will be processed at once.

overlap, o : Set window overlap, in percentage of window size. Allowed range is from 50 to 95. Default value is 75 percent. Setting this to a very high value increases impulsive noise removal but makes whole process much slower.

arorder, a : Set autoregression order, in percentage of window size. Allowed range is from 0 to 25. Default value is 2 percent. This option also controls quality of interpolated samples using neighbour good samples.

threshold, t : Set threshold value. Allowed range is from 1 to 100. Default value is 2. This controls the strength of impulsive noise which is going to be removed. The lower value, the more samples will be detected as impulsive noise.

burst, b : Set burst fusion, in percentage of window size. Allowed range is 0 to 10. Default value is 2. If any two samples detected as noise are spaced less than this value then any sample between those two samples will be also detected as noise.

method, m : Set overlap method.

It accepts the following values:

`add, a`
:   Select overlap-add method. Even not interpolated samples are slightly
    changed with this method.

`save, s`
:   Select overlap-save method. Not interpolated samples remain unchanged.

Default value is `a`.

8.10 adeclip

Remove clipped samples from input audio.

Samples detected as clipped are replaced by interpolated samples using autoregressive modelling.

window, w : Set window size, in milliseconds. Allowed range is from 10 to 100. Default value is 55 milliseconds. This sets size of window which will be processed at once.

overlap, o : Set window overlap, in percentage of window size. Allowed range is from 50 to 95. Default value is 75 percent.

arorder, a : Set autoregression order, in percentage of window size. Allowed range is from 0 to 25. Default value is 8 percent. This option also controls quality of interpolated samples using neighbour good samples.

threshold, t : Set threshold value. Allowed range is from 1 to 100. Default value is 10. Higher values make clip detection less aggressive.

hsize, n : Set size of histogram used to detect clips. Allowed range is from 100 to 9999. Default value is 1000. Higher values make clip detection less aggressive.

method, m : Set overlap method.

It accepts the following values:

`add, a`
:   Select overlap-add method. Even not interpolated samples are slightly changed
    with this method.

`save, s`
:   Select overlap-save method. Not interpolated samples remain unchanged.

Default value is `a`.

8.11 adecorrelate

Apply decorrelation to input audio stream.

The filter accepts the following options:

stages : Set decorrelation stages of filtering. Allowed range is from 1 to 16. Default value is 6.

seed : Set random seed used for setting delay in samples across channels.

8.12 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 ’|’. 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. If you want instead to delay in seconds, append ’s’ to number.

all : Use last set delay for all remaining channels. By default is disabled. This option if enabled changes how option delays is interpreted.

8.12.1 Examples

  • Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave the second channel (and any other channels that may be present) unchanged.

adelay=1500|0|500 - Delay second channel by 500 samples, the third channel by 700 samples and leave the first channel (and any other channels that may be present) unchanged.

adelay=0|500S|700S - Delay all channels by same number of samples:

adelay=delays=64S:all=1

8.13 adenorm

Remedy denormals in audio by adding extremely low-level noise.

This filter shall be placed before any filter that can produce denormals.

A description of the accepted parameters follows.

level : Set level of added noise in dB. Default is -351. Allowed range is from -451 to -90.

type : Set type of added noise.

`dc`
:   Add DC signal.

`ac`
:   Add AC signal.

`square`
:   Add square signal.

`pulse`
:   Add pulse signal.

Default is `dc`.

8.13.1 Commands

This filter supports the all above options as commands.

8.14 aderivative, aintegral

Compute derivative/integral of audio stream.

Applying both filters one after another produces original audio.

8.15 adrc

Apply spectral dynamic range controller filter to input audio stream.

A description of the accepted options follows.

transfer : Set the transfer expression.

The expression can contain the following constants:

`ch`
:   current channel number

`sn`
:   current sample number

`nb_channels`
:   number of channels

`t`
:   timestamp expressed in seconds

`sr`
:   sample rate

`p`
:   current frequency power value, in dB

`f`
:   current frequency in Hz

Default value is `p`.

attack : Set the attack in milliseconds. Default is 50 milliseconds. Allowed range is from 1 to 1000 milliseconds.

release : Set the release in milliseconds. Default is 100 milliseconds. Allowed range is from 5 to 2000 milliseconds.

channels : Set which channels to filter, by default all channels in audio stream are filtered.

8.15.1 Commands

This filter supports the all above options as commands.

8.15.2 Examples

  • Apply spectral compression to all frequencies with threshold of -50 dB and 1:6 ratio:

adrc=transfer='if(gt(p,-50),-50+(p-(-50))/6,p)':attack=50:release=100 - Similar to above but with 1:2 ratio and filtering only front center channel:

adrc=transfer='if(gt(p,-50),-50+(p-(-50))/2,p)':attack=50:release=100:channels=FC - Apply spectral noise gate to all frequencies with threshold of -85 dB and with short attack time and short release time:

adrc=transfer='if(lte(p,-85),p-800,p)':attack=1:release=5 - Apply spectral expansion to all frequencies with threshold of -10 dB and 1:2 ratio:

adrc=transfer='if(lt(p,-10),-10+(p-(-10))*2,p)':attack=50:release=100 - Apply limiter to max -60 dB to all frequencies, with attack of 2 ms and release of 10 ms:

adrc=transfer='min(p,-60)':attack=2:release=10

8.16 adynamicequalizer

Apply dynamic equalization to input audio stream.

A description of the accepted options follows.

threshold : Set the detection threshold used to trigger equalization. Threshold detection is using detection filter. Default value is 0. Allowed range is from 0 to 100.

dfrequency : Set the detection frequency in Hz used for detection filter used to trigger equalization. Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz.

dqfactor : Set the detection resonance factor for detection filter used to trigger equalization. Default value is 1. Allowed range is from 0.001 to 1000.

tfrequency : Set the target frequency of equalization filter. Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz.

tqfactor : Set the target resonance factor for target equalization filter. Default value is 1. Allowed range is from 0.001 to 1000.

attack : Set the amount of milliseconds the signal from detection has to rise above the detection threshold before equalization starts. Default is 20. Allowed range is between 1 and 2000.

release : Set the amount of milliseconds the signal from detection has to fall below the detection threshold before equalization ends. Default is 200. Allowed range is between 1 and 2000.

ratio : Set the ratio by which the equalization gain is raised. Default is 1. Allowed range is between 0 and 30.

makeup : Set the makeup offset by which the equalization gain is raised. Default is 0. Allowed range is between 0 and 100.

range : Set the max allowed cut/boost amount. Default is 50. Allowed range is from 1 to 200.

mode : Set the mode of filter operation, can be one of the following:

‘`listen`’
:   Output only isolated detection signal.

‘`cutbelow`’
:   Cut frequencies below detection threshold.

‘`cutabove`’
:   Cut frequencies above detection threshold.

‘`boostbelow`’
:   Boost frequencies below detection threshold.

‘`boostabove`’
:   Boost frequencies above detection threshold.

Default mode is ‘`cutbelow`’.

dftype : Set the type of detection filter, can be one of the following:

‘`bandpass`’

‘`lowpass`’

‘`highpass`’

‘`peak`’

Default type is ‘`bandpass`’.

tftype : Set the type of target filter, can be one of the following:

‘`bell`’

‘`lowshelf`’

‘`highshelf`’

Default type is ‘`bell`’.

auto : Automatically gather threshold from detection filter. By default is ‘disabled’. This option is useful to detect threshold in certain time frame of input audio stream, in such case option value is changed at runtime.

Available values are:

‘`disabled`’
:   Disable using automatically gathered threshold value.

‘`off`’
:   Stop picking threshold value.

‘`on`’
:   Start picking threshold value.

‘`adaptive`’
:   Adaptively pick threshold value, by calculating sliding window entropy.

precision : Set which precision to use when processing samples.

`auto`
:   Auto pick internal sample format depending on other filters.

`float`
:   Always use single-floating point precision sample format.

`double`
:   Always use double-floating point precision sample format.

8.16.1 Commands

This filter supports the all above options as commands.

8.17 adynamicsmooth

Apply dynamic smoothing to input audio stream.

A description of the accepted options follows.

sensitivity : Set an amount of sensitivity to frequency fluctations. Default is 2. Allowed range is from 0 to 1e+06.

basefreq : Set a base frequency for smoothing. Default value is 22050. Allowed range is from 2 to 1e+06.

8.17.1 Commands

This filter supports the all above options as commands.

8.18 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 : Set output gain of reflected signal. Default is 0.3.

delays : Set list of time intervals in milliseconds between original signal and reflections separated by ’|’. Allowed range for each delay is (0 - 90000.0]. Default is 1000.

decays : Set list of loudness of reflected signals separated by ’|’. Allowed range for each decay is (0 - 1.0]. Default is 0.5.

8.18.1 Examples

  • Make it sound as if there are twice as many instruments as are actually playing:

aecho=0.8:0.88:60:0.4 - If delay is very short, then it sounds like a (metallic) robot playing music:

aecho=0.8:0.88:6:0.4 - A longer delay will sound like an open air concert in the mountains:

aecho=0.8:0.9:1000:0.3 - Same as above but with one more mountain:

aecho=0.8:0.9:1000|1800:0.3|0.25

8.19 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 50µs (FM).

`75fm`
:   select 75µs (FM).

`50kf`
:   select 50µs (FM-KF).

`75kf`
:   select 75µs (FM-KF).

8.19.1 Commands

This filter supports the all above options as commands.

8.20 aeval

Modify an audio signal according to the specified expressions.

This filter accepts one or more expressions (one for each channel), which are evaluated and used to modify a corresponding audio signal.

It accepts the following parameters:

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_channels

nb_out_channels : input and output number of channels

val(CH) : the value of input channel with number CH

Note: this filter is slow. For faster processing you should use a dedicated filter.

8.20.1 Examples

  • Half volume:

aeval=val(ch)/2:c=same - Invert phase of the second channel:

aeval=val(0)|-val(1)

8.21 aexciter

An exciter is used to produce high sound that is not present in the original signal. This is done by creating harmonic distortions of the signal which are restricted in range and added to the original signal. An Exciter raises the upper end of an audio signal without simply raising the higher frequencies like an equalizer would do to create a more “crisp” or “brilliant” sound.

The filter accepts the following options:

level_in : Set input level prior processing of signal. Allowed range is from 0 to 64. Default value is 1.

level_out : Set output level after processing of signal. Allowed range is from 0 to 64. Default value is 1.

amount : Set the amount of harmonics added to original signal. Allowed range is from 0 to 64. Default value is 1.

drive : Set the amount of newly created harmonics. Allowed range is from 0.1 to 10. Default value is 8.5.

blend : Set the octave of newly created harmonics. Allowed range is from -10 to 10. Default value is 0.

freq : Set the lower frequency limit of producing harmonics in Hz. Allowed range is from 2000 to 12000 Hz. Default is 7500 Hz.

ceil : Set the upper frequency limit of producing harmonics. Allowed range is from 9999 to 20000 Hz. If value is lower than 10000 Hz no limit is applied.

listen : Mute the original signal and output only added harmonics. By default is disabled.

8.21.1 Commands

This filter supports the all above options as commands.

8.22 afade

Apply fade-in/out effect to input audio.

A description of the accepted parameters 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_sample, ss : Specify the number of the start sample for starting to apply the fade effect. Default is 0.

nb_samples, 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.

start_time, st : Specify the start time of the fade effect. Default is 0. The value must be specified as a time duration; see the Time duration section in the ffmpeg-utils(1) manual for the accepted syntax. If set this option is used instead of start_sample.

duration, d : Specify the duration of the fade effect. See 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

`losi`
:   select logistic sigmoid

`sinc`
:   select sine cardinal function

`isinc`
:   select inverted sine cardinal function

`quat`
:   select quartic

`quatr`
:   select quartic root

`qsin2`
:   select squared quarter of sine wave

`hsin2`
:   select squared half of sine wave

`nofade`
:   no fade applied

silence : Set the initial gain for fade-in or final gain for fade-out. Default value is 0.0.

unity : Set the initial gain for fade-out or final gain for fade-in. Default value is 1.0.

8.22.1 Commands

This filter supports the all above options as commands.

8.22.2 Examples

  • 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=875:d=25

8.23 afftdn

Denoise audio samples with FFT.

A description of the accept

(本文超出站点单文档体积上限,已截断)