.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .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 \fI\s-1GRAPH_DESCRIPTION\s0\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 \fI\s-1GRAPH_DESCRIPTION\s0\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 \*(L"source\*(R", and a filter with no output pads is called a \*(L"sink\*(R". .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(CW\*(C`avfilter_graph_parse_ptr()\*(C'\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 \*(L",\*(R"\-separated filter descriptions. .PP A filtergraph consists of a sequence of filterchains. A sequence of filterchains is represented by a list of \*(L";\*(R"\-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\*(L". The name of the filter class is optionally followed by a string \&\*(R"=\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 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 \&\*(L"L1\*(R", the first input pad of overlay is labelled \*(L"L2\*(R", 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, \*(L"in\*(R" is assumed; if the output label of the last filter is not specified, \*(L"out\*(R" 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 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=\f(CIflags\f(CW;\*(C'\fR to the filtergraph description. .PP Here is a \s-1BNF\s0 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 \*(L"Quoting and escaping\*(R" section in the \fBffmpeg\-utils\fB\|(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 .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, \s-1NAN\s0 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, \s-1NAN\s0 if unknown .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 \s-1EOF\s0 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. .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 "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, \*(L"fatten\*(R" the sound and bring more \*(L"power\*(R" to the track. If a signal is compressed too much it may sound dull or \*(L"dead\*(R" afterwards or it may start to \*(L"pump\*(R" (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 \*(L"Attack\*(R" and \*(L"Release\*(R". \&\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 \s-1RMS\s0 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 \fBffmpeg\-utils\fB\|(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, can be \fI2nd\fR, \fI4th\fR or \fI8th\fR. Default is \fI4th\fR. .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 \*(L"digital\*(R". 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 \*(L"softer\*(R" 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 \*(L"natural\*(R" 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 \s-1DC.\s0 .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 \s-1LFO.\s0 By default disabled. .IP "\fBlforange\fR" 4 .IX Item "lforange" Set \s-1LFO\s0 range. .IP "\fBlforate\fR" 4 .IX Item "lforate" Set \s-1LFO\s0 rate. .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 "\fBw\fR" 4 .IX Item "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 "\fBo\fR" 4 .IX Item "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 "\fBa\fR" 4 .IX Item "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 "\fBt\fR" 4 .IX Item "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 "\fBb\fR" 4 .IX Item "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 "\fBm\fR" 4 .IX Item "m" Set overlap method. .Sp It accepts the following values: .RS 4 .IP "\fBa\fR" 4 .IX Item "a" Select overlap-add method. Even not interpolated samples are slightly changed with this method. .IP "\fBs\fR" 4 .IX Item "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 "\fBw\fR" 4 .IX Item "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 "\fBo\fR" 4 .IX Item "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 "\fBa\fR" 4 .IX Item "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 "\fBt\fR" 4 .IX Item "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 "\fBn\fR" 4 .IX Item "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 "\fBm\fR" 4 .IX Item "m" Set overlap method. .Sp It accepts the following values: .RS 4 .IP "\fBa\fR" 4 .IX Item "a" Select overlap-add method. Even not interpolated samples are slightly changed with this method. .IP "\fBs\fR" 4 .IX Item "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 "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 "aderivative, aintegral" .IX Subsection "aderivative, aintegral" Compute derivative/integral of audio stream. .PP Applying both filters one after another produces original audio. .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 \s-1EMI.\s0 .IP "\fBbsi\fR" 4 .IX Item "bsi" select \s-1BSI\s0 (78RPM). .IP "\fBriaa\fR" 4 .IX Item "riaa" select \s-1RIAA.\s0 .IP "\fBcd\fR" 4 .IX Item "cd" select Compact Disc (\s-1CD\s0). .IP "\fB50fm\fR" 4 .IX Item "50fm" select 50Xs (\s-1FM\s0). .IP "\fB75fm\fR" 4 .IX Item "75fm" select 75Xs (\s-1FM\s0). .IP "\fB50kf\fR" 4 .IX Item "50kf" select 50Xs (FM-KF). .IP "\fB75kf\fR" 4 .IX Item "75kf" select 75Xs (FM-KF). .RE .RS 4 .RE .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(\s-1CH\s0)\fR" 4 .IX Item "val(CH)" the value of input channel with number \fI\s-1CH\s0\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 "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 \fBffmpeg\-utils\fB\|(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 \fBffmpeg\-utils\fB\|(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 "\fBnofade\fR" 4 .IX Item "nofade" no fade applied .RE .RS 4 .RE .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 \s-1FFT.\s0 .PP A description of the accepted parameters follows. .IP "\fBnr\fR" 4 .IX Item "nr" Set the noise reduction in dB, allowed range is 0.01 to 97. Default value is 12 dB. .IP "\fBnf\fR" 4 .IX Item "nf" Set the noise floor in dB, allowed range is \-80 to \-20. Default value is \-50 dB. .IP "\fBnt\fR" 4 .IX Item "nt" Set the noise type. .Sp It accepts the following values: .RS 4 .IP "\fBw\fR" 4 .IX Item "w" Select white noise. .IP "\fBv\fR" 4 .IX Item "v" Select vinyl noise. .IP "\fBs\fR" 4 .IX Item "s" Select shellac noise. .IP "\fBc\fR" 4 .IX Item "c" Select custom noise, defined in \f(CW\*(C`bn\*(C'\fR option. .Sp Default value is white noise. .RE .RS 4 .RE .IP "\fBbn\fR" 4 .IX Item "bn" Set custom band noise for every one of 15 bands. Bands are separated by ' ' or '|'. .IP "\fBrf\fR" 4 .IX Item "rf" Set the residual floor in dB, allowed range is \-80 to \-20. Default value is \-38 dB. .IP "\fBtn\fR" 4 .IX Item "tn" Enable noise tracking. By default is disabled. With this enabled, noise floor is automatically adjusted. .IP "\fBtr\fR" 4 .IX Item "tr" Enable residual tracking. By default is disabled. .IP "\fBom\fR" 4 .IX Item "om" Set the output mode. .Sp It accepts the following values: .RS 4 .IP "\fBi\fR" 4 .IX Item "i" Pass input unchanged. .IP "\fBo\fR" 4 .IX Item "o" Pass noise filtered out. .IP "\fBn\fR" 4 .IX Item "n" Pass only noise. .Sp Default value is \fIo\fR. .RE .RS 4 .RE .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the following commands: .IP "\fBsample_noise, sn\fR" 4 .IX Item "sample_noise, sn" Start or stop measuring noise profile. Syntax for the command is : \*(L"start\*(R" or \*(L"stop\*(R" string. After measuring noise profile is stopped it will be automatically applied in filtering. .IP "\fBnoise_reduction, nr\fR" 4 .IX Item "noise_reduction, nr" Change noise reduction. Argument is single float number. Syntax for the command is : "\fInoise_reduction\fR" .IP "\fBnoise_floor, nf\fR" 4 .IX Item "noise_floor, nf" Change noise floor. Argument is single float number. Syntax for the command is : "\fInoise_floor\fR" .IP "\fBoutput_mode, om\fR" 4 .IX Item "output_mode, om" Change output mode operation. Syntax for the command is : \*(L"i\*(R", \*(L"o\*(R" or \*(L"n\*(R" string. .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 \*(L"re\*(R". 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 \*(L"im\*(R". .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. Default is \f(CW\*(C`hann\*(C'\fR. .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 .SS "afir" .IX Subsection "afir" Apply an arbitrary Finite Impulse Response filter. .PP This filter is designed for applying long \s-1FIR\s0 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 \s-1FIR\s0 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 \s-1IR\s0 is processed. .IP "\fBgtype\fR" 4 .IX Item "gtype" Enable applying gain measured from power of \s-1IR.\s0 .Sp Set which approach to use for auto gain measurement. .RS 4 .IP "\fBnone\fR" 4 .IX Item "none" Do not apply any gain. .IP "\fBpeak\fR" 4 .IX Item "peak" select peak gain, very conservative approach. This is default value. .IP "\fBdc\fR" 4 .IX Item "dc" select \s-1DC\s0 gain, limited application. .IP "\fBgn\fR" 4 .IX Item "gn" select gain to noise approach, this is most popular one. .RE .RS 4 .RE .IP "\fBirgain\fR" 4 .IX Item "irgain" Set gain to be applied to \s-1IR\s0 coefficients before filtering. Allowed range is 0 to 1. This gain is applied after any gain applied with \fIgtype\fR option. .IP "\fBirfmt\fR" 4 .IX Item "irfmt" Set format of \s-1IR\s0 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" Show \s-1IR\s0 frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream. By default it is disabled. .IP "\fBchannel\fR" 4 .IX Item "channel" Set for which \s-1IR\s0 channel to display frequency response. By default is first channel displayed. This option is used only when \fIresponse\fR is enabled. .IP "\fBsize\fR" 4 .IX Item "size" Set video stream size. This option is used only when \fIresponse\fR is enabled. .IP "\fBrate\fR" 4 .IX Item "rate" Set video stream frame rate. This option is used only when \fIresponse\fR is enabled. .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 \fI32768\fR. Lower values decreases latency at cost of higher \s-1CPU\s0 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 \fI32768\fR. Lower values may increase \s-1CPU\s0 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 \s-1IR\s0 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. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Apply reverb to stream using mono \s-1IR\s0 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 .SS "aformat" .IX Subsection "aformat" Set output format constraints for the input audio. The framework will negotiate the most appropriate format to minimize conversions. .PP It accepts the following parameters: .IP "\fBsample_fmts, f\fR" 4 .IX Item "sample_fmts, f" A '|'\-separated list of requested sample formats. .IP "\fBsample_rates, r\fR" 4 .IX Item "sample_rates, r" A '|'\-separated list of requested sample rates. .IP "\fBchannel_layouts, cl\fR" 4 .IX Item "channel_layouts, cl" A '|'\-separated list of requested channel layouts. .Sp See \fBthe Channel Layout section in the \fBffmpeg\-utils\fB\|(1) manual\fR for the required syntax. .PP If a parameter is omitted, all values are allowed. .PP Force the output to either unsigned 8\-bit or signed 16\-bit stereo .PP .Vb 1 \& aformat=sample_fmts=u8|s16:channel_layouts=stereo .Ve .SS "agate" .IX Subsection "agate" A gate is mainly used to reduce lower parts of a signal. This kind of signal processing reduces disturbing noise between useful signals. .PP Gating is done by detecting the volume below a chosen level \fIthreshold\fR and dividing it by the factor set with \fIratio\fR. The bottom of the noise floor is set via \fIrange\fR. Because an exact manipulation of the signal would cause distortion of the waveform the reduction can be levelled over time. This is done by setting \fIattack\fR and \fIrelease\fR. .PP \&\fIattack\fR determines how long the signal has to fall below the threshold before any reduction will occur and \fIrelease\fR sets the time the signal has to rise above the threshold to reduce the reduction again. Shorter signals than the chosen attack time will be left untouched. .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 by 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 \s-1RMS\s0 like one. Default is \f(CW\*(C`rms\*(C'\fR. Can be \f(CW\*(C`peak\*(C'\fR or \f(CW\*(C`rms\*(C'\fR. .IP "\fBlink\fR" 4 .IX Item "link" Choose if the average level between all channels or the louder channel affects the reduction. Default is \f(CW\*(C`average\*(C'\fR. Can be \f(CW\*(C`average\*(C'\fR or \f(CW\*(C`maximum\*(C'\fR. .SS "aiir" .IX Subsection "aiir" Apply an arbitrary Infinite Impulse Response filter. .PP It accepts the following parameters: .IP "\fBzeros, z\fR" 4 .IX Item "zeros, z" Set numerator/zeros coefficients. .IP "\fBpoles, p\fR" 4 .IX Item "poles, p" Set denominator/poles coefficients. .IP "\fBgains, k\fR" 4 .IX Item "gains, k" Set channels gains. .IP "\fBdry_gain\fR" 4 .IX Item "dry_gain" Set input gain. .IP "\fBwet_gain\fR" 4 .IX Item "wet_gain" Set output gain. .IP "\fBformat, f\fR" 4 .IX Item "format, f" Set coefficients format. .RS 4 .IP "\fBtf\fR" 4 .IX Item "tf" digital transfer function .IP "\fBzp\fR" 4 .IX Item "zp" Z\-plane zeros/poles, cartesian (default) .IP "\fBpr\fR" 4 .IX Item "pr" Z\-plane zeros/poles, polar radians .IP "\fBpd\fR" 4 .IX Item "pd" Z\-plane zeros/poles, polar degrees .IP "\fBsp\fR" 4 .IX Item "sp" S\-plane zeros/poles .RE .RS 4 .RE .IP "\fBprocess, r\fR" 4 .IX Item "process, r" Set kind of processing. Can be \f(CW\*(C`d\*(C'\fR \- direct or \f(CW\*(C`s\*(C'\fR \- serial cascading. Default is \f(CW\*(C`s\*(C'\fR. .IP "\fBprecision, e\fR" 4 .IX Item "precision, e" Set filtering precision. .RS 4 .IP "\fBdbl\fR" 4 .IX Item "dbl" double-precision floating-point (default) .IP "\fBflt\fR" 4 .IX Item "flt" single-precision floating-point .IP "\fBi32\fR" 4 .IX Item "i32" 32\-bit integers .IP "\fBi16\fR" 4 .IX Item "i16" 16\-bit integers .RE .RS 4 .RE .IP "\fBnormalize, n\fR" 4 .IX Item "normalize, n" Normalize filter coefficients, by default is enabled. Enabling it will normalize magnitude response at \s-1DC\s0 to 0dB. .IP "\fBmix\fR" 4 .IX Item "mix" How much to use filtered signal in output. Default is 1. Range is between 0 and 1. .IP "\fBresponse\fR" 4 .IX Item "response" Show \s-1IR\s0 frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream. By default it is disabled. .IP "\fBchannel\fR" 4 .IX Item "channel" Set for which \s-1IR\s0 channel to display frequency response. By default is first channel displayed. This option is used only when \fIresponse\fR is enabled. .IP "\fBsize\fR" 4 .IX Item "size" Set video stream size. This option is used only when \fIresponse\fR is enabled. .PP Coefficients in \f(CW\*(C`tf\*(C'\fR format are separated by spaces and are in ascending order. .PP Coefficients in \f(CW\*(C`zp\*(C'\fR format are separated by spaces and order of coefficients doesn't matter. Coefficients in \f(CW\*(C`zp\*(C'\fR format are complex numbers with \fIi\fR imaginary unit. .PP Different coefficients and gains can be provided for every channel, in such case use '|' to separate coefficients or gains. Last provided coefficients will be used for all remaining channels. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Apply 2 pole elliptic notch at around 5000Hz for 48000 Hz sample rate: .Sp .Vb 1 \& aiir=k=1:z=7.957584807809675810E\-1 \-2.575128568908332300 3.674839853930788710 \-2.57512875289799137 7.957586296317130880E\-1:p=1 \-2.86950072432325953 3.63022088054647218 \-2.28075678147272232 6.361362326477423500E\-1:f=tf:r=d .Ve .IP "\(bu" 4 Same as above but in \f(CW\*(C`zp\*(C'\fR format: .Sp .Vb 1 \& aiir=k=0.79575848078096756:z=0.80918701+0.58773007i 0.80918701\-0.58773007i 0.80884700+0.58784055i 0.80884700\-0.58784055i:p=0.63892345+0.59951235i 0.63892345\-0.59951235i 0.79582691+0.44198673i 0.79582691\-0.44198673i:f=zp:r=s .Ve .SS "alimiter" .IX Subsection "alimiter" The limiter prevents an input signal from rising over a desired threshold. This limiter uses lookahead technology to prevent your signal from distorting. It means that there is a small delay after the signal is processed. Keep in mind that the delay it produces is the attack time you set. .PP The filter accepts the following options: .IP "\fBlevel_in\fR" 4 .IX Item "level_in" Set input gain. Default is 1. .IP "\fBlevel_out\fR" 4 .IX Item "level_out" Set output gain. Default is 1. .IP "\fBlimit\fR" 4 .IX Item "limit" Don't let signals above this level pass the limiter. Default is 1. .IP "\fBattack\fR" 4 .IX Item "attack" The limiter will reach its attenuation level in this amount of time in milliseconds. Default is 5 milliseconds. .IP "\fBrelease\fR" 4 .IX Item "release" Come back from limiting to attenuation 1.0 in this amount of milliseconds. Default is 50 milliseconds. .IP "\fBasc\fR" 4 .IX Item "asc" When gain reduction is always needed \s-1ASC\s0 takes care of releasing to an average reduction level rather than reaching a reduction of 0 in the release time. .IP "\fBasc_level\fR" 4 .IX Item "asc_level" Select how much the release time is affected by \s-1ASC, 0\s0 means nearly no changes in release time while 1 produces higher release times. .IP "\fBlevel\fR" 4 .IX Item "level" Auto level output signal. Default is enabled. This normalizes audio back to 0dB if enabled. .PP Depending on picked setting it is recommended to upsample input 2x or 4x times with \fBaresample\fR before applying this filter. .SS "allpass" .IX Subsection "allpass" Apply a two-pole all-pass filter with central frequency (in Hz) \&\fIfrequency\fR, and filter-width \fIwidth\fR. An all-pass filter changes the audio's frequency to phase relationship without changing its frequency to amplitude relationship. .PP The filter accepts the following options: .IP "\fBfrequency, f\fR" 4 .IX Item "frequency, f" Set 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 "\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 \s-1DC\s0 to 0dB. .IP "\fBorder, o\fR" 4 .IX Item "order, o" Set the filter order, can be 1 or 2. Default is 2. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the following commands: .IP "\fBfrequency, f\fR" 4 .IX Item "frequency, f" Change allpass frequency. Syntax for the command is : "\fIfrequency\fR" .IP "\fBwidth_type, t\fR" 4 .IX Item "width_type, t" Change allpass width_type. Syntax for the command is : "\fIwidth_type\fR" .IP "\fBwidth, w\fR" 4 .IX Item "width, w" Change allpass width. Syntax for the command is : "\fIwidth\fR" .IP "\fBmix, m\fR" 4 .IX Item "mix, m" Change allpass mix. Syntax for the command is : "\fImix\fR" .SS "aloop" .IX Subsection "aloop" Loop audio samples. .PP The filter accepts the following options: .IP "\fBloop\fR" 4 .IX Item "loop" Set the number of loops. Setting this value to \-1 will result in infinite loops. Default is 0. .IP "\fBsize\fR" 4 .IX Item "size" Set maximal number of samples. Default is 0. .IP "\fBstart\fR" 4 .IX Item "start" Set first sample of loop. Default is 0. .SS "amerge" .IX Subsection "amerge" Merge two or more audio streams into a single multi-channel stream. .PP The filter accepts the following options: .IP "\fBinputs\fR" 4 .IX Item "inputs" Set the number of inputs. Default is 2. .PP If the channel layouts of the inputs are disjoint, and therefore compatible, the channel layout of the output will be set accordingly and the channels will be reordered as necessary. If the channel layouts of the inputs are not disjoint, the output will have all the channels of the first input then all the channels of the second input, in that order, and the channel layout of the output will be the default value corresponding to the total number of channels. .PP For example, if the first input is in 2.1 (\s-1FL+FR+LF\s0) and the second input is \s-1FC+BL+BR,\s0 then the output will be in 5.1, with the channels in the following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the first input, b1 is the first channel of the second input). .PP On the other hand, if both input are in stereo, the output channels will be in the default order: a1, a2, b1, b2, and the channel layout will be arbitrarily set to 4.0, which may or may not be the expected value. .PP All inputs must have the same sample rate, and format. .PP If inputs do not have the same duration, the output will stop with the shortest. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Merge two mono files into a stereo stream: .Sp .Vb 1 \& amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge .Ve .IP "\(bu" 4 Multiple merges assuming 1 video stream and 6 audio streams in \fIinput.mkv\fR: .Sp .Vb 1 \& ffmpeg \-i input.mkv \-filter_complex "[0:1][0:2][0:3][0:4][0:5][0:6] amerge=inputs=6" \-c:a pcm_s16le output.mkv .Ve .SS "amix" .IX Subsection "amix" Mixes multiple audio inputs into a single output. .PP Note that this filter only supports float samples (the \fIamerge\fR and \fIpan\fR audio filters support many formats). If the \fIamix\fR input has integer samples then \fBaresample\fR will be automatically inserted to perform the conversion to float samples. .PP For example .PP .Vb 1 \& ffmpeg \-i INPUT1 \-i INPUT2 \-i INPUT3 \-filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT .Ve .PP will mix 3 input audio streams to a single output with the same duration as the first input and a dropout transition time of 3 seconds. .PP It accepts the following parameters: .IP "\fBinputs\fR" 4 .IX Item "inputs" The number of inputs. If unspecified, it defaults to 2. .IP "\fBduration\fR" 4 .IX Item "duration" How to determine the end-of-stream. .RS 4 .IP "\fBlongest\fR" 4 .IX Item "longest" The duration of the longest input. (default) .IP "\fBshortest\fR" 4 .IX Item "shortest" The duration of the shortest input. .IP "\fBfirst\fR" 4 .IX Item "first" The duration of the first input. .RE .RS 4 .RE .IP "\fBdropout_transition\fR" 4 .IX Item "dropout_transition" The transition time, in seconds, for volume renormalization when an input stream ends. The default value is 2 seconds. .IP "\fBweights\fR" 4 .IX Item "weights" Specify weight of each input audio stream as sequence. Each weight is separated by space. By default all inputs have same weight. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the following commands: .IP "\fBweights\fR" 4 .IX Item "weights" Syntax is same as option with same name. .SS "amultiply" .IX Subsection "amultiply" Multiply first audio stream with second audio stream and store result in output audio stream. Multiplication is done by multiplying each sample from first stream with sample at same position from second stream. .PP With this element-wise multiplication one can create amplitude fades and amplitude modulations. .SS "anequalizer" .IX Subsection "anequalizer" High-order parametric multiband equalizer for each channel. .PP It accepts the following parameters: .IP "\fBparams\fR" 4 .IX Item "params" This option string is in format: "c\fIchn\fR f=\fIcf\fR w=\fIw\fR g=\fIg\fR t=\fIf\fR | ..." Each equalizer band is separated by '|'. .RS 4 .IP "\fBchn\fR" 4 .IX Item "chn" Set channel number to which equalization will be applied. If input doesn't have that channel the entry is ignored. .IP "\fBf\fR" 4 .IX Item "f" Set central frequency for band. If input doesn't have that frequency the entry is ignored. .IP "\fBw\fR" 4 .IX Item "w" Set band width in hertz. .IP "\fBg\fR" 4 .IX Item "g" Set band gain in dB. .IP "\fBt\fR" 4 .IX Item "t" Set filter type for band, optional, can be: .RS 4 .IP "\fB0\fR" 4 .IX Item "0" Butterworth, this is default. .IP "\fB1\fR" 4 .IX Item "1" Chebyshev type 1. .IP "\fB2\fR" 4 .IX Item "2" Chebyshev type 2. .RE .RS 4 .RE .RE .RS 4 .RE .IP "\fBcurves\fR" 4 .IX Item "curves" With this option activated frequency response of anequalizer is displayed in video stream. .IP "\fBsize\fR" 4 .IX Item "size" Set video stream size. Only useful if curves option is activated. .IP "\fBmgain\fR" 4 .IX Item "mgain" Set max gain that will be displayed. Only useful if curves option is activated. Setting this to a reasonable value makes it possible to display gain which is derived from neighbour bands which are too close to each other and thus produce higher gain when both are activated. .IP "\fBfscale\fR" 4 .IX Item "fscale" Set frequency scale used to draw frequency response in video output. Can be linear or logarithmic. Default is logarithmic. .IP "\fBcolors\fR" 4 .IX Item "colors" Set color for each channel curve which is going to be displayed in video stream. This is list of color names separated by space or by '|'. Unrecognised or missing colors will be replaced by white color. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Lower gain by 10 of central frequency 200Hz and width 100 Hz for first 2 channels using Chebyshev type 1 filter: .Sp .Vb 1 \& anequalizer=c0 f=200 w=100 g=\-10 t=1|c1 f=200 w=100 g=\-10 t=1 .Ve .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the following commands: .IP "\fBchange\fR" 4 .IX Item "change" Alter existing filter parameters. Syntax for the commands is : "\fIfN\fR|f=\fIfreq\fR|w=\fIwidth\fR|g=\fIgain\fR" .Sp \&\fIfN\fR is existing filter number, starting from 0, if no such filter is available error is returned. \&\fIfreq\fR set new frequency parameter. \&\fIwidth\fR set new width parameter in herz. \&\fIgain\fR set new gain parameter in dB. .Sp Full filter invocation with asendcmd may look like this: asendcmd=c='4.0 anequalizer change 0|f=200|w=50|g=1',anequalizer=... .SS "anlmdn" .IX Subsection "anlmdn" Reduce broadband noise in audio samples using Non-Local Means algorithm. .PP Each sample is adjusted by looking for other samples with similar contexts. This context similarity is defined by comparing their surrounding patches of size \&\fBp\fR. Patches are searched in an area of \fBr\fR around the sample. .PP The filter accepts the following options: .IP "\fBs\fR" 4 .IX Item "s" Set denoising strength. Allowed range is from 0.00001 to 10. Default value is 0.00001. .IP "\fBp\fR" 4 .IX Item "p" Set patch radius duration. Allowed range is from 1 to 100 milliseconds. Default value is 2 milliseconds. .IP "\fBr\fR" 4 .IX Item "r" Set research radius duration. Allowed range is from 2 to 300 milliseconds. Default value is 6 milliseconds. .IP "\fBo\fR" 4 .IX Item "o" Set the output mode. .Sp It accepts the following values: .RS 4 .IP "\fBi\fR" 4 .IX Item "i" Pass input unchanged. .IP "\fBo\fR" 4 .IX Item "o" Pass noise filtered out. .IP "\fBn\fR" 4 .IX Item "n" Pass only noise. .Sp Default value is \fIo\fR. .RE .RS 4 .RE .IP "\fBm\fR" 4 .IX Item "m" Set smooth factor. Default value is \fI11\fR. Allowed range is from \fI1\fR to \fI15\fR. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the following commands: .IP "\fBs\fR" 4 .IX Item "s" Change denoise strength. Argument is single float number. Syntax for the command is : "\fIs\fR" .IP "\fBo\fR" 4 .IX Item "o" Change output mode. Syntax for the command is : \*(L"i\*(R", \*(L"o\*(R" or \*(L"n\*(R" string. .SS "anlms" .IX Subsection "anlms" Apply Normalized Least-Mean-Squares algorithm to the first audio stream using the second audio stream. .PP This adaptive filter is used to mimic a desired filter by finding the filter coefficients that relate to producing the least mean square of the error signal (difference between the desired, 2nd input audio stream and the actual signal, the 1st input audio stream). .PP A description of the accepted options follows. .IP "\fBorder\fR" 4 .IX Item "order" Set filter order. .IP "\fBmu\fR" 4 .IX Item "mu" Set filter mu. .IP "\fBeps\fR" 4 .IX Item "eps" Set the filter eps. .IP "\fBleakage\fR" 4 .IX Item "leakage" Set the filter leakage. .IP "\fBout_mode\fR" 4 .IX Item "out_mode" 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 filtered samples. .IP "\fBn\fR" 4 .IX Item "n" Pass difference between desired and filtered samples. .Sp Default value is \fIo\fR. .RE .RS 4 .RE .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 One of many usages of this filter is noise reduction, input audio is filtered with same samples that are delayed by fixed amount, one such example for stereo audio is: .Sp .Vb 1 \& asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o .Ve .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the same commands as options, excluding option \f(CW\*(C`order\*(C'\fR. .SS "anull" .IX Subsection "anull" Pass the audio source unchanged to the output. .SS "apad" .IX Subsection "apad" Pad the end of an audio stream with silence. .PP This can be used together with \fBffmpeg\fR \fB\-shortest\fR to extend audio streams to the same length as the video stream. .PP A description of the accepted options follows. .IP "\fBpacket_size\fR" 4 .IX Item "packet_size" Set silence packet size. Default value is 4096. .IP "\fBpad_len\fR" 4 .IX Item "pad_len" Set the number of samples of silence to add to the end. After the value is reached, the stream is terminated. This option is mutually exclusive with \fBwhole_len\fR. .IP "\fBwhole_len\fR" 4 .IX Item "whole_len" Set the minimum total number of samples in the output audio stream. If the value is longer than the input audio length, silence is added to the end, until the value is reached. This option is mutually exclusive with \fBpad_len\fR. .IP "\fBpad_dur\fR" 4 .IX Item "pad_dur" Specify the duration of samples of silence to add. See \&\fBthe Time duration section in the \fBffmpeg\-utils\fB\|(1) manual\fR for the accepted syntax. Used only if set to non-zero value. .IP "\fBwhole_dur\fR" 4 .IX Item "whole_dur" Specify the minimum total duration in the output audio stream. See \&\fBthe Time duration section in the \fBffmpeg\-utils\fB\|(1) manual\fR for the accepted syntax. Used only if set to non-zero value. If the value is longer than the input audio length, silence is added to the end, until the value is reached. This option is mutually exclusive with \fBpad_dur\fR .PP If neither the \fBpad_len\fR nor the \fBwhole_len\fR nor \fBpad_dur\fR nor \fBwhole_dur\fR option is set, the filter will add silence to the end of the input stream indefinitely. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Add 1024 samples of silence to the end of the input: .Sp .Vb 1 \& apad=pad_len=1024 .Ve .IP "\(bu" 4 Make sure the audio output will contain at least 10000 samples, pad the input with silence if required: .Sp .Vb 1 \& apad=whole_len=10000 .Ve .IP "\(bu" 4 Use \fBffmpeg\fR to pad the audio input with silence, so that the video stream will always result the shortest and will be converted until the end in the output file when using the \fBshortest\fR option: .Sp .Vb 1 \& ffmpeg \-i VIDEO \-i AUDIO \-filter_complex "[1:0]apad" \-shortest OUTPUT .Ve .SS "aphaser" .IX Subsection "aphaser" Add a phasing effect to the input audio. .PP A phaser filter creates series of peaks and troughs in the frequency spectrum. The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect. .PP A description of the accepted parameters follows. .IP "\fBin_gain\fR" 4 .IX Item "in_gain" Set input gain. Default is 0.4. .IP "\fBout_gain\fR" 4 .IX Item "out_gain" Set output gain. Default is 0.74 .IP "\fBdelay\fR" 4 .IX Item "delay" Set delay in milliseconds. Default is 3.0. .IP "\fBdecay\fR" 4 .IX Item "decay" Set decay. Default is 0.4. .IP "\fBspeed\fR" 4 .IX Item "speed" Set modulation speed in Hz. Default is 0.5. .IP "\fBtype\fR" 4 .IX Item "type" Set modulation type. Default is triangular. .Sp It accepts the following values: .RS 4 .IP "\fBtriangular, t\fR" 4 .IX Item "triangular, t" .PD 0 .IP "\fBsinusoidal, s\fR" 4 .IX Item "sinusoidal, s" .RE .RS 4 .RE .PD .SS "apulsator" .IX Subsection "apulsator" Audio pulsator is something between an autopanner and a tremolo. But it can produce funny stereo effects as well. Pulsator changes the volume of the left and right channel based on a \s-1LFO\s0 (low frequency oscillator) with different waveforms and shifted phases. This filter have the ability to define an offset between left and right channel. An offset of 0 means that both \s-1LFO\s0 shapes match each other. The left and right channel are altered equally \- a conventional tremolo. An offset of 50% means that the shape of the right channel is exactly shifted in phase (or moved backwards about half of the frequency) \- pulsator acts as an autopanner. At 1 both curves match again. Every setting in between moves the phase shift gapless between all stages and produces some \*(L"bypassing\*(R" sounds with sine and triangle waveforms. The more you set the offset near 1 (starting from the 0.5) the faster the signal passes from the left to the right speaker. .PP The filter accepts the following options: .IP "\fBlevel_in\fR" 4 .IX Item "level_in" Set input gain. By default it is 1. Range is [0.015625 \- 64]. .IP "\fBlevel_out\fR" 4 .IX Item "level_out" Set output gain. By default it is 1. Range is [0.015625 \- 64]. .IP "\fBmode\fR" 4 .IX Item "mode" Set waveform shape the \s-1LFO\s0 will use. Can be one of: sine, triangle, square, sawup or sawdown. Default is sine. .IP "\fBamount\fR" 4 .IX Item "amount" Set modulation. Define how much of original signal is affected by the \s-1LFO.\s0 .IP "\fBoffset_l\fR" 4 .IX Item "offset_l" Set left channel offset. Default is 0. Allowed range is [0 \- 1]. .IP "\fBoffset_r\fR" 4 .IX Item "offset_r" Set right channel offset. Default is 0.5. Allowed range is [0 \- 1]. .IP "\fBwidth\fR" 4 .IX Item "width" Set pulse width. Default is 1. Allowed range is [0 \- 2]. .IP "\fBtiming\fR" 4 .IX Item "timing" Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz. .IP "\fBbpm\fR" 4 .IX Item "bpm" Set bpm. Default is 120. Allowed range is [30 \- 300]. Only used if timing is set to bpm. .IP "\fBms\fR" 4 .IX Item "ms" Set ms. Default is 500. Allowed range is [10 \- 2000]. Only used if timing is set to ms. .IP "\fBhz\fR" 4 .IX Item "hz" Set frequency in Hz. Default is 2. Allowed range is [0.01 \- 100]. Only used if timing is set to hz. .SS "aresample" .IX Subsection "aresample" Resample the input audio to the specified parameters, using the libswresample library. If none are specified then the filter will automatically convert between its input and output. .PP This filter is also able to stretch/squeeze the audio data to make it match the timestamps or to inject silence / cut out audio to make it match the timestamps, do a combination of both or do neither. .PP The filter accepts the syntax [\fIsample_rate\fR:]\fIresampler_options\fR, where \fIsample_rate\fR expresses a sample rate and \fIresampler_options\fR is a list of \&\fIkey\fR=\fIvalue\fR pairs, separated by \*(L":\*(R". See the \&\fB\*(L"Resampler Options\*(R" section in the \&\fBffmpeg\-resampler\fB\|(1) manual\fR for the complete list of supported options. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Resample the input audio to 44100Hz: .Sp .Vb 1 \& aresample=44100 .Ve .IP "\(bu" 4 Stretch/squeeze samples to the given timestamps, with a maximum of 1000 samples per second compensation: .Sp .Vb 1 \& aresample=async=1000 .Ve .SS "areverse" .IX Subsection "areverse" Reverse an audio clip. .PP Warning: This filter requires memory to buffer the entire clip, so trimming is suggested. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Take the first 5 seconds of a clip, and reverse it. .Sp .Vb 1 \& atrim=end=5,areverse .Ve .SS "arnndn" .IX Subsection "arnndn" Reduce noise from speech using Recurrent Neural Networks. .PP This filter accepts the following options: .IP "\fBmodel, m\fR" 4 .IX Item "model, m" Set train model file to load. This option is always required. .SS "asetnsamples" .IX Subsection "asetnsamples" Set the number of samples per each output audio frame. .PP The last output packet may contain a different number of samples, as the filter will flush all the remaining samples when the input audio signals its end. .PP The filter accepts the following options: .IP "\fBnb_out_samples, n\fR" 4 .IX Item "nb_out_samples, n" Set the number of frames per each output audio frame. The number is intended as the number of samples \fIper each channel\fR. Default value is 1024. .IP "\fBpad, p\fR" 4 .IX Item "pad, p" If set to 1, the filter will pad the last audio frame with zeroes, so that the last frame will contain the same number of samples as the previous ones. Default value is 1. .PP For example, to set the number of per-frame samples to 1234 and disable padding for the last frame, use: .PP .Vb 1 \& asetnsamples=n=1234:p=0 .Ve .SS "asetrate" .IX Subsection "asetrate" Set the sample rate without altering the \s-1PCM\s0 data. This will result in a change of speed and pitch. .PP The filter accepts the following options: .IP "\fBsample_rate, r\fR" 4 .IX Item "sample_rate, r" Set the output sample rate. Default is 44100 Hz. .SS "ashowinfo" .IX Subsection "ashowinfo" Show a line containing various information for each input audio frame. The input audio is not modified. .PP The shown line contains a sequence of key/value pairs of the form \&\fIkey\fR:\fIvalue\fR. .PP The following values are shown in the output: .IP "\fBn\fR" 4 .IX Item "n" The (sequential) number of the input frame, starting from 0. .IP "\fBpts\fR" 4 .IX Item "pts" The presentation timestamp of the input frame, in time base units; the time base depends on the filter input pad, and is usually 1/\fIsample_rate\fR. .IP "\fBpts_time\fR" 4 .IX Item "pts_time" The presentation timestamp of the input frame in seconds. .IP "\fBpos\fR" 4 .IX Item "pos" position of the frame in the input stream, \-1 if this information in unavailable and/or meaningless (for example in case of synthetic audio) .IP "\fBfmt\fR" 4 .IX Item "fmt" The sample format. .IP "\fBchlayout\fR" 4 .IX Item "chlayout" The channel layout. .IP "\fBrate\fR" 4 .IX Item "rate" The sample rate for the audio frame. .IP "\fBnb_samples\fR" 4 .IX Item "nb_samples" The number of samples (per channel) in the frame. .IP "\fBchecksum\fR" 4 .IX Item "checksum" The Adler\-32 checksum (printed in hexadecimal) of the audio data. For planar audio, the data is treated as if all the planes were concatenated. .IP "\fBplane_checksums\fR" 4 .IX Item "plane_checksums" A list of Adler\-32 checksums for each data plane. .SS "asoftclip" .IX Subsection "asoftclip" Apply audio soft clipping. .PP Soft clipping is a type of distortion effect where the amplitude of a signal is saturated along a smooth curve, rather than the abrupt shape of hard-clipping. .PP This filter accepts the following options: .IP "\fBtype\fR" 4 .IX Item "type" Set type of soft-clipping. .Sp It accepts the following values: .RS 4 .IP "\fBtanh\fR" 4 .IX Item "tanh" .PD 0 .IP "\fBatan\fR" 4 .IX Item "atan" .IP "\fBcubic\fR" 4 .IX Item "cubic" .IP "\fBexp\fR" 4 .IX Item "exp" .IP "\fBalg\fR" 4 .IX Item "alg" .IP "\fBquintic\fR" 4 .IX Item "quintic" .IP "\fBsin\fR" 4 .IX Item "sin" .RE .RS 4 .RE .IP "\fBparam\fR" 4 .IX Item "param" .PD Set additional parameter which controls sigmoid function. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS "asr" .IX Subsection "asr" Automatic Speech Recognition .PP This filter uses PocketSphinx for speech recognition. To enable compilation of this filter, you need to configure FFmpeg with \&\f(CW\*(C`\-\-enable\-pocketsphinx\*(C'\fR. .PP It accepts the following options: .IP "\fBrate\fR" 4 .IX Item "rate" Set sampling rate of input audio. Defaults is \f(CW16000\fR. This need to match speech models, otherwise one will get poor results. .IP "\fBhmm\fR" 4 .IX Item "hmm" Set dictionary containing acoustic model files. .IP "\fBdict\fR" 4 .IX Item "dict" Set pronunciation dictionary. .IP "\fBlm\fR" 4 .IX Item "lm" Set language model file. .IP "\fBlmctl\fR" 4 .IX Item "lmctl" Set language model set. .IP "\fBlmname\fR" 4 .IX Item "lmname" Set which language model to use. .IP "\fBlogfn\fR" 4 .IX Item "logfn" Set output for log messages. .PP The filter exports recognized speech as the frame metadata \f(CW\*(C`lavfi.asr.text\*(C'\fR. .SS "astats" .IX Subsection "astats" Display time domain statistical information about the audio channels. Statistics are calculated and displayed for each audio channel and, where applicable, an overall figure is also given. .PP It accepts the following option: .IP "\fBlength\fR" 4 .IX Item "length" Short window length in seconds, used for peak and trough \s-1RMS\s0 measurement. Default is \f(CW0.05\fR (50 milliseconds). Allowed range is \f(CW\*(C`[0.01 \- 10]\*(C'\fR. .IP "\fBmetadata\fR" 4 .IX Item "metadata" Set metadata injection. All the metadata keys are prefixed with \f(CW\*(C`lavfi.astats.X\*(C'\fR, where \f(CW\*(C`X\*(C'\fR is channel number starting from 1 or string \f(CW\*(C`Overall\*(C'\fR. Default is disabled. .Sp Available keys for each channel are: DC_offset Min_level Max_level Min_difference Max_difference Mean_difference RMS_difference Peak_level RMS_peak RMS_trough Crest_factor Flat_factor Peak_count Noise_floor Noise_floor_count Bit_depth Dynamic_range Zero_crossings Zero_crossings_rate Number_of_NaNs Number_of_Infs Number_of_denormals .Sp and for Overall: DC_offset Min_level Max_level Min_difference Max_difference Mean_difference RMS_difference Peak_level RMS_level RMS_peak RMS_trough Flat_factor Peak_count Noise_floor Noise_floor_count Bit_depth Number_of_samples Number_of_NaNs Number_of_Infs Number_of_denormals .Sp For example full key look like this \f(CW\*(C`lavfi.astats.1.DC_offset\*(C'\fR or this \f(CW\*(C`lavfi.astats.Overall.Peak_count\*(C'\fR. .Sp For description what each key means read below. .IP "\fBreset\fR" 4 .IX Item "reset" Set number of frame after which stats are going to be recalculated. Default is disabled. .IP "\fBmeasure_perchannel\fR" 4 .IX Item "measure_perchannel" Select the entries which need to be measured per channel. The metadata keys can be used as flags, default is \fBall\fR which measures everything. \&\fBnone\fR disables all per channel measurement. .IP "\fBmeasure_overall\fR" 4 .IX Item "measure_overall" Select the entries which need to be measured overall. The metadata keys can be used as flags, default is \fBall\fR which measures everything. \&\fBnone\fR disables all overall measurement. .PP A description of each shown parameter follows: .IP "\fB\s-1DC\s0 offset\fR" 4 .IX Item "DC offset" Mean amplitude displacement from zero. .IP "\fBMin level\fR" 4 .IX Item "Min level" Minimal sample level. .IP "\fBMax level\fR" 4 .IX Item "Max level" Maximal sample level. .IP "\fBMin difference\fR" 4 .IX Item "Min difference" Minimal difference between two consecutive samples. .IP "\fBMax difference\fR" 4 .IX Item "Max difference" Maximal difference between two consecutive samples. .IP "\fBMean difference\fR" 4 .IX Item "Mean difference" Mean difference between two consecutive samples. The average of each difference between two consecutive samples. .IP "\fB\s-1RMS\s0 difference\fR" 4 .IX Item "RMS difference" Root Mean Square difference between two consecutive samples. .IP "\fBPeak level dB\fR" 4 .IX Item "Peak level dB" .PD 0 .IP "\fB\s-1RMS\s0 level dB\fR" 4 .IX Item "RMS level dB" .PD Standard peak and \s-1RMS\s0 level measured in dBFS. .IP "\fB\s-1RMS\s0 peak dB\fR" 4 .IX Item "RMS peak dB" .PD 0 .IP "\fB\s-1RMS\s0 trough dB\fR" 4 .IX Item "RMS trough dB" .PD Peak and trough values for \s-1RMS\s0 level measured over a short window. .IP "\fBCrest factor\fR" 4 .IX Item "Crest factor" Standard ratio of peak to \s-1RMS\s0 level (note: not in dB). .IP "\fBFlat factor\fR" 4 .IX Item "Flat factor" Flatness (i.e. consecutive samples with the same value) of the signal at its peak levels (i.e. either \fIMin level\fR or \fIMax level\fR). .IP "\fBPeak count\fR" 4 .IX Item "Peak count" Number of occasions (not the number of samples) that the signal attained either \&\fIMin level\fR or \fIMax level\fR. .IP "\fBNoise floor dB\fR" 4 .IX Item "Noise floor dB" Minimum local peak measured in dBFS over a short window. .IP "\fBNoise floor count\fR" 4 .IX Item "Noise floor count" Number of occasions (not the number of samples) that the signal attained \&\fINoise floor\fR. .IP "\fBBit depth\fR" 4 .IX Item "Bit depth" Overall bit depth of audio. Number of bits used for each sample. .IP "\fBDynamic range\fR" 4 .IX Item "Dynamic range" Measured dynamic range of audio in dB. .IP "\fBZero crossings\fR" 4 .IX Item "Zero crossings" Number of points where the waveform crosses the zero level axis. .IP "\fBZero crossings rate\fR" 4 .IX Item "Zero crossings rate" Rate of Zero crossings and number of audio samples. .SS "asubboost" .IX Subsection "asubboost" Boost subwoofer frequencies. .PP The filter accepts the following options: .IP "\fBdry\fR" 4 .IX Item "dry" Set dry gain, how much of original signal is kept. Allowed range is from 0 to 1. Default value is 0.5. .IP "\fBwet\fR" 4 .IX Item "wet" Set wet gain, how much of filtered signal is kept. Allowed range is from 0 to 1. Default value is 0.8. .IP "\fBdecay\fR" 4 .IX Item "decay" Set delay line decay gain value. Allowed range is from 0 to 1. Default value is 0.7. .IP "\fBfeedback\fR" 4 .IX Item "feedback" Set delay line feedback gain value. Allowed range is from 0 to 1. Default value is 0.5. .IP "\fBcutoff\fR" 4 .IX Item "cutoff" Set cutoff frequency in herz. Allowed range is 50 to 900. Default value is 100. .IP "\fBslope\fR" 4 .IX Item "slope" Set slope amount for cutoff frequency. Allowed range is 0.0001 to 1. Default value is 0.5. .IP "\fBdelay\fR" 4 .IX Item "delay" Set delay. Allowed range is from 1 to 100. Default value is 20. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS "atempo" .IX Subsection "atempo" Adjust audio tempo. .PP The filter accepts exactly one parameter, the audio tempo. If not specified then the filter will assume nominal 1.0 tempo. Tempo must be in the [0.5, 100.0] range. .PP Note that tempo greater than 2 will skip some samples rather than blend them in. If for any reason this is a concern it is always possible to daisy-chain several instances of atempo to achieve the desired product tempo. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Slow down audio to 80% tempo: .Sp .Vb 1 \& atempo=0.8 .Ve .IP "\(bu" 4 To speed up audio to 300% tempo: .Sp .Vb 1 \& atempo=3 .Ve .IP "\(bu" 4 To speed up audio to 300% tempo by daisy-chaining two atempo instances: .Sp .Vb 1 \& atempo=sqrt(3),atempo=sqrt(3) .Ve .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" .SS "atrim" .IX Subsection "atrim" Trim the input so that the output contains one continuous subpart of the input. .PP It accepts the following parameters: .IP "\fBstart\fR" 4 .IX Item "start" Timestamp (in seconds) of the start of the section to keep. I.e. the audio sample with the timestamp \fIstart\fR will be the first sample in the output. .IP "\fBend\fR" 4 .IX Item "end" Specify time of the first audio sample that will be dropped, i.e. the audio sample immediately preceding the one with the timestamp \fIend\fR will be the last sample in the output. .IP "\fBstart_pts\fR" 4 .IX Item "start_pts" Same as \fIstart\fR, except this option sets the start timestamp in samples instead of seconds. .IP "\fBend_pts\fR" 4 .IX Item "end_pts" Same as \fIend\fR, except this option sets the end timestamp in samples instead of seconds. .IP "\fBduration\fR" 4 .IX Item "duration" The maximum duration of the output in seconds. .IP "\fBstart_sample\fR" 4 .IX Item "start_sample" The number of the first sample that should be output. .IP "\fBend_sample\fR" 4 .IX Item "end_sample" The number of the first sample that should be dropped. .PP \&\fBstart\fR, \fBend\fR, and \fBduration\fR are expressed as time duration specifications; see \&\fBthe Time duration section in the \fBffmpeg\-utils\fB\|(1) manual\fR. .PP Note that the first two sets of the start/end options and the \fBduration\fR option look at the frame timestamp, while the _sample options simply count the samples that pass through the filter. So start/end_pts and start/end_sample will give different results when the timestamps are wrong, inexact or do not start at zero. Also note that this filter does not modify the timestamps. If you wish to have the output timestamps start at zero, insert the asetpts filter after the atrim filter. .PP If multiple start or end options are set, this filter tries to be greedy and keep all samples that match at least one of the specified constraints. To keep only the part that matches all the constraints at once, chain multiple atrim filters. .PP The defaults are such that all the input is kept. So it is possible to set e.g. just the end values to keep everything before the specified time. .PP Examples: .IP "\(bu" 4 Drop everything except the second minute of input: .Sp .Vb 1 \& ffmpeg \-i INPUT \-af atrim=60:120 .Ve .IP "\(bu" 4 Keep only the first 1000 samples: .Sp .Vb 1 \& ffmpeg \-i INPUT \-af atrim=end_sample=1000 .Ve .SS "axcorrelate" .IX Subsection "axcorrelate" Calculate normalized cross-correlation between two input audio streams. .PP Resulted samples are always between \-1 and 1 inclusive. If result is 1 it means two input samples are highly correlated in that selected segment. Result 0 means they are not correlated at all. If result is \-1 it means two input samples are out of phase, which means they cancel each other. .PP The filter accepts the following options: .IP "\fBsize\fR" 4 .IX Item "size" Set size of segment over which cross-correlation is calculated. Default is 256. Allowed range is from 2 to 131072. .IP "\fBalgo\fR" 4 .IX Item "algo" Set algorithm for cross-correlation. Can be \f(CW\*(C`slow\*(C'\fR or \f(CW\*(C`fast\*(C'\fR. Default is \f(CW\*(C`slow\*(C'\fR. Fast algorithm assumes mean values over any given segment are always zero and thus need much less calculations to make. This is generally not true, but is valid for typical audio streams. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Calculate correlation between channels in stereo audio stream: .Sp .Vb 1 \& ffmpeg \-i stereo.wav \-af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav .Ve .SS "bandpass" .IX Subsection "bandpass" Apply a two-pole Butterworth band-pass filter with central frequency \fIfrequency\fR, and (3dB\-point) band-width width. The \fIcsg\fR option selects a constant skirt gain (peak gain = Q) instead of the default: constant 0dB peak gain. The filter roll off at 6dB per octave (20dB per decade). .PP The filter accepts the following options: .IP "\fBfrequency, f\fR" 4 .IX Item "frequency, f" Set the filter's central frequency. Default is \f(CW3000\fR. .IP "\fBcsg\fR" 4 .IX Item "csg" Constant skirt gain if set to 1. Defaults to 0. .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 "\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 \s-1DC\s0 to 0dB. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the following commands: .IP "\fBfrequency, f\fR" 4 .IX Item "frequency, f" Change bandpass frequency. Syntax for the command is : "\fIfrequency\fR" .IP "\fBwidth_type, t\fR" 4 .IX Item "width_type, t" Change bandpass width_type. Syntax for the command is : "\fIwidth_type\fR" .IP "\fBwidth, w\fR" 4 .IX Item "width, w" Change bandpass width. Syntax for the command is : "\fIwidth\fR" .IP "\fBmix, m\fR" 4 .IX Item "mix, m" Change bandpass mix. Syntax for the command is : "\fImix\fR" .SS "bandreject" .IX Subsection "bandreject" Apply a two-pole Butterworth band-reject filter with central frequency \fIfrequency\fR, and (3dB\-point) band-width \fIwidth\fR. The filter roll off at 6dB per octave (20dB per decade). .PP The filter accepts the following options: .IP "\fBfrequency, f\fR" 4 .IX Item "frequency, f" Set the filter's central frequency. Default is \f(CW3000\fR. .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 "\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 \s-1DC\s0 to 0dB. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the following commands: .IP "\fBfrequency, f\fR" 4 .IX Item "frequency, f" Change bandreject frequency. Syntax for the command is : "\fIfrequency\fR" .IP "\fBwidth_type, t\fR" 4 .IX Item "width_type, t" Change bandreject width_type. Syntax for the command is : "\fIwidth_type\fR" .IP "\fBwidth, w\fR" 4 .IX Item "width, w" Change bandreject width. Syntax for the command is : "\fIwidth\fR" .IP "\fBmix, m\fR" 4 .IX Item "mix, m" Change bandreject mix. Syntax for the command is : "\fImix\fR" .SS "bass, lowshelf" .IX Subsection "bass, lowshelf" Boost or cut the bass (lower) frequencies of the audio using a two-pole shelving filter with a response similar to that of a standard hi-fi's tone-controls. This is also known as shelving equalisation (\s-1EQ\s0). .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(CW100\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 "\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 \s-1DC\s0 to 0dB. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the following commands: .IP "\fBfrequency, f\fR" 4 .IX Item "frequency, f" Change bass frequency. Syntax for the command is : "\fIfrequency\fR" .IP "\fBwidth_type, t\fR" 4 .IX Item "width_type, t" Change bass width_type. Syntax for the command is : "\fIwidth_type\fR" .IP "\fBwidth, w\fR" 4 .IX Item "width, w" Change bass width. Syntax for the command is : "\fIwidth\fR" .IP "\fBgain, g\fR" 4 .IX Item "gain, g" Change bass gain. Syntax for the command is : "\fIgain\fR" .IP "\fBmix, m\fR" 4 .IX Item "mix, m" Change bass mix. Syntax for the command is : "\fImix\fR" .SS "biquad" .IX Subsection "biquad" Apply a biquad \s-1IIR\s0 filter with the given coefficients. Where \fIb0\fR, \fIb1\fR, \fIb2\fR and \fIa0\fR, \fIa1\fR, \fIa2\fR are the numerator and denominator coefficients respectively. and \fIchannels\fR, \fIc\fR specify which channels to filter, by default all available are filtered. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the following commands: .IP "\fBa0\fR" 4 .IX Item "a0" .PD 0 .IP "\fBa1\fR" 4 .IX Item "a1" .IP "\fBa2\fR" 4 .IX Item "a2" .IP "\fBb0\fR" 4 .IX Item "b0" .IP "\fBb1\fR" 4 .IX Item "b1" .IP "\fBb2\fR" 4 .IX Item "b2" .PD Change biquad parameter. Syntax for the command is : "\fIvalue\fR" .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 \s-1DC\s0 to 0dB. .SS "bs2b" .IX Subsection "bs2b" Bauer stereo to binaural transformation, which improves headphone listening of stereo audio records. .PP To enable compilation of this filter you need to configure FFmpeg with \&\f(CW\*(C`\-\-enable\-libbs2b\*(C'\fR. .PP It accepts the following parameters: .IP "\fBprofile\fR" 4 .IX Item "profile" Pre-defined crossfeed level. .RS 4 .IP "\fBdefault\fR" 4 .IX Item "default" Default level (fcut=700, feed=50). .IP "\fBcmoy\fR" 4 .IX Item "cmoy" Chu Moy circuit (fcut=700, feed=60). .IP "\fBjmeier\fR" 4 .IX Item "jmeier" Jan Meier circuit (fcut=650, feed=95). .RE .RS 4 .RE .IP "\fBfcut\fR" 4 .IX Item "fcut" Cut frequency (in Hz). .IP "\fBfeed\fR" 4 .IX Item "feed" Feed level (in Hz). .SS "channelmap" .IX Subsection "channelmap" Remap input channels to new locations. .PP It accepts the following parameters: .IP "\fBmap\fR" 4 .IX Item "map" Map channels from input to output. The argument is a '|'\-separated list of mappings, each in the \f(CW\*(C`\f(CIin_channel\f(CW\-\f(CIout_channel\f(CW\*(C'\fR or \&\fIin_channel\fR form. \fIin_channel\fR can be either the name of the input channel (e.g. \s-1FL\s0 for front left) or its index in the input channel layout. \&\fIout_channel\fR is the name of the output channel or its index in the output channel layout. If \fIout_channel\fR is not given then it is implicitly an index, starting with zero and increasing by one for each mapping. .IP "\fBchannel_layout\fR" 4 .IX Item "channel_layout" The channel layout of the output stream. .PP If no mapping is present, the filter will implicitly map input channels to output channels, preserving indices. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 For example, assuming a 5.1+downmix input \s-1MOV\s0 file, .Sp .Vb 1 \& ffmpeg \-i in.mov \-filter \*(Aqchannelmap=map=DL\-FL|DR\-FR\*(Aq out.wav .Ve .Sp will create an output \s-1WAV\s0 file tagged as stereo from the downmix channels of the input. .IP "\(bu" 4 To fix a 5.1 \s-1WAV\s0 improperly encoded in \s-1AAC\s0's native channel order .Sp .Vb 1 \& ffmpeg \-i in.wav \-filter \*(Aqchannelmap=1|2|0|5|3|4:5.1\*(Aq out.wav .Ve .SS "channelsplit" .IX Subsection "channelsplit" Split each channel from an input audio stream into a separate output stream. .PP It accepts the following parameters: .IP "\fBchannel_layout\fR" 4 .IX Item "channel_layout" The channel layout of the input stream. The default is \*(L"stereo\*(R". .IP "\fBchannels\fR" 4 .IX Item "channels" A channel layout describing the channels to be extracted as separate output streams or \*(L"all\*(R" to extract each input channel as a separate stream. The default is \*(L"all\*(R". .Sp Choosing channels not present in channel layout in the input will result in an error. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 For example, assuming a stereo input \s-1MP3\s0 file, .Sp .Vb 1 \& ffmpeg \-i in.mp3 \-filter_complex channelsplit out.mkv .Ve .Sp will create an output Matroska file with two audio streams, one containing only the left channel and the other the right channel. .IP "\(bu" 4 Split a 5.1 \s-1WAV\s0 file into per-channel files: .Sp .Vb 5 \& ffmpeg \-i in.wav \-filter_complex \& \*(Aqchannelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]\*(Aq \& \-map \*(Aq[FL]\*(Aq front_left.wav \-map \*(Aq[FR]\*(Aq front_right.wav \-map \*(Aq[FC]\*(Aq \& front_center.wav \-map \*(Aq[LFE]\*(Aq lfe.wav \-map \*(Aq[SL]\*(Aq side_left.wav \-map \*(Aq[SR]\*(Aq \& side_right.wav .Ve .IP "\(bu" 4 Extract only \s-1LFE\s0 from a 5.1 \s-1WAV\s0 file: .Sp .Vb 2 \& ffmpeg \-i in.wav \-filter_complex \*(Aqchannelsplit=channel_layout=5.1:channels=LFE[LFE]\*(Aq \& \-map \*(Aq[LFE]\*(Aq lfe.wav .Ve .SS "chorus" .IX Subsection "chorus" Add a chorus effect to the audio. .PP Can make a single vocal sound like a chorus, but can also be applied to instrumentation. .PP Chorus resembles an echo effect with a short delay, but whereas with echo the delay is constant, with chorus, it is varied using using sinusoidal or triangular modulation. The modulation depth defines the range the modulated delay is played before or after the delay. Hence the delayed sound will sound slower or faster, that is the delayed sound tuned around the original one, like in a chorus where some vocals are slightly off key. .PP It accepts the following parameters: .IP "\fBin_gain\fR" 4 .IX Item "in_gain" Set input gain. Default is 0.4. .IP "\fBout_gain\fR" 4 .IX Item "out_gain" Set output gain. Default is 0.4. .IP "\fBdelays\fR" 4 .IX Item "delays" Set delays. A typical delay is around 40ms to 60ms. .IP "\fBdecays\fR" 4 .IX Item "decays" Set decays. .IP "\fBspeeds\fR" 4 .IX Item "speeds" Set speeds. .IP "\fBdepths\fR" 4 .IX Item "depths" Set depths. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 A single delay: .Sp .Vb 1 \& chorus=0.7:0.9:55:0.4:0.25:2 .Ve .IP "\(bu" 4 Two delays: .Sp .Vb 1 \& chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3 .Ve .IP "\(bu" 4 Fuller sounding chorus with three delays: .Sp .Vb 1 \& chorus=0.5:0.9:50|60|40:0.4|0.32|0.3:0.25|0.4|0.3:2|2.3|1.3 .Ve .SS "compand" .IX Subsection "compand" Compress or expand the audio's dynamic range. .PP It accepts the following parameters: .IP "\fBattacks\fR" 4 .IX Item "attacks" .PD 0 .IP "\fBdecays\fR" 4 .IX Item "decays" .PD A list of times in seconds for each channel over which the instantaneous level of the input signal is averaged to determine its volume. \fIattacks\fR refers to increase of volume and \fIdecays\fR refers to decrease of volume. For most situations, the attack time (response to the audio getting louder) should be shorter than the decay time, because the human ear is more sensitive to sudden loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and a typical value for decay is 0.8 seconds. If specified number of attacks & decays is lower than number of channels, the last set attack/decay will be used for all remaining channels. .IP "\fBpoints\fR" 4 .IX Item "points" A list of points for the transfer function, specified in dB relative to the maximum possible signal amplitude. Each key points list must be defined using the following syntax: \f(CW\*(C`x0/y0|x1/y1|x2/y2|....\*(C'\fR or \&\f(CW\*(C`x0/y0 x1/y1 x2/y2 ....\*(C'\fR .Sp The input values must be in strictly increasing order but the transfer function does not have to be monotonically rising. The point \f(CW\*(C`0/0\*(C'\fR is assumed but may be overridden (by \f(CW\*(C`0/out\-dBn\*(C'\fR). Typical values for the transfer function are \f(CW\*(C`\-70/\-70|\-60/\-20|1/0\*(C'\fR. .IP "\fBsoft-knee\fR" 4 .IX Item "soft-knee" Set the curve radius in dB for all joints. It defaults to 0.01. .IP "\fBgain\fR" 4 .IX Item "gain" Set the additional gain in dB to be applied at all points on the transfer function. This allows for easy adjustment of the overall gain. It defaults to 0. .IP "\fBvolume\fR" 4 .IX Item "volume" Set an initial volume, in dB, to be assumed for each channel when filtering starts. This permits the user to supply a nominal level initially, so that, for example, a very large gain is not applied to initial signal levels before the companding has begun to operate. A typical value for audio which is initially quiet is \-90 dB. It defaults to 0. .IP "\fBdelay\fR" 4 .IX Item "delay" Set a delay, in seconds. The input audio is analyzed immediately, but audio is delayed before being fed to the volume adjuster. Specifying a delay approximately equal to the attack/decay times allows the filter to effectively operate in predictive rather than reactive mode. It defaults to 0. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Make music with both quiet and loud passages suitable for listening to in a noisy environment: .Sp .Vb 1 \& compand=.3|.3:1|1:\-90/\-60|\-60/\-40|\-40/\-30|\-20/\-20:6:0:\-90:0.2 .Ve .Sp Another example for audio with whisper and explosion parts: .Sp .Vb 1 \& compand=0|0:1|1:\-90/\-900|\-70/\-70|\-30/\-9|0/\-3:6:0:0:0 .Ve .IP "\(bu" 4 A noise gate for when the noise is at a lower level than the signal: .Sp .Vb 1 \& compand=.1|.1:.2|.2:\-900/\-900|\-50.1/\-900|\-50/\-50:.01:0:\-90:.1 .Ve .IP "\(bu" 4 Here is another noise gate, this time for when the noise is at a higher level than the signal (making it, in some ways, similar to squelch): .Sp .Vb 1 \& compand=.1|.1:.1|.1:\-45.1/\-45.1|\-45/\-900|0/\-900:.01:45:\-90:.1 .Ve .IP "\(bu" 4 2:1 compression starting at \-6dB: .Sp .Vb 1 \& compand=points=\-80/\-80|\-6/\-6|0/\-3.8|20/3.5 .Ve .IP "\(bu" 4 2:1 compression starting at \-9dB: .Sp .Vb 1 \& compand=points=\-80/\-80|\-9/\-9|0/\-5.3|20/2.9 .Ve .IP "\(bu" 4 2:1 compression starting at \-12dB: .Sp .Vb 1 \& compand=points=\-80/\-80|\-12/\-12|0/\-6.8|20/1.9 .Ve .IP "\(bu" 4 2:1 compression starting at \-18dB: .Sp .Vb 1 \& compand=points=\-80/\-80|\-18/\-18|0/\-9.8|20/0.7 .Ve .IP "\(bu" 4 3:1 compression starting at \-15dB: .Sp .Vb 1 \& compand=points=\-80/\-80|\-15/\-15|0/\-10.8|20/\-5.2 .Ve .IP "\(bu" 4 Compressor/Gate: .Sp .Vb 1 \& compand=points=\-80/\-105|\-62/\-80|\-15.4/\-15.4|0/\-12|20/\-7.6 .Ve .IP "\(bu" 4 Expander: .Sp .Vb 1 \& compand=attacks=0:points=\-80/\-169|\-54/\-80|\-49.5/\-64.6|\-41.1/\-41.1|\-25.8/\-15|\-10.8/\-4.5|0/0|20/8.3 .Ve .IP "\(bu" 4 Hard limiter at \-6dB: .Sp .Vb 1 \& compand=attacks=0:points=\-80/\-80|\-6/\-6|20/\-6 .Ve .IP "\(bu" 4 Hard limiter at \-12dB: .Sp .Vb 1 \& compand=attacks=0:points=\-80/\-80|\-12/\-12|20/\-12 .Ve .IP "\(bu" 4 Hard noise gate at \-35 dB: .Sp .Vb 1 \& compand=attacks=0:points=\-80/\-115|\-35.1/\-80|\-35/\-35|20/20 .Ve .IP "\(bu" 4 Soft limiter: .Sp .Vb 1 \& compand=attacks=0:points=\-80/\-80|\-12.4/\-12.4|\-6/\-8|0/\-6.8|20/\-2.8 .Ve .SS "compensationdelay" .IX Subsection "compensationdelay" Compensation Delay Line is a metric based delay to compensate differing positions of microphones or speakers. .PP For example, you have recorded guitar with two microphones placed in different locations. Because the front of sound wave has fixed speed in normal conditions, the phasing of microphones can vary and depends on their location and interposition. The best sound mix can be achieved when these microphones are in phase (synchronized). Note that a distance of ~30 cm between microphones makes one microphone capture the signal in antiphase to the other microphone. That makes the final mix sound moody. This filter helps to solve phasing problems by adding different delays to each microphone track and make them synchronized. .PP The best result can be reached when you take one track as base and synchronize other tracks one by one with it. Remember that synchronization/delay tolerance depends on sample rate, too. Higher sample rates will give more tolerance. .PP The filter accepts the following parameters: .IP "\fBmm\fR" 4 .IX Item "mm" Set millimeters distance. This is compensation distance for fine tuning. Default is 0. .IP "\fBcm\fR" 4 .IX Item "cm" Set cm distance. This is compensation distance for tightening distance setup. Default is 0. .IP "\fBm\fR" 4 .IX Item "m" Set meters distance. This is compensation distance for hard distance setup. Default is 0. .IP "\fBdry\fR" 4 .IX Item "dry" Set dry amount. Amount of unprocessed (dry) signal. Default is 0. .IP "\fBwet\fR" 4 .IX Item "wet" Set wet amount. Amount of processed (wet) signal. Default is 1. .IP "\fBtemp\fR" 4 .IX Item "temp" Set temperature in degrees Celsius. This is the temperature of the environment. Default is 20. .SS "crossfeed" .IX Subsection "crossfeed" Apply headphone crossfeed filter. .PP Crossfeed is the process of blending the left and right channels of stereo audio recording. It is mainly used to reduce extreme stereo separation of low frequencies. .PP The intent is to produce more speaker like sound to the listener. .PP The filter accepts the following options: .IP "\fBstrength\fR" 4 .IX Item "strength" Set strength of crossfeed. Default is 0.2. Allowed range is from 0 to 1. This sets gain of low shelf filter for side part of stereo image. Default is \-6dB. Max allowed is \-30db when strength is set to 1. .IP "\fBrange\fR" 4 .IX Item "range" Set soundstage wideness. Default is 0.5. Allowed range is from 0 to 1. This sets cut off frequency of low shelf filter. Default is cut off near 1550 Hz. With range set to 1 cut off frequency is set to 2100 Hz. .IP "\fBslope\fR" 4 .IX Item "slope" Set curve slope of low shelf filter. Default is 0.5. Allowed range is from 0.01 to 1. .IP "\fBlevel_in\fR" 4 .IX Item "level_in" Set input gain. Default is 0.9. .IP "\fBlevel_out\fR" 4 .IX Item "level_out" Set output gain. Default is 1. .PP \fICommands\fR .IX Subsection "Commands" .PP This filter supports the all above options as \fBcommands\fR. .SS "crystalizer" .IX Subsection "crystalizer" Simple algorithm to expand audio dynamic range. .PP The filter accepts the following options: .IP "\fBi\fR" 4 .IX Item "i" Sets the intensity of effect (default: 2.0). Must be in range between 0.0 (unchanged sound) to 10.0 (maximum effect). .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 "dcshift" .IX Subsection "dcshift" Apply a \s-1DC\s0 shift to the audio. .PP This can be useful to remove a \s-1DC\s0 offset (caused perhaps by a hardware problem in the recording chain) from the audio. The effect of a \s-1DC\s0 offset is reduced headroom and hence volume. The \fBastats\fR filter can be used to determine if a signal has a \s-1DC\s0 offset. .IP "\fBshift\fR" 4 .IX Item "shift" Set the \s-1DC\s0 shift, allowed range is [\-1, 1]. It indicates the amount to shift the audio. .IP "\fBlimitergain\fR" 4 .IX Item "limitergain" Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is used to prevent clipping. .SS "deesser" .IX Subsection "deesser" Apply de-essing to the audio samples. .IP "\fBi\fR" 4 .IX Item "i" Set intensity for triggering de-essing. Allowed range is from 0 to 1. Default is 0. .IP "\fBm\fR" 4 .IX Item "m" Set amount of ducking on treble part of sound. Allowed range is from 0 to 1. Default is 0.5. .IP "\fBf\fR" 4 .IX Item "f" How much of original frequency content to keep when de-essing. Allowed range is from 0 to 1. Default is 0.5. .IP "\fBs\fR" 4 .IX Item "s" Set the output mode. .Sp It accepts the following values: .RS 4 .IP "\fBi\fR" 4 .IX Item "i" Pass input unchanged. .IP "\fBo\fR" 4 .IX Item "o" Pass ess filtered out. .IP "\fBe\fR" 4 .IX Item "e" Pass only ess. .Sp Default value is \fIo\fR. .RE .RS 4 .RE .SS "drmeter" .IX Subsection "drmeter" Measure audio dynamic range. .PP \&\s-1DR\s0 values of 14 and higher is found in very dynamic material. \s-1DR\s0 of 8 to 13 is found in transition material. And anything less that 8 have very poor dynamics and is very compressed. .PP The filter accepts the following options: .IP "\fBlength\fR" 4 .IX Item "length" Set window length in seconds used to split audio into segments of equal length. Default is 3 seconds. .SS "dynaudnorm" .IX Subsection "dynaudnorm" Dynamic Audio Normalizer. .PP This filter applies a certain amount of gain to the input audio in order to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in contrast to more \*(L"simple\*(R" normalization algorithms, the Dynamic Audio Normalizer *dynamically* re-adjusts the gain factor to the input audio. This allows for applying extra gain to the \*(L"quiet\*(R" sections of the audio while avoiding distortions or clipping the \*(L"loud\*(R" sections. In other words: The Dynamic Audio Normalizer will \*(L"even out\*(R" the volume of quiet and loud sections, in the sense that the volume of each section is brought to the same target level. Note, however, that the Dynamic Audio Normalizer achieves this goal *without* applying \*(L"dynamic range compressing\*(R". It will retain 100% of the dynamic range *within* each section of the audio file. .IP "\fBframelen, f\fR" 4 .IX Item "framelen, f" Set the frame length in milliseconds. In range from 10 to 8000 milliseconds. Default is 500 milliseconds. The Dynamic Audio Normalizer processes the input audio in small chunks, referred to as frames. This is required, because a peak magnitude has no meaning for just a single sample value. Instead, we need to determine the peak magnitude for a contiguous sequence of sample values. While a \*(L"standard\*(R" normalizer would simply use the peak magnitude of the complete file, the Dynamic Audio Normalizer determines the peak magnitude individually for each frame. The length of a frame is specified in milliseconds. By default, the Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has been found to give good results with most files. Note that the exact frame length, in number of samples, will be determined automatically, based on the sampling rate of the individual input audio file. .IP "\fBgausssize, g\fR" 4 .IX Item "gausssize, g" Set the Gaussian filter window size. In range from 3 to 301, must be odd number. Default is 31. Probably the most important parameter of the Dynamic Audio Normalizer is the \&\f(CW\*(C`window size\*(C'\fR of the Gaussian smoothing filter. The filter's window size is specified in frames, centered around the current frame. For the sake of simplicity, this must be an odd number. Consequently, the default value of 31 takes into account the current frame, as well as the 15 preceding frames and the 15 subsequent frames. Using a larger window results in a stronger smoothing effect and thus in less gain variation, i.e. slower gain adaptation. Conversely, using a smaller window results in a weaker smoothing effect and thus in more gain variation, i.e. faster gain adaptation. In other words, the more you increase this value, the more the Dynamic Audio Normalizer will behave like a \*(L"traditional\*(R" normalization filter. On the contrary, the more you decrease this value, the more the Dynamic Audio Normalizer will behave like a dynamic range compressor. .IP "\fBpeak, p\fR" 4 .IX Item "peak, p" Set the target peak value. This specifies the highest permissible magnitude level for the normalized audio input. This filter will try to approach the target peak magnitude as closely as possible, but at the same time it also makes sure that the normalized signal will never exceed the peak magnitude. A frame's maximum local gain factor is imposed directly by the target peak magnitude. The default value is 0.95 and thus leaves a headroom of 5%*. It is not recommended to go above this value. .IP "\fBmaxgain, m\fR" 4 .IX Item "maxgain, m" Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0. The Dynamic Audio Normalizer determines the maximum possible (local) gain factor for each input frame, i.e. the maximum gain factor that does not result in clipping or distortion. The maximum gain factor is determined by the frame's highest magnitude sample. However, the Dynamic Audio Normalizer additionally bounds the frame's maximum gain factor by a predetermined (global) maximum gain factor. This is done in order to avoid excessive gain factors in \*(L"silent\*(R" or almost silent frames. By default, the maximum gain factor is 10.0, For most inputs the default value should be sufficient and it usually is not recommended to increase this value. Though, for input with an extremely low overall volume level, it may be necessary to allow even higher gain factors. Note, however, that the Dynamic Audio Normalizer does not simply apply a \*(L"hard\*(R" threshold (i.e. cut off values above the threshold). Instead, a \*(L"sigmoid\*(R" threshold function will be applied. This way, the gain factors will smoothly approach the threshold value, but never exceed that value. .IP "\fBtargetrms, r\fR" 4 .IX Item "targetrms, r" Set the target \s-1RMS.\s0 In range from 0.0 to 1.0. Default is 0.0 \- disabled. By default, the Dynamic Audio Normalizer performs \*(L"peak\*(R" normalization. This means that the maximum local gain factor for each frame is defined (only) by the frame's highest magnitude sample. This way, the samples can be amplified as much as possible without exceeding the maximum signal level, i.e. without clipping. Optionally, however, the Dynamic Audio Normalizer can also take into account the frame's root mean square, abbreviated \s-1RMS.\s0 In electrical engineering, the \s-1RMS\s0 is commonly used to determine the power of a time-varying signal. It is therefore considered that the \s-1RMS\s0 is a better approximation of the \*(L"perceived loudness\*(R" than just looking at the signal's peak magnitude. Consequently, by adjusting all frames to a constant \s-1RMS\s0 value, a uniform \*(L"perceived loudness\*(R" can be established. If a target \s-1RMS\s0 value has been specified, a frame's local gain factor is defined as the factor that would result in exactly that \s-1RMS\s0 value. Note, however, that the maximum local gain factor is still restricted by the frame's highest magnitude sample, in order to prevent clipping. .IP "\fBcoupling, n\fR" 4 .IX Item "coupling, n" Enable channels coupling. By default is enabled. By default, the Dynamic Audio Normalizer will amplify all channels by the same amount. This means the same gain factor will be applied to all channels, i.e. the maximum possible gain factor is determined by the \*(L"loudest\*(R" channel. However, in some recordings, it may happen that the volume of the different channels is uneven, e.g. one channel may be \*(L"quieter\*(R" than the other one(s). In this case, this option can be used to disable the channel coupling. This way, the gain factor will be determined independently for each channel, depending only on the individual channel's highest magnitude sample. This allows for harmonizing the volume of the different channels. .IP "\fBcorrectdc, c\fR" 4 .IX Item "correctdc, c" Enable \s-1DC\s0 bias correction. By default is disabled. An audio signal (in the time domain) is a sequence of sample values. In the Dynamic Audio Normalizer these sample values are represented in the \&\-1.0 to 1.0 range, regardless of the original input format. Normally, the audio signal, or \*(L"waveform\*(R", should be centered around the zero point. That means if we calculate the mean value of all samples in a file, or in a single frame, then the result should be 0.0 or at least very close to that value. If, however, there is a significant deviation of the mean value from 0.0, in either positive or negative direction, this is referred to as a \&\s-1DC\s0 bias or \s-1DC\s0 offset. Since a \s-1DC\s0 bias is clearly undesirable, the Dynamic Audio Normalizer provides optional \s-1DC\s0 bias correction. With \s-1DC\s0 bias correction enabled, the Dynamic Audio Normalizer will determine the mean value, or \*(L"\s-1DC\s0 correction\*(R" offset, of each input frame and subtract that value from all of the frame's sample values which ensures those samples are centered around 0.0 again. Also, in order to avoid \*(L"gaps\*(R" at the frame boundaries, the \s-1DC\s0 correction offset values will be interpolated smoothly between neighbouring frames. .IP "\fBaltboundary, b\fR" 4 .IX Item "altboundary, b" Enable alternative boundary mode. By default is disabled. The Dynamic Audio Normalizer takes into account a certain neighbourhood around each frame. This includes the preceding frames as well as the subsequent frames. However, for the \*(L"boundary\*(R" frames, located at the very beginning and at the very end of the audio file, not all neighbouring frames are available. In particular, for the first few frames in the audio file, the preceding frames are not known. And, similarly, for the last few frames in the audio file, the subsequent frames are not known. Thus, the question arises which gain factors should be assumed for the missing frames in the \*(L"boundary\*(R" region. The Dynamic Audio Normalizer implements two modes to deal with this situation. The default boundary mode assumes a gain factor of exactly 1.0 for the missing frames, resulting in a smooth \*(L"fade in\*(R" and \&\*(L"fade out\*(R" at the beginning and at the end of the input, respectively. .IP "\fBcompress, s\fR" 4 .IX Item "compress, s" Set the compress factor. In range from 0.0 to 30.0. Default is 0.0. By default, the Dynamic Audio Normalizer does not apply \*(L"traditional\*(R" compression. This means that signal peaks will not be pruned and thus the full dynamic range will be retained within each local neighbourhood. However, in some cases it may be desirable to combine the Dynamic Audio Normalizer's normalization algorithm with a more \*(L"traditional\*(R" compression. For this purpose, the Dynamic Audio Normalizer provides an optional compression (thresholding) function. If (and only if) the compression feature is enabled, all input frames will be processed by a soft knee thresholding function prior to the actual normalization process. Put simply, the thresholding function is going to prune all samples whose magnitude exceeds a certain threshold value. However, the Dynamic Audio Normalizer does not simply apply a fixed threshold value. Instead, the threshold value will be adjusted for each individual frame. In general, smaller parameters result in stronger compression, and vice versa. Values below 3.0 are not recommended, because audible distortion may appear. .IP "\fBthreshold, t\fR" 4 .IX Item "threshold, t" Set the target threshold value. This specifies the lowest permissible magnitude level for the audio input which will be normalized. If input frame volume is above this value frame will be normalized. Otherwise frame may not be normalized at all. The default value is set to 0, which means all input frames will be normalized. This option is mostly useful if digital noise is not wanted to be amplified. .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 \s-1CD\s0 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 (\s-1EQ\s0) 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 \s-1DC\s0 to 0dB. .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 \*(L"live\*(R" 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 \s-1FIR\s0 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 \s-1FFT.\s0 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 (\s-1HDCD\s0) data. A 16\-bit \s-1PCM\s0 stream with embedded \s-1HDCD\s0 codes is expanded into a 20\-bit \s-1PCM\s0 stream. .PP The filter supports the Peak Extend and Low-level Gain Adjustment features of \s-1HDCD,\s0 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 \s-1PCM\s0 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 \s-1PE\s0 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 \s-1PE\s0 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 \s-1LFE\s0 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 \s-1IR\s0 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 \s-1DC\s0 to 0dB. .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`\f(CIinput_idx\f(CW.\f(CIin_channel\f(CW\-\f(CIout_channel\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. \s-1FL\s0 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 \s-1LADSPA\s0 (Linux Audio Developer's Simple Plugin \s-1API\s0) 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 \s-1LADSPA\s0 plugin library to load. If the environment variable \fB\s-1LADSPA_PATH\s0\fR is defined, the \s-1LADSPA\s0 plugin is searched in each one of the directories specified by the colon separated list in \&\fB\s-1LADSPA_PATH\s0\fR, otherwise in the standard \s-1LADSPA\s0 paths, which are in this order: \fI\s-1HOME/\s0.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 \fBffmpeg\-utils\fB\|(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 List all available plugins within amp (\s-1LADSPA\s0 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 (\s-1CMT\s0) 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 (\s-1CAPS\s0) 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 \s-1EQ\s0 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 (\s-1CAPS\s0) 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 (\s-1CAPS\s0) 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 (\s-1CAPS\s0) 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" \&\s-1EBU R128\s0 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 \s-1IL, LRA,\s0 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 "\fB\s-1LRA,\s0 lra\fR" 4 .IX Item "LRA, lra" Set loudness range target. Range is 1.0 \- 20.0. Default value is 7.0. .IP "\fB\s-1TP,\s0 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 \s-1IL\s0 of input file. Range is \-99.0 \- +0.0. .IP "\fBmeasured_LRA, measured_lra\fR" 4 .IX Item "measured_LRA, measured_lra" Measured \s-1LRA\s0 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 \s-1LRA\s0 shouldn't be lower than source \s-1LRA\s0 and the change in integrated loudness shouldn't result in a true peak which exceeds the target \s-1TP.\s0 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 \*(L"dual-mono\*(R". If a mono file is intended for playback on a stereo system, its \s-1EBU R128\s0 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 \s-1DC\s0 to 0dB. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Lowpass only \s-1LFE\s0 channel, it \s-1LFE\s0 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 \s-1LV2\s0 (\s-1LADSPA\s0 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 \s-1URI.\s0 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 \fBffmpeg\-utils\fB\|(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 .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 (\s-1FL, FR,\s0 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 \*(L"\-ac\*(R" 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 (\*(L"Pure channel mapping detected\*(R"), 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. .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 \s-1RMS\s0 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 \*(L"rumbling\*(R" 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 \s-1RMS\s0 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. .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 \*(L"dB\*(R" 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 \fBffmpeg\-utils\fB\|(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 \*(L"dB\*(R" 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 in start of multi-channel audio. Can be \fIany\fR or \fIall\fR. Default is \fIany\fR. With \fIany\fR, any sample that is detected as non-silence will cause stopped trimming of silence. With \fIall\fR, only if all channels are detected as non-silence will cause stopped trimming of silence. .IP "\fBstop_periods\fR" 4 .IX Item "stop_periods" Set the count for trimming silence from the end of audio. 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 \&\fIstart_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 \*(L"dB\*(R" 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 in end of multi-channel audio. Can be \fIany\fR or \fIall\fR. Default is \fIany\fR. With \fIany\fR, any sample that is detected as non-silence will cause stopped trimming of silence. With \fIall\fR, only if all channels are detected as non-silence will cause stopped trimming of silence. .IP "\fBdetection\fR" 4 .IX Item "detection" Set how is silence detected. Can be \f(CW\*(C`rms\*(C'\fR or \f(CW\*(C`peak\*(C'\fR. Second is faster and works better with digital silence which is exactly 0. Default value is \f(CW\*(C`rms\*(C'\fR. .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. Default value is \f(CW0.02\fR. Allowed range is from \f(CW0\fR to \f(CW10\fR. .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 .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 \s-1SOFA\s0 files (see <\fBhttp://www.sofacoustics.org/\fR> for a database). SOFAlizer is developed at the Acoustics Research Institute (\s-1ARI\s0) 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 \s-1SOFA\s0 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: <\s-1CH\s0> <\s-1AZIM\s0> <\s-1ELEV\s0>[|<\s-1CH\s0> <\s-1AZIM\s0> <\s-1ELEV\s0>|...]. 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 \s-1LFE\s0 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 \s-1SOFA\s0 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 \s-1SOFA\s0 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 "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. .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 \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 \fBffmpeg\-utils\fB\|(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 \fBffmpeg\-utils\fB\|(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 \s-1LFE\s0 channel output if output channel layout has it. By default, this is enabled. .IP "\fBlfe_low\fR" 4 .IX Item "lfe_low" Set \s-1LFE\s0 low cut off frequency. By default, this is \fI128\fR Hz. .IP "\fBlfe_high\fR" 4 .IX Item "lfe_high" Set \s-1LFE\s0 high cut off frequency. By default, this is \fI256\fR Hz. .IP "\fBlfe_mode\fR" 4 .IX Item "lfe_mode" Set \s-1LFE\s0 mode, can be \fIadd\fR or \fIsub\fR. Default is \fIadd\fR. In \fIadd\fR mode, \s-1LFE\s0 channel is created from input audio and added to output. In \fIsub\fR mode, \s-1LFE\s0 channel is created from input audio and added to output but also all non-LFE output channels are subtracted with output \s-1LFE\s0 channel. .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 "\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 \s-1LFE\s0 input volume. By default, this is \fI1\fR. .IP "\fBlfe_out\fR" 4 .IX Item "lfe_out" Set \s-1LFE\s0 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. .IP "\fBally\fR" 4 .IX Item "ally" Set spread usage of stereo image across Y axis for all channels. .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. .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. .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" .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 "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 (\s-1EQ\s0). .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 "\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 \s-1DC\s0 to 0dB. .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 "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 \*(L"1.0\*(R". .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 \s-1FLT.\s0 (default) .IP "\fBdouble\fR" 4 .IX Item "double" 64\-bit floating-point; this limits input sample format to \s-1DBL.\s0 .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 .IP "\fBpts\fR" 4 .IX Item "pts" frame \s-1PTS\s0 .IP "\fBsample_rate\fR" 4 .IX Item "sample_rate" sample rate .IP "\fBstartpts\fR" 4 .IX Item "startpts" \&\s-1PTS\s0 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 \s-1NAN.\s0 .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. The input is not modified. 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 \s-1PCM\s0 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/asrc_abuffer.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 \*(L"s16p\*(R" corresponds to the number 6 and the \*(L"stereo\*(R" 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 \fBffmpeg\-utils\fB\|(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 "afirsrc" .IX Subsection "afirsrc" Generate a \s-1FIR\s0 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 coefficents 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 \*(L"stereo\*(R". .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. .PP \fIExamples\fR .IX Subsection "Examples" .IP "\(bu" 4 Set the sample rate to 48000 Hz and the channel layout to \s-1AV_CH_LAYOUT_MONO.\s0 .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 \s-1PRNG.\s0 .IP "\fBnb_samples, n\fR" 4 .IX Item "nb_samples, n" Set the number of samples per each output frame, default is 1024. .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 \s-1FIR\s0 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 \s-1FIR\s0 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 \s-1FIR\s0 coefficients. .SS "sinc" .IX Subsection "sinc" Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject \s-1FIR\s0 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 \s-1PTS\s0 (Presentation TimeStamp) of the output audio frame, expressed in \fI\s-1TB\s0\fR units. .IP "\fBt\fR" 4 .IX Item "t" The \s-1PTS\s0 of the output audio frame, expressed in seconds. .IP "\fB\s-1TB\s0\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 \s-1NTSC\s0 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 \s-1QP\s0 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 \s-1QP\s0 of around 30, this region would get a \s-1QP\s0 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 \s-1QP\s0 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 .PP Since this filter is designed for reconstruction, it operates on frame sequences without considering timestamps, and terminates when either input reaches end of stream. This will cause problems if your encoding pipeline drops frames. If you're trying to apply an image as an overlay to a video stream, consider the \fIoverlay\fR filter instead. .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 \s-1ASS\s0 (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 bellow thresholds. .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 "bbox" .IX Subsection "bbox" Compute the bounding box for the non-black pixels in the input frame luminance plane. .PP This filter computes the bounding box containing all the pixels with a luminance 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 luminance value. Default is \f(CW16\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 10. 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. .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 \*(L"black\*(R". 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 \*(L"black\*(R". .Sp The threshold expresses the maximum pixel luminance value for which a pixel is considered \*(L"black\*(R". The provided value is scaled according to the following equation: .Sp .Vb 1 \& = + * .Ve .Sp \&\fIluminance_range_size\fR and \fIluminance_minimum_value\fR depend on the input video format, the range is [0\-255] for \s-1YUV\s0 full-range formats and [16\-235] for \s-1YUV\s0 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 \s-1AV_LOG_INFO\s0 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 \*(L"top\*(R" layer and second input is \&\*(L"bottom\*(R" 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 "\fBgrainmerge\fR" 4 .IX Item "grainmerge" .IP "\fBand\fR" 4 .IX Item "and" .IP "\fBaverage\fR" 4 .IX Item "average" .IP "\fBburn\fR" 4 .IX Item "burn" .IP "\fBdarken\fR" 4 .IX Item "darken" .IP "\fBdifference\fR" 4 .IX Item "difference" .IP "\fBgrainextract\fR" 4 .IX Item "grainextract" .IP "\fBdivide\fR" 4 .IX Item "divide" .IP "\fBdodge\fR" 4 .IX Item "dodge" .IP "\fBfreeze\fR" 4 .IX Item "freeze" .IP "\fBexclusion\fR" 4 .IX Item "exclusion" .IP "\fBextremity\fR" 4 .IX Item "extremity" .IP "\fBglow\fR" 4 .IX Item "glow" .IP "\fBhardlight\fR" 4 .IX Item "hardlight" .IP "\fBhardmix\fR" 4 .IX Item "hardmix" .IP "\fBheat\fR" 4 .IX Item "heat" .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 "\fBsoftlight\fR" 4 .IX Item "softlight" .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 "\fB\s-1SW\s0\fR" 4 .IX Item "SW" .PD 0 .IP "\fB\s-1SH\s0\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 "\fB\s-1TOP, A\s0\fR" 4 .IX Item "TOP, A" Value of pixel component at current location for first video frame (top layer). .IP "\fB\s-1BOTTOM, B\s0\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 .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 \s-1INT32_MAX.\s0 .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 \&\s-1INT32_MAX.\s0 .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 \*(L"2\*(R". 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 \*(L"yuv422p\*(R", \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 (\*(L"bwdif\*(R" stands for \*(L"Bob Weaver Deinterlacing Filter\*(R"). .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 "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. .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 \s-1YUV\s0 instead of \s-1RGB.\s0 .Sp Literal colors like \*(L"green\*(R" or \*(L"red\*(R" don't make sense with this enabled anymore. This can be used to pass exact \s-1YUV\s0 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" \&\s-1YUV\s0 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 \s-1YUV\s0 instead of \s-1RGB.\s0 .Sp Literal colors like \*(L"green\*(R" or \*(L"red\*(R" don't make sense with this enabled anymore. This can be used to pass exact \s-1YUV\s0 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 "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 \s-1CIE\s0 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 \s-1CIE\s0 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 \s-1CIE\s0 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 \s-1CIE\s0 diagram, by default disabled. .IP "\fBgamma\fR" 4 .IX Item "gamma" Set input gamma. Used only with \s-1XYZ\s0 input color space. .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 \s-1MPEG\s0 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 "\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 "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. .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 "colorkey" .IX Subsection "colorkey" \&\s-1RGB\s0 colorspace color 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. .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 \s-1RGB\s0 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. .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 "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" \&\s-1BT.709\s0 .IP "\fBfcc\fR" 4 .IX Item "fcc" \&\s-1FCC\s0 .IP "\fBbt601\fR" 4 .IX Item "bt601" \&\s-1BT.601\s0 .IP "\fBbt470\fR" 4 .IX Item "bt470" \&\s-1BT.470\s0 .IP "\fBbt470bg\fR" 4 .IX Item "bt470bg" \&\s-1BT.470BG\s0 .IP "\fBsmpte170m\fR" 4 .IX Item "smpte170m" \&\s-1SMPTE\-170M\s0 .IP "\fBsmpte240m\fR" 4 .IX Item "smpte240m" \&\s-1SMPTE\-240M\s0 .IP "\fBbt2020\fR" 4 .IX Item "bt2020" \&\s-1BT.2020\s0 .RE .RS 4 .RE .PP For example to convert from \s-1BT.601\s0 to \s-1SMPTE\-240M,\s0 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" \&\s-1BT.470M\s0 .IP "\fBbt470bg\fR" 4 .IX Item "bt470bg" \&\s-1BT.470BG\s0 .IP "\fBbt601\-6\-525\fR" 4 .IX Item "bt601-6-525" \&\s-1BT.601\-6 525\s0 .IP "\fBbt601\-6\-625\fR" 4 .IX Item "bt601-6-625" \&\s-1BT.601\-6 625\s0 .IP "\fBbt709\fR" 4 .IX Item "bt709" \&\s-1BT.709\s0 .IP "\fBsmpte170m\fR" 4 .IX Item "smpte170m" \&\s-1SMPTE\-170M\s0 .IP "\fBsmpte240m\fR" 4 .IX Item "smpte240m" \&\s-1SMPTE\-240M\s0 .IP "\fBbt2020\fR" 4 .IX Item "bt2020" \&\s-1BT.2020\s0 .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" \&\s-1BT.709\s0 .IP "\fBfcc\fR" 4 .IX Item "fcc" \&\s-1FCC\s0 .IP "\fBbt470bg\fR" 4 .IX Item "bt470bg" \&\s-1BT.470BG\s0 or \s-1BT.601\-6 625\s0 .IP "\fBsmpte170m\fR" 4 .IX Item "smpte170m" \&\s-1SMPTE\-170M\s0 or \s-1BT.601\-6 525\s0 .IP "\fBsmpte240m\fR" 4 .IX Item "smpte240m" \&\s-1SMPTE\-240M\s0 .IP "\fBycgco\fR" 4 .IX Item "ycgco" YCgCo .IP "\fBbt2020ncl\fR" 4 .IX Item "bt2020ncl" \&\s-1BT.2020\s0 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" \&\s-1BT.709\s0 .IP "\fBbt470m\fR" 4 .IX Item "bt470m" \&\s-1BT.470M\s0 .IP "\fBbt470bg\fR" 4 .IX Item "bt470bg" \&\s-1BT.470BG\s0 .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" \&\s-1SMPTE\-170M, BT.601\-6 625\s0 or \s-1BT.601\-6 525\s0 .IP "\fBsmpte240m\fR" 4 .IX Item "smpte240m" \&\s-1SMPTE\-240M\s0 .IP "\fBsrgb\fR" 4 .IX Item "srgb" \&\s-1SRGB\s0 .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" \&\s-1BT.2020\s0 for 10\-bits content .IP "\fBbt2020\-12\fR" 4 .IX Item "bt2020-12" \&\s-1BT.2020\s0 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" \&\s-1BT.709\s0 .IP "\fBbt470m\fR" 4 .IX Item "bt470m" \&\s-1BT.470M\s0 .IP "\fBbt470bg\fR" 4 .IX Item "bt470bg" \&\s-1BT.470BG\s0 or \s-1BT.601\-6 625\s0 .IP "\fBsmpte170m\fR" 4 .IX Item "smpte170m" \&\s-1SMPTE\-170M\s0 or \s-1BT.601\-6 525\s0 .IP "\fBsmpte240m\fR" 4 .IX Item "smpte240m" \&\s-1SMPTE\-240M\s0 .IP "\fBfilm\fR" 4 .IX Item "film" film .IP "\fBsmpte431\fR" 4 .IX Item "smpte431" \&\s-1SMPTE\-431\s0 .IP "\fBsmpte432\fR" 4 .IX Item "smpte432" \&\s-1SMPTE\-432\s0 .IP "\fBbt2020\fR" 4 .IX Item "bt2020" \&\s-1BT.2020\s0 .IP "\fBjedec\-p22\fR" 4 .IX Item "jedec-p22" \&\s-1JEDEC P22\s0 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" \&\s-1TV\s0 (restricted) range .IP "\fBmpeg\fR" 4 .IX Item "mpeg" \&\s-1MPEG\s0 (restricted) range .IP "\fBpc\fR" 4 .IX Item "pc" \&\s-1PC\s0 (full) range .IP "\fBjpeg\fR" 4 .IX Item "jpeg" \&\s-1JPEG\s0 (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" \&\s-1YUV 4:2:0\s0 planar 8\-bits .IP "\fByuv420p10\fR" 4 .IX Item "yuv420p10" \&\s-1YUV 4:2:0\s0 planar 10\-bits .IP "\fByuv420p12\fR" 4 .IX Item "yuv420p12" \&\s-1YUV 4:2:0\s0 planar 12\-bits .IP "\fByuv422p\fR" 4 .IX Item "yuv422p" \&\s-1YUV 4:2:2\s0 planar 8\-bits .IP "\fByuv422p10\fR" 4 .IX Item "yuv422p10" \&\s-1YUV 4:2:2\s0 planar 10\-bits .IP "\fByuv422p12\fR" 4 .IX Item "yuv422p12" \&\s-1YUV 4:2:2\s0 planar 12\-bits .IP "\fByuv444p\fR" 4 .IX Item "yuv444p" \&\s-1YUV 4:4:4\s0 planar 8\-bits .IP "\fByuv444p10\fR" 4 .IX Item "yuv444p10" \&\s-1YUV 4:4:4\s0 planar 10\-bits .IP "\fByuv444p12\fR" 4 .IX Item "yuv444p12" \&\s-1YUV 4:4:4\s0 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 \s-1CPU,\s0 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 \*(L"all\*(R" 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 \s-1SMPTE\-240M,\s0 use the command: .PP .Vb 1 \& colorspace=smpte240m .Ve .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 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 \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 \s-1GPU\s0 using Apple's CoreImage \s-1API\s0 on \s-1OSX.\s0 .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 \s-1OSX.\s0 .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=@