.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "FFMPEG-FILTERS 1" .TH FFMPEG-FILTERS 1 " " " " " " .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME ffmpeg\-filters \- FFmpeg filters .SH DESCRIPTION .IX Header "DESCRIPTION" This document describes filters, sources, and sinks provided by the libavfilter library. .SH "FILTERING INTRODUCTION" .IX Header "FILTERING INTRODUCTION" Filtering in FFmpeg is enabled through the libavfilter library. .PP 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. .PP .Vb 5 \& [main] \& input \-\-> split \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-> overlay \-\-> output \& | ^ \& |[tmp] [flip]| \& +\-\-\-\-\-> crop \-\-> vflip \-\-\-\-\-\-\-+ .Ve .PP 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: .PP .Vb 1 \& ffmpeg \-i INPUT \-vf "split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2" OUTPUT .Ve .PP The result will be that the top half of the video is mirrored onto the bottom half of the output video. .PP Filters in the same linear chain are separated by commas, and distinct linear chains of filters are separated by semicolons. In our example, \&\fIcrop,vflip\fR are in one linear chain, \fIsplit\fR and \&\fIoverlay\fR 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 \fI[main]\fR and \fI[tmp]\fR. .PP The stream sent to the second output of \fIsplit\fR, labelled as \&\fI[tmp]\fR, is processed through the \fIcrop\fR filter, which crops away the lower half part of the video, and then vertically flipped. The \&\fIoverlay\fR filter takes in input the first unchanged output of the split filter (which was labelled as \fI[main]\fR), and overlay on its lower half the output generated by the \fIcrop,vflip\fR filterchain. .PP 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. .PP There exist so-called \fIsource filters\fR that do not have an audio/video input, and \fIsink filters\fR that will not have audio/video output. .SH GRAPH .IX Header "GRAPH" The \fIgraph2dot\fR program included in the FFmpeg \fItools\fR directory can be used to parse a filtergraph description and issue a corresponding textual representation in the dot language. .PP Invoke the command: .PP .Vb 1 \& graph2dot \-h .Ve .PP to see how to use \fIgraph2dot\fR. .PP You can then pass the dot description to the \fIdot\fR program (from the graphviz suite of programs) and obtain a graphical representation of the filtergraph. .PP For example the sequence of commands: .PP .Vb 4 \& echo | \e \& tools/graph2dot \-o graph.tmp && \e \& dot \-Tpng graph.tmp \-o graph.png && \e \& display graph.png .Ve .PP can be used to create and display an image representing the graph described by the \fIGRAPH_DESCRIPTION\fR 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: .PP .Vb 1 \& ffmpeg \-i infile \-vf scale=640:360 outfile .Ve .PP your \fIGRAPH_DESCRIPTION\fR string will need to be of the form: .PP .Vb 1 \& nullsrc,scale=640:360,nullsink .Ve .PP you may also need to set the \fInullsrc\fR parameters and add a \fIformat\fR filter in order to simulate a specific input file. .SH "FILTERGRAPH DESCRIPTION" .IX Header "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. .PP 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. .PP A filter with no input pads is called a "source", and a filter with no output pads is called a "sink". .SS "Filtergraph syntax" .IX Subsection "Filtergraph syntax" A filtergraph has a textual representation, which is recognized by the \&\fB\-filter\fR/\fB\-vf\fR/\fB\-af\fR and \&\fB\-filter_complex\fR options in \fBffmpeg\fR and \&\fB\-vf\fR/\fB\-af\fR in \fBffplay\fR, and by the \&\f(CWavfilter_graph_parse_ptr()\fR function defined in \&\fIlibavfilter/avfilter.h\fR. .PP 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. .PP A filtergraph consists of a sequence of filterchains. A sequence of filterchains is represented by a list of ";"\-separated filterchain descriptions. .PP A filter is represented by a string of the form: [\fIin_link_1\fR]...[\fIin_link_N\fR]\fIfilter_name\fR@\fIid\fR=\fIarguments\fR[\fIout_link_1\fR]...[\fIout_link_M\fR] .PP \&\fIfilter_name\fR 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 "@\fIid\fR". The name of the filter class is optionally followed by a string "=\fIarguments\fR". .PP \&\fIarguments\fR is a string which contains the parameters used to initialize the filter instance. It may have one of two forms: .IP \(bu 4 A ':'\-separated list of \fIkey=value\fR pairs. .IP \(bu 4 A ':'\-separated list of \fIvalue\fR. In this case, the keys are assumed to be the option names in the order they are declared. E.g. the \f(CW\*(C`fade\*(C'\fR filter declares three options in this order \-\- \fBtype\fR, \fBstart_frame\fR and \&\fBnb_frames\fR. Then the parameter list \fIin:0:30\fR means that the value \&\fIin\fR is assigned to the option \fBtype\fR, \fI0\fR to \&\fBstart_frame\fR and \fI30\fR to \fBnb_frames\fR. .IP \(bu 4 A ':'\-separated list of mixed direct \fIvalue\fR and long \fIkey=value\fR pairs. The direct \fIvalue\fR must precede the \fIkey=value\fR pairs, and follow the same constraints order of the previous point. The following \&\fIkey=value\fR pairs can be set in any preferred order. .PP If the option value itself is a list of items (e.g. the \f(CW\*(C`format\*(C'\fR filter takes a list of pixel formats), the items in the list are usually separated by \&\fB|\fR. .PP The list of arguments can be quoted using the character \fB'\fR as initial and ending mark, and the character \fB\e\fR for escaping the characters within the quoted text; otherwise the argument string is considered terminated when the next special character (belonging to the set \&\fB[]=;,\fR) is encountered. .PP A special syntax implemented in the \fBffmpeg\fR 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. .PP .Vb 1 \& ffmpeg \-i \-vf drawtext=/text=/tmp/some_text .Ve .PP will load the text to be drawn from \fI/tmp/some_text\fR. API users wishing to implement a similar feature should use the \f(CW\*(C`avfilter_graph_segment_*()\*(C'\fR functions together with custom IO code. .PP 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 \fIin_link_1\fR \&... \fIin_link_N\fR, are associated to the filter input pads, the following labels \fIout_link_1\fR ... \fIout_link_M\fR, are associated to the output pads. .PP When two link labels with the same name are found in the filtergraph, a link between the corresponding input and output pad is created. .PP 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 .PP .Vb 1 \& nullsrc, split[L1], [L2]overlay, nullsink .Ve .PP 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. .PP 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. .PP 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. .PP 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. .PP For example, the filtergraph: .PP .Vb 1 \& testsrc,split[L1],hflip[L2];[L1][L2] hstack .Ve .PP can be represented as: .PP .Vb 2 \& testsrc, \& split [L1], hflip [L2]; \& \& [L1][L2] hstack .Ve .PP Libavfilter will automatically insert \fBscale\fR filters where format conversion is required. It is possible to specify swscale flags for those automatically inserted scalers by prepending \&\f(CW\*(C`sws_flags=\fR\f(CIflags\fR\f(CW;\*(C'\fR to the filtergraph description. .PP Here is a BNF description of the filtergraph syntax: .PP .Vb 8 \& ::= sequence of alphanumeric characters and \*(Aq_\*(Aq \& ::= ["@"] \& ::= "[" "]" \& ::= [] \& ::= sequence of chars (possibly quoted) \& ::= [] ["=" ] [] \& ::= [,] \& ::= [sws_flags=;] [;] .Ve .SS "Notes on filtergraph escaping" .IX Subsection "Notes on filtergraph escaping" Filtergraph description composition entails several levels of escaping. See \fBthe "Quoting and escaping" section in the ffmpeg\-utils\|(1) manual\fR for more information about the employed escaping procedure. .PP A first level escaping affects the content of each filter option value, which may contain the special character \f(CW\*(C`:\*(C'\fR used to separate values, or one of the escaping characters \f(CW\*(C`\e\*(Aq\*(C'\fR. .PP A second level escaping affects the whole filter description, which may contain the escaping characters \f(CW\*(C`\e\*(Aq\*(C'\fR or the special characters \f(CW\*(C`[],;\*(C'\fR used by the filtergraph description. .PP 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. .PP For example, consider the following string to be embedded in the \fBdrawtext\fR filter description \fBtext\fR value: .PP .Vb 1 \& this is a \*(Aqstring\*(Aq: may contain one, or more, special characters .Ve .PP This string contains the \f(CW\*(C`\*(Aq\*(C'\fR special escaping character, and the \&\f(CW\*(C`:\*(C'\fR special character, so it needs to be escaped in this way: .PP .Vb 1 \& text=this is a \e\*(Aqstring\e\*(Aq\e: may contain one, or more, special characters .Ve .PP 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: .PP .Vb 1 \& drawtext=text=this is a \e\e\e\*(Aqstring\e\e\e\*(Aq\e\e: may contain one\e, or more\e, special characters .Ve .PP (note that in addition to the \f(CW\*(C`\e\*(Aq\*(C'\fR escaping special characters, also \f(CW\*(C`,\*(C'\fR needs to be escaped). .PP 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 \&\f(CW\*(C`\e\*(C'\fR is special and needs to be escaped with another \f(CW\*(C`\e\*(C'\fR, the previous string will finally result in: .PP .Vb 1 \& \-vf "drawtext=text=this is a \e\e\e\e\e\e\*(Aqstring\e\e\e\e\e\e\*(Aq\e\e\e\e: may contain one\e\e, or more\e\e, special characters" .Ve .PP 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. .PP For example, in case of the \fBdrawtext filter\fR, you might prefer to use the \fBtextfile\fR option in place of \fBtext\fR to specify the text to render. .SH "TIMELINE EDITING" .IX Header "TIMELINE EDITING" Some filters support a generic \fBenable\fR 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. .PP The expression accepts the following values: .IP \fBt\fR 4 .IX Item "t" timestamp expressed in seconds, NAN if the input timestamp is unknown .IP \fBn\fR 4 .IX Item "n" sequential number of the input frame, starting from 0 .IP \fBpos\fR 4 .IX Item "pos" the position in the file of the input frame, NAN if unknown; deprecated, do not use .IP \fBw\fR 4 .IX Item "w" .PD 0 .IP \fBh\fR 4 .IX Item "h" .PD width and height of the input frame if video .PP Additionally, these filters support an \fBenable\fR command that can be used to re-define the expression. .PP Like any other filtering option, the \fBenable\fR option follows the same rules. .PP For example, to enable a blur filter (\fBsmartblur\fR) from 10 seconds to 3 minutes, and a \fBcurves\fR filter starting at 3 seconds: .PP .Vb 2 \& smartblur = enable=\*(Aqbetween(t,10,3*60)\*(Aq, \& curves = enable=\*(Aqgte(t,3)\*(Aq : preset=cross_process .Ve .PP See \f(CW\*(C`ffmpeg \-filters\*(C'\fR to view which filters have timeline support. .SH "CHANGING OPTIONS AT RUNTIME WITH A COMMAND" .IX Header "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 \&\fBffmpeg\fR \fB\-h filter=\fR. The name of the command is the name of the option and the argument is the new value. .SH "OPTIONS FOR FILTERS WITH SEVERAL INPUTS" .IX Header "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. .IP \fBeof_action\fR 4 .IX Item "eof_action" The action to take when EOF is encountered on the secondary input; it accepts one of the following values: .RS 4 .IP \fBrepeat\fR 4 .IX Item "repeat" Repeat the last frame (the default). .IP \fBendall\fR 4 .IX Item "endall" End both streams. .IP \fBpass\fR 4 .IX Item "pass" Pass the main input through. .RE .RS 4 .RE .IP \fBshortest\fR 4 .IX Item "shortest" If set to 1, force the output to terminate when the shortest input terminates. Default value is 0. .IP \fBrepeatlast\fR 4 .IX Item "repeatlast" If set to 1, force the filter to extend the last frame of secondary streams until the end of the primary stream. A value of 0 disables this behavior. Default value is 1. .IP \fBts_sync_mode\fR 4 .IX Item "ts_sync_mode" How strictly to sync streams based on secondary input timestamps; it accepts one of the following values: .RS 4 .IP \fBdefault\fR 4 .IX Item "default" Frame from secondary input with the nearest lower or equal timestamp to the primary input frame. .IP \fBnearest\fR 4 .IX Item "nearest" Frame from secondary input with the absolute nearest timestamp to the primary input frame. .RE .RS 4 .RE .SH "AUDIO FILTERS" .IX Header "AUDIO FILTERS" When you configure your FFmpeg build, you can disable any of the existing filters using \f(CW\*(C`\-\-disable\-filters\*(C'\fR. The configure output will show the audio filters included in your build. .PP Below is a description of the currently available audio filters. .SS aap .IX Subsection "aap" Apply Affine Projection algorithm to the first audio stream using the second audio stream. .PP This adaptive filter is used to estimate unknown audio based on multiple input audio samples. Affine projection algorithm can make trade-offs between computation complexity with convergence speed. .PP A description of the accepted options follows. .IP \fBorder\fR 4 .IX Item "order" Set the filter order. .IP \fBprojection\fR 4 .IX Item "projection" Set the projection order. .IP \fBmu\fR 4 .IX Item "mu" Set the filter mu. .IP \fBdelta\fR 4 .IX Item "delta" Set the coefficient to initialize internal covariance matrix. .IP \fBout_mode\fR 4 .IX Item "out_mode" Set the filter output samples. It accepts the following values: .RS 4 .IP \fBi\fR 4 .IX Item "i" Pass the 1st input. .IP \fBd\fR 4 .IX Item "d" Pass the 2nd input. .IP \fBo\fR 4 .IX Item "o" Pass difference between desired, 2nd input and error signal estimate. .IP \fBn\fR 4 .IX Item "n" Pass difference between input, 1st input and error signal estimate. .IP \fBe\fR 4 .IX Item "e" Pass error signal estimated samples. .Sp Default value is \fIo\fR. .RE .RS 4 .RE .IP \fBprecision\fR 4 .IX Item "precision" Set which precision to use when processing samples. .RS 4 .IP \fBauto\fR 4 .IX Item "auto" Auto pick internal sample format depending on other filters. .IP \fBfloat\fR 4 .IX Item "float" Always use single-floating point precision sample format. .IP \fBdouble\fR 4 .IX Item "double" Always use double-floating point precision sample format. .RE .RS 4 .RE .SS acompressor .IX Subsection "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. .PP Compression is done by detecting the volume above a chosen level \&\f(CW\*(C`threshold\*(C'\fR and dividing it by the factor set with \f(CW\*(C`ratio\*(C'\fR. 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". \&\f(CW\*(C`attack\*(C'\fR determines how long the signal has to rise above the threshold before any reduction will occur and \f(CW\*(C`release\*(C'\fR 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 \&\f(CW\*(C`makeup\*(C'\fR 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 \f(CW\*(C`knee\*(C'\fR flattens the hard edge at the threshold in the range of the chosen decibels. .PP The filter accepts the following options: .IP \fBlevel_in\fR 4 .IX Item "level_in" Set input gain. Default is 1. Range is between 0.015625 and 64. .IP \fBmode\fR 4 .IX Item "mode" Set mode of compressor operation. Can be \f(CW\*(C`upward\*(C'\fR or \f(CW\*(C`downward\*(C'\fR. Default is \f(CW\*(C`downward\*(C'\fR. .IP \fBthreshold\fR 4 .IX Item "threshold" If a signal of stream rises above this level it will affect the gain reduction. By default it is 0.125. Range is between 0.00097563 and 1. .IP \fBratio\fR 4 .IX Item "ratio" Set a ratio by which the signal is reduced. 1:2 means that if the level rose 4dB above the threshold, it will be only 2dB above after the reduction. Default is 2. Range is between 1 and 20. .IP \fBattack\fR 4 .IX Item "attack" Amount of milliseconds the signal has to rise above the threshold before gain reduction starts. Default is 20. Range is between 0.01 and 2000. .IP \fBrelease\fR 4 .IX Item "release" Amount of milliseconds the signal has to fall below the threshold before reduction is decreased again. Default is 250. Range is between 0.01 and 9000. .IP \fBmakeup\fR 4 .IX Item "makeup" Set the amount by how much signal will be amplified after processing. Default is 1. Range is from 1 to 64. .IP \fBknee\fR 4 .IX Item "knee" Curve the sharp knee around the threshold to enter gain reduction more softly. Default is 2.82843. Range is between 1 and 8. .IP \fBlink\fR 4 .IX Item "link" Choose if the \f(CW\*(C`average\*(C'\fR level between all channels of input stream or the louder(\f(CW\*(C`maximum\*(C'\fR) channel of input stream affects the reduction. Default is \f(CW\*(C`average\*(C'\fR. .IP \fBdetection\fR 4 .IX Item "detection" Should the exact signal be taken in case of \f(CW\*(C`peak\*(C'\fR or an RMS one in case of \f(CW\*(C`rms\*(C'\fR. Default is \f(CW\*(C`rms\*(C'\fR which is mostly smoother. .IP \fBmix\fR 4 .IX Item "mix" How much to use compressed signal in output. Default is 1. Range is between 0 and 1. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS acontrast .IX Subsection "acontrast" Simple audio dynamic range compression/expansion filter. .PP The filter accepts the following options: .IP \fBcontrast\fR 4 .IX Item "contrast" Set contrast. Default is 33. Allowed range is between 0 and 100. .SS acopy .IX Subsection "acopy" Copy the input audio source unchanged to the output. This is mainly useful for testing purposes. .SS acrossfade .IX Subsection "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. .PP The filter accepts the following options: .IP "\fBnb_samples, ns\fR" 4 .IX Item "nb_samples, ns" Specify the number of samples for which the cross fade effect has to last. At the end of the cross fade effect the first input audio will be completely silent. Default is 44100. .IP "\fBduration, d\fR" 4 .IX Item "duration, d" Specify the duration of the cross fade effect. See \&\fBthe Time duration section in the ffmpeg\-utils\|(1) manual\fR for the accepted syntax. By default the duration is determined by \fInb_samples\fR. If set this option is used instead of \fInb_samples\fR. .IP "\fBoverlap, o\fR" 4 .IX Item "overlap, o" Should first stream end overlap with second stream start. Default is enabled. .IP \fBcurve1\fR 4 .IX Item "curve1" Set curve for cross fade transition for first stream. .IP \fBcurve2\fR 4 .IX Item "curve2" Set curve for cross fade transition for second stream. .Sp For description of available curve types see \fBafade\fR filter description. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Cross fade from one input to another: .Sp .Vb 1 \& ffmpeg \-i first.flac \-i second.flac \-filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac .Ve .IP \(bu 4 Cross fade from one input to another but without overlapping: .Sp .Vb 1 \& ffmpeg \-i first.flac \-i second.flac \-filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac .Ve .SS acrossover .IX Subsection "acrossover" Split audio stream into several bands. .PP This filter splits audio stream into two or more frequency ranges. Summing all streams back will give flat output. .PP The filter accepts the following options: .IP \fBsplit\fR 4 .IX Item "split" Set split frequencies. Those must be positive and increasing. .IP \fBorder\fR 4 .IX Item "order" Set filter order for each band split. This controls filter roll-off or steepness of filter transfer function. Available values are: .RS 4 .IP \fB2nd\fR 4 .IX Item "2nd" 12 dB per octave. .IP \fB4th\fR 4 .IX Item "4th" 24 dB per octave. .IP \fB6th\fR 4 .IX Item "6th" 36 dB per octave. .IP \fB8th\fR 4 .IX Item "8th" 48 dB per octave. .IP \fB10th\fR 4 .IX Item "10th" 60 dB per octave. .IP \fB12th\fR 4 .IX Item "12th" 72 dB per octave. .IP \fB14th\fR 4 .IX Item "14th" 84 dB per octave. .IP \fB16th\fR 4 .IX Item "16th" 96 dB per octave. .IP \fB18th\fR 4 .IX Item "18th" 108 dB per octave. .IP \fB20th\fR 4 .IX Item "20th" 120 dB per octave. .RE .RS 4 .Sp Default is \fI4th\fR. .RE .IP \fBlevel\fR 4 .IX Item "level" Set input gain level. Allowed range is from 0 to 1. Default value is 1. .IP \fBgains\fR 4 .IX Item "gains" Set output gain for each band. Default value is 1 for all bands. .IP \fBprecision\fR 4 .IX Item "precision" Set which precision to use when processing samples. .RS 4 .IP \fBauto\fR 4 .IX Item "auto" Auto pick internal sample format depending on other filters. .IP \fBfloat\fR 4 .IX Item "float" Always use single-floating point precision sample format. .IP \fBdouble\fR 4 .IX Item "double" Always use double-floating point precision sample format. .RE .RS 4 .Sp Default value is \f(CW\*(C`auto\*(C'\fR. .RE .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Split input audio stream into two bands (low and high) with split frequency of 1500 Hz, each band will be in separate stream: .Sp .Vb 1 \& ffmpeg \-i in.flac \-filter_complex \*(Aqacrossover=split=1500[LOW][HIGH]\*(Aq \-map \*(Aq[LOW]\*(Aq low.wav \-map \*(Aq[HIGH]\*(Aq high.wav .Ve .IP \(bu 4 Same as above, but with higher filter order: .Sp .Vb 1 \& ffmpeg \-i in.flac \-filter_complex \*(Aqacrossover=split=1500:order=8th[LOW][HIGH]\*(Aq \-map \*(Aq[LOW]\*(Aq low.wav \-map \*(Aq[HIGH]\*(Aq high.wav .Ve .IP \(bu 4 Same as above, but also with additional middle band (frequencies between 1500 and 8000): .Sp .Vb 1 \& ffmpeg \-i in.flac \-filter_complex \*(Aqacrossover=split=1500 8000:order=8th[LOW][MID][HIGH]\*(Aq \-map \*(Aq[LOW]\*(Aq low.wav \-map \*(Aq[MID]\*(Aq mid.wav \-map \*(Aq[HIGH]\*(Aq high.wav .Ve .SS acrusher .IX Subsection "acrusher" Reduce audio bit resolution. .PP 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. .PP 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. .PP The filter accepts the following options: .IP \fBlevel_in\fR 4 .IX Item "level_in" Set level in. .IP \fBlevel_out\fR 4 .IX Item "level_out" Set level out. .IP \fBbits\fR 4 .IX Item "bits" Set bit reduction. .IP \fBmix\fR 4 .IX Item "mix" Set mixing amount. .IP \fBmode\fR 4 .IX Item "mode" Can be linear: \f(CW\*(C`lin\*(C'\fR or logarithmic: \f(CW\*(C`log\*(C'\fR. .IP \fBdc\fR 4 .IX Item "dc" Set DC. .IP \fBaa\fR 4 .IX Item "aa" Set anti-aliasing. .IP \fBsamples\fR 4 .IX Item "samples" Set sample reduction. .IP \fBlfo\fR 4 .IX Item "lfo" Enable LFO. By default disabled. .IP \fBlforange\fR 4 .IX Item "lforange" Set LFO range. .IP \fBlforate\fR 4 .IX Item "lforate" Set LFO rate. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS acue .IX Subsection "acue" Delay audio filtering until a given wallclock timestamp. See the \fBcue\fR filter. .SS adeclick .IX Subsection "adeclick" Remove impulsive noise from input audio. .PP Samples detected as impulsive noise are replaced by interpolated samples using autoregressive modelling. .IP "\fBwindow, w\fR" 4 .IX Item "window, w" Set window size, in milliseconds. Allowed range is from \f(CW10\fR to \&\f(CW100\fR. Default value is \f(CW55\fR milliseconds. This sets size of window which will be processed at once. .IP "\fBoverlap, o\fR" 4 .IX Item "overlap, o" Set window overlap, in percentage of window size. Allowed range is from \&\f(CW50\fR to \f(CW95\fR. Default value is \f(CW75\fR percent. Setting this to a very high value increases impulsive noise removal but makes whole process much slower. .IP "\fBarorder, a\fR" 4 .IX Item "arorder, a" Set autoregression order, in percentage of window size. Allowed range is from \&\f(CW0\fR to \f(CW25\fR. Default value is \f(CW2\fR percent. This option also controls quality of interpolated samples using neighbour good samples. .IP "\fBthreshold, t\fR" 4 .IX Item "threshold, t" Set threshold value. Allowed range is from \f(CW1\fR to \f(CW100\fR. Default value is \f(CW2\fR. 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. .IP "\fBburst, b\fR" 4 .IX Item "burst, b" Set burst fusion, in percentage of window size. Allowed range is \f(CW0\fR to \&\f(CW10\fR. Default value is \f(CW2\fR. 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. .IP "\fBmethod, m\fR" 4 .IX Item "method, m" Set overlap method. .Sp It accepts the following values: .RS 4 .IP "\fBadd, a\fR" 4 .IX Item "add, a" Select overlap-add method. Even not interpolated samples are slightly changed with this method. .IP "\fBsave, s\fR" 4 .IX Item "save, s" Select overlap-save method. Not interpolated samples remain unchanged. .RE .RS 4 .Sp Default value is \f(CW\*(C`a\*(C'\fR. .RE .SS adeclip .IX Subsection "adeclip" Remove clipped samples from input audio. .PP Samples detected as clipped are replaced by interpolated samples using autoregressive modelling. .IP "\fBwindow, w\fR" 4 .IX Item "window, w" Set window size, in milliseconds. Allowed range is from \f(CW10\fR to \f(CW100\fR. Default value is \f(CW55\fR milliseconds. This sets size of window which will be processed at once. .IP "\fBoverlap, o\fR" 4 .IX Item "overlap, o" Set window overlap, in percentage of window size. Allowed range is from \f(CW50\fR to \f(CW95\fR. Default value is \f(CW75\fR percent. .IP "\fBarorder, a\fR" 4 .IX Item "arorder, a" Set autoregression order, in percentage of window size. Allowed range is from \&\f(CW0\fR to \f(CW25\fR. Default value is \f(CW8\fR percent. This option also controls quality of interpolated samples using neighbour good samples. .IP "\fBthreshold, t\fR" 4 .IX Item "threshold, t" Set threshold value. Allowed range is from \f(CW1\fR to \f(CW100\fR. Default value is \f(CW10\fR. Higher values make clip detection less aggressive. .IP "\fBhsize, n\fR" 4 .IX Item "hsize, n" Set size of histogram used to detect clips. Allowed range is from \f(CW100\fR to \f(CW9999\fR. Default value is \f(CW1000\fR. Higher values make clip detection less aggressive. .IP "\fBmethod, m\fR" 4 .IX Item "method, m" Set overlap method. .Sp It accepts the following values: .RS 4 .IP "\fBadd, a\fR" 4 .IX Item "add, a" Select overlap-add method. Even not interpolated samples are slightly changed with this method. .IP "\fBsave, s\fR" 4 .IX Item "save, s" Select overlap-save method. Not interpolated samples remain unchanged. .RE .RS 4 .Sp Default value is \f(CW\*(C`a\*(C'\fR. .RE .SS adecorrelate .IX Subsection "adecorrelate" Apply decorrelation to input audio stream. .PP The filter accepts the following options: .IP \fBstages\fR 4 .IX Item "stages" Set decorrelation stages of filtering. Allowed range is from 1 to 16. Default value is 6. .IP \fBseed\fR 4 .IX Item "seed" Set random seed used for setting delay in samples across channels. .SS adelay .IX Subsection "adelay" Delay one or more audio channels. .PP Samples in delayed channel are filled with silence. .PP The filter accepts the following option: .IP \fBdelays\fR 4 .IX Item "delays" Set list of delays in milliseconds for each channel separated by '|'. Unused delays will be silently ignored. If number of given delays is smaller than number of channels all remaining channels will not be delayed. If you want to delay exact number of samples, append 'S' to number. If you want instead to delay in seconds, append 's' to number. .IP \fBall\fR 4 .IX Item "all" Use last set delay for all remaining channels. By default is disabled. This option if enabled changes how option \f(CW\*(C`delays\*(C'\fR is interpreted. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 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. .Sp .Vb 1 \& adelay=1500|0|500 .Ve .IP \(bu 4 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. .Sp .Vb 1 \& adelay=0|500S|700S .Ve .IP \(bu 4 Delay all channels by same number of samples: .Sp .Vb 1 \& adelay=delays=64S:all=1 .Ve .SS adenorm .IX Subsection "adenorm" Remedy denormals in audio by adding extremely low-level noise. .PP This filter shall be placed before any filter that can produce denormals. .PP A description of the accepted parameters follows. .IP \fBlevel\fR 4 .IX Item "level" Set level of added noise in dB. Default is \f(CW\-351\fR. Allowed range is from \-451 to \-90. .IP \fBtype\fR 4 .IX Item "type" Set type of added noise. .RS 4 .IP \fBdc\fR 4 .IX Item "dc" Add DC signal. .IP \fBac\fR 4 .IX Item "ac" Add AC signal. .IP \fBsquare\fR 4 .IX Item "square" Add square signal. .IP \fBpulse\fR 4 .IX Item "pulse" Add pulse signal. .RE .RS 4 .Sp Default is \f(CW\*(C`dc\*(C'\fR. .RE .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS "aderivative, aintegral" .IX Subsection "aderivative, aintegral" Compute derivative/integral of audio stream. .PP Applying both filters one after another produces original audio. .SS adrc .IX Subsection "adrc" Apply spectral dynamic range controller filter to input audio stream. .PP A description of the accepted options follows. .IP \fBtransfer\fR 4 .IX Item "transfer" Set the transfer expression. .Sp The expression can contain the following constants: .RS 4 .IP \fBch\fR 4 .IX Item "ch" current channel number .IP \fBsn\fR 4 .IX Item "sn" current sample number .IP \fBnb_channels\fR 4 .IX Item "nb_channels" number of channels .IP \fBt\fR 4 .IX Item "t" timestamp expressed in seconds .IP \fBsr\fR 4 .IX Item "sr" sample rate .IP \fBp\fR 4 .IX Item "p" current frequency power value, in dB .IP \fBf\fR 4 .IX Item "f" current frequency in Hz .RE .RS 4 .Sp Default value is \f(CW\*(C`p\*(C'\fR. .RE .IP \fBattack\fR 4 .IX Item "attack" Set the attack in milliseconds. Default is \f(CW50\fR milliseconds. Allowed range is from 1 to 1000 milliseconds. .IP \fBrelease\fR 4 .IX Item "release" Set the release in milliseconds. Default is \f(CW100\fR milliseconds. Allowed range is from 5 to 2000 milliseconds. .IP \fBchannels\fR 4 .IX Item "channels" Set which channels to filter, by default \f(CW\*(C`all\*(C'\fR channels in audio stream are filtered. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Apply spectral compression to all frequencies with threshold of \-50 dB and 1:6 ratio: .Sp .Vb 1 \& adrc=transfer=\*(Aqif(gt(p,\-50),\-50+(p\-(\-50))/6,p)\*(Aq:attack=50:release=100 .Ve .IP \(bu 4 Similar to above but with 1:2 ratio and filtering only front center channel: .Sp .Vb 1 \& adrc=transfer=\*(Aqif(gt(p,\-50),\-50+(p\-(\-50))/2,p)\*(Aq:attack=50:release=100:channels=FC .Ve .IP \(bu 4 Apply spectral noise gate to all frequencies with threshold of \-85 dB and with short attack time and short release time: .Sp .Vb 1 \& adrc=transfer=\*(Aqif(lte(p,\-85),p\-800,p)\*(Aq:attack=1:release=5 .Ve .IP \(bu 4 Apply spectral expansion to all frequencies with threshold of \-10 dB and 1:2 ratio: .Sp .Vb 1 \& adrc=transfer=\*(Aqif(lt(p,\-10),\-10+(p\-(\-10))*2,p)\*(Aq:attack=50:release=100 .Ve .IP \(bu 4 Apply limiter to max \-60 dB to all frequencies, with attack of 2 ms and release of 10 ms: .Sp .Vb 1 \& adrc=transfer=\*(Aqmin(p,\-60)\*(Aq:attack=2:release=10 .Ve .SS adynamicequalizer .IX Subsection "adynamicequalizer" Apply dynamic equalization to input audio stream. .PP A description of the accepted options follows. .IP \fBthreshold\fR 4 .IX Item "threshold" Set the detection threshold used to trigger equalization. Threshold detection is using detection filter. Default value is 0. Allowed range is from 0 to 100. .IP \fBdfrequency\fR 4 .IX Item "dfrequency" Set the detection frequency in Hz used for detection filter used to trigger equalization. Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz. .IP \fBdqfactor\fR 4 .IX Item "dqfactor" Set the detection resonance factor for detection filter used to trigger equalization. Default value is 1. Allowed range is from 0.001 to 1000. .IP \fBtfrequency\fR 4 .IX Item "tfrequency" Set the target frequency of equalization filter. Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz. .IP \fBtqfactor\fR 4 .IX Item "tqfactor" Set the target resonance factor for target equalization filter. Default value is 1. Allowed range is from 0.001 to 1000. .IP \fBattack\fR 4 .IX Item "attack" Set the amount of milliseconds the signal from detection has to rise above the detection threshold before equalization starts. Default is 20. Allowed range is between 1 and 2000. .IP \fBrelease\fR 4 .IX Item "release" Set the amount of milliseconds the signal from detection has to fall below the detection threshold before equalization ends. Default is 200. Allowed range is between 1 and 2000. .IP \fBratio\fR 4 .IX Item "ratio" Set the ratio by which the equalization gain is raised. Default is 1. Allowed range is between 0 and 30. .IP \fBmakeup\fR 4 .IX Item "makeup" Set the makeup offset by which the equalization gain is raised. Default is 0. Allowed range is between 0 and 100. .IP \fBrange\fR 4 .IX Item "range" Set the max allowed cut/boost amount. Default is 50. Allowed range is from 1 to 200. .IP \fBmode\fR 4 .IX Item "mode" Set the mode of filter operation, can be one of the following: .RS 4 .IP \fBlisten\fR 4 .IX Item "listen" Output only isolated detection signal. .IP \fBcutbelow\fR 4 .IX Item "cutbelow" Cut frequencies below detection threshold. .IP \fBcutabove\fR 4 .IX Item "cutabove" Cut frequencies above detection threshold. .IP \fBboostbelow\fR 4 .IX Item "boostbelow" Boost frequencies below detection threshold. .IP \fBboostabove\fR 4 .IX Item "boostabove" Boost frequencies above detection threshold. .RE .RS 4 .Sp Default mode is \fBcutbelow\fR. .RE .IP \fBdftype\fR 4 .IX Item "dftype" Set the type of detection filter, can be one of the following: .RS 4 .IP \fBbandpass\fR 4 .IX Item "bandpass" .PD 0 .IP \fBlowpass\fR 4 .IX Item "lowpass" .IP \fBhighpass\fR 4 .IX Item "highpass" .IP \fBpeak\fR 4 .IX Item "peak" .RE .RS 4 .PD .Sp Default type is \fBbandpass\fR. .RE .IP \fBtftype\fR 4 .IX Item "tftype" Set the type of target filter, can be one of the following: .RS 4 .IP \fBbell\fR 4 .IX Item "bell" .PD 0 .IP \fBlowshelf\fR 4 .IX Item "lowshelf" .IP \fBhighshelf\fR 4 .IX Item "highshelf" .RE .RS 4 .PD .Sp Default type is \fBbell\fR. .RE .IP \fBauto\fR 4 .IX Item "auto" Automatically gather threshold from detection filter. By default is \fBdisabled\fR. This option is useful to detect threshold in certain time frame of input audio stream, in such case option value is changed at runtime. .Sp Available values are: .RS 4 .IP \fBdisabled\fR 4 .IX Item "disabled" Disable using automatically gathered threshold value. .IP \fBoff\fR 4 .IX Item "off" Stop picking threshold value. .IP \fBon\fR 4 .IX Item "on" Start picking threshold value. .IP \fBadaptive\fR 4 .IX Item "adaptive" Adaptively pick threshold value, by calculating sliding window entropy. .RE .RS 4 .RE .IP \fBprecision\fR 4 .IX Item "precision" Set which precision to use when processing samples. .RS 4 .IP \fBauto\fR 4 .IX Item "auto" Auto pick internal sample format depending on other filters. .IP \fBfloat\fR 4 .IX Item "float" Always use single-floating point precision sample format. .IP \fBdouble\fR 4 .IX Item "double" Always use double-floating point precision sample format. .RE .RS 4 .RE .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS adynamicsmooth .IX Subsection "adynamicsmooth" Apply dynamic smoothing to input audio stream. .PP A description of the accepted options follows. .IP \fBsensitivity\fR 4 .IX Item "sensitivity" Set an amount of sensitivity to frequency fluctations. Default is 2. Allowed range is from 0 to 1e+06. .IP \fBbasefreq\fR 4 .IX Item "basefreq" Set a base frequency for smoothing. Default value is 22050. Allowed range is from 2 to 1e+06. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS aecho .IX Subsection "aecho" Apply echoing to the input audio. .PP 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 \f(CW\*(C`delay\*(C'\fR, and the loudness of the reflected signal is the \f(CW\*(C`decay\*(C'\fR. Multiple echoes can have different delays and decays. .PP A description of the accepted parameters follows. .IP \fBin_gain\fR 4 .IX Item "in_gain" Set input gain of reflected signal. Default is \f(CW0.6\fR. .IP \fBout_gain\fR 4 .IX Item "out_gain" Set output gain of reflected signal. Default is \f(CW0.3\fR. .IP \fBdelays\fR 4 .IX Item "delays" Set list of time intervals in milliseconds between original signal and reflections separated by '|'. Allowed range for each \f(CW\*(C`delay\*(C'\fR is \f(CW\*(C`(0 \- 90000.0]\*(C'\fR. Default is \f(CW1000\fR. .IP \fBdecays\fR 4 .IX Item "decays" Set list of loudness of reflected signals separated by '|'. Allowed range for each \f(CW\*(C`decay\*(C'\fR is \f(CW\*(C`(0 \- 1.0]\*(C'\fR. Default is \f(CW0.5\fR. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Make it sound as if there are twice as many instruments as are actually playing: .Sp .Vb 1 \& aecho=0.8:0.88:60:0.4 .Ve .IP \(bu 4 If delay is very short, then it sounds like a (metallic) robot playing music: .Sp .Vb 1 \& aecho=0.8:0.88:6:0.4 .Ve .IP \(bu 4 A longer delay will sound like an open air concert in the mountains: .Sp .Vb 1 \& aecho=0.8:0.9:1000:0.3 .Ve .IP \(bu 4 Same as above but with one more mountain: .Sp .Vb 1 \& aecho=0.8:0.9:1000|1800:0.3|0.25 .Ve .SS aemphasis .IX Subsection "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. .PP The filter accepts the following options: .IP \fBlevel_in\fR 4 .IX Item "level_in" Set input gain. .IP \fBlevel_out\fR 4 .IX Item "level_out" Set output gain. .IP \fBmode\fR 4 .IX Item "mode" Set filter mode. For restoring material use \f(CW\*(C`reproduction\*(C'\fR mode, otherwise use \f(CW\*(C`production\*(C'\fR mode. Default is \f(CW\*(C`reproduction\*(C'\fR mode. .IP \fBtype\fR 4 .IX Item "type" Set filter type. Selects medium. Can be one of the following: .RS 4 .IP \fBcol\fR 4 .IX Item "col" select Columbia. .IP \fBemi\fR 4 .IX Item "emi" select EMI. .IP \fBbsi\fR 4 .IX Item "bsi" select BSI (78RPM). .IP \fBriaa\fR 4 .IX Item "riaa" select RIAA. .IP \fBcd\fR 4 .IX Item "cd" select Compact Disc (CD). .IP \fB50fm\fR 4 .IX Item "50fm" select 50µs (FM). .IP \fB75fm\fR 4 .IX Item "75fm" select 75µs (FM). .IP \fB50kf\fR 4 .IX Item "50kf" select 50µs (FM-KF). .IP \fB75kf\fR 4 .IX Item "75kf" select 75µs (FM-KF). .RE .RS 4 .RE .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS aeval .IX Subsection "aeval" Modify an audio signal according to the specified expressions. .PP This filter accepts one or more expressions (one for each channel), which are evaluated and used to modify a corresponding audio signal. .PP It accepts the following parameters: .IP \fBexprs\fR 4 .IX Item "exprs" Set the '|'\-separated expressions list for each separate channel. If the number of input channels is greater than the number of expressions, the last specified expression is used for the remaining output channels. .IP "\fBchannel_layout, c\fR" 4 .IX Item "channel_layout, c" Set output channel layout. If not specified, the channel layout is specified by the number of expressions. If set to \fBsame\fR, it will use by default the same input channel layout. .PP Each expression in \fIexprs\fR can contain the following constants and functions: .IP \fBch\fR 4 .IX Item "ch" channel number of the current expression .IP \fBn\fR 4 .IX Item "n" number of the evaluated sample, starting from 0 .IP \fBs\fR 4 .IX Item "s" sample rate .IP \fBt\fR 4 .IX Item "t" time of the evaluated sample expressed in seconds .IP \fBnb_in_channels\fR 4 .IX Item "nb_in_channels" .PD 0 .IP \fBnb_out_channels\fR 4 .IX Item "nb_out_channels" .PD input and output number of channels .IP \fBval(CH)\fR 4 .IX Item "val(CH)" the value of input channel with number \fICH\fR .PP Note: this filter is slow. For faster processing you should use a dedicated filter. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Half volume: .Sp .Vb 1 \& aeval=val(ch)/2:c=same .Ve .IP \(bu 4 Invert phase of the second channel: .Sp .Vb 1 \& aeval=val(0)|\-val(1) .Ve .SS aexciter .IX Subsection "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. .PP The filter accepts the following options: .IP \fBlevel_in\fR 4 .IX Item "level_in" Set input level prior processing of signal. Allowed range is from 0 to 64. Default value is 1. .IP \fBlevel_out\fR 4 .IX Item "level_out" Set output level after processing of signal. Allowed range is from 0 to 64. Default value is 1. .IP \fBamount\fR 4 .IX Item "amount" Set the amount of harmonics added to original signal. Allowed range is from 0 to 64. Default value is 1. .IP \fBdrive\fR 4 .IX Item "drive" Set the amount of newly created harmonics. Allowed range is from 0.1 to 10. Default value is 8.5. .IP \fBblend\fR 4 .IX Item "blend" Set the octave of newly created harmonics. Allowed range is from \-10 to 10. Default value is 0. .IP \fBfreq\fR 4 .IX Item "freq" Set the lower frequency limit of producing harmonics in Hz. Allowed range is from 2000 to 12000 Hz. Default is 7500 Hz. .IP \fBceil\fR 4 .IX Item "ceil" Set the upper frequency limit of producing harmonics. Allowed range is from 9999 to 20000 Hz. If value is lower than 10000 Hz no limit is applied. .IP \fBlisten\fR 4 .IX Item "listen" Mute the original signal and output only added harmonics. By default is disabled. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS afade .IX Subsection "afade" Apply fade\-in/out effect to input audio. .PP A description of the accepted parameters follows. .IP "\fBtype, t\fR" 4 .IX Item "type, t" Specify the effect type, can be either \f(CW\*(C`in\*(C'\fR for fade-in, or \&\f(CW\*(C`out\*(C'\fR for a fade-out effect. Default is \f(CW\*(C`in\*(C'\fR. .IP "\fBstart_sample, ss\fR" 4 .IX Item "start_sample, ss" Specify the number of the start sample for starting to apply the fade effect. Default is 0. .IP "\fBnb_samples, ns\fR" 4 .IX Item "nb_samples, ns" Specify the number of samples for which the fade effect has to last. At the end of the fade-in effect the output audio will have the same volume as the input audio, at the end of the fade-out transition the output audio will be silence. Default is 44100. .IP "\fBstart_time, st\fR" 4 .IX Item "start_time, st" Specify the start time of the fade effect. Default is 0. The value must be specified as a time duration; see \&\fBthe Time duration section in the ffmpeg\-utils\|(1) manual\fR for the accepted syntax. If set this option is used instead of \fIstart_sample\fR. .IP "\fBduration, d\fR" 4 .IX Item "duration, d" Specify the duration of the fade effect. See \&\fBthe Time duration section in the ffmpeg\-utils\|(1) manual\fR 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 \fInb_samples\fR. If set this option is used instead of \fInb_samples\fR. .IP \fBcurve\fR 4 .IX Item "curve" Set curve for fade transition. .Sp It accepts the following values: .RS 4 .IP \fBtri\fR 4 .IX Item "tri" select triangular, linear slope (default) .IP \fBqsin\fR 4 .IX Item "qsin" select quarter of sine wave .IP \fBhsin\fR 4 .IX Item "hsin" select half of sine wave .IP \fBesin\fR 4 .IX Item "esin" select exponential sine wave .IP \fBlog\fR 4 .IX Item "log" select logarithmic .IP \fBipar\fR 4 .IX Item "ipar" select inverted parabola .IP \fBqua\fR 4 .IX Item "qua" select quadratic .IP \fBcub\fR 4 .IX Item "cub" select cubic .IP \fBsqu\fR 4 .IX Item "squ" select square root .IP \fBcbr\fR 4 .IX Item "cbr" select cubic root .IP \fBpar\fR 4 .IX Item "par" select parabola .IP \fBexp\fR 4 .IX Item "exp" select exponential .IP \fBiqsin\fR 4 .IX Item "iqsin" select inverted quarter of sine wave .IP \fBihsin\fR 4 .IX Item "ihsin" select inverted half of sine wave .IP \fBdese\fR 4 .IX Item "dese" select double-exponential seat .IP \fBdesi\fR 4 .IX Item "desi" select double-exponential sigmoid .IP \fBlosi\fR 4 .IX Item "losi" select logistic sigmoid .IP \fBsinc\fR 4 .IX Item "sinc" select sine cardinal function .IP \fBisinc\fR 4 .IX Item "isinc" select inverted sine cardinal function .IP \fBquat\fR 4 .IX Item "quat" select quartic .IP \fBquatr\fR 4 .IX Item "quatr" select quartic root .IP \fBqsin2\fR 4 .IX Item "qsin2" select squared quarter of sine wave .IP \fBhsin2\fR 4 .IX Item "hsin2" select squared half of sine wave .IP \fBnofade\fR 4 .IX Item "nofade" no fade applied .RE .RS 4 .RE .IP \fBsilence\fR 4 .IX Item "silence" Set the initial gain for fade-in or final gain for fade-out. Default value is \f(CW0.0\fR. .IP \fBunity\fR 4 .IX Item "unity" Set the initial gain for fade-out or final gain for fade-in. Default value is \f(CW1.0\fR. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Fade in first 15 seconds of audio: .Sp .Vb 1 \& afade=t=in:ss=0:d=15 .Ve .IP \(bu 4 Fade out last 25 seconds of a 900 seconds audio: .Sp .Vb 1 \& afade=t=out:st=875:d=25 .Ve .SS afftdn .IX Subsection "afftdn" Denoise audio samples with FFT. .PP A description of the accepted parameters follows. .IP "\fBnoise_reduction, nr\fR" 4 .IX Item "noise_reduction, nr" Set the noise reduction in dB, allowed range is 0.01 to 97. Default value is 12 dB. .IP "\fBnoise_floor, nf\fR" 4 .IX Item "noise_floor, nf" Set the noise floor in dB, allowed range is \-80 to \-20. Default value is \-50 dB. .IP "\fBnoise_type, nt\fR" 4 .IX Item "noise_type, nt" Set the noise type. .Sp It accepts the following values: .RS 4 .IP "\fBwhite, w\fR" 4 .IX Item "white, w" Select white noise. .IP "\fBvinyl, v\fR" 4 .IX Item "vinyl, v" Select vinyl noise. .IP "\fBshellac, s\fR" 4 .IX Item "shellac, s" Select shellac noise. .IP "\fBcustom, c\fR" 4 .IX Item "custom, c" Select custom noise, defined in \f(CW\*(C`bn\*(C'\fR option. .Sp Default value is white noise. .RE .RS 4 .RE .IP "\fBband_noise, bn\fR" 4 .IX Item "band_noise, bn" Set custom band noise profile for every one of 15 bands. Bands are separated by ' ' or '|'. .IP "\fBresidual_floor, rf\fR" 4 .IX Item "residual_floor, rf" Set the residual floor in dB, allowed range is \-80 to \-20. Default value is \-38 dB. .IP "\fBtrack_noise, tn\fR" 4 .IX Item "track_noise, tn" Enable noise floor tracking. By default is disabled. With this enabled, noise floor is automatically adjusted. .IP "\fBtrack_residual, tr\fR" 4 .IX Item "track_residual, tr" Enable residual tracking. By default is disabled. .IP "\fBoutput_mode, om\fR" 4 .IX Item "output_mode, om" Set the output mode. .Sp It accepts the following values: .RS 4 .IP "\fBinput, i\fR" 4 .IX Item "input, i" Pass input unchanged. .IP "\fBoutput, o\fR" 4 .IX Item "output, o" Pass noise filtered out. .IP "\fBnoise, n\fR" 4 .IX Item "noise, n" Pass only noise. .Sp Default value is \fIoutput\fR. .RE .RS 4 .RE .IP "\fBadaptivity, ad\fR" 4 .IX Item "adaptivity, ad" Set the adaptivity factor, used how fast to adapt gains adjustments per each frequency bin. Value \fI0\fR enables instant adaptation, while higher values react much slower. Allowed range is from \fI0\fR to \fI1\fR. Default value is \fI0.5\fR. .IP "\fBfloor_offset, fo\fR" 4 .IX Item "floor_offset, fo" 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 \fI\-2.0\fR to \fI2.0\fR. Default value is \fI1.0\fR. .IP "\fBnoise_link, nl\fR" 4 .IX Item "noise_link, nl" Set the noise link used for multichannel audio. .Sp It accepts the following values: .RS 4 .IP \fBnone\fR 4 .IX Item "none" Use unchanged channel's noise floor. .IP \fBmin\fR 4 .IX Item "min" Use measured min noise floor of all channels. .IP \fBmax\fR 4 .IX Item "max" Use measured max noise floor of all channels. .IP \fBaverage\fR 4 .IX Item "average" Use measured average noise floor of all channels. .Sp Default value is \fImin\fR. .RE .RS 4 .RE .IP "\fBband_multiplier, bm\fR" 4 .IX Item "band_multiplier, bm" Set the band multiplier factor, used how much to spread bands across frequency bins. Allowed range is from \fI0.2\fR to \fI5\fR. Default value is \fI1.25\fR. .IP "\fBsample_noise, sn\fR" 4 .IX Item "sample_noise, sn" Toggle capturing and measurement of noise profile from input audio. .Sp It accepts the following values: .RS 4 .IP "\fBstart, begin\fR" 4 .IX Item "start, begin" Start sample noise capture. .IP "\fBstop, end\fR" 4 .IX Item "stop, end" Stop sample noise capture and measure new noise band profile. .Sp Default value is \f(CW\*(C`none\*(C'\fR. .RE .RS 4 .RE .IP "\fBgain_smooth, gs\fR" 4 .IX Item "gain_smooth, gs" 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 \f(CW0\fR to \f(CW50\fR. Default value is \f(CW0\fR. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the some above mentioned options as \fBcommands\fR. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Reduce white noise by 10dB, and use previously measured noise floor of \-40dB: .Sp .Vb 1 \& afftdn=nr=10:nf=\-40 .Ve .IP \(bu 4 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: .Sp .Vb 1 \& afftdn=nr=10:nf=\-80:tn=1 .Ve .IP \(bu 4 Reduce noise by 20dB, using noise floor of \-40dB and using commands to take noise profile of first 0.4 seconds of input audio: .Sp .Vb 1 \& asendcmd=0.0 afftdn sn start,asendcmd=0.4 afftdn sn stop,afftdn=nr=20:nf=\-40 .Ve .SS afftfilt .IX Subsection "afftfilt" Apply arbitrary expressions to samples in frequency domain. .IP \fBreal\fR 4 .IX Item "real" 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. .IP \fBimag\fR 4 .IX Item "imag" Set frequency domain imaginary expression for each separate channel separated by '|'. Default is "im". .Sp Each expression in \fIreal\fR and \fIimag\fR can contain the following constants and functions: .RS 4 .IP \fBsr\fR 4 .IX Item "sr" sample rate .IP \fBb\fR 4 .IX Item "b" current frequency bin number .IP \fBnb\fR 4 .IX Item "nb" number of available bins .IP \fBch\fR 4 .IX Item "ch" channel number of the current expression .IP \fBchs\fR 4 .IX Item "chs" number of channels .IP \fBpts\fR 4 .IX Item "pts" current frame pts .IP \fBre\fR 4 .IX Item "re" current real part of frequency bin of current channel .IP \fBim\fR 4 .IX Item "im" current imaginary part of frequency bin of current channel .IP "\fBreal(b, ch)\fR" 4 .IX Item "real(b, ch)" Return the value of real part of frequency bin at location (\fIbin\fR,\fIchannel\fR) .IP "\fBimag(b, ch)\fR" 4 .IX Item "imag(b, ch)" Return the value of imaginary part of frequency bin at location (\fIbin\fR,\fIchannel\fR) .RE .RS 4 .RE .IP \fBwin_size\fR 4 .IX Item "win_size" Set window size. Allowed range is from 16 to 131072. Default is \f(CW4096\fR .IP \fBwin_func\fR 4 .IX Item "win_func" Set window function. .Sp It accepts the following values: .RS 4 .IP \fBrect\fR 4 .IX Item "rect" .PD 0 .IP \fBbartlett\fR 4 .IX Item "bartlett" .IP "\fBhann, hanning\fR" 4 .IX Item "hann, hanning" .IP \fBhamming\fR 4 .IX Item "hamming" .IP \fBblackman\fR 4 .IX Item "blackman" .IP \fBwelch\fR 4 .IX Item "welch" .IP \fBflattop\fR 4 .IX Item "flattop" .IP \fBbharris\fR 4 .IX Item "bharris" .IP \fBbnuttall\fR 4 .IX Item "bnuttall" .IP \fBbhann\fR 4 .IX Item "bhann" .IP \fBsine\fR 4 .IX Item "sine" .IP \fBnuttall\fR 4 .IX Item "nuttall" .IP \fBlanczos\fR 4 .IX Item "lanczos" .IP \fBgauss\fR 4 .IX Item "gauss" .IP \fBtukey\fR 4 .IX Item "tukey" .IP \fBdolph\fR 4 .IX Item "dolph" .IP \fBcauchy\fR 4 .IX Item "cauchy" .IP \fBparzen\fR 4 .IX Item "parzen" .IP \fBpoisson\fR 4 .IX Item "poisson" .IP \fBbohman\fR 4 .IX Item "bohman" .IP \fBkaiser\fR 4 .IX Item "kaiser" .RE .RS 4 .PD .Sp Default is \f(CW\*(C`hann\*(C'\fR. .RE .IP \fBoverlap\fR 4 .IX Item "overlap" Set window overlap. If set to 1, the recommended overlap for selected window function will be picked. Default is \f(CW0.75\fR. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Leave almost only low frequencies in audio: .Sp .Vb 1 \& afftfilt="\*(Aqreal=re * (1\-clip((b/nb)*b,0,1))\*(Aq:imag=\*(Aqim * (1\-clip((b/nb)*b,0,1))\*(Aq" .Ve .IP \(bu 4 Apply robotize effect: .Sp .Vb 1 \& afftfilt="real=\*(Aqhypot(re,im)*sin(0)\*(Aq:imag=\*(Aqhypot(re,im)*cos(0)\*(Aq:win_size=512:overlap=0.75" .Ve .IP \(bu 4 Apply whisper effect: .Sp .Vb 1 \& afftfilt="real=\*(Aqhypot(re,im)*cos((random(0)*2\-1)*2*3.14)\*(Aq:imag=\*(Aqhypot(re,im)*sin((random(1)*2\-1)*2*3.14)\*(Aq:win_size=128:overlap=0.8" .Ve .IP \(bu 4 Apply phase shift: .Sp .Vb 1 \& afftfilt="real=re*cos(1)\-im*sin(1):imag=re*sin(1)+im*cos(1)" .Ve .SS afir .IX Subsection "afir" Apply an arbitrary Finite Impulse Response filter. .PP This filter is designed for applying long FIR filters, up to 60 seconds long. .PP It can be used as component for digital crossover filters, room equalization, cross talk cancellation, wavefield synthesis, auralization, ambiophonics, ambisonics and spatialization. .PP 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. .PP It accepts the following parameters: .IP \fBdry\fR 4 .IX Item "dry" Set dry gain. This sets input gain. .IP \fBwet\fR 4 .IX Item "wet" Set wet gain. This sets final output gain. .IP \fBlength\fR 4 .IX Item "length" Set Impulse Response filter length. Default is 1, which means whole IR is processed. .IP \fBgtype\fR 4 .IX Item "gtype" This option is deprecated, and does nothing. .IP \fBirnorm\fR 4 .IX Item "irnorm" Set norm to be applied to IR coefficients before filtering. Allowed range is from \fI\-1\fR to \fI2\fR. IR coefficients are normalized with calculated vector norm set by this option. For negative values, no norm is calculated, and IR coefficients are not modified at all. Default is \fI1\fR. .IP \fBirlink\fR 4 .IX Item "irlink" For multichannel IR if this option is set to \fItrue\fR, all IR channels will be normalized with maximal measured gain of all IR channels coefficients as set by \f(CW\*(C`irnorm\*(C'\fR option. When disabled, all IR coefficients in each IR channel will be normalized independently. Default is \fItrue\fR. .IP \fBirgain\fR 4 .IX Item "irgain" 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 \fIirnorm\fR option. .IP \fBirfmt\fR 4 .IX Item "irfmt" Set format of IR stream. Can be \f(CW\*(C`mono\*(C'\fR or \f(CW\*(C`input\*(C'\fR. Default is \f(CW\*(C`input\*(C'\fR. .IP \fBmaxir\fR 4 .IX Item "maxir" Set max allowed Impulse Response filter duration in seconds. Default is 30 seconds. Allowed range is 0.1 to 60 seconds. .IP \fBresponse\fR 4 .IX Item "response" This option is deprecated, and does nothing. .IP \fBchannel\fR 4 .IX Item "channel" This option is deprecated, and does nothing. .IP \fBsize\fR 4 .IX Item "size" This option is deprecated, and does nothing. .IP \fBrate\fR 4 .IX Item "rate" This option is deprecated, and does nothing. .IP \fBminp\fR 4 .IX Item "minp" Set minimal partition size used for convolution. Default is \fI8192\fR. Allowed range is from \fI1\fR to \fI65536\fR. Lower values decreases latency at cost of higher CPU usage. .IP \fBmaxp\fR 4 .IX Item "maxp" Set maximal partition size used for convolution. Default is \fI8192\fR. Allowed range is from \fI8\fR to \fI65536\fR. Lower values may increase CPU usage. .IP \fBnbirs\fR 4 .IX Item "nbirs" Set number of input impulse responses streams which will be switchable at runtime. Allowed range is from \fI1\fR to \fI32\fR. Default is \fI1\fR. .IP \fBir\fR 4 .IX Item "ir" Set IR stream which will be used for convolution, starting from \fI0\fR, should always be lower than supplied value by \f(CW\*(C`nbirs\*(C'\fR option. Default is \fI0\fR. This option can be changed at runtime via \fBcommands\fR. .IP \fBprecision\fR 4 .IX Item "precision" Set which precision to use when processing samples. .RS 4 .IP \fBauto\fR 4 .IX Item "auto" Auto pick internal sample format depending on other filters. .IP \fBfloat\fR 4 .IX Item "float" Always use single-floating point precision sample format. .IP \fBdouble\fR 4 .IX Item "double" Always use double-floating point precision sample format. .RE .RS 4 .Sp Default value is auto. .RE .IP \fBirload\fR 4 .IX Item "irload" Set when to load IR stream. Can be \f(CW\*(C`init\*(C'\fR or \f(CW\*(C`access\*(C'\fR. First one load and prepares all IRs on initialization, second one once on first access of specific IR. Default is \f(CW\*(C`init\*(C'\fR. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Apply reverb to stream using mono IR file as second input, complete command using ffmpeg: .Sp .Vb 1 \& ffmpeg \-i input.wav \-i middle_tunnel_1way_mono.wav \-lavfi afir output.wav .Ve .IP \(bu 4 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, and setting irnorm option value: .Sp .Vb 1 \& "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:irnorm=1.2,pan=stereo|FL0 and <1 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. .IP "\fBcurve, v\fR" 4 .IX Item "curve, v" 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. .Sp The expression can contain the following constants: .RS 4 .IP \fBch\fR 4 .IX Item "ch" current channel number .IP \fBsn\fR 4 .IX Item "sn" current sample number .IP \fBnb_channels\fR 4 .IX Item "nb_channels" number of channels .IP \fBt\fR 4 .IX Item "t" timestamp expressed in seconds .IP \fBsr\fR 4 .IX Item "sr" sample rate .IP \fBp\fR 4 .IX Item "p" current frame peak value .RE .RS 4 .RE .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS earwax .IX Subsection "earwax" Make audio easier to listen to on headphones. .PP 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). .PP Ported from SoX. .SS equalizer .IX Subsection "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. .PP In order to produce complex equalisation curves, this filter can be given several times, each with a different central frequency. .PP The filter accepts the following options: .IP "\fBfrequency, f\fR" 4 .IX Item "frequency, f" Set the filter's central frequency in Hz. .IP "\fBwidth_type, t\fR" 4 .IX Item "width_type, t" Set method to specify band-width of filter. .RS 4 .IP \fBh\fR 4 .IX Item "h" Hz .IP \fBq\fR 4 .IX Item "q" Q\-Factor .IP \fBo\fR 4 .IX Item "o" octave .IP \fBs\fR 4 .IX Item "s" slope .IP \fBk\fR 4 .IX Item "k" kHz .RE .RS 4 .RE .IP "\fBwidth, w\fR" 4 .IX Item "width, w" Specify the band-width of a filter in width_type units. .IP "\fBgain, g\fR" 4 .IX Item "gain, g" Set the required gain or attenuation in dB. Beware of clipping when using a positive gain. .IP "\fBmix, m\fR" 4 .IX Item "mix, m" How much to use filtered signal in output. Default is 1. Range is between 0 and 1. .IP "\fBchannels, c\fR" 4 .IX Item "channels, c" Specify which channels to filter, by default all available are filtered. .IP "\fBnormalize, n\fR" 4 .IX Item "normalize, n" Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. .IP "\fBtransform, a\fR" 4 .IX Item "transform, a" Set transform type of IIR filter. .RS 4 .IP \fBdi\fR 4 .IX Item "di" .PD 0 .IP \fBdii\fR 4 .IX Item "dii" .IP \fBtdi\fR 4 .IX Item "tdi" .IP \fBtdii\fR 4 .IX Item "tdii" .IP \fBlatt\fR 4 .IX Item "latt" .IP \fBsvf\fR 4 .IX Item "svf" .IP \fBzdf\fR 4 .IX Item "zdf" .RE .RS 4 .RE .IP "\fBprecision, r\fR" 4 .IX Item "precision, r" .PD Set precision of filtering. .RS 4 .IP \fBauto\fR 4 .IX Item "auto" Pick automatic sample format depending on surround filters. .IP \fBs16\fR 4 .IX Item "s16" Always use signed 16\-bit. .IP \fBs32\fR 4 .IX Item "s32" Always use signed 32\-bit. .IP \fBf32\fR 4 .IX Item "f32" Always use float 32\-bit. .IP \fBf64\fR 4 .IX Item "f64" Always use float 64\-bit. .RE .RS 4 .RE .IP "\fBblock_size, b\fR" 4 .IX Item "block_size, 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. .Sp Note that filter delay will be exactly this many samples when set to non-zero value. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz: .Sp .Vb 1 \& equalizer=f=1000:t=h:width=200:g=\-10 .Ve .IP \(bu 4 Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2: .Sp .Vb 1 \& equalizer=f=1000:t=q:w=1:g=2,equalizer=f=100:t=q:w=2:g=\-5 .Ve .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the following commands: .IP "\fBfrequency, f\fR" 4 .IX Item "frequency, f" Change equalizer frequency. Syntax for the command is : "\fIfrequency\fR" .IP "\fBwidth_type, t\fR" 4 .IX Item "width_type, t" Change equalizer width_type. Syntax for the command is : "\fIwidth_type\fR" .IP "\fBwidth, w\fR" 4 .IX Item "width, w" Change equalizer width. Syntax for the command is : "\fIwidth\fR" .IP "\fBgain, g\fR" 4 .IX Item "gain, g" Change equalizer gain. Syntax for the command is : "\fIgain\fR" .IP "\fBmix, m\fR" 4 .IX Item "mix, m" Change equalizer mix. Syntax for the command is : "\fImix\fR" .SS extrastereo .IX Subsection "extrastereo" Linearly increases the difference between left and right channels which adds some sort of "live" effect to playback. .PP The filter accepts the following options: .IP \fBm\fR 4 .IX Item "m" 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. .IP \fBc\fR 4 .IX Item "c" Enable clipping. By default is enabled. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS firequalizer .IX Subsection "firequalizer" Apply FIR Equalization using arbitrary frequency response. .PP The filter accepts the following option: .IP \fBgain\fR 4 .IX Item "gain" Set gain curve equation (in dB). The expression can contain variables: .RS 4 .IP \fBf\fR 4 .IX Item "f" the evaluated frequency .IP \fBsr\fR 4 .IX Item "sr" sample rate .IP \fBch\fR 4 .IX Item "ch" channel number, set to 0 when multichannels evaluation is disabled .IP \fBchid\fR 4 .IX Item "chid" channel id, see libavutil/channel_layout.h, set to the first channel id when multichannels evaluation is disabled .IP \fBchs\fR 4 .IX Item "chs" number of channels .IP \fBchlayout\fR 4 .IX Item "chlayout" channel_layout, see libavutil/channel_layout.h .RE .RS 4 .Sp and functions: .IP \fBgain_interpolate(f)\fR 4 .IX Item "gain_interpolate(f)" interpolate gain on frequency f based on gain_entry .IP \fBcubic_interpolate(f)\fR 4 .IX Item "cubic_interpolate(f)" same as gain_interpolate, but smoother .RE .RS 4 .Sp This option is also available as command. Default is \f(CWgain_interpolate(f)\fR. .RE .IP \fBgain_entry\fR 4 .IX Item "gain_entry" Set gain entry for gain_interpolate function. The expression can contain functions: .RS 4 .IP "\fBentry(f, g)\fR" 4 .IX Item "entry(f, g)" store gain entry at frequency f with value g .RE .RS 4 .Sp This option is also available as command. .RE .IP \fBdelay\fR 4 .IX Item "delay" Set filter delay in seconds. Higher value means more accurate. Default is \f(CW0.01\fR. .IP \fBaccuracy\fR 4 .IX Item "accuracy" Set filter accuracy in Hz. Lower value means more accurate. Default is \f(CW5\fR. .IP \fBwfunc\fR 4 .IX Item "wfunc" Set window function. Acceptable values are: .RS 4 .IP \fBrectangular\fR 4 .IX Item "rectangular" rectangular window, useful when gain curve is already smooth .IP \fBhann\fR 4 .IX Item "hann" hann window (default) .IP \fBhamming\fR 4 .IX Item "hamming" hamming window .IP \fBblackman\fR 4 .IX Item "blackman" blackman window .IP \fBnuttall3\fR 4 .IX Item "nuttall3" 3\-terms continuous 1st derivative nuttall window .IP \fBmnuttall3\fR 4 .IX Item "mnuttall3" minimum 3\-terms discontinuous nuttall window .IP \fBnuttall\fR 4 .IX Item "nuttall" 4\-terms continuous 1st derivative nuttall window .IP \fBbnuttall\fR 4 .IX Item "bnuttall" minimum 4\-terms discontinuous nuttall (blackman-nuttall) window .IP \fBbharris\fR 4 .IX Item "bharris" blackman-harris window .IP \fBtukey\fR 4 .IX Item "tukey" tukey window .RE .RS 4 .RE .IP \fBfixed\fR 4 .IX Item "fixed" If enabled, use fixed number of audio samples. This improves speed when filtering with large delay. Default is disabled. .IP \fBmulti\fR 4 .IX Item "multi" Enable multichannels evaluation on gain. Default is disabled. .IP \fBzero_phase\fR 4 .IX Item "zero_phase" Enable zero phase mode by subtracting timestamp to compensate delay. Default is disabled. .IP \fBscale\fR 4 .IX Item "scale" Set scale used by gain. Acceptable values are: .RS 4 .IP \fBlinlin\fR 4 .IX Item "linlin" linear frequency, linear gain .IP \fBlinlog\fR 4 .IX Item "linlog" linear frequency, logarithmic (in dB) gain (default) .IP \fBloglin\fR 4 .IX Item "loglin" logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain .IP \fBloglog\fR 4 .IX Item "loglog" logarithmic frequency, logarithmic gain .RE .RS 4 .RE .IP \fBdumpfile\fR 4 .IX Item "dumpfile" Set file for dumping, suitable for gnuplot. .IP \fBdumpscale\fR 4 .IX Item "dumpscale" Set scale for dumpfile. Acceptable values are same with scale option. Default is linlog. .IP \fBfft2\fR 4 .IX Item "fft2" Enable 2\-channel convolution using complex FFT. This improves speed significantly. Default is disabled. .IP \fBmin_phase\fR 4 .IX Item "min_phase" Enable minimum phase impulse response. Default is disabled. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 lowpass at 1000 Hz: .Sp .Vb 1 \& firequalizer=gain=\*(Aqif(lt(f,1000), 0, \-INF)\*(Aq .Ve .IP \(bu 4 lowpass at 1000 Hz with gain_entry: .Sp .Vb 1 \& firequalizer=gain_entry=\*(Aqentry(1000,0); entry(1001, \-INF)\*(Aq .Ve .IP \(bu 4 custom equalization: .Sp .Vb 1 \& firequalizer=gain_entry=\*(Aqentry(100,0); entry(400, \-4); entry(1000, \-6); entry(2000, 0)\*(Aq .Ve .IP \(bu 4 higher delay with zero phase to compensate delay: .Sp .Vb 1 \& firequalizer=delay=0.1:fixed=on:zero_phase=on .Ve .IP \(bu 4 lowpass on left channel, highpass on right channel: .Sp .Vb 2 \& firequalizer=gain=\*(Aqif(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))\*(Aq \& :gain_entry=\*(Aqentry(1000, 0); entry(1001,\-INF); entry(1e6+1000,0)\*(Aq:multi=on .Ve .SS flanger .IX Subsection "flanger" Apply a flanging effect to the audio. .PP The filter accepts the following options: .IP \fBdelay\fR 4 .IX Item "delay" Set base delay in milliseconds. Range from 0 to 30. Default value is 0. .IP \fBdepth\fR 4 .IX Item "depth" Set added sweep delay in milliseconds. Range from 0 to 10. Default value is 2. .IP \fBregen\fR 4 .IX Item "regen" Set percentage regeneration (delayed signal feedback). Range from \-95 to 95. Default value is 0. .IP \fBwidth\fR 4 .IX Item "width" Set percentage of delayed signal mixed with original. Range from 0 to 100. Default value is 71. .IP \fBspeed\fR 4 .IX Item "speed" Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5. .IP \fBshape\fR 4 .IX Item "shape" Set swept wave shape, can be \fItriangular\fR or \fIsinusoidal\fR. Default value is \fIsinusoidal\fR. .IP \fBphase\fR 4 .IX Item "phase" Set swept wave percentage-shift for multi channel. Range from 0 to 100. Default value is 25. .IP \fBinterp\fR 4 .IX Item "interp" Set delay-line interpolation, \fIlinear\fR or \fIquadratic\fR. Default is \fIlinear\fR. .SS haas .IX Subsection "haas" Apply Haas effect to audio. .PP 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. .PP The filter accepts the following options: .IP \fBlevel_in\fR 4 .IX Item "level_in" Set input level. By default is \fI1\fR, or 0dB .IP \fBlevel_out\fR 4 .IX Item "level_out" Set output level. By default is \fI1\fR, or 0dB. .IP \fBside_gain\fR 4 .IX Item "side_gain" Set gain applied to side part of signal. By default is \fI1\fR. .IP \fBmiddle_source\fR 4 .IX Item "middle_source" Set kind of middle source. Can be one of the following: .RS 4 .IP \fBleft\fR 4 .IX Item "left" Pick left channel. .IP \fBright\fR 4 .IX Item "right" Pick right channel. .IP \fBmid\fR 4 .IX Item "mid" Pick middle part signal of stereo image. .IP \fBside\fR 4 .IX Item "side" Pick side part signal of stereo image. .RE .RS 4 .RE .IP \fBmiddle_phase\fR 4 .IX Item "middle_phase" Change middle phase. By default is disabled. .IP \fBleft_delay\fR 4 .IX Item "left_delay" Set left channel delay. By default is \fI2.05\fR milliseconds. .IP \fBleft_balance\fR 4 .IX Item "left_balance" Set left channel balance. By default is \fI\-1\fR. .IP \fBleft_gain\fR 4 .IX Item "left_gain" Set left channel gain. By default is \fI1\fR. .IP \fBleft_phase\fR 4 .IX Item "left_phase" Change left phase. By default is disabled. .IP \fBright_delay\fR 4 .IX Item "right_delay" Set right channel delay. By defaults is \fI2.12\fR milliseconds. .IP \fBright_balance\fR 4 .IX Item "right_balance" Set right channel balance. By default is \fI1\fR. .IP \fBright_gain\fR 4 .IX Item "right_gain" Set right channel gain. By default is \fI1\fR. .IP \fBright_phase\fR 4 .IX Item "right_phase" Change right phase. By default is enabled. .SS hdcd .IX Subsection "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. .PP The filter supports the Peak Extend and Low-level Gain Adjustment features of HDCD, and detects the Transient Filter flag. .PP .Vb 1 \& ffmpeg \-i HDCD16.flac \-af hdcd OUT24.flac .Ve .PP 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 \fB\-acodec pcm_s24le\fR after the filter to get 24\-bit PCM output. .PP .Vb 2 \& ffmpeg \-i HDCD16.wav \-af hdcd OUT16.wav \& ffmpeg \-i HDCD16.wav \-af hdcd \-c:a pcm_s24le OUT24.wav .Ve .PP The filter accepts the following options: .IP \fBdisable_autoconvert\fR 4 .IX Item "disable_autoconvert" Disable any automatic format conversion or resampling in the filter graph. .IP \fBprocess_stereo\fR 4 .IX Item "process_stereo" Process the stereo channels together. If target_gain does not match between channels, consider it invalid and use the last valid target_gain. .IP \fBcdt_ms\fR 4 .IX Item "cdt_ms" Set the code detect timer period in ms. .IP \fBforce_pe\fR 4 .IX Item "force_pe" Always extend peaks above \-3dBFS even if PE isn't signaled. .IP \fBanalyze_mode\fR 4 .IX Item "analyze_mode" 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. .Sp \&\f(CW\*(C`analyze_mode=pe:force_pe=true\*(C'\fR can be used to see all samples above the PE level. .Sp Modes are: .RS 4 .IP "\fB0, off\fR" 4 .IX Item "0, off" Disabled .IP "\fB1, lle\fR" 4 .IX Item "1, lle" Gain adjustment level at each sample .IP "\fB2, pe\fR" 4 .IX Item "2, pe" Samples where peak extend occurs .IP "\fB3, cdt\fR" 4 .IX Item "3, cdt" Samples where the code detect timer is active .IP "\fB4, tgm\fR" 4 .IX Item "4, tgm" Samples where the target gain does not match between channels .RE .RS 4 .RE .SS headphone .IX Subsection "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. .PP The filter accepts the following options: .IP \fBmap\fR 4 .IX Item "map" 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. .IP \fBgain\fR 4 .IX Item "gain" Set gain applied to audio. Value is in dB. Default is 0. .IP \fBtype\fR 4 .IX Item "type" Set processing type. Can be \fItime\fR or \fIfreq\fR. \fItime\fR is processing audio in time domain which is slow. \&\fIfreq\fR is processing audio in frequency domain which is fast. Default is \fIfreq\fR. .IP \fBlfe\fR 4 .IX Item "lfe" Set custom gain for LFE channels. Value is in dB. Default is 0. .IP \fBsize\fR 4 .IX Item "size" Set size of frame in number of samples which will be processed at once. Default value is \fI1024\fR. Allowed range is from 1024 to 96000. .IP \fBhrir\fR 4 .IX Item "hrir" Set format of hrir stream. Default value is \fIstereo\fR. Alternative value is \fImultich\fR. If value is set to \fIstereo\fR, number of additional streams should be greater or equal to number of input channels in first input stream. Also each additional stream should have stereo number of channels. If value is set to \fImultich\fR, number of additional streams should be exactly one. Also number of input channels of additional stream should be equal or greater than twice number of channels of first input stream. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Full example using wav files as coefficients with amovie filters for 7.1 downmix, each amovie filter use stereo file with IR coefficients as input. The files give coefficients for each position of virtual loudspeaker: .Sp .Vb 3 \& ffmpeg \-i input.wav \& \-filter_complex "amovie=azi_270_ele_0_DFC.wav[sr];amovie=azi_90_ele_0_DFC.wav[sl];amovie=azi_225_ele_0_DFC.wav[br];amovie=azi_135_ele_0_DFC.wav[bl];amovie=azi_0_ele_0_DFC.wav,asplit[fc][lfe];amovie=azi_35_ele_0_DFC.wav[fl];amovie=azi_325_ele_0_DFC.wav[fr];[0:a][fl][fr][fc][lfe][bl][br][sl][sr]headphone=FL|FR|FC|LFE|BL|BR|SL|SR" \& output.wav .Ve .IP \(bu 4 Full example using wav files as coefficients with amovie filters for 7.1 downmix, but now in \fImultich\fR \fIhrir\fR format. .Sp .Vb 2 \& ffmpeg \-i input.wav \-filter_complex "amovie=minp.wav[hrirs];[0:a][hrirs]headphone=map=FL|FR|FC|LFE|BL|BR|SL|SR:hrir=multich" \& output.wav .Ve .SS highpass .IX Subsection "highpass" Apply a high-pass filter with 3dB point frequency. The filter can be either single-pole, or double-pole (the default). The filter roll off at 6dB per pole per octave (20dB per pole per decade). .PP The filter accepts the following options: .IP "\fBfrequency, f\fR" 4 .IX Item "frequency, f" Set frequency in Hz. Default is 3000. .IP "\fBpoles, p\fR" 4 .IX Item "poles, p" Set number of poles. Default is 2. .IP "\fBwidth_type, t\fR" 4 .IX Item "width_type, t" Set method to specify band-width of filter. .RS 4 .IP \fBh\fR 4 .IX Item "h" Hz .IP \fBq\fR 4 .IX Item "q" Q\-Factor .IP \fBo\fR 4 .IX Item "o" octave .IP \fBs\fR 4 .IX Item "s" slope .IP \fBk\fR 4 .IX Item "k" kHz .RE .RS 4 .RE .IP "\fBwidth, w\fR" 4 .IX Item "width, w" Specify the band-width of a filter in width_type units. Applies only to double-pole filter. The default is 0.707q and gives a Butterworth response. .IP "\fBmix, m\fR" 4 .IX Item "mix, m" How much to use filtered signal in output. Default is 1. Range is between 0 and 1. .IP "\fBchannels, c\fR" 4 .IX Item "channels, c" Specify which channels to filter, by default all available are filtered. .IP "\fBnormalize, n\fR" 4 .IX Item "normalize, n" Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. .IP "\fBtransform, a\fR" 4 .IX Item "transform, a" Set transform type of IIR filter. .RS 4 .IP \fBdi\fR 4 .IX Item "di" .PD 0 .IP \fBdii\fR 4 .IX Item "dii" .IP \fBtdi\fR 4 .IX Item "tdi" .IP \fBtdii\fR 4 .IX Item "tdii" .IP \fBlatt\fR 4 .IX Item "latt" .IP \fBsvf\fR 4 .IX Item "svf" .IP \fBzdf\fR 4 .IX Item "zdf" .RE .RS 4 .RE .IP "\fBprecision, r\fR" 4 .IX Item "precision, r" .PD Set precision of filtering. .RS 4 .IP \fBauto\fR 4 .IX Item "auto" Pick automatic sample format depending on surround filters. .IP \fBs16\fR 4 .IX Item "s16" Always use signed 16\-bit. .IP \fBs32\fR 4 .IX Item "s32" Always use signed 32\-bit. .IP \fBf32\fR 4 .IX Item "f32" Always use float 32\-bit. .IP \fBf64\fR 4 .IX Item "f64" Always use float 64\-bit. .RE .RS 4 .RE .IP "\fBblock_size, b\fR" 4 .IX Item "block_size, 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. .Sp Note that filter delay will be exactly this many samples when set to non-zero value. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the following commands: .IP "\fBfrequency, f\fR" 4 .IX Item "frequency, f" Change highpass frequency. Syntax for the command is : "\fIfrequency\fR" .IP "\fBwidth_type, t\fR" 4 .IX Item "width_type, t" Change highpass width_type. Syntax for the command is : "\fIwidth_type\fR" .IP "\fBwidth, w\fR" 4 .IX Item "width, w" Change highpass width. Syntax for the command is : "\fIwidth\fR" .IP "\fBmix, m\fR" 4 .IX Item "mix, m" Change highpass mix. Syntax for the command is : "\fImix\fR" .SS join .IX Subsection "join" Join multiple input streams into one multi-channel stream. .PP It accepts the following parameters: .IP \fBinputs\fR 4 .IX Item "inputs" The number of input streams. It defaults to 2. .IP \fBchannel_layout\fR 4 .IX Item "channel_layout" The desired output channel layout. It defaults to stereo. .IP \fBmap\fR 4 .IX Item "map" Map channels from inputs to output. The argument is a '|'\-separated list of mappings, each in the \f(CW\*(C`\fR\f(CIinput_idx\fR\f(CW.\fR\f(CIin_channel\fR\f(CW\-\fR\f(CIout_channel\fR\f(CW\*(C'\fR form. \fIinput_idx\fR is the 0\-based index of the input stream. \fIin_channel\fR can be either the name of the input channel (e.g. FL for front left) or its index in the specified input stream. \fIout_channel\fR is the name of the output channel. .PP The filter will attempt to guess the mappings when they are not specified explicitly. It does so by first trying to find an unused matching input channel and if that fails it picks the first unused input channel. .PP Join 3 inputs (with properly set channel layouts): .PP .Vb 1 \& ffmpeg \-i INPUT1 \-i INPUT2 \-i INPUT3 \-filter_complex join=inputs=3 OUTPUT .Ve .PP Build a 5.1 output from 6 single-channel streams: .PP .Vb 3 \& ffmpeg \-i fl \-i fr \-i fc \-i sl \-i sr \-i lfe \-filter_complex \& \*(Aqjoin=inputs=6:channel_layout=5.1:map=0.0\-FL|1.0\-FR|2.0\-FC|3.0\-SL|4.0\-SR|5.0\-LFE\*(Aq \& out .Ve .SS ladspa .IX Subsection "ladspa" Load a LADSPA (Linux Audio Developer's Simple Plugin API) plugin. .PP To enable compilation of this filter you need to configure FFmpeg with \&\f(CW\*(C`\-\-enable\-ladspa\*(C'\fR. .IP "\fBfile, f\fR" 4 .IX Item "file, f" Specifies the name of LADSPA plugin library to load. If the environment variable \fBLADSPA_PATH\fR is defined, the LADSPA plugin is searched in each one of the directories specified by the colon separated list in \&\fBLADSPA_PATH\fR, otherwise in the standard LADSPA paths, which are in this order: \fIHOME/.ladspa/lib/\fR, \fI/usr/local/lib/ladspa/\fR, \&\fI/usr/lib/ladspa/\fR. .IP "\fBplugin, p\fR" 4 .IX Item "plugin, p" Specifies the plugin within the library. Some libraries contain only one plugin, but others contain many of them. If this is not set filter will list all available plugins within the specified library. .IP "\fBcontrols, c\fR" 4 .IX Item "controls, c" Set the '|' separated list of controls which are zero or more floating point values that determine the behavior of the loaded plugin (for example delay, threshold or gain). Controls need to be defined using the following syntax: c0=\fIvalue0\fR|c1=\fIvalue1\fR|c2=\fIvalue2\fR|..., where \&\fIvaluei\fR is the value set on the \fIi\fR\-th control. Alternatively they can be also defined using the following syntax: \&\fIvalue0\fR|\fIvalue1\fR|\fIvalue2\fR|..., where \&\fIvaluei\fR is the value set on the \fIi\fR\-th control. If \fBcontrols\fR is set to \f(CW\*(C`help\*(C'\fR, all available controls and their valid ranges are printed. .IP "\fBsample_rate, s\fR" 4 .IX Item "sample_rate, s" Specify the sample rate, default to 44100. Only used if plugin have zero inputs. .IP "\fBnb_samples, n\fR" 4 .IX Item "nb_samples, n" Set the number of samples per channel per each output frame, default is 1024. Only used if plugin have zero inputs. .IP "\fBduration, d\fR" 4 .IX Item "duration, d" Set the minimum duration of the sourced audio. See \&\fBthe Time duration section in the ffmpeg\-utils\|(1) manual\fR for the accepted syntax. Note that the resulting duration may be greater than the specified duration, as the generated audio is always cut at the end of a complete frame. If not specified, or the expressed duration is negative, the audio is supposed to be generated forever. Only used if plugin have zero inputs. .IP "\fBlatency, l\fR" 4 .IX Item "latency, l" Enable latency compensation, by default is disabled. Only used if plugin have inputs. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 List all available plugins within amp (LADSPA example plugin) library: .Sp .Vb 1 \& ladspa=file=amp .Ve .IP \(bu 4 List all available controls and their valid ranges for \f(CW\*(C`vcf_notch\*(C'\fR plugin from \f(CW\*(C`VCF\*(C'\fR library: .Sp .Vb 1 \& ladspa=f=vcf:p=vcf_notch:c=help .Ve .IP \(bu 4 Simulate low quality audio equipment using \f(CW\*(C`Computer Music Toolkit\*(C'\fR (CMT) plugin library: .Sp .Vb 1 \& ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12 .Ve .IP \(bu 4 Add reverberation to the audio using TAP-plugins (Tom's Audio Processing plugins): .Sp .Vb 1 \& ladspa=file=tap_reverb:tap_reverb .Ve .IP \(bu 4 Generate white noise, with 0.2 amplitude: .Sp .Vb 1 \& ladspa=file=cmt:noise_source_white:c=c0=.2 .Ve .IP \(bu 4 Generate 20 bpm clicks using plugin \f(CW\*(C`C* Click \- Metronome\*(C'\fR from the \&\f(CW\*(C`C* Audio Plugin Suite\*(C'\fR (CAPS) library: .Sp .Vb 1 \& ladspa=file=caps:Click:c=c1=20\*(Aq .Ve .IP \(bu 4 Apply \f(CW\*(C`C* Eq10X2 \- Stereo 10\-band equaliser\*(C'\fR effect: .Sp .Vb 1 \& ladspa=caps:Eq10X2:c=c0=\-48|c9=\-24|c3=12|c4=2 .Ve .IP \(bu 4 Increase volume by 20dB using fast lookahead limiter from Steve Harris \&\f(CW\*(C`SWH Plugins\*(C'\fR collection: .Sp .Vb 1 \& ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2 .Ve .IP \(bu 4 Attenuate low frequencies using Multiband EQ from Steve Harris \&\f(CW\*(C`SWH Plugins\*(C'\fR collection: .Sp .Vb 1 \& ladspa=mbeq_1197:mbeq:\-24|\-24|\-24|0|0|0|0|0|0|0|0|0|0|0|0 .Ve .IP \(bu 4 Reduce stereo image using \f(CW\*(C`Narrower\*(C'\fR from the \f(CW\*(C`C* Audio Plugin Suite\*(C'\fR (CAPS) library: .Sp .Vb 1 \& ladspa=caps:Narrower .Ve .IP \(bu 4 Another white noise, now using \f(CW\*(C`C* Audio Plugin Suite\*(C'\fR (CAPS) library: .Sp .Vb 1 \& ladspa=caps:White:.2 .Ve .IP \(bu 4 Some fractal noise, using \f(CW\*(C`C* Audio Plugin Suite\*(C'\fR (CAPS) library: .Sp .Vb 1 \& ladspa=caps:Fractal:c=c1=1 .Ve .IP \(bu 4 Dynamic volume normalization using \f(CW\*(C`VLevel\*(C'\fR plugin: .Sp .Vb 1 \& ladspa=vlevel\-ladspa:vlevel_mono .Ve .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the following commands: .IP \fBcN\fR 4 .IX Item "cN" Modify the \fIN\fR\-th control value. .Sp If the specified value is not valid, it is ignored and prior one is kept. .SS loudnorm .IX Subsection "loudnorm" EBU R128 loudness normalization. Includes both dynamic and linear normalization modes. Support for both single pass (livestreams, files) and double pass (files) modes. This algorithm can target IL, LRA, and maximum true peak. In dynamic mode, to accurately detect true peaks, the audio stream will be upsampled to 192 kHz. Use the \f(CW\*(C`\-ar\*(C'\fR option or \f(CW\*(C`aresample\*(C'\fR filter to explicitly set an output sample rate. .PP The filter accepts the following options: .IP "\fBI, i\fR" 4 .IX Item "I, i" Set integrated loudness target. Range is \-70.0 \- \-5.0. Default value is \-24.0. .IP "\fBLRA, lra\fR" 4 .IX Item "LRA, lra" Set loudness range target. Range is 1.0 \- 50.0. Default value is 7.0. .IP "\fBTP, tp\fR" 4 .IX Item "TP, tp" Set maximum true peak. Range is \-9.0 \- +0.0. Default value is \-2.0. .IP "\fBmeasured_I, measured_i\fR" 4 .IX Item "measured_I, measured_i" Measured IL of input file. Range is \-99.0 \- +0.0. .IP "\fBmeasured_LRA, measured_lra\fR" 4 .IX Item "measured_LRA, measured_lra" Measured LRA of input file. Range is 0.0 \- 99.0. .IP "\fBmeasured_TP, measured_tp\fR" 4 .IX Item "measured_TP, measured_tp" Measured true peak of input file. Range is \-99.0 \- +99.0. .IP \fBmeasured_thresh\fR 4 .IX Item "measured_thresh" Measured threshold of input file. Range is \-99.0 \- +0.0. .IP \fBoffset\fR 4 .IX Item "offset" Set offset gain. Gain is applied before the true-peak limiter. Range is \-99.0 \- +99.0. Default is +0.0. .IP \fBlinear\fR 4 .IX Item "linear" Normalize by linearly scaling the source audio. \&\f(CW\*(C`measured_I\*(C'\fR, \f(CW\*(C`measured_LRA\*(C'\fR, \f(CW\*(C`measured_TP\*(C'\fR, and \f(CW\*(C`measured_thresh\*(C'\fR must all be specified. Target LRA shouldn't be lower than source LRA and the change in integrated loudness shouldn't result in a true peak which exceeds the target TP. If any of these conditions aren't met, normalization mode will revert to \fIdynamic\fR. Options are \f(CW\*(C`true\*(C'\fR or \f(CW\*(C`false\*(C'\fR. Default is \f(CW\*(C`true\*(C'\fR. .IP \fBdual_mono\fR 4 .IX Item "dual_mono" Treat mono input files as "dual-mono". If a mono file is intended for playback on a stereo system, its EBU R128 measurement will be perceptually incorrect. If set to \f(CW\*(C`true\*(C'\fR, this option will compensate for this effect. Multi-channel input files are not affected by this option. Options are true or false. Default is false. .IP \fBprint_format\fR 4 .IX Item "print_format" Set print format for stats. Options are summary, json, or none. Default value is none. .SS lowpass .IX Subsection "lowpass" Apply a low-pass filter with 3dB point frequency. The filter can be either single-pole or double-pole (the default). The filter roll off at 6dB per pole per octave (20dB per pole per decade). .PP The filter accepts the following options: .IP "\fBfrequency, f\fR" 4 .IX Item "frequency, f" Set frequency in Hz. Default is 500. .IP "\fBpoles, p\fR" 4 .IX Item "poles, p" Set number of poles. Default is 2. .IP "\fBwidth_type, t\fR" 4 .IX Item "width_type, t" Set method to specify band-width of filter. .RS 4 .IP \fBh\fR 4 .IX Item "h" Hz .IP \fBq\fR 4 .IX Item "q" Q\-Factor .IP \fBo\fR 4 .IX Item "o" octave .IP \fBs\fR 4 .IX Item "s" slope .IP \fBk\fR 4 .IX Item "k" kHz .RE .RS 4 .RE .IP "\fBwidth, w\fR" 4 .IX Item "width, w" Specify the band-width of a filter in width_type units. Applies only to double-pole filter. The default is 0.707q and gives a Butterworth response. .IP "\fBmix, m\fR" 4 .IX Item "mix, m" How much to use filtered signal in output. Default is 1. Range is between 0 and 1. .IP "\fBchannels, c\fR" 4 .IX Item "channels, c" Specify which channels to filter, by default all available are filtered. .IP "\fBnormalize, n\fR" 4 .IX Item "normalize, n" Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. .IP "\fBtransform, a\fR" 4 .IX Item "transform, a" Set transform type of IIR filter. .RS 4 .IP \fBdi\fR 4 .IX Item "di" .PD 0 .IP \fBdii\fR 4 .IX Item "dii" .IP \fBtdi\fR 4 .IX Item "tdi" .IP \fBtdii\fR 4 .IX Item "tdii" .IP \fBlatt\fR 4 .IX Item "latt" .IP \fBsvf\fR 4 .IX Item "svf" .IP \fBzdf\fR 4 .IX Item "zdf" .RE .RS 4 .RE .IP "\fBprecision, r\fR" 4 .IX Item "precision, r" .PD Set precision of filtering. .RS 4 .IP \fBauto\fR 4 .IX Item "auto" Pick automatic sample format depending on surround filters. .IP \fBs16\fR 4 .IX Item "s16" Always use signed 16\-bit. .IP \fBs32\fR 4 .IX Item "s32" Always use signed 32\-bit. .IP \fBf32\fR 4 .IX Item "f32" Always use float 32\-bit. .IP \fBf64\fR 4 .IX Item "f64" Always use float 64\-bit. .RE .RS 4 .RE .IP "\fBblock_size, b\fR" 4 .IX Item "block_size, 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. .Sp Note that filter delay will be exactly this many samples when set to non-zero value. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Lowpass only LFE channel, it LFE is not present it does nothing: .Sp .Vb 1 \& lowpass=c=LFE .Ve .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the following commands: .IP "\fBfrequency, f\fR" 4 .IX Item "frequency, f" Change lowpass frequency. Syntax for the command is : "\fIfrequency\fR" .IP "\fBwidth_type, t\fR" 4 .IX Item "width_type, t" Change lowpass width_type. Syntax for the command is : "\fIwidth_type\fR" .IP "\fBwidth, w\fR" 4 .IX Item "width, w" Change lowpass width. Syntax for the command is : "\fIwidth\fR" .IP "\fBmix, m\fR" 4 .IX Item "mix, m" Change lowpass mix. Syntax for the command is : "\fImix\fR" .SS lv2 .IX Subsection "lv2" Load a LV2 (LADSPA Version 2) plugin. .PP To enable compilation of this filter you need to configure FFmpeg with \&\f(CW\*(C`\-\-enable\-lv2\*(C'\fR. .IP "\fBplugin, p\fR" 4 .IX Item "plugin, p" Specifies the plugin URI. You may need to escape ':'. .IP "\fBcontrols, c\fR" 4 .IX Item "controls, c" Set the '|' separated list of controls which are zero or more floating point values that determine the behavior of the loaded plugin (for example delay, threshold or gain). If \fBcontrols\fR is set to \f(CW\*(C`help\*(C'\fR, all available controls and their valid ranges are printed. .IP "\fBsample_rate, s\fR" 4 .IX Item "sample_rate, s" Specify the sample rate, default to 44100. Only used if plugin have zero inputs. .IP "\fBnb_samples, n\fR" 4 .IX Item "nb_samples, n" Set the number of samples per channel per each output frame, default is 1024. Only used if plugin have zero inputs. .IP "\fBduration, d\fR" 4 .IX Item "duration, d" Set the minimum duration of the sourced audio. See \&\fBthe Time duration section in the ffmpeg\-utils\|(1) manual\fR for the accepted syntax. Note that the resulting duration may be greater than the specified duration, as the generated audio is always cut at the end of a complete frame. If not specified, or the expressed duration is negative, the audio is supposed to be generated forever. Only used if plugin have zero inputs. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Apply bass enhancer plugin from Calf: .Sp .Vb 1 \& lv2=p=http\e\e\e\e://calf.sourceforge.net/plugins/BassEnhancer:c=amount=2 .Ve .IP \(bu 4 Apply vinyl plugin from Calf: .Sp .Vb 1 \& lv2=p=http\e\e\e\e://calf.sourceforge.net/plugins/Vinyl:c=drone=0.2|aging=0.5 .Ve .IP \(bu 4 Apply bit crusher plugin from ArtyFX: .Sp .Vb 1 \& lv2=p=http\e\e\e\e://www.openavproductions.com/artyfx#bitta:c=crush=0.3 .Ve .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports all options that are exported by plugin as commands. .SS mcompand .IX Subsection "mcompand" Multiband Compress or expand the audio's dynamic range. .PP The input audio is divided into bands using 4th order Linkwitz-Riley IIRs. This is akin to the crossover of a loudspeaker, and results in flat frequency response when absent compander action. .PP It accepts the following parameters: .IP \fBargs\fR 4 .IX Item "args" This option syntax is: attack,decay,[attack,decay..] soft-knee points crossover_frequency [delay [initial_volume [gain]]] | attack,decay ... For explanation of each item refer to compand filter documentation. .SS pan .IX Subsection "pan" Mix channels with specific gain levels. The filter accepts the output channel layout followed by a set of channels definitions. .PP This filter is also designed to efficiently remap the channels of an audio stream. .PP The filter accepts parameters of the form: "\fIl\fR|\fIoutdef\fR|\fIoutdef\fR|..." .IP \fBl\fR 4 .IX Item "l" output channel layout or number of channels .IP \fBoutdef\fR 4 .IX Item "outdef" output channel specification, of the form: "\fIout_name\fR=[\fIgain\fR*]\fIin_name\fR[(+\-)[\fIgain\fR*]\fIin_name\fR...]" .IP \fBout_name\fR 4 .IX Item "out_name" output channel to define, either a channel name (FL, FR, etc.) or a channel number (c0, c1, etc.) .IP \fBgain\fR 4 .IX Item "gain" multiplicative coefficient for the channel, 1 leaving the volume unchanged .IP \fBin_name\fR 4 .IX Item "in_name" input channel to use, see out_name for details; it is not possible to mix named and numbered input channels .PP If the `=' in a channel specification is replaced by `<', then the gains for that specification will be renormalized so that the total is 1, thus avoiding clipping noise. .PP \fIMixing examples\fR .IX Subsection "Mixing examples" .PP For example, if you want to down-mix from stereo to mono, but with a bigger factor for the left channel: .PP .Vb 1 \& pan=1c|c0=0.9*c0+0.1*c1 .Ve .PP A customized down-mix to stereo that works automatically for 3\-, 4\-, 5\- and 7\-channels surround: .PP .Vb 1 \& pan=stereo| FL < FL + 0.5*FC + 0.6*BL + 0.6*SL | FR < FR + 0.5*FC + 0.6*BR + 0.6*SR .Ve .PP Note that \fBffmpeg\fR integrates a default down-mix (and up-mix) system that should be preferred (see "\-ac" option) unless you have very specific needs. .PP \fIRemapping examples\fR .IX Subsection "Remapping examples" .PP The channel remapping will be effective if, and only if: .IP "*" 4 .IX Item "*" .PD 0 .IP "*" 4 .IX Item "*" .PD .PP If all these conditions are satisfied, the filter will notify the user ("Pure channel mapping detected"), and use an optimized and lossless method to do the remapping. .PP For example, if you have a 5.1 source and want a stereo audio stream by dropping the extra channels: .PP .Vb 1 \& pan="stereo| c0=FL | c1=FR" .Ve .PP Given the same source, you can also switch front left and front right channels and keep the input channel layout: .PP .Vb 1 \& pan="5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5" .Ve .PP If the input is a stereo audio stream, you can mute the front left channel (and still keep the stereo channel layout) with: .PP .Vb 1 \& pan="stereo|c1=c1" .Ve .PP Still with a stereo audio stream input, you can copy the right channel in both front left and right: .PP .Vb 1 \& pan="stereo| c0=FR | c1=FR" .Ve .SS replaygain .IX Subsection "replaygain" ReplayGain scanner filter. This filter takes an audio stream as an input and outputs it unchanged. At end of filtering it displays \f(CW\*(C`track_gain\*(C'\fR and \f(CW\*(C`track_peak\*(C'\fR. .PP The filter accepts the following exported read-only options: .IP \fBtrack_gain\fR 4 .IX Item "track_gain" Exported track gain in dB at end of stream. .IP \fBtrack_peak\fR 4 .IX Item "track_peak" Exported track peak at end of stream. .SS resample .IX Subsection "resample" Convert the audio sample format, sample rate and channel layout. It is not meant to be used directly. .SS rubberband .IX Subsection "rubberband" Apply time-stretching and pitch-shifting with librubberband. .PP To enable compilation of this filter, you need to configure FFmpeg with \&\f(CW\*(C`\-\-enable\-librubberband\*(C'\fR. .PP The filter accepts the following options: .IP \fBtempo\fR 4 .IX Item "tempo" Set tempo scale factor. .IP \fBpitch\fR 4 .IX Item "pitch" Set pitch scale factor. .IP \fBtransients\fR 4 .IX Item "transients" Set transients detector. Possible values are: .RS 4 .IP \fIcrisp\fR 4 .IX Item "crisp" .PD 0 .IP \fImixed\fR 4 .IX Item "mixed" .IP \fIsmooth\fR 4 .IX Item "smooth" .RE .RS 4 .RE .IP \fBdetector\fR 4 .IX Item "detector" .PD Set detector. Possible values are: .RS 4 .IP \fIcompound\fR 4 .IX Item "compound" .PD 0 .IP \fIpercussive\fR 4 .IX Item "percussive" .IP \fIsoft\fR 4 .IX Item "soft" .RE .RS 4 .RE .IP \fBphase\fR 4 .IX Item "phase" .PD Set phase. Possible values are: .RS 4 .IP \fIlaminar\fR 4 .IX Item "laminar" .PD 0 .IP \fIindependent\fR 4 .IX Item "independent" .RE .RS 4 .RE .IP \fBwindow\fR 4 .IX Item "window" .PD Set processing window size. Possible values are: .RS 4 .IP \fIstandard\fR 4 .IX Item "standard" .PD 0 .IP \fIshort\fR 4 .IX Item "short" .IP \fIlong\fR 4 .IX Item "long" .RE .RS 4 .RE .IP \fBsmoothing\fR 4 .IX Item "smoothing" .PD Set smoothing. Possible values are: .RS 4 .IP \fIoff\fR 4 .IX Item "off" .PD 0 .IP \fIon\fR 4 .IX Item "on" .RE .RS 4 .RE .IP \fBformant\fR 4 .IX Item "formant" .PD Enable formant preservation when shift pitching. Possible values are: .RS 4 .IP \fIshifted\fR 4 .IX Item "shifted" .PD 0 .IP \fIpreserved\fR 4 .IX Item "preserved" .RE .RS 4 .RE .IP \fBpitchq\fR 4 .IX Item "pitchq" .PD Set pitch quality. Possible values are: .RS 4 .IP \fIquality\fR 4 .IX Item "quality" .PD 0 .IP \fIspeed\fR 4 .IX Item "speed" .IP \fIconsistency\fR 4 .IX Item "consistency" .RE .RS 4 .RE .IP \fBchannels\fR 4 .IX Item "channels" .PD Set channels. Possible values are: .RS 4 .IP \fIapart\fR 4 .IX Item "apart" .PD 0 .IP \fItogether\fR 4 .IX Item "together" .RE .RS 4 .RE .PD .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the following commands: .IP \fBtempo\fR 4 .IX Item "tempo" Change filter tempo scale factor. Syntax for the command is : "\fItempo\fR" .IP \fBpitch\fR 4 .IX Item "pitch" Change filter pitch scale factor. Syntax for the command is : "\fIpitch\fR" .SS sidechaincompress .IX Subsection "sidechaincompress" This filter acts like normal compressor but has the ability to compress detected signal using second input signal. It needs two input streams and returns one output stream. First input stream will be processed depending on second stream signal. The filtered signal then can be filtered with other filters in later stages of processing. See \fBpan\fR and \fBamerge\fR filter. .PP The filter accepts the following options: .IP \fBlevel_in\fR 4 .IX Item "level_in" Set input gain. Default is 1. Range is between 0.015625 and 64. .IP \fBmode\fR 4 .IX Item "mode" Set mode of compressor operation. Can be \f(CW\*(C`upward\*(C'\fR or \f(CW\*(C`downward\*(C'\fR. Default is \f(CW\*(C`downward\*(C'\fR. .IP \fBthreshold\fR 4 .IX Item "threshold" If a signal of second stream raises above this level it will affect the gain reduction of first stream. By default is 0.125. Range is between 0.00097563 and 1. .IP \fBratio\fR 4 .IX Item "ratio" Set a ratio about which the signal is reduced. 1:2 means that if the level raised 4dB above the threshold, it will be only 2dB above after the reduction. Default is 2. Range is between 1 and 20. .IP \fBattack\fR 4 .IX Item "attack" Amount of milliseconds the signal has to rise above the threshold before gain reduction starts. Default is 20. Range is between 0.01 and 2000. .IP \fBrelease\fR 4 .IX Item "release" Amount of milliseconds the signal has to fall below the threshold before reduction is decreased again. Default is 250. Range is between 0.01 and 9000. .IP \fBmakeup\fR 4 .IX Item "makeup" Set the amount by how much signal will be amplified after processing. Default is 1. Range is from 1 to 64. .IP \fBknee\fR 4 .IX Item "knee" Curve the sharp knee around the threshold to enter gain reduction more softly. Default is 2.82843. Range is between 1 and 8. .IP \fBlink\fR 4 .IX Item "link" Choose if the \f(CW\*(C`average\*(C'\fR level between all channels of side-chain stream or the louder(\f(CW\*(C`maximum\*(C'\fR) channel of side-chain stream affects the reduction. Default is \f(CW\*(C`average\*(C'\fR. .IP \fBdetection\fR 4 .IX Item "detection" Should the exact signal be taken in case of \f(CW\*(C`peak\*(C'\fR or an RMS one in case of \f(CW\*(C`rms\*(C'\fR. Default is \f(CW\*(C`rms\*(C'\fR which is mainly smoother. .IP \fBlevel_sc\fR 4 .IX Item "level_sc" Set sidechain gain. Default is 1. Range is between 0.015625 and 64. .IP \fBmix\fR 4 .IX Item "mix" How much to use compressed signal in output. Default is 1. Range is between 0 and 1. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Full ffmpeg example taking 2 audio inputs, 1st input to be compressed depending on the signal of 2nd input and later compressed signal to be merged with 2nd input: .Sp .Vb 1 \& ffmpeg \-i main.flac \-i sidechain.flac \-filter_complex "[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress[compr];[compr][mix]amerge" .Ve .SS sidechaingate .IX Subsection "sidechaingate" A sidechain gate acts like a normal (wideband) gate but has the ability to filter the detected signal before sending it to the gain reduction stage. Normally a gate uses the full range signal to detect a level above the threshold. For example: If you cut all lower frequencies from your sidechain signal the gate will decrease the volume of your track only if not enough highs appear. With this technique you are able to reduce the resonation of a natural drum or remove "rumbling" of muted strokes from a heavily distorted guitar. It needs two input streams and returns one output stream. First input stream will be processed depending on second stream signal. .PP The filter accepts the following options: .IP \fBlevel_in\fR 4 .IX Item "level_in" Set input level before filtering. Default is 1. Allowed range is from 0.015625 to 64. .IP \fBmode\fR 4 .IX Item "mode" Set the mode of operation. Can be \f(CW\*(C`upward\*(C'\fR or \f(CW\*(C`downward\*(C'\fR. Default is \f(CW\*(C`downward\*(C'\fR. If set to \f(CW\*(C`upward\*(C'\fR mode, higher parts of signal will be amplified, expanding dynamic range in upward direction. Otherwise, in case of \f(CW\*(C`downward\*(C'\fR lower parts of signal will be reduced. .IP \fBrange\fR 4 .IX Item "range" 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. .IP \fBthreshold\fR 4 .IX Item "threshold" If a signal rises above this level the gain reduction is released. Default is 0.125. Allowed range is from 0 to 1. .IP \fBratio\fR 4 .IX Item "ratio" Set a ratio about which the signal is reduced. Default is 2. Allowed range is from 1 to 9000. .IP \fBattack\fR 4 .IX Item "attack" 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. .IP \fBrelease\fR 4 .IX Item "release" 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. .IP \fBmakeup\fR 4 .IX Item "makeup" Set amount of amplification of signal after processing. Default is 1. Allowed range is from 1 to 64. .IP \fBknee\fR 4 .IX Item "knee" Curve the sharp knee around the threshold to enter gain reduction more softly. Default is 2.828427125. Allowed range is from 1 to 8. .IP \fBdetection\fR 4 .IX Item "detection" Choose if exact signal should be taken for detection or an RMS like one. Default is rms. Can be peak or rms. .IP \fBlink\fR 4 .IX Item "link" Choose if the average level between all channels or the louder channel affects the reduction. Default is average. Can be average or maximum. .IP \fBlevel_sc\fR 4 .IX Item "level_sc" Set sidechain gain. Default is 1. Range is from 0.015625 to 64. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS silencedetect .IX Subsection "silencedetect" Detect silence in an audio stream. .PP This filter logs a message when it detects that the input audio volume is less or equal to a noise tolerance value for a duration greater or equal to the minimum detected noise duration. .PP The printed times and duration are expressed in seconds. The \&\f(CW\*(C`lavfi.silence_start\*(C'\fR or \f(CW\*(C`lavfi.silence_start.X\*(C'\fR metadata key is set on the first frame whose timestamp equals or exceeds the detection duration and it contains the timestamp of the first frame of the silence. .PP The \f(CW\*(C`lavfi.silence_duration\*(C'\fR or \f(CW\*(C`lavfi.silence_duration.X\*(C'\fR and \f(CW\*(C`lavfi.silence_end\*(C'\fR or \f(CW\*(C`lavfi.silence_end.X\*(C'\fR metadata keys are set on the first frame after the silence. If \fBmono\fR is enabled, and each channel is evaluated separately, the \f(CW\*(C`.X\*(C'\fR suffixed keys are used, and \f(CW\*(C`X\*(C'\fR corresponds to the channel number. .PP The filter accepts the following options: .IP "\fBnoise, n\fR" 4 .IX Item "noise, n" Set noise tolerance. Can be specified in dB (in case "dB" is appended to the specified value) or amplitude ratio. Default is \-60dB, or 0.001. .IP "\fBduration, d\fR" 4 .IX Item "duration, d" Set silence duration until notification (default is 2 seconds). See \&\fBthe Time duration section in the ffmpeg\-utils\|(1) manual\fR for the accepted syntax. .IP "\fBmono, m\fR" 4 .IX Item "mono, m" Process each channel separately, instead of combined. By default is disabled. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Detect 5 seconds of silence with \-50dB noise tolerance: .Sp .Vb 1 \& silencedetect=n=\-50dB:d=5 .Ve .IP \(bu 4 Complete example with \fBffmpeg\fR to detect silence with 0.0001 noise tolerance in \fIsilence.mp3\fR: .Sp .Vb 1 \& ffmpeg \-i silence.mp3 \-af silencedetect=noise=0.0001 \-f null \- .Ve .SS silenceremove .IX Subsection "silenceremove" Remove silence from the beginning, middle or end of the audio. .PP The filter accepts the following options: .IP \fBstart_periods\fR 4 .IX Item "start_periods" This value is used to indicate if audio should be trimmed at beginning of the audio. A value of zero indicates no silence should be trimmed from the beginning. When specifying a non-zero value, it trims audio up until it finds non-silence. Normally, when trimming silence from beginning of audio the \fIstart_periods\fR will be \f(CW1\fR but it can be increased to higher values to trim all audio up to specific count of non-silence periods. Default value is \f(CW0\fR. .IP \fBstart_duration\fR 4 .IX Item "start_duration" Specify the amount of time that non-silence must be detected before it stops trimming audio. By increasing the duration, bursts of noises can be treated as silence and trimmed off. Default value is \f(CW0\fR. .IP \fBstart_threshold\fR 4 .IX Item "start_threshold" This indicates what sample value should be treated as silence. For digital audio, a value of \f(CW0\fR may be fine but for audio recorded from analog, you may wish to increase the value to account for background noise. Can be specified in dB (in case "dB" is appended to the specified value) or amplitude ratio. Default value is \f(CW0\fR. .IP \fBstart_silence\fR 4 .IX Item "start_silence" Specify max duration of silence at beginning that will be kept after trimming. Default is 0, which is equal to trimming all samples detected as silence. .IP \fBstart_mode\fR 4 .IX Item "start_mode" Specify mode of detection of silence end at start of multi-channel audio. Can be \fIany\fR or \fIall\fR. Default is \fIany\fR. With \fIany\fR, any sample from any channel that is detected as non-silence will trigger end of silence trimming at start of audio stream. With \fIall\fR, only if every sample from every channel is detected as non-silence will trigger end of silence trimming at start of audio stream, limited usage. .IP \fBstop_periods\fR 4 .IX Item "stop_periods" Set the count for trimming silence from the end of audio. When specifying a positive value, it trims audio after it finds specified silence period. To remove silence from the middle of a file, specify a \fIstop_periods\fR that is negative. This value is then treated as a positive value and is used to indicate the effect should restart processing as specified by \&\fIstop_periods\fR, making it suitable for removing periods of silence in the middle of the audio. Default value is \f(CW0\fR. .IP \fBstop_duration\fR 4 .IX Item "stop_duration" Specify a duration of silence that must exist before audio is not copied any more. By specifying a higher duration, silence that is wanted can be left in the audio. Default value is \f(CW0\fR. .IP \fBstop_threshold\fR 4 .IX Item "stop_threshold" This is the same as \fBstart_threshold\fR but for trimming silence from the end of audio. Can be specified in dB (in case "dB" is appended to the specified value) or amplitude ratio. Default value is \f(CW0\fR. .IP \fBstop_silence\fR 4 .IX Item "stop_silence" Specify max duration of silence at end that will be kept after trimming. Default is 0, which is equal to trimming all samples detected as silence. .IP \fBstop_mode\fR 4 .IX Item "stop_mode" Specify mode of detection of silence start after start of multi-channel audio. Can be \fIany\fR or \fIall\fR. Default is \fIall\fR. With \fIany\fR, any sample from any channel that is detected as silence will trigger start of silence trimming after start of audio stream, limited usage. With \fIall\fR, only if every sample from every channel is detected as silence will trigger start of silence trimming after start of audio stream. .IP \fBdetection\fR 4 .IX Item "detection" Set how is silence detected. .RS 4 .IP \fBavg\fR 4 .IX Item "avg" Mean of absolute values of samples in moving window. .IP \fBrms\fR 4 .IX Item "rms" Root squared mean of absolute values of samples in moving window. .IP \fBpeak\fR 4 .IX Item "peak" Maximum of absolute values of samples in moving window. .IP \fBmedian\fR 4 .IX Item "median" Median of absolute values of samples in moving window. .IP \fBptp\fR 4 .IX Item "ptp" Absolute of max peak to min peak difference of samples in moving window. .IP \fBdev\fR 4 .IX Item "dev" Standard deviation of values of samples in moving window. .RE .RS 4 .Sp Default value is \f(CW\*(C`rms\*(C'\fR. .RE .IP \fBwindow\fR 4 .IX Item "window" Set duration in number of seconds used to calculate size of window in number of samples for detecting silence. Using \f(CW0\fR will effectively disable any windowing and use only single sample per channel for silence detection. In that case it may be needed to also set \fBstart_silence\fR and/or \&\fBstop_silence\fR to nonzero values with also \fBstart_duration\fR and/or \&\fBstop_duration\fR to nonzero values. Default value is \f(CW0.02\fR. Allowed range is from \f(CW0\fR to \f(CW10\fR. .IP \fBtimestamp\fR 4 .IX Item "timestamp" Set processing mode of every audio frame output timestamp. .RS 4 .IP \fBwrite\fR 4 .IX Item "write" Full timestamps rewrite, keep only the start time for the first output frame. .IP \fBcopy\fR 4 .IX Item "copy" Non-dropped frames are left with same timestamp as input audio frame. .RE .RS 4 .Sp Defaults value is \f(CW\*(C`write\*(C'\fR. .RE .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 The following example shows how this filter can be used to start a recording that does not contain the delay at the start which usually occurs between pressing the record button and the start of the performance: .Sp .Vb 1 \& silenceremove=start_periods=1:start_duration=5:start_threshold=0.02 .Ve .IP \(bu 4 Trim all silence encountered from beginning to end where there is more than 1 second of silence in audio: .Sp .Vb 1 \& silenceremove=stop_periods=\-1:stop_duration=1:stop_threshold=\-90dB .Ve .IP \(bu 4 Trim all digital silence samples, using peak detection, from beginning to end where there is more than 0 samples of digital silence in audio and digital silence is detected in all channels at same positions in stream: .Sp .Vb 1 \& silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=\-1:stop_threshold=0 .Ve .IP \(bu 4 Trim every 2nd encountered silence period from beginning to end where there is more than 1 second of silence per silence period in audio: .Sp .Vb 1 \& silenceremove=stop_periods=\-2:stop_duration=1:stop_threshold=\-90dB .Ve .IP \(bu 4 Similar as above, but keep maximum of 0.5 seconds of silence from each trimmed period: .Sp .Vb 1 \& silenceremove=stop_periods=\-2:stop_duration=1:stop_threshold=\-90dB:stop_silence=0.5 .Ve .IP \(bu 4 Similar as above, but keep maximum of 1.5 seconds of silence from start of audio: .Sp .Vb 1 \& silenceremove=stop_periods=\-2:stop_duration=1:stop_threshold=\-90dB:stop_silence=0.5:start_periods=1:start_duration=1:start_silence=1.5:stop_threshold=\-90dB .Ve .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports some above options as \fBcommands\fR. .SS sofalizer .IX Subsection "sofalizer" SOFAlizer uses head-related transfer functions (HRTFs) to create virtual loudspeakers around the user for binaural listening via headphones (audio formats up to 9 channels supported). The HRTFs are stored in SOFA files (see <\fBhttp://www.sofacoustics.org/\fR> for a database). SOFAlizer is developed at the Acoustics Research Institute (ARI) of the Austrian Academy of Sciences. .PP To enable compilation of this filter you need to configure FFmpeg with \&\f(CW\*(C`\-\-enable\-libmysofa\*(C'\fR. .PP The filter accepts the following options: .IP \fBsofa\fR 4 .IX Item "sofa" Set the SOFA file used for rendering. .IP \fBgain\fR 4 .IX Item "gain" Set gain applied to audio. Value is in dB. Default is 0. .IP \fBrotation\fR 4 .IX Item "rotation" Set rotation of virtual loudspeakers in deg. Default is 0. .IP \fBelevation\fR 4 .IX Item "elevation" Set elevation of virtual speakers in deg. Default is 0. .IP \fBradius\fR 4 .IX Item "radius" Set distance in meters between loudspeakers and the listener with near-field HRTFs. Default is 1. .IP \fBtype\fR 4 .IX Item "type" Set processing type. Can be \fItime\fR or \fIfreq\fR. \fItime\fR is processing audio in time domain which is slow. \&\fIfreq\fR is processing audio in frequency domain which is fast. Default is \fIfreq\fR. .IP \fBspeakers\fR 4 .IX Item "speakers" Set custom positions of virtual loudspeakers. Syntax for this option is: [| |...]. Each virtual loudspeaker is described with short channel name following with azimuth and elevation in degrees. Each virtual loudspeaker description is separated by '|'. For example to override front left and front right channel positions use: \&'speakers=FL 45 15|FR 345 15'. Descriptions with unrecognised channel names are ignored. .IP \fBlfegain\fR 4 .IX Item "lfegain" Set custom gain for LFE channels. Value is in dB. Default is 0. .IP \fBframesize\fR 4 .IX Item "framesize" Set custom frame size in number of samples. Default is 1024. Allowed range is from 1024 to 96000. Only used if option \fBtype\fR is set to \fIfreq\fR. .IP \fBnormalize\fR 4 .IX Item "normalize" Should all IRs be normalized upon importing SOFA file. By default is enabled. .IP \fBinterpolate\fR 4 .IX Item "interpolate" Should nearest IRs be interpolated with neighbor IRs if exact position does not match. By default is disabled. .IP \fBminphase\fR 4 .IX Item "minphase" Minphase all IRs upon loading of SOFA file. By default is disabled. .IP \fBanglestep\fR 4 .IX Item "anglestep" Set neighbor search angle step. Only used if option \fIinterpolate\fR is enabled. .IP \fBradstep\fR 4 .IX Item "radstep" Set neighbor search radius step. Only used if option \fIinterpolate\fR is enabled. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Using ClubFritz6 sofa file: .Sp .Vb 1 \& sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1 .Ve .IP \(bu 4 Using ClubFritz12 sofa file and bigger radius with small rotation: .Sp .Vb 1 \& sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5 .Ve .IP \(bu 4 Similar as above but with custom speaker positions for front left, front right, back left and back right and also with custom gain: .Sp .Vb 1 \& "sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=2:speakers=FL 45|FR 315|BL 135|BR 225:gain=28" .Ve .SS speechnorm .IX Subsection "speechnorm" Speech Normalizer. .PP This filter expands or compresses each half-cycle of audio samples (local set of samples all above or all below zero and between two nearest zero crossings) depending on threshold value, so audio reaches target peak value under conditions controlled by below options. .PP The filter accepts the following options: .IP "\fBpeak, p\fR" 4 .IX Item "peak, p" Set the expansion target peak value. This specifies the highest allowed absolute amplitude level for the normalized audio input. Default value is 0.95. Allowed range is from 0.0 to 1.0. .IP "\fBexpansion, e\fR" 4 .IX Item "expansion, e" Set the maximum expansion factor. Allowed range is from 1.0 to 50.0. Default value is 2.0. This option controls maximum local half-cycle of samples expansion. The maximum expansion would be such that local peak value reaches target peak value but never to surpass it and that ratio between new and previous peak value does not surpass this option value. .IP "\fBcompression, c\fR" 4 .IX Item "compression, c" Set the maximum compression factor. Allowed range is from 1.0 to 50.0. Default value is 2.0. This option controls maximum local half-cycle of samples compression. This option is used only if \fBthreshold\fR option is set to value greater than 0.0, then in such cases when local peak is lower or same as value set by \fBthreshold\fR all samples belonging to that peak's half-cycle will be compressed by current compression factor. .IP "\fBthreshold, t\fR" 4 .IX Item "threshold, t" Set the threshold value. Default value is 0.0. Allowed range is from 0.0 to 1.0. This option specifies which half-cycles of samples will be compressed and which will be expanded. Any half-cycle samples with their local peak value below or same as this option value will be compressed by current compression factor, otherwise, if greater than threshold value they will be expanded with expansion factor so that it could reach peak target value but never surpass it. .IP "\fBraise, r\fR" 4 .IX Item "raise, r" Set the expansion raising amount per each half-cycle of samples. Default value is 0.001. Allowed range is from 0.0 to 1.0. This controls how fast expansion factor is raised per each new half-cycle until it reaches \fBexpansion\fR value. Setting this options too high may lead to distortions. .IP "\fBfall, f\fR" 4 .IX Item "fall, f" Set the compression raising amount per each half-cycle of samples. Default value is 0.001. Allowed range is from 0.0 to 1.0. This controls how fast compression factor is raised per each new half-cycle until it reaches \fBcompression\fR value. .IP "\fBchannels, h\fR" 4 .IX Item "channels, h" Specify which channels to filter, by default all available channels are filtered. .IP "\fBinvert, i\fR" 4 .IX Item "invert, i" Enable inverted filtering, by default is disabled. This inverts interpretation of \fBthreshold\fR option. When enabled any half-cycle of samples with their local peak value below or same as \&\fBthreshold\fR option will be expanded otherwise it will be compressed. .IP "\fBlink, l\fR" 4 .IX Item "link, l" Link channels when calculating gain applied to each filtered channel sample, by default is disabled. When disabled each filtered channel gain calculation is independent, otherwise when this option is enabled the minimum of all possible gains for each filtered channel is used. .IP "\fBrms, m\fR" 4 .IX Item "rms, m" Set the expansion target RMS value. This specifies the highest allowed RMS level for the normalized audio input. Default value is 0.0, thus disabled. Allowed range is from 0.0 to 1.0. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Weak and slow amplification: .Sp .Vb 1 \& speechnorm=e=3:r=0.00001:l=1 .Ve .IP \(bu 4 Moderate and slow amplification: .Sp .Vb 1 \& speechnorm=e=6.25:r=0.00001:l=1 .Ve .IP \(bu 4 Strong and fast amplification: .Sp .Vb 1 \& speechnorm=e=12.5:r=0.0001:l=1 .Ve .IP \(bu 4 Very strong and fast amplification: .Sp .Vb 1 \& speechnorm=e=25:r=0.0001:l=1 .Ve .IP \(bu 4 Extreme and fast amplification: .Sp .Vb 1 \& speechnorm=e=50:r=0.0001:l=1 .Ve .SS stereotools .IX Subsection "stereotools" This filter has some handy utilities to manage stereo signals, for converting M/S stereo recordings to L/R signal while having control over the parameters or spreading the stereo image of master track. .PP The filter accepts the following options: .IP \fBlevel_in\fR 4 .IX Item "level_in" Set input level before filtering for both channels. Defaults is 1. Allowed range is from 0.015625 to 64. .IP \fBlevel_out\fR 4 .IX Item "level_out" Set output level after filtering for both channels. Defaults is 1. Allowed range is from 0.015625 to 64. .IP \fBbalance_in\fR 4 .IX Item "balance_in" Set input balance between both channels. Default is 0. Allowed range is from \-1 to 1. .IP \fBbalance_out\fR 4 .IX Item "balance_out" Set output balance between both channels. Default is 0. Allowed range is from \-1 to 1. .IP \fBsoftclip\fR 4 .IX Item "softclip" Enable softclipping. Results in analog distortion instead of harsh digital 0dB clipping. Disabled by default. .IP \fBmutel\fR 4 .IX Item "mutel" Mute the left channel. Disabled by default. .IP \fBmuter\fR 4 .IX Item "muter" Mute the right channel. Disabled by default. .IP \fBphasel\fR 4 .IX Item "phasel" Change the phase of the left channel. Disabled by default. .IP \fBphaser\fR 4 .IX Item "phaser" Change the phase of the right channel. Disabled by default. .IP \fBmode\fR 4 .IX Item "mode" Set stereo mode. Available values are: .RS 4 .IP \fBlr>lr\fR 4 .IX Item "lr>lr" Left/Right to Left/Right, this is default. .IP \fBlr>ms\fR 4 .IX Item "lr>ms" Left/Right to Mid/Side. .IP \fBms>lr\fR 4 .IX Item "ms>lr" Mid/Side to Left/Right. .IP \fBlr>ll\fR 4 .IX Item "lr>ll" Left/Right to Left/Left. .IP \fBlr>rr\fR 4 .IX Item "lr>rr" Left/Right to Right/Right. .IP \fBlr>l+r\fR 4 .IX Item "lr>l+r" Left/Right to Left + Right. .IP \fBlr>rl\fR 4 .IX Item "lr>rl" Left/Right to Right/Left. .IP \fBms>ll\fR 4 .IX Item "ms>ll" Mid/Side to Left/Left. .IP \fBms>rr\fR 4 .IX Item "ms>rr" Mid/Side to Right/Right. .IP \fBms>rl\fR 4 .IX Item "ms>rl" Mid/Side to Right/Left. .IP \fBlr>l\-r\fR 4 .IX Item "lr>l-r" Left/Right to Left \- Right. .RE .RS 4 .RE .IP \fBslev\fR 4 .IX Item "slev" Set level of side signal. Default is 1. Allowed range is from 0.015625 to 64. .IP \fBsbal\fR 4 .IX Item "sbal" Set balance of side signal. Default is 0. Allowed range is from \-1 to 1. .IP \fBmlev\fR 4 .IX Item "mlev" Set level of the middle signal. Default is 1. Allowed range is from 0.015625 to 64. .IP \fBmpan\fR 4 .IX Item "mpan" Set middle signal pan. Default is 0. Allowed range is from \-1 to 1. .IP \fBbase\fR 4 .IX Item "base" Set stereo base between mono and inversed channels. Default is 0. Allowed range is from \-1 to 1. .IP \fBdelay\fR 4 .IX Item "delay" Set delay in milliseconds how much to delay left from right channel and vice versa. Default is 0. Allowed range is from \-20 to 20. .IP \fBsclevel\fR 4 .IX Item "sclevel" Set S/C level. Default is 1. Allowed range is from 1 to 100. .IP \fBphase\fR 4 .IX Item "phase" Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360. .IP "\fBbmode_in, bmode_out\fR" 4 .IX Item "bmode_in, bmode_out" Set balance mode for balance_in/balance_out option. .Sp Can be one of the following: .RS 4 .IP \fBbalance\fR 4 .IX Item "balance" Classic balance mode. Attenuate one channel at time. Gain is raised up to 1. .IP \fBamplitude\fR 4 .IX Item "amplitude" Similar as classic mode above but gain is raised up to 2. .IP \fBpower\fR 4 .IX Item "power" Equal power distribution, from \-6dB to +6dB range. .RE .RS 4 .RE .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Apply karaoke like effect: .Sp .Vb 1 \& stereotools=mlev=0.015625 .Ve .IP \(bu 4 Convert M/S signal to L/R: .Sp .Vb 1 \& "stereotools=mode=ms>lr" .Ve .SS stereowiden .IX Subsection "stereowiden" This filter enhance the stereo effect by suppressing signal common to both channels and by delaying the signal of left into right and vice versa, thereby widening the stereo effect. .PP The filter accepts the following options: .IP \fBdelay\fR 4 .IX Item "delay" Time in milliseconds of the delay of left signal into right and vice versa. Default is 20 milliseconds. .IP \fBfeedback\fR 4 .IX Item "feedback" Amount of gain in delayed signal into right and vice versa. Gives a delay effect of left signal in right output and vice versa which gives widening effect. Default is 0.3. .IP \fBcrossfeed\fR 4 .IX Item "crossfeed" Cross feed of left into right with inverted phase. This helps in suppressing the mono. If the value is 1 it will cancel all the signal common to both channels. Default is 0.3. .IP \fBdrymix\fR 4 .IX Item "drymix" Set level of input signal of original channel. Default is 0.8. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options except \f(CW\*(C`delay\*(C'\fR as \fBcommands\fR. .SS superequalizer .IX Subsection "superequalizer" Apply 18 band equalizer. .PP The filter accepts the following options: .IP \fB1b\fR 4 .IX Item "1b" Set 65Hz band gain. .IP \fB2b\fR 4 .IX Item "2b" Set 92Hz band gain. .IP \fB3b\fR 4 .IX Item "3b" Set 131Hz band gain. .IP \fB4b\fR 4 .IX Item "4b" Set 185Hz band gain. .IP \fB5b\fR 4 .IX Item "5b" Set 262Hz band gain. .IP \fB6b\fR 4 .IX Item "6b" Set 370Hz band gain. .IP \fB7b\fR 4 .IX Item "7b" Set 523Hz band gain. .IP \fB8b\fR 4 .IX Item "8b" Set 740Hz band gain. .IP \fB9b\fR 4 .IX Item "9b" Set 1047Hz band gain. .IP \fB10b\fR 4 .IX Item "10b" Set 1480Hz band gain. .IP \fB11b\fR 4 .IX Item "11b" Set 2093Hz band gain. .IP \fB12b\fR 4 .IX Item "12b" Set 2960Hz band gain. .IP \fB13b\fR 4 .IX Item "13b" Set 4186Hz band gain. .IP \fB14b\fR 4 .IX Item "14b" Set 5920Hz band gain. .IP \fB15b\fR 4 .IX Item "15b" Set 8372Hz band gain. .IP \fB16b\fR 4 .IX Item "16b" Set 11840Hz band gain. .IP \fB17b\fR 4 .IX Item "17b" Set 16744Hz band gain. .IP \fB18b\fR 4 .IX Item "18b" Set 20000Hz band gain. .SS surround .IX Subsection "surround" Apply audio surround upmix filter. .PP This filter allows to produce multichannel output from audio stream. .PP The filter accepts the following options: .IP \fBchl_out\fR 4 .IX Item "chl_out" Set output channel layout. By default, this is \fI5.1\fR. .Sp See \fBthe Channel Layout section in the ffmpeg\-utils\|(1) manual\fR for the required syntax. .IP \fBchl_in\fR 4 .IX Item "chl_in" Set input channel layout. By default, this is \fIstereo\fR. .Sp See \fBthe Channel Layout section in the ffmpeg\-utils\|(1) manual\fR for the required syntax. .IP \fBlevel_in\fR 4 .IX Item "level_in" Set input volume level. By default, this is \fI1\fR. .IP \fBlevel_out\fR 4 .IX Item "level_out" Set output volume level. By default, this is \fI1\fR. .IP \fBlfe\fR 4 .IX Item "lfe" Enable LFE channel output if output channel layout has it. By default, this is enabled. .IP \fBlfe_low\fR 4 .IX Item "lfe_low" Set LFE low cut off frequency. By default, this is \fI128\fR Hz. .IP \fBlfe_high\fR 4 .IX Item "lfe_high" Set LFE high cut off frequency. By default, this is \fI256\fR Hz. .IP \fBlfe_mode\fR 4 .IX Item "lfe_mode" Set LFE mode, can be \fIadd\fR or \fIsub\fR. Default is \fIadd\fR. In \fIadd\fR mode, LFE channel is created from input audio and added to output. In \fIsub\fR mode, LFE channel is created from input audio and added to output but also all non-LFE output channels are subtracted with output LFE channel. .IP \fBsmooth\fR 4 .IX Item "smooth" Set temporal smoothness strength, used to gradually change factors when transforming stereo sound in time. Allowed range is from \fI0.0\fR to \fI1.0\fR. Useful to improve output quality with \fIfocus\fR option values greater than \fI0.0\fR. Default is \fI0.0\fR. Only values inside this range and without edges are effective. .IP \fBangle\fR 4 .IX Item "angle" Set angle of stereo surround transform, Allowed range is from \fI0\fR to \fI360\fR. Default is \fI90\fR. .IP \fBfocus\fR 4 .IX Item "focus" Set focus of stereo surround transform, Allowed range is from \fI\-1\fR to \fI1\fR. Default is \fI0\fR. .IP \fBfc_in\fR 4 .IX Item "fc_in" Set front center input volume. By default, this is \fI1\fR. .IP \fBfc_out\fR 4 .IX Item "fc_out" Set front center output volume. By default, this is \fI1\fR. .IP \fBfl_in\fR 4 .IX Item "fl_in" Set front left input volume. By default, this is \fI1\fR. .IP \fBfl_out\fR 4 .IX Item "fl_out" Set front left output volume. By default, this is \fI1\fR. .IP \fBfr_in\fR 4 .IX Item "fr_in" Set front right input volume. By default, this is \fI1\fR. .IP \fBfr_out\fR 4 .IX Item "fr_out" Set front right output volume. By default, this is \fI1\fR. .IP \fBsl_in\fR 4 .IX Item "sl_in" Set side left input volume. By default, this is \fI1\fR. .IP \fBsl_out\fR 4 .IX Item "sl_out" Set side left output volume. By default, this is \fI1\fR. .IP \fBsr_in\fR 4 .IX Item "sr_in" Set side right input volume. By default, this is \fI1\fR. .IP \fBsr_out\fR 4 .IX Item "sr_out" Set side right output volume. By default, this is \fI1\fR. .IP \fBbl_in\fR 4 .IX Item "bl_in" Set back left input volume. By default, this is \fI1\fR. .IP \fBbl_out\fR 4 .IX Item "bl_out" Set back left output volume. By default, this is \fI1\fR. .IP \fBbr_in\fR 4 .IX Item "br_in" Set back right input volume. By default, this is \fI1\fR. .IP \fBbr_out\fR 4 .IX Item "br_out" Set back right output volume. By default, this is \fI1\fR. .IP \fBbc_in\fR 4 .IX Item "bc_in" Set back center input volume. By default, this is \fI1\fR. .IP \fBbc_out\fR 4 .IX Item "bc_out" Set back center output volume. By default, this is \fI1\fR. .IP \fBlfe_in\fR 4 .IX Item "lfe_in" Set LFE input volume. By default, this is \fI1\fR. .IP \fBlfe_out\fR 4 .IX Item "lfe_out" Set LFE output volume. By default, this is \fI1\fR. .IP \fBallx\fR 4 .IX Item "allx" Set spread usage of stereo image across X axis for all channels. Allowed range is from \fI\-1\fR to \fI15\fR. By default this value is negative \fI\-1\fR, and thus unused. .IP \fBally\fR 4 .IX Item "ally" Set spread usage of stereo image across Y axis for all channels. Allowed range is from \fI\-1\fR to \fI15\fR. By default this value is negative \fI\-1\fR, and thus unused. .IP "\fBfcx, flx, frx, blx, brx, slx, srx, bcx\fR" 4 .IX Item "fcx, flx, frx, blx, brx, slx, srx, bcx" Set spread usage of stereo image across X axis for each channel. Allowed range is from \fI0.06\fR to \fI15\fR. By default this value is \fI0.5\fR. .IP "\fBfcy, fly, fry, bly, bry, sly, sry, bcy\fR" 4 .IX Item "fcy, fly, fry, bly, bry, sly, sry, bcy" Set spread usage of stereo image across Y axis for each channel. Allowed range is from \fI0.06\fR to \fI15\fR. By default this value is \fI0.5\fR. .IP \fBwin_size\fR 4 .IX Item "win_size" Set window size. Allowed range is from \fI1024\fR to \fI65536\fR. Default size is \fI4096\fR. .IP \fBwin_func\fR 4 .IX Item "win_func" Set window function. .Sp It accepts the following values: .RS 4 .IP \fBrect\fR 4 .IX Item "rect" .PD 0 .IP \fBbartlett\fR 4 .IX Item "bartlett" .IP "\fBhann, hanning\fR" 4 .IX Item "hann, hanning" .IP \fBhamming\fR 4 .IX Item "hamming" .IP \fBblackman\fR 4 .IX Item "blackman" .IP \fBwelch\fR 4 .IX Item "welch" .IP \fBflattop\fR 4 .IX Item "flattop" .IP \fBbharris\fR 4 .IX Item "bharris" .IP \fBbnuttall\fR 4 .IX Item "bnuttall" .IP \fBbhann\fR 4 .IX Item "bhann" .IP \fBsine\fR 4 .IX Item "sine" .IP \fBnuttall\fR 4 .IX Item "nuttall" .IP \fBlanczos\fR 4 .IX Item "lanczos" .IP \fBgauss\fR 4 .IX Item "gauss" .IP \fBtukey\fR 4 .IX Item "tukey" .IP \fBdolph\fR 4 .IX Item "dolph" .IP \fBcauchy\fR 4 .IX Item "cauchy" .IP \fBparzen\fR 4 .IX Item "parzen" .IP \fBpoisson\fR 4 .IX Item "poisson" .IP \fBbohman\fR 4 .IX Item "bohman" .IP \fBkaiser\fR 4 .IX Item "kaiser" .RE .RS 4 .PD .Sp Default is \f(CW\*(C`hann\*(C'\fR. .RE .IP \fBoverlap\fR 4 .IX Item "overlap" Set window overlap. If set to 1, the recommended overlap for selected window function will be picked. Default is \f(CW0.5\fR. .SS tiltshelf .IX Subsection "tiltshelf" Boost or cut the lower frequencies and cut or boost higher 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). .PP The filter accepts the following options: .IP "\fBgain, g\fR" 4 .IX Item "gain, g" 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. .IP "\fBfrequency, f\fR" 4 .IX Item "frequency, f" 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 \f(CW3000\fR Hz. .IP "\fBwidth_type, t\fR" 4 .IX Item "width_type, t" Set method to specify band-width of filter. .RS 4 .IP \fBh\fR 4 .IX Item "h" Hz .IP \fBq\fR 4 .IX Item "q" Q\-Factor .IP \fBo\fR 4 .IX Item "o" octave .IP \fBs\fR 4 .IX Item "s" slope .IP \fBk\fR 4 .IX Item "k" kHz .RE .RS 4 .RE .IP "\fBwidth, w\fR" 4 .IX Item "width, w" Determine how steep is the filter's shelf transition. .IP "\fBpoles, p\fR" 4 .IX Item "poles, p" Set number of poles. Default is 2. .IP "\fBmix, m\fR" 4 .IX Item "mix, m" How much to use filtered signal in output. Default is 1. Range is between 0 and 1. .IP "\fBchannels, c\fR" 4 .IX Item "channels, c" Specify which channels to filter, by default all available are filtered. .IP "\fBnormalize, n\fR" 4 .IX Item "normalize, n" Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. .IP "\fBtransform, a\fR" 4 .IX Item "transform, a" Set transform type of IIR filter. .RS 4 .IP \fBdi\fR 4 .IX Item "di" .PD 0 .IP \fBdii\fR 4 .IX Item "dii" .IP \fBtdi\fR 4 .IX Item "tdi" .IP \fBtdii\fR 4 .IX Item "tdii" .IP \fBlatt\fR 4 .IX Item "latt" .IP \fBsvf\fR 4 .IX Item "svf" .IP \fBzdf\fR 4 .IX Item "zdf" .RE .RS 4 .RE .IP "\fBprecision, r\fR" 4 .IX Item "precision, r" .PD Set precision of filtering. .RS 4 .IP \fBauto\fR 4 .IX Item "auto" Pick automatic sample format depending on surround filters. .IP \fBs16\fR 4 .IX Item "s16" Always use signed 16\-bit. .IP \fBs32\fR 4 .IX Item "s32" Always use signed 32\-bit. .IP \fBf32\fR 4 .IX Item "f32" Always use float 32\-bit. .IP \fBf64\fR 4 .IX Item "f64" Always use float 64\-bit. .RE .RS 4 .RE .IP "\fBblock_size, b\fR" 4 .IX Item "block_size, 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. .Sp Note that filter delay will be exactly this many samples when set to non-zero value. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports some options as \fBcommands\fR. .SS "treble, highshelf" .IX Subsection "treble, highshelf" Boost or cut treble (upper) 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). .PP The filter accepts the following options: .IP "\fBgain, g\fR" 4 .IX Item "gain, g" Give the gain at whichever is the lower of ~22 kHz and the Nyquist frequency. Its useful range is about \-20 (for a large cut) to +20 (for a large boost). Beware of clipping when using a positive gain. .IP "\fBfrequency, f\fR" 4 .IX Item "frequency, f" 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 \f(CW3000\fR Hz. .IP "\fBwidth_type, t\fR" 4 .IX Item "width_type, t" Set method to specify band-width of filter. .RS 4 .IP \fBh\fR 4 .IX Item "h" Hz .IP \fBq\fR 4 .IX Item "q" Q\-Factor .IP \fBo\fR 4 .IX Item "o" octave .IP \fBs\fR 4 .IX Item "s" slope .IP \fBk\fR 4 .IX Item "k" kHz .RE .RS 4 .RE .IP "\fBwidth, w\fR" 4 .IX Item "width, w" Determine how steep is the filter's shelf transition. .IP "\fBpoles, p\fR" 4 .IX Item "poles, p" Set number of poles. Default is 2. .IP "\fBmix, m\fR" 4 .IX Item "mix, m" How much to use filtered signal in output. Default is 1. Range is between 0 and 1. .IP "\fBchannels, c\fR" 4 .IX Item "channels, c" Specify which channels to filter, by default all available are filtered. .IP "\fBnormalize, n\fR" 4 .IX Item "normalize, n" Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. .IP "\fBtransform, a\fR" 4 .IX Item "transform, a" Set transform type of IIR filter. .RS 4 .IP \fBdi\fR 4 .IX Item "di" .PD 0 .IP \fBdii\fR 4 .IX Item "dii" .IP \fBtdi\fR 4 .IX Item "tdi" .IP \fBtdii\fR 4 .IX Item "tdii" .IP \fBlatt\fR 4 .IX Item "latt" .IP \fBsvf\fR 4 .IX Item "svf" .IP \fBzdf\fR 4 .IX Item "zdf" .RE .RS 4 .RE .IP "\fBprecision, r\fR" 4 .IX Item "precision, r" .PD Set precision of filtering. .RS 4 .IP \fBauto\fR 4 .IX Item "auto" Pick automatic sample format depending on surround filters. .IP \fBs16\fR 4 .IX Item "s16" Always use signed 16\-bit. .IP \fBs32\fR 4 .IX Item "s32" Always use signed 32\-bit. .IP \fBf32\fR 4 .IX Item "f32" Always use float 32\-bit. .IP \fBf64\fR 4 .IX Item "f64" Always use float 64\-bit. .RE .RS 4 .RE .IP "\fBblock_size, b\fR" 4 .IX Item "block_size, 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. .Sp Note that filter delay will be exactly this many samples when set to non-zero value. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the following commands: .IP "\fBfrequency, f\fR" 4 .IX Item "frequency, f" Change treble frequency. Syntax for the command is : "\fIfrequency\fR" .IP "\fBwidth_type, t\fR" 4 .IX Item "width_type, t" Change treble width_type. Syntax for the command is : "\fIwidth_type\fR" .IP "\fBwidth, w\fR" 4 .IX Item "width, w" Change treble width. Syntax for the command is : "\fIwidth\fR" .IP "\fBgain, g\fR" 4 .IX Item "gain, g" Change treble gain. Syntax for the command is : "\fIgain\fR" .IP "\fBmix, m\fR" 4 .IX Item "mix, m" Change treble mix. Syntax for the command is : "\fImix\fR" .SS tremolo .IX Subsection "tremolo" Sinusoidal amplitude modulation. .PP The filter accepts the following options: .IP \fBf\fR 4 .IX Item "f" Modulation frequency in Hertz. Modulation frequencies in the subharmonic range (20 Hz or lower) will result in a tremolo effect. This filter may also be used as a ring modulator by specifying a modulation frequency higher than 20 Hz. Range is 0.1 \- 20000.0. Default value is 5.0 Hz. .IP \fBd\fR 4 .IX Item "d" Depth of modulation as a percentage. Range is 0.0 \- 1.0. Default value is 0.5. .SS vibrato .IX Subsection "vibrato" Sinusoidal phase modulation. .PP The filter accepts the following options: .IP \fBf\fR 4 .IX Item "f" Modulation frequency in Hertz. Range is 0.1 \- 20000.0. Default value is 5.0 Hz. .IP \fBd\fR 4 .IX Item "d" Depth of modulation as a percentage. Range is 0.0 \- 1.0. Default value is 0.5. .SS virtualbass .IX Subsection "virtualbass" Apply audio Virtual Bass filter. .PP This filter accepts stereo input and produce stereo with LFE (2.1) channels output. The newly produced LFE channel have enhanced virtual bass originally obtained from both stereo channels. This filter outputs front left and front right channels unchanged as available in stereo input. .PP The filter accepts the following options: .IP \fBcutoff\fR 4 .IX Item "cutoff" Set the virtual bass cutoff frequency. Default value is 250 Hz. Allowed range is from 100 to 500 Hz. .IP \fBstrength\fR 4 .IX Item "strength" Set the virtual bass strength. Allowed range is from 0.5 to 3. Default value is 3. .SS volume .IX Subsection "volume" Adjust the input audio volume. .PP It accepts the following parameters: .IP \fBvolume\fR 4 .IX Item "volume" Set audio volume expression. .Sp Output values are clipped to the maximum value. .Sp The output audio volume is given by the relation: .Sp .Vb 1 \& = * .Ve .Sp The default value for \fIvolume\fR is "1.0". .IP \fBprecision\fR 4 .IX Item "precision" This parameter represents the mathematical precision. .Sp It determines which input sample formats will be allowed, which affects the precision of the volume scaling. .RS 4 .IP \fBfixed\fR 4 .IX Item "fixed" 8\-bit fixed-point; this limits input sample format to U8, S16, and S32. .IP \fBfloat\fR 4 .IX Item "float" 32\-bit floating-point; this limits input sample format to FLT. (default) .IP \fBdouble\fR 4 .IX Item "double" 64\-bit floating-point; this limits input sample format to DBL. .RE .RS 4 .RE .IP \fBreplaygain\fR 4 .IX Item "replaygain" Choose the behaviour on encountering ReplayGain side data in input frames. .RS 4 .IP \fBdrop\fR 4 .IX Item "drop" Remove ReplayGain side data, ignoring its contents (the default). .IP \fBignore\fR 4 .IX Item "ignore" Ignore ReplayGain side data, but leave it in the frame. .IP \fBtrack\fR 4 .IX Item "track" Prefer the track gain, if present. .IP \fBalbum\fR 4 .IX Item "album" Prefer the album gain, if present. .RE .RS 4 .RE .IP \fBreplaygain_preamp\fR 4 .IX Item "replaygain_preamp" Pre-amplification gain in dB to apply to the selected replaygain gain. .Sp Default value for \fIreplaygain_preamp\fR is 0.0. .IP \fBreplaygain_noclip\fR 4 .IX Item "replaygain_noclip" Prevent clipping by limiting the gain applied. .Sp Default value for \fIreplaygain_noclip\fR is 1. .IP \fBeval\fR 4 .IX Item "eval" Set when the volume expression is evaluated. .Sp It accepts the following values: .RS 4 .IP \fBonce\fR 4 .IX Item "once" only evaluate expression once during the filter initialization, or when the \fBvolume\fR command is sent .IP \fBframe\fR 4 .IX Item "frame" evaluate expression for each incoming frame .RE .RS 4 .Sp Default value is \fBonce\fR. .RE .PP The volume expression can contain the following parameters. .IP \fBn\fR 4 .IX Item "n" frame number (starting at zero) .IP \fBnb_channels\fR 4 .IX Item "nb_channels" number of channels .IP \fBnb_consumed_samples\fR 4 .IX Item "nb_consumed_samples" number of samples consumed by the filter .IP \fBnb_samples\fR 4 .IX Item "nb_samples" number of samples in the current frame .IP \fBpos\fR 4 .IX Item "pos" original frame position in the file; deprecated, do not use .IP \fBpts\fR 4 .IX Item "pts" frame PTS .IP \fBsample_rate\fR 4 .IX Item "sample_rate" sample rate .IP \fBstartpts\fR 4 .IX Item "startpts" PTS at start of stream .IP \fBstartt\fR 4 .IX Item "startt" time at start of stream .IP \fBt\fR 4 .IX Item "t" frame time .IP \fBtb\fR 4 .IX Item "tb" timestamp timebase .IP \fBvolume\fR 4 .IX Item "volume" last set volume value .PP Note that when \fBeval\fR is set to \fBonce\fR only the \&\fIsample_rate\fR and \fItb\fR variables are available, all other variables will evaluate to NAN. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the following commands: .IP \fBvolume\fR 4 .IX Item "volume" Modify the volume expression. The command accepts the same syntax of the corresponding option. .Sp If the specified expression is not valid, it is kept at its current value. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Halve the input audio volume: .Sp .Vb 3 \& volume=volume=0.5 \& volume=volume=1/2 \& volume=volume=\-6.0206dB .Ve .Sp In all the above example the named key for \fBvolume\fR can be omitted, for example like in: .Sp .Vb 1 \& volume=0.5 .Ve .IP \(bu 4 Increase input audio power by 6 decibels using fixed-point precision: .Sp .Vb 1 \& volume=volume=6dB:precision=fixed .Ve .IP \(bu 4 Fade volume after time 10 with an annihilation period of 5 seconds: .Sp .Vb 1 \& volume=\*(Aqif(lt(t,10),1,max(1\-(t\-10)/5,0))\*(Aq:eval=frame .Ve .SS volumedetect .IX Subsection "volumedetect" Detect the volume of the input video. .PP The filter has no parameters. It supports only 16\-bit signed integer samples, so the input will be converted when needed. Statistics about the volume will be printed in the log when the input stream end is reached. .PP In particular it will show the mean volume (root mean square), maximum volume (on a per-sample basis), and the beginning of a histogram of the registered volume values (from the maximum value to a cumulated 1/1000 of the samples). .PP All volumes are in decibels relative to the maximum PCM value. .PP \fIExamples\fR .IX Subsection "Examples" .PP Here is an excerpt of the output: .PP .Vb 9 \& [Parsed_volumedetect_0 0xa23120] mean_volume: \-27 dB \& [Parsed_volumedetect_0 0xa23120] max_volume: \-4 dB \& [Parsed_volumedetect_0 0xa23120] histogram_4db: 6 \& [Parsed_volumedetect_0 0xa23120] histogram_5db: 62 \& [Parsed_volumedetect_0 0xa23120] histogram_6db: 286 \& [Parsed_volumedetect_0 0xa23120] histogram_7db: 1042 \& [Parsed_volumedetect_0 0xa23120] histogram_8db: 2551 \& [Parsed_volumedetect_0 0xa23120] histogram_9db: 4609 \& [Parsed_volumedetect_0 0xa23120] histogram_10db: 8409 .Ve .PP It means that: .IP \(bu 4 The mean square energy is approximately \-27 dB, or 10^\-2.7. .IP \(bu 4 The largest sample is at \-4 dB, or more precisely between \-4 dB and \-5 dB. .IP \(bu 4 There are 6 samples at \-4 dB, 62 at \-5 dB, 286 at \-6 dB, etc. .PP In other words, raising the volume by +4 dB does not cause any clipping, raising it by +5 dB causes clipping for 6 samples, etc. .SH "AUDIO SOURCES" .IX Header "AUDIO SOURCES" Below is a description of the currently available audio sources. .SS abuffer .IX Subsection "abuffer" Buffer audio frames, and make them available to the filter chain. .PP This source is mainly intended for a programmatic use, in particular through the interface defined in \fIlibavfilter/buffersrc.h\fR. .PP It accepts the following parameters: .IP \fBtime_base\fR 4 .IX Item "time_base" The timebase which will be used for timestamps of submitted frames. It must be either a floating-point number or in \fInumerator\fR/\fIdenominator\fR form. .IP \fBsample_rate\fR 4 .IX Item "sample_rate" The sample rate of the incoming audio buffers. .IP \fBsample_fmt\fR 4 .IX Item "sample_fmt" The sample format of the incoming audio buffers. Either a sample format name or its corresponding integer representation from the enum AVSampleFormat in \fIlibavutil/samplefmt.h\fR .IP \fBchannel_layout\fR 4 .IX Item "channel_layout" The channel layout of the incoming audio buffers. Either a channel layout name from channel_layout_map in \&\fIlibavutil/channel_layout.c\fR or its corresponding integer representation from the AV_CH_LAYOUT_* macros in \fIlibavutil/channel_layout.h\fR .IP \fBchannels\fR 4 .IX Item "channels" The number of channels of the incoming audio buffers. If both \fIchannels\fR and \fIchannel_layout\fR are specified, then they must be consistent. .PP \fIExamples\fR .IX Subsection "Examples" .PP .Vb 1 \& abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo .Ve .PP will instruct the source to accept planar 16bit signed stereo at 44100Hz. Since the sample format with name "s16p" corresponds to the number 6 and the "stereo" channel layout corresponds to the value 0x3, this is equivalent to: .PP .Vb 1 \& abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3 .Ve .SS aevalsrc .IX Subsection "aevalsrc" Generate an audio signal specified by an expression. .PP This source accepts in input one or more expressions (one for each channel), which are evaluated and used to generate a corresponding audio signal. .PP This source accepts the following options: .IP \fBexprs\fR 4 .IX Item "exprs" Set the '|'\-separated expressions list for each separate channel. In case the \&\fBchannel_layout\fR option is not specified, the selected channel layout depends on the number of provided expressions. Otherwise the last specified expression is applied to the remaining output channels. .IP "\fBchannel_layout, c\fR" 4 .IX Item "channel_layout, c" Set the channel layout. The number of channels in the specified layout must be equal to the number of specified expressions. .IP "\fBduration, d\fR" 4 .IX Item "duration, d" Set the minimum duration of the sourced audio. See \&\fBthe Time duration section in the ffmpeg\-utils\|(1) manual\fR for the accepted syntax. Note that the resulting duration may be greater than the specified duration, as the generated audio is always cut at the end of a complete frame. .Sp If not specified, or the expressed duration is negative, the audio is supposed to be generated forever. .IP "\fBnb_samples, n\fR" 4 .IX Item "nb_samples, n" Set the number of samples per channel per each output frame, default to 1024. .IP "\fBsample_rate, s\fR" 4 .IX Item "sample_rate, s" Specify the sample rate, default to 44100. .PP Each expression in \fIexprs\fR can contain the following constants: .IP \fBn\fR 4 .IX Item "n" number of the evaluated sample, starting from 0 .IP \fBt\fR 4 .IX Item "t" time of the evaluated sample expressed in seconds, starting from 0 .IP \fBs\fR 4 .IX Item "s" sample rate .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Generate silence: .Sp .Vb 1 \& aevalsrc=0 .Ve .IP \(bu 4 Generate a sin signal with frequency of 440 Hz, set sample rate to 8000 Hz: .Sp .Vb 1 \& aevalsrc="sin(440*2*PI*t):s=8000" .Ve .IP \(bu 4 Generate a two channels signal, specify the channel layout (Front Center + Back Center) explicitly: .Sp .Vb 1 \& aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC" .Ve .IP \(bu 4 Generate white noise: .Sp .Vb 1 \& aevalsrc="\-2+random(0)" .Ve .IP \(bu 4 Generate an amplitude modulated signal: .Sp .Vb 1 \& aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)" .Ve .IP \(bu 4 Generate 2.5 Hz binaural beats on a 360 Hz carrier: .Sp .Vb 1 \& aevalsrc="0.1*sin(2*PI*(360\-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)" .Ve .SS afdelaysrc .IX Subsection "afdelaysrc" Generate a fractional delay FIR coefficients. .PP The resulting stream can be used with \fBafir\fR filter for filtering the audio signal. .PP The filter accepts the following options: .IP "\fBdelay, d\fR" 4 .IX Item "delay, d" Set the fractional delay. Default is 0. .IP "\fBsample_rate, r\fR" 4 .IX Item "sample_rate, r" Set the sample rate, default is 44100. .IP "\fBnb_samples, n\fR" 4 .IX Item "nb_samples, n" Set the number of samples per each frame. Default is 1024. .IP "\fBtaps, t\fR" 4 .IX Item "taps, t" Set the number of filter coefficients in output audio stream. Default value is 0. .IP "\fBchannel_layout, c\fR" 4 .IX Item "channel_layout, c" Specifies the channel layout, and can be a string representing a channel layout. The default value of \fIchannel_layout\fR is "stereo". .SS afireqsrc .IX Subsection "afireqsrc" Generate a FIR equalizer coefficients. .PP The resulting stream can be used with \fBafir\fR filter for filtering the audio signal. .PP The filter accepts the following options: .IP "\fBpreset, p\fR" 4 .IX Item "preset, p" Set equalizer preset. Default preset is \f(CW\*(C`flat\*(C'\fR. .Sp Available presets are: .RS 4 .IP \fBcustom\fR 4 .IX Item "custom" .PD 0 .IP \fBflat\fR 4 .IX Item "flat" .IP \fBacoustic\fR 4 .IX Item "acoustic" .IP \fBbass\fR 4 .IX Item "bass" .IP \fBbeats\fR 4 .IX Item "beats" .IP \fBclassic\fR 4 .IX Item "classic" .IP \fBclear\fR 4 .IX Item "clear" .IP "\fBdeep bass\fR" 4 .IX Item "deep bass" .IP \fBdubstep\fR 4 .IX Item "dubstep" .IP \fBelectronic\fR 4 .IX Item "electronic" .IP \fBhard-style\fR 4 .IX Item "hard-style" .IP \fBhip-hop\fR 4 .IX Item "hip-hop" .IP \fBjazz\fR 4 .IX Item "jazz" .IP \fBmetal\fR 4 .IX Item "metal" .IP \fBmovie\fR 4 .IX Item "movie" .IP \fBpop\fR 4 .IX Item "pop" .IP \fBr&b\fR 4 .IX Item "r&b" .IP \fBrock\fR 4 .IX Item "rock" .IP "\fBvocal booster\fR" 4 .IX Item "vocal booster" .RE .RS 4 .RE .IP "\fBgains, g\fR" 4 .IX Item "gains, g" .PD Set custom gains for each band. Only used if the preset option is set to \f(CW\*(C`custom\*(C'\fR. Gains are separated by white spaces and each gain is set in dBFS. Default is \f(CW\*(C`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\*(C'\fR. .IP "\fBbands, b\fR" 4 .IX Item "bands, b" Set the custom bands from where custon equalizer gains are set. This must be in strictly increasing order. Only used if the preset option is set to \f(CW\*(C`custom\*(C'\fR. Bands are separated by white spaces and each band represent frequency in Hz. Default is \f(CW\*(C`25 40 63 100 160 250 400 630 1000 1600 2500 4000 6300 10000 16000 24000\*(C'\fR. .IP "\fBtaps, t\fR" 4 .IX Item "taps, t" Set number of filter coefficients in output audio stream. Default value is \f(CW4096\fR. .IP "\fBsample_rate, r\fR" 4 .IX Item "sample_rate, r" Set sample rate of output audio stream, default is \f(CW44100\fR. .IP "\fBnb_samples, n\fR" 4 .IX Item "nb_samples, n" Set number of samples per each frame in output audio stream. Default is \f(CW1024\fR. .IP "\fBinterp, i\fR" 4 .IX Item "interp, i" Set interpolation method for FIR equalizer coefficients. Can be \f(CW\*(C`linear\*(C'\fR or \f(CW\*(C`cubic\*(C'\fR. .IP "\fBphase, h\fR" 4 .IX Item "phase, h" Set phase type of FIR filter. Can be \f(CW\*(C`linear\*(C'\fR or \f(CW\*(C`min\*(C'\fR: minimum-phase. Default is minimum-phase filter. .SS afirsrc .IX Subsection "afirsrc" Generate a FIR coefficients using frequency sampling method. .PP The resulting stream can be used with \fBafir\fR filter for filtering the audio signal. .PP The filter accepts the following options: .IP "\fBtaps, t\fR" 4 .IX Item "taps, t" Set number of filter coefficients in output audio stream. Default value is 1025. .IP "\fBfrequency, f\fR" 4 .IX Item "frequency, f" Set frequency points from where magnitude and phase are set. This must be in non decreasing order, and first element must be 0, while last element must be 1. Elements are separated by white spaces. .IP "\fBmagnitude, m\fR" 4 .IX Item "magnitude, m" Set magnitude value for every frequency point set by \fBfrequency\fR. Number of values must be same as number of frequency points. Values are separated by white spaces. .IP "\fBphase, p\fR" 4 .IX Item "phase, p" Set phase value for every frequency point set by \fBfrequency\fR. Number of values must be same as number of frequency points. Values are separated by white spaces. .IP "\fBsample_rate, r\fR" 4 .IX Item "sample_rate, r" Set sample rate, default is 44100. .IP "\fBnb_samples, n\fR" 4 .IX Item "nb_samples, n" Set number of samples per each frame. Default is 1024. .IP "\fBwin_func, w\fR" 4 .IX Item "win_func, w" Set window function. Default is blackman. .SS anullsrc .IX Subsection "anullsrc" The null audio source, return unprocessed audio frames. It is mainly useful as a template and to be employed in analysis / debugging tools, or as the source for filters which ignore the input data (for example the sox synth filter). .PP This source accepts the following options: .IP "\fBchannel_layout, cl\fR" 4 .IX Item "channel_layout, cl" Specifies the channel layout, and can be either an integer or a string representing a channel layout. The default value of \fIchannel_layout\fR is "stereo". .Sp Check the channel_layout_map definition in \&\fIlibavutil/channel_layout.c\fR for the mapping between strings and channel layout values. .IP "\fBsample_rate, r\fR" 4 .IX Item "sample_rate, r" Specifies the sample rate, and defaults to 44100. .IP "\fBnb_samples, n\fR" 4 .IX Item "nb_samples, n" Set the number of samples per requested frames. .IP "\fBduration, d\fR" 4 .IX Item "duration, d" Set the duration of the sourced audio. See \&\fBthe Time duration section in the ffmpeg\-utils\|(1) manual\fR for the accepted syntax. .Sp If not specified, or the expressed duration is negative, the audio is supposed to be generated forever. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO. .Sp .Vb 1 \& anullsrc=r=48000:cl=4 .Ve .IP \(bu 4 Do the same operation with a more obvious syntax: .Sp .Vb 1 \& anullsrc=r=48000:cl=mono .Ve .PP All the parameters need to be explicitly defined. .SS flite .IX Subsection "flite" Synthesize a voice utterance using the libflite library. .PP To enable compilation of this filter you need to configure FFmpeg with \&\f(CW\*(C`\-\-enable\-libflite\*(C'\fR. .PP Note that versions of the flite library prior to 2.0 are not thread-safe. .PP The filter accepts the following options: .IP \fBlist_voices\fR 4 .IX Item "list_voices" If set to 1, list the names of the available voices and exit immediately. Default value is 0. .IP "\fBnb_samples, n\fR" 4 .IX Item "nb_samples, n" Set the maximum number of samples per frame. Default value is 512. .IP \fBtextfile\fR 4 .IX Item "textfile" Set the filename containing the text to speak. .IP \fBtext\fR 4 .IX Item "text" Set the text to speak. .IP "\fBvoice, v\fR" 4 .IX Item "voice, v" Set the voice to use for the speech synthesis. Default value is \&\f(CW\*(C`kal\*(C'\fR. See also the \fIlist_voices\fR option. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Read from file \fIspeech.txt\fR, and synthesize the text using the standard flite voice: .Sp .Vb 1 \& flite=textfile=speech.txt .Ve .IP \(bu 4 Read the specified text selecting the \f(CW\*(C`slt\*(C'\fR voice: .Sp .Vb 1 \& flite=text=\*(AqSo fare thee well, poor devil of a Sub\-Sub, whose commentator I am\*(Aq:voice=slt .Ve .IP \(bu 4 Input text to ffmpeg: .Sp .Vb 1 \& ffmpeg \-f lavfi \-i flite=text=\*(AqSo fare thee well, poor devil of a Sub\-Sub, whose commentator I am\*(Aq:voice=slt .Ve .IP \(bu 4 Make \fIffplay\fR speak the specified text, using \f(CW\*(C`flite\*(C'\fR and the \f(CW\*(C`lavfi\*(C'\fR device: .Sp .Vb 1 \& ffplay \-f lavfi flite=text=\*(AqNo more be grieved for which that thou hast done.\*(Aq .Ve .PP For more information about libflite, check: <\fBhttp://www.festvox.org/flite/\fR> .SS anoisesrc .IX Subsection "anoisesrc" Generate a noise audio signal. .PP The filter accepts the following options: .IP "\fBsample_rate, r\fR" 4 .IX Item "sample_rate, r" Specify the sample rate. Default value is 48000 Hz. .IP "\fBamplitude, a\fR" 4 .IX Item "amplitude, a" Specify the amplitude (0.0 \- 1.0) of the generated audio stream. Default value is 1.0. .IP "\fBduration, d\fR" 4 .IX Item "duration, d" Specify the duration of the generated audio stream. Not specifying this option results in noise with an infinite length. .IP "\fBcolor, colour, c\fR" 4 .IX Item "color, colour, c" Specify the color of noise. Available noise colors are white, pink, brown, blue, violet and velvet. Default color is white. .IP "\fBseed, s\fR" 4 .IX Item "seed, s" Specify a value used to seed the PRNG. .IP "\fBnb_samples, n\fR" 4 .IX Item "nb_samples, n" Set the number of samples per each output frame, default is 1024. .IP \fBdensity\fR 4 .IX Item "density" Set the density (0.0 \- 1.0) for the velvet noise generator, default is 0.05. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate and an amplitude of 0.5: .Sp .Vb 1 \& anoisesrc=d=60:c=pink:r=44100:a=0.5 .Ve .SS hilbert .IX Subsection "hilbert" Generate odd-tap Hilbert transform FIR coefficients. .PP The resulting stream can be used with \fBafir\fR filter for phase-shifting the signal by 90 degrees. .PP This is used in many matrix coding schemes and for analytic signal generation. The process is often written as a multiplication by i (or j), the imaginary unit. .PP The filter accepts the following options: .IP "\fBsample_rate, s\fR" 4 .IX Item "sample_rate, s" Set sample rate, default is 44100. .IP "\fBtaps, t\fR" 4 .IX Item "taps, t" Set length of FIR filter, default is 22051. .IP "\fBnb_samples, n\fR" 4 .IX Item "nb_samples, n" Set number of samples per each frame. .IP "\fBwin_func, w\fR" 4 .IX Item "win_func, w" Set window function to be used when generating FIR coefficients. .SS sinc .IX Subsection "sinc" Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject FIR coefficients. .PP The resulting stream can be used with \fBafir\fR filter for filtering the audio signal. .PP The filter accepts the following options: .IP "\fBsample_rate, r\fR" 4 .IX Item "sample_rate, r" Set sample rate, default is 44100. .IP "\fBnb_samples, n\fR" 4 .IX Item "nb_samples, n" Set number of samples per each frame. Default is 1024. .IP \fBhp\fR 4 .IX Item "hp" Set high-pass frequency. Default is 0. .IP \fBlp\fR 4 .IX Item "lp" Set low-pass frequency. Default is 0. If high-pass frequency is lower than low-pass frequency and low-pass frequency is higher than 0 then filter will create band-pass filter coefficients, otherwise band-reject filter coefficients. .IP \fBphase\fR 4 .IX Item "phase" Set filter phase response. Default is 50. Allowed range is from 0 to 100. .IP \fBbeta\fR 4 .IX Item "beta" Set Kaiser window beta. .IP \fBatt\fR 4 .IX Item "att" Set stop-band attenuation. Default is 120dB, allowed range is from 40 to 180 dB. .IP \fBround\fR 4 .IX Item "round" Enable rounding, by default is disabled. .IP \fBhptaps\fR 4 .IX Item "hptaps" Set number of taps for high-pass filter. .IP \fBlptaps\fR 4 .IX Item "lptaps" Set number of taps for low-pass filter. .SS sine .IX Subsection "sine" Generate an audio signal made of a sine wave with amplitude 1/8. .PP The audio signal is bit-exact. .PP The filter accepts the following options: .IP "\fBfrequency, f\fR" 4 .IX Item "frequency, f" Set the carrier frequency. Default is 440 Hz. .IP "\fBbeep_factor, b\fR" 4 .IX Item "beep_factor, b" Enable a periodic beep every second with frequency \fIbeep_factor\fR times the carrier frequency. Default is 0, meaning the beep is disabled. .IP "\fBsample_rate, r\fR" 4 .IX Item "sample_rate, r" Specify the sample rate, default is 44100. .IP "\fBduration, d\fR" 4 .IX Item "duration, d" Specify the duration of the generated audio stream. .IP \fBsamples_per_frame\fR 4 .IX Item "samples_per_frame" Set the number of samples per output frame. .Sp The expression can contain the following constants: .RS 4 .IP \fBn\fR 4 .IX Item "n" The (sequential) number of the output audio frame, starting from 0. .IP \fBpts\fR 4 .IX Item "pts" The PTS (Presentation TimeStamp) of the output audio frame, expressed in \fITB\fR units. .IP \fBt\fR 4 .IX Item "t" The PTS of the output audio frame, expressed in seconds. .IP \fBTB\fR 4 .IX Item "TB" The timebase of the output audio frames. .RE .RS 4 .Sp Default is \f(CW1024\fR. .RE .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Generate a simple 440 Hz sine wave: .Sp .Vb 1 \& sine .Ve .IP \(bu 4 Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds: .Sp .Vb 3 \& sine=220:4:d=5 \& sine=f=220:b=4:d=5 \& sine=frequency=220:beep_factor=4:duration=5 .Ve .IP \(bu 4 Generate a 1 kHz sine wave following \f(CW\*(C`1602,1601,1602,1601,1602\*(C'\fR NTSC pattern: .Sp .Vb 1 \& sine=1000:samples_per_frame=\*(Aqst(0,mod(n,5)); 1602\-not(not(eq(ld(0),1)+eq(ld(0),3)))\*(Aq .Ve .SH "AUDIO SINKS" .IX Header "AUDIO SINKS" Below is a description of the currently available audio sinks. .SS abuffersink .IX Subsection "abuffersink" Buffer audio frames, and make them available to the end of filter chain. .PP This sink is mainly intended for programmatic use, in particular through the interface defined in \fIlibavfilter/buffersink.h\fR or the options system. .PP It accepts a pointer to an AVABufferSinkContext structure, which defines the incoming buffers' formats, to be passed as the opaque parameter to \f(CW\*(C`avfilter_init_filter\*(C'\fR for initialization. .SS anullsink .IX Subsection "anullsink" Null audio sink; do absolutely nothing with the input audio. It is mainly useful as a template and for use in analysis / debugging tools. .SH "VIDEO FILTERS" .IX Header "VIDEO FILTERS" When you configure your FFmpeg build, you can disable any of the existing filters using \f(CW\*(C`\-\-disable\-filters\*(C'\fR. The configure output will show the video filters included in your build. .PP Below is a description of the currently available video filters. .SS addroi .IX Subsection "addroi" Mark a region of interest in a video frame. .PP The frame data is passed through unchanged, but metadata is attached to the frame indicating regions of interest which can affect the behaviour of later encoding. Multiple regions can be marked by applying the filter multiple times. .IP \fBx\fR 4 .IX Item "x" Region distance in pixels from the left edge of the frame. .IP \fBy\fR 4 .IX Item "y" Region distance in pixels from the top edge of the frame. .IP \fBw\fR 4 .IX Item "w" Region width in pixels. .IP \fBh\fR 4 .IX Item "h" Region height in pixels. .Sp The parameters \fIx\fR, \fIy\fR, \fIw\fR and \fIh\fR are expressions, and may contain the following variables: .RS 4 .IP \fBiw\fR 4 .IX Item "iw" Width of the input frame. .IP \fBih\fR 4 .IX Item "ih" Height of the input frame. .RE .RS 4 .RE .IP \fBqoffset\fR 4 .IX Item "qoffset" Quantisation offset to apply within the region. .Sp This must be a real value in the range \-1 to +1. A value of zero indicates no quality change. A negative value asks for better quality (less quantisation), while a positive value asks for worse quality (greater quantisation). .Sp The range is calibrated so that the extreme values indicate the largest possible offset \- if the rest of the frame is encoded with the worst possible quality, an offset of \-1 indicates that this region should be encoded with the best possible quality anyway. Intermediate values are then interpolated in some codec-dependent way. .Sp For example, in 10\-bit H.264 the quantisation parameter varies between \&\-12 and 51. A typical qoffset value of \-1/10 therefore indicates that this region should be encoded with a QP around one-tenth of the full range better than the rest of the frame. So, if most of the frame were to be encoded with a QP of around 30, this region would get a QP of around 24 (an offset of approximately \-1/10 * (51 \- \-12) = \-6.3). An extreme value of \-1 would indicate that this region should be encoded with the best possible quality regardless of the treatment of the rest of the frame \- that is, should be encoded at a QP of \-12. .IP \fBclear\fR 4 .IX Item "clear" If set to true, remove any existing regions of interest marked on the frame before adding the new one. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Mark the centre quarter of the frame as interesting. .Sp .Vb 1 \& addroi=iw/4:ih/4:iw/2:ih/2:\-1/10 .Ve .IP \(bu 4 Mark the 100\-pixel\-wide region on the left edge of the frame as very uninteresting (to be encoded at much lower quality than the rest of the frame). .Sp .Vb 1 \& addroi=0:0:100:ih:+1/5 .Ve .SS alphaextract .IX Subsection "alphaextract" Extract the alpha component from the input as a grayscale video. This is especially useful with the \fIalphamerge\fR filter. .SS alphamerge .IX Subsection "alphamerge" Add or replace the alpha component of the primary input with the grayscale value of a second input. This is intended for use with \&\fIalphaextract\fR to allow the transmission or storage of frame sequences that have alpha in a format that doesn't support an alpha channel. .PP For example, to reconstruct full frames from a normal YUV-encoded video and a separate video created with \fIalphaextract\fR, you might use: .PP .Vb 1 \& movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out] .Ve .SS amplify .IX Subsection "amplify" Amplify differences between current pixel and pixels of adjacent frames in same pixel location. .PP This filter accepts the following options: .IP \fBradius\fR 4 .IX Item "radius" Set frame radius. Default is 2. Allowed range is from 1 to 63. For example radius of 3 will instruct filter to calculate average of 7 frames. .IP \fBfactor\fR 4 .IX Item "factor" Set factor to amplify difference. Default is 2. Allowed range is from 0 to 65535. .IP \fBthreshold\fR 4 .IX Item "threshold" Set threshold for difference amplification. Any difference greater or equal to this value will not alter source pixel. Default is 10. Allowed range is from 0 to 65535. .IP \fBtolerance\fR 4 .IX Item "tolerance" Set tolerance for difference amplification. Any difference lower to this value will not alter source pixel. Default is 0. Allowed range is from 0 to 65535. .IP \fBlow\fR 4 .IX Item "low" Set lower limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535. This option controls maximum possible value that will decrease source pixel value. .IP \fBhigh\fR 4 .IX Item "high" Set high limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535. This option controls maximum possible value that will increase source pixel value. .IP \fBplanes\fR 4 .IX Item "planes" Set which planes to filter. Default is all. Allowed range is from 0 to 15. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the following \fBcommands\fR that corresponds to option of same name: .IP \fBfactor\fR 4 .IX Item "factor" .PD 0 .IP \fBthreshold\fR 4 .IX Item "threshold" .IP \fBtolerance\fR 4 .IX Item "tolerance" .IP \fBlow\fR 4 .IX Item "low" .IP \fBhigh\fR 4 .IX Item "high" .IP \fBplanes\fR 4 .IX Item "planes" .PD .SS ass .IX Subsection "ass" Same as the \fBsubtitles\fR filter, except that it doesn't require libavcodec and libavformat to work. On the other hand, it is limited to ASS (Advanced Substation Alpha) subtitles files. .PP This filter accepts the following option in addition to the common options from the \fBsubtitles\fR filter: .IP \fBshaping\fR 4 .IX Item "shaping" Set the shaping engine .Sp Available values are: .RS 4 .IP \fBauto\fR 4 .IX Item "auto" The default libass shaping engine, which is the best available. .IP \fBsimple\fR 4 .IX Item "simple" Fast, font-agnostic shaper that can do only substitutions .IP \fBcomplex\fR 4 .IX Item "complex" Slower shaper using OpenType for substitutions and positioning .RE .RS 4 .Sp The default is \f(CW\*(C`auto\*(C'\fR. .RE .SS atadenoise .IX Subsection "atadenoise" Apply an Adaptive Temporal Averaging Denoiser to the video input. .PP The filter accepts the following options: .IP \fB0a\fR 4 .IX Item "0a" Set threshold A for 1st plane. Default is 0.02. Valid range is 0 to 0.3. .IP \fB0b\fR 4 .IX Item "0b" Set threshold B for 1st plane. Default is 0.04. Valid range is 0 to 5. .IP \fB1a\fR 4 .IX Item "1a" Set threshold A for 2nd plane. Default is 0.02. Valid range is 0 to 0.3. .IP \fB1b\fR 4 .IX Item "1b" Set threshold B for 2nd plane. Default is 0.04. Valid range is 0 to 5. .IP \fB2a\fR 4 .IX Item "2a" Set threshold A for 3rd plane. Default is 0.02. Valid range is 0 to 0.3. .IP \fB2b\fR 4 .IX Item "2b" Set threshold B for 3rd plane. Default is 0.04. Valid range is 0 to 5. .Sp Threshold A is designed to react on abrupt changes in the input signal and threshold B is designed to react on continuous changes in the input signal. .IP \fBs\fR 4 .IX Item "s" Set number of frames filter will use for averaging. Default is 9. Must be odd number in range [5, 129]. .IP \fBp\fR 4 .IX Item "p" Set what planes of frame filter will use for averaging. Default is all. .IP \fBa\fR 4 .IX Item "a" Set what variant of algorithm filter will use for averaging. Default is \f(CW\*(C`p\*(C'\fR parallel. Alternatively can be set to \f(CW\*(C`s\*(C'\fR serial. .Sp 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. .IP \fB0s\fR 4 .IX Item "0s" .PD 0 .IP \fB1s\fR 4 .IX Item "1s" .IP \fB2s\fR 4 .IX Item "2s" .PD 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. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports same \fBcommands\fR as options except option \f(CW\*(C`s\*(C'\fR. The command accepts the same syntax of the corresponding option. .SS avgblur .IX Subsection "avgblur" Apply average blur filter. .PP The filter accepts the following options: .IP \fBsizeX\fR 4 .IX Item "sizeX" Set horizontal radius size. .IP \fBplanes\fR 4 .IX Item "planes" Set which planes to filter. By default all planes are filtered. .IP \fBsizeY\fR 4 .IX Item "sizeY" Set vertical radius size, if zero it will be same as \f(CW\*(C`sizeX\*(C'\fR. Default is \f(CW0\fR. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports same commands as options. The command accepts the same syntax of the corresponding option. .PP If the specified expression is not valid, it is kept at its current value. .SS backgroundkey .IX Subsection "backgroundkey" Turns a static background into transparency. .PP The filter accepts the following option: .IP \fBthreshold\fR 4 .IX Item "threshold" Threshold for scene change detection. .IP \fBsimilarity\fR 4 .IX Item "similarity" Similarity percentage with the background. .IP \fBblend\fR 4 .IX Item "blend" Set the blend amount for pixels that are not similar. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS bbox .IX Subsection "bbox" Compute the bounding box for the non-black pixels in the input frame luma plane. .PP 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. .PP The filter accepts the following option: .IP \fBmin_val\fR 4 .IX Item "min_val" Set the minimal luma value. Default is \f(CW16\fR. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS bilateral .IX Subsection "bilateral" Apply bilateral filter, spatial smoothing while preserving edges. .PP The filter accepts the following options: .IP \fBsigmaS\fR 4 .IX Item "sigmaS" Set sigma of gaussian function to calculate spatial weight. Allowed range is 0 to 512. Default is 0.1. .IP \fBsigmaR\fR 4 .IX Item "sigmaR" Set sigma of gaussian function to calculate range weight. Allowed range is 0 to 1. Default is 0.1. .IP \fBplanes\fR 4 .IX Item "planes" Set planes to filter. Default is first only. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS bilateral_cuda .IX Subsection "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. .PP The filter accepts the following options: .IP \fBsigmaS\fR 4 .IX Item "sigmaS" Set sigma of gaussian function to calculate spatial weight, also called sigma space. Allowed range is 0.1 to 512. Default is 0.1. .IP \fBsigmaR\fR 4 .IX Item "sigmaR" 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. .IP \fBwindow_size\fR 4 .IX Item "window_size" 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. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Apply the bilateral filter on a video. .Sp .Vb 8 \& ./ffmpeg \-v verbose \e \& \-hwaccel cuda \-hwaccel_output_format cuda \-i input.mp4 \e \& \-init_hw_device cuda \e \& \-filter_complex \e \& " \e \& [0:v]scale_cuda=format=yuv444p[scaled_video]; \& [scaled_video]bilateral_cuda=window_size=9:sigmaS=3.0:sigmaR=50.0" \e \& \-an \-sn \-c:v h264_nvenc \-cq 20 out.mp4 .Ve .SS bitplanenoise .IX Subsection "bitplanenoise" Show and measure bit plane noise. .PP The filter accepts the following options: .IP \fBbitplane\fR 4 .IX Item "bitplane" Set which plane to analyze. Default is \f(CW1\fR. .IP \fBfilter\fR 4 .IX Item "filter" Filter out noisy pixels from \f(CW\*(C`bitplane\*(C'\fR set above. Default is disabled. .SS blackdetect .IX Subsection "blackdetect" Detect video intervals that are (almost) completely black. Can be useful to detect chapter transitions, commercials, or invalid recordings. .PP 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 \f(CW\*(C`info\*(C'\fR. In addition, a log line with level \f(CW\*(C`debug\*(C'\fR is printed per frame showing the black amount detected for that frame. .PP The filter also attaches metadata to the first frame of a black segment with key \f(CW\*(C`lavfi.black_start\*(C'\fR and to the first frame after the black segment ends with key \f(CW\*(C`lavfi.black_end\*(C'\fR. The value is the frame's timestamp. This metadata is added regardless of the minimum duration specified. .PP The filter accepts the following options: .IP "\fBblack_min_duration, d\fR" 4 .IX Item "black_min_duration, d" Set the minimum detected black duration expressed in seconds. It must be a non-negative floating point number. .Sp Default value is 2.0. .IP "\fBpicture_black_ratio_th, pic_th\fR" 4 .IX Item "picture_black_ratio_th, pic_th" Set the threshold for considering a picture "black". Express the minimum value for the ratio: .Sp .Vb 1 \& / .Ve .Sp for which a picture is considered black. Default value is 0.98. .IP "\fBpixel_black_th, pix_th\fR" 4 .IX Item "pixel_black_th, pix_th" Set the threshold for considering a pixel "black". .Sp 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: .Sp .Vb 1 \& = + * .Ve .Sp \&\fIluma_range_size\fR and \fIluma_minimum_value\fR 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. .Sp Default value is 0.10. .PP The following example sets the maximum pixel threshold to the minimum value, and detects only black intervals of 2 or more seconds: .PP .Vb 1 \& blackdetect=d=2:pix_th=0.00 .Ve .SS blackframe .IX Subsection "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. .PP In order to display the output lines, you need to set the loglevel at least to the AV_LOG_INFO value. .PP This filter exports frame metadata \f(CW\*(C`lavfi.blackframe.pblack\*(C'\fR. The value represents the percentage of pixels in the picture that are below the threshold value. .PP It accepts the following parameters: .IP \fBamount\fR 4 .IX Item "amount" The percentage of the pixels that have to be below the threshold; it defaults to \&\f(CW98\fR. .IP "\fBthreshold, thresh\fR" 4 .IX Item "threshold, thresh" The threshold below which a pixel value is considered black; it defaults to \&\f(CW32\fR. .SS blend .IX Subsection "blend" Blend two video frames into each other. .PP The \f(CW\*(C`blend\*(C'\fR 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. .PP The \f(CW\*(C`tblend\*(C'\fR (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. .PP A description of the accepted options follows. .IP \fBc0_mode\fR 4 .IX Item "c0_mode" .PD 0 .IP \fBc1_mode\fR 4 .IX Item "c1_mode" .IP \fBc2_mode\fR 4 .IX Item "c2_mode" .IP \fBc3_mode\fR 4 .IX Item "c3_mode" .IP \fBall_mode\fR 4 .IX Item "all_mode" .PD Set blend mode for specific pixel component or all pixel components in case of \fIall_mode\fR. Default value is \f(CW\*(C`normal\*(C'\fR. .Sp Available values for component modes are: .RS 4 .IP \fBaddition\fR 4 .IX Item "addition" .PD 0 .IP \fBand\fR 4 .IX Item "and" .IP \fBaverage\fR 4 .IX Item "average" .IP \fBbleach\fR 4 .IX Item "bleach" .IP \fBburn\fR 4 .IX Item "burn" .IP \fBdarken\fR 4 .IX Item "darken" .IP \fBdifference\fR 4 .IX Item "difference" .IP \fBdivide\fR 4 .IX Item "divide" .IP \fBdodge\fR 4 .IX Item "dodge" .IP \fBexclusion\fR 4 .IX Item "exclusion" .IP \fBextremity\fR 4 .IX Item "extremity" .IP \fBfreeze\fR 4 .IX Item "freeze" .IP \fBgeometric\fR 4 .IX Item "geometric" .IP \fBglow\fR 4 .IX Item "glow" .IP \fBgrainextract\fR 4 .IX Item "grainextract" .IP \fBgrainmerge\fR 4 .IX Item "grainmerge" .IP \fBhardlight\fR 4 .IX Item "hardlight" .IP \fBhardmix\fR 4 .IX Item "hardmix" .IP \fBhardoverlay\fR 4 .IX Item "hardoverlay" .IP \fBharmonic\fR 4 .IX Item "harmonic" .IP \fBheat\fR 4 .IX Item "heat" .IP \fBinterpolate\fR 4 .IX Item "interpolate" .IP \fBlighten\fR 4 .IX Item "lighten" .IP \fBlinearlight\fR 4 .IX Item "linearlight" .IP \fBmultiply\fR 4 .IX Item "multiply" .IP \fBmultiply128\fR 4 .IX Item "multiply128" .IP \fBnegation\fR 4 .IX Item "negation" .IP \fBnormal\fR 4 .IX Item "normal" .IP \fBor\fR 4 .IX Item "or" .IP \fBoverlay\fR 4 .IX Item "overlay" .IP \fBphoenix\fR 4 .IX Item "phoenix" .IP \fBpinlight\fR 4 .IX Item "pinlight" .IP \fBreflect\fR 4 .IX Item "reflect" .IP \fBscreen\fR 4 .IX Item "screen" .IP \fBsoftdifference\fR 4 .IX Item "softdifference" .IP \fBsoftlight\fR 4 .IX Item "softlight" .IP \fBstain\fR 4 .IX Item "stain" .IP \fBsubtract\fR 4 .IX Item "subtract" .IP \fBvividlight\fR 4 .IX Item "vividlight" .IP \fBxor\fR 4 .IX Item "xor" .RE .RS 4 .RE .IP \fBc0_opacity\fR 4 .IX Item "c0_opacity" .IP \fBc1_opacity\fR 4 .IX Item "c1_opacity" .IP \fBc2_opacity\fR 4 .IX Item "c2_opacity" .IP \fBc3_opacity\fR 4 .IX Item "c3_opacity" .IP \fBall_opacity\fR 4 .IX Item "all_opacity" .PD Set blend opacity for specific pixel component or all pixel components in case of \fIall_opacity\fR. Only used in combination with pixel component blend modes. .IP \fBc0_expr\fR 4 .IX Item "c0_expr" .PD 0 .IP \fBc1_expr\fR 4 .IX Item "c1_expr" .IP \fBc2_expr\fR 4 .IX Item "c2_expr" .IP \fBc3_expr\fR 4 .IX Item "c3_expr" .IP \fBall_expr\fR 4 .IX Item "all_expr" .PD Set blend expression for specific pixel component or all pixel components in case of \fIall_expr\fR. Note that related mode options will be ignored if those are set. .Sp The expressions can use the following variables: .RS 4 .IP \fBN\fR 4 .IX Item "N" The sequential number of the filtered frame, starting from \f(CW0\fR. .IP \fBX\fR 4 .IX Item "X" .PD 0 .IP \fBY\fR 4 .IX Item "Y" .PD the coordinates of the current sample .IP \fBW\fR 4 .IX Item "W" .PD 0 .IP \fBH\fR 4 .IX Item "H" .PD the width and height of currently filtered plane .IP \fBSW\fR 4 .IX Item "SW" .PD 0 .IP \fBSH\fR 4 .IX Item "SH" .PD 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 \f(CW\*(C`yuv420p\*(C'\fR frame, the values are \f(CW\*(C`1,1\*(C'\fR for the luma plane and \f(CW\*(C`0.5,0.5\*(C'\fR for the chroma planes. .IP \fBT\fR 4 .IX Item "T" Time of the current frame, expressed in seconds. .IP "\fBTOP, A\fR" 4 .IX Item "TOP, A" Value of pixel component at current location for first video frame (top layer). .IP "\fBBOTTOM, B\fR" 4 .IX Item "BOTTOM, B" Value of pixel component at current location for second video frame (bottom layer). .RE .RS 4 .RE .PP The \f(CW\*(C`blend\*(C'\fR filter also supports the \fBframesync\fR options. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Apply transition from bottom layer to top layer in first 10 seconds: .Sp .Vb 1 \& blend=all_expr=\*(AqA*(if(gte(T,10),1,T/10))+B*(1\-(if(gte(T,10),1,T/10)))\*(Aq .Ve .IP \(bu 4 Apply linear horizontal transition from top layer to bottom layer: .Sp .Vb 1 \& blend=all_expr=\*(AqA*(X/W)+B*(1\-X/W)\*(Aq .Ve .IP \(bu 4 Apply 1x1 checkerboard effect: .Sp .Vb 1 \& blend=all_expr=\*(Aqif(eq(mod(X,2),mod(Y,2)),A,B)\*(Aq .Ve .IP \(bu 4 Apply uncover left effect: .Sp .Vb 1 \& blend=all_expr=\*(Aqif(gte(N*SW+X,W),A,B)\*(Aq .Ve .IP \(bu 4 Apply uncover down effect: .Sp .Vb 1 \& blend=all_expr=\*(Aqif(gte(Y\-N*SH,0),A,B)\*(Aq .Ve .IP \(bu 4 Apply uncover up-left effect: .Sp .Vb 1 \& blend=all_expr=\*(Aqif(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)\*(Aq .Ve .IP \(bu 4 Split diagonally video and shows top and bottom layer on each side: .Sp .Vb 1 \& blend=all_expr=\*(Aqif(gt(X,Y*(W/H)),A,B)\*(Aq .Ve .IP \(bu 4 Display differences between the current and the previous frame: .Sp .Vb 1 \& tblend=all_mode=grainextract .Ve .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports same \fBcommands\fR as options. .SS blockdetect .IX Subsection "blockdetect" Determines blockiness of frames without altering the input frames. .PP Based on Remco Muijs and Ihor Kirenko: "A no-reference blocking artifact measure for adaptive video processing." 2005 13th European signal processing conference. .PP The filter accepts the following options: .IP \fBperiod_min\fR 4 .IX Item "period_min" .PD 0 .IP \fBperiod_max\fR 4 .IX Item "period_max" .PD Set minimum and maximum values for determining pixel grids (periods). Default values are [3,24]. .IP \fBplanes\fR 4 .IX Item "planes" Set planes to filter. Default is first only. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Determine blockiness for the first plane and search for periods within [8,32]: .Sp .Vb 1 \& blockdetect=period_min=8:period_max=32:planes=1 .Ve .SS blurdetect .IX Subsection "blurdetect" Determines blurriness of frames without altering the input frames. .PP Based on Marziliano, Pina, et al. "A no-reference perceptual blur metric." Allows for a block-based abbreviation. .PP The filter accepts the following options: .IP \fBlow\fR 4 .IX Item "low" .PD 0 .IP \fBhigh\fR 4 .IX Item "high" .PD Set low and high threshold values used by the Canny thresholding algorithm. .Sp 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. .Sp \&\fIlow\fR and \fIhigh\fR threshold values must be chosen in the range [0,1], and \fIlow\fR should be lesser or equal to \fIhigh\fR. .Sp Default value for \fIlow\fR is \f(CW\*(C`20/255\*(C'\fR, and default value for \fIhigh\fR is \f(CW\*(C`50/255\*(C'\fR. .IP \fBradius\fR 4 .IX Item "radius" Define the radius to search around an edge pixel for local maxima. .IP \fBblock_pct\fR 4 .IX Item "block_pct" Determine blurriness only for the most significant blocks, given in percentage. .IP \fBblock_width\fR 4 .IX Item "block_width" Determine blurriness for blocks of width \fIblock_width\fR. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of \fIblock_height\fR. .IP \fBblock_height\fR 4 .IX Item "block_height" Determine blurriness for blocks of height \fIblock_height\fR. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of \fIblock_width\fR. .IP \fBplanes\fR 4 .IX Item "planes" Set planes to filter. Default is first only. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Determine blur for 80% of most significant 32x32 blocks: .Sp .Vb 1 \& blurdetect=block_width=32:block_height=32:block_pct=80 .Ve .SS bm3d .IX Subsection "bm3d" Denoise frames using Block-Matching 3D algorithm. .PP The filter accepts the following options. .IP \fBsigma\fR 4 .IX Item "sigma" 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. .IP \fBblock\fR 4 .IX Item "block" Set local patch size. This sets dimensions in 2D. .IP \fBbstep\fR 4 .IX Item "bstep" 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. .IP \fBgroup\fR 4 .IX Item "group" 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. .IP \fBrange\fR 4 .IX Item "range" Set radius for search block matching. Default is 9. Allowed range is from 1 to INT32_MAX. .IP \fBmstep\fR 4 .IX Item "mstep" Set step between two search locations for block matching. Default is 1. Allowed range is from 1 to 64. Smaller is slower. .IP \fBthmse\fR 4 .IX Item "thmse" Set threshold of mean square error for block matching. Valid range is 0 to INT32_MAX. .IP \fBhdthr\fR 4 .IX Item "hdthr" Set thresholding parameter for hard thresholding in 3D transformed domain. Larger values results in stronger hard-thresholding filtering in frequency domain. .IP \fBestim\fR 4 .IX Item "estim" Set filtering estimation mode. Can be \f(CW\*(C`basic\*(C'\fR or \f(CW\*(C`final\*(C'\fR. Default is \f(CW\*(C`basic\*(C'\fR. .IP \fBref\fR 4 .IX Item "ref" If enabled, filter will use 2nd stream for block matching. Default is disabled for \f(CW\*(C`basic\*(C'\fR value of \fIestim\fR option, and always enabled if value of \fIestim\fR is \f(CW\*(C`final\*(C'\fR. .IP \fBplanes\fR 4 .IX Item "planes" Set planes to filter. Default is all available except alpha. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Basic filtering with bm3d: .Sp .Vb 1 \& bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic .Ve .IP \(bu 4 Same as above, but filtering only luma: .Sp .Vb 1 \& bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic:planes=1 .Ve .IP \(bu 4 Same as above, but with both estimation modes: .Sp .Vb 1 \& 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 .Ve .IP \(bu 4 Same as above, but prefilter with \fBnlmeans\fR filter instead: .Sp .Vb 1 \& 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 .Ve .SS boxblur .IX Subsection "boxblur" Apply a boxblur algorithm to the input video. .PP It accepts the following parameters: .IP "\fBluma_radius, lr\fR" 4 .IX Item "luma_radius, lr" .PD 0 .IP "\fBluma_power, lp\fR" 4 .IX Item "luma_power, lp" .IP "\fBchroma_radius, cr\fR" 4 .IX Item "chroma_radius, cr" .IP "\fBchroma_power, cp\fR" 4 .IX Item "chroma_power, cp" .IP "\fBalpha_radius, ar\fR" 4 .IX Item "alpha_radius, ar" .IP "\fBalpha_power, ap\fR" 4 .IX Item "alpha_power, ap" .PD .PP A description of the accepted options follows. .IP "\fBluma_radius, lr\fR" 4 .IX Item "luma_radius, lr" .PD 0 .IP "\fBchroma_radius, cr\fR" 4 .IX Item "chroma_radius, cr" .IP "\fBalpha_radius, ar\fR" 4 .IX Item "alpha_radius, ar" .PD Set an expression for the box radius in pixels used for blurring the corresponding input plane. .Sp The radius value must be a non-negative number, and must not be greater than the value of the expression \f(CW\*(C`min(w,h)/2\*(C'\fR for the luma and alpha planes, and of \f(CW\*(C`min(cw,ch)/2\*(C'\fR for the chroma planes. .Sp Default value for \fBluma_radius\fR is "2". If not specified, \&\fBchroma_radius\fR and \fBalpha_radius\fR default to the corresponding value set for \fBluma_radius\fR. .Sp The expressions can contain the following constants: .RS 4 .IP \fBw\fR 4 .IX Item "w" .PD 0 .IP \fBh\fR 4 .IX Item "h" .PD The input width and height in pixels. .IP \fBcw\fR 4 .IX Item "cw" .PD 0 .IP \fBch\fR 4 .IX Item "ch" .PD The input chroma image width and height in pixels. .IP \fBhsub\fR 4 .IX Item "hsub" .PD 0 .IP \fBvsub\fR 4 .IX Item "vsub" .PD The horizontal and vertical chroma subsample values. For example, for the pixel format "yuv422p", \fIhsub\fR is 2 and \fIvsub\fR is 1. .RE .RS 4 .RE .IP "\fBluma_power, lp\fR" 4 .IX Item "luma_power, lp" .PD 0 .IP "\fBchroma_power, cp\fR" 4 .IX Item "chroma_power, cp" .IP "\fBalpha_power, ap\fR" 4 .IX Item "alpha_power, ap" .PD Specify how many times the boxblur filter is applied to the corresponding plane. .Sp Default value for \fBluma_power\fR is 2. If not specified, \&\fBchroma_power\fR and \fBalpha_power\fR default to the corresponding value set for \fBluma_power\fR. .Sp A value of 0 will disable the effect. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Apply a boxblur filter with the luma, chroma, and alpha radii set to 2: .Sp .Vb 2 \& boxblur=luma_radius=2:luma_power=1 \& boxblur=2:1 .Ve .IP \(bu 4 Set the luma radius to 2, and alpha and chroma radius to 0: .Sp .Vb 1 \& boxblur=2:1:cr=0:ar=0 .Ve .IP \(bu 4 Set the luma and chroma radii to a fraction of the video dimension: .Sp .Vb 1 \& boxblur=luma_radius=min(h\e,w)/10:luma_power=1:chroma_radius=min(cw\e,ch)/10:chroma_power=1 .Ve .SS bwdif .IX Subsection "bwdif" Deinterlace the input video ("bwdif" stands for "Bob Weaver Deinterlacing Filter"). .PP Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic interpolation algorithms. It accepts the following parameters: .IP \fBmode\fR 4 .IX Item "mode" The interlacing mode to adopt. It accepts one of the following values: .RS 4 .IP "\fB0, send_frame\fR" 4 .IX Item "0, send_frame" Output one frame for each frame. .IP "\fB1, send_field\fR" 4 .IX Item "1, send_field" Output one frame for each field. .RE .RS 4 .Sp The default value is \f(CW\*(C`send_field\*(C'\fR. .RE .IP \fBparity\fR 4 .IX Item "parity" The picture field parity assumed for the input interlaced video. It accepts one of the following values: .RS 4 .IP "\fB0, tff\fR" 4 .IX Item "0, tff" Assume the top field is first. .IP "\fB1, bff\fR" 4 .IX Item "1, bff" Assume the bottom field is first. .IP "\fB\-1, auto\fR" 4 .IX Item "-1, auto" Enable automatic detection of field parity. .RE .RS 4 .Sp The default value is \f(CW\*(C`auto\*(C'\fR. If the interlacing is unknown or the decoder does not export this information, top field first will be assumed. .RE .IP \fBdeint\fR 4 .IX Item "deint" Specify which frames to deinterlace. Accepts one of the following values: .RS 4 .IP "\fB0, all\fR" 4 .IX Item "0, all" Deinterlace all frames. .IP "\fB1, interlaced\fR" 4 .IX Item "1, interlaced" Only deinterlace frames marked as interlaced. .RE .RS 4 .Sp The default value is \f(CW\*(C`all\*(C'\fR. .RE .SS bwdif_cuda .IX Subsection "bwdif_cuda" Deinterlace the input video using the \fBbwdif\fR algorithm, but implemented in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec and/or nvenc. .PP It accepts the following parameters: .IP \fBmode\fR 4 .IX Item "mode" The interlacing mode to adopt. It accepts one of the following values: .RS 4 .IP "\fB0, send_frame\fR" 4 .IX Item "0, send_frame" Output one frame for each frame. .IP "\fB1, send_field\fR" 4 .IX Item "1, send_field" Output one frame for each field. .RE .RS 4 .Sp The default value is \f(CW\*(C`send_field\*(C'\fR. .RE .IP \fBparity\fR 4 .IX Item "parity" The picture field parity assumed for the input interlaced video. It accepts one of the following values: .RS 4 .IP "\fB0, tff\fR" 4 .IX Item "0, tff" Assume the top field is first. .IP "\fB1, bff\fR" 4 .IX Item "1, bff" Assume the bottom field is first. .IP "\fB\-1, auto\fR" 4 .IX Item "-1, auto" Enable automatic detection of field parity. .RE .RS 4 .Sp The default value is \f(CW\*(C`auto\*(C'\fR. If the interlacing is unknown or the decoder does not export this information, top field first will be assumed. .RE .IP \fBdeint\fR 4 .IX Item "deint" Specify which frames to deinterlace. Accepts one of the following values: .RS 4 .IP "\fB0, all\fR" 4 .IX Item "0, all" Deinterlace all frames. .IP "\fB1, interlaced\fR" 4 .IX Item "1, interlaced" Only deinterlace frames marked as interlaced. .RE .RS 4 .Sp The default value is \f(CW\*(C`all\*(C'\fR. .RE .SS ccrepack .IX Subsection "ccrepack" Repack CEA\-708 closed captioning side data .PP 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). .SS cas .IX Subsection "cas" Apply Contrast Adaptive Sharpen filter to video stream. .PP The filter accepts the following options: .IP \fBstrength\fR 4 .IX Item "strength" Set the sharpening strength. Default value is 0. .IP \fBplanes\fR 4 .IX Item "planes" Set planes to filter. Default value is to filter all planes except alpha plane. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports same \fBcommands\fR as options. .SS chromahold .IX Subsection "chromahold" Remove all color information for all colors except for certain one. .PP The filter accepts the following options: .IP \fBcolor\fR 4 .IX Item "color" The color which will not be replaced with neutral chroma. .IP \fBsimilarity\fR 4 .IX Item "similarity" Similarity percentage with the above color. 0.01 matches only the exact key color, while 1.0 matches everything. .IP \fBblend\fR 4 .IX Item "blend" Blend percentage. 0.0 makes pixels either fully gray, or not gray at all. Higher values result in more preserved color. .IP \fByuv\fR 4 .IX Item "yuv" Signals that the color passed is already in YUV instead of RGB. .Sp 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. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports same \fBcommands\fR as options. The command accepts the same syntax of the corresponding option. .PP If the specified expression is not valid, it is kept at its current value. .SS chromakey .IX Subsection "chromakey" YUV colorspace color/chroma keying. .PP The filter accepts the following options: .IP \fBcolor\fR 4 .IX Item "color" The color which will be replaced with transparency. .IP \fBsimilarity\fR 4 .IX Item "similarity" Similarity percentage with the key color. .Sp 0.01 matches only the exact key color, while 1.0 matches everything. .IP \fBblend\fR 4 .IX Item "blend" Blend percentage. .Sp 0.0 makes pixels either fully transparent, or not transparent at all. .Sp Higher values result in semi-transparent pixels, with a higher transparency the more similar the pixels color is to the key color. .IP \fByuv\fR 4 .IX Item "yuv" Signals that the color passed is already in YUV instead of RGB. .Sp 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. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports same \fBcommands\fR as options. The command accepts the same syntax of the corresponding option. .PP If the specified expression is not valid, it is kept at its current value. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Make every green pixel in the input image transparent: .Sp .Vb 1 \& ffmpeg \-i input.png \-vf chromakey=green out.png .Ve .IP \(bu 4 Overlay a greenscreen-video on top of a static black background. .Sp .Vb 1 \& 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 .Ve .SS chromakey_cuda .IX Subsection "chromakey_cuda" CUDA accelerated YUV colorspace color/chroma keying. .PP This filter works like normal chromakey filter but operates on CUDA frames. for more details and parameters see \fBchromakey\fR. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Make all the green pixels in the input video transparent and use it as an overlay for another video: .Sp .Vb 10 \& ./ffmpeg \e \& \-hwaccel cuda \-hwaccel_output_format cuda \-i input_green.mp4 \e \& \-hwaccel cuda \-hwaccel_output_format cuda \-i base_video.mp4 \e \& \-init_hw_device cuda \e \& \-filter_complex \e \& " \e \& [0:v]chromakey_cuda=0x25302D:0.1:0.12:1[overlay_video]; \e \& [1:v]scale_cuda=format=yuv420p[base]; \e \& [base][overlay_video]overlay_cuda" \e \& \-an \-sn \-c:v h264_nvenc \-cq 20 output.mp4 .Ve .IP \(bu 4 Process two software sources, explicitly uploading the frames: .Sp .Vb 9 \& ./ffmpeg \-init_hw_device cuda=cuda \-filter_hw_device cuda \e \& \-f lavfi \-i color=size=800x600:color=white,format=yuv420p \e \& \-f lavfi \-i yuvtestsrc=size=200x200,format=yuv420p \e \& \-filter_complex \e \& " \e \& [0]hwupload[under]; \e \& [1]hwupload,chromakey_cuda=green:0.1:0.12[over]; \e \& [under][over]overlay_cuda" \e \& \-c:v hevc_nvenc \-cq 18 \-preset slow output.mp4 .Ve .SS chromanr .IX Subsection "chromanr" Reduce chrominance noise. .PP The filter accepts the following options: .IP \fBthres\fR 4 .IX Item "thres" 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. .IP \fBsizew\fR 4 .IX Item "sizew" Set horizontal radius of rectangle used for averaging. Allowed range is from 1 to 100. Default value is 5. .IP \fBsizeh\fR 4 .IX Item "sizeh" Set vertical radius of rectangle used for averaging. Allowed range is from 1 to 100. Default value is 5. .IP \fBstepw\fR 4 .IX Item "stepw" Set horizontal step when averaging. Default value is 1. Allowed range is from 1 to 50. Mostly useful to speed-up filtering. .IP \fBsteph\fR 4 .IX Item "steph" Set vertical step when averaging. Default value is 1. Allowed range is from 1 to 50. Mostly useful to speed-up filtering. .IP \fBthrey\fR 4 .IX Item "threy" 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. .IP \fBthreu\fR 4 .IX Item "threu" 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. .IP \fBthrev\fR 4 .IX Item "threv" 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. .IP \fBdistance\fR 4 .IX Item "distance" Set distance type used in calculations. .RS 4 .IP \fBmanhattan\fR 4 .IX Item "manhattan" Absolute difference. .IP \fBeuclidean\fR 4 .IX Item "euclidean" Difference squared. .RE .RS 4 .Sp Default distance type is manhattan. .RE .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports same \fBcommands\fR as options. The command accepts the same syntax of the corresponding option. .SS chromashift .IX Subsection "chromashift" Shift chroma pixels horizontally and/or vertically. .PP The filter accepts the following options: .IP \fBcbh\fR 4 .IX Item "cbh" Set amount to shift chroma-blue horizontally. .IP \fBcbv\fR 4 .IX Item "cbv" Set amount to shift chroma-blue vertically. .IP \fBcrh\fR 4 .IX Item "crh" Set amount to shift chroma-red horizontally. .IP \fBcrv\fR 4 .IX Item "crv" Set amount to shift chroma-red vertically. .IP \fBedge\fR 4 .IX Item "edge" Set edge mode, can be \fIsmear\fR, default, or \fIwarp\fR. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS ciescope .IX Subsection "ciescope" Display CIE color diagram with pixels overlaid onto it. .PP The filter accepts the following options: .IP \fBsystem\fR 4 .IX Item "system" Set color system. .RS 4 .IP "\fBntsc, 470m\fR" 4 .IX Item "ntsc, 470m" .PD 0 .IP "\fBebu, 470bg\fR" 4 .IX Item "ebu, 470bg" .IP \fBsmpte\fR 4 .IX Item "smpte" .IP \fB240m\fR 4 .IX Item "240m" .IP \fBapple\fR 4 .IX Item "apple" .IP \fBwidergb\fR 4 .IX Item "widergb" .IP \fBcie1931\fR 4 .IX Item "cie1931" .IP "\fBrec709, hdtv\fR" 4 .IX Item "rec709, hdtv" .IP "\fBuhdtv, rec2020\fR" 4 .IX Item "uhdtv, rec2020" .IP \fBdcip3\fR 4 .IX Item "dcip3" .RE .RS 4 .RE .IP \fBcie\fR 4 .IX Item "cie" .PD Set CIE system. .RS 4 .IP \fBxyy\fR 4 .IX Item "xyy" .PD 0 .IP \fBucs\fR 4 .IX Item "ucs" .IP \fBluv\fR 4 .IX Item "luv" .RE .RS 4 .RE .IP \fBgamuts\fR 4 .IX Item "gamuts" .PD Set what gamuts to draw. .Sp See \f(CW\*(C`system\*(C'\fR option for available values. .IP "\fBsize, s\fR" 4 .IX Item "size, s" Set ciescope size, by default set to 512. .IP "\fBintensity, i\fR" 4 .IX Item "intensity, i" Set intensity used to map input pixel values to CIE diagram. .IP \fBcontrast\fR 4 .IX Item "contrast" Set contrast used to draw tongue colors that are out of active color system gamut. .IP \fBcorrgamma\fR 4 .IX Item "corrgamma" Correct gamma displayed on scope, by default enabled. .IP \fBshowwhite\fR 4 .IX Item "showwhite" Show white point on CIE diagram, by default disabled. .IP \fBgamma\fR 4 .IX Item "gamma" Set input gamma. Used only with XYZ input color space. .IP \fBfill\fR 4 .IX Item "fill" Fill with CIE colors. By default is enabled. .SS codecview .IX Subsection "codecview" Visualize information exported by some codecs. .PP Some codecs can export information through frames using side-data or other means. For example, some MPEG based codecs export motion vectors through the \&\fIexport_mvs\fR flag in the codec \fBflags2\fR option. .PP The filter accepts the following option: .IP \fBblock\fR 4 .IX Item "block" Display block partition structure using the luma plane. .IP \fBmv\fR 4 .IX Item "mv" Set motion vectors to visualize. .Sp Available flags for \fImv\fR are: .RS 4 .IP \fBpf\fR 4 .IX Item "pf" forward predicted MVs of P\-frames .IP \fBbf\fR 4 .IX Item "bf" forward predicted MVs of B\-frames .IP \fBbb\fR 4 .IX Item "bb" backward predicted MVs of B\-frames .RE .RS 4 .RE .IP \fBqp\fR 4 .IX Item "qp" Display quantization parameters using the chroma planes. .IP "\fBmv_type, mvt\fR" 4 .IX Item "mv_type, mvt" Set motion vectors type to visualize. Includes MVs from all frames unless specified by \fIframe_type\fR option. .Sp Available flags for \fImv_type\fR are: .RS 4 .IP \fBfp\fR 4 .IX Item "fp" forward predicted MVs .IP \fBbp\fR 4 .IX Item "bp" backward predicted MVs .RE .RS 4 .RE .IP "\fBframe_type, ft\fR" 4 .IX Item "frame_type, ft" Set frame type to visualize motion vectors of. .Sp Available flags for \fIframe_type\fR are: .RS 4 .IP \fBif\fR 4 .IX Item "if" intra-coded frames (I\-frames) .IP \fBpf\fR 4 .IX Item "pf" predicted frames (P\-frames) .IP \fBbf\fR 4 .IX Item "bf" bi-directionally predicted frames (B\-frames) .RE .RS 4 .RE .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Visualize forward predicted MVs of all frames using \fBffplay\fR: .Sp .Vb 1 \& ffplay \-flags2 +export_mvs input.mp4 \-vf codecview=mv_type=fp .Ve .IP \(bu 4 Visualize multi-directionals MVs of P and B\-Frames using \fBffplay\fR: .Sp .Vb 1 \& ffplay \-flags2 +export_mvs input.mp4 \-vf codecview=mv=pf+bf+bb .Ve .SS colorbalance .IX Subsection "colorbalance" Modify intensity of primary colors (red, green and blue) of input frames. .PP 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. .PP A positive adjustment value shifts the balance towards the primary color, a negative value towards the complementary color. .PP The filter accepts the following options: .IP \fBrs\fR 4 .IX Item "rs" .PD 0 .IP \fBgs\fR 4 .IX Item "gs" .IP \fBbs\fR 4 .IX Item "bs" .PD Adjust red, green and blue shadows (darkest pixels). .IP \fBrm\fR 4 .IX Item "rm" .PD 0 .IP \fBgm\fR 4 .IX Item "gm" .IP \fBbm\fR 4 .IX Item "bm" .PD Adjust red, green and blue midtones (medium pixels). .IP \fBrh\fR 4 .IX Item "rh" .PD 0 .IP \fBgh\fR 4 .IX Item "gh" .IP \fBbh\fR 4 .IX Item "bh" .PD Adjust red, green and blue highlights (brightest pixels). .Sp Allowed ranges for options are \f(CW\*(C`[\-1.0, 1.0]\*(C'\fR. Defaults are \f(CW0\fR. .IP \fBpl\fR 4 .IX Item "pl" Preserve lightness when changing color balance. Default is disabled. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Add red color cast to shadows: .Sp .Vb 1 \& colorbalance=rs=.3 .Ve .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS colorcontrast .IX Subsection "colorcontrast" Adjust color contrast between RGB components. .PP The filter accepts the following options: .IP \fBrc\fR 4 .IX Item "rc" Set the red-cyan contrast. Defaults is 0.0. Allowed range is from \-1.0 to 1.0. .IP \fBgm\fR 4 .IX Item "gm" Set the green-magenta contrast. Defaults is 0.0. Allowed range is from \-1.0 to 1.0. .IP \fBby\fR 4 .IX Item "by" Set the blue-yellow contrast. Defaults is 0.0. Allowed range is from \-1.0 to 1.0. .IP \fBrcw\fR 4 .IX Item "rcw" .PD 0 .IP \fBgmw\fR 4 .IX Item "gmw" .IP \fBbyw\fR 4 .IX Item "byw" .PD Set the weight of each \f(CW\*(C`rc\*(C'\fR, \f(CW\*(C`gm\*(C'\fR, \f(CW\*(C`by\*(C'\fR 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. .IP \fBpl\fR 4 .IX Item "pl" Set the amount of preserving lightness. Default value is 0.0. Allowed range is from 0.0 to 1.0. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS colorcorrect .IX Subsection "colorcorrect" Adjust color white balance selectively for blacks and whites. This filter operates in YUV colorspace. .PP The filter accepts the following options: .IP \fBrl\fR 4 .IX Item "rl" Set the red shadow spot. Allowed range is from \-1.0 to 1.0. Default value is 0. .IP \fBbl\fR 4 .IX Item "bl" Set the blue shadow spot. Allowed range is from \-1.0 to 1.0. Default value is 0. .IP \fBrh\fR 4 .IX Item "rh" Set the red highlight spot. Allowed range is from \-1.0 to 1.0. Default value is 0. .IP \fBbh\fR 4 .IX Item "bh" Set the blue highlight spot. Allowed range is from \-1.0 to 1.0. Default value is 0. .IP \fBsaturation\fR 4 .IX Item "saturation" Set the amount of saturation. Allowed range is from \-3.0 to 3.0. Default value is 1. .IP \fBanalyze\fR 4 .IX Item "analyze" If set to anything other than \f(CW\*(C`manual\*(C'\fR it will analyze every frame and use derived parameters for filtering output frame. .Sp Possible values are: .RS 4 .IP \fBmanual\fR 4 .IX Item "manual" .PD 0 .IP \fBaverage\fR 4 .IX Item "average" .IP \fBminmax\fR 4 .IX Item "minmax" .IP \fBmedian\fR 4 .IX Item "median" .RE .RS 4 .PD .Sp Default value is \f(CW\*(C`manual\*(C'\fR. .RE .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS colorchannelmixer .IX Subsection "colorchannelmixer" Adjust video input frames by re-mixing color channels. .PP 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: .PP .Vb 1 \& =* + * + * + * .Ve .PP The filter accepts the following options: .IP \fBrr\fR 4 .IX Item "rr" .PD 0 .IP \fBrg\fR 4 .IX Item "rg" .IP \fBrb\fR 4 .IX Item "rb" .IP \fBra\fR 4 .IX Item "ra" .PD Adjust contribution of input red, green, blue and alpha channels for output red channel. Default is \f(CW1\fR for \fIrr\fR, and \f(CW0\fR for \fIrg\fR, \fIrb\fR and \fIra\fR. .IP \fBgr\fR 4 .IX Item "gr" .PD 0 .IP \fBgg\fR 4 .IX Item "gg" .IP \fBgb\fR 4 .IX Item "gb" .IP \fBga\fR 4 .IX Item "ga" .PD Adjust contribution of input red, green, blue and alpha channels for output green channel. Default is \f(CW1\fR for \fIgg\fR, and \f(CW0\fR for \fIgr\fR, \fIgb\fR and \fIga\fR. .IP \fBbr\fR 4 .IX Item "br" .PD 0 .IP \fBbg\fR 4 .IX Item "bg" .IP \fBbb\fR 4 .IX Item "bb" .IP \fBba\fR 4 .IX Item "ba" .PD Adjust contribution of input red, green, blue and alpha channels for output blue channel. Default is \f(CW1\fR for \fIbb\fR, and \f(CW0\fR for \fIbr\fR, \fIbg\fR and \fIba\fR. .IP \fBar\fR 4 .IX Item "ar" .PD 0 .IP \fBag\fR 4 .IX Item "ag" .IP \fBab\fR 4 .IX Item "ab" .IP \fBaa\fR 4 .IX Item "aa" .PD Adjust contribution of input red, green, blue and alpha channels for output alpha channel. Default is \f(CW1\fR for \fIaa\fR, and \f(CW0\fR for \fIar\fR, \fIag\fR and \fIab\fR. .Sp Allowed ranges for options are \f(CW\*(C`[\-2.0, 2.0]\*(C'\fR. .IP \fBpc\fR 4 .IX Item "pc" Set preserve color mode. The accepted values are: .RS 4 .IP \fBnone\fR 4 .IX Item "none" Disable color preserving, this is default. .IP \fBlum\fR 4 .IX Item "lum" Preserve luminance. .IP \fBmax\fR 4 .IX Item "max" Preserve max value of RGB triplet. .IP \fBavg\fR 4 .IX Item "avg" Preserve average value of RGB triplet. .IP \fBsum\fR 4 .IX Item "sum" Preserve sum value of RGB triplet. .IP \fBnrm\fR 4 .IX Item "nrm" Preserve normalized value of RGB triplet. .IP \fBpwr\fR 4 .IX Item "pwr" Preserve power value of RGB triplet. .RE .RS 4 .RE .IP \fBpa\fR 4 .IX Item "pa" Set the preserve color amount when changing colors. Allowed range is from \f(CW\*(C`[0.0, 1.0]\*(C'\fR. Default is \f(CW0.0\fR, thus disabled. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Convert source to grayscale: .Sp .Vb 1 \& colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3 .Ve .IP \(bu 4 Simulate sepia tones: .Sp .Vb 1 \& colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131 .Ve .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS colorize .IX Subsection "colorize" Overlay a solid color on the video stream. .PP The filter accepts the following options: .IP \fBhue\fR 4 .IX Item "hue" Set the color hue. Allowed range is from 0 to 360. Default value is 0. .IP \fBsaturation\fR 4 .IX Item "saturation" Set the color saturation. Allowed range is from 0 to 1. Default value is 0.5. .IP \fBlightness\fR 4 .IX Item "lightness" Set the color lightness. Allowed range is from 0 to 1. Default value is 0.5. .IP \fBmix\fR 4 .IX Item "mix" Set the mix of source lightness. By default is set to 1.0. Allowed range is from 0.0 to 1.0. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS colorkey .IX Subsection "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. .PP The filter accepts the following options: .IP \fBcolor\fR 4 .IX Item "color" Set the color for which alpha will be set to 0 (full transparency). See \fB"Color" section in the ffmpeg-utils manual\fR. Default is \f(CW\*(C`black\*(C'\fR. .IP \fBsimilarity\fR 4 .IX Item "similarity" 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 \f(CW0.01\fR. .IP \fBblend\fR 4 .IX Item "blend" 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 \f(CW0.0\fR. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Make every green pixel in the input image transparent: .Sp .Vb 1 \& ffmpeg \-i input.png \-vf colorkey=green out.png .Ve .IP \(bu 4 Overlay a greenscreen-video on top of a static background image. .Sp .Vb 1 \& 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 .Ve .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports same \fBcommands\fR as options. The command accepts the same syntax of the corresponding option. .PP If the specified expression is not valid, it is kept at its current value. .SS colorhold .IX Subsection "colorhold" Remove all color information for all RGB colors except for certain one. .PP The filter accepts the following options: .IP \fBcolor\fR 4 .IX Item "color" The color which will not be replaced with neutral gray. .IP \fBsimilarity\fR 4 .IX Item "similarity" Similarity percentage with the above color. 0.01 matches only the exact key color, while 1.0 matches everything. .IP \fBblend\fR 4 .IX Item "blend" Blend percentage. 0.0 makes pixels fully gray. Higher values result in more preserved color. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports same \fBcommands\fR as options. The command accepts the same syntax of the corresponding option. .PP If the specified expression is not valid, it is kept at its current value. .SS colorlevels .IX Subsection "colorlevels" Adjust video input frames using levels. .PP The filter accepts the following options: .IP \fBrimin\fR 4 .IX Item "rimin" .PD 0 .IP \fBgimin\fR 4 .IX Item "gimin" .IP \fBbimin\fR 4 .IX Item "bimin" .IP \fBaimin\fR 4 .IX Item "aimin" .PD Adjust red, green, blue and alpha input black point. Allowed ranges for options are \f(CW\*(C`[\-1.0, 1.0]\*(C'\fR. Defaults are \f(CW0\fR. .IP \fBrimax\fR 4 .IX Item "rimax" .PD 0 .IP \fBgimax\fR 4 .IX Item "gimax" .IP \fBbimax\fR 4 .IX Item "bimax" .IP \fBaimax\fR 4 .IX Item "aimax" .PD Adjust red, green, blue and alpha input white point. Allowed ranges for options are \f(CW\*(C`[\-1.0, 1.0]\*(C'\fR. Defaults are \f(CW1\fR. .Sp Input levels are used to lighten highlights (bright tones), darken shadows (dark tones), change the balance of bright and dark tones. .IP \fBromin\fR 4 .IX Item "romin" .PD 0 .IP \fBgomin\fR 4 .IX Item "gomin" .IP \fBbomin\fR 4 .IX Item "bomin" .IP \fBaomin\fR 4 .IX Item "aomin" .PD Adjust red, green, blue and alpha output black point. Allowed ranges for options are \f(CW\*(C`[0, 1.0]\*(C'\fR. Defaults are \f(CW0\fR. .IP \fBromax\fR 4 .IX Item "romax" .PD 0 .IP \fBgomax\fR 4 .IX Item "gomax" .IP \fBbomax\fR 4 .IX Item "bomax" .IP \fBaomax\fR 4 .IX Item "aomax" .PD Adjust red, green, blue and alpha output white point. Allowed ranges for options are \f(CW\*(C`[0, 1.0]\*(C'\fR. Defaults are \f(CW1\fR. .Sp Output levels allows manual selection of a constrained output level range. .IP \fBpreserve\fR 4 .IX Item "preserve" Set preserve color mode. The accepted values are: .RS 4 .IP \fBnone\fR 4 .IX Item "none" Disable color preserving, this is default. .IP \fBlum\fR 4 .IX Item "lum" Preserve luminance. .IP \fBmax\fR 4 .IX Item "max" Preserve max value of RGB triplet. .IP \fBavg\fR 4 .IX Item "avg" Preserve average value of RGB triplet. .IP \fBsum\fR 4 .IX Item "sum" Preserve sum value of RGB triplet. .IP \fBnrm\fR 4 .IX Item "nrm" Preserve normalized value of RGB triplet. .IP \fBpwr\fR 4 .IX Item "pwr" Preserve power value of RGB triplet. .RE .RS 4 .RE .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Make video output darker: .Sp .Vb 1 \& colorlevels=rimin=0.058:gimin=0.058:bimin=0.058 .Ve .IP \(bu 4 Increase contrast: .Sp .Vb 1 \& colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96 .Ve .IP \(bu 4 Make video output lighter: .Sp .Vb 1 \& colorlevels=rimax=0.902:gimax=0.902:bimax=0.902 .Ve .IP \(bu 4 Increase brightness: .Sp .Vb 1 \& colorlevels=romin=0.5:gomin=0.5:bomin=0.5 .Ve .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS colormap .IX Subsection "colormap" Apply custom color maps to video stream. .PP 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. .PP The filter accepts the following options: .IP \fBpatch_size\fR 4 .IX Item "patch_size" Set the source and target video stream patch size in pixels. .IP \fBnb_patches\fR 4 .IX Item "nb_patches" 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 \f(CW64\fR. .IP \fBtype\fR 4 .IX Item "type" Set the adjustments used for target colors. Can be \f(CW\*(C`relative\*(C'\fR or \f(CW\*(C`absolute\*(C'\fR. Defaults is \f(CW\*(C`absolute\*(C'\fR. .IP \fBkernel\fR 4 .IX Item "kernel" Set the kernel used to measure color differences between mapped colors. .Sp The accepted values are: .RS 4 .IP \fBeuclidean\fR 4 .IX Item "euclidean" .PD 0 .IP \fBweuclidean\fR 4 .IX Item "weuclidean" .RE .RS 4 .PD .Sp Default is \f(CW\*(C`euclidean\*(C'\fR. .RE .SS colormatrix .IX Subsection "colormatrix" Convert color matrix. .PP The filter accepts the following options: .IP \fBsrc\fR 4 .IX Item "src" .PD 0 .IP \fBdst\fR 4 .IX Item "dst" .PD Specify the source and destination color matrix. Both values must be specified. .Sp The accepted values are: .RS 4 .IP \fBbt709\fR 4 .IX Item "bt709" BT.709 .IP \fBfcc\fR 4 .IX Item "fcc" FCC .IP \fBbt601\fR 4 .IX Item "bt601" BT.601 .IP \fBbt470\fR 4 .IX Item "bt470" BT.470 .IP \fBbt470bg\fR 4 .IX Item "bt470bg" BT.470BG .IP \fBsmpte170m\fR 4 .IX Item "smpte170m" SMPTE\-170M .IP \fBsmpte240m\fR 4 .IX Item "smpte240m" SMPTE\-240M .IP \fBbt2020\fR 4 .IX Item "bt2020" BT.2020 .RE .RS 4 .RE .PP For example to convert from BT.601 to SMPTE\-240M, use the command: .PP .Vb 1 \& colormatrix=bt601:smpte240m .Ve .SS colorspace .IX Subsection "colorspace" Convert colorspace, transfer characteristics or color primaries. Input video needs to have an even size. .PP The filter accepts the following options: .IP \fBall\fR 4 .IX Item "all" Specify all color properties at once. .Sp The accepted values are: .RS 4 .IP \fBbt470m\fR 4 .IX Item "bt470m" BT.470M .IP \fBbt470bg\fR 4 .IX Item "bt470bg" BT.470BG .IP \fBbt601\-6\-525\fR 4 .IX Item "bt601-6-525" BT.601\-6 525 .IP \fBbt601\-6\-625\fR 4 .IX Item "bt601-6-625" BT.601\-6 625 .IP \fBbt709\fR 4 .IX Item "bt709" BT.709 .IP \fBsmpte170m\fR 4 .IX Item "smpte170m" SMPTE\-170M .IP \fBsmpte240m\fR 4 .IX Item "smpte240m" SMPTE\-240M .IP \fBbt2020\fR 4 .IX Item "bt2020" BT.2020 .RE .RS 4 .RE .IP \fBspace\fR 4 .IX Item "space" Specify output colorspace. .Sp The accepted values are: .RS 4 .IP \fBbt709\fR 4 .IX Item "bt709" BT.709 .IP \fBfcc\fR 4 .IX Item "fcc" FCC .IP \fBbt470bg\fR 4 .IX Item "bt470bg" BT.470BG or BT.601\-6 625 .IP \fBsmpte170m\fR 4 .IX Item "smpte170m" SMPTE\-170M or BT.601\-6 525 .IP \fBsmpte240m\fR 4 .IX Item "smpte240m" SMPTE\-240M .IP \fBycgco\fR 4 .IX Item "ycgco" YCgCo .IP \fBbt2020ncl\fR 4 .IX Item "bt2020ncl" BT.2020 with non-constant luminance .RE .RS 4 .RE .IP \fBtrc\fR 4 .IX Item "trc" Specify output transfer characteristics. .Sp The accepted values are: .RS 4 .IP \fBbt709\fR 4 .IX Item "bt709" BT.709 .IP \fBbt470m\fR 4 .IX Item "bt470m" BT.470M .IP \fBbt470bg\fR 4 .IX Item "bt470bg" BT.470BG .IP \fBgamma22\fR 4 .IX Item "gamma22" Constant gamma of 2.2 .IP \fBgamma28\fR 4 .IX Item "gamma28" Constant gamma of 2.8 .IP \fBsmpte170m\fR 4 .IX Item "smpte170m" SMPTE\-170M, BT.601\-6 625 or BT.601\-6 525 .IP \fBsmpte240m\fR 4 .IX Item "smpte240m" SMPTE\-240M .IP \fBsrgb\fR 4 .IX Item "srgb" SRGB .IP \fBiec61966\-2\-1\fR 4 .IX Item "iec61966-2-1" iec61966\-2\-1 .IP \fBiec61966\-2\-4\fR 4 .IX Item "iec61966-2-4" iec61966\-2\-4 .IP \fBxvycc\fR 4 .IX Item "xvycc" xvycc .IP \fBbt2020\-10\fR 4 .IX Item "bt2020-10" BT.2020 for 10\-bits content .IP \fBbt2020\-12\fR 4 .IX Item "bt2020-12" BT.2020 for 12\-bits content .RE .RS 4 .RE .IP \fBprimaries\fR 4 .IX Item "primaries" Specify output color primaries. .Sp The accepted values are: .RS 4 .IP \fBbt709\fR 4 .IX Item "bt709" BT.709 .IP \fBbt470m\fR 4 .IX Item "bt470m" BT.470M .IP \fBbt470bg\fR 4 .IX Item "bt470bg" BT.470BG or BT.601\-6 625 .IP \fBsmpte170m\fR 4 .IX Item "smpte170m" SMPTE\-170M or BT.601\-6 525 .IP \fBsmpte240m\fR 4 .IX Item "smpte240m" SMPTE\-240M .IP \fBfilm\fR 4 .IX Item "film" film .IP \fBsmpte431\fR 4 .IX Item "smpte431" SMPTE\-431 .IP \fBsmpte432\fR 4 .IX Item "smpte432" SMPTE\-432 .IP \fBbt2020\fR 4 .IX Item "bt2020" BT.2020 .IP \fBjedec\-p22\fR 4 .IX Item "jedec-p22" JEDEC P22 phosphors .RE .RS 4 .RE .IP \fBrange\fR 4 .IX Item "range" Specify output color range. .Sp The accepted values are: .RS 4 .IP \fBtv\fR 4 .IX Item "tv" TV (restricted) range .IP \fBmpeg\fR 4 .IX Item "mpeg" MPEG (restricted) range .IP \fBpc\fR 4 .IX Item "pc" PC (full) range .IP \fBjpeg\fR 4 .IX Item "jpeg" JPEG (full) range .RE .RS 4 .RE .IP \fBformat\fR 4 .IX Item "format" Specify output color format. .Sp The accepted values are: .RS 4 .IP \fByuv420p\fR 4 .IX Item "yuv420p" YUV 4:2:0 planar 8\-bits .IP \fByuv420p10\fR 4 .IX Item "yuv420p10" YUV 4:2:0 planar 10\-bits .IP \fByuv420p12\fR 4 .IX Item "yuv420p12" YUV 4:2:0 planar 12\-bits .IP \fByuv422p\fR 4 .IX Item "yuv422p" YUV 4:2:2 planar 8\-bits .IP \fByuv422p10\fR 4 .IX Item "yuv422p10" YUV 4:2:2 planar 10\-bits .IP \fByuv422p12\fR 4 .IX Item "yuv422p12" YUV 4:2:2 planar 12\-bits .IP \fByuv444p\fR 4 .IX Item "yuv444p" YUV 4:4:4 planar 8\-bits .IP \fByuv444p10\fR 4 .IX Item "yuv444p10" YUV 4:4:4 planar 10\-bits .IP \fByuv444p12\fR 4 .IX Item "yuv444p12" YUV 4:4:4 planar 12\-bits .RE .RS 4 .RE .IP \fBfast\fR 4 .IX Item "fast" Do a fast conversion, which skips gamma/primary correction. This will take significantly less CPU, but will be mathematically incorrect. To get output compatible with that produced by the colormatrix filter, use fast=1. .IP \fBdither\fR 4 .IX Item "dither" Specify dithering mode. .Sp The accepted values are: .RS 4 .IP \fBnone\fR 4 .IX Item "none" No dithering .IP \fBfsb\fR 4 .IX Item "fsb" Floyd-Steinberg dithering .RE .RS 4 .RE .IP \fBwpadapt\fR 4 .IX Item "wpadapt" Whitepoint adaptation mode. .Sp The accepted values are: .RS 4 .IP \fBbradford\fR 4 .IX Item "bradford" Bradford whitepoint adaptation .IP \fBvonkries\fR 4 .IX Item "vonkries" von Kries whitepoint adaptation .IP \fBidentity\fR 4 .IX Item "identity" identity whitepoint adaptation (i.e. no whitepoint adaptation) .RE .RS 4 .RE .IP \fBiall\fR 4 .IX Item "iall" Override all input properties at once. Same accepted values as \fBall\fR. .IP \fBispace\fR 4 .IX Item "ispace" Override input colorspace. Same accepted values as \fBspace\fR. .IP \fBiprimaries\fR 4 .IX Item "iprimaries" Override input color primaries. Same accepted values as \fBprimaries\fR. .IP \fBitrc\fR 4 .IX Item "itrc" Override input transfer characteristics. Same accepted values as \fBtrc\fR. .IP \fBirange\fR 4 .IX Item "irange" Override input color range. Same accepted values as \fBrange\fR. .PP 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. .PP For example to convert the input to SMPTE\-240M, use the command: .PP .Vb 1 \& colorspace=smpte240m .Ve .SS colorspace_cuda .IX Subsection "colorspace_cuda" CUDA accelerated implementation of the colorspace filter. .PP 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. .PP The filter accepts the following options: .IP \fBrange\fR 4 .IX Item "range" Specify output color range. .Sp The accepted values are: .RS 4 .IP \fBtv\fR 4 .IX Item "tv" TV (restricted) range .IP \fBmpeg\fR 4 .IX Item "mpeg" MPEG (restricted) range .IP \fBpc\fR 4 .IX Item "pc" PC (full) range .IP \fBjpeg\fR 4 .IX Item "jpeg" JPEG (full) range .RE .RS 4 .RE .SS colortemperature .IX Subsection "colortemperature" Adjust color temperature in video to simulate variations in ambient color temperature. .PP The filter accepts the following options: .IP \fBtemperature\fR 4 .IX Item "temperature" Set the temperature in Kelvin. Allowed range is from 1000 to 40000. Default value is 6500 K. .IP \fBmix\fR 4 .IX Item "mix" Set mixing with filtered output. Allowed range is from 0 to 1. Default value is 1. .IP \fBpl\fR 4 .IX Item "pl" Set the amount of preserving lightness. Allowed range is from 0 to 1. Default value is 0. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports same \fBcommands\fR as options. .SS convolution .IX Subsection "convolution" Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements. .PP The filter accepts the following options: .IP \fB0m\fR 4 .IX Item "0m" .PD 0 .IP \fB1m\fR 4 .IX Item "1m" .IP \fB2m\fR 4 .IX Item "2m" .IP \fB3m\fR 4 .IX Item "3m" .PD Set matrix for each plane. Matrix is sequence of 9, 25 or 49 signed integers in \fIsquare\fR mode, and from 1 to 49 odd number of signed integers in \fIrow\fR mode. .IP \fB0rdiv\fR 4 .IX Item "0rdiv" .PD 0 .IP \fB1rdiv\fR 4 .IX Item "1rdiv" .IP \fB2rdiv\fR 4 .IX Item "2rdiv" .IP \fB3rdiv\fR 4 .IX Item "3rdiv" .PD Set multiplier for calculated value for each plane. If unset or 0, it will be 1/sum of all matrix elements. .IP \fB0bias\fR 4 .IX Item "0bias" .PD 0 .IP \fB1bias\fR 4 .IX Item "1bias" .IP \fB2bias\fR 4 .IX Item "2bias" .IP \fB3bias\fR 4 .IX Item "3bias" .PD 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. .IP \fB0mode\fR 4 .IX Item "0mode" .PD 0 .IP \fB1mode\fR 4 .IX Item "1mode" .IP \fB2mode\fR 4 .IX Item "2mode" .IP \fB3mode\fR 4 .IX Item "3mode" .PD Set matrix mode for each plane. Can be \fIsquare\fR, \fIrow\fR or \fIcolumn\fR. Default is \fIsquare\fR. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .PP \fIExamples\fR .IX Subsection "Examples" .IP \(bu 4 Apply sharpen: .Sp .Vb 1 \& 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" .Ve .IP \(bu 4 Apply blur: .Sp .Vb 1 \& 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" .Ve .IP \(bu 4 Apply edge enhance: .Sp .Vb 1 \& 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" .Ve .IP \(bu 4 Apply edge detect: .Sp .Vb 1 \& 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" .Ve .IP \(bu 4 Apply laplacian edge detector which includes diagonals: .Sp .Vb 1 \& 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" .Ve .IP \(bu 4 Apply emboss: .Sp .Vb 1 \& 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" .Ve .SS convolve .IX Subsection "convolve" Apply 2D convolution of video stream in frequency domain using second stream as impulse. .PP The filter accepts the following options: .IP \fBplanes\fR 4 .IX Item "planes" Set which planes to process. .IP \fBimpulse\fR 4 .IX Item "impulse" Set which impulse video frames will be processed, can be \fIfirst\fR or \fIall\fR. Default is \fIall\fR. .PP The \f(CW\*(C`convolve\*(C'\fR filter also supports the \fBframesync\fR options. .SS copy .IX Subsection "copy" Copy the input video source unchanged to the output. This is mainly useful for testing purposes. .SS coreimage .IX Subsection "coreimage" Video filtering on GPU using Apple's CoreImage API on OSX. .PP 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. .PP 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. .PP The coreimage filter accepts the following options: .IP \fBlist_filters\fR 4 .IX Item "list_filters" 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. .Sp .Vb 1 \& list_filters=true .Ve .IP \fBfilter\fR 4 .IX Item "filter" Specify all filters by their respective name and options. Use \fIlist_filters\fR 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 \f(CW\*(C`default\*(C'\fR is available to use default options for a filter. .Sp It is required to specify either \f(CW\*(C`default\*(C'\fR 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: .Sp .Vb 1 \& filter=@