annotate ffmpeg/doc/ffmpeg-filters.pod @ 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 =head1 NAME
yading@10 2
yading@10 3 ffmpeg-filters - FFmpeg filters
yading@10 4
yading@10 5 =head1 DESCRIPTION
yading@10 6
yading@10 7
yading@10 8 This document describes filters, sources, and sinks provided by the
yading@10 9 libavfilter library.
yading@10 10
yading@10 11
yading@10 12
yading@10 13 =head1 FILTERING INTRODUCTION
yading@10 14
yading@10 15
yading@10 16 Filtering in FFmpeg is enabled through the libavfilter library.
yading@10 17
yading@10 18 In libavfilter, a filter can have multiple inputs and multiple
yading@10 19 outputs.
yading@10 20 To illustrate the sorts of things that are possible, we consider the
yading@10 21 following filtergraph.
yading@10 22
yading@10 23
yading@10 24 input --> split ---------------------> overlay --> output
yading@10 25 | ^
yading@10 26 | |
yading@10 27 +-----> crop --> vflip -------+
yading@10 28
yading@10 29
yading@10 30 This filtergraph splits the input stream in two streams, sends one
yading@10 31 stream through the crop filter and the vflip filter before merging it
yading@10 32 back with the other stream by overlaying it on top. You can use the
yading@10 33 following command to achieve this:
yading@10 34
yading@10 35
yading@10 36 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 37
yading@10 38
yading@10 39 The result will be that in output the top half of the video is mirrored
yading@10 40 onto the bottom half.
yading@10 41
yading@10 42 Filters in the same linear chain are separated by commas, and distinct
yading@10 43 linear chains of filters are separated by semicolons. In our example,
yading@10 44 I<crop,vflip> are in one linear chain, I<split> and
yading@10 45 I<overlay> are separately in another. The points where the linear
yading@10 46 chains join are labelled by names enclosed in square brackets. In the
yading@10 47 example, the split filter generates two outputs that are associated to
yading@10 48 the labels I<[main]> and I<[tmp]>.
yading@10 49
yading@10 50 The stream sent to the second output of I<split>, labelled as
yading@10 51 I<[tmp]>, is processed through the I<crop> filter, which crops
yading@10 52 away the lower half part of the video, and then vertically flipped. The
yading@10 53 I<overlay> filter takes in input the first unchanged output of the
yading@10 54 split filter (which was labelled as I<[main]>), and overlay on its
yading@10 55 lower half the output generated by the I<crop,vflip> filterchain.
yading@10 56
yading@10 57 Some filters take in input a list of parameters: they are specified
yading@10 58 after the filter name and an equal sign, and are separated from each other
yading@10 59 by a colon.
yading@10 60
yading@10 61 There exist so-called I<source filters> that do not have an
yading@10 62 audio/video input, and I<sink filters> that will not have audio/video
yading@10 63 output.
yading@10 64
yading@10 65
yading@10 66
yading@10 67 =head1 GRAPH
yading@10 68
yading@10 69
yading@10 70 The F<graph2dot> program included in the FFmpeg F<tools>
yading@10 71 directory can be used to parse a filtergraph description and issue a
yading@10 72 corresponding textual representation in the dot language.
yading@10 73
yading@10 74 Invoke the command:
yading@10 75
yading@10 76 graph2dot -h
yading@10 77
yading@10 78
yading@10 79 to see how to use F<graph2dot>.
yading@10 80
yading@10 81 You can then pass the dot description to the F<dot> program (from
yading@10 82 the graphviz suite of programs) and obtain a graphical representation
yading@10 83 of the filtergraph.
yading@10 84
yading@10 85 For example the sequence of commands:
yading@10 86
yading@10 87 echo <GRAPH_DESCRIPTION> | \
yading@10 88 tools/graph2dot -o graph.tmp && \
yading@10 89 dot -Tpng graph.tmp -o graph.png && \
yading@10 90 display graph.png
yading@10 91
yading@10 92
yading@10 93 can be used to create and display an image representing the graph
yading@10 94 described by the I<GRAPH_DESCRIPTION> string. Note that this string must be
yading@10 95 a complete self-contained graph, with its inputs and outputs explicitly defined.
yading@10 96 For example if your command line is of the form:
yading@10 97
yading@10 98 ffmpeg -i infile -vf scale=640:360 outfile
yading@10 99
yading@10 100 your I<GRAPH_DESCRIPTION> string will need to be of the form:
yading@10 101
yading@10 102 nullsrc,scale=640:360,nullsink
yading@10 103
yading@10 104 you may also need to set the I<nullsrc> parameters and add a I<format>
yading@10 105 filter in order to simulate a specific input file.
yading@10 106
yading@10 107
yading@10 108
yading@10 109 =head1 FILTERGRAPH DESCRIPTION
yading@10 110
yading@10 111
yading@10 112 A filtergraph is a directed graph of connected filters. It can contain
yading@10 113 cycles, and there can be multiple links between a pair of
yading@10 114 filters. Each link has one input pad on one side connecting it to one
yading@10 115 filter from which it takes its input, and one output pad on the other
yading@10 116 side connecting it to the one filter accepting its output.
yading@10 117
yading@10 118 Each filter in a filtergraph is an instance of a filter class
yading@10 119 registered in the application, which defines the features and the
yading@10 120 number of input and output pads of the filter.
yading@10 121
yading@10 122 A filter with no input pads is called a "source", a filter with no
yading@10 123 output pads is called a "sink".
yading@10 124
yading@10 125
yading@10 126
yading@10 127 =head2 Filtergraph syntax
yading@10 128
yading@10 129
yading@10 130 A filtergraph can be represented using a textual representation, which is
yading@10 131 recognized by the B<-filter>/B<-vf> and B<-filter_complex>
yading@10 132 options in B<ffmpeg> and B<-vf> in B<ffplay>, and by the
yading@10 133 C<avfilter_graph_parse()>/C<avfilter_graph_parse2()> function defined in
yading@10 134 F<libavfilter/avfilter.h>.
yading@10 135
yading@10 136 A filterchain consists of a sequence of connected filters, each one
yading@10 137 connected to the previous one in the sequence. A filterchain is
yading@10 138 represented by a list of ","-separated filter descriptions.
yading@10 139
yading@10 140 A filtergraph consists of a sequence of filterchains. A sequence of
yading@10 141 filterchains is represented by a list of ";"-separated filterchain
yading@10 142 descriptions.
yading@10 143
yading@10 144 A filter is represented by a string of the form:
yading@10 145 [I<in_link_1>]...[I<in_link_N>]I<filter_name>=I<arguments>[I<out_link_1>]...[I<out_link_M>]
yading@10 146
yading@10 147 I<filter_name> is the name of the filter class of which the
yading@10 148 described filter is an instance of, and has to be the name of one of
yading@10 149 the filter classes registered in the program.
yading@10 150 The name of the filter class is optionally followed by a string
yading@10 151 "=I<arguments>".
yading@10 152
yading@10 153 I<arguments> is a string which contains the parameters used to
yading@10 154 initialize the filter instance. It may have one of the following forms:
yading@10 155
yading@10 156 =over 4
yading@10 157
yading@10 158
yading@10 159
yading@10 160 =item *
yading@10 161
yading@10 162 A ':'-separated list of I<key=value> pairs.
yading@10 163
yading@10 164
yading@10 165 =item *
yading@10 166
yading@10 167 A ':'-separated list of I<value>. In this case, the keys are assumed to be
yading@10 168 the option names in the order they are declared. E.g. the C<fade> filter
yading@10 169 declares three options in this order -- B<type>, B<start_frame> and
yading@10 170 B<nb_frames>. Then the parameter list I<in:0:30> means that the value
yading@10 171 I<in> is assigned to the option B<type>, I<0> to
yading@10 172 B<start_frame> and I<30> to B<nb_frames>.
yading@10 173
yading@10 174
yading@10 175 =item *
yading@10 176
yading@10 177 A ':'-separated list of mixed direct I<value> and long I<key=value>
yading@10 178 pairs. The direct I<value> must precede the I<key=value> pairs, and
yading@10 179 follow the same constraints order of the previous point. The following
yading@10 180 I<key=value> pairs can be set in any preferred order.
yading@10 181
yading@10 182
yading@10 183 =back
yading@10 184
yading@10 185
yading@10 186 If the option value itself is a list of items (e.g. the C<format> filter
yading@10 187 takes a list of pixel formats), the items in the list are usually separated by
yading@10 188 '|'.
yading@10 189
yading@10 190 The list of arguments can be quoted using the character "'" as initial
yading@10 191 and ending mark, and the character '\' for escaping the characters
yading@10 192 within the quoted text; otherwise the argument string is considered
yading@10 193 terminated when the next special character (belonging to the set
yading@10 194 "[]=;,") is encountered.
yading@10 195
yading@10 196 The name and arguments of the filter are optionally preceded and
yading@10 197 followed by a list of link labels.
yading@10 198 A link label allows to name a link and associate it to a filter output
yading@10 199 or input pad. The preceding labels I<in_link_1>
yading@10 200 ... I<in_link_N>, are associated to the filter input pads,
yading@10 201 the following labels I<out_link_1> ... I<out_link_M>, are
yading@10 202 associated to the output pads.
yading@10 203
yading@10 204 When two link labels with the same name are found in the
yading@10 205 filtergraph, a link between the corresponding input and output pad is
yading@10 206 created.
yading@10 207
yading@10 208 If an output pad is not labelled, it is linked by default to the first
yading@10 209 unlabelled input pad of the next filter in the filterchain.
yading@10 210 For example in the filterchain:
yading@10 211
yading@10 212 nullsrc, split[L1], [L2]overlay, nullsink
yading@10 213
yading@10 214 the split filter instance has two output pads, and the overlay filter
yading@10 215 instance two input pads. The first output pad of split is labelled
yading@10 216 "L1", the first input pad of overlay is labelled "L2", and the second
yading@10 217 output pad of split is linked to the second input pad of overlay,
yading@10 218 which are both unlabelled.
yading@10 219
yading@10 220 In a complete filterchain all the unlabelled filter input and output
yading@10 221 pads must be connected. A filtergraph is considered valid if all the
yading@10 222 filter input and output pads of all the filterchains are connected.
yading@10 223
yading@10 224 Libavfilter will automatically insert scale filters where format
yading@10 225 conversion is required. It is possible to specify swscale flags
yading@10 226 for those automatically inserted scalers by prepending
yading@10 227 C<sws_flags=I<flags>;>
yading@10 228 to the filtergraph description.
yading@10 229
yading@10 230 Follows a BNF description for the filtergraph syntax:
yading@10 231
yading@10 232 <NAME> ::= sequence of alphanumeric characters and '_'
yading@10 233 <LINKLABEL> ::= "[" <NAME> "]"
yading@10 234 <LINKLABELS> ::= <LINKLABEL> [<LINKLABELS>]
yading@10 235 <FILTER_ARGUMENTS> ::= sequence of chars (eventually quoted)
yading@10 236 <FILTER> ::= [<LINKLABELS>] <NAME> ["=" <FILTER_ARGUMENTS>] [<LINKLABELS>]
yading@10 237 <FILTERCHAIN> ::= <FILTER> [,<FILTERCHAIN>]
yading@10 238 <FILTERGRAPH> ::= [sws_flags=<flags>;] <FILTERCHAIN> [;<FILTERGRAPH>]
yading@10 239
yading@10 240
yading@10 241
yading@10 242 =head2 Notes on filtergraph escaping
yading@10 243
yading@10 244
yading@10 245 Some filter arguments require the use of special characters, typically
yading@10 246 C<:> to separate key=value pairs in a named options list. In this
yading@10 247 case the user should perform a first level escaping when specifying
yading@10 248 the filter arguments. For example, consider the following literal
yading@10 249 string to be embedded in the drawtext filter arguments:
yading@10 250
yading@10 251 this is a 'string': may contain one, or more, special characters
yading@10 252
yading@10 253
yading@10 254 Since C<:> is special for the filter arguments syntax, it needs to
yading@10 255 be escaped, so you get:
yading@10 256
yading@10 257 text=this is a \'string\'\: may contain one, or more, special characters
yading@10 258
yading@10 259
yading@10 260 A second level of escaping is required when embedding the filter
yading@10 261 arguments in a filtergraph description, in order to escape all the
yading@10 262 filtergraph special characters. Thus the example above becomes:
yading@10 263
yading@10 264 drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
yading@10 265
yading@10 266
yading@10 267 Finally an additional level of escaping may be needed when writing the
yading@10 268 filtergraph description in a shell command, which depends on the
yading@10 269 escaping rules of the adopted shell. For example, assuming that
yading@10 270 C<\> is special and needs to be escaped with another C<\>, the
yading@10 271 previous string will finally result in:
yading@10 272
yading@10 273 -vf "drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters"
yading@10 274
yading@10 275
yading@10 276 Sometimes, it might be more convenient to employ quoting in place of
yading@10 277 escaping. For example the string:
yading@10 278
yading@10 279 Caesar: tu quoque, Brute, fili mi
yading@10 280
yading@10 281
yading@10 282 Can be quoted in the filter arguments as:
yading@10 283
yading@10 284 text='Caesar: tu quoque, Brute, fili mi'
yading@10 285
yading@10 286
yading@10 287 And finally inserted in a filtergraph like:
yading@10 288
yading@10 289 drawtext=text=\'Caesar: tu quoque\, Brute\, fili mi\'
yading@10 290
yading@10 291
yading@10 292 See the ``Quoting and escaping'' section in the ffmpeg-utils manual
yading@10 293 for more information about the escaping and quoting rules adopted by
yading@10 294 FFmpeg.
yading@10 295
yading@10 296
yading@10 297
yading@10 298 =head1 AUDIO FILTERS
yading@10 299
yading@10 300
yading@10 301 When you configure your FFmpeg build, you can disable any of the
yading@10 302 existing filters using C<--disable-filters>.
yading@10 303 The configure output will show the audio filters included in your
yading@10 304 build.
yading@10 305
yading@10 306 Below is a description of the currently available audio filters.
yading@10 307
yading@10 308
yading@10 309 =head2 aconvert
yading@10 310
yading@10 311
yading@10 312 Convert the input audio format to the specified formats.
yading@10 313
yading@10 314 I<This filter is deprecated. Use aformat> instead.
yading@10 315
yading@10 316 The filter accepts a string of the form:
yading@10 317 "I<sample_format>:I<channel_layout>".
yading@10 318
yading@10 319 I<sample_format> specifies the sample format, and can be a string or the
yading@10 320 corresponding numeric value defined in F<libavutil/samplefmt.h>. Use 'p'
yading@10 321 suffix for a planar sample format.
yading@10 322
yading@10 323 I<channel_layout> specifies the channel layout, and can be a string
yading@10 324 or the corresponding number value defined in F<libavutil/channel_layout.h>.
yading@10 325
yading@10 326 The special parameter "auto", signifies that the filter will
yading@10 327 automatically select the output format depending on the output filter.
yading@10 328
yading@10 329
yading@10 330 =head3 Examples
yading@10 331
yading@10 332
yading@10 333
yading@10 334 =over 4
yading@10 335
yading@10 336
yading@10 337 =item *
yading@10 338
yading@10 339 Convert input to float, planar, stereo:
yading@10 340
yading@10 341 aconvert=fltp:stereo
yading@10 342
yading@10 343
yading@10 344
yading@10 345 =item *
yading@10 346
yading@10 347 Convert input to unsigned 8-bit, automatically select out channel layout:
yading@10 348
yading@10 349 aconvert=u8:auto
yading@10 350
yading@10 351
yading@10 352 =back
yading@10 353
yading@10 354
yading@10 355
yading@10 356 =head2 allpass
yading@10 357
yading@10 358
yading@10 359 Apply a two-pole all-pass filter with central frequency (in Hz)
yading@10 360 I<frequency>, and filter-width I<width>.
yading@10 361 An all-pass filter changes the audio's frequency to phase relationship
yading@10 362 without changing its frequency to amplitude relationship.
yading@10 363
yading@10 364 The filter accepts the following options:
yading@10 365
yading@10 366
yading@10 367 =over 4
yading@10 368
yading@10 369
yading@10 370 =item B<frequency, f>
yading@10 371
yading@10 372 Set frequency in Hz.
yading@10 373
yading@10 374
yading@10 375 =item B<width_type>
yading@10 376
yading@10 377 Set method to specify band-width of filter.
yading@10 378
yading@10 379 =over 4
yading@10 380
yading@10 381
yading@10 382 =item B<h>
yading@10 383
yading@10 384 Hz
yading@10 385
yading@10 386 =item B<q>
yading@10 387
yading@10 388 Q-Factor
yading@10 389
yading@10 390 =item B<o>
yading@10 391
yading@10 392 octave
yading@10 393
yading@10 394 =item B<s>
yading@10 395
yading@10 396 slope
yading@10 397
yading@10 398 =back
yading@10 399
yading@10 400
yading@10 401
yading@10 402 =item B<width, w>
yading@10 403
yading@10 404 Specify the band-width of a filter in width_type units.
yading@10 405
yading@10 406 =back
yading@10 407
yading@10 408
yading@10 409
yading@10 410 =head2 highpass
yading@10 411
yading@10 412
yading@10 413 Apply a high-pass filter with 3dB point frequency.
yading@10 414 The filter can be either single-pole, or double-pole (the default).
yading@10 415 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
yading@10 416
yading@10 417 The filter accepts the following options:
yading@10 418
yading@10 419
yading@10 420 =over 4
yading@10 421
yading@10 422
yading@10 423 =item B<frequency, f>
yading@10 424
yading@10 425 Set frequency in Hz. Default is 3000.
yading@10 426
yading@10 427
yading@10 428 =item B<poles, p>
yading@10 429
yading@10 430 Set number of poles. Default is 2.
yading@10 431
yading@10 432
yading@10 433 =item B<width_type>
yading@10 434
yading@10 435 Set method to specify band-width of filter.
yading@10 436
yading@10 437 =over 4
yading@10 438
yading@10 439
yading@10 440 =item B<h>
yading@10 441
yading@10 442 Hz
yading@10 443
yading@10 444 =item B<q>
yading@10 445
yading@10 446 Q-Factor
yading@10 447
yading@10 448 =item B<o>
yading@10 449
yading@10 450 octave
yading@10 451
yading@10 452 =item B<s>
yading@10 453
yading@10 454 slope
yading@10 455
yading@10 456 =back
yading@10 457
yading@10 458
yading@10 459
yading@10 460 =item B<width, w>
yading@10 461
yading@10 462 Specify the band-width of a filter in width_type units.
yading@10 463 Applies only to double-pole filter.
yading@10 464 The default is 0.707q and gives a Butterworth response.
yading@10 465
yading@10 466 =back
yading@10 467
yading@10 468
yading@10 469
yading@10 470 =head2 lowpass
yading@10 471
yading@10 472
yading@10 473 Apply a low-pass filter with 3dB point frequency.
yading@10 474 The filter can be either single-pole or double-pole (the default).
yading@10 475 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
yading@10 476
yading@10 477 The filter accepts the following options:
yading@10 478
yading@10 479
yading@10 480 =over 4
yading@10 481
yading@10 482
yading@10 483 =item B<frequency, f>
yading@10 484
yading@10 485 Set frequency in Hz. Default is 500.
yading@10 486
yading@10 487
yading@10 488 =item B<poles, p>
yading@10 489
yading@10 490 Set number of poles. Default is 2.
yading@10 491
yading@10 492
yading@10 493 =item B<width_type>
yading@10 494
yading@10 495 Set method to specify band-width of filter.
yading@10 496
yading@10 497 =over 4
yading@10 498
yading@10 499
yading@10 500 =item B<h>
yading@10 501
yading@10 502 Hz
yading@10 503
yading@10 504 =item B<q>
yading@10 505
yading@10 506 Q-Factor
yading@10 507
yading@10 508 =item B<o>
yading@10 509
yading@10 510 octave
yading@10 511
yading@10 512 =item B<s>
yading@10 513
yading@10 514 slope
yading@10 515
yading@10 516 =back
yading@10 517
yading@10 518
yading@10 519
yading@10 520 =item B<width, w>
yading@10 521
yading@10 522 Specify the band-width of a filter in width_type units.
yading@10 523 Applies only to double-pole filter.
yading@10 524 The default is 0.707q and gives a Butterworth response.
yading@10 525
yading@10 526 =back
yading@10 527
yading@10 528
yading@10 529
yading@10 530 =head2 bass
yading@10 531
yading@10 532
yading@10 533 Boost or cut the bass (lower) frequencies of the audio using a two-pole
yading@10 534 shelving filter with a response similar to that of a standard
yading@10 535 hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
yading@10 536
yading@10 537 The filter accepts the following options:
yading@10 538
yading@10 539
yading@10 540 =over 4
yading@10 541
yading@10 542
yading@10 543 =item B<gain, g>
yading@10 544
yading@10 545 Give the gain at 0 Hz. Its useful range is about -20
yading@10 546 (for a large cut) to +20 (for a large boost).
yading@10 547 Beware of clipping when using a positive gain.
yading@10 548
yading@10 549
yading@10 550 =item B<frequency, f>
yading@10 551
yading@10 552 Set the filter's central frequency and so can be used
yading@10 553 to extend or reduce the frequency range to be boosted or cut.
yading@10 554 The default value is C<100> Hz.
yading@10 555
yading@10 556
yading@10 557 =item B<width_type>
yading@10 558
yading@10 559 Set method to specify band-width of filter.
yading@10 560
yading@10 561 =over 4
yading@10 562
yading@10 563
yading@10 564 =item B<h>
yading@10 565
yading@10 566 Hz
yading@10 567
yading@10 568 =item B<q>
yading@10 569
yading@10 570 Q-Factor
yading@10 571
yading@10 572 =item B<o>
yading@10 573
yading@10 574 octave
yading@10 575
yading@10 576 =item B<s>
yading@10 577
yading@10 578 slope
yading@10 579
yading@10 580 =back
yading@10 581
yading@10 582
yading@10 583
yading@10 584 =item B<width, w>
yading@10 585
yading@10 586 Determine how steep is the filter's shelf transition.
yading@10 587
yading@10 588 =back
yading@10 589
yading@10 590
yading@10 591
yading@10 592 =head2 treble
yading@10 593
yading@10 594
yading@10 595 Boost or cut treble (upper) frequencies of the audio using a two-pole
yading@10 596 shelving filter with a response similar to that of a standard
yading@10 597 hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
yading@10 598
yading@10 599 The filter accepts the following options:
yading@10 600
yading@10 601
yading@10 602 =over 4
yading@10 603
yading@10 604
yading@10 605 =item B<gain, g>
yading@10 606
yading@10 607 Give the gain at whichever is the lower of ~22 kHz and the
yading@10 608 Nyquist frequency. Its useful range is about -20 (for a large cut)
yading@10 609 to +20 (for a large boost). Beware of clipping when using a positive gain.
yading@10 610
yading@10 611
yading@10 612 =item B<frequency, f>
yading@10 613
yading@10 614 Set the filter's central frequency and so can be used
yading@10 615 to extend or reduce the frequency range to be boosted or cut.
yading@10 616 The default value is C<3000> Hz.
yading@10 617
yading@10 618
yading@10 619 =item B<width_type>
yading@10 620
yading@10 621 Set method to specify band-width of filter.
yading@10 622
yading@10 623 =over 4
yading@10 624
yading@10 625
yading@10 626 =item B<h>
yading@10 627
yading@10 628 Hz
yading@10 629
yading@10 630 =item B<q>
yading@10 631
yading@10 632 Q-Factor
yading@10 633
yading@10 634 =item B<o>
yading@10 635
yading@10 636 octave
yading@10 637
yading@10 638 =item B<s>
yading@10 639
yading@10 640 slope
yading@10 641
yading@10 642 =back
yading@10 643
yading@10 644
yading@10 645
yading@10 646 =item B<width, w>
yading@10 647
yading@10 648 Determine how steep is the filter's shelf transition.
yading@10 649
yading@10 650 =back
yading@10 651
yading@10 652
yading@10 653
yading@10 654 =head2 bandpass
yading@10 655
yading@10 656
yading@10 657 Apply a two-pole Butterworth band-pass filter with central
yading@10 658 frequency I<frequency>, and (3dB-point) band-width width.
yading@10 659 The I<csg> option selects a constant skirt gain (peak gain = Q)
yading@10 660 instead of the default: constant 0dB peak gain.
yading@10 661 The filter roll off at 6dB per octave (20dB per decade).
yading@10 662
yading@10 663 The filter accepts the following options:
yading@10 664
yading@10 665
yading@10 666 =over 4
yading@10 667
yading@10 668
yading@10 669 =item B<frequency, f>
yading@10 670
yading@10 671 Set the filter's central frequency. Default is C<3000>.
yading@10 672
yading@10 673
yading@10 674 =item B<csg>
yading@10 675
yading@10 676 Constant skirt gain if set to 1. Defaults to 0.
yading@10 677
yading@10 678
yading@10 679 =item B<width_type>
yading@10 680
yading@10 681 Set method to specify band-width of filter.
yading@10 682
yading@10 683 =over 4
yading@10 684
yading@10 685
yading@10 686 =item B<h>
yading@10 687
yading@10 688 Hz
yading@10 689
yading@10 690 =item B<q>
yading@10 691
yading@10 692 Q-Factor
yading@10 693
yading@10 694 =item B<o>
yading@10 695
yading@10 696 octave
yading@10 697
yading@10 698 =item B<s>
yading@10 699
yading@10 700 slope
yading@10 701
yading@10 702 =back
yading@10 703
yading@10 704
yading@10 705
yading@10 706 =item B<width, w>
yading@10 707
yading@10 708 Specify the band-width of a filter in width_type units.
yading@10 709
yading@10 710 =back
yading@10 711
yading@10 712
yading@10 713
yading@10 714 =head2 bandreject
yading@10 715
yading@10 716
yading@10 717 Apply a two-pole Butterworth band-reject filter with central
yading@10 718 frequency I<frequency>, and (3dB-point) band-width I<width>.
yading@10 719 The filter roll off at 6dB per octave (20dB per decade).
yading@10 720
yading@10 721 The filter accepts the following options:
yading@10 722
yading@10 723
yading@10 724 =over 4
yading@10 725
yading@10 726
yading@10 727 =item B<frequency, f>
yading@10 728
yading@10 729 Set the filter's central frequency. Default is C<3000>.
yading@10 730
yading@10 731
yading@10 732 =item B<width_type>
yading@10 733
yading@10 734 Set method to specify band-width of filter.
yading@10 735
yading@10 736 =over 4
yading@10 737
yading@10 738
yading@10 739 =item B<h>
yading@10 740
yading@10 741 Hz
yading@10 742
yading@10 743 =item B<q>
yading@10 744
yading@10 745 Q-Factor
yading@10 746
yading@10 747 =item B<o>
yading@10 748
yading@10 749 octave
yading@10 750
yading@10 751 =item B<s>
yading@10 752
yading@10 753 slope
yading@10 754
yading@10 755 =back
yading@10 756
yading@10 757
yading@10 758
yading@10 759 =item B<width, w>
yading@10 760
yading@10 761 Specify the band-width of a filter in width_type units.
yading@10 762
yading@10 763 =back
yading@10 764
yading@10 765
yading@10 766
yading@10 767 =head2 biquad
yading@10 768
yading@10 769
yading@10 770 Apply a biquad IIR filter with the given coefficients.
yading@10 771 Where I<b0>, I<b1>, I<b2> and I<a0>, I<a1>, I<a2>
yading@10 772 are the numerator and denominator coefficients respectively.
yading@10 773
yading@10 774
yading@10 775 =head2 equalizer
yading@10 776
yading@10 777
yading@10 778 Apply a two-pole peaking equalisation (EQ) filter. With this
yading@10 779 filter, the signal-level at and around a selected frequency can
yading@10 780 be increased or decreased, whilst (unlike bandpass and bandreject
yading@10 781 filters) that at all other frequencies is unchanged.
yading@10 782
yading@10 783 In order to produce complex equalisation curves, this filter can
yading@10 784 be given several times, each with a different central frequency.
yading@10 785
yading@10 786 The filter accepts the following options:
yading@10 787
yading@10 788
yading@10 789 =over 4
yading@10 790
yading@10 791
yading@10 792 =item B<frequency, f>
yading@10 793
yading@10 794 Set the filter's central frequency in Hz.
yading@10 795
yading@10 796
yading@10 797 =item B<width_type>
yading@10 798
yading@10 799 Set method to specify band-width of filter.
yading@10 800
yading@10 801 =over 4
yading@10 802
yading@10 803
yading@10 804 =item B<h>
yading@10 805
yading@10 806 Hz
yading@10 807
yading@10 808 =item B<q>
yading@10 809
yading@10 810 Q-Factor
yading@10 811
yading@10 812 =item B<o>
yading@10 813
yading@10 814 octave
yading@10 815
yading@10 816 =item B<s>
yading@10 817
yading@10 818 slope
yading@10 819
yading@10 820 =back
yading@10 821
yading@10 822
yading@10 823
yading@10 824 =item B<width, w>
yading@10 825
yading@10 826 Specify the band-width of a filter in width_type units.
yading@10 827
yading@10 828
yading@10 829 =item B<gain, g>
yading@10 830
yading@10 831 Set the required gain or attenuation in dB.
yading@10 832 Beware of clipping when using a positive gain.
yading@10 833
yading@10 834 =back
yading@10 835
yading@10 836
yading@10 837
yading@10 838 =head2 afade
yading@10 839
yading@10 840
yading@10 841 Apply fade-in/out effect to input audio.
yading@10 842
yading@10 843 A description of the accepted parameters follows.
yading@10 844
yading@10 845
yading@10 846 =over 4
yading@10 847
yading@10 848
yading@10 849 =item B<type, t>
yading@10 850
yading@10 851 Specify the effect type, can be either C<in> for fade-in, or
yading@10 852 C<out> for a fade-out effect. Default is C<in>.
yading@10 853
yading@10 854
yading@10 855 =item B<start_sample, ss>
yading@10 856
yading@10 857 Specify the number of the start sample for starting to apply the fade
yading@10 858 effect. Default is 0.
yading@10 859
yading@10 860
yading@10 861 =item B<nb_samples, ns>
yading@10 862
yading@10 863 Specify the number of samples for which the fade effect has to last. At
yading@10 864 the end of the fade-in effect the output audio will have the same
yading@10 865 volume as the input audio, at the end of the fade-out transition
yading@10 866 the output audio will be silence. Default is 44100.
yading@10 867
yading@10 868
yading@10 869 =item B<start_time, st>
yading@10 870
yading@10 871 Specify time for starting to apply the fade effect. Default is 0.
yading@10 872 The accepted syntax is:
yading@10 873
yading@10 874 [-]HH[:MM[:SS[.m...]]]
yading@10 875 [-]S+[.m...]
yading@10 876
yading@10 877 See also the function C<av_parse_time()>.
yading@10 878 If set this option is used instead of I<start_sample> one.
yading@10 879
yading@10 880
yading@10 881 =item B<duration, d>
yading@10 882
yading@10 883 Specify the duration for which the fade effect has to last. Default is 0.
yading@10 884 The accepted syntax is:
yading@10 885
yading@10 886 [-]HH[:MM[:SS[.m...]]]
yading@10 887 [-]S+[.m...]
yading@10 888
yading@10 889 See also the function C<av_parse_time()>.
yading@10 890 At the end of the fade-in effect the output audio will have the same
yading@10 891 volume as the input audio, at the end of the fade-out transition
yading@10 892 the output audio will be silence.
yading@10 893 If set this option is used instead of I<nb_samples> one.
yading@10 894
yading@10 895
yading@10 896 =item B<curve>
yading@10 897
yading@10 898 Set curve for fade transition.
yading@10 899
yading@10 900 It accepts the following values:
yading@10 901
yading@10 902 =over 4
yading@10 903
yading@10 904
yading@10 905 =item B<tri>
yading@10 906
yading@10 907 select triangular, linear slope (default)
yading@10 908
yading@10 909 =item B<qsin>
yading@10 910
yading@10 911 select quarter of sine wave
yading@10 912
yading@10 913 =item B<hsin>
yading@10 914
yading@10 915 select half of sine wave
yading@10 916
yading@10 917 =item B<esin>
yading@10 918
yading@10 919 select exponential sine wave
yading@10 920
yading@10 921 =item B<log>
yading@10 922
yading@10 923 select logarithmic
yading@10 924
yading@10 925 =item B<par>
yading@10 926
yading@10 927 select inverted parabola
yading@10 928
yading@10 929 =item B<qua>
yading@10 930
yading@10 931 select quadratic
yading@10 932
yading@10 933 =item B<cub>
yading@10 934
yading@10 935 select cubic
yading@10 936
yading@10 937 =item B<squ>
yading@10 938
yading@10 939 select square root
yading@10 940
yading@10 941 =item B<cbr>
yading@10 942
yading@10 943 select cubic root
yading@10 944
yading@10 945 =back
yading@10 946
yading@10 947
yading@10 948 =back
yading@10 949
yading@10 950
yading@10 951
yading@10 952 =head3 Examples
yading@10 953
yading@10 954
yading@10 955
yading@10 956 =over 4
yading@10 957
yading@10 958
yading@10 959 =item *
yading@10 960
yading@10 961 Fade in first 15 seconds of audio:
yading@10 962
yading@10 963 afade=t=in:ss=0:d=15
yading@10 964
yading@10 965
yading@10 966
yading@10 967 =item *
yading@10 968
yading@10 969 Fade out last 25 seconds of a 900 seconds audio:
yading@10 970
yading@10 971 afade=t=out:ss=875:d=25
yading@10 972
yading@10 973
yading@10 974 =back
yading@10 975
yading@10 976
yading@10 977
yading@10 978
yading@10 979 =head2 aformat
yading@10 980
yading@10 981
yading@10 982 Set output format constraints for the input audio. The framework will
yading@10 983 negotiate the most appropriate format to minimize conversions.
yading@10 984
yading@10 985 The filter accepts the following named parameters:
yading@10 986
yading@10 987 =over 4
yading@10 988
yading@10 989
yading@10 990
yading@10 991 =item B<sample_fmts>
yading@10 992
yading@10 993 A '|'-separated list of requested sample formats.
yading@10 994
yading@10 995
yading@10 996 =item B<sample_rates>
yading@10 997
yading@10 998 A '|'-separated list of requested sample rates.
yading@10 999
yading@10 1000
yading@10 1001 =item B<channel_layouts>
yading@10 1002
yading@10 1003 A '|'-separated list of requested channel layouts.
yading@10 1004
yading@10 1005
yading@10 1006 =back
yading@10 1007
yading@10 1008
yading@10 1009 If a parameter is omitted, all values are allowed.
yading@10 1010
yading@10 1011 For example to force the output to either unsigned 8-bit or signed 16-bit stereo:
yading@10 1012
yading@10 1013 aformat=sample_fmts=u8|s16:channel_layouts=stereo
yading@10 1014
yading@10 1015
yading@10 1016
yading@10 1017 =head2 amerge
yading@10 1018
yading@10 1019
yading@10 1020 Merge two or more audio streams into a single multi-channel stream.
yading@10 1021
yading@10 1022 The filter accepts the following options:
yading@10 1023
yading@10 1024
yading@10 1025 =over 4
yading@10 1026
yading@10 1027
yading@10 1028
yading@10 1029 =item B<inputs>
yading@10 1030
yading@10 1031 Set the number of inputs. Default is 2.
yading@10 1032
yading@10 1033
yading@10 1034 =back
yading@10 1035
yading@10 1036
yading@10 1037 If the channel layouts of the inputs are disjoint, and therefore compatible,
yading@10 1038 the channel layout of the output will be set accordingly and the channels
yading@10 1039 will be reordered as necessary. If the channel layouts of the inputs are not
yading@10 1040 disjoint, the output will have all the channels of the first input then all
yading@10 1041 the channels of the second input, in that order, and the channel layout of
yading@10 1042 the output will be the default value corresponding to the total number of
yading@10 1043 channels.
yading@10 1044
yading@10 1045 For example, if the first input is in 2.1 (FL+FR+LF) and the second input
yading@10 1046 is FC+BL+BR, then the output will be in 5.1, with the channels in the
yading@10 1047 following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
yading@10 1048 first input, b1 is the first channel of the second input).
yading@10 1049
yading@10 1050 On the other hand, if both input are in stereo, the output channels will be
yading@10 1051 in the default order: a1, a2, b1, b2, and the channel layout will be
yading@10 1052 arbitrarily set to 4.0, which may or may not be the expected value.
yading@10 1053
yading@10 1054 All inputs must have the same sample rate, and format.
yading@10 1055
yading@10 1056 If inputs do not have the same duration, the output will stop with the
yading@10 1057 shortest.
yading@10 1058
yading@10 1059
yading@10 1060 =head3 Examples
yading@10 1061
yading@10 1062
yading@10 1063
yading@10 1064 =over 4
yading@10 1065
yading@10 1066
yading@10 1067 =item *
yading@10 1068
yading@10 1069 Merge two mono files into a stereo stream:
yading@10 1070
yading@10 1071 amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
yading@10 1072
yading@10 1073
yading@10 1074
yading@10 1075 =item *
yading@10 1076
yading@10 1077 Multiple merges assuming 1 video stream and 6 audio streams in F<input.mkv>:
yading@10 1078
yading@10 1079 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 1080
yading@10 1081
yading@10 1082 =back
yading@10 1083
yading@10 1084
yading@10 1085
yading@10 1086 =head2 amix
yading@10 1087
yading@10 1088
yading@10 1089 Mixes multiple audio inputs into a single output.
yading@10 1090
yading@10 1091 For example
yading@10 1092
yading@10 1093 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
yading@10 1094
yading@10 1095 will mix 3 input audio streams to a single output with the same duration as the
yading@10 1096 first input and a dropout transition time of 3 seconds.
yading@10 1097
yading@10 1098 The filter accepts the following named parameters:
yading@10 1099
yading@10 1100 =over 4
yading@10 1101
yading@10 1102
yading@10 1103
yading@10 1104 =item B<inputs>
yading@10 1105
yading@10 1106 Number of inputs. If unspecified, it defaults to 2.
yading@10 1107
yading@10 1108
yading@10 1109 =item B<duration>
yading@10 1110
yading@10 1111 How to determine the end-of-stream.
yading@10 1112
yading@10 1113 =over 4
yading@10 1114
yading@10 1115
yading@10 1116
yading@10 1117 =item B<longest>
yading@10 1118
yading@10 1119 Duration of longest input. (default)
yading@10 1120
yading@10 1121
yading@10 1122 =item B<shortest>
yading@10 1123
yading@10 1124 Duration of shortest input.
yading@10 1125
yading@10 1126
yading@10 1127 =item B<first>
yading@10 1128
yading@10 1129 Duration of first input.
yading@10 1130
yading@10 1131
yading@10 1132 =back
yading@10 1133
yading@10 1134
yading@10 1135
yading@10 1136 =item B<dropout_transition>
yading@10 1137
yading@10 1138 Transition time, in seconds, for volume renormalization when an input
yading@10 1139 stream ends. The default value is 2 seconds.
yading@10 1140
yading@10 1141
yading@10 1142 =back
yading@10 1143
yading@10 1144
yading@10 1145
yading@10 1146 =head2 anull
yading@10 1147
yading@10 1148
yading@10 1149 Pass the audio source unchanged to the output.
yading@10 1150
yading@10 1151
yading@10 1152 =head2 apad
yading@10 1153
yading@10 1154
yading@10 1155 Pad the end of a audio stream with silence, this can be used together with
yading@10 1156 -shortest to extend audio streams to the same length as the video stream.
yading@10 1157
yading@10 1158
yading@10 1159 =head2 aphaser
yading@10 1160
yading@10 1161 Add a phasing effect to the input audio.
yading@10 1162
yading@10 1163 A phaser filter creates series of peaks and troughs in the frequency spectrum.
yading@10 1164 The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
yading@10 1165
yading@10 1166 A description of the accepted parameters follows.
yading@10 1167
yading@10 1168
yading@10 1169 =over 4
yading@10 1170
yading@10 1171
yading@10 1172 =item B<in_gain>
yading@10 1173
yading@10 1174 Set input gain. Default is 0.4.
yading@10 1175
yading@10 1176
yading@10 1177 =item B<out_gain>
yading@10 1178
yading@10 1179 Set output gain. Default is 0.74
yading@10 1180
yading@10 1181
yading@10 1182 =item B<delay>
yading@10 1183
yading@10 1184 Set delay in milliseconds. Default is 3.0.
yading@10 1185
yading@10 1186
yading@10 1187 =item B<decay>
yading@10 1188
yading@10 1189 Set decay. Default is 0.4.
yading@10 1190
yading@10 1191
yading@10 1192 =item B<speed>
yading@10 1193
yading@10 1194 Set modulation speed in Hz. Default is 0.5.
yading@10 1195
yading@10 1196
yading@10 1197 =item B<type>
yading@10 1198
yading@10 1199 Set modulation type. Default is triangular.
yading@10 1200
yading@10 1201 It accepts the following values:
yading@10 1202
yading@10 1203 =over 4
yading@10 1204
yading@10 1205
yading@10 1206 =item B<triangular, t>
yading@10 1207
yading@10 1208
yading@10 1209 =item B<sinusoidal, s>
yading@10 1210
yading@10 1211
yading@10 1212 =back
yading@10 1213
yading@10 1214
yading@10 1215 =back
yading@10 1216
yading@10 1217
yading@10 1218
yading@10 1219
yading@10 1220 =head2 aresample
yading@10 1221
yading@10 1222
yading@10 1223 Resample the input audio to the specified parameters, using the
yading@10 1224 libswresample library. If none are specified then the filter will
yading@10 1225 automatically convert between its input and output.
yading@10 1226
yading@10 1227 This filter is also able to stretch/squeeze the audio data to make it match
yading@10 1228 the timestamps or to inject silence / cut out audio to make it match the
yading@10 1229 timestamps, do a combination of both or do neither.
yading@10 1230
yading@10 1231 The filter accepts the syntax
yading@10 1232 [I<sample_rate>:]I<resampler_options>, where I<sample_rate>
yading@10 1233 expresses a sample rate and I<resampler_options> is a list of
yading@10 1234 I<key>=I<value> pairs, separated by ":". See the
yading@10 1235 ffmpeg-resampler manual for the complete list of supported options.
yading@10 1236
yading@10 1237
yading@10 1238 =head3 Examples
yading@10 1239
yading@10 1240
yading@10 1241
yading@10 1242 =over 4
yading@10 1243
yading@10 1244
yading@10 1245 =item *
yading@10 1246
yading@10 1247 Resample the input audio to 44100Hz:
yading@10 1248
yading@10 1249 aresample=44100
yading@10 1250
yading@10 1251
yading@10 1252
yading@10 1253 =item *
yading@10 1254
yading@10 1255 Stretch/squeeze samples to the given timestamps, with a maximum of 1000
yading@10 1256 samples per second compensation:
yading@10 1257
yading@10 1258 aresample=async=1000
yading@10 1259
yading@10 1260
yading@10 1261 =back
yading@10 1262
yading@10 1263
yading@10 1264
yading@10 1265 =head2 asetnsamples
yading@10 1266
yading@10 1267
yading@10 1268 Set the number of samples per each output audio frame.
yading@10 1269
yading@10 1270 The last output packet may contain a different number of samples, as
yading@10 1271 the filter will flush all the remaining samples when the input audio
yading@10 1272 signal its end.
yading@10 1273
yading@10 1274 The filter accepts the following options:
yading@10 1275
yading@10 1276
yading@10 1277 =over 4
yading@10 1278
yading@10 1279
yading@10 1280
yading@10 1281 =item B<nb_out_samples, n>
yading@10 1282
yading@10 1283 Set the number of frames per each output audio frame. The number is
yading@10 1284 intended as the number of samples I<per each channel>.
yading@10 1285 Default value is 1024.
yading@10 1286
yading@10 1287
yading@10 1288 =item B<pad, p>
yading@10 1289
yading@10 1290 If set to 1, the filter will pad the last audio frame with zeroes, so
yading@10 1291 that the last frame will contain the same number of samples as the
yading@10 1292 previous ones. Default value is 1.
yading@10 1293
yading@10 1294 =back
yading@10 1295
yading@10 1296
yading@10 1297 For example, to set the number of per-frame samples to 1234 and
yading@10 1298 disable padding for the last frame, use:
yading@10 1299
yading@10 1300 asetnsamples=n=1234:p=0
yading@10 1301
yading@10 1302
yading@10 1303
yading@10 1304 =head2 ashowinfo
yading@10 1305
yading@10 1306
yading@10 1307 Show a line containing various information for each input audio frame.
yading@10 1308 The input audio is not modified.
yading@10 1309
yading@10 1310 The shown line contains a sequence of key/value pairs of the form
yading@10 1311 I<key>:I<value>.
yading@10 1312
yading@10 1313 A description of each shown parameter follows:
yading@10 1314
yading@10 1315
yading@10 1316 =over 4
yading@10 1317
yading@10 1318
yading@10 1319 =item B<n>
yading@10 1320
yading@10 1321 sequential number of the input frame, starting from 0
yading@10 1322
yading@10 1323
yading@10 1324 =item B<pts>
yading@10 1325
yading@10 1326 Presentation timestamp of the input frame, in time base units; the time base
yading@10 1327 depends on the filter input pad, and is usually 1/I<sample_rate>.
yading@10 1328
yading@10 1329
yading@10 1330 =item B<pts_time>
yading@10 1331
yading@10 1332 presentation timestamp of the input frame in seconds
yading@10 1333
yading@10 1334
yading@10 1335 =item B<pos>
yading@10 1336
yading@10 1337 position of the frame in the input stream, -1 if this information in
yading@10 1338 unavailable and/or meaningless (for example in case of synthetic audio)
yading@10 1339
yading@10 1340
yading@10 1341 =item B<fmt>
yading@10 1342
yading@10 1343 sample format
yading@10 1344
yading@10 1345
yading@10 1346 =item B<chlayout>
yading@10 1347
yading@10 1348 channel layout
yading@10 1349
yading@10 1350
yading@10 1351 =item B<rate>
yading@10 1352
yading@10 1353 sample rate for the audio frame
yading@10 1354
yading@10 1355
yading@10 1356 =item B<nb_samples>
yading@10 1357
yading@10 1358 number of samples (per channel) in the frame
yading@10 1359
yading@10 1360
yading@10 1361 =item B<checksum>
yading@10 1362
yading@10 1363 Adler-32 checksum (printed in hexadecimal) of the audio data. For planar audio
yading@10 1364 the data is treated as if all the planes were concatenated.
yading@10 1365
yading@10 1366
yading@10 1367 =item B<plane_checksums>
yading@10 1368
yading@10 1369 A list of Adler-32 checksums for each data plane.
yading@10 1370
yading@10 1371 =back
yading@10 1372
yading@10 1373
yading@10 1374
yading@10 1375 =head2 astreamsync
yading@10 1376
yading@10 1377
yading@10 1378 Forward two audio streams and control the order the buffers are forwarded.
yading@10 1379
yading@10 1380 The filter accepts the following options:
yading@10 1381
yading@10 1382
yading@10 1383 =over 4
yading@10 1384
yading@10 1385
yading@10 1386 =item B<expr, e>
yading@10 1387
yading@10 1388 Set the expression deciding which stream should be
yading@10 1389 forwarded next: if the result is negative, the first stream is forwarded; if
yading@10 1390 the result is positive or zero, the second stream is forwarded. It can use
yading@10 1391 the following variables:
yading@10 1392
yading@10 1393
yading@10 1394 =over 4
yading@10 1395
yading@10 1396
yading@10 1397 =item I<b1 b2>
yading@10 1398
yading@10 1399 number of buffers forwarded so far on each stream
yading@10 1400
yading@10 1401 =item I<s1 s2>
yading@10 1402
yading@10 1403 number of samples forwarded so far on each stream
yading@10 1404
yading@10 1405 =item I<t1 t2>
yading@10 1406
yading@10 1407 current timestamp of each stream
yading@10 1408
yading@10 1409 =back
yading@10 1410
yading@10 1411
yading@10 1412 The default value is C<t1-t2>, which means to always forward the stream
yading@10 1413 that has a smaller timestamp.
yading@10 1414
yading@10 1415 =back
yading@10 1416
yading@10 1417
yading@10 1418
yading@10 1419 =head3 Examples
yading@10 1420
yading@10 1421
yading@10 1422 Stress-test C<amerge> by randomly sending buffers on the wrong
yading@10 1423 input, while avoiding too much of a desynchronization:
yading@10 1424
yading@10 1425 amovie=file.ogg [a] ; amovie=file.mp3 [b] ;
yading@10 1426 [a] [b] astreamsync=(2*random(1))-1+tanh(5*(t1-t2)) [a2] [b2] ;
yading@10 1427 [a2] [b2] amerge
yading@10 1428
yading@10 1429
yading@10 1430
yading@10 1431 =head2 atempo
yading@10 1432
yading@10 1433
yading@10 1434 Adjust audio tempo.
yading@10 1435
yading@10 1436 The filter accepts exactly one parameter, the audio tempo. If not
yading@10 1437 specified then the filter will assume nominal 1.0 tempo. Tempo must
yading@10 1438 be in the [0.5, 2.0] range.
yading@10 1439
yading@10 1440
yading@10 1441 =head3 Examples
yading@10 1442
yading@10 1443
yading@10 1444
yading@10 1445 =over 4
yading@10 1446
yading@10 1447
yading@10 1448 =item *
yading@10 1449
yading@10 1450 Slow down audio to 80% tempo:
yading@10 1451
yading@10 1452 atempo=0.8
yading@10 1453
yading@10 1454
yading@10 1455
yading@10 1456 =item *
yading@10 1457
yading@10 1458 To speed up audio to 125% tempo:
yading@10 1459
yading@10 1460 atempo=1.25
yading@10 1461
yading@10 1462
yading@10 1463 =back
yading@10 1464
yading@10 1465
yading@10 1466
yading@10 1467 =head2 earwax
yading@10 1468
yading@10 1469
yading@10 1470 Make audio easier to listen to on headphones.
yading@10 1471
yading@10 1472 This filter adds `cues' to 44.1kHz stereo (i.e. audio CD format) audio
yading@10 1473 so that when listened to on headphones the stereo image is moved from
yading@10 1474 inside your head (standard for headphones) to outside and in front of
yading@10 1475 the listener (standard for speakers).
yading@10 1476
yading@10 1477 Ported from SoX.
yading@10 1478
yading@10 1479
yading@10 1480 =head2 pan
yading@10 1481
yading@10 1482
yading@10 1483 Mix channels with specific gain levels. The filter accepts the output
yading@10 1484 channel layout followed by a set of channels definitions.
yading@10 1485
yading@10 1486 This filter is also designed to remap efficiently the channels of an audio
yading@10 1487 stream.
yading@10 1488
yading@10 1489 The filter accepts parameters of the form:
yading@10 1490 "I<l>:I<outdef>:I<outdef>:..."
yading@10 1491
yading@10 1492
yading@10 1493 =over 4
yading@10 1494
yading@10 1495
yading@10 1496 =item B<l>
yading@10 1497
yading@10 1498 output channel layout or number of channels
yading@10 1499
yading@10 1500
yading@10 1501 =item B<outdef>
yading@10 1502
yading@10 1503 output channel specification, of the form:
yading@10 1504 "I<out_name>=[I<gain>*]I<in_name>[+[I<gain>*]I<in_name>...]"
yading@10 1505
yading@10 1506
yading@10 1507 =item B<out_name>
yading@10 1508
yading@10 1509 output channel to define, either a channel name (FL, FR, etc.) or a channel
yading@10 1510 number (c0, c1, etc.)
yading@10 1511
yading@10 1512
yading@10 1513 =item B<gain>
yading@10 1514
yading@10 1515 multiplicative coefficient for the channel, 1 leaving the volume unchanged
yading@10 1516
yading@10 1517
yading@10 1518 =item B<in_name>
yading@10 1519
yading@10 1520 input channel to use, see out_name for details; it is not possible to mix
yading@10 1521 named and numbered input channels
yading@10 1522
yading@10 1523 =back
yading@10 1524
yading@10 1525
yading@10 1526 If the `=' in a channel specification is replaced by `E<lt>', then the gains for
yading@10 1527 that specification will be renormalized so that the total is 1, thus
yading@10 1528 avoiding clipping noise.
yading@10 1529
yading@10 1530
yading@10 1531 =head3 Mixing examples
yading@10 1532
yading@10 1533
yading@10 1534 For example, if you want to down-mix from stereo to mono, but with a bigger
yading@10 1535 factor for the left channel:
yading@10 1536
yading@10 1537 pan=1:c0=0.9*c0+0.1*c1
yading@10 1538
yading@10 1539
yading@10 1540 A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
yading@10 1541 7-channels surround:
yading@10 1542
yading@10 1543 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 1544
yading@10 1545
yading@10 1546 Note that B<ffmpeg> integrates a default down-mix (and up-mix) system
yading@10 1547 that should be preferred (see "-ac" option) unless you have very specific
yading@10 1548 needs.
yading@10 1549
yading@10 1550
yading@10 1551 =head3 Remapping examples
yading@10 1552
yading@10 1553
yading@10 1554 The channel remapping will be effective if, and only if:
yading@10 1555
yading@10 1556
yading@10 1557 =over 4
yading@10 1558
yading@10 1559
yading@10 1560 =item *<gain coefficients are zeroes or ones,>
yading@10 1561
yading@10 1562
yading@10 1563 =item *<only one input per channel output,>
yading@10 1564
yading@10 1565
yading@10 1566 =back
yading@10 1567
yading@10 1568
yading@10 1569 If all these conditions are satisfied, the filter will notify the user ("Pure
yading@10 1570 channel mapping detected"), and use an optimized and lossless method to do the
yading@10 1571 remapping.
yading@10 1572
yading@10 1573 For example, if you have a 5.1 source and want a stereo audio stream by
yading@10 1574 dropping the extra channels:
yading@10 1575
yading@10 1576 pan="stereo: c0=FL : c1=FR"
yading@10 1577
yading@10 1578
yading@10 1579 Given the same source, you can also switch front left and front right channels
yading@10 1580 and keep the input channel layout:
yading@10 1581
yading@10 1582 pan="5.1: c0=c1 : c1=c0 : c2=c2 : c3=c3 : c4=c4 : c5=c5"
yading@10 1583
yading@10 1584
yading@10 1585 If the input is a stereo audio stream, you can mute the front left channel (and
yading@10 1586 still keep the stereo channel layout) with:
yading@10 1587
yading@10 1588 pan="stereo:c1=c1"
yading@10 1589
yading@10 1590
yading@10 1591 Still with a stereo audio stream input, you can copy the right channel in both
yading@10 1592 front left and right:
yading@10 1593
yading@10 1594 pan="stereo: c0=FR : c1=FR"
yading@10 1595
yading@10 1596
yading@10 1597
yading@10 1598 =head2 silencedetect
yading@10 1599
yading@10 1600
yading@10 1601 Detect silence in an audio stream.
yading@10 1602
yading@10 1603 This filter logs a message when it detects that the input audio volume is less
yading@10 1604 or equal to a noise tolerance value for a duration greater or equal to the
yading@10 1605 minimum detected noise duration.
yading@10 1606
yading@10 1607 The printed times and duration are expressed in seconds.
yading@10 1608
yading@10 1609 The filter accepts the following options:
yading@10 1610
yading@10 1611
yading@10 1612 =over 4
yading@10 1613
yading@10 1614
yading@10 1615 =item B<duration, d>
yading@10 1616
yading@10 1617 Set silence duration until notification (default is 2 seconds).
yading@10 1618
yading@10 1619
yading@10 1620 =item B<noise, n>
yading@10 1621
yading@10 1622 Set noise tolerance. Can be specified in dB (in case "dB" is appended to the
yading@10 1623 specified value) or amplitude ratio. Default is -60dB, or 0.001.
yading@10 1624
yading@10 1625 =back
yading@10 1626
yading@10 1627
yading@10 1628
yading@10 1629 =head3 Examples
yading@10 1630
yading@10 1631
yading@10 1632
yading@10 1633 =over 4
yading@10 1634
yading@10 1635
yading@10 1636 =item *
yading@10 1637
yading@10 1638 Detect 5 seconds of silence with -50dB noise tolerance:
yading@10 1639
yading@10 1640 silencedetect=n=-50dB:d=5
yading@10 1641
yading@10 1642
yading@10 1643
yading@10 1644 =item *
yading@10 1645
yading@10 1646 Complete example with B<ffmpeg> to detect silence with 0.0001 noise
yading@10 1647 tolerance in F<silence.mp3>:
yading@10 1648
yading@10 1649 ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
yading@10 1650
yading@10 1651
yading@10 1652 =back
yading@10 1653
yading@10 1654
yading@10 1655
yading@10 1656 =head2 asyncts
yading@10 1657
yading@10 1658 Synchronize audio data with timestamps by squeezing/stretching it and/or
yading@10 1659 dropping samples/adding silence when needed.
yading@10 1660
yading@10 1661 This filter is not built by default, please use aresample to do squeezing/stretching.
yading@10 1662
yading@10 1663 The filter accepts the following named parameters:
yading@10 1664
yading@10 1665 =over 4
yading@10 1666
yading@10 1667
yading@10 1668
yading@10 1669 =item B<compensate>
yading@10 1670
yading@10 1671 Enable stretching/squeezing the data to make it match the timestamps. Disabled
yading@10 1672 by default. When disabled, time gaps are covered with silence.
yading@10 1673
yading@10 1674
yading@10 1675 =item B<min_delta>
yading@10 1676
yading@10 1677 Minimum difference between timestamps and audio data (in seconds) to trigger
yading@10 1678 adding/dropping samples. Default value is 0.1. If you get non-perfect sync with
yading@10 1679 this filter, try setting this parameter to 0.
yading@10 1680
yading@10 1681
yading@10 1682 =item B<max_comp>
yading@10 1683
yading@10 1684 Maximum compensation in samples per second. Relevant only with compensate=1.
yading@10 1685 Default value 500.
yading@10 1686
yading@10 1687
yading@10 1688 =item B<first_pts>
yading@10 1689
yading@10 1690 Assume the first pts should be this value. The time base is 1 / sample rate.
yading@10 1691 This allows for padding/trimming at the start of stream. By default, no
yading@10 1692 assumption is made about the first frame's expected pts, so no padding or
yading@10 1693 trimming is done. For example, this could be set to 0 to pad the beginning with
yading@10 1694 silence if an audio stream starts after the video stream or to trim any samples
yading@10 1695 with a negative pts due to encoder delay.
yading@10 1696
yading@10 1697
yading@10 1698 =back
yading@10 1699
yading@10 1700
yading@10 1701
yading@10 1702 =head2 channelsplit
yading@10 1703
yading@10 1704 Split each channel in input audio stream into a separate output stream.
yading@10 1705
yading@10 1706 This filter accepts the following named parameters:
yading@10 1707
yading@10 1708 =over 4
yading@10 1709
yading@10 1710
yading@10 1711 =item B<channel_layout>
yading@10 1712
yading@10 1713 Channel layout of the input stream. Default is "stereo".
yading@10 1714
yading@10 1715 =back
yading@10 1716
yading@10 1717
yading@10 1718 For example, assuming a stereo input MP3 file
yading@10 1719
yading@10 1720 ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
yading@10 1721
yading@10 1722 will create an output Matroska file with two audio streams, one containing only
yading@10 1723 the left channel and the other the right channel.
yading@10 1724
yading@10 1725 To split a 5.1 WAV file into per-channel files
yading@10 1726
yading@10 1727 ffmpeg -i in.wav -filter_complex
yading@10 1728 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
yading@10 1729 -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
yading@10 1730 front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
yading@10 1731 side_right.wav
yading@10 1732
yading@10 1733
yading@10 1734
yading@10 1735 =head2 channelmap
yading@10 1736
yading@10 1737 Remap input channels to new locations.
yading@10 1738
yading@10 1739 This filter accepts the following named parameters:
yading@10 1740
yading@10 1741 =over 4
yading@10 1742
yading@10 1743
yading@10 1744 =item B<channel_layout>
yading@10 1745
yading@10 1746 Channel layout of the output stream.
yading@10 1747
yading@10 1748
yading@10 1749 =item B<map>
yading@10 1750
yading@10 1751 Map channels from input to output. The argument is a '|'-separated list of
yading@10 1752 mappings, each in the C<I<in_channel>-I<out_channel>> or
yading@10 1753 I<in_channel> form. I<in_channel> can be either the name of the input
yading@10 1754 channel (e.g. FL for front left) or its index in the input channel layout.
yading@10 1755 I<out_channel> is the name of the output channel or its index in the output
yading@10 1756 channel layout. If I<out_channel> is not given then it is implicitly an
yading@10 1757 index, starting with zero and increasing by one for each mapping.
yading@10 1758
yading@10 1759 =back
yading@10 1760
yading@10 1761
yading@10 1762 If no mapping is present, the filter will implicitly map input channels to
yading@10 1763 output channels preserving index.
yading@10 1764
yading@10 1765 For example, assuming a 5.1+downmix input MOV file
yading@10 1766
yading@10 1767 ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
yading@10 1768
yading@10 1769 will create an output WAV file tagged as stereo from the downmix channels of
yading@10 1770 the input.
yading@10 1771
yading@10 1772 To fix a 5.1 WAV improperly encoded in AAC's native channel order
yading@10 1773
yading@10 1774 ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:channel_layout=5.1' out.wav
yading@10 1775
yading@10 1776
yading@10 1777
yading@10 1778 =head2 join
yading@10 1779
yading@10 1780 Join multiple input streams into one multi-channel stream.
yading@10 1781
yading@10 1782 The filter accepts the following named parameters:
yading@10 1783
yading@10 1784 =over 4
yading@10 1785
yading@10 1786
yading@10 1787
yading@10 1788 =item B<inputs>
yading@10 1789
yading@10 1790 Number of input streams. Defaults to 2.
yading@10 1791
yading@10 1792
yading@10 1793 =item B<channel_layout>
yading@10 1794
yading@10 1795 Desired output channel layout. Defaults to stereo.
yading@10 1796
yading@10 1797
yading@10 1798 =item B<map>
yading@10 1799
yading@10 1800 Map channels from inputs to output. The argument is a '|'-separated list of
yading@10 1801 mappings, each in the C<I<input_idx>.I<in_channel>-I<out_channel>>
yading@10 1802 form. I<input_idx> is the 0-based index of the input stream. I<in_channel>
yading@10 1803 can be either the name of the input channel (e.g. FL for front left) or its
yading@10 1804 index in the specified input stream. I<out_channel> is the name of the output
yading@10 1805 channel.
yading@10 1806
yading@10 1807 =back
yading@10 1808
yading@10 1809
yading@10 1810 The filter will attempt to guess the mappings when those are not specified
yading@10 1811 explicitly. It does so by first trying to find an unused matching input channel
yading@10 1812 and if that fails it picks the first unused input channel.
yading@10 1813
yading@10 1814 E.g. to join 3 inputs (with properly set channel layouts)
yading@10 1815
yading@10 1816 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
yading@10 1817
yading@10 1818
yading@10 1819 To build a 5.1 output from 6 single-channel streams:
yading@10 1820
yading@10 1821 ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
yading@10 1822 'join=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'
yading@10 1823 out
yading@10 1824
yading@10 1825
yading@10 1826
yading@10 1827 =head2 resample
yading@10 1828
yading@10 1829 Convert the audio sample format, sample rate and channel layout. This filter is
yading@10 1830 not meant to be used directly.
yading@10 1831
yading@10 1832
yading@10 1833 =head2 volume
yading@10 1834
yading@10 1835
yading@10 1836 Adjust the input audio volume.
yading@10 1837
yading@10 1838 The filter accepts the following options:
yading@10 1839
yading@10 1840
yading@10 1841 =over 4
yading@10 1842
yading@10 1843
yading@10 1844
yading@10 1845 =item B<volume>
yading@10 1846
yading@10 1847 Expresses how the audio volume will be increased or decreased.
yading@10 1848
yading@10 1849 Output values are clipped to the maximum value.
yading@10 1850
yading@10 1851 The output audio volume is given by the relation:
yading@10 1852
yading@10 1853 <output_volume> = <volume> * <input_volume>
yading@10 1854
yading@10 1855
yading@10 1856 Default value for I<volume> is 1.0.
yading@10 1857
yading@10 1858
yading@10 1859 =item B<precision>
yading@10 1860
yading@10 1861 Set the mathematical precision.
yading@10 1862
yading@10 1863 This determines which input sample formats will be allowed, which affects the
yading@10 1864 precision of the volume scaling.
yading@10 1865
yading@10 1866
yading@10 1867 =over 4
yading@10 1868
yading@10 1869
yading@10 1870 =item B<fixed>
yading@10 1871
yading@10 1872 8-bit fixed-point; limits input sample format to U8, S16, and S32.
yading@10 1873
yading@10 1874 =item B<float>
yading@10 1875
yading@10 1876 32-bit floating-point; limits input sample format to FLT. (default)
yading@10 1877
yading@10 1878 =item B<double>
yading@10 1879
yading@10 1880 64-bit floating-point; limits input sample format to DBL.
yading@10 1881
yading@10 1882 =back
yading@10 1883
yading@10 1884
yading@10 1885 =back
yading@10 1886
yading@10 1887
yading@10 1888
yading@10 1889 =head3 Examples
yading@10 1890
yading@10 1891
yading@10 1892
yading@10 1893 =over 4
yading@10 1894
yading@10 1895
yading@10 1896 =item *
yading@10 1897
yading@10 1898 Halve the input audio volume:
yading@10 1899
yading@10 1900 volume=volume=0.5
yading@10 1901 volume=volume=1/2
yading@10 1902 volume=volume=-6.0206dB
yading@10 1903
yading@10 1904
yading@10 1905 In all the above example the named key for B<volume> can be
yading@10 1906 omitted, for example like in:
yading@10 1907
yading@10 1908 volume=0.5
yading@10 1909
yading@10 1910
yading@10 1911
yading@10 1912 =item *
yading@10 1913
yading@10 1914 Increase input audio power by 6 decibels using fixed-point precision:
yading@10 1915
yading@10 1916 volume=volume=6dB:precision=fixed
yading@10 1917
yading@10 1918
yading@10 1919 =back
yading@10 1920
yading@10 1921
yading@10 1922
yading@10 1923 =head2 volumedetect
yading@10 1924
yading@10 1925
yading@10 1926 Detect the volume of the input video.
yading@10 1927
yading@10 1928 The filter has no parameters. The input is not modified. Statistics about
yading@10 1929 the volume will be printed in the log when the input stream end is reached.
yading@10 1930
yading@10 1931 In particular it will show the mean volume (root mean square), maximum
yading@10 1932 volume (on a per-sample basis), and the beginning of an histogram of the
yading@10 1933 registered volume values (from the maximum value to a cumulated 1/1000 of
yading@10 1934 the samples).
yading@10 1935
yading@10 1936 All volumes are in decibels relative to the maximum PCM value.
yading@10 1937
yading@10 1938
yading@10 1939 =head3 Examples
yading@10 1940
yading@10 1941
yading@10 1942 Here is an excerpt of the output:
yading@10 1943
yading@10 1944 [Parsed_volumedetect_0 0xa23120] mean_volume: -27 dB
yading@10 1945 [Parsed_volumedetect_0 0xa23120] max_volume: -4 dB
yading@10 1946 [Parsed_volumedetect_0 0xa23120] histogram_4db: 6
yading@10 1947 [Parsed_volumedetect_0 0xa23120] histogram_5db: 62
yading@10 1948 [Parsed_volumedetect_0 0xa23120] histogram_6db: 286
yading@10 1949 [Parsed_volumedetect_0 0xa23120] histogram_7db: 1042
yading@10 1950 [Parsed_volumedetect_0 0xa23120] histogram_8db: 2551
yading@10 1951 [Parsed_volumedetect_0 0xa23120] histogram_9db: 4609
yading@10 1952 [Parsed_volumedetect_0 0xa23120] histogram_10db: 8409
yading@10 1953
yading@10 1954
yading@10 1955 It means that:
yading@10 1956
yading@10 1957 =over 4
yading@10 1958
yading@10 1959
yading@10 1960 =item *
yading@10 1961
yading@10 1962 The mean square energy is approximately -27 dB, or 10^-2.7.
yading@10 1963
yading@10 1964 =item *
yading@10 1965
yading@10 1966 The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
yading@10 1967
yading@10 1968 =item *
yading@10 1969
yading@10 1970 There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
yading@10 1971
yading@10 1972 =back
yading@10 1973
yading@10 1974
yading@10 1975 In other words, raising the volume by +4 dB does not cause any clipping,
yading@10 1976 raising it by +5 dB causes clipping for 6 samples, etc.
yading@10 1977
yading@10 1978
yading@10 1979
yading@10 1980 =head1 AUDIO SOURCES
yading@10 1981
yading@10 1982
yading@10 1983 Below is a description of the currently available audio sources.
yading@10 1984
yading@10 1985
yading@10 1986 =head2 abuffer
yading@10 1987
yading@10 1988
yading@10 1989 Buffer audio frames, and make them available to the filter chain.
yading@10 1990
yading@10 1991 This source is mainly intended for a programmatic use, in particular
yading@10 1992 through the interface defined in F<libavfilter/asrc_abuffer.h>.
yading@10 1993
yading@10 1994 It accepts the following named parameters:
yading@10 1995
yading@10 1996
yading@10 1997 =over 4
yading@10 1998
yading@10 1999
yading@10 2000
yading@10 2001 =item B<time_base>
yading@10 2002
yading@10 2003 Timebase which will be used for timestamps of submitted frames. It must be
yading@10 2004 either a floating-point number or in I<numerator>/I<denominator> form.
yading@10 2005
yading@10 2006
yading@10 2007 =item B<sample_rate>
yading@10 2008
yading@10 2009 The sample rate of the incoming audio buffers.
yading@10 2010
yading@10 2011
yading@10 2012 =item B<sample_fmt>
yading@10 2013
yading@10 2014 The sample format of the incoming audio buffers.
yading@10 2015 Either a sample format name or its corresponging integer representation from
yading@10 2016 the enum AVSampleFormat in F<libavutil/samplefmt.h>
yading@10 2017
yading@10 2018
yading@10 2019 =item B<channel_layout>
yading@10 2020
yading@10 2021 The channel layout of the incoming audio buffers.
yading@10 2022 Either a channel layout name from channel_layout_map in
yading@10 2023 F<libavutil/channel_layout.c> or its corresponding integer representation
yading@10 2024 from the AV_CH_LAYOUT_* macros in F<libavutil/channel_layout.h>
yading@10 2025
yading@10 2026
yading@10 2027 =item B<channels>
yading@10 2028
yading@10 2029 The number of channels of the incoming audio buffers.
yading@10 2030 If both I<channels> and I<channel_layout> are specified, then they
yading@10 2031 must be consistent.
yading@10 2032
yading@10 2033
yading@10 2034 =back
yading@10 2035
yading@10 2036
yading@10 2037
yading@10 2038 =head3 Examples
yading@10 2039
yading@10 2040
yading@10 2041
yading@10 2042 abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
yading@10 2043
yading@10 2044
yading@10 2045 will instruct the source to accept planar 16bit signed stereo at 44100Hz.
yading@10 2046 Since the sample format with name "s16p" corresponds to the number
yading@10 2047 6 and the "stereo" channel layout corresponds to the value 0x3, this is
yading@10 2048 equivalent to:
yading@10 2049
yading@10 2050 abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
yading@10 2051
yading@10 2052
yading@10 2053
yading@10 2054 =head2 aevalsrc
yading@10 2055
yading@10 2056
yading@10 2057 Generate an audio signal specified by an expression.
yading@10 2058
yading@10 2059 This source accepts in input one or more expressions (one for each
yading@10 2060 channel), which are evaluated and used to generate a corresponding
yading@10 2061 audio signal.
yading@10 2062
yading@10 2063 This source accepts the following options:
yading@10 2064
yading@10 2065
yading@10 2066 =over 4
yading@10 2067
yading@10 2068
yading@10 2069 =item B<exprs>
yading@10 2070
yading@10 2071 Set the '|'-separated expressions list for each separate channel. In case the
yading@10 2072 B<channel_layout> option is not specified, the selected channel layout
yading@10 2073 depends on the number of provided expressions.
yading@10 2074
yading@10 2075
yading@10 2076 =item B<channel_layout, c>
yading@10 2077
yading@10 2078 Set the channel layout. The number of channels in the specified layout
yading@10 2079 must be equal to the number of specified expressions.
yading@10 2080
yading@10 2081
yading@10 2082 =item B<duration, d>
yading@10 2083
yading@10 2084 Set the minimum duration of the sourced audio. See the function
yading@10 2085 C<av_parse_time()> for the accepted format.
yading@10 2086 Note that the resulting duration may be greater than the specified
yading@10 2087 duration, as the generated audio is always cut at the end of a
yading@10 2088 complete frame.
yading@10 2089
yading@10 2090 If not specified, or the expressed duration is negative, the audio is
yading@10 2091 supposed to be generated forever.
yading@10 2092
yading@10 2093
yading@10 2094 =item B<nb_samples, n>
yading@10 2095
yading@10 2096 Set the number of samples per channel per each output frame,
yading@10 2097 default to 1024.
yading@10 2098
yading@10 2099
yading@10 2100 =item B<sample_rate, s>
yading@10 2101
yading@10 2102 Specify the sample rate, default to 44100.
yading@10 2103
yading@10 2104 =back
yading@10 2105
yading@10 2106
yading@10 2107 Each expression in I<exprs> can contain the following constants:
yading@10 2108
yading@10 2109
yading@10 2110 =over 4
yading@10 2111
yading@10 2112
yading@10 2113 =item B<n>
yading@10 2114
yading@10 2115 number of the evaluated sample, starting from 0
yading@10 2116
yading@10 2117
yading@10 2118 =item B<t>
yading@10 2119
yading@10 2120 time of the evaluated sample expressed in seconds, starting from 0
yading@10 2121
yading@10 2122
yading@10 2123 =item B<s>
yading@10 2124
yading@10 2125 sample rate
yading@10 2126
yading@10 2127
yading@10 2128 =back
yading@10 2129
yading@10 2130
yading@10 2131
yading@10 2132 =head3 Examples
yading@10 2133
yading@10 2134
yading@10 2135
yading@10 2136 =over 4
yading@10 2137
yading@10 2138
yading@10 2139 =item *
yading@10 2140
yading@10 2141 Generate silence:
yading@10 2142
yading@10 2143 aevalsrc=0
yading@10 2144
yading@10 2145
yading@10 2146
yading@10 2147 =item *
yading@10 2148
yading@10 2149 Generate a sin signal with frequency of 440 Hz, set sample rate to
yading@10 2150 8000 Hz:
yading@10 2151
yading@10 2152 aevalsrc="sin(440*2*PI*t):s=8000"
yading@10 2153
yading@10 2154
yading@10 2155
yading@10 2156 =item *
yading@10 2157
yading@10 2158 Generate a two channels signal, specify the channel layout (Front
yading@10 2159 Center + Back Center) explicitly:
yading@10 2160
yading@10 2161 aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC"
yading@10 2162
yading@10 2163
yading@10 2164
yading@10 2165 =item *
yading@10 2166
yading@10 2167 Generate white noise:
yading@10 2168
yading@10 2169 aevalsrc="-2+random(0)"
yading@10 2170
yading@10 2171
yading@10 2172
yading@10 2173 =item *
yading@10 2174
yading@10 2175 Generate an amplitude modulated signal:
yading@10 2176
yading@10 2177 aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)"
yading@10 2178
yading@10 2179
yading@10 2180
yading@10 2181 =item *
yading@10 2182
yading@10 2183 Generate 2.5 Hz binaural beats on a 360 Hz carrier:
yading@10 2184
yading@10 2185 aevalsrc="0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)"
yading@10 2186
yading@10 2187
yading@10 2188
yading@10 2189 =back
yading@10 2190
yading@10 2191
yading@10 2192
yading@10 2193 =head2 anullsrc
yading@10 2194
yading@10 2195
yading@10 2196 Null audio source, return unprocessed audio frames. It is mainly useful
yading@10 2197 as a template and to be employed in analysis / debugging tools, or as
yading@10 2198 the source for filters which ignore the input data (for example the sox
yading@10 2199 synth filter).
yading@10 2200
yading@10 2201 This source accepts the following options:
yading@10 2202
yading@10 2203
yading@10 2204 =over 4
yading@10 2205
yading@10 2206
yading@10 2207
yading@10 2208 =item B<channel_layout, cl>
yading@10 2209
yading@10 2210
yading@10 2211 Specify the channel layout, and can be either an integer or a string
yading@10 2212 representing a channel layout. The default value of I<channel_layout>
yading@10 2213 is "stereo".
yading@10 2214
yading@10 2215 Check the channel_layout_map definition in
yading@10 2216 F<libavutil/channel_layout.c> for the mapping between strings and
yading@10 2217 channel layout values.
yading@10 2218
yading@10 2219
yading@10 2220 =item B<sample_rate, r>
yading@10 2221
yading@10 2222 Specify the sample rate, and defaults to 44100.
yading@10 2223
yading@10 2224
yading@10 2225 =item B<nb_samples, n>
yading@10 2226
yading@10 2227 Set the number of samples per requested frames.
yading@10 2228
yading@10 2229
yading@10 2230 =back
yading@10 2231
yading@10 2232
yading@10 2233
yading@10 2234 =head3 Examples
yading@10 2235
yading@10 2236
yading@10 2237
yading@10 2238 =over 4
yading@10 2239
yading@10 2240
yading@10 2241 =item *
yading@10 2242
yading@10 2243 Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
yading@10 2244
yading@10 2245 anullsrc=r=48000:cl=4
yading@10 2246
yading@10 2247
yading@10 2248
yading@10 2249 =item *
yading@10 2250
yading@10 2251 Do the same operation with a more obvious syntax:
yading@10 2252
yading@10 2253 anullsrc=r=48000:cl=mono
yading@10 2254
yading@10 2255
yading@10 2256 =back
yading@10 2257
yading@10 2258
yading@10 2259
yading@10 2260 =head2 abuffer
yading@10 2261
yading@10 2262 Buffer audio frames, and make them available to the filter chain.
yading@10 2263
yading@10 2264 This source is not intended to be part of user-supplied graph descriptions but
yading@10 2265 for insertion by calling programs through the interface defined in
yading@10 2266 F<libavfilter/buffersrc.h>.
yading@10 2267
yading@10 2268 It accepts the following named parameters:
yading@10 2269
yading@10 2270 =over 4
yading@10 2271
yading@10 2272
yading@10 2273
yading@10 2274 =item B<time_base>
yading@10 2275
yading@10 2276 Timebase which will be used for timestamps of submitted frames. It must be
yading@10 2277 either a floating-point number or in I<numerator>/I<denominator> form.
yading@10 2278
yading@10 2279
yading@10 2280 =item B<sample_rate>
yading@10 2281
yading@10 2282 Audio sample rate.
yading@10 2283
yading@10 2284
yading@10 2285 =item B<sample_fmt>
yading@10 2286
yading@10 2287 Name of the sample format, as returned by C<av_get_sample_fmt_name()>.
yading@10 2288
yading@10 2289
yading@10 2290 =item B<channel_layout>
yading@10 2291
yading@10 2292 Channel layout of the audio data, in the form that can be accepted by
yading@10 2293 C<av_get_channel_layout()>.
yading@10 2294
yading@10 2295 =back
yading@10 2296
yading@10 2297
yading@10 2298 All the parameters need to be explicitly defined.
yading@10 2299
yading@10 2300
yading@10 2301 =head2 flite
yading@10 2302
yading@10 2303
yading@10 2304 Synthesize a voice utterance using the libflite library.
yading@10 2305
yading@10 2306 To enable compilation of this filter you need to configure FFmpeg with
yading@10 2307 C<--enable-libflite>.
yading@10 2308
yading@10 2309 Note that the flite library is not thread-safe.
yading@10 2310
yading@10 2311 The filter accepts the following options:
yading@10 2312
yading@10 2313
yading@10 2314 =over 4
yading@10 2315
yading@10 2316
yading@10 2317
yading@10 2318 =item B<list_voices>
yading@10 2319
yading@10 2320 If set to 1, list the names of the available voices and exit
yading@10 2321 immediately. Default value is 0.
yading@10 2322
yading@10 2323
yading@10 2324 =item B<nb_samples, n>
yading@10 2325
yading@10 2326 Set the maximum number of samples per frame. Default value is 512.
yading@10 2327
yading@10 2328
yading@10 2329 =item B<textfile>
yading@10 2330
yading@10 2331 Set the filename containing the text to speak.
yading@10 2332
yading@10 2333
yading@10 2334 =item B<text>
yading@10 2335
yading@10 2336 Set the text to speak.
yading@10 2337
yading@10 2338
yading@10 2339 =item B<voice, v>
yading@10 2340
yading@10 2341 Set the voice to use for the speech synthesis. Default value is
yading@10 2342 C<kal>. See also the I<list_voices> option.
yading@10 2343
yading@10 2344 =back
yading@10 2345
yading@10 2346
yading@10 2347
yading@10 2348 =head3 Examples
yading@10 2349
yading@10 2350
yading@10 2351
yading@10 2352 =over 4
yading@10 2353
yading@10 2354
yading@10 2355 =item *
yading@10 2356
yading@10 2357 Read from file F<speech.txt>, and synthetize the text using the
yading@10 2358 standard flite voice:
yading@10 2359
yading@10 2360 flite=textfile=speech.txt
yading@10 2361
yading@10 2362
yading@10 2363
yading@10 2364 =item *
yading@10 2365
yading@10 2366 Read the specified text selecting the C<slt> voice:
yading@10 2367
yading@10 2368 flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
yading@10 2369
yading@10 2370
yading@10 2371
yading@10 2372 =item *
yading@10 2373
yading@10 2374 Input text to ffmpeg:
yading@10 2375
yading@10 2376 ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
yading@10 2377
yading@10 2378
yading@10 2379
yading@10 2380 =item *
yading@10 2381
yading@10 2382 Make F<ffplay> speak the specified text, using C<flite> and
yading@10 2383 the C<lavfi> device:
yading@10 2384
yading@10 2385 ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
yading@10 2386
yading@10 2387
yading@10 2388 =back
yading@10 2389
yading@10 2390
yading@10 2391 For more information about libflite, check:
yading@10 2392 E<lt>B<http://www.speech.cs.cmu.edu/flite/>E<gt>
yading@10 2393
yading@10 2394
yading@10 2395 =head2 sine
yading@10 2396
yading@10 2397
yading@10 2398 Generate an audio signal made of a sine wave with amplitude 1/8.
yading@10 2399
yading@10 2400 The audio signal is bit-exact.
yading@10 2401
yading@10 2402 The filter accepts the following options:
yading@10 2403
yading@10 2404
yading@10 2405 =over 4
yading@10 2406
yading@10 2407
yading@10 2408
yading@10 2409 =item B<frequency, f>
yading@10 2410
yading@10 2411 Set the carrier frequency. Default is 440 Hz.
yading@10 2412
yading@10 2413
yading@10 2414 =item B<beep_factor, b>
yading@10 2415
yading@10 2416 Enable a periodic beep every second with frequency I<beep_factor> times
yading@10 2417 the carrier frequency. Default is 0, meaning the beep is disabled.
yading@10 2418
yading@10 2419
yading@10 2420 =item B<sample_rate, s>
yading@10 2421
yading@10 2422 Specify the sample rate, default is 44100.
yading@10 2423
yading@10 2424
yading@10 2425 =item B<duration, d>
yading@10 2426
yading@10 2427 Specify the duration of the generated audio stream.
yading@10 2428
yading@10 2429
yading@10 2430 =item B<samples_per_frame>
yading@10 2431
yading@10 2432 Set the number of samples per output frame, default is 1024.
yading@10 2433
yading@10 2434 =back
yading@10 2435
yading@10 2436
yading@10 2437
yading@10 2438 =head3 Examples
yading@10 2439
yading@10 2440
yading@10 2441
yading@10 2442 =over 4
yading@10 2443
yading@10 2444
yading@10 2445
yading@10 2446 =item *
yading@10 2447
yading@10 2448 Generate a simple 440 Hz sine wave:
yading@10 2449
yading@10 2450 sine
yading@10 2451
yading@10 2452
yading@10 2453
yading@10 2454 =item *
yading@10 2455
yading@10 2456 Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
yading@10 2457
yading@10 2458 sine=220:4:d=5
yading@10 2459 sine=f=220:b=4:d=5
yading@10 2460 sine=frequency=220:beep_factor=4:duration=5
yading@10 2461
yading@10 2462
yading@10 2463
yading@10 2464 =back
yading@10 2465
yading@10 2466
yading@10 2467
yading@10 2468
yading@10 2469 =head1 AUDIO SINKS
yading@10 2470
yading@10 2471
yading@10 2472 Below is a description of the currently available audio sinks.
yading@10 2473
yading@10 2474
yading@10 2475 =head2 abuffersink
yading@10 2476
yading@10 2477
yading@10 2478 Buffer audio frames, and make them available to the end of filter chain.
yading@10 2479
yading@10 2480 This sink is mainly intended for programmatic use, in particular
yading@10 2481 through the interface defined in F<libavfilter/buffersink.h>
yading@10 2482 or the options system.
yading@10 2483
yading@10 2484 It accepts a pointer to an AVABufferSinkContext structure, which
yading@10 2485 defines the incoming buffers' formats, to be passed as the opaque
yading@10 2486 parameter to C<avfilter_init_filter> for initialization.
yading@10 2487
yading@10 2488
yading@10 2489 =head2 anullsink
yading@10 2490
yading@10 2491
yading@10 2492 Null audio sink, do absolutely nothing with the input audio. It is
yading@10 2493 mainly useful as a template and to be employed in analysis / debugging
yading@10 2494 tools.
yading@10 2495
yading@10 2496
yading@10 2497
yading@10 2498 =head1 VIDEO FILTERS
yading@10 2499
yading@10 2500
yading@10 2501 When you configure your FFmpeg build, you can disable any of the
yading@10 2502 existing filters using C<--disable-filters>.
yading@10 2503 The configure output will show the video filters included in your
yading@10 2504 build.
yading@10 2505
yading@10 2506 Below is a description of the currently available video filters.
yading@10 2507
yading@10 2508
yading@10 2509 =head2 alphaextract
yading@10 2510
yading@10 2511
yading@10 2512 Extract the alpha component from the input as a grayscale video. This
yading@10 2513 is especially useful with the I<alphamerge> filter.
yading@10 2514
yading@10 2515
yading@10 2516 =head2 alphamerge
yading@10 2517
yading@10 2518
yading@10 2519 Add or replace the alpha component of the primary input with the
yading@10 2520 grayscale value of a second input. This is intended for use with
yading@10 2521 I<alphaextract> to allow the transmission or storage of frame
yading@10 2522 sequences that have alpha in a format that doesn't support an alpha
yading@10 2523 channel.
yading@10 2524
yading@10 2525 For example, to reconstruct full frames from a normal YUV-encoded video
yading@10 2526 and a separate video created with I<alphaextract>, you might use:
yading@10 2527
yading@10 2528 movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
yading@10 2529
yading@10 2530
yading@10 2531 Since this filter is designed for reconstruction, it operates on frame
yading@10 2532 sequences without considering timestamps, and terminates when either
yading@10 2533 input reaches end of stream. This will cause problems if your encoding
yading@10 2534 pipeline drops frames. If you're trying to apply an image as an
yading@10 2535 overlay to a video stream, consider the I<overlay> filter instead.
yading@10 2536
yading@10 2537
yading@10 2538 =head2 ass
yading@10 2539
yading@10 2540
yading@10 2541 Same as the subtitles filter, except that it doesn't require libavcodec
yading@10 2542 and libavformat to work. On the other hand, it is limited to ASS (Advanced
yading@10 2543 Substation Alpha) subtitles files.
yading@10 2544
yading@10 2545
yading@10 2546 =head2 bbox
yading@10 2547
yading@10 2548
yading@10 2549 Compute the bounding box for the non-black pixels in the input frame
yading@10 2550 luminance plane.
yading@10 2551
yading@10 2552 This filter computes the bounding box containing all the pixels with a
yading@10 2553 luminance value greater than the minimum allowed value.
yading@10 2554 The parameters describing the bounding box are printed on the filter
yading@10 2555 log.
yading@10 2556
yading@10 2557
yading@10 2558 =head2 blackdetect
yading@10 2559
yading@10 2560
yading@10 2561 Detect video intervals that are (almost) completely black. Can be
yading@10 2562 useful to detect chapter transitions, commercials, or invalid
yading@10 2563 recordings. Output lines contains the time for the start, end and
yading@10 2564 duration of the detected black interval expressed in seconds.
yading@10 2565
yading@10 2566 In order to display the output lines, you need to set the loglevel at
yading@10 2567 least to the AV_LOG_INFO value.
yading@10 2568
yading@10 2569 The filter accepts the following options:
yading@10 2570
yading@10 2571
yading@10 2572 =over 4
yading@10 2573
yading@10 2574
yading@10 2575 =item B<black_min_duration, d>
yading@10 2576
yading@10 2577 Set the minimum detected black duration expressed in seconds. It must
yading@10 2578 be a non-negative floating point number.
yading@10 2579
yading@10 2580 Default value is 2.0.
yading@10 2581
yading@10 2582
yading@10 2583 =item B<picture_black_ratio_th, pic_th>
yading@10 2584
yading@10 2585 Set the threshold for considering a picture "black".
yading@10 2586 Express the minimum value for the ratio:
yading@10 2587
yading@10 2588 <nb_black_pixels> / <nb_pixels>
yading@10 2589
yading@10 2590
yading@10 2591 for which a picture is considered black.
yading@10 2592 Default value is 0.98.
yading@10 2593
yading@10 2594
yading@10 2595 =item B<pixel_black_th, pix_th>
yading@10 2596
yading@10 2597 Set the threshold for considering a pixel "black".
yading@10 2598
yading@10 2599 The threshold expresses the maximum pixel luminance value for which a
yading@10 2600 pixel is considered "black". The provided value is scaled according to
yading@10 2601 the following equation:
yading@10 2602
yading@10 2603 <absolute_threshold> = <luminance_minimum_value> + <pixel_black_th> * <luminance_range_size>
yading@10 2604
yading@10 2605
yading@10 2606 I<luminance_range_size> and I<luminance_minimum_value> depend on
yading@10 2607 the input video format, the range is [0-255] for YUV full-range
yading@10 2608 formats and [16-235] for YUV non full-range formats.
yading@10 2609
yading@10 2610 Default value is 0.10.
yading@10 2611
yading@10 2612 =back
yading@10 2613
yading@10 2614
yading@10 2615 The following example sets the maximum pixel threshold to the minimum
yading@10 2616 value, and detects only black intervals of 2 or more seconds:
yading@10 2617
yading@10 2618 blackdetect=d=2:pix_th=0.00
yading@10 2619
yading@10 2620
yading@10 2621
yading@10 2622 =head2 blackframe
yading@10 2623
yading@10 2624
yading@10 2625 Detect frames that are (almost) completely black. Can be useful to
yading@10 2626 detect chapter transitions or commercials. Output lines consist of
yading@10 2627 the frame number of the detected frame, the percentage of blackness,
yading@10 2628 the position in the file if known or -1 and the timestamp in seconds.
yading@10 2629
yading@10 2630 In order to display the output lines, you need to set the loglevel at
yading@10 2631 least to the AV_LOG_INFO value.
yading@10 2632
yading@10 2633 The filter accepts the following options:
yading@10 2634
yading@10 2635
yading@10 2636 =over 4
yading@10 2637
yading@10 2638
yading@10 2639
yading@10 2640 =item B<amount>
yading@10 2641
yading@10 2642 Set the percentage of the pixels that have to be below the threshold, defaults
yading@10 2643 to C<98>.
yading@10 2644
yading@10 2645
yading@10 2646 =item B<threshold, thresh>
yading@10 2647
yading@10 2648 Set the threshold below which a pixel value is considered black, defaults to
yading@10 2649 C<32>.
yading@10 2650
yading@10 2651
yading@10 2652 =back
yading@10 2653
yading@10 2654
yading@10 2655
yading@10 2656 =head2 blend
yading@10 2657
yading@10 2658
yading@10 2659 Blend two video frames into each other.
yading@10 2660
yading@10 2661 It takes two input streams and outputs one stream, the first input is the
yading@10 2662 "top" layer and second input is "bottom" layer.
yading@10 2663 Output terminates when shortest input terminates.
yading@10 2664
yading@10 2665 A description of the accepted options follows.
yading@10 2666
yading@10 2667
yading@10 2668 =over 4
yading@10 2669
yading@10 2670
yading@10 2671 =item B<c0_mode>
yading@10 2672
yading@10 2673
yading@10 2674 =item B<c1_mode>
yading@10 2675
yading@10 2676
yading@10 2677 =item B<c2_mode>
yading@10 2678
yading@10 2679
yading@10 2680 =item B<c3_mode>
yading@10 2681
yading@10 2682
yading@10 2683 =item B<all_mode>
yading@10 2684
yading@10 2685 Set blend mode for specific pixel component or all pixel components in case
yading@10 2686 of I<all_mode>. Default value is C<normal>.
yading@10 2687
yading@10 2688 Available values for component modes are:
yading@10 2689
yading@10 2690 =over 4
yading@10 2691
yading@10 2692
yading@10 2693 =item B<addition>
yading@10 2694
yading@10 2695
yading@10 2696 =item B<and>
yading@10 2697
yading@10 2698
yading@10 2699 =item B<average>
yading@10 2700
yading@10 2701
yading@10 2702 =item B<burn>
yading@10 2703
yading@10 2704
yading@10 2705 =item B<darken>
yading@10 2706
yading@10 2707
yading@10 2708 =item B<difference>
yading@10 2709
yading@10 2710
yading@10 2711 =item B<divide>
yading@10 2712
yading@10 2713
yading@10 2714 =item B<dodge>
yading@10 2715
yading@10 2716
yading@10 2717 =item B<exclusion>
yading@10 2718
yading@10 2719
yading@10 2720 =item B<hardlight>
yading@10 2721
yading@10 2722
yading@10 2723 =item B<lighten>
yading@10 2724
yading@10 2725
yading@10 2726 =item B<multiply>
yading@10 2727
yading@10 2728
yading@10 2729 =item B<negation>
yading@10 2730
yading@10 2731
yading@10 2732 =item B<normal>
yading@10 2733
yading@10 2734
yading@10 2735 =item B<or>
yading@10 2736
yading@10 2737
yading@10 2738 =item B<overlay>
yading@10 2739
yading@10 2740
yading@10 2741 =item B<phoenix>
yading@10 2742
yading@10 2743
yading@10 2744 =item B<pinlight>
yading@10 2745
yading@10 2746
yading@10 2747 =item B<reflect>
yading@10 2748
yading@10 2749
yading@10 2750 =item B<screen>
yading@10 2751
yading@10 2752
yading@10 2753 =item B<softlight>
yading@10 2754
yading@10 2755
yading@10 2756 =item B<subtract>
yading@10 2757
yading@10 2758
yading@10 2759 =item B<vividlight>
yading@10 2760
yading@10 2761
yading@10 2762 =item B<xor>
yading@10 2763
yading@10 2764
yading@10 2765 =back
yading@10 2766
yading@10 2767
yading@10 2768
yading@10 2769 =item B<c0_opacity>
yading@10 2770
yading@10 2771
yading@10 2772 =item B<c1_opacity>
yading@10 2773
yading@10 2774
yading@10 2775 =item B<c2_opacity>
yading@10 2776
yading@10 2777
yading@10 2778 =item B<c3_opacity>
yading@10 2779
yading@10 2780
yading@10 2781 =item B<all_opacity>
yading@10 2782
yading@10 2783 Set blend opacity for specific pixel component or all pixel components in case
yading@10 2784 of I<all_opacity>. Only used in combination with pixel component blend modes.
yading@10 2785
yading@10 2786
yading@10 2787 =item B<c0_expr>
yading@10 2788
yading@10 2789
yading@10 2790 =item B<c1_expr>
yading@10 2791
yading@10 2792
yading@10 2793 =item B<c2_expr>
yading@10 2794
yading@10 2795
yading@10 2796 =item B<c3_expr>
yading@10 2797
yading@10 2798
yading@10 2799 =item B<all_expr>
yading@10 2800
yading@10 2801 Set blend expression for specific pixel component or all pixel components in case
yading@10 2802 of I<all_expr>. Note that related mode options will be ignored if those are set.
yading@10 2803
yading@10 2804 The expressions can use the following variables:
yading@10 2805
yading@10 2806
yading@10 2807 =over 4
yading@10 2808
yading@10 2809
yading@10 2810 =item B<N>
yading@10 2811
yading@10 2812 The sequential number of the filtered frame, starting from C<0>.
yading@10 2813
yading@10 2814
yading@10 2815 =item B<X>
yading@10 2816
yading@10 2817
yading@10 2818 =item B<Y>
yading@10 2819
yading@10 2820 the coordinates of the current sample
yading@10 2821
yading@10 2822
yading@10 2823 =item B<W>
yading@10 2824
yading@10 2825
yading@10 2826 =item B<H>
yading@10 2827
yading@10 2828 the width and height of currently filtered plane
yading@10 2829
yading@10 2830
yading@10 2831 =item B<SW>
yading@10 2832
yading@10 2833
yading@10 2834 =item B<SH>
yading@10 2835
yading@10 2836 Width and height scale depending on the currently filtered plane. It is the
yading@10 2837 ratio between the corresponding luma plane number of pixels and the current
yading@10 2838 plane ones. E.g. for YUV4:2:0 the values are C<1,1> for the luma plane, and
yading@10 2839 C<0.5,0.5> for chroma planes.
yading@10 2840
yading@10 2841
yading@10 2842 =item B<T>
yading@10 2843
yading@10 2844 Time of the current frame, expressed in seconds.
yading@10 2845
yading@10 2846
yading@10 2847 =item B<TOP, A>
yading@10 2848
yading@10 2849 Value of pixel component at current location for first video frame (top layer).
yading@10 2850
yading@10 2851
yading@10 2852 =item B<BOTTOM, B>
yading@10 2853
yading@10 2854 Value of pixel component at current location for second video frame (bottom layer).
yading@10 2855
yading@10 2856 =back
yading@10 2857
yading@10 2858
yading@10 2859 =back
yading@10 2860
yading@10 2861
yading@10 2862
yading@10 2863 =head3 Examples
yading@10 2864
yading@10 2865
yading@10 2866
yading@10 2867 =over 4
yading@10 2868
yading@10 2869
yading@10 2870 =item *
yading@10 2871
yading@10 2872 Apply transition from bottom layer to top layer in first 10 seconds:
yading@10 2873
yading@10 2874 blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
yading@10 2875
yading@10 2876
yading@10 2877
yading@10 2878 =item *
yading@10 2879
yading@10 2880 Apply 1x1 checkerboard effect:
yading@10 2881
yading@10 2882 blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
yading@10 2883
yading@10 2884
yading@10 2885 =back
yading@10 2886
yading@10 2887
yading@10 2888
yading@10 2889 =head2 boxblur
yading@10 2890
yading@10 2891
yading@10 2892 Apply boxblur algorithm to the input video.
yading@10 2893
yading@10 2894 The filter accepts the following options:
yading@10 2895
yading@10 2896
yading@10 2897 =over 4
yading@10 2898
yading@10 2899
yading@10 2900
yading@10 2901 =item B<luma_radius, lr>
yading@10 2902
yading@10 2903
yading@10 2904 =item B<luma_power, lp>
yading@10 2905
yading@10 2906
yading@10 2907 =item B<chroma_radius, cr>
yading@10 2908
yading@10 2909
yading@10 2910 =item B<chroma_power, cp>
yading@10 2911
yading@10 2912
yading@10 2913 =item B<alpha_radius, ar>
yading@10 2914
yading@10 2915
yading@10 2916 =item B<alpha_power, ap>
yading@10 2917
yading@10 2918
yading@10 2919
yading@10 2920 =back
yading@10 2921
yading@10 2922
yading@10 2923 A description of the accepted options follows.
yading@10 2924
yading@10 2925
yading@10 2926 =over 4
yading@10 2927
yading@10 2928
yading@10 2929 =item B<luma_radius, lr>
yading@10 2930
yading@10 2931
yading@10 2932 =item B<chroma_radius, cr>
yading@10 2933
yading@10 2934
yading@10 2935 =item B<alpha_radius, ar>
yading@10 2936
yading@10 2937 Set an expression for the box radius in pixels used for blurring the
yading@10 2938 corresponding input plane.
yading@10 2939
yading@10 2940 The radius value must be a non-negative number, and must not be
yading@10 2941 greater than the value of the expression C<min(w,h)/2> for the
yading@10 2942 luma and alpha planes, and of C<min(cw,ch)/2> for the chroma
yading@10 2943 planes.
yading@10 2944
yading@10 2945 Default value for B<luma_radius> is "2". If not specified,
yading@10 2946 B<chroma_radius> and B<alpha_radius> default to the
yading@10 2947 corresponding value set for B<luma_radius>.
yading@10 2948
yading@10 2949 The expressions can contain the following constants:
yading@10 2950
yading@10 2951 =over 4
yading@10 2952
yading@10 2953
yading@10 2954 =item B<w, h>
yading@10 2955
yading@10 2956 the input width and height in pixels
yading@10 2957
yading@10 2958
yading@10 2959 =item B<cw, ch>
yading@10 2960
yading@10 2961 the input chroma image width and height in pixels
yading@10 2962
yading@10 2963
yading@10 2964 =item B<hsub, vsub>
yading@10 2965
yading@10 2966 horizontal and vertical chroma subsample values. For example for the
yading@10 2967 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 2968
yading@10 2969 =back
yading@10 2970
yading@10 2971
yading@10 2972
yading@10 2973 =item B<luma_power, lp>
yading@10 2974
yading@10 2975
yading@10 2976 =item B<chroma_power, cp>
yading@10 2977
yading@10 2978
yading@10 2979 =item B<alpha_power, ap>
yading@10 2980
yading@10 2981 Specify how many times the boxblur filter is applied to the
yading@10 2982 corresponding plane.
yading@10 2983
yading@10 2984 Default value for B<luma_power> is 2. If not specified,
yading@10 2985 B<chroma_power> and B<alpha_power> default to the
yading@10 2986 corresponding value set for B<luma_power>.
yading@10 2987
yading@10 2988 A value of 0 will disable the effect.
yading@10 2989
yading@10 2990 =back
yading@10 2991
yading@10 2992
yading@10 2993
yading@10 2994 =head3 Examples
yading@10 2995
yading@10 2996
yading@10 2997
yading@10 2998 =over 4
yading@10 2999
yading@10 3000
yading@10 3001 =item *
yading@10 3002
yading@10 3003 Apply a boxblur filter with luma, chroma, and alpha radius
yading@10 3004 set to 2:
yading@10 3005
yading@10 3006 boxblur=luma_radius=2:luma_power=1
yading@10 3007 boxblur=2:1
yading@10 3008
yading@10 3009
yading@10 3010
yading@10 3011 =item *
yading@10 3012
yading@10 3013 Set luma radius to 2, alpha and chroma radius to 0:
yading@10 3014
yading@10 3015 boxblur=2:1:cr=0:ar=0
yading@10 3016
yading@10 3017
yading@10 3018
yading@10 3019 =item *
yading@10 3020
yading@10 3021 Set luma and chroma radius to a fraction of the video dimension:
yading@10 3022
yading@10 3023 boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
yading@10 3024
yading@10 3025
yading@10 3026 =back
yading@10 3027
yading@10 3028
yading@10 3029
yading@10 3030 =head2 colorbalance
yading@10 3031
yading@10 3032 Modify intensity of primary colors (red, green and blue) of input frames.
yading@10 3033
yading@10 3034 The filter allows an input frame to be adjusted in the shadows, midtones or highlights
yading@10 3035 regions for the red-cyan, green-magenta or blue-yellow balance.
yading@10 3036
yading@10 3037 A positive adjustment value shifts the balance towards the primary color, a negative
yading@10 3038 value towards the complementary color.
yading@10 3039
yading@10 3040 The filter accepts the following options:
yading@10 3041
yading@10 3042
yading@10 3043 =over 4
yading@10 3044
yading@10 3045
yading@10 3046 =item B<rs>
yading@10 3047
yading@10 3048
yading@10 3049 =item B<gs>
yading@10 3050
yading@10 3051
yading@10 3052 =item B<bs>
yading@10 3053
yading@10 3054 Adjust red, green and blue shadows (darkest pixels).
yading@10 3055
yading@10 3056
yading@10 3057 =item B<rm>
yading@10 3058
yading@10 3059
yading@10 3060 =item B<gm>
yading@10 3061
yading@10 3062
yading@10 3063 =item B<bm>
yading@10 3064
yading@10 3065 Adjust red, green and blue midtones (medium pixels).
yading@10 3066
yading@10 3067
yading@10 3068 =item B<rh>
yading@10 3069
yading@10 3070
yading@10 3071 =item B<gh>
yading@10 3072
yading@10 3073
yading@10 3074 =item B<bh>
yading@10 3075
yading@10 3076 Adjust red, green and blue highlights (brightest pixels).
yading@10 3077
yading@10 3078 Allowed ranges for options are C<[-1.0, 1.0]>. Defaults are C<0>.
yading@10 3079
yading@10 3080 =back
yading@10 3081
yading@10 3082
yading@10 3083
yading@10 3084 =head3 Examples
yading@10 3085
yading@10 3086
yading@10 3087
yading@10 3088 =over 4
yading@10 3089
yading@10 3090
yading@10 3091 =item *
yading@10 3092
yading@10 3093 Add red color cast to shadows:
yading@10 3094
yading@10 3095 colorbalance=rs=.3
yading@10 3096
yading@10 3097
yading@10 3098 =back
yading@10 3099
yading@10 3100
yading@10 3101
yading@10 3102 =head2 colorchannelmixer
yading@10 3103
yading@10 3104
yading@10 3105 Adjust video input frames by re-mixing color channels.
yading@10 3106
yading@10 3107 This filter modifies a color channel by adding the values associated to
yading@10 3108 the other channels of the same pixels. For example if the value to
yading@10 3109 modify is red, the output value will be:
yading@10 3110
yading@10 3111 <red>=<red>*<rr> + <blue>*<rb> + <green>*<rg> + <alpha>*<ra>
yading@10 3112
yading@10 3113
yading@10 3114 The filter accepts the following options:
yading@10 3115
yading@10 3116
yading@10 3117 =over 4
yading@10 3118
yading@10 3119
yading@10 3120 =item B<rr>
yading@10 3121
yading@10 3122
yading@10 3123 =item B<rg>
yading@10 3124
yading@10 3125
yading@10 3126 =item B<rb>
yading@10 3127
yading@10 3128
yading@10 3129 =item B<ra>
yading@10 3130
yading@10 3131 Adjust contribution of input red, green, blue and alpha channels for output red channel.
yading@10 3132 Default is C<1> for I<rr>, and C<0> for I<rg>, I<rb> and I<ra>.
yading@10 3133
yading@10 3134
yading@10 3135 =item B<gr>
yading@10 3136
yading@10 3137
yading@10 3138 =item B<gg>
yading@10 3139
yading@10 3140
yading@10 3141 =item B<gb>
yading@10 3142
yading@10 3143
yading@10 3144 =item B<ga>
yading@10 3145
yading@10 3146 Adjust contribution of input red, green, blue and alpha channels for output green channel.
yading@10 3147 Default is C<1> for I<gg>, and C<0> for I<gr>, I<gb> and I<ga>.
yading@10 3148
yading@10 3149
yading@10 3150 =item B<br>
yading@10 3151
yading@10 3152
yading@10 3153 =item B<bg>
yading@10 3154
yading@10 3155
yading@10 3156 =item B<bb>
yading@10 3157
yading@10 3158
yading@10 3159 =item B<ba>
yading@10 3160
yading@10 3161 Adjust contribution of input red, green, blue and alpha channels for output blue channel.
yading@10 3162 Default is C<1> for I<bb>, and C<0> for I<br>, I<bg> and I<ba>.
yading@10 3163
yading@10 3164
yading@10 3165 =item B<ar>
yading@10 3166
yading@10 3167
yading@10 3168 =item B<ag>
yading@10 3169
yading@10 3170
yading@10 3171 =item B<ab>
yading@10 3172
yading@10 3173
yading@10 3174 =item B<aa>
yading@10 3175
yading@10 3176 Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
yading@10 3177 Default is C<1> for I<aa>, and C<0> for I<ar>, I<ag> and I<ab>.
yading@10 3178
yading@10 3179 Allowed ranges for options are C<[-2.0, 2.0]>.
yading@10 3180
yading@10 3181 =back
yading@10 3182
yading@10 3183
yading@10 3184
yading@10 3185 =head3 Examples
yading@10 3186
yading@10 3187
yading@10 3188
yading@10 3189 =over 4
yading@10 3190
yading@10 3191
yading@10 3192 =item *
yading@10 3193
yading@10 3194 Convert source to grayscale:
yading@10 3195
yading@10 3196 colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
yading@10 3197
yading@10 3198
yading@10 3199 =back
yading@10 3200
yading@10 3201
yading@10 3202
yading@10 3203 =head2 colormatrix
yading@10 3204
yading@10 3205
yading@10 3206 Convert color matrix.
yading@10 3207
yading@10 3208 The filter accepts the following options:
yading@10 3209
yading@10 3210
yading@10 3211 =over 4
yading@10 3212
yading@10 3213
yading@10 3214 =item B<src>
yading@10 3215
yading@10 3216
yading@10 3217 =item B<dst>
yading@10 3218
yading@10 3219 Specify the source and destination color matrix. Both values must be
yading@10 3220 specified.
yading@10 3221
yading@10 3222 The accepted values are:
yading@10 3223
yading@10 3224 =over 4
yading@10 3225
yading@10 3226
yading@10 3227 =item B<bt709>
yading@10 3228
yading@10 3229 BT.709
yading@10 3230
yading@10 3231
yading@10 3232 =item B<bt601>
yading@10 3233
yading@10 3234 BT.601
yading@10 3235
yading@10 3236
yading@10 3237 =item B<smpte240m>
yading@10 3238
yading@10 3239 SMPTE-240M
yading@10 3240
yading@10 3241
yading@10 3242 =item B<fcc>
yading@10 3243
yading@10 3244 FCC
yading@10 3245
yading@10 3246 =back
yading@10 3247
yading@10 3248
yading@10 3249 =back
yading@10 3250
yading@10 3251
yading@10 3252 For example to convert from BT.601 to SMPTE-240M, use the command:
yading@10 3253
yading@10 3254 colormatrix=bt601:smpte240m
yading@10 3255
yading@10 3256
yading@10 3257
yading@10 3258 =head2 copy
yading@10 3259
yading@10 3260
yading@10 3261 Copy the input source unchanged to the output. Mainly useful for
yading@10 3262 testing purposes.
yading@10 3263
yading@10 3264
yading@10 3265 =head2 crop
yading@10 3266
yading@10 3267
yading@10 3268 Crop the input video to given dimensions.
yading@10 3269
yading@10 3270 The filter accepts the following options:
yading@10 3271
yading@10 3272
yading@10 3273 =over 4
yading@10 3274
yading@10 3275
yading@10 3276 =item B<w, out_w>
yading@10 3277
yading@10 3278 Width of the output video. It defaults to C<iw>.
yading@10 3279 This expression is evaluated only once during the filter
yading@10 3280 configuration.
yading@10 3281
yading@10 3282
yading@10 3283 =item B<h, out_h>
yading@10 3284
yading@10 3285 Height of the output video. It defaults to C<ih>.
yading@10 3286 This expression is evaluated only once during the filter
yading@10 3287 configuration.
yading@10 3288
yading@10 3289
yading@10 3290 =item B<x>
yading@10 3291
yading@10 3292 Horizontal position, in the input video, of the left edge of the output video.
yading@10 3293 It defaults to C<(in_w-out_w)/2>.
yading@10 3294 This expression is evaluated per-frame.
yading@10 3295
yading@10 3296
yading@10 3297 =item B<y>
yading@10 3298
yading@10 3299 Vertical position, in the input video, of the top edge of the output video.
yading@10 3300 It defaults to C<(in_h-out_h)/2>.
yading@10 3301 This expression is evaluated per-frame.
yading@10 3302
yading@10 3303
yading@10 3304 =item B<keep_aspect>
yading@10 3305
yading@10 3306 If set to 1 will force the output display aspect ratio
yading@10 3307 to be the same of the input, by changing the output sample aspect
yading@10 3308 ratio. It defaults to 0.
yading@10 3309
yading@10 3310 =back
yading@10 3311
yading@10 3312
yading@10 3313 The I<out_w>, I<out_h>, I<x>, I<y> parameters are
yading@10 3314 expressions containing the following constants:
yading@10 3315
yading@10 3316
yading@10 3317 =over 4
yading@10 3318
yading@10 3319
yading@10 3320 =item B<x, y>
yading@10 3321
yading@10 3322 the computed values for I<x> and I<y>. They are evaluated for
yading@10 3323 each new frame.
yading@10 3324
yading@10 3325
yading@10 3326 =item B<in_w, in_h>
yading@10 3327
yading@10 3328 the input width and height
yading@10 3329
yading@10 3330
yading@10 3331 =item B<iw, ih>
yading@10 3332
yading@10 3333 same as I<in_w> and I<in_h>
yading@10 3334
yading@10 3335
yading@10 3336 =item B<out_w, out_h>
yading@10 3337
yading@10 3338 the output (cropped) width and height
yading@10 3339
yading@10 3340
yading@10 3341 =item B<ow, oh>
yading@10 3342
yading@10 3343 same as I<out_w> and I<out_h>
yading@10 3344
yading@10 3345
yading@10 3346 =item B<a>
yading@10 3347
yading@10 3348 same as I<iw> / I<ih>
yading@10 3349
yading@10 3350
yading@10 3351 =item B<sar>
yading@10 3352
yading@10 3353 input sample aspect ratio
yading@10 3354
yading@10 3355
yading@10 3356 =item B<dar>
yading@10 3357
yading@10 3358 input display aspect ratio, it is the same as (I<iw> / I<ih>) * I<sar>
yading@10 3359
yading@10 3360
yading@10 3361 =item B<hsub, vsub>
yading@10 3362
yading@10 3363 horizontal and vertical chroma subsample values. For example for the
yading@10 3364 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 3365
yading@10 3366
yading@10 3367 =item B<n>
yading@10 3368
yading@10 3369 the number of input frame, starting from 0
yading@10 3370
yading@10 3371
yading@10 3372 =item B<pos>
yading@10 3373
yading@10 3374 the position in the file of the input frame, NAN if unknown
yading@10 3375
yading@10 3376
yading@10 3377 =item B<t>
yading@10 3378
yading@10 3379 timestamp expressed in seconds, NAN if the input timestamp is unknown
yading@10 3380
yading@10 3381
yading@10 3382 =back
yading@10 3383
yading@10 3384
yading@10 3385 The expression for I<out_w> may depend on the value of I<out_h>,
yading@10 3386 and the expression for I<out_h> may depend on I<out_w>, but they
yading@10 3387 cannot depend on I<x> and I<y>, as I<x> and I<y> are
yading@10 3388 evaluated after I<out_w> and I<out_h>.
yading@10 3389
yading@10 3390 The I<x> and I<y> parameters specify the expressions for the
yading@10 3391 position of the top-left corner of the output (non-cropped) area. They
yading@10 3392 are evaluated for each frame. If the evaluated value is not valid, it
yading@10 3393 is approximated to the nearest valid value.
yading@10 3394
yading@10 3395 The expression for I<x> may depend on I<y>, and the expression
yading@10 3396 for I<y> may depend on I<x>.
yading@10 3397
yading@10 3398
yading@10 3399 =head3 Examples
yading@10 3400
yading@10 3401
yading@10 3402
yading@10 3403 =over 4
yading@10 3404
yading@10 3405
yading@10 3406 =item *
yading@10 3407
yading@10 3408 Crop area with size 100x100 at position (12,34).
yading@10 3409
yading@10 3410 crop=100:100:12:34
yading@10 3411
yading@10 3412
yading@10 3413 Using named options, the example above becomes:
yading@10 3414
yading@10 3415 crop=w=100:h=100:x=12:y=34
yading@10 3416
yading@10 3417
yading@10 3418
yading@10 3419 =item *
yading@10 3420
yading@10 3421 Crop the central input area with size 100x100:
yading@10 3422
yading@10 3423 crop=100:100
yading@10 3424
yading@10 3425
yading@10 3426
yading@10 3427 =item *
yading@10 3428
yading@10 3429 Crop the central input area with size 2/3 of the input video:
yading@10 3430
yading@10 3431 crop=2/3*in_w:2/3*in_h
yading@10 3432
yading@10 3433
yading@10 3434
yading@10 3435 =item *
yading@10 3436
yading@10 3437 Crop the input video central square:
yading@10 3438
yading@10 3439 crop=out_w=in_h
yading@10 3440 crop=in_h
yading@10 3441
yading@10 3442
yading@10 3443
yading@10 3444 =item *
yading@10 3445
yading@10 3446 Delimit the rectangle with the top-left corner placed at position
yading@10 3447 100:100 and the right-bottom corner corresponding to the right-bottom
yading@10 3448 corner of the input image:
yading@10 3449
yading@10 3450 crop=in_w-100:in_h-100:100:100
yading@10 3451
yading@10 3452
yading@10 3453
yading@10 3454 =item *
yading@10 3455
yading@10 3456 Crop 10 pixels from the left and right borders, and 20 pixels from
yading@10 3457 the top and bottom borders
yading@10 3458
yading@10 3459 crop=in_w-2*10:in_h-2*20
yading@10 3460
yading@10 3461
yading@10 3462
yading@10 3463 =item *
yading@10 3464
yading@10 3465 Keep only the bottom right quarter of the input image:
yading@10 3466
yading@10 3467 crop=in_w/2:in_h/2:in_w/2:in_h/2
yading@10 3468
yading@10 3469
yading@10 3470
yading@10 3471 =item *
yading@10 3472
yading@10 3473 Crop height for getting Greek harmony:
yading@10 3474
yading@10 3475 crop=in_w:1/PHI*in_w
yading@10 3476
yading@10 3477
yading@10 3478
yading@10 3479 =item *
yading@10 3480
yading@10 3481 Appply trembling effect:
yading@10 3482
yading@10 3483 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 3484
yading@10 3485
yading@10 3486
yading@10 3487 =item *
yading@10 3488
yading@10 3489 Apply erratic camera effect depending on timestamp:
yading@10 3490
yading@10 3491 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 3492
yading@10 3493
yading@10 3494
yading@10 3495 =item *
yading@10 3496
yading@10 3497 Set x depending on the value of y:
yading@10 3498
yading@10 3499 crop=in_w/2:in_h/2:y:10+10*sin(n/10)
yading@10 3500
yading@10 3501
yading@10 3502 =back
yading@10 3503
yading@10 3504
yading@10 3505
yading@10 3506 =head2 cropdetect
yading@10 3507
yading@10 3508
yading@10 3509 Auto-detect crop size.
yading@10 3510
yading@10 3511 Calculate necessary cropping parameters and prints the recommended
yading@10 3512 parameters through the logging system. The detected dimensions
yading@10 3513 correspond to the non-black area of the input video.
yading@10 3514
yading@10 3515 The filter accepts the following options:
yading@10 3516
yading@10 3517
yading@10 3518 =over 4
yading@10 3519
yading@10 3520
yading@10 3521
yading@10 3522 =item B<limit>
yading@10 3523
yading@10 3524 Set higher black value threshold, which can be optionally specified
yading@10 3525 from nothing (0) to everything (255). An intensity value greater
yading@10 3526 to the set value is considered non-black. Default value is 24.
yading@10 3527
yading@10 3528
yading@10 3529 =item B<round>
yading@10 3530
yading@10 3531 Set the value for which the width/height should be divisible by. The
yading@10 3532 offset is automatically adjusted to center the video. Use 2 to get
yading@10 3533 only even dimensions (needed for 4:2:2 video). 16 is best when
yading@10 3534 encoding to most video codecs. Default value is 16.
yading@10 3535
yading@10 3536
yading@10 3537 =item B<reset_count, reset>
yading@10 3538
yading@10 3539 Set the counter that determines after how many frames cropdetect will
yading@10 3540 reset the previously detected largest video area and start over to
yading@10 3541 detect the current optimal crop area. Default value is 0.
yading@10 3542
yading@10 3543 This can be useful when channel logos distort the video area. 0
yading@10 3544 indicates never reset and return the largest area encountered during
yading@10 3545 playback.
yading@10 3546
yading@10 3547 =back
yading@10 3548
yading@10 3549
yading@10 3550
yading@10 3551 =head2 curves
yading@10 3552
yading@10 3553
yading@10 3554 Apply color adjustments using curves.
yading@10 3555
yading@10 3556 This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
yading@10 3557 component (red, green and blue) has its values defined by I<N> key points
yading@10 3558 tied from each other using a smooth curve. The x-axis represents the pixel
yading@10 3559 values from the input frame, and the y-axis the new pixel values to be set for
yading@10 3560 the output frame.
yading@10 3561
yading@10 3562 By default, a component curve is defined by the two points I<(0;0)> and
yading@10 3563 I<(1;1)>. This creates a straight line where each original pixel value is
yading@10 3564 "adjusted" to its own value, which means no change to the image.
yading@10 3565
yading@10 3566 The filter allows you to redefine these two points and add some more. A new
yading@10 3567 curve (using a natural cubic spline interpolation) will be define to pass
yading@10 3568 smoothly through all these new coordinates. The new defined points needs to be
yading@10 3569 strictly increasing over the x-axis, and their I<x> and I<y> values must
yading@10 3570 be in the I<[0;1]> interval. If the computed curves happened to go outside
yading@10 3571 the vector spaces, the values will be clipped accordingly.
yading@10 3572
yading@10 3573 If there is no key point defined in C<x=0>, the filter will automatically
yading@10 3574 insert a I<(0;0)> point. In the same way, if there is no key point defined
yading@10 3575 in C<x=1>, the filter will automatically insert a I<(1;1)> point.
yading@10 3576
yading@10 3577 The filter accepts the following options:
yading@10 3578
yading@10 3579
yading@10 3580 =over 4
yading@10 3581
yading@10 3582
yading@10 3583 =item B<preset>
yading@10 3584
yading@10 3585 Select one of the available color presets. This option can be used in addition
yading@10 3586 to the B<r>, B<g>, B<b> parameters; in this case, the later
yading@10 3587 options takes priority on the preset values.
yading@10 3588 Available presets are:
yading@10 3589
yading@10 3590 =over 4
yading@10 3591
yading@10 3592
yading@10 3593 =item B<none>
yading@10 3594
yading@10 3595
yading@10 3596 =item B<color_negative>
yading@10 3597
yading@10 3598
yading@10 3599 =item B<cross_process>
yading@10 3600
yading@10 3601
yading@10 3602 =item B<darker>
yading@10 3603
yading@10 3604
yading@10 3605 =item B<increase_contrast>
yading@10 3606
yading@10 3607
yading@10 3608 =item B<lighter>
yading@10 3609
yading@10 3610
yading@10 3611 =item B<linear_contrast>
yading@10 3612
yading@10 3613
yading@10 3614 =item B<medium_contrast>
yading@10 3615
yading@10 3616
yading@10 3617 =item B<negative>
yading@10 3618
yading@10 3619
yading@10 3620 =item B<strong_contrast>
yading@10 3621
yading@10 3622
yading@10 3623 =item B<vintage>
yading@10 3624
yading@10 3625
yading@10 3626 =back
yading@10 3627
yading@10 3628 Default is C<none>.
yading@10 3629
yading@10 3630 =item B<master, m>
yading@10 3631
yading@10 3632 Set the master key points. These points will define a second pass mapping. It
yading@10 3633 is sometimes called a "luminance" or "value" mapping. It can be used with
yading@10 3634 B<r>, B<g>, B<b> or B<all> since it acts like a
yading@10 3635 post-processing LUT.
yading@10 3636
yading@10 3637 =item B<red, r>
yading@10 3638
yading@10 3639 Set the key points for the red component.
yading@10 3640
yading@10 3641 =item B<green, g>
yading@10 3642
yading@10 3643 Set the key points for the green component.
yading@10 3644
yading@10 3645 =item B<blue, b>
yading@10 3646
yading@10 3647 Set the key points for the blue component.
yading@10 3648
yading@10 3649 =item B<all>
yading@10 3650
yading@10 3651 Set the key points for all components (not including master).
yading@10 3652 Can be used in addition to the other key points component
yading@10 3653 options. In this case, the unset component(s) will fallback on this
yading@10 3654 B<all> setting.
yading@10 3655
yading@10 3656 =item B<psfile>
yading@10 3657
yading@10 3658 Specify a Photoshop curves file (C<.asv>) to import the settings from.
yading@10 3659
yading@10 3660 =back
yading@10 3661
yading@10 3662
yading@10 3663 To avoid some filtergraph syntax conflicts, each key points list need to be
yading@10 3664 defined using the following syntax: C<x0/y0 x1/y1 x2/y2 ...>.
yading@10 3665
yading@10 3666
yading@10 3667 =head3 Examples
yading@10 3668
yading@10 3669
yading@10 3670
yading@10 3671 =over 4
yading@10 3672
yading@10 3673
yading@10 3674 =item *
yading@10 3675
yading@10 3676 Increase slightly the middle level of blue:
yading@10 3677
yading@10 3678 curves=blue='0.5/0.58'
yading@10 3679
yading@10 3680
yading@10 3681
yading@10 3682 =item *
yading@10 3683
yading@10 3684 Vintage effect:
yading@10 3685
yading@10 3686 curves=r='0/0.11 .42/.51 1/0.95':g='0.50/0.48':b='0/0.22 .49/.44 1/0.8'
yading@10 3687
yading@10 3688 Here we obtain the following coordinates for each components:
yading@10 3689
yading@10 3690 =over 4
yading@10 3691
yading@10 3692
yading@10 3693 =item I<red>
yading@10 3694
yading@10 3695 C<(0;0.11) (0.42;0.51) (1;0.95)>
yading@10 3696
yading@10 3697 =item I<green>
yading@10 3698
yading@10 3699 C<(0;0) (0.50;0.48) (1;1)>
yading@10 3700
yading@10 3701 =item I<blue>
yading@10 3702
yading@10 3703 C<(0;0.22) (0.49;0.44) (1;0.80)>
yading@10 3704
yading@10 3705 =back
yading@10 3706
yading@10 3707
yading@10 3708
yading@10 3709 =item *
yading@10 3710
yading@10 3711 The previous example can also be achieved with the associated built-in preset:
yading@10 3712
yading@10 3713 curves=preset=vintage
yading@10 3714
yading@10 3715
yading@10 3716
yading@10 3717 =item *
yading@10 3718
yading@10 3719 Or simply:
yading@10 3720
yading@10 3721 curves=vintage
yading@10 3722
yading@10 3723
yading@10 3724
yading@10 3725 =item *
yading@10 3726
yading@10 3727 Use a Photoshop preset and redefine the points of the green component:
yading@10 3728
yading@10 3729 curves=psfile='MyCurvesPresets/purple.asv':green='0.45/0.53'
yading@10 3730
yading@10 3731
yading@10 3732 =back
yading@10 3733
yading@10 3734
yading@10 3735
yading@10 3736
yading@10 3737 =head2 decimate
yading@10 3738
yading@10 3739
yading@10 3740 Drop duplicated frames at regular intervals.
yading@10 3741
yading@10 3742 The filter accepts the following options:
yading@10 3743
yading@10 3744
yading@10 3745 =over 4
yading@10 3746
yading@10 3747
yading@10 3748 =item B<cycle>
yading@10 3749
yading@10 3750 Set the number of frames from which one will be dropped. Setting this to
yading@10 3751 I<N> means one frame in every batch of I<N> frames will be dropped.
yading@10 3752 Default is C<5>.
yading@10 3753
yading@10 3754
yading@10 3755 =item B<dupthresh>
yading@10 3756
yading@10 3757 Set the threshold for duplicate detection. If the difference metric for a frame
yading@10 3758 is less than or equal to this value, then it is declared as duplicate. Default
yading@10 3759 is C<1.1>
yading@10 3760
yading@10 3761
yading@10 3762 =item B<scthresh>
yading@10 3763
yading@10 3764 Set scene change threshold. Default is C<15>.
yading@10 3765
yading@10 3766
yading@10 3767 =item B<blockx>
yading@10 3768
yading@10 3769
yading@10 3770 =item B<blocky>
yading@10 3771
yading@10 3772 Set the size of the x and y-axis blocks used during metric calculations.
yading@10 3773 Larger blocks give better noise suppression, but also give worse detection of
yading@10 3774 small movements. Must be a power of two. Default is C<32>.
yading@10 3775
yading@10 3776
yading@10 3777 =item B<ppsrc>
yading@10 3778
yading@10 3779 Mark main input as a pre-processed input and activate clean source input
yading@10 3780 stream. This allows the input to be pre-processed with various filters to help
yading@10 3781 the metrics calculation while keeping the frame selection lossless. When set to
yading@10 3782 C<1>, the first stream is for the pre-processed input, and the second
yading@10 3783 stream is the clean source from where the kept frames are chosen. Default is
yading@10 3784 C<0>.
yading@10 3785
yading@10 3786
yading@10 3787 =item B<chroma>
yading@10 3788
yading@10 3789 Set whether or not chroma is considered in the metric calculations. Default is
yading@10 3790 C<1>.
yading@10 3791
yading@10 3792 =back
yading@10 3793
yading@10 3794
yading@10 3795
yading@10 3796 =head2 delogo
yading@10 3797
yading@10 3798
yading@10 3799 Suppress a TV station logo by a simple interpolation of the surrounding
yading@10 3800 pixels. Just set a rectangle covering the logo and watch it disappear
yading@10 3801 (and sometimes something even uglier appear - your mileage may vary).
yading@10 3802
yading@10 3803 This filter accepts the following options:
yading@10 3804
yading@10 3805 =over 4
yading@10 3806
yading@10 3807
yading@10 3808
yading@10 3809 =item B<x, y>
yading@10 3810
yading@10 3811 Specify the top left corner coordinates of the logo. They must be
yading@10 3812 specified.
yading@10 3813
yading@10 3814
yading@10 3815 =item B<w, h>
yading@10 3816
yading@10 3817 Specify the width and height of the logo to clear. They must be
yading@10 3818 specified.
yading@10 3819
yading@10 3820
yading@10 3821 =item B<band, t>
yading@10 3822
yading@10 3823 Specify the thickness of the fuzzy edge of the rectangle (added to
yading@10 3824 I<w> and I<h>). The default value is 4.
yading@10 3825
yading@10 3826
yading@10 3827 =item B<show>
yading@10 3828
yading@10 3829 When set to 1, a green rectangle is drawn on the screen to simplify
yading@10 3830 finding the right I<x>, I<y>, I<w>, I<h> parameters, and
yading@10 3831 I<band> is set to 4. The default value is 0.
yading@10 3832
yading@10 3833
yading@10 3834 =back
yading@10 3835
yading@10 3836
yading@10 3837
yading@10 3838 =head3 Examples
yading@10 3839
yading@10 3840
yading@10 3841
yading@10 3842 =over 4
yading@10 3843
yading@10 3844
yading@10 3845 =item *
yading@10 3846
yading@10 3847 Set a rectangle covering the area with top left corner coordinates 0,0
yading@10 3848 and size 100x77, setting a band of size 10:
yading@10 3849
yading@10 3850 delogo=x=0:y=0:w=100:h=77:band=10
yading@10 3851
yading@10 3852
yading@10 3853
yading@10 3854 =back
yading@10 3855
yading@10 3856
yading@10 3857
yading@10 3858 =head2 deshake
yading@10 3859
yading@10 3860
yading@10 3861 Attempt to fix small changes in horizontal and/or vertical shift. This
yading@10 3862 filter helps remove camera shake from hand-holding a camera, bumping a
yading@10 3863 tripod, moving on a vehicle, etc.
yading@10 3864
yading@10 3865 The filter accepts the following options:
yading@10 3866
yading@10 3867
yading@10 3868 =over 4
yading@10 3869
yading@10 3870
yading@10 3871
yading@10 3872 =item B<x>
yading@10 3873
yading@10 3874
yading@10 3875 =item B<y>
yading@10 3876
yading@10 3877
yading@10 3878 =item B<w>
yading@10 3879
yading@10 3880
yading@10 3881 =item B<h>
yading@10 3882
yading@10 3883 Specify a rectangular area where to limit the search for motion
yading@10 3884 vectors.
yading@10 3885 If desired the search for motion vectors can be limited to a
yading@10 3886 rectangular area of the frame defined by its top left corner, width
yading@10 3887 and height. These parameters have the same meaning as the drawbox
yading@10 3888 filter which can be used to visualise the position of the bounding
yading@10 3889 box.
yading@10 3890
yading@10 3891 This is useful when simultaneous movement of subjects within the frame
yading@10 3892 might be confused for camera motion by the motion vector search.
yading@10 3893
yading@10 3894 If any or all of I<x>, I<y>, I<w> and I<h> are set to -1
yading@10 3895 then the full frame is used. This allows later options to be set
yading@10 3896 without specifying the bounding box for the motion vector search.
yading@10 3897
yading@10 3898 Default - search the whole frame.
yading@10 3899
yading@10 3900
yading@10 3901 =item B<rx>
yading@10 3902
yading@10 3903
yading@10 3904 =item B<ry>
yading@10 3905
yading@10 3906 Specify the maximum extent of movement in x and y directions in the
yading@10 3907 range 0-64 pixels. Default 16.
yading@10 3908
yading@10 3909
yading@10 3910 =item B<edge>
yading@10 3911
yading@10 3912 Specify how to generate pixels to fill blanks at the edge of the
yading@10 3913 frame. Available values are:
yading@10 3914
yading@10 3915 =over 4
yading@10 3916
yading@10 3917
yading@10 3918 =item B<blank, 0>
yading@10 3919
yading@10 3920 Fill zeroes at blank locations
yading@10 3921
yading@10 3922 =item B<original, 1>
yading@10 3923
yading@10 3924 Original image at blank locations
yading@10 3925
yading@10 3926 =item B<clamp, 2>
yading@10 3927
yading@10 3928 Extruded edge value at blank locations
yading@10 3929
yading@10 3930 =item B<mirror, 3>
yading@10 3931
yading@10 3932 Mirrored edge at blank locations
yading@10 3933
yading@10 3934 =back
yading@10 3935
yading@10 3936 Default value is B<mirror>.
yading@10 3937
yading@10 3938
yading@10 3939 =item B<blocksize>
yading@10 3940
yading@10 3941 Specify the blocksize to use for motion search. Range 4-128 pixels,
yading@10 3942 default 8.
yading@10 3943
yading@10 3944
yading@10 3945 =item B<contrast>
yading@10 3946
yading@10 3947 Specify the contrast threshold for blocks. Only blocks with more than
yading@10 3948 the specified contrast (difference between darkest and lightest
yading@10 3949 pixels) will be considered. Range 1-255, default 125.
yading@10 3950
yading@10 3951
yading@10 3952 =item B<search>
yading@10 3953
yading@10 3954 Specify the search strategy. Available values are:
yading@10 3955
yading@10 3956 =over 4
yading@10 3957
yading@10 3958
yading@10 3959 =item B<exhaustive, 0>
yading@10 3960
yading@10 3961 Set exhaustive search
yading@10 3962
yading@10 3963 =item B<less, 1>
yading@10 3964
yading@10 3965 Set less exhaustive search.
yading@10 3966
yading@10 3967 =back
yading@10 3968
yading@10 3969 Default value is B<exhaustive>.
yading@10 3970
yading@10 3971
yading@10 3972 =item B<filename>
yading@10 3973
yading@10 3974 If set then a detailed log of the motion search is written to the
yading@10 3975 specified file.
yading@10 3976
yading@10 3977
yading@10 3978 =item B<opencl>
yading@10 3979
yading@10 3980 If set to 1, specify using OpenCL capabilities, only available if
yading@10 3981 FFmpeg was configured with C<--enable-opencl>. Default value is 0.
yading@10 3982
yading@10 3983
yading@10 3984 =back
yading@10 3985
yading@10 3986
yading@10 3987
yading@10 3988 =head2 drawbox
yading@10 3989
yading@10 3990
yading@10 3991 Draw a colored box on the input image.
yading@10 3992
yading@10 3993 This filter accepts the following options:
yading@10 3994
yading@10 3995
yading@10 3996 =over 4
yading@10 3997
yading@10 3998
yading@10 3999 =item B<x, y>
yading@10 4000
yading@10 4001 Specify the top left corner coordinates of the box. Default to 0.
yading@10 4002
yading@10 4003
yading@10 4004 =item B<width, w>
yading@10 4005
yading@10 4006
yading@10 4007 =item B<height, h>
yading@10 4008
yading@10 4009 Specify the width and height of the box, if 0 they are interpreted as
yading@10 4010 the input width and height. Default to 0.
yading@10 4011
yading@10 4012
yading@10 4013 =item B<color, c>
yading@10 4014
yading@10 4015 Specify the color of the box to write, it can be the name of a color
yading@10 4016 (case insensitive match) or a 0xRRGGBB[AA] sequence. If the special
yading@10 4017 value C<invert> is used, the box edge color is the same as the
yading@10 4018 video with inverted luma.
yading@10 4019
yading@10 4020
yading@10 4021 =item B<thickness, t>
yading@10 4022
yading@10 4023 Set the thickness of the box edge. Default value is C<4>.
yading@10 4024
yading@10 4025 =back
yading@10 4026
yading@10 4027
yading@10 4028
yading@10 4029 =head3 Examples
yading@10 4030
yading@10 4031
yading@10 4032
yading@10 4033 =over 4
yading@10 4034
yading@10 4035
yading@10 4036 =item *
yading@10 4037
yading@10 4038 Draw a black box around the edge of the input image:
yading@10 4039
yading@10 4040 drawbox
yading@10 4041
yading@10 4042
yading@10 4043
yading@10 4044 =item *
yading@10 4045
yading@10 4046 Draw a box with color red and an opacity of 50%:
yading@10 4047
yading@10 4048 drawbox=10:20:200:60:red@0.5
yading@10 4049
yading@10 4050
yading@10 4051 The previous example can be specified as:
yading@10 4052
yading@10 4053 drawbox=x=10:y=20:w=200:h=60:color=red@0.5
yading@10 4054
yading@10 4055
yading@10 4056
yading@10 4057 =item *
yading@10 4058
yading@10 4059 Fill the box with pink color:
yading@10 4060
yading@10 4061 drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=max
yading@10 4062
yading@10 4063
yading@10 4064 =back
yading@10 4065
yading@10 4066
yading@10 4067
yading@10 4068
yading@10 4069 =head2 drawtext
yading@10 4070
yading@10 4071
yading@10 4072 Draw text string or text from specified file on top of video using the
yading@10 4073 libfreetype library.
yading@10 4074
yading@10 4075 To enable compilation of this filter you need to configure FFmpeg with
yading@10 4076 C<--enable-libfreetype>.
yading@10 4077
yading@10 4078
yading@10 4079 =head3 Syntax
yading@10 4080
yading@10 4081
yading@10 4082 The description of the accepted parameters follows.
yading@10 4083
yading@10 4084
yading@10 4085 =over 4
yading@10 4086
yading@10 4087
yading@10 4088
yading@10 4089 =item B<box>
yading@10 4090
yading@10 4091 Used to draw a box around text using background color.
yading@10 4092 Value should be either 1 (enable) or 0 (disable).
yading@10 4093 The default value of I<box> is 0.
yading@10 4094
yading@10 4095
yading@10 4096 =item B<boxcolor>
yading@10 4097
yading@10 4098 The color to be used for drawing box around text.
yading@10 4099 Either a string (e.g. "yellow") or in 0xRRGGBB[AA] format
yading@10 4100 (e.g. "0xff00ff"), possibly followed by an alpha specifier.
yading@10 4101 The default value of I<boxcolor> is "white".
yading@10 4102
yading@10 4103
yading@10 4104 =item B<draw>
yading@10 4105
yading@10 4106 Set an expression which specifies if the text should be drawn. If the
yading@10 4107 expression evaluates to 0, the text is not drawn. This is useful for
yading@10 4108 specifying that the text should be drawn only when specific conditions
yading@10 4109 are met.
yading@10 4110
yading@10 4111 Default value is "1".
yading@10 4112
yading@10 4113 See below for the list of accepted constants and functions.
yading@10 4114
yading@10 4115
yading@10 4116 =item B<expansion>
yading@10 4117
yading@10 4118 Select how the I<text> is expanded. Can be either C<none>,
yading@10 4119 C<strftime> (deprecated) or
yading@10 4120 C<normal> (default). See the drawtext_expansion, Text expansion section
yading@10 4121 below for details.
yading@10 4122
yading@10 4123
yading@10 4124 =item B<fix_bounds>
yading@10 4125
yading@10 4126 If true, check and fix text coords to avoid clipping.
yading@10 4127
yading@10 4128
yading@10 4129 =item B<fontcolor>
yading@10 4130
yading@10 4131 The color to be used for drawing fonts.
yading@10 4132 Either a string (e.g. "red") or in 0xRRGGBB[AA] format
yading@10 4133 (e.g. "0xff000033"), possibly followed by an alpha specifier.
yading@10 4134 The default value of I<fontcolor> is "black".
yading@10 4135
yading@10 4136
yading@10 4137 =item B<fontfile>
yading@10 4138
yading@10 4139 The font file to be used for drawing text. Path must be included.
yading@10 4140 This parameter is mandatory.
yading@10 4141
yading@10 4142
yading@10 4143 =item B<fontsize>
yading@10 4144
yading@10 4145 The font size to be used for drawing text.
yading@10 4146 The default value of I<fontsize> is 16.
yading@10 4147
yading@10 4148
yading@10 4149 =item B<ft_load_flags>
yading@10 4150
yading@10 4151 Flags to be used for loading the fonts.
yading@10 4152
yading@10 4153 The flags map the corresponding flags supported by libfreetype, and are
yading@10 4154 a combination of the following values:
yading@10 4155
yading@10 4156 =over 4
yading@10 4157
yading@10 4158
yading@10 4159 =item I<default>
yading@10 4160
yading@10 4161
yading@10 4162 =item I<no_scale>
yading@10 4163
yading@10 4164
yading@10 4165 =item I<no_hinting>
yading@10 4166
yading@10 4167
yading@10 4168 =item I<render>
yading@10 4169
yading@10 4170
yading@10 4171 =item I<no_bitmap>
yading@10 4172
yading@10 4173
yading@10 4174 =item I<vertical_layout>
yading@10 4175
yading@10 4176
yading@10 4177 =item I<force_autohint>
yading@10 4178
yading@10 4179
yading@10 4180 =item I<crop_bitmap>
yading@10 4181
yading@10 4182
yading@10 4183 =item I<pedantic>
yading@10 4184
yading@10 4185
yading@10 4186 =item I<ignore_global_advance_width>
yading@10 4187
yading@10 4188
yading@10 4189 =item I<no_recurse>
yading@10 4190
yading@10 4191
yading@10 4192 =item I<ignore_transform>
yading@10 4193
yading@10 4194
yading@10 4195 =item I<monochrome>
yading@10 4196
yading@10 4197
yading@10 4198 =item I<linear_design>
yading@10 4199
yading@10 4200
yading@10 4201 =item I<no_autohint>
yading@10 4202
yading@10 4203
yading@10 4204 =item I<end table>
yading@10 4205
yading@10 4206
yading@10 4207 =back
yading@10 4208
yading@10 4209
yading@10 4210 Default value is "render".
yading@10 4211
yading@10 4212 For more information consult the documentation for the FT_LOAD_*
yading@10 4213 libfreetype flags.
yading@10 4214
yading@10 4215
yading@10 4216 =item B<shadowcolor>
yading@10 4217
yading@10 4218 The color to be used for drawing a shadow behind the drawn text. It
yading@10 4219 can be a color name (e.g. "yellow") or a string in the 0xRRGGBB[AA]
yading@10 4220 form (e.g. "0xff00ff"), possibly followed by an alpha specifier.
yading@10 4221 The default value of I<shadowcolor> is "black".
yading@10 4222
yading@10 4223
yading@10 4224 =item B<shadowx, shadowy>
yading@10 4225
yading@10 4226 The x and y offsets for the text shadow position with respect to the
yading@10 4227 position of the text. They can be either positive or negative
yading@10 4228 values. Default value for both is "0".
yading@10 4229
yading@10 4230
yading@10 4231 =item B<tabsize>
yading@10 4232
yading@10 4233 The size in number of spaces to use for rendering the tab.
yading@10 4234 Default value is 4.
yading@10 4235
yading@10 4236
yading@10 4237 =item B<timecode>
yading@10 4238
yading@10 4239 Set the initial timecode representation in "hh:mm:ss[:;.]ff"
yading@10 4240 format. It can be used with or without text parameter. I<timecode_rate>
yading@10 4241 option must be specified.
yading@10 4242
yading@10 4243
yading@10 4244 =item B<timecode_rate, rate, r>
yading@10 4245
yading@10 4246 Set the timecode frame rate (timecode only).
yading@10 4247
yading@10 4248
yading@10 4249 =item B<text>
yading@10 4250
yading@10 4251 The text string to be drawn. The text must be a sequence of UTF-8
yading@10 4252 encoded characters.
yading@10 4253 This parameter is mandatory if no file is specified with the parameter
yading@10 4254 I<textfile>.
yading@10 4255
yading@10 4256
yading@10 4257 =item B<textfile>
yading@10 4258
yading@10 4259 A text file containing text to be drawn. The text must be a sequence
yading@10 4260 of UTF-8 encoded characters.
yading@10 4261
yading@10 4262 This parameter is mandatory if no text string is specified with the
yading@10 4263 parameter I<text>.
yading@10 4264
yading@10 4265 If both I<text> and I<textfile> are specified, an error is thrown.
yading@10 4266
yading@10 4267
yading@10 4268 =item B<reload>
yading@10 4269
yading@10 4270 If set to 1, the I<textfile> will be reloaded before each frame.
yading@10 4271 Be sure to update it atomically, or it may be read partially, or even fail.
yading@10 4272
yading@10 4273
yading@10 4274 =item B<x, y>
yading@10 4275
yading@10 4276 The expressions which specify the offsets where text will be drawn
yading@10 4277 within the video frame. They are relative to the top/left border of the
yading@10 4278 output image.
yading@10 4279
yading@10 4280 The default value of I<x> and I<y> is "0".
yading@10 4281
yading@10 4282 See below for the list of accepted constants and functions.
yading@10 4283
yading@10 4284 =back
yading@10 4285
yading@10 4286
yading@10 4287 The parameters for I<x> and I<y> are expressions containing the
yading@10 4288 following constants and functions:
yading@10 4289
yading@10 4290
yading@10 4291 =over 4
yading@10 4292
yading@10 4293
yading@10 4294 =item B<dar>
yading@10 4295
yading@10 4296 input display aspect ratio, it is the same as (I<w> / I<h>) * I<sar>
yading@10 4297
yading@10 4298
yading@10 4299 =item B<hsub, vsub>
yading@10 4300
yading@10 4301 horizontal and vertical chroma subsample values. For example for the
yading@10 4302 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 4303
yading@10 4304
yading@10 4305 =item B<line_h, lh>
yading@10 4306
yading@10 4307 the height of each text line
yading@10 4308
yading@10 4309
yading@10 4310 =item B<main_h, h, H>
yading@10 4311
yading@10 4312 the input height
yading@10 4313
yading@10 4314
yading@10 4315 =item B<main_w, w, W>
yading@10 4316
yading@10 4317 the input width
yading@10 4318
yading@10 4319
yading@10 4320 =item B<max_glyph_a, ascent>
yading@10 4321
yading@10 4322 the maximum distance from the baseline to the highest/upper grid
yading@10 4323 coordinate used to place a glyph outline point, for all the rendered
yading@10 4324 glyphs.
yading@10 4325 It is a positive value, due to the grid's orientation with the Y axis
yading@10 4326 upwards.
yading@10 4327
yading@10 4328
yading@10 4329 =item B<max_glyph_d, descent>
yading@10 4330
yading@10 4331 the maximum distance from the baseline to the lowest grid coordinate
yading@10 4332 used to place a glyph outline point, for all the rendered glyphs.
yading@10 4333 This is a negative value, due to the grid's orientation, with the Y axis
yading@10 4334 upwards.
yading@10 4335
yading@10 4336
yading@10 4337 =item B<max_glyph_h>
yading@10 4338
yading@10 4339 maximum glyph height, that is the maximum height for all the glyphs
yading@10 4340 contained in the rendered text, it is equivalent to I<ascent> -
yading@10 4341 I<descent>.
yading@10 4342
yading@10 4343
yading@10 4344 =item B<max_glyph_w>
yading@10 4345
yading@10 4346 maximum glyph width, that is the maximum width for all the glyphs
yading@10 4347 contained in the rendered text
yading@10 4348
yading@10 4349
yading@10 4350 =item B<n>
yading@10 4351
yading@10 4352 the number of input frame, starting from 0
yading@10 4353
yading@10 4354
yading@10 4355 =item B<rand(min, max)>
yading@10 4356
yading@10 4357 return a random number included between I<min> and I<max>
yading@10 4358
yading@10 4359
yading@10 4360 =item B<sar>
yading@10 4361
yading@10 4362 input sample aspect ratio
yading@10 4363
yading@10 4364
yading@10 4365 =item B<t>
yading@10 4366
yading@10 4367 timestamp expressed in seconds, NAN if the input timestamp is unknown
yading@10 4368
yading@10 4369
yading@10 4370 =item B<text_h, th>
yading@10 4371
yading@10 4372 the height of the rendered text
yading@10 4373
yading@10 4374
yading@10 4375 =item B<text_w, tw>
yading@10 4376
yading@10 4377 the width of the rendered text
yading@10 4378
yading@10 4379
yading@10 4380 =item B<x, y>
yading@10 4381
yading@10 4382 the x and y offset coordinates where the text is drawn.
yading@10 4383
yading@10 4384 These parameters allow the I<x> and I<y> expressions to refer
yading@10 4385 each other, so you can for example specify C<y=x/dar>.
yading@10 4386
yading@10 4387 =back
yading@10 4388
yading@10 4389
yading@10 4390 If libavfilter was built with C<--enable-fontconfig>, then
yading@10 4391 B<fontfile> can be a fontconfig pattern or omitted.
yading@10 4392
yading@10 4393
yading@10 4394
yading@10 4395 =head3 Text expansion
yading@10 4396
yading@10 4397
yading@10 4398 If B<expansion> is set to C<strftime>,
yading@10 4399 the filter recognizes strftime() sequences in the provided text and
yading@10 4400 expands them accordingly. Check the documentation of strftime(). This
yading@10 4401 feature is deprecated.
yading@10 4402
yading@10 4403 If B<expansion> is set to C<none>, the text is printed verbatim.
yading@10 4404
yading@10 4405 If B<expansion> is set to C<normal> (which is the default),
yading@10 4406 the following expansion mechanism is used.
yading@10 4407
yading@10 4408 The backslash character '\', followed by any character, always expands to
yading@10 4409 the second character.
yading@10 4410
yading@10 4411 Sequence of the form C<%{...}> are expanded. The text between the
yading@10 4412 braces is a function name, possibly followed by arguments separated by ':'.
yading@10 4413 If the arguments contain special characters or delimiters (':' or '}'),
yading@10 4414 they should be escaped.
yading@10 4415
yading@10 4416 Note that they probably must also be escaped as the value for the
yading@10 4417 B<text> option in the filter argument string and as the filter
yading@10 4418 argument in the filtergraph description, and possibly also for the shell,
yading@10 4419 that makes up to four levels of escaping; using a text file avoids these
yading@10 4420 problems.
yading@10 4421
yading@10 4422 The following functions are available:
yading@10 4423
yading@10 4424
yading@10 4425 =over 4
yading@10 4426
yading@10 4427
yading@10 4428
yading@10 4429 =item B<expr, e>
yading@10 4430
yading@10 4431 The expression evaluation result.
yading@10 4432
yading@10 4433 It must take one argument specifying the expression to be evaluated,
yading@10 4434 which accepts the same constants and functions as the I<x> and
yading@10 4435 I<y> values. Note that not all constants should be used, for
yading@10 4436 example the text size is not known when evaluating the expression, so
yading@10 4437 the constants I<text_w> and I<text_h> will have an undefined
yading@10 4438 value.
yading@10 4439
yading@10 4440
yading@10 4441 =item B<gmtime>
yading@10 4442
yading@10 4443 The time at which the filter is running, expressed in UTC.
yading@10 4444 It can accept an argument: a strftime() format string.
yading@10 4445
yading@10 4446
yading@10 4447 =item B<localtime>
yading@10 4448
yading@10 4449 The time at which the filter is running, expressed in the local time zone.
yading@10 4450 It can accept an argument: a strftime() format string.
yading@10 4451
yading@10 4452
yading@10 4453 =item B<n, frame_num>
yading@10 4454
yading@10 4455 The frame number, starting from 0.
yading@10 4456
yading@10 4457
yading@10 4458 =item B<pts>
yading@10 4459
yading@10 4460 The timestamp of the current frame, in seconds, with microsecond accuracy.
yading@10 4461
yading@10 4462
yading@10 4463 =back
yading@10 4464
yading@10 4465
yading@10 4466
yading@10 4467 =head3 Examples
yading@10 4468
yading@10 4469
yading@10 4470
yading@10 4471 =over 4
yading@10 4472
yading@10 4473
yading@10 4474 =item *
yading@10 4475
yading@10 4476 Draw "Test Text" with font FreeSerif, using the default values for the
yading@10 4477 optional parameters.
yading@10 4478
yading@10 4479
yading@10 4480 drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
yading@10 4481
yading@10 4482
yading@10 4483
yading@10 4484 =item *
yading@10 4485
yading@10 4486 Draw 'Test Text' with font FreeSerif of size 24 at position x=100
yading@10 4487 and y=50 (counting from the top-left corner of the screen), text is
yading@10 4488 yellow with a red box around it. Both the text and the box have an
yading@10 4489 opacity of 20%.
yading@10 4490
yading@10 4491
yading@10 4492 drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
yading@10 4493 x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2"
yading@10 4494
yading@10 4495
yading@10 4496 Note that the double quotes are not necessary if spaces are not used
yading@10 4497 within the parameter list.
yading@10 4498
yading@10 4499
yading@10 4500 =item *
yading@10 4501
yading@10 4502 Show the text at the center of the video frame:
yading@10 4503
yading@10 4504 drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h-line_h)/2"
yading@10 4505
yading@10 4506
yading@10 4507
yading@10 4508 =item *
yading@10 4509
yading@10 4510 Show a text line sliding from right to left in the last row of the video
yading@10 4511 frame. The file F<LONG_LINE> is assumed to contain a single line
yading@10 4512 with no newlines.
yading@10 4513
yading@10 4514 drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t"
yading@10 4515
yading@10 4516
yading@10 4517
yading@10 4518 =item *
yading@10 4519
yading@10 4520 Show the content of file F<CREDITS> off the bottom of the frame and scroll up.
yading@10 4521
yading@10 4522 drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t"
yading@10 4523
yading@10 4524
yading@10 4525
yading@10 4526 =item *
yading@10 4527
yading@10 4528 Draw a single green letter "g", at the center of the input video.
yading@10 4529 The glyph baseline is placed at half screen height.
yading@10 4530
yading@10 4531 drawtext="fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent"
yading@10 4532
yading@10 4533
yading@10 4534
yading@10 4535 =item *
yading@10 4536
yading@10 4537 Show text for 1 second every 3 seconds:
yading@10 4538
yading@10 4539 drawtext="fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:draw=lt(mod(t\,3)\,1):text='blink'"
yading@10 4540
yading@10 4541
yading@10 4542
yading@10 4543 =item *
yading@10 4544
yading@10 4545 Use fontconfig to set the font. Note that the colons need to be escaped.
yading@10 4546
yading@10 4547 drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
yading@10 4548
yading@10 4549
yading@10 4550
yading@10 4551 =item *
yading@10 4552
yading@10 4553 Print the date of a real-time encoding (see strftime(3)):
yading@10 4554
yading@10 4555 drawtext='fontfile=FreeSans.ttf:text=%{localtime:%a %b %d %Y}'
yading@10 4556
yading@10 4557
yading@10 4558
yading@10 4559 =back
yading@10 4560
yading@10 4561
yading@10 4562 For more information about libfreetype, check:
yading@10 4563 E<lt>B<http://www.freetype.org/>E<gt>.
yading@10 4564
yading@10 4565 For more information about fontconfig, check:
yading@10 4566 E<lt>B<http://freedesktop.org/software/fontconfig/fontconfig-user.html>E<gt>.
yading@10 4567
yading@10 4568
yading@10 4569 =head2 edgedetect
yading@10 4570
yading@10 4571
yading@10 4572 Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
yading@10 4573
yading@10 4574 The filter accepts the following options:
yading@10 4575
yading@10 4576
yading@10 4577 =over 4
yading@10 4578
yading@10 4579
yading@10 4580 =item B<low, high>
yading@10 4581
yading@10 4582 Set low and high threshold values used by the Canny thresholding
yading@10 4583 algorithm.
yading@10 4584
yading@10 4585 The high threshold selects the "strong" edge pixels, which are then
yading@10 4586 connected through 8-connectivity with the "weak" edge pixels selected
yading@10 4587 by the low threshold.
yading@10 4588
yading@10 4589 I<low> and I<high> threshold values must be choosen in the range
yading@10 4590 [0,1], and I<low> should be lesser or equal to I<high>.
yading@10 4591
yading@10 4592 Default value for I<low> is C<20/255>, and default value for I<high>
yading@10 4593 is C<50/255>.
yading@10 4594
yading@10 4595 =back
yading@10 4596
yading@10 4597
yading@10 4598 Example:
yading@10 4599
yading@10 4600 edgedetect=low=0.1:high=0.4
yading@10 4601
yading@10 4602
yading@10 4603
yading@10 4604 =head2 fade
yading@10 4605
yading@10 4606
yading@10 4607 Apply fade-in/out effect to input video.
yading@10 4608
yading@10 4609 This filter accepts the following options:
yading@10 4610
yading@10 4611
yading@10 4612 =over 4
yading@10 4613
yading@10 4614
yading@10 4615 =item B<type, t>
yading@10 4616
yading@10 4617 The effect type -- can be either "in" for fade-in, or "out" for a fade-out
yading@10 4618 effect.
yading@10 4619 Default is C<in>.
yading@10 4620
yading@10 4621
yading@10 4622 =item B<start_frame, s>
yading@10 4623
yading@10 4624 Specify the number of the start frame for starting to apply the fade
yading@10 4625 effect. Default is 0.
yading@10 4626
yading@10 4627
yading@10 4628 =item B<nb_frames, n>
yading@10 4629
yading@10 4630 The number of frames for which the fade effect has to last. At the end of the
yading@10 4631 fade-in effect the output video will have the same intensity as the input video,
yading@10 4632 at the end of the fade-out transition the output video will be completely black.
yading@10 4633 Default is 25.
yading@10 4634
yading@10 4635
yading@10 4636 =item B<alpha>
yading@10 4637
yading@10 4638 If set to 1, fade only alpha channel, if one exists on the input.
yading@10 4639 Default value is 0.
yading@10 4640
yading@10 4641 =back
yading@10 4642
yading@10 4643
yading@10 4644
yading@10 4645 =head3 Examples
yading@10 4646
yading@10 4647
yading@10 4648
yading@10 4649 =over 4
yading@10 4650
yading@10 4651
yading@10 4652 =item *
yading@10 4653
yading@10 4654 Fade in first 30 frames of video:
yading@10 4655
yading@10 4656 fade=in:0:30
yading@10 4657
yading@10 4658
yading@10 4659 The command above is equivalent to:
yading@10 4660
yading@10 4661 fade=t=in:s=0:n=30
yading@10 4662
yading@10 4663
yading@10 4664
yading@10 4665 =item *
yading@10 4666
yading@10 4667 Fade out last 45 frames of a 200-frame video:
yading@10 4668
yading@10 4669 fade=out:155:45
yading@10 4670 fade=type=out:start_frame=155:nb_frames=45
yading@10 4671
yading@10 4672
yading@10 4673
yading@10 4674 =item *
yading@10 4675
yading@10 4676 Fade in first 25 frames and fade out last 25 frames of a 1000-frame video:
yading@10 4677
yading@10 4678 fade=in:0:25, fade=out:975:25
yading@10 4679
yading@10 4680
yading@10 4681
yading@10 4682 =item *
yading@10 4683
yading@10 4684 Make first 5 frames black, then fade in from frame 5-24:
yading@10 4685
yading@10 4686 fade=in:5:20
yading@10 4687
yading@10 4688
yading@10 4689
yading@10 4690 =item *
yading@10 4691
yading@10 4692 Fade in alpha over first 25 frames of video:
yading@10 4693
yading@10 4694 fade=in:0:25:alpha=1
yading@10 4695
yading@10 4696
yading@10 4697 =back
yading@10 4698
yading@10 4699
yading@10 4700
yading@10 4701 =head2 field
yading@10 4702
yading@10 4703
yading@10 4704 Extract a single field from an interlaced image using stride
yading@10 4705 arithmetic to avoid wasting CPU time. The output frames are marked as
yading@10 4706 non-interlaced.
yading@10 4707
yading@10 4708 The filter accepts the following options:
yading@10 4709
yading@10 4710
yading@10 4711 =over 4
yading@10 4712
yading@10 4713
yading@10 4714 =item B<type>
yading@10 4715
yading@10 4716 Specify whether to extract the top (if the value is C<0> or
yading@10 4717 C<top>) or the bottom field (if the value is C<1> or
yading@10 4718 C<bottom>).
yading@10 4719
yading@10 4720 =back
yading@10 4721
yading@10 4722
yading@10 4723
yading@10 4724 =head2 fieldmatch
yading@10 4725
yading@10 4726
yading@10 4727 Field matching filter for inverse telecine. It is meant to reconstruct the
yading@10 4728 progressive frames from a telecined stream. The filter does not drop duplicated
yading@10 4729 frames, so to achieve a complete inverse telecine C<fieldmatch> needs to be
yading@10 4730 followed by a decimation filter such as decimate in the filtergraph.
yading@10 4731
yading@10 4732 The separation of the field matching and the decimation is notably motivated by
yading@10 4733 the possibility of inserting a de-interlacing filter fallback between the two.
yading@10 4734 If the source has mixed telecined and real interlaced content,
yading@10 4735 C<fieldmatch> will not be able to match fields for the interlaced parts.
yading@10 4736 But these remaining combed frames will be marked as interlaced, and thus can be
yading@10 4737 de-interlaced by a later filter such as yadif before decimation.
yading@10 4738
yading@10 4739 In addition to the various configuration options, C<fieldmatch> can take an
yading@10 4740 optional second stream, activated through the B<ppsrc> option. If
yading@10 4741 enabled, the frames reconstruction will be based on the fields and frames from
yading@10 4742 this second stream. This allows the first input to be pre-processed in order to
yading@10 4743 help the various algorithms of the filter, while keeping the output lossless
yading@10 4744 (assuming the fields are matched properly). Typically, a field-aware denoiser,
yading@10 4745 or brightness/contrast adjustments can help.
yading@10 4746
yading@10 4747 Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
yading@10 4748 and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
yading@10 4749 which C<fieldmatch> is based on. While the semantic and usage are very
yading@10 4750 close, some behaviour and options names can differ.
yading@10 4751
yading@10 4752 The filter accepts the following options:
yading@10 4753
yading@10 4754
yading@10 4755 =over 4
yading@10 4756
yading@10 4757
yading@10 4758 =item B<order>
yading@10 4759
yading@10 4760 Specify the assumed field order of the input stream. Available values are:
yading@10 4761
yading@10 4762
yading@10 4763 =over 4
yading@10 4764
yading@10 4765
yading@10 4766 =item B<auto>
yading@10 4767
yading@10 4768 Auto detect parity (use FFmpeg's internal parity value).
yading@10 4769
yading@10 4770 =item B<bff>
yading@10 4771
yading@10 4772 Assume bottom field first.
yading@10 4773
yading@10 4774 =item B<tff>
yading@10 4775
yading@10 4776 Assume top field first.
yading@10 4777
yading@10 4778 =back
yading@10 4779
yading@10 4780
yading@10 4781 Note that it is sometimes recommended not to trust the parity announced by the
yading@10 4782 stream.
yading@10 4783
yading@10 4784 Default value is I<auto>.
yading@10 4785
yading@10 4786
yading@10 4787 =item B<mode>
yading@10 4788
yading@10 4789 Set the matching mode or strategy to use. B<pc> mode is the safest in the
yading@10 4790 sense that it wont risk creating jerkiness due to duplicate frames when
yading@10 4791 possible, but if there are bad edits or blended fields it will end up
yading@10 4792 outputting combed frames when a good match might actually exist. On the other
yading@10 4793 hand, B<pcn_ub> mode is the most risky in terms of creating jerkiness,
yading@10 4794 but will almost always find a good frame if there is one. The other values are
yading@10 4795 all somewhere in between B<pc> and B<pcn_ub> in terms of risking
yading@10 4796 jerkiness and creating duplicate frames versus finding good matches in sections
yading@10 4797 with bad edits, orphaned fields, blended fields, etc.
yading@10 4798
yading@10 4799 More details about p/c/n/u/b are available in p/c/n/u/b meaning section.
yading@10 4800
yading@10 4801 Available values are:
yading@10 4802
yading@10 4803
yading@10 4804 =over 4
yading@10 4805
yading@10 4806
yading@10 4807 =item B<pc>
yading@10 4808
yading@10 4809 2-way matching (p/c)
yading@10 4810
yading@10 4811 =item B<pc_n>
yading@10 4812
yading@10 4813 2-way matching, and trying 3rd match if still combed (p/c + n)
yading@10 4814
yading@10 4815 =item B<pc_u>
yading@10 4816
yading@10 4817 2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
yading@10 4818
yading@10 4819 =item B<pc_n_ub>
yading@10 4820
yading@10 4821 2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
yading@10 4822 still combed (p/c + n + u/b)
yading@10 4823
yading@10 4824 =item B<pcn>
yading@10 4825
yading@10 4826 3-way matching (p/c/n)
yading@10 4827
yading@10 4828 =item B<pcn_ub>
yading@10 4829
yading@10 4830 3-way matching, and trying 4th/5th matches if all 3 of the original matches are
yading@10 4831 detected as combed (p/c/n + u/b)
yading@10 4832
yading@10 4833 =back
yading@10 4834
yading@10 4835
yading@10 4836 The parenthesis at the end indicate the matches that would be used for that
yading@10 4837 mode assuming B<order>=I<tff> (and B<field> on I<auto> or
yading@10 4838 I<top>).
yading@10 4839
yading@10 4840 In terms of speed B<pc> mode is by far the fastest and B<pcn_ub> is
yading@10 4841 the slowest.
yading@10 4842
yading@10 4843 Default value is I<pc_n>.
yading@10 4844
yading@10 4845
yading@10 4846 =item B<ppsrc>
yading@10 4847
yading@10 4848 Mark the main input stream as a pre-processed input, and enable the secondary
yading@10 4849 input stream as the clean source to pick the fields from. See the filter
yading@10 4850 introduction for more details. It is similar to the B<clip2> feature from
yading@10 4851 VFM/TFM.
yading@10 4852
yading@10 4853 Default value is C<0> (disabled).
yading@10 4854
yading@10 4855
yading@10 4856 =item B<field>
yading@10 4857
yading@10 4858 Set the field to match from. It is recommended to set this to the same value as
yading@10 4859 B<order> unless you experience matching failures with that setting. In
yading@10 4860 certain circumstances changing the field that is used to match from can have a
yading@10 4861 large impact on matching performance. Available values are:
yading@10 4862
yading@10 4863
yading@10 4864 =over 4
yading@10 4865
yading@10 4866
yading@10 4867 =item B<auto>
yading@10 4868
yading@10 4869 Automatic (same value as B<order>).
yading@10 4870
yading@10 4871 =item B<bottom>
yading@10 4872
yading@10 4873 Match from the bottom field.
yading@10 4874
yading@10 4875 =item B<top>
yading@10 4876
yading@10 4877 Match from the top field.
yading@10 4878
yading@10 4879 =back
yading@10 4880
yading@10 4881
yading@10 4882 Default value is I<auto>.
yading@10 4883
yading@10 4884
yading@10 4885 =item B<mchroma>
yading@10 4886
yading@10 4887 Set whether or not chroma is included during the match comparisons. In most
yading@10 4888 cases it is recommended to leave this enabled. You should set this to C<0>
yading@10 4889 only if your clip has bad chroma problems such as heavy rainbowing or other
yading@10 4890 artifacts. Setting this to C<0> could also be used to speed things up at
yading@10 4891 the cost of some accuracy.
yading@10 4892
yading@10 4893 Default value is C<1>.
yading@10 4894
yading@10 4895
yading@10 4896 =item B<y0>
yading@10 4897
yading@10 4898
yading@10 4899 =item B<y1>
yading@10 4900
yading@10 4901 These define an exclusion band which excludes the lines between B<y0> and
yading@10 4902 B<y1> from being included in the field matching decision. An exclusion
yading@10 4903 band can be used to ignore subtitles, a logo, or other things that may
yading@10 4904 interfere with the matching. B<y0> sets the starting scan line and
yading@10 4905 B<y1> sets the ending line; all lines in between B<y0> and
yading@10 4906 B<y1> (including B<y0> and B<y1>) will be ignored. Setting
yading@10 4907 B<y0> and B<y1> to the same value will disable the feature.
yading@10 4908 B<y0> and B<y1> defaults to C<0>.
yading@10 4909
yading@10 4910
yading@10 4911 =item B<scthresh>
yading@10 4912
yading@10 4913 Set the scene change detection threshold as a percentage of maximum change on
yading@10 4914 the luma plane. Good values are in the C<[8.0, 14.0]> range. Scene change
yading@10 4915 detection is only relevant in case B<combmatch>=I<sc>. The range for
yading@10 4916 B<scthresh> is C<[0.0, 100.0]>.
yading@10 4917
yading@10 4918 Default value is C<12.0>.
yading@10 4919
yading@10 4920
yading@10 4921 =item B<combmatch>
yading@10 4922
yading@10 4923 When B<combatch> is not I<none>, C<fieldmatch> will take into
yading@10 4924 account the combed scores of matches when deciding what match to use as the
yading@10 4925 final match. Available values are:
yading@10 4926
yading@10 4927
yading@10 4928 =over 4
yading@10 4929
yading@10 4930
yading@10 4931 =item B<none>
yading@10 4932
yading@10 4933 No final matching based on combed scores.
yading@10 4934
yading@10 4935 =item B<sc>
yading@10 4936
yading@10 4937 Combed scores are only used when a scene change is detected.
yading@10 4938
yading@10 4939 =item B<full>
yading@10 4940
yading@10 4941 Use combed scores all the time.
yading@10 4942
yading@10 4943 =back
yading@10 4944
yading@10 4945
yading@10 4946 Default is I<sc>.
yading@10 4947
yading@10 4948
yading@10 4949 =item B<combdbg>
yading@10 4950
yading@10 4951 Force C<fieldmatch> to calculate the combed metrics for certain matches and
yading@10 4952 print them. This setting is known as B<micout> in TFM/VFM vocabulary.
yading@10 4953 Available values are:
yading@10 4954
yading@10 4955
yading@10 4956 =over 4
yading@10 4957
yading@10 4958
yading@10 4959 =item B<none>
yading@10 4960
yading@10 4961 No forced calculation.
yading@10 4962
yading@10 4963 =item B<pcn>
yading@10 4964
yading@10 4965 Force p/c/n calculations.
yading@10 4966
yading@10 4967 =item B<pcnub>
yading@10 4968
yading@10 4969 Force p/c/n/u/b calculations.
yading@10 4970
yading@10 4971 =back
yading@10 4972
yading@10 4973
yading@10 4974 Default value is I<none>.
yading@10 4975
yading@10 4976
yading@10 4977 =item B<cthresh>
yading@10 4978
yading@10 4979 This is the area combing threshold used for combed frame detection. This
yading@10 4980 essentially controls how "strong" or "visible" combing must be to be detected.
yading@10 4981 Larger values mean combing must be more visible and smaller values mean combing
yading@10 4982 can be less visible or strong and still be detected. Valid settings are from
yading@10 4983 C<-1> (every pixel will be detected as combed) to C<255> (no pixel will
yading@10 4984 be detected as combed). This is basically a pixel difference value. A good
yading@10 4985 range is C<[8, 12]>.
yading@10 4986
yading@10 4987 Default value is C<9>.
yading@10 4988
yading@10 4989
yading@10 4990 =item B<chroma>
yading@10 4991
yading@10 4992 Sets whether or not chroma is considered in the combed frame decision. Only
yading@10 4993 disable this if your source has chroma problems (rainbowing, etc.) that are
yading@10 4994 causing problems for the combed frame detection with chroma enabled. Actually,
yading@10 4995 using B<chroma>=I<0> is usually more reliable, except for the case
yading@10 4996 where there is chroma only combing in the source.
yading@10 4997
yading@10 4998 Default value is C<0>.
yading@10 4999
yading@10 5000
yading@10 5001 =item B<blockx>
yading@10 5002
yading@10 5003
yading@10 5004 =item B<blocky>
yading@10 5005
yading@10 5006 Respectively set the x-axis and y-axis size of the window used during combed
yading@10 5007 frame detection. This has to do with the size of the area in which
yading@10 5008 B<combpel> pixels are required to be detected as combed for a frame to be
yading@10 5009 declared combed. See the B<combpel> parameter description for more info.
yading@10 5010 Possible values are any number that is a power of 2 starting at 4 and going up
yading@10 5011 to 512.
yading@10 5012
yading@10 5013 Default value is C<16>.
yading@10 5014
yading@10 5015
yading@10 5016 =item B<combpel>
yading@10 5017
yading@10 5018 The number of combed pixels inside any of the B<blocky> by
yading@10 5019 B<blockx> size blocks on the frame for the frame to be detected as
yading@10 5020 combed. While B<cthresh> controls how "visible" the combing must be, this
yading@10 5021 setting controls "how much" combing there must be in any localized area (a
yading@10 5022 window defined by the B<blockx> and B<blocky> settings) on the
yading@10 5023 frame. Minimum value is C<0> and maximum is C<blocky x blockx> (at
yading@10 5024 which point no frames will ever be detected as combed). This setting is known
yading@10 5025 as B<MI> in TFM/VFM vocabulary.
yading@10 5026
yading@10 5027 Default value is C<80>.
yading@10 5028
yading@10 5029 =back
yading@10 5030
yading@10 5031
yading@10 5032
yading@10 5033
yading@10 5034 =head3 p/c/n/u/b meaning
yading@10 5035
yading@10 5036
yading@10 5037
yading@10 5038 =head4 p/c/n
yading@10 5039
yading@10 5040
yading@10 5041 We assume the following telecined stream:
yading@10 5042
yading@10 5043
yading@10 5044 Top fields: 1 2 2 3 4
yading@10 5045 Bottom fields: 1 2 3 4 4
yading@10 5046
yading@10 5047
yading@10 5048 The numbers correspond to the progressive frame the fields relate to. Here, the
yading@10 5049 first two frames are progressive, the 3rd and 4th are combed, and so on.
yading@10 5050
yading@10 5051 When C<fieldmatch> is configured to run a matching from bottom
yading@10 5052 (B<field>=I<bottom>) this is how this input stream get transformed:
yading@10 5053
yading@10 5054
yading@10 5055 Input stream:
yading@10 5056 T 1 2 2 3 4
yading@10 5057 B 1 2 3 4 4 <-- matching reference
yading@10 5058
yading@10 5059 Matches: c c n n c
yading@10 5060
yading@10 5061 Output stream:
yading@10 5062 T 1 2 3 4 4
yading@10 5063 B 1 2 3 4 4
yading@10 5064
yading@10 5065
yading@10 5066 As a result of the field matching, we can see that some frames get duplicated.
yading@10 5067 To perform a complete inverse telecine, you need to rely on a decimation filter
yading@10 5068 after this operation. See for instance the decimate filter.
yading@10 5069
yading@10 5070 The same operation now matching from top fields (B<field>=I<top>)
yading@10 5071 looks like this:
yading@10 5072
yading@10 5073
yading@10 5074 Input stream:
yading@10 5075 T 1 2 2 3 4 <-- matching reference
yading@10 5076 B 1 2 3 4 4
yading@10 5077
yading@10 5078 Matches: c c p p c
yading@10 5079
yading@10 5080 Output stream:
yading@10 5081 T 1 2 2 3 4
yading@10 5082 B 1 2 2 3 4
yading@10 5083
yading@10 5084
yading@10 5085 In these examples, we can see what I<p>, I<c> and I<n> mean;
yading@10 5086 basically, they refer to the frame and field of the opposite parity:
yading@10 5087
yading@10 5088
yading@10 5089 =over 4
yading@10 5090
yading@10 5091
yading@10 5092 =item *<I<p> matches the field of the opposite parity in the previous frame>
yading@10 5093
yading@10 5094
yading@10 5095 =item *<I<c> matches the field of the opposite parity in the current frame>
yading@10 5096
yading@10 5097
yading@10 5098 =item *<I<n> matches the field of the opposite parity in the next frame>
yading@10 5099
yading@10 5100
yading@10 5101 =back
yading@10 5102
yading@10 5103
yading@10 5104
yading@10 5105 =head4 u/b
yading@10 5106
yading@10 5107
yading@10 5108 The I<u> and I<b> matching are a bit special in the sense that they match
yading@10 5109 from the opposite parity flag. In the following examples, we assume that we are
yading@10 5110 currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
yading@10 5111 'x' is placed above and below each matched fields.
yading@10 5112
yading@10 5113 With bottom matching (B<field>=I<bottom>):
yading@10 5114
yading@10 5115 Match: c p n b u
yading@10 5116
yading@10 5117 x x x x x
yading@10 5118 Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
yading@10 5119 Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
yading@10 5120 x x x x x
yading@10 5121
yading@10 5122 Output frames:
yading@10 5123 2 1 2 2 2
yading@10 5124 2 2 2 1 3
yading@10 5125
yading@10 5126
yading@10 5127 With top matching (B<field>=I<top>):
yading@10 5128
yading@10 5129 Match: c p n b u
yading@10 5130
yading@10 5131 x x x x x
yading@10 5132 Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
yading@10 5133 Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
yading@10 5134 x x x x x
yading@10 5135
yading@10 5136 Output frames:
yading@10 5137 2 2 2 1 2
yading@10 5138 2 1 3 2 2
yading@10 5139
yading@10 5140
yading@10 5141
yading@10 5142 =head3 Examples
yading@10 5143
yading@10 5144
yading@10 5145 Simple IVTC of a top field first telecined stream:
yading@10 5146
yading@10 5147 fieldmatch=order=tff:combmatch=none, decimate
yading@10 5148
yading@10 5149
yading@10 5150 Advanced IVTC, with fallback on yadif for still combed frames:
yading@10 5151
yading@10 5152 fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
yading@10 5153
yading@10 5154
yading@10 5155
yading@10 5156 =head2 fieldorder
yading@10 5157
yading@10 5158
yading@10 5159 Transform the field order of the input video.
yading@10 5160
yading@10 5161 This filter accepts the following options:
yading@10 5162
yading@10 5163
yading@10 5164 =over 4
yading@10 5165
yading@10 5166
yading@10 5167
yading@10 5168 =item B<order>
yading@10 5169
yading@10 5170 Output field order. Valid values are I<tff> for top field first or I<bff>
yading@10 5171 for bottom field first.
yading@10 5172
yading@10 5173 =back
yading@10 5174
yading@10 5175
yading@10 5176 Default value is B<tff>.
yading@10 5177
yading@10 5178 Transformation is achieved by shifting the picture content up or down
yading@10 5179 by one line, and filling the remaining line with appropriate picture content.
yading@10 5180 This method is consistent with most broadcast field order converters.
yading@10 5181
yading@10 5182 If the input video is not flagged as being interlaced, or it is already
yading@10 5183 flagged as being of the required output field order then this filter does
yading@10 5184 not alter the incoming video.
yading@10 5185
yading@10 5186 This filter is very useful when converting to or from PAL DV material,
yading@10 5187 which is bottom field first.
yading@10 5188
yading@10 5189 For example:
yading@10 5190
yading@10 5191 ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
yading@10 5192
yading@10 5193
yading@10 5194
yading@10 5195 =head2 fifo
yading@10 5196
yading@10 5197
yading@10 5198 Buffer input images and send them when they are requested.
yading@10 5199
yading@10 5200 This filter is mainly useful when auto-inserted by the libavfilter
yading@10 5201 framework.
yading@10 5202
yading@10 5203 The filter does not take parameters.
yading@10 5204
yading@10 5205
yading@10 5206
yading@10 5207 =head2 format
yading@10 5208
yading@10 5209
yading@10 5210 Convert the input video to one of the specified pixel formats.
yading@10 5211 Libavfilter will try to pick one that is supported for the input to
yading@10 5212 the next filter.
yading@10 5213
yading@10 5214 This filter accepts the following parameters:
yading@10 5215
yading@10 5216 =over 4
yading@10 5217
yading@10 5218
yading@10 5219
yading@10 5220 =item B<pix_fmts>
yading@10 5221
yading@10 5222 A '|'-separated list of pixel format names, for example
yading@10 5223 "pix_fmts=yuv420p|monow|rgb24".
yading@10 5224
yading@10 5225
yading@10 5226 =back
yading@10 5227
yading@10 5228
yading@10 5229
yading@10 5230 =head3 Examples
yading@10 5231
yading@10 5232
yading@10 5233
yading@10 5234 =over 4
yading@10 5235
yading@10 5236
yading@10 5237 =item *
yading@10 5238
yading@10 5239 Convert the input video to the format I<yuv420p>
yading@10 5240
yading@10 5241 format=pix_fmts=yuv420p
yading@10 5242
yading@10 5243
yading@10 5244 Convert the input video to any of the formats in the list
yading@10 5245
yading@10 5246 format=pix_fmts=yuv420p|yuv444p|yuv410p
yading@10 5247
yading@10 5248
yading@10 5249 =back
yading@10 5250
yading@10 5251
yading@10 5252
yading@10 5253 =head2 fps
yading@10 5254
yading@10 5255
yading@10 5256 Convert the video to specified constant frame rate by duplicating or dropping
yading@10 5257 frames as necessary.
yading@10 5258
yading@10 5259 This filter accepts the following named parameters:
yading@10 5260
yading@10 5261 =over 4
yading@10 5262
yading@10 5263
yading@10 5264
yading@10 5265 =item B<fps>
yading@10 5266
yading@10 5267 Desired output frame rate. The default is C<25>.
yading@10 5268
yading@10 5269
yading@10 5270 =item B<round>
yading@10 5271
yading@10 5272 Rounding method.
yading@10 5273
yading@10 5274 Possible values are:
yading@10 5275
yading@10 5276 =over 4
yading@10 5277
yading@10 5278
yading@10 5279 =item B<zero>
yading@10 5280
yading@10 5281 zero round towards 0
yading@10 5282
yading@10 5283 =item B<inf>
yading@10 5284
yading@10 5285 round away from 0
yading@10 5286
yading@10 5287 =item B<down>
yading@10 5288
yading@10 5289 round towards -infinity
yading@10 5290
yading@10 5291 =item B<up>
yading@10 5292
yading@10 5293 round towards +infinity
yading@10 5294
yading@10 5295 =item B<near>
yading@10 5296
yading@10 5297 round to nearest
yading@10 5298
yading@10 5299 =back
yading@10 5300
yading@10 5301 The default is C<near>.
yading@10 5302
yading@10 5303
yading@10 5304 =back
yading@10 5305
yading@10 5306
yading@10 5307 Alternatively, the options can be specified as a flat string:
yading@10 5308 I<fps>[:I<round>].
yading@10 5309
yading@10 5310 See also the setpts filter.
yading@10 5311
yading@10 5312
yading@10 5313 =head2 framestep
yading@10 5314
yading@10 5315
yading@10 5316 Select one frame every N-th frame.
yading@10 5317
yading@10 5318 This filter accepts the following option:
yading@10 5319
yading@10 5320 =over 4
yading@10 5321
yading@10 5322
yading@10 5323 =item B<step>
yading@10 5324
yading@10 5325 Select frame after every C<step> frames.
yading@10 5326 Allowed values are positive integers higher than 0. Default value is C<1>.
yading@10 5327
yading@10 5328 =back
yading@10 5329
yading@10 5330
yading@10 5331
yading@10 5332
yading@10 5333 =head2 frei0r
yading@10 5334
yading@10 5335
yading@10 5336 Apply a frei0r effect to the input video.
yading@10 5337
yading@10 5338 To enable compilation of this filter you need to install the frei0r
yading@10 5339 header and configure FFmpeg with C<--enable-frei0r>.
yading@10 5340
yading@10 5341 This filter accepts the following options:
yading@10 5342
yading@10 5343
yading@10 5344 =over 4
yading@10 5345
yading@10 5346
yading@10 5347
yading@10 5348 =item B<filter_name>
yading@10 5349
yading@10 5350 The name to the frei0r effect to load. If the environment variable
yading@10 5351 B<FREI0R_PATH> is defined, the frei0r effect is searched in each one of the
yading@10 5352 directories specified by the colon separated list in B<FREIOR_PATH>,
yading@10 5353 otherwise in the standard frei0r paths, which are in this order:
yading@10 5354 F<HOME/.frei0r-1/lib/>, F</usr/local/lib/frei0r-1/>,
yading@10 5355 F</usr/lib/frei0r-1/>.
yading@10 5356
yading@10 5357
yading@10 5358 =item B<filter_params>
yading@10 5359
yading@10 5360 A '|'-separated list of parameters to pass to the frei0r effect.
yading@10 5361
yading@10 5362
yading@10 5363 =back
yading@10 5364
yading@10 5365
yading@10 5366 A frei0r effect parameter can be a boolean (whose values are specified
yading@10 5367 with "y" and "n"), a double, a color (specified by the syntax
yading@10 5368 I<R>/I<G>/I<B>, I<R>, I<G>, and I<B> being float
yading@10 5369 numbers from 0.0 to 1.0) or by an C<av_parse_color()> color
yading@10 5370 description), a position (specified by the syntax I<X>/I<Y>,
yading@10 5371 I<X> and I<Y> being float numbers) and a string.
yading@10 5372
yading@10 5373 The number and kind of parameters depend on the loaded effect. If an
yading@10 5374 effect parameter is not specified the default value is set.
yading@10 5375
yading@10 5376
yading@10 5377 =head3 Examples
yading@10 5378
yading@10 5379
yading@10 5380
yading@10 5381 =over 4
yading@10 5382
yading@10 5383
yading@10 5384 =item *
yading@10 5385
yading@10 5386 Apply the distort0r effect, set the first two double parameters:
yading@10 5387
yading@10 5388 frei0r=filter_name=distort0r:filter_params=0.5|0.01
yading@10 5389
yading@10 5390
yading@10 5391
yading@10 5392 =item *
yading@10 5393
yading@10 5394 Apply the colordistance effect, take a color as first parameter:
yading@10 5395
yading@10 5396 frei0r=colordistance:0.2/0.3/0.4
yading@10 5397 frei0r=colordistance:violet
yading@10 5398 frei0r=colordistance:0x112233
yading@10 5399
yading@10 5400
yading@10 5401
yading@10 5402 =item *
yading@10 5403
yading@10 5404 Apply the perspective effect, specify the top left and top right image
yading@10 5405 positions:
yading@10 5406
yading@10 5407 frei0r=perspective:0.2/0.2|0.8/0.2
yading@10 5408
yading@10 5409
yading@10 5410 =back
yading@10 5411
yading@10 5412
yading@10 5413 For more information see:
yading@10 5414 E<lt>B<http://frei0r.dyne.org>E<gt>
yading@10 5415
yading@10 5416
yading@10 5417 =head2 geq
yading@10 5418
yading@10 5419
yading@10 5420 The filter accepts the following options:
yading@10 5421
yading@10 5422
yading@10 5423 =over 4
yading@10 5424
yading@10 5425
yading@10 5426 =item B<lum_expr>
yading@10 5427
yading@10 5428 the luminance expression
yading@10 5429
yading@10 5430 =item B<cb_expr>
yading@10 5431
yading@10 5432 the chrominance blue expression
yading@10 5433
yading@10 5434 =item B<cr_expr>
yading@10 5435
yading@10 5436 the chrominance red expression
yading@10 5437
yading@10 5438 =item B<alpha_expr>
yading@10 5439
yading@10 5440 the alpha expression
yading@10 5441
yading@10 5442 =back
yading@10 5443
yading@10 5444
yading@10 5445 If one of the chrominance expression is not defined, it falls back on the other
yading@10 5446 one. If no alpha expression is specified it will evaluate to opaque value.
yading@10 5447 If none of chrominance expressions are
yading@10 5448 specified, they will evaluate the luminance expression.
yading@10 5449
yading@10 5450 The expressions can use the following variables and functions:
yading@10 5451
yading@10 5452
yading@10 5453 =over 4
yading@10 5454
yading@10 5455
yading@10 5456 =item B<N>
yading@10 5457
yading@10 5458 The sequential number of the filtered frame, starting from C<0>.
yading@10 5459
yading@10 5460
yading@10 5461 =item B<X>
yading@10 5462
yading@10 5463
yading@10 5464 =item B<Y>
yading@10 5465
yading@10 5466 The coordinates of the current sample.
yading@10 5467
yading@10 5468
yading@10 5469 =item B<W>
yading@10 5470
yading@10 5471
yading@10 5472 =item B<H>
yading@10 5473
yading@10 5474 The width and height of the image.
yading@10 5475
yading@10 5476
yading@10 5477 =item B<SW>
yading@10 5478
yading@10 5479
yading@10 5480 =item B<SH>
yading@10 5481
yading@10 5482 Width and height scale depending on the currently filtered plane. It is the
yading@10 5483 ratio between the corresponding luma plane number of pixels and the current
yading@10 5484 plane ones. E.g. for YUV4:2:0 the values are C<1,1> for the luma plane, and
yading@10 5485 C<0.5,0.5> for chroma planes.
yading@10 5486
yading@10 5487
yading@10 5488 =item B<T>
yading@10 5489
yading@10 5490 Time of the current frame, expressed in seconds.
yading@10 5491
yading@10 5492
yading@10 5493 =item B<p(x, y)>
yading@10 5494
yading@10 5495 Return the value of the pixel at location (I<x>,I<y>) of the current
yading@10 5496 plane.
yading@10 5497
yading@10 5498
yading@10 5499 =item B<lum(x, y)>
yading@10 5500
yading@10 5501 Return the value of the pixel at location (I<x>,I<y>) of the luminance
yading@10 5502 plane.
yading@10 5503
yading@10 5504
yading@10 5505 =item B<cb(x, y)>
yading@10 5506
yading@10 5507 Return the value of the pixel at location (I<x>,I<y>) of the
yading@10 5508 blue-difference chroma plane. Returns 0 if there is no such plane.
yading@10 5509
yading@10 5510
yading@10 5511 =item B<cr(x, y)>
yading@10 5512
yading@10 5513 Return the value of the pixel at location (I<x>,I<y>) of the
yading@10 5514 red-difference chroma plane. Returns 0 if there is no such plane.
yading@10 5515
yading@10 5516
yading@10 5517 =item B<alpha(x, y)>
yading@10 5518
yading@10 5519 Return the value of the pixel at location (I<x>,I<y>) of the alpha
yading@10 5520 plane. Returns 0 if there is no such plane.
yading@10 5521
yading@10 5522 =back
yading@10 5523
yading@10 5524
yading@10 5525 For functions, if I<x> and I<y> are outside the area, the value will be
yading@10 5526 automatically clipped to the closer edge.
yading@10 5527
yading@10 5528
yading@10 5529 =head3 Examples
yading@10 5530
yading@10 5531
yading@10 5532
yading@10 5533 =over 4
yading@10 5534
yading@10 5535
yading@10 5536 =item *
yading@10 5537
yading@10 5538 Flip the image horizontally:
yading@10 5539
yading@10 5540 geq=p(W-X\,Y)
yading@10 5541
yading@10 5542
yading@10 5543
yading@10 5544 =item *
yading@10 5545
yading@10 5546 Generate a bidimensional sine wave, with angle C<PI/3> and a
yading@10 5547 wavelength of 100 pixels:
yading@10 5548
yading@10 5549 geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
yading@10 5550
yading@10 5551
yading@10 5552
yading@10 5553 =item *
yading@10 5554
yading@10 5555 Generate a fancy enigmatic moving light:
yading@10 5556
yading@10 5557 nullsrc=s=256x256,geq=random(1)/hypot(X-cos(N*0.07)*W/2-W/2\,Y-sin(N*0.09)*H/2-H/2)^2*1000000*sin(N*0.02):128:128
yading@10 5558
yading@10 5559
yading@10 5560
yading@10 5561 =item *
yading@10 5562
yading@10 5563 Generate a quick emboss effect:
yading@10 5564
yading@10 5565 format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
yading@10 5566
yading@10 5567
yading@10 5568 =back
yading@10 5569
yading@10 5570
yading@10 5571
yading@10 5572 =head2 gradfun
yading@10 5573
yading@10 5574
yading@10 5575 Fix the banding artifacts that are sometimes introduced into nearly flat
yading@10 5576 regions by truncation to 8bit color depth.
yading@10 5577 Interpolate the gradients that should go where the bands are, and
yading@10 5578 dither them.
yading@10 5579
yading@10 5580 This filter is designed for playback only. Do not use it prior to
yading@10 5581 lossy compression, because compression tends to lose the dither and
yading@10 5582 bring back the bands.
yading@10 5583
yading@10 5584 This filter accepts the following options:
yading@10 5585
yading@10 5586
yading@10 5587 =over 4
yading@10 5588
yading@10 5589
yading@10 5590
yading@10 5591 =item B<strength>
yading@10 5592
yading@10 5593 The maximum amount by which the filter will change any one pixel. Also the
yading@10 5594 threshold for detecting nearly flat regions. Acceptable values range from .51 to
yading@10 5595 64, default value is 1.2, out-of-range values will be clipped to the valid
yading@10 5596 range.
yading@10 5597
yading@10 5598
yading@10 5599 =item B<radius>
yading@10 5600
yading@10 5601 The neighborhood to fit the gradient to. A larger radius makes for smoother
yading@10 5602 gradients, but also prevents the filter from modifying the pixels near detailed
yading@10 5603 regions. Acceptable values are 8-32, default value is 16, out-of-range values
yading@10 5604 will be clipped to the valid range.
yading@10 5605
yading@10 5606
yading@10 5607 =back
yading@10 5608
yading@10 5609
yading@10 5610 Alternatively, the options can be specified as a flat string:
yading@10 5611 I<strength>[:I<radius>]
yading@10 5612
yading@10 5613
yading@10 5614 =head3 Examples
yading@10 5615
yading@10 5616
yading@10 5617
yading@10 5618 =over 4
yading@10 5619
yading@10 5620
yading@10 5621 =item *
yading@10 5622
yading@10 5623 Apply the filter with a C<3.5> strength and radius of C<8>:
yading@10 5624
yading@10 5625 gradfun=3.5:8
yading@10 5626
yading@10 5627
yading@10 5628
yading@10 5629 =item *
yading@10 5630
yading@10 5631 Specify radius, omitting the strength (which will fall-back to the default
yading@10 5632 value):
yading@10 5633
yading@10 5634 gradfun=radius=8
yading@10 5635
yading@10 5636
yading@10 5637
yading@10 5638 =back
yading@10 5639
yading@10 5640
yading@10 5641
yading@10 5642 =head2 hflip
yading@10 5643
yading@10 5644
yading@10 5645 Flip the input video horizontally.
yading@10 5646
yading@10 5647 For example to horizontally flip the input video with B<ffmpeg>:
yading@10 5648
yading@10 5649 ffmpeg -i in.avi -vf "hflip" out.avi
yading@10 5650
yading@10 5651
yading@10 5652
yading@10 5653 =head2 histeq
yading@10 5654
yading@10 5655 This filter applies a global color histogram equalization on a
yading@10 5656 per-frame basis.
yading@10 5657
yading@10 5658 It can be used to correct video that has a compressed range of pixel
yading@10 5659 intensities. The filter redistributes the pixel intensities to
yading@10 5660 equalize their distribution across the intensity range. It may be
yading@10 5661 viewed as an "automatically adjusting contrast filter". This filter is
yading@10 5662 useful only for correcting degraded or poorly captured source
yading@10 5663 video.
yading@10 5664
yading@10 5665 The filter accepts the following options:
yading@10 5666
yading@10 5667
yading@10 5668 =over 4
yading@10 5669
yading@10 5670
yading@10 5671 =item B<strength>
yading@10 5672
yading@10 5673 Determine the amount of equalization to be applied. As the strength
yading@10 5674 is reduced, the distribution of pixel intensities more-and-more
yading@10 5675 approaches that of the input frame. The value must be a float number
yading@10 5676 in the range [0,1] and defaults to 0.200.
yading@10 5677
yading@10 5678
yading@10 5679 =item B<intensity>
yading@10 5680
yading@10 5681 Set the maximum intensity that can generated and scale the output
yading@10 5682 values appropriately. The strength should be set as desired and then
yading@10 5683 the intensity can be limited if needed to avoid washing-out. The value
yading@10 5684 must be a float number in the range [0,1] and defaults to 0.210.
yading@10 5685
yading@10 5686
yading@10 5687 =item B<antibanding>
yading@10 5688
yading@10 5689 Set the antibanding level. If enabled the filter will randomly vary
yading@10 5690 the luminance of output pixels by a small amount to avoid banding of
yading@10 5691 the histogram. Possible values are C<none>, C<weak> or
yading@10 5692 C<strong>. It defaults to C<none>.
yading@10 5693
yading@10 5694 =back
yading@10 5695
yading@10 5696
yading@10 5697
yading@10 5698 =head2 histogram
yading@10 5699
yading@10 5700
yading@10 5701 Compute and draw a color distribution histogram for the input video.
yading@10 5702
yading@10 5703 The computed histogram is a representation of distribution of color components
yading@10 5704 in an image.
yading@10 5705
yading@10 5706 The filter accepts the following options:
yading@10 5707
yading@10 5708
yading@10 5709 =over 4
yading@10 5710
yading@10 5711
yading@10 5712 =item B<mode>
yading@10 5713
yading@10 5714 Set histogram mode.
yading@10 5715
yading@10 5716 It accepts the following values:
yading@10 5717
yading@10 5718 =over 4
yading@10 5719
yading@10 5720
yading@10 5721 =item B<levels>
yading@10 5722
yading@10 5723 standard histogram that display color components distribution in an image.
yading@10 5724 Displays color graph for each color component. Shows distribution
yading@10 5725 of the Y, U, V, A or G, B, R components, depending on input format,
yading@10 5726 in current frame. Bellow each graph is color component scale meter.
yading@10 5727
yading@10 5728
yading@10 5729 =item B<color>
yading@10 5730
yading@10 5731 chroma values in vectorscope, if brighter more such chroma values are
yading@10 5732 distributed in an image.
yading@10 5733 Displays chroma values (U/V color placement) in two dimensional graph
yading@10 5734 (which is called a vectorscope). It can be used to read of the hue and
yading@10 5735 saturation of the current frame. At a same time it is a histogram.
yading@10 5736 The whiter a pixel in the vectorscope, the more pixels of the input frame
yading@10 5737 correspond to that pixel (that is the more pixels have this chroma value).
yading@10 5738 The V component is displayed on the horizontal (X) axis, with the leftmost
yading@10 5739 side being V = 0 and the rightmost side being V = 255.
yading@10 5740 The U component is displayed on the vertical (Y) axis, with the top
yading@10 5741 representing U = 0 and the bottom representing U = 255.
yading@10 5742
yading@10 5743 The position of a white pixel in the graph corresponds to the chroma value
yading@10 5744 of a pixel of the input clip. So the graph can be used to read of the
yading@10 5745 hue (color flavor) and the saturation (the dominance of the hue in the color).
yading@10 5746 As the hue of a color changes, it moves around the square. At the center of
yading@10 5747 the square, the saturation is zero, which means that the corresponding pixel
yading@10 5748 has no color. If you increase the amount of a specific color, while leaving
yading@10 5749 the other colors unchanged, the saturation increases, and you move towards
yading@10 5750 the edge of the square.
yading@10 5751
yading@10 5752
yading@10 5753 =item B<color2>
yading@10 5754
yading@10 5755 chroma values in vectorscope, similar as C<color> but actual chroma values
yading@10 5756 are displayed.
yading@10 5757
yading@10 5758
yading@10 5759 =item B<waveform>
yading@10 5760
yading@10 5761 per row/column color component graph. In row mode graph in the left side represents
yading@10 5762 color component value 0 and right side represents value = 255. In column mode top
yading@10 5763 side represents color component value = 0 and bottom side represents value = 255.
yading@10 5764
yading@10 5765 =back
yading@10 5766
yading@10 5767 Default value is C<levels>.
yading@10 5768
yading@10 5769
yading@10 5770 =item B<level_height>
yading@10 5771
yading@10 5772 Set height of level in C<levels>. Default value is C<200>.
yading@10 5773 Allowed range is [50, 2048].
yading@10 5774
yading@10 5775
yading@10 5776 =item B<scale_height>
yading@10 5777
yading@10 5778 Set height of color scale in C<levels>. Default value is C<12>.
yading@10 5779 Allowed range is [0, 40].
yading@10 5780
yading@10 5781
yading@10 5782 =item B<step>
yading@10 5783
yading@10 5784 Set step for C<waveform> mode. Smaller values are useful to find out how much
yading@10 5785 of same luminance values across input rows/columns are distributed.
yading@10 5786 Default value is C<10>. Allowed range is [1, 255].
yading@10 5787
yading@10 5788
yading@10 5789 =item B<waveform_mode>
yading@10 5790
yading@10 5791 Set mode for C<waveform>. Can be either C<row>, or C<column>.
yading@10 5792 Default is C<row>.
yading@10 5793
yading@10 5794
yading@10 5795 =item B<display_mode>
yading@10 5796
yading@10 5797 Set display mode for C<waveform> and C<levels>.
yading@10 5798 It accepts the following values:
yading@10 5799
yading@10 5800 =over 4
yading@10 5801
yading@10 5802
yading@10 5803 =item B<parade>
yading@10 5804
yading@10 5805 Display separate graph for the color components side by side in
yading@10 5806 C<row> waveform mode or one below other in C<column> waveform mode
yading@10 5807 for C<waveform> histogram mode. For C<levels> histogram mode
yading@10 5808 per color component graphs are placed one bellow other.
yading@10 5809
yading@10 5810 This display mode in C<waveform> histogram mode makes it easy to spot
yading@10 5811 color casts in the highlights and shadows of an image, by comparing the
yading@10 5812 contours of the top and the bottom of each waveform.
yading@10 5813 Since whites, grays, and blacks are characterized by
yading@10 5814 exactly equal amounts of red, green, and blue, neutral areas of the
yading@10 5815 picture should display three waveforms of roughly equal width/height.
yading@10 5816 If not, the correction is easy to make by making adjustments to level the
yading@10 5817 three waveforms.
yading@10 5818
yading@10 5819
yading@10 5820 =item B<overlay>
yading@10 5821
yading@10 5822 Presents information that's identical to that in the C<parade>, except
yading@10 5823 that the graphs representing color components are superimposed directly
yading@10 5824 over one another.
yading@10 5825
yading@10 5826 This display mode in C<waveform> histogram mode can make it easier to spot
yading@10 5827 the relative differences or similarities in overlapping areas of the color
yading@10 5828 components that are supposed to be identical, such as neutral whites, grays,
yading@10 5829 or blacks.
yading@10 5830
yading@10 5831 =back
yading@10 5832
yading@10 5833 Default is C<parade>.
yading@10 5834
yading@10 5835 =back
yading@10 5836
yading@10 5837
yading@10 5838
yading@10 5839 =head3 Examples
yading@10 5840
yading@10 5841
yading@10 5842
yading@10 5843 =over 4
yading@10 5844
yading@10 5845
yading@10 5846
yading@10 5847 =item *
yading@10 5848
yading@10 5849 Calculate and draw histogram:
yading@10 5850
yading@10 5851 ffplay -i input -vf histogram
yading@10 5852
yading@10 5853
yading@10 5854
yading@10 5855 =back
yading@10 5856
yading@10 5857
yading@10 5858
yading@10 5859 =head2 hqdn3d
yading@10 5860
yading@10 5861
yading@10 5862 High precision/quality 3d denoise filter. This filter aims to reduce
yading@10 5863 image noise producing smooth images and making still images really
yading@10 5864 still. It should enhance compressibility.
yading@10 5865
yading@10 5866 It accepts the following optional parameters:
yading@10 5867
yading@10 5868
yading@10 5869 =over 4
yading@10 5870
yading@10 5871
yading@10 5872 =item B<luma_spatial>
yading@10 5873
yading@10 5874 a non-negative float number which specifies spatial luma strength,
yading@10 5875 defaults to 4.0
yading@10 5876
yading@10 5877
yading@10 5878 =item B<chroma_spatial>
yading@10 5879
yading@10 5880 a non-negative float number which specifies spatial chroma strength,
yading@10 5881 defaults to 3.0*I<luma_spatial>/4.0
yading@10 5882
yading@10 5883
yading@10 5884 =item B<luma_tmp>
yading@10 5885
yading@10 5886 a float number which specifies luma temporal strength, defaults to
yading@10 5887 6.0*I<luma_spatial>/4.0
yading@10 5888
yading@10 5889
yading@10 5890 =item B<chroma_tmp>
yading@10 5891
yading@10 5892 a float number which specifies chroma temporal strength, defaults to
yading@10 5893 I<luma_tmp>*I<chroma_spatial>/I<luma_spatial>
yading@10 5894
yading@10 5895 =back
yading@10 5896
yading@10 5897
yading@10 5898
yading@10 5899 =head2 hue
yading@10 5900
yading@10 5901
yading@10 5902 Modify the hue and/or the saturation of the input.
yading@10 5903
yading@10 5904 This filter accepts the following options:
yading@10 5905
yading@10 5906
yading@10 5907 =over 4
yading@10 5908
yading@10 5909
yading@10 5910 =item B<h>
yading@10 5911
yading@10 5912 Specify the hue angle as a number of degrees. It accepts an expression,
yading@10 5913 and defaults to "0".
yading@10 5914
yading@10 5915
yading@10 5916 =item B<s>
yading@10 5917
yading@10 5918 Specify the saturation in the [-10,10] range. It accepts a float number and
yading@10 5919 defaults to "1".
yading@10 5920
yading@10 5921
yading@10 5922 =item B<H>
yading@10 5923
yading@10 5924 Specify the hue angle as a number of radians. It accepts a float
yading@10 5925 number or an expression, and defaults to "0".
yading@10 5926
yading@10 5927 =back
yading@10 5928
yading@10 5929
yading@10 5930 B<h> and B<H> are mutually exclusive, and can't be
yading@10 5931 specified at the same time.
yading@10 5932
yading@10 5933 The B<h>, B<H> and B<s> option values are
yading@10 5934 expressions containing the following constants:
yading@10 5935
yading@10 5936
yading@10 5937 =over 4
yading@10 5938
yading@10 5939
yading@10 5940 =item B<n>
yading@10 5941
yading@10 5942 frame count of the input frame starting from 0
yading@10 5943
yading@10 5944
yading@10 5945 =item B<pts>
yading@10 5946
yading@10 5947 presentation timestamp of the input frame expressed in time base units
yading@10 5948
yading@10 5949
yading@10 5950 =item B<r>
yading@10 5951
yading@10 5952 frame rate of the input video, NAN if the input frame rate is unknown
yading@10 5953
yading@10 5954
yading@10 5955 =item B<t>
yading@10 5956
yading@10 5957 timestamp expressed in seconds, NAN if the input timestamp is unknown
yading@10 5958
yading@10 5959
yading@10 5960 =item B<tb>
yading@10 5961
yading@10 5962 time base of the input video
yading@10 5963
yading@10 5964 =back
yading@10 5965
yading@10 5966
yading@10 5967
yading@10 5968 =head3 Examples
yading@10 5969
yading@10 5970
yading@10 5971
yading@10 5972 =over 4
yading@10 5973
yading@10 5974
yading@10 5975 =item *
yading@10 5976
yading@10 5977 Set the hue to 90 degrees and the saturation to 1.0:
yading@10 5978
yading@10 5979 hue=h=90:s=1
yading@10 5980
yading@10 5981
yading@10 5982
yading@10 5983 =item *
yading@10 5984
yading@10 5985 Same command but expressing the hue in radians:
yading@10 5986
yading@10 5987 hue=H=PI/2:s=1
yading@10 5988
yading@10 5989
yading@10 5990
yading@10 5991 =item *
yading@10 5992
yading@10 5993 Rotate hue and make the saturation swing between 0
yading@10 5994 and 2 over a period of 1 second:
yading@10 5995
yading@10 5996 hue="H=2*PI*t: s=sin(2*PI*t)+1"
yading@10 5997
yading@10 5998
yading@10 5999
yading@10 6000 =item *
yading@10 6001
yading@10 6002 Apply a 3 seconds saturation fade-in effect starting at 0:
yading@10 6003
yading@10 6004 hue="s=min(t/3\,1)"
yading@10 6005
yading@10 6006
yading@10 6007 The general fade-in expression can be written as:
yading@10 6008
yading@10 6009 hue="s=min(0\, max((t-START)/DURATION\, 1))"
yading@10 6010
yading@10 6011
yading@10 6012
yading@10 6013 =item *
yading@10 6014
yading@10 6015 Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
yading@10 6016
yading@10 6017 hue="s=max(0\, min(1\, (8-t)/3))"
yading@10 6018
yading@10 6019
yading@10 6020 The general fade-out expression can be written as:
yading@10 6021
yading@10 6022 hue="s=max(0\, min(1\, (START+DURATION-t)/DURATION))"
yading@10 6023
yading@10 6024
yading@10 6025
yading@10 6026 =back
yading@10 6027
yading@10 6028
yading@10 6029
yading@10 6030 =head3 Commands
yading@10 6031
yading@10 6032
yading@10 6033 This filter supports the following commands:
yading@10 6034
yading@10 6035 =over 4
yading@10 6036
yading@10 6037
yading@10 6038 =item B<s>
yading@10 6039
yading@10 6040
yading@10 6041 =item B<h>
yading@10 6042
yading@10 6043
yading@10 6044 =item B<H>
yading@10 6045
yading@10 6046 Modify the hue and/or the saturation of the input video.
yading@10 6047 The command accepts the same syntax of the corresponding option.
yading@10 6048
yading@10 6049 If the specified expression is not valid, it is kept at its current
yading@10 6050 value.
yading@10 6051
yading@10 6052 =back
yading@10 6053
yading@10 6054
yading@10 6055
yading@10 6056 =head2 idet
yading@10 6057
yading@10 6058
yading@10 6059 Detect video interlacing type.
yading@10 6060
yading@10 6061 This filter tries to detect if the input is interlaced or progressive,
yading@10 6062 top or bottom field first.
yading@10 6063
yading@10 6064 The filter accepts the following options:
yading@10 6065
yading@10 6066
yading@10 6067 =over 4
yading@10 6068
yading@10 6069
yading@10 6070 =item B<intl_thres>
yading@10 6071
yading@10 6072 Set interlacing threshold.
yading@10 6073
yading@10 6074 =item B<prog_thres>
yading@10 6075
yading@10 6076 Set progressive threshold.
yading@10 6077
yading@10 6078 =back
yading@10 6079
yading@10 6080
yading@10 6081
yading@10 6082 =head2 il
yading@10 6083
yading@10 6084
yading@10 6085 Deinterleave or interleave fields.
yading@10 6086
yading@10 6087 This filter allows to process interlaced images fields without
yading@10 6088 deinterlacing them. Deinterleaving splits the input frame into 2
yading@10 6089 fields (so called half pictures). Odd lines are moved to the top
yading@10 6090 half of the output image, even lines to the bottom half.
yading@10 6091 You can process (filter) them independently and then re-interleave them.
yading@10 6092
yading@10 6093 The filter accepts the following options:
yading@10 6094
yading@10 6095
yading@10 6096 =over 4
yading@10 6097
yading@10 6098
yading@10 6099 =item B<luma_mode, l>
yading@10 6100
yading@10 6101
yading@10 6102 =item B<chroma_mode, s>
yading@10 6103
yading@10 6104
yading@10 6105 =item B<alpha_mode, a>
yading@10 6106
yading@10 6107 Available values for I<luma_mode>, I<chroma_mode> and
yading@10 6108 I<alpha_mode> are:
yading@10 6109
yading@10 6110
yading@10 6111 =over 4
yading@10 6112
yading@10 6113
yading@10 6114 =item B<none>
yading@10 6115
yading@10 6116 Do nothing.
yading@10 6117
yading@10 6118
yading@10 6119 =item B<deinterleave, d>
yading@10 6120
yading@10 6121 Deinterleave fields, placing one above the other.
yading@10 6122
yading@10 6123
yading@10 6124 =item B<interleave, i>
yading@10 6125
yading@10 6126 Interleave fields. Reverse the effect of deinterleaving.
yading@10 6127
yading@10 6128 =back
yading@10 6129
yading@10 6130 Default value is C<none>.
yading@10 6131
yading@10 6132
yading@10 6133 =item B<luma_swap, ls>
yading@10 6134
yading@10 6135
yading@10 6136 =item B<chroma_swap, cs>
yading@10 6137
yading@10 6138
yading@10 6139 =item B<alpha_swap, as>
yading@10 6140
yading@10 6141 Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is C<0>.
yading@10 6142
yading@10 6143 =back
yading@10 6144
yading@10 6145
yading@10 6146
yading@10 6147 =head2 interlace
yading@10 6148
yading@10 6149
yading@10 6150 Simple interlacing filter from progressive contents. This interleaves upper (or
yading@10 6151 lower) lines from odd frames with lower (or upper) lines from even frames,
yading@10 6152 halving the frame rate and preserving image height.
yading@10 6153
yading@10 6154
yading@10 6155 Original Original New Frame
yading@10 6156 Frame 'j' Frame 'j+1' (tff)
yading@10 6157 ========== =========== ==================
yading@10 6158 Line 0 --------------------> Frame 'j' Line 0
yading@10 6159 Line 1 Line 1 ----> Frame 'j+1' Line 1
yading@10 6160 Line 2 ---------------------> Frame 'j' Line 2
yading@10 6161 Line 3 Line 3 ----> Frame 'j+1' Line 3
yading@10 6162 ... ... ...
yading@10 6163 New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
yading@10 6164
yading@10 6165
yading@10 6166 It accepts the following optional parameters:
yading@10 6167
yading@10 6168
yading@10 6169 =over 4
yading@10 6170
yading@10 6171
yading@10 6172 =item B<scan>
yading@10 6173
yading@10 6174 determines whether the interlaced frame is taken from the even (tff - default)
yading@10 6175 or odd (bff) lines of the progressive frame.
yading@10 6176
yading@10 6177
yading@10 6178 =item B<lowpass>
yading@10 6179
yading@10 6180 Enable (default) or disable the vertical lowpass filter to avoid twitter
yading@10 6181 interlacing and reduce moire patterns.
yading@10 6182
yading@10 6183 =back
yading@10 6184
yading@10 6185
yading@10 6186
yading@10 6187 =head2 kerndeint
yading@10 6188
yading@10 6189
yading@10 6190 Deinterlace input video by applying Donald Graft's adaptive kernel
yading@10 6191 deinterling. Work on interlaced parts of a video to produce
yading@10 6192 progressive frames.
yading@10 6193
yading@10 6194 The description of the accepted parameters follows.
yading@10 6195
yading@10 6196
yading@10 6197 =over 4
yading@10 6198
yading@10 6199
yading@10 6200 =item B<thresh>
yading@10 6201
yading@10 6202 Set the threshold which affects the filter's tolerance when
yading@10 6203 determining if a pixel line must be processed. It must be an integer
yading@10 6204 in the range [0,255] and defaults to 10. A value of 0 will result in
yading@10 6205 applying the process on every pixels.
yading@10 6206
yading@10 6207
yading@10 6208 =item B<map>
yading@10 6209
yading@10 6210 Paint pixels exceeding the threshold value to white if set to 1.
yading@10 6211 Default is 0.
yading@10 6212
yading@10 6213
yading@10 6214 =item B<order>
yading@10 6215
yading@10 6216 Set the fields order. Swap fields if set to 1, leave fields alone if
yading@10 6217 0. Default is 0.
yading@10 6218
yading@10 6219
yading@10 6220 =item B<sharp>
yading@10 6221
yading@10 6222 Enable additional sharpening if set to 1. Default is 0.
yading@10 6223
yading@10 6224
yading@10 6225 =item B<twoway>
yading@10 6226
yading@10 6227 Enable twoway sharpening if set to 1. Default is 0.
yading@10 6228
yading@10 6229 =back
yading@10 6230
yading@10 6231
yading@10 6232
yading@10 6233 =head3 Examples
yading@10 6234
yading@10 6235
yading@10 6236
yading@10 6237 =over 4
yading@10 6238
yading@10 6239
yading@10 6240 =item *
yading@10 6241
yading@10 6242 Apply default values:
yading@10 6243
yading@10 6244 kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
yading@10 6245
yading@10 6246
yading@10 6247
yading@10 6248 =item *
yading@10 6249
yading@10 6250 Enable additional sharpening:
yading@10 6251
yading@10 6252 kerndeint=sharp=1
yading@10 6253
yading@10 6254
yading@10 6255
yading@10 6256 =item *
yading@10 6257
yading@10 6258 Paint processed pixels in white:
yading@10 6259
yading@10 6260 kerndeint=map=1
yading@10 6261
yading@10 6262
yading@10 6263 =back
yading@10 6264
yading@10 6265
yading@10 6266
yading@10 6267 =head2 lut, lutrgb, lutyuv
yading@10 6268
yading@10 6269
yading@10 6270 Compute a look-up table for binding each pixel component input value
yading@10 6271 to an output value, and apply it to input video.
yading@10 6272
yading@10 6273 I<lutyuv> applies a lookup table to a YUV input video, I<lutrgb>
yading@10 6274 to an RGB input video.
yading@10 6275
yading@10 6276 These filters accept the following options:
yading@10 6277
yading@10 6278 =over 4
yading@10 6279
yading@10 6280
yading@10 6281 =item B<c0>
yading@10 6282
yading@10 6283 set first pixel component expression
yading@10 6284
yading@10 6285 =item B<c1>
yading@10 6286
yading@10 6287 set second pixel component expression
yading@10 6288
yading@10 6289 =item B<c2>
yading@10 6290
yading@10 6291 set third pixel component expression
yading@10 6292
yading@10 6293 =item B<c3>
yading@10 6294
yading@10 6295 set fourth pixel component expression, corresponds to the alpha component
yading@10 6296
yading@10 6297
yading@10 6298 =item B<r>
yading@10 6299
yading@10 6300 set red component expression
yading@10 6301
yading@10 6302 =item B<g>
yading@10 6303
yading@10 6304 set green component expression
yading@10 6305
yading@10 6306 =item B<b>
yading@10 6307
yading@10 6308 set blue component expression
yading@10 6309
yading@10 6310 =item B<a>
yading@10 6311
yading@10 6312 alpha component expression
yading@10 6313
yading@10 6314
yading@10 6315 =item B<y>
yading@10 6316
yading@10 6317 set Y/luminance component expression
yading@10 6318
yading@10 6319 =item B<u>
yading@10 6320
yading@10 6321 set U/Cb component expression
yading@10 6322
yading@10 6323 =item B<v>
yading@10 6324
yading@10 6325 set V/Cr component expression
yading@10 6326
yading@10 6327 =back
yading@10 6328
yading@10 6329
yading@10 6330 Each of them specifies the expression to use for computing the lookup table for
yading@10 6331 the corresponding pixel component values.
yading@10 6332
yading@10 6333 The exact component associated to each of the I<c*> options depends on the
yading@10 6334 format in input.
yading@10 6335
yading@10 6336 The I<lut> filter requires either YUV or RGB pixel formats in input,
yading@10 6337 I<lutrgb> requires RGB pixel formats in input, and I<lutyuv> requires YUV.
yading@10 6338
yading@10 6339 The expressions can contain the following constants and functions:
yading@10 6340
yading@10 6341
yading@10 6342 =over 4
yading@10 6343
yading@10 6344
yading@10 6345 =item B<w, h>
yading@10 6346
yading@10 6347 the input width and height
yading@10 6348
yading@10 6349
yading@10 6350 =item B<val>
yading@10 6351
yading@10 6352 input value for the pixel component
yading@10 6353
yading@10 6354
yading@10 6355 =item B<clipval>
yading@10 6356
yading@10 6357 the input value clipped in the I<minval>-I<maxval> range
yading@10 6358
yading@10 6359
yading@10 6360 =item B<maxval>
yading@10 6361
yading@10 6362 maximum value for the pixel component
yading@10 6363
yading@10 6364
yading@10 6365 =item B<minval>
yading@10 6366
yading@10 6367 minimum value for the pixel component
yading@10 6368
yading@10 6369
yading@10 6370 =item B<negval>
yading@10 6371
yading@10 6372 the negated value for the pixel component value clipped in the
yading@10 6373 I<minval>-I<maxval> range , it corresponds to the expression
yading@10 6374 "maxval-clipval+minval"
yading@10 6375
yading@10 6376
yading@10 6377 =item B<clip(val)>
yading@10 6378
yading@10 6379 the computed value in I<val> clipped in the
yading@10 6380 I<minval>-I<maxval> range
yading@10 6381
yading@10 6382
yading@10 6383 =item B<gammaval(gamma)>
yading@10 6384
yading@10 6385 the computed gamma correction value of the pixel component value
yading@10 6386 clipped in the I<minval>-I<maxval> range, corresponds to the
yading@10 6387 expression
yading@10 6388 "pow((clipval-minval)/(maxval-minval)\,I<gamma>)*(maxval-minval)+minval"
yading@10 6389
yading@10 6390
yading@10 6391 =back
yading@10 6392
yading@10 6393
yading@10 6394 All expressions default to "val".
yading@10 6395
yading@10 6396
yading@10 6397 =head3 Examples
yading@10 6398
yading@10 6399
yading@10 6400
yading@10 6401 =over 4
yading@10 6402
yading@10 6403
yading@10 6404 =item *
yading@10 6405
yading@10 6406 Negate input video:
yading@10 6407
yading@10 6408 lutrgb="r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val"
yading@10 6409 lutyuv="y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val"
yading@10 6410
yading@10 6411
yading@10 6412 The above is the same as:
yading@10 6413
yading@10 6414 lutrgb="r=negval:g=negval:b=negval"
yading@10 6415 lutyuv="y=negval:u=negval:v=negval"
yading@10 6416
yading@10 6417
yading@10 6418
yading@10 6419 =item *
yading@10 6420
yading@10 6421 Negate luminance:
yading@10 6422
yading@10 6423 lutyuv=y=negval
yading@10 6424
yading@10 6425
yading@10 6426
yading@10 6427 =item *
yading@10 6428
yading@10 6429 Remove chroma components, turns the video into a graytone image:
yading@10 6430
yading@10 6431 lutyuv="u=128:v=128"
yading@10 6432
yading@10 6433
yading@10 6434
yading@10 6435 =item *
yading@10 6436
yading@10 6437 Apply a luma burning effect:
yading@10 6438
yading@10 6439 lutyuv="y=2*val"
yading@10 6440
yading@10 6441
yading@10 6442
yading@10 6443 =item *
yading@10 6444
yading@10 6445 Remove green and blue components:
yading@10 6446
yading@10 6447 lutrgb="g=0:b=0"
yading@10 6448
yading@10 6449
yading@10 6450
yading@10 6451 =item *
yading@10 6452
yading@10 6453 Set a constant alpha channel value on input:
yading@10 6454
yading@10 6455 format=rgba,lutrgb=a="maxval-minval/2"
yading@10 6456
yading@10 6457
yading@10 6458
yading@10 6459 =item *
yading@10 6460
yading@10 6461 Correct luminance gamma by a 0.5 factor:
yading@10 6462
yading@10 6463 lutyuv=y=gammaval(0.5)
yading@10 6464
yading@10 6465
yading@10 6466
yading@10 6467 =item *
yading@10 6468
yading@10 6469 Discard least significant bits of luma:
yading@10 6470
yading@10 6471 lutyuv=y='bitand(val, 128+64+32)'
yading@10 6472
yading@10 6473
yading@10 6474 =back
yading@10 6475
yading@10 6476
yading@10 6477
yading@10 6478 =head2 mp
yading@10 6479
yading@10 6480
yading@10 6481 Apply an MPlayer filter to the input video.
yading@10 6482
yading@10 6483 This filter provides a wrapper around most of the filters of
yading@10 6484 MPlayer/MEncoder.
yading@10 6485
yading@10 6486 This wrapper is considered experimental. Some of the wrapped filters
yading@10 6487 may not work properly and we may drop support for them, as they will
yading@10 6488 be implemented natively into FFmpeg. Thus you should avoid
yading@10 6489 depending on them when writing portable scripts.
yading@10 6490
yading@10 6491 The filters accepts the parameters:
yading@10 6492 I<filter_name>[:=]I<filter_params>
yading@10 6493
yading@10 6494 I<filter_name> is the name of a supported MPlayer filter,
yading@10 6495 I<filter_params> is a string containing the parameters accepted by
yading@10 6496 the named filter.
yading@10 6497
yading@10 6498 The list of the currently supported filters follows:
yading@10 6499
yading@10 6500 =over 4
yading@10 6501
yading@10 6502
yading@10 6503 =item I<dint>
yading@10 6504
yading@10 6505
yading@10 6506 =item I<down3dright>
yading@10 6507
yading@10 6508
yading@10 6509 =item I<eq2>
yading@10 6510
yading@10 6511
yading@10 6512 =item I<eq>
yading@10 6513
yading@10 6514
yading@10 6515 =item I<fil>
yading@10 6516
yading@10 6517
yading@10 6518 =item I<fspp>
yading@10 6519
yading@10 6520
yading@10 6521 =item I<ilpack>
yading@10 6522
yading@10 6523
yading@10 6524 =item I<mcdeint>
yading@10 6525
yading@10 6526
yading@10 6527 =item I<ow>
yading@10 6528
yading@10 6529
yading@10 6530 =item I<perspective>
yading@10 6531
yading@10 6532
yading@10 6533 =item I<phase>
yading@10 6534
yading@10 6535
yading@10 6536 =item I<pp7>
yading@10 6537
yading@10 6538
yading@10 6539 =item I<pullup>
yading@10 6540
yading@10 6541
yading@10 6542 =item I<qp>
yading@10 6543
yading@10 6544
yading@10 6545 =item I<sab>
yading@10 6546
yading@10 6547
yading@10 6548 =item I<softpulldown>
yading@10 6549
yading@10 6550
yading@10 6551 =item I<spp>
yading@10 6552
yading@10 6553
yading@10 6554 =item I<tinterlace>
yading@10 6555
yading@10 6556
yading@10 6557 =item I<uspp>
yading@10 6558
yading@10 6559
yading@10 6560 =back
yading@10 6561
yading@10 6562
yading@10 6563 The parameter syntax and behavior for the listed filters are the same
yading@10 6564 of the corresponding MPlayer filters. For detailed instructions check
yading@10 6565 the "VIDEO FILTERS" section in the MPlayer manual.
yading@10 6566
yading@10 6567
yading@10 6568 =head3 Examples
yading@10 6569
yading@10 6570
yading@10 6571
yading@10 6572 =over 4
yading@10 6573
yading@10 6574
yading@10 6575 =item *
yading@10 6576
yading@10 6577 Adjust gamma, brightness, contrast:
yading@10 6578
yading@10 6579 mp=eq2=1.0:2:0.5
yading@10 6580
yading@10 6581
yading@10 6582 =back
yading@10 6583
yading@10 6584
yading@10 6585 See also mplayer(1), E<lt>B<http://www.mplayerhq.hu/>E<gt>.
yading@10 6586
yading@10 6587
yading@10 6588 =head2 mpdecimate
yading@10 6589
yading@10 6590
yading@10 6591 Drop frames that do not differ greatly from the previous frame in
yading@10 6592 order to reduce frame rate.
yading@10 6593
yading@10 6594 The main use of this filter is for very-low-bitrate encoding
yading@10 6595 (e.g. streaming over dialup modem), but it could in theory be used for
yading@10 6596 fixing movies that were inverse-telecined incorrectly.
yading@10 6597
yading@10 6598 A description of the accepted options follows.
yading@10 6599
yading@10 6600
yading@10 6601 =over 4
yading@10 6602
yading@10 6603
yading@10 6604 =item B<max>
yading@10 6605
yading@10 6606 Set the maximum number of consecutive frames which can be dropped (if
yading@10 6607 positive), or the minimum interval between dropped frames (if
yading@10 6608 negative). If the value is 0, the frame is dropped unregarding the
yading@10 6609 number of previous sequentially dropped frames.
yading@10 6610
yading@10 6611 Default value is 0.
yading@10 6612
yading@10 6613
yading@10 6614 =item B<hi>
yading@10 6615
yading@10 6616
yading@10 6617 =item B<lo>
yading@10 6618
yading@10 6619
yading@10 6620 =item B<frac>
yading@10 6621
yading@10 6622 Set the dropping threshold values.
yading@10 6623
yading@10 6624 Values for B<hi> and B<lo> are for 8x8 pixel blocks and
yading@10 6625 represent actual pixel value differences, so a threshold of 64
yading@10 6626 corresponds to 1 unit of difference for each pixel, or the same spread
yading@10 6627 out differently over the block.
yading@10 6628
yading@10 6629 A frame is a candidate for dropping if no 8x8 blocks differ by more
yading@10 6630 than a threshold of B<hi>, and if no more than B<frac> blocks (1
yading@10 6631 meaning the whole image) differ by more than a threshold of B<lo>.
yading@10 6632
yading@10 6633 Default value for B<hi> is 64*12, default value for B<lo> is
yading@10 6634 64*5, and default value for B<frac> is 0.33.
yading@10 6635
yading@10 6636 =back
yading@10 6637
yading@10 6638
yading@10 6639
yading@10 6640
yading@10 6641 =head2 negate
yading@10 6642
yading@10 6643
yading@10 6644 Negate input video.
yading@10 6645
yading@10 6646 This filter accepts an integer in input, if non-zero it negates the
yading@10 6647 alpha component (if available). The default value in input is 0.
yading@10 6648
yading@10 6649
yading@10 6650 =head2 noformat
yading@10 6651
yading@10 6652
yading@10 6653 Force libavfilter not to use any of the specified pixel formats for the
yading@10 6654 input to the next filter.
yading@10 6655
yading@10 6656 This filter accepts the following parameters:
yading@10 6657
yading@10 6658 =over 4
yading@10 6659
yading@10 6660
yading@10 6661
yading@10 6662 =item B<pix_fmts>
yading@10 6663
yading@10 6664 A '|'-separated list of pixel format names, for example
yading@10 6665 "pix_fmts=yuv420p|monow|rgb24".
yading@10 6666
yading@10 6667
yading@10 6668 =back
yading@10 6669
yading@10 6670
yading@10 6671
yading@10 6672 =head3 Examples
yading@10 6673
yading@10 6674
yading@10 6675
yading@10 6676 =over 4
yading@10 6677
yading@10 6678
yading@10 6679 =item *
yading@10 6680
yading@10 6681 Force libavfilter to use a format different from I<yuv420p> for the
yading@10 6682 input to the vflip filter:
yading@10 6683
yading@10 6684 noformat=pix_fmts=yuv420p,vflip
yading@10 6685
yading@10 6686
yading@10 6687
yading@10 6688 =item *
yading@10 6689
yading@10 6690 Convert the input video to any of the formats not contained in the list:
yading@10 6691
yading@10 6692 noformat=yuv420p|yuv444p|yuv410p
yading@10 6693
yading@10 6694
yading@10 6695 =back
yading@10 6696
yading@10 6697
yading@10 6698
yading@10 6699 =head2 noise
yading@10 6700
yading@10 6701
yading@10 6702 Add noise on video input frame.
yading@10 6703
yading@10 6704 The filter accepts the following options:
yading@10 6705
yading@10 6706
yading@10 6707 =over 4
yading@10 6708
yading@10 6709
yading@10 6710 =item B<all_seed>
yading@10 6711
yading@10 6712
yading@10 6713 =item B<c0_seed>
yading@10 6714
yading@10 6715
yading@10 6716 =item B<c1_seed>
yading@10 6717
yading@10 6718
yading@10 6719 =item B<c2_seed>
yading@10 6720
yading@10 6721
yading@10 6722 =item B<c3_seed>
yading@10 6723
yading@10 6724 Set noise seed for specific pixel component or all pixel components in case
yading@10 6725 of I<all_seed>. Default value is C<123457>.
yading@10 6726
yading@10 6727
yading@10 6728 =item B<all_strength, alls>
yading@10 6729
yading@10 6730
yading@10 6731 =item B<c0_strength, c0s>
yading@10 6732
yading@10 6733
yading@10 6734 =item B<c1_strength, c1s>
yading@10 6735
yading@10 6736
yading@10 6737 =item B<c2_strength, c2s>
yading@10 6738
yading@10 6739
yading@10 6740 =item B<c3_strength, c3s>
yading@10 6741
yading@10 6742 Set noise strength for specific pixel component or all pixel components in case
yading@10 6743 I<all_strength>. Default value is C<0>. Allowed range is [0, 100].
yading@10 6744
yading@10 6745
yading@10 6746 =item B<all_flags, allf>
yading@10 6747
yading@10 6748
yading@10 6749 =item B<c0_flags, c0f>
yading@10 6750
yading@10 6751
yading@10 6752 =item B<c1_flags, c1f>
yading@10 6753
yading@10 6754
yading@10 6755 =item B<c2_flags, c2f>
yading@10 6756
yading@10 6757
yading@10 6758 =item B<c3_flags, c3f>
yading@10 6759
yading@10 6760 Set pixel component flags or set flags for all components if I<all_flags>.
yading@10 6761 Available values for component flags are:
yading@10 6762
yading@10 6763 =over 4
yading@10 6764
yading@10 6765
yading@10 6766 =item B<a>
yading@10 6767
yading@10 6768 averaged temporal noise (smoother)
yading@10 6769
yading@10 6770 =item B<p>
yading@10 6771
yading@10 6772 mix random noise with a (semi)regular pattern
yading@10 6773
yading@10 6774 =item B<q>
yading@10 6775
yading@10 6776 higher quality (slightly better looking, slightly slower)
yading@10 6777
yading@10 6778 =item B<t>
yading@10 6779
yading@10 6780 temporal noise (noise pattern changes between frames)
yading@10 6781
yading@10 6782 =item B<u>
yading@10 6783
yading@10 6784 uniform noise (gaussian otherwise)
yading@10 6785
yading@10 6786 =back
yading@10 6787
yading@10 6788
yading@10 6789 =back
yading@10 6790
yading@10 6791
yading@10 6792
yading@10 6793 =head3 Examples
yading@10 6794
yading@10 6795
yading@10 6796 Add temporal and uniform noise to input video:
yading@10 6797
yading@10 6798 noise=alls=20:allf=t+u
yading@10 6799
yading@10 6800
yading@10 6801
yading@10 6802 =head2 null
yading@10 6803
yading@10 6804
yading@10 6805 Pass the video source unchanged to the output.
yading@10 6806
yading@10 6807
yading@10 6808 =head2 ocv
yading@10 6809
yading@10 6810
yading@10 6811 Apply video transform using libopencv.
yading@10 6812
yading@10 6813 To enable this filter install libopencv library and headers and
yading@10 6814 configure FFmpeg with C<--enable-libopencv>.
yading@10 6815
yading@10 6816 This filter accepts the following parameters:
yading@10 6817
yading@10 6818
yading@10 6819 =over 4
yading@10 6820
yading@10 6821
yading@10 6822
yading@10 6823 =item B<filter_name>
yading@10 6824
yading@10 6825 The name of the libopencv filter to apply.
yading@10 6826
yading@10 6827
yading@10 6828 =item B<filter_params>
yading@10 6829
yading@10 6830 The parameters to pass to the libopencv filter. If not specified the default
yading@10 6831 values are assumed.
yading@10 6832
yading@10 6833
yading@10 6834 =back
yading@10 6835
yading@10 6836
yading@10 6837 Refer to the official libopencv documentation for more precise
yading@10 6838 information:
yading@10 6839 E<lt>B<http://opencv.willowgarage.com/documentation/c/image_filtering.html>E<gt>
yading@10 6840
yading@10 6841 Follows the list of supported libopencv filters.
yading@10 6842
yading@10 6843
yading@10 6844
yading@10 6845 =head3 dilate
yading@10 6846
yading@10 6847
yading@10 6848 Dilate an image by using a specific structuring element.
yading@10 6849 This filter corresponds to the libopencv function C<cvDilate>.
yading@10 6850
yading@10 6851 It accepts the parameters: I<struct_el>|I<nb_iterations>.
yading@10 6852
yading@10 6853 I<struct_el> represents a structuring element, and has the syntax:
yading@10 6854 I<cols>xI<rows>+I<anchor_x>xI<anchor_y>/I<shape>
yading@10 6855
yading@10 6856 I<cols> and I<rows> represent the number of columns and rows of
yading@10 6857 the structuring element, I<anchor_x> and I<anchor_y> the anchor
yading@10 6858 point, and I<shape> the shape for the structuring element, and
yading@10 6859 can be one of the values "rect", "cross", "ellipse", "custom".
yading@10 6860
yading@10 6861 If the value for I<shape> is "custom", it must be followed by a
yading@10 6862 string of the form "=I<filename>". The file with name
yading@10 6863 I<filename> is assumed to represent a binary image, with each
yading@10 6864 printable character corresponding to a bright pixel. When a custom
yading@10 6865 I<shape> is used, I<cols> and I<rows> are ignored, the number
yading@10 6866 or columns and rows of the read file are assumed instead.
yading@10 6867
yading@10 6868 The default value for I<struct_el> is "3x3+0x0/rect".
yading@10 6869
yading@10 6870 I<nb_iterations> specifies the number of times the transform is
yading@10 6871 applied to the image, and defaults to 1.
yading@10 6872
yading@10 6873 Follow some example:
yading@10 6874
yading@10 6875 # use the default values
yading@10 6876 ocv=dilate
yading@10 6877
yading@10 6878 # dilate using a structuring element with a 5x5 cross, iterate two times
yading@10 6879 ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
yading@10 6880
yading@10 6881 # read the shape from the file diamond.shape, iterate two times
yading@10 6882 # the file diamond.shape may contain a pattern of characters like this:
yading@10 6883 # *
yading@10 6884 # ***
yading@10 6885 # *****
yading@10 6886 # ***
yading@10 6887 # *
yading@10 6888 # the specified cols and rows are ignored (but not the anchor point coordinates)
yading@10 6889 ocv=dilate:0x0+2x2/custom=diamond.shape|2
yading@10 6890
yading@10 6891
yading@10 6892
yading@10 6893 =head3 erode
yading@10 6894
yading@10 6895
yading@10 6896 Erode an image by using a specific structuring element.
yading@10 6897 This filter corresponds to the libopencv function C<cvErode>.
yading@10 6898
yading@10 6899 The filter accepts the parameters: I<struct_el>:I<nb_iterations>,
yading@10 6900 with the same syntax and semantics as the dilate filter.
yading@10 6901
yading@10 6902
yading@10 6903 =head3 smooth
yading@10 6904
yading@10 6905
yading@10 6906 Smooth the input video.
yading@10 6907
yading@10 6908 The filter takes the following parameters:
yading@10 6909 I<type>|I<param1>|I<param2>|I<param3>|I<param4>.
yading@10 6910
yading@10 6911 I<type> is the type of smooth filter to apply, and can be one of
yading@10 6912 the following values: "blur", "blur_no_scale", "median", "gaussian",
yading@10 6913 "bilateral". The default value is "gaussian".
yading@10 6914
yading@10 6915 I<param1>, I<param2>, I<param3>, and I<param4> are
yading@10 6916 parameters whose meanings depend on smooth type. I<param1> and
yading@10 6917 I<param2> accept integer positive values or 0, I<param3> and
yading@10 6918 I<param4> accept float values.
yading@10 6919
yading@10 6920 The default value for I<param1> is 3, the default value for the
yading@10 6921 other parameters is 0.
yading@10 6922
yading@10 6923 These parameters correspond to the parameters assigned to the
yading@10 6924 libopencv function C<cvSmooth>.
yading@10 6925
yading@10 6926
yading@10 6927
yading@10 6928 =head2 overlay
yading@10 6929
yading@10 6930
yading@10 6931 Overlay one video on top of another.
yading@10 6932
yading@10 6933 It takes two inputs and one output, the first input is the "main"
yading@10 6934 video on which the second input is overlayed.
yading@10 6935
yading@10 6936 This filter accepts the following parameters:
yading@10 6937
yading@10 6938 A description of the accepted options follows.
yading@10 6939
yading@10 6940
yading@10 6941 =over 4
yading@10 6942
yading@10 6943
yading@10 6944 =item B<x>
yading@10 6945
yading@10 6946
yading@10 6947 =item B<y>
yading@10 6948
yading@10 6949 Set the expression for the x and y coordinates of the overlayed video
yading@10 6950 on the main video. Default value is "0" for both expressions. In case
yading@10 6951 the expression is invalid, it is set to a huge value (meaning that the
yading@10 6952 overlay will not be displayed within the output visible area).
yading@10 6953
yading@10 6954
yading@10 6955 =item B<enable>
yading@10 6956
yading@10 6957 Set the expression which enables the overlay. If the evaluation is
yading@10 6958 different from 0, the overlay is displayed on top of the input
yading@10 6959 frame. By default it is "1".
yading@10 6960
yading@10 6961
yading@10 6962 =item B<eval>
yading@10 6963
yading@10 6964 Set when the expressions for B<x>, B<y>, and
yading@10 6965 B<enable> are evaluated.
yading@10 6966
yading@10 6967 It accepts the following values:
yading@10 6968
yading@10 6969 =over 4
yading@10 6970
yading@10 6971
yading@10 6972 =item B<init>
yading@10 6973
yading@10 6974 only evaluate expressions once during the filter initialization or
yading@10 6975 when a command is processed
yading@10 6976
yading@10 6977
yading@10 6978 =item B<frame>
yading@10 6979
yading@10 6980 evaluate expressions for each incoming frame
yading@10 6981
yading@10 6982 =back
yading@10 6983
yading@10 6984
yading@10 6985 Default value is B<frame>.
yading@10 6986
yading@10 6987
yading@10 6988 =item B<shortest>
yading@10 6989
yading@10 6990 If set to 1, force the output to terminate when the shortest input
yading@10 6991 terminates. Default value is 0.
yading@10 6992
yading@10 6993
yading@10 6994 =item B<format>
yading@10 6995
yading@10 6996 Set the format for the output video.
yading@10 6997
yading@10 6998 It accepts the following values:
yading@10 6999
yading@10 7000 =over 4
yading@10 7001
yading@10 7002
yading@10 7003 =item B<yuv420>
yading@10 7004
yading@10 7005 force YUV420 output
yading@10 7006
yading@10 7007
yading@10 7008 =item B<yuv444>
yading@10 7009
yading@10 7010 force YUV444 output
yading@10 7011
yading@10 7012
yading@10 7013 =item B<rgb>
yading@10 7014
yading@10 7015 force RGB output
yading@10 7016
yading@10 7017 =back
yading@10 7018
yading@10 7019
yading@10 7020 Default value is B<yuv420>.
yading@10 7021
yading@10 7022
yading@10 7023 =item B<rgb> I<(deprecated)>
yading@10 7024
yading@10 7025 If set to 1, force the filter to accept inputs in the RGB
yading@10 7026 color space. Default value is 0. This option is deprecated, use
yading@10 7027 B<format> instead.
yading@10 7028
yading@10 7029
yading@10 7030 =item B<repeatlast>
yading@10 7031
yading@10 7032 If set to 1, force the filter to draw the last overlay frame over the
yading@10 7033 main input until the end of the stream. A value of 0 disables this
yading@10 7034 behavior, which is enabled by default.
yading@10 7035
yading@10 7036 =back
yading@10 7037
yading@10 7038
yading@10 7039 The B<x>, B<y>, and B<enable> expressions can
yading@10 7040 contain the following parameters.
yading@10 7041
yading@10 7042
yading@10 7043 =over 4
yading@10 7044
yading@10 7045
yading@10 7046 =item B<main_w, W>
yading@10 7047
yading@10 7048
yading@10 7049 =item B<main_h, H>
yading@10 7050
yading@10 7051 main input width and height
yading@10 7052
yading@10 7053
yading@10 7054 =item B<overlay_w, w>
yading@10 7055
yading@10 7056
yading@10 7057 =item B<overlay_h, h>
yading@10 7058
yading@10 7059 overlay input width and height
yading@10 7060
yading@10 7061
yading@10 7062 =item B<x>
yading@10 7063
yading@10 7064
yading@10 7065 =item B<y>
yading@10 7066
yading@10 7067 the computed values for I<x> and I<y>. They are evaluated for
yading@10 7068 each new frame.
yading@10 7069
yading@10 7070
yading@10 7071 =item B<hsub>
yading@10 7072
yading@10 7073
yading@10 7074 =item B<vsub>
yading@10 7075
yading@10 7076 horizontal and vertical chroma subsample values of the output
yading@10 7077 format. For example for the pixel format "yuv422p" I<hsub> is 2 and
yading@10 7078 I<vsub> is 1.
yading@10 7079
yading@10 7080
yading@10 7081 =item B<n>
yading@10 7082
yading@10 7083 the number of input frame, starting from 0
yading@10 7084
yading@10 7085
yading@10 7086 =item B<pos>
yading@10 7087
yading@10 7088 the position in the file of the input frame, NAN if unknown
yading@10 7089
yading@10 7090
yading@10 7091 =item B<t>
yading@10 7092
yading@10 7093 timestamp expressed in seconds, NAN if the input timestamp is unknown
yading@10 7094
yading@10 7095 =back
yading@10 7096
yading@10 7097
yading@10 7098 Note that the I<n>, I<pos>, I<t> variables are available only
yading@10 7099 when evaluation is done I<per frame>, and will evaluate to NAN
yading@10 7100 when B<eval> is set to B<init>.
yading@10 7101
yading@10 7102 Be aware that frames are taken from each input video in timestamp
yading@10 7103 order, hence, if their initial timestamps differ, it is a a good idea
yading@10 7104 to pass the two inputs through a I<setpts=PTS-STARTPTS> filter to
yading@10 7105 have them begin in the same zero timestamp, as it does the example for
yading@10 7106 the I<movie> filter.
yading@10 7107
yading@10 7108 You can chain together more overlays but you should test the
yading@10 7109 efficiency of such approach.
yading@10 7110
yading@10 7111
yading@10 7112 =head3 Commands
yading@10 7113
yading@10 7114
yading@10 7115 This filter supports the following commands:
yading@10 7116
yading@10 7117 =over 4
yading@10 7118
yading@10 7119
yading@10 7120 =item B<x>
yading@10 7121
yading@10 7122
yading@10 7123 =item B<y>
yading@10 7124
yading@10 7125
yading@10 7126 =item B<enable>
yading@10 7127
yading@10 7128 Modify the x/y and enable overlay of the overlay input.
yading@10 7129 The command accepts the same syntax of the corresponding option.
yading@10 7130
yading@10 7131 If the specified expression is not valid, it is kept at its current
yading@10 7132 value.
yading@10 7133
yading@10 7134 =back
yading@10 7135
yading@10 7136
yading@10 7137
yading@10 7138 =head3 Examples
yading@10 7139
yading@10 7140
yading@10 7141
yading@10 7142 =over 4
yading@10 7143
yading@10 7144
yading@10 7145 =item *
yading@10 7146
yading@10 7147 Draw the overlay at 10 pixels from the bottom right corner of the main
yading@10 7148 video:
yading@10 7149
yading@10 7150 overlay=main_w-overlay_w-10:main_h-overlay_h-10
yading@10 7151
yading@10 7152
yading@10 7153 Using named options the example above becomes:
yading@10 7154
yading@10 7155 overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
yading@10 7156
yading@10 7157
yading@10 7158
yading@10 7159 =item *
yading@10 7160
yading@10 7161 Insert a transparent PNG logo in the bottom left corner of the input,
yading@10 7162 using the B<ffmpeg> tool with the C<-filter_complex> option:
yading@10 7163
yading@10 7164 ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
yading@10 7165
yading@10 7166
yading@10 7167
yading@10 7168 =item *
yading@10 7169
yading@10 7170 Insert 2 different transparent PNG logos (second logo on bottom
yading@10 7171 right corner) using the B<ffmpeg> tool:
yading@10 7172
yading@10 7173 ffmpeg -i input -i logo1 -i logo2 -filter_complex 'overlay=x=10:y=H-h-10,overlay=x=W-w-10:y=H-h-10' output
yading@10 7174
yading@10 7175
yading@10 7176
yading@10 7177 =item *
yading@10 7178
yading@10 7179 Add a transparent color layer on top of the main video, C<WxH>
yading@10 7180 must specify the size of the main input to the overlay filter:
yading@10 7181
yading@10 7182 color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
yading@10 7183
yading@10 7184
yading@10 7185
yading@10 7186 =item *
yading@10 7187
yading@10 7188 Play an original video and a filtered version (here with the deshake
yading@10 7189 filter) side by side using the B<ffplay> tool:
yading@10 7190
yading@10 7191 ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
yading@10 7192
yading@10 7193
yading@10 7194 The above command is the same as:
yading@10 7195
yading@10 7196 ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
yading@10 7197
yading@10 7198
yading@10 7199
yading@10 7200 =item *
yading@10 7201
yading@10 7202 Make a sliding overlay appearing from the left to the right top part of the
yading@10 7203 screen starting since time 2:
yading@10 7204
yading@10 7205 overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
yading@10 7206
yading@10 7207
yading@10 7208
yading@10 7209 =item *
yading@10 7210
yading@10 7211 Compose output by putting two input videos side to side:
yading@10 7212
yading@10 7213 ffmpeg -i left.avi -i right.avi -filter_complex "
yading@10 7214 nullsrc=size=200x100 [background];
yading@10 7215 [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
yading@10 7216 [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
yading@10 7217 [background][left] overlay=shortest=1 [background+left];
yading@10 7218 [background+left][right] overlay=shortest=1:x=100 [left+right]
yading@10 7219 "
yading@10 7220
yading@10 7221
yading@10 7222
yading@10 7223 =item *
yading@10 7224
yading@10 7225 Chain several overlays in cascade:
yading@10 7226
yading@10 7227 nullsrc=s=200x200 [bg];
yading@10 7228 testsrc=s=100x100, split=4 [in0][in1][in2][in3];
yading@10 7229 [in0] lutrgb=r=0, [bg] overlay=0:0 [mid0];
yading@10 7230 [in1] lutrgb=g=0, [mid0] overlay=100:0 [mid1];
yading@10 7231 [in2] lutrgb=b=0, [mid1] overlay=0:100 [mid2];
yading@10 7232 [in3] null, [mid2] overlay=100:100 [out0]
yading@10 7233
yading@10 7234
yading@10 7235
yading@10 7236 =back
yading@10 7237
yading@10 7238
yading@10 7239
yading@10 7240 =head2 pad
yading@10 7241
yading@10 7242
yading@10 7243 Add paddings to the input image, and place the original input at the
yading@10 7244 given coordinates I<x>, I<y>.
yading@10 7245
yading@10 7246 This filter accepts the following parameters:
yading@10 7247
yading@10 7248
yading@10 7249 =over 4
yading@10 7250
yading@10 7251
yading@10 7252 =item B<width, w>
yading@10 7253
yading@10 7254
yading@10 7255 =item B<height, h>
yading@10 7256
yading@10 7257 Specify an expression for the size of the output image with the
yading@10 7258 paddings added. If the value for I<width> or I<height> is 0, the
yading@10 7259 corresponding input size is used for the output.
yading@10 7260
yading@10 7261 The I<width> expression can reference the value set by the
yading@10 7262 I<height> expression, and vice versa.
yading@10 7263
yading@10 7264 The default value of I<width> and I<height> is 0.
yading@10 7265
yading@10 7266
yading@10 7267 =item B<x>
yading@10 7268
yading@10 7269
yading@10 7270 =item B<y>
yading@10 7271
yading@10 7272 Specify an expression for the offsets where to place the input image
yading@10 7273 in the padded area with respect to the top/left border of the output
yading@10 7274 image.
yading@10 7275
yading@10 7276 The I<x> expression can reference the value set by the I<y>
yading@10 7277 expression, and vice versa.
yading@10 7278
yading@10 7279 The default value of I<x> and I<y> is 0.
yading@10 7280
yading@10 7281
yading@10 7282 =item B<color>
yading@10 7283
yading@10 7284 Specify the color of the padded area, it can be the name of a color
yading@10 7285 (case insensitive match) or a 0xRRGGBB[AA] sequence.
yading@10 7286
yading@10 7287 The default value of I<color> is "black".
yading@10 7288
yading@10 7289 =back
yading@10 7290
yading@10 7291
yading@10 7292 The value for the I<width>, I<height>, I<x>, and I<y>
yading@10 7293 options are expressions containing the following constants:
yading@10 7294
yading@10 7295
yading@10 7296 =over 4
yading@10 7297
yading@10 7298
yading@10 7299 =item B<in_w, in_h>
yading@10 7300
yading@10 7301 the input video width and height
yading@10 7302
yading@10 7303
yading@10 7304 =item B<iw, ih>
yading@10 7305
yading@10 7306 same as I<in_w> and I<in_h>
yading@10 7307
yading@10 7308
yading@10 7309 =item B<out_w, out_h>
yading@10 7310
yading@10 7311 the output width and height, that is the size of the padded area as
yading@10 7312 specified by the I<width> and I<height> expressions
yading@10 7313
yading@10 7314
yading@10 7315 =item B<ow, oh>
yading@10 7316
yading@10 7317 same as I<out_w> and I<out_h>
yading@10 7318
yading@10 7319
yading@10 7320 =item B<x, y>
yading@10 7321
yading@10 7322 x and y offsets as specified by the I<x> and I<y>
yading@10 7323 expressions, or NAN if not yet specified
yading@10 7324
yading@10 7325
yading@10 7326 =item B<a>
yading@10 7327
yading@10 7328 same as I<iw> / I<ih>
yading@10 7329
yading@10 7330
yading@10 7331 =item B<sar>
yading@10 7332
yading@10 7333 input sample aspect ratio
yading@10 7334
yading@10 7335
yading@10 7336 =item B<dar>
yading@10 7337
yading@10 7338 input display aspect ratio, it is the same as (I<iw> / I<ih>) * I<sar>
yading@10 7339
yading@10 7340
yading@10 7341 =item B<hsub, vsub>
yading@10 7342
yading@10 7343 horizontal and vertical chroma subsample values. For example for the
yading@10 7344 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 7345
yading@10 7346 =back
yading@10 7347
yading@10 7348
yading@10 7349
yading@10 7350 =head3 Examples
yading@10 7351
yading@10 7352
yading@10 7353
yading@10 7354 =over 4
yading@10 7355
yading@10 7356
yading@10 7357 =item *
yading@10 7358
yading@10 7359 Add paddings with color "violet" to the input video. Output video
yading@10 7360 size is 640x480, the top-left corner of the input video is placed at
yading@10 7361 column 0, row 40:
yading@10 7362
yading@10 7363 pad=640:480:0:40:violet
yading@10 7364
yading@10 7365
yading@10 7366 The example above is equivalent to the following command:
yading@10 7367
yading@10 7368 pad=width=640:height=480:x=0:y=40:color=violet
yading@10 7369
yading@10 7370
yading@10 7371
yading@10 7372 =item *
yading@10 7373
yading@10 7374 Pad the input to get an output with dimensions increased by 3/2,
yading@10 7375 and put the input video at the center of the padded area:
yading@10 7376
yading@10 7377 pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
yading@10 7378
yading@10 7379
yading@10 7380
yading@10 7381 =item *
yading@10 7382
yading@10 7383 Pad the input to get a squared output with size equal to the maximum
yading@10 7384 value between the input width and height, and put the input video at
yading@10 7385 the center of the padded area:
yading@10 7386
yading@10 7387 pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
yading@10 7388
yading@10 7389
yading@10 7390
yading@10 7391 =item *
yading@10 7392
yading@10 7393 Pad the input to get a final w/h ratio of 16:9:
yading@10 7394
yading@10 7395 pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
yading@10 7396
yading@10 7397
yading@10 7398
yading@10 7399 =item *
yading@10 7400
yading@10 7401 In case of anamorphic video, in order to set the output display aspect
yading@10 7402 correctly, it is necessary to use I<sar> in the expression,
yading@10 7403 according to the relation:
yading@10 7404
yading@10 7405 (ih * X / ih) * sar = output_dar
yading@10 7406 X = output_dar / sar
yading@10 7407
yading@10 7408
yading@10 7409 Thus the previous example needs to be modified to:
yading@10 7410
yading@10 7411 pad="ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2"
yading@10 7412
yading@10 7413
yading@10 7414
yading@10 7415 =item *
yading@10 7416
yading@10 7417 Double output size and put the input video in the bottom-right
yading@10 7418 corner of the output padded area:
yading@10 7419
yading@10 7420 pad="2*iw:2*ih:ow-iw:oh-ih"
yading@10 7421
yading@10 7422
yading@10 7423 =back
yading@10 7424
yading@10 7425
yading@10 7426
yading@10 7427 =head2 pixdesctest
yading@10 7428
yading@10 7429
yading@10 7430 Pixel format descriptor test filter, mainly useful for internal
yading@10 7431 testing. The output video should be equal to the input video.
yading@10 7432
yading@10 7433 For example:
yading@10 7434
yading@10 7435 format=monow, pixdesctest
yading@10 7436
yading@10 7437
yading@10 7438 can be used to test the monowhite pixel format descriptor definition.
yading@10 7439
yading@10 7440
yading@10 7441 =head2 pp
yading@10 7442
yading@10 7443
yading@10 7444 Enable the specified chain of postprocessing subfilters using libpostproc. This
yading@10 7445 library should be automatically selected with a GPL build (C<--enable-gpl>).
yading@10 7446 Subfilters must be separated by '/' and can be disabled by prepending a '-'.
yading@10 7447 Each subfilter and some options have a short and a long name that can be used
yading@10 7448 interchangeably, i.e. dr/dering are the same.
yading@10 7449
yading@10 7450 The filters accept the following options:
yading@10 7451
yading@10 7452
yading@10 7453 =over 4
yading@10 7454
yading@10 7455
yading@10 7456 =item B<subfilters>
yading@10 7457
yading@10 7458 Set postprocessing subfilters string.
yading@10 7459
yading@10 7460 =back
yading@10 7461
yading@10 7462
yading@10 7463 All subfilters share common options to determine their scope:
yading@10 7464
yading@10 7465
yading@10 7466 =over 4
yading@10 7467
yading@10 7468
yading@10 7469 =item B<a/autoq>
yading@10 7470
yading@10 7471 Honor the quality commands for this subfilter.
yading@10 7472
yading@10 7473
yading@10 7474 =item B<c/chrom>
yading@10 7475
yading@10 7476 Do chrominance filtering, too (default).
yading@10 7477
yading@10 7478
yading@10 7479 =item B<y/nochrom>
yading@10 7480
yading@10 7481 Do luminance filtering only (no chrominance).
yading@10 7482
yading@10 7483
yading@10 7484 =item B<n/noluma>
yading@10 7485
yading@10 7486 Do chrominance filtering only (no luminance).
yading@10 7487
yading@10 7488 =back
yading@10 7489
yading@10 7490
yading@10 7491 These options can be appended after the subfilter name, separated by a '|'.
yading@10 7492
yading@10 7493 Available subfilters are:
yading@10 7494
yading@10 7495
yading@10 7496 =over 4
yading@10 7497
yading@10 7498
yading@10 7499 =item B<hb/hdeblock[|difference[|flatness]]>
yading@10 7500
yading@10 7501 Horizontal deblocking filter
yading@10 7502
yading@10 7503 =over 4
yading@10 7504
yading@10 7505
yading@10 7506 =item B<difference>
yading@10 7507
yading@10 7508 Difference factor where higher values mean more deblocking (default: C<32>).
yading@10 7509
yading@10 7510 =item B<flatness>
yading@10 7511
yading@10 7512 Flatness threshold where lower values mean more deblocking (default: C<39>).
yading@10 7513
yading@10 7514 =back
yading@10 7515
yading@10 7516
yading@10 7517
yading@10 7518 =item B<vb/vdeblock[|difference[|flatness]]>
yading@10 7519
yading@10 7520 Vertical deblocking filter
yading@10 7521
yading@10 7522 =over 4
yading@10 7523
yading@10 7524
yading@10 7525 =item B<difference>
yading@10 7526
yading@10 7527 Difference factor where higher values mean more deblocking (default: C<32>).
yading@10 7528
yading@10 7529 =item B<flatness>
yading@10 7530
yading@10 7531 Flatness threshold where lower values mean more deblocking (default: C<39>).
yading@10 7532
yading@10 7533 =back
yading@10 7534
yading@10 7535
yading@10 7536
yading@10 7537 =item B<ha/hadeblock[|difference[|flatness]]>
yading@10 7538
yading@10 7539 Accurate horizontal deblocking filter
yading@10 7540
yading@10 7541 =over 4
yading@10 7542
yading@10 7543
yading@10 7544 =item B<difference>
yading@10 7545
yading@10 7546 Difference factor where higher values mean more deblocking (default: C<32>).
yading@10 7547
yading@10 7548 =item B<flatness>
yading@10 7549
yading@10 7550 Flatness threshold where lower values mean more deblocking (default: C<39>).
yading@10 7551
yading@10 7552 =back
yading@10 7553
yading@10 7554
yading@10 7555
yading@10 7556 =item B<va/vadeblock[|difference[|flatness]]>
yading@10 7557
yading@10 7558 Accurate vertical deblocking filter
yading@10 7559
yading@10 7560 =over 4
yading@10 7561
yading@10 7562
yading@10 7563 =item B<difference>
yading@10 7564
yading@10 7565 Difference factor where higher values mean more deblocking (default: C<32>).
yading@10 7566
yading@10 7567 =item B<flatness>
yading@10 7568
yading@10 7569 Flatness threshold where lower values mean more deblocking (default: C<39>).
yading@10 7570
yading@10 7571 =back
yading@10 7572
yading@10 7573
yading@10 7574 =back
yading@10 7575
yading@10 7576
yading@10 7577 The horizontal and vertical deblocking filters share the difference and
yading@10 7578 flatness values so you cannot set different horizontal and vertical
yading@10 7579 thresholds.
yading@10 7580
yading@10 7581
yading@10 7582 =over 4
yading@10 7583
yading@10 7584
yading@10 7585 =item B<h1/x1hdeblock>
yading@10 7586
yading@10 7587 Experimental horizontal deblocking filter
yading@10 7588
yading@10 7589
yading@10 7590 =item B<v1/x1vdeblock>
yading@10 7591
yading@10 7592 Experimental vertical deblocking filter
yading@10 7593
yading@10 7594
yading@10 7595 =item B<dr/dering>
yading@10 7596
yading@10 7597 Deringing filter
yading@10 7598
yading@10 7599
yading@10 7600 =item B<tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer>
yading@10 7601
yading@10 7602
yading@10 7603 =over 4
yading@10 7604
yading@10 7605
yading@10 7606 =item B<threshold1>
yading@10 7607
yading@10 7608 larger -E<gt> stronger filtering
yading@10 7609
yading@10 7610 =item B<threshold2>
yading@10 7611
yading@10 7612 larger -E<gt> stronger filtering
yading@10 7613
yading@10 7614 =item B<threshold3>
yading@10 7615
yading@10 7616 larger -E<gt> stronger filtering
yading@10 7617
yading@10 7618 =back
yading@10 7619
yading@10 7620
yading@10 7621
yading@10 7622 =item B<al/autolevels[:f/fullyrange], automatic brightness / contrast correction>
yading@10 7623
yading@10 7624
yading@10 7625 =over 4
yading@10 7626
yading@10 7627
yading@10 7628 =item B<f/fullyrange>
yading@10 7629
yading@10 7630 Stretch luminance to C<0-255>.
yading@10 7631
yading@10 7632 =back
yading@10 7633
yading@10 7634
yading@10 7635
yading@10 7636 =item B<lb/linblenddeint>
yading@10 7637
yading@10 7638 Linear blend deinterlacing filter that deinterlaces the given block by
yading@10 7639 filtering all lines with a C<(1 2 1)> filter.
yading@10 7640
yading@10 7641
yading@10 7642 =item B<li/linipoldeint>
yading@10 7643
yading@10 7644 Linear interpolating deinterlacing filter that deinterlaces the given block by
yading@10 7645 linearly interpolating every second line.
yading@10 7646
yading@10 7647
yading@10 7648 =item B<ci/cubicipoldeint>
yading@10 7649
yading@10 7650 Cubic interpolating deinterlacing filter deinterlaces the given block by
yading@10 7651 cubically interpolating every second line.
yading@10 7652
yading@10 7653
yading@10 7654 =item B<md/mediandeint>
yading@10 7655
yading@10 7656 Median deinterlacing filter that deinterlaces the given block by applying a
yading@10 7657 median filter to every second line.
yading@10 7658
yading@10 7659
yading@10 7660 =item B<fd/ffmpegdeint>
yading@10 7661
yading@10 7662 FFmpeg deinterlacing filter that deinterlaces the given block by filtering every
yading@10 7663 second line with a C<(-1 4 2 4 -1)> filter.
yading@10 7664
yading@10 7665
yading@10 7666 =item B<l5/lowpass5>
yading@10 7667
yading@10 7668 Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given
yading@10 7669 block by filtering all lines with a C<(-1 2 6 2 -1)> filter.
yading@10 7670
yading@10 7671
yading@10 7672 =item B<fq/forceQuant[|quantizer]>
yading@10 7673
yading@10 7674 Overrides the quantizer table from the input with the constant quantizer you
yading@10 7675 specify.
yading@10 7676
yading@10 7677 =over 4
yading@10 7678
yading@10 7679
yading@10 7680 =item B<quantizer>
yading@10 7681
yading@10 7682 Quantizer to use
yading@10 7683
yading@10 7684 =back
yading@10 7685
yading@10 7686
yading@10 7687
yading@10 7688 =item B<de/default>
yading@10 7689
yading@10 7690 Default pp filter combination (C<hb|a,vb|a,dr|a>)
yading@10 7691
yading@10 7692
yading@10 7693 =item B<fa/fast>
yading@10 7694
yading@10 7695 Fast pp filter combination (C<h1|a,v1|a,dr|a>)
yading@10 7696
yading@10 7697
yading@10 7698 =item B<ac>
yading@10 7699
yading@10 7700 High quality pp filter combination (C<ha|a|128|7,va|a,dr|a>)
yading@10 7701
yading@10 7702 =back
yading@10 7703
yading@10 7704
yading@10 7705
yading@10 7706 =head3 Examples
yading@10 7707
yading@10 7708
yading@10 7709
yading@10 7710 =over 4
yading@10 7711
yading@10 7712
yading@10 7713 =item *
yading@10 7714
yading@10 7715 Apply horizontal and vertical deblocking, deringing and automatic
yading@10 7716 brightness/contrast:
yading@10 7717
yading@10 7718 pp=hb/vb/dr/al
yading@10 7719
yading@10 7720
yading@10 7721
yading@10 7722 =item *
yading@10 7723
yading@10 7724 Apply default filters without brightness/contrast correction:
yading@10 7725
yading@10 7726 pp=de/-al
yading@10 7727
yading@10 7728
yading@10 7729
yading@10 7730 =item *
yading@10 7731
yading@10 7732 Apply default filters and temporal denoiser:
yading@10 7733
yading@10 7734 pp=default/tmpnoise|1|2|3
yading@10 7735
yading@10 7736
yading@10 7737
yading@10 7738 =item *
yading@10 7739
yading@10 7740 Apply deblocking on luminance only, and switch vertical deblocking on or off
yading@10 7741 automatically depending on available CPU time:
yading@10 7742
yading@10 7743 pp=hb|y/vb|a
yading@10 7744
yading@10 7745
yading@10 7746 =back
yading@10 7747
yading@10 7748
yading@10 7749
yading@10 7750 =head2 removelogo
yading@10 7751
yading@10 7752
yading@10 7753 Suppress a TV station logo, using an image file to determine which
yading@10 7754 pixels comprise the logo. It works by filling in the pixels that
yading@10 7755 comprise the logo with neighboring pixels.
yading@10 7756
yading@10 7757 The filters accept the following options:
yading@10 7758
yading@10 7759
yading@10 7760 =over 4
yading@10 7761
yading@10 7762
yading@10 7763 =item B<filename, f>
yading@10 7764
yading@10 7765 Set the filter bitmap file, which can be any image format supported by
yading@10 7766 libavformat. The width and height of the image file must match those of the
yading@10 7767 video stream being processed.
yading@10 7768
yading@10 7769 =back
yading@10 7770
yading@10 7771
yading@10 7772 Pixels in the provided bitmap image with a value of zero are not
yading@10 7773 considered part of the logo, non-zero pixels are considered part of
yading@10 7774 the logo. If you use white (255) for the logo and black (0) for the
yading@10 7775 rest, you will be safe. For making the filter bitmap, it is
yading@10 7776 recommended to take a screen capture of a black frame with the logo
yading@10 7777 visible, and then using a threshold filter followed by the erode
yading@10 7778 filter once or twice.
yading@10 7779
yading@10 7780 If needed, little splotches can be fixed manually. Remember that if
yading@10 7781 logo pixels are not covered, the filter quality will be much
yading@10 7782 reduced. Marking too many pixels as part of the logo does not hurt as
yading@10 7783 much, but it will increase the amount of blurring needed to cover over
yading@10 7784 the image and will destroy more information than necessary, and extra
yading@10 7785 pixels will slow things down on a large logo.
yading@10 7786
yading@10 7787
yading@10 7788 =head2 scale
yading@10 7789
yading@10 7790
yading@10 7791 Scale (resize) the input video, using the libswscale library.
yading@10 7792
yading@10 7793 The scale filter forces the output display aspect ratio to be the same
yading@10 7794 of the input, by changing the output sample aspect ratio.
yading@10 7795
yading@10 7796 The filter accepts the following options:
yading@10 7797
yading@10 7798
yading@10 7799 =over 4
yading@10 7800
yading@10 7801
yading@10 7802 =item B<width, w>
yading@10 7803
yading@10 7804 Output video width.
yading@10 7805 default value is C<iw>. See below
yading@10 7806 for the list of accepted constants.
yading@10 7807
yading@10 7808
yading@10 7809 =item B<height, h>
yading@10 7810
yading@10 7811 Output video height.
yading@10 7812 default value is C<ih>.
yading@10 7813 See below for the list of accepted constants.
yading@10 7814
yading@10 7815
yading@10 7816 =item B<interl>
yading@10 7817
yading@10 7818 Set the interlacing. It accepts the following values:
yading@10 7819
yading@10 7820
yading@10 7821 =over 4
yading@10 7822
yading@10 7823
yading@10 7824 =item B<1>
yading@10 7825
yading@10 7826 force interlaced aware scaling
yading@10 7827
yading@10 7828
yading@10 7829 =item B<0>
yading@10 7830
yading@10 7831 do not apply interlaced scaling
yading@10 7832
yading@10 7833
yading@10 7834 =item B<-1>
yading@10 7835
yading@10 7836 select interlaced aware scaling depending on whether the source frames
yading@10 7837 are flagged as interlaced or not
yading@10 7838
yading@10 7839 =back
yading@10 7840
yading@10 7841
yading@10 7842 Default value is C<0>.
yading@10 7843
yading@10 7844
yading@10 7845 =item B<flags>
yading@10 7846
yading@10 7847 Set libswscale scaling flags. If not explictly specified the filter
yading@10 7848 applies a bilinear scaling algorithm.
yading@10 7849
yading@10 7850
yading@10 7851 =item B<size, s>
yading@10 7852
yading@10 7853 Set the video size, the value must be a valid abbreviation or in the
yading@10 7854 form I<width>xI<height>.
yading@10 7855
yading@10 7856 =back
yading@10 7857
yading@10 7858
yading@10 7859 The values of the I<w> and I<h> options are expressions
yading@10 7860 containing the following constants:
yading@10 7861
yading@10 7862
yading@10 7863 =over 4
yading@10 7864
yading@10 7865
yading@10 7866 =item B<in_w, in_h>
yading@10 7867
yading@10 7868 the input width and height
yading@10 7869
yading@10 7870
yading@10 7871 =item B<iw, ih>
yading@10 7872
yading@10 7873 same as I<in_w> and I<in_h>
yading@10 7874
yading@10 7875
yading@10 7876 =item B<out_w, out_h>
yading@10 7877
yading@10 7878 the output (cropped) width and height
yading@10 7879
yading@10 7880
yading@10 7881 =item B<ow, oh>
yading@10 7882
yading@10 7883 same as I<out_w> and I<out_h>
yading@10 7884
yading@10 7885
yading@10 7886 =item B<a>
yading@10 7887
yading@10 7888 same as I<iw> / I<ih>
yading@10 7889
yading@10 7890
yading@10 7891 =item B<sar>
yading@10 7892
yading@10 7893 input sample aspect ratio
yading@10 7894
yading@10 7895
yading@10 7896 =item B<dar>
yading@10 7897
yading@10 7898 input display aspect ratio, it is the same as (I<iw> / I<ih>) * I<sar>
yading@10 7899
yading@10 7900
yading@10 7901 =item B<hsub, vsub>
yading@10 7902
yading@10 7903 horizontal and vertical chroma subsample values. For example for the
yading@10 7904 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 7905
yading@10 7906 =back
yading@10 7907
yading@10 7908
yading@10 7909 If the input image format is different from the format requested by
yading@10 7910 the next filter, the scale filter will convert the input to the
yading@10 7911 requested format.
yading@10 7912
yading@10 7913 If the value for I<w> or I<h> is 0, the respective input
yading@10 7914 size is used for the output.
yading@10 7915
yading@10 7916 If the value for I<w> or I<h> is -1, the scale filter will use, for the
yading@10 7917 respective output size, a value that maintains the aspect ratio of the input
yading@10 7918 image.
yading@10 7919
yading@10 7920
yading@10 7921 =head3 Examples
yading@10 7922
yading@10 7923
yading@10 7924
yading@10 7925 =over 4
yading@10 7926
yading@10 7927
yading@10 7928 =item *
yading@10 7929
yading@10 7930 Scale the input video to a size of 200x100:
yading@10 7931
yading@10 7932 scale=w=200:h=100
yading@10 7933
yading@10 7934
yading@10 7935 This is equivalent to:
yading@10 7936
yading@10 7937 scale=w=200:h=100
yading@10 7938
yading@10 7939
yading@10 7940 or:
yading@10 7941
yading@10 7942 scale=200x100
yading@10 7943
yading@10 7944
yading@10 7945
yading@10 7946 =item *
yading@10 7947
yading@10 7948 Specify a size abbreviation for the output size:
yading@10 7949
yading@10 7950 scale=qcif
yading@10 7951
yading@10 7952
yading@10 7953 which can also be written as:
yading@10 7954
yading@10 7955 scale=size=qcif
yading@10 7956
yading@10 7957
yading@10 7958
yading@10 7959 =item *
yading@10 7960
yading@10 7961 Scale the input to 2x:
yading@10 7962
yading@10 7963 scale=w=2*iw:h=2*ih
yading@10 7964
yading@10 7965
yading@10 7966
yading@10 7967 =item *
yading@10 7968
yading@10 7969 The above is the same as:
yading@10 7970
yading@10 7971 scale=2*in_w:2*in_h
yading@10 7972
yading@10 7973
yading@10 7974
yading@10 7975 =item *
yading@10 7976
yading@10 7977 Scale the input to 2x with forced interlaced scaling:
yading@10 7978
yading@10 7979 scale=2*iw:2*ih:interl=1
yading@10 7980
yading@10 7981
yading@10 7982
yading@10 7983 =item *
yading@10 7984
yading@10 7985 Scale the input to half size:
yading@10 7986
yading@10 7987 scale=w=iw/2:h=ih/2
yading@10 7988
yading@10 7989
yading@10 7990
yading@10 7991 =item *
yading@10 7992
yading@10 7993 Increase the width, and set the height to the same size:
yading@10 7994
yading@10 7995 scale=3/2*iw:ow
yading@10 7996
yading@10 7997
yading@10 7998
yading@10 7999 =item *
yading@10 8000
yading@10 8001 Seek for Greek harmony:
yading@10 8002
yading@10 8003 scale=iw:1/PHI*iw
yading@10 8004 scale=ih*PHI:ih
yading@10 8005
yading@10 8006
yading@10 8007
yading@10 8008 =item *
yading@10 8009
yading@10 8010 Increase the height, and set the width to 3/2 of the height:
yading@10 8011
yading@10 8012 scale=w=3/2*oh:h=3/5*ih
yading@10 8013
yading@10 8014
yading@10 8015
yading@10 8016 =item *
yading@10 8017
yading@10 8018 Increase the size, but make the size a multiple of the chroma
yading@10 8019 subsample values:
yading@10 8020
yading@10 8021 scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
yading@10 8022
yading@10 8023
yading@10 8024
yading@10 8025 =item *
yading@10 8026
yading@10 8027 Increase the width to a maximum of 500 pixels, keep the same input
yading@10 8028 aspect ratio:
yading@10 8029
yading@10 8030 scale=w='min(500\, iw*3/2):h=-1'
yading@10 8031
yading@10 8032
yading@10 8033 =back
yading@10 8034
yading@10 8035
yading@10 8036
yading@10 8037 =head2 separatefields
yading@10 8038
yading@10 8039
yading@10 8040 The C<separatefields> takes a frame-based video input and splits
yading@10 8041 each frame into its components fields, producing a new half height clip
yading@10 8042 with twice the frame rate and twice the frame count.
yading@10 8043
yading@10 8044 This filter use field-dominance information in frame to decide which
yading@10 8045 of each pair of fields to place first in the output.
yading@10 8046 If it gets it wrong use setfield filter before C<separatefields> filter.
yading@10 8047
yading@10 8048
yading@10 8049 =head2 setdar, setsar
yading@10 8050
yading@10 8051
yading@10 8052 The C<setdar> filter sets the Display Aspect Ratio for the filter
yading@10 8053 output video.
yading@10 8054
yading@10 8055 This is done by changing the specified Sample (aka Pixel) Aspect
yading@10 8056 Ratio, according to the following equation:
yading@10 8057
yading@10 8058 <DAR> = <HORIZONTAL_RESOLUTION> / <VERTICAL_RESOLUTION> * <SAR>
yading@10 8059
yading@10 8060
yading@10 8061 Keep in mind that the C<setdar> filter does not modify the pixel
yading@10 8062 dimensions of the video frame. Also the display aspect ratio set by
yading@10 8063 this filter may be changed by later filters in the filterchain,
yading@10 8064 e.g. in case of scaling or if another "setdar" or a "setsar" filter is
yading@10 8065 applied.
yading@10 8066
yading@10 8067 The C<setsar> filter sets the Sample (aka Pixel) Aspect Ratio for
yading@10 8068 the filter output video.
yading@10 8069
yading@10 8070 Note that as a consequence of the application of this filter, the
yading@10 8071 output display aspect ratio will change according to the equation
yading@10 8072 above.
yading@10 8073
yading@10 8074 Keep in mind that the sample aspect ratio set by the C<setsar>
yading@10 8075 filter may be changed by later filters in the filterchain, e.g. if
yading@10 8076 another "setsar" or a "setdar" filter is applied.
yading@10 8077
yading@10 8078 The filters accept the following options:
yading@10 8079
yading@10 8080
yading@10 8081 =over 4
yading@10 8082
yading@10 8083
yading@10 8084 =item B<r, ratio, dar (C<setdar> only), sar (C<setsar> only)>
yading@10 8085
yading@10 8086 Set the aspect ratio used by the filter.
yading@10 8087
yading@10 8088 The parameter can be a floating point number string, an expression, or
yading@10 8089 a string of the form I<num>:I<den>, where I<num> and
yading@10 8090 I<den> are the numerator and denominator of the aspect ratio. If
yading@10 8091 the parameter is not specified, it is assumed the value "0".
yading@10 8092 In case the form "I<num>:I<den>" is used, the C<:> character
yading@10 8093 should be escaped.
yading@10 8094
yading@10 8095
yading@10 8096 =item B<max>
yading@10 8097
yading@10 8098 Set the maximum integer value to use for expressing numerator and
yading@10 8099 denominator when reducing the expressed aspect ratio to a rational.
yading@10 8100 Default value is C<100>.
yading@10 8101
yading@10 8102
yading@10 8103 =back
yading@10 8104
yading@10 8105
yading@10 8106
yading@10 8107 =head3 Examples
yading@10 8108
yading@10 8109
yading@10 8110
yading@10 8111 =over 4
yading@10 8112
yading@10 8113
yading@10 8114
yading@10 8115 =item *
yading@10 8116
yading@10 8117 To change the display aspect ratio to 16:9, specify one of the following:
yading@10 8118
yading@10 8119 setdar=dar=1.77777
yading@10 8120 setdar=dar=16/9
yading@10 8121 setdar=dar=1.77777
yading@10 8122
yading@10 8123
yading@10 8124
yading@10 8125 =item *
yading@10 8126
yading@10 8127 To change the sample aspect ratio to 10:11, specify:
yading@10 8128
yading@10 8129 setsar=sar=10/11
yading@10 8130
yading@10 8131
yading@10 8132
yading@10 8133 =item *
yading@10 8134
yading@10 8135 To set a display aspect ratio of 16:9, and specify a maximum integer value of
yading@10 8136 1000 in the aspect ratio reduction, use the command:
yading@10 8137
yading@10 8138 setdar=ratio=16/9:max=1000
yading@10 8139
yading@10 8140
yading@10 8141
yading@10 8142 =back
yading@10 8143
yading@10 8144
yading@10 8145
yading@10 8146
yading@10 8147 =head2 setfield
yading@10 8148
yading@10 8149
yading@10 8150 Force field for the output video frame.
yading@10 8151
yading@10 8152 The C<setfield> filter marks the interlace type field for the
yading@10 8153 output frames. It does not change the input frame, but only sets the
yading@10 8154 corresponding property, which affects how the frame is treated by
yading@10 8155 following filters (e.g. C<fieldorder> or C<yadif>).
yading@10 8156
yading@10 8157 The filter accepts the following options:
yading@10 8158
yading@10 8159
yading@10 8160 =over 4
yading@10 8161
yading@10 8162
yading@10 8163
yading@10 8164 =item B<mode>
yading@10 8165
yading@10 8166 Available values are:
yading@10 8167
yading@10 8168
yading@10 8169 =over 4
yading@10 8170
yading@10 8171
yading@10 8172 =item B<auto>
yading@10 8173
yading@10 8174 Keep the same field property.
yading@10 8175
yading@10 8176
yading@10 8177 =item B<bff>
yading@10 8178
yading@10 8179 Mark the frame as bottom-field-first.
yading@10 8180
yading@10 8181
yading@10 8182 =item B<tff>
yading@10 8183
yading@10 8184 Mark the frame as top-field-first.
yading@10 8185
yading@10 8186
yading@10 8187 =item B<prog>
yading@10 8188
yading@10 8189 Mark the frame as progressive.
yading@10 8190
yading@10 8191 =back
yading@10 8192
yading@10 8193
yading@10 8194 =back
yading@10 8195
yading@10 8196
yading@10 8197
yading@10 8198 =head2 showinfo
yading@10 8199
yading@10 8200
yading@10 8201 Show a line containing various information for each input video frame.
yading@10 8202 The input video is not modified.
yading@10 8203
yading@10 8204 The shown line contains a sequence of key/value pairs of the form
yading@10 8205 I<key>:I<value>.
yading@10 8206
yading@10 8207 A description of each shown parameter follows:
yading@10 8208
yading@10 8209
yading@10 8210 =over 4
yading@10 8211
yading@10 8212
yading@10 8213 =item B<n>
yading@10 8214
yading@10 8215 sequential number of the input frame, starting from 0
yading@10 8216
yading@10 8217
yading@10 8218 =item B<pts>
yading@10 8219
yading@10 8220 Presentation TimeStamp of the input frame, expressed as a number of
yading@10 8221 time base units. The time base unit depends on the filter input pad.
yading@10 8222
yading@10 8223
yading@10 8224 =item B<pts_time>
yading@10 8225
yading@10 8226 Presentation TimeStamp of the input frame, expressed as a number of
yading@10 8227 seconds
yading@10 8228
yading@10 8229
yading@10 8230 =item B<pos>
yading@10 8231
yading@10 8232 position of the frame in the input stream, -1 if this information in
yading@10 8233 unavailable and/or meaningless (for example in case of synthetic video)
yading@10 8234
yading@10 8235
yading@10 8236 =item B<fmt>
yading@10 8237
yading@10 8238 pixel format name
yading@10 8239
yading@10 8240
yading@10 8241 =item B<sar>
yading@10 8242
yading@10 8243 sample aspect ratio of the input frame, expressed in the form
yading@10 8244 I<num>/I<den>
yading@10 8245
yading@10 8246
yading@10 8247 =item B<s>
yading@10 8248
yading@10 8249 size of the input frame, expressed in the form
yading@10 8250 I<width>xI<height>
yading@10 8251
yading@10 8252
yading@10 8253 =item B<i>
yading@10 8254
yading@10 8255 interlaced mode ("P" for "progressive", "T" for top field first, "B"
yading@10 8256 for bottom field first)
yading@10 8257
yading@10 8258
yading@10 8259 =item B<iskey>
yading@10 8260
yading@10 8261 1 if the frame is a key frame, 0 otherwise
yading@10 8262
yading@10 8263
yading@10 8264 =item B<type>
yading@10 8265
yading@10 8266 picture type of the input frame ("I" for an I-frame, "P" for a
yading@10 8267 P-frame, "B" for a B-frame, "?" for unknown type).
yading@10 8268 Check also the documentation of the C<AVPictureType> enum and of
yading@10 8269 the C<av_get_picture_type_char> function defined in
yading@10 8270 F<libavutil/avutil.h>.
yading@10 8271
yading@10 8272
yading@10 8273 =item B<checksum>
yading@10 8274
yading@10 8275 Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame
yading@10 8276
yading@10 8277
yading@10 8278 =item B<plane_checksum>
yading@10 8279
yading@10 8280 Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
yading@10 8281 expressed in the form "[I<c0> I<c1> I<c2> I<c3>]"
yading@10 8282
yading@10 8283 =back
yading@10 8284
yading@10 8285
yading@10 8286
yading@10 8287 =head2 smartblur
yading@10 8288
yading@10 8289
yading@10 8290 Blur the input video without impacting the outlines.
yading@10 8291
yading@10 8292 The filter accepts the following options:
yading@10 8293
yading@10 8294
yading@10 8295 =over 4
yading@10 8296
yading@10 8297
yading@10 8298 =item B<luma_radius, lr>
yading@10 8299
yading@10 8300 Set the luma radius. The option value must be a float number in
yading@10 8301 the range [0.1,5.0] that specifies the variance of the gaussian filter
yading@10 8302 used to blur the image (slower if larger). Default value is 1.0.
yading@10 8303
yading@10 8304
yading@10 8305 =item B<luma_strength, ls>
yading@10 8306
yading@10 8307 Set the luma strength. The option value must be a float number
yading@10 8308 in the range [-1.0,1.0] that configures the blurring. A value included
yading@10 8309 in [0.0,1.0] will blur the image whereas a value included in
yading@10 8310 [-1.0,0.0] will sharpen the image. Default value is 1.0.
yading@10 8311
yading@10 8312
yading@10 8313 =item B<luma_threshold, lt>
yading@10 8314
yading@10 8315 Set the luma threshold used as a coefficient to determine
yading@10 8316 whether a pixel should be blurred or not. The option value must be an
yading@10 8317 integer in the range [-30,30]. A value of 0 will filter all the image,
yading@10 8318 a value included in [0,30] will filter flat areas and a value included
yading@10 8319 in [-30,0] will filter edges. Default value is 0.
yading@10 8320
yading@10 8321
yading@10 8322 =item B<chroma_radius, cr>
yading@10 8323
yading@10 8324 Set the chroma radius. The option value must be a float number in
yading@10 8325 the range [0.1,5.0] that specifies the variance of the gaussian filter
yading@10 8326 used to blur the image (slower if larger). Default value is 1.0.
yading@10 8327
yading@10 8328
yading@10 8329 =item B<chroma_strength, cs>
yading@10 8330
yading@10 8331 Set the chroma strength. The option value must be a float number
yading@10 8332 in the range [-1.0,1.0] that configures the blurring. A value included
yading@10 8333 in [0.0,1.0] will blur the image whereas a value included in
yading@10 8334 [-1.0,0.0] will sharpen the image. Default value is 1.0.
yading@10 8335
yading@10 8336
yading@10 8337 =item B<chroma_threshold, ct>
yading@10 8338
yading@10 8339 Set the chroma threshold used as a coefficient to determine
yading@10 8340 whether a pixel should be blurred or not. The option value must be an
yading@10 8341 integer in the range [-30,30]. A value of 0 will filter all the image,
yading@10 8342 a value included in [0,30] will filter flat areas and a value included
yading@10 8343 in [-30,0] will filter edges. Default value is 0.
yading@10 8344
yading@10 8345 =back
yading@10 8346
yading@10 8347
yading@10 8348 If a chroma option is not explicitly set, the corresponding luma value
yading@10 8349 is set.
yading@10 8350
yading@10 8351
yading@10 8352 =head2 stereo3d
yading@10 8353
yading@10 8354
yading@10 8355 Convert between different stereoscopic image formats.
yading@10 8356
yading@10 8357 The filters accept the following options:
yading@10 8358
yading@10 8359
yading@10 8360 =over 4
yading@10 8361
yading@10 8362
yading@10 8363 =item B<in>
yading@10 8364
yading@10 8365 Set stereoscopic image format of input.
yading@10 8366
yading@10 8367 Available values for input image formats are:
yading@10 8368
yading@10 8369 =over 4
yading@10 8370
yading@10 8371
yading@10 8372 =item B<sbsl>
yading@10 8373
yading@10 8374 side by side parallel (left eye left, right eye right)
yading@10 8375
yading@10 8376
yading@10 8377 =item B<sbsr>
yading@10 8378
yading@10 8379 side by side crosseye (right eye left, left eye right)
yading@10 8380
yading@10 8381
yading@10 8382 =item B<sbs2l>
yading@10 8383
yading@10 8384 side by side parallel with half width resolution
yading@10 8385 (left eye left, right eye right)
yading@10 8386
yading@10 8387
yading@10 8388 =item B<sbs2r>
yading@10 8389
yading@10 8390 side by side crosseye with half width resolution
yading@10 8391 (right eye left, left eye right)
yading@10 8392
yading@10 8393
yading@10 8394 =item B<abl>
yading@10 8395
yading@10 8396 above-below (left eye above, right eye below)
yading@10 8397
yading@10 8398
yading@10 8399 =item B<abr>
yading@10 8400
yading@10 8401 above-below (right eye above, left eye below)
yading@10 8402
yading@10 8403
yading@10 8404 =item B<ab2l>
yading@10 8405
yading@10 8406 above-below with half height resolution
yading@10 8407 (left eye above, right eye below)
yading@10 8408
yading@10 8409
yading@10 8410 =item B<ab2r>
yading@10 8411
yading@10 8412 above-below with half height resolution
yading@10 8413 (right eye above, left eye below)
yading@10 8414
yading@10 8415 Default value is B<sbsl>.
yading@10 8416
yading@10 8417 =back
yading@10 8418
yading@10 8419
yading@10 8420
yading@10 8421 =item B<out>
yading@10 8422
yading@10 8423 Set stereoscopic image format of output.
yading@10 8424
yading@10 8425 Available values for output image formats are all the input formats as well as:
yading@10 8426
yading@10 8427 =over 4
yading@10 8428
yading@10 8429
yading@10 8430 =item B<arbg>
yading@10 8431
yading@10 8432 anaglyph red/blue gray
yading@10 8433 (red filter on left eye, blue filter on right eye)
yading@10 8434
yading@10 8435
yading@10 8436 =item B<argg>
yading@10 8437
yading@10 8438 anaglyph red/green gray
yading@10 8439 (red filter on left eye, green filter on right eye)
yading@10 8440
yading@10 8441
yading@10 8442 =item B<arcg>
yading@10 8443
yading@10 8444 anaglyph red/cyan gray
yading@10 8445 (red filter on left eye, cyan filter on right eye)
yading@10 8446
yading@10 8447
yading@10 8448 =item B<arch>
yading@10 8449
yading@10 8450 anaglyph red/cyan half colored
yading@10 8451 (red filter on left eye, cyan filter on right eye)
yading@10 8452
yading@10 8453
yading@10 8454 =item B<arcc>
yading@10 8455
yading@10 8456 anaglyph red/cyan color
yading@10 8457 (red filter on left eye, cyan filter on right eye)
yading@10 8458
yading@10 8459
yading@10 8460 =item B<arcd>
yading@10 8461
yading@10 8462 anaglyph red/cyan color optimized with the least squares projection of dubois
yading@10 8463 (red filter on left eye, cyan filter on right eye)
yading@10 8464
yading@10 8465
yading@10 8466 =item B<agmg>
yading@10 8467
yading@10 8468 anaglyph green/magenta gray
yading@10 8469 (green filter on left eye, magenta filter on right eye)
yading@10 8470
yading@10 8471
yading@10 8472 =item B<agmh>
yading@10 8473
yading@10 8474 anaglyph green/magenta half colored
yading@10 8475 (green filter on left eye, magenta filter on right eye)
yading@10 8476
yading@10 8477
yading@10 8478 =item B<agmc>
yading@10 8479
yading@10 8480 anaglyph green/magenta colored
yading@10 8481 (green filter on left eye, magenta filter on right eye)
yading@10 8482
yading@10 8483
yading@10 8484 =item B<agmd>
yading@10 8485
yading@10 8486 anaglyph green/magenta color optimized with the least squares projection of dubois
yading@10 8487 (green filter on left eye, magenta filter on right eye)
yading@10 8488
yading@10 8489
yading@10 8490 =item B<aybg>
yading@10 8491
yading@10 8492 anaglyph yellow/blue gray
yading@10 8493 (yellow filter on left eye, blue filter on right eye)
yading@10 8494
yading@10 8495
yading@10 8496 =item B<aybh>
yading@10 8497
yading@10 8498 anaglyph yellow/blue half colored
yading@10 8499 (yellow filter on left eye, blue filter on right eye)
yading@10 8500
yading@10 8501
yading@10 8502 =item B<aybc>
yading@10 8503
yading@10 8504 anaglyph yellow/blue colored
yading@10 8505 (yellow filter on left eye, blue filter on right eye)
yading@10 8506
yading@10 8507
yading@10 8508 =item B<aybd>
yading@10 8509
yading@10 8510 anaglyph yellow/blue color optimized with the least squares projection of dubois
yading@10 8511 (yellow filter on left eye, blue filter on right eye)
yading@10 8512
yading@10 8513
yading@10 8514 =item B<irl>
yading@10 8515
yading@10 8516 interleaved rows (left eye has top row, right eye starts on next row)
yading@10 8517
yading@10 8518
yading@10 8519 =item B<irr>
yading@10 8520
yading@10 8521 interleaved rows (right eye has top row, left eye starts on next row)
yading@10 8522
yading@10 8523
yading@10 8524 =item B<ml>
yading@10 8525
yading@10 8526 mono output (left eye only)
yading@10 8527
yading@10 8528
yading@10 8529 =item B<mr>
yading@10 8530
yading@10 8531 mono output (right eye only)
yading@10 8532
yading@10 8533 =back
yading@10 8534
yading@10 8535
yading@10 8536 Default value is B<arcd>.
yading@10 8537
yading@10 8538 =back
yading@10 8539
yading@10 8540
yading@10 8541
yading@10 8542
yading@10 8543 =head2 subtitles
yading@10 8544
yading@10 8545
yading@10 8546 Draw subtitles on top of input video using the libass library.
yading@10 8547
yading@10 8548 To enable compilation of this filter you need to configure FFmpeg with
yading@10 8549 C<--enable-libass>. This filter also requires a build with libavcodec and
yading@10 8550 libavformat to convert the passed subtitles file to ASS (Advanced Substation
yading@10 8551 Alpha) subtitles format.
yading@10 8552
yading@10 8553 The filter accepts the following options:
yading@10 8554
yading@10 8555
yading@10 8556 =over 4
yading@10 8557
yading@10 8558
yading@10 8559 =item B<filename, f>
yading@10 8560
yading@10 8561 Set the filename of the subtitle file to read. It must be specified.
yading@10 8562
yading@10 8563
yading@10 8564 =item B<original_size>
yading@10 8565
yading@10 8566 Specify the size of the original video, the video for which the ASS file
yading@10 8567 was composed. Due to a misdesign in ASS aspect ratio arithmetic, this is
yading@10 8568 necessary to correctly scale the fonts if the aspect ratio has been changed.
yading@10 8569
yading@10 8570
yading@10 8571 =item B<charenc>
yading@10 8572
yading@10 8573 Set subtitles input character encoding. C<subtitles> filter only. Only
yading@10 8574 useful if not UTF-8.
yading@10 8575
yading@10 8576 =back
yading@10 8577
yading@10 8578
yading@10 8579 If the first key is not specified, it is assumed that the first value
yading@10 8580 specifies the B<filename>.
yading@10 8581
yading@10 8582 For example, to render the file F<sub.srt> on top of the input
yading@10 8583 video, use the command:
yading@10 8584
yading@10 8585 subtitles=sub.srt
yading@10 8586
yading@10 8587
yading@10 8588 which is equivalent to:
yading@10 8589
yading@10 8590 subtitles=filename=sub.srt
yading@10 8591
yading@10 8592
yading@10 8593
yading@10 8594 =head2 super2xsai
yading@10 8595
yading@10 8596
yading@10 8597 Scale the input by 2x and smooth using the Super2xSaI (Scale and
yading@10 8598 Interpolate) pixel art scaling algorithm.
yading@10 8599
yading@10 8600 Useful for enlarging pixel art images without reducing sharpness.
yading@10 8601
yading@10 8602
yading@10 8603 =head2 swapuv
yading@10 8604
yading@10 8605 Swap U & V plane.
yading@10 8606
yading@10 8607
yading@10 8608 =head2 telecine
yading@10 8609
yading@10 8610
yading@10 8611 Apply telecine process to the video.
yading@10 8612
yading@10 8613 This filter accepts the following options:
yading@10 8614
yading@10 8615
yading@10 8616 =over 4
yading@10 8617
yading@10 8618
yading@10 8619 =item B<first_field>
yading@10 8620
yading@10 8621
yading@10 8622 =over 4
yading@10 8623
yading@10 8624
yading@10 8625 =item B<top, t>
yading@10 8626
yading@10 8627 top field first
yading@10 8628
yading@10 8629 =item B<bottom, b>
yading@10 8630
yading@10 8631 bottom field first
yading@10 8632 The default value is C<top>.
yading@10 8633
yading@10 8634 =back
yading@10 8635
yading@10 8636
yading@10 8637
yading@10 8638 =item B<pattern>
yading@10 8639
yading@10 8640 A string of numbers representing the pulldown pattern you wish to apply.
yading@10 8641 The default value is C<23>.
yading@10 8642
yading@10 8643 =back
yading@10 8644
yading@10 8645
yading@10 8646
yading@10 8647 Some typical patterns:
yading@10 8648
yading@10 8649 NTSC output (30i):
yading@10 8650 27.5p: 32222
yading@10 8651 24p: 23 (classic)
yading@10 8652 24p: 2332 (preferred)
yading@10 8653 20p: 33
yading@10 8654 18p: 334
yading@10 8655 16p: 3444
yading@10 8656
yading@10 8657 PAL output (25i):
yading@10 8658 27.5p: 12222
yading@10 8659 24p: 222222222223 ("Euro pulldown")
yading@10 8660 16.67p: 33
yading@10 8661 16p: 33333334
yading@10 8662
yading@10 8663
yading@10 8664
yading@10 8665 =head2 thumbnail
yading@10 8666
yading@10 8667 Select the most representative frame in a given sequence of consecutive frames.
yading@10 8668
yading@10 8669 The filter accepts the following options:
yading@10 8670
yading@10 8671
yading@10 8672 =over 4
yading@10 8673
yading@10 8674
yading@10 8675 =item B<n>
yading@10 8676
yading@10 8677 Set the frames batch size to analyze; in a set of I<n> frames, the filter
yading@10 8678 will pick one of them, and then handle the next batch of I<n> frames until
yading@10 8679 the end. Default is C<100>.
yading@10 8680
yading@10 8681 =back
yading@10 8682
yading@10 8683
yading@10 8684 Since the filter keeps track of the whole frames sequence, a bigger I<n>
yading@10 8685 value will result in a higher memory usage, so a high value is not recommended.
yading@10 8686
yading@10 8687
yading@10 8688 =head3 Examples
yading@10 8689
yading@10 8690
yading@10 8691
yading@10 8692 =over 4
yading@10 8693
yading@10 8694
yading@10 8695 =item *
yading@10 8696
yading@10 8697 Extract one picture each 50 frames:
yading@10 8698
yading@10 8699 thumbnail=50
yading@10 8700
yading@10 8701
yading@10 8702
yading@10 8703 =item *
yading@10 8704
yading@10 8705 Complete example of a thumbnail creation with B<ffmpeg>:
yading@10 8706
yading@10 8707 ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
yading@10 8708
yading@10 8709
yading@10 8710 =back
yading@10 8711
yading@10 8712
yading@10 8713
yading@10 8714 =head2 tile
yading@10 8715
yading@10 8716
yading@10 8717 Tile several successive frames together.
yading@10 8718
yading@10 8719 The filter accepts the following options:
yading@10 8720
yading@10 8721
yading@10 8722 =over 4
yading@10 8723
yading@10 8724
yading@10 8725
yading@10 8726 =item B<layout>
yading@10 8727
yading@10 8728 Set the grid size (i.e. the number of lines and columns) in the form
yading@10 8729 "I<w>xI<h>".
yading@10 8730
yading@10 8731
yading@10 8732 =item B<nb_frames>
yading@10 8733
yading@10 8734 Set the maximum number of frames to render in the given area. It must be less
yading@10 8735 than or equal to I<w>xI<h>. The default value is C<0>, meaning all
yading@10 8736 the area will be used.
yading@10 8737
yading@10 8738
yading@10 8739 =item B<margin>
yading@10 8740
yading@10 8741 Set the outer border margin in pixels.
yading@10 8742
yading@10 8743
yading@10 8744 =item B<padding>
yading@10 8745
yading@10 8746 Set the inner border thickness (i.e. the number of pixels between frames). For
yading@10 8747 more advanced padding options (such as having different values for the edges),
yading@10 8748 refer to the pad video filter.
yading@10 8749
yading@10 8750
yading@10 8751 =back
yading@10 8752
yading@10 8753
yading@10 8754
yading@10 8755 =head3 Examples
yading@10 8756
yading@10 8757
yading@10 8758
yading@10 8759 =over 4
yading@10 8760
yading@10 8761
yading@10 8762 =item *
yading@10 8763
yading@10 8764 Produce 8x8 PNG tiles of all keyframes (B<-skip_frame nokey>) in a movie:
yading@10 8765
yading@10 8766 ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
yading@10 8767
yading@10 8768 The B<-vsync 0> is necessary to prevent B<ffmpeg> from
yading@10 8769 duplicating each output frame to accomodate the originally detected frame
yading@10 8770 rate.
yading@10 8771
yading@10 8772
yading@10 8773 =item *
yading@10 8774
yading@10 8775 Display C<5> pictures in an area of C<3x2> frames,
yading@10 8776 with C<7> pixels between them, and C<2> pixels of initial margin, using
yading@10 8777 mixed flat and named options:
yading@10 8778
yading@10 8779 tile=3x2:nb_frames=5:padding=7:margin=2
yading@10 8780
yading@10 8781
yading@10 8782 =back
yading@10 8783
yading@10 8784
yading@10 8785
yading@10 8786 =head2 tinterlace
yading@10 8787
yading@10 8788
yading@10 8789 Perform various types of temporal field interlacing.
yading@10 8790
yading@10 8791 Frames are counted starting from 1, so the first input frame is
yading@10 8792 considered odd.
yading@10 8793
yading@10 8794 The filter accepts the following options:
yading@10 8795
yading@10 8796
yading@10 8797 =over 4
yading@10 8798
yading@10 8799
yading@10 8800
yading@10 8801 =item B<mode>
yading@10 8802
yading@10 8803 Specify the mode of the interlacing. This option can also be specified
yading@10 8804 as a value alone. See below for a list of values for this option.
yading@10 8805
yading@10 8806 Available values are:
yading@10 8807
yading@10 8808
yading@10 8809 =over 4
yading@10 8810
yading@10 8811
yading@10 8812 =item B<merge, 0>
yading@10 8813
yading@10 8814 Move odd frames into the upper field, even into the lower field,
yading@10 8815 generating a double height frame at half frame rate.
yading@10 8816
yading@10 8817
yading@10 8818 =item B<drop_odd, 1>
yading@10 8819
yading@10 8820 Only output even frames, odd frames are dropped, generating a frame with
yading@10 8821 unchanged height at half frame rate.
yading@10 8822
yading@10 8823
yading@10 8824 =item B<drop_even, 2>
yading@10 8825
yading@10 8826 Only output odd frames, even frames are dropped, generating a frame with
yading@10 8827 unchanged height at half frame rate.
yading@10 8828
yading@10 8829
yading@10 8830 =item B<pad, 3>
yading@10 8831
yading@10 8832 Expand each frame to full height, but pad alternate lines with black,
yading@10 8833 generating a frame with double height at the same input frame rate.
yading@10 8834
yading@10 8835
yading@10 8836 =item B<interleave_top, 4>
yading@10 8837
yading@10 8838 Interleave the upper field from odd frames with the lower field from
yading@10 8839 even frames, generating a frame with unchanged height at half frame rate.
yading@10 8840
yading@10 8841
yading@10 8842 =item B<interleave_bottom, 5>
yading@10 8843
yading@10 8844 Interleave the lower field from odd frames with the upper field from
yading@10 8845 even frames, generating a frame with unchanged height at half frame rate.
yading@10 8846
yading@10 8847
yading@10 8848 =item B<interlacex2, 6>
yading@10 8849
yading@10 8850 Double frame rate with unchanged height. Frames are inserted each
yading@10 8851 containing the second temporal field from the previous input frame and
yading@10 8852 the first temporal field from the next input frame. This mode relies on
yading@10 8853 the top_field_first flag. Useful for interlaced video displays with no
yading@10 8854 field synchronisation.
yading@10 8855
yading@10 8856 =back
yading@10 8857
yading@10 8858
yading@10 8859 Numeric values are deprecated but are accepted for backward
yading@10 8860 compatibility reasons.
yading@10 8861
yading@10 8862 Default mode is C<merge>.
yading@10 8863
yading@10 8864
yading@10 8865 =item B<flags>
yading@10 8866
yading@10 8867 Specify flags influencing the filter process.
yading@10 8868
yading@10 8869 Available value for I<flags> is:
yading@10 8870
yading@10 8871
yading@10 8872 =over 4
yading@10 8873
yading@10 8874
yading@10 8875 =item B<low_pass_filter, vlfp>
yading@10 8876
yading@10 8877 Enable vertical low-pass filtering in the filter.
yading@10 8878 Vertical low-pass filtering is required when creating an interlaced
yading@10 8879 destination from a progressive source which contains high-frequency
yading@10 8880 vertical detail. Filtering will reduce interlace 'twitter' and Moire
yading@10 8881 patterning.
yading@10 8882
yading@10 8883 Vertical low-pass filtering can only be enabled for B<mode>
yading@10 8884 I<interleave_top> and I<interleave_bottom>.
yading@10 8885
yading@10 8886
yading@10 8887 =back
yading@10 8888
yading@10 8889
yading@10 8890 =back
yading@10 8891
yading@10 8892
yading@10 8893
yading@10 8894 =head2 transpose
yading@10 8895
yading@10 8896
yading@10 8897 Transpose rows with columns in the input video and optionally flip it.
yading@10 8898
yading@10 8899 This filter accepts the following options:
yading@10 8900
yading@10 8901
yading@10 8902 =over 4
yading@10 8903
yading@10 8904
yading@10 8905
yading@10 8906 =item B<dir>
yading@10 8907
yading@10 8908 The direction of the transpose.
yading@10 8909
yading@10 8910
yading@10 8911 =over 4
yading@10 8912
yading@10 8913
yading@10 8914 =item B<0, 4, cclock_flip>
yading@10 8915
yading@10 8916 Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
yading@10 8917
yading@10 8918 L.R L.l
yading@10 8919 . . -> . .
yading@10 8920 l.r R.r
yading@10 8921
yading@10 8922
yading@10 8923
yading@10 8924 =item B<1, 5, clock>
yading@10 8925
yading@10 8926 Rotate by 90 degrees clockwise, that is:
yading@10 8927
yading@10 8928 L.R l.L
yading@10 8929 . . -> . .
yading@10 8930 l.r r.R
yading@10 8931
yading@10 8932
yading@10 8933
yading@10 8934 =item B<2, 6, cclock>
yading@10 8935
yading@10 8936 Rotate by 90 degrees counterclockwise, that is:
yading@10 8937
yading@10 8938 L.R R.r
yading@10 8939 . . -> . .
yading@10 8940 l.r L.l
yading@10 8941
yading@10 8942
yading@10 8943
yading@10 8944 =item B<3, 7, clock_flip>
yading@10 8945
yading@10 8946 Rotate by 90 degrees clockwise and vertically flip, that is:
yading@10 8947
yading@10 8948 L.R r.R
yading@10 8949 . . -> . .
yading@10 8950 l.r l.L
yading@10 8951
yading@10 8952
yading@10 8953 =back
yading@10 8954
yading@10 8955
yading@10 8956 For values between 4-7, the transposition is only done if the input
yading@10 8957 video geometry is portrait and not landscape. These values are
yading@10 8958 deprecated, the C<passthrough> option should be used instead.
yading@10 8959
yading@10 8960
yading@10 8961 =item B<passthrough>
yading@10 8962
yading@10 8963 Do not apply the transposition if the input geometry matches the one
yading@10 8964 specified by the specified value. It accepts the following values:
yading@10 8965
yading@10 8966 =over 4
yading@10 8967
yading@10 8968
yading@10 8969 =item B<none>
yading@10 8970
yading@10 8971 Always apply transposition.
yading@10 8972
yading@10 8973 =item B<portrait>
yading@10 8974
yading@10 8975 Preserve portrait geometry (when I<height> E<gt>= I<width>).
yading@10 8976
yading@10 8977 =item B<landscape>
yading@10 8978
yading@10 8979 Preserve landscape geometry (when I<width> E<gt>= I<height>).
yading@10 8980
yading@10 8981 =back
yading@10 8982
yading@10 8983
yading@10 8984 Default value is C<none>.
yading@10 8985
yading@10 8986 =back
yading@10 8987
yading@10 8988
yading@10 8989 For example to rotate by 90 degrees clockwise and preserve portrait
yading@10 8990 layout:
yading@10 8991
yading@10 8992 transpose=dir=1:passthrough=portrait
yading@10 8993
yading@10 8994
yading@10 8995 The command above can also be specified as:
yading@10 8996
yading@10 8997 transpose=1:portrait
yading@10 8998
yading@10 8999
yading@10 9000
yading@10 9001 =head2 unsharp
yading@10 9002
yading@10 9003
yading@10 9004 Sharpen or blur the input video.
yading@10 9005
yading@10 9006 It accepts the following parameters:
yading@10 9007
yading@10 9008
yading@10 9009 =over 4
yading@10 9010
yading@10 9011
yading@10 9012 =item B<luma_msize_x, lx>
yading@10 9013
yading@10 9014
yading@10 9015 =item B<chroma_msize_x, cx>
yading@10 9016
yading@10 9017 Set the luma/chroma matrix horizontal size. It must be an odd integer
yading@10 9018 between 3 and 63, default value is 5.
yading@10 9019
yading@10 9020
yading@10 9021 =item B<luma_msize_y, ly>
yading@10 9022
yading@10 9023
yading@10 9024 =item B<chroma_msize_y, cy>
yading@10 9025
yading@10 9026 Set the luma/chroma matrix vertical size. It must be an odd integer
yading@10 9027 between 3 and 63, default value is 5.
yading@10 9028
yading@10 9029
yading@10 9030 =item B<luma_amount, la>
yading@10 9031
yading@10 9032
yading@10 9033 =item B<chroma_amount, ca>
yading@10 9034
yading@10 9035 Set the luma/chroma effect strength. It can be a float number,
yading@10 9036 reasonable values lay between -1.5 and 1.5.
yading@10 9037
yading@10 9038 Negative values will blur the input video, while positive values will
yading@10 9039 sharpen it, a value of zero will disable the effect.
yading@10 9040
yading@10 9041 Default value is 1.0 for B<luma_amount>, 0.0 for
yading@10 9042 B<chroma_amount>.
yading@10 9043
yading@10 9044 =back
yading@10 9045
yading@10 9046
yading@10 9047 All parameters are optional and default to the
yading@10 9048 equivalent of the string '5:5:1.0:5:5:0.0'.
yading@10 9049
yading@10 9050
yading@10 9051 =head3 Examples
yading@10 9052
yading@10 9053
yading@10 9054
yading@10 9055 =over 4
yading@10 9056
yading@10 9057
yading@10 9058 =item *
yading@10 9059
yading@10 9060 Apply strong luma sharpen effect:
yading@10 9061
yading@10 9062 unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
yading@10 9063
yading@10 9064
yading@10 9065
yading@10 9066 =item *
yading@10 9067
yading@10 9068 Apply strong blur of both luma and chroma parameters:
yading@10 9069
yading@10 9070 unsharp=7:7:-2:7:7:-2
yading@10 9071
yading@10 9072
yading@10 9073 =back
yading@10 9074
yading@10 9075
yading@10 9076
yading@10 9077 =head2 vflip
yading@10 9078
yading@10 9079
yading@10 9080 Flip the input video vertically.
yading@10 9081
yading@10 9082
yading@10 9083 ffmpeg -i in.avi -vf "vflip" out.avi
yading@10 9084
yading@10 9085
yading@10 9086
yading@10 9087
yading@10 9088 =head2 yadif
yading@10 9089
yading@10 9090
yading@10 9091 Deinterlace the input video ("yadif" means "yet another deinterlacing
yading@10 9092 filter").
yading@10 9093
yading@10 9094 This filter accepts the following options:
yading@10 9095
yading@10 9096
yading@10 9097
yading@10 9098 =over 4
yading@10 9099
yading@10 9100
yading@10 9101
yading@10 9102 =item B<mode>
yading@10 9103
yading@10 9104 The interlacing mode to adopt, accepts one of the following values:
yading@10 9105
yading@10 9106
yading@10 9107 =over 4
yading@10 9108
yading@10 9109
yading@10 9110 =item B<0, send_frame>
yading@10 9111
yading@10 9112 output 1 frame for each frame
yading@10 9113
yading@10 9114 =item B<1, send_field>
yading@10 9115
yading@10 9116 output 1 frame for each field
yading@10 9117
yading@10 9118 =item B<2, send_frame_nospatial>
yading@10 9119
yading@10 9120 like C<send_frame> but skip spatial interlacing check
yading@10 9121
yading@10 9122 =item B<3, send_field_nospatial>
yading@10 9123
yading@10 9124 like C<send_field> but skip spatial interlacing check
yading@10 9125
yading@10 9126 =back
yading@10 9127
yading@10 9128
yading@10 9129 Default value is C<send_frame>.
yading@10 9130
yading@10 9131
yading@10 9132 =item B<parity>
yading@10 9133
yading@10 9134 The picture field parity assumed for the input interlaced video, accepts one of
yading@10 9135 the following values:
yading@10 9136
yading@10 9137
yading@10 9138 =over 4
yading@10 9139
yading@10 9140
yading@10 9141 =item B<0, tff>
yading@10 9142
yading@10 9143 assume top field first
yading@10 9144
yading@10 9145 =item B<1, bff>
yading@10 9146
yading@10 9147 assume bottom field first
yading@10 9148
yading@10 9149 =item B<-1, auto>
yading@10 9150
yading@10 9151 enable automatic detection
yading@10 9152
yading@10 9153 =back
yading@10 9154
yading@10 9155
yading@10 9156 Default value is C<auto>.
yading@10 9157 If interlacing is unknown or decoder does not export this information,
yading@10 9158 top field first will be assumed.
yading@10 9159
yading@10 9160
yading@10 9161 =item B<deint>
yading@10 9162
yading@10 9163 Specify which frames to deinterlace. Accept one of the following
yading@10 9164 values:
yading@10 9165
yading@10 9166
yading@10 9167 =over 4
yading@10 9168
yading@10 9169
yading@10 9170 =item B<0, all>
yading@10 9171
yading@10 9172 deinterlace all frames
yading@10 9173
yading@10 9174 =item B<1, interlaced>
yading@10 9175
yading@10 9176 only deinterlace frames marked as interlaced
yading@10 9177
yading@10 9178 =back
yading@10 9179
yading@10 9180
yading@10 9181 Default value is C<all>.
yading@10 9182
yading@10 9183 =back
yading@10 9184
yading@10 9185
yading@10 9186
yading@10 9187
yading@10 9188 =head1 VIDEO SOURCES
yading@10 9189
yading@10 9190
yading@10 9191 Below is a description of the currently available video sources.
yading@10 9192
yading@10 9193
yading@10 9194 =head2 buffer
yading@10 9195
yading@10 9196
yading@10 9197 Buffer video frames, and make them available to the filter chain.
yading@10 9198
yading@10 9199 This source is mainly intended for a programmatic use, in particular
yading@10 9200 through the interface defined in F<libavfilter/vsrc_buffer.h>.
yading@10 9201
yading@10 9202 This source accepts the following options:
yading@10 9203
yading@10 9204
yading@10 9205 =over 4
yading@10 9206
yading@10 9207
yading@10 9208
yading@10 9209 =item B<video_size>
yading@10 9210
yading@10 9211 Specify the size (width and height) of the buffered video frames.
yading@10 9212
yading@10 9213
yading@10 9214 =item B<width>
yading@10 9215
yading@10 9216 Input video width.
yading@10 9217
yading@10 9218
yading@10 9219 =item B<height>
yading@10 9220
yading@10 9221 Input video height.
yading@10 9222
yading@10 9223
yading@10 9224 =item B<pix_fmt>
yading@10 9225
yading@10 9226 A string representing the pixel format of the buffered video frames.
yading@10 9227 It may be a number corresponding to a pixel format, or a pixel format
yading@10 9228 name.
yading@10 9229
yading@10 9230
yading@10 9231 =item B<time_base>
yading@10 9232
yading@10 9233 Specify the timebase assumed by the timestamps of the buffered frames.
yading@10 9234
yading@10 9235
yading@10 9236 =item B<frame_rate>
yading@10 9237
yading@10 9238 Specify the frame rate expected for the video stream.
yading@10 9239
yading@10 9240
yading@10 9241 =item B<pixel_aspect, sar>
yading@10 9242
yading@10 9243 Specify the sample aspect ratio assumed by the video frames.
yading@10 9244
yading@10 9245
yading@10 9246 =item B<sws_param>
yading@10 9247
yading@10 9248 Specify the optional parameters to be used for the scale filter which
yading@10 9249 is automatically inserted when an input change is detected in the
yading@10 9250 input size or format.
yading@10 9251
yading@10 9252 =back
yading@10 9253
yading@10 9254
yading@10 9255 For example:
yading@10 9256
yading@10 9257 buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
yading@10 9258
yading@10 9259
yading@10 9260 will instruct the source to accept video frames with size 320x240 and
yading@10 9261 with format "yuv410p", assuming 1/24 as the timestamps timebase and
yading@10 9262 square pixels (1:1 sample aspect ratio).
yading@10 9263 Since the pixel format with name "yuv410p" corresponds to the number 6
yading@10 9264 (check the enum AVPixelFormat definition in F<libavutil/pixfmt.h>),
yading@10 9265 this example corresponds to:
yading@10 9266
yading@10 9267 buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
yading@10 9268
yading@10 9269
yading@10 9270 Alternatively, the options can be specified as a flat string, but this
yading@10 9271 syntax is deprecated:
yading@10 9272
yading@10 9273 I<width>:I<height>:I<pix_fmt>:I<time_base.num>:I<time_base.den>:I<pixel_aspect.num>:I<pixel_aspect.den>[:I<sws_param>]
yading@10 9274
yading@10 9275
yading@10 9276 =head2 cellauto
yading@10 9277
yading@10 9278
yading@10 9279 Create a pattern generated by an elementary cellular automaton.
yading@10 9280
yading@10 9281 The initial state of the cellular automaton can be defined through the
yading@10 9282 B<filename>, and B<pattern> options. If such options are
yading@10 9283 not specified an initial state is created randomly.
yading@10 9284
yading@10 9285 At each new frame a new row in the video is filled with the result of
yading@10 9286 the cellular automaton next generation. The behavior when the whole
yading@10 9287 frame is filled is defined by the B<scroll> option.
yading@10 9288
yading@10 9289 This source accepts the following options:
yading@10 9290
yading@10 9291
yading@10 9292 =over 4
yading@10 9293
yading@10 9294
yading@10 9295 =item B<filename, f>
yading@10 9296
yading@10 9297 Read the initial cellular automaton state, i.e. the starting row, from
yading@10 9298 the specified file.
yading@10 9299 In the file, each non-whitespace character is considered an alive
yading@10 9300 cell, a newline will terminate the row, and further characters in the
yading@10 9301 file will be ignored.
yading@10 9302
yading@10 9303
yading@10 9304 =item B<pattern, p>
yading@10 9305
yading@10 9306 Read the initial cellular automaton state, i.e. the starting row, from
yading@10 9307 the specified string.
yading@10 9308
yading@10 9309 Each non-whitespace character in the string is considered an alive
yading@10 9310 cell, a newline will terminate the row, and further characters in the
yading@10 9311 string will be ignored.
yading@10 9312
yading@10 9313
yading@10 9314 =item B<rate, r>
yading@10 9315
yading@10 9316 Set the video rate, that is the number of frames generated per second.
yading@10 9317 Default is 25.
yading@10 9318
yading@10 9319
yading@10 9320 =item B<random_fill_ratio, ratio>
yading@10 9321
yading@10 9322 Set the random fill ratio for the initial cellular automaton row. It
yading@10 9323 is a floating point number value ranging from 0 to 1, defaults to
yading@10 9324 1/PHI.
yading@10 9325
yading@10 9326 This option is ignored when a file or a pattern is specified.
yading@10 9327
yading@10 9328
yading@10 9329 =item B<random_seed, seed>
yading@10 9330
yading@10 9331 Set the seed for filling randomly the initial row, must be an integer
yading@10 9332 included between 0 and UINT32_MAX. If not specified, or if explicitly
yading@10 9333 set to -1, the filter will try to use a good random seed on a best
yading@10 9334 effort basis.
yading@10 9335
yading@10 9336
yading@10 9337 =item B<rule>
yading@10 9338
yading@10 9339 Set the cellular automaton rule, it is a number ranging from 0 to 255.
yading@10 9340 Default value is 110.
yading@10 9341
yading@10 9342
yading@10 9343 =item B<size, s>
yading@10 9344
yading@10 9345 Set the size of the output video.
yading@10 9346
yading@10 9347 If B<filename> or B<pattern> is specified, the size is set
yading@10 9348 by default to the width of the specified initial state row, and the
yading@10 9349 height is set to I<width> * PHI.
yading@10 9350
yading@10 9351 If B<size> is set, it must contain the width of the specified
yading@10 9352 pattern string, and the specified pattern will be centered in the
yading@10 9353 larger row.
yading@10 9354
yading@10 9355 If a filename or a pattern string is not specified, the size value
yading@10 9356 defaults to "320x518" (used for a randomly generated initial state).
yading@10 9357
yading@10 9358
yading@10 9359 =item B<scroll>
yading@10 9360
yading@10 9361 If set to 1, scroll the output upward when all the rows in the output
yading@10 9362 have been already filled. If set to 0, the new generated row will be
yading@10 9363 written over the top row just after the bottom row is filled.
yading@10 9364 Defaults to 1.
yading@10 9365
yading@10 9366
yading@10 9367 =item B<start_full, full>
yading@10 9368
yading@10 9369 If set to 1, completely fill the output with generated rows before
yading@10 9370 outputting the first frame.
yading@10 9371 This is the default behavior, for disabling set the value to 0.
yading@10 9372
yading@10 9373
yading@10 9374 =item B<stitch>
yading@10 9375
yading@10 9376 If set to 1, stitch the left and right row edges together.
yading@10 9377 This is the default behavior, for disabling set the value to 0.
yading@10 9378
yading@10 9379 =back
yading@10 9380
yading@10 9381
yading@10 9382
yading@10 9383 =head3 Examples
yading@10 9384
yading@10 9385
yading@10 9386
yading@10 9387 =over 4
yading@10 9388
yading@10 9389
yading@10 9390 =item *
yading@10 9391
yading@10 9392 Read the initial state from F<pattern>, and specify an output of
yading@10 9393 size 200x400.
yading@10 9394
yading@10 9395 cellauto=f=pattern:s=200x400
yading@10 9396
yading@10 9397
yading@10 9398
yading@10 9399 =item *
yading@10 9400
yading@10 9401 Generate a random initial row with a width of 200 cells, with a fill
yading@10 9402 ratio of 2/3:
yading@10 9403
yading@10 9404 cellauto=ratio=2/3:s=200x200
yading@10 9405
yading@10 9406
yading@10 9407
yading@10 9408 =item *
yading@10 9409
yading@10 9410 Create a pattern generated by rule 18 starting by a single alive cell
yading@10 9411 centered on an initial row with width 100:
yading@10 9412
yading@10 9413 cellauto=p=@s=100x400:full=0:rule=18
yading@10 9414
yading@10 9415
yading@10 9416
yading@10 9417 =item *
yading@10 9418
yading@10 9419 Specify a more elaborated initial pattern:
yading@10 9420
yading@10 9421 cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
yading@10 9422
yading@10 9423
yading@10 9424
yading@10 9425 =back
yading@10 9426
yading@10 9427
yading@10 9428
yading@10 9429 =head2 mandelbrot
yading@10 9430
yading@10 9431
yading@10 9432 Generate a Mandelbrot set fractal, and progressively zoom towards the
yading@10 9433 point specified with I<start_x> and I<start_y>.
yading@10 9434
yading@10 9435 This source accepts the following options:
yading@10 9436
yading@10 9437
yading@10 9438 =over 4
yading@10 9439
yading@10 9440
yading@10 9441
yading@10 9442 =item B<end_pts>
yading@10 9443
yading@10 9444 Set the terminal pts value. Default value is 400.
yading@10 9445
yading@10 9446
yading@10 9447 =item B<end_scale>
yading@10 9448
yading@10 9449 Set the terminal scale value.
yading@10 9450 Must be a floating point value. Default value is 0.3.
yading@10 9451
yading@10 9452
yading@10 9453 =item B<inner>
yading@10 9454
yading@10 9455 Set the inner coloring mode, that is the algorithm used to draw the
yading@10 9456 Mandelbrot fractal internal region.
yading@10 9457
yading@10 9458 It shall assume one of the following values:
yading@10 9459
yading@10 9460 =over 4
yading@10 9461
yading@10 9462
yading@10 9463 =item B<black>
yading@10 9464
yading@10 9465 Set black mode.
yading@10 9466
yading@10 9467 =item B<convergence>
yading@10 9468
yading@10 9469 Show time until convergence.
yading@10 9470
yading@10 9471 =item B<mincol>
yading@10 9472
yading@10 9473 Set color based on point closest to the origin of the iterations.
yading@10 9474
yading@10 9475 =item B<period>
yading@10 9476
yading@10 9477 Set period mode.
yading@10 9478
yading@10 9479 =back
yading@10 9480
yading@10 9481
yading@10 9482 Default value is I<mincol>.
yading@10 9483
yading@10 9484
yading@10 9485 =item B<bailout>
yading@10 9486
yading@10 9487 Set the bailout value. Default value is 10.0.
yading@10 9488
yading@10 9489
yading@10 9490 =item B<maxiter>
yading@10 9491
yading@10 9492 Set the maximum of iterations performed by the rendering
yading@10 9493 algorithm. Default value is 7189.
yading@10 9494
yading@10 9495
yading@10 9496 =item B<outer>
yading@10 9497
yading@10 9498 Set outer coloring mode.
yading@10 9499 It shall assume one of following values:
yading@10 9500
yading@10 9501 =over 4
yading@10 9502
yading@10 9503
yading@10 9504 =item B<iteration_count>
yading@10 9505
yading@10 9506 Set iteration cound mode.
yading@10 9507
yading@10 9508 =item B<normalized_iteration_count>
yading@10 9509
yading@10 9510 set normalized iteration count mode.
yading@10 9511
yading@10 9512 =back
yading@10 9513
yading@10 9514 Default value is I<normalized_iteration_count>.
yading@10 9515
yading@10 9516
yading@10 9517 =item B<rate, r>
yading@10 9518
yading@10 9519 Set frame rate, expressed as number of frames per second. Default
yading@10 9520 value is "25".
yading@10 9521
yading@10 9522
yading@10 9523 =item B<size, s>
yading@10 9524
yading@10 9525 Set frame size. Default value is "640x480".
yading@10 9526
yading@10 9527
yading@10 9528 =item B<start_scale>
yading@10 9529
yading@10 9530 Set the initial scale value. Default value is 3.0.
yading@10 9531
yading@10 9532
yading@10 9533 =item B<start_x>
yading@10 9534
yading@10 9535 Set the initial x position. Must be a floating point value between
yading@10 9536 -100 and 100. Default value is -0.743643887037158704752191506114774.
yading@10 9537
yading@10 9538
yading@10 9539 =item B<start_y>
yading@10 9540
yading@10 9541 Set the initial y position. Must be a floating point value between
yading@10 9542 -100 and 100. Default value is -0.131825904205311970493132056385139.
yading@10 9543
yading@10 9544 =back
yading@10 9545
yading@10 9546
yading@10 9547
yading@10 9548 =head2 mptestsrc
yading@10 9549
yading@10 9550
yading@10 9551 Generate various test patterns, as generated by the MPlayer test filter.
yading@10 9552
yading@10 9553 The size of the generated video is fixed, and is 256x256.
yading@10 9554 This source is useful in particular for testing encoding features.
yading@10 9555
yading@10 9556 This source accepts the following options:
yading@10 9557
yading@10 9558
yading@10 9559 =over 4
yading@10 9560
yading@10 9561
yading@10 9562
yading@10 9563 =item B<rate, r>
yading@10 9564
yading@10 9565 Specify the frame rate of the sourced video, as the number of frames
yading@10 9566 generated per second. It has to be a string in the format
yading@10 9567 I<frame_rate_num>/I<frame_rate_den>, an integer number, a float
yading@10 9568 number or a valid video frame rate abbreviation. The default value is
yading@10 9569 "25".
yading@10 9570
yading@10 9571
yading@10 9572 =item B<duration, d>
yading@10 9573
yading@10 9574 Set the video duration of the sourced video. The accepted syntax is:
yading@10 9575
yading@10 9576 [-]HH:MM:SS[.m...]
yading@10 9577 [-]S+[.m...]
yading@10 9578
yading@10 9579 See also the function C<av_parse_time()>.
yading@10 9580
yading@10 9581 If not specified, or the expressed duration is negative, the video is
yading@10 9582 supposed to be generated forever.
yading@10 9583
yading@10 9584
yading@10 9585 =item B<test, t>
yading@10 9586
yading@10 9587
yading@10 9588 Set the number or the name of the test to perform. Supported tests are:
yading@10 9589
yading@10 9590 =over 4
yading@10 9591
yading@10 9592
yading@10 9593 =item B<dc_luma>
yading@10 9594
yading@10 9595
yading@10 9596 =item B<dc_chroma>
yading@10 9597
yading@10 9598
yading@10 9599 =item B<freq_luma>
yading@10 9600
yading@10 9601
yading@10 9602 =item B<freq_chroma>
yading@10 9603
yading@10 9604
yading@10 9605 =item B<amp_luma>
yading@10 9606
yading@10 9607
yading@10 9608 =item B<amp_chroma>
yading@10 9609
yading@10 9610
yading@10 9611 =item B<cbp>
yading@10 9612
yading@10 9613
yading@10 9614 =item B<mv>
yading@10 9615
yading@10 9616
yading@10 9617 =item B<ring1>
yading@10 9618
yading@10 9619
yading@10 9620 =item B<ring2>
yading@10 9621
yading@10 9622
yading@10 9623 =item B<all>
yading@10 9624
yading@10 9625
yading@10 9626 =back
yading@10 9627
yading@10 9628
yading@10 9629 Default value is "all", which will cycle through the list of all tests.
yading@10 9630
yading@10 9631 =back
yading@10 9632
yading@10 9633
yading@10 9634 For example the following:
yading@10 9635
yading@10 9636 testsrc=t=dc_luma
yading@10 9637
yading@10 9638
yading@10 9639 will generate a "dc_luma" test pattern.
yading@10 9640
yading@10 9641
yading@10 9642 =head2 frei0r_src
yading@10 9643
yading@10 9644
yading@10 9645 Provide a frei0r source.
yading@10 9646
yading@10 9647 To enable compilation of this filter you need to install the frei0r
yading@10 9648 header and configure FFmpeg with C<--enable-frei0r>.
yading@10 9649
yading@10 9650 This source accepts the following options:
yading@10 9651
yading@10 9652
yading@10 9653 =over 4
yading@10 9654
yading@10 9655
yading@10 9656
yading@10 9657 =item B<size>
yading@10 9658
yading@10 9659 The size of the video to generate, may be a string of the form
yading@10 9660 I<width>xI<height> or a frame size abbreviation.
yading@10 9661
yading@10 9662
yading@10 9663 =item B<framerate>
yading@10 9664
yading@10 9665 Framerate of the generated video, may be a string of the form
yading@10 9666 I<num>/I<den> or a frame rate abbreviation.
yading@10 9667
yading@10 9668
yading@10 9669 =item B<filter_name>
yading@10 9670
yading@10 9671 The name to the frei0r source to load. For more information regarding frei0r and
yading@10 9672 how to set the parameters read the section frei0r in the description of
yading@10 9673 the video filters.
yading@10 9674
yading@10 9675
yading@10 9676 =item B<filter_params>
yading@10 9677
yading@10 9678 A '|'-separated list of parameters to pass to the frei0r source.
yading@10 9679
yading@10 9680
yading@10 9681 =back
yading@10 9682
yading@10 9683
yading@10 9684 For example, to generate a frei0r partik0l source with size 200x200
yading@10 9685 and frame rate 10 which is overlayed on the overlay filter main input:
yading@10 9686
yading@10 9687 frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
yading@10 9688
yading@10 9689
yading@10 9690
yading@10 9691 =head2 life
yading@10 9692
yading@10 9693
yading@10 9694 Generate a life pattern.
yading@10 9695
yading@10 9696 This source is based on a generalization of John Conway's life game.
yading@10 9697
yading@10 9698 The sourced input represents a life grid, each pixel represents a cell
yading@10 9699 which can be in one of two possible states, alive or dead. Every cell
yading@10 9700 interacts with its eight neighbours, which are the cells that are
yading@10 9701 horizontally, vertically, or diagonally adjacent.
yading@10 9702
yading@10 9703 At each interaction the grid evolves according to the adopted rule,
yading@10 9704 which specifies the number of neighbor alive cells which will make a
yading@10 9705 cell stay alive or born. The B<rule> option allows to specify
yading@10 9706 the rule to adopt.
yading@10 9707
yading@10 9708 This source accepts the following options:
yading@10 9709
yading@10 9710
yading@10 9711 =over 4
yading@10 9712
yading@10 9713
yading@10 9714 =item B<filename, f>
yading@10 9715
yading@10 9716 Set the file from which to read the initial grid state. In the file,
yading@10 9717 each non-whitespace character is considered an alive cell, and newline
yading@10 9718 is used to delimit the end of each row.
yading@10 9719
yading@10 9720 If this option is not specified, the initial grid is generated
yading@10 9721 randomly.
yading@10 9722
yading@10 9723
yading@10 9724 =item B<rate, r>
yading@10 9725
yading@10 9726 Set the video rate, that is the number of frames generated per second.
yading@10 9727 Default is 25.
yading@10 9728
yading@10 9729
yading@10 9730 =item B<random_fill_ratio, ratio>
yading@10 9731
yading@10 9732 Set the random fill ratio for the initial random grid. It is a
yading@10 9733 floating point number value ranging from 0 to 1, defaults to 1/PHI.
yading@10 9734 It is ignored when a file is specified.
yading@10 9735
yading@10 9736
yading@10 9737 =item B<random_seed, seed>
yading@10 9738
yading@10 9739 Set the seed for filling the initial random grid, must be an integer
yading@10 9740 included between 0 and UINT32_MAX. If not specified, or if explicitly
yading@10 9741 set to -1, the filter will try to use a good random seed on a best
yading@10 9742 effort basis.
yading@10 9743
yading@10 9744
yading@10 9745 =item B<rule>
yading@10 9746
yading@10 9747 Set the life rule.
yading@10 9748
yading@10 9749 A rule can be specified with a code of the kind "SI<NS>/BI<NB>",
yading@10 9750 where I<NS> and I<NB> are sequences of numbers in the range 0-8,
yading@10 9751 I<NS> specifies the number of alive neighbor cells which make a
yading@10 9752 live cell stay alive, and I<NB> the number of alive neighbor cells
yading@10 9753 which make a dead cell to become alive (i.e. to "born").
yading@10 9754 "s" and "b" can be used in place of "S" and "B", respectively.
yading@10 9755
yading@10 9756 Alternatively a rule can be specified by an 18-bits integer. The 9
yading@10 9757 high order bits are used to encode the next cell state if it is alive
yading@10 9758 for each number of neighbor alive cells, the low order bits specify
yading@10 9759 the rule for "borning" new cells. Higher order bits encode for an
yading@10 9760 higher number of neighbor cells.
yading@10 9761 For example the number 6153 = C<(12E<lt>E<lt>9)+9> specifies a stay alive
yading@10 9762 rule of 12 and a born rule of 9, which corresponds to "S23/B03".
yading@10 9763
yading@10 9764 Default value is "S23/B3", which is the original Conway's game of life
yading@10 9765 rule, and will keep a cell alive if it has 2 or 3 neighbor alive
yading@10 9766 cells, and will born a new cell if there are three alive cells around
yading@10 9767 a dead cell.
yading@10 9768
yading@10 9769
yading@10 9770 =item B<size, s>
yading@10 9771
yading@10 9772 Set the size of the output video.
yading@10 9773
yading@10 9774 If B<filename> is specified, the size is set by default to the
yading@10 9775 same size of the input file. If B<size> is set, it must contain
yading@10 9776 the size specified in the input file, and the initial grid defined in
yading@10 9777 that file is centered in the larger resulting area.
yading@10 9778
yading@10 9779 If a filename is not specified, the size value defaults to "320x240"
yading@10 9780 (used for a randomly generated initial grid).
yading@10 9781
yading@10 9782
yading@10 9783 =item B<stitch>
yading@10 9784
yading@10 9785 If set to 1, stitch the left and right grid edges together, and the
yading@10 9786 top and bottom edges also. Defaults to 1.
yading@10 9787
yading@10 9788
yading@10 9789 =item B<mold>
yading@10 9790
yading@10 9791 Set cell mold speed. If set, a dead cell will go from B<death_color> to
yading@10 9792 B<mold_color> with a step of B<mold>. B<mold> can have a
yading@10 9793 value from 0 to 255.
yading@10 9794
yading@10 9795
yading@10 9796 =item B<life_color>
yading@10 9797
yading@10 9798 Set the color of living (or new born) cells.
yading@10 9799
yading@10 9800
yading@10 9801 =item B<death_color>
yading@10 9802
yading@10 9803 Set the color of dead cells. If B<mold> is set, this is the first color
yading@10 9804 used to represent a dead cell.
yading@10 9805
yading@10 9806
yading@10 9807 =item B<mold_color>
yading@10 9808
yading@10 9809 Set mold color, for definitely dead and moldy cells.
yading@10 9810
yading@10 9811 =back
yading@10 9812
yading@10 9813
yading@10 9814
yading@10 9815 =head3 Examples
yading@10 9816
yading@10 9817
yading@10 9818
yading@10 9819 =over 4
yading@10 9820
yading@10 9821
yading@10 9822 =item *
yading@10 9823
yading@10 9824 Read a grid from F<pattern>, and center it on a grid of size
yading@10 9825 300x300 pixels:
yading@10 9826
yading@10 9827 life=f=pattern:s=300x300
yading@10 9828
yading@10 9829
yading@10 9830
yading@10 9831 =item *
yading@10 9832
yading@10 9833 Generate a random grid of size 200x200, with a fill ratio of 2/3:
yading@10 9834
yading@10 9835 life=ratio=2/3:s=200x200
yading@10 9836
yading@10 9837
yading@10 9838
yading@10 9839 =item *
yading@10 9840
yading@10 9841 Specify a custom rule for evolving a randomly generated grid:
yading@10 9842
yading@10 9843 life=rule=S14/B34
yading@10 9844
yading@10 9845
yading@10 9846
yading@10 9847 =item *
yading@10 9848
yading@10 9849 Full example with slow death effect (mold) using B<ffplay>:
yading@10 9850
yading@10 9851 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 9852
yading@10 9853
yading@10 9854 =back
yading@10 9855
yading@10 9856
yading@10 9857
yading@10 9858 =head2 color, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc
yading@10 9859
yading@10 9860
yading@10 9861 The C<color> source provides an uniformly colored input.
yading@10 9862
yading@10 9863 The C<nullsrc> source returns unprocessed video frames. It is
yading@10 9864 mainly useful to be employed in analysis / debugging tools, or as the
yading@10 9865 source for filters which ignore the input data.
yading@10 9866
yading@10 9867 The C<rgbtestsrc> source generates an RGB test pattern useful for
yading@10 9868 detecting RGB vs BGR issues. You should see a red, green and blue
yading@10 9869 stripe from top to bottom.
yading@10 9870
yading@10 9871 The C<smptebars> source generates a color bars pattern, based on
yading@10 9872 the SMPTE Engineering Guideline EG 1-1990.
yading@10 9873
yading@10 9874 The C<smptehdbars> source generates a color bars pattern, based on
yading@10 9875 the SMPTE RP 219-2002.
yading@10 9876
yading@10 9877 The C<testsrc> source generates a test video pattern, showing a
yading@10 9878 color pattern, a scrolling gradient and a timestamp. This is mainly
yading@10 9879 intended for testing purposes.
yading@10 9880
yading@10 9881 The sources accept the following options:
yading@10 9882
yading@10 9883
yading@10 9884 =over 4
yading@10 9885
yading@10 9886
yading@10 9887
yading@10 9888 =item B<color, c>
yading@10 9889
yading@10 9890 Specify the color of the source, only used in the C<color>
yading@10 9891 source. It can be the name of a color (case insensitive match) or a
yading@10 9892 0xRRGGBB[AA] sequence, possibly followed by an alpha specifier. The
yading@10 9893 default value is "black".
yading@10 9894
yading@10 9895
yading@10 9896 =item B<size, s>
yading@10 9897
yading@10 9898 Specify the size of the sourced video, it may be a string of the form
yading@10 9899 I<width>xI<height>, or the name of a size abbreviation. The
yading@10 9900 default value is "320x240".
yading@10 9901
yading@10 9902
yading@10 9903 =item B<rate, r>
yading@10 9904
yading@10 9905 Specify the frame rate of the sourced video, as the number of frames
yading@10 9906 generated per second. It has to be a string in the format
yading@10 9907 I<frame_rate_num>/I<frame_rate_den>, an integer number, a float
yading@10 9908 number or a valid video frame rate abbreviation. The default value is
yading@10 9909 "25".
yading@10 9910
yading@10 9911
yading@10 9912 =item B<sar>
yading@10 9913
yading@10 9914 Set the sample aspect ratio of the sourced video.
yading@10 9915
yading@10 9916
yading@10 9917 =item B<duration, d>
yading@10 9918
yading@10 9919 Set the video duration of the sourced video. The accepted syntax is:
yading@10 9920
yading@10 9921 [-]HH[:MM[:SS[.m...]]]
yading@10 9922 [-]S+[.m...]
yading@10 9923
yading@10 9924 See also the function C<av_parse_time()>.
yading@10 9925
yading@10 9926 If not specified, or the expressed duration is negative, the video is
yading@10 9927 supposed to be generated forever.
yading@10 9928
yading@10 9929
yading@10 9930 =item B<decimals, n>
yading@10 9931
yading@10 9932 Set the number of decimals to show in the timestamp, only used in the
yading@10 9933 C<testsrc> source.
yading@10 9934
yading@10 9935 The displayed timestamp value will correspond to the original
yading@10 9936 timestamp value multiplied by the power of 10 of the specified
yading@10 9937 value. Default value is 0.
yading@10 9938
yading@10 9939 =back
yading@10 9940
yading@10 9941
yading@10 9942 For example the following:
yading@10 9943
yading@10 9944 testsrc=duration=5.3:size=qcif:rate=10
yading@10 9945
yading@10 9946
yading@10 9947 will generate a video with a duration of 5.3 seconds, with size
yading@10 9948 176x144 and a frame rate of 10 frames per second.
yading@10 9949
yading@10 9950 The following graph description will generate a red source
yading@10 9951 with an opacity of 0.2, with size "qcif" and a frame rate of 10
yading@10 9952 frames per second.
yading@10 9953
yading@10 9954 color=c=red@0.2:s=qcif:r=10
yading@10 9955
yading@10 9956
yading@10 9957 If the input content is to be ignored, C<nullsrc> can be used. The
yading@10 9958 following command generates noise in the luminance plane by employing
yading@10 9959 the C<geq> filter:
yading@10 9960
yading@10 9961 nullsrc=s=256x256, geq=random(1)*255:128:128
yading@10 9962
yading@10 9963
yading@10 9964
yading@10 9965
yading@10 9966 =head1 VIDEO SINKS
yading@10 9967
yading@10 9968
yading@10 9969 Below is a description of the currently available video sinks.
yading@10 9970
yading@10 9971
yading@10 9972 =head2 buffersink
yading@10 9973
yading@10 9974
yading@10 9975 Buffer video frames, and make them available to the end of the filter
yading@10 9976 graph.
yading@10 9977
yading@10 9978 This sink is mainly intended for a programmatic use, in particular
yading@10 9979 through the interface defined in F<libavfilter/buffersink.h>
yading@10 9980 or the options system.
yading@10 9981
yading@10 9982 It accepts a pointer to an AVBufferSinkContext structure, which
yading@10 9983 defines the incoming buffers' formats, to be passed as the opaque
yading@10 9984 parameter to C<avfilter_init_filter> for initialization.
yading@10 9985
yading@10 9986
yading@10 9987 =head2 nullsink
yading@10 9988
yading@10 9989
yading@10 9990 Null video sink, do absolutely nothing with the input video. It is
yading@10 9991 mainly useful as a template and to be employed in analysis / debugging
yading@10 9992 tools.
yading@10 9993
yading@10 9994
yading@10 9995
yading@10 9996 =head1 MULTIMEDIA FILTERS
yading@10 9997
yading@10 9998
yading@10 9999 Below is a description of the currently available multimedia filters.
yading@10 10000
yading@10 10001
yading@10 10002 =head2 aperms, perms
yading@10 10003
yading@10 10004
yading@10 10005 Set read/write permissions for the output frames.
yading@10 10006
yading@10 10007 These filters are mainly aimed at developers to test direct path in the
yading@10 10008 following filter in the filtergraph.
yading@10 10009
yading@10 10010 The filters accept the following options:
yading@10 10011
yading@10 10012
yading@10 10013 =over 4
yading@10 10014
yading@10 10015
yading@10 10016 =item B<mode>
yading@10 10017
yading@10 10018 Select the permissions mode.
yading@10 10019
yading@10 10020 It accepts the following values:
yading@10 10021
yading@10 10022 =over 4
yading@10 10023
yading@10 10024
yading@10 10025 =item B<none>
yading@10 10026
yading@10 10027 Do nothing. This is the default.
yading@10 10028
yading@10 10029 =item B<ro>
yading@10 10030
yading@10 10031 Set all the output frames read-only.
yading@10 10032
yading@10 10033 =item B<rw>
yading@10 10034
yading@10 10035 Set all the output frames directly writable.
yading@10 10036
yading@10 10037 =item B<toggle>
yading@10 10038
yading@10 10039 Make the frame read-only if writable, and writable if read-only.
yading@10 10040
yading@10 10041 =item B<random>
yading@10 10042
yading@10 10043 Set each output frame read-only or writable randomly.
yading@10 10044
yading@10 10045 =back
yading@10 10046
yading@10 10047
yading@10 10048
yading@10 10049 =item B<seed>
yading@10 10050
yading@10 10051 Set the seed for the I<random> mode, must be an integer included between
yading@10 10052 C<0> and C<UINT32_MAX>. If not specified, or if explicitly set to
yading@10 10053 C<-1>, the filter will try to use a good random seed on a best effort
yading@10 10054 basis.
yading@10 10055
yading@10 10056 =back
yading@10 10057
yading@10 10058
yading@10 10059 Note: in case of auto-inserted filter between the permission filter and the
yading@10 10060 following one, the permission might not be received as expected in that
yading@10 10061 following filter. Inserting a format or aformat filter before the
yading@10 10062 perms/aperms filter can avoid this problem.
yading@10 10063
yading@10 10064
yading@10 10065 =head2 aselect, select
yading@10 10066
yading@10 10067 Select frames to pass in output.
yading@10 10068
yading@10 10069 This filter accepts the following options:
yading@10 10070
yading@10 10071
yading@10 10072 =over 4
yading@10 10073
yading@10 10074
yading@10 10075
yading@10 10076 =item B<expr, e>
yading@10 10077
yading@10 10078 Set expression, which is evaluated for each input frame.
yading@10 10079
yading@10 10080 If the expression is evaluated to zero, the frame is discarded.
yading@10 10081
yading@10 10082 If the evaluation result is negative or NaN, the frame is sent to the
yading@10 10083 first output; otherwise it is sent to the output with index
yading@10 10084 C<ceil(val)-1>, assuming that the input index starts from 0.
yading@10 10085
yading@10 10086 For example a value of C<1.2> corresponds to the output with index
yading@10 10087 C<ceil(1.2)-1 = 2-1 = 1>, that is the second output.
yading@10 10088
yading@10 10089
yading@10 10090 =item B<outputs, n>
yading@10 10091
yading@10 10092 Set the number of outputs. The output to which to send the selected
yading@10 10093 frame is based on the result of the evaluation. Default value is 1.
yading@10 10094
yading@10 10095 =back
yading@10 10096
yading@10 10097
yading@10 10098 The expression can contain the following constants:
yading@10 10099
yading@10 10100
yading@10 10101 =over 4
yading@10 10102
yading@10 10103
yading@10 10104 =item B<n>
yading@10 10105
yading@10 10106 the sequential number of the filtered frame, starting from 0
yading@10 10107
yading@10 10108
yading@10 10109 =item B<selected_n>
yading@10 10110
yading@10 10111 the sequential number of the selected frame, starting from 0
yading@10 10112
yading@10 10113
yading@10 10114 =item B<prev_selected_n>
yading@10 10115
yading@10 10116 the sequential number of the last selected frame, NAN if undefined
yading@10 10117
yading@10 10118
yading@10 10119 =item B<TB>
yading@10 10120
yading@10 10121 timebase of the input timestamps
yading@10 10122
yading@10 10123
yading@10 10124 =item B<pts>
yading@10 10125
yading@10 10126 the PTS (Presentation TimeStamp) of the filtered video frame,
yading@10 10127 expressed in I<TB> units, NAN if undefined
yading@10 10128
yading@10 10129
yading@10 10130 =item B<t>
yading@10 10131
yading@10 10132 the PTS (Presentation TimeStamp) of the filtered video frame,
yading@10 10133 expressed in seconds, NAN if undefined
yading@10 10134
yading@10 10135
yading@10 10136 =item B<prev_pts>
yading@10 10137
yading@10 10138 the PTS of the previously filtered video frame, NAN if undefined
yading@10 10139
yading@10 10140
yading@10 10141 =item B<prev_selected_pts>
yading@10 10142
yading@10 10143 the PTS of the last previously filtered video frame, NAN if undefined
yading@10 10144
yading@10 10145
yading@10 10146 =item B<prev_selected_t>
yading@10 10147
yading@10 10148 the PTS of the last previously selected video frame, NAN if undefined
yading@10 10149
yading@10 10150
yading@10 10151 =item B<start_pts>
yading@10 10152
yading@10 10153 the PTS of the first video frame in the video, NAN if undefined
yading@10 10154
yading@10 10155
yading@10 10156 =item B<start_t>
yading@10 10157
yading@10 10158 the time of the first video frame in the video, NAN if undefined
yading@10 10159
yading@10 10160
yading@10 10161 =item B<pict_type> I<(video only)>
yading@10 10162
yading@10 10163 the type of the filtered frame, can assume one of the following
yading@10 10164 values:
yading@10 10165
yading@10 10166 =over 4
yading@10 10167
yading@10 10168
yading@10 10169 =item B<I>
yading@10 10170
yading@10 10171
yading@10 10172 =item B<P>
yading@10 10173
yading@10 10174
yading@10 10175 =item B<B>
yading@10 10176
yading@10 10177
yading@10 10178 =item B<S>
yading@10 10179
yading@10 10180
yading@10 10181 =item B<SI>
yading@10 10182
yading@10 10183
yading@10 10184 =item B<SP>
yading@10 10185
yading@10 10186
yading@10 10187 =item B<BI>
yading@10 10188
yading@10 10189
yading@10 10190 =back
yading@10 10191
yading@10 10192
yading@10 10193
yading@10 10194 =item B<interlace_type> I<(video only)>
yading@10 10195
yading@10 10196 the frame interlace type, can assume one of the following values:
yading@10 10197
yading@10 10198 =over 4
yading@10 10199
yading@10 10200
yading@10 10201 =item B<PROGRESSIVE>
yading@10 10202
yading@10 10203 the frame is progressive (not interlaced)
yading@10 10204
yading@10 10205 =item B<TOPFIRST>
yading@10 10206
yading@10 10207 the frame is top-field-first
yading@10 10208
yading@10 10209 =item B<BOTTOMFIRST>
yading@10 10210
yading@10 10211 the frame is bottom-field-first
yading@10 10212
yading@10 10213 =back
yading@10 10214
yading@10 10215
yading@10 10216
yading@10 10217 =item B<consumed_sample_n> I<(audio only)>
yading@10 10218
yading@10 10219 the number of selected samples before the current frame
yading@10 10220
yading@10 10221
yading@10 10222 =item B<samples_n> I<(audio only)>
yading@10 10223
yading@10 10224 the number of samples in the current frame
yading@10 10225
yading@10 10226
yading@10 10227 =item B<sample_rate> I<(audio only)>
yading@10 10228
yading@10 10229 the input sample rate
yading@10 10230
yading@10 10231
yading@10 10232 =item B<key>
yading@10 10233
yading@10 10234 1 if the filtered frame is a key-frame, 0 otherwise
yading@10 10235
yading@10 10236
yading@10 10237 =item B<pos>
yading@10 10238
yading@10 10239 the position in the file of the filtered frame, -1 if the information
yading@10 10240 is not available (e.g. for synthetic video)
yading@10 10241
yading@10 10242
yading@10 10243 =item B<scene> I<(video only)>
yading@10 10244
yading@10 10245 value between 0 and 1 to indicate a new scene; a low value reflects a low
yading@10 10246 probability for the current frame to introduce a new scene, while a higher
yading@10 10247 value means the current frame is more likely to be one (see the example below)
yading@10 10248
yading@10 10249
yading@10 10250 =back
yading@10 10251
yading@10 10252
yading@10 10253 The default value of the select expression is "1".
yading@10 10254
yading@10 10255
yading@10 10256 =head3 Examples
yading@10 10257
yading@10 10258
yading@10 10259
yading@10 10260 =over 4
yading@10 10261
yading@10 10262
yading@10 10263 =item *
yading@10 10264
yading@10 10265 Select all frames in input:
yading@10 10266
yading@10 10267 select
yading@10 10268
yading@10 10269
yading@10 10270 The example above is the same as:
yading@10 10271
yading@10 10272 select=1
yading@10 10273
yading@10 10274
yading@10 10275
yading@10 10276 =item *
yading@10 10277
yading@10 10278 Skip all frames:
yading@10 10279
yading@10 10280 select=0
yading@10 10281
yading@10 10282
yading@10 10283
yading@10 10284 =item *
yading@10 10285
yading@10 10286 Select only I-frames:
yading@10 10287
yading@10 10288 select='eq(pict_type\,I)'
yading@10 10289
yading@10 10290
yading@10 10291
yading@10 10292 =item *
yading@10 10293
yading@10 10294 Select one frame every 100:
yading@10 10295
yading@10 10296 select='not(mod(n\,100))'
yading@10 10297
yading@10 10298
yading@10 10299
yading@10 10300 =item *
yading@10 10301
yading@10 10302 Select only frames contained in the 10-20 time interval:
yading@10 10303
yading@10 10304 select='gte(t\,10)*lte(t\,20)'
yading@10 10305
yading@10 10306
yading@10 10307
yading@10 10308 =item *
yading@10 10309
yading@10 10310 Select only I frames contained in the 10-20 time interval:
yading@10 10311
yading@10 10312 select='gte(t\,10)*lte(t\,20)*eq(pict_type\,I)'
yading@10 10313
yading@10 10314
yading@10 10315
yading@10 10316 =item *
yading@10 10317
yading@10 10318 Select frames with a minimum distance of 10 seconds:
yading@10 10319
yading@10 10320 select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
yading@10 10321
yading@10 10322
yading@10 10323
yading@10 10324 =item *
yading@10 10325
yading@10 10326 Use aselect to select only audio frames with samples number E<gt> 100:
yading@10 10327
yading@10 10328 aselect='gt(samples_n\,100)'
yading@10 10329
yading@10 10330
yading@10 10331
yading@10 10332 =item *
yading@10 10333
yading@10 10334 Create a mosaic of the first scenes:
yading@10 10335
yading@10 10336 ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
yading@10 10337
yading@10 10338
yading@10 10339 Comparing I<scene> against a value between 0.3 and 0.5 is generally a sane
yading@10 10340 choice.
yading@10 10341
yading@10 10342
yading@10 10343 =item *
yading@10 10344
yading@10 10345 Send even and odd frames to separate outputs, and compose them:
yading@10 10346
yading@10 10347 select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
yading@10 10348
yading@10 10349
yading@10 10350 =back
yading@10 10351
yading@10 10352
yading@10 10353
yading@10 10354 =head2 asendcmd, sendcmd
yading@10 10355
yading@10 10356
yading@10 10357 Send commands to filters in the filtergraph.
yading@10 10358
yading@10 10359 These filters read commands to be sent to other filters in the
yading@10 10360 filtergraph.
yading@10 10361
yading@10 10362 C<asendcmd> must be inserted between two audio filters,
yading@10 10363 C<sendcmd> must be inserted between two video filters, but apart
yading@10 10364 from that they act the same way.
yading@10 10365
yading@10 10366 The specification of commands can be provided in the filter arguments
yading@10 10367 with the I<commands> option, or in a file specified by the
yading@10 10368 I<filename> option.
yading@10 10369
yading@10 10370 These filters accept the following options:
yading@10 10371
yading@10 10372 =over 4
yading@10 10373
yading@10 10374
yading@10 10375 =item B<commands, c>
yading@10 10376
yading@10 10377 Set the commands to be read and sent to the other filters.
yading@10 10378
yading@10 10379 =item B<filename, f>
yading@10 10380
yading@10 10381 Set the filename of the commands to be read and sent to the other
yading@10 10382 filters.
yading@10 10383
yading@10 10384 =back
yading@10 10385
yading@10 10386
yading@10 10387
yading@10 10388 =head3 Commands syntax
yading@10 10389
yading@10 10390
yading@10 10391 A commands description consists of a sequence of interval
yading@10 10392 specifications, comprising a list of commands to be executed when a
yading@10 10393 particular event related to that interval occurs. The occurring event
yading@10 10394 is typically the current frame time entering or leaving a given time
yading@10 10395 interval.
yading@10 10396
yading@10 10397 An interval is specified by the following syntax:
yading@10 10398
yading@10 10399 <START>[-<END>] <COMMANDS>;
yading@10 10400
yading@10 10401
yading@10 10402 The time interval is specified by the I<START> and I<END> times.
yading@10 10403 I<END> is optional and defaults to the maximum time.
yading@10 10404
yading@10 10405 The current frame time is considered within the specified interval if
yading@10 10406 it is included in the interval [I<START>, I<END>), that is when
yading@10 10407 the time is greater or equal to I<START> and is lesser than
yading@10 10408 I<END>.
yading@10 10409
yading@10 10410 I<COMMANDS> consists of a sequence of one or more command
yading@10 10411 specifications, separated by ",", relating to that interval. The
yading@10 10412 syntax of a command specification is given by:
yading@10 10413
yading@10 10414 [<FLAGS>] <TARGET> <COMMAND> <ARG>
yading@10 10415
yading@10 10416
yading@10 10417 I<FLAGS> is optional and specifies the type of events relating to
yading@10 10418 the time interval which enable sending the specified command, and must
yading@10 10419 be a non-null sequence of identifier flags separated by "+" or "|" and
yading@10 10420 enclosed between "[" and "]".
yading@10 10421
yading@10 10422 The following flags are recognized:
yading@10 10423
yading@10 10424 =over 4
yading@10 10425
yading@10 10426
yading@10 10427 =item B<enter>
yading@10 10428
yading@10 10429 The command is sent when the current frame timestamp enters the
yading@10 10430 specified interval. In other words, the command is sent when the
yading@10 10431 previous frame timestamp was not in the given interval, and the
yading@10 10432 current is.
yading@10 10433
yading@10 10434
yading@10 10435 =item B<leave>
yading@10 10436
yading@10 10437 The command is sent when the current frame timestamp leaves the
yading@10 10438 specified interval. In other words, the command is sent when the
yading@10 10439 previous frame timestamp was in the given interval, and the
yading@10 10440 current is not.
yading@10 10441
yading@10 10442 =back
yading@10 10443
yading@10 10444
yading@10 10445 If I<FLAGS> is not specified, a default value of C<[enter]> is
yading@10 10446 assumed.
yading@10 10447
yading@10 10448 I<TARGET> specifies the target of the command, usually the name of
yading@10 10449 the filter class or a specific filter instance name.
yading@10 10450
yading@10 10451 I<COMMAND> specifies the name of the command for the target filter.
yading@10 10452
yading@10 10453 I<ARG> is optional and specifies the optional list of argument for
yading@10 10454 the given I<COMMAND>.
yading@10 10455
yading@10 10456 Between one interval specification and another, whitespaces, or
yading@10 10457 sequences of characters starting with C<#> until the end of line,
yading@10 10458 are ignored and can be used to annotate comments.
yading@10 10459
yading@10 10460 A simplified BNF description of the commands specification syntax
yading@10 10461 follows:
yading@10 10462
yading@10 10463 <COMMAND_FLAG> ::= "enter" | "leave"
yading@10 10464 <COMMAND_FLAGS> ::= <COMMAND_FLAG> [(+|"|")<COMMAND_FLAG>]
yading@10 10465 <COMMAND> ::= ["[" <COMMAND_FLAGS> "]"] <TARGET> <COMMAND> [<ARG>]
yading@10 10466 <COMMANDS> ::= <COMMAND> [,<COMMANDS>]
yading@10 10467 <INTERVAL> ::= <START>[-<END>] <COMMANDS>
yading@10 10468 <INTERVALS> ::= <INTERVAL>[;<INTERVALS>]
yading@10 10469
yading@10 10470
yading@10 10471
yading@10 10472 =head3 Examples
yading@10 10473
yading@10 10474
yading@10 10475
yading@10 10476 =over 4
yading@10 10477
yading@10 10478
yading@10 10479 =item *
yading@10 10480
yading@10 10481 Specify audio tempo change at second 4:
yading@10 10482
yading@10 10483 asendcmd=c='4.0 atempo tempo 1.5',atempo
yading@10 10484
yading@10 10485
yading@10 10486
yading@10 10487 =item *
yading@10 10488
yading@10 10489 Specify a list of drawtext and hue commands in a file.
yading@10 10490
yading@10 10491 # show text in the interval 5-10
yading@10 10492 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
yading@10 10493 [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
yading@10 10494
yading@10 10495 # desaturate the image in the interval 15-20
yading@10 10496 15.0-20.0 [enter] hue s 0,
yading@10 10497 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
yading@10 10498 [leave] hue s 1,
yading@10 10499 [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
yading@10 10500
yading@10 10501 # apply an exponential saturation fade-out effect, starting from time 25
yading@10 10502 25 [enter] hue s exp(25-t)
yading@10 10503
yading@10 10504
yading@10 10505 A filtergraph allowing to read and process the above command list
yading@10 10506 stored in a file F<test.cmd>, can be specified with:
yading@10 10507
yading@10 10508 sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
yading@10 10509
yading@10 10510
yading@10 10511 =back
yading@10 10512
yading@10 10513
yading@10 10514
yading@10 10515
yading@10 10516 =head2 asetpts, setpts
yading@10 10517
yading@10 10518
yading@10 10519 Change the PTS (presentation timestamp) of the input frames.
yading@10 10520
yading@10 10521 C<asetpts> works on audio frames, C<setpts> on video frames.
yading@10 10522
yading@10 10523 This filter accepts the following options:
yading@10 10524
yading@10 10525
yading@10 10526 =over 4
yading@10 10527
yading@10 10528
yading@10 10529
yading@10 10530 =item B<expr>
yading@10 10531
yading@10 10532 The expression which is evaluated for each frame to construct its timestamp.
yading@10 10533
yading@10 10534
yading@10 10535 =back
yading@10 10536
yading@10 10537
yading@10 10538 The expression is evaluated through the eval API and can contain the following
yading@10 10539 constants:
yading@10 10540
yading@10 10541
yading@10 10542 =over 4
yading@10 10543
yading@10 10544
yading@10 10545 =item B<FRAME_RATE>
yading@10 10546
yading@10 10547 frame rate, only defined for constant frame-rate video
yading@10 10548
yading@10 10549
yading@10 10550 =item B<PTS>
yading@10 10551
yading@10 10552 the presentation timestamp in input
yading@10 10553
yading@10 10554
yading@10 10555 =item B<N>
yading@10 10556
yading@10 10557 the count of the input frame, starting from 0.
yading@10 10558
yading@10 10559
yading@10 10560 =item B<NB_CONSUMED_SAMPLES>
yading@10 10561
yading@10 10562 the number of consumed samples, not including the current frame (only
yading@10 10563 audio)
yading@10 10564
yading@10 10565
yading@10 10566 =item B<NB_SAMPLES>
yading@10 10567
yading@10 10568 the number of samples in the current frame (only audio)
yading@10 10569
yading@10 10570
yading@10 10571 =item B<SAMPLE_RATE>
yading@10 10572
yading@10 10573 audio sample rate
yading@10 10574
yading@10 10575
yading@10 10576 =item B<STARTPTS>
yading@10 10577
yading@10 10578 the PTS of the first frame
yading@10 10579
yading@10 10580
yading@10 10581 =item B<STARTT>
yading@10 10582
yading@10 10583 the time in seconds of the first frame
yading@10 10584
yading@10 10585
yading@10 10586 =item B<INTERLACED>
yading@10 10587
yading@10 10588 tell if the current frame is interlaced
yading@10 10589
yading@10 10590
yading@10 10591 =item B<T>
yading@10 10592
yading@10 10593 the time in seconds of the current frame
yading@10 10594
yading@10 10595
yading@10 10596 =item B<TB>
yading@10 10597
yading@10 10598 the time base
yading@10 10599
yading@10 10600
yading@10 10601 =item B<POS>
yading@10 10602
yading@10 10603 original position in the file of the frame, or undefined if undefined
yading@10 10604 for the current frame
yading@10 10605
yading@10 10606
yading@10 10607 =item B<PREV_INPTS>
yading@10 10608
yading@10 10609 previous input PTS
yading@10 10610
yading@10 10611
yading@10 10612 =item B<PREV_INT>
yading@10 10613
yading@10 10614 previous input time in seconds
yading@10 10615
yading@10 10616
yading@10 10617 =item B<PREV_OUTPTS>
yading@10 10618
yading@10 10619 previous output PTS
yading@10 10620
yading@10 10621
yading@10 10622 =item B<PREV_OUTT>
yading@10 10623
yading@10 10624 previous output time in seconds
yading@10 10625
yading@10 10626
yading@10 10627 =item B<RTCTIME>
yading@10 10628
yading@10 10629 wallclock (RTC) time in microseconds. This is deprecated, use time(0)
yading@10 10630 instead.
yading@10 10631
yading@10 10632
yading@10 10633 =item B<RTCSTART>
yading@10 10634
yading@10 10635 wallclock (RTC) time at the start of the movie in microseconds
yading@10 10636
yading@10 10637 =back
yading@10 10638
yading@10 10639
yading@10 10640
yading@10 10641 =head3 Examples
yading@10 10642
yading@10 10643
yading@10 10644
yading@10 10645 =over 4
yading@10 10646
yading@10 10647
yading@10 10648 =item *
yading@10 10649
yading@10 10650 Start counting PTS from zero
yading@10 10651
yading@10 10652 setpts=PTS-STARTPTS
yading@10 10653
yading@10 10654
yading@10 10655
yading@10 10656 =item *
yading@10 10657
yading@10 10658 Apply fast motion effect:
yading@10 10659
yading@10 10660 setpts=0.5*PTS
yading@10 10661
yading@10 10662
yading@10 10663
yading@10 10664 =item *
yading@10 10665
yading@10 10666 Apply slow motion effect:
yading@10 10667
yading@10 10668 setpts=2.0*PTS
yading@10 10669
yading@10 10670
yading@10 10671
yading@10 10672 =item *
yading@10 10673
yading@10 10674 Set fixed rate of 25 frames per second:
yading@10 10675
yading@10 10676 setpts=N/(25*TB)
yading@10 10677
yading@10 10678
yading@10 10679
yading@10 10680 =item *
yading@10 10681
yading@10 10682 Set fixed rate 25 fps with some jitter:
yading@10 10683
yading@10 10684 setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
yading@10 10685
yading@10 10686
yading@10 10687
yading@10 10688 =item *
yading@10 10689
yading@10 10690 Apply an offset of 10 seconds to the input PTS:
yading@10 10691
yading@10 10692 setpts=PTS+10/TB
yading@10 10693
yading@10 10694
yading@10 10695
yading@10 10696 =item *
yading@10 10697
yading@10 10698 Generate timestamps from a "live source" and rebase onto the current timebase:
yading@10 10699
yading@10 10700 setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
yading@10 10701
yading@10 10702
yading@10 10703 =back
yading@10 10704
yading@10 10705
yading@10 10706
yading@10 10707 =head2 ebur128
yading@10 10708
yading@10 10709
yading@10 10710 EBU R128 scanner filter. This filter takes an audio stream as input and outputs
yading@10 10711 it unchanged. By default, it logs a message at a frequency of 10Hz with the
yading@10 10712 Momentary loudness (identified by C<M>), Short-term loudness (C<S>),
yading@10 10713 Integrated loudness (C<I>) and Loudness Range (C<LRA>).
yading@10 10714
yading@10 10715 The filter also has a video output (see the I<video> option) with a real
yading@10 10716 time graph to observe the loudness evolution. The graphic contains the logged
yading@10 10717 message mentioned above, so it is not printed anymore when this option is set,
yading@10 10718 unless the verbose logging is set. The main graphing area contains the
yading@10 10719 short-term loudness (3 seconds of analysis), and the gauge on the right is for
yading@10 10720 the momentary loudness (400 milliseconds).
yading@10 10721
yading@10 10722 More information about the Loudness Recommendation EBU R128 on
yading@10 10723 E<lt>B<http://tech.ebu.ch/loudness>E<gt>.
yading@10 10724
yading@10 10725 The filter accepts the following options:
yading@10 10726
yading@10 10727
yading@10 10728 =over 4
yading@10 10729
yading@10 10730
yading@10 10731
yading@10 10732 =item B<video>
yading@10 10733
yading@10 10734 Activate the video output. The audio stream is passed unchanged whether this
yading@10 10735 option is set or no. The video stream will be the first output stream if
yading@10 10736 activated. Default is C<0>.
yading@10 10737
yading@10 10738
yading@10 10739 =item B<size>
yading@10 10740
yading@10 10741 Set the video size. This option is for video only. Default and minimum
yading@10 10742 resolution is C<640x480>.
yading@10 10743
yading@10 10744
yading@10 10745 =item B<meter>
yading@10 10746
yading@10 10747 Set the EBU scale meter. Default is C<9>. Common values are C<9> and
yading@10 10748 C<18>, respectively for EBU scale meter +9 and EBU scale meter +18. Any
yading@10 10749 other integer value between this range is allowed.
yading@10 10750
yading@10 10751
yading@10 10752 =item B<metadata>
yading@10 10753
yading@10 10754 Set metadata injection. If set to C<1>, the audio input will be segmented
yading@10 10755 into 100ms output frames, each of them containing various loudness information
yading@10 10756 in metadata. All the metadata keys are prefixed with C<lavfi.r128.>.
yading@10 10757
yading@10 10758 Default is C<0>.
yading@10 10759
yading@10 10760
yading@10 10761 =item B<framelog>
yading@10 10762
yading@10 10763 Force the frame logging level.
yading@10 10764
yading@10 10765 Available values are:
yading@10 10766
yading@10 10767 =over 4
yading@10 10768
yading@10 10769
yading@10 10770 =item B<info>
yading@10 10771
yading@10 10772 information logging level
yading@10 10773
yading@10 10774 =item B<verbose>
yading@10 10775
yading@10 10776 verbose logging level
yading@10 10777
yading@10 10778 =back
yading@10 10779
yading@10 10780
yading@10 10781 By default, the logging level is set to I<info>. If the B<video> or
yading@10 10782 the B<metadata> options are set, it switches to I<verbose>.
yading@10 10783
yading@10 10784 =back
yading@10 10785
yading@10 10786
yading@10 10787
yading@10 10788 =head3 Examples
yading@10 10789
yading@10 10790
yading@10 10791
yading@10 10792 =over 4
yading@10 10793
yading@10 10794
yading@10 10795 =item *
yading@10 10796
yading@10 10797 Real-time graph using B<ffplay>, with a EBU scale meter +18:
yading@10 10798
yading@10 10799 ffplay -f lavfi -i "amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]"
yading@10 10800
yading@10 10801
yading@10 10802
yading@10 10803 =item *
yading@10 10804
yading@10 10805 Run an analysis with B<ffmpeg>:
yading@10 10806
yading@10 10807 ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
yading@10 10808
yading@10 10809
yading@10 10810 =back
yading@10 10811
yading@10 10812
yading@10 10813
yading@10 10814 =head2 settb, asettb
yading@10 10815
yading@10 10816
yading@10 10817 Set the timebase to use for the output frames timestamps.
yading@10 10818 It is mainly useful for testing timebase configuration.
yading@10 10819
yading@10 10820 This filter accepts the following options:
yading@10 10821
yading@10 10822
yading@10 10823 =over 4
yading@10 10824
yading@10 10825
yading@10 10826
yading@10 10827 =item B<expr, tb>
yading@10 10828
yading@10 10829 The expression which is evaluated into the output timebase.
yading@10 10830
yading@10 10831
yading@10 10832 =back
yading@10 10833
yading@10 10834
yading@10 10835 The value for B<tb> is an arithmetic expression representing a
yading@10 10836 rational. The expression can contain the constants "AVTB" (the default
yading@10 10837 timebase), "intb" (the input timebase) and "sr" (the sample rate,
yading@10 10838 audio only). Default value is "intb".
yading@10 10839
yading@10 10840
yading@10 10841 =head3 Examples
yading@10 10842
yading@10 10843
yading@10 10844
yading@10 10845 =over 4
yading@10 10846
yading@10 10847
yading@10 10848 =item *
yading@10 10849
yading@10 10850 Set the timebase to 1/25:
yading@10 10851
yading@10 10852 settb=expr=1/25
yading@10 10853
yading@10 10854
yading@10 10855
yading@10 10856 =item *
yading@10 10857
yading@10 10858 Set the timebase to 1/10:
yading@10 10859
yading@10 10860 settb=expr=0.1
yading@10 10861
yading@10 10862
yading@10 10863
yading@10 10864 =item *
yading@10 10865
yading@10 10866 Set the timebase to 1001/1000:
yading@10 10867
yading@10 10868 settb=1+0.001
yading@10 10869
yading@10 10870
yading@10 10871
yading@10 10872 =item *
yading@10 10873
yading@10 10874 Set the timebase to 2*intb:
yading@10 10875
yading@10 10876 settb=2*intb
yading@10 10877
yading@10 10878
yading@10 10879
yading@10 10880 =item *
yading@10 10881
yading@10 10882 Set the default timebase value:
yading@10 10883
yading@10 10884 settb=AVTB
yading@10 10885
yading@10 10886
yading@10 10887 =back
yading@10 10888
yading@10 10889
yading@10 10890
yading@10 10891 =head2 concat
yading@10 10892
yading@10 10893
yading@10 10894 Concatenate audio and video streams, joining them together one after the
yading@10 10895 other.
yading@10 10896
yading@10 10897 The filter works on segments of synchronized video and audio streams. All
yading@10 10898 segments must have the same number of streams of each type, and that will
yading@10 10899 also be the number of streams at output.
yading@10 10900
yading@10 10901 The filter accepts the following options:
yading@10 10902
yading@10 10903
yading@10 10904 =over 4
yading@10 10905
yading@10 10906
yading@10 10907
yading@10 10908 =item B<n>
yading@10 10909
yading@10 10910 Set the number of segments. Default is 2.
yading@10 10911
yading@10 10912
yading@10 10913 =item B<v>
yading@10 10914
yading@10 10915 Set the number of output video streams, that is also the number of video
yading@10 10916 streams in each segment. Default is 1.
yading@10 10917
yading@10 10918
yading@10 10919 =item B<a>
yading@10 10920
yading@10 10921 Set the number of output audio streams, that is also the number of video
yading@10 10922 streams in each segment. Default is 0.
yading@10 10923
yading@10 10924
yading@10 10925 =item B<unsafe>
yading@10 10926
yading@10 10927 Activate unsafe mode: do not fail if segments have a different format.
yading@10 10928
yading@10 10929
yading@10 10930 =back
yading@10 10931
yading@10 10932
yading@10 10933 The filter has I<v>+I<a> outputs: first I<v> video outputs, then
yading@10 10934 I<a> audio outputs.
yading@10 10935
yading@10 10936 There are I<n>x(I<v>+I<a>) inputs: first the inputs for the first
yading@10 10937 segment, in the same order as the outputs, then the inputs for the second
yading@10 10938 segment, etc.
yading@10 10939
yading@10 10940 Related streams do not always have exactly the same duration, for various
yading@10 10941 reasons including codec frame size or sloppy authoring. For that reason,
yading@10 10942 related synchronized streams (e.g. a video and its audio track) should be
yading@10 10943 concatenated at once. The concat filter will use the duration of the longest
yading@10 10944 stream in each segment (except the last one), and if necessary pad shorter
yading@10 10945 audio streams with silence.
yading@10 10946
yading@10 10947 For this filter to work correctly, all segments must start at timestamp 0.
yading@10 10948
yading@10 10949 All corresponding streams must have the same parameters in all segments; the
yading@10 10950 filtering system will automatically select a common pixel format for video
yading@10 10951 streams, and a common sample format, sample rate and channel layout for
yading@10 10952 audio streams, but other settings, such as resolution, must be converted
yading@10 10953 explicitly by the user.
yading@10 10954
yading@10 10955 Different frame rates are acceptable but will result in variable frame rate
yading@10 10956 at output; be sure to configure the output file to handle it.
yading@10 10957
yading@10 10958
yading@10 10959 =head3 Examples
yading@10 10960
yading@10 10961
yading@10 10962
yading@10 10963 =over 4
yading@10 10964
yading@10 10965
yading@10 10966 =item *
yading@10 10967
yading@10 10968 Concatenate an opening, an episode and an ending, all in bilingual version
yading@10 10969 (video in stream 0, audio in streams 1 and 2):
yading@10 10970
yading@10 10971 ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
yading@10 10972 '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
yading@10 10973 concat=n=3:v=1:a=2 [v] [a1] [a2]' \
yading@10 10974 -map '[v]' -map '[a1]' -map '[a2]' output.mkv
yading@10 10975
yading@10 10976
yading@10 10977
yading@10 10978 =item *
yading@10 10979
yading@10 10980 Concatenate two parts, handling audio and video separately, using the
yading@10 10981 (a)movie sources, and adjusting the resolution:
yading@10 10982
yading@10 10983 movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
yading@10 10984 movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
yading@10 10985 [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
yading@10 10986
yading@10 10987 Note that a desync will happen at the stitch if the audio and video streams
yading@10 10988 do not have exactly the same duration in the first file.
yading@10 10989
yading@10 10990
yading@10 10991 =back
yading@10 10992
yading@10 10993
yading@10 10994
yading@10 10995 =head2 showspectrum
yading@10 10996
yading@10 10997
yading@10 10998 Convert input audio to a video output, representing the audio frequency
yading@10 10999 spectrum.
yading@10 11000
yading@10 11001 The filter accepts the following options:
yading@10 11002
yading@10 11003
yading@10 11004 =over 4
yading@10 11005
yading@10 11006
yading@10 11007 =item B<size, s>
yading@10 11008
yading@10 11009 Specify the video size for the output. Default value is C<640x512>.
yading@10 11010
yading@10 11011
yading@10 11012 =item B<slide>
yading@10 11013
yading@10 11014 Specify if the spectrum should slide along the window. Default value is
yading@10 11015 C<0>.
yading@10 11016
yading@10 11017
yading@10 11018 =item B<mode>
yading@10 11019
yading@10 11020 Specify display mode.
yading@10 11021
yading@10 11022 It accepts the following values:
yading@10 11023
yading@10 11024 =over 4
yading@10 11025
yading@10 11026
yading@10 11027 =item B<combined>
yading@10 11028
yading@10 11029 all channels are displayed in the same row
yading@10 11030
yading@10 11031 =item B<separate>
yading@10 11032
yading@10 11033 all channels are displayed in separate rows
yading@10 11034
yading@10 11035 =back
yading@10 11036
yading@10 11037
yading@10 11038 Default value is B<combined>.
yading@10 11039
yading@10 11040
yading@10 11041 =item B<color>
yading@10 11042
yading@10 11043 Specify display color mode.
yading@10 11044
yading@10 11045 It accepts the following values:
yading@10 11046
yading@10 11047 =over 4
yading@10 11048
yading@10 11049
yading@10 11050 =item B<channel>
yading@10 11051
yading@10 11052 each channel is displayed in a separate color
yading@10 11053
yading@10 11054 =item B<intensity>
yading@10 11055
yading@10 11056 each channel is is displayed using the same color scheme
yading@10 11057
yading@10 11058 =back
yading@10 11059
yading@10 11060
yading@10 11061 Default value is B<channel>.
yading@10 11062
yading@10 11063
yading@10 11064 =item B<scale>
yading@10 11065
yading@10 11066 Specify scale used for calculating intensity color values.
yading@10 11067
yading@10 11068 It accepts the following values:
yading@10 11069
yading@10 11070 =over 4
yading@10 11071
yading@10 11072
yading@10 11073 =item B<lin>
yading@10 11074
yading@10 11075 linear
yading@10 11076
yading@10 11077 =item B<sqrt>
yading@10 11078
yading@10 11079 square root, default
yading@10 11080
yading@10 11081 =item B<cbrt>
yading@10 11082
yading@10 11083 cubic root
yading@10 11084
yading@10 11085 =item B<log>
yading@10 11086
yading@10 11087 logarithmic
yading@10 11088
yading@10 11089 =back
yading@10 11090
yading@10 11091
yading@10 11092 Default value is B<sqrt>.
yading@10 11093
yading@10 11094
yading@10 11095 =item B<saturation>
yading@10 11096
yading@10 11097 Set saturation modifier for displayed colors. Negative values provide
yading@10 11098 alternative color scheme. C<0> is no saturation at all.
yading@10 11099 Saturation must be in [-10.0, 10.0] range.
yading@10 11100 Default value is C<1>.
yading@10 11101
yading@10 11102 =back
yading@10 11103
yading@10 11104
yading@10 11105 The usage is very similar to the showwaves filter; see the examples in that
yading@10 11106 section.
yading@10 11107
yading@10 11108
yading@10 11109 =head3 Examples
yading@10 11110
yading@10 11111
yading@10 11112
yading@10 11113 =over 4
yading@10 11114
yading@10 11115
yading@10 11116 =item *
yading@10 11117
yading@10 11118 Large window with logarithmic color scaling:
yading@10 11119
yading@10 11120 showspectrum=s=1280x480:scale=log
yading@10 11121
yading@10 11122
yading@10 11123
yading@10 11124 =item *
yading@10 11125
yading@10 11126 Complete example for a colored and sliding spectrum per channel using B<ffplay>:
yading@10 11127
yading@10 11128 ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
yading@10 11129 [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
yading@10 11130
yading@10 11131
yading@10 11132 =back
yading@10 11133
yading@10 11134
yading@10 11135
yading@10 11136 =head2 showwaves
yading@10 11137
yading@10 11138
yading@10 11139 Convert input audio to a video output, representing the samples waves.
yading@10 11140
yading@10 11141 The filter accepts the following options:
yading@10 11142
yading@10 11143
yading@10 11144 =over 4
yading@10 11145
yading@10 11146
yading@10 11147 =item B<size, s>
yading@10 11148
yading@10 11149 Specify the video size for the output. Default value is "600x240".
yading@10 11150
yading@10 11151
yading@10 11152 =item B<mode>
yading@10 11153
yading@10 11154 Set display mode.
yading@10 11155
yading@10 11156 Available values are:
yading@10 11157
yading@10 11158 =over 4
yading@10 11159
yading@10 11160
yading@10 11161 =item B<point>
yading@10 11162
yading@10 11163 Draw a point for each sample.
yading@10 11164
yading@10 11165
yading@10 11166 =item B<line>
yading@10 11167
yading@10 11168 Draw a vertical line for each sample.
yading@10 11169
yading@10 11170 =back
yading@10 11171
yading@10 11172
yading@10 11173 Default value is C<point>.
yading@10 11174
yading@10 11175
yading@10 11176 =item B<n>
yading@10 11177
yading@10 11178 Set the number of samples which are printed on the same column. A
yading@10 11179 larger value will decrease the frame rate. Must be a positive
yading@10 11180 integer. This option can be set only if the value for I<rate>
yading@10 11181 is not explicitly specified.
yading@10 11182
yading@10 11183
yading@10 11184 =item B<rate, r>
yading@10 11185
yading@10 11186 Set the (approximate) output frame rate. This is done by setting the
yading@10 11187 option I<n>. Default value is "25".
yading@10 11188
yading@10 11189
yading@10 11190 =back
yading@10 11191
yading@10 11192
yading@10 11193
yading@10 11194 =head3 Examples
yading@10 11195
yading@10 11196
yading@10 11197
yading@10 11198 =over 4
yading@10 11199
yading@10 11200
yading@10 11201 =item *
yading@10 11202
yading@10 11203 Output the input file audio and the corresponding video representation
yading@10 11204 at the same time:
yading@10 11205
yading@10 11206 amovie=a.mp3,asplit[out0],showwaves[out1]
yading@10 11207
yading@10 11208
yading@10 11209
yading@10 11210 =item *
yading@10 11211
yading@10 11212 Create a synthetic signal and show it with showwaves, forcing a
yading@10 11213 frame rate of 30 frames per second:
yading@10 11214
yading@10 11215 aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
yading@10 11216
yading@10 11217
yading@10 11218 =back
yading@10 11219
yading@10 11220
yading@10 11221
yading@10 11222 =head2 split, asplit
yading@10 11223
yading@10 11224
yading@10 11225 Split input into several identical outputs.
yading@10 11226
yading@10 11227 C<asplit> works with audio input, C<split> with video.
yading@10 11228
yading@10 11229 The filter accepts a single parameter which specifies the number of outputs. If
yading@10 11230 unspecified, it defaults to 2.
yading@10 11231
yading@10 11232
yading@10 11233 =head3 Examples
yading@10 11234
yading@10 11235
yading@10 11236
yading@10 11237 =over 4
yading@10 11238
yading@10 11239
yading@10 11240 =item *
yading@10 11241
yading@10 11242 Create two separate outputs from the same input:
yading@10 11243
yading@10 11244 [in] split [out0][out1]
yading@10 11245
yading@10 11246
yading@10 11247
yading@10 11248 =item *
yading@10 11249
yading@10 11250 To create 3 or more outputs, you need to specify the number of
yading@10 11251 outputs, like in:
yading@10 11252
yading@10 11253 [in] asplit=3 [out0][out1][out2]
yading@10 11254
yading@10 11255
yading@10 11256
yading@10 11257 =item *
yading@10 11258
yading@10 11259 Create two separate outputs from the same input, one cropped and
yading@10 11260 one padded:
yading@10 11261
yading@10 11262 [in] split [splitout1][splitout2];
yading@10 11263 [splitout1] crop=100:100:0:0 [cropout];
yading@10 11264 [splitout2] pad=200:200:100:100 [padout];
yading@10 11265
yading@10 11266
yading@10 11267
yading@10 11268 =item *
yading@10 11269
yading@10 11270 Create 5 copies of the input audio with B<ffmpeg>:
yading@10 11271
yading@10 11272 ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
yading@10 11273
yading@10 11274
yading@10 11275 =back
yading@10 11276
yading@10 11277
yading@10 11278
yading@10 11279
yading@10 11280 =head1 MULTIMEDIA SOURCES
yading@10 11281
yading@10 11282
yading@10 11283 Below is a description of the currently available multimedia sources.
yading@10 11284
yading@10 11285
yading@10 11286 =head2 amovie
yading@10 11287
yading@10 11288
yading@10 11289 This is the same as movie source, except it selects an audio
yading@10 11290 stream by default.
yading@10 11291
yading@10 11292
yading@10 11293
yading@10 11294 =head2 movie
yading@10 11295
yading@10 11296
yading@10 11297 Read audio and/or video stream(s) from a movie container.
yading@10 11298
yading@10 11299 This filter accepts the following options:
yading@10 11300
yading@10 11301
yading@10 11302 =over 4
yading@10 11303
yading@10 11304
yading@10 11305 =item B<filename>
yading@10 11306
yading@10 11307 The name of the resource to read (not necessarily a file but also a device or a
yading@10 11308 stream accessed through some protocol).
yading@10 11309
yading@10 11310
yading@10 11311 =item B<format_name, f>
yading@10 11312
yading@10 11313 Specifies the format assumed for the movie to read, and can be either
yading@10 11314 the name of a container or an input device. If not specified the
yading@10 11315 format is guessed from I<movie_name> or by probing.
yading@10 11316
yading@10 11317
yading@10 11318 =item B<seek_point, sp>
yading@10 11319
yading@10 11320 Specifies the seek point in seconds, the frames will be output
yading@10 11321 starting from this seek point, the parameter is evaluated with
yading@10 11322 C<av_strtod> so the numerical value may be suffixed by an IS
yading@10 11323 postfix. Default value is "0".
yading@10 11324
yading@10 11325
yading@10 11326 =item B<streams, s>
yading@10 11327
yading@10 11328 Specifies the streams to read. Several streams can be specified,
yading@10 11329 separated by "+". The source will then have as many outputs, in the
yading@10 11330 same order. The syntax is explained in the ``Stream specifiers''
yading@10 11331 section in the ffmpeg manual. Two special names, "dv" and "da" specify
yading@10 11332 respectively the default (best suited) video and audio stream. Default
yading@10 11333 is "dv", or "da" if the filter is called as "amovie".
yading@10 11334
yading@10 11335
yading@10 11336 =item B<stream_index, si>
yading@10 11337
yading@10 11338 Specifies the index of the video stream to read. If the value is -1,
yading@10 11339 the best suited video stream will be automatically selected. Default
yading@10 11340 value is "-1". Deprecated. If the filter is called "amovie", it will select
yading@10 11341 audio instead of video.
yading@10 11342
yading@10 11343
yading@10 11344 =item B<loop>
yading@10 11345
yading@10 11346 Specifies how many times to read the stream in sequence.
yading@10 11347 If the value is less than 1, the stream will be read again and again.
yading@10 11348 Default value is "1".
yading@10 11349
yading@10 11350 Note that when the movie is looped the source timestamps are not
yading@10 11351 changed, so it will generate non monotonically increasing timestamps.
yading@10 11352
yading@10 11353 =back
yading@10 11354
yading@10 11355
yading@10 11356 This filter allows to overlay a second video on top of main input of
yading@10 11357 a filtergraph as shown in this graph:
yading@10 11358
yading@10 11359 input -----------> deltapts0 --> overlay --> output
yading@10 11360 ^
yading@10 11361 |
yading@10 11362 movie --> scale--> deltapts1 -------+
yading@10 11363
yading@10 11364
yading@10 11365
yading@10 11366 =head3 Examples
yading@10 11367
yading@10 11368
yading@10 11369
yading@10 11370 =over 4
yading@10 11371
yading@10 11372
yading@10 11373 =item *
yading@10 11374
yading@10 11375 Skip 3.2 seconds from the start of the avi file in.avi, and overlay it
yading@10 11376 on top of the input labelled as "in":
yading@10 11377
yading@10 11378 movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
yading@10 11379 [in] setpts=PTS-STARTPTS [main];
yading@10 11380 [main][over] overlay=16:16 [out]
yading@10 11381
yading@10 11382
yading@10 11383
yading@10 11384 =item *
yading@10 11385
yading@10 11386 Read from a video4linux2 device, and overlay it on top of the input
yading@10 11387 labelled as "in":
yading@10 11388
yading@10 11389 movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
yading@10 11390 [in] setpts=PTS-STARTPTS [main];
yading@10 11391 [main][over] overlay=16:16 [out]
yading@10 11392
yading@10 11393
yading@10 11394
yading@10 11395 =item *
yading@10 11396
yading@10 11397 Read the first video stream and the audio stream with id 0x81 from
yading@10 11398 dvd.vob; the video is connected to the pad named "video" and the audio is
yading@10 11399 connected to the pad named "audio":
yading@10 11400
yading@10 11401 movie=dvd.vob:s=v:0+#0x81 [video] [audio]
yading@10 11402
yading@10 11403
yading@10 11404 =back
yading@10 11405
yading@10 11406
yading@10 11407
yading@10 11408
yading@10 11409 =head1 SEE ALSO
yading@10 11410
yading@10 11411
yading@10 11412
yading@10 11413 ffmpeg(1), ffplay(1), ffprobe(1), ffserver(1), libavfilter(3)
yading@10 11414
yading@10 11415
yading@10 11416 =head1 AUTHORS
yading@10 11417
yading@10 11418
yading@10 11419 The FFmpeg developers.
yading@10 11420
yading@10 11421 For details about the authorship, see the Git history of the project
yading@10 11422 (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
yading@10 11423 B<git log> in the FFmpeg source directory, or browsing the
yading@10 11424 online repository at E<lt>B<http://source.ffmpeg.org>E<gt>.
yading@10 11425
yading@10 11426 Maintainers for the specific components are listed in the file
yading@10 11427 F<MAINTAINERS> in the source code tree.
yading@10 11428
yading@10 11429
yading@10 11430