annotate ffmpeg/doc/ffmpeg-filters.1 @ 13:844d341cf643 tip

Back up before ISMIR
author Yading Song <yading.song@eecs.qmul.ac.uk>
date Thu, 31 Oct 2013 13:17:06 +0000
parents 6840f77b83aa
children
rev   line source
yading@10 1 .\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
yading@10 2 .\"
yading@10 3 .\" Standard preamble:
yading@10 4 .\" ========================================================================
yading@10 5 .de Sp \" Vertical space (when we can't use .PP)
yading@10 6 .if t .sp .5v
yading@10 7 .if n .sp
yading@10 8 ..
yading@10 9 .de Vb \" Begin verbatim text
yading@10 10 .ft CW
yading@10 11 .nf
yading@10 12 .ne \\$1
yading@10 13 ..
yading@10 14 .de Ve \" End verbatim text
yading@10 15 .ft R
yading@10 16 .fi
yading@10 17 ..
yading@10 18 .\" Set up some character translations and predefined strings. \*(-- will
yading@10 19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
yading@10 20 .\" double quote, and \*(R" will give a right double quote. \*(C+ will
yading@10 21 .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
yading@10 22 .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
yading@10 23 .\" nothing in troff, for use with C<>.
yading@10 24 .tr \(*W-
yading@10 25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
yading@10 26 .ie n \{\
yading@10 27 . ds -- \(*W-
yading@10 28 . ds PI pi
yading@10 29 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
yading@10 30 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
yading@10 31 . ds L" ""
yading@10 32 . ds R" ""
yading@10 33 . ds C` ""
yading@10 34 . ds C' ""
yading@10 35 'br\}
yading@10 36 .el\{\
yading@10 37 . ds -- \|\(em\|
yading@10 38 . ds PI \(*p
yading@10 39 . ds L" ``
yading@10 40 . ds R" ''
yading@10 41 'br\}
yading@10 42 .\"
yading@10 43 .\" Escape single quotes in literal strings from groff's Unicode transform.
yading@10 44 .ie \n(.g .ds Aq \(aq
yading@10 45 .el .ds Aq '
yading@10 46 .\"
yading@10 47 .\" If the F register is turned on, we'll generate index entries on stderr for
yading@10 48 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
yading@10 49 .\" entries marked with X<> in POD. Of course, you'll have to process the
yading@10 50 .\" output yourself in some meaningful fashion.
yading@10 51 .ie \nF \{\
yading@10 52 . de IX
yading@10 53 . tm Index:\\$1\t\\n%\t"\\$2"
yading@10 54 ..
yading@10 55 . nr % 0
yading@10 56 . rr F
yading@10 57 .\}
yading@10 58 .el \{\
yading@10 59 . de IX
yading@10 60 ..
yading@10 61 .\}
yading@10 62 .\"
yading@10 63 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
yading@10 64 .\" Fear. Run. Save yourself. No user-serviceable parts.
yading@10 65 . \" fudge factors for nroff and troff
yading@10 66 .if n \{\
yading@10 67 . ds #H 0
yading@10 68 . ds #V .8m
yading@10 69 . ds #F .3m
yading@10 70 . ds #[ \f1
yading@10 71 . ds #] \fP
yading@10 72 .\}
yading@10 73 .if t \{\
yading@10 74 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
yading@10 75 . ds #V .6m
yading@10 76 . ds #F 0
yading@10 77 . ds #[ \&
yading@10 78 . ds #] \&
yading@10 79 .\}
yading@10 80 . \" simple accents for nroff and troff
yading@10 81 .if n \{\
yading@10 82 . ds ' \&
yading@10 83 . ds ` \&
yading@10 84 . ds ^ \&
yading@10 85 . ds , \&
yading@10 86 . ds ~ ~
yading@10 87 . ds /
yading@10 88 .\}
yading@10 89 .if t \{\
yading@10 90 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
yading@10 91 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
yading@10 92 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
yading@10 93 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
yading@10 94 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
yading@10 95 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
yading@10 96 .\}
yading@10 97 . \" troff and (daisy-wheel) nroff accents
yading@10 98 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
yading@10 99 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
yading@10 100 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
yading@10 101 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
yading@10 102 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
yading@10 103 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
yading@10 104 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
yading@10 105 .ds ae a\h'-(\w'a'u*4/10)'e
yading@10 106 .ds Ae A\h'-(\w'A'u*4/10)'E
yading@10 107 . \" corrections for vroff
yading@10 108 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
yading@10 109 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
yading@10 110 . \" for low resolution devices (crt and lpr)
yading@10 111 .if \n(.H>23 .if \n(.V>19 \
yading@10 112 \{\
yading@10 113 . ds : e
yading@10 114 . ds 8 ss
yading@10 115 . ds o a
yading@10 116 . ds d- d\h'-1'\(ga
yading@10 117 . ds D- D\h'-1'\(hy
yading@10 118 . ds th \o'bp'
yading@10 119 . ds Th \o'LP'
yading@10 120 . ds ae ae
yading@10 121 . ds Ae AE
yading@10 122 .\}
yading@10 123 .rm #[ #] #H #V #F C
yading@10 124 .\" ========================================================================
yading@10 125 .\"
yading@10 126 .IX Title "FFMPEG-FILTERS 1"
yading@10 127 .TH FFMPEG-FILTERS 1 "2013-04-21" " " " "
yading@10 128 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
yading@10 129 .\" way too many mistakes in technical documents.
yading@10 130 .if n .ad l
yading@10 131 .nh
yading@10 132 .SH "NAME"
yading@10 133 ffmpeg\-filters \- FFmpeg filters
yading@10 134 .SH "DESCRIPTION"
yading@10 135 .IX Header "DESCRIPTION"
yading@10 136 This document describes filters, sources, and sinks provided by the
yading@10 137 libavfilter library.
yading@10 138 .SH "FILTERING INTRODUCTION"
yading@10 139 .IX Header "FILTERING INTRODUCTION"
yading@10 140 Filtering in FFmpeg is enabled through the libavfilter library.
yading@10 141 .PP
yading@10 142 In libavfilter, a filter can have multiple inputs and multiple
yading@10 143 outputs.
yading@10 144 To illustrate the sorts of things that are possible, we consider the
yading@10 145 following filtergraph.
yading@10 146 .PP
yading@10 147 .Vb 4
yading@10 148 \& input \-\-> split \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-> overlay \-\-> output
yading@10 149 \& | ^
yading@10 150 \& | |
yading@10 151 \& +\-\-\-\-\-> crop \-\-> vflip \-\-\-\-\-\-\-+
yading@10 152 .Ve
yading@10 153 .PP
yading@10 154 This filtergraph splits the input stream in two streams, sends one
yading@10 155 stream through the crop filter and the vflip filter before merging it
yading@10 156 back with the other stream by overlaying it on top. You can use the
yading@10 157 following command to achieve this:
yading@10 158 .PP
yading@10 159 .Vb 1
yading@10 160 \& ffmpeg \-i INPUT \-vf "split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2" OUTPUT
yading@10 161 .Ve
yading@10 162 .PP
yading@10 163 The result will be that in output the top half of the video is mirrored
yading@10 164 onto the bottom half.
yading@10 165 .PP
yading@10 166 Filters in the same linear chain are separated by commas, and distinct
yading@10 167 linear chains of filters are separated by semicolons. In our example,
yading@10 168 \&\fIcrop,vflip\fR are in one linear chain, \fIsplit\fR and
yading@10 169 \&\fIoverlay\fR are separately in another. The points where the linear
yading@10 170 chains join are labelled by names enclosed in square brackets. In the
yading@10 171 example, the split filter generates two outputs that are associated to
yading@10 172 the labels \fI[main]\fR and \fI[tmp]\fR.
yading@10 173 .PP
yading@10 174 The stream sent to the second output of \fIsplit\fR, labelled as
yading@10 175 \&\fI[tmp]\fR, is processed through the \fIcrop\fR filter, which crops
yading@10 176 away the lower half part of the video, and then vertically flipped. The
yading@10 177 \&\fIoverlay\fR filter takes in input the first unchanged output of the
yading@10 178 split filter (which was labelled as \fI[main]\fR), and overlay on its
yading@10 179 lower half the output generated by the \fIcrop,vflip\fR filterchain.
yading@10 180 .PP
yading@10 181 Some filters take in input a list of parameters: they are specified
yading@10 182 after the filter name and an equal sign, and are separated from each other
yading@10 183 by a colon.
yading@10 184 .PP
yading@10 185 There exist so-called \fIsource filters\fR that do not have an
yading@10 186 audio/video input, and \fIsink filters\fR that will not have audio/video
yading@10 187 output.
yading@10 188 .SH "GRAPH"
yading@10 189 .IX Header "GRAPH"
yading@10 190 The \fIgraph2dot\fR program included in the FFmpeg \fItools\fR
yading@10 191 directory can be used to parse a filtergraph description and issue a
yading@10 192 corresponding textual representation in the dot language.
yading@10 193 .PP
yading@10 194 Invoke the command:
yading@10 195 .PP
yading@10 196 .Vb 1
yading@10 197 \& graph2dot \-h
yading@10 198 .Ve
yading@10 199 .PP
yading@10 200 to see how to use \fIgraph2dot\fR.
yading@10 201 .PP
yading@10 202 You can then pass the dot description to the \fIdot\fR program (from
yading@10 203 the graphviz suite of programs) and obtain a graphical representation
yading@10 204 of the filtergraph.
yading@10 205 .PP
yading@10 206 For example the sequence of commands:
yading@10 207 .PP
yading@10 208 .Vb 4
yading@10 209 \& echo <GRAPH_DESCRIPTION> | \e
yading@10 210 \& tools/graph2dot \-o graph.tmp && \e
yading@10 211 \& dot \-Tpng graph.tmp \-o graph.png && \e
yading@10 212 \& display graph.png
yading@10 213 .Ve
yading@10 214 .PP
yading@10 215 can be used to create and display an image representing the graph
yading@10 216 described by the \fI\s-1GRAPH_DESCRIPTION\s0\fR string. Note that this string must be
yading@10 217 a complete self-contained graph, with its inputs and outputs explicitly defined.
yading@10 218 For example if your command line is of the form:
yading@10 219 .PP
yading@10 220 .Vb 1
yading@10 221 \& ffmpeg \-i infile \-vf scale=640:360 outfile
yading@10 222 .Ve
yading@10 223 .PP
yading@10 224 your \fI\s-1GRAPH_DESCRIPTION\s0\fR string will need to be of the form:
yading@10 225 .PP
yading@10 226 .Vb 1
yading@10 227 \& nullsrc,scale=640:360,nullsink
yading@10 228 .Ve
yading@10 229 .PP
yading@10 230 you may also need to set the \fInullsrc\fR parameters and add a \fIformat\fR
yading@10 231 filter in order to simulate a specific input file.
yading@10 232 .SH "FILTERGRAPH DESCRIPTION"
yading@10 233 .IX Header "FILTERGRAPH DESCRIPTION"
yading@10 234 A filtergraph is a directed graph of connected filters. It can contain
yading@10 235 cycles, and there can be multiple links between a pair of
yading@10 236 filters. Each link has one input pad on one side connecting it to one
yading@10 237 filter from which it takes its input, and one output pad on the other
yading@10 238 side connecting it to the one filter accepting its output.
yading@10 239 .PP
yading@10 240 Each filter in a filtergraph is an instance of a filter class
yading@10 241 registered in the application, which defines the features and the
yading@10 242 number of input and output pads of the filter.
yading@10 243 .PP
yading@10 244 A filter with no input pads is called a \*(L"source\*(R", a filter with no
yading@10 245 output pads is called a \*(L"sink\*(R".
yading@10 246 .SS "Filtergraph syntax"
yading@10 247 .IX Subsection "Filtergraph syntax"
yading@10 248 A filtergraph can be represented using a textual representation, which is
yading@10 249 recognized by the \fB\-filter\fR/\fB\-vf\fR and \fB\-filter_complex\fR
yading@10 250 options in \fBffmpeg\fR and \fB\-vf\fR in \fBffplay\fR, and by the
yading@10 251 \&\f(CW\*(C`avfilter_graph_parse()\*(C'\fR/\f(CW\*(C`avfilter_graph_parse2()\*(C'\fR function defined in
yading@10 252 \&\fIlibavfilter/avfilter.h\fR.
yading@10 253 .PP
yading@10 254 A filterchain consists of a sequence of connected filters, each one
yading@10 255 connected to the previous one in the sequence. A filterchain is
yading@10 256 represented by a list of \*(L",\*(R"\-separated filter descriptions.
yading@10 257 .PP
yading@10 258 A filtergraph consists of a sequence of filterchains. A sequence of
yading@10 259 filterchains is represented by a list of \*(L";\*(R"\-separated filterchain
yading@10 260 descriptions.
yading@10 261 .PP
yading@10 262 A filter is represented by a string of the form:
yading@10 263 [\fIin_link_1\fR]...[\fIin_link_N\fR]\fIfilter_name\fR=\fIarguments\fR[\fIout_link_1\fR]...[\fIout_link_M\fR]
yading@10 264 .PP
yading@10 265 \&\fIfilter_name\fR is the name of the filter class of which the
yading@10 266 described filter is an instance of, and has to be the name of one of
yading@10 267 the filter classes registered in the program.
yading@10 268 The name of the filter class is optionally followed by a string
yading@10 269 "=\fIarguments\fR".
yading@10 270 .PP
yading@10 271 \&\fIarguments\fR is a string which contains the parameters used to
yading@10 272 initialize the filter instance. It may have one of the following forms:
yading@10 273 .IP "\(bu" 4
yading@10 274 A ':'\-separated list of \fIkey=value\fR pairs.
yading@10 275 .IP "\(bu" 4
yading@10 276 A ':'\-separated list of \fIvalue\fR. In this case, the keys are assumed to be
yading@10 277 the option names in the order they are declared. E.g. the \f(CW\*(C`fade\*(C'\fR filter
yading@10 278 declares three options in this order \*(-- \fBtype\fR, \fBstart_frame\fR and
yading@10 279 \&\fBnb_frames\fR. Then the parameter list \fIin:0:30\fR means that the value
yading@10 280 \&\fIin\fR is assigned to the option \fBtype\fR, \fI0\fR to
yading@10 281 \&\fBstart_frame\fR and \fI30\fR to \fBnb_frames\fR.
yading@10 282 .IP "\(bu" 4
yading@10 283 A ':'\-separated list of mixed direct \fIvalue\fR and long \fIkey=value\fR
yading@10 284 pairs. The direct \fIvalue\fR must precede the \fIkey=value\fR pairs, and
yading@10 285 follow the same constraints order of the previous point. The following
yading@10 286 \&\fIkey=value\fR pairs can be set in any preferred order.
yading@10 287 .PP
yading@10 288 If the option value itself is a list of items (e.g. the \f(CW\*(C`format\*(C'\fR filter
yading@10 289 takes a list of pixel formats), the items in the list are usually separated by
yading@10 290 \&'|'.
yading@10 291 .PP
yading@10 292 The list of arguments can be quoted using the character \*(L"'\*(R" as initial
yading@10 293 and ending mark, and the character '\e' for escaping the characters
yading@10 294 within the quoted text; otherwise the argument string is considered
yading@10 295 terminated when the next special character (belonging to the set
yading@10 296 \&\*(L"[]=;,\*(R") is encountered.
yading@10 297 .PP
yading@10 298 The name and arguments of the filter are optionally preceded and
yading@10 299 followed by a list of link labels.
yading@10 300 A link label allows to name a link and associate it to a filter output
yading@10 301 or input pad. The preceding labels \fIin_link_1\fR
yading@10 302 \&... \fIin_link_N\fR, are associated to the filter input pads,
yading@10 303 the following labels \fIout_link_1\fR ... \fIout_link_M\fR, are
yading@10 304 associated to the output pads.
yading@10 305 .PP
yading@10 306 When two link labels with the same name are found in the
yading@10 307 filtergraph, a link between the corresponding input and output pad is
yading@10 308 created.
yading@10 309 .PP
yading@10 310 If an output pad is not labelled, it is linked by default to the first
yading@10 311 unlabelled input pad of the next filter in the filterchain.
yading@10 312 For example in the filterchain:
yading@10 313 .PP
yading@10 314 .Vb 1
yading@10 315 \& nullsrc, split[L1], [L2]overlay, nullsink
yading@10 316 .Ve
yading@10 317 .PP
yading@10 318 the split filter instance has two output pads, and the overlay filter
yading@10 319 instance two input pads. The first output pad of split is labelled
yading@10 320 \&\*(L"L1\*(R", the first input pad of overlay is labelled \*(L"L2\*(R", and the second
yading@10 321 output pad of split is linked to the second input pad of overlay,
yading@10 322 which are both unlabelled.
yading@10 323 .PP
yading@10 324 In a complete filterchain all the unlabelled filter input and output
yading@10 325 pads must be connected. A filtergraph is considered valid if all the
yading@10 326 filter input and output pads of all the filterchains are connected.
yading@10 327 .PP
yading@10 328 Libavfilter will automatically insert scale filters where format
yading@10 329 conversion is required. It is possible to specify swscale flags
yading@10 330 for those automatically inserted scalers by prepending
yading@10 331 \&\f(CW\*(C`sws_flags=\f(CIflags\f(CW;\*(C'\fR
yading@10 332 to the filtergraph description.
yading@10 333 .PP
yading@10 334 Follows a \s-1BNF\s0 description for the filtergraph syntax:
yading@10 335 .PP
yading@10 336 .Vb 7
yading@10 337 \& <NAME> ::= sequence of alphanumeric characters and \*(Aq_\*(Aq
yading@10 338 \& <LINKLABEL> ::= "[" <NAME> "]"
yading@10 339 \& <LINKLABELS> ::= <LINKLABEL> [<LINKLABELS>]
yading@10 340 \& <FILTER_ARGUMENTS> ::= sequence of chars (eventually quoted)
yading@10 341 \& <FILTER> ::= [<LINKLABELS>] <NAME> ["=" <FILTER_ARGUMENTS>] [<LINKLABELS>]
yading@10 342 \& <FILTERCHAIN> ::= <FILTER> [,<FILTERCHAIN>]
yading@10 343 \& <FILTERGRAPH> ::= [sws_flags=<flags>;] <FILTERCHAIN> [;<FILTERGRAPH>]
yading@10 344 .Ve
yading@10 345 .SS "Notes on filtergraph escaping"
yading@10 346 .IX Subsection "Notes on filtergraph escaping"
yading@10 347 Some filter arguments require the use of special characters, typically
yading@10 348 \&\f(CW\*(C`:\*(C'\fR to separate key=value pairs in a named options list. In this
yading@10 349 case the user should perform a first level escaping when specifying
yading@10 350 the filter arguments. For example, consider the following literal
yading@10 351 string to be embedded in the drawtext filter arguments:
yading@10 352 .PP
yading@10 353 .Vb 1
yading@10 354 \& this is a \*(Aqstring\*(Aq: may contain one, or more, special characters
yading@10 355 .Ve
yading@10 356 .PP
yading@10 357 Since \f(CW\*(C`:\*(C'\fR is special for the filter arguments syntax, it needs to
yading@10 358 be escaped, so you get:
yading@10 359 .PP
yading@10 360 .Vb 1
yading@10 361 \& text=this is a \e\*(Aqstring\e\*(Aq\e: may contain one, or more, special characters
yading@10 362 .Ve
yading@10 363 .PP
yading@10 364 A second level of escaping is required when embedding the filter
yading@10 365 arguments in a filtergraph description, in order to escape all the
yading@10 366 filtergraph special characters. Thus the example above becomes:
yading@10 367 .PP
yading@10 368 .Vb 1
yading@10 369 \& drawtext=text=this is a \e\e\e\*(Aqstring\e\e\e\*(Aq\e\e: may contain one\e, or more\e, special characters
yading@10 370 .Ve
yading@10 371 .PP
yading@10 372 Finally an additional level of escaping may be needed when writing the
yading@10 373 filtergraph description in a shell command, which depends on the
yading@10 374 escaping rules of the adopted shell. For example, assuming that
yading@10 375 \&\f(CW\*(C`\e\*(C'\fR is special and needs to be escaped with another \f(CW\*(C`\e\*(C'\fR, the
yading@10 376 previous string will finally result in:
yading@10 377 .PP
yading@10 378 .Vb 1
yading@10 379 \& \-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"
yading@10 380 .Ve
yading@10 381 .PP
yading@10 382 Sometimes, it might be more convenient to employ quoting in place of
yading@10 383 escaping. For example the string:
yading@10 384 .PP
yading@10 385 .Vb 1
yading@10 386 \& Caesar: tu quoque, Brute, fili mi
yading@10 387 .Ve
yading@10 388 .PP
yading@10 389 Can be quoted in the filter arguments as:
yading@10 390 .PP
yading@10 391 .Vb 1
yading@10 392 \& text=\*(AqCaesar: tu quoque, Brute, fili mi\*(Aq
yading@10 393 .Ve
yading@10 394 .PP
yading@10 395 And finally inserted in a filtergraph like:
yading@10 396 .PP
yading@10 397 .Vb 1
yading@10 398 \& drawtext=text=\e\*(AqCaesar: tu quoque\e, Brute\e, fili mi\e\*(Aq
yading@10 399 .Ve
yading@10 400 .PP
yading@10 401 See the ``Quoting and escaping'' section in the ffmpeg-utils manual
yading@10 402 for more information about the escaping and quoting rules adopted by
yading@10 403 FFmpeg.
yading@10 404 .SH "AUDIO FILTERS"
yading@10 405 .IX Header "AUDIO FILTERS"
yading@10 406 When you configure your FFmpeg build, you can disable any of the
yading@10 407 existing filters using \f(CW\*(C`\-\-disable\-filters\*(C'\fR.
yading@10 408 The configure output will show the audio filters included in your
yading@10 409 build.
yading@10 410 .PP
yading@10 411 Below is a description of the currently available audio filters.
yading@10 412 .SS "aconvert"
yading@10 413 .IX Subsection "aconvert"
yading@10 414 Convert the input audio format to the specified formats.
yading@10 415 .PP
yading@10 416 \&\fIThis filter is deprecated. Use aformat\fR instead.
yading@10 417 .PP
yading@10 418 The filter accepts a string of the form:
yading@10 419 "\fIsample_format\fR:\fIchannel_layout\fR".
yading@10 420 .PP
yading@10 421 \&\fIsample_format\fR specifies the sample format, and can be a string or the
yading@10 422 corresponding numeric value defined in \fIlibavutil/samplefmt.h\fR. Use 'p'
yading@10 423 suffix for a planar sample format.
yading@10 424 .PP
yading@10 425 \&\fIchannel_layout\fR specifies the channel layout, and can be a string
yading@10 426 or the corresponding number value defined in \fIlibavutil/channel_layout.h\fR.
yading@10 427 .PP
yading@10 428 The special parameter \*(L"auto\*(R", signifies that the filter will
yading@10 429 automatically select the output format depending on the output filter.
yading@10 430 .PP
yading@10 431 \fIExamples\fR
yading@10 432 .IX Subsection "Examples"
yading@10 433 .IP "\(bu" 4
yading@10 434 Convert input to float, planar, stereo:
yading@10 435 .Sp
yading@10 436 .Vb 1
yading@10 437 \& aconvert=fltp:stereo
yading@10 438 .Ve
yading@10 439 .IP "\(bu" 4
yading@10 440 Convert input to unsigned 8\-bit, automatically select out channel layout:
yading@10 441 .Sp
yading@10 442 .Vb 1
yading@10 443 \& aconvert=u8:auto
yading@10 444 .Ve
yading@10 445 .SS "allpass"
yading@10 446 .IX Subsection "allpass"
yading@10 447 Apply a two-pole all-pass filter with central frequency (in Hz)
yading@10 448 \&\fIfrequency\fR, and filter-width \fIwidth\fR.
yading@10 449 An all-pass filter changes the audio's frequency to phase relationship
yading@10 450 without changing its frequency to amplitude relationship.
yading@10 451 .PP
yading@10 452 The filter accepts the following options:
yading@10 453 .IP "\fBfrequency, f\fR" 4
yading@10 454 .IX Item "frequency, f"
yading@10 455 Set frequency in Hz.
yading@10 456 .IP "\fBwidth_type\fR" 4
yading@10 457 .IX Item "width_type"
yading@10 458 Set method to specify band-width of filter.
yading@10 459 .RS 4
yading@10 460 .IP "\fBh\fR" 4
yading@10 461 .IX Item "h"
yading@10 462 Hz
yading@10 463 .IP "\fBq\fR" 4
yading@10 464 .IX Item "q"
yading@10 465 Q\-Factor
yading@10 466 .IP "\fBo\fR" 4
yading@10 467 .IX Item "o"
yading@10 468 octave
yading@10 469 .IP "\fBs\fR" 4
yading@10 470 .IX Item "s"
yading@10 471 slope
yading@10 472 .RE
yading@10 473 .RS 4
yading@10 474 .RE
yading@10 475 .IP "\fBwidth, w\fR" 4
yading@10 476 .IX Item "width, w"
yading@10 477 Specify the band-width of a filter in width_type units.
yading@10 478 .SS "highpass"
yading@10 479 .IX Subsection "highpass"
yading@10 480 Apply a high-pass filter with 3dB point frequency.
yading@10 481 The filter can be either single-pole, or double-pole (the default).
yading@10 482 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
yading@10 483 .PP
yading@10 484 The filter accepts the following options:
yading@10 485 .IP "\fBfrequency, f\fR" 4
yading@10 486 .IX Item "frequency, f"
yading@10 487 Set frequency in Hz. Default is 3000.
yading@10 488 .IP "\fBpoles, p\fR" 4
yading@10 489 .IX Item "poles, p"
yading@10 490 Set number of poles. Default is 2.
yading@10 491 .IP "\fBwidth_type\fR" 4
yading@10 492 .IX Item "width_type"
yading@10 493 Set method to specify band-width of filter.
yading@10 494 .RS 4
yading@10 495 .IP "\fBh\fR" 4
yading@10 496 .IX Item "h"
yading@10 497 Hz
yading@10 498 .IP "\fBq\fR" 4
yading@10 499 .IX Item "q"
yading@10 500 Q\-Factor
yading@10 501 .IP "\fBo\fR" 4
yading@10 502 .IX Item "o"
yading@10 503 octave
yading@10 504 .IP "\fBs\fR" 4
yading@10 505 .IX Item "s"
yading@10 506 slope
yading@10 507 .RE
yading@10 508 .RS 4
yading@10 509 .RE
yading@10 510 .IP "\fBwidth, w\fR" 4
yading@10 511 .IX Item "width, w"
yading@10 512 Specify the band-width of a filter in width_type units.
yading@10 513 Applies only to double-pole filter.
yading@10 514 The default is 0.707q and gives a Butterworth response.
yading@10 515 .SS "lowpass"
yading@10 516 .IX Subsection "lowpass"
yading@10 517 Apply a low-pass filter with 3dB point frequency.
yading@10 518 The filter can be either single-pole or double-pole (the default).
yading@10 519 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
yading@10 520 .PP
yading@10 521 The filter accepts the following options:
yading@10 522 .IP "\fBfrequency, f\fR" 4
yading@10 523 .IX Item "frequency, f"
yading@10 524 Set frequency in Hz. Default is 500.
yading@10 525 .IP "\fBpoles, p\fR" 4
yading@10 526 .IX Item "poles, p"
yading@10 527 Set number of poles. Default is 2.
yading@10 528 .IP "\fBwidth_type\fR" 4
yading@10 529 .IX Item "width_type"
yading@10 530 Set method to specify band-width of filter.
yading@10 531 .RS 4
yading@10 532 .IP "\fBh\fR" 4
yading@10 533 .IX Item "h"
yading@10 534 Hz
yading@10 535 .IP "\fBq\fR" 4
yading@10 536 .IX Item "q"
yading@10 537 Q\-Factor
yading@10 538 .IP "\fBo\fR" 4
yading@10 539 .IX Item "o"
yading@10 540 octave
yading@10 541 .IP "\fBs\fR" 4
yading@10 542 .IX Item "s"
yading@10 543 slope
yading@10 544 .RE
yading@10 545 .RS 4
yading@10 546 .RE
yading@10 547 .IP "\fBwidth, w\fR" 4
yading@10 548 .IX Item "width, w"
yading@10 549 Specify the band-width of a filter in width_type units.
yading@10 550 Applies only to double-pole filter.
yading@10 551 The default is 0.707q and gives a Butterworth response.
yading@10 552 .SS "bass"
yading@10 553 .IX Subsection "bass"
yading@10 554 Boost or cut the bass (lower) frequencies of the audio using a two-pole
yading@10 555 shelving filter with a response similar to that of a standard
yading@10 556 hi-fi's tone-controls. This is also known as shelving equalisation (\s-1EQ\s0).
yading@10 557 .PP
yading@10 558 The filter accepts the following options:
yading@10 559 .IP "\fBgain, g\fR" 4
yading@10 560 .IX Item "gain, g"
yading@10 561 Give the gain at 0 Hz. Its useful range is about \-20
yading@10 562 (for a large cut) to +20 (for a large boost).
yading@10 563 Beware of clipping when using a positive gain.
yading@10 564 .IP "\fBfrequency, f\fR" 4
yading@10 565 .IX Item "frequency, f"
yading@10 566 Set the filter's central frequency and so can be used
yading@10 567 to extend or reduce the frequency range to be boosted or cut.
yading@10 568 The default value is \f(CW100\fR Hz.
yading@10 569 .IP "\fBwidth_type\fR" 4
yading@10 570 .IX Item "width_type"
yading@10 571 Set method to specify band-width of filter.
yading@10 572 .RS 4
yading@10 573 .IP "\fBh\fR" 4
yading@10 574 .IX Item "h"
yading@10 575 Hz
yading@10 576 .IP "\fBq\fR" 4
yading@10 577 .IX Item "q"
yading@10 578 Q\-Factor
yading@10 579 .IP "\fBo\fR" 4
yading@10 580 .IX Item "o"
yading@10 581 octave
yading@10 582 .IP "\fBs\fR" 4
yading@10 583 .IX Item "s"
yading@10 584 slope
yading@10 585 .RE
yading@10 586 .RS 4
yading@10 587 .RE
yading@10 588 .IP "\fBwidth, w\fR" 4
yading@10 589 .IX Item "width, w"
yading@10 590 Determine how steep is the filter's shelf transition.
yading@10 591 .SS "treble"
yading@10 592 .IX Subsection "treble"
yading@10 593 Boost or cut treble (upper) frequencies of the audio using a two-pole
yading@10 594 shelving filter with a response similar to that of a standard
yading@10 595 hi-fi's tone-controls. This is also known as shelving equalisation (\s-1EQ\s0).
yading@10 596 .PP
yading@10 597 The filter accepts the following options:
yading@10 598 .IP "\fBgain, g\fR" 4
yading@10 599 .IX Item "gain, g"
yading@10 600 Give the gain at whichever is the lower of ~22 kHz and the
yading@10 601 Nyquist frequency. Its useful range is about \-20 (for a large cut)
yading@10 602 to +20 (for a large boost). Beware of clipping when using a positive gain.
yading@10 603 .IP "\fBfrequency, f\fR" 4
yading@10 604 .IX Item "frequency, f"
yading@10 605 Set the filter's central frequency and so can be used
yading@10 606 to extend or reduce the frequency range to be boosted or cut.
yading@10 607 The default value is \f(CW3000\fR Hz.
yading@10 608 .IP "\fBwidth_type\fR" 4
yading@10 609 .IX Item "width_type"
yading@10 610 Set method to specify band-width of filter.
yading@10 611 .RS 4
yading@10 612 .IP "\fBh\fR" 4
yading@10 613 .IX Item "h"
yading@10 614 Hz
yading@10 615 .IP "\fBq\fR" 4
yading@10 616 .IX Item "q"
yading@10 617 Q\-Factor
yading@10 618 .IP "\fBo\fR" 4
yading@10 619 .IX Item "o"
yading@10 620 octave
yading@10 621 .IP "\fBs\fR" 4
yading@10 622 .IX Item "s"
yading@10 623 slope
yading@10 624 .RE
yading@10 625 .RS 4
yading@10 626 .RE
yading@10 627 .IP "\fBwidth, w\fR" 4
yading@10 628 .IX Item "width, w"
yading@10 629 Determine how steep is the filter's shelf transition.
yading@10 630 .SS "bandpass"
yading@10 631 .IX Subsection "bandpass"
yading@10 632 Apply a two-pole Butterworth band-pass filter with central
yading@10 633 frequency \fIfrequency\fR, and (3dB\-point) band-width width.
yading@10 634 The \fIcsg\fR option selects a constant skirt gain (peak gain = Q)
yading@10 635 instead of the default: constant 0dB peak gain.
yading@10 636 The filter roll off at 6dB per octave (20dB per decade).
yading@10 637 .PP
yading@10 638 The filter accepts the following options:
yading@10 639 .IP "\fBfrequency, f\fR" 4
yading@10 640 .IX Item "frequency, f"
yading@10 641 Set the filter's central frequency. Default is \f(CW3000\fR.
yading@10 642 .IP "\fBcsg\fR" 4
yading@10 643 .IX Item "csg"
yading@10 644 Constant skirt gain if set to 1. Defaults to 0.
yading@10 645 .IP "\fBwidth_type\fR" 4
yading@10 646 .IX Item "width_type"
yading@10 647 Set method to specify band-width of filter.
yading@10 648 .RS 4
yading@10 649 .IP "\fBh\fR" 4
yading@10 650 .IX Item "h"
yading@10 651 Hz
yading@10 652 .IP "\fBq\fR" 4
yading@10 653 .IX Item "q"
yading@10 654 Q\-Factor
yading@10 655 .IP "\fBo\fR" 4
yading@10 656 .IX Item "o"
yading@10 657 octave
yading@10 658 .IP "\fBs\fR" 4
yading@10 659 .IX Item "s"
yading@10 660 slope
yading@10 661 .RE
yading@10 662 .RS 4
yading@10 663 .RE
yading@10 664 .IP "\fBwidth, w\fR" 4
yading@10 665 .IX Item "width, w"
yading@10 666 Specify the band-width of a filter in width_type units.
yading@10 667 .SS "bandreject"
yading@10 668 .IX Subsection "bandreject"
yading@10 669 Apply a two-pole Butterworth band-reject filter with central
yading@10 670 frequency \fIfrequency\fR, and (3dB\-point) band-width \fIwidth\fR.
yading@10 671 The filter roll off at 6dB per octave (20dB per decade).
yading@10 672 .PP
yading@10 673 The filter accepts the following options:
yading@10 674 .IP "\fBfrequency, f\fR" 4
yading@10 675 .IX Item "frequency, f"
yading@10 676 Set the filter's central frequency. Default is \f(CW3000\fR.
yading@10 677 .IP "\fBwidth_type\fR" 4
yading@10 678 .IX Item "width_type"
yading@10 679 Set method to specify band-width of filter.
yading@10 680 .RS 4
yading@10 681 .IP "\fBh\fR" 4
yading@10 682 .IX Item "h"
yading@10 683 Hz
yading@10 684 .IP "\fBq\fR" 4
yading@10 685 .IX Item "q"
yading@10 686 Q\-Factor
yading@10 687 .IP "\fBo\fR" 4
yading@10 688 .IX Item "o"
yading@10 689 octave
yading@10 690 .IP "\fBs\fR" 4
yading@10 691 .IX Item "s"
yading@10 692 slope
yading@10 693 .RE
yading@10 694 .RS 4
yading@10 695 .RE
yading@10 696 .IP "\fBwidth, w\fR" 4
yading@10 697 .IX Item "width, w"
yading@10 698 Specify the band-width of a filter in width_type units.
yading@10 699 .SS "biquad"
yading@10 700 .IX Subsection "biquad"
yading@10 701 Apply a biquad \s-1IIR\s0 filter with the given coefficients.
yading@10 702 Where \fIb0\fR, \fIb1\fR, \fIb2\fR and \fIa0\fR, \fIa1\fR, \fIa2\fR
yading@10 703 are the numerator and denominator coefficients respectively.
yading@10 704 .SS "equalizer"
yading@10 705 .IX Subsection "equalizer"
yading@10 706 Apply a two-pole peaking equalisation (\s-1EQ\s0) filter. With this
yading@10 707 filter, the signal-level at and around a selected frequency can
yading@10 708 be increased or decreased, whilst (unlike bandpass and bandreject
yading@10 709 filters) that at all other frequencies is unchanged.
yading@10 710 .PP
yading@10 711 In order to produce complex equalisation curves, this filter can
yading@10 712 be given several times, each with a different central frequency.
yading@10 713 .PP
yading@10 714 The filter accepts the following options:
yading@10 715 .IP "\fBfrequency, f\fR" 4
yading@10 716 .IX Item "frequency, f"
yading@10 717 Set the filter's central frequency in Hz.
yading@10 718 .IP "\fBwidth_type\fR" 4
yading@10 719 .IX Item "width_type"
yading@10 720 Set method to specify band-width of filter.
yading@10 721 .RS 4
yading@10 722 .IP "\fBh\fR" 4
yading@10 723 .IX Item "h"
yading@10 724 Hz
yading@10 725 .IP "\fBq\fR" 4
yading@10 726 .IX Item "q"
yading@10 727 Q\-Factor
yading@10 728 .IP "\fBo\fR" 4
yading@10 729 .IX Item "o"
yading@10 730 octave
yading@10 731 .IP "\fBs\fR" 4
yading@10 732 .IX Item "s"
yading@10 733 slope
yading@10 734 .RE
yading@10 735 .RS 4
yading@10 736 .RE
yading@10 737 .IP "\fBwidth, w\fR" 4
yading@10 738 .IX Item "width, w"
yading@10 739 Specify the band-width of a filter in width_type units.
yading@10 740 .IP "\fBgain, g\fR" 4
yading@10 741 .IX Item "gain, g"
yading@10 742 Set the required gain or attenuation in dB.
yading@10 743 Beware of clipping when using a positive gain.
yading@10 744 .SS "afade"
yading@10 745 .IX Subsection "afade"
yading@10 746 Apply fade\-in/out effect to input audio.
yading@10 747 .PP
yading@10 748 A description of the accepted parameters follows.
yading@10 749 .IP "\fBtype, t\fR" 4
yading@10 750 .IX Item "type, t"
yading@10 751 Specify the effect type, can be either \f(CW\*(C`in\*(C'\fR for fade-in, or
yading@10 752 \&\f(CW\*(C`out\*(C'\fR for a fade-out effect. Default is \f(CW\*(C`in\*(C'\fR.
yading@10 753 .IP "\fBstart_sample, ss\fR" 4
yading@10 754 .IX Item "start_sample, ss"
yading@10 755 Specify the number of the start sample for starting to apply the fade
yading@10 756 effect. Default is 0.
yading@10 757 .IP "\fBnb_samples, ns\fR" 4
yading@10 758 .IX Item "nb_samples, ns"
yading@10 759 Specify the number of samples for which the fade effect has to last. At
yading@10 760 the end of the fade-in effect the output audio will have the same
yading@10 761 volume as the input audio, at the end of the fade-out transition
yading@10 762 the output audio will be silence. Default is 44100.
yading@10 763 .IP "\fBstart_time, st\fR" 4
yading@10 764 .IX Item "start_time, st"
yading@10 765 Specify time for starting to apply the fade effect. Default is 0.
yading@10 766 The accepted syntax is:
yading@10 767 .Sp
yading@10 768 .Vb 2
yading@10 769 \& [\-]HH[:MM[:SS[.m...]]]
yading@10 770 \& [\-]S+[.m...]
yading@10 771 .Ve
yading@10 772 .Sp
yading@10 773 See also the function \f(CW\*(C`av_parse_time()\*(C'\fR.
yading@10 774 If set this option is used instead of \fIstart_sample\fR one.
yading@10 775 .IP "\fBduration, d\fR" 4
yading@10 776 .IX Item "duration, d"
yading@10 777 Specify the duration for which the fade effect has to last. Default is 0.
yading@10 778 The accepted syntax is:
yading@10 779 .Sp
yading@10 780 .Vb 2
yading@10 781 \& [\-]HH[:MM[:SS[.m...]]]
yading@10 782 \& [\-]S+[.m...]
yading@10 783 .Ve
yading@10 784 .Sp
yading@10 785 See also the function \f(CW\*(C`av_parse_time()\*(C'\fR.
yading@10 786 At the end of the fade-in effect the output audio will have the same
yading@10 787 volume as the input audio, at the end of the fade-out transition
yading@10 788 the output audio will be silence.
yading@10 789 If set this option is used instead of \fInb_samples\fR one.
yading@10 790 .IP "\fBcurve\fR" 4
yading@10 791 .IX Item "curve"
yading@10 792 Set curve for fade transition.
yading@10 793 .Sp
yading@10 794 It accepts the following values:
yading@10 795 .RS 4
yading@10 796 .IP "\fBtri\fR" 4
yading@10 797 .IX Item "tri"
yading@10 798 select triangular, linear slope (default)
yading@10 799 .IP "\fBqsin\fR" 4
yading@10 800 .IX Item "qsin"
yading@10 801 select quarter of sine wave
yading@10 802 .IP "\fBhsin\fR" 4
yading@10 803 .IX Item "hsin"
yading@10 804 select half of sine wave
yading@10 805 .IP "\fBesin\fR" 4
yading@10 806 .IX Item "esin"
yading@10 807 select exponential sine wave
yading@10 808 .IP "\fBlog\fR" 4
yading@10 809 .IX Item "log"
yading@10 810 select logarithmic
yading@10 811 .IP "\fBpar\fR" 4
yading@10 812 .IX Item "par"
yading@10 813 select inverted parabola
yading@10 814 .IP "\fBqua\fR" 4
yading@10 815 .IX Item "qua"
yading@10 816 select quadratic
yading@10 817 .IP "\fBcub\fR" 4
yading@10 818 .IX Item "cub"
yading@10 819 select cubic
yading@10 820 .IP "\fBsqu\fR" 4
yading@10 821 .IX Item "squ"
yading@10 822 select square root
yading@10 823 .IP "\fBcbr\fR" 4
yading@10 824 .IX Item "cbr"
yading@10 825 select cubic root
yading@10 826 .RE
yading@10 827 .RS 4
yading@10 828 .RE
yading@10 829 .PP
yading@10 830 \fIExamples\fR
yading@10 831 .IX Subsection "Examples"
yading@10 832 .IP "\(bu" 4
yading@10 833 Fade in first 15 seconds of audio:
yading@10 834 .Sp
yading@10 835 .Vb 1
yading@10 836 \& afade=t=in:ss=0:d=15
yading@10 837 .Ve
yading@10 838 .IP "\(bu" 4
yading@10 839 Fade out last 25 seconds of a 900 seconds audio:
yading@10 840 .Sp
yading@10 841 .Vb 1
yading@10 842 \& afade=t=out:ss=875:d=25
yading@10 843 .Ve
yading@10 844 .SS "aformat"
yading@10 845 .IX Subsection "aformat"
yading@10 846 Set output format constraints for the input audio. The framework will
yading@10 847 negotiate the most appropriate format to minimize conversions.
yading@10 848 .PP
yading@10 849 The filter accepts the following named parameters:
yading@10 850 .IP "\fBsample_fmts\fR" 4
yading@10 851 .IX Item "sample_fmts"
yading@10 852 A '|'\-separated list of requested sample formats.
yading@10 853 .IP "\fBsample_rates\fR" 4
yading@10 854 .IX Item "sample_rates"
yading@10 855 A '|'\-separated list of requested sample rates.
yading@10 856 .IP "\fBchannel_layouts\fR" 4
yading@10 857 .IX Item "channel_layouts"
yading@10 858 A '|'\-separated list of requested channel layouts.
yading@10 859 .PP
yading@10 860 If a parameter is omitted, all values are allowed.
yading@10 861 .PP
yading@10 862 For example to force the output to either unsigned 8\-bit or signed 16\-bit stereo:
yading@10 863 .PP
yading@10 864 .Vb 1
yading@10 865 \& aformat=sample_fmts=u8|s16:channel_layouts=stereo
yading@10 866 .Ve
yading@10 867 .SS "amerge"
yading@10 868 .IX Subsection "amerge"
yading@10 869 Merge two or more audio streams into a single multi-channel stream.
yading@10 870 .PP
yading@10 871 The filter accepts the following options:
yading@10 872 .IP "\fBinputs\fR" 4
yading@10 873 .IX Item "inputs"
yading@10 874 Set the number of inputs. Default is 2.
yading@10 875 .PP
yading@10 876 If the channel layouts of the inputs are disjoint, and therefore compatible,
yading@10 877 the channel layout of the output will be set accordingly and the channels
yading@10 878 will be reordered as necessary. If the channel layouts of the inputs are not
yading@10 879 disjoint, the output will have all the channels of the first input then all
yading@10 880 the channels of the second input, in that order, and the channel layout of
yading@10 881 the output will be the default value corresponding to the total number of
yading@10 882 channels.
yading@10 883 .PP
yading@10 884 For example, if the first input is in 2.1 (\s-1FL+FR+LF\s0) and the second input
yading@10 885 is \s-1FC+BL+BR\s0, then the output will be in 5.1, with the channels in the
yading@10 886 following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
yading@10 887 first input, b1 is the first channel of the second input).
yading@10 888 .PP
yading@10 889 On the other hand, if both input are in stereo, the output channels will be
yading@10 890 in the default order: a1, a2, b1, b2, and the channel layout will be
yading@10 891 arbitrarily set to 4.0, which may or may not be the expected value.
yading@10 892 .PP
yading@10 893 All inputs must have the same sample rate, and format.
yading@10 894 .PP
yading@10 895 If inputs do not have the same duration, the output will stop with the
yading@10 896 shortest.
yading@10 897 .PP
yading@10 898 \fIExamples\fR
yading@10 899 .IX Subsection "Examples"
yading@10 900 .IP "\(bu" 4
yading@10 901 Merge two mono files into a stereo stream:
yading@10 902 .Sp
yading@10 903 .Vb 1
yading@10 904 \& amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
yading@10 905 .Ve
yading@10 906 .IP "\(bu" 4
yading@10 907 Multiple merges assuming 1 video stream and 6 audio streams in \fIinput.mkv\fR:
yading@10 908 .Sp
yading@10 909 .Vb 1
yading@10 910 \& 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
yading@10 911 .Ve
yading@10 912 .SS "amix"
yading@10 913 .IX Subsection "amix"
yading@10 914 Mixes multiple audio inputs into a single output.
yading@10 915 .PP
yading@10 916 For example
yading@10 917 .PP
yading@10 918 .Vb 1
yading@10 919 \& ffmpeg \-i INPUT1 \-i INPUT2 \-i INPUT3 \-filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
yading@10 920 .Ve
yading@10 921 .PP
yading@10 922 will mix 3 input audio streams to a single output with the same duration as the
yading@10 923 first input and a dropout transition time of 3 seconds.
yading@10 924 .PP
yading@10 925 The filter accepts the following named parameters:
yading@10 926 .IP "\fBinputs\fR" 4
yading@10 927 .IX Item "inputs"
yading@10 928 Number of inputs. If unspecified, it defaults to 2.
yading@10 929 .IP "\fBduration\fR" 4
yading@10 930 .IX Item "duration"
yading@10 931 How to determine the end-of-stream.
yading@10 932 .RS 4
yading@10 933 .IP "\fBlongest\fR" 4
yading@10 934 .IX Item "longest"
yading@10 935 Duration of longest input. (default)
yading@10 936 .IP "\fBshortest\fR" 4
yading@10 937 .IX Item "shortest"
yading@10 938 Duration of shortest input.
yading@10 939 .IP "\fBfirst\fR" 4
yading@10 940 .IX Item "first"
yading@10 941 Duration of first input.
yading@10 942 .RE
yading@10 943 .RS 4
yading@10 944 .RE
yading@10 945 .IP "\fBdropout_transition\fR" 4
yading@10 946 .IX Item "dropout_transition"
yading@10 947 Transition time, in seconds, for volume renormalization when an input
yading@10 948 stream ends. The default value is 2 seconds.
yading@10 949 .SS "anull"
yading@10 950 .IX Subsection "anull"
yading@10 951 Pass the audio source unchanged to the output.
yading@10 952 .SS "apad"
yading@10 953 .IX Subsection "apad"
yading@10 954 Pad the end of a audio stream with silence, this can be used together with
yading@10 955 \&\-shortest to extend audio streams to the same length as the video stream.
yading@10 956 .SS "aphaser"
yading@10 957 .IX Subsection "aphaser"
yading@10 958 Add a phasing effect to the input audio.
yading@10 959 .PP
yading@10 960 A phaser filter creates series of peaks and troughs in the frequency spectrum.
yading@10 961 The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
yading@10 962 .PP
yading@10 963 A description of the accepted parameters follows.
yading@10 964 .IP "\fBin_gain\fR" 4
yading@10 965 .IX Item "in_gain"
yading@10 966 Set input gain. Default is 0.4.
yading@10 967 .IP "\fBout_gain\fR" 4
yading@10 968 .IX Item "out_gain"
yading@10 969 Set output gain. Default is 0.74
yading@10 970 .IP "\fBdelay\fR" 4
yading@10 971 .IX Item "delay"
yading@10 972 Set delay in milliseconds. Default is 3.0.
yading@10 973 .IP "\fBdecay\fR" 4
yading@10 974 .IX Item "decay"
yading@10 975 Set decay. Default is 0.4.
yading@10 976 .IP "\fBspeed\fR" 4
yading@10 977 .IX Item "speed"
yading@10 978 Set modulation speed in Hz. Default is 0.5.
yading@10 979 .IP "\fBtype\fR" 4
yading@10 980 .IX Item "type"
yading@10 981 Set modulation type. Default is triangular.
yading@10 982 .Sp
yading@10 983 It accepts the following values:
yading@10 984 .RS 4
yading@10 985 .IP "\fBtriangular, t\fR" 4
yading@10 986 .IX Item "triangular, t"
yading@10 987 .PD 0
yading@10 988 .IP "\fBsinusoidal, s\fR" 4
yading@10 989 .IX Item "sinusoidal, s"
yading@10 990 .RE
yading@10 991 .RS 4
yading@10 992 .RE
yading@10 993 .PD
yading@10 994 .SS "aresample"
yading@10 995 .IX Subsection "aresample"
yading@10 996 Resample the input audio to the specified parameters, using the
yading@10 997 libswresample library. If none are specified then the filter will
yading@10 998 automatically convert between its input and output.
yading@10 999 .PP
yading@10 1000 This filter is also able to stretch/squeeze the audio data to make it match
yading@10 1001 the timestamps or to inject silence / cut out audio to make it match the
yading@10 1002 timestamps, do a combination of both or do neither.
yading@10 1003 .PP
yading@10 1004 The filter accepts the syntax
yading@10 1005 [\fIsample_rate\fR:]\fIresampler_options\fR, where \fIsample_rate\fR
yading@10 1006 expresses a sample rate and \fIresampler_options\fR is a list of
yading@10 1007 \&\fIkey\fR=\fIvalue\fR pairs, separated by \*(L":\*(R". See the
yading@10 1008 ffmpeg-resampler manual for the complete list of supported options.
yading@10 1009 .PP
yading@10 1010 \fIExamples\fR
yading@10 1011 .IX Subsection "Examples"
yading@10 1012 .IP "\(bu" 4
yading@10 1013 Resample the input audio to 44100Hz:
yading@10 1014 .Sp
yading@10 1015 .Vb 1
yading@10 1016 \& aresample=44100
yading@10 1017 .Ve
yading@10 1018 .IP "\(bu" 4
yading@10 1019 Stretch/squeeze samples to the given timestamps, with a maximum of 1000
yading@10 1020 samples per second compensation:
yading@10 1021 .Sp
yading@10 1022 .Vb 1
yading@10 1023 \& aresample=async=1000
yading@10 1024 .Ve
yading@10 1025 .SS "asetnsamples"
yading@10 1026 .IX Subsection "asetnsamples"
yading@10 1027 Set the number of samples per each output audio frame.
yading@10 1028 .PP
yading@10 1029 The last output packet may contain a different number of samples, as
yading@10 1030 the filter will flush all the remaining samples when the input audio
yading@10 1031 signal its end.
yading@10 1032 .PP
yading@10 1033 The filter accepts the following options:
yading@10 1034 .IP "\fBnb_out_samples, n\fR" 4
yading@10 1035 .IX Item "nb_out_samples, n"
yading@10 1036 Set the number of frames per each output audio frame. The number is
yading@10 1037 intended as the number of samples \fIper each channel\fR.
yading@10 1038 Default value is 1024.
yading@10 1039 .IP "\fBpad, p\fR" 4
yading@10 1040 .IX Item "pad, p"
yading@10 1041 If set to 1, the filter will pad the last audio frame with zeroes, so
yading@10 1042 that the last frame will contain the same number of samples as the
yading@10 1043 previous ones. Default value is 1.
yading@10 1044 .PP
yading@10 1045 For example, to set the number of per-frame samples to 1234 and
yading@10 1046 disable padding for the last frame, use:
yading@10 1047 .PP
yading@10 1048 .Vb 1
yading@10 1049 \& asetnsamples=n=1234:p=0
yading@10 1050 .Ve
yading@10 1051 .SS "ashowinfo"
yading@10 1052 .IX Subsection "ashowinfo"
yading@10 1053 Show a line containing various information for each input audio frame.
yading@10 1054 The input audio is not modified.
yading@10 1055 .PP
yading@10 1056 The shown line contains a sequence of key/value pairs of the form
yading@10 1057 \&\fIkey\fR:\fIvalue\fR.
yading@10 1058 .PP
yading@10 1059 A description of each shown parameter follows:
yading@10 1060 .IP "\fBn\fR" 4
yading@10 1061 .IX Item "n"
yading@10 1062 sequential number of the input frame, starting from 0
yading@10 1063 .IP "\fBpts\fR" 4
yading@10 1064 .IX Item "pts"
yading@10 1065 Presentation timestamp of the input frame, in time base units; the time base
yading@10 1066 depends on the filter input pad, and is usually 1/\fIsample_rate\fR.
yading@10 1067 .IP "\fBpts_time\fR" 4
yading@10 1068 .IX Item "pts_time"
yading@10 1069 presentation timestamp of the input frame in seconds
yading@10 1070 .IP "\fBpos\fR" 4
yading@10 1071 .IX Item "pos"
yading@10 1072 position of the frame in the input stream, \-1 if this information in
yading@10 1073 unavailable and/or meaningless (for example in case of synthetic audio)
yading@10 1074 .IP "\fBfmt\fR" 4
yading@10 1075 .IX Item "fmt"
yading@10 1076 sample format
yading@10 1077 .IP "\fBchlayout\fR" 4
yading@10 1078 .IX Item "chlayout"
yading@10 1079 channel layout
yading@10 1080 .IP "\fBrate\fR" 4
yading@10 1081 .IX Item "rate"
yading@10 1082 sample rate for the audio frame
yading@10 1083 .IP "\fBnb_samples\fR" 4
yading@10 1084 .IX Item "nb_samples"
yading@10 1085 number of samples (per channel) in the frame
yading@10 1086 .IP "\fBchecksum\fR" 4
yading@10 1087 .IX Item "checksum"
yading@10 1088 Adler\-32 checksum (printed in hexadecimal) of the audio data. For planar audio
yading@10 1089 the data is treated as if all the planes were concatenated.
yading@10 1090 .IP "\fBplane_checksums\fR" 4
yading@10 1091 .IX Item "plane_checksums"
yading@10 1092 A list of Adler\-32 checksums for each data plane.
yading@10 1093 .SS "astreamsync"
yading@10 1094 .IX Subsection "astreamsync"
yading@10 1095 Forward two audio streams and control the order the buffers are forwarded.
yading@10 1096 .PP
yading@10 1097 The filter accepts the following options:
yading@10 1098 .IP "\fBexpr, e\fR" 4
yading@10 1099 .IX Item "expr, e"
yading@10 1100 Set the expression deciding which stream should be
yading@10 1101 forwarded next: if the result is negative, the first stream is forwarded; if
yading@10 1102 the result is positive or zero, the second stream is forwarded. It can use
yading@10 1103 the following variables:
yading@10 1104 .RS 4
yading@10 1105 .IP "\fIb1 b2\fR" 4
yading@10 1106 .IX Item "b1 b2"
yading@10 1107 number of buffers forwarded so far on each stream
yading@10 1108 .IP "\fIs1 s2\fR" 4
yading@10 1109 .IX Item "s1 s2"
yading@10 1110 number of samples forwarded so far on each stream
yading@10 1111 .IP "\fIt1 t2\fR" 4
yading@10 1112 .IX Item "t1 t2"
yading@10 1113 current timestamp of each stream
yading@10 1114 .RE
yading@10 1115 .RS 4
yading@10 1116 .Sp
yading@10 1117 The default value is \f(CW\*(C`t1\-t2\*(C'\fR, which means to always forward the stream
yading@10 1118 that has a smaller timestamp.
yading@10 1119 .RE
yading@10 1120 .PP
yading@10 1121 \fIExamples\fR
yading@10 1122 .IX Subsection "Examples"
yading@10 1123 .PP
yading@10 1124 Stress-test \f(CW\*(C`amerge\*(C'\fR by randomly sending buffers on the wrong
yading@10 1125 input, while avoiding too much of a desynchronization:
yading@10 1126 .PP
yading@10 1127 .Vb 3
yading@10 1128 \& amovie=file.ogg [a] ; amovie=file.mp3 [b] ;
yading@10 1129 \& [a] [b] astreamsync=(2*random(1))\-1+tanh(5*(t1\-t2)) [a2] [b2] ;
yading@10 1130 \& [a2] [b2] amerge
yading@10 1131 .Ve
yading@10 1132 .SS "atempo"
yading@10 1133 .IX Subsection "atempo"
yading@10 1134 Adjust audio tempo.
yading@10 1135 .PP
yading@10 1136 The filter accepts exactly one parameter, the audio tempo. If not
yading@10 1137 specified then the filter will assume nominal 1.0 tempo. Tempo must
yading@10 1138 be in the [0.5, 2.0] range.
yading@10 1139 .PP
yading@10 1140 \fIExamples\fR
yading@10 1141 .IX Subsection "Examples"
yading@10 1142 .IP "\(bu" 4
yading@10 1143 Slow down audio to 80% tempo:
yading@10 1144 .Sp
yading@10 1145 .Vb 1
yading@10 1146 \& atempo=0.8
yading@10 1147 .Ve
yading@10 1148 .IP "\(bu" 4
yading@10 1149 To speed up audio to 125% tempo:
yading@10 1150 .Sp
yading@10 1151 .Vb 1
yading@10 1152 \& atempo=1.25
yading@10 1153 .Ve
yading@10 1154 .SS "earwax"
yading@10 1155 .IX Subsection "earwax"
yading@10 1156 Make audio easier to listen to on headphones.
yading@10 1157 .PP
yading@10 1158 This filter adds `cues' to 44.1kHz stereo (i.e. audio \s-1CD\s0 format) audio
yading@10 1159 so that when listened to on headphones the stereo image is moved from
yading@10 1160 inside your head (standard for headphones) to outside and in front of
yading@10 1161 the listener (standard for speakers).
yading@10 1162 .PP
yading@10 1163 Ported from SoX.
yading@10 1164 .SS "pan"
yading@10 1165 .IX Subsection "pan"
yading@10 1166 Mix channels with specific gain levels. The filter accepts the output
yading@10 1167 channel layout followed by a set of channels definitions.
yading@10 1168 .PP
yading@10 1169 This filter is also designed to remap efficiently the channels of an audio
yading@10 1170 stream.
yading@10 1171 .PP
yading@10 1172 The filter accepts parameters of the form:
yading@10 1173 "\fIl\fR:\fIoutdef\fR:\fIoutdef\fR:..."
yading@10 1174 .IP "\fBl\fR" 4
yading@10 1175 .IX Item "l"
yading@10 1176 output channel layout or number of channels
yading@10 1177 .IP "\fBoutdef\fR" 4
yading@10 1178 .IX Item "outdef"
yading@10 1179 output channel specification, of the form:
yading@10 1180 "\fIout_name\fR=[\fIgain\fR*]\fIin_name\fR[+[\fIgain\fR*]\fIin_name\fR...]"
yading@10 1181 .IP "\fBout_name\fR" 4
yading@10 1182 .IX Item "out_name"
yading@10 1183 output channel to define, either a channel name (\s-1FL\s0, \s-1FR\s0, etc.) or a channel
yading@10 1184 number (c0, c1, etc.)
yading@10 1185 .IP "\fBgain\fR" 4
yading@10 1186 .IX Item "gain"
yading@10 1187 multiplicative coefficient for the channel, 1 leaving the volume unchanged
yading@10 1188 .IP "\fBin_name\fR" 4
yading@10 1189 .IX Item "in_name"
yading@10 1190 input channel to use, see out_name for details; it is not possible to mix
yading@10 1191 named and numbered input channels
yading@10 1192 .PP
yading@10 1193 If the `=' in a channel specification is replaced by `<', then the gains for
yading@10 1194 that specification will be renormalized so that the total is 1, thus
yading@10 1195 avoiding clipping noise.
yading@10 1196 .PP
yading@10 1197 \fIMixing examples\fR
yading@10 1198 .IX Subsection "Mixing examples"
yading@10 1199 .PP
yading@10 1200 For example, if you want to down-mix from stereo to mono, but with a bigger
yading@10 1201 factor for the left channel:
yading@10 1202 .PP
yading@10 1203 .Vb 1
yading@10 1204 \& pan=1:c0=0.9*c0+0.1*c1
yading@10 1205 .Ve
yading@10 1206 .PP
yading@10 1207 A customized down-mix to stereo that works automatically for 3\-, 4\-, 5\- and
yading@10 1208 7\-channels surround:
yading@10 1209 .PP
yading@10 1210 .Vb 1
yading@10 1211 \& pan=stereo: FL < FL + 0.5*FC + 0.6*BL + 0.6*SL : FR < FR + 0.5*FC + 0.6*BR + 0.6*SR
yading@10 1212 .Ve
yading@10 1213 .PP
yading@10 1214 Note that \fBffmpeg\fR integrates a default down-mix (and up-mix) system
yading@10 1215 that should be preferred (see \*(L"\-ac\*(R" option) unless you have very specific
yading@10 1216 needs.
yading@10 1217 .PP
yading@10 1218 \fIRemapping examples\fR
yading@10 1219 .IX Subsection "Remapping examples"
yading@10 1220 .PP
yading@10 1221 The channel remapping will be effective if, and only if:
yading@10 1222 .IP "*<gain coefficients are zeroes or ones,>" 4
yading@10 1223 .IX Item "*<gain coefficients are zeroes or ones,>"
yading@10 1224 .PD 0
yading@10 1225 .IP "*<only one input per channel output,>" 4
yading@10 1226 .IX Item "*<only one input per channel output,>"
yading@10 1227 .PD
yading@10 1228 .PP
yading@10 1229 If all these conditions are satisfied, the filter will notify the user (\*(L"Pure
yading@10 1230 channel mapping detected\*(R"), and use an optimized and lossless method to do the
yading@10 1231 remapping.
yading@10 1232 .PP
yading@10 1233 For example, if you have a 5.1 source and want a stereo audio stream by
yading@10 1234 dropping the extra channels:
yading@10 1235 .PP
yading@10 1236 .Vb 1
yading@10 1237 \& pan="stereo: c0=FL : c1=FR"
yading@10 1238 .Ve
yading@10 1239 .PP
yading@10 1240 Given the same source, you can also switch front left and front right channels
yading@10 1241 and keep the input channel layout:
yading@10 1242 .PP
yading@10 1243 .Vb 1
yading@10 1244 \& pan="5.1: c0=c1 : c1=c0 : c2=c2 : c3=c3 : c4=c4 : c5=c5"
yading@10 1245 .Ve
yading@10 1246 .PP
yading@10 1247 If the input is a stereo audio stream, you can mute the front left channel (and
yading@10 1248 still keep the stereo channel layout) with:
yading@10 1249 .PP
yading@10 1250 .Vb 1
yading@10 1251 \& pan="stereo:c1=c1"
yading@10 1252 .Ve
yading@10 1253 .PP
yading@10 1254 Still with a stereo audio stream input, you can copy the right channel in both
yading@10 1255 front left and right:
yading@10 1256 .PP
yading@10 1257 .Vb 1
yading@10 1258 \& pan="stereo: c0=FR : c1=FR"
yading@10 1259 .Ve
yading@10 1260 .SS "silencedetect"
yading@10 1261 .IX Subsection "silencedetect"
yading@10 1262 Detect silence in an audio stream.
yading@10 1263 .PP
yading@10 1264 This filter logs a message when it detects that the input audio volume is less
yading@10 1265 or equal to a noise tolerance value for a duration greater or equal to the
yading@10 1266 minimum detected noise duration.
yading@10 1267 .PP
yading@10 1268 The printed times and duration are expressed in seconds.
yading@10 1269 .PP
yading@10 1270 The filter accepts the following options:
yading@10 1271 .IP "\fBduration, d\fR" 4
yading@10 1272 .IX Item "duration, d"
yading@10 1273 Set silence duration until notification (default is 2 seconds).
yading@10 1274 .IP "\fBnoise, n\fR" 4
yading@10 1275 .IX Item "noise, n"
yading@10 1276 Set noise tolerance. Can be specified in dB (in case \*(L"dB\*(R" is appended to the
yading@10 1277 specified value) or amplitude ratio. Default is \-60dB, or 0.001.
yading@10 1278 .PP
yading@10 1279 \fIExamples\fR
yading@10 1280 .IX Subsection "Examples"
yading@10 1281 .IP "\(bu" 4
yading@10 1282 Detect 5 seconds of silence with \-50dB noise tolerance:
yading@10 1283 .Sp
yading@10 1284 .Vb 1
yading@10 1285 \& silencedetect=n=\-50dB:d=5
yading@10 1286 .Ve
yading@10 1287 .IP "\(bu" 4
yading@10 1288 Complete example with \fBffmpeg\fR to detect silence with 0.0001 noise
yading@10 1289 tolerance in \fIsilence.mp3\fR:
yading@10 1290 .Sp
yading@10 1291 .Vb 1
yading@10 1292 \& ffmpeg \-i silence.mp3 \-af silencedetect=noise=0.0001 \-f null \-
yading@10 1293 .Ve
yading@10 1294 .SS "asyncts"
yading@10 1295 .IX Subsection "asyncts"
yading@10 1296 Synchronize audio data with timestamps by squeezing/stretching it and/or
yading@10 1297 dropping samples/adding silence when needed.
yading@10 1298 .PP
yading@10 1299 This filter is not built by default, please use aresample to do squeezing/stretching.
yading@10 1300 .PP
yading@10 1301 The filter accepts the following named parameters:
yading@10 1302 .IP "\fBcompensate\fR" 4
yading@10 1303 .IX Item "compensate"
yading@10 1304 Enable stretching/squeezing the data to make it match the timestamps. Disabled
yading@10 1305 by default. When disabled, time gaps are covered with silence.
yading@10 1306 .IP "\fBmin_delta\fR" 4
yading@10 1307 .IX Item "min_delta"
yading@10 1308 Minimum difference between timestamps and audio data (in seconds) to trigger
yading@10 1309 adding/dropping samples. Default value is 0.1. If you get non-perfect sync with
yading@10 1310 this filter, try setting this parameter to 0.
yading@10 1311 .IP "\fBmax_comp\fR" 4
yading@10 1312 .IX Item "max_comp"
yading@10 1313 Maximum compensation in samples per second. Relevant only with compensate=1.
yading@10 1314 Default value 500.
yading@10 1315 .IP "\fBfirst_pts\fR" 4
yading@10 1316 .IX Item "first_pts"
yading@10 1317 Assume the first pts should be this value. The time base is 1 / sample rate.
yading@10 1318 This allows for padding/trimming at the start of stream. By default, no
yading@10 1319 assumption is made about the first frame's expected pts, so no padding or
yading@10 1320 trimming is done. For example, this could be set to 0 to pad the beginning with
yading@10 1321 silence if an audio stream starts after the video stream or to trim any samples
yading@10 1322 with a negative pts due to encoder delay.
yading@10 1323 .SS "channelsplit"
yading@10 1324 .IX Subsection "channelsplit"
yading@10 1325 Split each channel in input audio stream into a separate output stream.
yading@10 1326 .PP
yading@10 1327 This filter accepts the following named parameters:
yading@10 1328 .IP "\fBchannel_layout\fR" 4
yading@10 1329 .IX Item "channel_layout"
yading@10 1330 Channel layout of the input stream. Default is \*(L"stereo\*(R".
yading@10 1331 .PP
yading@10 1332 For example, assuming a stereo input \s-1MP3\s0 file
yading@10 1333 .PP
yading@10 1334 .Vb 1
yading@10 1335 \& ffmpeg \-i in.mp3 \-filter_complex channelsplit out.mkv
yading@10 1336 .Ve
yading@10 1337 .PP
yading@10 1338 will create an output Matroska file with two audio streams, one containing only
yading@10 1339 the left channel and the other the right channel.
yading@10 1340 .PP
yading@10 1341 To split a 5.1 \s-1WAV\s0 file into per-channel files
yading@10 1342 .PP
yading@10 1343 .Vb 5
yading@10 1344 \& ffmpeg \-i in.wav \-filter_complex
yading@10 1345 \& \*(Aqchannelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]\*(Aq
yading@10 1346 \& \-map \*(Aq[FL]\*(Aq front_left.wav \-map \*(Aq[FR]\*(Aq front_right.wav \-map \*(Aq[FC]\*(Aq
yading@10 1347 \& front_center.wav \-map \*(Aq[LFE]\*(Aq lfe.wav \-map \*(Aq[SL]\*(Aq side_left.wav \-map \*(Aq[SR]\*(Aq
yading@10 1348 \& side_right.wav
yading@10 1349 .Ve
yading@10 1350 .SS "channelmap"
yading@10 1351 .IX Subsection "channelmap"
yading@10 1352 Remap input channels to new locations.
yading@10 1353 .PP
yading@10 1354 This filter accepts the following named parameters:
yading@10 1355 .IP "\fBchannel_layout\fR" 4
yading@10 1356 .IX Item "channel_layout"
yading@10 1357 Channel layout of the output stream.
yading@10 1358 .IP "\fBmap\fR" 4
yading@10 1359 .IX Item "map"
yading@10 1360 Map channels from input to output. The argument is a '|'\-separated list of
yading@10 1361 mappings, each in the \f(CW\*(C`\f(CIin_channel\f(CW\-\f(CIout_channel\f(CW\*(C'\fR or
yading@10 1362 \&\fIin_channel\fR form. \fIin_channel\fR can be either the name of the input
yading@10 1363 channel (e.g. \s-1FL\s0 for front left) or its index in the input channel layout.
yading@10 1364 \&\fIout_channel\fR is the name of the output channel or its index in the output
yading@10 1365 channel layout. If \fIout_channel\fR is not given then it is implicitly an
yading@10 1366 index, starting with zero and increasing by one for each mapping.
yading@10 1367 .PP
yading@10 1368 If no mapping is present, the filter will implicitly map input channels to
yading@10 1369 output channels preserving index.
yading@10 1370 .PP
yading@10 1371 For example, assuming a 5.1+downmix input \s-1MOV\s0 file
yading@10 1372 .PP
yading@10 1373 .Vb 1
yading@10 1374 \& ffmpeg \-i in.mov \-filter \*(Aqchannelmap=map=DL\-FL|DR\-FR\*(Aq out.wav
yading@10 1375 .Ve
yading@10 1376 .PP
yading@10 1377 will create an output \s-1WAV\s0 file tagged as stereo from the downmix channels of
yading@10 1378 the input.
yading@10 1379 .PP
yading@10 1380 To fix a 5.1 \s-1WAV\s0 improperly encoded in \s-1AAC\s0's native channel order
yading@10 1381 .PP
yading@10 1382 .Vb 1
yading@10 1383 \& ffmpeg \-i in.wav \-filter \*(Aqchannelmap=1|2|0|5|3|4:channel_layout=5.1\*(Aq out.wav
yading@10 1384 .Ve
yading@10 1385 .SS "join"
yading@10 1386 .IX Subsection "join"
yading@10 1387 Join multiple input streams into one multi-channel stream.
yading@10 1388 .PP
yading@10 1389 The filter accepts the following named parameters:
yading@10 1390 .IP "\fBinputs\fR" 4
yading@10 1391 .IX Item "inputs"
yading@10 1392 Number of input streams. Defaults to 2.
yading@10 1393 .IP "\fBchannel_layout\fR" 4
yading@10 1394 .IX Item "channel_layout"
yading@10 1395 Desired output channel layout. Defaults to stereo.
yading@10 1396 .IP "\fBmap\fR" 4
yading@10 1397 .IX Item "map"
yading@10 1398 Map channels from inputs to output. The argument is a '|'\-separated list of
yading@10 1399 mappings, each in the \f(CW\*(C`\f(CIinput_idx\f(CW.\f(CIin_channel\f(CW\-\f(CIout_channel\f(CW\*(C'\fR
yading@10 1400 form. \fIinput_idx\fR is the 0\-based index of the input stream. \fIin_channel\fR
yading@10 1401 can be either the name of the input channel (e.g. \s-1FL\s0 for front left) or its
yading@10 1402 index in the specified input stream. \fIout_channel\fR is the name of the output
yading@10 1403 channel.
yading@10 1404 .PP
yading@10 1405 The filter will attempt to guess the mappings when those are not specified
yading@10 1406 explicitly. It does so by first trying to find an unused matching input channel
yading@10 1407 and if that fails it picks the first unused input channel.
yading@10 1408 .PP
yading@10 1409 E.g. to join 3 inputs (with properly set channel layouts)
yading@10 1410 .PP
yading@10 1411 .Vb 1
yading@10 1412 \& ffmpeg \-i INPUT1 \-i INPUT2 \-i INPUT3 \-filter_complex join=inputs=3 OUTPUT
yading@10 1413 .Ve
yading@10 1414 .PP
yading@10 1415 To build a 5.1 output from 6 single-channel streams:
yading@10 1416 .PP
yading@10 1417 .Vb 3
yading@10 1418 \& ffmpeg \-i fl \-i fr \-i fc \-i sl \-i sr \-i lfe \-filter_complex
yading@10 1419 \& \*(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
yading@10 1420 \& out
yading@10 1421 .Ve
yading@10 1422 .SS "resample"
yading@10 1423 .IX Subsection "resample"
yading@10 1424 Convert the audio sample format, sample rate and channel layout. This filter is
yading@10 1425 not meant to be used directly.
yading@10 1426 .SS "volume"
yading@10 1427 .IX Subsection "volume"
yading@10 1428 Adjust the input audio volume.
yading@10 1429 .PP
yading@10 1430 The filter accepts the following options:
yading@10 1431 .IP "\fBvolume\fR" 4
yading@10 1432 .IX Item "volume"
yading@10 1433 Expresses how the audio volume will be increased or decreased.
yading@10 1434 .Sp
yading@10 1435 Output values are clipped to the maximum value.
yading@10 1436 .Sp
yading@10 1437 The output audio volume is given by the relation:
yading@10 1438 .Sp
yading@10 1439 .Vb 1
yading@10 1440 \& <output_volume> = <volume> * <input_volume>
yading@10 1441 .Ve
yading@10 1442 .Sp
yading@10 1443 Default value for \fIvolume\fR is 1.0.
yading@10 1444 .IP "\fBprecision\fR" 4
yading@10 1445 .IX Item "precision"
yading@10 1446 Set the mathematical precision.
yading@10 1447 .Sp
yading@10 1448 This determines which input sample formats will be allowed, which affects the
yading@10 1449 precision of the volume scaling.
yading@10 1450 .RS 4
yading@10 1451 .IP "\fBfixed\fR" 4
yading@10 1452 .IX Item "fixed"
yading@10 1453 8\-bit fixed-point; limits input sample format to U8, S16, and S32.
yading@10 1454 .IP "\fBfloat\fR" 4
yading@10 1455 .IX Item "float"
yading@10 1456 32\-bit floating-point; limits input sample format to \s-1FLT\s0. (default)
yading@10 1457 .IP "\fBdouble\fR" 4
yading@10 1458 .IX Item "double"
yading@10 1459 64\-bit floating-point; limits input sample format to \s-1DBL\s0.
yading@10 1460 .RE
yading@10 1461 .RS 4
yading@10 1462 .RE
yading@10 1463 .PP
yading@10 1464 \fIExamples\fR
yading@10 1465 .IX Subsection "Examples"
yading@10 1466 .IP "\(bu" 4
yading@10 1467 Halve the input audio volume:
yading@10 1468 .Sp
yading@10 1469 .Vb 3
yading@10 1470 \& volume=volume=0.5
yading@10 1471 \& volume=volume=1/2
yading@10 1472 \& volume=volume=\-6.0206dB
yading@10 1473 .Ve
yading@10 1474 .Sp
yading@10 1475 In all the above example the named key for \fBvolume\fR can be
yading@10 1476 omitted, for example like in:
yading@10 1477 .Sp
yading@10 1478 .Vb 1
yading@10 1479 \& volume=0.5
yading@10 1480 .Ve
yading@10 1481 .IP "\(bu" 4
yading@10 1482 Increase input audio power by 6 decibels using fixed-point precision:
yading@10 1483 .Sp
yading@10 1484 .Vb 1
yading@10 1485 \& volume=volume=6dB:precision=fixed
yading@10 1486 .Ve
yading@10 1487 .SS "volumedetect"
yading@10 1488 .IX Subsection "volumedetect"
yading@10 1489 Detect the volume of the input video.
yading@10 1490 .PP
yading@10 1491 The filter has no parameters. The input is not modified. Statistics about
yading@10 1492 the volume will be printed in the log when the input stream end is reached.
yading@10 1493 .PP
yading@10 1494 In particular it will show the mean volume (root mean square), maximum
yading@10 1495 volume (on a per-sample basis), and the beginning of an histogram of the
yading@10 1496 registered volume values (from the maximum value to a cumulated 1/1000 of
yading@10 1497 the samples).
yading@10 1498 .PP
yading@10 1499 All volumes are in decibels relative to the maximum \s-1PCM\s0 value.
yading@10 1500 .PP
yading@10 1501 \fIExamples\fR
yading@10 1502 .IX Subsection "Examples"
yading@10 1503 .PP
yading@10 1504 Here is an excerpt of the output:
yading@10 1505 .PP
yading@10 1506 .Vb 9
yading@10 1507 \& [Parsed_volumedetect_0 0xa23120] mean_volume: \-27 dB
yading@10 1508 \& [Parsed_volumedetect_0 0xa23120] max_volume: \-4 dB
yading@10 1509 \& [Parsed_volumedetect_0 0xa23120] histogram_4db: 6
yading@10 1510 \& [Parsed_volumedetect_0 0xa23120] histogram_5db: 62
yading@10 1511 \& [Parsed_volumedetect_0 0xa23120] histogram_6db: 286
yading@10 1512 \& [Parsed_volumedetect_0 0xa23120] histogram_7db: 1042
yading@10 1513 \& [Parsed_volumedetect_0 0xa23120] histogram_8db: 2551
yading@10 1514 \& [Parsed_volumedetect_0 0xa23120] histogram_9db: 4609
yading@10 1515 \& [Parsed_volumedetect_0 0xa23120] histogram_10db: 8409
yading@10 1516 .Ve
yading@10 1517 .PP
yading@10 1518 It means that:
yading@10 1519 .IP "\(bu" 4
yading@10 1520 The mean square energy is approximately \-27 dB, or 10^\-2.7.
yading@10 1521 .IP "\(bu" 4
yading@10 1522 The largest sample is at \-4 dB, or more precisely between \-4 dB and \-5 dB.
yading@10 1523 .IP "\(bu" 4
yading@10 1524 There are 6 samples at \-4 dB, 62 at \-5 dB, 286 at \-6 dB, etc.
yading@10 1525 .PP
yading@10 1526 In other words, raising the volume by +4 dB does not cause any clipping,
yading@10 1527 raising it by +5 dB causes clipping for 6 samples, etc.
yading@10 1528 .SH "AUDIO SOURCES"
yading@10 1529 .IX Header "AUDIO SOURCES"
yading@10 1530 Below is a description of the currently available audio sources.
yading@10 1531 .SS "abuffer"
yading@10 1532 .IX Subsection "abuffer"
yading@10 1533 Buffer audio frames, and make them available to the filter chain.
yading@10 1534 .PP
yading@10 1535 This source is mainly intended for a programmatic use, in particular
yading@10 1536 through the interface defined in \fIlibavfilter/asrc_abuffer.h\fR.
yading@10 1537 .PP
yading@10 1538 It accepts the following named parameters:
yading@10 1539 .IP "\fBtime_base\fR" 4
yading@10 1540 .IX Item "time_base"
yading@10 1541 Timebase which will be used for timestamps of submitted frames. It must be
yading@10 1542 either a floating-point number or in \fInumerator\fR/\fIdenominator\fR form.
yading@10 1543 .IP "\fBsample_rate\fR" 4
yading@10 1544 .IX Item "sample_rate"
yading@10 1545 The sample rate of the incoming audio buffers.
yading@10 1546 .IP "\fBsample_fmt\fR" 4
yading@10 1547 .IX Item "sample_fmt"
yading@10 1548 The sample format of the incoming audio buffers.
yading@10 1549 Either a sample format name or its corresponging integer representation from
yading@10 1550 the enum AVSampleFormat in \fIlibavutil/samplefmt.h\fR
yading@10 1551 .IP "\fBchannel_layout\fR" 4
yading@10 1552 .IX Item "channel_layout"
yading@10 1553 The channel layout of the incoming audio buffers.
yading@10 1554 Either a channel layout name from channel_layout_map in
yading@10 1555 \&\fIlibavutil/channel_layout.c\fR or its corresponding integer representation
yading@10 1556 from the AV_CH_LAYOUT_* macros in \fIlibavutil/channel_layout.h\fR
yading@10 1557 .IP "\fBchannels\fR" 4
yading@10 1558 .IX Item "channels"
yading@10 1559 The number of channels of the incoming audio buffers.
yading@10 1560 If both \fIchannels\fR and \fIchannel_layout\fR are specified, then they
yading@10 1561 must be consistent.
yading@10 1562 .PP
yading@10 1563 \fIExamples\fR
yading@10 1564 .IX Subsection "Examples"
yading@10 1565 .PP
yading@10 1566 .Vb 1
yading@10 1567 \& abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
yading@10 1568 .Ve
yading@10 1569 .PP
yading@10 1570 will instruct the source to accept planar 16bit signed stereo at 44100Hz.
yading@10 1571 Since the sample format with name \*(L"s16p\*(R" corresponds to the number
yading@10 1572 6 and the \*(L"stereo\*(R" channel layout corresponds to the value 0x3, this is
yading@10 1573 equivalent to:
yading@10 1574 .PP
yading@10 1575 .Vb 1
yading@10 1576 \& abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
yading@10 1577 .Ve
yading@10 1578 .SS "aevalsrc"
yading@10 1579 .IX Subsection "aevalsrc"
yading@10 1580 Generate an audio signal specified by an expression.
yading@10 1581 .PP
yading@10 1582 This source accepts in input one or more expressions (one for each
yading@10 1583 channel), which are evaluated and used to generate a corresponding
yading@10 1584 audio signal.
yading@10 1585 .PP
yading@10 1586 This source accepts the following options:
yading@10 1587 .IP "\fBexprs\fR" 4
yading@10 1588 .IX Item "exprs"
yading@10 1589 Set the '|'\-separated expressions list for each separate channel. In case the
yading@10 1590 \&\fBchannel_layout\fR option is not specified, the selected channel layout
yading@10 1591 depends on the number of provided expressions.
yading@10 1592 .IP "\fBchannel_layout, c\fR" 4
yading@10 1593 .IX Item "channel_layout, c"
yading@10 1594 Set the channel layout. The number of channels in the specified layout
yading@10 1595 must be equal to the number of specified expressions.
yading@10 1596 .IP "\fBduration, d\fR" 4
yading@10 1597 .IX Item "duration, d"
yading@10 1598 Set the minimum duration of the sourced audio. See the function
yading@10 1599 \&\f(CW\*(C`av_parse_time()\*(C'\fR for the accepted format.
yading@10 1600 Note that the resulting duration may be greater than the specified
yading@10 1601 duration, as the generated audio is always cut at the end of a
yading@10 1602 complete frame.
yading@10 1603 .Sp
yading@10 1604 If not specified, or the expressed duration is negative, the audio is
yading@10 1605 supposed to be generated forever.
yading@10 1606 .IP "\fBnb_samples, n\fR" 4
yading@10 1607 .IX Item "nb_samples, n"
yading@10 1608 Set the number of samples per channel per each output frame,
yading@10 1609 default to 1024.
yading@10 1610 .IP "\fBsample_rate, s\fR" 4
yading@10 1611 .IX Item "sample_rate, s"
yading@10 1612 Specify the sample rate, default to 44100.
yading@10 1613 .PP
yading@10 1614 Each expression in \fIexprs\fR can contain the following constants:
yading@10 1615 .IP "\fBn\fR" 4
yading@10 1616 .IX Item "n"
yading@10 1617 number of the evaluated sample, starting from 0
yading@10 1618 .IP "\fBt\fR" 4
yading@10 1619 .IX Item "t"
yading@10 1620 time of the evaluated sample expressed in seconds, starting from 0
yading@10 1621 .IP "\fBs\fR" 4
yading@10 1622 .IX Item "s"
yading@10 1623 sample rate
yading@10 1624 .PP
yading@10 1625 \fIExamples\fR
yading@10 1626 .IX Subsection "Examples"
yading@10 1627 .IP "\(bu" 4
yading@10 1628 Generate silence:
yading@10 1629 .Sp
yading@10 1630 .Vb 1
yading@10 1631 \& aevalsrc=0
yading@10 1632 .Ve
yading@10 1633 .IP "\(bu" 4
yading@10 1634 Generate a sin signal with frequency of 440 Hz, set sample rate to
yading@10 1635 8000 Hz:
yading@10 1636 .Sp
yading@10 1637 .Vb 1
yading@10 1638 \& aevalsrc="sin(440*2*PI*t):s=8000"
yading@10 1639 .Ve
yading@10 1640 .IP "\(bu" 4
yading@10 1641 Generate a two channels signal, specify the channel layout (Front
yading@10 1642 Center + Back Center) explicitly:
yading@10 1643 .Sp
yading@10 1644 .Vb 1
yading@10 1645 \& aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC"
yading@10 1646 .Ve
yading@10 1647 .IP "\(bu" 4
yading@10 1648 Generate white noise:
yading@10 1649 .Sp
yading@10 1650 .Vb 1
yading@10 1651 \& aevalsrc="\-2+random(0)"
yading@10 1652 .Ve
yading@10 1653 .IP "\(bu" 4
yading@10 1654 Generate an amplitude modulated signal:
yading@10 1655 .Sp
yading@10 1656 .Vb 1
yading@10 1657 \& aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)"
yading@10 1658 .Ve
yading@10 1659 .IP "\(bu" 4
yading@10 1660 Generate 2.5 Hz binaural beats on a 360 Hz carrier:
yading@10 1661 .Sp
yading@10 1662 .Vb 1
yading@10 1663 \& aevalsrc="0.1*sin(2*PI*(360\-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)"
yading@10 1664 .Ve
yading@10 1665 .SS "anullsrc"
yading@10 1666 .IX Subsection "anullsrc"
yading@10 1667 Null audio source, return unprocessed audio frames. It is mainly useful
yading@10 1668 as a template and to be employed in analysis / debugging tools, or as
yading@10 1669 the source for filters which ignore the input data (for example the sox
yading@10 1670 synth filter).
yading@10 1671 .PP
yading@10 1672 This source accepts the following options:
yading@10 1673 .IP "\fBchannel_layout, cl\fR" 4
yading@10 1674 .IX Item "channel_layout, cl"
yading@10 1675 Specify the channel layout, and can be either an integer or a string
yading@10 1676 representing a channel layout. The default value of \fIchannel_layout\fR
yading@10 1677 is \*(L"stereo\*(R".
yading@10 1678 .Sp
yading@10 1679 Check the channel_layout_map definition in
yading@10 1680 \&\fIlibavutil/channel_layout.c\fR for the mapping between strings and
yading@10 1681 channel layout values.
yading@10 1682 .IP "\fBsample_rate, r\fR" 4
yading@10 1683 .IX Item "sample_rate, r"
yading@10 1684 Specify the sample rate, and defaults to 44100.
yading@10 1685 .IP "\fBnb_samples, n\fR" 4
yading@10 1686 .IX Item "nb_samples, n"
yading@10 1687 Set the number of samples per requested frames.
yading@10 1688 .PP
yading@10 1689 \fIExamples\fR
yading@10 1690 .IX Subsection "Examples"
yading@10 1691 .IP "\(bu" 4
yading@10 1692 Set the sample rate to 48000 Hz and the channel layout to \s-1AV_CH_LAYOUT_MONO\s0.
yading@10 1693 .Sp
yading@10 1694 .Vb 1
yading@10 1695 \& anullsrc=r=48000:cl=4
yading@10 1696 .Ve
yading@10 1697 .IP "\(bu" 4
yading@10 1698 Do the same operation with a more obvious syntax:
yading@10 1699 .Sp
yading@10 1700 .Vb 1
yading@10 1701 \& anullsrc=r=48000:cl=mono
yading@10 1702 .Ve
yading@10 1703 .SS "abuffer"
yading@10 1704 .IX Subsection "abuffer"
yading@10 1705 Buffer audio frames, and make them available to the filter chain.
yading@10 1706 .PP
yading@10 1707 This source is not intended to be part of user-supplied graph descriptions but
yading@10 1708 for insertion by calling programs through the interface defined in
yading@10 1709 \&\fIlibavfilter/buffersrc.h\fR.
yading@10 1710 .PP
yading@10 1711 It accepts the following named parameters:
yading@10 1712 .IP "\fBtime_base\fR" 4
yading@10 1713 .IX Item "time_base"
yading@10 1714 Timebase which will be used for timestamps of submitted frames. It must be
yading@10 1715 either a floating-point number or in \fInumerator\fR/\fIdenominator\fR form.
yading@10 1716 .IP "\fBsample_rate\fR" 4
yading@10 1717 .IX Item "sample_rate"
yading@10 1718 Audio sample rate.
yading@10 1719 .IP "\fBsample_fmt\fR" 4
yading@10 1720 .IX Item "sample_fmt"
yading@10 1721 Name of the sample format, as returned by \f(CW\*(C`av_get_sample_fmt_name()\*(C'\fR.
yading@10 1722 .IP "\fBchannel_layout\fR" 4
yading@10 1723 .IX Item "channel_layout"
yading@10 1724 Channel layout of the audio data, in the form that can be accepted by
yading@10 1725 \&\f(CW\*(C`av_get_channel_layout()\*(C'\fR.
yading@10 1726 .PP
yading@10 1727 All the parameters need to be explicitly defined.
yading@10 1728 .SS "flite"
yading@10 1729 .IX Subsection "flite"
yading@10 1730 Synthesize a voice utterance using the libflite library.
yading@10 1731 .PP
yading@10 1732 To enable compilation of this filter you need to configure FFmpeg with
yading@10 1733 \&\f(CW\*(C`\-\-enable\-libflite\*(C'\fR.
yading@10 1734 .PP
yading@10 1735 Note that the flite library is not thread-safe.
yading@10 1736 .PP
yading@10 1737 The filter accepts the following options:
yading@10 1738 .IP "\fBlist_voices\fR" 4
yading@10 1739 .IX Item "list_voices"
yading@10 1740 If set to 1, list the names of the available voices and exit
yading@10 1741 immediately. Default value is 0.
yading@10 1742 .IP "\fBnb_samples, n\fR" 4
yading@10 1743 .IX Item "nb_samples, n"
yading@10 1744 Set the maximum number of samples per frame. Default value is 512.
yading@10 1745 .IP "\fBtextfile\fR" 4
yading@10 1746 .IX Item "textfile"
yading@10 1747 Set the filename containing the text to speak.
yading@10 1748 .IP "\fBtext\fR" 4
yading@10 1749 .IX Item "text"
yading@10 1750 Set the text to speak.
yading@10 1751 .IP "\fBvoice, v\fR" 4
yading@10 1752 .IX Item "voice, v"
yading@10 1753 Set the voice to use for the speech synthesis. Default value is
yading@10 1754 \&\f(CW\*(C`kal\*(C'\fR. See also the \fIlist_voices\fR option.
yading@10 1755 .PP
yading@10 1756 \fIExamples\fR
yading@10 1757 .IX Subsection "Examples"
yading@10 1758 .IP "\(bu" 4
yading@10 1759 Read from file \fIspeech.txt\fR, and synthetize the text using the
yading@10 1760 standard flite voice:
yading@10 1761 .Sp
yading@10 1762 .Vb 1
yading@10 1763 \& flite=textfile=speech.txt
yading@10 1764 .Ve
yading@10 1765 .IP "\(bu" 4
yading@10 1766 Read the specified text selecting the \f(CW\*(C`slt\*(C'\fR voice:
yading@10 1767 .Sp
yading@10 1768 .Vb 1
yading@10 1769 \& flite=text=\*(AqSo fare thee well, poor devil of a Sub\-Sub, whose commentator I am\*(Aq:voice=slt
yading@10 1770 .Ve
yading@10 1771 .IP "\(bu" 4
yading@10 1772 Input text to ffmpeg:
yading@10 1773 .Sp
yading@10 1774 .Vb 1
yading@10 1775 \& ffmpeg \-f lavfi \-i flite=text=\*(AqSo fare thee well, poor devil of a Sub\-Sub, whose commentator I am\*(Aq:voice=slt
yading@10 1776 .Ve
yading@10 1777 .IP "\(bu" 4
yading@10 1778 Make \fIffplay\fR speak the specified text, using \f(CW\*(C`flite\*(C'\fR and
yading@10 1779 the \f(CW\*(C`lavfi\*(C'\fR device:
yading@10 1780 .Sp
yading@10 1781 .Vb 1
yading@10 1782 \& ffplay \-f lavfi flite=text=\*(AqNo more be grieved for which that thou hast done.\*(Aq
yading@10 1783 .Ve
yading@10 1784 .PP
yading@10 1785 For more information about libflite, check:
yading@10 1786 <\fBhttp://www.speech.cs.cmu.edu/flite/\fR>
yading@10 1787 .SS "sine"
yading@10 1788 .IX Subsection "sine"
yading@10 1789 Generate an audio signal made of a sine wave with amplitude 1/8.
yading@10 1790 .PP
yading@10 1791 The audio signal is bit-exact.
yading@10 1792 .PP
yading@10 1793 The filter accepts the following options:
yading@10 1794 .IP "\fBfrequency, f\fR" 4
yading@10 1795 .IX Item "frequency, f"
yading@10 1796 Set the carrier frequency. Default is 440 Hz.
yading@10 1797 .IP "\fBbeep_factor, b\fR" 4
yading@10 1798 .IX Item "beep_factor, b"
yading@10 1799 Enable a periodic beep every second with frequency \fIbeep_factor\fR times
yading@10 1800 the carrier frequency. Default is 0, meaning the beep is disabled.
yading@10 1801 .IP "\fBsample_rate, s\fR" 4
yading@10 1802 .IX Item "sample_rate, s"
yading@10 1803 Specify the sample rate, default is 44100.
yading@10 1804 .IP "\fBduration, d\fR" 4
yading@10 1805 .IX Item "duration, d"
yading@10 1806 Specify the duration of the generated audio stream.
yading@10 1807 .IP "\fBsamples_per_frame\fR" 4
yading@10 1808 .IX Item "samples_per_frame"
yading@10 1809 Set the number of samples per output frame, default is 1024.
yading@10 1810 .PP
yading@10 1811 \fIExamples\fR
yading@10 1812 .IX Subsection "Examples"
yading@10 1813 .IP "\(bu" 4
yading@10 1814 Generate a simple 440 Hz sine wave:
yading@10 1815 .Sp
yading@10 1816 .Vb 1
yading@10 1817 \& sine
yading@10 1818 .Ve
yading@10 1819 .IP "\(bu" 4
yading@10 1820 Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
yading@10 1821 .Sp
yading@10 1822 .Vb 3
yading@10 1823 \& sine=220:4:d=5
yading@10 1824 \& sine=f=220:b=4:d=5
yading@10 1825 \& sine=frequency=220:beep_factor=4:duration=5
yading@10 1826 .Ve
yading@10 1827 .SH "AUDIO SINKS"
yading@10 1828 .IX Header "AUDIO SINKS"
yading@10 1829 Below is a description of the currently available audio sinks.
yading@10 1830 .SS "abuffersink"
yading@10 1831 .IX Subsection "abuffersink"
yading@10 1832 Buffer audio frames, and make them available to the end of filter chain.
yading@10 1833 .PP
yading@10 1834 This sink is mainly intended for programmatic use, in particular
yading@10 1835 through the interface defined in \fIlibavfilter/buffersink.h\fR
yading@10 1836 or the options system.
yading@10 1837 .PP
yading@10 1838 It accepts a pointer to an AVABufferSinkContext structure, which
yading@10 1839 defines the incoming buffers' formats, to be passed as the opaque
yading@10 1840 parameter to \f(CW\*(C`avfilter_init_filter\*(C'\fR for initialization.
yading@10 1841 .SS "anullsink"
yading@10 1842 .IX Subsection "anullsink"
yading@10 1843 Null audio sink, do absolutely nothing with the input audio. It is
yading@10 1844 mainly useful as a template and to be employed in analysis / debugging
yading@10 1845 tools.
yading@10 1846 .SH "VIDEO FILTERS"
yading@10 1847 .IX Header "VIDEO FILTERS"
yading@10 1848 When you configure your FFmpeg build, you can disable any of the
yading@10 1849 existing filters using \f(CW\*(C`\-\-disable\-filters\*(C'\fR.
yading@10 1850 The configure output will show the video filters included in your
yading@10 1851 build.
yading@10 1852 .PP
yading@10 1853 Below is a description of the currently available video filters.
yading@10 1854 .SS "alphaextract"
yading@10 1855 .IX Subsection "alphaextract"
yading@10 1856 Extract the alpha component from the input as a grayscale video. This
yading@10 1857 is especially useful with the \fIalphamerge\fR filter.
yading@10 1858 .SS "alphamerge"
yading@10 1859 .IX Subsection "alphamerge"
yading@10 1860 Add or replace the alpha component of the primary input with the
yading@10 1861 grayscale value of a second input. This is intended for use with
yading@10 1862 \&\fIalphaextract\fR to allow the transmission or storage of frame
yading@10 1863 sequences that have alpha in a format that doesn't support an alpha
yading@10 1864 channel.
yading@10 1865 .PP
yading@10 1866 For example, to reconstruct full frames from a normal YUV-encoded video
yading@10 1867 and a separate video created with \fIalphaextract\fR, you might use:
yading@10 1868 .PP
yading@10 1869 .Vb 1
yading@10 1870 \& movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
yading@10 1871 .Ve
yading@10 1872 .PP
yading@10 1873 Since this filter is designed for reconstruction, it operates on frame
yading@10 1874 sequences without considering timestamps, and terminates when either
yading@10 1875 input reaches end of stream. This will cause problems if your encoding
yading@10 1876 pipeline drops frames. If you're trying to apply an image as an
yading@10 1877 overlay to a video stream, consider the \fIoverlay\fR filter instead.
yading@10 1878 .SS "ass"
yading@10 1879 .IX Subsection "ass"
yading@10 1880 Same as the subtitles filter, except that it doesn't require libavcodec
yading@10 1881 and libavformat to work. On the other hand, it is limited to \s-1ASS\s0 (Advanced
yading@10 1882 Substation Alpha) subtitles files.
yading@10 1883 .SS "bbox"
yading@10 1884 .IX Subsection "bbox"
yading@10 1885 Compute the bounding box for the non-black pixels in the input frame
yading@10 1886 luminance plane.
yading@10 1887 .PP
yading@10 1888 This filter computes the bounding box containing all the pixels with a
yading@10 1889 luminance value greater than the minimum allowed value.
yading@10 1890 The parameters describing the bounding box are printed on the filter
yading@10 1891 log.
yading@10 1892 .SS "blackdetect"
yading@10 1893 .IX Subsection "blackdetect"
yading@10 1894 Detect video intervals that are (almost) completely black. Can be
yading@10 1895 useful to detect chapter transitions, commercials, or invalid
yading@10 1896 recordings. Output lines contains the time for the start, end and
yading@10 1897 duration of the detected black interval expressed in seconds.
yading@10 1898 .PP
yading@10 1899 In order to display the output lines, you need to set the loglevel at
yading@10 1900 least to the \s-1AV_LOG_INFO\s0 value.
yading@10 1901 .PP
yading@10 1902 The filter accepts the following options:
yading@10 1903 .IP "\fBblack_min_duration, d\fR" 4
yading@10 1904 .IX Item "black_min_duration, d"
yading@10 1905 Set the minimum detected black duration expressed in seconds. It must
yading@10 1906 be a non-negative floating point number.
yading@10 1907 .Sp
yading@10 1908 Default value is 2.0.
yading@10 1909 .IP "\fBpicture_black_ratio_th, pic_th\fR" 4
yading@10 1910 .IX Item "picture_black_ratio_th, pic_th"
yading@10 1911 Set the threshold for considering a picture \*(L"black\*(R".
yading@10 1912 Express the minimum value for the ratio:
yading@10 1913 .Sp
yading@10 1914 .Vb 1
yading@10 1915 \& <nb_black_pixels> / <nb_pixels>
yading@10 1916 .Ve
yading@10 1917 .Sp
yading@10 1918 for which a picture is considered black.
yading@10 1919 Default value is 0.98.
yading@10 1920 .IP "\fBpixel_black_th, pix_th\fR" 4
yading@10 1921 .IX Item "pixel_black_th, pix_th"
yading@10 1922 Set the threshold for considering a pixel \*(L"black\*(R".
yading@10 1923 .Sp
yading@10 1924 The threshold expresses the maximum pixel luminance value for which a
yading@10 1925 pixel is considered \*(L"black\*(R". The provided value is scaled according to
yading@10 1926 the following equation:
yading@10 1927 .Sp
yading@10 1928 .Vb 1
yading@10 1929 \& <absolute_threshold> = <luminance_minimum_value> + <pixel_black_th> * <luminance_range_size>
yading@10 1930 .Ve
yading@10 1931 .Sp
yading@10 1932 \&\fIluminance_range_size\fR and \fIluminance_minimum_value\fR depend on
yading@10 1933 the input video format, the range is [0\-255] for \s-1YUV\s0 full-range
yading@10 1934 formats and [16\-235] for \s-1YUV\s0 non full-range formats.
yading@10 1935 .Sp
yading@10 1936 Default value is 0.10.
yading@10 1937 .PP
yading@10 1938 The following example sets the maximum pixel threshold to the minimum
yading@10 1939 value, and detects only black intervals of 2 or more seconds:
yading@10 1940 .PP
yading@10 1941 .Vb 1
yading@10 1942 \& blackdetect=d=2:pix_th=0.00
yading@10 1943 .Ve
yading@10 1944 .SS "blackframe"
yading@10 1945 .IX Subsection "blackframe"
yading@10 1946 Detect frames that are (almost) completely black. Can be useful to
yading@10 1947 detect chapter transitions or commercials. Output lines consist of
yading@10 1948 the frame number of the detected frame, the percentage of blackness,
yading@10 1949 the position in the file if known or \-1 and the timestamp in seconds.
yading@10 1950 .PP
yading@10 1951 In order to display the output lines, you need to set the loglevel at
yading@10 1952 least to the \s-1AV_LOG_INFO\s0 value.
yading@10 1953 .PP
yading@10 1954 The filter accepts the following options:
yading@10 1955 .IP "\fBamount\fR" 4
yading@10 1956 .IX Item "amount"
yading@10 1957 Set the percentage of the pixels that have to be below the threshold, defaults
yading@10 1958 to \f(CW98\fR.
yading@10 1959 .IP "\fBthreshold, thresh\fR" 4
yading@10 1960 .IX Item "threshold, thresh"
yading@10 1961 Set the threshold below which a pixel value is considered black, defaults to
yading@10 1962 \&\f(CW32\fR.
yading@10 1963 .SS "blend"
yading@10 1964 .IX Subsection "blend"
yading@10 1965 Blend two video frames into each other.
yading@10 1966 .PP
yading@10 1967 It takes two input streams and outputs one stream, the first input is the
yading@10 1968 \&\*(L"top\*(R" layer and second input is \*(L"bottom\*(R" layer.
yading@10 1969 Output terminates when shortest input terminates.
yading@10 1970 .PP
yading@10 1971 A description of the accepted options follows.
yading@10 1972 .IP "\fBc0_mode\fR" 4
yading@10 1973 .IX Item "c0_mode"
yading@10 1974 .PD 0
yading@10 1975 .IP "\fBc1_mode\fR" 4
yading@10 1976 .IX Item "c1_mode"
yading@10 1977 .IP "\fBc2_mode\fR" 4
yading@10 1978 .IX Item "c2_mode"
yading@10 1979 .IP "\fBc3_mode\fR" 4
yading@10 1980 .IX Item "c3_mode"
yading@10 1981 .IP "\fBall_mode\fR" 4
yading@10 1982 .IX Item "all_mode"
yading@10 1983 .PD
yading@10 1984 Set blend mode for specific pixel component or all pixel components in case
yading@10 1985 of \fIall_mode\fR. Default value is \f(CW\*(C`normal\*(C'\fR.
yading@10 1986 .Sp
yading@10 1987 Available values for component modes are:
yading@10 1988 .RS 4
yading@10 1989 .IP "\fBaddition\fR" 4
yading@10 1990 .IX Item "addition"
yading@10 1991 .PD 0
yading@10 1992 .IP "\fBand\fR" 4
yading@10 1993 .IX Item "and"
yading@10 1994 .IP "\fBaverage\fR" 4
yading@10 1995 .IX Item "average"
yading@10 1996 .IP "\fBburn\fR" 4
yading@10 1997 .IX Item "burn"
yading@10 1998 .IP "\fBdarken\fR" 4
yading@10 1999 .IX Item "darken"
yading@10 2000 .IP "\fBdifference\fR" 4
yading@10 2001 .IX Item "difference"
yading@10 2002 .IP "\fBdivide\fR" 4
yading@10 2003 .IX Item "divide"
yading@10 2004 .IP "\fBdodge\fR" 4
yading@10 2005 .IX Item "dodge"
yading@10 2006 .IP "\fBexclusion\fR" 4
yading@10 2007 .IX Item "exclusion"
yading@10 2008 .IP "\fBhardlight\fR" 4
yading@10 2009 .IX Item "hardlight"
yading@10 2010 .IP "\fBlighten\fR" 4
yading@10 2011 .IX Item "lighten"
yading@10 2012 .IP "\fBmultiply\fR" 4
yading@10 2013 .IX Item "multiply"
yading@10 2014 .IP "\fBnegation\fR" 4
yading@10 2015 .IX Item "negation"
yading@10 2016 .IP "\fBnormal\fR" 4
yading@10 2017 .IX Item "normal"
yading@10 2018 .IP "\fBor\fR" 4
yading@10 2019 .IX Item "or"
yading@10 2020 .IP "\fBoverlay\fR" 4
yading@10 2021 .IX Item "overlay"
yading@10 2022 .IP "\fBphoenix\fR" 4
yading@10 2023 .IX Item "phoenix"
yading@10 2024 .IP "\fBpinlight\fR" 4
yading@10 2025 .IX Item "pinlight"
yading@10 2026 .IP "\fBreflect\fR" 4
yading@10 2027 .IX Item "reflect"
yading@10 2028 .IP "\fBscreen\fR" 4
yading@10 2029 .IX Item "screen"
yading@10 2030 .IP "\fBsoftlight\fR" 4
yading@10 2031 .IX Item "softlight"
yading@10 2032 .IP "\fBsubtract\fR" 4
yading@10 2033 .IX Item "subtract"
yading@10 2034 .IP "\fBvividlight\fR" 4
yading@10 2035 .IX Item "vividlight"
yading@10 2036 .IP "\fBxor\fR" 4
yading@10 2037 .IX Item "xor"
yading@10 2038 .RE
yading@10 2039 .RS 4
yading@10 2040 .RE
yading@10 2041 .IP "\fBc0_opacity\fR" 4
yading@10 2042 .IX Item "c0_opacity"
yading@10 2043 .IP "\fBc1_opacity\fR" 4
yading@10 2044 .IX Item "c1_opacity"
yading@10 2045 .IP "\fBc2_opacity\fR" 4
yading@10 2046 .IX Item "c2_opacity"
yading@10 2047 .IP "\fBc3_opacity\fR" 4
yading@10 2048 .IX Item "c3_opacity"
yading@10 2049 .IP "\fBall_opacity\fR" 4
yading@10 2050 .IX Item "all_opacity"
yading@10 2051 .PD
yading@10 2052 Set blend opacity for specific pixel component or all pixel components in case
yading@10 2053 of \fIall_opacity\fR. Only used in combination with pixel component blend modes.
yading@10 2054 .IP "\fBc0_expr\fR" 4
yading@10 2055 .IX Item "c0_expr"
yading@10 2056 .PD 0
yading@10 2057 .IP "\fBc1_expr\fR" 4
yading@10 2058 .IX Item "c1_expr"
yading@10 2059 .IP "\fBc2_expr\fR" 4
yading@10 2060 .IX Item "c2_expr"
yading@10 2061 .IP "\fBc3_expr\fR" 4
yading@10 2062 .IX Item "c3_expr"
yading@10 2063 .IP "\fBall_expr\fR" 4
yading@10 2064 .IX Item "all_expr"
yading@10 2065 .PD
yading@10 2066 Set blend expression for specific pixel component or all pixel components in case
yading@10 2067 of \fIall_expr\fR. Note that related mode options will be ignored if those are set.
yading@10 2068 .Sp
yading@10 2069 The expressions can use the following variables:
yading@10 2070 .RS 4
yading@10 2071 .IP "\fBN\fR" 4
yading@10 2072 .IX Item "N"
yading@10 2073 The sequential number of the filtered frame, starting from \f(CW0\fR.
yading@10 2074 .IP "\fBX\fR" 4
yading@10 2075 .IX Item "X"
yading@10 2076 .PD 0
yading@10 2077 .IP "\fBY\fR" 4
yading@10 2078 .IX Item "Y"
yading@10 2079 .PD
yading@10 2080 the coordinates of the current sample
yading@10 2081 .IP "\fBW\fR" 4
yading@10 2082 .IX Item "W"
yading@10 2083 .PD 0
yading@10 2084 .IP "\fBH\fR" 4
yading@10 2085 .IX Item "H"
yading@10 2086 .PD
yading@10 2087 the width and height of currently filtered plane
yading@10 2088 .IP "\fB\s-1SW\s0\fR" 4
yading@10 2089 .IX Item "SW"
yading@10 2090 .PD 0
yading@10 2091 .IP "\fB\s-1SH\s0\fR" 4
yading@10 2092 .IX Item "SH"
yading@10 2093 .PD
yading@10 2094 Width and height scale depending on the currently filtered plane. It is the
yading@10 2095 ratio between the corresponding luma plane number of pixels and the current
yading@10 2096 plane ones. E.g. for \s-1YUV4:2:0\s0 the values are \f(CW\*(C`1,1\*(C'\fR for the luma plane, and
yading@10 2097 \&\f(CW\*(C`0.5,0.5\*(C'\fR for chroma planes.
yading@10 2098 .IP "\fBT\fR" 4
yading@10 2099 .IX Item "T"
yading@10 2100 Time of the current frame, expressed in seconds.
yading@10 2101 .IP "\fB\s-1TOP\s0, A\fR" 4
yading@10 2102 .IX Item "TOP, A"
yading@10 2103 Value of pixel component at current location for first video frame (top layer).
yading@10 2104 .IP "\fB\s-1BOTTOM\s0, B\fR" 4
yading@10 2105 .IX Item "BOTTOM, B"
yading@10 2106 Value of pixel component at current location for second video frame (bottom layer).
yading@10 2107 .RE
yading@10 2108 .RS 4
yading@10 2109 .RE
yading@10 2110 .PP
yading@10 2111 \fIExamples\fR
yading@10 2112 .IX Subsection "Examples"
yading@10 2113 .IP "\(bu" 4
yading@10 2114 Apply transition from bottom layer to top layer in first 10 seconds:
yading@10 2115 .Sp
yading@10 2116 .Vb 1
yading@10 2117 \& blend=all_expr=\*(AqA*(if(gte(T,10),1,T/10))+B*(1\-(if(gte(T,10),1,T/10)))\*(Aq
yading@10 2118 .Ve
yading@10 2119 .IP "\(bu" 4
yading@10 2120 Apply 1x1 checkerboard effect:
yading@10 2121 .Sp
yading@10 2122 .Vb 1
yading@10 2123 \& blend=all_expr=\*(Aqif(eq(mod(X,2),mod(Y,2)),A,B)\*(Aq
yading@10 2124 .Ve
yading@10 2125 .SS "boxblur"
yading@10 2126 .IX Subsection "boxblur"
yading@10 2127 Apply boxblur algorithm to the input video.
yading@10 2128 .PP
yading@10 2129 The filter accepts the following options:
yading@10 2130 .IP "\fBluma_radius, lr\fR" 4
yading@10 2131 .IX Item "luma_radius, lr"
yading@10 2132 .PD 0
yading@10 2133 .IP "\fBluma_power, lp\fR" 4
yading@10 2134 .IX Item "luma_power, lp"
yading@10 2135 .IP "\fBchroma_radius, cr\fR" 4
yading@10 2136 .IX Item "chroma_radius, cr"
yading@10 2137 .IP "\fBchroma_power, cp\fR" 4
yading@10 2138 .IX Item "chroma_power, cp"
yading@10 2139 .IP "\fBalpha_radius, ar\fR" 4
yading@10 2140 .IX Item "alpha_radius, ar"
yading@10 2141 .IP "\fBalpha_power, ap\fR" 4
yading@10 2142 .IX Item "alpha_power, ap"
yading@10 2143 .PD
yading@10 2144 .PP
yading@10 2145 A description of the accepted options follows.
yading@10 2146 .IP "\fBluma_radius, lr\fR" 4
yading@10 2147 .IX Item "luma_radius, lr"
yading@10 2148 .PD 0
yading@10 2149 .IP "\fBchroma_radius, cr\fR" 4
yading@10 2150 .IX Item "chroma_radius, cr"
yading@10 2151 .IP "\fBalpha_radius, ar\fR" 4
yading@10 2152 .IX Item "alpha_radius, ar"
yading@10 2153 .PD
yading@10 2154 Set an expression for the box radius in pixels used for blurring the
yading@10 2155 corresponding input plane.
yading@10 2156 .Sp
yading@10 2157 The radius value must be a non-negative number, and must not be
yading@10 2158 greater than the value of the expression \f(CW\*(C`min(w,h)/2\*(C'\fR for the
yading@10 2159 luma and alpha planes, and of \f(CW\*(C`min(cw,ch)/2\*(C'\fR for the chroma
yading@10 2160 planes.
yading@10 2161 .Sp
yading@10 2162 Default value for \fBluma_radius\fR is \*(L"2\*(R". If not specified,
yading@10 2163 \&\fBchroma_radius\fR and \fBalpha_radius\fR default to the
yading@10 2164 corresponding value set for \fBluma_radius\fR.
yading@10 2165 .Sp
yading@10 2166 The expressions can contain the following constants:
yading@10 2167 .RS 4
yading@10 2168 .IP "\fBw, h\fR" 4
yading@10 2169 .IX Item "w, h"
yading@10 2170 the input width and height in pixels
yading@10 2171 .IP "\fBcw, ch\fR" 4
yading@10 2172 .IX Item "cw, ch"
yading@10 2173 the input chroma image width and height in pixels
yading@10 2174 .IP "\fBhsub, vsub\fR" 4
yading@10 2175 .IX Item "hsub, vsub"
yading@10 2176 horizontal and vertical chroma subsample values. For example for the
yading@10 2177 pixel format \*(L"yuv422p\*(R" \fIhsub\fR is 2 and \fIvsub\fR is 1.
yading@10 2178 .RE
yading@10 2179 .RS 4
yading@10 2180 .RE
yading@10 2181 .IP "\fBluma_power, lp\fR" 4
yading@10 2182 .IX Item "luma_power, lp"
yading@10 2183 .PD 0
yading@10 2184 .IP "\fBchroma_power, cp\fR" 4
yading@10 2185 .IX Item "chroma_power, cp"
yading@10 2186 .IP "\fBalpha_power, ap\fR" 4
yading@10 2187 .IX Item "alpha_power, ap"
yading@10 2188 .PD
yading@10 2189 Specify how many times the boxblur filter is applied to the
yading@10 2190 corresponding plane.
yading@10 2191 .Sp
yading@10 2192 Default value for \fBluma_power\fR is 2. If not specified,
yading@10 2193 \&\fBchroma_power\fR and \fBalpha_power\fR default to the
yading@10 2194 corresponding value set for \fBluma_power\fR.
yading@10 2195 .Sp
yading@10 2196 A value of 0 will disable the effect.
yading@10 2197 .PP
yading@10 2198 \fIExamples\fR
yading@10 2199 .IX Subsection "Examples"
yading@10 2200 .IP "\(bu" 4
yading@10 2201 Apply a boxblur filter with luma, chroma, and alpha radius
yading@10 2202 set to 2:
yading@10 2203 .Sp
yading@10 2204 .Vb 2
yading@10 2205 \& boxblur=luma_radius=2:luma_power=1
yading@10 2206 \& boxblur=2:1
yading@10 2207 .Ve
yading@10 2208 .IP "\(bu" 4
yading@10 2209 Set luma radius to 2, alpha and chroma radius to 0:
yading@10 2210 .Sp
yading@10 2211 .Vb 1
yading@10 2212 \& boxblur=2:1:cr=0:ar=0
yading@10 2213 .Ve
yading@10 2214 .IP "\(bu" 4
yading@10 2215 Set luma and chroma radius to a fraction of the video dimension:
yading@10 2216 .Sp
yading@10 2217 .Vb 1
yading@10 2218 \& boxblur=luma_radius=min(h\e,w)/10:luma_power=1:chroma_radius=min(cw\e,ch)/10:chroma_power=1
yading@10 2219 .Ve
yading@10 2220 .SS "colorbalance"
yading@10 2221 .IX Subsection "colorbalance"
yading@10 2222 Modify intensity of primary colors (red, green and blue) of input frames.
yading@10 2223 .PP
yading@10 2224 The filter allows an input frame to be adjusted in the shadows, midtones or highlights
yading@10 2225 regions for the red-cyan, green-magenta or blue-yellow balance.
yading@10 2226 .PP
yading@10 2227 A positive adjustment value shifts the balance towards the primary color, a negative
yading@10 2228 value towards the complementary color.
yading@10 2229 .PP
yading@10 2230 The filter accepts the following options:
yading@10 2231 .IP "\fBrs\fR" 4
yading@10 2232 .IX Item "rs"
yading@10 2233 .PD 0
yading@10 2234 .IP "\fBgs\fR" 4
yading@10 2235 .IX Item "gs"
yading@10 2236 .IP "\fBbs\fR" 4
yading@10 2237 .IX Item "bs"
yading@10 2238 .PD
yading@10 2239 Adjust red, green and blue shadows (darkest pixels).
yading@10 2240 .IP "\fBrm\fR" 4
yading@10 2241 .IX Item "rm"
yading@10 2242 .PD 0
yading@10 2243 .IP "\fBgm\fR" 4
yading@10 2244 .IX Item "gm"
yading@10 2245 .IP "\fBbm\fR" 4
yading@10 2246 .IX Item "bm"
yading@10 2247 .PD
yading@10 2248 Adjust red, green and blue midtones (medium pixels).
yading@10 2249 .IP "\fBrh\fR" 4
yading@10 2250 .IX Item "rh"
yading@10 2251 .PD 0
yading@10 2252 .IP "\fBgh\fR" 4
yading@10 2253 .IX Item "gh"
yading@10 2254 .IP "\fBbh\fR" 4
yading@10 2255 .IX Item "bh"
yading@10 2256 .PD
yading@10 2257 Adjust red, green and blue highlights (brightest pixels).
yading@10 2258 .Sp
yading@10 2259 Allowed ranges for options are \f(CW\*(C`[\-1.0, 1.0]\*(C'\fR. Defaults are \f(CW0\fR.
yading@10 2260 .PP
yading@10 2261 \fIExamples\fR
yading@10 2262 .IX Subsection "Examples"
yading@10 2263 .IP "\(bu" 4
yading@10 2264 Add red color cast to shadows:
yading@10 2265 .Sp
yading@10 2266 .Vb 1
yading@10 2267 \& colorbalance=rs=.3
yading@10 2268 .Ve
yading@10 2269 .SS "colorchannelmixer"
yading@10 2270 .IX Subsection "colorchannelmixer"
yading@10 2271 Adjust video input frames by re-mixing color channels.
yading@10 2272 .PP
yading@10 2273 This filter modifies a color channel by adding the values associated to
yading@10 2274 the other channels of the same pixels. For example if the value to
yading@10 2275 modify is red, the output value will be:
yading@10 2276 .PP
yading@10 2277 .Vb 1
yading@10 2278 \& <red>=<red>*<rr> + <blue>*<rb> + <green>*<rg> + <alpha>*<ra>
yading@10 2279 .Ve
yading@10 2280 .PP
yading@10 2281 The filter accepts the following options:
yading@10 2282 .IP "\fBrr\fR" 4
yading@10 2283 .IX Item "rr"
yading@10 2284 .PD 0
yading@10 2285 .IP "\fBrg\fR" 4
yading@10 2286 .IX Item "rg"
yading@10 2287 .IP "\fBrb\fR" 4
yading@10 2288 .IX Item "rb"
yading@10 2289 .IP "\fBra\fR" 4
yading@10 2290 .IX Item "ra"
yading@10 2291 .PD
yading@10 2292 Adjust contribution of input red, green, blue and alpha channels for output red channel.
yading@10 2293 Default is \f(CW1\fR for \fIrr\fR, and \f(CW0\fR for \fIrg\fR, \fIrb\fR and \fIra\fR.
yading@10 2294 .IP "\fBgr\fR" 4
yading@10 2295 .IX Item "gr"
yading@10 2296 .PD 0
yading@10 2297 .IP "\fBgg\fR" 4
yading@10 2298 .IX Item "gg"
yading@10 2299 .IP "\fBgb\fR" 4
yading@10 2300 .IX Item "gb"
yading@10 2301 .IP "\fBga\fR" 4
yading@10 2302 .IX Item "ga"
yading@10 2303 .PD
yading@10 2304 Adjust contribution of input red, green, blue and alpha channels for output green channel.
yading@10 2305 Default is \f(CW1\fR for \fIgg\fR, and \f(CW0\fR for \fIgr\fR, \fIgb\fR and \fIga\fR.
yading@10 2306 .IP "\fBbr\fR" 4
yading@10 2307 .IX Item "br"
yading@10 2308 .PD 0
yading@10 2309 .IP "\fBbg\fR" 4
yading@10 2310 .IX Item "bg"
yading@10 2311 .IP "\fBbb\fR" 4
yading@10 2312 .IX Item "bb"
yading@10 2313 .IP "\fBba\fR" 4
yading@10 2314 .IX Item "ba"
yading@10 2315 .PD
yading@10 2316 Adjust contribution of input red, green, blue and alpha channels for output blue channel.
yading@10 2317 Default is \f(CW1\fR for \fIbb\fR, and \f(CW0\fR for \fIbr\fR, \fIbg\fR and \fIba\fR.
yading@10 2318 .IP "\fBar\fR" 4
yading@10 2319 .IX Item "ar"
yading@10 2320 .PD 0
yading@10 2321 .IP "\fBag\fR" 4
yading@10 2322 .IX Item "ag"
yading@10 2323 .IP "\fBab\fR" 4
yading@10 2324 .IX Item "ab"
yading@10 2325 .IP "\fBaa\fR" 4
yading@10 2326 .IX Item "aa"
yading@10 2327 .PD
yading@10 2328 Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
yading@10 2329 Default is \f(CW1\fR for \fIaa\fR, and \f(CW0\fR for \fIar\fR, \fIag\fR and \fIab\fR.
yading@10 2330 .Sp
yading@10 2331 Allowed ranges for options are \f(CW\*(C`[\-2.0, 2.0]\*(C'\fR.
yading@10 2332 .PP
yading@10 2333 \fIExamples\fR
yading@10 2334 .IX Subsection "Examples"
yading@10 2335 .IP "\(bu" 4
yading@10 2336 Convert source to grayscale:
yading@10 2337 .Sp
yading@10 2338 .Vb 1
yading@10 2339 \& colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
yading@10 2340 .Ve
yading@10 2341 .SS "colormatrix"
yading@10 2342 .IX Subsection "colormatrix"
yading@10 2343 Convert color matrix.
yading@10 2344 .PP
yading@10 2345 The filter accepts the following options:
yading@10 2346 .IP "\fBsrc\fR" 4
yading@10 2347 .IX Item "src"
yading@10 2348 .PD 0
yading@10 2349 .IP "\fBdst\fR" 4
yading@10 2350 .IX Item "dst"
yading@10 2351 .PD
yading@10 2352 Specify the source and destination color matrix. Both values must be
yading@10 2353 specified.
yading@10 2354 .Sp
yading@10 2355 The accepted values are:
yading@10 2356 .RS 4
yading@10 2357 .IP "\fBbt709\fR" 4
yading@10 2358 .IX Item "bt709"
yading@10 2359 \&\s-1BT\s0.709
yading@10 2360 .IP "\fBbt601\fR" 4
yading@10 2361 .IX Item "bt601"
yading@10 2362 \&\s-1BT\s0.601
yading@10 2363 .IP "\fBsmpte240m\fR" 4
yading@10 2364 .IX Item "smpte240m"
yading@10 2365 \&\s-1SMPTE\-240M\s0
yading@10 2366 .IP "\fBfcc\fR" 4
yading@10 2367 .IX Item "fcc"
yading@10 2368 \&\s-1FCC\s0
yading@10 2369 .RE
yading@10 2370 .RS 4
yading@10 2371 .RE
yading@10 2372 .PP
yading@10 2373 For example to convert from \s-1BT\s0.601 to \s-1SMPTE\-240M\s0, use the command:
yading@10 2374 .PP
yading@10 2375 .Vb 1
yading@10 2376 \& colormatrix=bt601:smpte240m
yading@10 2377 .Ve
yading@10 2378 .SS "copy"
yading@10 2379 .IX Subsection "copy"
yading@10 2380 Copy the input source unchanged to the output. Mainly useful for
yading@10 2381 testing purposes.
yading@10 2382 .SS "crop"
yading@10 2383 .IX Subsection "crop"
yading@10 2384 Crop the input video to given dimensions.
yading@10 2385 .PP
yading@10 2386 The filter accepts the following options:
yading@10 2387 .IP "\fBw, out_w\fR" 4
yading@10 2388 .IX Item "w, out_w"
yading@10 2389 Width of the output video. It defaults to \f(CW\*(C`iw\*(C'\fR.
yading@10 2390 This expression is evaluated only once during the filter
yading@10 2391 configuration.
yading@10 2392 .IP "\fBh, out_h\fR" 4
yading@10 2393 .IX Item "h, out_h"
yading@10 2394 Height of the output video. It defaults to \f(CW\*(C`ih\*(C'\fR.
yading@10 2395 This expression is evaluated only once during the filter
yading@10 2396 configuration.
yading@10 2397 .IP "\fBx\fR" 4
yading@10 2398 .IX Item "x"
yading@10 2399 Horizontal position, in the input video, of the left edge of the output video.
yading@10 2400 It defaults to \f(CW\*(C`(in_w\-out_w)/2\*(C'\fR.
yading@10 2401 This expression is evaluated per-frame.
yading@10 2402 .IP "\fBy\fR" 4
yading@10 2403 .IX Item "y"
yading@10 2404 Vertical position, in the input video, of the top edge of the output video.
yading@10 2405 It defaults to \f(CW\*(C`(in_h\-out_h)/2\*(C'\fR.
yading@10 2406 This expression is evaluated per-frame.
yading@10 2407 .IP "\fBkeep_aspect\fR" 4
yading@10 2408 .IX Item "keep_aspect"
yading@10 2409 If set to 1 will force the output display aspect ratio
yading@10 2410 to be the same of the input, by changing the output sample aspect
yading@10 2411 ratio. It defaults to 0.
yading@10 2412 .PP
yading@10 2413 The \fIout_w\fR, \fIout_h\fR, \fIx\fR, \fIy\fR parameters are
yading@10 2414 expressions containing the following constants:
yading@10 2415 .IP "\fBx, y\fR" 4
yading@10 2416 .IX Item "x, y"
yading@10 2417 the computed values for \fIx\fR and \fIy\fR. They are evaluated for
yading@10 2418 each new frame.
yading@10 2419 .IP "\fBin_w, in_h\fR" 4
yading@10 2420 .IX Item "in_w, in_h"
yading@10 2421 the input width and height
yading@10 2422 .IP "\fBiw, ih\fR" 4
yading@10 2423 .IX Item "iw, ih"
yading@10 2424 same as \fIin_w\fR and \fIin_h\fR
yading@10 2425 .IP "\fBout_w, out_h\fR" 4
yading@10 2426 .IX Item "out_w, out_h"
yading@10 2427 the output (cropped) width and height
yading@10 2428 .IP "\fBow, oh\fR" 4
yading@10 2429 .IX Item "ow, oh"
yading@10 2430 same as \fIout_w\fR and \fIout_h\fR
yading@10 2431 .IP "\fBa\fR" 4
yading@10 2432 .IX Item "a"
yading@10 2433 same as \fIiw\fR / \fIih\fR
yading@10 2434 .IP "\fBsar\fR" 4
yading@10 2435 .IX Item "sar"
yading@10 2436 input sample aspect ratio
yading@10 2437 .IP "\fBdar\fR" 4
yading@10 2438 .IX Item "dar"
yading@10 2439 input display aspect ratio, it is the same as (\fIiw\fR / \fIih\fR) * \fIsar\fR
yading@10 2440 .IP "\fBhsub, vsub\fR" 4
yading@10 2441 .IX Item "hsub, vsub"
yading@10 2442 horizontal and vertical chroma subsample values. For example for the
yading@10 2443 pixel format \*(L"yuv422p\*(R" \fIhsub\fR is 2 and \fIvsub\fR is 1.
yading@10 2444 .IP "\fBn\fR" 4
yading@10 2445 .IX Item "n"
yading@10 2446 the number of input frame, starting from 0
yading@10 2447 .IP "\fBpos\fR" 4
yading@10 2448 .IX Item "pos"
yading@10 2449 the position in the file of the input frame, \s-1NAN\s0 if unknown
yading@10 2450 .IP "\fBt\fR" 4
yading@10 2451 .IX Item "t"
yading@10 2452 timestamp expressed in seconds, \s-1NAN\s0 if the input timestamp is unknown
yading@10 2453 .PP
yading@10 2454 The expression for \fIout_w\fR may depend on the value of \fIout_h\fR,
yading@10 2455 and the expression for \fIout_h\fR may depend on \fIout_w\fR, but they
yading@10 2456 cannot depend on \fIx\fR and \fIy\fR, as \fIx\fR and \fIy\fR are
yading@10 2457 evaluated after \fIout_w\fR and \fIout_h\fR.
yading@10 2458 .PP
yading@10 2459 The \fIx\fR and \fIy\fR parameters specify the expressions for the
yading@10 2460 position of the top-left corner of the output (non-cropped) area. They
yading@10 2461 are evaluated for each frame. If the evaluated value is not valid, it
yading@10 2462 is approximated to the nearest valid value.
yading@10 2463 .PP
yading@10 2464 The expression for \fIx\fR may depend on \fIy\fR, and the expression
yading@10 2465 for \fIy\fR may depend on \fIx\fR.
yading@10 2466 .PP
yading@10 2467 \fIExamples\fR
yading@10 2468 .IX Subsection "Examples"
yading@10 2469 .IP "\(bu" 4
yading@10 2470 Crop area with size 100x100 at position (12,34).
yading@10 2471 .Sp
yading@10 2472 .Vb 1
yading@10 2473 \& crop=100:100:12:34
yading@10 2474 .Ve
yading@10 2475 .Sp
yading@10 2476 Using named options, the example above becomes:
yading@10 2477 .Sp
yading@10 2478 .Vb 1
yading@10 2479 \& crop=w=100:h=100:x=12:y=34
yading@10 2480 .Ve
yading@10 2481 .IP "\(bu" 4
yading@10 2482 Crop the central input area with size 100x100:
yading@10 2483 .Sp
yading@10 2484 .Vb 1
yading@10 2485 \& crop=100:100
yading@10 2486 .Ve
yading@10 2487 .IP "\(bu" 4
yading@10 2488 Crop the central input area with size 2/3 of the input video:
yading@10 2489 .Sp
yading@10 2490 .Vb 1
yading@10 2491 \& crop=2/3*in_w:2/3*in_h
yading@10 2492 .Ve
yading@10 2493 .IP "\(bu" 4
yading@10 2494 Crop the input video central square:
yading@10 2495 .Sp
yading@10 2496 .Vb 2
yading@10 2497 \& crop=out_w=in_h
yading@10 2498 \& crop=in_h
yading@10 2499 .Ve
yading@10 2500 .IP "\(bu" 4
yading@10 2501 Delimit the rectangle with the top-left corner placed at position
yading@10 2502 100:100 and the right-bottom corner corresponding to the right-bottom
yading@10 2503 corner of the input image:
yading@10 2504 .Sp
yading@10 2505 .Vb 1
yading@10 2506 \& crop=in_w\-100:in_h\-100:100:100
yading@10 2507 .Ve
yading@10 2508 .IP "\(bu" 4
yading@10 2509 Crop 10 pixels from the left and right borders, and 20 pixels from
yading@10 2510 the top and bottom borders
yading@10 2511 .Sp
yading@10 2512 .Vb 1
yading@10 2513 \& crop=in_w\-2*10:in_h\-2*20
yading@10 2514 .Ve
yading@10 2515 .IP "\(bu" 4
yading@10 2516 Keep only the bottom right quarter of the input image:
yading@10 2517 .Sp
yading@10 2518 .Vb 1
yading@10 2519 \& crop=in_w/2:in_h/2:in_w/2:in_h/2
yading@10 2520 .Ve
yading@10 2521 .IP "\(bu" 4
yading@10 2522 Crop height for getting Greek harmony:
yading@10 2523 .Sp
yading@10 2524 .Vb 1
yading@10 2525 \& crop=in_w:1/PHI*in_w
yading@10 2526 .Ve
yading@10 2527 .IP "\(bu" 4
yading@10 2528 Appply trembling effect:
yading@10 2529 .Sp
yading@10 2530 .Vb 1
yading@10 2531 \& crop=in_w/2:in_h/2:(in_w\-out_w)/2+((in_w\-out_w)/2)*sin(n/10):(in_h\-out_h)/2 +((in_h\-out_h)/2)*sin(n/7)
yading@10 2532 .Ve
yading@10 2533 .IP "\(bu" 4
yading@10 2534 Apply erratic camera effect depending on timestamp:
yading@10 2535 .Sp
yading@10 2536 .Vb 1
yading@10 2537 \& crop=in_w/2:in_h/2:(in_w\-out_w)/2+((in_w\-out_w)/2)*sin(t*10):(in_h\-out_h)/2 +((in_h\-out_h)/2)*sin(t*13)"
yading@10 2538 .Ve
yading@10 2539 .IP "\(bu" 4
yading@10 2540 Set x depending on the value of y:
yading@10 2541 .Sp
yading@10 2542 .Vb 1
yading@10 2543 \& crop=in_w/2:in_h/2:y:10+10*sin(n/10)
yading@10 2544 .Ve
yading@10 2545 .SS "cropdetect"
yading@10 2546 .IX Subsection "cropdetect"
yading@10 2547 Auto-detect crop size.
yading@10 2548 .PP
yading@10 2549 Calculate necessary cropping parameters and prints the recommended
yading@10 2550 parameters through the logging system. The detected dimensions
yading@10 2551 correspond to the non-black area of the input video.
yading@10 2552 .PP
yading@10 2553 The filter accepts the following options:
yading@10 2554 .IP "\fBlimit\fR" 4
yading@10 2555 .IX Item "limit"
yading@10 2556 Set higher black value threshold, which can be optionally specified
yading@10 2557 from nothing (0) to everything (255). An intensity value greater
yading@10 2558 to the set value is considered non-black. Default value is 24.
yading@10 2559 .IP "\fBround\fR" 4
yading@10 2560 .IX Item "round"
yading@10 2561 Set the value for which the width/height should be divisible by. The
yading@10 2562 offset is automatically adjusted to center the video. Use 2 to get
yading@10 2563 only even dimensions (needed for 4:2:2 video). 16 is best when
yading@10 2564 encoding to most video codecs. Default value is 16.
yading@10 2565 .IP "\fBreset_count, reset\fR" 4
yading@10 2566 .IX Item "reset_count, reset"
yading@10 2567 Set the counter that determines after how many frames cropdetect will
yading@10 2568 reset the previously detected largest video area and start over to
yading@10 2569 detect the current optimal crop area. Default value is 0.
yading@10 2570 .Sp
yading@10 2571 This can be useful when channel logos distort the video area. 0
yading@10 2572 indicates never reset and return the largest area encountered during
yading@10 2573 playback.
yading@10 2574 .SS "curves"
yading@10 2575 .IX Subsection "curves"
yading@10 2576 Apply color adjustments using curves.
yading@10 2577 .PP
yading@10 2578 This filter is similar to the Adobe Photoshop and \s-1GIMP\s0 curves tools. Each
yading@10 2579 component (red, green and blue) has its values defined by \fIN\fR key points
yading@10 2580 tied from each other using a smooth curve. The x\-axis represents the pixel
yading@10 2581 values from the input frame, and the y\-axis the new pixel values to be set for
yading@10 2582 the output frame.
yading@10 2583 .PP
yading@10 2584 By default, a component curve is defined by the two points \fI(0;0)\fR and
yading@10 2585 \&\fI(1;1)\fR. This creates a straight line where each original pixel value is
yading@10 2586 \&\*(L"adjusted\*(R" to its own value, which means no change to the image.
yading@10 2587 .PP
yading@10 2588 The filter allows you to redefine these two points and add some more. A new
yading@10 2589 curve (using a natural cubic spline interpolation) will be define to pass
yading@10 2590 smoothly through all these new coordinates. The new defined points needs to be
yading@10 2591 strictly increasing over the x\-axis, and their \fIx\fR and \fIy\fR values must
yading@10 2592 be in the \fI[0;1]\fR interval. If the computed curves happened to go outside
yading@10 2593 the vector spaces, the values will be clipped accordingly.
yading@10 2594 .PP
yading@10 2595 If there is no key point defined in \f(CW\*(C`x=0\*(C'\fR, the filter will automatically
yading@10 2596 insert a \fI(0;0)\fR point. In the same way, if there is no key point defined
yading@10 2597 in \f(CW\*(C`x=1\*(C'\fR, the filter will automatically insert a \fI(1;1)\fR point.
yading@10 2598 .PP
yading@10 2599 The filter accepts the following options:
yading@10 2600 .IP "\fBpreset\fR" 4
yading@10 2601 .IX Item "preset"
yading@10 2602 Select one of the available color presets. This option can be used in addition
yading@10 2603 to the \fBr\fR, \fBg\fR, \fBb\fR parameters; in this case, the later
yading@10 2604 options takes priority on the preset values.
yading@10 2605 Available presets are:
yading@10 2606 .RS 4
yading@10 2607 .IP "\fBnone\fR" 4
yading@10 2608 .IX Item "none"
yading@10 2609 .PD 0
yading@10 2610 .IP "\fBcolor_negative\fR" 4
yading@10 2611 .IX Item "color_negative"
yading@10 2612 .IP "\fBcross_process\fR" 4
yading@10 2613 .IX Item "cross_process"
yading@10 2614 .IP "\fBdarker\fR" 4
yading@10 2615 .IX Item "darker"
yading@10 2616 .IP "\fBincrease_contrast\fR" 4
yading@10 2617 .IX Item "increase_contrast"
yading@10 2618 .IP "\fBlighter\fR" 4
yading@10 2619 .IX Item "lighter"
yading@10 2620 .IP "\fBlinear_contrast\fR" 4
yading@10 2621 .IX Item "linear_contrast"
yading@10 2622 .IP "\fBmedium_contrast\fR" 4
yading@10 2623 .IX Item "medium_contrast"
yading@10 2624 .IP "\fBnegative\fR" 4
yading@10 2625 .IX Item "negative"
yading@10 2626 .IP "\fBstrong_contrast\fR" 4
yading@10 2627 .IX Item "strong_contrast"
yading@10 2628 .IP "\fBvintage\fR" 4
yading@10 2629 .IX Item "vintage"
yading@10 2630 .RE
yading@10 2631 .RS 4
yading@10 2632 .PD
yading@10 2633 .Sp
yading@10 2634 Default is \f(CW\*(C`none\*(C'\fR.
yading@10 2635 .RE
yading@10 2636 .IP "\fBmaster, m\fR" 4
yading@10 2637 .IX Item "master, m"
yading@10 2638 Set the master key points. These points will define a second pass mapping. It
yading@10 2639 is sometimes called a \*(L"luminance\*(R" or \*(L"value\*(R" mapping. It can be used with
yading@10 2640 \&\fBr\fR, \fBg\fR, \fBb\fR or \fBall\fR since it acts like a
yading@10 2641 post-processing \s-1LUT\s0.
yading@10 2642 .IP "\fBred, r\fR" 4
yading@10 2643 .IX Item "red, r"
yading@10 2644 Set the key points for the red component.
yading@10 2645 .IP "\fBgreen, g\fR" 4
yading@10 2646 .IX Item "green, g"
yading@10 2647 Set the key points for the green component.
yading@10 2648 .IP "\fBblue, b\fR" 4
yading@10 2649 .IX Item "blue, b"
yading@10 2650 Set the key points for the blue component.
yading@10 2651 .IP "\fBall\fR" 4
yading@10 2652 .IX Item "all"
yading@10 2653 Set the key points for all components (not including master).
yading@10 2654 Can be used in addition to the other key points component
yading@10 2655 options. In this case, the unset component(s) will fallback on this
yading@10 2656 \&\fBall\fR setting.
yading@10 2657 .IP "\fBpsfile\fR" 4
yading@10 2658 .IX Item "psfile"
yading@10 2659 Specify a Photoshop curves file (\f(CW\*(C`.asv\*(C'\fR) to import the settings from.
yading@10 2660 .PP
yading@10 2661 To avoid some filtergraph syntax conflicts, each key points list need to be
yading@10 2662 defined using the following syntax: \f(CW\*(C`x0/y0 x1/y1 x2/y2 ...\*(C'\fR.
yading@10 2663 .PP
yading@10 2664 \fIExamples\fR
yading@10 2665 .IX Subsection "Examples"
yading@10 2666 .IP "\(bu" 4
yading@10 2667 Increase slightly the middle level of blue:
yading@10 2668 .Sp
yading@10 2669 .Vb 1
yading@10 2670 \& curves=blue=\*(Aq0.5/0.58\*(Aq
yading@10 2671 .Ve
yading@10 2672 .IP "\(bu" 4
yading@10 2673 Vintage effect:
yading@10 2674 .Sp
yading@10 2675 .Vb 1
yading@10 2676 \& curves=r=\*(Aq0/0.11 .42/.51 1/0.95\*(Aq:g=\*(Aq0.50/0.48\*(Aq:b=\*(Aq0/0.22 .49/.44 1/0.8\*(Aq
yading@10 2677 .Ve
yading@10 2678 .Sp
yading@10 2679 Here we obtain the following coordinates for each components:
yading@10 2680 .RS 4
yading@10 2681 .IP "\fIred\fR" 4
yading@10 2682 .IX Item "red"
yading@10 2683 \&\f(CW\*(C`(0;0.11) (0.42;0.51) (1;0.95)\*(C'\fR
yading@10 2684 .IP "\fIgreen\fR" 4
yading@10 2685 .IX Item "green"
yading@10 2686 \&\f(CW\*(C`(0;0) (0.50;0.48) (1;1)\*(C'\fR
yading@10 2687 .IP "\fIblue\fR" 4
yading@10 2688 .IX Item "blue"
yading@10 2689 \&\f(CW\*(C`(0;0.22) (0.49;0.44) (1;0.80)\*(C'\fR
yading@10 2690 .RE
yading@10 2691 .RS 4
yading@10 2692 .RE
yading@10 2693 .IP "\(bu" 4
yading@10 2694 The previous example can also be achieved with the associated built-in preset:
yading@10 2695 .Sp
yading@10 2696 .Vb 1
yading@10 2697 \& curves=preset=vintage
yading@10 2698 .Ve
yading@10 2699 .IP "\(bu" 4
yading@10 2700 Or simply:
yading@10 2701 .Sp
yading@10 2702 .Vb 1
yading@10 2703 \& curves=vintage
yading@10 2704 .Ve
yading@10 2705 .IP "\(bu" 4
yading@10 2706 Use a Photoshop preset and redefine the points of the green component:
yading@10 2707 .Sp
yading@10 2708 .Vb 1
yading@10 2709 \& curves=psfile=\*(AqMyCurvesPresets/purple.asv\*(Aq:green=\*(Aq0.45/0.53\*(Aq
yading@10 2710 .Ve
yading@10 2711 .SS "decimate"
yading@10 2712 .IX Subsection "decimate"
yading@10 2713 Drop duplicated frames at regular intervals.
yading@10 2714 .PP
yading@10 2715 The filter accepts the following options:
yading@10 2716 .IP "\fBcycle\fR" 4
yading@10 2717 .IX Item "cycle"
yading@10 2718 Set the number of frames from which one will be dropped. Setting this to
yading@10 2719 \&\fIN\fR means one frame in every batch of \fIN\fR frames will be dropped.
yading@10 2720 Default is \f(CW5\fR.
yading@10 2721 .IP "\fBdupthresh\fR" 4
yading@10 2722 .IX Item "dupthresh"
yading@10 2723 Set the threshold for duplicate detection. If the difference metric for a frame
yading@10 2724 is less than or equal to this value, then it is declared as duplicate. Default
yading@10 2725 is \f(CW1.1\fR
yading@10 2726 .IP "\fBscthresh\fR" 4
yading@10 2727 .IX Item "scthresh"
yading@10 2728 Set scene change threshold. Default is \f(CW15\fR.
yading@10 2729 .IP "\fBblockx\fR" 4
yading@10 2730 .IX Item "blockx"
yading@10 2731 .PD 0
yading@10 2732 .IP "\fBblocky\fR" 4
yading@10 2733 .IX Item "blocky"
yading@10 2734 .PD
yading@10 2735 Set the size of the x and y\-axis blocks used during metric calculations.
yading@10 2736 Larger blocks give better noise suppression, but also give worse detection of
yading@10 2737 small movements. Must be a power of two. Default is \f(CW32\fR.
yading@10 2738 .IP "\fBppsrc\fR" 4
yading@10 2739 .IX Item "ppsrc"
yading@10 2740 Mark main input as a pre-processed input and activate clean source input
yading@10 2741 stream. This allows the input to be pre-processed with various filters to help
yading@10 2742 the metrics calculation while keeping the frame selection lossless. When set to
yading@10 2743 \&\f(CW1\fR, the first stream is for the pre-processed input, and the second
yading@10 2744 stream is the clean source from where the kept frames are chosen. Default is
yading@10 2745 \&\f(CW0\fR.
yading@10 2746 .IP "\fBchroma\fR" 4
yading@10 2747 .IX Item "chroma"
yading@10 2748 Set whether or not chroma is considered in the metric calculations. Default is
yading@10 2749 \&\f(CW1\fR.
yading@10 2750 .SS "delogo"
yading@10 2751 .IX Subsection "delogo"
yading@10 2752 Suppress a \s-1TV\s0 station logo by a simple interpolation of the surrounding
yading@10 2753 pixels. Just set a rectangle covering the logo and watch it disappear
yading@10 2754 (and sometimes something even uglier appear \- your mileage may vary).
yading@10 2755 .PP
yading@10 2756 This filter accepts the following options:
yading@10 2757 .IP "\fBx, y\fR" 4
yading@10 2758 .IX Item "x, y"
yading@10 2759 Specify the top left corner coordinates of the logo. They must be
yading@10 2760 specified.
yading@10 2761 .IP "\fBw, h\fR" 4
yading@10 2762 .IX Item "w, h"
yading@10 2763 Specify the width and height of the logo to clear. They must be
yading@10 2764 specified.
yading@10 2765 .IP "\fBband, t\fR" 4
yading@10 2766 .IX Item "band, t"
yading@10 2767 Specify the thickness of the fuzzy edge of the rectangle (added to
yading@10 2768 \&\fIw\fR and \fIh\fR). The default value is 4.
yading@10 2769 .IP "\fBshow\fR" 4
yading@10 2770 .IX Item "show"
yading@10 2771 When set to 1, a green rectangle is drawn on the screen to simplify
yading@10 2772 finding the right \fIx\fR, \fIy\fR, \fIw\fR, \fIh\fR parameters, and
yading@10 2773 \&\fIband\fR is set to 4. The default value is 0.
yading@10 2774 .PP
yading@10 2775 \fIExamples\fR
yading@10 2776 .IX Subsection "Examples"
yading@10 2777 .IP "\(bu" 4
yading@10 2778 Set a rectangle covering the area with top left corner coordinates 0,0
yading@10 2779 and size 100x77, setting a band of size 10:
yading@10 2780 .Sp
yading@10 2781 .Vb 1
yading@10 2782 \& delogo=x=0:y=0:w=100:h=77:band=10
yading@10 2783 .Ve
yading@10 2784 .SS "deshake"
yading@10 2785 .IX Subsection "deshake"
yading@10 2786 Attempt to fix small changes in horizontal and/or vertical shift. This
yading@10 2787 filter helps remove camera shake from hand-holding a camera, bumping a
yading@10 2788 tripod, moving on a vehicle, etc.
yading@10 2789 .PP
yading@10 2790 The filter accepts the following options:
yading@10 2791 .IP "\fBx\fR" 4
yading@10 2792 .IX Item "x"
yading@10 2793 .PD 0
yading@10 2794 .IP "\fBy\fR" 4
yading@10 2795 .IX Item "y"
yading@10 2796 .IP "\fBw\fR" 4
yading@10 2797 .IX Item "w"
yading@10 2798 .IP "\fBh\fR" 4
yading@10 2799 .IX Item "h"
yading@10 2800 .PD
yading@10 2801 Specify a rectangular area where to limit the search for motion
yading@10 2802 vectors.
yading@10 2803 If desired the search for motion vectors can be limited to a
yading@10 2804 rectangular area of the frame defined by its top left corner, width
yading@10 2805 and height. These parameters have the same meaning as the drawbox
yading@10 2806 filter which can be used to visualise the position of the bounding
yading@10 2807 box.
yading@10 2808 .Sp
yading@10 2809 This is useful when simultaneous movement of subjects within the frame
yading@10 2810 might be confused for camera motion by the motion vector search.
yading@10 2811 .Sp
yading@10 2812 If any or all of \fIx\fR, \fIy\fR, \fIw\fR and \fIh\fR are set to \-1
yading@10 2813 then the full frame is used. This allows later options to be set
yading@10 2814 without specifying the bounding box for the motion vector search.
yading@10 2815 .Sp
yading@10 2816 Default \- search the whole frame.
yading@10 2817 .IP "\fBrx\fR" 4
yading@10 2818 .IX Item "rx"
yading@10 2819 .PD 0
yading@10 2820 .IP "\fBry\fR" 4
yading@10 2821 .IX Item "ry"
yading@10 2822 .PD
yading@10 2823 Specify the maximum extent of movement in x and y directions in the
yading@10 2824 range 0\-64 pixels. Default 16.
yading@10 2825 .IP "\fBedge\fR" 4
yading@10 2826 .IX Item "edge"
yading@10 2827 Specify how to generate pixels to fill blanks at the edge of the
yading@10 2828 frame. Available values are:
yading@10 2829 .RS 4
yading@10 2830 .IP "\fBblank, 0\fR" 4
yading@10 2831 .IX Item "blank, 0"
yading@10 2832 Fill zeroes at blank locations
yading@10 2833 .IP "\fBoriginal, 1\fR" 4
yading@10 2834 .IX Item "original, 1"
yading@10 2835 Original image at blank locations
yading@10 2836 .IP "\fBclamp, 2\fR" 4
yading@10 2837 .IX Item "clamp, 2"
yading@10 2838 Extruded edge value at blank locations
yading@10 2839 .IP "\fBmirror, 3\fR" 4
yading@10 2840 .IX Item "mirror, 3"
yading@10 2841 Mirrored edge at blank locations
yading@10 2842 .RE
yading@10 2843 .RS 4
yading@10 2844 .Sp
yading@10 2845 Default value is \fBmirror\fR.
yading@10 2846 .RE
yading@10 2847 .IP "\fBblocksize\fR" 4
yading@10 2848 .IX Item "blocksize"
yading@10 2849 Specify the blocksize to use for motion search. Range 4\-128 pixels,
yading@10 2850 default 8.
yading@10 2851 .IP "\fBcontrast\fR" 4
yading@10 2852 .IX Item "contrast"
yading@10 2853 Specify the contrast threshold for blocks. Only blocks with more than
yading@10 2854 the specified contrast (difference between darkest and lightest
yading@10 2855 pixels) will be considered. Range 1\-255, default 125.
yading@10 2856 .IP "\fBsearch\fR" 4
yading@10 2857 .IX Item "search"
yading@10 2858 Specify the search strategy. Available values are:
yading@10 2859 .RS 4
yading@10 2860 .IP "\fBexhaustive, 0\fR" 4
yading@10 2861 .IX Item "exhaustive, 0"
yading@10 2862 Set exhaustive search
yading@10 2863 .IP "\fBless, 1\fR" 4
yading@10 2864 .IX Item "less, 1"
yading@10 2865 Set less exhaustive search.
yading@10 2866 .RE
yading@10 2867 .RS 4
yading@10 2868 .Sp
yading@10 2869 Default value is \fBexhaustive\fR.
yading@10 2870 .RE
yading@10 2871 .IP "\fBfilename\fR" 4
yading@10 2872 .IX Item "filename"
yading@10 2873 If set then a detailed log of the motion search is written to the
yading@10 2874 specified file.
yading@10 2875 .IP "\fBopencl\fR" 4
yading@10 2876 .IX Item "opencl"
yading@10 2877 If set to 1, specify using OpenCL capabilities, only available if
yading@10 2878 FFmpeg was configured with \f(CW\*(C`\-\-enable\-opencl\*(C'\fR. Default value is 0.
yading@10 2879 .SS "drawbox"
yading@10 2880 .IX Subsection "drawbox"
yading@10 2881 Draw a colored box on the input image.
yading@10 2882 .PP
yading@10 2883 This filter accepts the following options:
yading@10 2884 .IP "\fBx, y\fR" 4
yading@10 2885 .IX Item "x, y"
yading@10 2886 Specify the top left corner coordinates of the box. Default to 0.
yading@10 2887 .IP "\fBwidth, w\fR" 4
yading@10 2888 .IX Item "width, w"
yading@10 2889 .PD 0
yading@10 2890 .IP "\fBheight, h\fR" 4
yading@10 2891 .IX Item "height, h"
yading@10 2892 .PD
yading@10 2893 Specify the width and height of the box, if 0 they are interpreted as
yading@10 2894 the input width and height. Default to 0.
yading@10 2895 .IP "\fBcolor, c\fR" 4
yading@10 2896 .IX Item "color, c"
yading@10 2897 Specify the color of the box to write, it can be the name of a color
yading@10 2898 (case insensitive match) or a 0xRRGGBB[\s-1AA\s0] sequence. If the special
yading@10 2899 value \f(CW\*(C`invert\*(C'\fR is used, the box edge color is the same as the
yading@10 2900 video with inverted luma.
yading@10 2901 .IP "\fBthickness, t\fR" 4
yading@10 2902 .IX Item "thickness, t"
yading@10 2903 Set the thickness of the box edge. Default value is \f(CW4\fR.
yading@10 2904 .PP
yading@10 2905 \fIExamples\fR
yading@10 2906 .IX Subsection "Examples"
yading@10 2907 .IP "\(bu" 4
yading@10 2908 Draw a black box around the edge of the input image:
yading@10 2909 .Sp
yading@10 2910 .Vb 1
yading@10 2911 \& drawbox
yading@10 2912 .Ve
yading@10 2913 .IP "\(bu" 4
yading@10 2914 Draw a box with color red and an opacity of 50%:
yading@10 2915 .Sp
yading@10 2916 .Vb 1
yading@10 2917 \& drawbox=10:20:200:60:red@0.5
yading@10 2918 .Ve
yading@10 2919 .Sp
yading@10 2920 The previous example can be specified as:
yading@10 2921 .Sp
yading@10 2922 .Vb 1
yading@10 2923 \& drawbox=x=10:y=20:w=200:h=60:color=red@0.5
yading@10 2924 .Ve
yading@10 2925 .IP "\(bu" 4
yading@10 2926 Fill the box with pink color:
yading@10 2927 .Sp
yading@10 2928 .Vb 1
yading@10 2929 \& drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=max
yading@10 2930 .Ve
yading@10 2931 .SS "drawtext"
yading@10 2932 .IX Subsection "drawtext"
yading@10 2933 Draw text string or text from specified file on top of video using the
yading@10 2934 libfreetype library.
yading@10 2935 .PP
yading@10 2936 To enable compilation of this filter you need to configure FFmpeg with
yading@10 2937 \&\f(CW\*(C`\-\-enable\-libfreetype\*(C'\fR.
yading@10 2938 .PP
yading@10 2939 \fISyntax\fR
yading@10 2940 .IX Subsection "Syntax"
yading@10 2941 .PP
yading@10 2942 The description of the accepted parameters follows.
yading@10 2943 .IP "\fBbox\fR" 4
yading@10 2944 .IX Item "box"
yading@10 2945 Used to draw a box around text using background color.
yading@10 2946 Value should be either 1 (enable) or 0 (disable).
yading@10 2947 The default value of \fIbox\fR is 0.
yading@10 2948 .IP "\fBboxcolor\fR" 4
yading@10 2949 .IX Item "boxcolor"
yading@10 2950 The color to be used for drawing box around text.
yading@10 2951 Either a string (e.g. \*(L"yellow\*(R") or in 0xRRGGBB[\s-1AA\s0] format
yading@10 2952 (e.g. \*(L"0xff00ff\*(R"), possibly followed by an alpha specifier.
yading@10 2953 The default value of \fIboxcolor\fR is \*(L"white\*(R".
yading@10 2954 .IP "\fBdraw\fR" 4
yading@10 2955 .IX Item "draw"
yading@10 2956 Set an expression which specifies if the text should be drawn. If the
yading@10 2957 expression evaluates to 0, the text is not drawn. This is useful for
yading@10 2958 specifying that the text should be drawn only when specific conditions
yading@10 2959 are met.
yading@10 2960 .Sp
yading@10 2961 Default value is \*(L"1\*(R".
yading@10 2962 .Sp
yading@10 2963 See below for the list of accepted constants and functions.
yading@10 2964 .IP "\fBexpansion\fR" 4
yading@10 2965 .IX Item "expansion"
yading@10 2966 Select how the \fItext\fR is expanded. Can be either \f(CW\*(C`none\*(C'\fR,
yading@10 2967 \&\f(CW\*(C`strftime\*(C'\fR (deprecated) or
yading@10 2968 \&\f(CW\*(C`normal\*(C'\fR (default). See the drawtext_expansion, Text expansion section
yading@10 2969 below for details.
yading@10 2970 .IP "\fBfix_bounds\fR" 4
yading@10 2971 .IX Item "fix_bounds"
yading@10 2972 If true, check and fix text coords to avoid clipping.
yading@10 2973 .IP "\fBfontcolor\fR" 4
yading@10 2974 .IX Item "fontcolor"
yading@10 2975 The color to be used for drawing fonts.
yading@10 2976 Either a string (e.g. \*(L"red\*(R") or in 0xRRGGBB[\s-1AA\s0] format
yading@10 2977 (e.g. \*(L"0xff000033\*(R"), possibly followed by an alpha specifier.
yading@10 2978 The default value of \fIfontcolor\fR is \*(L"black\*(R".
yading@10 2979 .IP "\fBfontfile\fR" 4
yading@10 2980 .IX Item "fontfile"
yading@10 2981 The font file to be used for drawing text. Path must be included.
yading@10 2982 This parameter is mandatory.
yading@10 2983 .IP "\fBfontsize\fR" 4
yading@10 2984 .IX Item "fontsize"
yading@10 2985 The font size to be used for drawing text.
yading@10 2986 The default value of \fIfontsize\fR is 16.
yading@10 2987 .IP "\fBft_load_flags\fR" 4
yading@10 2988 .IX Item "ft_load_flags"
yading@10 2989 Flags to be used for loading the fonts.
yading@10 2990 .Sp
yading@10 2991 The flags map the corresponding flags supported by libfreetype, and are
yading@10 2992 a combination of the following values:
yading@10 2993 .RS 4
yading@10 2994 .IP "\fIdefault\fR" 4
yading@10 2995 .IX Item "default"
yading@10 2996 .PD 0
yading@10 2997 .IP "\fIno_scale\fR" 4
yading@10 2998 .IX Item "no_scale"
yading@10 2999 .IP "\fIno_hinting\fR" 4
yading@10 3000 .IX Item "no_hinting"
yading@10 3001 .IP "\fIrender\fR" 4
yading@10 3002 .IX Item "render"
yading@10 3003 .IP "\fIno_bitmap\fR" 4
yading@10 3004 .IX Item "no_bitmap"
yading@10 3005 .IP "\fIvertical_layout\fR" 4
yading@10 3006 .IX Item "vertical_layout"
yading@10 3007 .IP "\fIforce_autohint\fR" 4
yading@10 3008 .IX Item "force_autohint"
yading@10 3009 .IP "\fIcrop_bitmap\fR" 4
yading@10 3010 .IX Item "crop_bitmap"
yading@10 3011 .IP "\fIpedantic\fR" 4
yading@10 3012 .IX Item "pedantic"
yading@10 3013 .IP "\fIignore_global_advance_width\fR" 4
yading@10 3014 .IX Item "ignore_global_advance_width"
yading@10 3015 .IP "\fIno_recurse\fR" 4
yading@10 3016 .IX Item "no_recurse"
yading@10 3017 .IP "\fIignore_transform\fR" 4
yading@10 3018 .IX Item "ignore_transform"
yading@10 3019 .IP "\fImonochrome\fR" 4
yading@10 3020 .IX Item "monochrome"
yading@10 3021 .IP "\fIlinear_design\fR" 4
yading@10 3022 .IX Item "linear_design"
yading@10 3023 .IP "\fIno_autohint\fR" 4
yading@10 3024 .IX Item "no_autohint"
yading@10 3025 .IP "\fIend table\fR" 4
yading@10 3026 .IX Item "end table"
yading@10 3027 .RE
yading@10 3028 .RS 4
yading@10 3029 .PD
yading@10 3030 .Sp
yading@10 3031 Default value is \*(L"render\*(R".
yading@10 3032 .Sp
yading@10 3033 For more information consult the documentation for the FT_LOAD_*
yading@10 3034 libfreetype flags.
yading@10 3035 .RE
yading@10 3036 .IP "\fBshadowcolor\fR" 4
yading@10 3037 .IX Item "shadowcolor"
yading@10 3038 The color to be used for drawing a shadow behind the drawn text. It
yading@10 3039 can be a color name (e.g. \*(L"yellow\*(R") or a string in the 0xRRGGBB[\s-1AA\s0]
yading@10 3040 form (e.g. \*(L"0xff00ff\*(R"), possibly followed by an alpha specifier.
yading@10 3041 The default value of \fIshadowcolor\fR is \*(L"black\*(R".
yading@10 3042 .IP "\fBshadowx, shadowy\fR" 4
yading@10 3043 .IX Item "shadowx, shadowy"
yading@10 3044 The x and y offsets for the text shadow position with respect to the
yading@10 3045 position of the text. They can be either positive or negative
yading@10 3046 values. Default value for both is \*(L"0\*(R".
yading@10 3047 .IP "\fBtabsize\fR" 4
yading@10 3048 .IX Item "tabsize"
yading@10 3049 The size in number of spaces to use for rendering the tab.
yading@10 3050 Default value is 4.
yading@10 3051 .IP "\fBtimecode\fR" 4
yading@10 3052 .IX Item "timecode"
yading@10 3053 Set the initial timecode representation in \*(L"hh:mm:ss[:;.]ff\*(R"
yading@10 3054 format. It can be used with or without text parameter. \fItimecode_rate\fR
yading@10 3055 option must be specified.
yading@10 3056 .IP "\fBtimecode_rate, rate, r\fR" 4
yading@10 3057 .IX Item "timecode_rate, rate, r"
yading@10 3058 Set the timecode frame rate (timecode only).
yading@10 3059 .IP "\fBtext\fR" 4
yading@10 3060 .IX Item "text"
yading@10 3061 The text string to be drawn. The text must be a sequence of \s-1UTF\-8\s0
yading@10 3062 encoded characters.
yading@10 3063 This parameter is mandatory if no file is specified with the parameter
yading@10 3064 \&\fItextfile\fR.
yading@10 3065 .IP "\fBtextfile\fR" 4
yading@10 3066 .IX Item "textfile"
yading@10 3067 A text file containing text to be drawn. The text must be a sequence
yading@10 3068 of \s-1UTF\-8\s0 encoded characters.
yading@10 3069 .Sp
yading@10 3070 This parameter is mandatory if no text string is specified with the
yading@10 3071 parameter \fItext\fR.
yading@10 3072 .Sp
yading@10 3073 If both \fItext\fR and \fItextfile\fR are specified, an error is thrown.
yading@10 3074 .IP "\fBreload\fR" 4
yading@10 3075 .IX Item "reload"
yading@10 3076 If set to 1, the \fItextfile\fR will be reloaded before each frame.
yading@10 3077 Be sure to update it atomically, or it may be read partially, or even fail.
yading@10 3078 .IP "\fBx, y\fR" 4
yading@10 3079 .IX Item "x, y"
yading@10 3080 The expressions which specify the offsets where text will be drawn
yading@10 3081 within the video frame. They are relative to the top/left border of the
yading@10 3082 output image.
yading@10 3083 .Sp
yading@10 3084 The default value of \fIx\fR and \fIy\fR is \*(L"0\*(R".
yading@10 3085 .Sp
yading@10 3086 See below for the list of accepted constants and functions.
yading@10 3087 .PP
yading@10 3088 The parameters for \fIx\fR and \fIy\fR are expressions containing the
yading@10 3089 following constants and functions:
yading@10 3090 .IP "\fBdar\fR" 4
yading@10 3091 .IX Item "dar"
yading@10 3092 input display aspect ratio, it is the same as (\fIw\fR / \fIh\fR) * \fIsar\fR
yading@10 3093 .IP "\fBhsub, vsub\fR" 4
yading@10 3094 .IX Item "hsub, vsub"
yading@10 3095 horizontal and vertical chroma subsample values. For example for the
yading@10 3096 pixel format \*(L"yuv422p\*(R" \fIhsub\fR is 2 and \fIvsub\fR is 1.
yading@10 3097 .IP "\fBline_h, lh\fR" 4
yading@10 3098 .IX Item "line_h, lh"
yading@10 3099 the height of each text line
yading@10 3100 .IP "\fBmain_h, h, H\fR" 4
yading@10 3101 .IX Item "main_h, h, H"
yading@10 3102 the input height
yading@10 3103 .IP "\fBmain_w, w, W\fR" 4
yading@10 3104 .IX Item "main_w, w, W"
yading@10 3105 the input width
yading@10 3106 .IP "\fBmax_glyph_a, ascent\fR" 4
yading@10 3107 .IX Item "max_glyph_a, ascent"
yading@10 3108 the maximum distance from the baseline to the highest/upper grid
yading@10 3109 coordinate used to place a glyph outline point, for all the rendered
yading@10 3110 glyphs.
yading@10 3111 It is a positive value, due to the grid's orientation with the Y axis
yading@10 3112 upwards.
yading@10 3113 .IP "\fBmax_glyph_d, descent\fR" 4
yading@10 3114 .IX Item "max_glyph_d, descent"
yading@10 3115 the maximum distance from the baseline to the lowest grid coordinate
yading@10 3116 used to place a glyph outline point, for all the rendered glyphs.
yading@10 3117 This is a negative value, due to the grid's orientation, with the Y axis
yading@10 3118 upwards.
yading@10 3119 .IP "\fBmax_glyph_h\fR" 4
yading@10 3120 .IX Item "max_glyph_h"
yading@10 3121 maximum glyph height, that is the maximum height for all the glyphs
yading@10 3122 contained in the rendered text, it is equivalent to \fIascent\fR \-
yading@10 3123 \&\fIdescent\fR.
yading@10 3124 .IP "\fBmax_glyph_w\fR" 4
yading@10 3125 .IX Item "max_glyph_w"
yading@10 3126 maximum glyph width, that is the maximum width for all the glyphs
yading@10 3127 contained in the rendered text
yading@10 3128 .IP "\fBn\fR" 4
yading@10 3129 .IX Item "n"
yading@10 3130 the number of input frame, starting from 0
yading@10 3131 .IP "\fBrand(min, max)\fR" 4
yading@10 3132 .IX Item "rand(min, max)"
yading@10 3133 return a random number included between \fImin\fR and \fImax\fR
yading@10 3134 .IP "\fBsar\fR" 4
yading@10 3135 .IX Item "sar"
yading@10 3136 input sample aspect ratio
yading@10 3137 .IP "\fBt\fR" 4
yading@10 3138 .IX Item "t"
yading@10 3139 timestamp expressed in seconds, \s-1NAN\s0 if the input timestamp is unknown
yading@10 3140 .IP "\fBtext_h, th\fR" 4
yading@10 3141 .IX Item "text_h, th"
yading@10 3142 the height of the rendered text
yading@10 3143 .IP "\fBtext_w, tw\fR" 4
yading@10 3144 .IX Item "text_w, tw"
yading@10 3145 the width of the rendered text
yading@10 3146 .IP "\fBx, y\fR" 4
yading@10 3147 .IX Item "x, y"
yading@10 3148 the x and y offset coordinates where the text is drawn.
yading@10 3149 .Sp
yading@10 3150 These parameters allow the \fIx\fR and \fIy\fR expressions to refer
yading@10 3151 each other, so you can for example specify \f(CW\*(C`y=x/dar\*(C'\fR.
yading@10 3152 .PP
yading@10 3153 If libavfilter was built with \f(CW\*(C`\-\-enable\-fontconfig\*(C'\fR, then
yading@10 3154 \&\fBfontfile\fR can be a fontconfig pattern or omitted.
yading@10 3155 .PP
yading@10 3156 \fIText expansion\fR
yading@10 3157 .IX Subsection "Text expansion"
yading@10 3158 .PP
yading@10 3159 If \fBexpansion\fR is set to \f(CW\*(C`strftime\*(C'\fR,
yading@10 3160 the filter recognizes \fIstrftime()\fR sequences in the provided text and
yading@10 3161 expands them accordingly. Check the documentation of \fIstrftime()\fR. This
yading@10 3162 feature is deprecated.
yading@10 3163 .PP
yading@10 3164 If \fBexpansion\fR is set to \f(CW\*(C`none\*(C'\fR, the text is printed verbatim.
yading@10 3165 .PP
yading@10 3166 If \fBexpansion\fR is set to \f(CW\*(C`normal\*(C'\fR (which is the default),
yading@10 3167 the following expansion mechanism is used.
yading@10 3168 .PP
yading@10 3169 The backslash character '\e', followed by any character, always expands to
yading@10 3170 the second character.
yading@10 3171 .PP
yading@10 3172 Sequence of the form \f(CW\*(C`%{...}\*(C'\fR are expanded. The text between the
yading@10 3173 braces is a function name, possibly followed by arguments separated by ':'.
yading@10 3174 If the arguments contain special characters or delimiters (':' or '}'),
yading@10 3175 they should be escaped.
yading@10 3176 .PP
yading@10 3177 Note that they probably must also be escaped as the value for the
yading@10 3178 \&\fBtext\fR option in the filter argument string and as the filter
yading@10 3179 argument in the filtergraph description, and possibly also for the shell,
yading@10 3180 that makes up to four levels of escaping; using a text file avoids these
yading@10 3181 problems.
yading@10 3182 .PP
yading@10 3183 The following functions are available:
yading@10 3184 .IP "\fBexpr, e\fR" 4
yading@10 3185 .IX Item "expr, e"
yading@10 3186 The expression evaluation result.
yading@10 3187 .Sp
yading@10 3188 It must take one argument specifying the expression to be evaluated,
yading@10 3189 which accepts the same constants and functions as the \fIx\fR and
yading@10 3190 \&\fIy\fR values. Note that not all constants should be used, for
yading@10 3191 example the text size is not known when evaluating the expression, so
yading@10 3192 the constants \fItext_w\fR and \fItext_h\fR will have an undefined
yading@10 3193 value.
yading@10 3194 .IP "\fBgmtime\fR" 4
yading@10 3195 .IX Item "gmtime"
yading@10 3196 The time at which the filter is running, expressed in \s-1UTC\s0.
yading@10 3197 It can accept an argument: a \fIstrftime()\fR format string.
yading@10 3198 .IP "\fBlocaltime\fR" 4
yading@10 3199 .IX Item "localtime"
yading@10 3200 The time at which the filter is running, expressed in the local time zone.
yading@10 3201 It can accept an argument: a \fIstrftime()\fR format string.
yading@10 3202 .IP "\fBn, frame_num\fR" 4
yading@10 3203 .IX Item "n, frame_num"
yading@10 3204 The frame number, starting from 0.
yading@10 3205 .IP "\fBpts\fR" 4
yading@10 3206 .IX Item "pts"
yading@10 3207 The timestamp of the current frame, in seconds, with microsecond accuracy.
yading@10 3208 .PP
yading@10 3209 \fIExamples\fR
yading@10 3210 .IX Subsection "Examples"
yading@10 3211 .IP "\(bu" 4
yading@10 3212 Draw \*(L"Test Text\*(R" with font FreeSerif, using the default values for the
yading@10 3213 optional parameters.
yading@10 3214 .Sp
yading@10 3215 .Vb 1
yading@10 3216 \& drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text=\*(AqTest Text\*(Aq"
yading@10 3217 .Ve
yading@10 3218 .IP "\(bu" 4
yading@10 3219 Draw 'Test Text' with font FreeSerif of size 24 at position x=100
yading@10 3220 and y=50 (counting from the top-left corner of the screen), text is
yading@10 3221 yellow with a red box around it. Both the text and the box have an
yading@10 3222 opacity of 20%.
yading@10 3223 .Sp
yading@10 3224 .Vb 2
yading@10 3225 \& drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text=\*(AqTest Text\*(Aq:\e
yading@10 3226 \& x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2"
yading@10 3227 .Ve
yading@10 3228 .Sp
yading@10 3229 Note that the double quotes are not necessary if spaces are not used
yading@10 3230 within the parameter list.
yading@10 3231 .IP "\(bu" 4
yading@10 3232 Show the text at the center of the video frame:
yading@10 3233 .Sp
yading@10 3234 .Vb 1
yading@10 3235 \& drawtext="fontsize=30:fontfile=FreeSerif.ttf:text=\*(Aqhello world\*(Aq:x=(w\-text_w)/2:y=(h\-text_h\-line_h)/2"
yading@10 3236 .Ve
yading@10 3237 .IP "\(bu" 4
yading@10 3238 Show a text line sliding from right to left in the last row of the video
yading@10 3239 frame. The file \fI\s-1LONG_LINE\s0\fR is assumed to contain a single line
yading@10 3240 with no newlines.
yading@10 3241 .Sp
yading@10 3242 .Vb 1
yading@10 3243 \& drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h\-line_h:x=\-50*t"
yading@10 3244 .Ve
yading@10 3245 .IP "\(bu" 4
yading@10 3246 Show the content of file \fI\s-1CREDITS\s0\fR off the bottom of the frame and scroll up.
yading@10 3247 .Sp
yading@10 3248 .Vb 1
yading@10 3249 \& drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h\-20*t"
yading@10 3250 .Ve
yading@10 3251 .IP "\(bu" 4
yading@10 3252 Draw a single green letter \*(L"g\*(R", at the center of the input video.
yading@10 3253 The glyph baseline is placed at half screen height.
yading@10 3254 .Sp
yading@10 3255 .Vb 1
yading@10 3256 \& drawtext="fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w\-max_glyph_w)/2:y=h/2\-ascent"
yading@10 3257 .Ve
yading@10 3258 .IP "\(bu" 4
yading@10 3259 Show text for 1 second every 3 seconds:
yading@10 3260 .Sp
yading@10 3261 .Vb 1
yading@10 3262 \& drawtext="fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:draw=lt(mod(t\e,3)\e,1):text=\*(Aqblink\*(Aq"
yading@10 3263 .Ve
yading@10 3264 .IP "\(bu" 4
yading@10 3265 Use fontconfig to set the font. Note that the colons need to be escaped.
yading@10 3266 .Sp
yading@10 3267 .Vb 1
yading@10 3268 \& drawtext=\*(Aqfontfile=Linux Libertine O\-40\e:style=Semibold:text=FFmpeg\*(Aq
yading@10 3269 .Ve
yading@10 3270 .IP "\(bu" 4
yading@10 3271 Print the date of a real-time encoding (see \fIstrftime\fR\|(3)):
yading@10 3272 .Sp
yading@10 3273 .Vb 1
yading@10 3274 \& drawtext=\*(Aqfontfile=FreeSans.ttf:text=%{localtime:%a %b %d %Y}\*(Aq
yading@10 3275 .Ve
yading@10 3276 .PP
yading@10 3277 For more information about libfreetype, check:
yading@10 3278 <\fBhttp://www.freetype.org/\fR>.
yading@10 3279 .PP
yading@10 3280 For more information about fontconfig, check:
yading@10 3281 <\fBhttp://freedesktop.org/software/fontconfig/fontconfig\-user.html\fR>.
yading@10 3282 .SS "edgedetect"
yading@10 3283 .IX Subsection "edgedetect"
yading@10 3284 Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
yading@10 3285 .PP
yading@10 3286 The filter accepts the following options:
yading@10 3287 .IP "\fBlow, high\fR" 4
yading@10 3288 .IX Item "low, high"
yading@10 3289 Set low and high threshold values used by the Canny thresholding
yading@10 3290 algorithm.
yading@10 3291 .Sp
yading@10 3292 The high threshold selects the \*(L"strong\*(R" edge pixels, which are then
yading@10 3293 connected through 8\-connectivity with the \*(L"weak\*(R" edge pixels selected
yading@10 3294 by the low threshold.
yading@10 3295 .Sp
yading@10 3296 \&\fIlow\fR and \fIhigh\fR threshold values must be choosen in the range
yading@10 3297 [0,1], and \fIlow\fR should be lesser or equal to \fIhigh\fR.
yading@10 3298 .Sp
yading@10 3299 Default value for \fIlow\fR is \f(CW\*(C`20/255\*(C'\fR, and default value for \fIhigh\fR
yading@10 3300 is \f(CW\*(C`50/255\*(C'\fR.
yading@10 3301 .PP
yading@10 3302 Example:
yading@10 3303 .PP
yading@10 3304 .Vb 1
yading@10 3305 \& edgedetect=low=0.1:high=0.4
yading@10 3306 .Ve
yading@10 3307 .SS "fade"
yading@10 3308 .IX Subsection "fade"
yading@10 3309 Apply fade\-in/out effect to input video.
yading@10 3310 .PP
yading@10 3311 This filter accepts the following options:
yading@10 3312 .IP "\fBtype, t\fR" 4
yading@10 3313 .IX Item "type, t"
yading@10 3314 The effect type \*(-- can be either \*(L"in\*(R" for fade-in, or \*(L"out\*(R" for a fade-out
yading@10 3315 effect.
yading@10 3316 Default is \f(CW\*(C`in\*(C'\fR.
yading@10 3317 .IP "\fBstart_frame, s\fR" 4
yading@10 3318 .IX Item "start_frame, s"
yading@10 3319 Specify the number of the start frame for starting to apply the fade
yading@10 3320 effect. Default is 0.
yading@10 3321 .IP "\fBnb_frames, n\fR" 4
yading@10 3322 .IX Item "nb_frames, n"
yading@10 3323 The number of frames for which the fade effect has to last. At the end of the
yading@10 3324 fade-in effect the output video will have the same intensity as the input video,
yading@10 3325 at the end of the fade-out transition the output video will be completely black.
yading@10 3326 Default is 25.
yading@10 3327 .IP "\fBalpha\fR" 4
yading@10 3328 .IX Item "alpha"
yading@10 3329 If set to 1, fade only alpha channel, if one exists on the input.
yading@10 3330 Default value is 0.
yading@10 3331 .PP
yading@10 3332 \fIExamples\fR
yading@10 3333 .IX Subsection "Examples"
yading@10 3334 .IP "\(bu" 4
yading@10 3335 Fade in first 30 frames of video:
yading@10 3336 .Sp
yading@10 3337 .Vb 1
yading@10 3338 \& fade=in:0:30
yading@10 3339 .Ve
yading@10 3340 .Sp
yading@10 3341 The command above is equivalent to:
yading@10 3342 .Sp
yading@10 3343 .Vb 1
yading@10 3344 \& fade=t=in:s=0:n=30
yading@10 3345 .Ve
yading@10 3346 .IP "\(bu" 4
yading@10 3347 Fade out last 45 frames of a 200\-frame video:
yading@10 3348 .Sp
yading@10 3349 .Vb 2
yading@10 3350 \& fade=out:155:45
yading@10 3351 \& fade=type=out:start_frame=155:nb_frames=45
yading@10 3352 .Ve
yading@10 3353 .IP "\(bu" 4
yading@10 3354 Fade in first 25 frames and fade out last 25 frames of a 1000\-frame video:
yading@10 3355 .Sp
yading@10 3356 .Vb 1
yading@10 3357 \& fade=in:0:25, fade=out:975:25
yading@10 3358 .Ve
yading@10 3359 .IP "\(bu" 4
yading@10 3360 Make first 5 frames black, then fade in from frame 5\-24:
yading@10 3361 .Sp
yading@10 3362 .Vb 1
yading@10 3363 \& fade=in:5:20
yading@10 3364 .Ve
yading@10 3365 .IP "\(bu" 4
yading@10 3366 Fade in alpha over first 25 frames of video:
yading@10 3367 .Sp
yading@10 3368 .Vb 1
yading@10 3369 \& fade=in:0:25:alpha=1
yading@10 3370 .Ve
yading@10 3371 .SS "field"
yading@10 3372 .IX Subsection "field"
yading@10 3373 Extract a single field from an interlaced image using stride
yading@10 3374 arithmetic to avoid wasting \s-1CPU\s0 time. The output frames are marked as
yading@10 3375 non-interlaced.
yading@10 3376 .PP
yading@10 3377 The filter accepts the following options:
yading@10 3378 .IP "\fBtype\fR" 4
yading@10 3379 .IX Item "type"
yading@10 3380 Specify whether to extract the top (if the value is \f(CW0\fR or
yading@10 3381 \&\f(CW\*(C`top\*(C'\fR) or the bottom field (if the value is \f(CW1\fR or
yading@10 3382 \&\f(CW\*(C`bottom\*(C'\fR).
yading@10 3383 .SS "fieldmatch"
yading@10 3384 .IX Subsection "fieldmatch"
yading@10 3385 Field matching filter for inverse telecine. It is meant to reconstruct the
yading@10 3386 progressive frames from a telecined stream. The filter does not drop duplicated
yading@10 3387 frames, so to achieve a complete inverse telecine \f(CW\*(C`fieldmatch\*(C'\fR needs to be
yading@10 3388 followed by a decimation filter such as decimate in the filtergraph.
yading@10 3389 .PP
yading@10 3390 The separation of the field matching and the decimation is notably motivated by
yading@10 3391 the possibility of inserting a de-interlacing filter fallback between the two.
yading@10 3392 If the source has mixed telecined and real interlaced content,
yading@10 3393 \&\f(CW\*(C`fieldmatch\*(C'\fR will not be able to match fields for the interlaced parts.
yading@10 3394 But these remaining combed frames will be marked as interlaced, and thus can be
yading@10 3395 de-interlaced by a later filter such as yadif before decimation.
yading@10 3396 .PP
yading@10 3397 In addition to the various configuration options, \f(CW\*(C`fieldmatch\*(C'\fR can take an
yading@10 3398 optional second stream, activated through the \fBppsrc\fR option. If
yading@10 3399 enabled, the frames reconstruction will be based on the fields and frames from
yading@10 3400 this second stream. This allows the first input to be pre-processed in order to
yading@10 3401 help the various algorithms of the filter, while keeping the output lossless
yading@10 3402 (assuming the fields are matched properly). Typically, a field-aware denoiser,
yading@10 3403 or brightness/contrast adjustments can help.
yading@10 3404 .PP
yading@10 3405 Note that this filter uses the same algorithms as \s-1TIVTC/TFM\s0 (AviSynth project)
yading@10 3406 and \s-1VIVTC/VFM\s0 (VapourSynth project). The later is a light clone of \s-1TFM\s0 from
yading@10 3407 which \f(CW\*(C`fieldmatch\*(C'\fR is based on. While the semantic and usage are very
yading@10 3408 close, some behaviour and options names can differ.
yading@10 3409 .PP
yading@10 3410 The filter accepts the following options:
yading@10 3411 .IP "\fBorder\fR" 4
yading@10 3412 .IX Item "order"
yading@10 3413 Specify the assumed field order of the input stream. Available values are:
yading@10 3414 .RS 4
yading@10 3415 .IP "\fBauto\fR" 4
yading@10 3416 .IX Item "auto"
yading@10 3417 Auto detect parity (use FFmpeg's internal parity value).
yading@10 3418 .IP "\fBbff\fR" 4
yading@10 3419 .IX Item "bff"
yading@10 3420 Assume bottom field first.
yading@10 3421 .IP "\fBtff\fR" 4
yading@10 3422 .IX Item "tff"
yading@10 3423 Assume top field first.
yading@10 3424 .RE
yading@10 3425 .RS 4
yading@10 3426 .Sp
yading@10 3427 Note that it is sometimes recommended not to trust the parity announced by the
yading@10 3428 stream.
yading@10 3429 .Sp
yading@10 3430 Default value is \fIauto\fR.
yading@10 3431 .RE
yading@10 3432 .IP "\fBmode\fR" 4
yading@10 3433 .IX Item "mode"
yading@10 3434 Set the matching mode or strategy to use. \fBpc\fR mode is the safest in the
yading@10 3435 sense that it wont risk creating jerkiness due to duplicate frames when
yading@10 3436 possible, but if there are bad edits or blended fields it will end up
yading@10 3437 outputting combed frames when a good match might actually exist. On the other
yading@10 3438 hand, \fBpcn_ub\fR mode is the most risky in terms of creating jerkiness,
yading@10 3439 but will almost always find a good frame if there is one. The other values are
yading@10 3440 all somewhere in between \fBpc\fR and \fBpcn_ub\fR in terms of risking
yading@10 3441 jerkiness and creating duplicate frames versus finding good matches in sections
yading@10 3442 with bad edits, orphaned fields, blended fields, etc.
yading@10 3443 .Sp
yading@10 3444 More details about p/c/n/u/b are available in p/c/n/u/b meaning section.
yading@10 3445 .Sp
yading@10 3446 Available values are:
yading@10 3447 .RS 4
yading@10 3448 .IP "\fBpc\fR" 4
yading@10 3449 .IX Item "pc"
yading@10 3450 2\-way matching (p/c)
yading@10 3451 .IP "\fBpc_n\fR" 4
yading@10 3452 .IX Item "pc_n"
yading@10 3453 2\-way matching, and trying 3rd match if still combed (p/c + n)
yading@10 3454 .IP "\fBpc_u\fR" 4
yading@10 3455 .IX Item "pc_u"
yading@10 3456 2\-way matching, and trying 3rd match (same order) if still combed (p/c + u)
yading@10 3457 .IP "\fBpc_n_ub\fR" 4
yading@10 3458 .IX Item "pc_n_ub"
yading@10 3459 2\-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
yading@10 3460 still combed (p/c + n + u/b)
yading@10 3461 .IP "\fBpcn\fR" 4
yading@10 3462 .IX Item "pcn"
yading@10 3463 3\-way matching (p/c/n)
yading@10 3464 .IP "\fBpcn_ub\fR" 4
yading@10 3465 .IX Item "pcn_ub"
yading@10 3466 3\-way matching, and trying 4th/5th matches if all 3 of the original matches are
yading@10 3467 detected as combed (p/c/n + u/b)
yading@10 3468 .RE
yading@10 3469 .RS 4
yading@10 3470 .Sp
yading@10 3471 The parenthesis at the end indicate the matches that would be used for that
yading@10 3472 mode assuming \fBorder\fR=\fItff\fR (and \fBfield\fR on \fIauto\fR or
yading@10 3473 \&\fItop\fR).
yading@10 3474 .Sp
yading@10 3475 In terms of speed \fBpc\fR mode is by far the fastest and \fBpcn_ub\fR is
yading@10 3476 the slowest.
yading@10 3477 .Sp
yading@10 3478 Default value is \fIpc_n\fR.
yading@10 3479 .RE
yading@10 3480 .IP "\fBppsrc\fR" 4
yading@10 3481 .IX Item "ppsrc"
yading@10 3482 Mark the main input stream as a pre-processed input, and enable the secondary
yading@10 3483 input stream as the clean source to pick the fields from. See the filter
yading@10 3484 introduction for more details. It is similar to the \fBclip2\fR feature from
yading@10 3485 \&\s-1VFM/TFM\s0.
yading@10 3486 .Sp
yading@10 3487 Default value is \f(CW0\fR (disabled).
yading@10 3488 .IP "\fBfield\fR" 4
yading@10 3489 .IX Item "field"
yading@10 3490 Set the field to match from. It is recommended to set this to the same value as
yading@10 3491 \&\fBorder\fR unless you experience matching failures with that setting. In
yading@10 3492 certain circumstances changing the field that is used to match from can have a
yading@10 3493 large impact on matching performance. Available values are:
yading@10 3494 .RS 4
yading@10 3495 .IP "\fBauto\fR" 4
yading@10 3496 .IX Item "auto"
yading@10 3497 Automatic (same value as \fBorder\fR).
yading@10 3498 .IP "\fBbottom\fR" 4
yading@10 3499 .IX Item "bottom"
yading@10 3500 Match from the bottom field.
yading@10 3501 .IP "\fBtop\fR" 4
yading@10 3502 .IX Item "top"
yading@10 3503 Match from the top field.
yading@10 3504 .RE
yading@10 3505 .RS 4
yading@10 3506 .Sp
yading@10 3507 Default value is \fIauto\fR.
yading@10 3508 .RE
yading@10 3509 .IP "\fBmchroma\fR" 4
yading@10 3510 .IX Item "mchroma"
yading@10 3511 Set whether or not chroma is included during the match comparisons. In most
yading@10 3512 cases it is recommended to leave this enabled. You should set this to \f(CW0\fR
yading@10 3513 only if your clip has bad chroma problems such as heavy rainbowing or other
yading@10 3514 artifacts. Setting this to \f(CW0\fR could also be used to speed things up at
yading@10 3515 the cost of some accuracy.
yading@10 3516 .Sp
yading@10 3517 Default value is \f(CW1\fR.
yading@10 3518 .IP "\fBy0\fR" 4
yading@10 3519 .IX Item "y0"
yading@10 3520 .PD 0
yading@10 3521 .IP "\fBy1\fR" 4
yading@10 3522 .IX Item "y1"
yading@10 3523 .PD
yading@10 3524 These define an exclusion band which excludes the lines between \fBy0\fR and
yading@10 3525 \&\fBy1\fR from being included in the field matching decision. An exclusion
yading@10 3526 band can be used to ignore subtitles, a logo, or other things that may
yading@10 3527 interfere with the matching. \fBy0\fR sets the starting scan line and
yading@10 3528 \&\fBy1\fR sets the ending line; all lines in between \fBy0\fR and
yading@10 3529 \&\fBy1\fR (including \fBy0\fR and \fBy1\fR) will be ignored. Setting
yading@10 3530 \&\fBy0\fR and \fBy1\fR to the same value will disable the feature.
yading@10 3531 \&\fBy0\fR and \fBy1\fR defaults to \f(CW0\fR.
yading@10 3532 .IP "\fBscthresh\fR" 4
yading@10 3533 .IX Item "scthresh"
yading@10 3534 Set the scene change detection threshold as a percentage of maximum change on
yading@10 3535 the luma plane. Good values are in the \f(CW\*(C`[8.0, 14.0]\*(C'\fR range. Scene change
yading@10 3536 detection is only relevant in case \fBcombmatch\fR=\fIsc\fR. The range for
yading@10 3537 \&\fBscthresh\fR is \f(CW\*(C`[0.0, 100.0]\*(C'\fR.
yading@10 3538 .Sp
yading@10 3539 Default value is \f(CW12.0\fR.
yading@10 3540 .IP "\fBcombmatch\fR" 4
yading@10 3541 .IX Item "combmatch"
yading@10 3542 When \fBcombatch\fR is not \fInone\fR, \f(CW\*(C`fieldmatch\*(C'\fR will take into
yading@10 3543 account the combed scores of matches when deciding what match to use as the
yading@10 3544 final match. Available values are:
yading@10 3545 .RS 4
yading@10 3546 .IP "\fBnone\fR" 4
yading@10 3547 .IX Item "none"
yading@10 3548 No final matching based on combed scores.
yading@10 3549 .IP "\fBsc\fR" 4
yading@10 3550 .IX Item "sc"
yading@10 3551 Combed scores are only used when a scene change is detected.
yading@10 3552 .IP "\fBfull\fR" 4
yading@10 3553 .IX Item "full"
yading@10 3554 Use combed scores all the time.
yading@10 3555 .RE
yading@10 3556 .RS 4
yading@10 3557 .Sp
yading@10 3558 Default is \fIsc\fR.
yading@10 3559 .RE
yading@10 3560 .IP "\fBcombdbg\fR" 4
yading@10 3561 .IX Item "combdbg"
yading@10 3562 Force \f(CW\*(C`fieldmatch\*(C'\fR to calculate the combed metrics for certain matches and
yading@10 3563 print them. This setting is known as \fBmicout\fR in \s-1TFM/VFM\s0 vocabulary.
yading@10 3564 Available values are:
yading@10 3565 .RS 4
yading@10 3566 .IP "\fBnone\fR" 4
yading@10 3567 .IX Item "none"
yading@10 3568 No forced calculation.
yading@10 3569 .IP "\fBpcn\fR" 4
yading@10 3570 .IX Item "pcn"
yading@10 3571 Force p/c/n calculations.
yading@10 3572 .IP "\fBpcnub\fR" 4
yading@10 3573 .IX Item "pcnub"
yading@10 3574 Force p/c/n/u/b calculations.
yading@10 3575 .RE
yading@10 3576 .RS 4
yading@10 3577 .Sp
yading@10 3578 Default value is \fInone\fR.
yading@10 3579 .RE
yading@10 3580 .IP "\fBcthresh\fR" 4
yading@10 3581 .IX Item "cthresh"
yading@10 3582 This is the area combing threshold used for combed frame detection. This
yading@10 3583 essentially controls how \*(L"strong\*(R" or \*(L"visible\*(R" combing must be to be detected.
yading@10 3584 Larger values mean combing must be more visible and smaller values mean combing
yading@10 3585 can be less visible or strong and still be detected. Valid settings are from
yading@10 3586 \&\f(CW\*(C`\-1\*(C'\fR (every pixel will be detected as combed) to \f(CW255\fR (no pixel will
yading@10 3587 be detected as combed). This is basically a pixel difference value. A good
yading@10 3588 range is \f(CW\*(C`[8, 12]\*(C'\fR.
yading@10 3589 .Sp
yading@10 3590 Default value is \f(CW9\fR.
yading@10 3591 .IP "\fBchroma\fR" 4
yading@10 3592 .IX Item "chroma"
yading@10 3593 Sets whether or not chroma is considered in the combed frame decision. Only
yading@10 3594 disable this if your source has chroma problems (rainbowing, etc.) that are
yading@10 3595 causing problems for the combed frame detection with chroma enabled. Actually,
yading@10 3596 using \fBchroma\fR=\fI0\fR is usually more reliable, except for the case
yading@10 3597 where there is chroma only combing in the source.
yading@10 3598 .Sp
yading@10 3599 Default value is \f(CW0\fR.
yading@10 3600 .IP "\fBblockx\fR" 4
yading@10 3601 .IX Item "blockx"
yading@10 3602 .PD 0
yading@10 3603 .IP "\fBblocky\fR" 4
yading@10 3604 .IX Item "blocky"
yading@10 3605 .PD
yading@10 3606 Respectively set the x\-axis and y\-axis size of the window used during combed
yading@10 3607 frame detection. This has to do with the size of the area in which
yading@10 3608 \&\fBcombpel\fR pixels are required to be detected as combed for a frame to be
yading@10 3609 declared combed. See the \fBcombpel\fR parameter description for more info.
yading@10 3610 Possible values are any number that is a power of 2 starting at 4 and going up
yading@10 3611 to 512.
yading@10 3612 .Sp
yading@10 3613 Default value is \f(CW16\fR.
yading@10 3614 .IP "\fBcombpel\fR" 4
yading@10 3615 .IX Item "combpel"
yading@10 3616 The number of combed pixels inside any of the \fBblocky\fR by
yading@10 3617 \&\fBblockx\fR size blocks on the frame for the frame to be detected as
yading@10 3618 combed. While \fBcthresh\fR controls how \*(L"visible\*(R" the combing must be, this
yading@10 3619 setting controls \*(L"how much\*(R" combing there must be in any localized area (a
yading@10 3620 window defined by the \fBblockx\fR and \fBblocky\fR settings) on the
yading@10 3621 frame. Minimum value is \f(CW0\fR and maximum is \f(CW\*(C`blocky x blockx\*(C'\fR (at
yading@10 3622 which point no frames will ever be detected as combed). This setting is known
yading@10 3623 as \fB\s-1MI\s0\fR in \s-1TFM/VFM\s0 vocabulary.
yading@10 3624 .Sp
yading@10 3625 Default value is \f(CW80\fR.
yading@10 3626 .PP
yading@10 3627 \fIp/c/n/u/b meaning\fR
yading@10 3628 .IX Subsection "p/c/n/u/b meaning"
yading@10 3629 .PP
yading@10 3630 p/c/n
yading@10 3631 .IX Subsection "p/c/n"
yading@10 3632 .PP
yading@10 3633 We assume the following telecined stream:
yading@10 3634 .PP
yading@10 3635 .Vb 2
yading@10 3636 \& Top fields: 1 2 2 3 4
yading@10 3637 \& Bottom fields: 1 2 3 4 4
yading@10 3638 .Ve
yading@10 3639 .PP
yading@10 3640 The numbers correspond to the progressive frame the fields relate to. Here, the
yading@10 3641 first two frames are progressive, the 3rd and 4th are combed, and so on.
yading@10 3642 .PP
yading@10 3643 When \f(CW\*(C`fieldmatch\*(C'\fR is configured to run a matching from bottom
yading@10 3644 (\fBfield\fR=\fIbottom\fR) this is how this input stream get transformed:
yading@10 3645 .PP
yading@10 3646 .Vb 3
yading@10 3647 \& Input stream:
yading@10 3648 \& T 1 2 2 3 4
yading@10 3649 \& B 1 2 3 4 4 <\-\- matching reference
yading@10 3650 \&
yading@10 3651 \& Matches: c c n n c
yading@10 3652 \&
yading@10 3653 \& Output stream:
yading@10 3654 \& T 1 2 3 4 4
yading@10 3655 \& B 1 2 3 4 4
yading@10 3656 .Ve
yading@10 3657 .PP
yading@10 3658 As a result of the field matching, we can see that some frames get duplicated.
yading@10 3659 To perform a complete inverse telecine, you need to rely on a decimation filter
yading@10 3660 after this operation. See for instance the decimate filter.
yading@10 3661 .PP
yading@10 3662 The same operation now matching from top fields (\fBfield\fR=\fItop\fR)
yading@10 3663 looks like this:
yading@10 3664 .PP
yading@10 3665 .Vb 3
yading@10 3666 \& Input stream:
yading@10 3667 \& T 1 2 2 3 4 <\-\- matching reference
yading@10 3668 \& B 1 2 3 4 4
yading@10 3669 \&
yading@10 3670 \& Matches: c c p p c
yading@10 3671 \&
yading@10 3672 \& Output stream:
yading@10 3673 \& T 1 2 2 3 4
yading@10 3674 \& B 1 2 2 3 4
yading@10 3675 .Ve
yading@10 3676 .PP
yading@10 3677 In these examples, we can see what \fIp\fR, \fIc\fR and \fIn\fR mean;
yading@10 3678 basically, they refer to the frame and field of the opposite parity:
yading@10 3679 .IP "*<\fIp\fR matches the field of the opposite parity in the previous frame>" 4
yading@10 3680 .IX Item "*<p matches the field of the opposite parity in the previous frame>"
yading@10 3681 .PD 0
yading@10 3682 .IP "*<\fIc\fR matches the field of the opposite parity in the current frame>" 4
yading@10 3683 .IX Item "*<c matches the field of the opposite parity in the current frame>"
yading@10 3684 .IP "*<\fIn\fR matches the field of the opposite parity in the next frame>" 4
yading@10 3685 .IX Item "*<n matches the field of the opposite parity in the next frame>"
yading@10 3686 .PD
yading@10 3687 .PP
yading@10 3688 u/b
yading@10 3689 .IX Subsection "u/b"
yading@10 3690 .PP
yading@10 3691 The \fIu\fR and \fIb\fR matching are a bit special in the sense that they match
yading@10 3692 from the opposite parity flag. In the following examples, we assume that we are
yading@10 3693 currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
yading@10 3694 \&'x' is placed above and below each matched fields.
yading@10 3695 .PP
yading@10 3696 With bottom matching (\fBfield\fR=\fIbottom\fR):
yading@10 3697 .PP
yading@10 3698 .Vb 1
yading@10 3699 \& Match: c p n b u
yading@10 3700 \&
yading@10 3701 \& x x x x x
yading@10 3702 \& Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
yading@10 3703 \& Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
yading@10 3704 \& x x x x x
yading@10 3705 \&
yading@10 3706 \& Output frames:
yading@10 3707 \& 2 1 2 2 2
yading@10 3708 \& 2 2 2 1 3
yading@10 3709 .Ve
yading@10 3710 .PP
yading@10 3711 With top matching (\fBfield\fR=\fItop\fR):
yading@10 3712 .PP
yading@10 3713 .Vb 1
yading@10 3714 \& Match: c p n b u
yading@10 3715 \&
yading@10 3716 \& x x x x x
yading@10 3717 \& Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
yading@10 3718 \& Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
yading@10 3719 \& x x x x x
yading@10 3720 \&
yading@10 3721 \& Output frames:
yading@10 3722 \& 2 2 2 1 2
yading@10 3723 \& 2 1 3 2 2
yading@10 3724 .Ve
yading@10 3725 .PP
yading@10 3726 \fIExamples\fR
yading@10 3727 .IX Subsection "Examples"
yading@10 3728 .PP
yading@10 3729 Simple \s-1IVTC\s0 of a top field first telecined stream:
yading@10 3730 .PP
yading@10 3731 .Vb 1
yading@10 3732 \& fieldmatch=order=tff:combmatch=none, decimate
yading@10 3733 .Ve
yading@10 3734 .PP
yading@10 3735 Advanced \s-1IVTC\s0, with fallback on yadif for still combed frames:
yading@10 3736 .PP
yading@10 3737 .Vb 1
yading@10 3738 \& fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
yading@10 3739 .Ve
yading@10 3740 .SS "fieldorder"
yading@10 3741 .IX Subsection "fieldorder"
yading@10 3742 Transform the field order of the input video.
yading@10 3743 .PP
yading@10 3744 This filter accepts the following options:
yading@10 3745 .IP "\fBorder\fR" 4
yading@10 3746 .IX Item "order"
yading@10 3747 Output field order. Valid values are \fItff\fR for top field first or \fIbff\fR
yading@10 3748 for bottom field first.
yading@10 3749 .PP
yading@10 3750 Default value is \fBtff\fR.
yading@10 3751 .PP
yading@10 3752 Transformation is achieved by shifting the picture content up or down
yading@10 3753 by one line, and filling the remaining line with appropriate picture content.
yading@10 3754 This method is consistent with most broadcast field order converters.
yading@10 3755 .PP
yading@10 3756 If the input video is not flagged as being interlaced, or it is already
yading@10 3757 flagged as being of the required output field order then this filter does
yading@10 3758 not alter the incoming video.
yading@10 3759 .PP
yading@10 3760 This filter is very useful when converting to or from \s-1PAL\s0 \s-1DV\s0 material,
yading@10 3761 which is bottom field first.
yading@10 3762 .PP
yading@10 3763 For example:
yading@10 3764 .PP
yading@10 3765 .Vb 1
yading@10 3766 \& ffmpeg \-i in.vob \-vf "fieldorder=bff" out.dv
yading@10 3767 .Ve
yading@10 3768 .SS "fifo"
yading@10 3769 .IX Subsection "fifo"
yading@10 3770 Buffer input images and send them when they are requested.
yading@10 3771 .PP
yading@10 3772 This filter is mainly useful when auto-inserted by the libavfilter
yading@10 3773 framework.
yading@10 3774 .PP
yading@10 3775 The filter does not take parameters.
yading@10 3776 .SS "format"
yading@10 3777 .IX Subsection "format"
yading@10 3778 Convert the input video to one of the specified pixel formats.
yading@10 3779 Libavfilter will try to pick one that is supported for the input to
yading@10 3780 the next filter.
yading@10 3781 .PP
yading@10 3782 This filter accepts the following parameters:
yading@10 3783 .IP "\fBpix_fmts\fR" 4
yading@10 3784 .IX Item "pix_fmts"
yading@10 3785 A '|'\-separated list of pixel format names, for example
yading@10 3786 \&\*(L"pix_fmts=yuv420p|monow|rgb24\*(R".
yading@10 3787 .PP
yading@10 3788 \fIExamples\fR
yading@10 3789 .IX Subsection "Examples"
yading@10 3790 .IP "\(bu" 4
yading@10 3791 Convert the input video to the format \fIyuv420p\fR
yading@10 3792 .Sp
yading@10 3793 .Vb 1
yading@10 3794 \& format=pix_fmts=yuv420p
yading@10 3795 .Ve
yading@10 3796 .Sp
yading@10 3797 Convert the input video to any of the formats in the list
yading@10 3798 .Sp
yading@10 3799 .Vb 1
yading@10 3800 \& format=pix_fmts=yuv420p|yuv444p|yuv410p
yading@10 3801 .Ve
yading@10 3802 .SS "fps"
yading@10 3803 .IX Subsection "fps"
yading@10 3804 Convert the video to specified constant frame rate by duplicating or dropping
yading@10 3805 frames as necessary.
yading@10 3806 .PP
yading@10 3807 This filter accepts the following named parameters:
yading@10 3808 .IP "\fBfps\fR" 4
yading@10 3809 .IX Item "fps"
yading@10 3810 Desired output frame rate. The default is \f(CW25\fR.
yading@10 3811 .IP "\fBround\fR" 4
yading@10 3812 .IX Item "round"
yading@10 3813 Rounding method.
yading@10 3814 .Sp
yading@10 3815 Possible values are:
yading@10 3816 .RS 4
yading@10 3817 .IP "\fBzero\fR" 4
yading@10 3818 .IX Item "zero"
yading@10 3819 zero round towards 0
yading@10 3820 .IP "\fBinf\fR" 4
yading@10 3821 .IX Item "inf"
yading@10 3822 round away from 0
yading@10 3823 .IP "\fBdown\fR" 4
yading@10 3824 .IX Item "down"
yading@10 3825 round towards \-infinity
yading@10 3826 .IP "\fBup\fR" 4
yading@10 3827 .IX Item "up"
yading@10 3828 round towards +infinity
yading@10 3829 .IP "\fBnear\fR" 4
yading@10 3830 .IX Item "near"
yading@10 3831 round to nearest
yading@10 3832 .RE
yading@10 3833 .RS 4
yading@10 3834 .Sp
yading@10 3835 The default is \f(CW\*(C`near\*(C'\fR.
yading@10 3836 .RE
yading@10 3837 .PP
yading@10 3838 Alternatively, the options can be specified as a flat string:
yading@10 3839 \&\fIfps\fR[:\fIround\fR].
yading@10 3840 .PP
yading@10 3841 See also the setpts filter.
yading@10 3842 .SS "framestep"
yading@10 3843 .IX Subsection "framestep"
yading@10 3844 Select one frame every N\-th frame.
yading@10 3845 .PP
yading@10 3846 This filter accepts the following option:
yading@10 3847 .IP "\fBstep\fR" 4
yading@10 3848 .IX Item "step"
yading@10 3849 Select frame after every \f(CW\*(C`step\*(C'\fR frames.
yading@10 3850 Allowed values are positive integers higher than 0. Default value is \f(CW1\fR.
yading@10 3851 .SS "frei0r"
yading@10 3852 .IX Subsection "frei0r"
yading@10 3853 Apply a frei0r effect to the input video.
yading@10 3854 .PP
yading@10 3855 To enable compilation of this filter you need to install the frei0r
yading@10 3856 header and configure FFmpeg with \f(CW\*(C`\-\-enable\-frei0r\*(C'\fR.
yading@10 3857 .PP
yading@10 3858 This filter accepts the following options:
yading@10 3859 .IP "\fBfilter_name\fR" 4
yading@10 3860 .IX Item "filter_name"
yading@10 3861 The name to the frei0r effect to load. If the environment variable
yading@10 3862 \&\fB\s-1FREI0R_PATH\s0\fR is defined, the frei0r effect is searched in each one of the
yading@10 3863 directories specified by the colon separated list in \fB\s-1FREIOR_PATH\s0\fR,
yading@10 3864 otherwise in the standard frei0r paths, which are in this order:
yading@10 3865 \&\fI\s-1HOME/\s0.frei0r\-1/lib/\fR, \fI/usr/local/lib/frei0r\-1/\fR,
yading@10 3866 \&\fI/usr/lib/frei0r\-1/\fR.
yading@10 3867 .IP "\fBfilter_params\fR" 4
yading@10 3868 .IX Item "filter_params"
yading@10 3869 A '|'\-separated list of parameters to pass to the frei0r effect.
yading@10 3870 .PP
yading@10 3871 A frei0r effect parameter can be a boolean (whose values are specified
yading@10 3872 with \*(L"y\*(R" and \*(L"n\*(R"), a double, a color (specified by the syntax
yading@10 3873 \&\fIR\fR/\fIG\fR/\fIB\fR, \fIR\fR, \fIG\fR, and \fIB\fR being float
yading@10 3874 numbers from 0.0 to 1.0) or by an \f(CW\*(C`av_parse_color()\*(C'\fR color
yading@10 3875 description), a position (specified by the syntax \fIX\fR/\fIY\fR,
yading@10 3876 \&\fIX\fR and \fIY\fR being float numbers) and a string.
yading@10 3877 .PP
yading@10 3878 The number and kind of parameters depend on the loaded effect. If an
yading@10 3879 effect parameter is not specified the default value is set.
yading@10 3880 .PP
yading@10 3881 \fIExamples\fR
yading@10 3882 .IX Subsection "Examples"
yading@10 3883 .IP "\(bu" 4
yading@10 3884 Apply the distort0r effect, set the first two double parameters:
yading@10 3885 .Sp
yading@10 3886 .Vb 1
yading@10 3887 \& frei0r=filter_name=distort0r:filter_params=0.5|0.01
yading@10 3888 .Ve
yading@10 3889 .IP "\(bu" 4
yading@10 3890 Apply the colordistance effect, take a color as first parameter:
yading@10 3891 .Sp
yading@10 3892 .Vb 3
yading@10 3893 \& frei0r=colordistance:0.2/0.3/0.4
yading@10 3894 \& frei0r=colordistance:violet
yading@10 3895 \& frei0r=colordistance:0x112233
yading@10 3896 .Ve
yading@10 3897 .IP "\(bu" 4
yading@10 3898 Apply the perspective effect, specify the top left and top right image
yading@10 3899 positions:
yading@10 3900 .Sp
yading@10 3901 .Vb 1
yading@10 3902 \& frei0r=perspective:0.2/0.2|0.8/0.2
yading@10 3903 .Ve
yading@10 3904 .PP
yading@10 3905 For more information see:
yading@10 3906 <\fBhttp://frei0r.dyne.org\fR>
yading@10 3907 .SS "geq"
yading@10 3908 .IX Subsection "geq"
yading@10 3909 The filter accepts the following options:
yading@10 3910 .IP "\fBlum_expr\fR" 4
yading@10 3911 .IX Item "lum_expr"
yading@10 3912 the luminance expression
yading@10 3913 .IP "\fBcb_expr\fR" 4
yading@10 3914 .IX Item "cb_expr"
yading@10 3915 the chrominance blue expression
yading@10 3916 .IP "\fBcr_expr\fR" 4
yading@10 3917 .IX Item "cr_expr"
yading@10 3918 the chrominance red expression
yading@10 3919 .IP "\fBalpha_expr\fR" 4
yading@10 3920 .IX Item "alpha_expr"
yading@10 3921 the alpha expression
yading@10 3922 .PP
yading@10 3923 If one of the chrominance expression is not defined, it falls back on the other
yading@10 3924 one. If no alpha expression is specified it will evaluate to opaque value.
yading@10 3925 If none of chrominance expressions are
yading@10 3926 specified, they will evaluate the luminance expression.
yading@10 3927 .PP
yading@10 3928 The expressions can use the following variables and functions:
yading@10 3929 .IP "\fBN\fR" 4
yading@10 3930 .IX Item "N"
yading@10 3931 The sequential number of the filtered frame, starting from \f(CW0\fR.
yading@10 3932 .IP "\fBX\fR" 4
yading@10 3933 .IX Item "X"
yading@10 3934 .PD 0
yading@10 3935 .IP "\fBY\fR" 4
yading@10 3936 .IX Item "Y"
yading@10 3937 .PD
yading@10 3938 The coordinates of the current sample.
yading@10 3939 .IP "\fBW\fR" 4
yading@10 3940 .IX Item "W"
yading@10 3941 .PD 0
yading@10 3942 .IP "\fBH\fR" 4
yading@10 3943 .IX Item "H"
yading@10 3944 .PD
yading@10 3945 The width and height of the image.
yading@10 3946 .IP "\fB\s-1SW\s0\fR" 4
yading@10 3947 .IX Item "SW"
yading@10 3948 .PD 0
yading@10 3949 .IP "\fB\s-1SH\s0\fR" 4
yading@10 3950 .IX Item "SH"
yading@10 3951 .PD
yading@10 3952 Width and height scale depending on the currently filtered plane. It is the
yading@10 3953 ratio between the corresponding luma plane number of pixels and the current
yading@10 3954 plane ones. E.g. for \s-1YUV4:2:0\s0 the values are \f(CW\*(C`1,1\*(C'\fR for the luma plane, and
yading@10 3955 \&\f(CW\*(C`0.5,0.5\*(C'\fR for chroma planes.
yading@10 3956 .IP "\fBT\fR" 4
yading@10 3957 .IX Item "T"
yading@10 3958 Time of the current frame, expressed in seconds.
yading@10 3959 .IP "\fBp(x, y)\fR" 4
yading@10 3960 .IX Item "p(x, y)"
yading@10 3961 Return the value of the pixel at location (\fIx\fR,\fIy\fR) of the current
yading@10 3962 plane.
yading@10 3963 .IP "\fBlum(x, y)\fR" 4
yading@10 3964 .IX Item "lum(x, y)"
yading@10 3965 Return the value of the pixel at location (\fIx\fR,\fIy\fR) of the luminance
yading@10 3966 plane.
yading@10 3967 .IP "\fBcb(x, y)\fR" 4
yading@10 3968 .IX Item "cb(x, y)"
yading@10 3969 Return the value of the pixel at location (\fIx\fR,\fIy\fR) of the
yading@10 3970 blue-difference chroma plane. Returns 0 if there is no such plane.
yading@10 3971 .IP "\fBcr(x, y)\fR" 4
yading@10 3972 .IX Item "cr(x, y)"
yading@10 3973 Return the value of the pixel at location (\fIx\fR,\fIy\fR) of the
yading@10 3974 red-difference chroma plane. Returns 0 if there is no such plane.
yading@10 3975 .IP "\fBalpha(x, y)\fR" 4
yading@10 3976 .IX Item "alpha(x, y)"
yading@10 3977 Return the value of the pixel at location (\fIx\fR,\fIy\fR) of the alpha
yading@10 3978 plane. Returns 0 if there is no such plane.
yading@10 3979 .PP
yading@10 3980 For functions, if \fIx\fR and \fIy\fR are outside the area, the value will be
yading@10 3981 automatically clipped to the closer edge.
yading@10 3982 .PP
yading@10 3983 \fIExamples\fR
yading@10 3984 .IX Subsection "Examples"
yading@10 3985 .IP "\(bu" 4
yading@10 3986 Flip the image horizontally:
yading@10 3987 .Sp
yading@10 3988 .Vb 1
yading@10 3989 \& geq=p(W\-X\e,Y)
yading@10 3990 .Ve
yading@10 3991 .IP "\(bu" 4
yading@10 3992 Generate a bidimensional sine wave, with angle \f(CW\*(C`PI/3\*(C'\fR and a
yading@10 3993 wavelength of 100 pixels:
yading@10 3994 .Sp
yading@10 3995 .Vb 1
yading@10 3996 \& geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X\-50*T) + sin(PI/3)*Y)):128:128
yading@10 3997 .Ve
yading@10 3998 .IP "\(bu" 4
yading@10 3999 Generate a fancy enigmatic moving light:
yading@10 4000 .Sp
yading@10 4001 .Vb 1
yading@10 4002 \& nullsrc=s=256x256,geq=random(1)/hypot(X\-cos(N*0.07)*W/2\-W/2\e,Y\-sin(N*0.09)*H/2\-H/2)^2*1000000*sin(N*0.02):128:128
yading@10 4003 .Ve
yading@10 4004 .IP "\(bu" 4
yading@10 4005 Generate a quick emboss effect:
yading@10 4006 .Sp
yading@10 4007 .Vb 1
yading@10 4008 \& format=gray,geq=lum_expr=\*(Aq(p(X,Y)+(256\-p(X\-4,Y\-4)))/2\*(Aq
yading@10 4009 .Ve
yading@10 4010 .SS "gradfun"
yading@10 4011 .IX Subsection "gradfun"
yading@10 4012 Fix the banding artifacts that are sometimes introduced into nearly flat
yading@10 4013 regions by truncation to 8bit color depth.
yading@10 4014 Interpolate the gradients that should go where the bands are, and
yading@10 4015 dither them.
yading@10 4016 .PP
yading@10 4017 This filter is designed for playback only. Do not use it prior to
yading@10 4018 lossy compression, because compression tends to lose the dither and
yading@10 4019 bring back the bands.
yading@10 4020 .PP
yading@10 4021 This filter accepts the following options:
yading@10 4022 .IP "\fBstrength\fR" 4
yading@10 4023 .IX Item "strength"
yading@10 4024 The maximum amount by which the filter will change any one pixel. Also the
yading@10 4025 threshold for detecting nearly flat regions. Acceptable values range from .51 to
yading@10 4026 64, default value is 1.2, out-of-range values will be clipped to the valid
yading@10 4027 range.
yading@10 4028 .IP "\fBradius\fR" 4
yading@10 4029 .IX Item "radius"
yading@10 4030 The neighborhood to fit the gradient to. A larger radius makes for smoother
yading@10 4031 gradients, but also prevents the filter from modifying the pixels near detailed
yading@10 4032 regions. Acceptable values are 8\-32, default value is 16, out-of-range values
yading@10 4033 will be clipped to the valid range.
yading@10 4034 .PP
yading@10 4035 Alternatively, the options can be specified as a flat string:
yading@10 4036 \&\fIstrength\fR[:\fIradius\fR]
yading@10 4037 .PP
yading@10 4038 \fIExamples\fR
yading@10 4039 .IX Subsection "Examples"
yading@10 4040 .IP "\(bu" 4
yading@10 4041 Apply the filter with a \f(CW3.5\fR strength and radius of \f(CW8\fR:
yading@10 4042 .Sp
yading@10 4043 .Vb 1
yading@10 4044 \& gradfun=3.5:8
yading@10 4045 .Ve
yading@10 4046 .IP "\(bu" 4
yading@10 4047 Specify radius, omitting the strength (which will fall-back to the default
yading@10 4048 value):
yading@10 4049 .Sp
yading@10 4050 .Vb 1
yading@10 4051 \& gradfun=radius=8
yading@10 4052 .Ve
yading@10 4053 .SS "hflip"
yading@10 4054 .IX Subsection "hflip"
yading@10 4055 Flip the input video horizontally.
yading@10 4056 .PP
yading@10 4057 For example to horizontally flip the input video with \fBffmpeg\fR:
yading@10 4058 .PP
yading@10 4059 .Vb 1
yading@10 4060 \& ffmpeg \-i in.avi \-vf "hflip" out.avi
yading@10 4061 .Ve
yading@10 4062 .SS "histeq"
yading@10 4063 .IX Subsection "histeq"
yading@10 4064 This filter applies a global color histogram equalization on a
yading@10 4065 per-frame basis.
yading@10 4066 .PP
yading@10 4067 It can be used to correct video that has a compressed range of pixel
yading@10 4068 intensities. The filter redistributes the pixel intensities to
yading@10 4069 equalize their distribution across the intensity range. It may be
yading@10 4070 viewed as an \*(L"automatically adjusting contrast filter\*(R". This filter is
yading@10 4071 useful only for correcting degraded or poorly captured source
yading@10 4072 video.
yading@10 4073 .PP
yading@10 4074 The filter accepts the following options:
yading@10 4075 .IP "\fBstrength\fR" 4
yading@10 4076 .IX Item "strength"
yading@10 4077 Determine the amount of equalization to be applied. As the strength
yading@10 4078 is reduced, the distribution of pixel intensities more-and-more
yading@10 4079 approaches that of the input frame. The value must be a float number
yading@10 4080 in the range [0,1] and defaults to 0.200.
yading@10 4081 .IP "\fBintensity\fR" 4
yading@10 4082 .IX Item "intensity"
yading@10 4083 Set the maximum intensity that can generated and scale the output
yading@10 4084 values appropriately. The strength should be set as desired and then
yading@10 4085 the intensity can be limited if needed to avoid washing-out. The value
yading@10 4086 must be a float number in the range [0,1] and defaults to 0.210.
yading@10 4087 .IP "\fBantibanding\fR" 4
yading@10 4088 .IX Item "antibanding"
yading@10 4089 Set the antibanding level. If enabled the filter will randomly vary
yading@10 4090 the luminance of output pixels by a small amount to avoid banding of
yading@10 4091 the histogram. Possible values are \f(CW\*(C`none\*(C'\fR, \f(CW\*(C`weak\*(C'\fR or
yading@10 4092 \&\f(CW\*(C`strong\*(C'\fR. It defaults to \f(CW\*(C`none\*(C'\fR.
yading@10 4093 .SS "histogram"
yading@10 4094 .IX Subsection "histogram"
yading@10 4095 Compute and draw a color distribution histogram for the input video.
yading@10 4096 .PP
yading@10 4097 The computed histogram is a representation of distribution of color components
yading@10 4098 in an image.
yading@10 4099 .PP
yading@10 4100 The filter accepts the following options:
yading@10 4101 .IP "\fBmode\fR" 4
yading@10 4102 .IX Item "mode"
yading@10 4103 Set histogram mode.
yading@10 4104 .Sp
yading@10 4105 It accepts the following values:
yading@10 4106 .RS 4
yading@10 4107 .IP "\fBlevels\fR" 4
yading@10 4108 .IX Item "levels"
yading@10 4109 standard histogram that display color components distribution in an image.
yading@10 4110 Displays color graph for each color component. Shows distribution
yading@10 4111 of the Y, U, V, A or G, B, R components, depending on input format,
yading@10 4112 in current frame. Bellow each graph is color component scale meter.
yading@10 4113 .IP "\fBcolor\fR" 4
yading@10 4114 .IX Item "color"
yading@10 4115 chroma values in vectorscope, if brighter more such chroma values are
yading@10 4116 distributed in an image.
yading@10 4117 Displays chroma values (U/V color placement) in two dimensional graph
yading@10 4118 (which is called a vectorscope). It can be used to read of the hue and
yading@10 4119 saturation of the current frame. At a same time it is a histogram.
yading@10 4120 The whiter a pixel in the vectorscope, the more pixels of the input frame
yading@10 4121 correspond to that pixel (that is the more pixels have this chroma value).
yading@10 4122 The V component is displayed on the horizontal (X) axis, with the leftmost
yading@10 4123 side being V = 0 and the rightmost side being V = 255.
yading@10 4124 The U component is displayed on the vertical (Y) axis, with the top
yading@10 4125 representing U = 0 and the bottom representing U = 255.
yading@10 4126 .Sp
yading@10 4127 The position of a white pixel in the graph corresponds to the chroma value
yading@10 4128 of a pixel of the input clip. So the graph can be used to read of the
yading@10 4129 hue (color flavor) and the saturation (the dominance of the hue in the color).
yading@10 4130 As the hue of a color changes, it moves around the square. At the center of
yading@10 4131 the square, the saturation is zero, which means that the corresponding pixel
yading@10 4132 has no color. If you increase the amount of a specific color, while leaving
yading@10 4133 the other colors unchanged, the saturation increases, and you move towards
yading@10 4134 the edge of the square.
yading@10 4135 .IP "\fBcolor2\fR" 4
yading@10 4136 .IX Item "color2"
yading@10 4137 chroma values in vectorscope, similar as \f(CW\*(C`color\*(C'\fR but actual chroma values
yading@10 4138 are displayed.
yading@10 4139 .IP "\fBwaveform\fR" 4
yading@10 4140 .IX Item "waveform"
yading@10 4141 per row/column color component graph. In row mode graph in the left side represents
yading@10 4142 color component value 0 and right side represents value = 255. In column mode top
yading@10 4143 side represents color component value = 0 and bottom side represents value = 255.
yading@10 4144 .RE
yading@10 4145 .RS 4
yading@10 4146 .Sp
yading@10 4147 Default value is \f(CW\*(C`levels\*(C'\fR.
yading@10 4148 .RE
yading@10 4149 .IP "\fBlevel_height\fR" 4
yading@10 4150 .IX Item "level_height"
yading@10 4151 Set height of level in \f(CW\*(C`levels\*(C'\fR. Default value is \f(CW200\fR.
yading@10 4152 Allowed range is [50, 2048].
yading@10 4153 .IP "\fBscale_height\fR" 4
yading@10 4154 .IX Item "scale_height"
yading@10 4155 Set height of color scale in \f(CW\*(C`levels\*(C'\fR. Default value is \f(CW12\fR.
yading@10 4156 Allowed range is [0, 40].
yading@10 4157 .IP "\fBstep\fR" 4
yading@10 4158 .IX Item "step"
yading@10 4159 Set step for \f(CW\*(C`waveform\*(C'\fR mode. Smaller values are useful to find out how much
yading@10 4160 of same luminance values across input rows/columns are distributed.
yading@10 4161 Default value is \f(CW10\fR. Allowed range is [1, 255].
yading@10 4162 .IP "\fBwaveform_mode\fR" 4
yading@10 4163 .IX Item "waveform_mode"
yading@10 4164 Set mode for \f(CW\*(C`waveform\*(C'\fR. Can be either \f(CW\*(C`row\*(C'\fR, or \f(CW\*(C`column\*(C'\fR.
yading@10 4165 Default is \f(CW\*(C`row\*(C'\fR.
yading@10 4166 .IP "\fBdisplay_mode\fR" 4
yading@10 4167 .IX Item "display_mode"
yading@10 4168 Set display mode for \f(CW\*(C`waveform\*(C'\fR and \f(CW\*(C`levels\*(C'\fR.
yading@10 4169 It accepts the following values:
yading@10 4170 .RS 4
yading@10 4171 .IP "\fBparade\fR" 4
yading@10 4172 .IX Item "parade"
yading@10 4173 Display separate graph for the color components side by side in
yading@10 4174 \&\f(CW\*(C`row\*(C'\fR waveform mode or one below other in \f(CW\*(C`column\*(C'\fR waveform mode
yading@10 4175 for \f(CW\*(C`waveform\*(C'\fR histogram mode. For \f(CW\*(C`levels\*(C'\fR histogram mode
yading@10 4176 per color component graphs are placed one bellow other.
yading@10 4177 .Sp
yading@10 4178 This display mode in \f(CW\*(C`waveform\*(C'\fR histogram mode makes it easy to spot
yading@10 4179 color casts in the highlights and shadows of an image, by comparing the
yading@10 4180 contours of the top and the bottom of each waveform.
yading@10 4181 Since whites, grays, and blacks are characterized by
yading@10 4182 exactly equal amounts of red, green, and blue, neutral areas of the
yading@10 4183 picture should display three waveforms of roughly equal width/height.
yading@10 4184 If not, the correction is easy to make by making adjustments to level the
yading@10 4185 three waveforms.
yading@10 4186 .IP "\fBoverlay\fR" 4
yading@10 4187 .IX Item "overlay"
yading@10 4188 Presents information that's identical to that in the \f(CW\*(C`parade\*(C'\fR, except
yading@10 4189 that the graphs representing color components are superimposed directly
yading@10 4190 over one another.
yading@10 4191 .Sp
yading@10 4192 This display mode in \f(CW\*(C`waveform\*(C'\fR histogram mode can make it easier to spot
yading@10 4193 the relative differences or similarities in overlapping areas of the color
yading@10 4194 components that are supposed to be identical, such as neutral whites, grays,
yading@10 4195 or blacks.
yading@10 4196 .RE
yading@10 4197 .RS 4
yading@10 4198 .Sp
yading@10 4199 Default is \f(CW\*(C`parade\*(C'\fR.
yading@10 4200 .RE
yading@10 4201 .PP
yading@10 4202 \fIExamples\fR
yading@10 4203 .IX Subsection "Examples"
yading@10 4204 .IP "\(bu" 4
yading@10 4205 Calculate and draw histogram:
yading@10 4206 .Sp
yading@10 4207 .Vb 1
yading@10 4208 \& ffplay \-i input \-vf histogram
yading@10 4209 .Ve
yading@10 4210 .SS "hqdn3d"
yading@10 4211 .IX Subsection "hqdn3d"
yading@10 4212 High precision/quality 3d denoise filter. This filter aims to reduce
yading@10 4213 image noise producing smooth images and making still images really
yading@10 4214 still. It should enhance compressibility.
yading@10 4215 .PP
yading@10 4216 It accepts the following optional parameters:
yading@10 4217 .IP "\fBluma_spatial\fR" 4
yading@10 4218 .IX Item "luma_spatial"
yading@10 4219 a non-negative float number which specifies spatial luma strength,
yading@10 4220 defaults to 4.0
yading@10 4221 .IP "\fBchroma_spatial\fR" 4
yading@10 4222 .IX Item "chroma_spatial"
yading@10 4223 a non-negative float number which specifies spatial chroma strength,
yading@10 4224 defaults to 3.0*\fIluma_spatial\fR/4.0
yading@10 4225 .IP "\fBluma_tmp\fR" 4
yading@10 4226 .IX Item "luma_tmp"
yading@10 4227 a float number which specifies luma temporal strength, defaults to
yading@10 4228 6.0*\fIluma_spatial\fR/4.0
yading@10 4229 .IP "\fBchroma_tmp\fR" 4
yading@10 4230 .IX Item "chroma_tmp"
yading@10 4231 a float number which specifies chroma temporal strength, defaults to
yading@10 4232 \&\fIluma_tmp\fR*\fIchroma_spatial\fR/\fIluma_spatial\fR
yading@10 4233 .SS "hue"
yading@10 4234 .IX Subsection "hue"
yading@10 4235 Modify the hue and/or the saturation of the input.
yading@10 4236 .PP
yading@10 4237 This filter accepts the following options:
yading@10 4238 .IP "\fBh\fR" 4
yading@10 4239 .IX Item "h"
yading@10 4240 Specify the hue angle as a number of degrees. It accepts an expression,
yading@10 4241 and defaults to \*(L"0\*(R".
yading@10 4242 .IP "\fBs\fR" 4
yading@10 4243 .IX Item "s"
yading@10 4244 Specify the saturation in the [\-10,10] range. It accepts a float number and
yading@10 4245 defaults to \*(L"1\*(R".
yading@10 4246 .IP "\fBH\fR" 4
yading@10 4247 .IX Item "H"
yading@10 4248 Specify the hue angle as a number of radians. It accepts a float
yading@10 4249 number or an expression, and defaults to \*(L"0\*(R".
yading@10 4250 .PP
yading@10 4251 \&\fBh\fR and \fBH\fR are mutually exclusive, and can't be
yading@10 4252 specified at the same time.
yading@10 4253 .PP
yading@10 4254 The \fBh\fR, \fBH\fR and \fBs\fR option values are
yading@10 4255 expressions containing the following constants:
yading@10 4256 .IP "\fBn\fR" 4
yading@10 4257 .IX Item "n"
yading@10 4258 frame count of the input frame starting from 0
yading@10 4259 .IP "\fBpts\fR" 4
yading@10 4260 .IX Item "pts"
yading@10 4261 presentation timestamp of the input frame expressed in time base units
yading@10 4262 .IP "\fBr\fR" 4
yading@10 4263 .IX Item "r"
yading@10 4264 frame rate of the input video, \s-1NAN\s0 if the input frame rate is unknown
yading@10 4265 .IP "\fBt\fR" 4
yading@10 4266 .IX Item "t"
yading@10 4267 timestamp expressed in seconds, \s-1NAN\s0 if the input timestamp is unknown
yading@10 4268 .IP "\fBtb\fR" 4
yading@10 4269 .IX Item "tb"
yading@10 4270 time base of the input video
yading@10 4271 .PP
yading@10 4272 \fIExamples\fR
yading@10 4273 .IX Subsection "Examples"
yading@10 4274 .IP "\(bu" 4
yading@10 4275 Set the hue to 90 degrees and the saturation to 1.0:
yading@10 4276 .Sp
yading@10 4277 .Vb 1
yading@10 4278 \& hue=h=90:s=1
yading@10 4279 .Ve
yading@10 4280 .IP "\(bu" 4
yading@10 4281 Same command but expressing the hue in radians:
yading@10 4282 .Sp
yading@10 4283 .Vb 1
yading@10 4284 \& hue=H=PI/2:s=1
yading@10 4285 .Ve
yading@10 4286 .IP "\(bu" 4
yading@10 4287 Rotate hue and make the saturation swing between 0
yading@10 4288 and 2 over a period of 1 second:
yading@10 4289 .Sp
yading@10 4290 .Vb 1
yading@10 4291 \& hue="H=2*PI*t: s=sin(2*PI*t)+1"
yading@10 4292 .Ve
yading@10 4293 .IP "\(bu" 4
yading@10 4294 Apply a 3 seconds saturation fade-in effect starting at 0:
yading@10 4295 .Sp
yading@10 4296 .Vb 1
yading@10 4297 \& hue="s=min(t/3\e,1)"
yading@10 4298 .Ve
yading@10 4299 .Sp
yading@10 4300 The general fade-in expression can be written as:
yading@10 4301 .Sp
yading@10 4302 .Vb 1
yading@10 4303 \& hue="s=min(0\e, max((t\-START)/DURATION\e, 1))"
yading@10 4304 .Ve
yading@10 4305 .IP "\(bu" 4
yading@10 4306 Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
yading@10 4307 .Sp
yading@10 4308 .Vb 1
yading@10 4309 \& hue="s=max(0\e, min(1\e, (8\-t)/3))"
yading@10 4310 .Ve
yading@10 4311 .Sp
yading@10 4312 The general fade-out expression can be written as:
yading@10 4313 .Sp
yading@10 4314 .Vb 1
yading@10 4315 \& hue="s=max(0\e, min(1\e, (START+DURATION\-t)/DURATION))"
yading@10 4316 .Ve
yading@10 4317 .PP
yading@10 4318 \fICommands\fR
yading@10 4319 .IX Subsection "Commands"
yading@10 4320 .PP
yading@10 4321 This filter supports the following commands:
yading@10 4322 .IP "\fBs\fR" 4
yading@10 4323 .IX Item "s"
yading@10 4324 .PD 0
yading@10 4325 .IP "\fBh\fR" 4
yading@10 4326 .IX Item "h"
yading@10 4327 .IP "\fBH\fR" 4
yading@10 4328 .IX Item "H"
yading@10 4329 .PD
yading@10 4330 Modify the hue and/or the saturation of the input video.
yading@10 4331 The command accepts the same syntax of the corresponding option.
yading@10 4332 .Sp
yading@10 4333 If the specified expression is not valid, it is kept at its current
yading@10 4334 value.
yading@10 4335 .SS "idet"
yading@10 4336 .IX Subsection "idet"
yading@10 4337 Detect video interlacing type.
yading@10 4338 .PP
yading@10 4339 This filter tries to detect if the input is interlaced or progressive,
yading@10 4340 top or bottom field first.
yading@10 4341 .PP
yading@10 4342 The filter accepts the following options:
yading@10 4343 .IP "\fBintl_thres\fR" 4
yading@10 4344 .IX Item "intl_thres"
yading@10 4345 Set interlacing threshold.
yading@10 4346 .IP "\fBprog_thres\fR" 4
yading@10 4347 .IX Item "prog_thres"
yading@10 4348 Set progressive threshold.
yading@10 4349 .SS "il"
yading@10 4350 .IX Subsection "il"
yading@10 4351 Deinterleave or interleave fields.
yading@10 4352 .PP
yading@10 4353 This filter allows to process interlaced images fields without
yading@10 4354 deinterlacing them. Deinterleaving splits the input frame into 2
yading@10 4355 fields (so called half pictures). Odd lines are moved to the top
yading@10 4356 half of the output image, even lines to the bottom half.
yading@10 4357 You can process (filter) them independently and then re-interleave them.
yading@10 4358 .PP
yading@10 4359 The filter accepts the following options:
yading@10 4360 .IP "\fBluma_mode, l\fR" 4
yading@10 4361 .IX Item "luma_mode, l"
yading@10 4362 .PD 0
yading@10 4363 .IP "\fBchroma_mode, s\fR" 4
yading@10 4364 .IX Item "chroma_mode, s"
yading@10 4365 .IP "\fBalpha_mode, a\fR" 4
yading@10 4366 .IX Item "alpha_mode, a"
yading@10 4367 .PD
yading@10 4368 Available values for \fIluma_mode\fR, \fIchroma_mode\fR and
yading@10 4369 \&\fIalpha_mode\fR are:
yading@10 4370 .RS 4
yading@10 4371 .IP "\fBnone\fR" 4
yading@10 4372 .IX Item "none"
yading@10 4373 Do nothing.
yading@10 4374 .IP "\fBdeinterleave, d\fR" 4
yading@10 4375 .IX Item "deinterleave, d"
yading@10 4376 Deinterleave fields, placing one above the other.
yading@10 4377 .IP "\fBinterleave, i\fR" 4
yading@10 4378 .IX Item "interleave, i"
yading@10 4379 Interleave fields. Reverse the effect of deinterleaving.
yading@10 4380 .RE
yading@10 4381 .RS 4
yading@10 4382 .Sp
yading@10 4383 Default value is \f(CW\*(C`none\*(C'\fR.
yading@10 4384 .RE
yading@10 4385 .IP "\fBluma_swap, ls\fR" 4
yading@10 4386 .IX Item "luma_swap, ls"
yading@10 4387 .PD 0
yading@10 4388 .IP "\fBchroma_swap, cs\fR" 4
yading@10 4389 .IX Item "chroma_swap, cs"
yading@10 4390 .IP "\fBalpha_swap, as\fR" 4
yading@10 4391 .IX Item "alpha_swap, as"
yading@10 4392 .PD
yading@10 4393 Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is \f(CW0\fR.
yading@10 4394 .SS "interlace"
yading@10 4395 .IX Subsection "interlace"
yading@10 4396 Simple interlacing filter from progressive contents. This interleaves upper (or
yading@10 4397 lower) lines from odd frames with lower (or upper) lines from even frames,
yading@10 4398 halving the frame rate and preserving image height.
yading@10 4399 .PP
yading@10 4400 .Vb 9
yading@10 4401 \& Original Original New Frame
yading@10 4402 \& Frame \*(Aqj\*(Aq Frame \*(Aqj+1\*(Aq (tff)
yading@10 4403 \& ========== =========== ==================
yading@10 4404 \& Line 0 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-> Frame \*(Aqj\*(Aq Line 0
yading@10 4405 \& Line 1 Line 1 \-\-\-\-> Frame \*(Aqj+1\*(Aq Line 1
yading@10 4406 \& Line 2 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-> Frame \*(Aqj\*(Aq Line 2
yading@10 4407 \& Line 3 Line 3 \-\-\-\-> Frame \*(Aqj+1\*(Aq Line 3
yading@10 4408 \& ... ... ...
yading@10 4409 \& New Frame + 1 will be generated by Frame \*(Aqj+2\*(Aq and Frame \*(Aqj+3\*(Aq and so on
yading@10 4410 .Ve
yading@10 4411 .PP
yading@10 4412 It accepts the following optional parameters:
yading@10 4413 .IP "\fBscan\fR" 4
yading@10 4414 .IX Item "scan"
yading@10 4415 determines whether the interlaced frame is taken from the even (tff \- default)
yading@10 4416 or odd (bff) lines of the progressive frame.
yading@10 4417 .IP "\fBlowpass\fR" 4
yading@10 4418 .IX Item "lowpass"
yading@10 4419 Enable (default) or disable the vertical lowpass filter to avoid twitter
yading@10 4420 interlacing and reduce moire patterns.
yading@10 4421 .SS "kerndeint"
yading@10 4422 .IX Subsection "kerndeint"
yading@10 4423 Deinterlace input video by applying Donald Graft's adaptive kernel
yading@10 4424 deinterling. Work on interlaced parts of a video to produce
yading@10 4425 progressive frames.
yading@10 4426 .PP
yading@10 4427 The description of the accepted parameters follows.
yading@10 4428 .IP "\fBthresh\fR" 4
yading@10 4429 .IX Item "thresh"
yading@10 4430 Set the threshold which affects the filter's tolerance when
yading@10 4431 determining if a pixel line must be processed. It must be an integer
yading@10 4432 in the range [0,255] and defaults to 10. A value of 0 will result in
yading@10 4433 applying the process on every pixels.
yading@10 4434 .IP "\fBmap\fR" 4
yading@10 4435 .IX Item "map"
yading@10 4436 Paint pixels exceeding the threshold value to white if set to 1.
yading@10 4437 Default is 0.
yading@10 4438 .IP "\fBorder\fR" 4
yading@10 4439 .IX Item "order"
yading@10 4440 Set the fields order. Swap fields if set to 1, leave fields alone if
yading@10 4441 0. Default is 0.
yading@10 4442 .IP "\fBsharp\fR" 4
yading@10 4443 .IX Item "sharp"
yading@10 4444 Enable additional sharpening if set to 1. Default is 0.
yading@10 4445 .IP "\fBtwoway\fR" 4
yading@10 4446 .IX Item "twoway"
yading@10 4447 Enable twoway sharpening if set to 1. Default is 0.
yading@10 4448 .PP
yading@10 4449 \fIExamples\fR
yading@10 4450 .IX Subsection "Examples"
yading@10 4451 .IP "\(bu" 4
yading@10 4452 Apply default values:
yading@10 4453 .Sp
yading@10 4454 .Vb 1
yading@10 4455 \& kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
yading@10 4456 .Ve
yading@10 4457 .IP "\(bu" 4
yading@10 4458 Enable additional sharpening:
yading@10 4459 .Sp
yading@10 4460 .Vb 1
yading@10 4461 \& kerndeint=sharp=1
yading@10 4462 .Ve
yading@10 4463 .IP "\(bu" 4
yading@10 4464 Paint processed pixels in white:
yading@10 4465 .Sp
yading@10 4466 .Vb 1
yading@10 4467 \& kerndeint=map=1
yading@10 4468 .Ve
yading@10 4469 .SS "lut, lutrgb, lutyuv"
yading@10 4470 .IX Subsection "lut, lutrgb, lutyuv"
yading@10 4471 Compute a look-up table for binding each pixel component input value
yading@10 4472 to an output value, and apply it to input video.
yading@10 4473 .PP
yading@10 4474 \&\fIlutyuv\fR applies a lookup table to a \s-1YUV\s0 input video, \fIlutrgb\fR
yading@10 4475 to an \s-1RGB\s0 input video.
yading@10 4476 .PP
yading@10 4477 These filters accept the following options:
yading@10 4478 .IP "\fBc0\fR" 4
yading@10 4479 .IX Item "c0"
yading@10 4480 set first pixel component expression
yading@10 4481 .IP "\fBc1\fR" 4
yading@10 4482 .IX Item "c1"
yading@10 4483 set second pixel component expression
yading@10 4484 .IP "\fBc2\fR" 4
yading@10 4485 .IX Item "c2"
yading@10 4486 set third pixel component expression
yading@10 4487 .IP "\fBc3\fR" 4
yading@10 4488 .IX Item "c3"
yading@10 4489 set fourth pixel component expression, corresponds to the alpha component
yading@10 4490 .IP "\fBr\fR" 4
yading@10 4491 .IX Item "r"
yading@10 4492 set red component expression
yading@10 4493 .IP "\fBg\fR" 4
yading@10 4494 .IX Item "g"
yading@10 4495 set green component expression
yading@10 4496 .IP "\fBb\fR" 4
yading@10 4497 .IX Item "b"
yading@10 4498 set blue component expression
yading@10 4499 .IP "\fBa\fR" 4
yading@10 4500 .IX Item "a"
yading@10 4501 alpha component expression
yading@10 4502 .IP "\fBy\fR" 4
yading@10 4503 .IX Item "y"
yading@10 4504 set Y/luminance component expression
yading@10 4505 .IP "\fBu\fR" 4
yading@10 4506 .IX Item "u"
yading@10 4507 set U/Cb component expression
yading@10 4508 .IP "\fBv\fR" 4
yading@10 4509 .IX Item "v"
yading@10 4510 set V/Cr component expression
yading@10 4511 .PP
yading@10 4512 Each of them specifies the expression to use for computing the lookup table for
yading@10 4513 the corresponding pixel component values.
yading@10 4514 .PP
yading@10 4515 The exact component associated to each of the \fIc*\fR options depends on the
yading@10 4516 format in input.
yading@10 4517 .PP
yading@10 4518 The \fIlut\fR filter requires either \s-1YUV\s0 or \s-1RGB\s0 pixel formats in input,
yading@10 4519 \&\fIlutrgb\fR requires \s-1RGB\s0 pixel formats in input, and \fIlutyuv\fR requires \s-1YUV\s0.
yading@10 4520 .PP
yading@10 4521 The expressions can contain the following constants and functions:
yading@10 4522 .IP "\fBw, h\fR" 4
yading@10 4523 .IX Item "w, h"
yading@10 4524 the input width and height
yading@10 4525 .IP "\fBval\fR" 4
yading@10 4526 .IX Item "val"
yading@10 4527 input value for the pixel component
yading@10 4528 .IP "\fBclipval\fR" 4
yading@10 4529 .IX Item "clipval"
yading@10 4530 the input value clipped in the \fIminval\fR\-\fImaxval\fR range
yading@10 4531 .IP "\fBmaxval\fR" 4
yading@10 4532 .IX Item "maxval"
yading@10 4533 maximum value for the pixel component
yading@10 4534 .IP "\fBminval\fR" 4
yading@10 4535 .IX Item "minval"
yading@10 4536 minimum value for the pixel component
yading@10 4537 .IP "\fBnegval\fR" 4
yading@10 4538 .IX Item "negval"
yading@10 4539 the negated value for the pixel component value clipped in the
yading@10 4540 \&\fIminval\fR\-\fImaxval\fR range , it corresponds to the expression
yading@10 4541 \&\*(L"maxval\-clipval+minval\*(R"
yading@10 4542 .IP "\fBclip(val)\fR" 4
yading@10 4543 .IX Item "clip(val)"
yading@10 4544 the computed value in \fIval\fR clipped in the
yading@10 4545 \&\fIminval\fR\-\fImaxval\fR range
yading@10 4546 .IP "\fBgammaval(gamma)\fR" 4
yading@10 4547 .IX Item "gammaval(gamma)"
yading@10 4548 the computed gamma correction value of the pixel component value
yading@10 4549 clipped in the \fIminval\fR\-\fImaxval\fR range, corresponds to the
yading@10 4550 expression
yading@10 4551 "pow((clipval\-minval)/(maxval\-minval)\e,\fIgamma\fR)*(maxval\-minval)+minval"
yading@10 4552 .PP
yading@10 4553 All expressions default to \*(L"val\*(R".
yading@10 4554 .PP
yading@10 4555 \fIExamples\fR
yading@10 4556 .IX Subsection "Examples"
yading@10 4557 .IP "\(bu" 4
yading@10 4558 Negate input video:
yading@10 4559 .Sp
yading@10 4560 .Vb 2
yading@10 4561 \& lutrgb="r=maxval+minval\-val:g=maxval+minval\-val:b=maxval+minval\-val"
yading@10 4562 \& lutyuv="y=maxval+minval\-val:u=maxval+minval\-val:v=maxval+minval\-val"
yading@10 4563 .Ve
yading@10 4564 .Sp
yading@10 4565 The above is the same as:
yading@10 4566 .Sp
yading@10 4567 .Vb 2
yading@10 4568 \& lutrgb="r=negval:g=negval:b=negval"
yading@10 4569 \& lutyuv="y=negval:u=negval:v=negval"
yading@10 4570 .Ve
yading@10 4571 .IP "\(bu" 4
yading@10 4572 Negate luminance:
yading@10 4573 .Sp
yading@10 4574 .Vb 1
yading@10 4575 \& lutyuv=y=negval
yading@10 4576 .Ve
yading@10 4577 .IP "\(bu" 4
yading@10 4578 Remove chroma components, turns the video into a graytone image:
yading@10 4579 .Sp
yading@10 4580 .Vb 1
yading@10 4581 \& lutyuv="u=128:v=128"
yading@10 4582 .Ve
yading@10 4583 .IP "\(bu" 4
yading@10 4584 Apply a luma burning effect:
yading@10 4585 .Sp
yading@10 4586 .Vb 1
yading@10 4587 \& lutyuv="y=2*val"
yading@10 4588 .Ve
yading@10 4589 .IP "\(bu" 4
yading@10 4590 Remove green and blue components:
yading@10 4591 .Sp
yading@10 4592 .Vb 1
yading@10 4593 \& lutrgb="g=0:b=0"
yading@10 4594 .Ve
yading@10 4595 .IP "\(bu" 4
yading@10 4596 Set a constant alpha channel value on input:
yading@10 4597 .Sp
yading@10 4598 .Vb 1
yading@10 4599 \& format=rgba,lutrgb=a="maxval\-minval/2"
yading@10 4600 .Ve
yading@10 4601 .IP "\(bu" 4
yading@10 4602 Correct luminance gamma by a 0.5 factor:
yading@10 4603 .Sp
yading@10 4604 .Vb 1
yading@10 4605 \& lutyuv=y=gammaval(0.5)
yading@10 4606 .Ve
yading@10 4607 .IP "\(bu" 4
yading@10 4608 Discard least significant bits of luma:
yading@10 4609 .Sp
yading@10 4610 .Vb 1
yading@10 4611 \& lutyuv=y=\*(Aqbitand(val, 128+64+32)\*(Aq
yading@10 4612 .Ve
yading@10 4613 .SS "mp"
yading@10 4614 .IX Subsection "mp"
yading@10 4615 Apply an MPlayer filter to the input video.
yading@10 4616 .PP
yading@10 4617 This filter provides a wrapper around most of the filters of
yading@10 4618 MPlayer/MEncoder.
yading@10 4619 .PP
yading@10 4620 This wrapper is considered experimental. Some of the wrapped filters
yading@10 4621 may not work properly and we may drop support for them, as they will
yading@10 4622 be implemented natively into FFmpeg. Thus you should avoid
yading@10 4623 depending on them when writing portable scripts.
yading@10 4624 .PP
yading@10 4625 The filters accepts the parameters:
yading@10 4626 \&\fIfilter_name\fR[:=]\fIfilter_params\fR
yading@10 4627 .PP
yading@10 4628 \&\fIfilter_name\fR is the name of a supported MPlayer filter,
yading@10 4629 \&\fIfilter_params\fR is a string containing the parameters accepted by
yading@10 4630 the named filter.
yading@10 4631 .PP
yading@10 4632 The list of the currently supported filters follows:
yading@10 4633 .IP "\fIdint\fR" 4
yading@10 4634 .IX Item "dint"
yading@10 4635 .PD 0
yading@10 4636 .IP "\fIdown3dright\fR" 4
yading@10 4637 .IX Item "down3dright"
yading@10 4638 .IP "\fIeq2\fR" 4
yading@10 4639 .IX Item "eq2"
yading@10 4640 .IP "\fIeq\fR" 4
yading@10 4641 .IX Item "eq"
yading@10 4642 .IP "\fIfil\fR" 4
yading@10 4643 .IX Item "fil"
yading@10 4644 .IP "\fIfspp\fR" 4
yading@10 4645 .IX Item "fspp"
yading@10 4646 .IP "\fIilpack\fR" 4
yading@10 4647 .IX Item "ilpack"
yading@10 4648 .IP "\fImcdeint\fR" 4
yading@10 4649 .IX Item "mcdeint"
yading@10 4650 .IP "\fIow\fR" 4
yading@10 4651 .IX Item "ow"
yading@10 4652 .IP "\fIperspective\fR" 4
yading@10 4653 .IX Item "perspective"
yading@10 4654 .IP "\fIphase\fR" 4
yading@10 4655 .IX Item "phase"
yading@10 4656 .IP "\fIpp7\fR" 4
yading@10 4657 .IX Item "pp7"
yading@10 4658 .IP "\fIpullup\fR" 4
yading@10 4659 .IX Item "pullup"
yading@10 4660 .IP "\fIqp\fR" 4
yading@10 4661 .IX Item "qp"
yading@10 4662 .IP "\fIsab\fR" 4
yading@10 4663 .IX Item "sab"
yading@10 4664 .IP "\fIsoftpulldown\fR" 4
yading@10 4665 .IX Item "softpulldown"
yading@10 4666 .IP "\fIspp\fR" 4
yading@10 4667 .IX Item "spp"
yading@10 4668 .IP "\fItinterlace\fR" 4
yading@10 4669 .IX Item "tinterlace"
yading@10 4670 .IP "\fIuspp\fR" 4
yading@10 4671 .IX Item "uspp"
yading@10 4672 .PD
yading@10 4673 .PP
yading@10 4674 The parameter syntax and behavior for the listed filters are the same
yading@10 4675 of the corresponding MPlayer filters. For detailed instructions check
yading@10 4676 the \*(L"\s-1VIDEO\s0 \s-1FILTERS\s0\*(R" section in the MPlayer manual.
yading@10 4677 .PP
yading@10 4678 \fIExamples\fR
yading@10 4679 .IX Subsection "Examples"
yading@10 4680 .IP "\(bu" 4
yading@10 4681 Adjust gamma, brightness, contrast:
yading@10 4682 .Sp
yading@10 4683 .Vb 1
yading@10 4684 \& mp=eq2=1.0:2:0.5
yading@10 4685 .Ve
yading@10 4686 .PP
yading@10 4687 See also \fImplayer\fR\|(1), <\fBhttp://www.mplayerhq.hu/\fR>.
yading@10 4688 .SS "mpdecimate"
yading@10 4689 .IX Subsection "mpdecimate"
yading@10 4690 Drop frames that do not differ greatly from the previous frame in
yading@10 4691 order to reduce frame rate.
yading@10 4692 .PP
yading@10 4693 The main use of this filter is for very-low-bitrate encoding
yading@10 4694 (e.g. streaming over dialup modem), but it could in theory be used for
yading@10 4695 fixing movies that were inverse-telecined incorrectly.
yading@10 4696 .PP
yading@10 4697 A description of the accepted options follows.
yading@10 4698 .IP "\fBmax\fR" 4
yading@10 4699 .IX Item "max"
yading@10 4700 Set the maximum number of consecutive frames which can be dropped (if
yading@10 4701 positive), or the minimum interval between dropped frames (if
yading@10 4702 negative). If the value is 0, the frame is dropped unregarding the
yading@10 4703 number of previous sequentially dropped frames.
yading@10 4704 .Sp
yading@10 4705 Default value is 0.
yading@10 4706 .IP "\fBhi\fR" 4
yading@10 4707 .IX Item "hi"
yading@10 4708 .PD 0
yading@10 4709 .IP "\fBlo\fR" 4
yading@10 4710 .IX Item "lo"
yading@10 4711 .IP "\fBfrac\fR" 4
yading@10 4712 .IX Item "frac"
yading@10 4713 .PD
yading@10 4714 Set the dropping threshold values.
yading@10 4715 .Sp
yading@10 4716 Values for \fBhi\fR and \fBlo\fR are for 8x8 pixel blocks and
yading@10 4717 represent actual pixel value differences, so a threshold of 64
yading@10 4718 corresponds to 1 unit of difference for each pixel, or the same spread
yading@10 4719 out differently over the block.
yading@10 4720 .Sp
yading@10 4721 A frame is a candidate for dropping if no 8x8 blocks differ by more
yading@10 4722 than a threshold of \fBhi\fR, and if no more than \fBfrac\fR blocks (1
yading@10 4723 meaning the whole image) differ by more than a threshold of \fBlo\fR.
yading@10 4724 .Sp
yading@10 4725 Default value for \fBhi\fR is 64*12, default value for \fBlo\fR is
yading@10 4726 64*5, and default value for \fBfrac\fR is 0.33.
yading@10 4727 .SS "negate"
yading@10 4728 .IX Subsection "negate"
yading@10 4729 Negate input video.
yading@10 4730 .PP
yading@10 4731 This filter accepts an integer in input, if non-zero it negates the
yading@10 4732 alpha component (if available). The default value in input is 0.
yading@10 4733 .SS "noformat"
yading@10 4734 .IX Subsection "noformat"
yading@10 4735 Force libavfilter not to use any of the specified pixel formats for the
yading@10 4736 input to the next filter.
yading@10 4737 .PP
yading@10 4738 This filter accepts the following parameters:
yading@10 4739 .IP "\fBpix_fmts\fR" 4
yading@10 4740 .IX Item "pix_fmts"
yading@10 4741 A '|'\-separated list of pixel format names, for example
yading@10 4742 \&\*(L"pix_fmts=yuv420p|monow|rgb24\*(R".
yading@10 4743 .PP
yading@10 4744 \fIExamples\fR
yading@10 4745 .IX Subsection "Examples"
yading@10 4746 .IP "\(bu" 4
yading@10 4747 Force libavfilter to use a format different from \fIyuv420p\fR for the
yading@10 4748 input to the vflip filter:
yading@10 4749 .Sp
yading@10 4750 .Vb 1
yading@10 4751 \& noformat=pix_fmts=yuv420p,vflip
yading@10 4752 .Ve
yading@10 4753 .IP "\(bu" 4
yading@10 4754 Convert the input video to any of the formats not contained in the list:
yading@10 4755 .Sp
yading@10 4756 .Vb 1
yading@10 4757 \& noformat=yuv420p|yuv444p|yuv410p
yading@10 4758 .Ve
yading@10 4759 .SS "noise"
yading@10 4760 .IX Subsection "noise"
yading@10 4761 Add noise on video input frame.
yading@10 4762 .PP
yading@10 4763 The filter accepts the following options:
yading@10 4764 .IP "\fBall_seed\fR" 4
yading@10 4765 .IX Item "all_seed"
yading@10 4766 .PD 0
yading@10 4767 .IP "\fBc0_seed\fR" 4
yading@10 4768 .IX Item "c0_seed"
yading@10 4769 .IP "\fBc1_seed\fR" 4
yading@10 4770 .IX Item "c1_seed"
yading@10 4771 .IP "\fBc2_seed\fR" 4
yading@10 4772 .IX Item "c2_seed"
yading@10 4773 .IP "\fBc3_seed\fR" 4
yading@10 4774 .IX Item "c3_seed"
yading@10 4775 .PD
yading@10 4776 Set noise seed for specific pixel component or all pixel components in case
yading@10 4777 of \fIall_seed\fR. Default value is \f(CW123457\fR.
yading@10 4778 .IP "\fBall_strength, alls\fR" 4
yading@10 4779 .IX Item "all_strength, alls"
yading@10 4780 .PD 0
yading@10 4781 .IP "\fBc0_strength, c0s\fR" 4
yading@10 4782 .IX Item "c0_strength, c0s"
yading@10 4783 .IP "\fBc1_strength, c1s\fR" 4
yading@10 4784 .IX Item "c1_strength, c1s"
yading@10 4785 .IP "\fBc2_strength, c2s\fR" 4
yading@10 4786 .IX Item "c2_strength, c2s"
yading@10 4787 .IP "\fBc3_strength, c3s\fR" 4
yading@10 4788 .IX Item "c3_strength, c3s"
yading@10 4789 .PD
yading@10 4790 Set noise strength for specific pixel component or all pixel components in case
yading@10 4791 \&\fIall_strength\fR. Default value is \f(CW0\fR. Allowed range is [0, 100].
yading@10 4792 .IP "\fBall_flags, allf\fR" 4
yading@10 4793 .IX Item "all_flags, allf"
yading@10 4794 .PD 0
yading@10 4795 .IP "\fBc0_flags, c0f\fR" 4
yading@10 4796 .IX Item "c0_flags, c0f"
yading@10 4797 .IP "\fBc1_flags, c1f\fR" 4
yading@10 4798 .IX Item "c1_flags, c1f"
yading@10 4799 .IP "\fBc2_flags, c2f\fR" 4
yading@10 4800 .IX Item "c2_flags, c2f"
yading@10 4801 .IP "\fBc3_flags, c3f\fR" 4
yading@10 4802 .IX Item "c3_flags, c3f"
yading@10 4803 .PD
yading@10 4804 Set pixel component flags or set flags for all components if \fIall_flags\fR.
yading@10 4805 Available values for component flags are:
yading@10 4806 .RS 4
yading@10 4807 .IP "\fBa\fR" 4
yading@10 4808 .IX Item "a"
yading@10 4809 averaged temporal noise (smoother)
yading@10 4810 .IP "\fBp\fR" 4
yading@10 4811 .IX Item "p"
yading@10 4812 mix random noise with a (semi)regular pattern
yading@10 4813 .IP "\fBq\fR" 4
yading@10 4814 .IX Item "q"
yading@10 4815 higher quality (slightly better looking, slightly slower)
yading@10 4816 .IP "\fBt\fR" 4
yading@10 4817 .IX Item "t"
yading@10 4818 temporal noise (noise pattern changes between frames)
yading@10 4819 .IP "\fBu\fR" 4
yading@10 4820 .IX Item "u"
yading@10 4821 uniform noise (gaussian otherwise)
yading@10 4822 .RE
yading@10 4823 .RS 4
yading@10 4824 .RE
yading@10 4825 .PP
yading@10 4826 \fIExamples\fR
yading@10 4827 .IX Subsection "Examples"
yading@10 4828 .PP
yading@10 4829 Add temporal and uniform noise to input video:
yading@10 4830 .PP
yading@10 4831 .Vb 1
yading@10 4832 \& noise=alls=20:allf=t+u
yading@10 4833 .Ve
yading@10 4834 .SS "null"
yading@10 4835 .IX Subsection "null"
yading@10 4836 Pass the video source unchanged to the output.
yading@10 4837 .SS "ocv"
yading@10 4838 .IX Subsection "ocv"
yading@10 4839 Apply video transform using libopencv.
yading@10 4840 .PP
yading@10 4841 To enable this filter install libopencv library and headers and
yading@10 4842 configure FFmpeg with \f(CW\*(C`\-\-enable\-libopencv\*(C'\fR.
yading@10 4843 .PP
yading@10 4844 This filter accepts the following parameters:
yading@10 4845 .IP "\fBfilter_name\fR" 4
yading@10 4846 .IX Item "filter_name"
yading@10 4847 The name of the libopencv filter to apply.
yading@10 4848 .IP "\fBfilter_params\fR" 4
yading@10 4849 .IX Item "filter_params"
yading@10 4850 The parameters to pass to the libopencv filter. If not specified the default
yading@10 4851 values are assumed.
yading@10 4852 .PP
yading@10 4853 Refer to the official libopencv documentation for more precise
yading@10 4854 information:
yading@10 4855 <\fBhttp://opencv.willowgarage.com/documentation/c/image_filtering.html\fR>
yading@10 4856 .PP
yading@10 4857 Follows the list of supported libopencv filters.
yading@10 4858 .PP
yading@10 4859 \fIdilate\fR
yading@10 4860 .IX Subsection "dilate"
yading@10 4861 .PP
yading@10 4862 Dilate an image by using a specific structuring element.
yading@10 4863 This filter corresponds to the libopencv function \f(CW\*(C`cvDilate\*(C'\fR.
yading@10 4864 .PP
yading@10 4865 It accepts the parameters: \fIstruct_el\fR|\fInb_iterations\fR.
yading@10 4866 .PP
yading@10 4867 \&\fIstruct_el\fR represents a structuring element, and has the syntax:
yading@10 4868 \&\fIcols\fRx\fIrows\fR+\fIanchor_x\fRx\fIanchor_y\fR/\fIshape\fR
yading@10 4869 .PP
yading@10 4870 \&\fIcols\fR and \fIrows\fR represent the number of columns and rows of
yading@10 4871 the structuring element, \fIanchor_x\fR and \fIanchor_y\fR the anchor
yading@10 4872 point, and \fIshape\fR the shape for the structuring element, and
yading@10 4873 can be one of the values \*(L"rect\*(R", \*(L"cross\*(R", \*(L"ellipse\*(R", \*(L"custom\*(R".
yading@10 4874 .PP
yading@10 4875 If the value for \fIshape\fR is \*(L"custom\*(R", it must be followed by a
yading@10 4876 string of the form "=\fIfilename\fR". The file with name
yading@10 4877 \&\fIfilename\fR is assumed to represent a binary image, with each
yading@10 4878 printable character corresponding to a bright pixel. When a custom
yading@10 4879 \&\fIshape\fR is used, \fIcols\fR and \fIrows\fR are ignored, the number
yading@10 4880 or columns and rows of the read file are assumed instead.
yading@10 4881 .PP
yading@10 4882 The default value for \fIstruct_el\fR is \*(L"3x3+0x0/rect\*(R".
yading@10 4883 .PP
yading@10 4884 \&\fInb_iterations\fR specifies the number of times the transform is
yading@10 4885 applied to the image, and defaults to 1.
yading@10 4886 .PP
yading@10 4887 Follow some example:
yading@10 4888 .PP
yading@10 4889 .Vb 2
yading@10 4890 \& # use the default values
yading@10 4891 \& ocv=dilate
yading@10 4892 \&
yading@10 4893 \& # dilate using a structuring element with a 5x5 cross, iterate two times
yading@10 4894 \& ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
yading@10 4895 \&
yading@10 4896 \& # read the shape from the file diamond.shape, iterate two times
yading@10 4897 \& # the file diamond.shape may contain a pattern of characters like this:
yading@10 4898 \& # *
yading@10 4899 \& # ***
yading@10 4900 \& # *****
yading@10 4901 \& # ***
yading@10 4902 \& # *
yading@10 4903 \& # the specified cols and rows are ignored (but not the anchor point coordinates)
yading@10 4904 \& ocv=dilate:0x0+2x2/custom=diamond.shape|2
yading@10 4905 .Ve
yading@10 4906 .PP
yading@10 4907 \fIerode\fR
yading@10 4908 .IX Subsection "erode"
yading@10 4909 .PP
yading@10 4910 Erode an image by using a specific structuring element.
yading@10 4911 This filter corresponds to the libopencv function \f(CW\*(C`cvErode\*(C'\fR.
yading@10 4912 .PP
yading@10 4913 The filter accepts the parameters: \fIstruct_el\fR:\fInb_iterations\fR,
yading@10 4914 with the same syntax and semantics as the dilate filter.
yading@10 4915 .PP
yading@10 4916 \fIsmooth\fR
yading@10 4917 .IX Subsection "smooth"
yading@10 4918 .PP
yading@10 4919 Smooth the input video.
yading@10 4920 .PP
yading@10 4921 The filter takes the following parameters:
yading@10 4922 \&\fItype\fR|\fIparam1\fR|\fIparam2\fR|\fIparam3\fR|\fIparam4\fR.
yading@10 4923 .PP
yading@10 4924 \&\fItype\fR is the type of smooth filter to apply, and can be one of
yading@10 4925 the following values: \*(L"blur\*(R", \*(L"blur_no_scale\*(R", \*(L"median\*(R", \*(L"gaussian\*(R",
yading@10 4926 \&\*(L"bilateral\*(R". The default value is \*(L"gaussian\*(R".
yading@10 4927 .PP
yading@10 4928 \&\fIparam1\fR, \fIparam2\fR, \fIparam3\fR, and \fIparam4\fR are
yading@10 4929 parameters whose meanings depend on smooth type. \fIparam1\fR and
yading@10 4930 \&\fIparam2\fR accept integer positive values or 0, \fIparam3\fR and
yading@10 4931 \&\fIparam4\fR accept float values.
yading@10 4932 .PP
yading@10 4933 The default value for \fIparam1\fR is 3, the default value for the
yading@10 4934 other parameters is 0.
yading@10 4935 .PP
yading@10 4936 These parameters correspond to the parameters assigned to the
yading@10 4937 libopencv function \f(CW\*(C`cvSmooth\*(C'\fR.
yading@10 4938 .SS "overlay"
yading@10 4939 .IX Subsection "overlay"
yading@10 4940 Overlay one video on top of another.
yading@10 4941 .PP
yading@10 4942 It takes two inputs and one output, the first input is the \*(L"main\*(R"
yading@10 4943 video on which the second input is overlayed.
yading@10 4944 .PP
yading@10 4945 This filter accepts the following parameters:
yading@10 4946 .PP
yading@10 4947 A description of the accepted options follows.
yading@10 4948 .IP "\fBx\fR" 4
yading@10 4949 .IX Item "x"
yading@10 4950 .PD 0
yading@10 4951 .IP "\fBy\fR" 4
yading@10 4952 .IX Item "y"
yading@10 4953 .PD
yading@10 4954 Set the expression for the x and y coordinates of the overlayed video
yading@10 4955 on the main video. Default value is \*(L"0\*(R" for both expressions. In case
yading@10 4956 the expression is invalid, it is set to a huge value (meaning that the
yading@10 4957 overlay will not be displayed within the output visible area).
yading@10 4958 .IP "\fBenable\fR" 4
yading@10 4959 .IX Item "enable"
yading@10 4960 Set the expression which enables the overlay. If the evaluation is
yading@10 4961 different from 0, the overlay is displayed on top of the input
yading@10 4962 frame. By default it is \*(L"1\*(R".
yading@10 4963 .IP "\fBeval\fR" 4
yading@10 4964 .IX Item "eval"
yading@10 4965 Set when the expressions for \fBx\fR, \fBy\fR, and
yading@10 4966 \&\fBenable\fR are evaluated.
yading@10 4967 .Sp
yading@10 4968 It accepts the following values:
yading@10 4969 .RS 4
yading@10 4970 .IP "\fBinit\fR" 4
yading@10 4971 .IX Item "init"
yading@10 4972 only evaluate expressions once during the filter initialization or
yading@10 4973 when a command is processed
yading@10 4974 .IP "\fBframe\fR" 4
yading@10 4975 .IX Item "frame"
yading@10 4976 evaluate expressions for each incoming frame
yading@10 4977 .RE
yading@10 4978 .RS 4
yading@10 4979 .Sp
yading@10 4980 Default value is \fBframe\fR.
yading@10 4981 .RE
yading@10 4982 .IP "\fBshortest\fR" 4
yading@10 4983 .IX Item "shortest"
yading@10 4984 If set to 1, force the output to terminate when the shortest input
yading@10 4985 terminates. Default value is 0.
yading@10 4986 .IP "\fBformat\fR" 4
yading@10 4987 .IX Item "format"
yading@10 4988 Set the format for the output video.
yading@10 4989 .Sp
yading@10 4990 It accepts the following values:
yading@10 4991 .RS 4
yading@10 4992 .IP "\fByuv420\fR" 4
yading@10 4993 .IX Item "yuv420"
yading@10 4994 force \s-1YUV420\s0 output
yading@10 4995 .IP "\fByuv444\fR" 4
yading@10 4996 .IX Item "yuv444"
yading@10 4997 force \s-1YUV444\s0 output
yading@10 4998 .IP "\fBrgb\fR" 4
yading@10 4999 .IX Item "rgb"
yading@10 5000 force \s-1RGB\s0 output
yading@10 5001 .RE
yading@10 5002 .RS 4
yading@10 5003 .Sp
yading@10 5004 Default value is \fByuv420\fR.
yading@10 5005 .RE
yading@10 5006 .IP "\fBrgb\fR \fI(deprecated)\fR" 4
yading@10 5007 .IX Item "rgb (deprecated)"
yading@10 5008 If set to 1, force the filter to accept inputs in the \s-1RGB\s0
yading@10 5009 color space. Default value is 0. This option is deprecated, use
yading@10 5010 \&\fBformat\fR instead.
yading@10 5011 .IP "\fBrepeatlast\fR" 4
yading@10 5012 .IX Item "repeatlast"
yading@10 5013 If set to 1, force the filter to draw the last overlay frame over the
yading@10 5014 main input until the end of the stream. A value of 0 disables this
yading@10 5015 behavior, which is enabled by default.
yading@10 5016 .PP
yading@10 5017 The \fBx\fR, \fBy\fR, and \fBenable\fR expressions can
yading@10 5018 contain the following parameters.
yading@10 5019 .IP "\fBmain_w, W\fR" 4
yading@10 5020 .IX Item "main_w, W"
yading@10 5021 .PD 0
yading@10 5022 .IP "\fBmain_h, H\fR" 4
yading@10 5023 .IX Item "main_h, H"
yading@10 5024 .PD
yading@10 5025 main input width and height
yading@10 5026 .IP "\fBoverlay_w, w\fR" 4
yading@10 5027 .IX Item "overlay_w, w"
yading@10 5028 .PD 0
yading@10 5029 .IP "\fBoverlay_h, h\fR" 4
yading@10 5030 .IX Item "overlay_h, h"
yading@10 5031 .PD
yading@10 5032 overlay input width and height
yading@10 5033 .IP "\fBx\fR" 4
yading@10 5034 .IX Item "x"
yading@10 5035 .PD 0
yading@10 5036 .IP "\fBy\fR" 4
yading@10 5037 .IX Item "y"
yading@10 5038 .PD
yading@10 5039 the computed values for \fIx\fR and \fIy\fR. They are evaluated for
yading@10 5040 each new frame.
yading@10 5041 .IP "\fBhsub\fR" 4
yading@10 5042 .IX Item "hsub"
yading@10 5043 .PD 0
yading@10 5044 .IP "\fBvsub\fR" 4
yading@10 5045 .IX Item "vsub"
yading@10 5046 .PD
yading@10 5047 horizontal and vertical chroma subsample values of the output
yading@10 5048 format. For example for the pixel format \*(L"yuv422p\*(R" \fIhsub\fR is 2 and
yading@10 5049 \&\fIvsub\fR is 1.
yading@10 5050 .IP "\fBn\fR" 4
yading@10 5051 .IX Item "n"
yading@10 5052 the number of input frame, starting from 0
yading@10 5053 .IP "\fBpos\fR" 4
yading@10 5054 .IX Item "pos"
yading@10 5055 the position in the file of the input frame, \s-1NAN\s0 if unknown
yading@10 5056 .IP "\fBt\fR" 4
yading@10 5057 .IX Item "t"
yading@10 5058 timestamp expressed in seconds, \s-1NAN\s0 if the input timestamp is unknown
yading@10 5059 .PP
yading@10 5060 Note that the \fIn\fR, \fIpos\fR, \fIt\fR variables are available only
yading@10 5061 when evaluation is done \fIper frame\fR, and will evaluate to \s-1NAN\s0
yading@10 5062 when \fBeval\fR is set to \fBinit\fR.
yading@10 5063 .PP
yading@10 5064 Be aware that frames are taken from each input video in timestamp
yading@10 5065 order, hence, if their initial timestamps differ, it is a a good idea
yading@10 5066 to pass the two inputs through a \fIsetpts=PTS\-STARTPTS\fR filter to
yading@10 5067 have them begin in the same zero timestamp, as it does the example for
yading@10 5068 the \fImovie\fR filter.
yading@10 5069 .PP
yading@10 5070 You can chain together more overlays but you should test the
yading@10 5071 efficiency of such approach.
yading@10 5072 .PP
yading@10 5073 \fICommands\fR
yading@10 5074 .IX Subsection "Commands"
yading@10 5075 .PP
yading@10 5076 This filter supports the following commands:
yading@10 5077 .IP "\fBx\fR" 4
yading@10 5078 .IX Item "x"
yading@10 5079 .PD 0
yading@10 5080 .IP "\fBy\fR" 4
yading@10 5081 .IX Item "y"
yading@10 5082 .IP "\fBenable\fR" 4
yading@10 5083 .IX Item "enable"
yading@10 5084 .PD
yading@10 5085 Modify the x/y and enable overlay of the overlay input.
yading@10 5086 The command accepts the same syntax of the corresponding option.
yading@10 5087 .Sp
yading@10 5088 If the specified expression is not valid, it is kept at its current
yading@10 5089 value.
yading@10 5090 .PP
yading@10 5091 \fIExamples\fR
yading@10 5092 .IX Subsection "Examples"
yading@10 5093 .IP "\(bu" 4
yading@10 5094 Draw the overlay at 10 pixels from the bottom right corner of the main
yading@10 5095 video:
yading@10 5096 .Sp
yading@10 5097 .Vb 1
yading@10 5098 \& overlay=main_w\-overlay_w\-10:main_h\-overlay_h\-10
yading@10 5099 .Ve
yading@10 5100 .Sp
yading@10 5101 Using named options the example above becomes:
yading@10 5102 .Sp
yading@10 5103 .Vb 1
yading@10 5104 \& overlay=x=main_w\-overlay_w\-10:y=main_h\-overlay_h\-10
yading@10 5105 .Ve
yading@10 5106 .IP "\(bu" 4
yading@10 5107 Insert a transparent \s-1PNG\s0 logo in the bottom left corner of the input,
yading@10 5108 using the \fBffmpeg\fR tool with the \f(CW\*(C`\-filter_complex\*(C'\fR option:
yading@10 5109 .Sp
yading@10 5110 .Vb 1
yading@10 5111 \& ffmpeg \-i input \-i logo \-filter_complex \*(Aqoverlay=10:main_h\-overlay_h\-10\*(Aq output
yading@10 5112 .Ve
yading@10 5113 .IP "\(bu" 4
yading@10 5114 Insert 2 different transparent \s-1PNG\s0 logos (second logo on bottom
yading@10 5115 right corner) using the \fBffmpeg\fR tool:
yading@10 5116 .Sp
yading@10 5117 .Vb 1
yading@10 5118 \& ffmpeg \-i input \-i logo1 \-i logo2 \-filter_complex \*(Aqoverlay=x=10:y=H\-h\-10,overlay=x=W\-w\-10:y=H\-h\-10\*(Aq output
yading@10 5119 .Ve
yading@10 5120 .IP "\(bu" 4
yading@10 5121 Add a transparent color layer on top of the main video, \f(CW\*(C`WxH\*(C'\fR
yading@10 5122 must specify the size of the main input to the overlay filter:
yading@10 5123 .Sp
yading@10 5124 .Vb 1
yading@10 5125 \& color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
yading@10 5126 .Ve
yading@10 5127 .IP "\(bu" 4
yading@10 5128 Play an original video and a filtered version (here with the deshake
yading@10 5129 filter) side by side using the \fBffplay\fR tool:
yading@10 5130 .Sp
yading@10 5131 .Vb 1
yading@10 5132 \& ffplay input.avi \-vf \*(Aqsplit[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w\*(Aq
yading@10 5133 .Ve
yading@10 5134 .Sp
yading@10 5135 The above command is the same as:
yading@10 5136 .Sp
yading@10 5137 .Vb 1
yading@10 5138 \& ffplay input.avi \-vf \*(Aqsplit[b], pad=iw*2[src], [b]deshake, [src]overlay=w\*(Aq
yading@10 5139 .Ve
yading@10 5140 .IP "\(bu" 4
yading@10 5141 Make a sliding overlay appearing from the left to the right top part of the
yading@10 5142 screen starting since time 2:
yading@10 5143 .Sp
yading@10 5144 .Vb 1
yading@10 5145 \& overlay=x=\*(Aqif(gte(t,2), \-w+(t\-2)*20, NAN)\*(Aq:y=0
yading@10 5146 .Ve
yading@10 5147 .IP "\(bu" 4
yading@10 5148 Compose output by putting two input videos side to side:
yading@10 5149 .Sp
yading@10 5150 .Vb 7
yading@10 5151 \& ffmpeg \-i left.avi \-i right.avi \-filter_complex "
yading@10 5152 \& nullsrc=size=200x100 [background];
yading@10 5153 \& [0:v] setpts=PTS\-STARTPTS, scale=100x100 [left];
yading@10 5154 \& [1:v] setpts=PTS\-STARTPTS, scale=100x100 [right];
yading@10 5155 \& [background][left] overlay=shortest=1 [background+left];
yading@10 5156 \& [background+left][right] overlay=shortest=1:x=100 [left+right]
yading@10 5157 \& "
yading@10 5158 .Ve
yading@10 5159 .IP "\(bu" 4
yading@10 5160 Chain several overlays in cascade:
yading@10 5161 .Sp
yading@10 5162 .Vb 6
yading@10 5163 \& nullsrc=s=200x200 [bg];
yading@10 5164 \& testsrc=s=100x100, split=4 [in0][in1][in2][in3];
yading@10 5165 \& [in0] lutrgb=r=0, [bg] overlay=0:0 [mid0];
yading@10 5166 \& [in1] lutrgb=g=0, [mid0] overlay=100:0 [mid1];
yading@10 5167 \& [in2] lutrgb=b=0, [mid1] overlay=0:100 [mid2];
yading@10 5168 \& [in3] null, [mid2] overlay=100:100 [out0]
yading@10 5169 .Ve
yading@10 5170 .SS "pad"
yading@10 5171 .IX Subsection "pad"
yading@10 5172 Add paddings to the input image, and place the original input at the
yading@10 5173 given coordinates \fIx\fR, \fIy\fR.
yading@10 5174 .PP
yading@10 5175 This filter accepts the following parameters:
yading@10 5176 .IP "\fBwidth, w\fR" 4
yading@10 5177 .IX Item "width, w"
yading@10 5178 .PD 0
yading@10 5179 .IP "\fBheight, h\fR" 4
yading@10 5180 .IX Item "height, h"
yading@10 5181 .PD
yading@10 5182 Specify an expression for the size of the output image with the
yading@10 5183 paddings added. If the value for \fIwidth\fR or \fIheight\fR is 0, the
yading@10 5184 corresponding input size is used for the output.
yading@10 5185 .Sp
yading@10 5186 The \fIwidth\fR expression can reference the value set by the
yading@10 5187 \&\fIheight\fR expression, and vice versa.
yading@10 5188 .Sp
yading@10 5189 The default value of \fIwidth\fR and \fIheight\fR is 0.
yading@10 5190 .IP "\fBx\fR" 4
yading@10 5191 .IX Item "x"
yading@10 5192 .PD 0
yading@10 5193 .IP "\fBy\fR" 4
yading@10 5194 .IX Item "y"
yading@10 5195 .PD
yading@10 5196 Specify an expression for the offsets where to place the input image
yading@10 5197 in the padded area with respect to the top/left border of the output
yading@10 5198 image.
yading@10 5199 .Sp
yading@10 5200 The \fIx\fR expression can reference the value set by the \fIy\fR
yading@10 5201 expression, and vice versa.
yading@10 5202 .Sp
yading@10 5203 The default value of \fIx\fR and \fIy\fR is 0.
yading@10 5204 .IP "\fBcolor\fR" 4
yading@10 5205 .IX Item "color"
yading@10 5206 Specify the color of the padded area, it can be the name of a color
yading@10 5207 (case insensitive match) or a 0xRRGGBB[\s-1AA\s0] sequence.
yading@10 5208 .Sp
yading@10 5209 The default value of \fIcolor\fR is \*(L"black\*(R".
yading@10 5210 .PP
yading@10 5211 The value for the \fIwidth\fR, \fIheight\fR, \fIx\fR, and \fIy\fR
yading@10 5212 options are expressions containing the following constants:
yading@10 5213 .IP "\fBin_w, in_h\fR" 4
yading@10 5214 .IX Item "in_w, in_h"
yading@10 5215 the input video width and height
yading@10 5216 .IP "\fBiw, ih\fR" 4
yading@10 5217 .IX Item "iw, ih"
yading@10 5218 same as \fIin_w\fR and \fIin_h\fR
yading@10 5219 .IP "\fBout_w, out_h\fR" 4
yading@10 5220 .IX Item "out_w, out_h"
yading@10 5221 the output width and height, that is the size of the padded area as
yading@10 5222 specified by the \fIwidth\fR and \fIheight\fR expressions
yading@10 5223 .IP "\fBow, oh\fR" 4
yading@10 5224 .IX Item "ow, oh"
yading@10 5225 same as \fIout_w\fR and \fIout_h\fR
yading@10 5226 .IP "\fBx, y\fR" 4
yading@10 5227 .IX Item "x, y"
yading@10 5228 x and y offsets as specified by the \fIx\fR and \fIy\fR
yading@10 5229 expressions, or \s-1NAN\s0 if not yet specified
yading@10 5230 .IP "\fBa\fR" 4
yading@10 5231 .IX Item "a"
yading@10 5232 same as \fIiw\fR / \fIih\fR
yading@10 5233 .IP "\fBsar\fR" 4
yading@10 5234 .IX Item "sar"
yading@10 5235 input sample aspect ratio
yading@10 5236 .IP "\fBdar\fR" 4
yading@10 5237 .IX Item "dar"
yading@10 5238 input display aspect ratio, it is the same as (\fIiw\fR / \fIih\fR) * \fIsar\fR
yading@10 5239 .IP "\fBhsub, vsub\fR" 4
yading@10 5240 .IX Item "hsub, vsub"
yading@10 5241 horizontal and vertical chroma subsample values. For example for the
yading@10 5242 pixel format \*(L"yuv422p\*(R" \fIhsub\fR is 2 and \fIvsub\fR is 1.
yading@10 5243 .PP
yading@10 5244 \fIExamples\fR
yading@10 5245 .IX Subsection "Examples"
yading@10 5246 .IP "\(bu" 4
yading@10 5247 Add paddings with color \*(L"violet\*(R" to the input video. Output video
yading@10 5248 size is 640x480, the top-left corner of the input video is placed at
yading@10 5249 column 0, row 40:
yading@10 5250 .Sp
yading@10 5251 .Vb 1
yading@10 5252 \& pad=640:480:0:40:violet
yading@10 5253 .Ve
yading@10 5254 .Sp
yading@10 5255 The example above is equivalent to the following command:
yading@10 5256 .Sp
yading@10 5257 .Vb 1
yading@10 5258 \& pad=width=640:height=480:x=0:y=40:color=violet
yading@10 5259 .Ve
yading@10 5260 .IP "\(bu" 4
yading@10 5261 Pad the input to get an output with dimensions increased by 3/2,
yading@10 5262 and put the input video at the center of the padded area:
yading@10 5263 .Sp
yading@10 5264 .Vb 1
yading@10 5265 \& pad="3/2*iw:3/2*ih:(ow\-iw)/2:(oh\-ih)/2"
yading@10 5266 .Ve
yading@10 5267 .IP "\(bu" 4
yading@10 5268 Pad the input to get a squared output with size equal to the maximum
yading@10 5269 value between the input width and height, and put the input video at
yading@10 5270 the center of the padded area:
yading@10 5271 .Sp
yading@10 5272 .Vb 1
yading@10 5273 \& pad="max(iw\e,ih):ow:(ow\-iw)/2:(oh\-ih)/2"
yading@10 5274 .Ve
yading@10 5275 .IP "\(bu" 4
yading@10 5276 Pad the input to get a final w/h ratio of 16:9:
yading@10 5277 .Sp
yading@10 5278 .Vb 1
yading@10 5279 \& pad="ih*16/9:ih:(ow\-iw)/2:(oh\-ih)/2"
yading@10 5280 .Ve
yading@10 5281 .IP "\(bu" 4
yading@10 5282 In case of anamorphic video, in order to set the output display aspect
yading@10 5283 correctly, it is necessary to use \fIsar\fR in the expression,
yading@10 5284 according to the relation:
yading@10 5285 .Sp
yading@10 5286 .Vb 2
yading@10 5287 \& (ih * X / ih) * sar = output_dar
yading@10 5288 \& X = output_dar / sar
yading@10 5289 .Ve
yading@10 5290 .Sp
yading@10 5291 Thus the previous example needs to be modified to:
yading@10 5292 .Sp
yading@10 5293 .Vb 1
yading@10 5294 \& pad="ih*16/9/sar:ih:(ow\-iw)/2:(oh\-ih)/2"
yading@10 5295 .Ve
yading@10 5296 .IP "\(bu" 4
yading@10 5297 Double output size and put the input video in the bottom-right
yading@10 5298 corner of the output padded area:
yading@10 5299 .Sp
yading@10 5300 .Vb 1
yading@10 5301 \& pad="2*iw:2*ih:ow\-iw:oh\-ih"
yading@10 5302 .Ve
yading@10 5303 .SS "pixdesctest"
yading@10 5304 .IX Subsection "pixdesctest"
yading@10 5305 Pixel format descriptor test filter, mainly useful for internal
yading@10 5306 testing. The output video should be equal to the input video.
yading@10 5307 .PP
yading@10 5308 For example:
yading@10 5309 .PP
yading@10 5310 .Vb 1
yading@10 5311 \& format=monow, pixdesctest
yading@10 5312 .Ve
yading@10 5313 .PP
yading@10 5314 can be used to test the monowhite pixel format descriptor definition.
yading@10 5315 .SS "pp"
yading@10 5316 .IX Subsection "pp"
yading@10 5317 Enable the specified chain of postprocessing subfilters using libpostproc. This
yading@10 5318 library should be automatically selected with a \s-1GPL\s0 build (\f(CW\*(C`\-\-enable\-gpl\*(C'\fR).
yading@10 5319 Subfilters must be separated by '/' and can be disabled by prepending a '\-'.
yading@10 5320 Each subfilter and some options have a short and a long name that can be used
yading@10 5321 interchangeably, i.e. dr/dering are the same.
yading@10 5322 .PP
yading@10 5323 The filters accept the following options:
yading@10 5324 .IP "\fBsubfilters\fR" 4
yading@10 5325 .IX Item "subfilters"
yading@10 5326 Set postprocessing subfilters string.
yading@10 5327 .PP
yading@10 5328 All subfilters share common options to determine their scope:
yading@10 5329 .IP "\fBa/autoq\fR" 4
yading@10 5330 .IX Item "a/autoq"
yading@10 5331 Honor the quality commands for this subfilter.
yading@10 5332 .IP "\fBc/chrom\fR" 4
yading@10 5333 .IX Item "c/chrom"
yading@10 5334 Do chrominance filtering, too (default).
yading@10 5335 .IP "\fBy/nochrom\fR" 4
yading@10 5336 .IX Item "y/nochrom"
yading@10 5337 Do luminance filtering only (no chrominance).
yading@10 5338 .IP "\fBn/noluma\fR" 4
yading@10 5339 .IX Item "n/noluma"
yading@10 5340 Do chrominance filtering only (no luminance).
yading@10 5341 .PP
yading@10 5342 These options can be appended after the subfilter name, separated by a '|'.
yading@10 5343 .PP
yading@10 5344 Available subfilters are:
yading@10 5345 .IP "\fBhb/hdeblock[|difference[|flatness]]\fR" 4
yading@10 5346 .IX Item "hb/hdeblock[|difference[|flatness]]"
yading@10 5347 Horizontal deblocking filter
yading@10 5348 .RS 4
yading@10 5349 .IP "\fBdifference\fR" 4
yading@10 5350 .IX Item "difference"
yading@10 5351 Difference factor where higher values mean more deblocking (default: \f(CW32\fR).
yading@10 5352 .IP "\fBflatness\fR" 4
yading@10 5353 .IX Item "flatness"
yading@10 5354 Flatness threshold where lower values mean more deblocking (default: \f(CW39\fR).
yading@10 5355 .RE
yading@10 5356 .RS 4
yading@10 5357 .RE
yading@10 5358 .IP "\fBvb/vdeblock[|difference[|flatness]]\fR" 4
yading@10 5359 .IX Item "vb/vdeblock[|difference[|flatness]]"
yading@10 5360 Vertical deblocking filter
yading@10 5361 .RS 4
yading@10 5362 .IP "\fBdifference\fR" 4
yading@10 5363 .IX Item "difference"
yading@10 5364 Difference factor where higher values mean more deblocking (default: \f(CW32\fR).
yading@10 5365 .IP "\fBflatness\fR" 4
yading@10 5366 .IX Item "flatness"
yading@10 5367 Flatness threshold where lower values mean more deblocking (default: \f(CW39\fR).
yading@10 5368 .RE
yading@10 5369 .RS 4
yading@10 5370 .RE
yading@10 5371 .IP "\fBha/hadeblock[|difference[|flatness]]\fR" 4
yading@10 5372 .IX Item "ha/hadeblock[|difference[|flatness]]"
yading@10 5373 Accurate horizontal deblocking filter
yading@10 5374 .RS 4
yading@10 5375 .IP "\fBdifference\fR" 4
yading@10 5376 .IX Item "difference"
yading@10 5377 Difference factor where higher values mean more deblocking (default: \f(CW32\fR).
yading@10 5378 .IP "\fBflatness\fR" 4
yading@10 5379 .IX Item "flatness"
yading@10 5380 Flatness threshold where lower values mean more deblocking (default: \f(CW39\fR).
yading@10 5381 .RE
yading@10 5382 .RS 4
yading@10 5383 .RE
yading@10 5384 .IP "\fBva/vadeblock[|difference[|flatness]]\fR" 4
yading@10 5385 .IX Item "va/vadeblock[|difference[|flatness]]"
yading@10 5386 Accurate vertical deblocking filter
yading@10 5387 .RS 4
yading@10 5388 .IP "\fBdifference\fR" 4
yading@10 5389 .IX Item "difference"
yading@10 5390 Difference factor where higher values mean more deblocking (default: \f(CW32\fR).
yading@10 5391 .IP "\fBflatness\fR" 4
yading@10 5392 .IX Item "flatness"
yading@10 5393 Flatness threshold where lower values mean more deblocking (default: \f(CW39\fR).
yading@10 5394 .RE
yading@10 5395 .RS 4
yading@10 5396 .RE
yading@10 5397 .PP
yading@10 5398 The horizontal and vertical deblocking filters share the difference and
yading@10 5399 flatness values so you cannot set different horizontal and vertical
yading@10 5400 thresholds.
yading@10 5401 .IP "\fBh1/x1hdeblock\fR" 4
yading@10 5402 .IX Item "h1/x1hdeblock"
yading@10 5403 Experimental horizontal deblocking filter
yading@10 5404 .IP "\fBv1/x1vdeblock\fR" 4
yading@10 5405 .IX Item "v1/x1vdeblock"
yading@10 5406 Experimental vertical deblocking filter
yading@10 5407 .IP "\fBdr/dering\fR" 4
yading@10 5408 .IX Item "dr/dering"
yading@10 5409 Deringing filter
yading@10 5410 .IP "\fBtn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer\fR" 4
yading@10 5411 .IX Item "tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer"
yading@10 5412 .RS 4
yading@10 5413 .PD 0
yading@10 5414 .IP "\fBthreshold1\fR" 4
yading@10 5415 .IX Item "threshold1"
yading@10 5416 .PD
yading@10 5417 larger \-> stronger filtering
yading@10 5418 .IP "\fBthreshold2\fR" 4
yading@10 5419 .IX Item "threshold2"
yading@10 5420 larger \-> stronger filtering
yading@10 5421 .IP "\fBthreshold3\fR" 4
yading@10 5422 .IX Item "threshold3"
yading@10 5423 larger \-> stronger filtering
yading@10 5424 .RE
yading@10 5425 .RS 4
yading@10 5426 .RE
yading@10 5427 .IP "\fBal/autolevels[:f/fullyrange], automatic brightness / contrast correction\fR" 4
yading@10 5428 .IX Item "al/autolevels[:f/fullyrange], automatic brightness / contrast correction"
yading@10 5429 .RS 4
yading@10 5430 .PD 0
yading@10 5431 .IP "\fBf/fullyrange\fR" 4
yading@10 5432 .IX Item "f/fullyrange"
yading@10 5433 .PD
yading@10 5434 Stretch luminance to \f(CW\*(C`0\-255\*(C'\fR.
yading@10 5435 .RE
yading@10 5436 .RS 4
yading@10 5437 .RE
yading@10 5438 .IP "\fBlb/linblenddeint\fR" 4
yading@10 5439 .IX Item "lb/linblenddeint"
yading@10 5440 Linear blend deinterlacing filter that deinterlaces the given block by
yading@10 5441 filtering all lines with a \f(CW\*(C`(1 2 1)\*(C'\fR filter.
yading@10 5442 .IP "\fBli/linipoldeint\fR" 4
yading@10 5443 .IX Item "li/linipoldeint"
yading@10 5444 Linear interpolating deinterlacing filter that deinterlaces the given block by
yading@10 5445 linearly interpolating every second line.
yading@10 5446 .IP "\fBci/cubicipoldeint\fR" 4
yading@10 5447 .IX Item "ci/cubicipoldeint"
yading@10 5448 Cubic interpolating deinterlacing filter deinterlaces the given block by
yading@10 5449 cubically interpolating every second line.
yading@10 5450 .IP "\fBmd/mediandeint\fR" 4
yading@10 5451 .IX Item "md/mediandeint"
yading@10 5452 Median deinterlacing filter that deinterlaces the given block by applying a
yading@10 5453 median filter to every second line.
yading@10 5454 .IP "\fBfd/ffmpegdeint\fR" 4
yading@10 5455 .IX Item "fd/ffmpegdeint"
yading@10 5456 FFmpeg deinterlacing filter that deinterlaces the given block by filtering every
yading@10 5457 second line with a \f(CW\*(C`(\-1 4 2 4 \-1)\*(C'\fR filter.
yading@10 5458 .IP "\fBl5/lowpass5\fR" 4
yading@10 5459 .IX Item "l5/lowpass5"
yading@10 5460 Vertically applied \s-1FIR\s0 lowpass deinterlacing filter that deinterlaces the given
yading@10 5461 block by filtering all lines with a \f(CW\*(C`(\-1 2 6 2 \-1)\*(C'\fR filter.
yading@10 5462 .IP "\fBfq/forceQuant[|quantizer]\fR" 4
yading@10 5463 .IX Item "fq/forceQuant[|quantizer]"
yading@10 5464 Overrides the quantizer table from the input with the constant quantizer you
yading@10 5465 specify.
yading@10 5466 .RS 4
yading@10 5467 .IP "\fBquantizer\fR" 4
yading@10 5468 .IX Item "quantizer"
yading@10 5469 Quantizer to use
yading@10 5470 .RE
yading@10 5471 .RS 4
yading@10 5472 .RE
yading@10 5473 .IP "\fBde/default\fR" 4
yading@10 5474 .IX Item "de/default"
yading@10 5475 Default pp filter combination (\f(CW\*(C`hb|a,vb|a,dr|a\*(C'\fR)
yading@10 5476 .IP "\fBfa/fast\fR" 4
yading@10 5477 .IX Item "fa/fast"
yading@10 5478 Fast pp filter combination (\f(CW\*(C`h1|a,v1|a,dr|a\*(C'\fR)
yading@10 5479 .IP "\fBac\fR" 4
yading@10 5480 .IX Item "ac"
yading@10 5481 High quality pp filter combination (\f(CW\*(C`ha|a|128|7,va|a,dr|a\*(C'\fR)
yading@10 5482 .PP
yading@10 5483 \fIExamples\fR
yading@10 5484 .IX Subsection "Examples"
yading@10 5485 .IP "\(bu" 4
yading@10 5486 Apply horizontal and vertical deblocking, deringing and automatic
yading@10 5487 brightness/contrast:
yading@10 5488 .Sp
yading@10 5489 .Vb 1
yading@10 5490 \& pp=hb/vb/dr/al
yading@10 5491 .Ve
yading@10 5492 .IP "\(bu" 4
yading@10 5493 Apply default filters without brightness/contrast correction:
yading@10 5494 .Sp
yading@10 5495 .Vb 1
yading@10 5496 \& pp=de/\-al
yading@10 5497 .Ve
yading@10 5498 .IP "\(bu" 4
yading@10 5499 Apply default filters and temporal denoiser:
yading@10 5500 .Sp
yading@10 5501 .Vb 1
yading@10 5502 \& pp=default/tmpnoise|1|2|3
yading@10 5503 .Ve
yading@10 5504 .IP "\(bu" 4
yading@10 5505 Apply deblocking on luminance only, and switch vertical deblocking on or off
yading@10 5506 automatically depending on available \s-1CPU\s0 time:
yading@10 5507 .Sp
yading@10 5508 .Vb 1
yading@10 5509 \& pp=hb|y/vb|a
yading@10 5510 .Ve
yading@10 5511 .SS "removelogo"
yading@10 5512 .IX Subsection "removelogo"
yading@10 5513 Suppress a \s-1TV\s0 station logo, using an image file to determine which
yading@10 5514 pixels comprise the logo. It works by filling in the pixels that
yading@10 5515 comprise the logo with neighboring pixels.
yading@10 5516 .PP
yading@10 5517 The filters accept the following options:
yading@10 5518 .IP "\fBfilename, f\fR" 4
yading@10 5519 .IX Item "filename, f"
yading@10 5520 Set the filter bitmap file, which can be any image format supported by
yading@10 5521 libavformat. The width and height of the image file must match those of the
yading@10 5522 video stream being processed.
yading@10 5523 .PP
yading@10 5524 Pixels in the provided bitmap image with a value of zero are not
yading@10 5525 considered part of the logo, non-zero pixels are considered part of
yading@10 5526 the logo. If you use white (255) for the logo and black (0) for the
yading@10 5527 rest, you will be safe. For making the filter bitmap, it is
yading@10 5528 recommended to take a screen capture of a black frame with the logo
yading@10 5529 visible, and then using a threshold filter followed by the erode
yading@10 5530 filter once or twice.
yading@10 5531 .PP
yading@10 5532 If needed, little splotches can be fixed manually. Remember that if
yading@10 5533 logo pixels are not covered, the filter quality will be much
yading@10 5534 reduced. Marking too many pixels as part of the logo does not hurt as
yading@10 5535 much, but it will increase the amount of blurring needed to cover over
yading@10 5536 the image and will destroy more information than necessary, and extra
yading@10 5537 pixels will slow things down on a large logo.
yading@10 5538 .SS "scale"
yading@10 5539 .IX Subsection "scale"
yading@10 5540 Scale (resize) the input video, using the libswscale library.
yading@10 5541 .PP
yading@10 5542 The scale filter forces the output display aspect ratio to be the same
yading@10 5543 of the input, by changing the output sample aspect ratio.
yading@10 5544 .PP
yading@10 5545 The filter accepts the following options:
yading@10 5546 .IP "\fBwidth, w\fR" 4
yading@10 5547 .IX Item "width, w"
yading@10 5548 Output video width.
yading@10 5549 default value is \f(CW\*(C`iw\*(C'\fR. See below
yading@10 5550 for the list of accepted constants.
yading@10 5551 .IP "\fBheight, h\fR" 4
yading@10 5552 .IX Item "height, h"
yading@10 5553 Output video height.
yading@10 5554 default value is \f(CW\*(C`ih\*(C'\fR.
yading@10 5555 See below for the list of accepted constants.
yading@10 5556 .IP "\fBinterl\fR" 4
yading@10 5557 .IX Item "interl"
yading@10 5558 Set the interlacing. It accepts the following values:
yading@10 5559 .RS 4
yading@10 5560 .IP "\fB1\fR" 4
yading@10 5561 .IX Item "1"
yading@10 5562 force interlaced aware scaling
yading@10 5563 .IP "\fB0\fR" 4
yading@10 5564 .IX Item "0"
yading@10 5565 do not apply interlaced scaling
yading@10 5566 .IP "\fB\-1\fR" 4
yading@10 5567 .IX Item "-1"
yading@10 5568 select interlaced aware scaling depending on whether the source frames
yading@10 5569 are flagged as interlaced or not
yading@10 5570 .RE
yading@10 5571 .RS 4
yading@10 5572 .Sp
yading@10 5573 Default value is \f(CW0\fR.
yading@10 5574 .RE
yading@10 5575 .IP "\fBflags\fR" 4
yading@10 5576 .IX Item "flags"
yading@10 5577 Set libswscale scaling flags. If not explictly specified the filter
yading@10 5578 applies a bilinear scaling algorithm.
yading@10 5579 .IP "\fBsize, s\fR" 4
yading@10 5580 .IX Item "size, s"
yading@10 5581 Set the video size, the value must be a valid abbreviation or in the
yading@10 5582 form \fIwidth\fRx\fIheight\fR.
yading@10 5583 .PP
yading@10 5584 The values of the \fIw\fR and \fIh\fR options are expressions
yading@10 5585 containing the following constants:
yading@10 5586 .IP "\fBin_w, in_h\fR" 4
yading@10 5587 .IX Item "in_w, in_h"
yading@10 5588 the input width and height
yading@10 5589 .IP "\fBiw, ih\fR" 4
yading@10 5590 .IX Item "iw, ih"
yading@10 5591 same as \fIin_w\fR and \fIin_h\fR
yading@10 5592 .IP "\fBout_w, out_h\fR" 4
yading@10 5593 .IX Item "out_w, out_h"
yading@10 5594 the output (cropped) width and height
yading@10 5595 .IP "\fBow, oh\fR" 4
yading@10 5596 .IX Item "ow, oh"
yading@10 5597 same as \fIout_w\fR and \fIout_h\fR
yading@10 5598 .IP "\fBa\fR" 4
yading@10 5599 .IX Item "a"
yading@10 5600 same as \fIiw\fR / \fIih\fR
yading@10 5601 .IP "\fBsar\fR" 4
yading@10 5602 .IX Item "sar"
yading@10 5603 input sample aspect ratio
yading@10 5604 .IP "\fBdar\fR" 4
yading@10 5605 .IX Item "dar"
yading@10 5606 input display aspect ratio, it is the same as (\fIiw\fR / \fIih\fR) * \fIsar\fR
yading@10 5607 .IP "\fBhsub, vsub\fR" 4
yading@10 5608 .IX Item "hsub, vsub"
yading@10 5609 horizontal and vertical chroma subsample values. For example for the
yading@10 5610 pixel format \*(L"yuv422p\*(R" \fIhsub\fR is 2 and \fIvsub\fR is 1.
yading@10 5611 .PP
yading@10 5612 If the input image format is different from the format requested by
yading@10 5613 the next filter, the scale filter will convert the input to the
yading@10 5614 requested format.
yading@10 5615 .PP
yading@10 5616 If the value for \fIw\fR or \fIh\fR is 0, the respective input
yading@10 5617 size is used for the output.
yading@10 5618 .PP
yading@10 5619 If the value for \fIw\fR or \fIh\fR is \-1, the scale filter will use, for the
yading@10 5620 respective output size, a value that maintains the aspect ratio of the input
yading@10 5621 image.
yading@10 5622 .PP
yading@10 5623 \fIExamples\fR
yading@10 5624 .IX Subsection "Examples"
yading@10 5625 .IP "\(bu" 4
yading@10 5626 Scale the input video to a size of 200x100:
yading@10 5627 .Sp
yading@10 5628 .Vb 1
yading@10 5629 \& scale=w=200:h=100
yading@10 5630 .Ve
yading@10 5631 .Sp
yading@10 5632 This is equivalent to:
yading@10 5633 .Sp
yading@10 5634 .Vb 1
yading@10 5635 \& scale=w=200:h=100
yading@10 5636 .Ve
yading@10 5637 .Sp
yading@10 5638 or:
yading@10 5639 .Sp
yading@10 5640 .Vb 1
yading@10 5641 \& scale=200x100
yading@10 5642 .Ve
yading@10 5643 .IP "\(bu" 4
yading@10 5644 Specify a size abbreviation for the output size:
yading@10 5645 .Sp
yading@10 5646 .Vb 1
yading@10 5647 \& scale=qcif
yading@10 5648 .Ve
yading@10 5649 .Sp
yading@10 5650 which can also be written as:
yading@10 5651 .Sp
yading@10 5652 .Vb 1
yading@10 5653 \& scale=size=qcif
yading@10 5654 .Ve
yading@10 5655 .IP "\(bu" 4
yading@10 5656 Scale the input to 2x:
yading@10 5657 .Sp
yading@10 5658 .Vb 1
yading@10 5659 \& scale=w=2*iw:h=2*ih
yading@10 5660 .Ve
yading@10 5661 .IP "\(bu" 4
yading@10 5662 The above is the same as:
yading@10 5663 .Sp
yading@10 5664 .Vb 1
yading@10 5665 \& scale=2*in_w:2*in_h
yading@10 5666 .Ve
yading@10 5667 .IP "\(bu" 4
yading@10 5668 Scale the input to 2x with forced interlaced scaling:
yading@10 5669 .Sp
yading@10 5670 .Vb 1
yading@10 5671 \& scale=2*iw:2*ih:interl=1
yading@10 5672 .Ve
yading@10 5673 .IP "\(bu" 4
yading@10 5674 Scale the input to half size:
yading@10 5675 .Sp
yading@10 5676 .Vb 1
yading@10 5677 \& scale=w=iw/2:h=ih/2
yading@10 5678 .Ve
yading@10 5679 .IP "\(bu" 4
yading@10 5680 Increase the width, and set the height to the same size:
yading@10 5681 .Sp
yading@10 5682 .Vb 1
yading@10 5683 \& scale=3/2*iw:ow
yading@10 5684 .Ve
yading@10 5685 .IP "\(bu" 4
yading@10 5686 Seek for Greek harmony:
yading@10 5687 .Sp
yading@10 5688 .Vb 2
yading@10 5689 \& scale=iw:1/PHI*iw
yading@10 5690 \& scale=ih*PHI:ih
yading@10 5691 .Ve
yading@10 5692 .IP "\(bu" 4
yading@10 5693 Increase the height, and set the width to 3/2 of the height:
yading@10 5694 .Sp
yading@10 5695 .Vb 1
yading@10 5696 \& scale=w=3/2*oh:h=3/5*ih
yading@10 5697 .Ve
yading@10 5698 .IP "\(bu" 4
yading@10 5699 Increase the size, but make the size a multiple of the chroma
yading@10 5700 subsample values:
yading@10 5701 .Sp
yading@10 5702 .Vb 1
yading@10 5703 \& scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
yading@10 5704 .Ve
yading@10 5705 .IP "\(bu" 4
yading@10 5706 Increase the width to a maximum of 500 pixels, keep the same input
yading@10 5707 aspect ratio:
yading@10 5708 .Sp
yading@10 5709 .Vb 1
yading@10 5710 \& scale=w=\*(Aqmin(500\e, iw*3/2):h=\-1\*(Aq
yading@10 5711 .Ve
yading@10 5712 .SS "separatefields"
yading@10 5713 .IX Subsection "separatefields"
yading@10 5714 The \f(CW\*(C`separatefields\*(C'\fR takes a frame-based video input and splits
yading@10 5715 each frame into its components fields, producing a new half height clip
yading@10 5716 with twice the frame rate and twice the frame count.
yading@10 5717 .PP
yading@10 5718 This filter use field-dominance information in frame to decide which
yading@10 5719 of each pair of fields to place first in the output.
yading@10 5720 If it gets it wrong use setfield filter before \f(CW\*(C`separatefields\*(C'\fR filter.
yading@10 5721 .SS "setdar, setsar"
yading@10 5722 .IX Subsection "setdar, setsar"
yading@10 5723 The \f(CW\*(C`setdar\*(C'\fR filter sets the Display Aspect Ratio for the filter
yading@10 5724 output video.
yading@10 5725 .PP
yading@10 5726 This is done by changing the specified Sample (aka Pixel) Aspect
yading@10 5727 Ratio, according to the following equation:
yading@10 5728 .PP
yading@10 5729 .Vb 1
yading@10 5730 \& <DAR> = <HORIZONTAL_RESOLUTION> / <VERTICAL_RESOLUTION> * <SAR>
yading@10 5731 .Ve
yading@10 5732 .PP
yading@10 5733 Keep in mind that the \f(CW\*(C`setdar\*(C'\fR filter does not modify the pixel
yading@10 5734 dimensions of the video frame. Also the display aspect ratio set by
yading@10 5735 this filter may be changed by later filters in the filterchain,
yading@10 5736 e.g. in case of scaling or if another \*(L"setdar\*(R" or a \*(L"setsar\*(R" filter is
yading@10 5737 applied.
yading@10 5738 .PP
yading@10 5739 The \f(CW\*(C`setsar\*(C'\fR filter sets the Sample (aka Pixel) Aspect Ratio for
yading@10 5740 the filter output video.
yading@10 5741 .PP
yading@10 5742 Note that as a consequence of the application of this filter, the
yading@10 5743 output display aspect ratio will change according to the equation
yading@10 5744 above.
yading@10 5745 .PP
yading@10 5746 Keep in mind that the sample aspect ratio set by the \f(CW\*(C`setsar\*(C'\fR
yading@10 5747 filter may be changed by later filters in the filterchain, e.g. if
yading@10 5748 another \*(L"setsar\*(R" or a \*(L"setdar\*(R" filter is applied.
yading@10 5749 .PP
yading@10 5750 The filters accept the following options:
yading@10 5751 .ie n .IP "\fBr, ratio, dar (\fB""setdar""\fB only), sar (\f(BI""setsar""\fB only)\fR" 4
yading@10 5752 .el .IP "\fBr, ratio, dar (\f(CBsetdar\fB only), sar (\f(CBsetsar\fB only)\fR" 4
yading@10 5753 .IX Item "r, ratio, dar (setdar only), sar (setsar only)"
yading@10 5754 Set the aspect ratio used by the filter.
yading@10 5755 .Sp
yading@10 5756 The parameter can be a floating point number string, an expression, or
yading@10 5757 a string of the form \fInum\fR:\fIden\fR, where \fInum\fR and
yading@10 5758 \&\fIden\fR are the numerator and denominator of the aspect ratio. If
yading@10 5759 the parameter is not specified, it is assumed the value \*(L"0\*(R".
yading@10 5760 In case the form "\fInum\fR:\fIden\fR" is used, the \f(CW\*(C`:\*(C'\fR character
yading@10 5761 should be escaped.
yading@10 5762 .IP "\fBmax\fR" 4
yading@10 5763 .IX Item "max"
yading@10 5764 Set the maximum integer value to use for expressing numerator and
yading@10 5765 denominator when reducing the expressed aspect ratio to a rational.
yading@10 5766 Default value is \f(CW100\fR.
yading@10 5767 .PP
yading@10 5768 \fIExamples\fR
yading@10 5769 .IX Subsection "Examples"
yading@10 5770 .IP "\(bu" 4
yading@10 5771 To change the display aspect ratio to 16:9, specify one of the following:
yading@10 5772 .Sp
yading@10 5773 .Vb 3
yading@10 5774 \& setdar=dar=1.77777
yading@10 5775 \& setdar=dar=16/9
yading@10 5776 \& setdar=dar=1.77777
yading@10 5777 .Ve
yading@10 5778 .IP "\(bu" 4
yading@10 5779 To change the sample aspect ratio to 10:11, specify:
yading@10 5780 .Sp
yading@10 5781 .Vb 1
yading@10 5782 \& setsar=sar=10/11
yading@10 5783 .Ve
yading@10 5784 .IP "\(bu" 4
yading@10 5785 To set a display aspect ratio of 16:9, and specify a maximum integer value of
yading@10 5786 1000 in the aspect ratio reduction, use the command:
yading@10 5787 .Sp
yading@10 5788 .Vb 1
yading@10 5789 \& setdar=ratio=16/9:max=1000
yading@10 5790 .Ve
yading@10 5791 .SS "setfield"
yading@10 5792 .IX Subsection "setfield"
yading@10 5793 Force field for the output video frame.
yading@10 5794 .PP
yading@10 5795 The \f(CW\*(C`setfield\*(C'\fR filter marks the interlace type field for the
yading@10 5796 output frames. It does not change the input frame, but only sets the
yading@10 5797 corresponding property, which affects how the frame is treated by
yading@10 5798 following filters (e.g. \f(CW\*(C`fieldorder\*(C'\fR or \f(CW\*(C`yadif\*(C'\fR).
yading@10 5799 .PP
yading@10 5800 The filter accepts the following options:
yading@10 5801 .IP "\fBmode\fR" 4
yading@10 5802 .IX Item "mode"
yading@10 5803 Available values are:
yading@10 5804 .RS 4
yading@10 5805 .IP "\fBauto\fR" 4
yading@10 5806 .IX Item "auto"
yading@10 5807 Keep the same field property.
yading@10 5808 .IP "\fBbff\fR" 4
yading@10 5809 .IX Item "bff"
yading@10 5810 Mark the frame as bottom-field-first.
yading@10 5811 .IP "\fBtff\fR" 4
yading@10 5812 .IX Item "tff"
yading@10 5813 Mark the frame as top-field-first.
yading@10 5814 .IP "\fBprog\fR" 4
yading@10 5815 .IX Item "prog"
yading@10 5816 Mark the frame as progressive.
yading@10 5817 .RE
yading@10 5818 .RS 4
yading@10 5819 .RE
yading@10 5820 .SS "showinfo"
yading@10 5821 .IX Subsection "showinfo"
yading@10 5822 Show a line containing various information for each input video frame.
yading@10 5823 The input video is not modified.
yading@10 5824 .PP
yading@10 5825 The shown line contains a sequence of key/value pairs of the form
yading@10 5826 \&\fIkey\fR:\fIvalue\fR.
yading@10 5827 .PP
yading@10 5828 A description of each shown parameter follows:
yading@10 5829 .IP "\fBn\fR" 4
yading@10 5830 .IX Item "n"
yading@10 5831 sequential number of the input frame, starting from 0
yading@10 5832 .IP "\fBpts\fR" 4
yading@10 5833 .IX Item "pts"
yading@10 5834 Presentation TimeStamp of the input frame, expressed as a number of
yading@10 5835 time base units. The time base unit depends on the filter input pad.
yading@10 5836 .IP "\fBpts_time\fR" 4
yading@10 5837 .IX Item "pts_time"
yading@10 5838 Presentation TimeStamp of the input frame, expressed as a number of
yading@10 5839 seconds
yading@10 5840 .IP "\fBpos\fR" 4
yading@10 5841 .IX Item "pos"
yading@10 5842 position of the frame in the input stream, \-1 if this information in
yading@10 5843 unavailable and/or meaningless (for example in case of synthetic video)
yading@10 5844 .IP "\fBfmt\fR" 4
yading@10 5845 .IX Item "fmt"
yading@10 5846 pixel format name
yading@10 5847 .IP "\fBsar\fR" 4
yading@10 5848 .IX Item "sar"
yading@10 5849 sample aspect ratio of the input frame, expressed in the form
yading@10 5850 \&\fInum\fR/\fIden\fR
yading@10 5851 .IP "\fBs\fR" 4
yading@10 5852 .IX Item "s"
yading@10 5853 size of the input frame, expressed in the form
yading@10 5854 \&\fIwidth\fRx\fIheight\fR
yading@10 5855 .IP "\fBi\fR" 4
yading@10 5856 .IX Item "i"
yading@10 5857 interlaced mode (\*(L"P\*(R" for \*(L"progressive\*(R", \*(L"T\*(R" for top field first, \*(L"B\*(R"
yading@10 5858 for bottom field first)
yading@10 5859 .IP "\fBiskey\fR" 4
yading@10 5860 .IX Item "iskey"
yading@10 5861 1 if the frame is a key frame, 0 otherwise
yading@10 5862 .IP "\fBtype\fR" 4
yading@10 5863 .IX Item "type"
yading@10 5864 picture type of the input frame (\*(L"I\*(R" for an I\-frame, \*(L"P\*(R" for a
yading@10 5865 P\-frame, \*(L"B\*(R" for a B\-frame, \*(L"?\*(R" for unknown type).
yading@10 5866 Check also the documentation of the \f(CW\*(C`AVPictureType\*(C'\fR enum and of
yading@10 5867 the \f(CW\*(C`av_get_picture_type_char\*(C'\fR function defined in
yading@10 5868 \&\fIlibavutil/avutil.h\fR.
yading@10 5869 .IP "\fBchecksum\fR" 4
yading@10 5870 .IX Item "checksum"
yading@10 5871 Adler\-32 checksum (printed in hexadecimal) of all the planes of the input frame
yading@10 5872 .IP "\fBplane_checksum\fR" 4
yading@10 5873 .IX Item "plane_checksum"
yading@10 5874 Adler\-32 checksum (printed in hexadecimal) of each plane of the input frame,
yading@10 5875 expressed in the form "[\fIc0\fR \fIc1\fR \fIc2\fR \fIc3\fR]"
yading@10 5876 .SS "smartblur"
yading@10 5877 .IX Subsection "smartblur"
yading@10 5878 Blur the input video without impacting the outlines.
yading@10 5879 .PP
yading@10 5880 The filter accepts the following options:
yading@10 5881 .IP "\fBluma_radius, lr\fR" 4
yading@10 5882 .IX Item "luma_radius, lr"
yading@10 5883 Set the luma radius. The option value must be a float number in
yading@10 5884 the range [0.1,5.0] that specifies the variance of the gaussian filter
yading@10 5885 used to blur the image (slower if larger). Default value is 1.0.
yading@10 5886 .IP "\fBluma_strength, ls\fR" 4
yading@10 5887 .IX Item "luma_strength, ls"
yading@10 5888 Set the luma strength. The option value must be a float number
yading@10 5889 in the range [\-1.0,1.0] that configures the blurring. A value included
yading@10 5890 in [0.0,1.0] will blur the image whereas a value included in
yading@10 5891 [\-1.0,0.0] will sharpen the image. Default value is 1.0.
yading@10 5892 .IP "\fBluma_threshold, lt\fR" 4
yading@10 5893 .IX Item "luma_threshold, lt"
yading@10 5894 Set the luma threshold used as a coefficient to determine
yading@10 5895 whether a pixel should be blurred or not. The option value must be an
yading@10 5896 integer in the range [\-30,30]. A value of 0 will filter all the image,
yading@10 5897 a value included in [0,30] will filter flat areas and a value included
yading@10 5898 in [\-30,0] will filter edges. Default value is 0.
yading@10 5899 .IP "\fBchroma_radius, cr\fR" 4
yading@10 5900 .IX Item "chroma_radius, cr"
yading@10 5901 Set the chroma radius. The option value must be a float number in
yading@10 5902 the range [0.1,5.0] that specifies the variance of the gaussian filter
yading@10 5903 used to blur the image (slower if larger). Default value is 1.0.
yading@10 5904 .IP "\fBchroma_strength, cs\fR" 4
yading@10 5905 .IX Item "chroma_strength, cs"
yading@10 5906 Set the chroma strength. The option value must be a float number
yading@10 5907 in the range [\-1.0,1.0] that configures the blurring. A value included
yading@10 5908 in [0.0,1.0] will blur the image whereas a value included in
yading@10 5909 [\-1.0,0.0] will sharpen the image. Default value is 1.0.
yading@10 5910 .IP "\fBchroma_threshold, ct\fR" 4
yading@10 5911 .IX Item "chroma_threshold, ct"
yading@10 5912 Set the chroma threshold used as a coefficient to determine
yading@10 5913 whether a pixel should be blurred or not. The option value must be an
yading@10 5914 integer in the range [\-30,30]. A value of 0 will filter all the image,
yading@10 5915 a value included in [0,30] will filter flat areas and a value included
yading@10 5916 in [\-30,0] will filter edges. Default value is 0.
yading@10 5917 .PP
yading@10 5918 If a chroma option is not explicitly set, the corresponding luma value
yading@10 5919 is set.
yading@10 5920 .SS "stereo3d"
yading@10 5921 .IX Subsection "stereo3d"
yading@10 5922 Convert between different stereoscopic image formats.
yading@10 5923 .PP
yading@10 5924 The filters accept the following options:
yading@10 5925 .IP "\fBin\fR" 4
yading@10 5926 .IX Item "in"
yading@10 5927 Set stereoscopic image format of input.
yading@10 5928 .Sp
yading@10 5929 Available values for input image formats are:
yading@10 5930 .RS 4
yading@10 5931 .IP "\fBsbsl\fR" 4
yading@10 5932 .IX Item "sbsl"
yading@10 5933 side by side parallel (left eye left, right eye right)
yading@10 5934 .IP "\fBsbsr\fR" 4
yading@10 5935 .IX Item "sbsr"
yading@10 5936 side by side crosseye (right eye left, left eye right)
yading@10 5937 .IP "\fBsbs2l\fR" 4
yading@10 5938 .IX Item "sbs2l"
yading@10 5939 side by side parallel with half width resolution
yading@10 5940 (left eye left, right eye right)
yading@10 5941 .IP "\fBsbs2r\fR" 4
yading@10 5942 .IX Item "sbs2r"
yading@10 5943 side by side crosseye with half width resolution
yading@10 5944 (right eye left, left eye right)
yading@10 5945 .IP "\fBabl\fR" 4
yading@10 5946 .IX Item "abl"
yading@10 5947 above-below (left eye above, right eye below)
yading@10 5948 .IP "\fBabr\fR" 4
yading@10 5949 .IX Item "abr"
yading@10 5950 above-below (right eye above, left eye below)
yading@10 5951 .IP "\fBab2l\fR" 4
yading@10 5952 .IX Item "ab2l"
yading@10 5953 above-below with half height resolution
yading@10 5954 (left eye above, right eye below)
yading@10 5955 .IP "\fBab2r\fR" 4
yading@10 5956 .IX Item "ab2r"
yading@10 5957 above-below with half height resolution
yading@10 5958 (right eye above, left eye below)
yading@10 5959 .Sp
yading@10 5960 Default value is \fBsbsl\fR.
yading@10 5961 .RE
yading@10 5962 .RS 4
yading@10 5963 .RE
yading@10 5964 .IP "\fBout\fR" 4
yading@10 5965 .IX Item "out"
yading@10 5966 Set stereoscopic image format of output.
yading@10 5967 .Sp
yading@10 5968 Available values for output image formats are all the input formats as well as:
yading@10 5969 .RS 4
yading@10 5970 .IP "\fBarbg\fR" 4
yading@10 5971 .IX Item "arbg"
yading@10 5972 anaglyph red/blue gray
yading@10 5973 (red filter on left eye, blue filter on right eye)
yading@10 5974 .IP "\fBargg\fR" 4
yading@10 5975 .IX Item "argg"
yading@10 5976 anaglyph red/green gray
yading@10 5977 (red filter on left eye, green filter on right eye)
yading@10 5978 .IP "\fBarcg\fR" 4
yading@10 5979 .IX Item "arcg"
yading@10 5980 anaglyph red/cyan gray
yading@10 5981 (red filter on left eye, cyan filter on right eye)
yading@10 5982 .IP "\fBarch\fR" 4
yading@10 5983 .IX Item "arch"
yading@10 5984 anaglyph red/cyan half colored
yading@10 5985 (red filter on left eye, cyan filter on right eye)
yading@10 5986 .IP "\fBarcc\fR" 4
yading@10 5987 .IX Item "arcc"
yading@10 5988 anaglyph red/cyan color
yading@10 5989 (red filter on left eye, cyan filter on right eye)
yading@10 5990 .IP "\fBarcd\fR" 4
yading@10 5991 .IX Item "arcd"
yading@10 5992 anaglyph red/cyan color optimized with the least squares projection of dubois
yading@10 5993 (red filter on left eye, cyan filter on right eye)
yading@10 5994 .IP "\fBagmg\fR" 4
yading@10 5995 .IX Item "agmg"
yading@10 5996 anaglyph green/magenta gray
yading@10 5997 (green filter on left eye, magenta filter on right eye)
yading@10 5998 .IP "\fBagmh\fR" 4
yading@10 5999 .IX Item "agmh"
yading@10 6000 anaglyph green/magenta half colored
yading@10 6001 (green filter on left eye, magenta filter on right eye)
yading@10 6002 .IP "\fBagmc\fR" 4
yading@10 6003 .IX Item "agmc"
yading@10 6004 anaglyph green/magenta colored
yading@10 6005 (green filter on left eye, magenta filter on right eye)
yading@10 6006 .IP "\fBagmd\fR" 4
yading@10 6007 .IX Item "agmd"
yading@10 6008 anaglyph green/magenta color optimized with the least squares projection of dubois
yading@10 6009 (green filter on left eye, magenta filter on right eye)
yading@10 6010 .IP "\fBaybg\fR" 4
yading@10 6011 .IX Item "aybg"
yading@10 6012 anaglyph yellow/blue gray
yading@10 6013 (yellow filter on left eye, blue filter on right eye)
yading@10 6014 .IP "\fBaybh\fR" 4
yading@10 6015 .IX Item "aybh"
yading@10 6016 anaglyph yellow/blue half colored
yading@10 6017 (yellow filter on left eye, blue filter on right eye)
yading@10 6018 .IP "\fBaybc\fR" 4
yading@10 6019 .IX Item "aybc"
yading@10 6020 anaglyph yellow/blue colored
yading@10 6021 (yellow filter on left eye, blue filter on right eye)
yading@10 6022 .IP "\fBaybd\fR" 4
yading@10 6023 .IX Item "aybd"
yading@10 6024 anaglyph yellow/blue color optimized with the least squares projection of dubois
yading@10 6025 (yellow filter on left eye, blue filter on right eye)
yading@10 6026 .IP "\fBirl\fR" 4
yading@10 6027 .IX Item "irl"
yading@10 6028 interleaved rows (left eye has top row, right eye starts on next row)
yading@10 6029 .IP "\fBirr\fR" 4
yading@10 6030 .IX Item "irr"
yading@10 6031 interleaved rows (right eye has top row, left eye starts on next row)
yading@10 6032 .IP "\fBml\fR" 4
yading@10 6033 .IX Item "ml"
yading@10 6034 mono output (left eye only)
yading@10 6035 .IP "\fBmr\fR" 4
yading@10 6036 .IX Item "mr"
yading@10 6037 mono output (right eye only)
yading@10 6038 .RE
yading@10 6039 .RS 4
yading@10 6040 .Sp
yading@10 6041 Default value is \fBarcd\fR.
yading@10 6042 .RE
yading@10 6043 .SS "subtitles"
yading@10 6044 .IX Subsection "subtitles"
yading@10 6045 Draw subtitles on top of input video using the libass library.
yading@10 6046 .PP
yading@10 6047 To enable compilation of this filter you need to configure FFmpeg with
yading@10 6048 \&\f(CW\*(C`\-\-enable\-libass\*(C'\fR. This filter also requires a build with libavcodec and
yading@10 6049 libavformat to convert the passed subtitles file to \s-1ASS\s0 (Advanced Substation
yading@10 6050 Alpha) subtitles format.
yading@10 6051 .PP
yading@10 6052 The filter accepts the following options:
yading@10 6053 .IP "\fBfilename, f\fR" 4
yading@10 6054 .IX Item "filename, f"
yading@10 6055 Set the filename of the subtitle file to read. It must be specified.
yading@10 6056 .IP "\fBoriginal_size\fR" 4
yading@10 6057 .IX Item "original_size"
yading@10 6058 Specify the size of the original video, the video for which the \s-1ASS\s0 file
yading@10 6059 was composed. Due to a misdesign in \s-1ASS\s0 aspect ratio arithmetic, this is
yading@10 6060 necessary to correctly scale the fonts if the aspect ratio has been changed.
yading@10 6061 .IP "\fBcharenc\fR" 4
yading@10 6062 .IX Item "charenc"
yading@10 6063 Set subtitles input character encoding. \f(CW\*(C`subtitles\*(C'\fR filter only. Only
yading@10 6064 useful if not \s-1UTF\-8\s0.
yading@10 6065 .PP
yading@10 6066 If the first key is not specified, it is assumed that the first value
yading@10 6067 specifies the \fBfilename\fR.
yading@10 6068 .PP
yading@10 6069 For example, to render the file \fIsub.srt\fR on top of the input
yading@10 6070 video, use the command:
yading@10 6071 .PP
yading@10 6072 .Vb 1
yading@10 6073 \& subtitles=sub.srt
yading@10 6074 .Ve
yading@10 6075 .PP
yading@10 6076 which is equivalent to:
yading@10 6077 .PP
yading@10 6078 .Vb 1
yading@10 6079 \& subtitles=filename=sub.srt
yading@10 6080 .Ve
yading@10 6081 .SS "super2xsai"
yading@10 6082 .IX Subsection "super2xsai"
yading@10 6083 Scale the input by 2x and smooth using the Super2xSaI (Scale and
yading@10 6084 Interpolate) pixel art scaling algorithm.
yading@10 6085 .PP
yading@10 6086 Useful for enlarging pixel art images without reducing sharpness.
yading@10 6087 .SS "swapuv"
yading@10 6088 .IX Subsection "swapuv"
yading@10 6089 Swap U & V plane.
yading@10 6090 .SS "telecine"
yading@10 6091 .IX Subsection "telecine"
yading@10 6092 Apply telecine process to the video.
yading@10 6093 .PP
yading@10 6094 This filter accepts the following options:
yading@10 6095 .IP "\fBfirst_field\fR" 4
yading@10 6096 .IX Item "first_field"
yading@10 6097 .RS 4
yading@10 6098 .PD 0
yading@10 6099 .IP "\fBtop, t\fR" 4
yading@10 6100 .IX Item "top, t"
yading@10 6101 .PD
yading@10 6102 top field first
yading@10 6103 .IP "\fBbottom, b\fR" 4
yading@10 6104 .IX Item "bottom, b"
yading@10 6105 bottom field first
yading@10 6106 The default value is \f(CW\*(C`top\*(C'\fR.
yading@10 6107 .RE
yading@10 6108 .RS 4
yading@10 6109 .RE
yading@10 6110 .IP "\fBpattern\fR" 4
yading@10 6111 .IX Item "pattern"
yading@10 6112 A string of numbers representing the pulldown pattern you wish to apply.
yading@10 6113 The default value is \f(CW23\fR.
yading@10 6114 .PP
yading@10 6115 .Vb 1
yading@10 6116 \& Some typical patterns:
yading@10 6117 \&
yading@10 6118 \& NTSC output (30i):
yading@10 6119 \& 27.5p: 32222
yading@10 6120 \& 24p: 23 (classic)
yading@10 6121 \& 24p: 2332 (preferred)
yading@10 6122 \& 20p: 33
yading@10 6123 \& 18p: 334
yading@10 6124 \& 16p: 3444
yading@10 6125 \&
yading@10 6126 \& PAL output (25i):
yading@10 6127 \& 27.5p: 12222
yading@10 6128 \& 24p: 222222222223 ("Euro pulldown")
yading@10 6129 \& 16.67p: 33
yading@10 6130 \& 16p: 33333334
yading@10 6131 .Ve
yading@10 6132 .SS "thumbnail"
yading@10 6133 .IX Subsection "thumbnail"
yading@10 6134 Select the most representative frame in a given sequence of consecutive frames.
yading@10 6135 .PP
yading@10 6136 The filter accepts the following options:
yading@10 6137 .IP "\fBn\fR" 4
yading@10 6138 .IX Item "n"
yading@10 6139 Set the frames batch size to analyze; in a set of \fIn\fR frames, the filter
yading@10 6140 will pick one of them, and then handle the next batch of \fIn\fR frames until
yading@10 6141 the end. Default is \f(CW100\fR.
yading@10 6142 .PP
yading@10 6143 Since the filter keeps track of the whole frames sequence, a bigger \fIn\fR
yading@10 6144 value will result in a higher memory usage, so a high value is not recommended.
yading@10 6145 .PP
yading@10 6146 \fIExamples\fR
yading@10 6147 .IX Subsection "Examples"
yading@10 6148 .IP "\(bu" 4
yading@10 6149 Extract one picture each 50 frames:
yading@10 6150 .Sp
yading@10 6151 .Vb 1
yading@10 6152 \& thumbnail=50
yading@10 6153 .Ve
yading@10 6154 .IP "\(bu" 4
yading@10 6155 Complete example of a thumbnail creation with \fBffmpeg\fR:
yading@10 6156 .Sp
yading@10 6157 .Vb 1
yading@10 6158 \& ffmpeg \-i in.avi \-vf thumbnail,scale=300:200 \-frames:v 1 out.png
yading@10 6159 .Ve
yading@10 6160 .SS "tile"
yading@10 6161 .IX Subsection "tile"
yading@10 6162 Tile several successive frames together.
yading@10 6163 .PP
yading@10 6164 The filter accepts the following options:
yading@10 6165 .IP "\fBlayout\fR" 4
yading@10 6166 .IX Item "layout"
yading@10 6167 Set the grid size (i.e. the number of lines and columns) in the form
yading@10 6168 "\fIw\fRx\fIh\fR".
yading@10 6169 .IP "\fBnb_frames\fR" 4
yading@10 6170 .IX Item "nb_frames"
yading@10 6171 Set the maximum number of frames to render in the given area. It must be less
yading@10 6172 than or equal to \fIw\fRx\fIh\fR. The default value is \f(CW0\fR, meaning all
yading@10 6173 the area will be used.
yading@10 6174 .IP "\fBmargin\fR" 4
yading@10 6175 .IX Item "margin"
yading@10 6176 Set the outer border margin in pixels.
yading@10 6177 .IP "\fBpadding\fR" 4
yading@10 6178 .IX Item "padding"
yading@10 6179 Set the inner border thickness (i.e. the number of pixels between frames). For
yading@10 6180 more advanced padding options (such as having different values for the edges),
yading@10 6181 refer to the pad video filter.
yading@10 6182 .PP
yading@10 6183 \fIExamples\fR
yading@10 6184 .IX Subsection "Examples"
yading@10 6185 .IP "\(bu" 4
yading@10 6186 Produce 8x8 \s-1PNG\s0 tiles of all keyframes (\fB\-skip_frame nokey\fR) in a movie:
yading@10 6187 .Sp
yading@10 6188 .Vb 1
yading@10 6189 \& ffmpeg \-skip_frame nokey \-i file.avi \-vf \*(Aqscale=128:72,tile=8x8\*(Aq \-an \-vsync 0 keyframes%03d.png
yading@10 6190 .Ve
yading@10 6191 .Sp
yading@10 6192 The \fB\-vsync 0\fR is necessary to prevent \fBffmpeg\fR from
yading@10 6193 duplicating each output frame to accomodate the originally detected frame
yading@10 6194 rate.
yading@10 6195 .IP "\(bu" 4
yading@10 6196 Display \f(CW5\fR pictures in an area of \f(CW\*(C`3x2\*(C'\fR frames,
yading@10 6197 with \f(CW7\fR pixels between them, and \f(CW2\fR pixels of initial margin, using
yading@10 6198 mixed flat and named options:
yading@10 6199 .Sp
yading@10 6200 .Vb 1
yading@10 6201 \& tile=3x2:nb_frames=5:padding=7:margin=2
yading@10 6202 .Ve
yading@10 6203 .SS "tinterlace"
yading@10 6204 .IX Subsection "tinterlace"
yading@10 6205 Perform various types of temporal field interlacing.
yading@10 6206 .PP
yading@10 6207 Frames are counted starting from 1, so the first input frame is
yading@10 6208 considered odd.
yading@10 6209 .PP
yading@10 6210 The filter accepts the following options:
yading@10 6211 .IP "\fBmode\fR" 4
yading@10 6212 .IX Item "mode"
yading@10 6213 Specify the mode of the interlacing. This option can also be specified
yading@10 6214 as a value alone. See below for a list of values for this option.
yading@10 6215 .Sp
yading@10 6216 Available values are:
yading@10 6217 .RS 4
yading@10 6218 .IP "\fBmerge, 0\fR" 4
yading@10 6219 .IX Item "merge, 0"
yading@10 6220 Move odd frames into the upper field, even into the lower field,
yading@10 6221 generating a double height frame at half frame rate.
yading@10 6222 .IP "\fBdrop_odd, 1\fR" 4
yading@10 6223 .IX Item "drop_odd, 1"
yading@10 6224 Only output even frames, odd frames are dropped, generating a frame with
yading@10 6225 unchanged height at half frame rate.
yading@10 6226 .IP "\fBdrop_even, 2\fR" 4
yading@10 6227 .IX Item "drop_even, 2"
yading@10 6228 Only output odd frames, even frames are dropped, generating a frame with
yading@10 6229 unchanged height at half frame rate.
yading@10 6230 .IP "\fBpad, 3\fR" 4
yading@10 6231 .IX Item "pad, 3"
yading@10 6232 Expand each frame to full height, but pad alternate lines with black,
yading@10 6233 generating a frame with double height at the same input frame rate.
yading@10 6234 .IP "\fBinterleave_top, 4\fR" 4
yading@10 6235 .IX Item "interleave_top, 4"
yading@10 6236 Interleave the upper field from odd frames with the lower field from
yading@10 6237 even frames, generating a frame with unchanged height at half frame rate.
yading@10 6238 .IP "\fBinterleave_bottom, 5\fR" 4
yading@10 6239 .IX Item "interleave_bottom, 5"
yading@10 6240 Interleave the lower field from odd frames with the upper field from
yading@10 6241 even frames, generating a frame with unchanged height at half frame rate.
yading@10 6242 .IP "\fBinterlacex2, 6\fR" 4
yading@10 6243 .IX Item "interlacex2, 6"
yading@10 6244 Double frame rate with unchanged height. Frames are inserted each
yading@10 6245 containing the second temporal field from the previous input frame and
yading@10 6246 the first temporal field from the next input frame. This mode relies on
yading@10 6247 the top_field_first flag. Useful for interlaced video displays with no
yading@10 6248 field synchronisation.
yading@10 6249 .RE
yading@10 6250 .RS 4
yading@10 6251 .Sp
yading@10 6252 Numeric values are deprecated but are accepted for backward
yading@10 6253 compatibility reasons.
yading@10 6254 .Sp
yading@10 6255 Default mode is \f(CW\*(C`merge\*(C'\fR.
yading@10 6256 .RE
yading@10 6257 .IP "\fBflags\fR" 4
yading@10 6258 .IX Item "flags"
yading@10 6259 Specify flags influencing the filter process.
yading@10 6260 .Sp
yading@10 6261 Available value for \fIflags\fR is:
yading@10 6262 .RS 4
yading@10 6263 .IP "\fBlow_pass_filter, vlfp\fR" 4
yading@10 6264 .IX Item "low_pass_filter, vlfp"
yading@10 6265 Enable vertical low-pass filtering in the filter.
yading@10 6266 Vertical low-pass filtering is required when creating an interlaced
yading@10 6267 destination from a progressive source which contains high-frequency
yading@10 6268 vertical detail. Filtering will reduce interlace 'twitter' and Moire
yading@10 6269 patterning.
yading@10 6270 .Sp
yading@10 6271 Vertical low-pass filtering can only be enabled for \fBmode\fR
yading@10 6272 \&\fIinterleave_top\fR and \fIinterleave_bottom\fR.
yading@10 6273 .RE
yading@10 6274 .RS 4
yading@10 6275 .RE
yading@10 6276 .SS "transpose"
yading@10 6277 .IX Subsection "transpose"
yading@10 6278 Transpose rows with columns in the input video and optionally flip it.
yading@10 6279 .PP
yading@10 6280 This filter accepts the following options:
yading@10 6281 .IP "\fBdir\fR" 4
yading@10 6282 .IX Item "dir"
yading@10 6283 The direction of the transpose.
yading@10 6284 .RS 4
yading@10 6285 .IP "\fB0, 4, cclock_flip\fR" 4
yading@10 6286 .IX Item "0, 4, cclock_flip"
yading@10 6287 Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
yading@10 6288 .Sp
yading@10 6289 .Vb 3
yading@10 6290 \& L.R L.l
yading@10 6291 \& . . \-> . .
yading@10 6292 \& l.r R.r
yading@10 6293 .Ve
yading@10 6294 .IP "\fB1, 5, clock\fR" 4
yading@10 6295 .IX Item "1, 5, clock"
yading@10 6296 Rotate by 90 degrees clockwise, that is:
yading@10 6297 .Sp
yading@10 6298 .Vb 3
yading@10 6299 \& L.R l.L
yading@10 6300 \& . . \-> . .
yading@10 6301 \& l.r r.R
yading@10 6302 .Ve
yading@10 6303 .IP "\fB2, 6, cclock\fR" 4
yading@10 6304 .IX Item "2, 6, cclock"
yading@10 6305 Rotate by 90 degrees counterclockwise, that is:
yading@10 6306 .Sp
yading@10 6307 .Vb 3
yading@10 6308 \& L.R R.r
yading@10 6309 \& . . \-> . .
yading@10 6310 \& l.r L.l
yading@10 6311 .Ve
yading@10 6312 .IP "\fB3, 7, clock_flip\fR" 4
yading@10 6313 .IX Item "3, 7, clock_flip"
yading@10 6314 Rotate by 90 degrees clockwise and vertically flip, that is:
yading@10 6315 .Sp
yading@10 6316 .Vb 3
yading@10 6317 \& L.R r.R
yading@10 6318 \& . . \-> . .
yading@10 6319 \& l.r l.L
yading@10 6320 .Ve
yading@10 6321 .RE
yading@10 6322 .RS 4
yading@10 6323 .Sp
yading@10 6324 For values between 4\-7, the transposition is only done if the input
yading@10 6325 video geometry is portrait and not landscape. These values are
yading@10 6326 deprecated, the \f(CW\*(C`passthrough\*(C'\fR option should be used instead.
yading@10 6327 .RE
yading@10 6328 .IP "\fBpassthrough\fR" 4
yading@10 6329 .IX Item "passthrough"
yading@10 6330 Do not apply the transposition if the input geometry matches the one
yading@10 6331 specified by the specified value. It accepts the following values:
yading@10 6332 .RS 4
yading@10 6333 .IP "\fBnone\fR" 4
yading@10 6334 .IX Item "none"
yading@10 6335 Always apply transposition.
yading@10 6336 .IP "\fBportrait\fR" 4
yading@10 6337 .IX Item "portrait"
yading@10 6338 Preserve portrait geometry (when \fIheight\fR >= \fIwidth\fR).
yading@10 6339 .IP "\fBlandscape\fR" 4
yading@10 6340 .IX Item "landscape"
yading@10 6341 Preserve landscape geometry (when \fIwidth\fR >= \fIheight\fR).
yading@10 6342 .RE
yading@10 6343 .RS 4
yading@10 6344 .Sp
yading@10 6345 Default value is \f(CW\*(C`none\*(C'\fR.
yading@10 6346 .RE
yading@10 6347 .PP
yading@10 6348 For example to rotate by 90 degrees clockwise and preserve portrait
yading@10 6349 layout:
yading@10 6350 .PP
yading@10 6351 .Vb 1
yading@10 6352 \& transpose=dir=1:passthrough=portrait
yading@10 6353 .Ve
yading@10 6354 .PP
yading@10 6355 The command above can also be specified as:
yading@10 6356 .PP
yading@10 6357 .Vb 1
yading@10 6358 \& transpose=1:portrait
yading@10 6359 .Ve
yading@10 6360 .SS "unsharp"
yading@10 6361 .IX Subsection "unsharp"
yading@10 6362 Sharpen or blur the input video.
yading@10 6363 .PP
yading@10 6364 It accepts the following parameters:
yading@10 6365 .IP "\fBluma_msize_x, lx\fR" 4
yading@10 6366 .IX Item "luma_msize_x, lx"
yading@10 6367 .PD 0
yading@10 6368 .IP "\fBchroma_msize_x, cx\fR" 4
yading@10 6369 .IX Item "chroma_msize_x, cx"
yading@10 6370 .PD
yading@10 6371 Set the luma/chroma matrix horizontal size. It must be an odd integer
yading@10 6372 between 3 and 63, default value is 5.
yading@10 6373 .IP "\fBluma_msize_y, ly\fR" 4
yading@10 6374 .IX Item "luma_msize_y, ly"
yading@10 6375 .PD 0
yading@10 6376 .IP "\fBchroma_msize_y, cy\fR" 4
yading@10 6377 .IX Item "chroma_msize_y, cy"
yading@10 6378 .PD
yading@10 6379 Set the luma/chroma matrix vertical size. It must be an odd integer
yading@10 6380 between 3 and 63, default value is 5.
yading@10 6381 .IP "\fBluma_amount, la\fR" 4
yading@10 6382 .IX Item "luma_amount, la"
yading@10 6383 .PD 0
yading@10 6384 .IP "\fBchroma_amount, ca\fR" 4
yading@10 6385 .IX Item "chroma_amount, ca"
yading@10 6386 .PD
yading@10 6387 Set the luma/chroma effect strength. It can be a float number,
yading@10 6388 reasonable values lay between \-1.5 and 1.5.
yading@10 6389 .Sp
yading@10 6390 Negative values will blur the input video, while positive values will
yading@10 6391 sharpen it, a value of zero will disable the effect.
yading@10 6392 .Sp
yading@10 6393 Default value is 1.0 for \fBluma_amount\fR, 0.0 for
yading@10 6394 \&\fBchroma_amount\fR.
yading@10 6395 .PP
yading@10 6396 All parameters are optional and default to the
yading@10 6397 equivalent of the string '5:5:1.0:5:5:0.0'.
yading@10 6398 .PP
yading@10 6399 \fIExamples\fR
yading@10 6400 .IX Subsection "Examples"
yading@10 6401 .IP "\(bu" 4
yading@10 6402 Apply strong luma sharpen effect:
yading@10 6403 .Sp
yading@10 6404 .Vb 1
yading@10 6405 \& unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
yading@10 6406 .Ve
yading@10 6407 .IP "\(bu" 4
yading@10 6408 Apply strong blur of both luma and chroma parameters:
yading@10 6409 .Sp
yading@10 6410 .Vb 1
yading@10 6411 \& unsharp=7:7:\-2:7:7:\-2
yading@10 6412 .Ve
yading@10 6413 .SS "vflip"
yading@10 6414 .IX Subsection "vflip"
yading@10 6415 Flip the input video vertically.
yading@10 6416 .PP
yading@10 6417 .Vb 1
yading@10 6418 \& ffmpeg \-i in.avi \-vf "vflip" out.avi
yading@10 6419 .Ve
yading@10 6420 .SS "yadif"
yading@10 6421 .IX Subsection "yadif"
yading@10 6422 Deinterlace the input video (\*(L"yadif\*(R" means \*(L"yet another deinterlacing
yading@10 6423 filter\*(R").
yading@10 6424 .PP
yading@10 6425 This filter accepts the following options:
yading@10 6426 .IP "\fBmode\fR" 4
yading@10 6427 .IX Item "mode"
yading@10 6428 The interlacing mode to adopt, accepts one of the following values:
yading@10 6429 .RS 4
yading@10 6430 .IP "\fB0, send_frame\fR" 4
yading@10 6431 .IX Item "0, send_frame"
yading@10 6432 output 1 frame for each frame
yading@10 6433 .IP "\fB1, send_field\fR" 4
yading@10 6434 .IX Item "1, send_field"
yading@10 6435 output 1 frame for each field
yading@10 6436 .IP "\fB2, send_frame_nospatial\fR" 4
yading@10 6437 .IX Item "2, send_frame_nospatial"
yading@10 6438 like \f(CW\*(C`send_frame\*(C'\fR but skip spatial interlacing check
yading@10 6439 .IP "\fB3, send_field_nospatial\fR" 4
yading@10 6440 .IX Item "3, send_field_nospatial"
yading@10 6441 like \f(CW\*(C`send_field\*(C'\fR but skip spatial interlacing check
yading@10 6442 .RE
yading@10 6443 .RS 4
yading@10 6444 .Sp
yading@10 6445 Default value is \f(CW\*(C`send_frame\*(C'\fR.
yading@10 6446 .RE
yading@10 6447 .IP "\fBparity\fR" 4
yading@10 6448 .IX Item "parity"
yading@10 6449 The picture field parity assumed for the input interlaced video, accepts one of
yading@10 6450 the following values:
yading@10 6451 .RS 4
yading@10 6452 .IP "\fB0, tff\fR" 4
yading@10 6453 .IX Item "0, tff"
yading@10 6454 assume top field first
yading@10 6455 .IP "\fB1, bff\fR" 4
yading@10 6456 .IX Item "1, bff"
yading@10 6457 assume bottom field first
yading@10 6458 .IP "\fB\-1, auto\fR" 4
yading@10 6459 .IX Item "-1, auto"
yading@10 6460 enable automatic detection
yading@10 6461 .RE
yading@10 6462 .RS 4
yading@10 6463 .Sp
yading@10 6464 Default value is \f(CW\*(C`auto\*(C'\fR.
yading@10 6465 If interlacing is unknown or decoder does not export this information,
yading@10 6466 top field first will be assumed.
yading@10 6467 .RE
yading@10 6468 .IP "\fBdeint\fR" 4
yading@10 6469 .IX Item "deint"
yading@10 6470 Specify which frames to deinterlace. Accept one of the following
yading@10 6471 values:
yading@10 6472 .RS 4
yading@10 6473 .IP "\fB0, all\fR" 4
yading@10 6474 .IX Item "0, all"
yading@10 6475 deinterlace all frames
yading@10 6476 .IP "\fB1, interlaced\fR" 4
yading@10 6477 .IX Item "1, interlaced"
yading@10 6478 only deinterlace frames marked as interlaced
yading@10 6479 .RE
yading@10 6480 .RS 4
yading@10 6481 .Sp
yading@10 6482 Default value is \f(CW\*(C`all\*(C'\fR.
yading@10 6483 .RE
yading@10 6484 .SH "VIDEO SOURCES"
yading@10 6485 .IX Header "VIDEO SOURCES"
yading@10 6486 Below is a description of the currently available video sources.
yading@10 6487 .SS "buffer"
yading@10 6488 .IX Subsection "buffer"
yading@10 6489 Buffer video frames, and make them available to the filter chain.
yading@10 6490 .PP
yading@10 6491 This source is mainly intended for a programmatic use, in particular
yading@10 6492 through the interface defined in \fIlibavfilter/vsrc_buffer.h\fR.
yading@10 6493 .PP
yading@10 6494 This source accepts the following options:
yading@10 6495 .IP "\fBvideo_size\fR" 4
yading@10 6496 .IX Item "video_size"
yading@10 6497 Specify the size (width and height) of the buffered video frames.
yading@10 6498 .IP "\fBwidth\fR" 4
yading@10 6499 .IX Item "width"
yading@10 6500 Input video width.
yading@10 6501 .IP "\fBheight\fR" 4
yading@10 6502 .IX Item "height"
yading@10 6503 Input video height.
yading@10 6504 .IP "\fBpix_fmt\fR" 4
yading@10 6505 .IX Item "pix_fmt"
yading@10 6506 A string representing the pixel format of the buffered video frames.
yading@10 6507 It may be a number corresponding to a pixel format, or a pixel format
yading@10 6508 name.
yading@10 6509 .IP "\fBtime_base\fR" 4
yading@10 6510 .IX Item "time_base"
yading@10 6511 Specify the timebase assumed by the timestamps of the buffered frames.
yading@10 6512 .IP "\fBframe_rate\fR" 4
yading@10 6513 .IX Item "frame_rate"
yading@10 6514 Specify the frame rate expected for the video stream.
yading@10 6515 .IP "\fBpixel_aspect, sar\fR" 4
yading@10 6516 .IX Item "pixel_aspect, sar"
yading@10 6517 Specify the sample aspect ratio assumed by the video frames.
yading@10 6518 .IP "\fBsws_param\fR" 4
yading@10 6519 .IX Item "sws_param"
yading@10 6520 Specify the optional parameters to be used for the scale filter which
yading@10 6521 is automatically inserted when an input change is detected in the
yading@10 6522 input size or format.
yading@10 6523 .PP
yading@10 6524 For example:
yading@10 6525 .PP
yading@10 6526 .Vb 1
yading@10 6527 \& buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
yading@10 6528 .Ve
yading@10 6529 .PP
yading@10 6530 will instruct the source to accept video frames with size 320x240 and
yading@10 6531 with format \*(L"yuv410p\*(R", assuming 1/24 as the timestamps timebase and
yading@10 6532 square pixels (1:1 sample aspect ratio).
yading@10 6533 Since the pixel format with name \*(L"yuv410p\*(R" corresponds to the number 6
yading@10 6534 (check the enum AVPixelFormat definition in \fIlibavutil/pixfmt.h\fR),
yading@10 6535 this example corresponds to:
yading@10 6536 .PP
yading@10 6537 .Vb 1
yading@10 6538 \& buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
yading@10 6539 .Ve
yading@10 6540 .PP
yading@10 6541 Alternatively, the options can be specified as a flat string, but this
yading@10 6542 syntax is deprecated:
yading@10 6543 .PP
yading@10 6544 \&\fIwidth\fR:\fIheight\fR:\fIpix_fmt\fR:\fItime_base.num\fR:\fItime_base.den\fR:\fIpixel_aspect.num\fR:\fIpixel_aspect.den\fR[:\fIsws_param\fR]
yading@10 6545 .SS "cellauto"
yading@10 6546 .IX Subsection "cellauto"
yading@10 6547 Create a pattern generated by an elementary cellular automaton.
yading@10 6548 .PP
yading@10 6549 The initial state of the cellular automaton can be defined through the
yading@10 6550 \&\fBfilename\fR, and \fBpattern\fR options. If such options are
yading@10 6551 not specified an initial state is created randomly.
yading@10 6552 .PP
yading@10 6553 At each new frame a new row in the video is filled with the result of
yading@10 6554 the cellular automaton next generation. The behavior when the whole
yading@10 6555 frame is filled is defined by the \fBscroll\fR option.
yading@10 6556 .PP
yading@10 6557 This source accepts the following options:
yading@10 6558 .IP "\fBfilename, f\fR" 4
yading@10 6559 .IX Item "filename, f"
yading@10 6560 Read the initial cellular automaton state, i.e. the starting row, from
yading@10 6561 the specified file.
yading@10 6562 In the file, each non-whitespace character is considered an alive
yading@10 6563 cell, a newline will terminate the row, and further characters in the
yading@10 6564 file will be ignored.
yading@10 6565 .IP "\fBpattern, p\fR" 4
yading@10 6566 .IX Item "pattern, p"
yading@10 6567 Read the initial cellular automaton state, i.e. the starting row, from
yading@10 6568 the specified string.
yading@10 6569 .Sp
yading@10 6570 Each non-whitespace character in the string is considered an alive
yading@10 6571 cell, a newline will terminate the row, and further characters in the
yading@10 6572 string will be ignored.
yading@10 6573 .IP "\fBrate, r\fR" 4
yading@10 6574 .IX Item "rate, r"
yading@10 6575 Set the video rate, that is the number of frames generated per second.
yading@10 6576 Default is 25.
yading@10 6577 .IP "\fBrandom_fill_ratio, ratio\fR" 4
yading@10 6578 .IX Item "random_fill_ratio, ratio"
yading@10 6579 Set the random fill ratio for the initial cellular automaton row. It
yading@10 6580 is a floating point number value ranging from 0 to 1, defaults to
yading@10 6581 1/PHI.
yading@10 6582 .Sp
yading@10 6583 This option is ignored when a file or a pattern is specified.
yading@10 6584 .IP "\fBrandom_seed, seed\fR" 4
yading@10 6585 .IX Item "random_seed, seed"
yading@10 6586 Set the seed for filling randomly the initial row, must be an integer
yading@10 6587 included between 0 and \s-1UINT32_MAX\s0. If not specified, or if explicitly
yading@10 6588 set to \-1, the filter will try to use a good random seed on a best
yading@10 6589 effort basis.
yading@10 6590 .IP "\fBrule\fR" 4
yading@10 6591 .IX Item "rule"
yading@10 6592 Set the cellular automaton rule, it is a number ranging from 0 to 255.
yading@10 6593 Default value is 110.
yading@10 6594 .IP "\fBsize, s\fR" 4
yading@10 6595 .IX Item "size, s"
yading@10 6596 Set the size of the output video.
yading@10 6597 .Sp
yading@10 6598 If \fBfilename\fR or \fBpattern\fR is specified, the size is set
yading@10 6599 by default to the width of the specified initial state row, and the
yading@10 6600 height is set to \fIwidth\fR * \s-1PHI\s0.
yading@10 6601 .Sp
yading@10 6602 If \fBsize\fR is set, it must contain the width of the specified
yading@10 6603 pattern string, and the specified pattern will be centered in the
yading@10 6604 larger row.
yading@10 6605 .Sp
yading@10 6606 If a filename or a pattern string is not specified, the size value
yading@10 6607 defaults to \*(L"320x518\*(R" (used for a randomly generated initial state).
yading@10 6608 .IP "\fBscroll\fR" 4
yading@10 6609 .IX Item "scroll"
yading@10 6610 If set to 1, scroll the output upward when all the rows in the output
yading@10 6611 have been already filled. If set to 0, the new generated row will be
yading@10 6612 written over the top row just after the bottom row is filled.
yading@10 6613 Defaults to 1.
yading@10 6614 .IP "\fBstart_full, full\fR" 4
yading@10 6615 .IX Item "start_full, full"
yading@10 6616 If set to 1, completely fill the output with generated rows before
yading@10 6617 outputting the first frame.
yading@10 6618 This is the default behavior, for disabling set the value to 0.
yading@10 6619 .IP "\fBstitch\fR" 4
yading@10 6620 .IX Item "stitch"
yading@10 6621 If set to 1, stitch the left and right row edges together.
yading@10 6622 This is the default behavior, for disabling set the value to 0.
yading@10 6623 .PP
yading@10 6624 \fIExamples\fR
yading@10 6625 .IX Subsection "Examples"
yading@10 6626 .IP "\(bu" 4
yading@10 6627 Read the initial state from \fIpattern\fR, and specify an output of
yading@10 6628 size 200x400.
yading@10 6629 .Sp
yading@10 6630 .Vb 1
yading@10 6631 \& cellauto=f=pattern:s=200x400
yading@10 6632 .Ve
yading@10 6633 .IP "\(bu" 4
yading@10 6634 Generate a random initial row with a width of 200 cells, with a fill
yading@10 6635 ratio of 2/3:
yading@10 6636 .Sp
yading@10 6637 .Vb 1
yading@10 6638 \& cellauto=ratio=2/3:s=200x200
yading@10 6639 .Ve
yading@10 6640 .IP "\(bu" 4
yading@10 6641 Create a pattern generated by rule 18 starting by a single alive cell
yading@10 6642 centered on an initial row with width 100:
yading@10 6643 .Sp
yading@10 6644 .Vb 1
yading@10 6645 \& cellauto=p=@s=100x400:full=0:rule=18
yading@10 6646 .Ve
yading@10 6647 .IP "\(bu" 4
yading@10 6648 Specify a more elaborated initial pattern:
yading@10 6649 .Sp
yading@10 6650 .Vb 1
yading@10 6651 \& cellauto=p=\*(Aq@@ @ @@\*(Aq:s=100x400:full=0:rule=18
yading@10 6652 .Ve
yading@10 6653 .SS "mandelbrot"
yading@10 6654 .IX Subsection "mandelbrot"
yading@10 6655 Generate a Mandelbrot set fractal, and progressively zoom towards the
yading@10 6656 point specified with \fIstart_x\fR and \fIstart_y\fR.
yading@10 6657 .PP
yading@10 6658 This source accepts the following options:
yading@10 6659 .IP "\fBend_pts\fR" 4
yading@10 6660 .IX Item "end_pts"
yading@10 6661 Set the terminal pts value. Default value is 400.
yading@10 6662 .IP "\fBend_scale\fR" 4
yading@10 6663 .IX Item "end_scale"
yading@10 6664 Set the terminal scale value.
yading@10 6665 Must be a floating point value. Default value is 0.3.
yading@10 6666 .IP "\fBinner\fR" 4
yading@10 6667 .IX Item "inner"
yading@10 6668 Set the inner coloring mode, that is the algorithm used to draw the
yading@10 6669 Mandelbrot fractal internal region.
yading@10 6670 .Sp
yading@10 6671 It shall assume one of the following values:
yading@10 6672 .RS 4
yading@10 6673 .IP "\fBblack\fR" 4
yading@10 6674 .IX Item "black"
yading@10 6675 Set black mode.
yading@10 6676 .IP "\fBconvergence\fR" 4
yading@10 6677 .IX Item "convergence"
yading@10 6678 Show time until convergence.
yading@10 6679 .IP "\fBmincol\fR" 4
yading@10 6680 .IX Item "mincol"
yading@10 6681 Set color based on point closest to the origin of the iterations.
yading@10 6682 .IP "\fBperiod\fR" 4
yading@10 6683 .IX Item "period"
yading@10 6684 Set period mode.
yading@10 6685 .RE
yading@10 6686 .RS 4
yading@10 6687 .Sp
yading@10 6688 Default value is \fImincol\fR.
yading@10 6689 .RE
yading@10 6690 .IP "\fBbailout\fR" 4
yading@10 6691 .IX Item "bailout"
yading@10 6692 Set the bailout value. Default value is 10.0.
yading@10 6693 .IP "\fBmaxiter\fR" 4
yading@10 6694 .IX Item "maxiter"
yading@10 6695 Set the maximum of iterations performed by the rendering
yading@10 6696 algorithm. Default value is 7189.
yading@10 6697 .IP "\fBouter\fR" 4
yading@10 6698 .IX Item "outer"
yading@10 6699 Set outer coloring mode.
yading@10 6700 It shall assume one of following values:
yading@10 6701 .RS 4
yading@10 6702 .IP "\fBiteration_count\fR" 4
yading@10 6703 .IX Item "iteration_count"
yading@10 6704 Set iteration cound mode.
yading@10 6705 .IP "\fBnormalized_iteration_count\fR" 4
yading@10 6706 .IX Item "normalized_iteration_count"
yading@10 6707 set normalized iteration count mode.
yading@10 6708 .RE
yading@10 6709 .RS 4
yading@10 6710 .Sp
yading@10 6711 Default value is \fInormalized_iteration_count\fR.
yading@10 6712 .RE
yading@10 6713 .IP "\fBrate, r\fR" 4
yading@10 6714 .IX Item "rate, r"
yading@10 6715 Set frame rate, expressed as number of frames per second. Default
yading@10 6716 value is \*(L"25\*(R".
yading@10 6717 .IP "\fBsize, s\fR" 4
yading@10 6718 .IX Item "size, s"
yading@10 6719 Set frame size. Default value is \*(L"640x480\*(R".
yading@10 6720 .IP "\fBstart_scale\fR" 4
yading@10 6721 .IX Item "start_scale"
yading@10 6722 Set the initial scale value. Default value is 3.0.
yading@10 6723 .IP "\fBstart_x\fR" 4
yading@10 6724 .IX Item "start_x"
yading@10 6725 Set the initial x position. Must be a floating point value between
yading@10 6726 \&\-100 and 100. Default value is \-0.743643887037158704752191506114774.
yading@10 6727 .IP "\fBstart_y\fR" 4
yading@10 6728 .IX Item "start_y"
yading@10 6729 Set the initial y position. Must be a floating point value between
yading@10 6730 \&\-100 and 100. Default value is \-0.131825904205311970493132056385139.
yading@10 6731 .SS "mptestsrc"
yading@10 6732 .IX Subsection "mptestsrc"
yading@10 6733 Generate various test patterns, as generated by the MPlayer test filter.
yading@10 6734 .PP
yading@10 6735 The size of the generated video is fixed, and is 256x256.
yading@10 6736 This source is useful in particular for testing encoding features.
yading@10 6737 .PP
yading@10 6738 This source accepts the following options:
yading@10 6739 .IP "\fBrate, r\fR" 4
yading@10 6740 .IX Item "rate, r"
yading@10 6741 Specify the frame rate of the sourced video, as the number of frames
yading@10 6742 generated per second. It has to be a string in the format
yading@10 6743 \&\fIframe_rate_num\fR/\fIframe_rate_den\fR, an integer number, a float
yading@10 6744 number or a valid video frame rate abbreviation. The default value is
yading@10 6745 \&\*(L"25\*(R".
yading@10 6746 .IP "\fBduration, d\fR" 4
yading@10 6747 .IX Item "duration, d"
yading@10 6748 Set the video duration of the sourced video. The accepted syntax is:
yading@10 6749 .Sp
yading@10 6750 .Vb 2
yading@10 6751 \& [\-]HH:MM:SS[.m...]
yading@10 6752 \& [\-]S+[.m...]
yading@10 6753 .Ve
yading@10 6754 .Sp
yading@10 6755 See also the function \f(CW\*(C`av_parse_time()\*(C'\fR.
yading@10 6756 .Sp
yading@10 6757 If not specified, or the expressed duration is negative, the video is
yading@10 6758 supposed to be generated forever.
yading@10 6759 .IP "\fBtest, t\fR" 4
yading@10 6760 .IX Item "test, t"
yading@10 6761 Set the number or the name of the test to perform. Supported tests are:
yading@10 6762 .RS 4
yading@10 6763 .IP "\fBdc_luma\fR" 4
yading@10 6764 .IX Item "dc_luma"
yading@10 6765 .PD 0
yading@10 6766 .IP "\fBdc_chroma\fR" 4
yading@10 6767 .IX Item "dc_chroma"
yading@10 6768 .IP "\fBfreq_luma\fR" 4
yading@10 6769 .IX Item "freq_luma"
yading@10 6770 .IP "\fBfreq_chroma\fR" 4
yading@10 6771 .IX Item "freq_chroma"
yading@10 6772 .IP "\fBamp_luma\fR" 4
yading@10 6773 .IX Item "amp_luma"
yading@10 6774 .IP "\fBamp_chroma\fR" 4
yading@10 6775 .IX Item "amp_chroma"
yading@10 6776 .IP "\fBcbp\fR" 4
yading@10 6777 .IX Item "cbp"
yading@10 6778 .IP "\fBmv\fR" 4
yading@10 6779 .IX Item "mv"
yading@10 6780 .IP "\fBring1\fR" 4
yading@10 6781 .IX Item "ring1"
yading@10 6782 .IP "\fBring2\fR" 4
yading@10 6783 .IX Item "ring2"
yading@10 6784 .IP "\fBall\fR" 4
yading@10 6785 .IX Item "all"
yading@10 6786 .RE
yading@10 6787 .RS 4
yading@10 6788 .PD
yading@10 6789 .Sp
yading@10 6790 Default value is \*(L"all\*(R", which will cycle through the list of all tests.
yading@10 6791 .RE
yading@10 6792 .PP
yading@10 6793 For example the following:
yading@10 6794 .PP
yading@10 6795 .Vb 1
yading@10 6796 \& testsrc=t=dc_luma
yading@10 6797 .Ve
yading@10 6798 .PP
yading@10 6799 will generate a \*(L"dc_luma\*(R" test pattern.
yading@10 6800 .SS "frei0r_src"
yading@10 6801 .IX Subsection "frei0r_src"
yading@10 6802 Provide a frei0r source.
yading@10 6803 .PP
yading@10 6804 To enable compilation of this filter you need to install the frei0r
yading@10 6805 header and configure FFmpeg with \f(CW\*(C`\-\-enable\-frei0r\*(C'\fR.
yading@10 6806 .PP
yading@10 6807 This source accepts the following options:
yading@10 6808 .IP "\fBsize\fR" 4
yading@10 6809 .IX Item "size"
yading@10 6810 The size of the video to generate, may be a string of the form
yading@10 6811 \&\fIwidth\fRx\fIheight\fR or a frame size abbreviation.
yading@10 6812 .IP "\fBframerate\fR" 4
yading@10 6813 .IX Item "framerate"
yading@10 6814 Framerate of the generated video, may be a string of the form
yading@10 6815 \&\fInum\fR/\fIden\fR or a frame rate abbreviation.
yading@10 6816 .IP "\fBfilter_name\fR" 4
yading@10 6817 .IX Item "filter_name"
yading@10 6818 The name to the frei0r source to load. For more information regarding frei0r and
yading@10 6819 how to set the parameters read the section frei0r in the description of
yading@10 6820 the video filters.
yading@10 6821 .IP "\fBfilter_params\fR" 4
yading@10 6822 .IX Item "filter_params"
yading@10 6823 A '|'\-separated list of parameters to pass to the frei0r source.
yading@10 6824 .PP
yading@10 6825 For example, to generate a frei0r partik0l source with size 200x200
yading@10 6826 and frame rate 10 which is overlayed on the overlay filter main input:
yading@10 6827 .PP
yading@10 6828 .Vb 1
yading@10 6829 \& frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
yading@10 6830 .Ve
yading@10 6831 .SS "life"
yading@10 6832 .IX Subsection "life"
yading@10 6833 Generate a life pattern.
yading@10 6834 .PP
yading@10 6835 This source is based on a generalization of John Conway's life game.
yading@10 6836 .PP
yading@10 6837 The sourced input represents a life grid, each pixel represents a cell
yading@10 6838 which can be in one of two possible states, alive or dead. Every cell
yading@10 6839 interacts with its eight neighbours, which are the cells that are
yading@10 6840 horizontally, vertically, or diagonally adjacent.
yading@10 6841 .PP
yading@10 6842 At each interaction the grid evolves according to the adopted rule,
yading@10 6843 which specifies the number of neighbor alive cells which will make a
yading@10 6844 cell stay alive or born. The \fBrule\fR option allows to specify
yading@10 6845 the rule to adopt.
yading@10 6846 .PP
yading@10 6847 This source accepts the following options:
yading@10 6848 .IP "\fBfilename, f\fR" 4
yading@10 6849 .IX Item "filename, f"
yading@10 6850 Set the file from which to read the initial grid state. In the file,
yading@10 6851 each non-whitespace character is considered an alive cell, and newline
yading@10 6852 is used to delimit the end of each row.
yading@10 6853 .Sp
yading@10 6854 If this option is not specified, the initial grid is generated
yading@10 6855 randomly.
yading@10 6856 .IP "\fBrate, r\fR" 4
yading@10 6857 .IX Item "rate, r"
yading@10 6858 Set the video rate, that is the number of frames generated per second.
yading@10 6859 Default is 25.
yading@10 6860 .IP "\fBrandom_fill_ratio, ratio\fR" 4
yading@10 6861 .IX Item "random_fill_ratio, ratio"
yading@10 6862 Set the random fill ratio for the initial random grid. It is a
yading@10 6863 floating point number value ranging from 0 to 1, defaults to 1/PHI.
yading@10 6864 It is ignored when a file is specified.
yading@10 6865 .IP "\fBrandom_seed, seed\fR" 4
yading@10 6866 .IX Item "random_seed, seed"
yading@10 6867 Set the seed for filling the initial random grid, must be an integer
yading@10 6868 included between 0 and \s-1UINT32_MAX\s0. If not specified, or if explicitly
yading@10 6869 set to \-1, the filter will try to use a good random seed on a best
yading@10 6870 effort basis.
yading@10 6871 .IP "\fBrule\fR" 4
yading@10 6872 .IX Item "rule"
yading@10 6873 Set the life rule.
yading@10 6874 .Sp
yading@10 6875 A rule can be specified with a code of the kind "S\fI\s-1NS\s0\fR/B\fI\s-1NB\s0\fR",
yading@10 6876 where \fI\s-1NS\s0\fR and \fI\s-1NB\s0\fR are sequences of numbers in the range 0\-8,
yading@10 6877 \&\fI\s-1NS\s0\fR specifies the number of alive neighbor cells which make a
yading@10 6878 live cell stay alive, and \fI\s-1NB\s0\fR the number of alive neighbor cells
yading@10 6879 which make a dead cell to become alive (i.e. to \*(L"born\*(R").
yading@10 6880 \&\*(L"s\*(R" and \*(L"b\*(R" can be used in place of \*(L"S\*(R" and \*(L"B\*(R", respectively.
yading@10 6881 .Sp
yading@10 6882 Alternatively a rule can be specified by an 18\-bits integer. The 9
yading@10 6883 high order bits are used to encode the next cell state if it is alive
yading@10 6884 for each number of neighbor alive cells, the low order bits specify
yading@10 6885 the rule for \*(L"borning\*(R" new cells. Higher order bits encode for an
yading@10 6886 higher number of neighbor cells.
yading@10 6887 For example the number 6153 = \f(CW\*(C`(12<<9)+9\*(C'\fR specifies a stay alive
yading@10 6888 rule of 12 and a born rule of 9, which corresponds to \*(L"S23/B03\*(R".
yading@10 6889 .Sp
yading@10 6890 Default value is \*(L"S23/B3\*(R", which is the original Conway's game of life
yading@10 6891 rule, and will keep a cell alive if it has 2 or 3 neighbor alive
yading@10 6892 cells, and will born a new cell if there are three alive cells around
yading@10 6893 a dead cell.
yading@10 6894 .IP "\fBsize, s\fR" 4
yading@10 6895 .IX Item "size, s"
yading@10 6896 Set the size of the output video.
yading@10 6897 .Sp
yading@10 6898 If \fBfilename\fR is specified, the size is set by default to the
yading@10 6899 same size of the input file. If \fBsize\fR is set, it must contain
yading@10 6900 the size specified in the input file, and the initial grid defined in
yading@10 6901 that file is centered in the larger resulting area.
yading@10 6902 .Sp
yading@10 6903 If a filename is not specified, the size value defaults to \*(L"320x240\*(R"
yading@10 6904 (used for a randomly generated initial grid).
yading@10 6905 .IP "\fBstitch\fR" 4
yading@10 6906 .IX Item "stitch"
yading@10 6907 If set to 1, stitch the left and right grid edges together, and the
yading@10 6908 top and bottom edges also. Defaults to 1.
yading@10 6909 .IP "\fBmold\fR" 4
yading@10 6910 .IX Item "mold"
yading@10 6911 Set cell mold speed. If set, a dead cell will go from \fBdeath_color\fR to
yading@10 6912 \&\fBmold_color\fR with a step of \fBmold\fR. \fBmold\fR can have a
yading@10 6913 value from 0 to 255.
yading@10 6914 .IP "\fBlife_color\fR" 4
yading@10 6915 .IX Item "life_color"
yading@10 6916 Set the color of living (or new born) cells.
yading@10 6917 .IP "\fBdeath_color\fR" 4
yading@10 6918 .IX Item "death_color"
yading@10 6919 Set the color of dead cells. If \fBmold\fR is set, this is the first color
yading@10 6920 used to represent a dead cell.
yading@10 6921 .IP "\fBmold_color\fR" 4
yading@10 6922 .IX Item "mold_color"
yading@10 6923 Set mold color, for definitely dead and moldy cells.
yading@10 6924 .PP
yading@10 6925 \fIExamples\fR
yading@10 6926 .IX Subsection "Examples"
yading@10 6927 .IP "\(bu" 4
yading@10 6928 Read a grid from \fIpattern\fR, and center it on a grid of size
yading@10 6929 300x300 pixels:
yading@10 6930 .Sp
yading@10 6931 .Vb 1
yading@10 6932 \& life=f=pattern:s=300x300
yading@10 6933 .Ve
yading@10 6934 .IP "\(bu" 4
yading@10 6935 Generate a random grid of size 200x200, with a fill ratio of 2/3:
yading@10 6936 .Sp
yading@10 6937 .Vb 1
yading@10 6938 \& life=ratio=2/3:s=200x200
yading@10 6939 .Ve
yading@10 6940 .IP "\(bu" 4
yading@10 6941 Specify a custom rule for evolving a randomly generated grid:
yading@10 6942 .Sp
yading@10 6943 .Vb 1
yading@10 6944 \& life=rule=S14/B34
yading@10 6945 .Ve
yading@10 6946 .IP "\(bu" 4
yading@10 6947 Full example with slow death effect (mold) using \fBffplay\fR:
yading@10 6948 .Sp
yading@10 6949 .Vb 1
yading@10 6950 \& ffplay \-f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16
yading@10 6951 .Ve
yading@10 6952 .SS "color, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc"
yading@10 6953 .IX Subsection "color, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc"
yading@10 6954 The \f(CW\*(C`color\*(C'\fR source provides an uniformly colored input.
yading@10 6955 .PP
yading@10 6956 The \f(CW\*(C`nullsrc\*(C'\fR source returns unprocessed video frames. It is
yading@10 6957 mainly useful to be employed in analysis / debugging tools, or as the
yading@10 6958 source for filters which ignore the input data.
yading@10 6959 .PP
yading@10 6960 The \f(CW\*(C`rgbtestsrc\*(C'\fR source generates an \s-1RGB\s0 test pattern useful for
yading@10 6961 detecting \s-1RGB\s0 vs \s-1BGR\s0 issues. You should see a red, green and blue
yading@10 6962 stripe from top to bottom.
yading@10 6963 .PP
yading@10 6964 The \f(CW\*(C`smptebars\*(C'\fR source generates a color bars pattern, based on
yading@10 6965 the \s-1SMPTE\s0 Engineering Guideline \s-1EG\s0 1\-1990.
yading@10 6966 .PP
yading@10 6967 The \f(CW\*(C`smptehdbars\*(C'\fR source generates a color bars pattern, based on
yading@10 6968 the \s-1SMPTE\s0 \s-1RP\s0 219\-2002.
yading@10 6969 .PP
yading@10 6970 The \f(CW\*(C`testsrc\*(C'\fR source generates a test video pattern, showing a
yading@10 6971 color pattern, a scrolling gradient and a timestamp. This is mainly
yading@10 6972 intended for testing purposes.
yading@10 6973 .PP
yading@10 6974 The sources accept the following options:
yading@10 6975 .IP "\fBcolor, c\fR" 4
yading@10 6976 .IX Item "color, c"
yading@10 6977 Specify the color of the source, only used in the \f(CW\*(C`color\*(C'\fR
yading@10 6978 source. It can be the name of a color (case insensitive match) or a
yading@10 6979 0xRRGGBB[\s-1AA\s0] sequence, possibly followed by an alpha specifier. The
yading@10 6980 default value is \*(L"black\*(R".
yading@10 6981 .IP "\fBsize, s\fR" 4
yading@10 6982 .IX Item "size, s"
yading@10 6983 Specify the size of the sourced video, it may be a string of the form
yading@10 6984 \&\fIwidth\fRx\fIheight\fR, or the name of a size abbreviation. The
yading@10 6985 default value is \*(L"320x240\*(R".
yading@10 6986 .IP "\fBrate, r\fR" 4
yading@10 6987 .IX Item "rate, r"
yading@10 6988 Specify the frame rate of the sourced video, as the number of frames
yading@10 6989 generated per second. It has to be a string in the format
yading@10 6990 \&\fIframe_rate_num\fR/\fIframe_rate_den\fR, an integer number, a float
yading@10 6991 number or a valid video frame rate abbreviation. The default value is
yading@10 6992 \&\*(L"25\*(R".
yading@10 6993 .IP "\fBsar\fR" 4
yading@10 6994 .IX Item "sar"
yading@10 6995 Set the sample aspect ratio of the sourced video.
yading@10 6996 .IP "\fBduration, d\fR" 4
yading@10 6997 .IX Item "duration, d"
yading@10 6998 Set the video duration of the sourced video. The accepted syntax is:
yading@10 6999 .Sp
yading@10 7000 .Vb 2
yading@10 7001 \& [\-]HH[:MM[:SS[.m...]]]
yading@10 7002 \& [\-]S+[.m...]
yading@10 7003 .Ve
yading@10 7004 .Sp
yading@10 7005 See also the function \f(CW\*(C`av_parse_time()\*(C'\fR.
yading@10 7006 .Sp
yading@10 7007 If not specified, or the expressed duration is negative, the video is
yading@10 7008 supposed to be generated forever.
yading@10 7009 .IP "\fBdecimals, n\fR" 4
yading@10 7010 .IX Item "decimals, n"
yading@10 7011 Set the number of decimals to show in the timestamp, only used in the
yading@10 7012 \&\f(CW\*(C`testsrc\*(C'\fR source.
yading@10 7013 .Sp
yading@10 7014 The displayed timestamp value will correspond to the original
yading@10 7015 timestamp value multiplied by the power of 10 of the specified
yading@10 7016 value. Default value is 0.
yading@10 7017 .PP
yading@10 7018 For example the following:
yading@10 7019 .PP
yading@10 7020 .Vb 1
yading@10 7021 \& testsrc=duration=5.3:size=qcif:rate=10
yading@10 7022 .Ve
yading@10 7023 .PP
yading@10 7024 will generate a video with a duration of 5.3 seconds, with size
yading@10 7025 176x144 and a frame rate of 10 frames per second.
yading@10 7026 .PP
yading@10 7027 The following graph description will generate a red source
yading@10 7028 with an opacity of 0.2, with size \*(L"qcif\*(R" and a frame rate of 10
yading@10 7029 frames per second.
yading@10 7030 .PP
yading@10 7031 .Vb 1
yading@10 7032 \& color=c=red@0.2:s=qcif:r=10
yading@10 7033 .Ve
yading@10 7034 .PP
yading@10 7035 If the input content is to be ignored, \f(CW\*(C`nullsrc\*(C'\fR can be used. The
yading@10 7036 following command generates noise in the luminance plane by employing
yading@10 7037 the \f(CW\*(C`geq\*(C'\fR filter:
yading@10 7038 .PP
yading@10 7039 .Vb 1
yading@10 7040 \& nullsrc=s=256x256, geq=random(1)*255:128:128
yading@10 7041 .Ve
yading@10 7042 .SH "VIDEO SINKS"
yading@10 7043 .IX Header "VIDEO SINKS"
yading@10 7044 Below is a description of the currently available video sinks.
yading@10 7045 .SS "buffersink"
yading@10 7046 .IX Subsection "buffersink"
yading@10 7047 Buffer video frames, and make them available to the end of the filter
yading@10 7048 graph.
yading@10 7049 .PP
yading@10 7050 This sink is mainly intended for a programmatic use, in particular
yading@10 7051 through the interface defined in \fIlibavfilter/buffersink.h\fR
yading@10 7052 or the options system.
yading@10 7053 .PP
yading@10 7054 It accepts a pointer to an AVBufferSinkContext structure, which
yading@10 7055 defines the incoming buffers' formats, to be passed as the opaque
yading@10 7056 parameter to \f(CW\*(C`avfilter_init_filter\*(C'\fR for initialization.
yading@10 7057 .SS "nullsink"
yading@10 7058 .IX Subsection "nullsink"
yading@10 7059 Null video sink, do absolutely nothing with the input video. It is
yading@10 7060 mainly useful as a template and to be employed in analysis / debugging
yading@10 7061 tools.
yading@10 7062 .SH "MULTIMEDIA FILTERS"
yading@10 7063 .IX Header "MULTIMEDIA FILTERS"
yading@10 7064 Below is a description of the currently available multimedia filters.
yading@10 7065 .SS "aperms, perms"
yading@10 7066 .IX Subsection "aperms, perms"
yading@10 7067 Set read/write permissions for the output frames.
yading@10 7068 .PP
yading@10 7069 These filters are mainly aimed at developers to test direct path in the
yading@10 7070 following filter in the filtergraph.
yading@10 7071 .PP
yading@10 7072 The filters accept the following options:
yading@10 7073 .IP "\fBmode\fR" 4
yading@10 7074 .IX Item "mode"
yading@10 7075 Select the permissions mode.
yading@10 7076 .Sp
yading@10 7077 It accepts the following values:
yading@10 7078 .RS 4
yading@10 7079 .IP "\fBnone\fR" 4
yading@10 7080 .IX Item "none"
yading@10 7081 Do nothing. This is the default.
yading@10 7082 .IP "\fBro\fR" 4
yading@10 7083 .IX Item "ro"
yading@10 7084 Set all the output frames read-only.
yading@10 7085 .IP "\fBrw\fR" 4
yading@10 7086 .IX Item "rw"
yading@10 7087 Set all the output frames directly writable.
yading@10 7088 .IP "\fBtoggle\fR" 4
yading@10 7089 .IX Item "toggle"
yading@10 7090 Make the frame read-only if writable, and writable if read-only.
yading@10 7091 .IP "\fBrandom\fR" 4
yading@10 7092 .IX Item "random"
yading@10 7093 Set each output frame read-only or writable randomly.
yading@10 7094 .RE
yading@10 7095 .RS 4
yading@10 7096 .RE
yading@10 7097 .IP "\fBseed\fR" 4
yading@10 7098 .IX Item "seed"
yading@10 7099 Set the seed for the \fIrandom\fR mode, must be an integer included between
yading@10 7100 \&\f(CW0\fR and \f(CW\*(C`UINT32_MAX\*(C'\fR. If not specified, or if explicitly set to
yading@10 7101 \&\f(CW\*(C`\-1\*(C'\fR, the filter will try to use a good random seed on a best effort
yading@10 7102 basis.
yading@10 7103 .PP
yading@10 7104 Note: in case of auto-inserted filter between the permission filter and the
yading@10 7105 following one, the permission might not be received as expected in that
yading@10 7106 following filter. Inserting a format or aformat filter before the
yading@10 7107 perms/aperms filter can avoid this problem.
yading@10 7108 .SS "aselect, select"
yading@10 7109 .IX Subsection "aselect, select"
yading@10 7110 Select frames to pass in output.
yading@10 7111 .PP
yading@10 7112 This filter accepts the following options:
yading@10 7113 .IP "\fBexpr, e\fR" 4
yading@10 7114 .IX Item "expr, e"
yading@10 7115 Set expression, which is evaluated for each input frame.
yading@10 7116 .Sp
yading@10 7117 If the expression is evaluated to zero, the frame is discarded.
yading@10 7118 .Sp
yading@10 7119 If the evaluation result is negative or NaN, the frame is sent to the
yading@10 7120 first output; otherwise it is sent to the output with index
yading@10 7121 \&\f(CW\*(C`ceil(val)\-1\*(C'\fR, assuming that the input index starts from 0.
yading@10 7122 .Sp
yading@10 7123 For example a value of \f(CW1.2\fR corresponds to the output with index
yading@10 7124 \&\f(CW\*(C`ceil(1.2)\-1 = 2\-1 = 1\*(C'\fR, that is the second output.
yading@10 7125 .IP "\fBoutputs, n\fR" 4
yading@10 7126 .IX Item "outputs, n"
yading@10 7127 Set the number of outputs. The output to which to send the selected
yading@10 7128 frame is based on the result of the evaluation. Default value is 1.
yading@10 7129 .PP
yading@10 7130 The expression can contain the following constants:
yading@10 7131 .IP "\fBn\fR" 4
yading@10 7132 .IX Item "n"
yading@10 7133 the sequential number of the filtered frame, starting from 0
yading@10 7134 .IP "\fBselected_n\fR" 4
yading@10 7135 .IX Item "selected_n"
yading@10 7136 the sequential number of the selected frame, starting from 0
yading@10 7137 .IP "\fBprev_selected_n\fR" 4
yading@10 7138 .IX Item "prev_selected_n"
yading@10 7139 the sequential number of the last selected frame, \s-1NAN\s0 if undefined
yading@10 7140 .IP "\fB\s-1TB\s0\fR" 4
yading@10 7141 .IX Item "TB"
yading@10 7142 timebase of the input timestamps
yading@10 7143 .IP "\fBpts\fR" 4
yading@10 7144 .IX Item "pts"
yading@10 7145 the \s-1PTS\s0 (Presentation TimeStamp) of the filtered video frame,
yading@10 7146 expressed in \fI\s-1TB\s0\fR units, \s-1NAN\s0 if undefined
yading@10 7147 .IP "\fBt\fR" 4
yading@10 7148 .IX Item "t"
yading@10 7149 the \s-1PTS\s0 (Presentation TimeStamp) of the filtered video frame,
yading@10 7150 expressed in seconds, \s-1NAN\s0 if undefined
yading@10 7151 .IP "\fBprev_pts\fR" 4
yading@10 7152 .IX Item "prev_pts"
yading@10 7153 the \s-1PTS\s0 of the previously filtered video frame, \s-1NAN\s0 if undefined
yading@10 7154 .IP "\fBprev_selected_pts\fR" 4
yading@10 7155 .IX Item "prev_selected_pts"
yading@10 7156 the \s-1PTS\s0 of the last previously filtered video frame, \s-1NAN\s0 if undefined
yading@10 7157 .IP "\fBprev_selected_t\fR" 4
yading@10 7158 .IX Item "prev_selected_t"
yading@10 7159 the \s-1PTS\s0 of the last previously selected video frame, \s-1NAN\s0 if undefined
yading@10 7160 .IP "\fBstart_pts\fR" 4
yading@10 7161 .IX Item "start_pts"
yading@10 7162 the \s-1PTS\s0 of the first video frame in the video, \s-1NAN\s0 if undefined
yading@10 7163 .IP "\fBstart_t\fR" 4
yading@10 7164 .IX Item "start_t"
yading@10 7165 the time of the first video frame in the video, \s-1NAN\s0 if undefined
yading@10 7166 .IP "\fBpict_type\fR \fI(video only)\fR" 4
yading@10 7167 .IX Item "pict_type (video only)"
yading@10 7168 the type of the filtered frame, can assume one of the following
yading@10 7169 values:
yading@10 7170 .RS 4
yading@10 7171 .IP "\fBI\fR" 4
yading@10 7172 .IX Item "I"
yading@10 7173 .PD 0
yading@10 7174 .IP "\fBP\fR" 4
yading@10 7175 .IX Item "P"
yading@10 7176 .IP "\fBB\fR" 4
yading@10 7177 .IX Item "B"
yading@10 7178 .IP "\fBS\fR" 4
yading@10 7179 .IX Item "S"
yading@10 7180 .IP "\fB\s-1SI\s0\fR" 4
yading@10 7181 .IX Item "SI"
yading@10 7182 .IP "\fB\s-1SP\s0\fR" 4
yading@10 7183 .IX Item "SP"
yading@10 7184 .IP "\fB\s-1BI\s0\fR" 4
yading@10 7185 .IX Item "BI"
yading@10 7186 .RE
yading@10 7187 .RS 4
yading@10 7188 .RE
yading@10 7189 .IP "\fBinterlace_type\fR \fI(video only)\fR" 4
yading@10 7190 .IX Item "interlace_type (video only)"
yading@10 7191 .PD
yading@10 7192 the frame interlace type, can assume one of the following values:
yading@10 7193 .RS 4
yading@10 7194 .IP "\fB\s-1PROGRESSIVE\s0\fR" 4
yading@10 7195 .IX Item "PROGRESSIVE"
yading@10 7196 the frame is progressive (not interlaced)
yading@10 7197 .IP "\fB\s-1TOPFIRST\s0\fR" 4
yading@10 7198 .IX Item "TOPFIRST"
yading@10 7199 the frame is top-field-first
yading@10 7200 .IP "\fB\s-1BOTTOMFIRST\s0\fR" 4
yading@10 7201 .IX Item "BOTTOMFIRST"
yading@10 7202 the frame is bottom-field-first
yading@10 7203 .RE
yading@10 7204 .RS 4
yading@10 7205 .RE
yading@10 7206 .IP "\fBconsumed_sample_n\fR \fI(audio only)\fR" 4
yading@10 7207 .IX Item "consumed_sample_n (audio only)"
yading@10 7208 the number of selected samples before the current frame
yading@10 7209 .IP "\fBsamples_n\fR \fI(audio only)\fR" 4
yading@10 7210 .IX Item "samples_n (audio only)"
yading@10 7211 the number of samples in the current frame
yading@10 7212 .IP "\fBsample_rate\fR \fI(audio only)\fR" 4
yading@10 7213 .IX Item "sample_rate (audio only)"
yading@10 7214 the input sample rate
yading@10 7215 .IP "\fBkey\fR" 4
yading@10 7216 .IX Item "key"
yading@10 7217 1 if the filtered frame is a key-frame, 0 otherwise
yading@10 7218 .IP "\fBpos\fR" 4
yading@10 7219 .IX Item "pos"
yading@10 7220 the position in the file of the filtered frame, \-1 if the information
yading@10 7221 is not available (e.g. for synthetic video)
yading@10 7222 .IP "\fBscene\fR \fI(video only)\fR" 4
yading@10 7223 .IX Item "scene (video only)"
yading@10 7224 value between 0 and 1 to indicate a new scene; a low value reflects a low
yading@10 7225 probability for the current frame to introduce a new scene, while a higher
yading@10 7226 value means the current frame is more likely to be one (see the example below)
yading@10 7227 .PP
yading@10 7228 The default value of the select expression is \*(L"1\*(R".
yading@10 7229 .PP
yading@10 7230 \fIExamples\fR
yading@10 7231 .IX Subsection "Examples"
yading@10 7232 .IP "\(bu" 4
yading@10 7233 Select all frames in input:
yading@10 7234 .Sp
yading@10 7235 .Vb 1
yading@10 7236 \& select
yading@10 7237 .Ve
yading@10 7238 .Sp
yading@10 7239 The example above is the same as:
yading@10 7240 .Sp
yading@10 7241 .Vb 1
yading@10 7242 \& select=1
yading@10 7243 .Ve
yading@10 7244 .IP "\(bu" 4
yading@10 7245 Skip all frames:
yading@10 7246 .Sp
yading@10 7247 .Vb 1
yading@10 7248 \& select=0
yading@10 7249 .Ve
yading@10 7250 .IP "\(bu" 4
yading@10 7251 Select only I\-frames:
yading@10 7252 .Sp
yading@10 7253 .Vb 1
yading@10 7254 \& select=\*(Aqeq(pict_type\e,I)\*(Aq
yading@10 7255 .Ve
yading@10 7256 .IP "\(bu" 4
yading@10 7257 Select one frame every 100:
yading@10 7258 .Sp
yading@10 7259 .Vb 1
yading@10 7260 \& select=\*(Aqnot(mod(n\e,100))\*(Aq
yading@10 7261 .Ve
yading@10 7262 .IP "\(bu" 4
yading@10 7263 Select only frames contained in the 10\-20 time interval:
yading@10 7264 .Sp
yading@10 7265 .Vb 1
yading@10 7266 \& select=\*(Aqgte(t\e,10)*lte(t\e,20)\*(Aq
yading@10 7267 .Ve
yading@10 7268 .IP "\(bu" 4
yading@10 7269 Select only I frames contained in the 10\-20 time interval:
yading@10 7270 .Sp
yading@10 7271 .Vb 1
yading@10 7272 \& select=\*(Aqgte(t\e,10)*lte(t\e,20)*eq(pict_type\e,I)\*(Aq
yading@10 7273 .Ve
yading@10 7274 .IP "\(bu" 4
yading@10 7275 Select frames with a minimum distance of 10 seconds:
yading@10 7276 .Sp
yading@10 7277 .Vb 1
yading@10 7278 \& select=\*(Aqisnan(prev_selected_t)+gte(t\-prev_selected_t\e,10)\*(Aq
yading@10 7279 .Ve
yading@10 7280 .IP "\(bu" 4
yading@10 7281 Use aselect to select only audio frames with samples number > 100:
yading@10 7282 .Sp
yading@10 7283 .Vb 1
yading@10 7284 \& aselect=\*(Aqgt(samples_n\e,100)\*(Aq
yading@10 7285 .Ve
yading@10 7286 .IP "\(bu" 4
yading@10 7287 Create a mosaic of the first scenes:
yading@10 7288 .Sp
yading@10 7289 .Vb 1
yading@10 7290 \& ffmpeg \-i video.avi \-vf select=\*(Aqgt(scene\e,0.4)\*(Aq,scale=160:120,tile \-frames:v 1 preview.png
yading@10 7291 .Ve
yading@10 7292 .Sp
yading@10 7293 Comparing \fIscene\fR against a value between 0.3 and 0.5 is generally a sane
yading@10 7294 choice.
yading@10 7295 .IP "\(bu" 4
yading@10 7296 Send even and odd frames to separate outputs, and compose them:
yading@10 7297 .Sp
yading@10 7298 .Vb 1
yading@10 7299 \& select=n=2:e=\*(Aqmod(n, 2)+1\*(Aq [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
yading@10 7300 .Ve
yading@10 7301 .SS "asendcmd, sendcmd"
yading@10 7302 .IX Subsection "asendcmd, sendcmd"
yading@10 7303 Send commands to filters in the filtergraph.
yading@10 7304 .PP
yading@10 7305 These filters read commands to be sent to other filters in the
yading@10 7306 filtergraph.
yading@10 7307 .PP
yading@10 7308 \&\f(CW\*(C`asendcmd\*(C'\fR must be inserted between two audio filters,
yading@10 7309 \&\f(CW\*(C`sendcmd\*(C'\fR must be inserted between two video filters, but apart
yading@10 7310 from that they act the same way.
yading@10 7311 .PP
yading@10 7312 The specification of commands can be provided in the filter arguments
yading@10 7313 with the \fIcommands\fR option, or in a file specified by the
yading@10 7314 \&\fIfilename\fR option.
yading@10 7315 .PP
yading@10 7316 These filters accept the following options:
yading@10 7317 .IP "\fBcommands, c\fR" 4
yading@10 7318 .IX Item "commands, c"
yading@10 7319 Set the commands to be read and sent to the other filters.
yading@10 7320 .IP "\fBfilename, f\fR" 4
yading@10 7321 .IX Item "filename, f"
yading@10 7322 Set the filename of the commands to be read and sent to the other
yading@10 7323 filters.
yading@10 7324 .PP
yading@10 7325 \fICommands syntax\fR
yading@10 7326 .IX Subsection "Commands syntax"
yading@10 7327 .PP
yading@10 7328 A commands description consists of a sequence of interval
yading@10 7329 specifications, comprising a list of commands to be executed when a
yading@10 7330 particular event related to that interval occurs. The occurring event
yading@10 7331 is typically the current frame time entering or leaving a given time
yading@10 7332 interval.
yading@10 7333 .PP
yading@10 7334 An interval is specified by the following syntax:
yading@10 7335 .PP
yading@10 7336 .Vb 1
yading@10 7337 \& <START>[\-<END>] <COMMANDS>;
yading@10 7338 .Ve
yading@10 7339 .PP
yading@10 7340 The time interval is specified by the \fI\s-1START\s0\fR and \fI\s-1END\s0\fR times.
yading@10 7341 \&\fI\s-1END\s0\fR is optional and defaults to the maximum time.
yading@10 7342 .PP
yading@10 7343 The current frame time is considered within the specified interval if
yading@10 7344 it is included in the interval [\fI\s-1START\s0\fR, \fI\s-1END\s0\fR), that is when
yading@10 7345 the time is greater or equal to \fI\s-1START\s0\fR and is lesser than
yading@10 7346 \&\fI\s-1END\s0\fR.
yading@10 7347 .PP
yading@10 7348 \&\fI\s-1COMMANDS\s0\fR consists of a sequence of one or more command
yading@10 7349 specifications, separated by \*(L",\*(R", relating to that interval. The
yading@10 7350 syntax of a command specification is given by:
yading@10 7351 .PP
yading@10 7352 .Vb 1
yading@10 7353 \& [<FLAGS>] <TARGET> <COMMAND> <ARG>
yading@10 7354 .Ve
yading@10 7355 .PP
yading@10 7356 \&\fI\s-1FLAGS\s0\fR is optional and specifies the type of events relating to
yading@10 7357 the time interval which enable sending the specified command, and must
yading@10 7358 be a non-null sequence of identifier flags separated by \*(L"+\*(R" or \*(L"|\*(R" and
yading@10 7359 enclosed between \*(L"[\*(R" and \*(L"]\*(R".
yading@10 7360 .PP
yading@10 7361 The following flags are recognized:
yading@10 7362 .IP "\fBenter\fR" 4
yading@10 7363 .IX Item "enter"
yading@10 7364 The command is sent when the current frame timestamp enters the
yading@10 7365 specified interval. In other words, the command is sent when the
yading@10 7366 previous frame timestamp was not in the given interval, and the
yading@10 7367 current is.
yading@10 7368 .IP "\fBleave\fR" 4
yading@10 7369 .IX Item "leave"
yading@10 7370 The command is sent when the current frame timestamp leaves the
yading@10 7371 specified interval. In other words, the command is sent when the
yading@10 7372 previous frame timestamp was in the given interval, and the
yading@10 7373 current is not.
yading@10 7374 .PP
yading@10 7375 If \fI\s-1FLAGS\s0\fR is not specified, a default value of \f(CW\*(C`[enter]\*(C'\fR is
yading@10 7376 assumed.
yading@10 7377 .PP
yading@10 7378 \&\fI\s-1TARGET\s0\fR specifies the target of the command, usually the name of
yading@10 7379 the filter class or a specific filter instance name.
yading@10 7380 .PP
yading@10 7381 \&\fI\s-1COMMAND\s0\fR specifies the name of the command for the target filter.
yading@10 7382 .PP
yading@10 7383 \&\fI\s-1ARG\s0\fR is optional and specifies the optional list of argument for
yading@10 7384 the given \fI\s-1COMMAND\s0\fR.
yading@10 7385 .PP
yading@10 7386 Between one interval specification and another, whitespaces, or
yading@10 7387 sequences of characters starting with \f(CW\*(C`#\*(C'\fR until the end of line,
yading@10 7388 are ignored and can be used to annotate comments.
yading@10 7389 .PP
yading@10 7390 A simplified \s-1BNF\s0 description of the commands specification syntax
yading@10 7391 follows:
yading@10 7392 .PP
yading@10 7393 .Vb 6
yading@10 7394 \& <COMMAND_FLAG> ::= "enter" | "leave"
yading@10 7395 \& <COMMAND_FLAGS> ::= <COMMAND_FLAG> [(+|"|")<COMMAND_FLAG>]
yading@10 7396 \& <COMMAND> ::= ["[" <COMMAND_FLAGS> "]"] <TARGET> <COMMAND> [<ARG>]
yading@10 7397 \& <COMMANDS> ::= <COMMAND> [,<COMMANDS>]
yading@10 7398 \& <INTERVAL> ::= <START>[\-<END>] <COMMANDS>
yading@10 7399 \& <INTERVALS> ::= <INTERVAL>[;<INTERVALS>]
yading@10 7400 .Ve
yading@10 7401 .PP
yading@10 7402 \fIExamples\fR
yading@10 7403 .IX Subsection "Examples"
yading@10 7404 .IP "\(bu" 4
yading@10 7405 Specify audio tempo change at second 4:
yading@10 7406 .Sp
yading@10 7407 .Vb 1
yading@10 7408 \& asendcmd=c=\*(Aq4.0 atempo tempo 1.5\*(Aq,atempo
yading@10 7409 .Ve
yading@10 7410 .IP "\(bu" 4
yading@10 7411 Specify a list of drawtext and hue commands in a file.
yading@10 7412 .Sp
yading@10 7413 .Vb 3
yading@10 7414 \& # show text in the interval 5\-10
yading@10 7415 \& 5.0\-10.0 [enter] drawtext reinit \*(Aqfontfile=FreeSerif.ttf:text=hello world\*(Aq,
yading@10 7416 \& [leave] drawtext reinit \*(Aqfontfile=FreeSerif.ttf:text=\*(Aq;
yading@10 7417 \&
yading@10 7418 \& # desaturate the image in the interval 15\-20
yading@10 7419 \& 15.0\-20.0 [enter] hue s 0,
yading@10 7420 \& [enter] drawtext reinit \*(Aqfontfile=FreeSerif.ttf:text=nocolor\*(Aq,
yading@10 7421 \& [leave] hue s 1,
yading@10 7422 \& [leave] drawtext reinit \*(Aqfontfile=FreeSerif.ttf:text=color\*(Aq;
yading@10 7423 \&
yading@10 7424 \& # apply an exponential saturation fade\-out effect, starting from time 25
yading@10 7425 \& 25 [enter] hue s exp(25\-t)
yading@10 7426 .Ve
yading@10 7427 .Sp
yading@10 7428 A filtergraph allowing to read and process the above command list
yading@10 7429 stored in a file \fItest.cmd\fR, can be specified with:
yading@10 7430 .Sp
yading@10 7431 .Vb 1
yading@10 7432 \& sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text=\*(Aq\*(Aq,hue
yading@10 7433 .Ve
yading@10 7434 .SS "asetpts, setpts"
yading@10 7435 .IX Subsection "asetpts, setpts"
yading@10 7436 Change the \s-1PTS\s0 (presentation timestamp) of the input frames.
yading@10 7437 .PP
yading@10 7438 \&\f(CW\*(C`asetpts\*(C'\fR works on audio frames, \f(CW\*(C`setpts\*(C'\fR on video frames.
yading@10 7439 .PP
yading@10 7440 This filter accepts the following options:
yading@10 7441 .IP "\fBexpr\fR" 4
yading@10 7442 .IX Item "expr"
yading@10 7443 The expression which is evaluated for each frame to construct its timestamp.
yading@10 7444 .PP
yading@10 7445 The expression is evaluated through the eval \s-1API\s0 and can contain the following
yading@10 7446 constants:
yading@10 7447 .IP "\fB\s-1FRAME_RATE\s0\fR" 4
yading@10 7448 .IX Item "FRAME_RATE"
yading@10 7449 frame rate, only defined for constant frame-rate video
yading@10 7450 .IP "\fB\s-1PTS\s0\fR" 4
yading@10 7451 .IX Item "PTS"
yading@10 7452 the presentation timestamp in input
yading@10 7453 .IP "\fBN\fR" 4
yading@10 7454 .IX Item "N"
yading@10 7455 the count of the input frame, starting from 0.
yading@10 7456 .IP "\fB\s-1NB_CONSUMED_SAMPLES\s0\fR" 4
yading@10 7457 .IX Item "NB_CONSUMED_SAMPLES"
yading@10 7458 the number of consumed samples, not including the current frame (only
yading@10 7459 audio)
yading@10 7460 .IP "\fB\s-1NB_SAMPLES\s0\fR" 4
yading@10 7461 .IX Item "NB_SAMPLES"
yading@10 7462 the number of samples in the current frame (only audio)
yading@10 7463 .IP "\fB\s-1SAMPLE_RATE\s0\fR" 4
yading@10 7464 .IX Item "SAMPLE_RATE"
yading@10 7465 audio sample rate
yading@10 7466 .IP "\fB\s-1STARTPTS\s0\fR" 4
yading@10 7467 .IX Item "STARTPTS"
yading@10 7468 the \s-1PTS\s0 of the first frame
yading@10 7469 .IP "\fB\s-1STARTT\s0\fR" 4
yading@10 7470 .IX Item "STARTT"
yading@10 7471 the time in seconds of the first frame
yading@10 7472 .IP "\fB\s-1INTERLACED\s0\fR" 4
yading@10 7473 .IX Item "INTERLACED"
yading@10 7474 tell if the current frame is interlaced
yading@10 7475 .IP "\fBT\fR" 4
yading@10 7476 .IX Item "T"
yading@10 7477 the time in seconds of the current frame
yading@10 7478 .IP "\fB\s-1TB\s0\fR" 4
yading@10 7479 .IX Item "TB"
yading@10 7480 the time base
yading@10 7481 .IP "\fB\s-1POS\s0\fR" 4
yading@10 7482 .IX Item "POS"
yading@10 7483 original position in the file of the frame, or undefined if undefined
yading@10 7484 for the current frame
yading@10 7485 .IP "\fB\s-1PREV_INPTS\s0\fR" 4
yading@10 7486 .IX Item "PREV_INPTS"
yading@10 7487 previous input \s-1PTS\s0
yading@10 7488 .IP "\fB\s-1PREV_INT\s0\fR" 4
yading@10 7489 .IX Item "PREV_INT"
yading@10 7490 previous input time in seconds
yading@10 7491 .IP "\fB\s-1PREV_OUTPTS\s0\fR" 4
yading@10 7492 .IX Item "PREV_OUTPTS"
yading@10 7493 previous output \s-1PTS\s0
yading@10 7494 .IP "\fB\s-1PREV_OUTT\s0\fR" 4
yading@10 7495 .IX Item "PREV_OUTT"
yading@10 7496 previous output time in seconds
yading@10 7497 .IP "\fB\s-1RTCTIME\s0\fR" 4
yading@10 7498 .IX Item "RTCTIME"
yading@10 7499 wallclock (\s-1RTC\s0) time in microseconds. This is deprecated, use \fItime\fR\|(0)
yading@10 7500 instead.
yading@10 7501 .IP "\fB\s-1RTCSTART\s0\fR" 4
yading@10 7502 .IX Item "RTCSTART"
yading@10 7503 wallclock (\s-1RTC\s0) time at the start of the movie in microseconds
yading@10 7504 .PP
yading@10 7505 \fIExamples\fR
yading@10 7506 .IX Subsection "Examples"
yading@10 7507 .IP "\(bu" 4
yading@10 7508 Start counting \s-1PTS\s0 from zero
yading@10 7509 .Sp
yading@10 7510 .Vb 1
yading@10 7511 \& setpts=PTS\-STARTPTS
yading@10 7512 .Ve
yading@10 7513 .IP "\(bu" 4
yading@10 7514 Apply fast motion effect:
yading@10 7515 .Sp
yading@10 7516 .Vb 1
yading@10 7517 \& setpts=0.5*PTS
yading@10 7518 .Ve
yading@10 7519 .IP "\(bu" 4
yading@10 7520 Apply slow motion effect:
yading@10 7521 .Sp
yading@10 7522 .Vb 1
yading@10 7523 \& setpts=2.0*PTS
yading@10 7524 .Ve
yading@10 7525 .IP "\(bu" 4
yading@10 7526 Set fixed rate of 25 frames per second:
yading@10 7527 .Sp
yading@10 7528 .Vb 1
yading@10 7529 \& setpts=N/(25*TB)
yading@10 7530 .Ve
yading@10 7531 .IP "\(bu" 4
yading@10 7532 Set fixed rate 25 fps with some jitter:
yading@10 7533 .Sp
yading@10 7534 .Vb 1
yading@10 7535 \& setpts=\*(Aq1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))\*(Aq
yading@10 7536 .Ve
yading@10 7537 .IP "\(bu" 4
yading@10 7538 Apply an offset of 10 seconds to the input \s-1PTS:\s0
yading@10 7539 .Sp
yading@10 7540 .Vb 1
yading@10 7541 \& setpts=PTS+10/TB
yading@10 7542 .Ve
yading@10 7543 .IP "\(bu" 4
yading@10 7544 Generate timestamps from a \*(L"live source\*(R" and rebase onto the current timebase:
yading@10 7545 .Sp
yading@10 7546 .Vb 1
yading@10 7547 \& setpts=\*(Aq(RTCTIME \- RTCSTART) / (TB * 1000000)\*(Aq
yading@10 7548 .Ve
yading@10 7549 .SS "ebur128"
yading@10 7550 .IX Subsection "ebur128"
yading@10 7551 \&\s-1EBU\s0 R128 scanner filter. This filter takes an audio stream as input and outputs
yading@10 7552 it unchanged. By default, it logs a message at a frequency of 10Hz with the
yading@10 7553 Momentary loudness (identified by \f(CW\*(C`M\*(C'\fR), Short-term loudness (\f(CW\*(C`S\*(C'\fR),
yading@10 7554 Integrated loudness (\f(CW\*(C`I\*(C'\fR) and Loudness Range (\f(CW\*(C`LRA\*(C'\fR).
yading@10 7555 .PP
yading@10 7556 The filter also has a video output (see the \fIvideo\fR option) with a real
yading@10 7557 time graph to observe the loudness evolution. The graphic contains the logged
yading@10 7558 message mentioned above, so it is not printed anymore when this option is set,
yading@10 7559 unless the verbose logging is set. The main graphing area contains the
yading@10 7560 short-term loudness (3 seconds of analysis), and the gauge on the right is for
yading@10 7561 the momentary loudness (400 milliseconds).
yading@10 7562 .PP
yading@10 7563 More information about the Loudness Recommendation \s-1EBU\s0 R128 on
yading@10 7564 <\fBhttp://tech.ebu.ch/loudness\fR>.
yading@10 7565 .PP
yading@10 7566 The filter accepts the following options:
yading@10 7567 .IP "\fBvideo\fR" 4
yading@10 7568 .IX Item "video"
yading@10 7569 Activate the video output. The audio stream is passed unchanged whether this
yading@10 7570 option is set or no. The video stream will be the first output stream if
yading@10 7571 activated. Default is \f(CW0\fR.
yading@10 7572 .IP "\fBsize\fR" 4
yading@10 7573 .IX Item "size"
yading@10 7574 Set the video size. This option is for video only. Default and minimum
yading@10 7575 resolution is \f(CW\*(C`640x480\*(C'\fR.
yading@10 7576 .IP "\fBmeter\fR" 4
yading@10 7577 .IX Item "meter"
yading@10 7578 Set the \s-1EBU\s0 scale meter. Default is \f(CW9\fR. Common values are \f(CW9\fR and
yading@10 7579 \&\f(CW18\fR, respectively for \s-1EBU\s0 scale meter +9 and \s-1EBU\s0 scale meter +18. Any
yading@10 7580 other integer value between this range is allowed.
yading@10 7581 .IP "\fBmetadata\fR" 4
yading@10 7582 .IX Item "metadata"
yading@10 7583 Set metadata injection. If set to \f(CW1\fR, the audio input will be segmented
yading@10 7584 into 100ms output frames, each of them containing various loudness information
yading@10 7585 in metadata. All the metadata keys are prefixed with \f(CW\*(C`lavfi.r128.\*(C'\fR.
yading@10 7586 .Sp
yading@10 7587 Default is \f(CW0\fR.
yading@10 7588 .IP "\fBframelog\fR" 4
yading@10 7589 .IX Item "framelog"
yading@10 7590 Force the frame logging level.
yading@10 7591 .Sp
yading@10 7592 Available values are:
yading@10 7593 .RS 4
yading@10 7594 .IP "\fBinfo\fR" 4
yading@10 7595 .IX Item "info"
yading@10 7596 information logging level
yading@10 7597 .IP "\fBverbose\fR" 4
yading@10 7598 .IX Item "verbose"
yading@10 7599 verbose logging level
yading@10 7600 .RE
yading@10 7601 .RS 4
yading@10 7602 .Sp
yading@10 7603 By default, the logging level is set to \fIinfo\fR. If the \fBvideo\fR or
yading@10 7604 the \fBmetadata\fR options are set, it switches to \fIverbose\fR.
yading@10 7605 .RE
yading@10 7606 .PP
yading@10 7607 \fIExamples\fR
yading@10 7608 .IX Subsection "Examples"
yading@10 7609 .IP "\(bu" 4
yading@10 7610 Real-time graph using \fBffplay\fR, with a \s-1EBU\s0 scale meter +18:
yading@10 7611 .Sp
yading@10 7612 .Vb 1
yading@10 7613 \& ffplay \-f lavfi \-i "amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]"
yading@10 7614 .Ve
yading@10 7615 .IP "\(bu" 4
yading@10 7616 Run an analysis with \fBffmpeg\fR:
yading@10 7617 .Sp
yading@10 7618 .Vb 1
yading@10 7619 \& ffmpeg \-nostats \-i input.mp3 \-filter_complex ebur128 \-f null \-
yading@10 7620 .Ve
yading@10 7621 .SS "settb, asettb"
yading@10 7622 .IX Subsection "settb, asettb"
yading@10 7623 Set the timebase to use for the output frames timestamps.
yading@10 7624 It is mainly useful for testing timebase configuration.
yading@10 7625 .PP
yading@10 7626 This filter accepts the following options:
yading@10 7627 .IP "\fBexpr, tb\fR" 4
yading@10 7628 .IX Item "expr, tb"
yading@10 7629 The expression which is evaluated into the output timebase.
yading@10 7630 .PP
yading@10 7631 The value for \fBtb\fR is an arithmetic expression representing a
yading@10 7632 rational. The expression can contain the constants \*(L"\s-1AVTB\s0\*(R" (the default
yading@10 7633 timebase), \*(L"intb\*(R" (the input timebase) and \*(L"sr\*(R" (the sample rate,
yading@10 7634 audio only). Default value is \*(L"intb\*(R".
yading@10 7635 .PP
yading@10 7636 \fIExamples\fR
yading@10 7637 .IX Subsection "Examples"
yading@10 7638 .IP "\(bu" 4
yading@10 7639 Set the timebase to 1/25:
yading@10 7640 .Sp
yading@10 7641 .Vb 1
yading@10 7642 \& settb=expr=1/25
yading@10 7643 .Ve
yading@10 7644 .IP "\(bu" 4
yading@10 7645 Set the timebase to 1/10:
yading@10 7646 .Sp
yading@10 7647 .Vb 1
yading@10 7648 \& settb=expr=0.1
yading@10 7649 .Ve
yading@10 7650 .IP "\(bu" 4
yading@10 7651 Set the timebase to 1001/1000:
yading@10 7652 .Sp
yading@10 7653 .Vb 1
yading@10 7654 \& settb=1+0.001
yading@10 7655 .Ve
yading@10 7656 .IP "\(bu" 4
yading@10 7657 Set the timebase to 2*intb:
yading@10 7658 .Sp
yading@10 7659 .Vb 1
yading@10 7660 \& settb=2*intb
yading@10 7661 .Ve
yading@10 7662 .IP "\(bu" 4
yading@10 7663 Set the default timebase value:
yading@10 7664 .Sp
yading@10 7665 .Vb 1
yading@10 7666 \& settb=AVTB
yading@10 7667 .Ve
yading@10 7668 .SS "concat"
yading@10 7669 .IX Subsection "concat"
yading@10 7670 Concatenate audio and video streams, joining them together one after the
yading@10 7671 other.
yading@10 7672 .PP
yading@10 7673 The filter works on segments of synchronized video and audio streams. All
yading@10 7674 segments must have the same number of streams of each type, and that will
yading@10 7675 also be the number of streams at output.
yading@10 7676 .PP
yading@10 7677 The filter accepts the following options:
yading@10 7678 .IP "\fBn\fR" 4
yading@10 7679 .IX Item "n"
yading@10 7680 Set the number of segments. Default is 2.
yading@10 7681 .IP "\fBv\fR" 4
yading@10 7682 .IX Item "v"
yading@10 7683 Set the number of output video streams, that is also the number of video
yading@10 7684 streams in each segment. Default is 1.
yading@10 7685 .IP "\fBa\fR" 4
yading@10 7686 .IX Item "a"
yading@10 7687 Set the number of output audio streams, that is also the number of video
yading@10 7688 streams in each segment. Default is 0.
yading@10 7689 .IP "\fBunsafe\fR" 4
yading@10 7690 .IX Item "unsafe"
yading@10 7691 Activate unsafe mode: do not fail if segments have a different format.
yading@10 7692 .PP
yading@10 7693 The filter has \fIv\fR+\fIa\fR outputs: first \fIv\fR video outputs, then
yading@10 7694 \&\fIa\fR audio outputs.
yading@10 7695 .PP
yading@10 7696 There are \fIn\fRx(\fIv\fR+\fIa\fR) inputs: first the inputs for the first
yading@10 7697 segment, in the same order as the outputs, then the inputs for the second
yading@10 7698 segment, etc.
yading@10 7699 .PP
yading@10 7700 Related streams do not always have exactly the same duration, for various
yading@10 7701 reasons including codec frame size or sloppy authoring. For that reason,
yading@10 7702 related synchronized streams (e.g. a video and its audio track) should be
yading@10 7703 concatenated at once. The concat filter will use the duration of the longest
yading@10 7704 stream in each segment (except the last one), and if necessary pad shorter
yading@10 7705 audio streams with silence.
yading@10 7706 .PP
yading@10 7707 For this filter to work correctly, all segments must start at timestamp 0.
yading@10 7708 .PP
yading@10 7709 All corresponding streams must have the same parameters in all segments; the
yading@10 7710 filtering system will automatically select a common pixel format for video
yading@10 7711 streams, and a common sample format, sample rate and channel layout for
yading@10 7712 audio streams, but other settings, such as resolution, must be converted
yading@10 7713 explicitly by the user.
yading@10 7714 .PP
yading@10 7715 Different frame rates are acceptable but will result in variable frame rate
yading@10 7716 at output; be sure to configure the output file to handle it.
yading@10 7717 .PP
yading@10 7718 \fIExamples\fR
yading@10 7719 .IX Subsection "Examples"
yading@10 7720 .IP "\(bu" 4
yading@10 7721 Concatenate an opening, an episode and an ending, all in bilingual version
yading@10 7722 (video in stream 0, audio in streams 1 and 2):
yading@10 7723 .Sp
yading@10 7724 .Vb 4
yading@10 7725 \& ffmpeg \-i opening.mkv \-i episode.mkv \-i ending.mkv \-filter_complex \e
yading@10 7726 \& \*(Aq[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
yading@10 7727 \& concat=n=3:v=1:a=2 [v] [a1] [a2]\*(Aq \e
yading@10 7728 \& \-map \*(Aq[v]\*(Aq \-map \*(Aq[a1]\*(Aq \-map \*(Aq[a2]\*(Aq output.mkv
yading@10 7729 .Ve
yading@10 7730 .IP "\(bu" 4
yading@10 7731 Concatenate two parts, handling audio and video separately, using the
yading@10 7732 (a)movie sources, and adjusting the resolution:
yading@10 7733 .Sp
yading@10 7734 .Vb 3
yading@10 7735 \& movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
yading@10 7736 \& movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
yading@10 7737 \& [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
yading@10 7738 .Ve
yading@10 7739 .Sp
yading@10 7740 Note that a desync will happen at the stitch if the audio and video streams
yading@10 7741 do not have exactly the same duration in the first file.
yading@10 7742 .SS "showspectrum"
yading@10 7743 .IX Subsection "showspectrum"
yading@10 7744 Convert input audio to a video output, representing the audio frequency
yading@10 7745 spectrum.
yading@10 7746 .PP
yading@10 7747 The filter accepts the following options:
yading@10 7748 .IP "\fBsize, s\fR" 4
yading@10 7749 .IX Item "size, s"
yading@10 7750 Specify the video size for the output. Default value is \f(CW\*(C`640x512\*(C'\fR.
yading@10 7751 .IP "\fBslide\fR" 4
yading@10 7752 .IX Item "slide"
yading@10 7753 Specify if the spectrum should slide along the window. Default value is
yading@10 7754 \&\f(CW0\fR.
yading@10 7755 .IP "\fBmode\fR" 4
yading@10 7756 .IX Item "mode"
yading@10 7757 Specify display mode.
yading@10 7758 .Sp
yading@10 7759 It accepts the following values:
yading@10 7760 .RS 4
yading@10 7761 .IP "\fBcombined\fR" 4
yading@10 7762 .IX Item "combined"
yading@10 7763 all channels are displayed in the same row
yading@10 7764 .IP "\fBseparate\fR" 4
yading@10 7765 .IX Item "separate"
yading@10 7766 all channels are displayed in separate rows
yading@10 7767 .RE
yading@10 7768 .RS 4
yading@10 7769 .Sp
yading@10 7770 Default value is \fBcombined\fR.
yading@10 7771 .RE
yading@10 7772 .IP "\fBcolor\fR" 4
yading@10 7773 .IX Item "color"
yading@10 7774 Specify display color mode.
yading@10 7775 .Sp
yading@10 7776 It accepts the following values:
yading@10 7777 .RS 4
yading@10 7778 .IP "\fBchannel\fR" 4
yading@10 7779 .IX Item "channel"
yading@10 7780 each channel is displayed in a separate color
yading@10 7781 .IP "\fBintensity\fR" 4
yading@10 7782 .IX Item "intensity"
yading@10 7783 each channel is is displayed using the same color scheme
yading@10 7784 .RE
yading@10 7785 .RS 4
yading@10 7786 .Sp
yading@10 7787 Default value is \fBchannel\fR.
yading@10 7788 .RE
yading@10 7789 .IP "\fBscale\fR" 4
yading@10 7790 .IX Item "scale"
yading@10 7791 Specify scale used for calculating intensity color values.
yading@10 7792 .Sp
yading@10 7793 It accepts the following values:
yading@10 7794 .RS 4
yading@10 7795 .IP "\fBlin\fR" 4
yading@10 7796 .IX Item "lin"
yading@10 7797 linear
yading@10 7798 .IP "\fBsqrt\fR" 4
yading@10 7799 .IX Item "sqrt"
yading@10 7800 square root, default
yading@10 7801 .IP "\fBcbrt\fR" 4
yading@10 7802 .IX Item "cbrt"
yading@10 7803 cubic root
yading@10 7804 .IP "\fBlog\fR" 4
yading@10 7805 .IX Item "log"
yading@10 7806 logarithmic
yading@10 7807 .RE
yading@10 7808 .RS 4
yading@10 7809 .Sp
yading@10 7810 Default value is \fBsqrt\fR.
yading@10 7811 .RE
yading@10 7812 .IP "\fBsaturation\fR" 4
yading@10 7813 .IX Item "saturation"
yading@10 7814 Set saturation modifier for displayed colors. Negative values provide
yading@10 7815 alternative color scheme. \f(CW0\fR is no saturation at all.
yading@10 7816 Saturation must be in [\-10.0, 10.0] range.
yading@10 7817 Default value is \f(CW1\fR.
yading@10 7818 .PP
yading@10 7819 The usage is very similar to the showwaves filter; see the examples in that
yading@10 7820 section.
yading@10 7821 .PP
yading@10 7822 \fIExamples\fR
yading@10 7823 .IX Subsection "Examples"
yading@10 7824 .IP "\(bu" 4
yading@10 7825 Large window with logarithmic color scaling:
yading@10 7826 .Sp
yading@10 7827 .Vb 1
yading@10 7828 \& showspectrum=s=1280x480:scale=log
yading@10 7829 .Ve
yading@10 7830 .IP "\(bu" 4
yading@10 7831 Complete example for a colored and sliding spectrum per channel using \fBffplay\fR:
yading@10 7832 .Sp
yading@10 7833 .Vb 2
yading@10 7834 \& ffplay \-f lavfi \*(Aqamovie=input.mp3, asplit [a][out1];
yading@10 7835 \& [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]\*(Aq
yading@10 7836 .Ve
yading@10 7837 .SS "showwaves"
yading@10 7838 .IX Subsection "showwaves"
yading@10 7839 Convert input audio to a video output, representing the samples waves.
yading@10 7840 .PP
yading@10 7841 The filter accepts the following options:
yading@10 7842 .IP "\fBsize, s\fR" 4
yading@10 7843 .IX Item "size, s"
yading@10 7844 Specify the video size for the output. Default value is \*(L"600x240\*(R".
yading@10 7845 .IP "\fBmode\fR" 4
yading@10 7846 .IX Item "mode"
yading@10 7847 Set display mode.
yading@10 7848 .Sp
yading@10 7849 Available values are:
yading@10 7850 .RS 4
yading@10 7851 .IP "\fBpoint\fR" 4
yading@10 7852 .IX Item "point"
yading@10 7853 Draw a point for each sample.
yading@10 7854 .IP "\fBline\fR" 4
yading@10 7855 .IX Item "line"
yading@10 7856 Draw a vertical line for each sample.
yading@10 7857 .RE
yading@10 7858 .RS 4
yading@10 7859 .Sp
yading@10 7860 Default value is \f(CW\*(C`point\*(C'\fR.
yading@10 7861 .RE
yading@10 7862 .IP "\fBn\fR" 4
yading@10 7863 .IX Item "n"
yading@10 7864 Set the number of samples which are printed on the same column. A
yading@10 7865 larger value will decrease the frame rate. Must be a positive
yading@10 7866 integer. This option can be set only if the value for \fIrate\fR
yading@10 7867 is not explicitly specified.
yading@10 7868 .IP "\fBrate, r\fR" 4
yading@10 7869 .IX Item "rate, r"
yading@10 7870 Set the (approximate) output frame rate. This is done by setting the
yading@10 7871 option \fIn\fR. Default value is \*(L"25\*(R".
yading@10 7872 .PP
yading@10 7873 \fIExamples\fR
yading@10 7874 .IX Subsection "Examples"
yading@10 7875 .IP "\(bu" 4
yading@10 7876 Output the input file audio and the corresponding video representation
yading@10 7877 at the same time:
yading@10 7878 .Sp
yading@10 7879 .Vb 1
yading@10 7880 \& amovie=a.mp3,asplit[out0],showwaves[out1]
yading@10 7881 .Ve
yading@10 7882 .IP "\(bu" 4
yading@10 7883 Create a synthetic signal and show it with showwaves, forcing a
yading@10 7884 frame rate of 30 frames per second:
yading@10 7885 .Sp
yading@10 7886 .Vb 1
yading@10 7887 \& aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
yading@10 7888 .Ve
yading@10 7889 .SS "split, asplit"
yading@10 7890 .IX Subsection "split, asplit"
yading@10 7891 Split input into several identical outputs.
yading@10 7892 .PP
yading@10 7893 \&\f(CW\*(C`asplit\*(C'\fR works with audio input, \f(CW\*(C`split\*(C'\fR with video.
yading@10 7894 .PP
yading@10 7895 The filter accepts a single parameter which specifies the number of outputs. If
yading@10 7896 unspecified, it defaults to 2.
yading@10 7897 .PP
yading@10 7898 \fIExamples\fR
yading@10 7899 .IX Subsection "Examples"
yading@10 7900 .IP "\(bu" 4
yading@10 7901 Create two separate outputs from the same input:
yading@10 7902 .Sp
yading@10 7903 .Vb 1
yading@10 7904 \& [in] split [out0][out1]
yading@10 7905 .Ve
yading@10 7906 .IP "\(bu" 4
yading@10 7907 To create 3 or more outputs, you need to specify the number of
yading@10 7908 outputs, like in:
yading@10 7909 .Sp
yading@10 7910 .Vb 1
yading@10 7911 \& [in] asplit=3 [out0][out1][out2]
yading@10 7912 .Ve
yading@10 7913 .IP "\(bu" 4
yading@10 7914 Create two separate outputs from the same input, one cropped and
yading@10 7915 one padded:
yading@10 7916 .Sp
yading@10 7917 .Vb 3
yading@10 7918 \& [in] split [splitout1][splitout2];
yading@10 7919 \& [splitout1] crop=100:100:0:0 [cropout];
yading@10 7920 \& [splitout2] pad=200:200:100:100 [padout];
yading@10 7921 .Ve
yading@10 7922 .IP "\(bu" 4
yading@10 7923 Create 5 copies of the input audio with \fBffmpeg\fR:
yading@10 7924 .Sp
yading@10 7925 .Vb 1
yading@10 7926 \& ffmpeg \-i INPUT \-filter_complex asplit=5 OUTPUT
yading@10 7927 .Ve
yading@10 7928 .SH "MULTIMEDIA SOURCES"
yading@10 7929 .IX Header "MULTIMEDIA SOURCES"
yading@10 7930 Below is a description of the currently available multimedia sources.
yading@10 7931 .SS "amovie"
yading@10 7932 .IX Subsection "amovie"
yading@10 7933 This is the same as movie source, except it selects an audio
yading@10 7934 stream by default.
yading@10 7935 .SS "movie"
yading@10 7936 .IX Subsection "movie"
yading@10 7937 Read audio and/or video stream(s) from a movie container.
yading@10 7938 .PP
yading@10 7939 This filter accepts the following options:
yading@10 7940 .IP "\fBfilename\fR" 4
yading@10 7941 .IX Item "filename"
yading@10 7942 The name of the resource to read (not necessarily a file but also a device or a
yading@10 7943 stream accessed through some protocol).
yading@10 7944 .IP "\fBformat_name, f\fR" 4
yading@10 7945 .IX Item "format_name, f"
yading@10 7946 Specifies the format assumed for the movie to read, and can be either
yading@10 7947 the name of a container or an input device. If not specified the
yading@10 7948 format is guessed from \fImovie_name\fR or by probing.
yading@10 7949 .IP "\fBseek_point, sp\fR" 4
yading@10 7950 .IX Item "seek_point, sp"
yading@10 7951 Specifies the seek point in seconds, the frames will be output
yading@10 7952 starting from this seek point, the parameter is evaluated with
yading@10 7953 \&\f(CW\*(C`av_strtod\*(C'\fR so the numerical value may be suffixed by an \s-1IS\s0
yading@10 7954 postfix. Default value is \*(L"0\*(R".
yading@10 7955 .IP "\fBstreams, s\fR" 4
yading@10 7956 .IX Item "streams, s"
yading@10 7957 Specifies the streams to read. Several streams can be specified,
yading@10 7958 separated by \*(L"+\*(R". The source will then have as many outputs, in the
yading@10 7959 same order. The syntax is explained in the ``Stream specifiers''
yading@10 7960 section in the ffmpeg manual. Two special names, \*(L"dv\*(R" and \*(L"da\*(R" specify
yading@10 7961 respectively the default (best suited) video and audio stream. Default
yading@10 7962 is \*(L"dv\*(R", or \*(L"da\*(R" if the filter is called as \*(L"amovie\*(R".
yading@10 7963 .IP "\fBstream_index, si\fR" 4
yading@10 7964 .IX Item "stream_index, si"
yading@10 7965 Specifies the index of the video stream to read. If the value is \-1,
yading@10 7966 the best suited video stream will be automatically selected. Default
yading@10 7967 value is \*(L"\-1\*(R". Deprecated. If the filter is called \*(L"amovie\*(R", it will select
yading@10 7968 audio instead of video.
yading@10 7969 .IP "\fBloop\fR" 4
yading@10 7970 .IX Item "loop"
yading@10 7971 Specifies how many times to read the stream in sequence.
yading@10 7972 If the value is less than 1, the stream will be read again and again.
yading@10 7973 Default value is \*(L"1\*(R".
yading@10 7974 .Sp
yading@10 7975 Note that when the movie is looped the source timestamps are not
yading@10 7976 changed, so it will generate non monotonically increasing timestamps.
yading@10 7977 .PP
yading@10 7978 This filter allows to overlay a second video on top of main input of
yading@10 7979 a filtergraph as shown in this graph:
yading@10 7980 .PP
yading@10 7981 .Vb 4
yading@10 7982 \& input \-\-\-\-\-\-\-\-\-\-\-> deltapts0 \-\-> overlay \-\-> output
yading@10 7983 \& ^
yading@10 7984 \& |
yading@10 7985 \& movie \-\-> scale\-\-> deltapts1 \-\-\-\-\-\-\-+
yading@10 7986 .Ve
yading@10 7987 .PP
yading@10 7988 \fIExamples\fR
yading@10 7989 .IX Subsection "Examples"
yading@10 7990 .IP "\(bu" 4
yading@10 7991 Skip 3.2 seconds from the start of the avi file in.avi, and overlay it
yading@10 7992 on top of the input labelled as \*(L"in\*(R":
yading@10 7993 .Sp
yading@10 7994 .Vb 3
yading@10 7995 \& movie=in.avi:seek_point=3.2, scale=180:\-1, setpts=PTS\-STARTPTS [over];
yading@10 7996 \& [in] setpts=PTS\-STARTPTS [main];
yading@10 7997 \& [main][over] overlay=16:16 [out]
yading@10 7998 .Ve
yading@10 7999 .IP "\(bu" 4
yading@10 8000 Read from a video4linux2 device, and overlay it on top of the input
yading@10 8001 labelled as \*(L"in\*(R":
yading@10 8002 .Sp
yading@10 8003 .Vb 3
yading@10 8004 \& movie=/dev/video0:f=video4linux2, scale=180:\-1, setpts=PTS\-STARTPTS [over];
yading@10 8005 \& [in] setpts=PTS\-STARTPTS [main];
yading@10 8006 \& [main][over] overlay=16:16 [out]
yading@10 8007 .Ve
yading@10 8008 .IP "\(bu" 4
yading@10 8009 Read the first video stream and the audio stream with id 0x81 from
yading@10 8010 dvd.vob; the video is connected to the pad named \*(L"video\*(R" and the audio is
yading@10 8011 connected to the pad named \*(L"audio\*(R":
yading@10 8012 .Sp
yading@10 8013 .Vb 1
yading@10 8014 \& movie=dvd.vob:s=v:0+#0x81 [video] [audio]
yading@10 8015 .Ve
yading@10 8016 .SH "SEE ALSO"
yading@10 8017 .IX Header "SEE ALSO"
yading@10 8018 \&\fIffmpeg\fR\|(1), \fIffplay\fR\|(1), \fIffprobe\fR\|(1), \fIffserver\fR\|(1), \fIlibavfilter\fR\|(3)
yading@10 8019 .SH "AUTHORS"
yading@10 8020 .IX Header "AUTHORS"
yading@10 8021 The FFmpeg developers.
yading@10 8022 .PP
yading@10 8023 For details about the authorship, see the Git history of the project
yading@10 8024 (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
yading@10 8025 \&\fBgit log\fR in the FFmpeg source directory, or browsing the
yading@10 8026 online repository at <\fBhttp://source.ffmpeg.org\fR>.
yading@10 8027 .PP
yading@10 8028 Maintainers for the specific components are listed in the file
yading@10 8029 \&\fI\s-1MAINTAINERS\s0\fR in the source code tree.