=encoding utf8 =head1 NAME ffmpeg-filters - FFmpeg filters =head1 DESCRIPTION This document describes filters, sources, and sinks provided by the libavfilter library. =head1 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, I are in one linear chain, I and I 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 I<[main]> and I<[tmp]>. The stream sent to the second output of I, labelled as I<[tmp]>, is processed through the I filter, which crops away the lower half part of the video, and then vertically flipped. The I filter takes in input the first unchanged output of the split filter (which was labelled as I<[main]>), and overlay on its lower half the output generated by the I 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 I that do not have an audio/video input, and I that will not have audio/video output. =head1 GRAPH The F program included in the FFmpeg F 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 F. You can then pass the dot description to the F program (from the graphviz suite of programs) and obtain a graphical representation of the filtergraph. For example the sequence of commands: echo | \ 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 I 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 I string will need to be of the form: nullsrc,scale=640:360,nullsink you may also need to set the I parameters and add a I filter in order to simulate a specific input file. =head1 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". =head2 Filtergraph syntax A filtergraph has a textual representation, which is recognized by the B<-filter>/B<-vf>/B<-af> and B<-filter_complex> options in B and B<-vf>/B<-af> in B, and by the C function defined in F. 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: [I]...[I]I@I=I[I]...[I] I 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 "@I". The name of the filter class is optionally followed by a string "=I". I is a string which contains the parameters used to initialize the filter instance. It may have one of two forms: =over 4 =item * A ':'-separated list of I pairs. =item * A ':'-separated list of I. In this case, the keys are assumed to be the option names in the order they are declared. E.g. the C filter declares three options in this order -- B, B and B. Then the parameter list I means that the value I is assigned to the option B, I<0> to B and I<30> to B. =item * A ':'-separated list of mixed direct I and long I pairs. The direct I must precede the I pairs, and follow the same constraints order of the previous point. The following I pairs can be set in any preferred order. =back If the option value itself is a list of items (e.g. the C filter takes a list of pixel formats), the items in the list are usually separated by B<|>. The list of arguments can be quoted using the character B<'> as initial and ending mark, and the character B<\> for escaping the characters within the quoted text; otherwise the argument string is considered terminated when the next special character (belonging to the set B<[]=;,>) is encountered. A special syntax implemented in the B 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 -vf drawtext=/text=/tmp/some_text will load the text to be drawn from F. API users wishing to implement a similar feature should use the C 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 I ... I, are associated to the filter input pads, the following labels I ... I, 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 redability. 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 B filters where format conversion is required. It is possible to specify swscale flags for those automatically inserted scalers by prepending C;> to the filtergraph description. Here is a BNF description of the filtergraph syntax: ::= sequence of alphanumeric characters and '_' ::= ["@"] ::= "[" "]" ::= [] ::= sequence of chars (possibly quoted) ::= [] ["=" ] [] ::= [,] ::= [sws_flags=;] [;] =head2 Notes on filtergraph escaping Filtergraph description composition entails several levels of escaping. See B 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 C<:> used to separate values, or one of the escaping characters C<\'>. A second level escaping affects the whole filter description, which may contain the escaping characters C<\'> or the special characters C<[],;> 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 B filter description B value: this is a 'string': may contain one, or more, special characters This string contains the C<'> special escaping character, and the C<:> 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 C<\'> escaping special characters, also C<,> 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 C<\> is special and needs to be escaped with another C<\>, 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 B, you might prefer to use the B option in place of B to specify the text to render. When using the B tool, you might consider to use the B<-filter_script option> or B<-filter_complex_script option>. =head1 TIMELINE EDITING Some filters support a generic B 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: =over 4 =item B timestamp expressed in seconds, NAN if the input timestamp is unknown =item B sequential number of the input frame, starting from 0 =item B the position in the file of the input frame, NAN if unknown; deprecated, do not use =item B =item B width and height of the input frame if video =back Additionally, these filters support an B command that can be used to re-define the expression. Like any other filtering option, the B option follows the same rules. For example, to enable a blur filter (B) from 10 seconds to 3 minutes, and a B filter starting at 3 seconds: smartblur = enable='between(t,10,3*60)', curves = enable='gte(t,3)' : preset=cross_process See C to view which filters have timeline support. =head1 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 B B<-h filter=Ename of filterE>. The name of the command is the name of the option and the argument is the new value. =head1 OPTIONS FOR FILTERS WITH SEVERAL INPUTS Some filters with several inputs support a common set of options. These options can only be set by name, not with the short notation. =over 4 =item B The action to take when EOF is encountered on the secondary input; it accepts one of the following values: =over 4 =item B Repeat the last frame (the default). =item B End both streams. =item B Pass the main input through. =back =item B If set to 1, force the output to terminate when the shortest input terminates. Default value is 0. =item B 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. =item B How strictly to sync streams based on secondary input timestamps; it accepts one of the following values: =over 4 =item B Frame from secondary input with the nearest lower or equal timestamp to the primary input frame. =item B Frame from secondary input with the absolute nearest timestamp to the primary input frame. =back =back =head1 AUDIO FILTERS When you configure your FFmpeg build, you can disable any of the existing filters using C<--disable-filters>. The configure output will show the audio filters included in your build. Below is a description of the currently available audio filters. =head2 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 C and dividing it by the factor set with C. 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". C determines how long the signal has to rise above the threshold before any reduction will occur and C 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 C 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 C flattens the hard edge at the threshold in the range of the chosen decibels. The filter accepts the following options: =over 4 =item B Set input gain. Default is 1. Range is between 0.015625 and 64. =item B Set mode of compressor operation. Can be C or C. Default is C. =item B 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. =item B 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. =item B 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. =item B 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. =item B Set the amount by how much signal will be amplified after processing. Default is 1. Range is from 1 to 64. =item B Curve the sharp knee around the threshold to enter gain reduction more softly. Default is 2.82843. Range is between 1 and 8. =item B Choose if the C level between all channels of input stream or the louder(C) channel of input stream affects the reduction. Default is C. =item B Should the exact signal be taken in case of C or an RMS one in case of C. Default is C which is mostly smoother. =item B How much to use compressed signal in output. Default is 1. Range is between 0 and 1. =back =head3 Commands This filter supports the all above options as B. =head2 acontrast Simple audio dynamic range compression/expansion filter. The filter accepts the following options: =over 4 =item B Set contrast. Default is 33. Allowed range is between 0 and 100. =back =head2 acopy Copy the input audio source unchanged to the output. This is mainly useful for testing purposes. =head2 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: =over 4 =item B 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. =item B Specify the duration of the cross fade effect. See B for the accepted syntax. By default the duration is determined by I. If set this option is used instead of I. =item B Should first stream end overlap with second stream start. Default is enabled. =item B Set curve for cross fade transition for first stream. =item B Set curve for cross fade transition for second stream. For description of available curve types see B filter description. =back =head3 Examples =over 4 =item * 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 =item * 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 =back =head2 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: =over 4 =item B Set split frequencies. Those must be positive and increasing. =item B Set filter order for each band split. This controls filter roll-off or steepness of filter transfer function. Available values are: =over 4 =item B<2nd> 12 dB per octave. =item B<4th> 24 dB per octave. =item B<6th> 36 dB per octave. =item B<8th> 48 dB per octave. =item B<10th> 60 dB per octave. =item B<12th> 72 dB per octave. =item B<14th> 84 dB per octave. =item B<16th> 96 dB per octave. =item B<18th> 108 dB per octave. =item B<20th> 120 dB per octave. =back Default is I<4th>. =item B Set input gain level. Allowed range is from 0 to 1. Default value is 1. =item B Set output gain for each band. Default value is 1 for all bands. =item B Set which precision to use when processing samples. =over 4 =item B Auto pick internal sample format depending on other filters. =item B Always use single-floating point precision sample format. =item B Always use double-floating point precision sample format. =back Default value is C. =back =head3 Examples =over 4 =item * 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 =item * 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 =item * 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 =back =head2 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: =over 4 =item B Set level in. =item B Set level out. =item B Set bit reduction. =item B Set mixing amount. =item B Can be linear: C or logarithmic: C. =item B Set DC. =item B Set anti-aliasing. =item B Set sample reduction. =item B Enable LFO. By default disabled. =item B Set LFO range. =item B Set LFO rate. =back =head3 Commands This filter supports the all above options as B. =head2 acue Delay audio filtering until a given wallclock timestamp. See the B filter. =head2 adeclick Remove impulsive noise from input audio. Samples detected as impulsive noise are replaced by interpolated samples using autoregressive modelling. =over 4 =item B Set window size, in milliseconds. Allowed range is from C<10> to C<100>. Default value is C<55> milliseconds. This sets size of window which will be processed at once. =item B Set window overlap, in percentage of window size. Allowed range is from C<50> to C<95>. Default value is C<75> percent. Setting this to a very high value increases impulsive noise removal but makes whole process much slower. =item B Set autoregression order, in percentage of window size. Allowed range is from C<0> to C<25>. Default value is C<2> percent. This option also controls quality of interpolated samples using neighbour good samples. =item B Set threshold value. Allowed range is from C<1> to C<100>. Default value is C<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. =item B Set burst fusion, in percentage of window size. Allowed range is C<0> to C<10>. Default value is C<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. =item B Set overlap method. It accepts the following values: =over 4 =item B Select overlap-add method. Even not interpolated samples are slightly changed with this method. =item B Select overlap-save method. Not interpolated samples remain unchanged. =back Default value is C. =back =head2 adeclip Remove clipped samples from input audio. Samples detected as clipped are replaced by interpolated samples using autoregressive modelling. =over 4 =item B Set window size, in milliseconds. Allowed range is from C<10> to C<100>. Default value is C<55> milliseconds. This sets size of window which will be processed at once. =item B Set window overlap, in percentage of window size. Allowed range is from C<50> to C<95>. Default value is C<75> percent. =item B Set autoregression order, in percentage of window size. Allowed range is from C<0> to C<25>. Default value is C<8> percent. This option also controls quality of interpolated samples using neighbour good samples. =item B Set threshold value. Allowed range is from C<1> to C<100>. Default value is C<10>. Higher values make clip detection less aggressive. =item B Set size of histogram used to detect clips. Allowed range is from C<100> to C<9999>. Default value is C<1000>. Higher values make clip detection less aggressive. =item B Set overlap method. It accepts the following values: =over 4 =item B Select overlap-add method. Even not interpolated samples are slightly changed with this method. =item B Select overlap-save method. Not interpolated samples remain unchanged. =back Default value is C. =back =head2 adecorrelate Apply decorrelation to input audio stream. The filter accepts the following options: =over 4 =item B Set decorrelation stages of filtering. Allowed range is from 1 to 16. Default value is 6. =item B Set random seed used for setting delay in samples across channels. =back =head2 adelay Delay one or more audio channels. Samples in delayed channel are filled with silence. The filter accepts the following option: =over 4 =item B 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. =item B Use last set delay for all remaining channels. By default is disabled. This option if enabled changes how option C is interpreted. =back =head3 Examples =over 4 =item * 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 =item * 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 =item * Delay all channels by same number of samples: adelay=delays=64S:all=1 =back =head2 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. =over 4 =item B Set level of added noise in dB. Default is C<-351>. Allowed range is from -451 to -90. =item B Set type of added noise. =over 4 =item B Add DC signal. =item B Add AC signal. =item B Add square signal. =item B Add pulse signal. =back Default is C. =back =head3 Commands This filter supports the all above options as B. =head2 aderivative, aintegral Compute derivative/integral of audio stream. Applying both filters one after another produces original audio. =head2 adrc Apply spectral dynamic range controller filter to input audio stream. A description of the accepted options follows. =over 4 =item B Set the transfer expression. The expression can contain the following constants: =over 4 =item B current channel number =item B current sample number =item B number of channels =item B timestamp expressed in seconds =item B sample rate =item B

current frequency power value, in dB =item B current frequency in Hz =back Default value is C

. =item B Set the attack in milliseconds. Default is C<50> milliseconds. Allowed range is from 1 to 1000 milliseconds. =item B Set the release in milliseconds. Default is C<100> milliseconds. Allowed range is from 5 to 2000 milliseconds. =item B Set which channels to filter, by default C channels in audio stream are filtered. =back =head3 Commands This filter supports the all above options as B. =head3 Examples =over 4 =item * 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 =item * 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 =item * 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 =item * 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 =item * 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 =back =head2 adynamicequalizer Apply dynamic equalization to input audio stream. A description of the accepted options follows. =over 4 =item B 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. =item B 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. =item B Set the detection resonance factor for detection filter used to trigger equalization. Default value is 1. Allowed range is from 0.001 to 1000. =item B Set the target frequency of equalization filter. Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz. =item B Set the target resonance factor for target equalization filter. Default value is 1. Allowed range is from 0.001 to 1000. =item B 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. =item B 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. =item B Set the ratio by which the equalization gain is raised. Default is 1. Allowed range is between 0 and 30. =item B Set the makeup offset by which the equalization gain is raised. Default is 0. Allowed range is between 0 and 100. =item B Set the max allowed cut/boost amount. Default is 50. Allowed range is from 1 to 200. =item B Set the mode of filter operation, can be one of the following: =over 4 =item B Output only isolated detection signal. =item B Cut frequencies above detection threshold. =item B Boost frequencies bellow detection threshold. =back Default mode is B. =item B Set the type of detection filter, can be one of the following: =over 4 =item B =item B =item B =item B =back Default type is B. =item B Set the type of target filter, can be one of the following: =over 4 =item B =item B =item B =back Default type is B. =item B Set processing direction relative to threshold. =over 4 =item B Boost/Cut if threshold is higher/lower than detected volume. =item B Boost/Cut if threshold is lower/higher than detected volume. =back Default direction is B. =item B Automatically gather threshold from detection filter. By default is B. 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: =over 4 =item B Disable using automatically gathered threshold value. =item B Stop picking threshold value. =item B Start picking threshold value. =back =item B Set which precision to use when processing samples. =over 4 =item B Auto pick internal sample format depending on other filters. =item B Always use single-floating point precision sample format. =item B Always use double-floating point precision sample format. =back =back =head3 Commands This filter supports the all above options as B. =head2 adynamicsmooth Apply dynamic smoothing to input audio stream. A description of the accepted options follows. =over 4 =item B Set an amount of sensitivity to frequency fluctations. Default is 2. Allowed range is from 0 to 1e+06. =item B Set a base frequency for smoothing. Default value is 22050. Allowed range is from 2 to 1e+06. =back =head3 Commands This filter supports the all above options as B. =head2 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 C, and the loudness of the reflected signal is the C. Multiple echoes can have different delays and decays. A description of the accepted parameters follows. =over 4 =item B Set input gain of reflected signal. Default is C<0.6>. =item B Set output gain of reflected signal. Default is C<0.3>. =item B Set list of time intervals in milliseconds between original signal and reflections separated by '|'. Allowed range for each C is C<(0 - 90000.0]>. Default is C<1000>. =item B Set list of loudness of reflected signals separated by '|'. Allowed range for each C is C<(0 - 1.0]>. Default is C<0.5>. =back =head3 Examples =over 4 =item * Make it sound as if there are twice as many instruments as are actually playing: aecho=0.8:0.88:60:0.4 =item * If delay is very short, then it sounds like a (metallic) robot playing music: aecho=0.8:0.88:6:0.4 =item * A longer delay will sound like an open air concert in the mountains: aecho=0.8:0.9:1000:0.3 =item * Same as above but with one more mountain: aecho=0.8:0.9:1000|1800:0.3|0.25 =back =head2 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: =over 4 =item B Set input gain. =item B Set output gain. =item B Set filter mode. For restoring material use C mode, otherwise use C mode. Default is C mode. =item B Set filter type. Selects medium. Can be one of the following: =over 4 =item B select Columbia. =item B select EMI. =item B select BSI (78RPM). =item B select RIAA. =item B select Compact Disc (CD). =item B<50fm> select 50µs (FM). =item B<75fm> select 75µs (FM). =item B<50kf> select 50µs (FM-KF). =item B<75kf> select 75µs (FM-KF). =back =back =head3 Commands This filter supports the all above options as B. =head2 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: =over 4 =item B 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. =item B Set output channel layout. If not specified, the channel layout is specified by the number of expressions. If set to B, it will use by default the same input channel layout. =back Each expression in I can contain the following constants and functions: =over 4 =item B channel number of the current expression =item B number of the evaluated sample, starting from 0 =item B sample rate =item B time of the evaluated sample expressed in seconds =item B =item B input and output number of channels =item B the value of input channel with number I =back Note: this filter is slow. For faster processing you should use a dedicated filter. =head3 Examples =over 4 =item * Half volume: aeval=val(ch)/2:c=same =item * Invert phase of the second channel: aeval=val(0)|-val(1) =back =head2 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: =over 4 =item B Set input level prior processing of signal. Allowed range is from 0 to 64. Default value is 1. =item B Set output level after processing of signal. Allowed range is from 0 to 64. Default value is 1. =item B Set the amount of harmonics added to original signal. Allowed range is from 0 to 64. Default value is 1. =item B Set the amount of newly created harmonics. Allowed range is from 0.1 to 10. Default value is 8.5. =item B Set the octave of newly created harmonics. Allowed range is from -10 to 10. Default value is 0. =item B Set the lower frequency limit of producing harmonics in Hz. Allowed range is from 2000 to 12000 Hz. Default is 7500 Hz. =item B 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. =item B Mute the original signal and output only added harmonics. By default is disabled. =back =head3 Commands This filter supports the all above options as B. =head2 afade Apply fade-in/out effect to input audio. A description of the accepted parameters follows. =over 4 =item B Specify the effect type, can be either C for fade-in, or C for a fade-out effect. Default is C. =item B Specify the number of the start sample for starting to apply the fade effect. Default is 0. =item B 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. =item B Specify the start time of the fade effect. Default is 0. The value must be specified as a time duration; see B for the accepted syntax. If set this option is used instead of I. =item B Specify the duration of the fade effect. See B 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 I. If set this option is used instead of I. =item B Set curve for fade transition. It accepts the following values: =over 4 =item B select triangular, linear slope (default) =item B select quarter of sine wave =item B select half of sine wave =item B select exponential sine wave =item B select logarithmic =item B select inverted parabola =item B select quadratic =item B select cubic =item B select square root =item B select cubic root =item B select parabola =item B select exponential =item B select inverted quarter of sine wave =item B select inverted half of sine wave =item B select double-exponential seat =item B select double-exponential sigmoid =item B select logistic sigmoid =item B select sine cardinal function =item B select inverted sine cardinal function =item B select quartic =item B select quartic root =item B select squared quarter of sine wave =item B select squared half of sine wave =item B no fade applied =back =item B Set the initial gain for fade-in or final gain for fade-out. Default value is C<0.0>. =item B Set the initial gain for fade-out or final gain for fade-in. Default value is C<1.0>. =back =head3 Commands This filter supports the all above options as B. =head3 Examples =over 4 =item * Fade in first 15 seconds of audio: afade=t=in:ss=0:d=15 =item * Fade out last 25 seconds of a 900 seconds audio: afade=t=out:st=875:d=25 =back =head2 afftdn Denoise audio samples with FFT. A description of the accepted parameters follows. =over 4 =item B Set the noise reduction in dB, allowed range is 0.01 to 97. Default value is 12 dB. =item B Set the noise floor in dB, allowed range is -80 to -20. Default value is -50 dB. =item B Set the noise type. It accepts the following values: =over 4 =item B Select white noise. =item B Select vinyl noise. =item B Select shellac noise. =item B Select custom noise, defined in C option. Default value is white noise. =back =item B Set custom band noise profile for every one of 15 bands. Bands are separated by ' ' or '|'. =item B Set the residual floor in dB, allowed range is -80 to -20. Default value is -38 dB. =item B Enable noise floor tracking. By default is disabled. With this enabled, noise floor is automatically adjusted. =item B Enable residual tracking. By default is disabled. =item B Set the output mode. It accepts the following values: =over 4 =item B Pass input unchanged. =item B Pass noise filtered out. =item B Pass only noise. Default value is I. =back =item B Set the adaptivity factor, used how fast to adapt gains adjustments per each frequency bin. Value I<0> enables instant adaptation, while higher values react much slower. Allowed range is from I<0> to I<1>. Default value is I<0.5>. =item B Set the noise floor offset factor. This option is used to adjust offset applied to measured noise floor. It is only effective when noise floor tracking is enabled. Allowed range is from I<-2.0> to I<2.0>. Default value is I<1.0>. =item B Set the noise link used for multichannel audio. It accepts the following values: =over 4 =item B Use unchanged channel's noise floor. =item B Use measured min noise floor of all channels. =item B Use measured max noise floor of all channels. =item B Use measured average noise floor of all channels. Default value is I. =back =item B Set the band multiplier factor, used how much to spread bands across frequency bins. Allowed range is from I<0.2> to I<5>. Default value is I<1.25>. =item B Toggle capturing and measurement of noise profile from input audio. It accepts the following values: =over 4 =item B Start sample noise capture. =item B Stop sample noise capture and measure new noise band profile. Default value is C. =back =item B Set gain smooth spatial radius, used to smooth gains applied to each frequency bin. Useful to reduce random music noise artefacts. Higher values increases smoothing of gains. Allowed range is from C<0> to C<50>. Default value is C<0>. =back =head3 Commands This filter supports the some above mentioned options as B. =head3 Examples =over 4 =item * Reduce white noise by 10dB, and use previously measured noise floor of -40dB: afftdn=nr=10:nf=-40 =item * Reduce white noise by 10dB, also set initial noise floor to -80dB and enable automatic tracking of noise floor so noise floor will gradually change during processing: afftdn=nr=10:nf=-80:tn=1 =item * Reduce noise by 20dB, using noise floor of -40dB and using commands to take noise profile of first 0.4 seconds of input audio: asendcmd=0.0 afftdn sn start,asendcmd=0.4 afftdn sn stop,afftdn=nr=20:nf=-40 =back =head2 afftfilt Apply arbitrary expressions to samples in frequency domain. =over 4 =item B Set frequency domain real expression for each separate channel separated by '|'. Default is "re". If the number of input channels is greater than the number of expressions, the last specified expression is used for the remaining output channels. =item B Set frequency domain imaginary expression for each separate channel separated by '|'. Default is "im". Each expression in I and I can contain the following constants and functions: =over 4 =item B sample rate =item B current frequency bin number =item B number of available bins =item B channel number of the current expression =item B number of channels =item B current frame pts =item B current real part of frequency bin of current channel =item B current imaginary part of frequency bin of current channel =item B Return the value of real part of frequency bin at location (I,I) =item B Return the value of imaginary part of frequency bin at location (I,I) =back =item B Set window size. Allowed range is from 16 to 131072. Default is C<4096> =item B Set window function. It accepts the following values: =over 4 =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =back Default is C. =item B Set window overlap. If set to 1, the recommended overlap for selected window function will be picked. Default is C<0.75>. =back =head3 Examples =over 4 =item * Leave almost only low frequencies in audio: afftfilt="'real=re * (1-clip((b/nb)*b,0,1))':imag='im * (1-clip((b/nb)*b,0,1))'" =item * Apply robotize effect: afftfilt="real='hypot(re,im)*sin(0)':imag='hypot(re,im)*cos(0)':win_size=512:overlap=0.75" =item * Apply whisper effect: afftfilt="real='hypot(re,im)*cos((random(0)*2-1)*2*3.14)':imag='hypot(re,im)*sin((random(1)*2-1)*2*3.14)':win_size=128:overlap=0.8" =item * Apply phase shift: afftfilt="real=re*cos(1)-im*sin(1):imag=re*sin(1)+im*cos(1)" =back =head2 afir Apply an arbitrary Finite Impulse Response filter. This filter is designed for applying long FIR filters, up to 60 seconds long. It can be used as component for digital crossover filters, room equalization, cross talk cancellation, wavefield synthesis, auralization, ambiophonics, ambisonics and spatialization. This filter uses the streams higher than first one as FIR coefficients. If the non-first stream holds a single channel, it will be used for all input channels in the first stream, otherwise the number of channels in the non-first stream must be same as the number of channels in the first stream. It accepts the following parameters: =over 4 =item B Set dry gain. This sets input gain. =item B Set wet gain. This sets final output gain. =item B Set Impulse Response filter length. Default is 1, which means whole IR is processed. =item B Enable applying gain measured from power of IR. Set which approach to use for auto gain measurement. =over 4 =item B Do not apply any gain. =item B select peak gain, very conservative approach. This is default value. =item B select DC gain, limited application. =item B select gain to noise approach, this is most popular one. =item B select AC gain. =item B select RMS gain. =back =item B Set gain to be applied to IR coefficients before filtering. Allowed range is 0 to 1. This gain is applied after any gain applied with I option. =item B Set format of IR stream. Can be C or C. Default is C. =item B Set max allowed Impulse Response filter duration in seconds. Default is 30 seconds. Allowed range is 0.1 to 60 seconds. =item B Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream. By default it is disabled. =item B Set for which IR channel to display frequency response. By default is first channel displayed. This option is used only when I is enabled. =item B Set video stream size. This option is used only when I is enabled. =item B Set video stream frame rate. This option is used only when I is enabled. =item B Set minimal partition size used for convolution. Default is I<8192>. Allowed range is from I<1> to I<65536>. Lower values decreases latency at cost of higher CPU usage. =item B Set maximal partition size used for convolution. Default is I<8192>. Allowed range is from I<8> to I<65536>. Lower values may increase CPU usage. =item B Set number of input impulse responses streams which will be switchable at runtime. Allowed range is from I<1> to I<32>. Default is I<1>. =item B Set IR stream which will be used for convolution, starting from I<0>, should always be lower than supplied value by C option. Default is I<0>. This option can be changed at runtime via B. =item B Set which precision to use when processing samples. =over 4 =item B Auto pick internal sample format depending on other filters. =item B Always use single-floating point precision sample format. =item B Always use double-floating point precision sample format. =back Default value is auto. =item B Set when to load IR stream. Can be C or C. First one load and prepares all IRs on initialization, second one once on first access of specific IR. Default is C. =back =head3 Examples =over 4 =item * Apply reverb to stream using mono IR file as second input, complete command using ffmpeg: ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav =item * Apply true stereo processing given input stereo stream, and two stereo impulse responses for left and right channel, the impulse response files are files with names l_ir.wav and r_ir.wav: "pan=4C|c0=FL|c1=FL|c2=FR|c3=FR[a];amovie=l_ir.wav[LIR];amovie=r_ir.wav[RIR];[LIR][RIR]amerge[ir];[a][ir]afir=irfmt=input:gtype=gn:irgain=-5dB,pan=stereo|FL A '|'-separated list of requested sample formats. =item B A '|'-separated list of requested sample rates. =item B A '|'-separated list of requested channel layouts. See B for the required syntax. =back If a parameter is omitted, all values are allowed. Force the output to either unsigned 8-bit or signed 16-bit stereo aformat=sample_fmts=u8|s16:channel_layouts=stereo =head2 afreqshift Apply frequency shift to input audio samples. The filter accepts the following options: =over 4 =item B Specify frequency shift. Allowed range is -INT_MAX to INT_MAX. Default value is 0.0. =item B Set output gain applied to final output. Allowed range is from 0.0 to 1.0. Default value is 1.0. =item B Set filter order used for filtering. Allowed range is from 1 to 16. Default value is 8. =back =head3 Commands This filter supports the all above options as B. =head2 afwtdn Reduce broadband noise from input samples using Wavelets. A description of the accepted options follows. =over 4 =item B Set the noise sigma, allowed range is from 0 to 1. Default value is 0. This option controls strength of denoising applied to input samples. Most useful way to set this option is via decibels, eg. -45dB. =item B Set the number of wavelet levels of decomposition. Allowed range is from 1 to 12. Default value is 10. Setting this too low make denoising performance very poor. =item B Set wavelet type for decomposition of input frame. They are sorted by number of coefficients, from lowest to highest. More coefficients means worse filtering speed, but overall better quality. Available wavelets are: =over 4 =item B =item B =item B =item B =item B =item B =item B =back =item B Set percent of full denoising. Allowed range is from 0 to 100 percent. Default value is 85 percent or partial denoising. =item B If enabled, first input frame will be used as noise profile. If first frame samples contain non-noise performance will be very poor. =item B If enabled, input frames are analyzed for presence of noise. If noise is detected with high possibility then input frame profile will be used for processing following frames, until new noise frame is detected. =item B Set size of single frame in number of samples. Allowed range is from 512 to 65536. Default frame size is 8192 samples. =item B Set softness applied inside thresholding function. Allowed range is from 0 to 10. Default softness is 1. =back =head3 Commands This filter supports the all above options as B. =head2 agate A gate is mainly used to reduce lower parts of a signal. This kind of signal processing reduces disturbing noise between useful signals. Gating is done by detecting the volume below a chosen level I and dividing it by the factor set with I. The bottom of the noise floor is set via I. Because an exact manipulation of the signal would cause distortion of the waveform the reduction can be levelled over time. This is done by setting I and I. I determines how long the signal has to fall below the threshold before any reduction will occur and I sets the time the signal has to rise above the threshold to reduce the reduction again. Shorter signals than the chosen attack time will be left untouched. =over 4 =item B Set input level before filtering. Default is 1. Allowed range is from 0.015625 to 64. =item B Set the mode of operation. Can be C or C. Default is C. If set to C mode, higher parts of signal will be amplified, expanding dynamic range in upward direction. Otherwise, in case of C lower parts of signal will be reduced. =item B Set the level of gain reduction when the signal is below the threshold. Default is 0.06125. Allowed range is from 0 to 1. Setting this to 0 disables reduction and then filter behaves like expander. =item B If a signal rises above this level the gain reduction is released. Default is 0.125. Allowed range is from 0 to 1. =item B Set a ratio by which the signal is reduced. Default is 2. Allowed range is from 1 to 9000. =item B 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. =item B 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. =item B Set amount of amplification of signal after processing. Default is 1. Allowed range is from 1 to 64. =item B Curve the sharp knee around the threshold to enter gain reduction more softly. Default is 2.828427125. Allowed range is from 1 to 8. =item B Choose if exact signal should be taken for detection or an RMS like one. Default is C. Can be C or C. =item B Choose if the average level between all channels or the louder channel affects the reduction. Default is C. Can be C or C. =back =head3 Commands This filter supports the all above options as B. =head2 aiir Apply an arbitrary Infinite Impulse Response filter. It accepts the following parameters: =over 4 =item B Set B/numerator/zeros/reflection coefficients. =item B Set A/denominator/poles/ladder coefficients. =item B Set channels gains. =item B Set input gain. =item B Set output gain. =item B Set coefficients format. =over 4 =item B lattice-ladder function =item B analog transfer function =item B digital transfer function =item B Z-plane zeros/poles, cartesian (default) =item B Z-plane zeros/poles, polar radians =item B Z-plane zeros/poles, polar degrees =item B S-plane zeros/poles =back =item B Set type of processing. =over 4 =item B direct processing =item B serial processing =item B

parallel processing =back =item B Set filtering precision. =over 4 =item B double-precision floating-point (default) =item B single-precision floating-point =item B 32-bit integers =item B 16-bit integers =back =item B Normalize filter coefficients, by default is enabled. Enabling it will normalize magnitude response at DC to 0dB. =item B How much to use filtered signal in output. Default is 1. Range is between 0 and 1. =item B Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream. By default it is disabled. =item B Set for which IR channel to display frequency response. By default is first channel displayed. This option is used only when I is enabled. =item B Set video stream size. This option is used only when I is enabled. =back Coefficients in C and C format are separated by spaces and are in ascending order. Coefficients in C format are separated by spaces and order of coefficients doesn't matter. Coefficients in C format are complex numbers with I imaginary unit. Different coefficients and gains can be provided for every channel, in such case use '|' to separate coefficients or gains. Last provided coefficients will be used for all remaining channels. =head3 Examples =over 4 =item * Apply 2 pole elliptic notch at around 5000Hz for 48000 Hz sample rate: aiir=k=1:z=7.957584807809675810E-1 -2.575128568908332300 3.674839853930788710 -2.57512875289799137 7.957586296317130880E-1:p=1 -2.86950072432325953 3.63022088054647218 -2.28075678147272232 6.361362326477423500E-1:f=tf:r=d =item * Same as above but in C format: aiir=k=0.79575848078096756:z=0.80918701+0.58773007i 0.80918701-0.58773007i 0.80884700+0.58784055i 0.80884700-0.58784055i:p=0.63892345+0.59951235i 0.63892345-0.59951235i 0.79582691+0.44198673i 0.79582691-0.44198673i:f=zp:r=s =item * Apply 3-rd order analog normalized Butterworth low-pass filter, using analog transfer function format: aiir=z=1.3057 0 0 0:p=1.3057 2.3892 2.1860 1:f=sf:r=d =back =head2 alimiter The limiter prevents an input signal from rising over a desired threshold. This limiter uses lookahead technology to prevent your signal from distorting. It means that there is a small delay after the signal is processed. Keep in mind that the delay it produces is the attack time you set. The filter accepts the following options: =over 4 =item B Set input gain. Default is 1. =item B Set output gain. Default is 1. =item B Don't let signals above this level pass the limiter. Default is 1. =item B The limiter will reach its attenuation level in this amount of time in milliseconds. Default is 5 milliseconds. =item B Come back from limiting to attenuation 1.0 in this amount of milliseconds. Default is 50 milliseconds. =item B When gain reduction is always needed ASC takes care of releasing to an average reduction level rather than reaching a reduction of 0 in the release time. =item B Select how much the release time is affected by ASC, 0 means nearly no changes in release time while 1 produces higher release times. =item B Auto level output signal. Default is enabled. This normalizes audio back to 0dB if enabled. =item B Compensate the delay introduced by using the lookahead buffer set with attack parameter. Also flush the valid audio data in the lookahead buffer when the stream hits EOF. =back Depending on picked setting it is recommended to upsample input 2x or 4x times with B before applying this filter. =head2 allpass Apply a two-pole all-pass filter with central frequency (in Hz) I, and filter-width I. An all-pass filter changes the audio's frequency to phase relationship without changing its frequency to amplitude relationship. The filter accepts the following options: =over 4 =item B Set frequency in Hz. =item B Set method to specify band-width of filter. =over 4 =item B Hz =item B Q-Factor =item B octave =item B slope =item B kHz =back =item B Specify the band-width of a filter in width_type units. =item B How much to use filtered signal in output. Default is 1. Range is between 0 and 1. =item B Specify which channels to filter, by default all available are filtered. =item B Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. =item B Set the filter order, can be 1 or 2. Default is 2. =item B Set transform type of IIR filter. =over 4 =item B =item B =item B =item B =item B =item B =item B =back =item B Set precison of filtering. =over 4 =item B Pick automatic sample format depending on surround filters. =item B Always use signed 16-bit. =item B Always use signed 32-bit. =item B Always use float 32-bit. =item B Always use float 64-bit. =back =back =head3 Commands This filter supports the following commands: =over 4 =item B Change allpass frequency. Syntax for the command is : "I" =item B Change allpass width_type. Syntax for the command is : "I" =item B Change allpass width. Syntax for the command is : "I" =item B Change allpass mix. Syntax for the command is : "I" =back =head2 aloop Loop audio samples. The filter accepts the following options: =over 4 =item B Set the number of loops. Setting this value to -1 will result in infinite loops. Default is 0. =item B Set maximal number of samples. Default is 0. =item B Set first sample of loop. Default is 0. =item B

. Patches are searched in an area of B around the sample. The filter accepts the following options: =over 4 =item B Set denoising strength. Allowed range is from 0.00001 to 10000. Default value is 0.00001. =item B Set patch radius duration. Allowed range is from 1 to 100 milliseconds. Default value is 2 milliseconds. =item B Set research radius duration. Allowed range is from 2 to 300 milliseconds. Default value is 6 milliseconds. =item B Set the output mode. It accepts the following values: =over 4 =item B Pass input unchanged. =item B Pass noise filtered out. =item B Pass only noise. Default value is I. =back =item B Set smooth factor. Default value is I<11>. Allowed range is from I<1> to I<1000>. =back =head3 Commands This filter supports the all above options as B. =head2 anlmf, anlms Apply Normalized Least-Mean-(Squares|Fourth) algorithm to the first audio stream using the second audio stream. This adaptive filter is used to mimic a desired filter by finding the filter coefficients that relate to producing the least mean square of the error signal (difference between the desired, 2nd input audio stream and the actual signal, the 1st input audio stream). A description of the accepted options follows. =over 4 =item B Set filter order. =item B Set filter mu. =item B Set the filter eps. =item B Set the filter leakage. =item B It accepts the following values: =over 4 =item B Pass the 1st input. =item B Pass the 2nd input. =item B Pass difference between desired, 2nd input and error signal estimate. =item B Pass difference between input, 1st input and error signal estimate. =item B Pass error signal estimated samples. Default value is I. =back =back =head3 Examples =over 4 =item * One of many usages of this filter is noise reduction, input audio is filtered with same samples that are delayed by fixed amount, one such example for stereo audio is: asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o =back =head3 Commands This filter supports the same commands as options, excluding option C. =head2 anull Pass the audio source unchanged to the output. =head2 apad Pad the end of an audio stream with silence. This can be used together with B B<-shortest> to extend audio streams to the same length as the video stream. A description of the accepted options follows. =over 4 =item B Set silence packet size. Default value is 4096. =item B Set the number of samples of silence to add to the end. After the value is reached, the stream is terminated. This option is mutually exclusive with B. =item B Set the minimum total number of samples in the output audio stream. If the value is longer than the input audio length, silence is added to the end, until the value is reached. This option is mutually exclusive with B. =item B Specify the duration of samples of silence to add. See B for the accepted syntax. Used only if set to non-negative value. =item B Specify the minimum total duration in the output audio stream. See B for the accepted syntax. Used only if set to non-negative value. If the value is longer than the input audio length, silence is added to the end, until the value is reached. This option is mutually exclusive with B =back If neither the B nor the B nor B nor B option is set, the filter will add silence to the end of the input stream indefinitely. Note that for ffmpeg 4.4 and earlier a zero B or B also caused the filter to add silence indefinitely. =head3 Examples =over 4 =item * Add 1024 samples of silence to the end of the input: apad=pad_len=1024 =item * Make sure the audio output will contain at least 10000 samples, pad the input with silence if required: apad=whole_len=10000 =item * Use B to pad the audio input with silence, so that the video stream will always result the shortest and will be converted until the end in the output file when using the B option: ffmpeg -i VIDEO -i AUDIO -filter_complex "[1:0]apad" -shortest OUTPUT =back =head2 aphaser Add a phasing effect to the input audio. A phaser filter creates series of peaks and troughs in the frequency spectrum. The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect. A description of the accepted parameters follows. =over 4 =item B Set input gain. Default is 0.4. =item B Set output gain. Default is 0.74 =item B Set delay in milliseconds. Default is 3.0. =item B Set decay. Default is 0.4. =item B Set modulation speed in Hz. Default is 0.5. =item B Set modulation type. Default is triangular. It accepts the following values: =over 4 =item B =item B =back =back =head2 aphaseshift Apply phase shift to input audio samples. The filter accepts the following options: =over 4 =item B Specify phase shift. Allowed range is from -1.0 to 1.0. Default value is 0.0. =item B Set output gain applied to final output. Allowed range is from 0.0 to 1.0. Default value is 1.0. =item B Set filter order used for filtering. Allowed range is from 1 to 16. Default value is 8. =back =head3 Commands This filter supports the all above options as B. =head2 apsnr Measure Audio Peak Signal-to-Noise Ratio. This filter takes two audio streams for input, and outputs first audio stream. Results are in dB per channel at end of either input. =head2 apsyclip Apply Psychoacoustic clipper to input audio stream. The filter accepts the following options: =over 4 =item B Set input gain. By default it is 1. Range is [0.015625 - 64]. =item B Set output gain. By default it is 1. Range is [0.015625 - 64]. =item B Set the clipping start value. Default value is 0dBFS or 1. =item B Output only difference samples, useful to hear introduced distortions. By default is disabled. =item B Set strength of adaptive distortion applied. Default value is 0.5. Allowed range is from 0 to 1. =item B Set number of iterations of psychoacoustic clipper. Allowed range is from 1 to 20. Default value is 10. =item B Auto level output signal. Default is disabled. This normalizes audio back to 0dBFS if enabled. =back =head3 Commands This filter supports the all above options as B. =head2 apulsator Audio pulsator is something between an autopanner and a tremolo. But it can produce funny stereo effects as well. Pulsator changes the volume of the left and right channel based on a LFO (low frequency oscillator) with different waveforms and shifted phases. This filter have the ability to define an offset between left and right channel. An offset of 0 means that both LFO shapes match each other. The left and right channel are altered equally - a conventional tremolo. An offset of 50% means that the shape of the right channel is exactly shifted in phase (or moved backwards about half of the frequency) - pulsator acts as an autopanner. At 1 both curves match again. Every setting in between moves the phase shift gapless between all stages and produces some "bypassing" sounds with sine and triangle waveforms. The more you set the offset near 1 (starting from the 0.5) the faster the signal passes from the left to the right speaker. The filter accepts the following options: =over 4 =item B Set input gain. By default it is 1. Range is [0.015625 - 64]. =item B Set output gain. By default it is 1. Range is [0.015625 - 64]. =item B Set waveform shape the LFO will use. Can be one of: sine, triangle, square, sawup or sawdown. Default is sine. =item B Set modulation. Define how much of original signal is affected by the LFO. =item B Set left channel offset. Default is 0. Allowed range is [0 - 1]. =item B Set right channel offset. Default is 0.5. Allowed range is [0 - 1]. =item B Set pulse width. Default is 1. Allowed range is [0 - 2]. =item B Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz. =item B Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing is set to bpm. =item B Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing is set to ms. =item B Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used if timing is set to hz. =back =head2 aresample Resample the input audio to the specified parameters, using the libswresample library. If none are specified then the filter will automatically convert between its input and output. This filter is also able to stretch/squeeze the audio data to make it match the timestamps or to inject silence / cut out audio to make it match the timestamps, do a combination of both or do neither. The filter accepts the syntax [I:]I, where I expresses a sample rate and I is a list of I=I pairs, separated by ":". See the B<"Resampler Options" section in the ffmpeg-resampler(1) manual> for the complete list of supported options. =head3 Examples =over 4 =item * Resample the input audio to 44100Hz: aresample=44100 =item * Stretch/squeeze samples to the given timestamps, with a maximum of 1000 samples per second compensation: aresample=async=1000 =back =head2 areverse Reverse an audio clip. Warning: This filter requires memory to buffer the entire clip, so trimming is suggested. =head3 Examples =over 4 =item * Take the first 5 seconds of a clip, and reverse it. atrim=end=5,areverse =back =head2 arls Apply Recursive Least Squares algorithm to the first audio stream using the second audio stream. This adaptive filter is used to mimic a desired filter by recursively finding the filter coefficients that relate to producing the minimal weighted linear least squares cost function of the error signal (difference between the desired, 2nd input audio stream and the actual signal, the 1st input audio stream). A description of the accepted options follows. =over 4 =item B Set the filter order. =item B Set the forgetting factor. =item B Set the coefficient to initialize internal covariance matrix. =item B Set the filter output samples. It accepts the following values: =over 4 =item B Pass the 1st input. =item B Pass the 2nd input. =item B Pass difference between desired, 2nd input and error signal estimate. =item B Pass difference between input, 1st input and error signal estimate. =item B Pass error signal estimated samples. Default value is I. =back =back =head2 arnndn Reduce noise from speech using Recurrent Neural Networks. This filter accepts the following options: =over 4 =item B Set train model file to load. This option is always required. =item B Set how much to mix filtered samples into final output. Allowed range is from -1 to 1. Default value is 1. Negative values are special, they set how much to keep filtered noise in the final filter output. Set this option to -1 to hear actual noise removed from input signal. =back =head3 Commands This filter supports the all above options as B. =head2 asdr Measure Audio Signal-to-Distortion Ratio. This filter takes two audio streams for input, and outputs first audio stream. Results are in dB per channel at end of either input. =head2 asetnsamples Set the number of samples per each output audio frame. The last output packet may contain a different number of samples, as the filter will flush all the remaining samples when the input audio signals its end. The filter accepts the following options: =over 4 =item B Set the number of frames per each output audio frame. The number is intended as the number of samples I. Default value is 1024. =item B If set to 1, the filter will pad the last audio frame with zeroes, so that the last frame will contain the same number of samples as the previous ones. Default value is 1. =back For example, to set the number of per-frame samples to 1234 and disable padding for the last frame, use: asetnsamples=n=1234:p=0 =head2 asetrate Set the sample rate without altering the PCM data. This will result in a change of speed and pitch. The filter accepts the following options: =over 4 =item B Set the output sample rate. Default is 44100 Hz. =back =head2 ashowinfo Show a line containing various information for each input audio frame. The input audio is not modified. The shown line contains a sequence of key/value pairs of the form I:I. The following values are shown in the output: =over 4 =item B The (sequential) number of the input frame, starting from 0. =item B The presentation timestamp of the input frame, in time base units; the time base depends on the filter input pad, and is usually 1/I. =item B The presentation timestamp of the input frame in seconds. =item B The sample format. =item B The channel layout. =item B The sample rate for the audio frame. =item B The number of samples (per channel) in the frame. =item B 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. =item B A list of Adler-32 checksums for each data plane. =back =head2 asisdr Measure Audio Scaled-Invariant Signal-to-Distortion Ratio. This filter takes two audio streams for input, and outputs first audio stream. Results are in dB per channel at end of either input. =head2 asoftclip Apply audio soft clipping. Soft clipping is a type of distortion effect where the amplitude of a signal is saturated along a smooth curve, rather than the abrupt shape of hard-clipping. This filter accepts the following options: =over 4 =item B Set type of soft-clipping. It accepts the following values: =over 4 =item B =item B =item B =item B =item B =item B =item B =item B =item B =back =item B Set threshold from where to start clipping. Default value is 0dB or 1. =item B Set gain applied to output. Default value is 0dB or 1. =item B Set additional parameter which controls sigmoid function. =item B Set oversampling factor. =back =head3 Commands This filter supports the all above options as B. =head2 aspectralstats Display frequency domain statistical information about the audio channels. Statistics are calculated and stored as metadata for each audio channel and for each audio frame. It accepts the following option: =over 4 =item B Set the window length in samples. Default value is 2048. Allowed range is from 32 to 65536. =item B Set window function. It accepts the following values: =over 4 =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =back Default is C. =item B Set window overlap. Allowed range is from C<0> to C<1>. Default value is C<0.5>. =item B Select the parameters which are measured. The metadata keys can be used as flags, default is B which measures everything. B disables all measurement. =back A list of each metadata key follows: =over 4 =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =back =head2 asr Automatic Speech Recognition This filter uses PocketSphinx for speech recognition. To enable compilation of this filter, you need to configure FFmpeg with C<--enable-pocketsphinx>. It accepts the following options: =over 4 =item B Set sampling rate of input audio. Defaults is C<16000>. This need to match speech models, otherwise one will get poor results. =item B Set dictionary containing acoustic model files. =item B Set pronunciation dictionary. =item B Set language model file. =item B Set language model set. =item B Set which language model to use. =item B Set output for log messages. =back The filter exports recognized speech as the frame metadata C. =head2 astats Display time domain statistical information about the audio channels. Statistics are calculated and displayed for each audio channel and, where applicable, an overall figure is also given. It accepts the following option: =over 4 =item B Short window length in seconds, used for peak and trough RMS measurement. Default is C<0.05> (50 milliseconds). Allowed range is C<[0 - 10]>. =item B Set metadata injection. All the metadata keys are prefixed with C, where C is channel number starting from 1 or string C. Default is disabled. Available keys for each channel are: I I I I I I I I I I I I I I I I I I I I I I I I and for C: I I I I I I I I I I I I I I I I I I I I I I For example, a full key looks like C or C. Read below for the description of the keys. =item B Set the number of frames over which cumulative stats are calculated before being reset. Default is disabled. =item B Select the parameters which are measured per channel. The metadata keys can be used as flags, default is B which measures everything. B disables all per channel measurement. =item B Select the parameters which are measured overall. The metadata keys can be used as flags, default is B which measures everything. B disables all overall measurement. =back A description of the measure keys follow: =over 4 =item B no measures =item B all measures =item B overall bit depth of audio, i.e. number of bits used for each sample =item B standard ratio of peak to RMS level (note: not in dB) =item B mean amplitude displacement from zero =item B measured dynamic range of audio in dB =item B entropy measured across whole audio, entropy of value near 1.0 is typically measured for white noise =item B flatness (i.e. consecutive samples with the same value) of the signal at its peak levels (i.e. either I or I) =item B maximal difference between two consecutive samples =item B maximal sample level =item B mean difference between two consecutive samples, i.e. the average of each difference between two consecutive samples =item B minimal difference between two consecutive samples =item B minimal sample level =item B minimum local peak measured in dBFS over a short window =item B number of occasions (not the number of samples) that the signal attained I =item B number of samples with an infinite value =item B number of samples with a NaN (not a number) value =item B number of samples with a subnormal value =item B number of samples =item B number of occasions (not the number of samples) that the signal attained either I or I =item B number of occasions that the absolute samples taken from the signal attained max absolute value of I and I =item B standard peak level measured in dBFS =item B Root Mean Square difference between two consecutive samples =item B standard RMS level measured in dBFS =item B =item B peak and trough values for RMS level measured over a short window, measured in dBFS. =item B number of points where the waveform crosses the zero level axis =item B rate of Zero crossings and number of audio samples =back =head2 asubboost Boost subwoofer frequencies. The filter accepts the following options: =over 4 =item B Set dry gain, how much of original signal is kept. Allowed range is from 0 to 1. Default value is 1.0. =item B Set wet gain, how much of filtered signal is kept. Allowed range is from 0 to 1. Default value is 1.0. =item B Set max boost factor. Allowed range is from 1 to 12. Default value is 2. =item B Set delay line decay gain value. Allowed range is from 0 to 1. Default value is 0.0. =item B Set delay line feedback gain value. Allowed range is from 0 to 1. Default value is 0.9. =item B Set cutoff frequency in Hertz. Allowed range is 50 to 900. Default value is 100. =item B Set slope amount for cutoff frequency. Allowed range is 0.0001 to 1. Default value is 0.5. =item B Set delay. Allowed range is from 1 to 100. Default value is 20. =item B Set the channels to process. Default value is all available. =back =head3 Commands This filter supports the all above options as B. =head2 asubcut Cut subwoofer frequencies. This filter allows to set custom, steeper roll off than highpass filter, and thus is able to more attenuate frequency content in stop-band. The filter accepts the following options: =over 4 =item B Set cutoff frequency in Hertz. Allowed range is 2 to 200. Default value is 20. =item B Set filter order. Available values are from 3 to 20. Default value is 10. =item B Set input gain level. Allowed range is from 0 to 1. Default value is 1. =back =head3 Commands This filter supports the all above options as B. =head2 asupercut Cut super frequencies. The filter accepts the following options: =over 4 =item B Set cutoff frequency in Hertz. Allowed range is 20000 to 192000. Default value is 20000. =item B Set filter order. Available values are from 3 to 20. Default value is 10. =item B Set input gain level. Allowed range is from 0 to 1. Default value is 1. =back =head3 Commands This filter supports the all above options as B. =head2 asuperpass Apply high order Butterworth band-pass filter. The filter accepts the following options: =over 4 =item B Set center frequency in Hertz. Allowed range is 2 to 999999. Default value is 1000. =item B Set filter order. Available values are from 4 to 20. Default value is 4. =item B Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1. =item B Set input gain level. Allowed range is from 0 to 2. Default value is 1. =back =head3 Commands This filter supports the all above options as B. =head2 asuperstop Apply high order Butterworth band-stop filter. The filter accepts the following options: =over 4 =item B Set center frequency in Hertz. Allowed range is 2 to 999999. Default value is 1000. =item B Set filter order. Available values are from 4 to 20. Default value is 4. =item B Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1. =item B Set input gain level. Allowed range is from 0 to 2. Default value is 1. =back =head3 Commands This filter supports the all above options as B. =head2 atempo Adjust audio tempo. The filter accepts exactly one parameter, the audio tempo. If not specified then the filter will assume nominal 1.0 tempo. Tempo must be in the [0.5, 100.0] range. Note that tempo greater than 2 will skip some samples rather than blend them in. If for any reason this is a concern it is always possible to daisy-chain several instances of atempo to achieve the desired product tempo. =head3 Examples =over 4 =item * Slow down audio to 80% tempo: atempo=0.8 =item * To speed up audio to 300% tempo: atempo=3 =item * To speed up audio to 300% tempo by daisy-chaining two atempo instances: atempo=sqrt(3),atempo=sqrt(3) =back =head3 Commands This filter supports the following commands: =over 4 =item B Change filter tempo scale factor. Syntax for the command is : "I" =back =head2 atilt Apply spectral tilt filter to audio stream. This filter apply any spectral roll-off slope over any specified frequency band. The filter accepts the following options: =over 4 =item B Set central frequency of tilt in Hz. Default is 10000 Hz. =item B Set slope direction of tilt. Default is 0. Allowed range is from -1 to 1. =item B Set width of tilt. Default is 1000. Allowed range is from 100 to 10000. =item B Set order of tilt filter. =item B Set input volume level. Allowed range is from 0 to 4. Defalt is 1. =back =head3 Commands This filter supports the all above options as B. =head2 atrim Trim the input so that the output contains one continuous subpart of the input. It accepts the following parameters: =over 4 =item B Timestamp (in seconds) of the start of the section to keep. I.e. the audio sample with the timestamp I will be the first sample in the output. =item B Specify time of the first audio sample that will be dropped, i.e. the audio sample immediately preceding the one with the timestamp I will be the last sample in the output. =item B Same as I, except this option sets the start timestamp in samples instead of seconds. =item B Same as I, except this option sets the end timestamp in samples instead of seconds. =item B The maximum duration of the output in seconds. =item B The number of the first sample that should be output. =item B The number of the first sample that should be dropped. =back B, B, and B are expressed as time duration specifications; see B. Note that the first two sets of the start/end options and the B option look at the frame timestamp, while the _sample options simply count the samples that pass through the filter. So start/end_pts and start/end_sample will give different results when the timestamps are wrong, inexact or do not start at zero. Also note that this filter does not modify the timestamps. If you wish to have the output timestamps start at zero, insert the asetpts filter after the atrim filter. If multiple start or end options are set, this filter tries to be greedy and keep all samples that match at least one of the specified constraints. To keep only the part that matches all the constraints at once, chain multiple atrim filters. The defaults are such that all the input is kept. So it is possible to set e.g. just the end values to keep everything before the specified time. Examples: =over 4 =item * Drop everything except the second minute of input: ffmpeg -i INPUT -af atrim=60:120 =item * Keep only the first 1000 samples: ffmpeg -i INPUT -af atrim=end_sample=1000 =back =head2 axcorrelate Calculate normalized windowed cross-correlation between two input audio streams. Resulted samples are always between -1 and 1 inclusive. If result is 1 it means two input samples are highly correlated in that selected segment. Result 0 means they are not correlated at all. If result is -1 it means two input samples are out of phase, which means they cancel each other. The filter accepts the following options: =over 4 =item B Set size of segment over which cross-correlation is calculated. Default is 256. Allowed range is from 2 to 131072. =item B Set algorithm for cross-correlation. Can be C or C or C. Default is C. Fast algorithm assumes mean values over any given segment are always zero and thus need much less calculations to make. This is generally not true, but is valid for typical audio streams. =back =head3 Examples =over 4 =item * Calculate correlation between channels in stereo audio stream: ffmpeg -i stereo.wav -af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav =back =head2 bandpass Apply a two-pole Butterworth band-pass filter with central frequency I, and (3dB-point) band-width width. The I option selects a constant skirt gain (peak gain = Q) instead of the default: constant 0dB peak gain. The filter roll off at 6dB per octave (20dB per decade). The filter accepts the following options: =over 4 =item B Set the filter's central frequency. Default is C<3000>. =item B Constant skirt gain if set to 1. Defaults to 0. =item B Set method to specify band-width of filter. =over 4 =item B Hz =item B Q-Factor =item B octave =item B slope =item B kHz =back =item B Specify the band-width of a filter in width_type units. =item B How much to use filtered signal in output. Default is 1. Range is between 0 and 1. =item B Specify which channels to filter, by default all available are filtered. =item B Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. =item B Set transform type of IIR filter. =over 4 =item B =item B =item B =item B =item B =item B =item B =back =item B Set precison of filtering. =over 4 =item B Pick automatic sample format depending on surround filters. =item B Always use signed 16-bit. =item B Always use signed 32-bit. =item B Always use float 32-bit. =item B Always use float 64-bit. =back =item B Set block size used for reverse IIR processing. If this value is set to high enough value (higher than impulse response length truncated when reaches near zero values) filtering will become linear phase otherwise if not big enough it will just produce nasty artifacts. Note that filter delay will be exactly this many samples when set to non-zero value. =back =head3 Commands This filter supports the following commands: =over 4 =item B Change bandpass frequency. Syntax for the command is : "I" =item B Change bandpass width_type. Syntax for the command is : "I" =item B Change bandpass width. Syntax for the command is : "I" =item B Change bandpass mix. Syntax for the command is : "I" =back =head2 bandreject Apply a two-pole Butterworth band-reject filter with central frequency I, and (3dB-point) band-width I. The filter roll off at 6dB per octave (20dB per decade). The filter accepts the following options: =over 4 =item B Set the filter's central frequency. Default is C<3000>. =item B Set method to specify band-width of filter. =over 4 =item B Hz =item B Q-Factor =item B octave =item B slope =item B kHz =back =item B Specify the band-width of a filter in width_type units. =item B How much to use filtered signal in output. Default is 1. Range is between 0 and 1. =item B Specify which channels to filter, by default all available are filtered. =item B Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. =item B Set transform type of IIR filter. =over 4 =item B =item B =item B =item B =item B =item B =item B =back =item B Set precison of filtering. =over 4 =item B Pick automatic sample format depending on surround filters. =item B Always use signed 16-bit. =item B Always use signed 32-bit. =item B Always use float 32-bit. =item B Always use float 64-bit. =back =item B Set block size used for reverse IIR processing. If this value is set to high enough value (higher than impulse response length truncated when reaches near zero values) filtering will become linear phase otherwise if not big enough it will just produce nasty artifacts. Note that filter delay will be exactly this many samples when set to non-zero value. =back =head3 Commands This filter supports the following commands: =over 4 =item B Change bandreject frequency. Syntax for the command is : "I" =item B Change bandreject width_type. Syntax for the command is : "I" =item B Change bandreject width. Syntax for the command is : "I" =item B Change bandreject mix. Syntax for the command is : "I" =back =head2 bass, lowshelf Boost or cut the bass (lower) frequencies of the audio using a two-pole shelving filter with a response similar to that of a standard hi-fi's tone-controls. This is also known as shelving equalisation (EQ). The filter accepts the following options: =over 4 =item B Give the gain at 0 Hz. Its useful range is about -20 (for a large cut) to +20 (for a large boost). Beware of clipping when using a positive gain. =item B Set the filter's central frequency and so can be used to extend or reduce the frequency range to be boosted or cut. The default value is C<100> Hz. =item B Set method to specify band-width of filter. =over 4 =item B Hz =item B Q-Factor =item B octave =item B slope =item B kHz =back =item B Determine how steep is the filter's shelf transition. =item B Set number of poles. Default is 2. =item B How much to use filtered signal in output. Default is 1. Range is between 0 and 1. =item B Specify which channels to filter, by default all available are filtered. =item B Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. =item B Set transform type of IIR filter. =over 4 =item B =item B =item B =item B =item B =item B =item B =back =item B Set precison of filtering. =over 4 =item B Pick automatic sample format depending on surround filters. =item B Always use signed 16-bit. =item B Always use signed 32-bit. =item B Always use float 32-bit. =item B Always use float 64-bit. =back =item B Set block size used for reverse IIR processing. If this value is set to high enough value (higher than impulse response length truncated when reaches near zero values) filtering will become linear phase otherwise if not big enough it will just produce nasty artifacts. Note that filter delay will be exactly this many samples when set to non-zero value. =back =head3 Commands This filter supports the following commands: =over 4 =item B Change bass frequency. Syntax for the command is : "I" =item B Change bass width_type. Syntax for the command is : "I" =item B Change bass width. Syntax for the command is : "I" =item B Change bass gain. Syntax for the command is : "I" =item B Change bass mix. Syntax for the command is : "I" =back =head2 biquad Apply a biquad IIR filter with the given coefficients. Where I, I, I and I, I, I are the numerator and denominator coefficients respectively. and I, I specify which channels to filter, by default all available are filtered. =head3 Commands This filter supports the following commands: =over 4 =item B =item B =item B =item B =item B =item B Change biquad parameter. Syntax for the command is : "I" =item B How much to use filtered signal in output. Default is 1. Range is between 0 and 1. =item B Specify which channels to filter, by default all available are filtered. =item B Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. =item B Set transform type of IIR filter. =over 4 =item B =item B =item B =item B =item B =item B =item B =back =item B Set precison of filtering. =over 4 =item B Pick automatic sample format depending on surround filters. =item B Always use signed 16-bit. =item B Always use signed 32-bit. =item B Always use float 32-bit. =item B Always use float 64-bit. =back =item B Set block size used for reverse IIR processing. If this value is set to high enough value (higher than impulse response length truncated when reaches near zero values) filtering will become linear phase otherwise if not big enough it will just produce nasty artifacts. Note that filter delay will be exactly this many samples when set to non-zero value. =back =head2 bs2b Bauer stereo to binaural transformation, which improves headphone listening of stereo audio records. To enable compilation of this filter you need to configure FFmpeg with C<--enable-libbs2b>. It accepts the following parameters: =over 4 =item B Pre-defined crossfeed level. =over 4 =item B Default level (fcut=700, feed=50). =item B Chu Moy circuit (fcut=700, feed=60). =item B Jan Meier circuit (fcut=650, feed=95). =back =item B Cut frequency (in Hz). =item B Feed level (in Hz). =back =head2 channelmap Remap input channels to new locations. It accepts the following parameters: =over 4 =item B Map channels from input to output. The argument is a '|'-separated list of mappings, each in the C-I> or I form. I can be either the name of the input channel (e.g. FL for front left) or its index in the input channel layout. I is the name of the output channel or its index in the output channel layout. If I is not given then it is implicitly an index, starting with zero and increasing by one for each mapping. =item B The channel layout of the output stream. =back If no mapping is present, the filter will implicitly map input channels to output channels, preserving indices. =head3 Examples =over 4 =item * For example, assuming a 5.1+downmix input MOV file, ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav will create an output WAV file tagged as stereo from the downmix channels of the input. =item * To fix a 5.1 WAV improperly encoded in AAC's native channel order ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav =back =head2 channelsplit Split each channel from an input audio stream into a separate output stream. It accepts the following parameters: =over 4 =item B The channel layout of the input stream. The default is "stereo". =item B A channel layout describing the channels to be extracted as separate output streams or "all" to extract each input channel as a separate stream. The default is "all". Choosing channels not present in channel layout in the input will result in an error. =back =head3 Examples =over 4 =item * For example, assuming a stereo input MP3 file, ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv will create an output Matroska file with two audio streams, one containing only the left channel and the other the right channel. =item * Split a 5.1 WAV file into per-channel files: ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]' -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]' front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]' side_right.wav =item * Extract only LFE from a 5.1 WAV file: ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1:channels=LFE[LFE]' -map '[LFE]' lfe.wav =back =head2 chorus Add a chorus effect to the audio. Can make a single vocal sound like a chorus, but can also be applied to instrumentation. Chorus resembles an echo effect with a short delay, but whereas with echo the delay is constant, with chorus, it is varied using using sinusoidal or triangular modulation. The modulation depth defines the range the modulated delay is played before or after the delay. Hence the delayed sound will sound slower or faster, that is the delayed sound tuned around the original one, like in a chorus where some vocals are slightly off key. It accepts the following parameters: =over 4 =item B Set input gain. Default is 0.4. =item B Set output gain. Default is 0.4. =item B Set delays. A typical delay is around 40ms to 60ms. =item B Set decays. =item B Set speeds. =item B Set depths. =back =head3 Examples =over 4 =item * A single delay: chorus=0.7:0.9:55:0.4:0.25:2 =item * Two delays: chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3 =item * Fuller sounding chorus with three delays: chorus=0.5:0.9:50|60|40:0.4|0.32|0.3:0.25|0.4|0.3:2|2.3|1.3 =back =head2 compand Compress or expand the audio's dynamic range. It accepts the following parameters: =over 4 =item B =item B A list of times in seconds for each channel over which the instantaneous level of the input signal is averaged to determine its volume. I refers to increase of volume and I 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. =item B 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: C or C The input values must be in strictly increasing order but the transfer function does not have to be monotonically rising. The point C<0/0> is assumed but may be overridden (by C<0/out-dBn>). Typical values for the transfer function are C<-70/-70|-60/-20|1/0>. =item B Set the curve radius in dB for all joints. It defaults to 0.01. =item B 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. =item B 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. =item B 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. =back =head3 Examples =over 4 =item * 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 Another example for audio with whisper and explosion parts: compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0 =item * 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 =item * 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 squelch): compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1 =item * 2:1 compression starting at -6dB: compand=points=-80/-80|-6/-6|0/-3.8|20/3.5 =item * 2:1 compression starting at -9dB: compand=points=-80/-80|-9/-9|0/-5.3|20/2.9 =item * 2:1 compression starting at -12dB: compand=points=-80/-80|-12/-12|0/-6.8|20/1.9 =item * 2:1 compression starting at -18dB: compand=points=-80/-80|-18/-18|0/-9.8|20/0.7 =item * 3:1 compression starting at -15dB: compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2 =item * Compressor/Gate: compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6 =item * 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 =item * Hard limiter at -6dB: compand=attacks=0:points=-80/-80|-6/-6|20/-6 =item * Hard limiter at -12dB: compand=attacks=0:points=-80/-80|-12/-12|20/-12 =item * Hard noise gate at -35 dB: compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20 =item * Soft limiter: compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8 =back =head2 compensationdelay Compensation Delay Line is a metric based delay to compensate differing positions of microphones or speakers. For example, you have recorded guitar with two microphones placed in different locations. Because the front of sound wave has fixed speed in normal conditions, the phasing of microphones can vary and depends on their location and interposition. The best sound mix can be achieved when these microphones are in phase (synchronized). Note that a distance of ~30 cm between microphones makes one microphone capture the signal in antiphase to the other microphone. That makes the final mix sound moody. This filter helps to solve phasing problems by adding different delays to each microphone track and make them synchronized. The best result can be reached when you take one track as base and synchronize other tracks one by one with it. Remember that synchronization/delay tolerance depends on sample rate, too. Higher sample rates will give more tolerance. The filter accepts the following parameters: =over 4 =item B Set millimeters distance. This is compensation distance for fine tuning. Default is 0. =item B Set cm distance. This is compensation distance for tightening distance setup. Default is 0. =item B Set meters distance. This is compensation distance for hard distance setup. Default is 0. =item B Set dry amount. Amount of unprocessed (dry) signal. Default is 0. =item B Set wet amount. Amount of processed (wet) signal. Default is 1. =item B Set temperature in degrees Celsius. This is the temperature of the environment. Default is 20. =back =head3 Commands This filter supports the all above options as B. =head2 crossfeed Apply headphone crossfeed filter. Crossfeed is the process of blending the left and right channels of stereo audio recording. It is mainly used to reduce extreme stereo separation of low frequencies. The intent is to produce more speaker like sound to the listener. The filter accepts the following options: =over 4 =item B Set strength of crossfeed. Default is 0.2. Allowed range is from 0 to 1. This sets gain of low shelf filter for side part of stereo image. Default is -6dB. Max allowed is -30db when strength is set to 1. =item B Set soundstage wideness. Default is 0.5. Allowed range is from 0 to 1. This sets cut off frequency of low shelf filter. Default is cut off near 1550 Hz. With range set to 1 cut off frequency is set to 2100 Hz. =item B Set curve slope of low shelf filter. Default is 0.5. Allowed range is from 0.01 to 1. =item B Set input gain. Default is 0.9. =item B Set output gain. Default is 1. =item B Set block size used for reverse IIR processing. If this value is set to high enough value (higher than impulse response length truncated when reaches near zero values) filtering will become linear phase otherwise if not big enough it will just produce nasty artifacts. Note that filter delay will be exactly this many samples when set to non-zero value. =back =head3 Commands This filter supports the all above options as B. =head2 crystalizer Simple algorithm for audio noise sharpening. This filter linearly increases differences betweeen each audio sample. The filter accepts the following options: =over 4 =item B Sets the intensity of effect (default: 2.0). Must be in range between -10.0 to 0 (unchanged sound) to 10.0 (maximum effect). To inverse filtering use negative value. =item B Enable clipping. By default is enabled. =back =head3 Commands This filter supports the all above options as B. =head2 dcshift Apply a DC shift to the audio. This can be useful to remove a DC offset (caused perhaps by a hardware problem in the recording chain) from the audio. The effect of a DC offset is reduced headroom and hence volume. The B filter can be used to determine if a signal has a DC offset. =over 4 =item B Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift the audio. =item B Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is used to prevent clipping. =back =head2 deesser Apply de-essing to the audio samples. =over 4 =item B Set intensity for triggering de-essing. Allowed range is from 0 to 1. Default is 0. =item B Set amount of ducking on treble part of sound. Allowed range is from 0 to 1. Default is 0.5. =item B How much of original frequency content to keep when de-essing. Allowed range is from 0 to 1. Default is 0.5. =item B Set the output mode. It accepts the following values: =over 4 =item B Pass input unchanged. =item B Pass ess filtered out. =item B Pass only ess. Default value is I. =back =back =head2 dialoguenhance Enhance dialogue in stereo audio. This filter accepts stereo input and produce surround (3.0) channels output. The newly produced front center channel have enhanced speech dialogue originally available in both stereo channels. This filter outputs front left and front right channels same as available in stereo input. The filter accepts the following options: =over 4 =item B Set the original center factor to keep in front center channel output. Allowed range is from 0 to 1. Default value is 1. =item B Set the dialogue enhance factor to put in front center channel output. Allowed range is from 0 to 3. Default value is 1. =item B Set the voice detection factor. Allowed range is from 2 to 32. Default value is 2. =back =head3 Commands This filter supports the all above options as B. =head2 drmeter Measure audio dynamic range. DR values of 14 and higher is found in very dynamic material. DR of 8 to 13 is found in transition material. And anything less that 8 have very poor dynamics and is very compressed. The filter accepts the following options: =over 4 =item B Set window length in seconds used to split audio into segments of equal length. Default is 3 seconds. =back =head2 dynaudnorm Dynamic Audio Normalizer. This filter applies a certain amount of gain to the input audio in order to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in contrast to more "simple" normalization algorithms, the Dynamic Audio Normalizer *dynamically* re-adjusts the gain factor to the input audio. This allows for applying extra gain to the "quiet" sections of the audio while avoiding distortions or clipping the "loud" sections. In other words: 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 level. Note, however, that the Dynamic Audio Normalizer achieves this goal *without* applying "dynamic range compressing". It will retain 100% of the dynamic range *within* each section of the audio file. =over 4 =item B 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. =item B 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 C of the Gaussian smoothing filter. The filter's 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. =item B 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 frame's 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. =item B 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 frame's highest magnitude sample. However, the Dynamic Audio Normalizer additionally bounds the frame's 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. =item B 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 frame's 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 frame's 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 signal's 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 frame's 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 frame's highest magnitude sample, in order to prevent clipping. =item B 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 channel's highest magnitude sample. This allows for harmonizing the volume of the different channels. =item B 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 frame's 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. =item B 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. =item B 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 Normalizer's 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. =item B Set the target threshold value. This specifies the lowest permissible magnitude level for the audio input which will be normalized. If input frame volume is above this value frame will be normalized. Otherwise frame may not be normalized at all. The default value is set to 0, which means all input frames will be normalized. This option is mostly useful if digital noise is not wanted to be amplified. =item B Specify which channels to filter, by default all available channels are filtered. =item B Specify overlap for frames. If set to 0 (default) no frame overlapping is done. Using E0 and E1 values will make less conservative gain adjustments, like when framelen option is set to smaller value, if framelen option value is compensated for non-zero overlap then gain adjustments will be smoother across time compared to zero overlap case. =item B Specify the peak mapping curve expression which is going to be used when calculating gain applied to frames. The max output frame gain will still be limited by other options mentioned previously for this filter. The expression can contain the following constants: =over 4 =item B current channel number =item B current sample number =item B number of channels =item B timestamp expressed in seconds =item B sample rate =item B

current frame peak value =back =back =head3 Commands This filter supports the all above options as B. =head2 earwax Make audio easier to listen to on headphones. This filter adds `cues' to 44.1kHz stereo (i.e. audio CD format) audio so that when listened to on headphones the stereo image is moved from inside your head (standard for headphones) to outside and in front of the listener (standard for speakers). Ported from SoX. =head2 equalizer Apply a two-pole peaking equalisation (EQ) filter. With this filter, the signal-level at and around a selected frequency can be increased or decreased, whilst (unlike bandpass and bandreject filters) that at all other frequencies is unchanged. In order to produce complex equalisation curves, this filter can be given several times, each with a different central frequency. The filter accepts the following options: =over 4 =item B Set the filter's central frequency in Hz. =item B Set method to specify band-width of filter. =over 4 =item B Hz =item B Q-Factor =item B octave =item B slope =item B kHz =back =item B Specify the band-width of a filter in width_type units. =item B Set the required gain or attenuation in dB. Beware of clipping when using a positive gain. =item B How much to use filtered signal in output. Default is 1. Range is between 0 and 1. =item B Specify which channels to filter, by default all available are filtered. =item B Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. =item B Set transform type of IIR filter. =over 4 =item B =item B =item B =item B =item B =item B =item B =back =item B Set precison of filtering. =over 4 =item B Pick automatic sample format depending on surround filters. =item B Always use signed 16-bit. =item B Always use signed 32-bit. =item B Always use float 32-bit. =item B Always use float 64-bit. =back =item B Set block size used for reverse IIR processing. If this value is set to high enough value (higher than impulse response length truncated when reaches near zero values) filtering will become linear phase otherwise if not big enough it will just produce nasty artifacts. Note that filter delay will be exactly this many samples when set to non-zero value. =back =head3 Examples =over 4 =item * Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz: equalizer=f=1000:t=h:width=200:g=-10 =item * Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2: equalizer=f=1000:t=q:w=1:g=2,equalizer=f=100:t=q:w=2:g=-5 =back =head3 Commands This filter supports the following commands: =over 4 =item B Change equalizer frequency. Syntax for the command is : "I" =item B Change equalizer width_type. Syntax for the command is : "I" =item B Change equalizer width. Syntax for the command is : "I" =item B Change equalizer gain. Syntax for the command is : "I" =item B Change equalizer mix. Syntax for the command is : "I" =back =head2 extrastereo Linearly increases the difference between left and right channels which adds some sort of "live" effect to playback. The filter accepts the following options: =over 4 =item B 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. =item B Enable clipping. By default is enabled. =back =head3 Commands This filter supports the all above options as B. =head2 firequalizer Apply FIR Equalization using arbitrary frequency response. The filter accepts the following option: =over 4 =item B Set gain curve equation (in dB). The expression can contain variables: =over 4 =item B the evaluated frequency =item B sample rate =item B channel number, set to 0 when multichannels evaluation is disabled =item B channel id, see libavutil/channel_layout.h, set to the first channel id when multichannels evaluation is disabled =item B number of channels =item B channel_layout, see libavutil/channel_layout.h =back and functions: =over 4 =item B interpolate gain on frequency f based on gain_entry =item B same as gain_interpolate, but smoother =back This option is also available as command. Default is C. =item B Set gain entry for gain_interpolate function. The expression can contain functions: =over 4 =item B store gain entry at frequency f with value g =back This option is also available as command. =item B Set filter delay in seconds. Higher value means more accurate. Default is C<0.01>. =item B Set filter accuracy in Hz. Lower value means more accurate. Default is C<5>. =item B Set window function. Acceptable values are: =over 4 =item B rectangular window, useful when gain curve is already smooth =item B hann window (default) =item B hamming window =item B blackman window =item B 3-terms continuous 1st derivative nuttall window =item B minimum 3-terms discontinuous nuttall window =item B 4-terms continuous 1st derivative nuttall window =item B minimum 4-terms discontinuous nuttall (blackman-nuttall) window =item B blackman-harris window =item B tukey window =back =item B If enabled, use fixed number of audio samples. This improves speed when filtering with large delay. Default is disabled. =item B Enable multichannels evaluation on gain. Default is disabled. =item B Enable zero phase mode by subtracting timestamp to compensate delay. Default is disabled. =item B Set scale used by gain. Acceptable values are: =over 4 =item B linear frequency, linear gain =item B linear frequency, logarithmic (in dB) gain (default) =item B logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain =item B logarithmic frequency, logarithmic gain =back =item B Set file for dumping, suitable for gnuplot. =item B Set scale for dumpfile. Acceptable values are same with scale option. Default is linlog. =item B Enable 2-channel convolution using complex FFT. This improves speed significantly. Default is disabled. =item B Enable minimum phase impulse response. Default is disabled. =back =head3 Examples =over 4 =item * lowpass at 1000 Hz: firequalizer=gain='if(lt(f,1000), 0, -INF)' =item * lowpass at 1000 Hz with gain_entry: firequalizer=gain_entry='entry(1000,0); entry(1001, -INF)' =item * custom equalization: firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)' =item * higher delay with zero phase to compensate delay: firequalizer=delay=0.1:fixed=on:zero_phase=on =item * lowpass on left channel, highpass on right channel: firequalizer=gain='if(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))' :gain_entry='entry(1000, 0); entry(1001,-INF); entry(1e6+1000,0)':multi=on =back =head2 flanger Apply a flanging effect to the audio. The filter accepts the following options: =over 4 =item B Set base delay in milliseconds. Range from 0 to 30. Default value is 0. =item B Set added sweep delay in milliseconds. Range from 0 to 10. Default value is 2. =item B Set percentage regeneration (delayed signal feedback). Range from -95 to 95. Default value is 0. =item B Set percentage of delayed signal mixed with original. Range from 0 to 100. Default value is 71. =item B Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5. =item B Set swept wave shape, can be I or I. Default value is I. =item B Set swept wave percentage-shift for multi channel. Range from 0 to 100. Default value is 25. =item B Set delay-line interpolation, I or I. Default is I. =back =head2 haas Apply Haas effect to audio. Note that this makes most sense to apply on mono signals. With this filter applied to mono signals it give some directionality and stretches its stereo image. The filter accepts the following options: =over 4 =item B Set input level. By default is I<1>, or 0dB =item B Set output level. By default is I<1>, or 0dB. =item B Set gain applied to side part of signal. By default is I<1>. =item B Set kind of middle source. Can be one of the following: =over 4 =item B Pick left channel. =item B Pick right channel. =item B Pick middle part signal of stereo image. =item B Pick side part signal of stereo image. =back =item B Change middle phase. By default is disabled. =item B Set left channel delay. By default is I<2.05> milliseconds. =item B Set left channel balance. By default is I<-1>. =item B Set left channel gain. By default is I<1>. =item B Change left phase. By default is disabled. =item B Set right channel delay. By defaults is I<2.12> milliseconds. =item B Set right channel balance. By default is I<1>. =item B Set right channel gain. By default is I<1>. =item B Change right phase. By default is enabled. =back =head2 hdcd Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with embedded HDCD codes is expanded into a 20-bit PCM stream. The filter supports the Peak Extend and Low-level Gain Adjustment features of HDCD, and detects the Transient Filter flag. ffmpeg -i HDCD16.flac -af hdcd OUT24.flac When using the filter with wav, note the default encoding for wav is 16-bit, so the resulting 20-bit stream will be truncated back to 16-bit. Use something like B<-acodec pcm_s24le> after the filter to get 24-bit PCM output. ffmpeg -i HDCD16.wav -af hdcd OUT16.wav ffmpeg -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav The filter accepts the following options: =over 4 =item B Disable any automatic format conversion or resampling in the filter graph. =item B Process the stereo channels together. If target_gain does not match between channels, consider it invalid and use the last valid target_gain. =item B Set the code detect timer period in ms. =item B Always extend peaks above -3dBFS even if PE isn't signaled. =item B Replace audio with a solid tone and adjust the amplitude to signal some specific aspect of the decoding process. The output file can be loaded in an audio editor alongside the original to aid analysis. C can be used to see all samples above the PE level. Modes are: =over 4 =item B<0, off> Disabled =item B<1, lle> Gain adjustment level at each sample =item B<2, pe> Samples where peak extend occurs =item B<3, cdt> Samples where the code detect timer is active =item B<4, tgm> Samples where the target gain does not match between channels =back =back =head2 headphone Apply head-related transfer functions (HRTFs) to create virtual loudspeakers around the user for binaural listening via headphones. The HRIRs are provided via additional streams, for each channel one stereo input stream is needed. The filter accepts the following options: =over 4 =item B Set mapping of input streams for convolution. The argument is a '|'-separated list of channel names in order as they are given as additional stream inputs for filter. This also specify number of input streams. Number of input streams must be not less than number of channels in first stream plus one. =item B Set gain applied to audio. Value is in dB. Default is 0. =item B Set processing type. Can be I

Set what planes of frame filter will use for averaging. Default is all. =item B Set what variant of algorithm filter will use for averaging. Default is C

parallel. Alternatively can be set to C serial. Parallel can be faster then serial, while other way around is never true. Parallel will abort early on first change being greater then thresholds, while serial will continue processing other side of frames if they are equal or below thresholds. =item B<0s> =item B<1s> =item B<2s> Set sigma for 1st plane, 2nd plane or 3rd plane. Default is 32767. Valid range is from 0 to 32767. This options controls weight for each pixel in radius defined by size. Default value means every pixel have same weight. Setting this option to 0 effectively disables filtering. =back =head3 Commands This filter supports same B as options except option C. The command accepts the same syntax of the corresponding option. =head2 avgblur Apply average blur filter. The filter accepts the following options: =over 4 =item B Set horizontal radius size. =item B Set which planes to filter. By default all planes are filtered. =item B Set vertical radius size, if zero it will be same as C. Default is C<0>. =back =head3 Commands This filter supports same commands as options. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. =head2 backgroundkey Turns a static background into transparency. The filter accepts the following option: =over 4 =item B Threshold for scene change detection. =item B Similarity percentage with the background. =item B Set the blend amount for pixels that are not similar. =back =head3 Commands This filter supports the all above options as B. =head2 bbox Compute the bounding box for the non-black pixels in the input frame luma plane. This filter computes the bounding box containing all the pixels with a luma value greater than the minimum allowed value. The parameters describing the bounding box are printed on the filter log. The filter accepts the following option: =over 4 =item B Set the minimal luma value. Default is C<16>. =back =head3 Commands This filter supports the all above options as B. =head2 bilateral Apply bilateral filter, spatial smoothing while preserving edges. The filter accepts the following options: =over 4 =item B Set sigma of gaussian function to calculate spatial weight. Allowed range is 0 to 512. Default is 0.1. =item B Set sigma of gaussian function to calculate range weight. Allowed range is 0 to 1. Default is 0.1. =item B Set planes to filter. Default is first only. =back =head3 Commands This filter supports the all above options as B. =head2 bilateral_cuda CUDA accelerated bilateral filter, an edge preserving filter. This filter is mathematically accurate thanks to the use of GPU acceleration. For best output quality, use one to one chroma subsampling, i.e. yuv444p format. The filter accepts the following options: =over 4 =item B Set sigma of gaussian function to calculate spatial weight, also called sigma space. Allowed range is 0.1 to 512. Default is 0.1. =item B Set sigma of gaussian function to calculate color range weight, also called sigma color. Allowed range is 0.1 to 512. Default is 0.1. =item B Set window size of the bilateral function to determine the number of neighbours to loop on. If the number entered is even, one will be added automatically. Allowed range is 1 to 255. Default is 1. =back =head3 Examples =over 4 =item * Apply the bilateral filter on a video. ./ffmpeg -v verbose \ -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 \ -init_hw_device cuda \ -filter_complex \ " \ [0:v]scale_cuda=format=yuv444p[scaled_video]; [scaled_video]bilateral_cuda=window_size=9:sigmaS=3.0:sigmaR=50.0" \ -an -sn -c:v h264_nvenc -cq 20 out.mp4 =back =head2 bitplanenoise Show and measure bit plane noise. The filter accepts the following options: =over 4 =item B Set which plane to analyze. Default is C<1>. =item B Filter out noisy pixels from C set above. Default is disabled. =back =head2 blackdetect Detect video intervals that are (almost) completely black. Can be useful to detect chapter transitions, commercials, or invalid recordings. The filter outputs its detection analysis to both the log as well as frame metadata. If a black segment of at least the specified minimum duration is found, a line with the start and end timestamps as well as duration is printed to the log with level C. In addition, a log line with level C is printed per frame showing the black amount detected for that frame. The filter also attaches metadata to the first frame of a black segment with key C and to the first frame after the black segment ends with key C. The value is the frame's timestamp. This metadata is added regardless of the minimum duration specified. The filter accepts the following options: =over 4 =item B Set the minimum detected black duration expressed in seconds. It must be a non-negative floating point number. Default value is 2.0. =item B Set the threshold for considering a picture "black". Express the minimum value for the ratio: / for which a picture is considered black. Default value is 0.98. =item B Set the threshold for considering a pixel "black". The threshold expresses the maximum pixel luma value for which a pixel is considered "black". The provided value is scaled according to the following equation: = + * I and I 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. =back The following example sets the maximum pixel threshold to the minimum value, and detects only black intervals of 2 or more seconds: blackdetect=d=2:pix_th=0.00 =head2 blackframe Detect frames that are (almost) completely black. Can be useful to detect chapter transitions or commercials. Output lines consist of the frame number of the detected frame, the percentage of blackness, the position in the file if known or -1 and the timestamp in seconds. In order to display the output lines, you need to set the loglevel at least to the AV_LOG_INFO value. This filter exports frame metadata C. The value represents the percentage of pixels in the picture that are below the threshold value. It accepts the following parameters: =over 4 =item B The percentage of the pixels that have to be below the threshold; it defaults to C<98>. =item B The threshold below which a pixel value is considered black; it defaults to C<32>. =back =head2 blend Blend two video frames into each other. The C filter takes two input streams and outputs one stream, the first input is the "top" layer and second input is "bottom" layer. By default, the output terminates when the longest input terminates. The C (time blend) filter takes two consecutive frames from one single stream, and outputs the result obtained by blending the new frame on top of the old frame. A description of the accepted options follows. =over 4 =item B =item B =item B =item B =item B Set blend mode for specific pixel component or all pixel components in case of I. Default value is C. Available values for component modes are: =over 4 =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =back =item B =item B =item B =item B =item B Set blend opacity for specific pixel component or all pixel components in case of I. Only used in combination with pixel component blend modes. =item B =item B =item B =item B =item B Set blend expression for specific pixel component or all pixel components in case of I. Note that related mode options will be ignored if those are set. The expressions can use the following variables: =over 4 =item B The sequential number of the filtered frame, starting from C<0>. =item B =item B the coordinates of the current sample =item B =item B the width and height of currently filtered plane =item B =item B Width and height scale for the plane being filtered. It is the ratio between the dimensions of the current plane to the luma plane, e.g. for a C frame, the values are C<1,1> for the luma plane and C<0.5,0.5> for the chroma planes. =item B Time of the current frame, expressed in seconds. =item B Value of pixel component at current location for first video frame (top layer). =item B Value of pixel component at current location for second video frame (bottom layer). =back =back The C filter also supports the B options. =head3 Examples =over 4 =item * Apply transition from bottom layer to top layer in first 10 seconds: blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))' =item * Apply linear horizontal transition from top layer to bottom layer: blend=all_expr='A*(X/W)+B*(1-X/W)' =item * Apply 1x1 checkerboard effect: blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)' =item * Apply uncover left effect: blend=all_expr='if(gte(N*SW+X,W),A,B)' =item * Apply uncover down effect: blend=all_expr='if(gte(Y-N*SH,0),A,B)' =item * Apply uncover up-left effect: blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)' =item * Split diagonally video and shows top and bottom layer on each side: blend=all_expr='if(gt(X,Y*(W/H)),A,B)' =item * Display differences between the current and the previous frame: tblend=all_mode=grainextract =back =head3 Commands This filter supports same B as options. =head2 blockdetect Determines blockiness of frames without altering the input frames. Based on Remco Muijs and Ihor Kirenko: "A no-reference blocking artifact measure for adaptive video processing." 2005 13th European signal processing conference. The filter accepts the following options: =over 4 =item B =item B Set minimum and maximum values for determining pixel grids (periods). Default values are [3,24]. =item B Set planes to filter. Default is first only. =back =head3 Examples =over 4 =item * Determine blockiness for the first plane and search for periods within [8,32]: blockdetect=period_min=8:period_max=32:planes=1 =back =head2 blurdetect Determines blurriness of frames without altering the input frames. Based on Marziliano, Pina, et al. "A no-reference perceptual blur metric." Allows for a block-based abbreviation. The filter accepts the following options: =over 4 =item B =item B 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. I and I threshold values must be chosen in the range [0,1], and I should be lesser or equal to I. Default value for I is C<20/255>, and default value for I is C<50/255>. =item B Define the radius to search around an edge pixel for local maxima. =item B Determine blurriness only for the most significant blocks, given in percentage. =item B Determine blurriness for blocks of width I. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of I. =item B Determine blurriness for blocks of height I. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of I. =item B Set planes to filter. Default is first only. =back =head3 Examples =over 4 =item * Determine blur for 80% of most significant 32x32 blocks: blurdetect=block_width=32:block_height=32:block_pct=80 =back =head2 bm3d Denoise frames using Block-Matching 3D algorithm. The filter accepts the following options. =over 4 =item B Set denoising strength. Default value is 1. Allowed range is from 0 to 999.9. The denoising algorithm is very sensitive to sigma, so adjust it according to the source. =item B Set local patch size. This sets dimensions in 2D. =item B Set sliding step for processing blocks. Default value is 4. Allowed range is from 1 to 64. Smaller values allows processing more reference blocks and is slower. =item B Set maximal number of similar blocks for 3rd dimension. Default value is 1. When set to 1, no block matching is done. Larger values allows more blocks in single group. Allowed range is from 1 to 256. =item B Set radius for search block matching. Default is 9. Allowed range is from 1 to INT32_MAX. =item B Set step between two search locations for block matching. Default is 1. Allowed range is from 1 to 64. Smaller is slower. =item B Set threshold of mean square error for block matching. Valid range is 0 to INT32_MAX. =item B Set thresholding parameter for hard thresholding in 3D transformed domain. Larger values results in stronger hard-thresholding filtering in frequency domain. =item B Set filtering estimation mode. Can be C or C. Default is C. =item B If enabled, filter will use 2nd stream for block matching. Default is disabled for C value of I option, and always enabled if value of I is C. =item B Set planes to filter. Default is all available except alpha. =back =head3 Examples =over 4 =item * Basic filtering with bm3d: bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic =item * Same as above, but filtering only luma: bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic:planes=1 =item * Same as above, but with both estimation modes: split[a][b],[a]bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1 =item * Same as above, but prefilter with B filter instead: split[a][b],[a]nlmeans=s=3:r=7:p=3[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1 =back =head2 boxblur Apply a boxblur algorithm to the input video. It accepts the following parameters: =over 4 =item B =item B =item B =item B =item B =item B =back A description of the accepted options follows. =over 4 =item B =item B =item B 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 C for the luma and alpha planes, and of C for the chroma planes. Default value for B is "2". If not specified, B and B default to the corresponding value set for B. The expressions can contain the following constants: =over 4 =item B =item B The input width and height in pixels. =item B =item B The input chroma image width and height in pixels. =item B =item B The horizontal and vertical chroma subsample values. For example, for the pixel format "yuv422p", I is 2 and I is 1. =back =item B =item B =item B Specify how many times the boxblur filter is applied to the corresponding plane. Default value for B is 2. If not specified, B and B default to the corresponding value set for B. A value of 0 will disable the effect. =back =head3 Examples =over 4 =item * Apply a boxblur filter with the luma, chroma, and alpha radii set to 2: boxblur=luma_radius=2:luma_power=1 boxblur=2:1 =item * Set the luma radius to 2, and alpha and chroma radius to 0: boxblur=2:1:cr=0:ar=0 =item * Set the luma and chroma radii to a fraction of the video dimension: boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1 =back =head2 bwdif Deinterlace the input video ("bwdif" stands for "Bob Weaver Deinterlacing Filter"). Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic interpolation algorithms. It accepts the following parameters: =over 4 =item B The interlacing mode to adopt. It accepts one of the following values: =over 4 =item B<0, send_frame> Output one frame for each frame. =item B<1, send_field> Output one frame for each field. =back The default value is C. =item B The picture field parity assumed for the input interlaced video. It accepts one of the following values: =over 4 =item B<0, tff> Assume the top field is first. =item B<1, bff> Assume the bottom field is first. =item B<-1, auto> Enable automatic detection of field parity. =back The default value is C. If the interlacing is unknown or the decoder does not export this information, top field first will be assumed. =item B Specify which frames to deinterlace. Accepts one of the following values: =over 4 =item B<0, all> Deinterlace all frames. =item B<1, interlaced> Only deinterlace frames marked as interlaced. =back The default value is C. =back =head2 bwdif_cuda Deinterlace the input video using the B algorithm, but implemented in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec and/or nvenc. It accepts the following parameters: =over 4 =item B The interlacing mode to adopt. It accepts one of the following values: =over 4 =item B<0, send_frame> Output one frame for each frame. =item B<1, send_field> Output one frame for each field. =back The default value is C. =item B The picture field parity assumed for the input interlaced video. It accepts one of the following values: =over 4 =item B<0, tff> Assume the top field is first. =item B<1, bff> Assume the bottom field is first. =item B<-1, auto> Enable automatic detection of field parity. =back The default value is C. If the interlacing is unknown or the decoder does not export this information, top field first will be assumed. =item B Specify which frames to deinterlace. Accepts one of the following values: =over 4 =item B<0, all> Deinterlace all frames. =item B<1, interlaced> Only deinterlace frames marked as interlaced. =back The default value is C. =back =head2 ccrepack Repack CEA-708 closed captioning side data This filter fixes various issues seen with commerical encoders related to upstream malformed CEA-708 payloads, specifically incorrect number of tuples (wrong cc_count for the target FPS), and incorrect ordering of tuples (i.e. the CEA-608 tuples are not at the first entries in the payload). =head2 cas Apply Contrast Adaptive Sharpen filter to video stream. The filter accepts the following options: =over 4 =item B Set the sharpening strength. Default value is 0. =item B Set planes to filter. Default value is to filter all planes except alpha plane. =back =head3 Commands This filter supports same B as options. =head2 chromahold Remove all color information for all colors except for certain one. The filter accepts the following options: =over 4 =item B The color which will not be replaced with neutral chroma. =item B Similarity percentage with the above color. 0.01 matches only the exact key color, while 1.0 matches everything. =item B Blend percentage. 0.0 makes pixels either fully gray, or not gray at all. Higher values result in more preserved color. =item B Signals that the color passed is already in YUV instead of RGB. Literal colors like "green" or "red" don't make sense with this enabled anymore. This can be used to pass exact YUV values as hexadecimal numbers. =back =head3 Commands This filter supports same B as options. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. =head2 chromakey YUV colorspace color/chroma keying. The filter accepts the following options: =over 4 =item B The color which will be replaced with transparency. =item B Similarity percentage with the key color. 0.01 matches only the exact key color, while 1.0 matches everything. =item B Blend percentage. 0.0 makes pixels either fully transparent, or not transparent at all. Higher values result in semi-transparent pixels, with a higher transparency the more similar the pixels color is to the key color. =item B Signals that the color passed is already in YUV instead of RGB. Literal colors like "green" or "red" don't make sense with this enabled anymore. This can be used to pass exact YUV values as hexadecimal numbers. =back =head3 Commands This filter supports same B as options. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. =head3 Examples =over 4 =item * Make every green pixel in the input image transparent: ffmpeg -i input.png -vf chromakey=green out.png =item * Overlay a greenscreen-video on top of a static black background. ffmpeg -f lavfi -i color=c=black:s=1280x720 -i video.mp4 -shortest -filter_complex "[1:v]chromakey=0x70de77:0.1:0.2[ckout];[0:v][ckout]overlay[out]" -map "[out]" output.mkv =back =head2 chromakey_cuda CUDA accelerated YUV colorspace color/chroma keying. This filter works like normal chromakey filter but operates on CUDA frames. for more details and parameters see B. =head3 Examples =over 4 =item * Make all the green pixels in the input video transparent and use it as an overlay for another video: ./ffmpeg \ -hwaccel cuda -hwaccel_output_format cuda -i input_green.mp4 \ -hwaccel cuda -hwaccel_output_format cuda -i base_video.mp4 \ -init_hw_device cuda \ -filter_complex \ " \ [0:v]chromakey_cuda=0x25302D:0.1:0.12:1[overlay_video]; \ [1:v]scale_cuda=format=yuv420p[base]; \ [base][overlay_video]overlay_cuda" \ -an -sn -c:v h264_nvenc -cq 20 output.mp4 =item * Process two software sources, explicitly uploading the frames: ./ffmpeg -init_hw_device cuda=cuda -filter_hw_device cuda \ -f lavfi -i color=size=800x600:color=white,format=yuv420p \ -f lavfi -i yuvtestsrc=size=200x200,format=yuv420p \ -filter_complex \ " \ [0]hwupload[under]; \ [1]hwupload,chromakey_cuda=green:0.1:0.12[over]; \ [under][over]overlay_cuda" \ -c:v hevc_nvenc -cq 18 -preset slow output.mp4 =back =head2 chromanr Reduce chrominance noise. The filter accepts the following options: =over 4 =item B Set threshold for averaging chrominance values. Sum of absolute difference of Y, U and V pixel components of current pixel and neighbour pixels lower than this threshold will be used in averaging. Luma component is left unchanged and is copied to output. Default value is 30. Allowed range is from 1 to 200. =item B Set horizontal radius of rectangle used for averaging. Allowed range is from 1 to 100. Default value is 5. =item B Set vertical radius of rectangle used for averaging. Allowed range is from 1 to 100. Default value is 5. =item B Set horizontal step when averaging. Default value is 1. Allowed range is from 1 to 50. Mostly useful to speed-up filtering. =item B Set vertical step when averaging. Default value is 1. Allowed range is from 1 to 50. Mostly useful to speed-up filtering. =item B Set Y threshold for averaging chrominance values. Set finer control for max allowed difference between Y components of current pixel and neigbour pixels. Default value is 200. Allowed range is from 1 to 200. =item B Set U threshold for averaging chrominance values. Set finer control for max allowed difference between U components of current pixel and neigbour pixels. Default value is 200. Allowed range is from 1 to 200. =item B Set V threshold for averaging chrominance values. Set finer control for max allowed difference between V components of current pixel and neigbour pixels. Default value is 200. Allowed range is from 1 to 200. =item B Set distance type used in calculations. =over 4 =item B Absolute difference. =item B Difference squared. =back Default distance type is manhattan. =back =head3 Commands This filter supports same B as options. The command accepts the same syntax of the corresponding option. =head2 chromashift Shift chroma pixels horizontally and/or vertically. The filter accepts the following options: =over 4 =item B Set amount to shift chroma-blue horizontally. =item B Set amount to shift chroma-blue vertically. =item B Set amount to shift chroma-red horizontally. =item B Set amount to shift chroma-red vertically. =item B Set edge mode, can be I, default, or I. =back =head3 Commands This filter supports the all above options as B. =head2 ciescope Display CIE color diagram with pixels overlaid onto it. The filter accepts the following options: =over 4 =item B Set color system. =over 4 =item B =item B =item B =item B<240m> =item B =item B =item B =item B =item B =item B =back =item B Set CIE system. =over 4 =item B =item B =item B =back =item B Set what gamuts to draw. See C option for available values. =item B Set ciescope size, by default set to 512. =item B Set intensity used to map input pixel values to CIE diagram. =item B Set contrast used to draw tongue colors that are out of active color system gamut. =item B Correct gamma displayed on scope, by default enabled. =item B Show white point on CIE diagram, by default disabled. =item B Set input gamma. Used only with XYZ input color space. =item B Fill with CIE colors. By default is enabled. =back =head2 codecview Visualize information exported by some codecs. Some codecs can export information through frames using side-data or other means. For example, some MPEG based codecs export motion vectors through the I flag in the codec B option. The filter accepts the following option: =over 4 =item B Display block partition structure using the luma plane. =item B Set motion vectors to visualize. Available flags for I are: =over 4 =item B forward predicted MVs of P-frames =item B forward predicted MVs of B-frames =item B backward predicted MVs of B-frames =back =item B Display quantization parameters using the chroma planes. =item B Set motion vectors type to visualize. Includes MVs from all frames unless specified by I option. Available flags for I are: =over 4 =item B forward predicted MVs =item B backward predicted MVs =back =item B Set frame type to visualize motion vectors of. Available flags for I are: =over 4 =item B intra-coded frames (I-frames) =item B predicted frames (P-frames) =item B bi-directionally predicted frames (B-frames) =back =back =head3 Examples =over 4 =item * Visualize forward predicted MVs of all frames using B: ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv_type=fp =item * Visualize multi-directionals MVs of P and B-Frames using B: ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb =back =head2 colorbalance Modify intensity of primary colors (red, green and blue) of input frames. The filter allows an input frame to be adjusted in the shadows, midtones or highlights regions for the red-cyan, green-magenta or blue-yellow balance. A positive adjustment value shifts the balance towards the primary color, a negative value towards the complementary color. The filter accepts the following options: =over 4 =item B =item B =item B Adjust red, green and blue shadows (darkest pixels). =item B =item B =item B Adjust red, green and blue midtones (medium pixels). =item B =item B =item B Adjust red, green and blue highlights (brightest pixels). Allowed ranges for options are C<[-1.0, 1.0]>. Defaults are C<0>. =item B Preserve lightness when changing color balance. Default is disabled. =back =head3 Examples =over 4 =item * Add red color cast to shadows: colorbalance=rs=.3 =back =head3 Commands This filter supports the all above options as B. =head2 colorcontrast Adjust color contrast between RGB components. The filter accepts the following options: =over 4 =item B Set the red-cyan contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0. =item B Set the green-magenta contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0. =item B Set the blue-yellow contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0. =item B =item B =item B Set the weight of each C, C, C option value. Default value is 0.0. Allowed range is from 0.0 to 1.0. If all weights are 0.0 filtering is disabled. =item B Set the amount of preserving lightness. Default value is 0.0. Allowed range is from 0.0 to 1.0. =back =head3 Commands This filter supports the all above options as B. =head2 colorcorrect Adjust color white balance selectively for blacks and whites. This filter operates in YUV colorspace. The filter accepts the following options: =over 4 =item B Set the red shadow spot. Allowed range is from -1.0 to 1.0. Default value is 0. =item B Set the blue shadow spot. Allowed range is from -1.0 to 1.0. Default value is 0. =item B Set the red highlight spot. Allowed range is from -1.0 to 1.0. Default value is 0. =item B Set the blue highlight spot. Allowed range is from -1.0 to 1.0. Default value is 0. =item B Set the amount of saturation. Allowed range is from -3.0 to 3.0. Default value is 1. =item B If set to anything other than C it will analyze every frame and use derived parameters for filtering output frame. Possible values are: =over 4 =item B =item B =item B =item B =back Default value is C. =back =head3 Commands This filter supports the all above options as B. =head2 colorchannelmixer Adjust video input frames by re-mixing color channels. This filter modifies a color channel by adding the values associated to the other channels of the same pixels. For example if the value to modify is red, the output value will be: =* + * + * + * The filter accepts the following options: =over 4 =item B =item B =item B =item B Adjust contribution of input red, green, blue and alpha channels for output red channel. Default is C<1> for I, and C<0> for I, I and I. =item B =item B =item B =item B Adjust contribution of input red, green, blue and alpha channels for output green channel. Default is C<1> for I, and C<0> for I, I and I. =item B
=item B =item B =item B Adjust contribution of input red, green, blue and alpha channels for output blue channel. Default is C<1> for I, and C<0> for I
, I and I. =item B =item B =item B =item B Adjust contribution of input red, green, blue and alpha channels for output alpha channel. Default is C<1> for I, and C<0> for I, I and I. Allowed ranges for options are C<[-2.0, 2.0]>. =item B Set preserve color mode. The accepted values are: =over 4 =item B Disable color preserving, this is default. =item B Preserve luminance. =item B Preserve max value of RGB triplet. =item B Preserve average value of RGB triplet. =item B Preserve sum value of RGB triplet. =item B Preserve normalized value of RGB triplet. =item B Preserve power value of RGB triplet. =back =item B Set the preserve color amount when changing colors. Allowed range is from C<[0.0, 1.0]>. Default is C<0.0>, thus disabled. =back =head3 Examples =over 4 =item * Convert source to grayscale: colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3 =item * Simulate sepia tones: colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131 =back =head3 Commands This filter supports the all above options as B. =head2 colorize Overlay a solid color on the video stream. The filter accepts the following options: =over 4 =item B Set the color hue. Allowed range is from 0 to 360. Default value is 0. =item B Set the color saturation. Allowed range is from 0 to 1. Default value is 0.5. =item B Set the color lightness. Allowed range is from 0 to 1. Default value is 0.5. =item B Set the mix of source lightness. By default is set to 1.0. Allowed range is from 0.0 to 1.0. =back =head3 Commands This filter supports the all above options as B. =head2 colorkey RGB colorspace color keying. This filter operates on 8-bit RGB format frames by setting the alpha component of each pixel which falls within the similarity radius of the key color to 0. The alpha value for pixels outside the similarity radius depends on the value of the blend option. The filter accepts the following options: =over 4 =item B Set the color for which alpha will be set to 0 (full transparency). See B<"Color" section in the ffmpeg-utils manual>. Default is C. =item B Set the radius from the key color within which other colors also have full transparency. The computed distance is related to the unit fractional distance in 3D space between the RGB values of the key color and the pixel's color. Range is 0.01 to 1.0. 0.01 matches within a very small radius around the exact key color, while 1.0 matches everything. Default is C<0.01>. =item B Set how the alpha value for pixels that fall outside the similarity radius is computed. 0.0 makes pixels either fully transparent or fully opaque. Higher values result in semi-transparent pixels, with greater transparency the more similar the pixel color is to the key color. Range is 0.0 to 1.0. Default is C<0.0>. =back =head3 Examples =over 4 =item * Make every green pixel in the input image transparent: ffmpeg -i input.png -vf colorkey=green out.png =item * Overlay a greenscreen-video on top of a static background image. ffmpeg -i background.png -i video.mp4 -filter_complex "[1:v]colorkey=0x3BBD1E:0.3:0.2[ckout];[0:v][ckout]overlay[out]" -map "[out]" output.flv =back =head3 Commands This filter supports same B as options. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. =head2 colorhold Remove all color information for all RGB colors except for certain one. The filter accepts the following options: =over 4 =item B The color which will not be replaced with neutral gray. =item B Similarity percentage with the above color. 0.01 matches only the exact key color, while 1.0 matches everything. =item B Blend percentage. 0.0 makes pixels fully gray. Higher values result in more preserved color. =back =head3 Commands This filter supports same B as options. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. =head2 colorlevels Adjust video input frames using levels. The filter accepts the following options: =over 4 =item B =item B =item B =item B Adjust red, green, blue and alpha input black point. Allowed ranges for options are C<[-1.0, 1.0]>. Defaults are C<0>. =item B =item B =item B =item B Adjust red, green, blue and alpha input white point. Allowed ranges for options are C<[-1.0, 1.0]>. Defaults are C<1>. Input levels are used to lighten highlights (bright tones), darken shadows (dark tones), change the balance of bright and dark tones. =item B =item B =item B =item B Adjust red, green, blue and alpha output black point. Allowed ranges for options are C<[0, 1.0]>. Defaults are C<0>. =item B =item B =item B =item B Adjust red, green, blue and alpha output white point. Allowed ranges for options are C<[0, 1.0]>. Defaults are C<1>. Output levels allows manual selection of a constrained output level range. =item B Set preserve color mode. The accepted values are: =over 4 =item B Disable color preserving, this is default. =item B Preserve luminance. =item B Preserve max value of RGB triplet. =item B Preserve average value of RGB triplet. =item B Preserve sum value of RGB triplet. =item B Preserve normalized value of RGB triplet. =item B Preserve power value of RGB triplet. =back =back =head3 Examples =over 4 =item * Make video output darker: colorlevels=rimin=0.058:gimin=0.058:bimin=0.058 =item * Increase contrast: colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96 =item * Make video output lighter: colorlevels=rimax=0.902:gimax=0.902:bimax=0.902 =item * Increase brightness: colorlevels=romin=0.5:gomin=0.5:bomin=0.5 =back =head3 Commands This filter supports the all above options as B. =head2 colormap Apply custom color maps to video stream. This filter needs three input video streams. First stream is video stream that is going to be filtered out. Second and third video stream specify color patches for source color to target color mapping. The filter accepts the following options: =over 4 =item B Set the source and target video stream patch size in pixels. =item B Set the max number of used patches from source and target video stream. Default value is number of patches available in additional video streams. Max allowed number of patches is C<64>. =item B Set the adjustments used for target colors. Can be C or C. Defaults is C. =item B Set the kernel used to measure color differences between mapped colors. The accepted values are: =over 4 =item B =item B =back Default is C. =back =head2 colormatrix Convert color matrix. The filter accepts the following options: =over 4 =item B =item B Specify the source and destination color matrix. Both values must be specified. The accepted values are: =over 4 =item B BT.709 =item B FCC =item B BT.601 =item B BT.470 =item B BT.470BG =item B SMPTE-170M =item B SMPTE-240M =item B BT.2020 =back =back For example to convert from BT.601 to SMPTE-240M, use the command: colormatrix=bt601:smpte240m =head2 colorspace Convert colorspace, transfer characteristics or color primaries. Input video needs to have an even size. The filter accepts the following options: =over 4 =item B Specify all color properties at once. The accepted values are: =over 4 =item B BT.470M =item B BT.470BG =item B BT.601-6 525 =item B BT.601-6 625 =item B BT.709 =item B SMPTE-170M =item B SMPTE-240M =item B BT.2020 =back =item B Specify output colorspace. The accepted values are: =over 4 =item B BT.709 =item B FCC =item B BT.470BG or BT.601-6 625 =item B SMPTE-170M or BT.601-6 525 =item B SMPTE-240M =item B YCgCo =item B BT.2020 with non-constant luminance =back =item B Specify output transfer characteristics. The accepted values are: =over 4 =item B BT.709 =item B BT.470M =item B BT.470BG =item B Constant gamma of 2.2 =item B Constant gamma of 2.8 =item B SMPTE-170M, BT.601-6 625 or BT.601-6 525 =item B SMPTE-240M =item B SRGB =item B iec61966-2-1 =item B iec61966-2-4 =item B xvycc =item B BT.2020 for 10-bits content =item B BT.2020 for 12-bits content =back =item B Specify output color primaries. The accepted values are: =over 4 =item B BT.709 =item B BT.470M =item B BT.470BG or BT.601-6 625 =item B SMPTE-170M or BT.601-6 525 =item B SMPTE-240M =item B film =item B SMPTE-431 =item B SMPTE-432 =item B BT.2020 =item B JEDEC P22 phosphors =back =item B Specify output color range. The accepted values are: =over 4 =item B TV (restricted) range =item B MPEG (restricted) range =item B PC (full) range =item B JPEG (full) range =back =item B Specify output color format. The accepted values are: =over 4 =item B YUV 4:2:0 planar 8-bits =item B YUV 4:2:0 planar 10-bits =item B YUV 4:2:0 planar 12-bits =item B YUV 4:2:2 planar 8-bits =item B YUV 4:2:2 planar 10-bits =item B YUV 4:2:2 planar 12-bits =item B YUV 4:4:4 planar 8-bits =item B YUV 4:4:4 planar 10-bits =item B YUV 4:4:4 planar 12-bits =back =item B 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. =item B Specify dithering mode. The accepted values are: =over 4 =item B No dithering =item B Floyd-Steinberg dithering =back =item B Whitepoint adaptation mode. The accepted values are: =over 4 =item B Bradford whitepoint adaptation =item B von Kries whitepoint adaptation =item B identity whitepoint adaptation (i.e. no whitepoint adaptation) =back =item B Override all input properties at once. Same accepted values as B. =item B Override input colorspace. Same accepted values as B. =item B Override input color primaries. Same accepted values as B. =item B Override input transfer characteristics. Same accepted values as B. =item B Override input color range. Same accepted values as B. =back The filter converts the transfer characteristics, color space and color primaries to the specified user values. The output value, if not specified, is set to a default value based on the "all" property. If that property is also not specified, the filter will log an error. The output color range and format default to the same value as the input color range and format. The input transfer characteristics, color space, color primaries and color range should be set on the input data. If any of these are missing, the filter will log an error and no conversion will take place. For example to convert the input to SMPTE-240M, use the command: colorspace=smpte240m =head2 colorspace_cuda CUDA accelerated implementation of the colorspace filter. It is by no means feature complete compared to the software colorspace filter, and at the current time only supports color range conversion between jpeg/full and mpeg/limited range. The filter accepts the following options: =over 4 =item B Specify output color range. The accepted values are: =over 4 =item B TV (restricted) range =item B MPEG (restricted) range =item B PC (full) range =item B JPEG (full) range =back =back =head2 colortemperature Adjust color temperature in video to simulate variations in ambient color temperature. The filter accepts the following options: =over 4 =item B Set the temperature in Kelvin. Allowed range is from 1000 to 40000. Default value is 6500 K. =item B Set mixing with filtered output. Allowed range is from 0 to 1. Default value is 1. =item B Set the amount of preserving lightness. Allowed range is from 0 to 1. Default value is 0. =back =head3 Commands This filter supports same B as options. =head2 convolution Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements. The filter accepts the following options: =over 4 =item B<0m> =item B<1m> =item B<2m> =item B<3m> Set matrix for each plane. Matrix is sequence of 9, 25 or 49 signed integers in I mode, and from 1 to 49 odd number of signed integers in I mode. =item B<0rdiv> =item B<1rdiv> =item B<2rdiv> =item B<3rdiv> Set multiplier for calculated value for each plane. If unset or 0, it will be sum of all matrix elements. =item B<0bias> =item B<1bias> =item B<2bias> =item B<3bias> Set bias for each plane. This value is added to the result of the multiplication. Useful for making the overall image brighter or darker. Default is 0.0. =item B<0mode> =item B<1mode> =item B<2mode> =item B<3mode> Set matrix mode for each plane. Can be I, I or I. Default is I. =back =head3 Commands This filter supports the all above options as B. =head3 Examples =over 4 =item * Apply sharpen: convolution="0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0" =item * Apply blur: convolution="1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9" =item * Apply edge enhance: convolution="0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128" =item * Apply edge detect: convolution="0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128" =item * Apply laplacian edge detector which includes diagonals: convolution="1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0" =item * Apply emboss: convolution="-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2" =back =head2 convolve Apply 2D convolution of video stream in frequency domain using second stream as impulse. The filter accepts the following options: =over 4 =item B Set which planes to process. =item B Set which impulse video frames will be processed, can be I or I. Default is I. =back The C filter also supports the B options. =head2 copy Copy the input video source unchanged to the output. This is mainly useful for testing purposes. =head2 coreimage Video filtering on GPU using Apple's CoreImage API on OSX. Hardware acceleration is based on an OpenGL context. Usually, this means it is processed by video hardware. However, software-based OpenGL implementations exist which means there is no guarantee for hardware processing. It depends on the respective OSX. There are many filters and image generators provided by Apple that come with a large variety of options. The filter has to be referenced by its name along with its options. The coreimage filter accepts the following options: =over 4 =item B List all available filters and generators along with all their respective options as well as possible minimum and maximum values along with the default values. list_filters=true =item B Specify all filters by their respective name and options. Use I 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 C is available to use default options for a filter. It is required to specify either C 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=@
same as I / I =item B input sample aspect ratio =item B input display aspect ratio, it is the same as (I / I) * I =item B =item B horizontal and vertical chroma subsample values. For example for the pixel format "yuv422p" I is 2 and I is 1. =item B The number of the input frame, starting from 0. =item B the position in the file of the input frame, NAN if unknown; deprecated, do not use =item B The timestamp expressed in seconds. It's NAN if the input timestamp is unknown. =back The expression for I may depend on the value of I, and the expression for I may depend on I, but they cannot depend on I and I, as I and I are evaluated after I and I. The I and I parameters specify the expressions for the position of the top-left corner of the output (non-cropped) area. They are evaluated for each frame. If the evaluated value is not valid, it is approximated to the nearest valid value. The expression for I may depend on I, and the expression for I may depend on I. =head3 Examples =over 4 =item * Crop area with size 100x100 at position (12,34). crop=100:100:12:34 Using named options, the example above becomes: crop=w=100:h=100:x=12:y=34 =item * Crop the central input area with size 100x100: crop=100:100 =item * Crop the central input area with size 2/3 of the input video: crop=2/3*in_w:2/3*in_h =item * Crop the input video central square: crop=out_w=in_h crop=in_h =item * Delimit the rectangle with the top-left corner placed at position 100:100 and the right-bottom corner corresponding to the right-bottom corner of the input image. crop=in_w-100:in_h-100:100:100 =item * Crop 10 pixels from the left and right borders, and 20 pixels from the top and bottom borders crop=in_w-2*10:in_h-2*20 =item * Keep only the bottom right quarter of the input image: crop=in_w/2:in_h/2:in_w/2:in_h/2 =item * Crop height for getting Greek harmony: crop=in_w:1/PHI*in_w =item * Apply trembling effect: crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7) =item * Apply erratic camera effect depending on timestamp: crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13) =item * Set x depending on the value of y: crop=in_w/2:in_h/2:y:10+10*sin(n/10) =back =head3 Commands This filter supports the following commands: =over 4 =item B =item B =item B =item B Set width/height of the output video and the horizontal/vertical position in the input video. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. =back =head2 cropdetect Auto-detect the crop size. It calculates the necessary cropping parameters and prints the recommended parameters via the logging system. The detected dimensions correspond to the non-black or video area of the input video according to I. It accepts the following parameters: =over 4 =item B Depending on I crop detection is based on either the mere black value of surrounding pixels or a combination of motion vectors and edge pixels. =over 4 =item B Detect black pixels surrounding the playing video. For fine control use option I. =item B Detect the playing video by the motion vectors inside the video and scanning for edge pixels typically forming the border of a playing video. =back =item B Set higher black value threshold, which can be optionally specified from nothing (0) to everything (255 for 8-bit based formats). An intensity value greater to the set value is considered non-black. It defaults to 24. You can also specify a value between 0.0 and 1.0 which will be scaled depending on the bitdepth of the pixel format. =item B The value which the width/height should be divisible by. It defaults to 16. The offset is automatically adjusted to center the video. Use 2 to get only even dimensions (needed for 4:2:2 video). 16 is best when encoding to most video codecs. =item B Set the number of initial frames for which evaluation is skipped. Default is 2. Range is 0 to INT_MAX. =item B Set the counter that determines after how many frames cropdetect will reset the previously detected largest video area and start over to detect the current optimal crop area. Default value is 0. This can be useful when channel logos distort the video area. 0 indicates 'never reset', and returns the largest area encountered during playback. =item B Set motion in pixel units as threshold for motion detection. It defaults to 8. =item B =item B 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. I and I threshold values must be chosen in the range [0,1], and I should be lesser or equal to I. Default value for I is C<5/255>, and default value for I is C<15/255>. =back =head3 Examples =over 4 =item * Find video area surrounded by black borders: ffmpeg -i file.mp4 -vf cropdetect,metadata=mode=print -f null - =item * Find an embedded video area, generate motion vectors beforehand: ffmpeg -i file.mp4 -vf mestimate,cropdetect=mode=mvedges,metadata=mode=print -f null - =item * Find an embedded video area, use motion vectors from decoder: ffmpeg -flags2 +export_mvs -i file.mp4 -vf cropdetect=mode=mvedges,metadata=mode=print -f null - =back =head3 Commands This filter supports the following commands: =over 4 =item B The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. =back =head2 cue Delay video filtering until a given wallclock timestamp. The filter first passes on B amount of frames, then it buffers at most B amount of frames and waits for the cue. After reaching the cue it forwards the buffered frames and also any subsequent frames coming in its input. The filter can be used synchronize the output of multiple ffmpeg processes for realtime output devices like decklink. By putting the delay in the filtering chain and pre-buffering frames the process can pass on data to output almost immediately after the target wallclock timestamp is reached. Perfect frame accuracy cannot be guaranteed, but the result is good enough for some use cases. =over 4 =item B The cue timestamp expressed in a UNIX timestamp in microseconds. Default is 0. =item B The duration of content to pass on as preroll expressed in seconds. Default is 0. =item B The maximum duration of content to buffer before waiting for the cue expressed in seconds. Default is 0. =back =head2 curves Apply color adjustments using curves. This filter is similar to the Adobe Photoshop and GIMP curves tools. Each component (red, green and blue) has its values defined by I key points tied from each other using a smooth curve. The x-axis represents the pixel values from the input frame, and the y-axis the new pixel values to be set for the output frame. By default, a component curve is defined by the two points I<(0;0)> and I<(1;1)>. This creates a straight line where each original pixel value is "adjusted" to its own value, which means no change to the image. The filter allows you to redefine these two points and add some more. A new curve will be define to pass smoothly through all these new coordinates. The new defined points needs to be strictly increasing over the x-axis, and their I and I values must be in the I<[0;1]> interval. The curve is formed by using a natural or monotonic cubic spline interpolation, depending on the I option (default: C). The C spline produces a smoother curve in general while the monotonic (C) spline guarantees the transitions between the specified points to be monotonic. If the computed curves happened to go outside the vector spaces, the values will be clipped accordingly. The filter accepts the following options: =over 4 =item B Select one of the available color presets. This option can be used in addition to the B, B, B parameters; in this case, the later options takes priority on the preset values. Available presets are: =over 4 =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =back Default is C. =item B Set the master key points. These points will define a second pass mapping. It is sometimes called a "luminance" or "value" mapping. It can be used with B, B, B or B since it acts like a post-processing LUT. =item B Set the key points for the red component. =item B Set the key points for the green component. =item B Set the key points for the blue component. =item B Set the key points for all components (not including master). Can be used in addition to the other key points component options. In this case, the unset component(s) will fallback on this B setting. =item B Specify a Photoshop curves file (C<.acv>) to import the settings from. =item B Save Gnuplot script of the curves in specified file. =item B Specify the kind of interpolation. Available algorithms are: =over 4 =item B Natural cubic spline using a piece-wise cubic polynomial that is twice continuously differentiable. =item B Monotonic cubic spline using a piecewise cubic Hermite interpolating polynomial (PCHIP). =back =back To avoid some filtergraph syntax conflicts, each key points list need to be defined using the following syntax: C. =head3 Commands This filter supports same B as options. =head3 Examples =over 4 =item * Increase slightly the middle level of blue: curves=blue='0/0 0.5/0.58 1/1' =item * Vintage effect: curves=r='0/0.11 .42/.51 1/0.95':g='0/0 0.50/0.48 1/1':b='0/0.22 .49/.44 1/0.8' Here we obtain the following coordinates for each components: =over 4 =item I C<(0;0.11) (0.42;0.51) (1;0.95)> =item I C<(0;0) (0.50;0.48) (1;1)> =item I C<(0;0.22) (0.49;0.44) (1;0.80)> =back =item * The previous example can also be achieved with the associated built-in preset: curves=preset=vintage =item * Or simply: curves=vintage =item * Use a Photoshop preset and redefine the points of the green component: curves=psfile='MyCurvesPresets/purple.acv':green='0/0 0.45/0.53 1/1' =item * Check out the curves of the C profile using B and B: ffmpeg -f lavfi -i color -vf curves=cross_process:plot=/tmp/curves.plt -frames:v 1 -f null - gnuplot -p /tmp/curves.plt =back =head2 datascope Video data analysis filter. This filter shows hexadecimal pixel values of part of video. The filter accepts the following options: =over 4 =item B Set output video size. =item B Set x offset from where to pick pixels. =item B Set y offset from where to pick pixels. =item B Set scope mode, can be one of the following: =over 4 =item B Draw hexadecimal pixel values with white color on black background. =item B Draw hexadecimal pixel values with input video pixel color on black background. =item B Draw hexadecimal pixel values on color background picked from input video, the text color is picked in such way so its always visible. =back =item B Draw rows and columns numbers on left and top of video. =item B Set background opacity. =item B Set display number format. Can be C, or C. Default is C. =item B Set pixel components to display. By default all pixel components are displayed. =back =head3 Commands This filter supports same B as options excluding C option. =head2 dblur Apply Directional blur filter. The filter accepts the following options: =over 4 =item B Set angle of directional blur. Default is C<45>. =item B Set radius of directional blur. Default is C<5>. =item B Set which planes to filter. By default all planes are filtered. =back =head3 Commands This filter supports same B as options. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. =head2 dctdnoiz Denoise frames using 2D DCT (frequency domain filtering). This filter is not designed for real time. The filter accepts the following options: =over 4 =item B Set the noise sigma constant. This I defines a hard threshold of C<3 * sigma>; every DCT coefficient (absolute value) below this threshold with be dropped. If you need a more advanced filtering, see B. Default is C<0>. =item B Set number overlapping pixels for each block. Since the filter can be slow, you may want to reduce this value, at the cost of a less effective filter and the risk of various artefacts. If the overlapping value doesn't permit processing the whole input width or height, a warning will be displayed and according borders won't be denoised. Default value is I-1, which is the best possible setting. =item B Set the coefficient factor expression. For each coefficient of a DCT block, this expression will be evaluated as a multiplier value for the coefficient. If this is option is set, the B option will be ignored. The absolute value of the coefficient can be accessed through the I variable. =item B Set the I using the number of bits. C<1EEI> defines the I, which is the width and height of the processed blocks. The default value is I<3> (8x8) and can be raised to I<4> for a I of 16x16. Note that changing this setting has huge consequences on the speed processing. Also, a larger block size does not necessarily means a better de-noising. =back =head3 Examples Apply a denoise with a B of C<4.5>: dctdnoiz=4.5 The same operation can be achieved using the expression system: dctdnoiz=e='gte(c, 4.5*3)' Violent denoise using a block size of C<16x16>: dctdnoiz=15:n=4 =head2 deband Remove banding artifacts from input video. It works by replacing banded pixels with average value of referenced pixels. The filter accepts the following options: =over 4 =item B<1thr> =item B<2thr> =item B<3thr> =item B<4thr> Set banding detection threshold for each plane. Default is 0.02. Valid range is 0.00003 to 0.5. If difference between current pixel and reference pixel is less than threshold, it will be considered as banded. =item B Banding detection range in pixels. Default is 16. If positive, random number in range 0 to set value will be used. If negative, exact absolute value will be used. The range defines square of four pixels around current pixel. =item B Set direction in radians from which four pixel will be compared. If positive, random direction from 0 to set direction will be picked. If negative, exact of absolute value will be picked. For example direction 0, -PI or -2*PI radians will pick only pixels on same row and -PI/2 will pick only pixels on same column. =item B If enabled, current pixel is compared with average value of all four surrounding pixels. The default is enabled. If disabled current pixel is compared with all four surrounding pixels. The pixel is considered banded if only all four differences with surrounding pixels are less than threshold. =item B If enabled, current pixel is changed if and only if all pixel components are banded, e.g. banding detection threshold is triggered for all color components. The default is disabled. =back =head3 Commands This filter supports the all above options as B. =head2 deblock Remove blocking artifacts from input video. The filter accepts the following options: =over 4 =item B Set filter type, can be I or I. Default is I. This controls what kind of deblocking is applied. =item B Set size of block, allowed range is from 4 to 512. Default is I<8>. =item B =item B =item B =item B Set blocking detection thresholds. Allowed range is 0 to 1. Defaults are: I<0.098> for I and I<0.05> for the rest. Using higher threshold gives more deblocking strength. Setting I controls threshold detection at exact edge of block. Remaining options controls threshold detection near the edge. Each one for below/above or left/right. Setting any of those to I<0> disables deblocking. =item B Set planes to filter. Default is to filter all available planes. =back =head3 Examples =over 4 =item * Deblock using weak filter and block size of 4 pixels. deblock=filter=weak:block=4 =item * Deblock using strong filter, block size of 4 pixels and custom thresholds for deblocking more edges. deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05 =item * Similar as above, but filter only first plane. deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=1 =item * Similar as above, but filter only second and third plane. deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=6 =back =head3 Commands This filter supports the all above options as B. =head2 decimate Drop duplicated frames at regular intervals. The filter accepts the following options: =over 4 =item B Set the number of frames from which one will be dropped. Setting this to I means one frame in every batch of I frames will be dropped. Default is C<5>. =item B Set the threshold for duplicate detection. If the difference metric for a frame is less than or equal to this value, then it is declared as duplicate. Default is C<1.1> =item B Set scene change threshold. Default is C<15>. =item B =item B Set the size of the x and y-axis blocks used during metric calculations. Larger blocks give better noise suppression, but also give worse detection of small movements. Must be a power of two. Default is C<32>. =item B Mark main input as a pre-processed input and activate clean source input stream. This allows the input to be pre-processed with various filters to help the metrics calculation while keeping the frame selection lossless. When set to C<1>, the first stream is for the pre-processed input, and the second stream is the clean source from where the kept frames are chosen. Default is C<0>. =item B Set whether or not chroma is considered in the metric calculations. Default is C<1>. =item B Set whether or not the input only partially contains content to be decimated. Default is C. If enabled video output stream will be in variable frame rate. =back =head2 deconvolve Apply 2D deconvolution of video stream in frequency domain using second stream as impulse. The filter accepts the following options: =over 4 =item B Set which planes to process. =item B Set which impulse video frames will be processed, can be I or I. Default is I. =item B Set noise when doing divisions. Default is I<0.0000001>. Useful when width and height are not same and not power of 2 or if stream prior to convolving had noise. =back The C filter also supports the B options. =head2 dedot Reduce cross-luminance (dot-crawl) and cross-color (rainbows) from video. It accepts the following options: =over 4 =item B Set mode of operation. Can be combination of I for cross-luminance reduction and/or I for cross-color reduction. =item B Set spatial luma threshold. Lower values increases reduction of cross-luminance. =item B Set tolerance for temporal luma. Higher values increases reduction of cross-luminance. =item B Set tolerance for chroma temporal variation. Higher values increases reduction of cross-color. =item B Set temporal chroma threshold. Lower values increases reduction of cross-color. =back =head2 deflate Apply deflate effect to the video. This filter replaces the pixel by the local(3x3) average by taking into account only values lower than the pixel. It accepts the following options: =over 4 =item B =item B =item B =item B Limit the maximum change for each plane, default is 65535. If 0, plane will remain unchanged. =back =head3 Commands This filter supports the all above options as B. =head2 deflicker Remove temporal frame luminance variations. It accepts the following options: =over 4 =item B Set moving-average filter size in frames. Default is 5. Allowed range is 2 - 129. =item B Set averaging mode to smooth temporal luminance variations. Available values are: =over 4 =item B Arithmetic mean =item B Geometric mean =item B Harmonic mean =item B Quadratic mean =item B Cubic mean =item B Power mean =item B Median =back =item B Do not actually modify frame. Useful when one only wants metadata. =back =head2 dejudder Remove judder produced by partially interlaced telecined content. Judder can be introduced, for instance, by B filter. If the original source was partially telecined content then the output of C will have a variable frame rate. May change the recorded frame rate of the container. Aside from that change, this filter will not affect constant frame rate video. The option available in this filter is: =over 4 =item B Specify the length of the window over which the judder repeats. Accepts any integer greater than 1. Useful values are: =over 4 =item B<4> If the original was telecined from 24 to 30 fps (Film to NTSC). =item B<5> If the original was telecined from 25 to 30 fps (PAL to NTSC). =item B<20> If a mixture of the two. =back The default is B<4>. =back =head2 delogo Suppress a TV station logo by a simple interpolation of the surrounding pixels. Just set a rectangle covering the logo and watch it disappear (and sometimes something even uglier appear - your mileage may vary). It accepts the following parameters: =over 4 =item B =item B Specify the top left corner coordinates of the logo. They must be specified. =item B =item B Specify the width and height of the logo to clear. They must be specified. =item B When set to 1, a green rectangle is drawn on the screen to simplify finding the right I, I, I, and I 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. =back =head3 Examples =over 4 =item * Set a rectangle covering the area with top left corner coordinates 0,0 and size 100x77: delogo=x=0:y=0:w=100:h=77 =back =head2 derain Remove the rain in the input image/video by applying the derain methods based on convolutional neural networks. Supported models: =over 4 =item * Recurrent Squeeze-and-Excitation Context Aggregation Net (RESCAN). See EBE. =back Training as well as model generation scripts are provided in the repository at EBE. The filter accepts the following options: =over 4 =item B Specify which filter to use. This option accepts the following values: =over 4 =item B Derain filter. To conduct derain filter, you need to use a derain model. =item B Dehaze filter. To conduct dehaze filter, you need to use a dehaze model. =back Default value is B. =item B Specify which DNN backend to use for model loading and execution. This option accepts the following values: =over 4 =item B TensorFlow backend. To enable this backend you need to install the TensorFlow for C library (see EBE) and configure FFmpeg with C<--enable-libtensorflow> =back =item B Set path to model file specifying network architecture and its parameters. Note that different backends use different file formats. TensorFlow can load files for only its format. =back To get full functionality (such as async execution), please use the B filter. =head2 deshake Attempt to fix small changes in horizontal and/or vertical shift. This filter helps remove camera shake from hand-holding a camera, bumping a tripod, moving on a vehicle, etc. The filter accepts the following options: =over 4 =item B =item B =item B =item B 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 I, I, I and I 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. =item B =item B Specify the maximum extent of movement in x and y directions in the range 0-64 pixels. Default 16. =item B Specify how to generate pixels to fill blanks at the edge of the frame. Available values are: =over 4 =item B Fill zeroes at blank locations =item B Original image at blank locations =item B Extruded edge value at blank locations =item B Mirrored edge at blank locations =back Default value is B. =item B Specify the blocksize to use for motion search. Range 4-128 pixels, default 8. =item B 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. =item B Specify the search strategy. Available values are: =over 4 =item B Set exhaustive search =item B Set less exhaustive search. =back Default value is B. =item B If set then a detailed log of the motion search is written to the specified file. =back =head2 despill Remove unwanted contamination of foreground colors, caused by reflected color of greenscreen or bluescreen. This filter accepts the following options: =over 4 =item B Set what type of despill to use. =item B Set how spillmap will be generated. =item B Set how much to get rid of still remaining spill. =item B Controls amount of red in spill area. =item B Controls amount of green in spill area. Should be -1 for greenscreen. =item B Controls amount of blue in spill area. Should be -1 for bluescreen. =item B Controls brightness of spill area, preserving colors. =item B Modify alpha from generated spillmap. =back =head3 Commands This filter supports the all above options as B. =head2 detelecine Apply an exact inverse of the telecine operation. It requires a predefined pattern specified using the pattern option which must be the same as that passed to the telecine filter. This filter accepts the following options: =over 4 =item B =over 4 =item B top field first =item B bottom field first The default value is C. =back =item B A string of numbers representing the pulldown pattern you wish to apply. The default value is C<23>. =item B 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 C<0>. =back =head2 dilation Apply dilation effect to the video. This filter replaces the pixel by the local(3x3) maximum. It accepts the following options: =over 4 =item B =item B =item B =item B Limit the maximum change for each plane, default is 65535. If 0, plane will remain unchanged. =item B 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: 1 2 3 4 5 6 7 8 =back =head3 Commands This filter supports the all above options as B. =head2 displace Displace pixels as indicated by second and third input stream. It takes three input streams and outputs one stream, the first input is the source, and second and third input are displacement maps. The second input specifies how much to displace pixels along the x-axis, while the third input specifies how much to displace pixels along the y-axis. If one of displacement map streams terminates, last frame from that displacement map will be used. Note that once generated, displacements maps can be reused over and over again. A description of the accepted options follows. =over 4 =item B Set displace behavior for pixels that are out of range. Available values are: =over 4 =item B Missing pixels are replaced by black pixels. =item B Adjacent pixels will spread out to replace missing pixels. =item B Out of range pixels are wrapped so they point to pixels of other side. =item B Out of range pixels will be replaced with mirrored pixels. =back Default is B. =back =head3 Examples =over 4 =item * Add ripple effect to rgb input of video size hd720: ffmpeg -i INPUT -f lavfi -i nullsrc=s=hd720,lutrgb=128:128:128 -f lavfi -i nullsrc=s=hd720,geq='r=128+30*sin(2*PI*X/400+T):g=128+30*sin(2*PI*X/400+T):b=128+30*sin(2*PI*X/400+T)' -lavfi '[0][1][2]displace' OUTPUT =item * Add wave effect to rgb input of video size hd720: ffmpeg -i INPUT -f lavfi -i nullsrc=hd720,geq='r=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):g=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):b=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T))' -lavfi '[1]split[x][y],[0][x][y]displace' OUTPUT =back =head2 dnn_classify Do classification with deep neural networks based on bounding boxes. The filter accepts the following options: =over 4 =item B Specify which DNN backend to use for model loading and execution. This option accepts only openvino now, tensorflow backends will be added. =item B Set path to model file specifying network architecture and its parameters. Note that different backends use different file formats. =item B Set the input name of the dnn network. =item B Set the output name of the dnn network. =item B Set the confidence threshold (default: 0.5). =item B Set path to label file specifying the mapping between label id and name. Each label name is written in one line, tailing spaces and empty lines are skipped. The first line is the name of label id 0, and the second line is the name of label id 1, etc. The label id is considered as name if the label file is not provided. =item B Set the configs to be passed into backend For tensorflow backend, you can set its configs with B options, please use tools/python/tf_sess_config.py to get the configs for your system. =back =head2 dnn_detect Do object detection with deep neural networks. The filter accepts the following options: =over 4 =item B Specify which DNN backend to use for model loading and execution. This option accepts only openvino now, tensorflow backends will be added. =item B Set path to model file specifying network architecture and its parameters. Note that different backends use different file formats. =item B Set the input name of the dnn network. =item B Set the output name of the dnn network. =item B Set the confidence threshold (default: 0.5). =item B Set path to label file specifying the mapping between label id and name. Each label name is written in one line, tailing spaces and empty lines are skipped. The first line is the name of label id 0 (usually it is 'background'), and the second line is the name of label id 1, etc. The label id is considered as name if the label file is not provided. =item B Set the configs to be passed into backend. To use async execution, set async (default: set). Roll back to sync execution if the backend does not support async. =back =head2 dnn_processing Do image processing with deep neural networks. It works together with another filter which converts the pixel format of the Frame to what the dnn network requires. The filter accepts the following options: =over 4 =item B Specify which DNN backend to use for model loading and execution. This option accepts the following values: =over 4 =item B TensorFlow backend. To enable this backend you need to install the TensorFlow for C library (see EBE) and configure FFmpeg with C<--enable-libtensorflow> =item B OpenVINO backend. To enable this backend you need to build and install the OpenVINO for C library (see EBE) and configure FFmpeg with C<--enable-libopenvino> (--extra-cflags=-I... --extra-ldflags=-L... might be needed if the header files and libraries are not installed into system path) =back =item B Set path to model file specifying network architecture and its parameters. Note that different backends use different file formats. TensorFlow, OpenVINO backend can load files for only its format. =item B Set the input name of the dnn network. =item B Set the output name of the dnn network. =item B Set the configs to be passed into backend. To use async execution, set async (default: set). Roll back to sync execution if the backend does not support async. For tensorflow backend, you can set its configs with B options, please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system. =back =head3 Examples =over 4 =item * Remove rain in rgb24 frame with can.pb (see B filter): ./ffmpeg -i rain.jpg -vf format=rgb24,dnn_processing=dnn_backend=tensorflow:model=can.pb:input=x:output=y derain.jpg =item * Handle the Y channel with srcnn.pb (see B filter) for frame with yuv420p (planar YUV formats supported): ./ffmpeg -i 480p.jpg -vf format=yuv420p,scale=w=iw*2:h=ih*2,dnn_processing=dnn_backend=tensorflow:model=srcnn.pb:input=x:output=y -y srcnn.jpg =item * Handle the Y channel with espcn.pb (see B filter), which changes frame size, for format yuv420p (planar YUV formats supported), please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system. ./ffmpeg -i 480p.jpg -vf format=yuv420p,dnn_processing=dnn_backend=tensorflow:model=espcn.pb:input=x:output=y:backend_configs=sess_config=0x10022805320e09cdccccccccccec3f20012a01303801 -y tmp.espcn.jpg =back =head2 drawbox Draw a colored box on the input image. It accepts the following parameters: =over 4 =item B =item B The expressions which specify the top left corner coordinates of the box. It defaults to 0. =item B =item B 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. =item B Specify the color of the box to write. For the general syntax of this option, check the B<"Color" section in the ffmpeg-utils manual>. If the special value C is used, the box edge color is the same as the video with inverted luma. =item B The expression which sets the thickness of the box edge. A value of C will create a filled box. Default value is C<3>. See below for the list of accepted constants. =item B Applicable if the input has alpha. With value C<1>, the pixels of the painted box will overwrite the video's color and alpha pixels. Default is C<0>, which composites the box onto the input, leaving the video's alpha intact. =back The parameters for I, I, I and I and I are expressions containing the following constants: =over 4 =item B The input display aspect ratio, it is the same as (I / I) * I. =item B =item B horizontal and vertical chroma subsample values. For example for the pixel format "yuv422p" I is 2 and I is 1. =item B =item B The input width and height. =item B The input sample aspect ratio. =item B =item B The x and y offset coordinates where the box is drawn. =item B =item B The width and height of the drawn box. =item B Box source can be set as side_data_detection_bboxes if you want to use box data in detection bboxes of side data. If I is set, the I, I, I and I will be ignored and still use box data in detection bboxes of side data. So please do not use this parameter if you were not sure about the box source. =item B The thickness of the drawn box. These constants allow the I, I, I, I and I expressions to refer to each other, so you may for example specify C or C. =back =head3 Examples =over 4 =item * Draw a black box around the edge of the input image: drawbox =item * Draw a box with color red and an opacity of 50%: drawbox=10:20:200:60:red@0.5 The previous example can be specified as: drawbox=x=10:y=20:w=200:h=60:color=red@0.5 =item * Fill the box with pink color: drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill =item * Draw a 2-pixel red 2.40:1 mask: drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red =back =head3 Commands This filter supports same commands as options. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. =head2 drawgraph Draw a graph using input video metadata. It accepts the following parameters: =over 4 =item B Set 1st frame metadata key from which metadata values will be used to draw a graph. =item B Set 1st foreground color expression. =item B Set 2nd frame metadata key from which metadata values will be used to draw a graph. =item B Set 2nd foreground color expression. =item B Set 3rd frame metadata key from which metadata values will be used to draw a graph. =item B Set 3rd foreground color expression. =item B Set 4th frame metadata key from which metadata values will be used to draw a graph. =item B Set 4th foreground color expression. =item B Set minimal value of metadata value. =item B Set maximal value of metadata value. =item B Set graph background color. Default is white. =item B Set graph mode. Available values for mode is: =over 4 =item B =item B =item B =back Default is C. =item B Set slide mode. Available values for slide is: =over 4 =item B Draw new frame when right border is reached. =item B Replace old columns with new ones. =item B Scroll from right to left. =item B Scroll from left to right. =item B Draw single picture. =back Default is C. =item B Set size of graph video. For the syntax of this option, check the B<"Video size" section in the ffmpeg-utils manual>. The default value is C<900x256>. =item B Set the output frame rate. Default value is C<25>. The foreground color expressions can use the following variables: =over 4 =item B Minimal value of metadata value. =item B Maximal value of metadata value. =item B Current metadata key value. =back The color is defined as 0xAABBGGRR. =back Example using metadata from B filter: signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255 Example using metadata from B filter: ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5 =head2 drawgrid Draw a grid on the input image. It accepts the following parameters: =over 4 =item B =item B The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0. =item B =item B 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 C, so image gets framed. Default to 0. =item B Specify the color of the grid. For the general syntax of this option, check the B<"Color" section in the ffmpeg-utils manual>. If the special value C is used, the grid color is the same as the video with inverted luma. =item B The expression which sets the thickness of the grid line. Default value is C<1>. See below for the list of accepted constants. =item B Applicable if the input has alpha. With C<1> the pixels of the painted grid will overwrite the video's color and alpha pixels. Default is C<0>, which composites the grid onto the input, leaving the video's alpha intact. =back The parameters for I, I, I and I and I are expressions containing the following constants: =over 4 =item B The input display aspect ratio, it is the same as (I / I) * I. =item B =item B horizontal and vertical chroma subsample values. For example for the pixel format "yuv422p" I is 2 and I is 1. =item B =item B The input grid cell width and height. =item B The input sample aspect ratio. =item B =item B The x and y coordinates of some point of grid intersection (meant to configure offset). =item B =item B The width and height of the drawn cell. =item B The thickness of the drawn cell. These constants allow the I, I, I, I and I expressions to refer to each other, so you may for example specify C or C. =back =head3 Examples =over 4 =item * 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:color=red@0.5 =item * Draw a white 3x3 grid with an opacity of 50%: drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5 =back =head3 Commands This filter supports same commands as options. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. =head2 drawtext Draw a text string or text from a specified file on top of a video, using the libfreetype library. To enable compilation of this filter, you need to configure FFmpeg with C<--enable-libfreetype> and C<--enable-libharfbuzz>. To enable default font fallback and the I option you need to configure FFmpeg with C<--enable-libfontconfig>. To enable the I option, you need to configure FFmpeg with C<--enable-libfribidi>. =head3 Syntax It accepts the following parameters: =over 4 =item B 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 I is 0. =item B Set the width of the border to be drawn around the box using I. The value must be specified using one of the following formats: =over 4 =item * set the width of all the borders to 10> =item * set the width of the top and bottom borders to 10> and the width of the left and right borders to 20 =item * set the width of the top border to 10, the width> of the bottom border to 30 and the width of the left and right borders to 20 =item * set the borders width to 10 (top), 20 (right),> 30 (bottom), 40 (left) =back The default value of I is "0". =item B The color to be used for drawing box around text. For the syntax of this option, check the B<"Color" section in the ffmpeg-utils manual>. The default value of I is "white". =item B Set the line spacing in pixels. The default value of I is 0. =item B Set the vertical and horizontal alignment of the text with respect to the box boundaries. The value is combination of flags, one for the vertical alignment (T=top, M=middle, B=bottom) and one for the horizontal alignment (L=left, C=center, R=right). Please note that tab characters are only supported with the left horizontal alignment. =item B Specify what the I value is referred to. Possible values are: =over 4 =item * the top of the highest glyph of the first text line is placed at I> =item * the baseline of the first text line is placed at I> =item * the baseline of the first text line is placed at I plus the> ascent (in pixels) defined in the font metrics =back The default value of I is "text" for backward compatibility. =item B Set the width of the border to be drawn around the text using I. The default value of I is 0. =item B Set the color to be used for drawing border around text. For the syntax of this option, check the B<"Color" section in the ffmpeg-utils manual>. The default value of I is "black". =item B Select how the I is expanded. Can be either C, C (deprecated) or C (default). See the B section below for details. =item B Set a start time for the count. Value is in microseconds. Only applied in the deprecated C expansion mode. To emulate in normal expansion mode use the C function, supplying the start time (in seconds) as the second argument. =item B If true, check and fix text coords to avoid clipping. =item B The color to be used for drawing fonts. For the syntax of this option, check the B<"Color" section in the ffmpeg-utils manual>. The default value of I is "black". =item B String which is expanded the same way as I to obtain dynamic I value. By default this option has empty value and is not processed. When this option is set, it overrides I option. =item B The font family to be used for drawing text. By default Sans. =item B The font file to be used for drawing text. The path must be included. This parameter is mandatory if the fontconfig support is disabled. =item B Draw the text applying alpha blending. The value can be a number between 0.0 and 1.0. The expression accepts the same variables I as well. The default value is 1. Please see I. =item B The font size to be used for drawing text. The default value of I is 16. =item B 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). =item B 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: =over 4 =item I =item I =item I =item I =item I =item I =item I =item I =item I =item I =item I =item I =item I =item I =item I =back Default value is "default". For more information consult the documentation for the FT_LOAD_* libfreetype flags. =item B The color to be used for drawing a shadow behind the drawn text. For the syntax of this option, check the B<"Color" section in the ffmpeg-utils manual>. The default value of I is "black". =item B Set the width of the box to be drawn around text. The default value of I is computed automatically to match the text width =item B Set the height of the box to be drawn around text. The default value of I is computed automatically to match the text height =item B =item B 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". =item B The starting frame number for the n/frame_num variable. The default value is "0". =item B The size in number of spaces to use for rendering the tab. Default value is 4. =item B Set the initial timecode representation in "hh:mm:ss[:;.]ff" format. It can be used with or without text parameter. I option must be specified. =item B Set the timecode frame rate (timecode only). Value will be rounded to nearest integer. Minimum value is "1". Drop-frame timecode is supported for frame rates 30 & 60. =item B If set to 1, the output of the timecode option will wrap around at 24 hours. Default is 0 (disabled). =item B 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 I. =item B 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 I. If both I and I are specified, an error is thrown. =item B Text source should be set as side_data_detection_bboxes if you want to use text data in detection bboxes of side data. If text source is set, I and I will be ignored and still use text data in detection bboxes of side data. So please do not use this parameter if you are not sure about the text source. =item B The I will be reloaded at specified frame interval. Be sure to update I atomically, or it may be read partially, or even fail. Range is 0 to INT_MAX. Default is 0. =item B =item B 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 I and I is "0". See below for the list of accepted constants and functions. =back The parameters for I and I are expressions containing the following constants and functions: =over 4 =item B input display aspect ratio, it is the same as (I / I) * I =item B =item B horizontal and vertical chroma subsample values. For example for the pixel format "yuv422p" I is 2 and I is 1. =item B the height of each text line =item B the input height =item B the input width =item B 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 grid's orientation with the Y axis upwards. =item B 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 grid's orientation, with the Y axis upwards. =item B maximum glyph height, that is the maximum height for all the glyphs contained in the rendered text, it is equivalent to I - I. =item B maximum glyph width, that is the maximum width for all the glyphs contained in the rendered text =item B the ascent size defined in the font metrics =item B the descent size defined in the font metrics =item B the maximum ascender of the glyphs of the first text line =item B the maximum descender of the glyphs of the last text line =item B the number of input frame, starting from 0 =item B return a random number included between I and I =item B The input sample aspect ratio. =item B timestamp expressed in seconds, NAN if the input timestamp is unknown =item B the height of the rendered text =item B the width of the rendered text =item B =item B the x and y offset coordinates where the text is drawn. These parameters allow the I and I expressions to refer to each other, so you can for example specify C. =item B A one character description of the current frame's picture type. =item B The current packet's position in the input file or stream (in bytes, from the start of the input). A value of -1 indicates this info is not available. =item B The current packet's duration, in seconds. =item B The current packet's size (in bytes). =back =head3 Text expansion If B is set to C, the filter recognizes sequences accepted by the C C function in the provided text and expands them accordingly. Check the documentation of C. This feature is deprecated in favor of C expansion with the C or C expansion functions. If B is set to C, the text is printed verbatim. If B is set to C (which is the default), the following expansion mechanism is used. The backslash character B<\>, followed by any character, always expands to the second character. Sequences of the form C<%{...}> are expanded. The text between the braces is a function name, possibly followed by arguments separated by ':'. If the arguments contain special characters or delimiters (':' or '}'), they should be escaped. Note that they probably must also be escaped as the value for the B option in the filter argument string and as the filter argument in the filtergraph description, and possibly also for the shell, that makes up to four levels of escaping; using a text file with the B option avoids these problems. The following functions are available: =over 4 =item B The expression evaluation result. It must take one argument specifying the expression to be evaluated, which accepts the same constants and functions as the I and I values. Note that not all constants should be used, for example the text size is not known when evaluating the expression, so the constants I and I will have an undefined value. =item B Evaluate the expression's value and output as formatted integer. The first argument is the expression to be evaluated, just as for the I function. The second argument specifies the output format. Allowed values are B, B, B and B. They are treated exactly as in the C function. The third parameter is optional and sets the number of positions taken by the output. It can be used to add padding with zeros from the left. =item B The time at which the filter is running, expressed in UTC. It can accept an argument: a C C function format string. The format string is extended to support the variable I<%[1-6]N> which prints fractions of the second with optionally specified number of digits. =item B The time at which the filter is running, expressed in the local time zone. It can accept an argument: a C C function format string. The format string is extended to support the variable I<%[1-6]N> which prints fractions of the second with optionally specified number of digits. =item B Frame metadata. Takes one or two arguments. The first argument is mandatory and specifies the metadata key. The second argument is optional and specifies a default value, used when the metadata key is not found or empty. Available metadata can be identified by inspecting entries starting with TAG included within each frame section printed by running C. String metadata generated in filters leading to the drawtext filter are also available. =item B The frame number, starting from 0. =item B A one character description of the current picture type. =item B The timestamp of the current frame. It can take up to three arguments. The first argument is the format of the timestamp; it defaults to C for seconds as a decimal number with microsecond accuracy; C stands for a formatted I<[-]HH:MM:SS.mmm> timestamp with millisecond accuracy. C stands for the timestamp of the frame formatted as UTC time; C stands for the timestamp of the frame formatted as local time zone time. The second argument is an offset added to the timestamp. If the format is set to C, a third argument C<24HH> may be supplied to present the hour part of the formatted timestamp in 24h format (00-23). If the format is set to C or C, a third argument may be supplied: a C C function format string. By default, I format will be used. =back =head3 Commands This filter supports altering parameters via commands: =over 4 =item B Alter existing filter parameters. Syntax for the argument is the same as for filter invocation, e.g. fontsize=56:fontcolor=green:text='Hello World' Full filter invocation with sendcmd would look like this: sendcmd=c='56.0 drawtext reinit fontsize=56\:fontcolor=green\:text=Hello\\ World' If the entire argument can't be parsed or applied as valid values then the filter will continue with its existing parameters. =back The following options are also supported as B: =over 4 =item * =item * =item * =item * =item * =item * =item * =item * =item * =item * =item * =item * =item * =item * =item * =item * =item * =back =head3 Examples =over 4 =item * 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'" =item * 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 yellow with a red box around it. Both the text and the box have an opacity of 20%. drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\ x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2" Note that the double quotes are not necessary if spaces are not used within the parameter list. =item * Show the text at the center of the video frame: drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2" =item * 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\,(h-text_h))\,y)" =item * Show a text line sliding from right to left in the last row of the video frame. The file F is assumed to contain a single line with no newlines. drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t" =item * Show the content of file F off the bottom of the frame and scroll up. drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t" =item * 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" =item * Show text for 1 second every 3 seconds: drawtext="fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:enable=lt(mod(t\,3)\,1):text='blink'" =item * Use fontconfig to set the font. Note that the colons need to be escaped. drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg' =item * Draw "Test Text" with font size dependent on height of the video. drawtext="text='Test Text': fontsize=h/30: x=(w-text_w)/2: y=(h-text_h*2)" =item * Print the date of a real-time encoding (see documentation for the C C function): drawtext='fontfile=FreeSans.ttf:text=%{localtime\:%a %b %d %Y}' =item * Show text fading in and out (appearing/disappearing): #!/bin/sh DS=1.0 # display start DE=10.0 # display end FID=1.5 # fade in duration FOD=5 # fade out duration ffplay -f lavfi "color,drawtext=text=TEST:fontsize=50:fontfile=FreeSerif.ttf:fontcolor_expr=ff0000%{eif\\\\: clip(255*(1*between(t\\, $DS + $FID\\, $DE - $FOD) + ((t - $DS)/$FID)*between(t\\, $DS\\, $DS + $FID) + (-(t - $DE)/$FOD)*between(t\\, $DE - $FOD\\, $DE) )\\, 0\\, 255) \\\\: x\\\\: 2 }" =item * Horizontally align multiple separate texts. Note that B and the B value are included in the B offset. drawtext=fontfile=FreeSans.ttf:text=DOG:fontsize=24:x=10:y=20+24-max_glyph_a, drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a =item * Plot special I metadata onto each frame if such metadata exists. Otherwise, plot the string "NA". Note that image2 demuxer must have option B<-export_path_metadata 1> for the special metadata fields to be available for filters. drawtext="fontsize=20:fontcolor=white:fontfile=FreeSans.ttf:text='%{metadata\:lavf.image2dec.source_basename\:NA}':x=10:y=10" =back For more information about libfreetype, check: EBE. For more information about fontconfig, check: EBE. For more information about libfribidi, check: EBE. For more information about libharfbuzz, check: EBE. =head2 edgedetect Detect and draw edges. The filter uses the Canny Edge Detection algorithm. The filter accepts the following options: =over 4 =item B =item B 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. I and I threshold values must be chosen in the range [0,1], and I should be lesser or equal to I. Default value for I is C<20/255>, and default value for I is C<50/255>. =item B Define the drawing mode. =over 4 =item B Draw white/gray wires on black background. =item B Mix the colors to create a paint/cartoon effect. =item B Apply Canny edge detector on all selected planes. =back Default value is I. =item B Select planes for filtering. By default all available planes are filtered. =back =head3 Examples =over 4 =item * Standard edge detection with custom values for the hysteresis thresholding: edgedetect=low=0.1:high=0.4 =item * Painting effect without thresholding: edgedetect=mode=colormix:high=0 =back =head2 elbg Apply a posterize effect using the ELBG (Enhanced LBG) algorithm. For each input image, the filter will compute the optimal mapping from the input to the output given the codebook length, that is the number of distinct output colors. This filter accepts the following options. =over 4 =item B Set codebook length. The value must be a positive integer, and represents the number of distinct output colors. Default value is 256. =item B 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. =item B 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. =item B Set pal8 output pixel format. This option does not work with codebook length greater than 256. Default is disabled. =item B Include alpha values in the quantization calculation. Allows creating palettized output images (e.g. PNG8) with multiple alpha smooth blending. =back =head2 entropy Measure graylevel entropy in histogram of color channels of video frames. It accepts the following parameters: =over 4 =item B Can be either I or I. Default is I. I mode measures entropy of histogram delta values, absolute differences between neighbour histogram values. =back =head2 epx Apply the EPX magnification filter which is designed for pixel art. It accepts the following option: =over 4 =item B Set the scaling dimension: C<2> for C<2xEPX>, C<3> for C<3xEPX>. Default is C<3>. =back =head2 eq Set brightness, contrast, saturation and approximate gamma adjustment. The filter accepts the following options: =over 4 =item B Set the contrast expression. The value must be a float value in range C<-1000.0> to C<1000.0>. The default value is "1". =item B Set the brightness expression. The value must be a float value in range C<-1.0> to C<1.0>. The default value is "0". =item B Set the saturation expression. The value must be a float in range C<0.0> to C<3.0>. The default value is "1". =item B Set the gamma expression. The value must be a float in range C<0.1> to C<10.0>. The default value is "1". =item B Set the gamma expression for red. The value must be a float in range C<0.1> to C<10.0>. The default value is "1". =item B Set the gamma expression for green. The value must be a float in range C<0.1> to C<10.0>. The default value is "1". =item B Set the gamma expression for blue. The value must be a float in range C<0.1> to C<10.0>. The default value is "1". =item B 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 C<0.0> to C<1.0>. A value of C<0.0> turns the gamma correction all the way down while C<1.0> leaves it at its full strength. Default is "1". =item B Set when the expressions for brightness, contrast, saturation and gamma expressions are evaluated. It accepts the following values: =over 4 =item B only evaluate expressions once during the filter initialization or when a command is processed =item B evaluate expressions for each incoming frame =back Default value is B. =back The expressions accept the following parameters: =over 4 =item B frame count of the input frame starting from 0 =item B byte position of the corresponding packet in the input file, NAN if unspecified; deprecated, do not use =item B frame rate of the input video, NAN if the input frame rate is unknown =item B timestamp expressed in seconds, NAN if the input timestamp is unknown =back =head3 Commands The filter supports the following commands: =over 4 =item B Set the contrast expression. =item B Set the brightness expression. =item B Set the saturation expression. =item B Set the gamma expression. =item B Set the gamma_r expression. =item B Set gamma_g expression. =item B Set gamma_b expression. =item B Set gamma_weight 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. =back =head2 erosion Apply erosion effect to the video. This filter replaces the pixel by the local(3x3) minimum. It accepts the following options: =over 4 =item B =item B =item B =item B Limit the maximum change for each plane, default is 65535. If 0, plane will remain unchanged. =item B 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: 1 2 3 4 5 6 7 8 =back =head3 Commands This filter supports the all above options as B. =head2 estdif Deinterlace the input video ("estdif" stands for "Edge Slope Tracing Deinterlacing Filter"). Spatial only filter that uses edge slope tracing algorithm to interpolate missing lines. It accepts the following parameters: =over 4 =item B The interlacing mode to adopt. It accepts one of the following values: =over 4 =item B Output one frame for each frame. =item B Output one frame for each field. =back The default value is C. =item B The picture field parity assumed for the input interlaced video. It accepts one of the following values: =over 4 =item B Assume the top field is first. =item B Assume the bottom field is first. =item B Enable automatic detection of field parity. =back The default value is C. If the interlacing is unknown or the decoder does not export this information, top field first will be assumed. =item B Specify which frames to deinterlace. Accepts one of the following values: =over 4 =item B Deinterlace all frames. =item B Only deinterlace frames marked as interlaced. =back The default value is C. =item B Specify the search radius for edge slope tracing. Default value is 1. Allowed range is from 1 to 15. =item B Specify the search radius for best edge matching. Default value is 2. Allowed range is from 0 to 15. =item B Specify the edge cost for edge matching. Default value is 2. Allowed range is from 0 to 50. =item B Specify the middle cost for edge matching. Default value is 1. Allowed range is from 0 to 50. =item B Specify the distance cost for edge matching. Default value is 1. Allowed range is from 0 to 50. =item B Specify the interpolation used. Default is 4-point interpolation. It accepts one of the following values: =over 4 =item B<2p> Two-point interpolation. =item B<4p> Four-point interpolation. =item B<6p> Six-point interpolation. =back =back =head3 Commands This filter supports same B as options. =head2 exposure Adjust exposure of the video stream. The filter accepts the following options: =over 4 =item B Set the exposure correction in EV. Allowed range is from -3.0 to 3.0 EV Default value is 0 EV. =item B Set the black level correction. Allowed range is from -1.0 to 1.0. Default value is 0. =back =head3 Commands This filter supports same B as options. =head2 extractplanes Extract color channel components from input video stream into separate grayscale video streams. The filter accepts the following option: =over 4 =item B Set plane(s) to extract. Available values for planes are: =over 4 =item B =item B =item B =item B =item B =item B =item B =back Choosing planes not available in the input will result in an error. That means you cannot select C, C, C planes with C, C, C planes at same time. =back =head3 Examples =over 4 =item * 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 =back =head2 fade Apply a fade-in/out effect to the input video. It accepts the following parameters: =over 4 =item B The effect type can be either "in" for a fade-in, or "out" for a fade-out effect. Default is C. =item B Specify the number of the frame to start applying the fade effect at. Default is 0. =item B 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 B. Default is 25. =item B If set to 1, fade only alpha channel, if one exists on the input. Default value is 0. =item B 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. =item B 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 B. If both duration and nb_frames are specified, duration is used. Default is 0 (nb_frames is used by default). =item B Specify the color of the fade. Default is "black". =back =head3 Examples =over 4 =item * Fade in the first 30 frames of video: fade=in:0:30 The command above is equivalent to: fade=t=in:s=0:n=30 =item * Fade out the last 45 frames of a 200-frame video: fade=out:155:45 fade=type=out:start_frame=155:nb_frames=45 =item * 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 =item * Make the first 5 frames yellow, then fade in from frame 5-24: fade=in:5:20:color=yellow =item * Fade in alpha over first 25 frames of video: fade=in:0:25:alpha=1 =item * Make the first 5.5 seconds black, then fade in for 0.5 seconds: fade=t=in:st=5.5:d=0.5 =back =head2 feedback Apply feedback video filter. This filter pass cropped input frames to 2nd output. From there it can be filtered with other video filters. After filter receives frame from 2nd input, that frame is combined on top of original frame from 1st input and passed to 1st output. The typical usage is filter only part of frame. The filter accepts the following options: =over 4 =item B =item B Set the top left crop position. =item B =item B Set the crop size. =back =head3 Examples =over 4 =item * Blur only top left rectangular part of video frame size 100x100 with gblur filter. [in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]gblur=8[blurin] =item * Draw black box on top left part of video frame of size 100x100 with drawbox filter. [in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]drawbox=x=0:y=0:w=100:h=100:t=100[blurin] =back =head2 fftdnoiz Denoise frames using 3D FFT (frequency domain filtering). The filter accepts the following options: =over 4 =item B Set the noise sigma constant. This sets denoising strength. Default value is 1. Allowed range is from 0 to 30. Using very high sigma with low overlap may give blocking artifacts. =item B Set amount of denoising. By default all detected noise is reduced. Default value is 1. Allowed range is from 0 to 1. =item B Set size of block in pixels, Default is 32, can be 8 to 256. =item B Set block overlap. Default is 0.5. Allowed range is from 0.2 to 0.8. =item B Set denoising method. Default is C, can also be C. =item B Set number of previous frames to use for denoising. By default is set to 0. =item B Set number of next frames to to use for denoising. By default is set to 0. =item B Set planes which will be filtered, by default are all available filtered except alpha. =back =head2 fftfilt Apply arbitrary expressions to samples in frequency domain =over 4 =item B Adjust the dc value (gain) of the luma plane of the image. The filter accepts an integer value in range C<0> to C<1000>. The default value is set to C<0>. =item B Adjust the dc value (gain) of the 1st chroma plane of the image. The filter accepts an integer value in range C<0> to C<1000>. The default value is set to C<0>. =item B Adjust the dc value (gain) of the 2nd chroma plane of the image. The filter accepts an integer value in range C<0> to C<1000>. The default value is set to C<0>. =item B Set the frequency domain weight expression for the luma plane. =item B Set the frequency domain weight expression for the 1st chroma plane. =item B Set the frequency domain weight expression for the 2nd chroma plane. =item B Set when the expressions are evaluated. It accepts the following values: =over 4 =item B Only evaluate expressions once during the filter initialization. =item B Evaluate expressions for each incoming frame. =back Default value is B. The filter accepts the following variables: =item B =item B The coordinates of the current sample. =item B =item B The width and height of the image. =item B The number of input frame, starting from 0. =item B =item B The size of FFT array for horizontal and vertical processing. =back =head3 Examples =over 4 =item * High-pass: fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)' =item * Low-pass: fftfilt=dc_Y=0:weight_Y='squish((Y+X)/100-1)' =item * Sharpen: fftfilt=dc_Y=0:weight_Y='1+squish(1-(Y+X)/100)' =item * Blur: fftfilt=dc_Y=0:weight_Y='exp(-4 * ((Y+X)/(W+H)))' =back =head2 field Extract a single field from an interlaced image using stride arithmetic to avoid wasting CPU time. The output frames are marked as non-interlaced. The filter accepts the following options: =over 4 =item B Specify whether to extract the top (if the value is C<0> or C) or the bottom field (if the value is C<1> or C). =back =head2 fieldhint Create new frames by copying the top and bottom fields from surrounding frames supplied as numbers by the hint file. =over 4 =item B Set file containing hints: absolute/relative frame numbers. There must be one line for each frame in a clip. Each line must contain two numbers separated by the comma, optionally followed by C<-> or C<+>. Numbers supplied on each line of file can not be out of [N-1,N+1] where N is current frame number for C mode or out of [-1, 1] range for C mode. First number tells from which frame to pick up top field and second number tells from which frame to pick up bottom field. If optionally followed by C<+> output frame will be marked as interlaced, else if followed by C<-> output frame will be marked as progressive, else it will be marked same as input frame. If optionally followed by C output frame will use only top field, or in case of C it will use only bottom field. If line starts with C<#> or C<;> that line is skipped. =item B Can be item C or C or C. Default is C. The C mode is same as C mode, except at last entry of file if there are more frames to process than C file is seek back to start. =back Example of first several lines of C file for C mode: 0,0 - # first frame 1,0 - # second frame, use third's frame top field and second's frame bottom field 1,0 - # third frame, use fourth's frame top field and third's frame bottom field 1,0 - 0,0 - 0,0 - 1,0 - 1,0 - 1,0 - 0,0 - 0,0 - 1,0 - 1,0 - 1,0 - 0,0 - =head2 fieldmatch Field matching filter for inverse telecine. It is meant to reconstruct the progressive frames from a telecined stream. The filter does not drop duplicated frames, so to achieve a complete inverse telecine C needs to be followed by a decimation filter such as B in the filtergraph. The separation of the field matching and the decimation is notably motivated by the possibility of inserting a de-interlacing filter fallback between the two. If the source has mixed telecined and real interlaced content, C will not be able to match fields for the interlaced parts. But these remaining combed frames will be marked as interlaced, and thus can be de-interlaced by a later filter such as B before decimation. In addition to the various configuration options, C can take an optional second stream, activated through the B option. If enabled, the frames reconstruction will be based on the fields and frames from this second stream. This allows the first input to be pre-processed in order 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 brightness/contrast adjustments can help. Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project) and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from which C is based on. While the semantic and usage are very close, some behaviour and options names can differ. The B filter currently only works for constant frame rate 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 stream: C. The filter accepts the following options: =over 4 =item B Specify the assumed field order of the input stream. Available values are: =over 4 =item B Auto detect parity (use FFmpeg's internal parity value). =item B Assume bottom field first. =item B Assume top field first. =back Note that it is sometimes recommended not to trust the parity announced by the stream. Default value is I. =item B Set the matching mode or strategy to use. B mode is the safest in the sense that it won't 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, B 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 B and B 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 B

section. Available values are: =over 4 =item B 2-way matching (p/c) =item B 2-way matching, and trying 3rd match if still combed (p/c + n) =item B 2-way matching, and trying 3rd match (same order) if still combed (p/c + u) =item B 2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if still combed (p/c + n + u/b) =item B 3-way matching (p/c/n) =item B 3-way matching, and trying 4th/5th matches if all 3 of the original matches are detected as combed (p/c/n + u/b) =back The parenthesis at the end indicate the matches that would be used for that mode assuming B=I (and B on I or I). In terms of speed B mode is by far the fastest and B is the slowest. Default value is I. =item B 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 B feature from VFM/TFM. Default value is C<0> (disabled). =item B Set the field to match from. It is recommended to set this to the same value as B 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: =over 4 =item B Automatic (same value as B). =item B Match from the bottom field. =item B Match from the top field. =back Default value is I. =item B 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 C<0> only if your clip has bad chroma problems such as heavy rainbowing or other artifacts. Setting this to C<0> could also be used to speed things up at the cost of some accuracy. Default value is C<1>. =item B =item B These define an exclusion band which excludes the lines between B and B 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. B sets the starting scan line and B sets the ending line; all lines in between B and B (including B and B) will be ignored. Setting B and B to the same value will disable the feature. B and B defaults to C<0>. =item B Set the scene change detection threshold as a percentage of maximum change on the luma plane. Good values are in the C<[8.0, 14.0]> range. Scene change detection is only relevant in case B=I. The range for B is C<[0.0, 100.0]>. Default value is C<12.0>. =item B When B is not I, C will take into account the combed scores of matches when deciding what match to use as the final match. Available values are: =over 4 =item B No final matching based on combed scores. =item B Combed scores are only used when a scene change is detected. =item B Use combed scores all the time. =back Default is I. =item B Force C to calculate the combed metrics for certain matches and print them. This setting is known as B in TFM/VFM vocabulary. Available values are: =over 4 =item B No forced calculation. =item B Force p/c/n calculations. =item B Force p/c/n/u/b calculations. =back Default value is I. =item B 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 C<-1> (every pixel will be detected as combed) to C<255> (no pixel will be detected as combed). This is basically a pixel difference value. A good range is C<[8, 12]>. Default value is C<9>. =item B 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 B=I<0> is usually more reliable, except for the case where there is chroma only combing in the source. Default value is C<0>. =item B =item B 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 B pixels are required to be detected as combed for a frame to be declared combed. See the B 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 C<16>. =item B The number of combed pixels inside any of the B by B size blocks on the frame for the frame to be detected as combed. While B 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 B and B settings) on the frame. Minimum value is C<0> and maximum is C (at which point no frames will ever be detected as combed). This setting is known as B in TFM/VFM vocabulary. Default value is C<80>. =back =head3 p/c/n/u/b meaning =head4 p/c/n We assume the following telecined stream: Top fields: 1 2 2 3 4 Bottom fields: 1 2 3 4 4 The numbers correspond to the progressive frame the fields relate to. Here, the first two frames are progressive, the 3rd and 4th are combed, and so on. When C is configured to run a matching from bottom (B=I) this is how this input stream get transformed: Input stream: T 1 2 2 3 4 B 1 2 3 4 4 <-- matching reference Matches: c c n n c Output stream: T 1 2 3 4 4 B 1 2 3 4 4 As a result of the field matching, 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 instance the B filter. The same operation now matching from top fields (B=I) looks like this: Input stream: T 1 2 2 3 4 <-- matching reference B 1 2 3 4 4 Matches: c c p p c Output stream: T 1 2 2 3 4 B 1 2 2 3 4 In these examples, we can see what I

, I and I mean; basically, they refer to the frame and field of the opposite parity: =over 4 =item * matches the field of the opposite parity in the previous frame> =item * matches the field of the opposite parity in the current frame> =item * matches the field of the opposite parity in the next frame> =back =head4 u/b The I and I matching are 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, bottom:2). According to the match, a 'x' is placed above and below each matched fields. With bottom matching (B=I): Match: c p n b u x x x x x Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2 Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 x x x x x Output frames: 2 1 2 2 2 2 2 2 1 3 With top matching (B=I): Match: c p n b u x x x x x Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2 Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 x x x x x Output frames: 2 2 2 1 2 2 1 3 2 2 =head3 Examples Simple IVTC of a top field first telecined stream: fieldmatch=order=tff:combmatch=none, decimate Advanced IVTC, with fallback on B for still combed frames: fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate =head2 fieldorder Transform the field order of the input video. It accepts the following parameters: =over 4 =item B The output field order. Valid values are I for top field first or I for bottom field first. =back The default value is B. The transformation is 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 broadcast field order converters. If the input video is not 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. It is very useful when converting to or from PAL DV material, which is bottom field first. For example: ffmpeg -i in.vob -vf "fieldorder=bff" out.dv =head2 fifo, afifo Buffer input images and send them when they are requested. It is mainly useful when auto-inserted by the libavfilter framework. It does not take parameters. =head2 fillborders Fill borders of the input video, without changing video stream dimensions. Sometimes video can have garbage at the four edges and you may not want to crop video input to keep size multiple of some number. This filter accepts the following options: =over 4 =item B Number of pixels to fill from left border. =item B Number of pixels to fill from right border. =item B Number of pixels to fill from top border. =item B Number of pixels to fill from bottom border. =item B Set fill mode. It accepts the following values: =over 4 =item B fill pixels using outermost pixels =item B fill pixels using mirroring (half sample symmetric) =item B fill pixels with constant value =item B fill pixels using reflecting (whole sample symmetric) =item B fill pixels using wrapping =item B fade pixels to constant value =item B fill pixels at top and bottom with weighted averages pixels near borders =back Default is I. =item B Set color for pixels in fixed or fade mode. Default is I. =back =head3 Commands This filter supports same B as options. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. =head2 find_rect Find a rectangular object in the input video. The object to search for must be specified as a gray8 image specified with the B option. For each possible match, a score is computed. If the score reaches the specified threshold, the object is considered found. If the input video contains multiple instances of the object, the filter will find only one of them. When an object is found, the following metadata entries are set in the matching frame: =over 4 =item B width of object =item B height of object =item B x position of object =item B y position of object =item B match score of the found object =back It accepts the following options: =over 4 =item B Filepath of the object image, needs to be in gray8. =item B Detection threshold, expressed as a decimal number in the range 0-1. A threshold value of 0.01 means only exact matches, a threshold of 0.99 means almost everything matches. Default value is 0.5. =item B Number of mipmaps, default is 3. =item B Specifies the rectangle in which to search. =item B Discard frames where object is not detected. Default is disabled. =back =head3 Examples =over 4 =item * Cover a rectangular object by the supplied image of a given video using B: ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv =item * Find the position of an object in each frame using B and write it to a log file: ffprobe -f lavfi movie=test.mp4,find_rect=object=object.pgm:threshold=0.3 \ -show_entries frame=pkt_pts_time:frame_tags=lavfi.rect.x,lavfi.rect.y \ -of csv -o find_rect.csv =back =head2 floodfill Flood area with values of same pixel components with another values. It accepts the following options: =over 4 =item B Set pixel x coordinate. =item B Set pixel y coordinate. =item B Set source #0 component value. =item B Set source #1 component value. =item B Set source #2 component value. =item B Set source #3 component value. =item B Set destination #0 component value. =item B Set destination #1 component value. =item B Set destination #2 component value. =item B Set destination #3 component value. =back =head2 format Convert 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. It accepts the following parameters: =over 4 =item B A '|'-separated list of pixel format names, such as "pix_fmts=yuv420p|monow|rgb24". =back =head3 Examples =over 4 =item * Convert the input video to the I format format=pix_fmts=yuv420p Convert the input video to any of the formats in the list format=pix_fmts=yuv420p|yuv444p|yuv410p =back =head2 fps Convert the video to specified constant frame rate by duplicating or dropping frames as necessary. It accepts the following parameters: =over 4 =item B The desired output frame rate. It accepts expressions containing the following constants: =over 4 =item B The input's frame rate =item B NTSC frame rate of C<30000/1001> =item B PAL frame rate of C<25.0> =item B Film frame rate of C<24.0> =item B NTSC-film frame rate of C<24000/1001> =back The default is C<25>. =item B 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 frame's 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. =item B Timestamp (PTS) rounding method. Possible values are: =over 4 =item B round towards 0 =item B round away from 0 =item B round towards -infinity =item B round towards +infinity =item B round to nearest =back The default is C. =item B Action performed when reading the last frame. Possible values are: =over 4 =item B Use same timestamp rounding method as used for other frames. =item B Pass through last frame if input duration has not been reached yet. =back The default is C. =back Alternatively, the options can be specified as a flat string: I[:I[:I]]. See also the B filter. =head3 Examples =over 4 =item * A typical usage in order to set the fps to 25: fps=fps=25 =item * Sets the fps to 24, using abbreviation and rounding method to round to nearest: fps=fps=film:round=near =back =head2 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 B and B filters. It accepts the following parameters: =over 4 =item B The desired packing format. Supported values are: =over 4 =item B The views are next to each other (default). =item B The views are on top of each other. =item B The views are packed by line. =item B The views are packed by column. =item B The views are temporally interleaved. =back =back 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 =head2 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. =over 4 =item B Specify the output frames per second. This option can also be specified as a value alone. The default is C<50>. =item B Specify the start of a range where the output frame will be created as a linear interpolation of two frames. The range is [C<0>-C<255>], the default is C<15>. =item B Specify the end of a range where the output frame will be created as a linear interpolation of two frames. The range is [C<0>-C<255>], the default is C<240>. =item B 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 C<8.2>. =item B Specify flags influencing the filter process. Available value for I is: =over 4 =item B Enable scene change detection using the value of the option I. This flag is enabled by default. =back =back =head2 framestep Select one frame every N-th frame. This filter accepts the following option: =over 4 =item B Select frame after every C frames. Allowed values are positive integers higher than 0. Default value is C<1>. =back =head2 freezedetect Detect frozen video. This filter logs a message and sets frame metadata when it detects that the input video has no significant change in content during a specified duration. Video freeze detection calculates the mean average absolute difference of all the components of video frames and compares it to a noise floor. The printed times and duration are expressed in seconds. The C metadata key is set on the first frame whose timestamp equals or exceeds the detection duration and it contains the timestamp of the first frame of the freeze. The C and C metadata keys are set on the first frame after the freeze. The filter accepts the following options: =over 4 =item B Set noise tolerance. Can be specified in dB (in case "dB" is appended to the specified value) or as a difference ratio between 0 and 1. Default is -60dB, or 0.001. =item B Set freeze duration until notification (default is 2 seconds). =back =head2 freezeframes Freeze video frames. This filter freezes video frames using frame from 2nd input. The filter accepts the following options: =over 4 =item B Set number of first frame from which to start freeze. =item B Set number of last frame from which to end freeze. =item B Set number of frame from 2nd input which will be used instead of replaced frames. =back =head2 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 C<--enable-frei0r>. It accepts the following parameters: =over 4 =item B The name of the frei0r effect to load. If the environment variable B is defined, the frei0r effect is searched for in each of the directories specified by the colon-separated list in B. Otherwise, the standard frei0r paths are searched, in this order: F, F, F. =item B A '|'-separated list of parameters to pass to the frei0r effect. =back A frei0r effect parameter can be a boolean (its value is either "y" or "n"), a double, a color (specified as I/I/I, where I, I, and I are floating point numbers between 0.0 and 1.0, inclusive) or a color description as specified in the B<"Color" section in the ffmpeg-utils manual>, a position (specified as I/I, where I and I 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. =head3 Examples =over 4 =item * Apply the distort0r effect, setting the first two double parameters: frei0r=filter_name=distort0r:filter_params=0.5|0.01 =item * Apply the colordistance effect, taking a color as the first parameter: frei0r=colordistance:0.2/0.3/0.4 frei0r=colordistance:violet frei0r=colordistance:0x112233 =item * Apply the perspective effect, specifying the top left and top right image positions: frei0r=perspective:0.2/0.2|0.8/0.2 =back For more information, see EBE =head3 Commands This filter supports the B option as B. =head2 fspp Apply fast and simple postprocessing. It is a faster version of B. 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: =over 4 =item B Set quality. This option defines the number of levels for averaging. It accepts an integer in the range 4-5. Default value is C<4>. =item B 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). =item B 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 C<0> − PSNR optimal. =item B Enable the use of the QP from the B-Frames if set to C<1>. Using this option may cause flicker since the B-Frames have often larger QP. Default is C<0> (not enabled). =back =head2 gblur Apply Gaussian blur filter. The filter accepts the following options: =over 4 =item B Set horizontal sigma, standard deviation of Gaussian blur. Default is C<0.5>. =item B Set number of steps for Gaussian approximation. Default is C<1>. =item B Set which planes to filter. By default all planes are filtered. =item B Set vertical sigma, if negative it will be same as C. Default is C<-1>. =back =head3 Commands This filter supports same commands as options. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. =head2 geq Apply generic equation to each pixel. The filter accepts the following options: =over 4 =item B Set the luma expression. =item B Set the chrominance blue expression. =item B Set the chrominance red expression. =item B Set the alpha expression. =item B Set the red expression. =item B Set the green expression. =item B Set the blue expression. =back The colorspace is selected according to the specified options. If one of the B, B, or B options is specified, the filter will automatically select a YCbCr colorspace. If one of the B, B, or B 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 luma expression. The expressions can use the following variables and functions: =over 4 =item B The sequential number of the filtered frame, starting from C<0>. =item B =item B The coordinates of the current sample. =item B =item B The width and height of the image. =item B =item B 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 C<1,1> for the luma plane, and C<0.5,0.5> for chroma planes. =item B Time of the current frame, expressed in seconds. =item B Return the value of the pixel at location (I,I) of the current plane. =item B Return the value of the pixel at location (I,I) of the luma plane. =item B Return the value of the pixel at location (I,I) of the blue-difference chroma plane. Return 0 if there is no such plane. =item B Return the value of the pixel at location (I,I) of the red-difference chroma plane. Return 0 if there is no such plane. =item B =item B =item B Return the value of the pixel at location (I,I) of the red/green/blue component. Return 0 if there is no such component. =item B Return the value of the pixel at location (I,I) of the alpha plane. Return 0 if there is no such plane. =item B Sum of sample values in the rectangle from (0,0) to (x,y), this allows obtaining sums of samples within a rectangle. See the functions without the sum postfix. =item B Set one of interpolation methods: =over 4 =item B =item B =back Default is bilinear. =back For functions, if I and I are outside the area, the value will be automatically clipped to the closer edge. Please note that this filter can use multiple threads in which case each slice will have its own expression state. If you want to use only a single expression state because your expressions depend on previous state then you should limit the number of filter threads to 1. =head3 Examples =over 4 =item * Flip the image horizontally: geq=p(W-X\,Y) =item * Generate a bidimensional sine wave, with angle C and a wavelength of 100 pixels: geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128 =item * Generate a fancy enigmatic moving light: nullsrc=s=256x256,geq=random(1)/hypot(X-cos(N*0.07)*W/2-W/2\,Y-sin(N*0.09)*H/2-H/2)^2*1000000*sin(N*0.02):128:128 =item * Generate a quick emboss effect: format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2' =item * Modify RGB components depending on pixel position: geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)' =item * Create a radial gradient that is the same size as the input (also see the B filter): geq=lum=255*gauss((X/W-0.5)*3)*gauss((Y/H-0.5)*3)/gauss(0)/gauss(0),format=gray =back =head2 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: =over 4 =item B 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. =item B 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. =back Alternatively, the options can be specified as a flat string: I[:I] =head3 Examples =over 4 =item * Apply the filter with a C<3.5> strength and radius of C<8>: gradfun=3.5:8 =item * Specify radius, omitting the strength (which will fall-back to the default value): gradfun=radius=8 =back =head2 graphmonitor Show various filtergraph stats. With this filter one can debug complete filtergraph. Especially issues with links filling with queued frames. The filter accepts the following options: =over 4 =item B Set video output size. Default is I. =item B Set video opacity. Default is I<0.9>. Allowed range is from I<0> to I<1>. =item B Set output mode flags. Available values for flags are: =over 4 =item B No any filtering. Default. =item B Show only filters with queued frames. =item B Show only filters with non-zero stats. =item B Show only filters with non-eof stat. =item B Show only filters that are enabled in timeline. =back =item B Set flags which enable which stats are shown in video. Available values for flags are: =over 4 =item B All flags turned off. =item B All flags turned on. =item B Display number of queued frames in each link. =item B Display number of frames taken from filter. =item B Display number of frames given out from filter. =item B Display delta number of frames between above two values. =item B Display current filtered frame pts. =item B Display pts delta between current and previous frame. =item B