annotate ffmpeg/doc/ffprobe-all.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 ffprobe - ffprobe media prober
yading@10 4
yading@10 5 =head1 SYNOPSIS
yading@10 6
yading@10 7
yading@10 8 ffprobe [I<options>] [F<input_file>]
yading@10 9
yading@10 10
yading@10 11 =head1 DESCRIPTION
yading@10 12
yading@10 13
yading@10 14 ffprobe gathers information from multimedia streams and prints it in
yading@10 15 human- and machine-readable fashion.
yading@10 16
yading@10 17 For example it can be used to check the format of the container used
yading@10 18 by a multimedia stream and the format and type of each media stream
yading@10 19 contained in it.
yading@10 20
yading@10 21 If a filename is specified in input, ffprobe will try to open and
yading@10 22 probe the file content. If the file cannot be opened or recognized as
yading@10 23 a multimedia file, a positive exit code is returned.
yading@10 24
yading@10 25 ffprobe may be employed both as a standalone application or in
yading@10 26 combination with a textual filter, which may perform more
yading@10 27 sophisticated processing, e.g. statistical processing or plotting.
yading@10 28
yading@10 29 Options are used to list some of the formats supported by ffprobe or
yading@10 30 for specifying which information to display, and for setting how
yading@10 31 ffprobe will show it.
yading@10 32
yading@10 33 ffprobe output is designed to be easily parsable by a textual filter,
yading@10 34 and consists of one or more sections of a form defined by the selected
yading@10 35 writer, which is specified by the B<print_format> option.
yading@10 36
yading@10 37 Sections may contain other nested sections, and are identified by a
yading@10 38 name (which may be shared by other sections), and an unique
yading@10 39 name. See the output of B<sections>.
yading@10 40
yading@10 41 Metadata tags stored in the container or in the streams are recognized
yading@10 42 and printed in the corresponding "FORMAT" or "STREAM" section.
yading@10 43
yading@10 44
yading@10 45
yading@10 46 =head1 OPTIONS
yading@10 47
yading@10 48
yading@10 49 All the numerical options, if not specified otherwise, accept a string
yading@10 50 representing a number as input, which may be followed by one of the SI
yading@10 51 unit prefixes, for example: 'K', 'M', or 'G'.
yading@10 52
yading@10 53 If 'i' is appended to the SI unit prefix, the complete prefix will be
yading@10 54 interpreted as a unit prefix for binary multiplies, which are based on
yading@10 55 powers of 1024 instead of powers of 1000. Appending 'B' to the SI unit
yading@10 56 prefix multiplies the value by 8. This allows using, for example:
yading@10 57 'KB', 'MiB', 'G' and 'B' as number suffixes.
yading@10 58
yading@10 59 Options which do not take arguments are boolean options, and set the
yading@10 60 corresponding value to true. They can be set to false by prefixing
yading@10 61 the option name with "no". For example using "-nofoo"
yading@10 62 will set the boolean option with name "foo" to false.
yading@10 63
yading@10 64
yading@10 65
yading@10 66 =head2 Stream specifiers
yading@10 67
yading@10 68 Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
yading@10 69 are used to precisely specify which stream(s) a given option belongs to.
yading@10 70
yading@10 71 A stream specifier is a string generally appended to the option name and
yading@10 72 separated from it by a colon. E.g. C<-codec:a:1 ac3> contains the
yading@10 73 C<a:1> stream specifier, which matches the second audio stream. Therefore, it
yading@10 74 would select the ac3 codec for the second audio stream.
yading@10 75
yading@10 76 A stream specifier can match several streams, so that the option is applied to all
yading@10 77 of them. E.g. the stream specifier in C<-b:a 128k> matches all audio
yading@10 78 streams.
yading@10 79
yading@10 80 An empty stream specifier matches all streams. For example, C<-codec copy>
yading@10 81 or C<-codec: copy> would copy all the streams without reencoding.
yading@10 82
yading@10 83 Possible forms of stream specifiers are:
yading@10 84
yading@10 85 =over 4
yading@10 86
yading@10 87
yading@10 88 =item I<stream_index>
yading@10 89
yading@10 90 Matches the stream with this index. E.g. C<-threads:1 4> would set the
yading@10 91 thread count for the second stream to 4.
yading@10 92
yading@10 93 =item I<stream_type>B<[:>I<stream_index>B<]>
yading@10 94
yading@10 95 I<stream_type> is one of following: 'v' for video, 'a' for audio, 's' for subtitle,
yading@10 96 'd' for data, and 't' for attachments. If I<stream_index> is given, then it matches
yading@10 97 stream number I<stream_index> of this type. Otherwise, it matches all
yading@10 98 streams of this type.
yading@10 99
yading@10 100 =item B<p:>I<program_id>B<[:>I<stream_index>B<]>
yading@10 101
yading@10 102 If I<stream_index> is given, then it matches the stream with number I<stream_index>
yading@10 103 in the program with the id I<program_id>. Otherwise, it matches all streams in the
yading@10 104 program.
yading@10 105
yading@10 106 =item B<#>I<stream_id>
yading@10 107
yading@10 108 Matches the stream by a format-specific ID.
yading@10 109
yading@10 110 =back
yading@10 111
yading@10 112
yading@10 113
yading@10 114 =head2 Generic options
yading@10 115
yading@10 116
yading@10 117 These options are shared amongst the ff* tools.
yading@10 118
yading@10 119
yading@10 120 =over 4
yading@10 121
yading@10 122
yading@10 123
yading@10 124 =item B<-L>
yading@10 125
yading@10 126 Show license.
yading@10 127
yading@10 128
yading@10 129 =item B<-h, -?, -help, --help [>I<arg>B<]>
yading@10 130
yading@10 131 Show help. An optional parameter may be specified to print help about a specific
yading@10 132 item.
yading@10 133
yading@10 134 Possible values of I<arg> are:
yading@10 135
yading@10 136 =over 4
yading@10 137
yading@10 138
yading@10 139 =item B<decoder=>I<decoder_name>
yading@10 140
yading@10 141 Print detailed information about the decoder named I<decoder_name>. Use the
yading@10 142 B<-decoders> option to get a list of all decoders.
yading@10 143
yading@10 144
yading@10 145 =item B<encoder=>I<encoder_name>
yading@10 146
yading@10 147 Print detailed information about the encoder named I<encoder_name>. Use the
yading@10 148 B<-encoders> option to get a list of all encoders.
yading@10 149
yading@10 150
yading@10 151 =item B<demuxer=>I<demuxer_name>
yading@10 152
yading@10 153 Print detailed information about the demuxer named I<demuxer_name>. Use the
yading@10 154 B<-formats> option to get a list of all demuxers and muxers.
yading@10 155
yading@10 156
yading@10 157 =item B<muxer=>I<muxer_name>
yading@10 158
yading@10 159 Print detailed information about the muxer named I<muxer_name>. Use the
yading@10 160 B<-formats> option to get a list of all muxers and demuxers.
yading@10 161
yading@10 162
yading@10 163 =item B<filter=>I<filter_name>
yading@10 164
yading@10 165 Print detailed information about the filter name I<filter_name>. Use the
yading@10 166 B<-filters> option to get a list of all filters.
yading@10 167
yading@10 168
yading@10 169 =back
yading@10 170
yading@10 171
yading@10 172
yading@10 173 =item B<-version>
yading@10 174
yading@10 175 Show version.
yading@10 176
yading@10 177
yading@10 178 =item B<-formats>
yading@10 179
yading@10 180 Show available formats.
yading@10 181
yading@10 182
yading@10 183 =item B<-codecs>
yading@10 184
yading@10 185 Show all codecs known to libavcodec.
yading@10 186
yading@10 187 Note that the term 'codec' is used throughout this documentation as a shortcut
yading@10 188 for what is more correctly called a media bitstream format.
yading@10 189
yading@10 190
yading@10 191 =item B<-decoders>
yading@10 192
yading@10 193 Show available decoders.
yading@10 194
yading@10 195
yading@10 196 =item B<-encoders>
yading@10 197
yading@10 198 Show all available encoders.
yading@10 199
yading@10 200
yading@10 201 =item B<-bsfs>
yading@10 202
yading@10 203 Show available bitstream filters.
yading@10 204
yading@10 205
yading@10 206 =item B<-protocols>
yading@10 207
yading@10 208 Show available protocols.
yading@10 209
yading@10 210
yading@10 211 =item B<-filters>
yading@10 212
yading@10 213 Show available libavfilter filters.
yading@10 214
yading@10 215
yading@10 216 =item B<-pix_fmts>
yading@10 217
yading@10 218 Show available pixel formats.
yading@10 219
yading@10 220
yading@10 221 =item B<-sample_fmts>
yading@10 222
yading@10 223 Show available sample formats.
yading@10 224
yading@10 225
yading@10 226 =item B<-layouts>
yading@10 227
yading@10 228 Show channel names and standard channel layouts.
yading@10 229
yading@10 230
yading@10 231 =item B<-loglevel [repeat+]>I<loglevel> B<| -v [repeat+]>I<loglevel>
yading@10 232
yading@10 233 Set the logging level used by the library.
yading@10 234 Adding "repeat+" indicates that repeated log output should not be compressed
yading@10 235 to the first line and the "Last message repeated n times" line will be
yading@10 236 omitted. "repeat" can also be used alone.
yading@10 237 If "repeat" is used alone, and with no prior loglevel set, the default
yading@10 238 loglevel will be used. If multiple loglevel parameters are given, using
yading@10 239 'repeat' will not change the loglevel.
yading@10 240 I<loglevel> is a number or a string containing one of the following values:
yading@10 241
yading@10 242 =over 4
yading@10 243
yading@10 244
yading@10 245 =item B<quiet>
yading@10 246
yading@10 247 Show nothing at all; be silent.
yading@10 248
yading@10 249 =item B<panic>
yading@10 250
yading@10 251 Only show fatal errors which could lead the process to crash, such as
yading@10 252 and assert failure. This is not currently used for anything.
yading@10 253
yading@10 254 =item B<fatal>
yading@10 255
yading@10 256 Only show fatal errors. These are errors after which the process absolutely
yading@10 257 cannot continue after.
yading@10 258
yading@10 259 =item B<error>
yading@10 260
yading@10 261 Show all errors, including ones which can be recovered from.
yading@10 262
yading@10 263 =item B<warning>
yading@10 264
yading@10 265 Show all warnings and errors. Any message related to possibly
yading@10 266 incorrect or unexpected events will be shown.
yading@10 267
yading@10 268 =item B<info>
yading@10 269
yading@10 270 Show informative messages during processing. This is in addition to
yading@10 271 warnings and errors. This is the default value.
yading@10 272
yading@10 273 =item B<verbose>
yading@10 274
yading@10 275 Same as C<info>, except more verbose.
yading@10 276
yading@10 277 =item B<debug>
yading@10 278
yading@10 279 Show everything, including debugging information.
yading@10 280
yading@10 281 =back
yading@10 282
yading@10 283
yading@10 284 By default the program logs to stderr, if coloring is supported by the
yading@10 285 terminal, colors are used to mark errors and warnings. Log coloring
yading@10 286 can be disabled setting the environment variable
yading@10 287 B<AV_LOG_FORCE_NOCOLOR> or B<NO_COLOR>, or can be forced setting
yading@10 288 the environment variable B<AV_LOG_FORCE_COLOR>.
yading@10 289 The use of the environment variable B<NO_COLOR> is deprecated and
yading@10 290 will be dropped in a following FFmpeg version.
yading@10 291
yading@10 292
yading@10 293 =item B<-report>
yading@10 294
yading@10 295 Dump full command line and console output to a file named
yading@10 296 C<I<program>-I<YYYYMMDD>-I<HHMMSS>.log> in the current
yading@10 297 directory.
yading@10 298 This file can be useful for bug reports.
yading@10 299 It also implies C<-loglevel verbose>.
yading@10 300
yading@10 301 Setting the environment variable C<FFREPORT> to any value has the
yading@10 302 same effect. If the value is a ':'-separated key=value sequence, these
yading@10 303 options will affect the report; options values must be escaped if they
yading@10 304 contain special characters or the options delimiter ':' (see the
yading@10 305 ``Quoting and escaping'' section in the ffmpeg-utils manual). The
yading@10 306 following option is recognized:
yading@10 307
yading@10 308 =over 4
yading@10 309
yading@10 310
yading@10 311 =item B<file>
yading@10 312
yading@10 313 set the file name to use for the report; C<%p> is expanded to the name
yading@10 314 of the program, C<%t> is expanded to a timestamp, C<%%> is expanded
yading@10 315 to a plain C<%>
yading@10 316
yading@10 317 =back
yading@10 318
yading@10 319
yading@10 320 Errors in parsing the environment variable are not fatal, and will not
yading@10 321 appear in the report.
yading@10 322
yading@10 323
yading@10 324 =item B<-cpuflags flags (>I<global>B<)>
yading@10 325
yading@10 326 Allows setting and clearing cpu flags. This option is intended
yading@10 327 for testing. Do not use it unless you know what you're doing.
yading@10 328
yading@10 329 ffmpeg -cpuflags -sse+mmx ...
yading@10 330 ffmpeg -cpuflags mmx ...
yading@10 331 ffmpeg -cpuflags 0 ...
yading@10 332
yading@10 333 Possible flags for this option are:
yading@10 334
yading@10 335 =over 4
yading@10 336
yading@10 337
yading@10 338 =item B<x86>
yading@10 339
yading@10 340
yading@10 341 =over 4
yading@10 342
yading@10 343
yading@10 344 =item B<mmx>
yading@10 345
yading@10 346
yading@10 347 =item B<mmxext>
yading@10 348
yading@10 349
yading@10 350 =item B<sse>
yading@10 351
yading@10 352
yading@10 353 =item B<sse2>
yading@10 354
yading@10 355
yading@10 356 =item B<sse2slow>
yading@10 357
yading@10 358
yading@10 359 =item B<sse3>
yading@10 360
yading@10 361
yading@10 362 =item B<sse3slow>
yading@10 363
yading@10 364
yading@10 365 =item B<ssse3>
yading@10 366
yading@10 367
yading@10 368 =item B<atom>
yading@10 369
yading@10 370
yading@10 371 =item B<sse4.1>
yading@10 372
yading@10 373
yading@10 374 =item B<sse4.2>
yading@10 375
yading@10 376
yading@10 377 =item B<avx>
yading@10 378
yading@10 379
yading@10 380 =item B<xop>
yading@10 381
yading@10 382
yading@10 383 =item B<fma4>
yading@10 384
yading@10 385
yading@10 386 =item B<3dnow>
yading@10 387
yading@10 388
yading@10 389 =item B<3dnowext>
yading@10 390
yading@10 391
yading@10 392 =item B<cmov>
yading@10 393
yading@10 394
yading@10 395 =back
yading@10 396
yading@10 397
yading@10 398 =item B<ARM>
yading@10 399
yading@10 400
yading@10 401 =over 4
yading@10 402
yading@10 403
yading@10 404 =item B<armv5te>
yading@10 405
yading@10 406
yading@10 407 =item B<armv6>
yading@10 408
yading@10 409
yading@10 410 =item B<armv6t2>
yading@10 411
yading@10 412
yading@10 413 =item B<vfp>
yading@10 414
yading@10 415
yading@10 416 =item B<vfpv3>
yading@10 417
yading@10 418
yading@10 419 =item B<neon>
yading@10 420
yading@10 421
yading@10 422 =back
yading@10 423
yading@10 424
yading@10 425 =item B<PowerPC>
yading@10 426
yading@10 427
yading@10 428 =over 4
yading@10 429
yading@10 430
yading@10 431 =item B<altivec>
yading@10 432
yading@10 433
yading@10 434 =back
yading@10 435
yading@10 436
yading@10 437 =item B<Specific Processors>
yading@10 438
yading@10 439
yading@10 440 =over 4
yading@10 441
yading@10 442
yading@10 443 =item B<pentium2>
yading@10 444
yading@10 445
yading@10 446 =item B<pentium3>
yading@10 447
yading@10 448
yading@10 449 =item B<pentium4>
yading@10 450
yading@10 451
yading@10 452 =item B<k6>
yading@10 453
yading@10 454
yading@10 455 =item B<k62>
yading@10 456
yading@10 457
yading@10 458 =item B<athlon>
yading@10 459
yading@10 460
yading@10 461 =item B<athlonxp>
yading@10 462
yading@10 463
yading@10 464 =item B<k8>
yading@10 465
yading@10 466
yading@10 467 =back
yading@10 468
yading@10 469
yading@10 470 =back
yading@10 471
yading@10 472
yading@10 473
yading@10 474 =item B<-opencl_options options (>I<global>B<)>
yading@10 475
yading@10 476 Set OpenCL environment options. This option is only available when
yading@10 477 FFmpeg has been compiled with C<--enable-opencl>.
yading@10 478
yading@10 479 I<options> must be a list of I<key>=I<value> option pairs
yading@10 480 separated by ':'. See the ``OpenCL Options'' section in the
yading@10 481 ffmpeg-utils manual for the list of supported options.
yading@10 482
yading@10 483 =back
yading@10 484
yading@10 485
yading@10 486
yading@10 487 =head2 AVOptions
yading@10 488
yading@10 489
yading@10 490 These options are provided directly by the libavformat, libavdevice and
yading@10 491 libavcodec libraries. To see the list of available AVOptions, use the
yading@10 492 B<-help> option. They are separated into two categories:
yading@10 493
yading@10 494 =over 4
yading@10 495
yading@10 496
yading@10 497 =item B<generic>
yading@10 498
yading@10 499 These options can be set for any container, codec or device. Generic options
yading@10 500 are listed under AVFormatContext options for containers/devices and under
yading@10 501 AVCodecContext options for codecs.
yading@10 502
yading@10 503 =item B<private>
yading@10 504
yading@10 505 These options are specific to the given container, device or codec. Private
yading@10 506 options are listed under their corresponding containers/devices/codecs.
yading@10 507
yading@10 508 =back
yading@10 509
yading@10 510
yading@10 511 For example to write an ID3v2.3 header instead of a default ID3v2.4 to
yading@10 512 an MP3 file, use the B<id3v2_version> private option of the MP3
yading@10 513 muxer:
yading@10 514
yading@10 515 ffmpeg -i input.flac -id3v2_version 3 out.mp3
yading@10 516
yading@10 517
yading@10 518 All codec AVOptions are obviously per-stream, so the chapter on stream
yading@10 519 specifiers applies to them
yading@10 520
yading@10 521 Note B<-nooption> syntax cannot be used for boolean AVOptions,
yading@10 522 use B<-option 0>/B<-option 1>.
yading@10 523
yading@10 524 Note2 old undocumented way of specifying per-stream AVOptions by prepending
yading@10 525 v/a/s to the options name is now obsolete and will be removed soon.
yading@10 526
yading@10 527
yading@10 528 =head2 Main options
yading@10 529
yading@10 530
yading@10 531
yading@10 532 =over 4
yading@10 533
yading@10 534
yading@10 535
yading@10 536 =item B<-f> I<format>
yading@10 537
yading@10 538 Force format to use.
yading@10 539
yading@10 540
yading@10 541 =item B<-unit>
yading@10 542
yading@10 543 Show the unit of the displayed values.
yading@10 544
yading@10 545
yading@10 546 =item B<-prefix>
yading@10 547
yading@10 548 Use SI prefixes for the displayed values.
yading@10 549 Unless the "-byte_binary_prefix" option is used all the prefixes
yading@10 550 are decimal.
yading@10 551
yading@10 552
yading@10 553 =item B<-byte_binary_prefix>
yading@10 554
yading@10 555 Force the use of binary prefixes for byte values.
yading@10 556
yading@10 557
yading@10 558 =item B<-sexagesimal>
yading@10 559
yading@10 560 Use sexagesimal format HH:MM:SS.MICROSECONDS for time values.
yading@10 561
yading@10 562
yading@10 563 =item B<-pretty>
yading@10 564
yading@10 565 Prettify the format of the displayed values, it corresponds to the
yading@10 566 options "-unit -prefix -byte_binary_prefix -sexagesimal".
yading@10 567
yading@10 568
yading@10 569 =item B<-of, -print_format> I<writer_name>B<[=>I<writer_options>B<]>
yading@10 570
yading@10 571 Set the output printing format.
yading@10 572
yading@10 573 I<writer_name> specifies the name of the writer, and
yading@10 574 I<writer_options> specifies the options to be passed to the writer.
yading@10 575
yading@10 576 For example for printing the output in JSON format, specify:
yading@10 577
yading@10 578 -print_format json
yading@10 579
yading@10 580
yading@10 581 For more details on the available output printing formats, see the
yading@10 582 Writers section below.
yading@10 583
yading@10 584
yading@10 585 =item B<-sections>
yading@10 586
yading@10 587 Print sections structure and section information, and exit. The output
yading@10 588 is not meant to be parsed by a machine.
yading@10 589
yading@10 590
yading@10 591 =item B<-select_streams> I<stream_specifier>
yading@10 592
yading@10 593 Select only the streams specified by I<stream_specifier>. This
yading@10 594 option affects only the options related to streams
yading@10 595 (e.g. C<show_streams>, C<show_packets>, etc.).
yading@10 596
yading@10 597 For example to show only audio streams, you can use the command:
yading@10 598
yading@10 599 ffprobe -show_streams -select_streams a INPUT
yading@10 600
yading@10 601
yading@10 602 To show only video packets belonging to the video stream with index 1:
yading@10 603
yading@10 604 ffprobe -show_packets -select_streams v:1 INPUT
yading@10 605
yading@10 606
yading@10 607
yading@10 608 =item B<-show_data>
yading@10 609
yading@10 610 Show payload data, as an hexadecimal and ASCII dump. Coupled with
yading@10 611 B<-show_packets>, it will dump the packets' data. Coupled with
yading@10 612 B<-show_streams>, it will dump the codec extradata.
yading@10 613
yading@10 614 The dump is printed as the "data" field. It may contain newlines.
yading@10 615
yading@10 616
yading@10 617 =item B<-show_error>
yading@10 618
yading@10 619 Show information about the error found when trying to probe the input.
yading@10 620
yading@10 621 The error information is printed within a section with name "ERROR".
yading@10 622
yading@10 623
yading@10 624 =item B<-show_format>
yading@10 625
yading@10 626 Show information about the container format of the input multimedia
yading@10 627 stream.
yading@10 628
yading@10 629 All the container format information is printed within a section with
yading@10 630 name "FORMAT".
yading@10 631
yading@10 632
yading@10 633 =item B<-show_format_entry> I<name>
yading@10 634
yading@10 635 Like B<-show_format>, but only prints the specified entry of the
yading@10 636 container format information, rather than all. This option may be given more
yading@10 637 than once, then all specified entries will be shown.
yading@10 638
yading@10 639 This option is deprecated, use C<show_entries> instead.
yading@10 640
yading@10 641
yading@10 642 =item B<-show_entries> I<section_entries>
yading@10 643
yading@10 644 Set list of entries to show.
yading@10 645
yading@10 646 Entries are specified according to the following
yading@10 647 syntax. I<section_entries> contains a list of section entries
yading@10 648 separated by C<:>. Each section entry is composed by a section
yading@10 649 name (or unique name), optionally followed by a list of entries local
yading@10 650 to that section, separated by C<,>.
yading@10 651
yading@10 652 If section name is specified but is followed by no C<=>, all
yading@10 653 entries are printed to output, together with all the contained
yading@10 654 sections. Otherwise only the entries specified in the local section
yading@10 655 entries list are printed. In particular, if C<=> is specified but
yading@10 656 the list of local entries is empty, then no entries will be shown for
yading@10 657 that section.
yading@10 658
yading@10 659 Note that the order of specification of the local section entries is
yading@10 660 not honored in the output, and the usual display order will be
yading@10 661 retained.
yading@10 662
yading@10 663 The formal syntax is given by:
yading@10 664
yading@10 665 <LOCAL_SECTION_ENTRIES> ::= <SECTION_ENTRY_NAME>[,<LOCAL_SECTION_ENTRIES>]
yading@10 666 <SECTION_ENTRY> ::= <SECTION_NAME>[=[<LOCAL_SECTION_ENTRIES>]]
yading@10 667 <SECTION_ENTRIES> ::= <SECTION_ENTRY>[:<SECTION_ENTRIES>]
yading@10 668
yading@10 669
yading@10 670 For example, to show only the index and type of each stream, and the PTS
yading@10 671 time, duration time, and stream index of the packets, you can specify
yading@10 672 the argument:
yading@10 673
yading@10 674 packet=pts_time,duration_time,stream_index : stream=index,codec_type
yading@10 675
yading@10 676
yading@10 677 To show all the entries in the section "format", but only the codec
yading@10 678 type in the section "stream", specify the argument:
yading@10 679
yading@10 680 format : stream=codec_type
yading@10 681
yading@10 682
yading@10 683 To show all the tags in the stream and format sections:
yading@10 684
yading@10 685 format_tags : format_tags
yading@10 686
yading@10 687
yading@10 688 To show only the C<title> tag (if available) in the stream
yading@10 689 sections:
yading@10 690
yading@10 691 stream_tags=title
yading@10 692
yading@10 693
yading@10 694
yading@10 695 =item B<-show_packets>
yading@10 696
yading@10 697 Show information about each packet contained in the input multimedia
yading@10 698 stream.
yading@10 699
yading@10 700 The information for each single packet is printed within a dedicated
yading@10 701 section with name "PACKET".
yading@10 702
yading@10 703
yading@10 704 =item B<-show_frames>
yading@10 705
yading@10 706 Show information about each frame contained in the input multimedia
yading@10 707 stream.
yading@10 708
yading@10 709 The information for each single frame is printed within a dedicated
yading@10 710 section with name "FRAME".
yading@10 711
yading@10 712
yading@10 713 =item B<-show_streams>
yading@10 714
yading@10 715 Show information about each media stream contained in the input
yading@10 716 multimedia stream.
yading@10 717
yading@10 718 Each media stream information is printed within a dedicated section
yading@10 719 with name "STREAM".
yading@10 720
yading@10 721
yading@10 722 =item B<-count_frames>
yading@10 723
yading@10 724 Count the number of frames per stream and report it in the
yading@10 725 corresponding stream section.
yading@10 726
yading@10 727
yading@10 728 =item B<-count_packets>
yading@10 729
yading@10 730 Count the number of packets per stream and report it in the
yading@10 731 corresponding stream section.
yading@10 732
yading@10 733
yading@10 734 =item B<-show_private_data, -private>
yading@10 735
yading@10 736 Show private data, that is data depending on the format of the
yading@10 737 particular shown element.
yading@10 738 This option is enabled by default, but you may need to disable it
yading@10 739 for specific uses, for example when creating XSD-compliant XML output.
yading@10 740
yading@10 741
yading@10 742 =item B<-show_program_version>
yading@10 743
yading@10 744 Show information related to program version.
yading@10 745
yading@10 746 Version information is printed within a section with name
yading@10 747 "PROGRAM_VERSION".
yading@10 748
yading@10 749
yading@10 750 =item B<-show_library_versions>
yading@10 751
yading@10 752 Show information related to library versions.
yading@10 753
yading@10 754 Version information for each library is printed within a section with
yading@10 755 name "LIBRARY_VERSION".
yading@10 756
yading@10 757
yading@10 758 =item B<-show_versions>
yading@10 759
yading@10 760 Show information related to program and library versions. This is the
yading@10 761 equivalent of setting both B<-show_program_version> and
yading@10 762 B<-show_library_versions> options.
yading@10 763
yading@10 764
yading@10 765 =item B<-bitexact>
yading@10 766
yading@10 767 Force bitexact output, useful to produce output which is not dependent
yading@10 768 on the specific build.
yading@10 769
yading@10 770
yading@10 771 =item B<-i> I<input_file>
yading@10 772
yading@10 773 Read I<input_file>.
yading@10 774
yading@10 775
yading@10 776 =back
yading@10 777
yading@10 778
yading@10 779
yading@10 780 =head1 WRITERS
yading@10 781
yading@10 782
yading@10 783 A writer defines the output format adopted by B<ffprobe>, and will be
yading@10 784 used for printing all the parts of the output.
yading@10 785
yading@10 786 A writer may accept one or more arguments, which specify the options
yading@10 787 to adopt. The options are specified as a list of I<key>=I<value>
yading@10 788 pairs, separated by ":".
yading@10 789
yading@10 790 A description of the currently available writers follows.
yading@10 791
yading@10 792
yading@10 793 =head2 default
yading@10 794
yading@10 795 Default format.
yading@10 796
yading@10 797 Print each section in the form:
yading@10 798
yading@10 799 [SECTION]
yading@10 800 key1=val1
yading@10 801 ...
yading@10 802 keyN=valN
yading@10 803 [/SECTION]
yading@10 804
yading@10 805
yading@10 806 Metadata tags are printed as a line in the corresponding FORMAT or
yading@10 807 STREAM section, and are prefixed by the string "TAG:".
yading@10 808
yading@10 809 A description of the accepted options follows.
yading@10 810
yading@10 811
yading@10 812 =over 4
yading@10 813
yading@10 814
yading@10 815
yading@10 816 =item B<nokey, nk>
yading@10 817
yading@10 818 If set to 1 specify not to print the key of each field. Default value
yading@10 819 is 0.
yading@10 820
yading@10 821
yading@10 822 =item B<noprint_wrappers, nw>
yading@10 823
yading@10 824 If set to 1 specify not to print the section header and footer.
yading@10 825 Default value is 0.
yading@10 826
yading@10 827 =back
yading@10 828
yading@10 829
yading@10 830
yading@10 831 =head2 compact, csv
yading@10 832
yading@10 833 Compact and CSV format.
yading@10 834
yading@10 835 The C<csv> writer is equivalent to C<compact>, but supports
yading@10 836 different defaults.
yading@10 837
yading@10 838 Each section is printed on a single line.
yading@10 839 If no option is specifid, the output has the form:
yading@10 840
yading@10 841 section|key1=val1| ... |keyN=valN
yading@10 842
yading@10 843
yading@10 844 Metadata tags are printed in the corresponding "format" or "stream"
yading@10 845 section. A metadata tag key, if printed, is prefixed by the string
yading@10 846 "tag:".
yading@10 847
yading@10 848 The description of the accepted options follows.
yading@10 849
yading@10 850
yading@10 851 =over 4
yading@10 852
yading@10 853
yading@10 854
yading@10 855 =item B<item_sep, s>
yading@10 856
yading@10 857 Specify the character to use for separating fields in the output line.
yading@10 858 It must be a single printable character, it is "|" by default ("," for
yading@10 859 the C<csv> writer).
yading@10 860
yading@10 861
yading@10 862 =item B<nokey, nk>
yading@10 863
yading@10 864 If set to 1 specify not to print the key of each field. Its default
yading@10 865 value is 0 (1 for the C<csv> writer).
yading@10 866
yading@10 867
yading@10 868 =item B<escape, e>
yading@10 869
yading@10 870 Set the escape mode to use, default to "c" ("csv" for the C<csv>
yading@10 871 writer).
yading@10 872
yading@10 873 It can assume one of the following values:
yading@10 874
yading@10 875 =over 4
yading@10 876
yading@10 877
yading@10 878 =item B<c>
yading@10 879
yading@10 880 Perform C-like escaping. Strings containing a newline ('\n'), carriage
yading@10 881 return ('\r'), a tab ('\t'), a form feed ('\f'), the escaping
yading@10 882 character ('\') or the item separator character I<SEP> are escaped using C-like fashioned
yading@10 883 escaping, so that a newline is converted to the sequence "\n", a
yading@10 884 carriage return to "\r", '\' to "\\" and the separator I<SEP> is
yading@10 885 converted to "\I<SEP>".
yading@10 886
yading@10 887
yading@10 888 =item B<csv>
yading@10 889
yading@10 890 Perform CSV-like escaping, as described in RFC4180. Strings
yading@10 891 containing a newline ('\n'), a carriage return ('\r'), a double quote
yading@10 892 ('"'), or I<SEP> are enclosed in double-quotes.
yading@10 893
yading@10 894
yading@10 895 =item B<none>
yading@10 896
yading@10 897 Perform no escaping.
yading@10 898
yading@10 899 =back
yading@10 900
yading@10 901
yading@10 902
yading@10 903 =item B<print_section, p>
yading@10 904
yading@10 905 Print the section name at the begin of each line if the value is
yading@10 906 C<1>, disable it with value set to C<0>. Default value is
yading@10 907 C<1>.
yading@10 908
yading@10 909
yading@10 910 =back
yading@10 911
yading@10 912
yading@10 913
yading@10 914 =head2 flat
yading@10 915
yading@10 916 Flat format.
yading@10 917
yading@10 918 A free-form output where each line contains an explicit key=value, such as
yading@10 919 "streams.stream.3.tags.foo=bar". The output is shell escaped, so it can be
yading@10 920 directly embedded in sh scripts as long as the separator character is an
yading@10 921 alphanumeric character or an underscore (see I<sep_char> option).
yading@10 922
yading@10 923 The description of the accepted options follows.
yading@10 924
yading@10 925
yading@10 926 =over 4
yading@10 927
yading@10 928
yading@10 929 =item B<sep_char, s>
yading@10 930
yading@10 931 Separator character used to separate the chapter, the section name, IDs and
yading@10 932 potential tags in the printed field key.
yading@10 933
yading@10 934 Default value is '.'.
yading@10 935
yading@10 936
yading@10 937 =item B<hierarchical, h>
yading@10 938
yading@10 939 Specify if the section name specification should be hierarchical. If
yading@10 940 set to 1, and if there is more than one section in the current
yading@10 941 chapter, the section name will be prefixed by the name of the
yading@10 942 chapter. A value of 0 will disable this behavior.
yading@10 943
yading@10 944 Default value is 1.
yading@10 945
yading@10 946 =back
yading@10 947
yading@10 948
yading@10 949
yading@10 950 =head2 ini
yading@10 951
yading@10 952 INI format output.
yading@10 953
yading@10 954 Print output in an INI based format.
yading@10 955
yading@10 956 The following conventions are adopted:
yading@10 957
yading@10 958
yading@10 959 =over 4
yading@10 960
yading@10 961
yading@10 962 =item *
yading@10 963
yading@10 964 all key and values are UTF-8
yading@10 965
yading@10 966 =item *
yading@10 967
yading@10 968 '.' is the subgroup separator
yading@10 969
yading@10 970 =item *
yading@10 971
yading@10 972 newline, '\t', '\f', '\b' and the following characters are escaped
yading@10 973
yading@10 974 =item *
yading@10 975
yading@10 976 '\' is the escape character
yading@10 977
yading@10 978 =item *
yading@10 979
yading@10 980 '#' is the comment indicator
yading@10 981
yading@10 982 =item *
yading@10 983
yading@10 984 '=' is the key/value separator
yading@10 985
yading@10 986 =item *
yading@10 987
yading@10 988 ':' is not used but usually parsed as key/value separator
yading@10 989
yading@10 990 =back
yading@10 991
yading@10 992
yading@10 993 This writer accepts options as a list of I<key>=I<value> pairs,
yading@10 994 separated by ":".
yading@10 995
yading@10 996 The description of the accepted options follows.
yading@10 997
yading@10 998
yading@10 999 =over 4
yading@10 1000
yading@10 1001
yading@10 1002 =item B<hierarchical, h>
yading@10 1003
yading@10 1004 Specify if the section name specification should be hierarchical. If
yading@10 1005 set to 1, and if there is more than one section in the current
yading@10 1006 chapter, the section name will be prefixed by the name of the
yading@10 1007 chapter. A value of 0 will disable this behavior.
yading@10 1008
yading@10 1009 Default value is 1.
yading@10 1010
yading@10 1011 =back
yading@10 1012
yading@10 1013
yading@10 1014
yading@10 1015 =head2 json
yading@10 1016
yading@10 1017 JSON based format.
yading@10 1018
yading@10 1019 Each section is printed using JSON notation.
yading@10 1020
yading@10 1021 The description of the accepted options follows.
yading@10 1022
yading@10 1023
yading@10 1024 =over 4
yading@10 1025
yading@10 1026
yading@10 1027
yading@10 1028 =item B<compact, c>
yading@10 1029
yading@10 1030 If set to 1 enable compact output, that is each section will be
yading@10 1031 printed on a single line. Default value is 0.
yading@10 1032
yading@10 1033 =back
yading@10 1034
yading@10 1035
yading@10 1036 For more information about JSON, see E<lt>B<http://www.json.org/>E<gt>.
yading@10 1037
yading@10 1038
yading@10 1039 =head2 xml
yading@10 1040
yading@10 1041 XML based format.
yading@10 1042
yading@10 1043 The XML output is described in the XML schema description file
yading@10 1044 F<ffprobe.xsd> installed in the FFmpeg datadir.
yading@10 1045
yading@10 1046 An updated version of the schema can be retrieved at the url
yading@10 1047 E<lt>B<http://www.ffmpeg.org/schema/ffprobe.xsd>E<gt>, which redirects to the
yading@10 1048 latest schema committed into the FFmpeg development source code tree.
yading@10 1049
yading@10 1050 Note that the output issued will be compliant to the
yading@10 1051 F<ffprobe.xsd> schema only when no special global output options
yading@10 1052 (B<unit>, B<prefix>, B<byte_binary_prefix>,
yading@10 1053 B<sexagesimal> etc.) are specified.
yading@10 1054
yading@10 1055 The description of the accepted options follows.
yading@10 1056
yading@10 1057
yading@10 1058 =over 4
yading@10 1059
yading@10 1060
yading@10 1061
yading@10 1062 =item B<fully_qualified, q>
yading@10 1063
yading@10 1064 If set to 1 specify if the output should be fully qualified. Default
yading@10 1065 value is 0.
yading@10 1066 This is required for generating an XML file which can be validated
yading@10 1067 through an XSD file.
yading@10 1068
yading@10 1069
yading@10 1070 =item B<xsd_compliant, x>
yading@10 1071
yading@10 1072 If set to 1 perform more checks for ensuring that the output is XSD
yading@10 1073 compliant. Default value is 0.
yading@10 1074 This option automatically sets B<fully_qualified> to 1.
yading@10 1075
yading@10 1076 =back
yading@10 1077
yading@10 1078
yading@10 1079 For more information about the XML format, see
yading@10 1080 E<lt>B<http://www.w3.org/XML/>E<gt>.
yading@10 1081
yading@10 1082
yading@10 1083 =head1 TIMECODE
yading@10 1084
yading@10 1085
yading@10 1086 B<ffprobe> supports Timecode extraction:
yading@10 1087
yading@10 1088
yading@10 1089 =over 4
yading@10 1090
yading@10 1091
yading@10 1092
yading@10 1093 =item *
yading@10 1094
yading@10 1095 MPEG1/2 timecode is extracted from the GOP, and is available in the video
yading@10 1096 stream details (B<-show_streams>, see I<timecode>).
yading@10 1097
yading@10 1098
yading@10 1099 =item *
yading@10 1100
yading@10 1101 MOV timecode is extracted from tmcd track, so is available in the tmcd
yading@10 1102 stream metadata (B<-show_streams>, see I<TAG:timecode>).
yading@10 1103
yading@10 1104
yading@10 1105 =item *
yading@10 1106
yading@10 1107 DV, GXF and AVI timecodes are available in format metadata
yading@10 1108 (B<-show_format>, see I<TAG:timecode>).
yading@10 1109
yading@10 1110
yading@10 1111 =back
yading@10 1112
yading@10 1113
yading@10 1114
yading@10 1115
yading@10 1116 =head1 SYNTAX
yading@10 1117
yading@10 1118
yading@10 1119 This section documents the syntax and formats employed by the FFmpeg
yading@10 1120 libraries and tools.
yading@10 1121
yading@10 1122
yading@10 1123
yading@10 1124 =head2 Quoting and escaping
yading@10 1125
yading@10 1126
yading@10 1127 FFmpeg adopts the following quoting and escaping mechanism, unless
yading@10 1128 explicitly specified. The following rules are applied:
yading@10 1129
yading@10 1130
yading@10 1131 =over 4
yading@10 1132
yading@10 1133
yading@10 1134 =item *
yading@10 1135
yading@10 1136 C<'> and C<\> are special characters (respectively used for
yading@10 1137 quoting and escaping). In addition to them, there might be other
yading@10 1138 special characters depending on the specific syntax where the escaping
yading@10 1139 and quoting are employed.
yading@10 1140
yading@10 1141
yading@10 1142 =item *
yading@10 1143
yading@10 1144 A special character is escaped by prefixing it with a '\'.
yading@10 1145
yading@10 1146
yading@10 1147 =item *
yading@10 1148
yading@10 1149 All characters enclosed between '' are included literally in the
yading@10 1150 parsed string. The quote character C<'> itself cannot be quoted,
yading@10 1151 so you may need to close the quote and escape it.
yading@10 1152
yading@10 1153
yading@10 1154 =item *
yading@10 1155
yading@10 1156 Leading and trailing whitespaces, unless escaped or quoted, are
yading@10 1157 removed from the parsed string.
yading@10 1158
yading@10 1159 =back
yading@10 1160
yading@10 1161
yading@10 1162 Note that you may need to add a second level of escaping when using
yading@10 1163 the command line or a script, which depends on the syntax of the
yading@10 1164 adopted shell language.
yading@10 1165
yading@10 1166 The function C<av_get_token> defined in
yading@10 1167 F<libavutil/avstring.h> can be used to parse a token quoted or
yading@10 1168 escaped according to the rules defined above.
yading@10 1169
yading@10 1170 The tool F<tools/ffescape> in the FFmpeg source tree can be used
yading@10 1171 to automatically quote or escape a string in a script.
yading@10 1172
yading@10 1173
yading@10 1174 =head3 Examples
yading@10 1175
yading@10 1176
yading@10 1177
yading@10 1178 =over 4
yading@10 1179
yading@10 1180
yading@10 1181 =item *
yading@10 1182
yading@10 1183 Escape the string C<Crime d'Amour> containing the C<'> special
yading@10 1184 character:
yading@10 1185
yading@10 1186 Crime d\'Amour
yading@10 1187
yading@10 1188
yading@10 1189
yading@10 1190 =item *
yading@10 1191
yading@10 1192 The string above contains a quote, so the C<'> needs to be escaped
yading@10 1193 when quoting it:
yading@10 1194
yading@10 1195 'Crime d'\''Amour'
yading@10 1196
yading@10 1197
yading@10 1198
yading@10 1199 =item *
yading@10 1200
yading@10 1201 Include leading or trailing whitespaces using quoting:
yading@10 1202
yading@10 1203 ' this string starts and ends with whitespaces '
yading@10 1204
yading@10 1205
yading@10 1206
yading@10 1207 =item *
yading@10 1208
yading@10 1209 Escaping and quoting can be mixed together:
yading@10 1210
yading@10 1211 ' The string '\'string\'' is a string '
yading@10 1212
yading@10 1213
yading@10 1214
yading@10 1215 =item *
yading@10 1216
yading@10 1217 To include a literal C<\> you can use either escaping or quoting:
yading@10 1218
yading@10 1219 'c:\foo' can be written as c:\\foo
yading@10 1220
yading@10 1221
yading@10 1222 =back
yading@10 1223
yading@10 1224
yading@10 1225
yading@10 1226
yading@10 1227 =head2 Date
yading@10 1228
yading@10 1229
yading@10 1230 The accepted syntax is:
yading@10 1231
yading@10 1232 [(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
yading@10 1233 now
yading@10 1234
yading@10 1235
yading@10 1236 If the value is "now" it takes the current time.
yading@10 1237
yading@10 1238 Time is local time unless Z is appended, in which case it is
yading@10 1239 interpreted as UTC.
yading@10 1240 If the year-month-day part is not specified it takes the current
yading@10 1241 year-month-day.
yading@10 1242
yading@10 1243
yading@10 1244
yading@10 1245 =head2 Time duration
yading@10 1246
yading@10 1247
yading@10 1248 The accepted syntax is:
yading@10 1249
yading@10 1250 [-][HH:]MM:SS[.m...]
yading@10 1251 [-]S+[.m...]
yading@10 1252
yading@10 1253
yading@10 1254 I<HH> expresses the number of hours, I<MM> the number a of minutes
yading@10 1255 and I<SS> the number of seconds.
yading@10 1256
yading@10 1257
yading@10 1258
yading@10 1259 =head2 Video size
yading@10 1260
yading@10 1261 Specify the size of the sourced video, it may be a string of the form
yading@10 1262 I<width>xI<height>, or the name of a size abbreviation.
yading@10 1263
yading@10 1264 The following abbreviations are recognized:
yading@10 1265
yading@10 1266 =over 4
yading@10 1267
yading@10 1268
yading@10 1269 =item B<ntsc>
yading@10 1270
yading@10 1271 720x480
yading@10 1272
yading@10 1273 =item B<pal>
yading@10 1274
yading@10 1275 720x576
yading@10 1276
yading@10 1277 =item B<qntsc>
yading@10 1278
yading@10 1279 352x240
yading@10 1280
yading@10 1281 =item B<qpal>
yading@10 1282
yading@10 1283 352x288
yading@10 1284
yading@10 1285 =item B<sntsc>
yading@10 1286
yading@10 1287 640x480
yading@10 1288
yading@10 1289 =item B<spal>
yading@10 1290
yading@10 1291 768x576
yading@10 1292
yading@10 1293 =item B<film>
yading@10 1294
yading@10 1295 352x240
yading@10 1296
yading@10 1297 =item B<ntsc-film>
yading@10 1298
yading@10 1299 352x240
yading@10 1300
yading@10 1301 =item B<sqcif>
yading@10 1302
yading@10 1303 128x96
yading@10 1304
yading@10 1305 =item B<qcif>
yading@10 1306
yading@10 1307 176x144
yading@10 1308
yading@10 1309 =item B<cif>
yading@10 1310
yading@10 1311 352x288
yading@10 1312
yading@10 1313 =item B<4cif>
yading@10 1314
yading@10 1315 704x576
yading@10 1316
yading@10 1317 =item B<16cif>
yading@10 1318
yading@10 1319 1408x1152
yading@10 1320
yading@10 1321 =item B<qqvga>
yading@10 1322
yading@10 1323 160x120
yading@10 1324
yading@10 1325 =item B<qvga>
yading@10 1326
yading@10 1327 320x240
yading@10 1328
yading@10 1329 =item B<vga>
yading@10 1330
yading@10 1331 640x480
yading@10 1332
yading@10 1333 =item B<svga>
yading@10 1334
yading@10 1335 800x600
yading@10 1336
yading@10 1337 =item B<xga>
yading@10 1338
yading@10 1339 1024x768
yading@10 1340
yading@10 1341 =item B<uxga>
yading@10 1342
yading@10 1343 1600x1200
yading@10 1344
yading@10 1345 =item B<qxga>
yading@10 1346
yading@10 1347 2048x1536
yading@10 1348
yading@10 1349 =item B<sxga>
yading@10 1350
yading@10 1351 1280x1024
yading@10 1352
yading@10 1353 =item B<qsxga>
yading@10 1354
yading@10 1355 2560x2048
yading@10 1356
yading@10 1357 =item B<hsxga>
yading@10 1358
yading@10 1359 5120x4096
yading@10 1360
yading@10 1361 =item B<wvga>
yading@10 1362
yading@10 1363 852x480
yading@10 1364
yading@10 1365 =item B<wxga>
yading@10 1366
yading@10 1367 1366x768
yading@10 1368
yading@10 1369 =item B<wsxga>
yading@10 1370
yading@10 1371 1600x1024
yading@10 1372
yading@10 1373 =item B<wuxga>
yading@10 1374
yading@10 1375 1920x1200
yading@10 1376
yading@10 1377 =item B<woxga>
yading@10 1378
yading@10 1379 2560x1600
yading@10 1380
yading@10 1381 =item B<wqsxga>
yading@10 1382
yading@10 1383 3200x2048
yading@10 1384
yading@10 1385 =item B<wquxga>
yading@10 1386
yading@10 1387 3840x2400
yading@10 1388
yading@10 1389 =item B<whsxga>
yading@10 1390
yading@10 1391 6400x4096
yading@10 1392
yading@10 1393 =item B<whuxga>
yading@10 1394
yading@10 1395 7680x4800
yading@10 1396
yading@10 1397 =item B<cga>
yading@10 1398
yading@10 1399 320x200
yading@10 1400
yading@10 1401 =item B<ega>
yading@10 1402
yading@10 1403 640x350
yading@10 1404
yading@10 1405 =item B<hd480>
yading@10 1406
yading@10 1407 852x480
yading@10 1408
yading@10 1409 =item B<hd720>
yading@10 1410
yading@10 1411 1280x720
yading@10 1412
yading@10 1413 =item B<hd1080>
yading@10 1414
yading@10 1415 1920x1080
yading@10 1416
yading@10 1417 =item B<2k>
yading@10 1418
yading@10 1419 2048x1080
yading@10 1420
yading@10 1421 =item B<2kflat>
yading@10 1422
yading@10 1423 1998x1080
yading@10 1424
yading@10 1425 =item B<2kscope>
yading@10 1426
yading@10 1427 2048x858
yading@10 1428
yading@10 1429 =item B<4k>
yading@10 1430
yading@10 1431 4096x2160
yading@10 1432
yading@10 1433 =item B<4kflat>
yading@10 1434
yading@10 1435 3996x2160
yading@10 1436
yading@10 1437 =item B<4kscope>
yading@10 1438
yading@10 1439 4096x1716
yading@10 1440
yading@10 1441 =back
yading@10 1442
yading@10 1443
yading@10 1444
yading@10 1445
yading@10 1446 =head2 Video rate
yading@10 1447
yading@10 1448
yading@10 1449 Specify the frame rate of a video, expressed as the number of frames
yading@10 1450 generated per second. It has to be a string in the format
yading@10 1451 I<frame_rate_num>/I<frame_rate_den>, an integer number, a float
yading@10 1452 number or a valid video frame rate abbreviation.
yading@10 1453
yading@10 1454 The following abbreviations are recognized:
yading@10 1455
yading@10 1456 =over 4
yading@10 1457
yading@10 1458
yading@10 1459 =item B<ntsc>
yading@10 1460
yading@10 1461 30000/1001
yading@10 1462
yading@10 1463 =item B<pal>
yading@10 1464
yading@10 1465 25/1
yading@10 1466
yading@10 1467 =item B<qntsc>
yading@10 1468
yading@10 1469 30000/1001
yading@10 1470
yading@10 1471 =item B<qpal>
yading@10 1472
yading@10 1473 25/1
yading@10 1474
yading@10 1475 =item B<sntsc>
yading@10 1476
yading@10 1477 30000/1001
yading@10 1478
yading@10 1479 =item B<spal>
yading@10 1480
yading@10 1481 25/1
yading@10 1482
yading@10 1483 =item B<film>
yading@10 1484
yading@10 1485 24/1
yading@10 1486
yading@10 1487 =item B<ntsc-film>
yading@10 1488
yading@10 1489 24000/1001
yading@10 1490
yading@10 1491 =back
yading@10 1492
yading@10 1493
yading@10 1494
yading@10 1495
yading@10 1496 =head2 Ratio
yading@10 1497
yading@10 1498
yading@10 1499 A ratio can be expressed as an expression, or in the form
yading@10 1500 I<numerator>:I<denominator>.
yading@10 1501
yading@10 1502 Note that a ratio with infinite (1/0) or negative value is
yading@10 1503 considered valid, so you should check on the returned value if you
yading@10 1504 want to exclude those values.
yading@10 1505
yading@10 1506 The undefined value can be expressed using the "0:0" string.
yading@10 1507
yading@10 1508
yading@10 1509
yading@10 1510 =head2 Color
yading@10 1511
yading@10 1512
yading@10 1513 It can be the name of a color (case insensitive match) or a
yading@10 1514 [0x|#]RRGGBB[AA] sequence, possibly followed by "@" and a string
yading@10 1515 representing the alpha component.
yading@10 1516
yading@10 1517 The alpha component may be a string composed by "0x" followed by an
yading@10 1518 hexadecimal number or a decimal number between 0.0 and 1.0, which
yading@10 1519 represents the opacity value (0x00/0.0 means completely transparent,
yading@10 1520 0xff/1.0 completely opaque).
yading@10 1521 If the alpha component is not specified then 0xff is assumed.
yading@10 1522
yading@10 1523 The string "random" will result in a random color.
yading@10 1524
yading@10 1525
yading@10 1526
yading@10 1527 =head1 EXPRESSION EVALUATION
yading@10 1528
yading@10 1529
yading@10 1530 When evaluating an arithmetic expression, FFmpeg uses an internal
yading@10 1531 formula evaluator, implemented through the F<libavutil/eval.h>
yading@10 1532 interface.
yading@10 1533
yading@10 1534 An expression may contain unary, binary operators, constants, and
yading@10 1535 functions.
yading@10 1536
yading@10 1537 Two expressions I<expr1> and I<expr2> can be combined to form
yading@10 1538 another expression "I<expr1>;I<expr2>".
yading@10 1539 I<expr1> and I<expr2> are evaluated in turn, and the new
yading@10 1540 expression evaluates to the value of I<expr2>.
yading@10 1541
yading@10 1542 The following binary operators are available: C<+>, C<->,
yading@10 1543 C<*>, C</>, C<^>.
yading@10 1544
yading@10 1545 The following unary operators are available: C<+>, C<->.
yading@10 1546
yading@10 1547 The following functions are available:
yading@10 1548
yading@10 1549 =over 4
yading@10 1550
yading@10 1551
yading@10 1552 =item B<abs(x)>
yading@10 1553
yading@10 1554 Compute absolute value of I<x>.
yading@10 1555
yading@10 1556
yading@10 1557 =item B<acos(x)>
yading@10 1558
yading@10 1559 Compute arccosine of I<x>.
yading@10 1560
yading@10 1561
yading@10 1562 =item B<asin(x)>
yading@10 1563
yading@10 1564 Compute arcsine of I<x>.
yading@10 1565
yading@10 1566
yading@10 1567 =item B<atan(x)>
yading@10 1568
yading@10 1569 Compute arctangent of I<x>.
yading@10 1570
yading@10 1571
yading@10 1572 =item B<between(x, min, max)>
yading@10 1573
yading@10 1574 Return 1 if I<x> is greater than or equal to I<min> and lesser than or
yading@10 1575 equal to I<max>, 0 otherwise.
yading@10 1576
yading@10 1577
yading@10 1578 =item B<bitand(x, y)>
yading@10 1579
yading@10 1580
yading@10 1581 =item B<bitor(x, y)>
yading@10 1582
yading@10 1583 Compute bitwise and/or operation on I<x> and I<y>.
yading@10 1584
yading@10 1585 The results of the evaluation of I<x> and I<y> are converted to
yading@10 1586 integers before executing the bitwise operation.
yading@10 1587
yading@10 1588 Note that both the conversion to integer and the conversion back to
yading@10 1589 floating point can lose precision. Beware of unexpected results for
yading@10 1590 large numbers (usually 2^53 and larger).
yading@10 1591
yading@10 1592
yading@10 1593 =item B<ceil(expr)>
yading@10 1594
yading@10 1595 Round the value of expression I<expr> upwards to the nearest
yading@10 1596 integer. For example, "ceil(1.5)" is "2.0".
yading@10 1597
yading@10 1598
yading@10 1599 =item B<cos(x)>
yading@10 1600
yading@10 1601 Compute cosine of I<x>.
yading@10 1602
yading@10 1603
yading@10 1604 =item B<cosh(x)>
yading@10 1605
yading@10 1606 Compute hyperbolic cosine of I<x>.
yading@10 1607
yading@10 1608
yading@10 1609 =item B<eq(x, y)>
yading@10 1610
yading@10 1611 Return 1 if I<x> and I<y> are equivalent, 0 otherwise.
yading@10 1612
yading@10 1613
yading@10 1614 =item B<exp(x)>
yading@10 1615
yading@10 1616 Compute exponential of I<x> (with base C<e>, the Euler's number).
yading@10 1617
yading@10 1618
yading@10 1619 =item B<floor(expr)>
yading@10 1620
yading@10 1621 Round the value of expression I<expr> downwards to the nearest
yading@10 1622 integer. For example, "floor(-1.5)" is "-2.0".
yading@10 1623
yading@10 1624
yading@10 1625 =item B<gauss(x)>
yading@10 1626
yading@10 1627 Compute Gauss function of I<x>, corresponding to
yading@10 1628 C<exp(-x*x/2) / sqrt(2*PI)>.
yading@10 1629
yading@10 1630
yading@10 1631 =item B<gcd(x, y)>
yading@10 1632
yading@10 1633 Return the greatest common divisor of I<x> and I<y>. If both I<x> and
yading@10 1634 I<y> are 0 or either or both are less than zero then behavior is undefined.
yading@10 1635
yading@10 1636
yading@10 1637 =item B<gt(x, y)>
yading@10 1638
yading@10 1639 Return 1 if I<x> is greater than I<y>, 0 otherwise.
yading@10 1640
yading@10 1641
yading@10 1642 =item B<gte(x, y)>
yading@10 1643
yading@10 1644 Return 1 if I<x> is greater than or equal to I<y>, 0 otherwise.
yading@10 1645
yading@10 1646
yading@10 1647 =item B<hypot(x, y)>
yading@10 1648
yading@10 1649 This function is similar to the C function with the same name; it returns
yading@10 1650 "sqrt(I<x>*I<x> + I<y>*I<y>)", the length of the hypotenuse of a
yading@10 1651 right triangle with sides of length I<x> and I<y>, or the distance of the
yading@10 1652 point (I<x>, I<y>) from the origin.
yading@10 1653
yading@10 1654
yading@10 1655 =item B<if(x, y)>
yading@10 1656
yading@10 1657 Evaluate I<x>, and if the result is non-zero return the result of
yading@10 1658 the evaluation of I<y>, return 0 otherwise.
yading@10 1659
yading@10 1660
yading@10 1661 =item B<if(x, y, z)>
yading@10 1662
yading@10 1663 Evaluate I<x>, and if the result is non-zero return the evaluation
yading@10 1664 result of I<y>, otherwise the evaluation result of I<z>.
yading@10 1665
yading@10 1666
yading@10 1667 =item B<ifnot(x, y)>
yading@10 1668
yading@10 1669 Evaluate I<x>, and if the result is zero return the result of the
yading@10 1670 evaluation of I<y>, return 0 otherwise.
yading@10 1671
yading@10 1672
yading@10 1673 =item B<ifnot(x, y, z)>
yading@10 1674
yading@10 1675 Evaluate I<x>, and if the result is zero return the evaluation
yading@10 1676 result of I<y>, otherwise the evaluation result of I<z>.
yading@10 1677
yading@10 1678
yading@10 1679 =item B<isinf(x)>
yading@10 1680
yading@10 1681 Return 1.0 if I<x> is +/-INFINITY, 0.0 otherwise.
yading@10 1682
yading@10 1683
yading@10 1684 =item B<isnan(x)>
yading@10 1685
yading@10 1686 Return 1.0 if I<x> is NAN, 0.0 otherwise.
yading@10 1687
yading@10 1688
yading@10 1689 =item B<ld(var)>
yading@10 1690
yading@10 1691 Allow to load the value of the internal variable with number
yading@10 1692 I<var>, which was previously stored with st(I<var>, I<expr>).
yading@10 1693 The function returns the loaded value.
yading@10 1694
yading@10 1695
yading@10 1696 =item B<log(x)>
yading@10 1697
yading@10 1698 Compute natural logarithm of I<x>.
yading@10 1699
yading@10 1700
yading@10 1701 =item B<lt(x, y)>
yading@10 1702
yading@10 1703 Return 1 if I<x> is lesser than I<y>, 0 otherwise.
yading@10 1704
yading@10 1705
yading@10 1706 =item B<lte(x, y)>
yading@10 1707
yading@10 1708 Return 1 if I<x> is lesser than or equal to I<y>, 0 otherwise.
yading@10 1709
yading@10 1710
yading@10 1711 =item B<max(x, y)>
yading@10 1712
yading@10 1713 Return the maximum between I<x> and I<y>.
yading@10 1714
yading@10 1715
yading@10 1716 =item B<min(x, y)>
yading@10 1717
yading@10 1718 Return the maximum between I<x> and I<y>.
yading@10 1719
yading@10 1720
yading@10 1721 =item B<mod(x, y)>
yading@10 1722
yading@10 1723 Compute the remainder of division of I<x> by I<y>.
yading@10 1724
yading@10 1725
yading@10 1726 =item B<not(expr)>
yading@10 1727
yading@10 1728 Return 1.0 if I<expr> is zero, 0.0 otherwise.
yading@10 1729
yading@10 1730
yading@10 1731 =item B<pow(x, y)>
yading@10 1732
yading@10 1733 Compute the power of I<x> elevated I<y>, it is equivalent to
yading@10 1734 "(I<x>)^(I<y>)".
yading@10 1735
yading@10 1736
yading@10 1737 =item B<print(t)>
yading@10 1738
yading@10 1739
yading@10 1740 =item B<print(t, l)>
yading@10 1741
yading@10 1742 Print the value of expression I<t> with loglevel I<l>. If
yading@10 1743 I<l> is not specified then a default log level is used.
yading@10 1744 Returns the value of the expression printed.
yading@10 1745
yading@10 1746 Prints t with loglevel l
yading@10 1747
yading@10 1748
yading@10 1749 =item B<random(x)>
yading@10 1750
yading@10 1751 Return a pseudo random value between 0.0 and 1.0. I<x> is the index of the
yading@10 1752 internal variable which will be used to save the seed/state.
yading@10 1753
yading@10 1754
yading@10 1755 =item B<root(expr, max)>
yading@10 1756
yading@10 1757 Find an input value for which the function represented by I<expr>
yading@10 1758 with argument I<ld(0)> is 0 in the interval 0..I<max>.
yading@10 1759
yading@10 1760 The expression in I<expr> must denote a continuous function or the
yading@10 1761 result is undefined.
yading@10 1762
yading@10 1763 I<ld(0)> is used to represent the function input value, which means
yading@10 1764 that the given expression will be evaluated multiple times with
yading@10 1765 various input values that the expression can access through
yading@10 1766 C<ld(0)>. When the expression evaluates to 0 then the
yading@10 1767 corresponding input value will be returned.
yading@10 1768
yading@10 1769
yading@10 1770 =item B<sin(x)>
yading@10 1771
yading@10 1772 Compute sine of I<x>.
yading@10 1773
yading@10 1774
yading@10 1775 =item B<sinh(x)>
yading@10 1776
yading@10 1777 Compute hyperbolic sine of I<x>.
yading@10 1778
yading@10 1779
yading@10 1780 =item B<sqrt(expr)>
yading@10 1781
yading@10 1782 Compute the square root of I<expr>. This is equivalent to
yading@10 1783 "(I<expr>)^.5".
yading@10 1784
yading@10 1785
yading@10 1786 =item B<squish(x)>
yading@10 1787
yading@10 1788 Compute expression C<1/(1 + exp(4*x))>.
yading@10 1789
yading@10 1790
yading@10 1791 =item B<st(var, expr)>
yading@10 1792
yading@10 1793 Allow to store the value of the expression I<expr> in an internal
yading@10 1794 variable. I<var> specifies the number of the variable where to
yading@10 1795 store the value, and it is a value ranging from 0 to 9. The function
yading@10 1796 returns the value stored in the internal variable.
yading@10 1797 Note, Variables are currently not shared between expressions.
yading@10 1798
yading@10 1799
yading@10 1800 =item B<tan(x)>
yading@10 1801
yading@10 1802 Compute tangent of I<x>.
yading@10 1803
yading@10 1804
yading@10 1805 =item B<tanh(x)>
yading@10 1806
yading@10 1807 Compute hyperbolic tangent of I<x>.
yading@10 1808
yading@10 1809
yading@10 1810 =item B<taylor(expr, x)>
yading@10 1811
yading@10 1812
yading@10 1813 =item B<taylor(expr, x, id)>
yading@10 1814
yading@10 1815 Evaluate a Taylor series at I<x>, given an expression representing
yading@10 1816 the C<ld(id)>-th derivative of a function at 0.
yading@10 1817
yading@10 1818 When the series does not converge the result is undefined.
yading@10 1819
yading@10 1820 I<ld(id)> is used to represent the derivative order in I<expr>,
yading@10 1821 which means that the given expression will be evaluated multiple times
yading@10 1822 with various input values that the expression can access through
yading@10 1823 C<ld(id)>. If I<id> is not specified then 0 is assumed.
yading@10 1824
yading@10 1825 Note, when you have the derivatives at y instead of 0,
yading@10 1826 C<taylor(expr, x-y)> can be used.
yading@10 1827
yading@10 1828
yading@10 1829 =item B<time(0)>
yading@10 1830
yading@10 1831 Return the current (wallclock) time in seconds.
yading@10 1832
yading@10 1833
yading@10 1834 =item B<trunc(expr)>
yading@10 1835
yading@10 1836 Round the value of expression I<expr> towards zero to the nearest
yading@10 1837 integer. For example, "trunc(-1.5)" is "-1.0".
yading@10 1838
yading@10 1839
yading@10 1840 =item B<while(cond, expr)>
yading@10 1841
yading@10 1842 Evaluate expression I<expr> while the expression I<cond> is
yading@10 1843 non-zero, and returns the value of the last I<expr> evaluation, or
yading@10 1844 NAN if I<cond> was always false.
yading@10 1845
yading@10 1846 =back
yading@10 1847
yading@10 1848
yading@10 1849 The following constants are available:
yading@10 1850
yading@10 1851 =over 4
yading@10 1852
yading@10 1853
yading@10 1854 =item B<PI>
yading@10 1855
yading@10 1856 area of the unit disc, approximately 3.14
yading@10 1857
yading@10 1858 =item B<E>
yading@10 1859
yading@10 1860 exp(1) (Euler's number), approximately 2.718
yading@10 1861
yading@10 1862 =item B<PHI>
yading@10 1863
yading@10 1864 golden ratio (1+sqrt(5))/2, approximately 1.618
yading@10 1865
yading@10 1866 =back
yading@10 1867
yading@10 1868
yading@10 1869 Assuming that an expression is considered "true" if it has a non-zero
yading@10 1870 value, note that:
yading@10 1871
yading@10 1872 C<*> works like AND
yading@10 1873
yading@10 1874 C<+> works like OR
yading@10 1875
yading@10 1876 For example the construct:
yading@10 1877
yading@10 1878 if (A AND B) then C
yading@10 1879
yading@10 1880 is equivalent to:
yading@10 1881
yading@10 1882 if(A*B, C)
yading@10 1883
yading@10 1884
yading@10 1885 In your C code, you can extend the list of unary and binary functions,
yading@10 1886 and define recognized constants, so that they are available for your
yading@10 1887 expressions.
yading@10 1888
yading@10 1889 The evaluator also recognizes the International System unit prefixes.
yading@10 1890 If 'i' is appended after the prefix, binary prefixes are used, which
yading@10 1891 are based on powers of 1024 instead of powers of 1000.
yading@10 1892 The 'B' postfix multiplies the value by 8, and can be appended after a
yading@10 1893 unit prefix or used alone. This allows using for example 'KB', 'MiB',
yading@10 1894 'G' and 'B' as number postfix.
yading@10 1895
yading@10 1896 The list of available International System prefixes follows, with
yading@10 1897 indication of the corresponding powers of 10 and of 2.
yading@10 1898
yading@10 1899 =over 4
yading@10 1900
yading@10 1901
yading@10 1902 =item B<y>
yading@10 1903
yading@10 1904 10^-24 / 2^-80
yading@10 1905
yading@10 1906 =item B<z>
yading@10 1907
yading@10 1908 10^-21 / 2^-70
yading@10 1909
yading@10 1910 =item B<a>
yading@10 1911
yading@10 1912 10^-18 / 2^-60
yading@10 1913
yading@10 1914 =item B<f>
yading@10 1915
yading@10 1916 10^-15 / 2^-50
yading@10 1917
yading@10 1918 =item B<p>
yading@10 1919
yading@10 1920 10^-12 / 2^-40
yading@10 1921
yading@10 1922 =item B<n>
yading@10 1923
yading@10 1924 10^-9 / 2^-30
yading@10 1925
yading@10 1926 =item B<u>
yading@10 1927
yading@10 1928 10^-6 / 2^-20
yading@10 1929
yading@10 1930 =item B<m>
yading@10 1931
yading@10 1932 10^-3 / 2^-10
yading@10 1933
yading@10 1934 =item B<c>
yading@10 1935
yading@10 1936 10^-2
yading@10 1937
yading@10 1938 =item B<d>
yading@10 1939
yading@10 1940 10^-1
yading@10 1941
yading@10 1942 =item B<h>
yading@10 1943
yading@10 1944 10^2
yading@10 1945
yading@10 1946 =item B<k>
yading@10 1947
yading@10 1948 10^3 / 2^10
yading@10 1949
yading@10 1950 =item B<K>
yading@10 1951
yading@10 1952 10^3 / 2^10
yading@10 1953
yading@10 1954 =item B<M>
yading@10 1955
yading@10 1956 10^6 / 2^20
yading@10 1957
yading@10 1958 =item B<G>
yading@10 1959
yading@10 1960 10^9 / 2^30
yading@10 1961
yading@10 1962 =item B<T>
yading@10 1963
yading@10 1964 10^12 / 2^40
yading@10 1965
yading@10 1966 =item B<P>
yading@10 1967
yading@10 1968 10^15 / 2^40
yading@10 1969
yading@10 1970 =item B<E>
yading@10 1971
yading@10 1972 10^18 / 2^50
yading@10 1973
yading@10 1974 =item B<Z>
yading@10 1975
yading@10 1976 10^21 / 2^60
yading@10 1977
yading@10 1978 =item B<Y>
yading@10 1979
yading@10 1980 10^24 / 2^70
yading@10 1981
yading@10 1982 =back
yading@10 1983
yading@10 1984
yading@10 1985
yading@10 1986
yading@10 1987 =head1 OPENCL OPTIONS
yading@10 1988
yading@10 1989
yading@10 1990 When FFmpeg is configured with C<--enable-opencl>, it is possible
yading@10 1991 to set the options for the global OpenCL context.
yading@10 1992
yading@10 1993 The list of supported options follows:
yading@10 1994
yading@10 1995
yading@10 1996 =over 4
yading@10 1997
yading@10 1998
yading@10 1999 =item B<build_options>
yading@10 2000
yading@10 2001 Set build options used to compile the registered kernels.
yading@10 2002
yading@10 2003 See reference "OpenCL Specification Version: 1.2 chapter 5.6.4".
yading@10 2004
yading@10 2005
yading@10 2006 =item B<platform_idx>
yading@10 2007
yading@10 2008 Select the index of the platform to run OpenCL code.
yading@10 2009
yading@10 2010 The specified index must be one of the indexes in the device list
yading@10 2011 which can be obtained with C<av_opencl_get_device_list()>.
yading@10 2012
yading@10 2013
yading@10 2014 =item B<device_idx>
yading@10 2015
yading@10 2016 Select the index of the device used to run OpenCL code.
yading@10 2017
yading@10 2018 The specifed index must be one of the indexes in the device list which
yading@10 2019 can be obtained with C<av_opencl_get_device_list()>.
yading@10 2020
yading@10 2021
yading@10 2022 =back
yading@10 2023
yading@10 2024
yading@10 2025
yading@10 2026
yading@10 2027 =head1 CODEC OPTIONS
yading@10 2028
yading@10 2029
yading@10 2030 libavcodec provides some generic global options, which can be set on
yading@10 2031 all the encoders and decoders. In addition each codec may support
yading@10 2032 so-called private options, which are specific for a given codec.
yading@10 2033
yading@10 2034 Sometimes, a global option may only affect a specific kind of codec,
yading@10 2035 and may be unsensical or ignored by another, so you need to be aware
yading@10 2036 of the meaning of the specified options. Also some options are
yading@10 2037 meant only for decoding or encoding.
yading@10 2038
yading@10 2039 Options may be set by specifying -I<option> I<value> in the
yading@10 2040 FFmpeg tools, or by setting the value explicitly in the
yading@10 2041 C<AVCodecContext> options or using the F<libavutil/opt.h> API
yading@10 2042 for programmatic use.
yading@10 2043
yading@10 2044 The list of supported options follow:
yading@10 2045
yading@10 2046
yading@10 2047 =over 4
yading@10 2048
yading@10 2049
yading@10 2050 =item B<b> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 2051
yading@10 2052 Set bitrate in bits/s. Default value is 200K.
yading@10 2053
yading@10 2054
yading@10 2055 =item B<ab> I<integer> B<(>I<encoding,audio>B<)>
yading@10 2056
yading@10 2057 Set audio bitrate (in bits/s). Default value is 128K.
yading@10 2058
yading@10 2059
yading@10 2060 =item B<bt> I<integer> B<(>I<encoding,video>B<)>
yading@10 2061
yading@10 2062 Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate
yading@10 2063 tolerance specifies how far ratecontrol is willing to deviate from the
yading@10 2064 target average bitrate value. This is not related to min/max
yading@10 2065 bitrate. Lowering tolerance too much has an adverse effect on quality.
yading@10 2066
yading@10 2067
yading@10 2068 =item B<flags> I<flags> B<(>I<decoding/encoding,audio,video,subtitles>B<)>
yading@10 2069
yading@10 2070 Set generic flags.
yading@10 2071
yading@10 2072 Possible values:
yading@10 2073
yading@10 2074 =over 4
yading@10 2075
yading@10 2076
yading@10 2077 =item B<mv4>
yading@10 2078
yading@10 2079 Use four motion vector by macroblock (mpeg4).
yading@10 2080
yading@10 2081 =item B<qpel>
yading@10 2082
yading@10 2083 Use 1/4 pel motion compensation.
yading@10 2084
yading@10 2085 =item B<loop>
yading@10 2086
yading@10 2087 Use loop filter.
yading@10 2088
yading@10 2089 =item B<qscale>
yading@10 2090
yading@10 2091 Use fixed qscale.
yading@10 2092
yading@10 2093 =item B<gmc>
yading@10 2094
yading@10 2095 Use gmc.
yading@10 2096
yading@10 2097 =item B<mv0>
yading@10 2098
yading@10 2099 Always try a mb with mv=E<lt>0,0E<gt>.
yading@10 2100
yading@10 2101 =item B<input_preserved>
yading@10 2102
yading@10 2103
yading@10 2104
yading@10 2105 =item B<pass1>
yading@10 2106
yading@10 2107 Use internal 2pass ratecontrol in first pass mode.
yading@10 2108
yading@10 2109 =item B<pass2>
yading@10 2110
yading@10 2111 Use internal 2pass ratecontrol in second pass mode.
yading@10 2112
yading@10 2113 =item B<gray>
yading@10 2114
yading@10 2115 Only decode/encode grayscale.
yading@10 2116
yading@10 2117 =item B<emu_edge>
yading@10 2118
yading@10 2119 Do not draw edges.
yading@10 2120
yading@10 2121 =item B<psnr>
yading@10 2122
yading@10 2123 Set error[?] variables during encoding.
yading@10 2124
yading@10 2125 =item B<truncated>
yading@10 2126
yading@10 2127
yading@10 2128
yading@10 2129 =item B<naq>
yading@10 2130
yading@10 2131 Normalize adaptive quantization.
yading@10 2132
yading@10 2133 =item B<ildct>
yading@10 2134
yading@10 2135 Use interlaced DCT.
yading@10 2136
yading@10 2137 =item B<low_delay>
yading@10 2138
yading@10 2139 Force low delay.
yading@10 2140
yading@10 2141 =item B<global_header>
yading@10 2142
yading@10 2143 Place global headers in extradata instead of every keyframe.
yading@10 2144
yading@10 2145 =item B<bitexact>
yading@10 2146
yading@10 2147 Use only bitexact stuff (except (I)DCT).
yading@10 2148
yading@10 2149 =item B<aic>
yading@10 2150
yading@10 2151 Apply H263 advanced intra coding / mpeg4 ac prediction.
yading@10 2152
yading@10 2153 =item B<cbp>
yading@10 2154
yading@10 2155 Deprecated, use mpegvideo private options instead.
yading@10 2156
yading@10 2157 =item B<qprd>
yading@10 2158
yading@10 2159 Deprecated, use mpegvideo private options instead.
yading@10 2160
yading@10 2161 =item B<ilme>
yading@10 2162
yading@10 2163 Apply interlaced motion estimation.
yading@10 2164
yading@10 2165 =item B<cgop>
yading@10 2166
yading@10 2167 Use closed gop.
yading@10 2168
yading@10 2169 =back
yading@10 2170
yading@10 2171
yading@10 2172
yading@10 2173 =item B<sub_id> I<integer>
yading@10 2174
yading@10 2175 Deprecated, currently unused.
yading@10 2176
yading@10 2177
yading@10 2178 =item B<me_method> I<integer> B<(>I<encoding,video>B<)>
yading@10 2179
yading@10 2180 Set motion estimation method.
yading@10 2181
yading@10 2182 Possible values:
yading@10 2183
yading@10 2184 =over 4
yading@10 2185
yading@10 2186
yading@10 2187 =item B<zero>
yading@10 2188
yading@10 2189 zero motion estimation (fastest)
yading@10 2190
yading@10 2191 =item B<full>
yading@10 2192
yading@10 2193 full motion estimation (slowest)
yading@10 2194
yading@10 2195 =item B<epzs>
yading@10 2196
yading@10 2197 EPZS motion estimation (default)
yading@10 2198
yading@10 2199 =item B<esa>
yading@10 2200
yading@10 2201 esa motion estimation (alias for full)
yading@10 2202
yading@10 2203 =item B<tesa>
yading@10 2204
yading@10 2205 tesa motion estimation
yading@10 2206
yading@10 2207 =item B<dia>
yading@10 2208
yading@10 2209 dia motion estimation (alias for epzs)
yading@10 2210
yading@10 2211 =item B<log>
yading@10 2212
yading@10 2213 log motion estimation
yading@10 2214
yading@10 2215 =item B<phods>
yading@10 2216
yading@10 2217 phods motion estimation
yading@10 2218
yading@10 2219 =item B<x1>
yading@10 2220
yading@10 2221 X1 motion estimation
yading@10 2222
yading@10 2223 =item B<hex>
yading@10 2224
yading@10 2225 hex motion estimation
yading@10 2226
yading@10 2227 =item B<umh>
yading@10 2228
yading@10 2229 umh motion estimation
yading@10 2230
yading@10 2231 =item B<iter>
yading@10 2232
yading@10 2233 iter motion estimation
yading@10 2234
yading@10 2235 =back
yading@10 2236
yading@10 2237
yading@10 2238
yading@10 2239 =item B<extradata_size> I<integer>
yading@10 2240
yading@10 2241 Set extradata size.
yading@10 2242
yading@10 2243
yading@10 2244 =item B<time_base> I<rational number>
yading@10 2245
yading@10 2246 Set codec time base.
yading@10 2247
yading@10 2248 It is the fundamental unit of time (in seconds) in terms of which
yading@10 2249 frame timestamps are represented. For fixed-fps content, timebase
yading@10 2250 should be C<1 / frame_rate> and timestamp increments should be
yading@10 2251 identically 1.
yading@10 2252
yading@10 2253
yading@10 2254 =item B<g> I<integer> B<(>I<encoding,video>B<)>
yading@10 2255
yading@10 2256 Set the group of picture size. Default value is 12.
yading@10 2257
yading@10 2258
yading@10 2259 =item B<ar> I<integer> B<(>I<decoding/encoding,audio>B<)>
yading@10 2260
yading@10 2261 Set audio sampling rate (in Hz).
yading@10 2262
yading@10 2263
yading@10 2264 =item B<ac> I<integer> B<(>I<decoding/encoding,audio>B<)>
yading@10 2265
yading@10 2266 Set number of audio channels.
yading@10 2267
yading@10 2268
yading@10 2269 =item B<cutoff> I<integer> B<(>I<encoding,audio>B<)>
yading@10 2270
yading@10 2271 Set cutoff bandwidth.
yading@10 2272
yading@10 2273
yading@10 2274 =item B<frame_size> I<integer> B<(>I<encoding,audio>B<)>
yading@10 2275
yading@10 2276 Set audio frame size.
yading@10 2277
yading@10 2278 Each submitted frame except the last must contain exactly frame_size
yading@10 2279 samples per channel. May be 0 when the codec has
yading@10 2280 CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
yading@10 2281 restricted. It is set by some decoders to indicate constant frame
yading@10 2282 size.
yading@10 2283
yading@10 2284
yading@10 2285 =item B<frame_number> I<integer>
yading@10 2286
yading@10 2287 Set the frame number.
yading@10 2288
yading@10 2289
yading@10 2290 =item B<delay> I<integer>
yading@10 2291
yading@10 2292
yading@10 2293
yading@10 2294 =item B<qcomp> I<float> B<(>I<encoding,video>B<)>
yading@10 2295
yading@10 2296 Set video quantizer scale compression (VBR). It is used as a constant
yading@10 2297 in the ratecontrol equation. Recommended range for default rc_eq:
yading@10 2298 0.0-1.0.
yading@10 2299
yading@10 2300
yading@10 2301 =item B<qblur> I<float> B<(>I<encoding,video>B<)>
yading@10 2302
yading@10 2303 Set video quantizer scale blur (VBR).
yading@10 2304
yading@10 2305
yading@10 2306 =item B<qmin> I<integer> B<(>I<encoding,video>B<)>
yading@10 2307
yading@10 2308 Set min video quantizer scale (VBR). Must be included between -1 and
yading@10 2309 69, default value is 2.
yading@10 2310
yading@10 2311
yading@10 2312 =item B<qmax> I<integer> B<(>I<encoding,video>B<)>
yading@10 2313
yading@10 2314 Set max video quantizer scale (VBR). Must be included between -1 and
yading@10 2315 1024, default value is 31.
yading@10 2316
yading@10 2317
yading@10 2318 =item B<qdiff> I<integer> B<(>I<encoding,video>B<)>
yading@10 2319
yading@10 2320 Set max difference between the quantizer scale (VBR).
yading@10 2321
yading@10 2322
yading@10 2323 =item B<bf> I<integer> B<(>I<encoding,video>B<)>
yading@10 2324
yading@10 2325 Set max number of B frames.
yading@10 2326
yading@10 2327
yading@10 2328 =item B<b_qfactor> I<float> B<(>I<encoding,video>B<)>
yading@10 2329
yading@10 2330 Set qp factor between P and B frames.
yading@10 2331
yading@10 2332
yading@10 2333 =item B<rc_strategy> I<integer> B<(>I<encoding,video>B<)>
yading@10 2334
yading@10 2335 Set ratecontrol method.
yading@10 2336
yading@10 2337
yading@10 2338 =item B<b_strategy> I<integer> B<(>I<encoding,video>B<)>
yading@10 2339
yading@10 2340 Set strategy to choose between I/P/B-frames.
yading@10 2341
yading@10 2342
yading@10 2343 =item B<ps> I<integer> B<(>I<encoding,video>B<)>
yading@10 2344
yading@10 2345 Set RTP payload size in bytes.
yading@10 2346
yading@10 2347
yading@10 2348 =item B<mv_bits> I<integer>
yading@10 2349
yading@10 2350
yading@10 2351 =item B<header_bits> I<integer>
yading@10 2352
yading@10 2353
yading@10 2354 =item B<i_tex_bits> I<integer>
yading@10 2355
yading@10 2356
yading@10 2357 =item B<p_tex_bits> I<integer>
yading@10 2358
yading@10 2359
yading@10 2360 =item B<i_count> I<integer>
yading@10 2361
yading@10 2362
yading@10 2363 =item B<p_count> I<integer>
yading@10 2364
yading@10 2365
yading@10 2366 =item B<skip_count> I<integer>
yading@10 2367
yading@10 2368
yading@10 2369 =item B<misc_bits> I<integer>
yading@10 2370
yading@10 2371
yading@10 2372 =item B<frame_bits> I<integer>
yading@10 2373
yading@10 2374
yading@10 2375 =item B<codec_tag> I<integer>
yading@10 2376
yading@10 2377
yading@10 2378 =item B<bug> I<flags> B<(>I<decoding,video>B<)>
yading@10 2379
yading@10 2380 Workaround not auto detected encoder bugs.
yading@10 2381
yading@10 2382 Possible values:
yading@10 2383
yading@10 2384 =over 4
yading@10 2385
yading@10 2386
yading@10 2387 =item B<autodetect>
yading@10 2388
yading@10 2389
yading@10 2390
yading@10 2391 =item B<old_msmpeg4>
yading@10 2392
yading@10 2393 some old lavc generated msmpeg4v3 files (no autodetection)
yading@10 2394
yading@10 2395 =item B<xvid_ilace>
yading@10 2396
yading@10 2397 Xvid interlacing bug (autodetected if fourcc==XVIX)
yading@10 2398
yading@10 2399 =item B<ump4>
yading@10 2400
yading@10 2401 (autodetected if fourcc==UMP4)
yading@10 2402
yading@10 2403 =item B<no_padding>
yading@10 2404
yading@10 2405 padding bug (autodetected)
yading@10 2406
yading@10 2407 =item B<amv>
yading@10 2408
yading@10 2409
yading@10 2410
yading@10 2411 =item B<ac_vlc>
yading@10 2412
yading@10 2413 illegal vlc bug (autodetected per fourcc)
yading@10 2414
yading@10 2415 =item B<qpel_chroma>
yading@10 2416
yading@10 2417
yading@10 2418
yading@10 2419 =item B<std_qpel>
yading@10 2420
yading@10 2421 old standard qpel (autodetected per fourcc/version)
yading@10 2422
yading@10 2423 =item B<qpel_chroma2>
yading@10 2424
yading@10 2425
yading@10 2426
yading@10 2427 =item B<direct_blocksize>
yading@10 2428
yading@10 2429 direct-qpel-blocksize bug (autodetected per fourcc/version)
yading@10 2430
yading@10 2431 =item B<edge>
yading@10 2432
yading@10 2433 edge padding bug (autodetected per fourcc/version)
yading@10 2434
yading@10 2435 =item B<hpel_chroma>
yading@10 2436
yading@10 2437
yading@10 2438
yading@10 2439 =item B<dc_clip>
yading@10 2440
yading@10 2441
yading@10 2442
yading@10 2443 =item B<ms>
yading@10 2444
yading@10 2445 Workaround various bugs in microsoft broken decoders.
yading@10 2446
yading@10 2447 =item B<trunc>
yading@10 2448
yading@10 2449 trancated frames
yading@10 2450
yading@10 2451 =back
yading@10 2452
yading@10 2453
yading@10 2454
yading@10 2455 =item B<lelim> I<integer> B<(>I<encoding,video>B<)>
yading@10 2456
yading@10 2457 Set single coefficient elimination threshold for luminance (negative
yading@10 2458 values also consider DC coefficient).
yading@10 2459
yading@10 2460
yading@10 2461 =item B<celim> I<integer> B<(>I<encoding,video>B<)>
yading@10 2462
yading@10 2463 Set single coefficient elimination threshold for chrominance (negative
yading@10 2464 values also consider dc coefficient)
yading@10 2465
yading@10 2466
yading@10 2467 =item B<strict> I<integer> B<(>I<decoding/encoding,audio,video>B<)>
yading@10 2468
yading@10 2469 Specify how strictly to follow the standards.
yading@10 2470
yading@10 2471 Possible values:
yading@10 2472
yading@10 2473 =over 4
yading@10 2474
yading@10 2475
yading@10 2476 =item B<very>
yading@10 2477
yading@10 2478 strictly conform to a older more strict version of the spec or reference software
yading@10 2479
yading@10 2480 =item B<strict>
yading@10 2481
yading@10 2482 strictly conform to all the things in the spec no matter what consequences
yading@10 2483
yading@10 2484 =item B<normal>
yading@10 2485
yading@10 2486
yading@10 2487
yading@10 2488 =item B<unofficial>
yading@10 2489
yading@10 2490 allow unofficial extensions
yading@10 2491
yading@10 2492 =item B<experimental>
yading@10 2493
yading@10 2494 allow non standardized experimental things
yading@10 2495
yading@10 2496 =back
yading@10 2497
yading@10 2498
yading@10 2499
yading@10 2500 =item B<b_qoffset> I<float> B<(>I<encoding,video>B<)>
yading@10 2501
yading@10 2502 Set QP offset between P and B frames.
yading@10 2503
yading@10 2504
yading@10 2505 =item B<err_detect> I<flags> B<(>I<decoding,audio,video>B<)>
yading@10 2506
yading@10 2507 Set error detection flags.
yading@10 2508
yading@10 2509 Possible values:
yading@10 2510
yading@10 2511 =over 4
yading@10 2512
yading@10 2513
yading@10 2514 =item B<crccheck>
yading@10 2515
yading@10 2516 verify embedded CRCs
yading@10 2517
yading@10 2518 =item B<bitstream>
yading@10 2519
yading@10 2520 detect bitstream specification deviations
yading@10 2521
yading@10 2522 =item B<buffer>
yading@10 2523
yading@10 2524 detect improper bitstream length
yading@10 2525
yading@10 2526 =item B<explode>
yading@10 2527
yading@10 2528 abort decoding on minor error detection
yading@10 2529
yading@10 2530 =item B<careful>
yading@10 2531
yading@10 2532 consider things that violate the spec and have not been seen in the wild as errors
yading@10 2533
yading@10 2534 =item B<compliant>
yading@10 2535
yading@10 2536 consider all spec non compliancies as errors
yading@10 2537
yading@10 2538 =item B<aggressive>
yading@10 2539
yading@10 2540 consider things that a sane encoder should not do as an error
yading@10 2541
yading@10 2542 =back
yading@10 2543
yading@10 2544
yading@10 2545
yading@10 2546 =item B<has_b_frames> I<integer>
yading@10 2547
yading@10 2548
yading@10 2549
yading@10 2550 =item B<block_align> I<integer>
yading@10 2551
yading@10 2552
yading@10 2553
yading@10 2554 =item B<mpeg_quant> I<integer> B<(>I<encoding,video>B<)>
yading@10 2555
yading@10 2556 Use MPEG quantizers instead of H.263.
yading@10 2557
yading@10 2558
yading@10 2559 =item B<qsquish> I<float> B<(>I<encoding,video>B<)>
yading@10 2560
yading@10 2561 How to keep quantizer between qmin and qmax (0 = clip, 1 = use
yading@10 2562 differentiable function).
yading@10 2563
yading@10 2564
yading@10 2565 =item B<rc_qmod_amp> I<float> B<(>I<encoding,video>B<)>
yading@10 2566
yading@10 2567 Set experimental quantizer modulation.
yading@10 2568
yading@10 2569
yading@10 2570 =item B<rc_qmod_freq> I<integer> B<(>I<encoding,video>B<)>
yading@10 2571
yading@10 2572 Set experimental quantizer modulation.
yading@10 2573
yading@10 2574
yading@10 2575 =item B<rc_override_count> I<integer>
yading@10 2576
yading@10 2577
yading@10 2578
yading@10 2579 =item B<rc_eq> I<string> B<(>I<encoding,video>B<)>
yading@10 2580
yading@10 2581 Set rate control equation. When computing the expression, besides the
yading@10 2582 standard functions defined in the section 'Expression Evaluation', the
yading@10 2583 following functions are available: bits2qp(bits), qp2bits(qp). Also
yading@10 2584 the following constants are available: iTex pTex tex mv fCode iCount
yading@10 2585 mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
yading@10 2586 avgTex.
yading@10 2587
yading@10 2588
yading@10 2589 =item B<maxrate> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 2590
yading@10 2591 Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
yading@10 2592
yading@10 2593
yading@10 2594 =item B<minrate> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 2595
yading@10 2596 Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
yading@10 2597 encode. It is of little use elsewise.
yading@10 2598
yading@10 2599
yading@10 2600 =item B<bufsize> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 2601
yading@10 2602 Set ratecontrol buffer size (in bits).
yading@10 2603
yading@10 2604
yading@10 2605 =item B<rc_buf_aggressivity> I<float> B<(>I<encoding,video>B<)>
yading@10 2606
yading@10 2607 Currently useless.
yading@10 2608
yading@10 2609
yading@10 2610 =item B<i_qfactor> I<float> B<(>I<encoding,video>B<)>
yading@10 2611
yading@10 2612 Set QP factor between P and I frames.
yading@10 2613
yading@10 2614
yading@10 2615 =item B<i_qoffset> I<float> B<(>I<encoding,video>B<)>
yading@10 2616
yading@10 2617 Set QP offset between P and I frames.
yading@10 2618
yading@10 2619
yading@10 2620 =item B<rc_init_cplx> I<float> B<(>I<encoding,video>B<)>
yading@10 2621
yading@10 2622 Set initial complexity for 1-pass encoding.
yading@10 2623
yading@10 2624
yading@10 2625 =item B<dct> I<integer> B<(>I<encoding,video>B<)>
yading@10 2626
yading@10 2627 Set DCT algorithm.
yading@10 2628
yading@10 2629 Possible values:
yading@10 2630
yading@10 2631 =over 4
yading@10 2632
yading@10 2633
yading@10 2634 =item B<auto>
yading@10 2635
yading@10 2636 autoselect a good one (default)
yading@10 2637
yading@10 2638 =item B<fastint>
yading@10 2639
yading@10 2640 fast integer
yading@10 2641
yading@10 2642 =item B<int>
yading@10 2643
yading@10 2644 accurate integer
yading@10 2645
yading@10 2646 =item B<mmx>
yading@10 2647
yading@10 2648
yading@10 2649
yading@10 2650 =item B<altivec>
yading@10 2651
yading@10 2652
yading@10 2653
yading@10 2654 =item B<faan>
yading@10 2655
yading@10 2656 floating point AAN DCT
yading@10 2657
yading@10 2658 =back
yading@10 2659
yading@10 2660
yading@10 2661
yading@10 2662 =item B<lumi_mask> I<float> B<(>I<encoding,video>B<)>
yading@10 2663
yading@10 2664 Compress bright areas stronger than medium ones.
yading@10 2665
yading@10 2666
yading@10 2667 =item B<tcplx_mask> I<float> B<(>I<encoding,video>B<)>
yading@10 2668
yading@10 2669 Set temporal complexity masking.
yading@10 2670
yading@10 2671
yading@10 2672 =item B<scplx_mask> I<float> B<(>I<encoding,video>B<)>
yading@10 2673
yading@10 2674 Set spatial complexity masking.
yading@10 2675
yading@10 2676
yading@10 2677 =item B<p_mask> I<float> B<(>I<encoding,video>B<)>
yading@10 2678
yading@10 2679 Set inter masking.
yading@10 2680
yading@10 2681
yading@10 2682 =item B<dark_mask> I<float> B<(>I<encoding,video>B<)>
yading@10 2683
yading@10 2684 Compress dark areas stronger than medium ones.
yading@10 2685
yading@10 2686
yading@10 2687 =item B<idct> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 2688
yading@10 2689 Select IDCT implementation.
yading@10 2690
yading@10 2691 Possible values:
yading@10 2692
yading@10 2693 =over 4
yading@10 2694
yading@10 2695
yading@10 2696 =item B<auto>
yading@10 2697
yading@10 2698
yading@10 2699
yading@10 2700 =item B<int>
yading@10 2701
yading@10 2702
yading@10 2703
yading@10 2704 =item B<simple>
yading@10 2705
yading@10 2706
yading@10 2707
yading@10 2708 =item B<simplemmx>
yading@10 2709
yading@10 2710
yading@10 2711
yading@10 2712 =item B<libmpeg2mmx>
yading@10 2713
yading@10 2714
yading@10 2715
yading@10 2716 =item B<mmi>
yading@10 2717
yading@10 2718
yading@10 2719
yading@10 2720 =item B<arm>
yading@10 2721
yading@10 2722
yading@10 2723
yading@10 2724 =item B<altivec>
yading@10 2725
yading@10 2726
yading@10 2727
yading@10 2728 =item B<sh4>
yading@10 2729
yading@10 2730
yading@10 2731
yading@10 2732 =item B<simplearm>
yading@10 2733
yading@10 2734
yading@10 2735
yading@10 2736 =item B<simplearmv5te>
yading@10 2737
yading@10 2738
yading@10 2739
yading@10 2740 =item B<simplearmv6>
yading@10 2741
yading@10 2742
yading@10 2743
yading@10 2744 =item B<simpleneon>
yading@10 2745
yading@10 2746
yading@10 2747
yading@10 2748 =item B<simplealpha>
yading@10 2749
yading@10 2750
yading@10 2751
yading@10 2752 =item B<h264>
yading@10 2753
yading@10 2754
yading@10 2755
yading@10 2756 =item B<vp3>
yading@10 2757
yading@10 2758
yading@10 2759
yading@10 2760 =item B<ipp>
yading@10 2761
yading@10 2762
yading@10 2763
yading@10 2764 =item B<xvidmmx>
yading@10 2765
yading@10 2766
yading@10 2767
yading@10 2768 =item B<faani>
yading@10 2769
yading@10 2770 floating point AAN IDCT
yading@10 2771
yading@10 2772 =back
yading@10 2773
yading@10 2774
yading@10 2775
yading@10 2776 =item B<slice_count> I<integer>
yading@10 2777
yading@10 2778
yading@10 2779
yading@10 2780 =item B<ec> I<flags> B<(>I<decoding,video>B<)>
yading@10 2781
yading@10 2782 Set error concealment strategy.
yading@10 2783
yading@10 2784 Possible values:
yading@10 2785
yading@10 2786 =over 4
yading@10 2787
yading@10 2788
yading@10 2789 =item B<guess_mvs>
yading@10 2790
yading@10 2791 iterative motion vector (MV) search (slow)
yading@10 2792
yading@10 2793 =item B<deblock>
yading@10 2794
yading@10 2795 use strong deblock filter for damaged MBs
yading@10 2796
yading@10 2797 =back
yading@10 2798
yading@10 2799
yading@10 2800
yading@10 2801 =item B<bits_per_coded_sample> I<integer>
yading@10 2802
yading@10 2803
yading@10 2804
yading@10 2805 =item B<pred> I<integer> B<(>I<encoding,video>B<)>
yading@10 2806
yading@10 2807 Set prediction method.
yading@10 2808
yading@10 2809 Possible values:
yading@10 2810
yading@10 2811 =over 4
yading@10 2812
yading@10 2813
yading@10 2814 =item B<left>
yading@10 2815
yading@10 2816
yading@10 2817
yading@10 2818 =item B<plane>
yading@10 2819
yading@10 2820
yading@10 2821
yading@10 2822 =item B<median>
yading@10 2823
yading@10 2824
yading@10 2825
yading@10 2826 =back
yading@10 2827
yading@10 2828
yading@10 2829
yading@10 2830 =item B<aspect> I<rational number> B<(>I<encoding,video>B<)>
yading@10 2831
yading@10 2832 Set sample aspect ratio.
yading@10 2833
yading@10 2834
yading@10 2835 =item B<debug> I<flags> B<(>I<decoding/encoding,audio,video,subtitles>B<)>
yading@10 2836
yading@10 2837 Print specific debug info.
yading@10 2838
yading@10 2839 Possible values:
yading@10 2840
yading@10 2841 =over 4
yading@10 2842
yading@10 2843
yading@10 2844 =item B<pict>
yading@10 2845
yading@10 2846 picture info
yading@10 2847
yading@10 2848 =item B<rc>
yading@10 2849
yading@10 2850 rate control
yading@10 2851
yading@10 2852 =item B<bitstream>
yading@10 2853
yading@10 2854
yading@10 2855
yading@10 2856 =item B<mb_type>
yading@10 2857
yading@10 2858 macroblock (MB) type
yading@10 2859
yading@10 2860 =item B<qp>
yading@10 2861
yading@10 2862 per-block quantization parameter (QP)
yading@10 2863
yading@10 2864 =item B<mv>
yading@10 2865
yading@10 2866 motion vector
yading@10 2867
yading@10 2868 =item B<dct_coeff>
yading@10 2869
yading@10 2870
yading@10 2871
yading@10 2872 =item B<skip>
yading@10 2873
yading@10 2874
yading@10 2875
yading@10 2876 =item B<startcode>
yading@10 2877
yading@10 2878
yading@10 2879
yading@10 2880 =item B<pts>
yading@10 2881
yading@10 2882
yading@10 2883
yading@10 2884 =item B<er>
yading@10 2885
yading@10 2886 error recognition
yading@10 2887
yading@10 2888 =item B<mmco>
yading@10 2889
yading@10 2890 memory management control operations (H.264)
yading@10 2891
yading@10 2892 =item B<bugs>
yading@10 2893
yading@10 2894
yading@10 2895
yading@10 2896 =item B<vis_qp>
yading@10 2897
yading@10 2898 visualize quantization parameter (QP), lower QP are tinted greener
yading@10 2899
yading@10 2900 =item B<vis_mb_type>
yading@10 2901
yading@10 2902 visualize block types
yading@10 2903
yading@10 2904 =item B<buffers>
yading@10 2905
yading@10 2906 picture buffer allocations
yading@10 2907
yading@10 2908 =item B<thread_ops>
yading@10 2909
yading@10 2910 threading operations
yading@10 2911
yading@10 2912 =back
yading@10 2913
yading@10 2914
yading@10 2915
yading@10 2916 =item B<vismv> I<integer> B<(>I<decoding,video>B<)>
yading@10 2917
yading@10 2918 Visualize motion vectors (MVs).
yading@10 2919
yading@10 2920 Possible values:
yading@10 2921
yading@10 2922 =over 4
yading@10 2923
yading@10 2924
yading@10 2925 =item B<pf>
yading@10 2926
yading@10 2927 forward predicted MVs of P-frames
yading@10 2928
yading@10 2929 =item B<bf>
yading@10 2930
yading@10 2931 forward predicted MVs of B-frames
yading@10 2932
yading@10 2933 =item B<bb>
yading@10 2934
yading@10 2935 backward predicted MVs of B-frames
yading@10 2936
yading@10 2937 =back
yading@10 2938
yading@10 2939
yading@10 2940
yading@10 2941 =item B<cmp> I<integer> B<(>I<encoding,video>B<)>
yading@10 2942
yading@10 2943 Set full pel me compare function.
yading@10 2944
yading@10 2945 Possible values:
yading@10 2946
yading@10 2947 =over 4
yading@10 2948
yading@10 2949
yading@10 2950 =item B<sad>
yading@10 2951
yading@10 2952 sum of absolute differences, fast (default)
yading@10 2953
yading@10 2954 =item B<sse>
yading@10 2955
yading@10 2956 sum of squared errors
yading@10 2957
yading@10 2958 =item B<satd>
yading@10 2959
yading@10 2960 sum of absolute Hadamard transformed differences
yading@10 2961
yading@10 2962 =item B<dct>
yading@10 2963
yading@10 2964 sum of absolute DCT transformed differences
yading@10 2965
yading@10 2966 =item B<psnr>
yading@10 2967
yading@10 2968 sum of squared quantization errors (avoid, low quality)
yading@10 2969
yading@10 2970 =item B<bit>
yading@10 2971
yading@10 2972 number of bits needed for the block
yading@10 2973
yading@10 2974 =item B<rd>
yading@10 2975
yading@10 2976 rate distortion optimal, slow
yading@10 2977
yading@10 2978 =item B<zero>
yading@10 2979
yading@10 2980 0
yading@10 2981
yading@10 2982 =item B<vsad>
yading@10 2983
yading@10 2984 sum of absolute vertical differences
yading@10 2985
yading@10 2986 =item B<vsse>
yading@10 2987
yading@10 2988 sum of squared vertical differences
yading@10 2989
yading@10 2990 =item B<nsse>
yading@10 2991
yading@10 2992 noise preserving sum of squared differences
yading@10 2993
yading@10 2994 =item B<w53>
yading@10 2995
yading@10 2996 5/3 wavelet, only used in snow
yading@10 2997
yading@10 2998 =item B<w97>
yading@10 2999
yading@10 3000 9/7 wavelet, only used in snow
yading@10 3001
yading@10 3002 =item B<dctmax>
yading@10 3003
yading@10 3004
yading@10 3005
yading@10 3006 =item B<chroma>
yading@10 3007
yading@10 3008
yading@10 3009
yading@10 3010 =back
yading@10 3011
yading@10 3012
yading@10 3013
yading@10 3014 =item B<subcmp> I<integer> B<(>I<encoding,video>B<)>
yading@10 3015
yading@10 3016 Set sub pel me compare function.
yading@10 3017
yading@10 3018 Possible values:
yading@10 3019
yading@10 3020 =over 4
yading@10 3021
yading@10 3022
yading@10 3023 =item B<sad>
yading@10 3024
yading@10 3025 sum of absolute differences, fast (default)
yading@10 3026
yading@10 3027 =item B<sse>
yading@10 3028
yading@10 3029 sum of squared errors
yading@10 3030
yading@10 3031 =item B<satd>
yading@10 3032
yading@10 3033 sum of absolute Hadamard transformed differences
yading@10 3034
yading@10 3035 =item B<dct>
yading@10 3036
yading@10 3037 sum of absolute DCT transformed differences
yading@10 3038
yading@10 3039 =item B<psnr>
yading@10 3040
yading@10 3041 sum of squared quantization errors (avoid, low quality)
yading@10 3042
yading@10 3043 =item B<bit>
yading@10 3044
yading@10 3045 number of bits needed for the block
yading@10 3046
yading@10 3047 =item B<rd>
yading@10 3048
yading@10 3049 rate distortion optimal, slow
yading@10 3050
yading@10 3051 =item B<zero>
yading@10 3052
yading@10 3053 0
yading@10 3054
yading@10 3055 =item B<vsad>
yading@10 3056
yading@10 3057 sum of absolute vertical differences
yading@10 3058
yading@10 3059 =item B<vsse>
yading@10 3060
yading@10 3061 sum of squared vertical differences
yading@10 3062
yading@10 3063 =item B<nsse>
yading@10 3064
yading@10 3065 noise preserving sum of squared differences
yading@10 3066
yading@10 3067 =item B<w53>
yading@10 3068
yading@10 3069 5/3 wavelet, only used in snow
yading@10 3070
yading@10 3071 =item B<w97>
yading@10 3072
yading@10 3073 9/7 wavelet, only used in snow
yading@10 3074
yading@10 3075 =item B<dctmax>
yading@10 3076
yading@10 3077
yading@10 3078
yading@10 3079 =item B<chroma>
yading@10 3080
yading@10 3081
yading@10 3082
yading@10 3083 =back
yading@10 3084
yading@10 3085
yading@10 3086
yading@10 3087 =item B<mbcmp> I<integer> B<(>I<encoding,video>B<)>
yading@10 3088
yading@10 3089 Set macroblock compare function.
yading@10 3090
yading@10 3091 Possible values:
yading@10 3092
yading@10 3093 =over 4
yading@10 3094
yading@10 3095
yading@10 3096 =item B<sad>
yading@10 3097
yading@10 3098 sum of absolute differences, fast (default)
yading@10 3099
yading@10 3100 =item B<sse>
yading@10 3101
yading@10 3102 sum of squared errors
yading@10 3103
yading@10 3104 =item B<satd>
yading@10 3105
yading@10 3106 sum of absolute Hadamard transformed differences
yading@10 3107
yading@10 3108 =item B<dct>
yading@10 3109
yading@10 3110 sum of absolute DCT transformed differences
yading@10 3111
yading@10 3112 =item B<psnr>
yading@10 3113
yading@10 3114 sum of squared quantization errors (avoid, low quality)
yading@10 3115
yading@10 3116 =item B<bit>
yading@10 3117
yading@10 3118 number of bits needed for the block
yading@10 3119
yading@10 3120 =item B<rd>
yading@10 3121
yading@10 3122 rate distortion optimal, slow
yading@10 3123
yading@10 3124 =item B<zero>
yading@10 3125
yading@10 3126 0
yading@10 3127
yading@10 3128 =item B<vsad>
yading@10 3129
yading@10 3130 sum of absolute vertical differences
yading@10 3131
yading@10 3132 =item B<vsse>
yading@10 3133
yading@10 3134 sum of squared vertical differences
yading@10 3135
yading@10 3136 =item B<nsse>
yading@10 3137
yading@10 3138 noise preserving sum of squared differences
yading@10 3139
yading@10 3140 =item B<w53>
yading@10 3141
yading@10 3142 5/3 wavelet, only used in snow
yading@10 3143
yading@10 3144 =item B<w97>
yading@10 3145
yading@10 3146 9/7 wavelet, only used in snow
yading@10 3147
yading@10 3148 =item B<dctmax>
yading@10 3149
yading@10 3150
yading@10 3151
yading@10 3152 =item B<chroma>
yading@10 3153
yading@10 3154
yading@10 3155
yading@10 3156 =back
yading@10 3157
yading@10 3158
yading@10 3159
yading@10 3160 =item B<ildctcmp> I<integer> B<(>I<encoding,video>B<)>
yading@10 3161
yading@10 3162 Set interlaced dct compare function.
yading@10 3163
yading@10 3164 Possible values:
yading@10 3165
yading@10 3166 =over 4
yading@10 3167
yading@10 3168
yading@10 3169 =item B<sad>
yading@10 3170
yading@10 3171 sum of absolute differences, fast (default)
yading@10 3172
yading@10 3173 =item B<sse>
yading@10 3174
yading@10 3175 sum of squared errors
yading@10 3176
yading@10 3177 =item B<satd>
yading@10 3178
yading@10 3179 sum of absolute Hadamard transformed differences
yading@10 3180
yading@10 3181 =item B<dct>
yading@10 3182
yading@10 3183 sum of absolute DCT transformed differences
yading@10 3184
yading@10 3185 =item B<psnr>
yading@10 3186
yading@10 3187 sum of squared quantization errors (avoid, low quality)
yading@10 3188
yading@10 3189 =item B<bit>
yading@10 3190
yading@10 3191 number of bits needed for the block
yading@10 3192
yading@10 3193 =item B<rd>
yading@10 3194
yading@10 3195 rate distortion optimal, slow
yading@10 3196
yading@10 3197 =item B<zero>
yading@10 3198
yading@10 3199 0
yading@10 3200
yading@10 3201 =item B<vsad>
yading@10 3202
yading@10 3203 sum of absolute vertical differences
yading@10 3204
yading@10 3205 =item B<vsse>
yading@10 3206
yading@10 3207 sum of squared vertical differences
yading@10 3208
yading@10 3209 =item B<nsse>
yading@10 3210
yading@10 3211 noise preserving sum of squared differences
yading@10 3212
yading@10 3213 =item B<w53>
yading@10 3214
yading@10 3215 5/3 wavelet, only used in snow
yading@10 3216
yading@10 3217 =item B<w97>
yading@10 3218
yading@10 3219 9/7 wavelet, only used in snow
yading@10 3220
yading@10 3221 =item B<dctmax>
yading@10 3222
yading@10 3223
yading@10 3224
yading@10 3225 =item B<chroma>
yading@10 3226
yading@10 3227
yading@10 3228
yading@10 3229 =back
yading@10 3230
yading@10 3231
yading@10 3232
yading@10 3233 =item B<dia_size> I<integer> B<(>I<encoding,video>B<)>
yading@10 3234
yading@10 3235 Set diamond type & size for motion estimation.
yading@10 3236
yading@10 3237
yading@10 3238 =item B<last_pred> I<integer> B<(>I<encoding,video>B<)>
yading@10 3239
yading@10 3240 Set amount of motion predictors from the previous frame.
yading@10 3241
yading@10 3242
yading@10 3243 =item B<preme> I<integer> B<(>I<encoding,video>B<)>
yading@10 3244
yading@10 3245 Set pre motion estimation.
yading@10 3246
yading@10 3247
yading@10 3248 =item B<precmp> I<integer> B<(>I<encoding,video>B<)>
yading@10 3249
yading@10 3250 Set pre motion estimation compare function.
yading@10 3251
yading@10 3252 Possible values:
yading@10 3253
yading@10 3254 =over 4
yading@10 3255
yading@10 3256
yading@10 3257 =item B<sad>
yading@10 3258
yading@10 3259 sum of absolute differences, fast (default)
yading@10 3260
yading@10 3261 =item B<sse>
yading@10 3262
yading@10 3263 sum of squared errors
yading@10 3264
yading@10 3265 =item B<satd>
yading@10 3266
yading@10 3267 sum of absolute Hadamard transformed differences
yading@10 3268
yading@10 3269 =item B<dct>
yading@10 3270
yading@10 3271 sum of absolute DCT transformed differences
yading@10 3272
yading@10 3273 =item B<psnr>
yading@10 3274
yading@10 3275 sum of squared quantization errors (avoid, low quality)
yading@10 3276
yading@10 3277 =item B<bit>
yading@10 3278
yading@10 3279 number of bits needed for the block
yading@10 3280
yading@10 3281 =item B<rd>
yading@10 3282
yading@10 3283 rate distortion optimal, slow
yading@10 3284
yading@10 3285 =item B<zero>
yading@10 3286
yading@10 3287 0
yading@10 3288
yading@10 3289 =item B<vsad>
yading@10 3290
yading@10 3291 sum of absolute vertical differences
yading@10 3292
yading@10 3293 =item B<vsse>
yading@10 3294
yading@10 3295 sum of squared vertical differences
yading@10 3296
yading@10 3297 =item B<nsse>
yading@10 3298
yading@10 3299 noise preserving sum of squared differences
yading@10 3300
yading@10 3301 =item B<w53>
yading@10 3302
yading@10 3303 5/3 wavelet, only used in snow
yading@10 3304
yading@10 3305 =item B<w97>
yading@10 3306
yading@10 3307 9/7 wavelet, only used in snow
yading@10 3308
yading@10 3309 =item B<dctmax>
yading@10 3310
yading@10 3311
yading@10 3312
yading@10 3313 =item B<chroma>
yading@10 3314
yading@10 3315
yading@10 3316
yading@10 3317 =back
yading@10 3318
yading@10 3319
yading@10 3320
yading@10 3321 =item B<pre_dia_size> I<integer> B<(>I<encoding,video>B<)>
yading@10 3322
yading@10 3323 Set diamond type & size for motion estimation pre-pass.
yading@10 3324
yading@10 3325
yading@10 3326 =item B<subq> I<integer> B<(>I<encoding,video>B<)>
yading@10 3327
yading@10 3328 Set sub pel motion estimation quality.
yading@10 3329
yading@10 3330
yading@10 3331 =item B<dtg_active_format> I<integer>
yading@10 3332
yading@10 3333
yading@10 3334
yading@10 3335 =item B<me_range> I<integer> B<(>I<encoding,video>B<)>
yading@10 3336
yading@10 3337 Set limit motion vectors range (1023 for DivX player).
yading@10 3338
yading@10 3339
yading@10 3340 =item B<ibias> I<integer> B<(>I<encoding,video>B<)>
yading@10 3341
yading@10 3342 Set intra quant bias.
yading@10 3343
yading@10 3344
yading@10 3345 =item B<pbias> I<integer> B<(>I<encoding,video>B<)>
yading@10 3346
yading@10 3347 Set inter quant bias.
yading@10 3348
yading@10 3349
yading@10 3350 =item B<color_table_id> I<integer>
yading@10 3351
yading@10 3352
yading@10 3353
yading@10 3354 =item B<global_quality> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 3355
yading@10 3356
yading@10 3357
yading@10 3358 =item B<coder> I<integer> B<(>I<encoding,video>B<)>
yading@10 3359
yading@10 3360
yading@10 3361 Possible values:
yading@10 3362
yading@10 3363 =over 4
yading@10 3364
yading@10 3365
yading@10 3366 =item B<vlc>
yading@10 3367
yading@10 3368 variable length coder / huffman coder
yading@10 3369
yading@10 3370 =item B<ac>
yading@10 3371
yading@10 3372 arithmetic coder
yading@10 3373
yading@10 3374 =item B<raw>
yading@10 3375
yading@10 3376 raw (no encoding)
yading@10 3377
yading@10 3378 =item B<rle>
yading@10 3379
yading@10 3380 run-length coder
yading@10 3381
yading@10 3382 =item B<deflate>
yading@10 3383
yading@10 3384 deflate-based coder
yading@10 3385
yading@10 3386 =back
yading@10 3387
yading@10 3388
yading@10 3389
yading@10 3390 =item B<context> I<integer> B<(>I<encoding,video>B<)>
yading@10 3391
yading@10 3392 Set context model.
yading@10 3393
yading@10 3394
yading@10 3395 =item B<slice_flags> I<integer>
yading@10 3396
yading@10 3397
yading@10 3398
yading@10 3399 =item B<xvmc_acceleration> I<integer>
yading@10 3400
yading@10 3401
yading@10 3402
yading@10 3403 =item B<mbd> I<integer> B<(>I<encoding,video>B<)>
yading@10 3404
yading@10 3405 Set macroblock decision algorithm (high quality mode).
yading@10 3406
yading@10 3407 Possible values:
yading@10 3408
yading@10 3409 =over 4
yading@10 3410
yading@10 3411
yading@10 3412 =item B<simple>
yading@10 3413
yading@10 3414 use mbcmp (default)
yading@10 3415
yading@10 3416 =item B<bits>
yading@10 3417
yading@10 3418 use fewest bits
yading@10 3419
yading@10 3420 =item B<rd>
yading@10 3421
yading@10 3422 use best rate distortion
yading@10 3423
yading@10 3424 =back
yading@10 3425
yading@10 3426
yading@10 3427
yading@10 3428 =item B<stream_codec_tag> I<integer>
yading@10 3429
yading@10 3430
yading@10 3431
yading@10 3432 =item B<sc_threshold> I<integer> B<(>I<encoding,video>B<)>
yading@10 3433
yading@10 3434 Set scene change threshold.
yading@10 3435
yading@10 3436
yading@10 3437 =item B<lmin> I<integer> B<(>I<encoding,video>B<)>
yading@10 3438
yading@10 3439 Set min lagrange factor (VBR).
yading@10 3440
yading@10 3441
yading@10 3442 =item B<lmax> I<integer> B<(>I<encoding,video>B<)>
yading@10 3443
yading@10 3444 Set max lagrange factor (VBR).
yading@10 3445
yading@10 3446
yading@10 3447 =item B<nr> I<integer> B<(>I<encoding,video>B<)>
yading@10 3448
yading@10 3449 Set noise reduction.
yading@10 3450
yading@10 3451
yading@10 3452 =item B<rc_init_occupancy> I<integer> B<(>I<encoding,video>B<)>
yading@10 3453
yading@10 3454 Set number of bits which should be loaded into the rc buffer before
yading@10 3455 decoding starts.
yading@10 3456
yading@10 3457
yading@10 3458 =item B<inter_threshold> I<integer> B<(>I<encoding,video>B<)>
yading@10 3459
yading@10 3460
yading@10 3461
yading@10 3462 =item B<flags2> I<flags> B<(>I<decoding/encoding,audio,video>B<)>
yading@10 3463
yading@10 3464
yading@10 3465 Possible values:
yading@10 3466
yading@10 3467 =over 4
yading@10 3468
yading@10 3469
yading@10 3470 =item B<fast>
yading@10 3471
yading@10 3472 allow non spec compliant speedup tricks
yading@10 3473
yading@10 3474 =item B<sgop>
yading@10 3475
yading@10 3476 Deprecated, use mpegvideo private options instead
yading@10 3477
yading@10 3478 =item B<noout>
yading@10 3479
yading@10 3480 skip bitstream encoding
yading@10 3481
yading@10 3482 =item B<local_header>
yading@10 3483
yading@10 3484 place global headers at every keyframe instead of in extradata
yading@10 3485
yading@10 3486 =item B<chunks>
yading@10 3487
yading@10 3488 Frame data might be split into multiple chunks
yading@10 3489
yading@10 3490 =item B<showall>
yading@10 3491
yading@10 3492 Show all frames before the first keyframe
yading@10 3493
yading@10 3494 =item B<skiprd>
yading@10 3495
yading@10 3496 Deprecated, use mpegvideo private options instead
yading@10 3497
yading@10 3498 =back
yading@10 3499
yading@10 3500
yading@10 3501
yading@10 3502 =item B<error> I<integer> B<(>I<encoding,video>B<)>
yading@10 3503
yading@10 3504
yading@10 3505
yading@10 3506 =item B<qns> I<integer> B<(>I<encoding,video>B<)>
yading@10 3507
yading@10 3508 Deprecated, use mpegvideo private options instead.
yading@10 3509
yading@10 3510
yading@10 3511 =item B<threads> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 3512
yading@10 3513
yading@10 3514 Possible values:
yading@10 3515
yading@10 3516 =over 4
yading@10 3517
yading@10 3518
yading@10 3519 =item B<auto>
yading@10 3520
yading@10 3521 detect a good number of threads
yading@10 3522
yading@10 3523 =back
yading@10 3524
yading@10 3525
yading@10 3526
yading@10 3527 =item B<me_threshold> I<integer> B<(>I<encoding,video>B<)>
yading@10 3528
yading@10 3529 Set motion estimation threshold.
yading@10 3530
yading@10 3531
yading@10 3532 =item B<mb_threshold> I<integer> B<(>I<encoding,video>B<)>
yading@10 3533
yading@10 3534 Set macroblock threshold.
yading@10 3535
yading@10 3536
yading@10 3537 =item B<dc> I<integer> B<(>I<encoding,video>B<)>
yading@10 3538
yading@10 3539 Set intra_dc_precision.
yading@10 3540
yading@10 3541
yading@10 3542 =item B<nssew> I<integer> B<(>I<encoding,video>B<)>
yading@10 3543
yading@10 3544 Set nsse weight.
yading@10 3545
yading@10 3546
yading@10 3547 =item B<skip_top> I<integer> B<(>I<decoding,video>B<)>
yading@10 3548
yading@10 3549 Set number of macroblock rows at the top which are skipped.
yading@10 3550
yading@10 3551
yading@10 3552 =item B<skip_bottom> I<integer> B<(>I<decoding,video>B<)>
yading@10 3553
yading@10 3554 Set number of macroblock rows at the bottom which are skipped.
yading@10 3555
yading@10 3556
yading@10 3557 =item B<profile> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 3558
yading@10 3559
yading@10 3560 Possible values:
yading@10 3561
yading@10 3562 =over 4
yading@10 3563
yading@10 3564
yading@10 3565 =item B<unknown>
yading@10 3566
yading@10 3567
yading@10 3568
yading@10 3569 =item B<aac_main>
yading@10 3570
yading@10 3571
yading@10 3572
yading@10 3573 =item B<aac_low>
yading@10 3574
yading@10 3575
yading@10 3576
yading@10 3577 =item B<aac_ssr>
yading@10 3578
yading@10 3579
yading@10 3580
yading@10 3581 =item B<aac_ltp>
yading@10 3582
yading@10 3583
yading@10 3584
yading@10 3585 =item B<aac_he>
yading@10 3586
yading@10 3587
yading@10 3588
yading@10 3589 =item B<aac_he_v2>
yading@10 3590
yading@10 3591
yading@10 3592
yading@10 3593 =item B<aac_ld>
yading@10 3594
yading@10 3595
yading@10 3596
yading@10 3597 =item B<aac_eld>
yading@10 3598
yading@10 3599
yading@10 3600
yading@10 3601 =item B<dts>
yading@10 3602
yading@10 3603
yading@10 3604
yading@10 3605 =item B<dts_es>
yading@10 3606
yading@10 3607
yading@10 3608
yading@10 3609 =item B<dts_96_24>
yading@10 3610
yading@10 3611
yading@10 3612
yading@10 3613 =item B<dts_hd_hra>
yading@10 3614
yading@10 3615
yading@10 3616
yading@10 3617 =item B<dts_hd_ma>
yading@10 3618
yading@10 3619
yading@10 3620
yading@10 3621 =back
yading@10 3622
yading@10 3623
yading@10 3624
yading@10 3625 =item B<level> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 3626
yading@10 3627
yading@10 3628 Possible values:
yading@10 3629
yading@10 3630 =over 4
yading@10 3631
yading@10 3632
yading@10 3633 =item B<unknown>
yading@10 3634
yading@10 3635
yading@10 3636
yading@10 3637 =back
yading@10 3638
yading@10 3639
yading@10 3640
yading@10 3641 =item B<lowres> I<integer> B<(>I<decoding,audio,video>B<)>
yading@10 3642
yading@10 3643 Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
yading@10 3644
yading@10 3645
yading@10 3646 =item B<skip_threshold> I<integer> B<(>I<encoding,video>B<)>
yading@10 3647
yading@10 3648 Set frame skip threshold.
yading@10 3649
yading@10 3650
yading@10 3651 =item B<skip_factor> I<integer> B<(>I<encoding,video>B<)>
yading@10 3652
yading@10 3653 Set frame skip factor.
yading@10 3654
yading@10 3655
yading@10 3656 =item B<skip_exp> I<integer> B<(>I<encoding,video>B<)>
yading@10 3657
yading@10 3658 Set frame skip exponent.
yading@10 3659
yading@10 3660
yading@10 3661 =item B<skipcmp> I<integer> B<(>I<encoding,video>B<)>
yading@10 3662
yading@10 3663 Set frame skip compare function.
yading@10 3664
yading@10 3665 Possible values:
yading@10 3666
yading@10 3667 =over 4
yading@10 3668
yading@10 3669
yading@10 3670 =item B<sad>
yading@10 3671
yading@10 3672 sum of absolute differences, fast (default)
yading@10 3673
yading@10 3674 =item B<sse>
yading@10 3675
yading@10 3676 sum of squared errors
yading@10 3677
yading@10 3678 =item B<satd>
yading@10 3679
yading@10 3680 sum of absolute Hadamard transformed differences
yading@10 3681
yading@10 3682 =item B<dct>
yading@10 3683
yading@10 3684 sum of absolute DCT transformed differences
yading@10 3685
yading@10 3686 =item B<psnr>
yading@10 3687
yading@10 3688 sum of squared quantization errors (avoid, low quality)
yading@10 3689
yading@10 3690 =item B<bit>
yading@10 3691
yading@10 3692 number of bits needed for the block
yading@10 3693
yading@10 3694 =item B<rd>
yading@10 3695
yading@10 3696 rate distortion optimal, slow
yading@10 3697
yading@10 3698 =item B<zero>
yading@10 3699
yading@10 3700 0
yading@10 3701
yading@10 3702 =item B<vsad>
yading@10 3703
yading@10 3704 sum of absolute vertical differences
yading@10 3705
yading@10 3706 =item B<vsse>
yading@10 3707
yading@10 3708 sum of squared vertical differences
yading@10 3709
yading@10 3710 =item B<nsse>
yading@10 3711
yading@10 3712 noise preserving sum of squared differences
yading@10 3713
yading@10 3714 =item B<w53>
yading@10 3715
yading@10 3716 5/3 wavelet, only used in snow
yading@10 3717
yading@10 3718 =item B<w97>
yading@10 3719
yading@10 3720 9/7 wavelet, only used in snow
yading@10 3721
yading@10 3722 =item B<dctmax>
yading@10 3723
yading@10 3724
yading@10 3725
yading@10 3726 =item B<chroma>
yading@10 3727
yading@10 3728
yading@10 3729
yading@10 3730 =back
yading@10 3731
yading@10 3732
yading@10 3733
yading@10 3734 =item B<border_mask> I<float> B<(>I<encoding,video>B<)>
yading@10 3735
yading@10 3736 Increase the quantizer for macroblocks close to borders.
yading@10 3737
yading@10 3738
yading@10 3739 =item B<mblmin> I<integer> B<(>I<encoding,video>B<)>
yading@10 3740
yading@10 3741 Set min macroblock lagrange factor (VBR).
yading@10 3742
yading@10 3743
yading@10 3744 =item B<mblmax> I<integer> B<(>I<encoding,video>B<)>
yading@10 3745
yading@10 3746 Set max macroblock lagrange factor (VBR).
yading@10 3747
yading@10 3748
yading@10 3749 =item B<mepc> I<integer> B<(>I<encoding,video>B<)>
yading@10 3750
yading@10 3751 Set motion estimation bitrate penalty compensation (1.0 = 256).
yading@10 3752
yading@10 3753
yading@10 3754 =item B<skip_loop_filter> I<integer> B<(>I<decoding,video>B<)>
yading@10 3755
yading@10 3756
yading@10 3757 =item B<skip_idct> I<integer> B<(>I<decoding,video>B<)>
yading@10 3758
yading@10 3759
yading@10 3760 =item B<skip_frame> I<integer> B<(>I<decoding,video>B<)>
yading@10 3761
yading@10 3762
yading@10 3763 Make decoder discard processing depending on the frame type selected
yading@10 3764 by the option value.
yading@10 3765
yading@10 3766 B<skip_loop_filter> skips frame loop filtering, B<skip_idct>
yading@10 3767 skips frame IDCT/dequantization, B<skip_frame> skips decoding.
yading@10 3768
yading@10 3769 Possible values:
yading@10 3770
yading@10 3771 =over 4
yading@10 3772
yading@10 3773
yading@10 3774 =item B<none>
yading@10 3775
yading@10 3776 Discard no frame.
yading@10 3777
yading@10 3778
yading@10 3779 =item B<default>
yading@10 3780
yading@10 3781 Discard useless frames like 0-sized frames.
yading@10 3782
yading@10 3783
yading@10 3784 =item B<noref>
yading@10 3785
yading@10 3786 Discard all non-reference frames.
yading@10 3787
yading@10 3788
yading@10 3789 =item B<bidir>
yading@10 3790
yading@10 3791 Discard all bidirectional frames.
yading@10 3792
yading@10 3793
yading@10 3794 =item B<nokey>
yading@10 3795
yading@10 3796 Discard all frames excepts keyframes.
yading@10 3797
yading@10 3798
yading@10 3799 =item B<all>
yading@10 3800
yading@10 3801 Discard all frames.
yading@10 3802
yading@10 3803 =back
yading@10 3804
yading@10 3805
yading@10 3806 Default value is B<default>.
yading@10 3807
yading@10 3808
yading@10 3809 =item B<bidir_refine> I<integer> B<(>I<encoding,video>B<)>
yading@10 3810
yading@10 3811 Refine the two motion vectors used in bidirectional macroblocks.
yading@10 3812
yading@10 3813
yading@10 3814 =item B<brd_scale> I<integer> B<(>I<encoding,video>B<)>
yading@10 3815
yading@10 3816 Downscale frames for dynamic B-frame decision.
yading@10 3817
yading@10 3818
yading@10 3819 =item B<keyint_min> I<integer> B<(>I<encoding,video>B<)>
yading@10 3820
yading@10 3821 Set minimum interval between IDR-frames.
yading@10 3822
yading@10 3823
yading@10 3824 =item B<refs> I<integer> B<(>I<encoding,video>B<)>
yading@10 3825
yading@10 3826 Set reference frames to consider for motion compensation.
yading@10 3827
yading@10 3828
yading@10 3829 =item B<chromaoffset> I<integer> B<(>I<encoding,video>B<)>
yading@10 3830
yading@10 3831 Set chroma qp offset from luma.
yading@10 3832
yading@10 3833
yading@10 3834 =item B<trellis> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 3835
yading@10 3836 Set rate-distortion optimal quantization.
yading@10 3837
yading@10 3838
yading@10 3839 =item B<sc_factor> I<integer> B<(>I<encoding,video>B<)>
yading@10 3840
yading@10 3841 Set value multiplied by qscale for each frame and added to
yading@10 3842 scene_change_score.
yading@10 3843
yading@10 3844
yading@10 3845 =item B<mv0_threshold> I<integer> B<(>I<encoding,video>B<)>
yading@10 3846
yading@10 3847
yading@10 3848 =item B<b_sensitivity> I<integer> B<(>I<encoding,video>B<)>
yading@10 3849
yading@10 3850 Adjust sensitivity of b_frame_strategy 1.
yading@10 3851
yading@10 3852
yading@10 3853 =item B<compression_level> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 3854
yading@10 3855
yading@10 3856 =item B<min_prediction_order> I<integer> B<(>I<encoding,audio>B<)>
yading@10 3857
yading@10 3858
yading@10 3859 =item B<max_prediction_order> I<integer> B<(>I<encoding,audio>B<)>
yading@10 3860
yading@10 3861
yading@10 3862 =item B<timecode_frame_start> I<integer> B<(>I<encoding,video>B<)>
yading@10 3863
yading@10 3864 Set GOP timecode frame start number, in non drop frame format.
yading@10 3865
yading@10 3866
yading@10 3867 =item B<request_channels> I<integer> B<(>I<decoding,audio>B<)>
yading@10 3868
yading@10 3869 Set desired number of audio channels.
yading@10 3870
yading@10 3871
yading@10 3872 =item B<bits_per_raw_sample> I<integer>
yading@10 3873
yading@10 3874
yading@10 3875 =item B<channel_layout> I<integer> B<(>I<decoding/encoding,audio>B<)>
yading@10 3876
yading@10 3877
yading@10 3878 Possible values:
yading@10 3879
yading@10 3880 =over 4
yading@10 3881
yading@10 3882
yading@10 3883 =back
yading@10 3884
yading@10 3885
yading@10 3886 =item B<request_channel_layout> I<integer> B<(>I<decoding,audio>B<)>
yading@10 3887
yading@10 3888
yading@10 3889 Possible values:
yading@10 3890
yading@10 3891 =over 4
yading@10 3892
yading@10 3893
yading@10 3894 =back
yading@10 3895
yading@10 3896
yading@10 3897 =item B<rc_max_vbv_use> I<float> B<(>I<encoding,video>B<)>
yading@10 3898
yading@10 3899
yading@10 3900 =item B<rc_min_vbv_use> I<float> B<(>I<encoding,video>B<)>
yading@10 3901
yading@10 3902
yading@10 3903 =item B<ticks_per_frame> I<integer> B<(>I<decoding/encoding,audio,video>B<)>
yading@10 3904
yading@10 3905
yading@10 3906 =item B<color_primaries> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 3907
yading@10 3908
yading@10 3909 =item B<color_trc> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 3910
yading@10 3911
yading@10 3912 =item B<colorspace> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 3913
yading@10 3914
yading@10 3915 =item B<color_range> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 3916
yading@10 3917
yading@10 3918 =item B<chroma_sample_location> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 3919
yading@10 3920
yading@10 3921
yading@10 3922 =item B<log_level_offset> I<integer>
yading@10 3923
yading@10 3924 Set the log level offset.
yading@10 3925
yading@10 3926
yading@10 3927 =item B<slices> I<integer> B<(>I<encoding,video>B<)>
yading@10 3928
yading@10 3929 Number of slices, used in parallelized encoding.
yading@10 3930
yading@10 3931
yading@10 3932 =item B<thread_type> I<flags> B<(>I<decoding/encoding,video>B<)>
yading@10 3933
yading@10 3934 Select multithreading type.
yading@10 3935
yading@10 3936 Possible values:
yading@10 3937
yading@10 3938 =over 4
yading@10 3939
yading@10 3940
yading@10 3941 =item B<slice>
yading@10 3942
yading@10 3943
yading@10 3944
yading@10 3945 =item B<frame>
yading@10 3946
yading@10 3947
yading@10 3948
yading@10 3949 =back
yading@10 3950
yading@10 3951
yading@10 3952 =item B<audio_service_type> I<integer> B<(>I<encoding,audio>B<)>
yading@10 3953
yading@10 3954 Set audio service type.
yading@10 3955
yading@10 3956 Possible values:
yading@10 3957
yading@10 3958 =over 4
yading@10 3959
yading@10 3960
yading@10 3961 =item B<ma>
yading@10 3962
yading@10 3963 Main Audio Service
yading@10 3964
yading@10 3965 =item B<ef>
yading@10 3966
yading@10 3967 Effects
yading@10 3968
yading@10 3969 =item B<vi>
yading@10 3970
yading@10 3971 Visually Impaired
yading@10 3972
yading@10 3973 =item B<hi>
yading@10 3974
yading@10 3975 Hearing Impaired
yading@10 3976
yading@10 3977 =item B<di>
yading@10 3978
yading@10 3979 Dialogue
yading@10 3980
yading@10 3981 =item B<co>
yading@10 3982
yading@10 3983 Commentary
yading@10 3984
yading@10 3985 =item B<em>
yading@10 3986
yading@10 3987 Emergency
yading@10 3988
yading@10 3989 =item B<vo>
yading@10 3990
yading@10 3991 Voice Over
yading@10 3992
yading@10 3993 =item B<ka>
yading@10 3994
yading@10 3995 Karaoke
yading@10 3996
yading@10 3997 =back
yading@10 3998
yading@10 3999
yading@10 4000
yading@10 4001 =item B<request_sample_fmt> I<sample_fmt> B<(>I<decoding,audio>B<)>
yading@10 4002
yading@10 4003 Set sample format audio decoders should prefer. Default value is
yading@10 4004 C<none>.
yading@10 4005
yading@10 4006
yading@10 4007 =item B<pkt_timebase> I<rational number>
yading@10 4008
yading@10 4009
yading@10 4010
yading@10 4011 =item B<sub_charenc> I<encoding> B<(>I<decoding,subtitles>B<)>
yading@10 4012
yading@10 4013 Set the input subtitles character encoding.
yading@10 4014
yading@10 4015 =back
yading@10 4016
yading@10 4017
yading@10 4018
yading@10 4019
yading@10 4020 =head1 DECODERS
yading@10 4021
yading@10 4022
yading@10 4023 Decoders are configured elements in FFmpeg which allow the decoding of
yading@10 4024 multimedia streams.
yading@10 4025
yading@10 4026 When you configure your FFmpeg build, all the supported native decoders
yading@10 4027 are enabled by default. Decoders requiring an external library must be enabled
yading@10 4028 manually via the corresponding C<--enable-lib> option. You can list all
yading@10 4029 available decoders using the configure option C<--list-decoders>.
yading@10 4030
yading@10 4031 You can disable all the decoders with the configure option
yading@10 4032 C<--disable-decoders> and selectively enable / disable single decoders
yading@10 4033 with the options C<--enable-decoder=I<DECODER>> /
yading@10 4034 C<--disable-decoder=I<DECODER>>.
yading@10 4035
yading@10 4036 The option C<-codecs> of the ff* tools will display the list of
yading@10 4037 enabled decoders.
yading@10 4038
yading@10 4039
yading@10 4040
yading@10 4041 =head1 VIDEO DECODERS
yading@10 4042
yading@10 4043
yading@10 4044 A description of some of the currently available video decoders
yading@10 4045 follows.
yading@10 4046
yading@10 4047
yading@10 4048 =head2 rawvideo
yading@10 4049
yading@10 4050
yading@10 4051 Raw video decoder.
yading@10 4052
yading@10 4053 This decoder decodes rawvideo streams.
yading@10 4054
yading@10 4055
yading@10 4056 =head3 Options
yading@10 4057
yading@10 4058
yading@10 4059
yading@10 4060 =over 4
yading@10 4061
yading@10 4062
yading@10 4063 =item B<top> I<top_field_first>
yading@10 4064
yading@10 4065 Specify the assumed field type of the input video.
yading@10 4066
yading@10 4067 =over 4
yading@10 4068
yading@10 4069
yading@10 4070 =item B<-1>
yading@10 4071
yading@10 4072 the video is assumed to be progressive (default)
yading@10 4073
yading@10 4074 =item B<0>
yading@10 4075
yading@10 4076 bottom-field-first is assumed
yading@10 4077
yading@10 4078 =item B<1>
yading@10 4079
yading@10 4080 top-field-first is assumed
yading@10 4081
yading@10 4082 =back
yading@10 4083
yading@10 4084
yading@10 4085
yading@10 4086 =back
yading@10 4087
yading@10 4088
yading@10 4089
yading@10 4090
yading@10 4091 =head1 AUDIO DECODERS
yading@10 4092
yading@10 4093
yading@10 4094
yading@10 4095 =head2 ffwavesynth
yading@10 4096
yading@10 4097
yading@10 4098 Internal wave synthetizer.
yading@10 4099
yading@10 4100 This decoder generates wave patterns according to predefined sequences. Its
yading@10 4101 use is purely internal and the format of the data it accepts is not publicly
yading@10 4102 documented.
yading@10 4103
yading@10 4104
yading@10 4105
yading@10 4106 =head1 SUBTITLES DECODERS
yading@10 4107
yading@10 4108
yading@10 4109
yading@10 4110 =head2 dvdsub
yading@10 4111
yading@10 4112
yading@10 4113 This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
yading@10 4114 also be found in VobSub file pairs and in some Matroska files.
yading@10 4115
yading@10 4116
yading@10 4117 =head3 Options
yading@10 4118
yading@10 4119
yading@10 4120
yading@10 4121 =over 4
yading@10 4122
yading@10 4123
yading@10 4124 =item B<palette>
yading@10 4125
yading@10 4126 Specify the global palette used by the bitmaps. When stored in VobSub, the
yading@10 4127 palette is normally specified in the index file; in Matroska, the palette is
yading@10 4128 stored in the codec extra-data in the same format as in VobSub. In DVDs, the
yading@10 4129 palette is stored in the IFO file, and therefore not available when reading
yading@10 4130 from dumped VOB files.
yading@10 4131
yading@10 4132 The format for this option is a string containing 16 24-bits hexadecimal
yading@10 4133 numbers (without 0x prefix) separated by comas, for example C<0d00ee,
yading@10 4134 ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
yading@10 4135 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b>.
yading@10 4136
yading@10 4137 =back
yading@10 4138
yading@10 4139
yading@10 4140
yading@10 4141 =head1 ENCODERS
yading@10 4142
yading@10 4143
yading@10 4144 Encoders are configured elements in FFmpeg which allow the encoding of
yading@10 4145 multimedia streams.
yading@10 4146
yading@10 4147 When you configure your FFmpeg build, all the supported native encoders
yading@10 4148 are enabled by default. Encoders requiring an external library must be enabled
yading@10 4149 manually via the corresponding C<--enable-lib> option. You can list all
yading@10 4150 available encoders using the configure option C<--list-encoders>.
yading@10 4151
yading@10 4152 You can disable all the encoders with the configure option
yading@10 4153 C<--disable-encoders> and selectively enable / disable single encoders
yading@10 4154 with the options C<--enable-encoder=I<ENCODER>> /
yading@10 4155 C<--disable-encoder=I<ENCODER>>.
yading@10 4156
yading@10 4157 The option C<-codecs> of the ff* tools will display the list of
yading@10 4158 enabled encoders.
yading@10 4159
yading@10 4160
yading@10 4161
yading@10 4162 =head1 AUDIO ENCODERS
yading@10 4163
yading@10 4164
yading@10 4165 A description of some of the currently available audio encoders
yading@10 4166 follows.
yading@10 4167
yading@10 4168
yading@10 4169 =head2 ac3 and ac3_fixed
yading@10 4170
yading@10 4171
yading@10 4172 AC-3 audio encoders.
yading@10 4173
yading@10 4174 These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
yading@10 4175 the undocumented RealAudio 3 (a.k.a. dnet).
yading@10 4176
yading@10 4177 The I<ac3> encoder uses floating-point math, while the I<ac3_fixed>
yading@10 4178 encoder only uses fixed-point integer math. This does not mean that one is
yading@10 4179 always faster, just that one or the other may be better suited to a
yading@10 4180 particular system. The floating-point encoder will generally produce better
yading@10 4181 quality audio for a given bitrate. The I<ac3_fixed> encoder is not the
yading@10 4182 default codec for any of the output formats, so it must be specified explicitly
yading@10 4183 using the option C<-acodec ac3_fixed> in order to use it.
yading@10 4184
yading@10 4185
yading@10 4186 =head3 AC-3 Metadata
yading@10 4187
yading@10 4188
yading@10 4189 The AC-3 metadata options are used to set parameters that describe the audio,
yading@10 4190 but in most cases do not affect the audio encoding itself. Some of the options
yading@10 4191 do directly affect or influence the decoding and playback of the resulting
yading@10 4192 bitstream, while others are just for informational purposes. A few of the
yading@10 4193 options will add bits to the output stream that could otherwise be used for
yading@10 4194 audio data, and will thus affect the quality of the output. Those will be
yading@10 4195 indicated accordingly with a note in the option list below.
yading@10 4196
yading@10 4197 These parameters are described in detail in several publicly-available
yading@10 4198 documents.
yading@10 4199
yading@10 4200 =over 4
yading@10 4201
yading@10 4202
yading@10 4203 =item *<E<lt>B<http://www.atsc.org/cms/standards/a_52-2010.pdf>E<gt>>
yading@10 4204
yading@10 4205
yading@10 4206 =item *<E<lt>B<http://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf>E<gt>>
yading@10 4207
yading@10 4208
yading@10 4209 =item *<E<lt>B<http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf>E<gt>>
yading@10 4210
yading@10 4211
yading@10 4212 =item *<E<lt>B<http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf>E<gt>>
yading@10 4213
yading@10 4214
yading@10 4215 =back
yading@10 4216
yading@10 4217
yading@10 4218
yading@10 4219 =head4 Metadata Control Options
yading@10 4220
yading@10 4221
yading@10 4222
yading@10 4223 =over 4
yading@10 4224
yading@10 4225
yading@10 4226
yading@10 4227 =item B<-per_frame_metadata> I<boolean>
yading@10 4228
yading@10 4229 Allow Per-Frame Metadata. Specifies if the encoder should check for changing
yading@10 4230 metadata for each frame.
yading@10 4231
yading@10 4232 =over 4
yading@10 4233
yading@10 4234
yading@10 4235 =item B<0>
yading@10 4236
yading@10 4237 The metadata values set at initialization will be used for every frame in the
yading@10 4238 stream. (default)
yading@10 4239
yading@10 4240 =item B<1>
yading@10 4241
yading@10 4242 Metadata values can be changed before encoding each frame.
yading@10 4243
yading@10 4244 =back
yading@10 4245
yading@10 4246
yading@10 4247
yading@10 4248 =back
yading@10 4249
yading@10 4250
yading@10 4251
yading@10 4252 =head4 Downmix Levels
yading@10 4253
yading@10 4254
yading@10 4255
yading@10 4256 =over 4
yading@10 4257
yading@10 4258
yading@10 4259
yading@10 4260 =item B<-center_mixlev> I<level>
yading@10 4261
yading@10 4262 Center Mix Level. The amount of gain the decoder should apply to the center
yading@10 4263 channel when downmixing to stereo. This field will only be written to the
yading@10 4264 bitstream if a center channel is present. The value is specified as a scale
yading@10 4265 factor. There are 3 valid values:
yading@10 4266
yading@10 4267 =over 4
yading@10 4268
yading@10 4269
yading@10 4270 =item B<0.707>
yading@10 4271
yading@10 4272 Apply -3dB gain
yading@10 4273
yading@10 4274 =item B<0.595>
yading@10 4275
yading@10 4276 Apply -4.5dB gain (default)
yading@10 4277
yading@10 4278 =item B<0.500>
yading@10 4279
yading@10 4280 Apply -6dB gain
yading@10 4281
yading@10 4282 =back
yading@10 4283
yading@10 4284
yading@10 4285
yading@10 4286 =item B<-surround_mixlev> I<level>
yading@10 4287
yading@10 4288 Surround Mix Level. The amount of gain the decoder should apply to the surround
yading@10 4289 channel(s) when downmixing to stereo. This field will only be written to the
yading@10 4290 bitstream if one or more surround channels are present. The value is specified
yading@10 4291 as a scale factor. There are 3 valid values:
yading@10 4292
yading@10 4293 =over 4
yading@10 4294
yading@10 4295
yading@10 4296 =item B<0.707>
yading@10 4297
yading@10 4298 Apply -3dB gain
yading@10 4299
yading@10 4300 =item B<0.500>
yading@10 4301
yading@10 4302 Apply -6dB gain (default)
yading@10 4303
yading@10 4304 =item B<0.000>
yading@10 4305
yading@10 4306 Silence Surround Channel(s)
yading@10 4307
yading@10 4308 =back
yading@10 4309
yading@10 4310
yading@10 4311
yading@10 4312 =back
yading@10 4313
yading@10 4314
yading@10 4315
yading@10 4316 =head4 Audio Production Information
yading@10 4317
yading@10 4318 Audio Production Information is optional information describing the mixing
yading@10 4319 environment. Either none or both of the fields are written to the bitstream.
yading@10 4320
yading@10 4321
yading@10 4322 =over 4
yading@10 4323
yading@10 4324
yading@10 4325
yading@10 4326 =item B<-mixing_level> I<number>
yading@10 4327
yading@10 4328 Mixing Level. Specifies peak sound pressure level (SPL) in the production
yading@10 4329 environment when the mix was mastered. Valid values are 80 to 111, or -1 for
yading@10 4330 unknown or not indicated. The default value is -1, but that value cannot be
yading@10 4331 used if the Audio Production Information is written to the bitstream. Therefore,
yading@10 4332 if the C<room_type> option is not the default value, the C<mixing_level>
yading@10 4333 option must not be -1.
yading@10 4334
yading@10 4335
yading@10 4336 =item B<-room_type> I<type>
yading@10 4337
yading@10 4338 Room Type. Describes the equalization used during the final mixing session at
yading@10 4339 the studio or on the dubbing stage. A large room is a dubbing stage with the
yading@10 4340 industry standard X-curve equalization; a small room has flat equalization.
yading@10 4341 This field will not be written to the bitstream if both the C<mixing_level>
yading@10 4342 option and the C<room_type> option have the default values.
yading@10 4343
yading@10 4344 =over 4
yading@10 4345
yading@10 4346
yading@10 4347 =item B<0>
yading@10 4348
yading@10 4349
yading@10 4350 =item B<notindicated>
yading@10 4351
yading@10 4352 Not Indicated (default)
yading@10 4353
yading@10 4354 =item B<1>
yading@10 4355
yading@10 4356
yading@10 4357 =item B<large>
yading@10 4358
yading@10 4359 Large Room
yading@10 4360
yading@10 4361 =item B<2>
yading@10 4362
yading@10 4363
yading@10 4364 =item B<small>
yading@10 4365
yading@10 4366 Small Room
yading@10 4367
yading@10 4368 =back
yading@10 4369
yading@10 4370
yading@10 4371
yading@10 4372 =back
yading@10 4373
yading@10 4374
yading@10 4375
yading@10 4376 =head4 Other Metadata Options
yading@10 4377
yading@10 4378
yading@10 4379
yading@10 4380 =over 4
yading@10 4381
yading@10 4382
yading@10 4383
yading@10 4384 =item B<-copyright> I<boolean>
yading@10 4385
yading@10 4386 Copyright Indicator. Specifies whether a copyright exists for this audio.
yading@10 4387
yading@10 4388 =over 4
yading@10 4389
yading@10 4390
yading@10 4391 =item B<0>
yading@10 4392
yading@10 4393
yading@10 4394 =item B<off>
yading@10 4395
yading@10 4396 No Copyright Exists (default)
yading@10 4397
yading@10 4398 =item B<1>
yading@10 4399
yading@10 4400
yading@10 4401 =item B<on>
yading@10 4402
yading@10 4403 Copyright Exists
yading@10 4404
yading@10 4405 =back
yading@10 4406
yading@10 4407
yading@10 4408
yading@10 4409 =item B<-dialnorm> I<value>
yading@10 4410
yading@10 4411 Dialogue Normalization. Indicates how far the average dialogue level of the
yading@10 4412 program is below digital 100% full scale (0 dBFS). This parameter determines a
yading@10 4413 level shift during audio reproduction that sets the average volume of the
yading@10 4414 dialogue to a preset level. The goal is to match volume level between program
yading@10 4415 sources. A value of -31dB will result in no volume level change, relative to
yading@10 4416 the source volume, during audio reproduction. Valid values are whole numbers in
yading@10 4417 the range -31 to -1, with -31 being the default.
yading@10 4418
yading@10 4419
yading@10 4420 =item B<-dsur_mode> I<mode>
yading@10 4421
yading@10 4422 Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
yading@10 4423 (Pro Logic). This field will only be written to the bitstream if the audio
yading@10 4424 stream is stereo. Using this option does B<NOT> mean the encoder will actually
yading@10 4425 apply Dolby Surround processing.
yading@10 4426
yading@10 4427 =over 4
yading@10 4428
yading@10 4429
yading@10 4430 =item B<0>
yading@10 4431
yading@10 4432
yading@10 4433 =item B<notindicated>
yading@10 4434
yading@10 4435 Not Indicated (default)
yading@10 4436
yading@10 4437 =item B<1>
yading@10 4438
yading@10 4439
yading@10 4440 =item B<off>
yading@10 4441
yading@10 4442 Not Dolby Surround Encoded
yading@10 4443
yading@10 4444 =item B<2>
yading@10 4445
yading@10 4446
yading@10 4447 =item B<on>
yading@10 4448
yading@10 4449 Dolby Surround Encoded
yading@10 4450
yading@10 4451 =back
yading@10 4452
yading@10 4453
yading@10 4454
yading@10 4455 =item B<-original> I<boolean>
yading@10 4456
yading@10 4457 Original Bit Stream Indicator. Specifies whether this audio is from the
yading@10 4458 original source and not a copy.
yading@10 4459
yading@10 4460 =over 4
yading@10 4461
yading@10 4462
yading@10 4463 =item B<0>
yading@10 4464
yading@10 4465
yading@10 4466 =item B<off>
yading@10 4467
yading@10 4468 Not Original Source
yading@10 4469
yading@10 4470 =item B<1>
yading@10 4471
yading@10 4472
yading@10 4473 =item B<on>
yading@10 4474
yading@10 4475 Original Source (default)
yading@10 4476
yading@10 4477 =back
yading@10 4478
yading@10 4479
yading@10 4480
yading@10 4481 =back
yading@10 4482
yading@10 4483
yading@10 4484
yading@10 4485 =head3 Extended Bitstream Information
yading@10 4486
yading@10 4487 The extended bitstream options are part of the Alternate Bit Stream Syntax as
yading@10 4488 specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
yading@10 4489 If any one parameter in a group is specified, all values in that group will be
yading@10 4490 written to the bitstream. Default values are used for those that are written
yading@10 4491 but have not been specified. If the mixing levels are written, the decoder
yading@10 4492 will use these values instead of the ones specified in the C<center_mixlev>
yading@10 4493 and C<surround_mixlev> options if it supports the Alternate Bit Stream
yading@10 4494 Syntax.
yading@10 4495
yading@10 4496
yading@10 4497 =head4 Extended Bitstream Information - Part 1
yading@10 4498
yading@10 4499
yading@10 4500
yading@10 4501 =over 4
yading@10 4502
yading@10 4503
yading@10 4504
yading@10 4505 =item B<-dmix_mode> I<mode>
yading@10 4506
yading@10 4507 Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
yading@10 4508 (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
yading@10 4509
yading@10 4510 =over 4
yading@10 4511
yading@10 4512
yading@10 4513 =item B<0>
yading@10 4514
yading@10 4515
yading@10 4516 =item B<notindicated>
yading@10 4517
yading@10 4518 Not Indicated (default)
yading@10 4519
yading@10 4520 =item B<1>
yading@10 4521
yading@10 4522
yading@10 4523 =item B<ltrt>
yading@10 4524
yading@10 4525 Lt/Rt Downmix Preferred
yading@10 4526
yading@10 4527 =item B<2>
yading@10 4528
yading@10 4529
yading@10 4530 =item B<loro>
yading@10 4531
yading@10 4532 Lo/Ro Downmix Preferred
yading@10 4533
yading@10 4534 =back
yading@10 4535
yading@10 4536
yading@10 4537
yading@10 4538 =item B<-ltrt_cmixlev> I<level>
yading@10 4539
yading@10 4540 Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
yading@10 4541 center channel when downmixing to stereo in Lt/Rt mode.
yading@10 4542
yading@10 4543 =over 4
yading@10 4544
yading@10 4545
yading@10 4546 =item B<1.414>
yading@10 4547
yading@10 4548 Apply +3dB gain
yading@10 4549
yading@10 4550 =item B<1.189>
yading@10 4551
yading@10 4552 Apply +1.5dB gain
yading@10 4553
yading@10 4554 =item B<1.000>
yading@10 4555
yading@10 4556 Apply 0dB gain
yading@10 4557
yading@10 4558 =item B<0.841>
yading@10 4559
yading@10 4560 Apply -1.5dB gain
yading@10 4561
yading@10 4562 =item B<0.707>
yading@10 4563
yading@10 4564 Apply -3.0dB gain
yading@10 4565
yading@10 4566 =item B<0.595>
yading@10 4567
yading@10 4568 Apply -4.5dB gain (default)
yading@10 4569
yading@10 4570 =item B<0.500>
yading@10 4571
yading@10 4572 Apply -6.0dB gain
yading@10 4573
yading@10 4574 =item B<0.000>
yading@10 4575
yading@10 4576 Silence Center Channel
yading@10 4577
yading@10 4578 =back
yading@10 4579
yading@10 4580
yading@10 4581
yading@10 4582 =item B<-ltrt_surmixlev> I<level>
yading@10 4583
yading@10 4584 Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
yading@10 4585 surround channel(s) when downmixing to stereo in Lt/Rt mode.
yading@10 4586
yading@10 4587 =over 4
yading@10 4588
yading@10 4589
yading@10 4590 =item B<0.841>
yading@10 4591
yading@10 4592 Apply -1.5dB gain
yading@10 4593
yading@10 4594 =item B<0.707>
yading@10 4595
yading@10 4596 Apply -3.0dB gain
yading@10 4597
yading@10 4598 =item B<0.595>
yading@10 4599
yading@10 4600 Apply -4.5dB gain
yading@10 4601
yading@10 4602 =item B<0.500>
yading@10 4603
yading@10 4604 Apply -6.0dB gain (default)
yading@10 4605
yading@10 4606 =item B<0.000>
yading@10 4607
yading@10 4608 Silence Surround Channel(s)
yading@10 4609
yading@10 4610 =back
yading@10 4611
yading@10 4612
yading@10 4613
yading@10 4614 =item B<-loro_cmixlev> I<level>
yading@10 4615
yading@10 4616 Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
yading@10 4617 center channel when downmixing to stereo in Lo/Ro mode.
yading@10 4618
yading@10 4619 =over 4
yading@10 4620
yading@10 4621
yading@10 4622 =item B<1.414>
yading@10 4623
yading@10 4624 Apply +3dB gain
yading@10 4625
yading@10 4626 =item B<1.189>
yading@10 4627
yading@10 4628 Apply +1.5dB gain
yading@10 4629
yading@10 4630 =item B<1.000>
yading@10 4631
yading@10 4632 Apply 0dB gain
yading@10 4633
yading@10 4634 =item B<0.841>
yading@10 4635
yading@10 4636 Apply -1.5dB gain
yading@10 4637
yading@10 4638 =item B<0.707>
yading@10 4639
yading@10 4640 Apply -3.0dB gain
yading@10 4641
yading@10 4642 =item B<0.595>
yading@10 4643
yading@10 4644 Apply -4.5dB gain (default)
yading@10 4645
yading@10 4646 =item B<0.500>
yading@10 4647
yading@10 4648 Apply -6.0dB gain
yading@10 4649
yading@10 4650 =item B<0.000>
yading@10 4651
yading@10 4652 Silence Center Channel
yading@10 4653
yading@10 4654 =back
yading@10 4655
yading@10 4656
yading@10 4657
yading@10 4658 =item B<-loro_surmixlev> I<level>
yading@10 4659
yading@10 4660 Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
yading@10 4661 surround channel(s) when downmixing to stereo in Lo/Ro mode.
yading@10 4662
yading@10 4663 =over 4
yading@10 4664
yading@10 4665
yading@10 4666 =item B<0.841>
yading@10 4667
yading@10 4668 Apply -1.5dB gain
yading@10 4669
yading@10 4670 =item B<0.707>
yading@10 4671
yading@10 4672 Apply -3.0dB gain
yading@10 4673
yading@10 4674 =item B<0.595>
yading@10 4675
yading@10 4676 Apply -4.5dB gain
yading@10 4677
yading@10 4678 =item B<0.500>
yading@10 4679
yading@10 4680 Apply -6.0dB gain (default)
yading@10 4681
yading@10 4682 =item B<0.000>
yading@10 4683
yading@10 4684 Silence Surround Channel(s)
yading@10 4685
yading@10 4686 =back
yading@10 4687
yading@10 4688
yading@10 4689
yading@10 4690 =back
yading@10 4691
yading@10 4692
yading@10 4693
yading@10 4694 =head4 Extended Bitstream Information - Part 2
yading@10 4695
yading@10 4696
yading@10 4697
yading@10 4698 =over 4
yading@10 4699
yading@10 4700
yading@10 4701
yading@10 4702 =item B<-dsurex_mode> I<mode>
yading@10 4703
yading@10 4704 Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
yading@10 4705 (7.1 matrixed to 5.1). Using this option does B<NOT> mean the encoder will actually
yading@10 4706 apply Dolby Surround EX processing.
yading@10 4707
yading@10 4708 =over 4
yading@10 4709
yading@10 4710
yading@10 4711 =item B<0>
yading@10 4712
yading@10 4713
yading@10 4714 =item B<notindicated>
yading@10 4715
yading@10 4716 Not Indicated (default)
yading@10 4717
yading@10 4718 =item B<1>
yading@10 4719
yading@10 4720
yading@10 4721 =item B<on>
yading@10 4722
yading@10 4723 Dolby Surround EX Off
yading@10 4724
yading@10 4725 =item B<2>
yading@10 4726
yading@10 4727
yading@10 4728 =item B<off>
yading@10 4729
yading@10 4730 Dolby Surround EX On
yading@10 4731
yading@10 4732 =back
yading@10 4733
yading@10 4734
yading@10 4735
yading@10 4736 =item B<-dheadphone_mode> I<mode>
yading@10 4737
yading@10 4738 Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
yading@10 4739 encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
yading@10 4740 option does B<NOT> mean the encoder will actually apply Dolby Headphone
yading@10 4741 processing.
yading@10 4742
yading@10 4743 =over 4
yading@10 4744
yading@10 4745
yading@10 4746 =item B<0>
yading@10 4747
yading@10 4748
yading@10 4749 =item B<notindicated>
yading@10 4750
yading@10 4751 Not Indicated (default)
yading@10 4752
yading@10 4753 =item B<1>
yading@10 4754
yading@10 4755
yading@10 4756 =item B<on>
yading@10 4757
yading@10 4758 Dolby Headphone Off
yading@10 4759
yading@10 4760 =item B<2>
yading@10 4761
yading@10 4762
yading@10 4763 =item B<off>
yading@10 4764
yading@10 4765 Dolby Headphone On
yading@10 4766
yading@10 4767 =back
yading@10 4768
yading@10 4769
yading@10 4770
yading@10 4771 =item B<-ad_conv_type> I<type>
yading@10 4772
yading@10 4773 A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
yading@10 4774 conversion.
yading@10 4775
yading@10 4776 =over 4
yading@10 4777
yading@10 4778
yading@10 4779 =item B<0>
yading@10 4780
yading@10 4781
yading@10 4782 =item B<standard>
yading@10 4783
yading@10 4784 Standard A/D Converter (default)
yading@10 4785
yading@10 4786 =item B<1>
yading@10 4787
yading@10 4788
yading@10 4789 =item B<hdcd>
yading@10 4790
yading@10 4791 HDCD A/D Converter
yading@10 4792
yading@10 4793 =back
yading@10 4794
yading@10 4795
yading@10 4796
yading@10 4797 =back
yading@10 4798
yading@10 4799
yading@10 4800
yading@10 4801 =head3 Other AC-3 Encoding Options
yading@10 4802
yading@10 4803
yading@10 4804
yading@10 4805 =over 4
yading@10 4806
yading@10 4807
yading@10 4808
yading@10 4809 =item B<-stereo_rematrixing> I<boolean>
yading@10 4810
yading@10 4811 Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
yading@10 4812 is an optional AC-3 feature that increases quality by selectively encoding
yading@10 4813 the left/right channels as mid/side. This option is enabled by default, and it
yading@10 4814 is highly recommended that it be left as enabled except for testing purposes.
yading@10 4815
yading@10 4816
yading@10 4817 =back
yading@10 4818
yading@10 4819
yading@10 4820
yading@10 4821 =head3 Floating-Point-Only AC-3 Encoding Options
yading@10 4822
yading@10 4823
yading@10 4824 These options are only valid for the floating-point encoder and do not exist
yading@10 4825 for the fixed-point encoder due to the corresponding features not being
yading@10 4826 implemented in fixed-point.
yading@10 4827
yading@10 4828
yading@10 4829 =over 4
yading@10 4830
yading@10 4831
yading@10 4832
yading@10 4833 =item B<-channel_coupling> I<boolean>
yading@10 4834
yading@10 4835 Enables/Disables use of channel coupling, which is an optional AC-3 feature
yading@10 4836 that increases quality by combining high frequency information from multiple
yading@10 4837 channels into a single channel. The per-channel high frequency information is
yading@10 4838 sent with less accuracy in both the frequency and time domains. This allows
yading@10 4839 more bits to be used for lower frequencies while preserving enough information
yading@10 4840 to reconstruct the high frequencies. This option is enabled by default for the
yading@10 4841 floating-point encoder and should generally be left as enabled except for
yading@10 4842 testing purposes or to increase encoding speed.
yading@10 4843
yading@10 4844 =over 4
yading@10 4845
yading@10 4846
yading@10 4847 =item B<-1>
yading@10 4848
yading@10 4849
yading@10 4850 =item B<auto>
yading@10 4851
yading@10 4852 Selected by Encoder (default)
yading@10 4853
yading@10 4854 =item B<0>
yading@10 4855
yading@10 4856
yading@10 4857 =item B<off>
yading@10 4858
yading@10 4859 Disable Channel Coupling
yading@10 4860
yading@10 4861 =item B<1>
yading@10 4862
yading@10 4863
yading@10 4864 =item B<on>
yading@10 4865
yading@10 4866 Enable Channel Coupling
yading@10 4867
yading@10 4868 =back
yading@10 4869
yading@10 4870
yading@10 4871
yading@10 4872 =item B<-cpl_start_band> I<number>
yading@10 4873
yading@10 4874 Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
yading@10 4875 value higher than the bandwidth is used, it will be reduced to 1 less than the
yading@10 4876 coupling end band. If I<auto> is used, the start band will be determined by
yading@10 4877 the encoder based on the bit rate, sample rate, and channel layout. This option
yading@10 4878 has no effect if channel coupling is disabled.
yading@10 4879
yading@10 4880 =over 4
yading@10 4881
yading@10 4882
yading@10 4883 =item B<-1>
yading@10 4884
yading@10 4885
yading@10 4886 =item B<auto>
yading@10 4887
yading@10 4888 Selected by Encoder (default)
yading@10 4889
yading@10 4890 =back
yading@10 4891
yading@10 4892
yading@10 4893
yading@10 4894 =back
yading@10 4895
yading@10 4896
yading@10 4897
yading@10 4898
yading@10 4899 =head1 VIDEO ENCODERS
yading@10 4900
yading@10 4901
yading@10 4902 A description of some of the currently available video encoders
yading@10 4903 follows.
yading@10 4904
yading@10 4905
yading@10 4906 =head2 libtheora
yading@10 4907
yading@10 4908
yading@10 4909 Theora format supported through libtheora.
yading@10 4910
yading@10 4911 Requires the presence of the libtheora headers and library during
yading@10 4912 configuration. You need to explicitly configure the build with
yading@10 4913 C<--enable-libtheora>.
yading@10 4914
yading@10 4915
yading@10 4916 =head3 Options
yading@10 4917
yading@10 4918
yading@10 4919 The following global options are mapped to internal libtheora options
yading@10 4920 which affect the quality and the bitrate of the encoded stream.
yading@10 4921
yading@10 4922
yading@10 4923 =over 4
yading@10 4924
yading@10 4925
yading@10 4926 =item B<b>
yading@10 4927
yading@10 4928 Set the video bitrate, only works if the C<qscale> flag in
yading@10 4929 B<flags> is not enabled.
yading@10 4930
yading@10 4931
yading@10 4932 =item B<flags>
yading@10 4933
yading@10 4934 Used to enable constant quality mode encoding through the
yading@10 4935 B<qscale> flag, and to enable the C<pass1> and C<pass2>
yading@10 4936 modes.
yading@10 4937
yading@10 4938
yading@10 4939 =item B<g>
yading@10 4940
yading@10 4941 Set the GOP size.
yading@10 4942
yading@10 4943
yading@10 4944 =item B<global_quality>
yading@10 4945
yading@10 4946 Set the global quality in lambda units, only works if the
yading@10 4947 C<qscale> flag in B<flags> is enabled. The value is clipped
yading@10 4948 in the [0 - 10*C<FF_QP2LAMBDA>] range, and then multiplied for 6.3
yading@10 4949 to get a value in the native libtheora range [0-63]. A higher value
yading@10 4950 corresponds to a higher quality.
yading@10 4951
yading@10 4952 For example, to set maximum constant quality encoding with
yading@10 4953 B<ffmpeg>:
yading@10 4954
yading@10 4955 ffmpeg -i INPUT -flags:v qscale -global_quality:v "10*QP2LAMBDA" -codec:v libtheora OUTPUT.ogg
yading@10 4956
yading@10 4957
yading@10 4958 =back
yading@10 4959
yading@10 4960
yading@10 4961
yading@10 4962 =head2 libvpx
yading@10 4963
yading@10 4964
yading@10 4965 VP8 format supported through libvpx.
yading@10 4966
yading@10 4967 Requires the presence of the libvpx headers and library during configuration.
yading@10 4968 You need to explicitly configure the build with C<--enable-libvpx>.
yading@10 4969
yading@10 4970
yading@10 4971 =head3 Options
yading@10 4972
yading@10 4973
yading@10 4974 Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
yading@10 4975
yading@10 4976
yading@10 4977 =over 4
yading@10 4978
yading@10 4979
yading@10 4980
yading@10 4981 =item B<threads>
yading@10 4982
yading@10 4983 g_threads
yading@10 4984
yading@10 4985
yading@10 4986 =item B<profile>
yading@10 4987
yading@10 4988 g_profile
yading@10 4989
yading@10 4990
yading@10 4991 =item B<vb>
yading@10 4992
yading@10 4993 rc_target_bitrate
yading@10 4994
yading@10 4995
yading@10 4996 =item B<g>
yading@10 4997
yading@10 4998 kf_max_dist
yading@10 4999
yading@10 5000
yading@10 5001 =item B<keyint_min>
yading@10 5002
yading@10 5003 kf_min_dist
yading@10 5004
yading@10 5005
yading@10 5006 =item B<qmin>
yading@10 5007
yading@10 5008 rc_min_quantizer
yading@10 5009
yading@10 5010
yading@10 5011 =item B<qmax>
yading@10 5012
yading@10 5013 rc_max_quantizer
yading@10 5014
yading@10 5015
yading@10 5016 =item B<bufsize, vb>
yading@10 5017
yading@10 5018 rc_buf_sz
yading@10 5019 C<(bufsize * 1000 / vb)>
yading@10 5020
yading@10 5021 rc_buf_optimal_sz
yading@10 5022 C<(bufsize * 1000 / vb * 5 / 6)>
yading@10 5023
yading@10 5024
yading@10 5025 =item B<rc_init_occupancy, vb>
yading@10 5026
yading@10 5027 rc_buf_initial_sz
yading@10 5028 C<(rc_init_occupancy * 1000 / vb)>
yading@10 5029
yading@10 5030
yading@10 5031 =item B<rc_buffer_aggressivity>
yading@10 5032
yading@10 5033 rc_undershoot_pct
yading@10 5034
yading@10 5035
yading@10 5036 =item B<skip_threshold>
yading@10 5037
yading@10 5038 rc_dropframe_thresh
yading@10 5039
yading@10 5040
yading@10 5041 =item B<qcomp>
yading@10 5042
yading@10 5043 rc_2pass_vbr_bias_pct
yading@10 5044
yading@10 5045
yading@10 5046 =item B<maxrate, vb>
yading@10 5047
yading@10 5048 rc_2pass_vbr_maxsection_pct
yading@10 5049 C<(maxrate * 100 / vb)>
yading@10 5050
yading@10 5051
yading@10 5052 =item B<minrate, vb>
yading@10 5053
yading@10 5054 rc_2pass_vbr_minsection_pct
yading@10 5055 C<(minrate * 100 / vb)>
yading@10 5056
yading@10 5057
yading@10 5058 =item B<minrate, maxrate, vb>
yading@10 5059
yading@10 5060 C<VPX_CBR>
yading@10 5061 C<(minrate == maxrate == vb)>
yading@10 5062
yading@10 5063
yading@10 5064 =item B<crf>
yading@10 5065
yading@10 5066 C<VPX_CQ>, C<VP8E_SET_CQ_LEVEL>
yading@10 5067
yading@10 5068
yading@10 5069 =item B<quality>
yading@10 5070
yading@10 5071
yading@10 5072 =over 4
yading@10 5073
yading@10 5074
yading@10 5075 =item I<best>
yading@10 5076
yading@10 5077 C<VPX_DL_BEST_QUALITY>
yading@10 5078
yading@10 5079 =item I<good>
yading@10 5080
yading@10 5081 C<VPX_DL_GOOD_QUALITY>
yading@10 5082
yading@10 5083 =item I<realtime>
yading@10 5084
yading@10 5085 C<VPX_DL_REALTIME>
yading@10 5086
yading@10 5087 =back
yading@10 5088
yading@10 5089
yading@10 5090
yading@10 5091 =item B<speed>
yading@10 5092
yading@10 5093 C<VP8E_SET_CPUUSED>
yading@10 5094
yading@10 5095
yading@10 5096 =item B<nr>
yading@10 5097
yading@10 5098 C<VP8E_SET_NOISE_SENSITIVITY>
yading@10 5099
yading@10 5100
yading@10 5101 =item B<mb_threshold>
yading@10 5102
yading@10 5103 C<VP8E_SET_STATIC_THRESHOLD>
yading@10 5104
yading@10 5105
yading@10 5106 =item B<slices>
yading@10 5107
yading@10 5108 C<VP8E_SET_TOKEN_PARTITIONS>
yading@10 5109
yading@10 5110
yading@10 5111 =item B<max-intra-rate>
yading@10 5112
yading@10 5113 C<VP8E_SET_MAX_INTRA_BITRATE_PCT>
yading@10 5114
yading@10 5115
yading@10 5116 =item B<force_key_frames>
yading@10 5117
yading@10 5118 C<VPX_EFLAG_FORCE_KF>
yading@10 5119
yading@10 5120
yading@10 5121 =item B<Alternate reference frame related>
yading@10 5122
yading@10 5123
yading@10 5124 =over 4
yading@10 5125
yading@10 5126
yading@10 5127 =item B<vp8flags altref>
yading@10 5128
yading@10 5129 C<VP8E_SET_ENABLEAUTOALTREF>
yading@10 5130
yading@10 5131 =item I<arnr_max_frames>
yading@10 5132
yading@10 5133 C<VP8E_SET_ARNR_MAXFRAMES>
yading@10 5134
yading@10 5135 =item I<arnr_type>
yading@10 5136
yading@10 5137 C<VP8E_SET_ARNR_TYPE>
yading@10 5138
yading@10 5139 =item I<arnr_strength>
yading@10 5140
yading@10 5141 C<VP8E_SET_ARNR_STRENGTH>
yading@10 5142
yading@10 5143 =item I<rc_lookahead>
yading@10 5144
yading@10 5145 g_lag_in_frames
yading@10 5146
yading@10 5147 =back
yading@10 5148
yading@10 5149
yading@10 5150
yading@10 5151 =item B<vp8flags error_resilient>
yading@10 5152
yading@10 5153 g_error_resilient
yading@10 5154
yading@10 5155
yading@10 5156 =back
yading@10 5157
yading@10 5158
yading@10 5159 For more information about libvpx see:
yading@10 5160 E<lt>B<http://www.webmproject.org/>E<gt>
yading@10 5161
yading@10 5162
yading@10 5163 =head2 libx264
yading@10 5164
yading@10 5165
yading@10 5166 x264 H.264/MPEG-4 AVC encoder wrapper
yading@10 5167
yading@10 5168 Requires the presence of the libx264 headers and library during
yading@10 5169 configuration. You need to explicitly configure the build with
yading@10 5170 C<--enable-libx264>.
yading@10 5171
yading@10 5172 x264 supports an impressive number of features, including 8x8 and 4x4 adaptive
yading@10 5173 spatial transform, adaptive B-frame placement, CAVLC/CABAC entropy coding,
yading@10 5174 interlacing (MBAFF), lossless mode, psy optimizations for detail retention
yading@10 5175 (adaptive quantization, psy-RD, psy-trellis).
yading@10 5176
yading@10 5177 The FFmpeg wrapper provides a mapping for most of them using global options
yading@10 5178 that match those of the encoders and provides private options for the unique
yading@10 5179 encoder options. Additionally an expert override is provided to directly pass
yading@10 5180 a list of key=value tuples as accepted by x264_param_parse.
yading@10 5181
yading@10 5182
yading@10 5183 =head3 Option Mapping
yading@10 5184
yading@10 5185
yading@10 5186 The following options are supported by the x264 wrapper, the x264-equivalent
yading@10 5187 options follow the FFmpeg ones.
yading@10 5188
yading@10 5189
yading@10 5190 =over 4
yading@10 5191
yading@10 5192
yading@10 5193 =item B<b : bitrate>
yading@10 5194
yading@10 5195 FFmpeg C<b> option is expressed in bits/s, x264 C<bitrate> in kilobits/s.
yading@10 5196
yading@10 5197 =item B<bf : bframes>
yading@10 5198
yading@10 5199 Maximum number of B-frames.
yading@10 5200
yading@10 5201 =item B<g : keyint>
yading@10 5202
yading@10 5203 Maximum GOP size.
yading@10 5204
yading@10 5205 =item B<qmin : qpmin>
yading@10 5206
yading@10 5207
yading@10 5208 =item B<qmax : qpmax>
yading@10 5209
yading@10 5210
yading@10 5211 =item B<qdiff : qpstep>
yading@10 5212
yading@10 5213
yading@10 5214 =item B<qblur : qblur>
yading@10 5215
yading@10 5216
yading@10 5217 =item B<qcomp : qcomp>
yading@10 5218
yading@10 5219
yading@10 5220 =item B<refs : ref>
yading@10 5221
yading@10 5222
yading@10 5223 =item B<sc_threshold : scenecut>
yading@10 5224
yading@10 5225
yading@10 5226 =item B<trellis : trellis>
yading@10 5227
yading@10 5228
yading@10 5229 =item B<nr : nr>
yading@10 5230
yading@10 5231 Noise reduction.
yading@10 5232
yading@10 5233 =item B<me_range : merange>
yading@10 5234
yading@10 5235
yading@10 5236 =item B<me_method : me>
yading@10 5237
yading@10 5238
yading@10 5239 =item B<subq : subme>
yading@10 5240
yading@10 5241
yading@10 5242 =item B<b_strategy : b-adapt>
yading@10 5243
yading@10 5244
yading@10 5245 =item B<keyint_min : keyint-min>
yading@10 5246
yading@10 5247
yading@10 5248 =item B<coder : cabac>
yading@10 5249
yading@10 5250 Set coder to C<ac> to use CABAC.
yading@10 5251
yading@10 5252 =item B<cmp : chroma-me>
yading@10 5253
yading@10 5254 Set to C<chroma> to use chroma motion estimation.
yading@10 5255
yading@10 5256 =item B<threads : threads>
yading@10 5257
yading@10 5258
yading@10 5259 =item B<thread_type : sliced_threads>
yading@10 5260
yading@10 5261 Set to C<slice> to use sliced threading instead of frame threading.
yading@10 5262
yading@10 5263 =item B<flags -cgop : open-gop>
yading@10 5264
yading@10 5265 Set C<-cgop> to use recovery points to close GOPs.
yading@10 5266
yading@10 5267 =item B<rc_init_occupancy : vbv-init>
yading@10 5268
yading@10 5269 Initial buffer occupancy.
yading@10 5270
yading@10 5271 =back
yading@10 5272
yading@10 5273
yading@10 5274
yading@10 5275 =head3 Private Options
yading@10 5276
yading@10 5277
yading@10 5278 =over 4
yading@10 5279
yading@10 5280
yading@10 5281 =item B<-preset> I<string>
yading@10 5282
yading@10 5283 Set the encoding preset (cf. x264 --fullhelp).
yading@10 5284
yading@10 5285 =item B<-tune> I<string>
yading@10 5286
yading@10 5287 Tune the encoding params (cf. x264 --fullhelp).
yading@10 5288
yading@10 5289 =item B<-profile> I<string>
yading@10 5290
yading@10 5291 Set profile restrictions (cf. x264 --fullhelp).
yading@10 5292
yading@10 5293 =item B<-fastfirstpass> I<integer>
yading@10 5294
yading@10 5295 Use fast settings when encoding first pass.
yading@10 5296
yading@10 5297 =item B<-crf> I<float>
yading@10 5298
yading@10 5299 Select the quality for constant quality mode.
yading@10 5300
yading@10 5301 =item B<-crf_max> I<float>
yading@10 5302
yading@10 5303 In CRF mode, prevents VBV from lowering quality beyond this point.
yading@10 5304
yading@10 5305 =item B<-qp> I<integer>
yading@10 5306
yading@10 5307 Constant quantization parameter rate control method.
yading@10 5308
yading@10 5309 =item B<-aq-mode> I<integer>
yading@10 5310
yading@10 5311 AQ method
yading@10 5312
yading@10 5313 Possible values:
yading@10 5314
yading@10 5315 =over 4
yading@10 5316
yading@10 5317
yading@10 5318 =item B<none>
yading@10 5319
yading@10 5320
yading@10 5321
yading@10 5322 =item B<variance>
yading@10 5323
yading@10 5324 Variance AQ (complexity mask).
yading@10 5325
yading@10 5326 =item B<autovariance>
yading@10 5327
yading@10 5328 Auto-variance AQ (experimental).
yading@10 5329
yading@10 5330 =back
yading@10 5331
yading@10 5332
yading@10 5333 =item B<-aq-strength> I<float>
yading@10 5334
yading@10 5335 AQ strength, reduces blocking and blurring in flat and textured areas.
yading@10 5336
yading@10 5337 =item B<-psy> I<integer>
yading@10 5338
yading@10 5339 Use psychovisual optimizations.
yading@10 5340
yading@10 5341 =item B<-psy-rd> I<string>
yading@10 5342
yading@10 5343 Strength of psychovisual optimization, in E<lt>psy-rdE<gt>:E<lt>psy-trellisE<gt> format.
yading@10 5344
yading@10 5345 =item B<-rc-lookahead> I<integer>
yading@10 5346
yading@10 5347 Number of frames to look ahead for frametype and ratecontrol.
yading@10 5348
yading@10 5349 =item B<-weightb> I<integer>
yading@10 5350
yading@10 5351 Weighted prediction for B-frames.
yading@10 5352
yading@10 5353 =item B<-weightp> I<integer>
yading@10 5354
yading@10 5355 Weighted prediction analysis method.
yading@10 5356
yading@10 5357 Possible values:
yading@10 5358
yading@10 5359 =over 4
yading@10 5360
yading@10 5361
yading@10 5362 =item B<none>
yading@10 5363
yading@10 5364
yading@10 5365
yading@10 5366 =item B<simple>
yading@10 5367
yading@10 5368
yading@10 5369
yading@10 5370 =item B<smart>
yading@10 5371
yading@10 5372
yading@10 5373
yading@10 5374 =back
yading@10 5375
yading@10 5376
yading@10 5377 =item B<-ssim> I<integer>
yading@10 5378
yading@10 5379 Calculate and print SSIM stats.
yading@10 5380
yading@10 5381 =item B<-intra-refresh> I<integer>
yading@10 5382
yading@10 5383 Use Periodic Intra Refresh instead of IDR frames.
yading@10 5384
yading@10 5385 =item B<-b-bias> I<integer>
yading@10 5386
yading@10 5387 Influences how often B-frames are used.
yading@10 5388
yading@10 5389 =item B<-b-pyramid> I<integer>
yading@10 5390
yading@10 5391 Keep some B-frames as references.
yading@10 5392
yading@10 5393 Possible values:
yading@10 5394
yading@10 5395 =over 4
yading@10 5396
yading@10 5397
yading@10 5398 =item B<none>
yading@10 5399
yading@10 5400
yading@10 5401
yading@10 5402 =item B<strict>
yading@10 5403
yading@10 5404 Strictly hierarchical pyramid.
yading@10 5405
yading@10 5406 =item B<normal>
yading@10 5407
yading@10 5408 Non-strict (not Blu-ray compatible).
yading@10 5409
yading@10 5410 =back
yading@10 5411
yading@10 5412
yading@10 5413 =item B<-mixed-refs> I<integer>
yading@10 5414
yading@10 5415 One reference per partition, as opposed to one reference per macroblock.
yading@10 5416
yading@10 5417 =item B<-8x8dct> I<integer>
yading@10 5418
yading@10 5419 High profile 8x8 transform.
yading@10 5420
yading@10 5421 =item B<-fast-pskip> I<integer>
yading@10 5422
yading@10 5423
yading@10 5424 =item B<-aud> I<integer>
yading@10 5425
yading@10 5426 Use access unit delimiters.
yading@10 5427
yading@10 5428 =item B<-mbtree> I<integer>
yading@10 5429
yading@10 5430 Use macroblock tree ratecontrol.
yading@10 5431
yading@10 5432 =item B<-deblock> I<string>
yading@10 5433
yading@10 5434 Loop filter parameters, in E<lt>alpha:betaE<gt> form.
yading@10 5435
yading@10 5436 =item B<-cplxblur> I<float>
yading@10 5437
yading@10 5438 Reduce fluctuations in QP (before curve compression).
yading@10 5439
yading@10 5440 =item B<-partitions> I<string>
yading@10 5441
yading@10 5442 A comma-separated list of partitions to consider, possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, all.
yading@10 5443
yading@10 5444 =item B<-direct-pred> I<integer>
yading@10 5445
yading@10 5446 Direct MV prediction mode
yading@10 5447
yading@10 5448 Possible values:
yading@10 5449
yading@10 5450 =over 4
yading@10 5451
yading@10 5452
yading@10 5453 =item B<none>
yading@10 5454
yading@10 5455
yading@10 5456
yading@10 5457 =item B<spatial>
yading@10 5458
yading@10 5459
yading@10 5460
yading@10 5461 =item B<temporal>
yading@10 5462
yading@10 5463
yading@10 5464
yading@10 5465 =item B<auto>
yading@10 5466
yading@10 5467
yading@10 5468
yading@10 5469 =back
yading@10 5470
yading@10 5471
yading@10 5472 =item B<-slice-max-size> I<integer>
yading@10 5473
yading@10 5474 Limit the size of each slice in bytes.
yading@10 5475
yading@10 5476 =item B<-stats> I<string>
yading@10 5477
yading@10 5478 Filename for 2 pass stats.
yading@10 5479
yading@10 5480 =item B<-nal-hrd> I<integer>
yading@10 5481
yading@10 5482 Signal HRD information (requires vbv-bufsize; cbr not allowed in .mp4).
yading@10 5483
yading@10 5484 Possible values:
yading@10 5485
yading@10 5486 =over 4
yading@10 5487
yading@10 5488
yading@10 5489 =item B<none>
yading@10 5490
yading@10 5491
yading@10 5492
yading@10 5493 =item B<vbr>
yading@10 5494
yading@10 5495
yading@10 5496
yading@10 5497 =item B<cbr>
yading@10 5498
yading@10 5499
yading@10 5500
yading@10 5501 =back
yading@10 5502
yading@10 5503
yading@10 5504
yading@10 5505 =item B<x264opts> I<options>
yading@10 5506
yading@10 5507 Allow to set any x264 option, see C<x264 --fullhelp> for a list.
yading@10 5508
yading@10 5509 I<options> is a list of I<key>=I<value> couples separated by
yading@10 5510 ":". In I<filter> and I<psy-rd> options that use ":" as a separator
yading@10 5511 themselves, use "," instead. They accept it as well since long ago but this
yading@10 5512 is kept undocumented for some reason.
yading@10 5513
yading@10 5514 For example to specify libx264 encoding options with B<ffmpeg>:
yading@10 5515
yading@10 5516 ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
yading@10 5517
yading@10 5518
yading@10 5519 For more information about libx264 and the supported options see:
yading@10 5520 E<lt>B<http://www.videolan.org/developers/x264.html>E<gt>
yading@10 5521
yading@10 5522
yading@10 5523 =item B<-x264-params> I<string>
yading@10 5524
yading@10 5525 Override the x264 configuration using a :-separated list of key=value parameters.
yading@10 5526
yading@10 5527 -x264-params level=30:bframes=0:weightp=0:cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:no-fast-pskip=1:subq=6:8x8dct=0:trellis=0
yading@10 5528
yading@10 5529
yading@10 5530 =back
yading@10 5531
yading@10 5532
yading@10 5533 Encoding avpresets for common usages are provided so they can be used with the
yading@10 5534 general presets system (e.g. passing the C<-pre> option).
yading@10 5535
yading@10 5536
yading@10 5537 =head2 ProRes
yading@10 5538
yading@10 5539
yading@10 5540 Apple ProRes encoder.
yading@10 5541
yading@10 5542 FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
yading@10 5543 The used encoder can be choosen with the C<-vcodec> option.
yading@10 5544
yading@10 5545
yading@10 5546 =head3 Private Options for prores-ks
yading@10 5547
yading@10 5548
yading@10 5549
yading@10 5550 =over 4
yading@10 5551
yading@10 5552
yading@10 5553 =item B<profile> I<integer>
yading@10 5554
yading@10 5555 Select the ProRes profile to encode
yading@10 5556
yading@10 5557 =over 4
yading@10 5558
yading@10 5559
yading@10 5560 =item B<proxy>
yading@10 5561
yading@10 5562
yading@10 5563 =item B<lt>
yading@10 5564
yading@10 5565
yading@10 5566 =item B<standard>
yading@10 5567
yading@10 5568
yading@10 5569 =item B<hq>
yading@10 5570
yading@10 5571
yading@10 5572 =back
yading@10 5573
yading@10 5574
yading@10 5575
yading@10 5576 =item B<quant_mat> I<integer>
yading@10 5577
yading@10 5578 Select quantization matrix.
yading@10 5579
yading@10 5580 =over 4
yading@10 5581
yading@10 5582
yading@10 5583 =item B<auto>
yading@10 5584
yading@10 5585
yading@10 5586 =item B<default>
yading@10 5587
yading@10 5588
yading@10 5589 =item B<proxy>
yading@10 5590
yading@10 5591
yading@10 5592 =item B<lt>
yading@10 5593
yading@10 5594
yading@10 5595 =item B<standard>
yading@10 5596
yading@10 5597
yading@10 5598 =item B<hq>
yading@10 5599
yading@10 5600
yading@10 5601 =back
yading@10 5602
yading@10 5603 If set to I<auto>, the matrix matching the profile will be picked.
yading@10 5604 If not set, the matrix providing the highest quality, I<default>, will be
yading@10 5605 picked.
yading@10 5606
yading@10 5607
yading@10 5608 =item B<bits_per_mb> I<integer>
yading@10 5609
yading@10 5610 How many bits to allot for coding one macroblock. Different profiles use
yading@10 5611 between 200 and 2400 bits per macroblock, the maximum is 8000.
yading@10 5612
yading@10 5613
yading@10 5614 =item B<mbs_per_slice> I<integer>
yading@10 5615
yading@10 5616 Number of macroblocks in each slice (1-8); the default value (8)
yading@10 5617 should be good in almost all situations.
yading@10 5618
yading@10 5619
yading@10 5620 =item B<vendor> I<string>
yading@10 5621
yading@10 5622 Override the 4-byte vendor ID.
yading@10 5623 A custom vendor ID like I<apl0> would claim the stream was produced by
yading@10 5624 the Apple encoder.
yading@10 5625
yading@10 5626
yading@10 5627 =back
yading@10 5628
yading@10 5629
yading@10 5630
yading@10 5631 =head3 Speed considerations
yading@10 5632
yading@10 5633
yading@10 5634 In the default mode of operation the encoder has to honor frame constraints
yading@10 5635 (i.e. not produc frames with size bigger than requested) while still making
yading@10 5636 output picture as good as possible.
yading@10 5637 A frame containing a lot of small details is harder to compress and the encoder
yading@10 5638 would spend more time searching for appropriate quantizers for each slice.
yading@10 5639
yading@10 5640 Setting a higher B<bits_per_mb> limit will improve the speed.
yading@10 5641
yading@10 5642 For the fastest encoding speed set the B<qscale> parameter (4 is the
yading@10 5643 recommended value) and do not set a size constraint.
yading@10 5644
yading@10 5645
yading@10 5646 =head1 BITSTREAM FILTERS
yading@10 5647
yading@10 5648
yading@10 5649 When you configure your FFmpeg build, all the supported bitstream
yading@10 5650 filters are enabled by default. You can list all available ones using
yading@10 5651 the configure option C<--list-bsfs>.
yading@10 5652
yading@10 5653 You can disable all the bitstream filters using the configure option
yading@10 5654 C<--disable-bsfs>, and selectively enable any bitstream filter using
yading@10 5655 the option C<--enable-bsf=BSF>, or you can disable a particular
yading@10 5656 bitstream filter using the option C<--disable-bsf=BSF>.
yading@10 5657
yading@10 5658 The option C<-bsfs> of the ff* tools will display the list of
yading@10 5659 all the supported bitstream filters included in your build.
yading@10 5660
yading@10 5661 Below is a description of the currently available bitstream filters.
yading@10 5662
yading@10 5663
yading@10 5664 =head2 aac_adtstoasc
yading@10 5665
yading@10 5666
yading@10 5667
yading@10 5668 =head2 chomp
yading@10 5669
yading@10 5670
yading@10 5671
yading@10 5672 =head2 dump_extradata
yading@10 5673
yading@10 5674
yading@10 5675
yading@10 5676 =head2 h264_mp4toannexb
yading@10 5677
yading@10 5678
yading@10 5679 Convert an H.264 bitstream from length prefixed mode to start code
yading@10 5680 prefixed mode (as defined in the Annex B of the ITU-T H.264
yading@10 5681 specification).
yading@10 5682
yading@10 5683 This is required by some streaming formats, typically the MPEG-2
yading@10 5684 transport stream format ("mpegts").
yading@10 5685
yading@10 5686 For example to remux an MP4 file containing an H.264 stream to mpegts
yading@10 5687 format with B<ffmpeg>, you can use the command:
yading@10 5688
yading@10 5689
yading@10 5690 ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
yading@10 5691
yading@10 5692
yading@10 5693
yading@10 5694 =head2 imx_dump_header
yading@10 5695
yading@10 5696
yading@10 5697
yading@10 5698 =head2 mjpeg2jpeg
yading@10 5699
yading@10 5700
yading@10 5701 Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
yading@10 5702
yading@10 5703 MJPEG is a video codec wherein each video frame is essentially a
yading@10 5704 JPEG image. The individual frames can be extracted without loss,
yading@10 5705 e.g. by
yading@10 5706
yading@10 5707
yading@10 5708 ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
yading@10 5709
yading@10 5710
yading@10 5711 Unfortunately, these chunks are incomplete JPEG images, because
yading@10 5712 they lack the DHT segment required for decoding. Quoting from
yading@10 5713 E<lt>B<http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml>E<gt>:
yading@10 5714
yading@10 5715 Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
yading@10 5716 commented that "MJPEG, or at least the MJPEG in AVIs having the
yading@10 5717 MJPG fourcc, is restricted JPEG with a fixed -- and *omitted* --
yading@10 5718 Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
yading@10 5719 and it must use basic Huffman encoding, not arithmetic or
yading@10 5720 progressive. . . . You can indeed extract the MJPEG frames and
yading@10 5721 decode them with a regular JPEG decoder, but you have to prepend
yading@10 5722 the DHT segment to them, or else the decoder won't have any idea
yading@10 5723 how to decompress the data. The exact table necessary is given in
yading@10 5724 the OpenDML spec."
yading@10 5725
yading@10 5726 This bitstream filter patches the header of frames extracted from an MJPEG
yading@10 5727 stream (carrying the AVI1 header ID and lacking a DHT segment) to
yading@10 5728 produce fully qualified JPEG images.
yading@10 5729
yading@10 5730
yading@10 5731 ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
yading@10 5732 exiftran -i -9 frame*.jpg
yading@10 5733 ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
yading@10 5734
yading@10 5735
yading@10 5736
yading@10 5737 =head2 mjpega_dump_header
yading@10 5738
yading@10 5739
yading@10 5740
yading@10 5741 =head2 movsub
yading@10 5742
yading@10 5743
yading@10 5744
yading@10 5745 =head2 mp3_header_compress
yading@10 5746
yading@10 5747
yading@10 5748
yading@10 5749 =head2 mp3_header_decompress
yading@10 5750
yading@10 5751
yading@10 5752
yading@10 5753 =head2 noise
yading@10 5754
yading@10 5755
yading@10 5756
yading@10 5757 =head2 remove_extradata
yading@10 5758
yading@10 5759
yading@10 5760
yading@10 5761
yading@10 5762 =head1 FORMAT OPTIONS
yading@10 5763
yading@10 5764
yading@10 5765 The libavformat library provides some generic global options, which
yading@10 5766 can be set on all the muxers and demuxers. In addition each muxer or
yading@10 5767 demuxer may support so-called private options, which are specific for
yading@10 5768 that component.
yading@10 5769
yading@10 5770 Options may be set by specifying -I<option> I<value> in the
yading@10 5771 FFmpeg tools, or by setting the value explicitly in the
yading@10 5772 C<AVFormatContext> options or using the F<libavutil/opt.h> API
yading@10 5773 for programmatic use.
yading@10 5774
yading@10 5775 The list of supported options follows:
yading@10 5776
yading@10 5777
yading@10 5778 =over 4
yading@10 5779
yading@10 5780
yading@10 5781 =item B<avioflags> I<flags> B<(>I<input/output>B<)>
yading@10 5782
yading@10 5783 Possible values:
yading@10 5784
yading@10 5785 =over 4
yading@10 5786
yading@10 5787
yading@10 5788 =item B<direct>
yading@10 5789
yading@10 5790 Reduce buffering.
yading@10 5791
yading@10 5792 =back
yading@10 5793
yading@10 5794
yading@10 5795
yading@10 5796 =item B<probesize> I<integer> B<(>I<input>B<)>
yading@10 5797
yading@10 5798 Set probing size in bytes, i.e. the size of the data to analyze to get
yading@10 5799 stream information. A higher value will allow to detect more
yading@10 5800 information in case it is dispersed into the stream, but will increase
yading@10 5801 latency. Must be an integer not lesser than 32. It is 5000000 by default.
yading@10 5802
yading@10 5803
yading@10 5804 =item B<packetsize> I<integer> B<(>I<output>B<)>
yading@10 5805
yading@10 5806 Set packet size.
yading@10 5807
yading@10 5808
yading@10 5809 =item B<fflags> I<flags> B<(>I<input/output>B<)>
yading@10 5810
yading@10 5811 Set format flags.
yading@10 5812
yading@10 5813 Possible values:
yading@10 5814
yading@10 5815 =over 4
yading@10 5816
yading@10 5817
yading@10 5818 =item B<ignidx>
yading@10 5819
yading@10 5820 Ignore index.
yading@10 5821
yading@10 5822 =item B<genpts>
yading@10 5823
yading@10 5824 Generate PTS.
yading@10 5825
yading@10 5826 =item B<nofillin>
yading@10 5827
yading@10 5828 Do not fill in missing values that can be exactly calculated.
yading@10 5829
yading@10 5830 =item B<noparse>
yading@10 5831
yading@10 5832 Disable AVParsers, this needs C<+nofillin> too.
yading@10 5833
yading@10 5834 =item B<igndts>
yading@10 5835
yading@10 5836 Ignore DTS.
yading@10 5837
yading@10 5838 =item B<discardcorrupt>
yading@10 5839
yading@10 5840 Discard corrupted frames.
yading@10 5841
yading@10 5842 =item B<sortdts>
yading@10 5843
yading@10 5844 Try to interleave output packets by DTS.
yading@10 5845
yading@10 5846 =item B<keepside>
yading@10 5847
yading@10 5848 Do not merge side data.
yading@10 5849
yading@10 5850 =item B<latm>
yading@10 5851
yading@10 5852 Enable RTP MP4A-LATM payload.
yading@10 5853
yading@10 5854 =item B<nobuffer>
yading@10 5855
yading@10 5856 Reduce the latency introduced by optional buffering
yading@10 5857
yading@10 5858 =back
yading@10 5859
yading@10 5860
yading@10 5861
yading@10 5862 =item B<analyzeduration> I<integer> B<(>I<input>B<)>
yading@10 5863
yading@10 5864 Specify how many microseconds are analyzed to probe the input. A
yading@10 5865 higher value will allow to detect more accurate information, but will
yading@10 5866 increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
yading@10 5867
yading@10 5868
yading@10 5869 =item B<cryptokey> I<hexadecimal string> B<(>I<input>B<)>
yading@10 5870
yading@10 5871 Set decryption key.
yading@10 5872
yading@10 5873
yading@10 5874 =item B<indexmem> I<integer> B<(>I<input>B<)>
yading@10 5875
yading@10 5876 Set max memory used for timestamp index (per stream).
yading@10 5877
yading@10 5878
yading@10 5879 =item B<rtbufsize> I<integer> B<(>I<input>B<)>
yading@10 5880
yading@10 5881 Set max memory used for buffering real-time frames.
yading@10 5882
yading@10 5883
yading@10 5884 =item B<fdebug> I<flags> B<(>I<input/output>B<)>
yading@10 5885
yading@10 5886 Print specific debug info.
yading@10 5887
yading@10 5888 Possible values:
yading@10 5889
yading@10 5890 =over 4
yading@10 5891
yading@10 5892
yading@10 5893 =item B<ts>
yading@10 5894
yading@10 5895
yading@10 5896 =back
yading@10 5897
yading@10 5898
yading@10 5899
yading@10 5900 =item B<max_delay> I<integer> B<(>I<input/output>B<)>
yading@10 5901
yading@10 5902 Set maximum muxing or demuxing delay in microseconds.
yading@10 5903
yading@10 5904
yading@10 5905 =item B<fpsprobesize> I<integer> B<(>I<input>B<)>
yading@10 5906
yading@10 5907 Set number of frames used to probe fps.
yading@10 5908
yading@10 5909
yading@10 5910 =item B<audio_preload> I<integer> B<(>I<output>B<)>
yading@10 5911
yading@10 5912 Set microseconds by which audio packets should be interleaved earlier.
yading@10 5913
yading@10 5914
yading@10 5915 =item B<chunk_duration> I<integer> B<(>I<output>B<)>
yading@10 5916
yading@10 5917 Set microseconds for each chunk.
yading@10 5918
yading@10 5919
yading@10 5920 =item B<chunk_size> I<integer> B<(>I<output>B<)>
yading@10 5921
yading@10 5922 Set size in bytes for each chunk.
yading@10 5923
yading@10 5924
yading@10 5925 =item B<err_detect, f_err_detect> I<flags> B<(>I<input>B<)>
yading@10 5926
yading@10 5927 Set error detection flags. C<f_err_detect> is deprecated and
yading@10 5928 should be used only via the B<ffmpeg> tool.
yading@10 5929
yading@10 5930 Possible values:
yading@10 5931
yading@10 5932 =over 4
yading@10 5933
yading@10 5934
yading@10 5935 =item B<crccheck>
yading@10 5936
yading@10 5937 Verify embedded CRCs.
yading@10 5938
yading@10 5939 =item B<bitstream>
yading@10 5940
yading@10 5941 Detect bitstream specification deviations.
yading@10 5942
yading@10 5943 =item B<buffer>
yading@10 5944
yading@10 5945 Detect improper bitstream length.
yading@10 5946
yading@10 5947 =item B<explode>
yading@10 5948
yading@10 5949 Abort decoding on minor error detection.
yading@10 5950
yading@10 5951 =item B<careful>
yading@10 5952
yading@10 5953 Consider things that violate the spec and have not been seen in the
yading@10 5954 wild as errors.
yading@10 5955
yading@10 5956 =item B<compliant>
yading@10 5957
yading@10 5958 Consider all spec non compliancies as errors.
yading@10 5959
yading@10 5960 =item B<aggressive>
yading@10 5961
yading@10 5962 Consider things that a sane encoder should not do as an error.
yading@10 5963
yading@10 5964 =back
yading@10 5965
yading@10 5966
yading@10 5967
yading@10 5968 =item B<use_wallclock_as_timestamps> I<integer> B<(>I<input>B<)>
yading@10 5969
yading@10 5970 Use wallclock as timestamps.
yading@10 5971
yading@10 5972
yading@10 5973 =item B<avoid_negative_ts> I<integer> B<(>I<output>B<)>
yading@10 5974
yading@10 5975 Shift timestamps to make them positive. A value of 1 enables shifting,
yading@10 5976 a value of 0 disables it, the default value of -1 enables shifting
yading@10 5977 when required by the target format.
yading@10 5978
yading@10 5979 When shifting is enabled, all output timestamps are shifted by the
yading@10 5980 same amount. Audio, video, and subtitles desynching and relative
yading@10 5981 timestamp differences are preserved compared to how they would have
yading@10 5982 been without shifting.
yading@10 5983
yading@10 5984 Also note that this affects only leading negative timestamps, and not
yading@10 5985 non-monotonic negative timestamps.
yading@10 5986
yading@10 5987
yading@10 5988 =item B<flush_packets> I<integer> B<(>I<output>B<)>
yading@10 5989
yading@10 5990 Flush the underlying I/O stream after each packet. Default 1 enables it, and
yading@10 5991 has the effect of reducing the latency; 0 disables it and may slightly
yading@10 5992 increase performance in some cases.
yading@10 5993
yading@10 5994 =back
yading@10 5995
yading@10 5996
yading@10 5997
yading@10 5998
yading@10 5999 =head1 DEMUXERS
yading@10 6000
yading@10 6001
yading@10 6002 Demuxers are configured elements in FFmpeg which allow to read the
yading@10 6003 multimedia streams from a particular type of file.
yading@10 6004
yading@10 6005 When you configure your FFmpeg build, all the supported demuxers
yading@10 6006 are enabled by default. You can list all available ones using the
yading@10 6007 configure option C<--list-demuxers>.
yading@10 6008
yading@10 6009 You can disable all the demuxers using the configure option
yading@10 6010 C<--disable-demuxers>, and selectively enable a single demuxer with
yading@10 6011 the option C<--enable-demuxer=I<DEMUXER>>, or disable it
yading@10 6012 with the option C<--disable-demuxer=I<DEMUXER>>.
yading@10 6013
yading@10 6014 The option C<-formats> of the ff* tools will display the list of
yading@10 6015 enabled demuxers.
yading@10 6016
yading@10 6017 The description of some of the currently available demuxers follows.
yading@10 6018
yading@10 6019
yading@10 6020 =head2 applehttp
yading@10 6021
yading@10 6022
yading@10 6023 Apple HTTP Live Streaming demuxer.
yading@10 6024
yading@10 6025 This demuxer presents all AVStreams from all variant streams.
yading@10 6026 The id field is set to the bitrate variant index number. By setting
yading@10 6027 the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
yading@10 6028 the caller can decide which variant streams to actually receive.
yading@10 6029 The total bitrate of the variant that the stream belongs to is
yading@10 6030 available in a metadata key named "variant_bitrate".
yading@10 6031
yading@10 6032
yading@10 6033
yading@10 6034 =head2 concat
yading@10 6035
yading@10 6036
yading@10 6037 Virtual concatenation script demuxer.
yading@10 6038
yading@10 6039 This demuxer reads a list of files and other directives from a text file and
yading@10 6040 demuxes them one after the other, as if all their packet had been muxed
yading@10 6041 together.
yading@10 6042
yading@10 6043 The timestamps in the files are adjusted so that the first file starts at 0
yading@10 6044 and each next file starts where the previous one finishes. Note that it is
yading@10 6045 done globally and may cause gaps if all streams do not have exactly the same
yading@10 6046 length.
yading@10 6047
yading@10 6048 All files must have the same streams (same codecs, same time base, etc.).
yading@10 6049
yading@10 6050 The duration of each file is used to adjust the timestamps of the next file:
yading@10 6051 if the duration is incorrect (because it was computed using the bit-rate or
yading@10 6052 because the file is truncated, for example), it can cause artifacts. The
yading@10 6053 C<duration> directive can be used to override the duration stored in
yading@10 6054 each file.
yading@10 6055
yading@10 6056
yading@10 6057 =head3 Syntax
yading@10 6058
yading@10 6059
yading@10 6060 The script is a text file in extended-ASCII, with one directive per line.
yading@10 6061 Empty lines, leading spaces and lines starting with '#' are ignored. The
yading@10 6062 following directive is recognized:
yading@10 6063
yading@10 6064
yading@10 6065 =over 4
yading@10 6066
yading@10 6067
yading@10 6068
yading@10 6069 =item B<C<file I<path>>>
yading@10 6070
yading@10 6071 Path to a file to read; special characters and spaces must be escaped with
yading@10 6072 backslash or single quotes.
yading@10 6073
yading@10 6074 All subsequent directives apply to that file.
yading@10 6075
yading@10 6076
yading@10 6077 =item B<C<ffconcat version 1.0>>
yading@10 6078
yading@10 6079 Identify the script type and version. It also sets the B<safe> option
yading@10 6080 to 1 if it was to its default -1.
yading@10 6081
yading@10 6082 To make FFmpeg recognize the format automatically, this directive must
yading@10 6083 appears exactly as is (no extra space or byte-order-mark) on the very first
yading@10 6084 line of the script.
yading@10 6085
yading@10 6086
yading@10 6087 =item B<C<duration I<dur>>>
yading@10 6088
yading@10 6089 Duration of the file. This information can be specified from the file;
yading@10 6090 specifying it here may be more efficient or help if the information from the
yading@10 6091 file is not available or accurate.
yading@10 6092
yading@10 6093 If the duration is set for all files, then it is possible to seek in the
yading@10 6094 whole concatenated video.
yading@10 6095
yading@10 6096
yading@10 6097 =back
yading@10 6098
yading@10 6099
yading@10 6100
yading@10 6101 =head3 Options
yading@10 6102
yading@10 6103
yading@10 6104 This demuxer accepts the following option:
yading@10 6105
yading@10 6106
yading@10 6107 =over 4
yading@10 6108
yading@10 6109
yading@10 6110
yading@10 6111 =item B<safe>
yading@10 6112
yading@10 6113 If set to 1, reject unsafe file paths. A file path is considered safe if it
yading@10 6114 does not contain a protocol specification and is relative and all components
yading@10 6115 only contain characters from the portable character set (letters, digits,
yading@10 6116 period, underscore and hyphen) and have no period at the beginning of a
yading@10 6117 component.
yading@10 6118
yading@10 6119 If set to 0, any file name is accepted.
yading@10 6120
yading@10 6121 The default is -1, it is equivalent to 1 if the format was automatically
yading@10 6122 probed and 0 otherwise.
yading@10 6123
yading@10 6124
yading@10 6125 =back
yading@10 6126
yading@10 6127
yading@10 6128
yading@10 6129 =head2 libquvi
yading@10 6130
yading@10 6131
yading@10 6132 Play media from Internet services using the quvi project.
yading@10 6133
yading@10 6134 The demuxer accepts a B<format> option to request a specific quality. It
yading@10 6135 is by default set to I<best>.
yading@10 6136
yading@10 6137 See E<lt>B<http://quvi.sourceforge.net/>E<gt> for more information.
yading@10 6138
yading@10 6139 FFmpeg needs to be built with C<--enable-libquvi> for this demuxer to be
yading@10 6140 enabled.
yading@10 6141
yading@10 6142
yading@10 6143 =head2 image2
yading@10 6144
yading@10 6145
yading@10 6146 Image file demuxer.
yading@10 6147
yading@10 6148 This demuxer reads from a list of image files specified by a pattern.
yading@10 6149 The syntax and meaning of the pattern is specified by the
yading@10 6150 option I<pattern_type>.
yading@10 6151
yading@10 6152 The pattern may contain a suffix which is used to automatically
yading@10 6153 determine the format of the images contained in the files.
yading@10 6154
yading@10 6155 The size, the pixel format, and the format of each image must be the
yading@10 6156 same for all the files in the sequence.
yading@10 6157
yading@10 6158 This demuxer accepts the following options:
yading@10 6159
yading@10 6160 =over 4
yading@10 6161
yading@10 6162
yading@10 6163 =item B<framerate>
yading@10 6164
yading@10 6165 Set the frame rate for the video stream. It defaults to 25.
yading@10 6166
yading@10 6167 =item B<loop>
yading@10 6168
yading@10 6169 If set to 1, loop over the input. Default value is 0.
yading@10 6170
yading@10 6171 =item B<pattern_type>
yading@10 6172
yading@10 6173 Select the pattern type used to interpret the provided filename.
yading@10 6174
yading@10 6175 I<pattern_type> accepts one of the following values.
yading@10 6176
yading@10 6177 =over 4
yading@10 6178
yading@10 6179
yading@10 6180 =item B<sequence>
yading@10 6181
yading@10 6182 Select a sequence pattern type, used to specify a sequence of files
yading@10 6183 indexed by sequential numbers.
yading@10 6184
yading@10 6185 A sequence pattern may contain the string "%d" or "%0I<N>d", which
yading@10 6186 specifies the position of the characters representing a sequential
yading@10 6187 number in each filename matched by the pattern. If the form
yading@10 6188 "%d0I<N>d" is used, the string representing the number in each
yading@10 6189 filename is 0-padded and I<N> is the total number of 0-padded
yading@10 6190 digits representing the number. The literal character '%' can be
yading@10 6191 specified in the pattern with the string "%%".
yading@10 6192
yading@10 6193 If the sequence pattern contains "%d" or "%0I<N>d", the first filename of
yading@10 6194 the file list specified by the pattern must contain a number
yading@10 6195 inclusively contained between I<start_number> and
yading@10 6196 I<start_number>+I<start_number_range>-1, and all the following
yading@10 6197 numbers must be sequential.
yading@10 6198
yading@10 6199 For example the pattern "img-%03d.bmp" will match a sequence of
yading@10 6200 filenames of the form F<img-001.bmp>, F<img-002.bmp>, ...,
yading@10 6201 F<img-010.bmp>, etc.; the pattern "i%%m%%g-%d.jpg" will match a
yading@10 6202 sequence of filenames of the form F<i%m%g-1.jpg>,
yading@10 6203 F<i%m%g-2.jpg>, ..., F<i%m%g-10.jpg>, etc.
yading@10 6204
yading@10 6205 Note that the pattern must not necessarily contain "%d" or
yading@10 6206 "%0I<N>d", for example to convert a single image file
yading@10 6207 F<img.jpeg> you can employ the command:
yading@10 6208
yading@10 6209 ffmpeg -i img.jpeg img.png
yading@10 6210
yading@10 6211
yading@10 6212
yading@10 6213 =item B<glob>
yading@10 6214
yading@10 6215 Select a glob wildcard pattern type.
yading@10 6216
yading@10 6217 The pattern is interpreted like a C<glob()> pattern. This is only
yading@10 6218 selectable if libavformat was compiled with globbing support.
yading@10 6219
yading@10 6220
yading@10 6221 =item B<glob_sequence> I<(deprecated, will be removed)>
yading@10 6222
yading@10 6223 Select a mixed glob wildcard/sequence pattern.
yading@10 6224
yading@10 6225 If your version of libavformat was compiled with globbing support, and
yading@10 6226 the provided pattern contains at least one glob meta character among
yading@10 6227 C<%*?[]{}> that is preceded by an unescaped "%", the pattern is
yading@10 6228 interpreted like a C<glob()> pattern, otherwise it is interpreted
yading@10 6229 like a sequence pattern.
yading@10 6230
yading@10 6231 All glob special characters C<%*?[]{}> must be prefixed
yading@10 6232 with "%". To escape a literal "%" you shall use "%%".
yading@10 6233
yading@10 6234 For example the pattern C<foo-%*.jpeg> will match all the
yading@10 6235 filenames prefixed by "foo-" and terminating with ".jpeg", and
yading@10 6236 C<foo-%?%?%?.jpeg> will match all the filenames prefixed with
yading@10 6237 "foo-", followed by a sequence of three characters, and terminating
yading@10 6238 with ".jpeg".
yading@10 6239
yading@10 6240 This pattern type is deprecated in favor of I<glob> and
yading@10 6241 I<sequence>.
yading@10 6242
yading@10 6243 =back
yading@10 6244
yading@10 6245
yading@10 6246 Default value is I<glob_sequence>.
yading@10 6247
yading@10 6248 =item B<pixel_format>
yading@10 6249
yading@10 6250 Set the pixel format of the images to read. If not specified the pixel
yading@10 6251 format is guessed from the first image file in the sequence.
yading@10 6252
yading@10 6253 =item B<start_number>
yading@10 6254
yading@10 6255 Set the index of the file matched by the image file pattern to start
yading@10 6256 to read from. Default value is 0.
yading@10 6257
yading@10 6258 =item B<start_number_range>
yading@10 6259
yading@10 6260 Set the index interval range to check when looking for the first image
yading@10 6261 file in the sequence, starting from I<start_number>. Default value
yading@10 6262 is 5.
yading@10 6263
yading@10 6264 =item B<video_size>
yading@10 6265
yading@10 6266 Set the video size of the images to read. If not specified the video
yading@10 6267 size is guessed from the first image file in the sequence.
yading@10 6268
yading@10 6269 =back
yading@10 6270
yading@10 6271
yading@10 6272
yading@10 6273 =head3 Examples
yading@10 6274
yading@10 6275
yading@10 6276
yading@10 6277 =over 4
yading@10 6278
yading@10 6279
yading@10 6280 =item *
yading@10 6281
yading@10 6282 Use B<ffmpeg> for creating a video from the images in the file
yading@10 6283 sequence F<img-001.jpeg>, F<img-002.jpeg>, ..., assuming an
yading@10 6284 input frame rate of 10 frames per second:
yading@10 6285
yading@10 6286 ffmpeg -i 'img-%03d.jpeg' -r 10 out.mkv
yading@10 6287
yading@10 6288
yading@10 6289
yading@10 6290 =item *
yading@10 6291
yading@10 6292 As above, but start by reading from a file with index 100 in the sequence:
yading@10 6293
yading@10 6294 ffmpeg -start_number 100 -i 'img-%03d.jpeg' -r 10 out.mkv
yading@10 6295
yading@10 6296
yading@10 6297
yading@10 6298 =item *
yading@10 6299
yading@10 6300 Read images matching the "*.png" glob pattern , that is all the files
yading@10 6301 terminating with the ".png" suffix:
yading@10 6302
yading@10 6303 ffmpeg -pattern_type glob -i "*.png" -r 10 out.mkv
yading@10 6304
yading@10 6305
yading@10 6306 =back
yading@10 6307
yading@10 6308
yading@10 6309
yading@10 6310 =head2 rawvideo
yading@10 6311
yading@10 6312
yading@10 6313 Raw video demuxer.
yading@10 6314
yading@10 6315 This demuxer allows to read raw video data. Since there is no header
yading@10 6316 specifying the assumed video parameters, the user must specify them
yading@10 6317 in order to be able to decode the data correctly.
yading@10 6318
yading@10 6319 This demuxer accepts the following options:
yading@10 6320
yading@10 6321 =over 4
yading@10 6322
yading@10 6323
yading@10 6324
yading@10 6325 =item B<framerate>
yading@10 6326
yading@10 6327 Set input video frame rate. Default value is 25.
yading@10 6328
yading@10 6329
yading@10 6330 =item B<pixel_format>
yading@10 6331
yading@10 6332 Set the input video pixel format. Default value is C<yuv420p>.
yading@10 6333
yading@10 6334
yading@10 6335 =item B<video_size>
yading@10 6336
yading@10 6337 Set the input video size. This value must be specified explicitly.
yading@10 6338
yading@10 6339 =back
yading@10 6340
yading@10 6341
yading@10 6342 For example to read a rawvideo file F<input.raw> with
yading@10 6343 B<ffplay>, assuming a pixel format of C<rgb24>, a video
yading@10 6344 size of C<320x240>, and a frame rate of 10 images per second, use
yading@10 6345 the command:
yading@10 6346
yading@10 6347 ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
yading@10 6348
yading@10 6349
yading@10 6350
yading@10 6351 =head2 sbg
yading@10 6352
yading@10 6353
yading@10 6354 SBaGen script demuxer.
yading@10 6355
yading@10 6356 This demuxer reads the script language used by SBaGen
yading@10 6357 E<lt>B<http://uazu.net/sbagen/>E<gt> to generate binaural beats sessions. A SBG
yading@10 6358 script looks like that:
yading@10 6359
yading@10 6360 -SE
yading@10 6361 a: 300-2.5/3 440+4.5/0
yading@10 6362 b: 300-2.5/0 440+4.5/3
yading@10 6363 off: -
yading@10 6364 NOW == a
yading@10 6365 +0:07:00 == b
yading@10 6366 +0:14:00 == a
yading@10 6367 +0:21:00 == b
yading@10 6368 +0:30:00 off
yading@10 6369
yading@10 6370
yading@10 6371 A SBG script can mix absolute and relative timestamps. If the script uses
yading@10 6372 either only absolute timestamps (including the script start time) or only
yading@10 6373 relative ones, then its layout is fixed, and the conversion is
yading@10 6374 straightforward. On the other hand, if the script mixes both kind of
yading@10 6375 timestamps, then the I<NOW> reference for relative timestamps will be
yading@10 6376 taken from the current time of day at the time the script is read, and the
yading@10 6377 script layout will be frozen according to that reference. That means that if
yading@10 6378 the script is directly played, the actual times will match the absolute
yading@10 6379 timestamps up to the sound controller's clock accuracy, but if the user
yading@10 6380 somehow pauses the playback or seeks, all times will be shifted accordingly.
yading@10 6381
yading@10 6382
yading@10 6383 =head2 tedcaptions
yading@10 6384
yading@10 6385
yading@10 6386 JSON captions used for E<lt>B<http://www.ted.com/>E<gt>.
yading@10 6387
yading@10 6388 TED does not provide links to the captions, but they can be guessed from the
yading@10 6389 page. The file F<tools/bookmarklets.html> from the FFmpeg source tree
yading@10 6390 contains a bookmarklet to expose them.
yading@10 6391
yading@10 6392 This demuxer accepts the following option:
yading@10 6393
yading@10 6394 =over 4
yading@10 6395
yading@10 6396
yading@10 6397 =item B<start_time>
yading@10 6398
yading@10 6399 Set the start time of the TED talk, in milliseconds. The default is 15000
yading@10 6400 (15s). It is used to sync the captions with the downloadable videos, because
yading@10 6401 they include a 15s intro.
yading@10 6402
yading@10 6403 =back
yading@10 6404
yading@10 6405
yading@10 6406 Example: convert the captions to a format most players understand:
yading@10 6407
yading@10 6408 ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
yading@10 6409
yading@10 6410
yading@10 6411
yading@10 6412 =head1 MUXERS
yading@10 6413
yading@10 6414
yading@10 6415 Muxers are configured elements in FFmpeg which allow writing
yading@10 6416 multimedia streams to a particular type of file.
yading@10 6417
yading@10 6418 When you configure your FFmpeg build, all the supported muxers
yading@10 6419 are enabled by default. You can list all available muxers using the
yading@10 6420 configure option C<--list-muxers>.
yading@10 6421
yading@10 6422 You can disable all the muxers with the configure option
yading@10 6423 C<--disable-muxers> and selectively enable / disable single muxers
yading@10 6424 with the options C<--enable-muxer=I<MUXER>> /
yading@10 6425 C<--disable-muxer=I<MUXER>>.
yading@10 6426
yading@10 6427 The option C<-formats> of the ff* tools will display the list of
yading@10 6428 enabled muxers.
yading@10 6429
yading@10 6430 A description of some of the currently available muxers follows.
yading@10 6431
yading@10 6432
yading@10 6433
yading@10 6434 =head2 crc
yading@10 6435
yading@10 6436
yading@10 6437 CRC (Cyclic Redundancy Check) testing format.
yading@10 6438
yading@10 6439 This muxer computes and prints the Adler-32 CRC of all the input audio
yading@10 6440 and video frames. By default audio frames are converted to signed
yading@10 6441 16-bit raw audio and video frames to raw video before computing the
yading@10 6442 CRC.
yading@10 6443
yading@10 6444 The output of the muxer consists of a single line of the form:
yading@10 6445 CRC=0xI<CRC>, where I<CRC> is a hexadecimal number 0-padded to
yading@10 6446 8 digits containing the CRC for all the decoded input frames.
yading@10 6447
yading@10 6448 For example to compute the CRC of the input, and store it in the file
yading@10 6449 F<out.crc>:
yading@10 6450
yading@10 6451 ffmpeg -i INPUT -f crc out.crc
yading@10 6452
yading@10 6453
yading@10 6454 You can print the CRC to stdout with the command:
yading@10 6455
yading@10 6456 ffmpeg -i INPUT -f crc -
yading@10 6457
yading@10 6458
yading@10 6459 You can select the output format of each frame with B<ffmpeg> by
yading@10 6460 specifying the audio and video codec and format. For example to
yading@10 6461 compute the CRC of the input audio converted to PCM unsigned 8-bit
yading@10 6462 and the input video converted to MPEG-2 video, use the command:
yading@10 6463
yading@10 6464 ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
yading@10 6465
yading@10 6466
yading@10 6467 See also the framecrc muxer.
yading@10 6468
yading@10 6469
yading@10 6470
yading@10 6471 =head2 framecrc
yading@10 6472
yading@10 6473
yading@10 6474 Per-packet CRC (Cyclic Redundancy Check) testing format.
yading@10 6475
yading@10 6476 This muxer computes and prints the Adler-32 CRC for each audio
yading@10 6477 and video packet. By default audio frames are converted to signed
yading@10 6478 16-bit raw audio and video frames to raw video before computing the
yading@10 6479 CRC.
yading@10 6480
yading@10 6481 The output of the muxer consists of a line for each audio and video
yading@10 6482 packet of the form:
yading@10 6483
yading@10 6484 <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, 0x<CRC>
yading@10 6485
yading@10 6486
yading@10 6487 I<CRC> is a hexadecimal number 0-padded to 8 digits containing the
yading@10 6488 CRC of the packet.
yading@10 6489
yading@10 6490 For example to compute the CRC of the audio and video frames in
yading@10 6491 F<INPUT>, converted to raw audio and video packets, and store it
yading@10 6492 in the file F<out.crc>:
yading@10 6493
yading@10 6494 ffmpeg -i INPUT -f framecrc out.crc
yading@10 6495
yading@10 6496
yading@10 6497 To print the information to stdout, use the command:
yading@10 6498
yading@10 6499 ffmpeg -i INPUT -f framecrc -
yading@10 6500
yading@10 6501
yading@10 6502 With B<ffmpeg>, you can select the output format to which the
yading@10 6503 audio and video frames are encoded before computing the CRC for each
yading@10 6504 packet by specifying the audio and video codec. For example, to
yading@10 6505 compute the CRC of each decoded input audio frame converted to PCM
yading@10 6506 unsigned 8-bit and of each decoded input video frame converted to
yading@10 6507 MPEG-2 video, use the command:
yading@10 6508
yading@10 6509 ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
yading@10 6510
yading@10 6511
yading@10 6512 See also the crc muxer.
yading@10 6513
yading@10 6514
yading@10 6515
yading@10 6516 =head2 framemd5
yading@10 6517
yading@10 6518
yading@10 6519 Per-packet MD5 testing format.
yading@10 6520
yading@10 6521 This muxer computes and prints the MD5 hash for each audio
yading@10 6522 and video packet. By default audio frames are converted to signed
yading@10 6523 16-bit raw audio and video frames to raw video before computing the
yading@10 6524 hash.
yading@10 6525
yading@10 6526 The output of the muxer consists of a line for each audio and video
yading@10 6527 packet of the form:
yading@10 6528
yading@10 6529 <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, <MD5>
yading@10 6530
yading@10 6531
yading@10 6532 I<MD5> is a hexadecimal number representing the computed MD5 hash
yading@10 6533 for the packet.
yading@10 6534
yading@10 6535 For example to compute the MD5 of the audio and video frames in
yading@10 6536 F<INPUT>, converted to raw audio and video packets, and store it
yading@10 6537 in the file F<out.md5>:
yading@10 6538
yading@10 6539 ffmpeg -i INPUT -f framemd5 out.md5
yading@10 6540
yading@10 6541
yading@10 6542 To print the information to stdout, use the command:
yading@10 6543
yading@10 6544 ffmpeg -i INPUT -f framemd5 -
yading@10 6545
yading@10 6546
yading@10 6547 See also the md5 muxer.
yading@10 6548
yading@10 6549
yading@10 6550
yading@10 6551 =head2 hls
yading@10 6552
yading@10 6553
yading@10 6554 Apple HTTP Live Streaming muxer that segments MPEG-TS according to
yading@10 6555 the HTTP Live Streaming specification.
yading@10 6556
yading@10 6557 It creates a playlist file and numbered segment files. The output
yading@10 6558 filename specifies the playlist filename; the segment filenames
yading@10 6559 receive the same basename as the playlist, a sequential number and
yading@10 6560 a .ts extension.
yading@10 6561
yading@10 6562
yading@10 6563 ffmpeg -i in.nut out.m3u8
yading@10 6564
yading@10 6565
yading@10 6566
yading@10 6567 =over 4
yading@10 6568
yading@10 6569
yading@10 6570 =item B<-hls_time> I<seconds>
yading@10 6571
yading@10 6572 Set the segment length in seconds.
yading@10 6573
yading@10 6574 =item B<-hls_list_size> I<size>
yading@10 6575
yading@10 6576 Set the maximum number of playlist entries.
yading@10 6577
yading@10 6578 =item B<-hls_wrap> I<wrap>
yading@10 6579
yading@10 6580 Set the number after which index wraps.
yading@10 6581
yading@10 6582 =item B<-start_number> I<number>
yading@10 6583
yading@10 6584 Start the sequence from I<number>.
yading@10 6585
yading@10 6586 =back
yading@10 6587
yading@10 6588
yading@10 6589
yading@10 6590
yading@10 6591 =head2 ico
yading@10 6592
yading@10 6593
yading@10 6594 ICO file muxer.
yading@10 6595
yading@10 6596 Microsoft's icon file format (ICO) has some strict limitations that should be noted:
yading@10 6597
yading@10 6598
yading@10 6599 =over 4
yading@10 6600
yading@10 6601
yading@10 6602 =item *
yading@10 6603
yading@10 6604 Size cannot exceed 256 pixels in any dimension
yading@10 6605
yading@10 6606
yading@10 6607 =item *
yading@10 6608
yading@10 6609 Only BMP and PNG images can be stored
yading@10 6610
yading@10 6611
yading@10 6612 =item *
yading@10 6613
yading@10 6614 If a BMP image is used, it must be one of the following pixel formats:
yading@10 6615
yading@10 6616 BMP Bit Depth FFmpeg Pixel Format
yading@10 6617 1bit pal8
yading@10 6618 4bit pal8
yading@10 6619 8bit pal8
yading@10 6620 16bit rgb555le
yading@10 6621 24bit bgr24
yading@10 6622 32bit bgra
yading@10 6623
yading@10 6624
yading@10 6625
yading@10 6626 =item *
yading@10 6627
yading@10 6628 If a BMP image is used, it must use the BITMAPINFOHEADER DIB header
yading@10 6629
yading@10 6630
yading@10 6631 =item *
yading@10 6632
yading@10 6633 If a PNG image is used, it must use the rgba pixel format
yading@10 6634
yading@10 6635 =back
yading@10 6636
yading@10 6637
yading@10 6638
yading@10 6639
yading@10 6640 =head2 image2
yading@10 6641
yading@10 6642
yading@10 6643 Image file muxer.
yading@10 6644
yading@10 6645 The image file muxer writes video frames to image files.
yading@10 6646
yading@10 6647 The output filenames are specified by a pattern, which can be used to
yading@10 6648 produce sequentially numbered series of files.
yading@10 6649 The pattern may contain the string "%d" or "%0I<N>d", this string
yading@10 6650 specifies the position of the characters representing a numbering in
yading@10 6651 the filenames. If the form "%0I<N>d" is used, the string
yading@10 6652 representing the number in each filename is 0-padded to I<N>
yading@10 6653 digits. The literal character '%' can be specified in the pattern with
yading@10 6654 the string "%%".
yading@10 6655
yading@10 6656 If the pattern contains "%d" or "%0I<N>d", the first filename of
yading@10 6657 the file list specified will contain the number 1, all the following
yading@10 6658 numbers will be sequential.
yading@10 6659
yading@10 6660 The pattern may contain a suffix which is used to automatically
yading@10 6661 determine the format of the image files to write.
yading@10 6662
yading@10 6663 For example the pattern "img-%03d.bmp" will specify a sequence of
yading@10 6664 filenames of the form F<img-001.bmp>, F<img-002.bmp>, ...,
yading@10 6665 F<img-010.bmp>, etc.
yading@10 6666 The pattern "img%%-%d.jpg" will specify a sequence of filenames of the
yading@10 6667 form F<img%-1.jpg>, F<img%-2.jpg>, ..., F<img%-10.jpg>,
yading@10 6668 etc.
yading@10 6669
yading@10 6670 The following example shows how to use B<ffmpeg> for creating a
yading@10 6671 sequence of files F<img-001.jpeg>, F<img-002.jpeg>, ...,
yading@10 6672 taking one image every second from the input video:
yading@10 6673
yading@10 6674 ffmpeg -i in.avi -vsync 1 -r 1 -f image2 'img-%03d.jpeg'
yading@10 6675
yading@10 6676
yading@10 6677 Note that with B<ffmpeg>, if the format is not specified with the
yading@10 6678 C<-f> option and the output filename specifies an image file
yading@10 6679 format, the image2 muxer is automatically selected, so the previous
yading@10 6680 command can be written as:
yading@10 6681
yading@10 6682 ffmpeg -i in.avi -vsync 1 -r 1 'img-%03d.jpeg'
yading@10 6683
yading@10 6684
yading@10 6685 Note also that the pattern must not necessarily contain "%d" or
yading@10 6686 "%0I<N>d", for example to create a single image file
yading@10 6687 F<img.jpeg> from the input video you can employ the command:
yading@10 6688
yading@10 6689 ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
yading@10 6690
yading@10 6691
yading@10 6692
yading@10 6693 =over 4
yading@10 6694
yading@10 6695
yading@10 6696 =item B<start_number> I<number>
yading@10 6697
yading@10 6698 Start the sequence from I<number>. Default value is 1. Must be a
yading@10 6699 positive number.
yading@10 6700
yading@10 6701
yading@10 6702 =item B<-update> I<number>
yading@10 6703
yading@10 6704 If I<number> is nonzero, the filename will always be interpreted as just a
yading@10 6705 filename, not a pattern, and this file will be continuously overwritten with new
yading@10 6706 images.
yading@10 6707
yading@10 6708
yading@10 6709 =back
yading@10 6710
yading@10 6711
yading@10 6712 The image muxer supports the .Y.U.V image file format. This format is
yading@10 6713 special in that that each image frame consists of three files, for
yading@10 6714 each of the YUV420P components. To read or write this image file format,
yading@10 6715 specify the name of the '.Y' file. The muxer will automatically open the
yading@10 6716 '.U' and '.V' files as required.
yading@10 6717
yading@10 6718
yading@10 6719
yading@10 6720 =head2 md5
yading@10 6721
yading@10 6722
yading@10 6723 MD5 testing format.
yading@10 6724
yading@10 6725 This muxer computes and prints the MD5 hash of all the input audio
yading@10 6726 and video frames. By default audio frames are converted to signed
yading@10 6727 16-bit raw audio and video frames to raw video before computing the
yading@10 6728 hash.
yading@10 6729
yading@10 6730 The output of the muxer consists of a single line of the form:
yading@10 6731 MD5=I<MD5>, where I<MD5> is a hexadecimal number representing
yading@10 6732 the computed MD5 hash.
yading@10 6733
yading@10 6734 For example to compute the MD5 hash of the input converted to raw
yading@10 6735 audio and video, and store it in the file F<out.md5>:
yading@10 6736
yading@10 6737 ffmpeg -i INPUT -f md5 out.md5
yading@10 6738
yading@10 6739
yading@10 6740 You can print the MD5 to stdout with the command:
yading@10 6741
yading@10 6742 ffmpeg -i INPUT -f md5 -
yading@10 6743
yading@10 6744
yading@10 6745 See also the framemd5 muxer.
yading@10 6746
yading@10 6747
yading@10 6748 =head2 MOV/MP4/ISMV
yading@10 6749
yading@10 6750
yading@10 6751 The mov/mp4/ismv muxer supports fragmentation. Normally, a MOV/MP4
yading@10 6752 file has all the metadata about all packets stored in one location
yading@10 6753 (written at the end of the file, it can be moved to the start for
yading@10 6754 better playback by adding I<faststart> to the I<movflags>, or
yading@10 6755 using the B<qt-faststart> tool). A fragmented
yading@10 6756 file consists of a number of fragments, where packets and metadata
yading@10 6757 about these packets are stored together. Writing a fragmented
yading@10 6758 file has the advantage that the file is decodable even if the
yading@10 6759 writing is interrupted (while a normal MOV/MP4 is undecodable if
yading@10 6760 it is not properly finished), and it requires less memory when writing
yading@10 6761 very long files (since writing normal MOV/MP4 files stores info about
yading@10 6762 every single packet in memory until the file is closed). The downside
yading@10 6763 is that it is less compatible with other applications.
yading@10 6764
yading@10 6765 Fragmentation is enabled by setting one of the AVOptions that define
yading@10 6766 how to cut the file into fragments:
yading@10 6767
yading@10 6768
yading@10 6769 =over 4
yading@10 6770
yading@10 6771
yading@10 6772 =item B<-moov_size> I<bytes>
yading@10 6773
yading@10 6774 Reserves space for the moov atom at the beginning of the file instead of placing the
yading@10 6775 moov atom at the end. If the space reserved is insufficient, muxing will fail.
yading@10 6776
yading@10 6777 =item B<-movflags frag_keyframe>
yading@10 6778
yading@10 6779 Start a new fragment at each video keyframe.
yading@10 6780
yading@10 6781 =item B<-frag_duration> I<duration>
yading@10 6782
yading@10 6783 Create fragments that are I<duration> microseconds long.
yading@10 6784
yading@10 6785 =item B<-frag_size> I<size>
yading@10 6786
yading@10 6787 Create fragments that contain up to I<size> bytes of payload data.
yading@10 6788
yading@10 6789 =item B<-movflags frag_custom>
yading@10 6790
yading@10 6791 Allow the caller to manually choose when to cut fragments, by
yading@10 6792 calling C<av_write_frame(ctx, NULL)> to write a fragment with
yading@10 6793 the packets written so far. (This is only useful with other
yading@10 6794 applications integrating libavformat, not from B<ffmpeg>.)
yading@10 6795
yading@10 6796 =item B<-min_frag_duration> I<duration>
yading@10 6797
yading@10 6798 Don't create fragments that are shorter than I<duration> microseconds long.
yading@10 6799
yading@10 6800 =back
yading@10 6801
yading@10 6802
yading@10 6803 If more than one condition is specified, fragments are cut when
yading@10 6804 one of the specified conditions is fulfilled. The exception to this is
yading@10 6805 C<-min_frag_duration>, which has to be fulfilled for any of the other
yading@10 6806 conditions to apply.
yading@10 6807
yading@10 6808 Additionally, the way the output file is written can be adjusted
yading@10 6809 through a few other options:
yading@10 6810
yading@10 6811
yading@10 6812 =over 4
yading@10 6813
yading@10 6814
yading@10 6815 =item B<-movflags empty_moov>
yading@10 6816
yading@10 6817 Write an initial moov atom directly at the start of the file, without
yading@10 6818 describing any samples in it. Generally, an mdat/moov pair is written
yading@10 6819 at the start of the file, as a normal MOV/MP4 file, containing only
yading@10 6820 a short portion of the file. With this option set, there is no initial
yading@10 6821 mdat atom, and the moov atom only describes the tracks but has
yading@10 6822 a zero duration.
yading@10 6823
yading@10 6824 Files written with this option set do not work in QuickTime.
yading@10 6825 This option is implicitly set when writing ismv (Smooth Streaming) files.
yading@10 6826
yading@10 6827 =item B<-movflags separate_moof>
yading@10 6828
yading@10 6829 Write a separate moof (movie fragment) atom for each track. Normally,
yading@10 6830 packets for all tracks are written in a moof atom (which is slightly
yading@10 6831 more efficient), but with this option set, the muxer writes one moof/mdat
yading@10 6832 pair for each track, making it easier to separate tracks.
yading@10 6833
yading@10 6834 This option is implicitly set when writing ismv (Smooth Streaming) files.
yading@10 6835
yading@10 6836 =item B<-movflags faststart>
yading@10 6837
yading@10 6838 Run a second pass moving the moov atom on top of the file. This
yading@10 6839 operation can take a while, and will not work in various situations such
yading@10 6840 as fragmented output, thus it is not enabled by default.
yading@10 6841
yading@10 6842 =item B<-movflags rtphint>
yading@10 6843
yading@10 6844 Add RTP hinting tracks to the output file.
yading@10 6845
yading@10 6846 =back
yading@10 6847
yading@10 6848
yading@10 6849 Smooth Streaming content can be pushed in real time to a publishing
yading@10 6850 point on IIS with this muxer. Example:
yading@10 6851
yading@10 6852 ffmpeg -re <<normal input/transcoding options>> -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
yading@10 6853
yading@10 6854
yading@10 6855
yading@10 6856 =head2 mpegts
yading@10 6857
yading@10 6858
yading@10 6859 MPEG transport stream muxer.
yading@10 6860
yading@10 6861 This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
yading@10 6862
yading@10 6863 The muxer options are:
yading@10 6864
yading@10 6865
yading@10 6866 =over 4
yading@10 6867
yading@10 6868
yading@10 6869 =item B<-mpegts_original_network_id> I<number>
yading@10 6870
yading@10 6871 Set the original_network_id (default 0x0001). This is unique identifier
yading@10 6872 of a network in DVB. Its main use is in the unique identification of a
yading@10 6873 service through the path Original_Network_ID, Transport_Stream_ID.
yading@10 6874
yading@10 6875 =item B<-mpegts_transport_stream_id> I<number>
yading@10 6876
yading@10 6877 Set the transport_stream_id (default 0x0001). This identifies a
yading@10 6878 transponder in DVB.
yading@10 6879
yading@10 6880 =item B<-mpegts_service_id> I<number>
yading@10 6881
yading@10 6882 Set the service_id (default 0x0001) also known as program in DVB.
yading@10 6883
yading@10 6884 =item B<-mpegts_pmt_start_pid> I<number>
yading@10 6885
yading@10 6886 Set the first PID for PMT (default 0x1000, max 0x1f00).
yading@10 6887
yading@10 6888 =item B<-mpegts_start_pid> I<number>
yading@10 6889
yading@10 6890 Set the first PID for data packets (default 0x0100, max 0x0f00).
yading@10 6891
yading@10 6892 =back
yading@10 6893
yading@10 6894
yading@10 6895 The recognized metadata settings in mpegts muxer are C<service_provider>
yading@10 6896 and C<service_name>. If they are not set the default for
yading@10 6897 C<service_provider> is "FFmpeg" and the default for
yading@10 6898 C<service_name> is "Service01".
yading@10 6899
yading@10 6900
yading@10 6901 ffmpeg -i file.mpg -c copy \
yading@10 6902 -mpegts_original_network_id 0x1122 \
yading@10 6903 -mpegts_transport_stream_id 0x3344 \
yading@10 6904 -mpegts_service_id 0x5566 \
yading@10 6905 -mpegts_pmt_start_pid 0x1500 \
yading@10 6906 -mpegts_start_pid 0x150 \
yading@10 6907 -metadata service_provider="Some provider" \
yading@10 6908 -metadata service_name="Some Channel" \
yading@10 6909 -y out.ts
yading@10 6910
yading@10 6911
yading@10 6912
yading@10 6913 =head2 null
yading@10 6914
yading@10 6915
yading@10 6916 Null muxer.
yading@10 6917
yading@10 6918 This muxer does not generate any output file, it is mainly useful for
yading@10 6919 testing or benchmarking purposes.
yading@10 6920
yading@10 6921 For example to benchmark decoding with B<ffmpeg> you can use the
yading@10 6922 command:
yading@10 6923
yading@10 6924 ffmpeg -benchmark -i INPUT -f null out.null
yading@10 6925
yading@10 6926
yading@10 6927 Note that the above command does not read or write the F<out.null>
yading@10 6928 file, but specifying the output file is required by the B<ffmpeg>
yading@10 6929 syntax.
yading@10 6930
yading@10 6931 Alternatively you can write the command as:
yading@10 6932
yading@10 6933 ffmpeg -benchmark -i INPUT -f null -
yading@10 6934
yading@10 6935
yading@10 6936
yading@10 6937 =head2 matroska
yading@10 6938
yading@10 6939
yading@10 6940 Matroska container muxer.
yading@10 6941
yading@10 6942 This muxer implements the matroska and webm container specs.
yading@10 6943
yading@10 6944 The recognized metadata settings in this muxer are:
yading@10 6945
yading@10 6946
yading@10 6947 =over 4
yading@10 6948
yading@10 6949
yading@10 6950
yading@10 6951 =item B<title=>I<title name>
yading@10 6952
yading@10 6953 Name provided to a single track
yading@10 6954
yading@10 6955 =back
yading@10 6956
yading@10 6957
yading@10 6958
yading@10 6959 =over 4
yading@10 6960
yading@10 6961
yading@10 6962
yading@10 6963 =item B<language=>I<language name>
yading@10 6964
yading@10 6965 Specifies the language of the track in the Matroska languages form
yading@10 6966
yading@10 6967 =back
yading@10 6968
yading@10 6969
yading@10 6970
yading@10 6971 =over 4
yading@10 6972
yading@10 6973
yading@10 6974
yading@10 6975 =item B<stereo_mode=>I<mode>
yading@10 6976
yading@10 6977 Stereo 3D video layout of two views in a single video track
yading@10 6978
yading@10 6979 =over 4
yading@10 6980
yading@10 6981
yading@10 6982 =item B<mono>
yading@10 6983
yading@10 6984 video is not stereo
yading@10 6985
yading@10 6986 =item B<left_right>
yading@10 6987
yading@10 6988 Both views are arranged side by side, Left-eye view is on the left
yading@10 6989
yading@10 6990 =item B<bottom_top>
yading@10 6991
yading@10 6992 Both views are arranged in top-bottom orientation, Left-eye view is at bottom
yading@10 6993
yading@10 6994 =item B<top_bottom>
yading@10 6995
yading@10 6996 Both views are arranged in top-bottom orientation, Left-eye view is on top
yading@10 6997
yading@10 6998 =item B<checkerboard_rl>
yading@10 6999
yading@10 7000 Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
yading@10 7001
yading@10 7002 =item B<checkerboard_lr>
yading@10 7003
yading@10 7004 Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
yading@10 7005
yading@10 7006 =item B<row_interleaved_rl>
yading@10 7007
yading@10 7008 Each view is constituted by a row based interleaving, Right-eye view is first row
yading@10 7009
yading@10 7010 =item B<row_interleaved_lr>
yading@10 7011
yading@10 7012 Each view is constituted by a row based interleaving, Left-eye view is first row
yading@10 7013
yading@10 7014 =item B<col_interleaved_rl>
yading@10 7015
yading@10 7016 Both views are arranged in a column based interleaving manner, Right-eye view is first column
yading@10 7017
yading@10 7018 =item B<col_interleaved_lr>
yading@10 7019
yading@10 7020 Both views are arranged in a column based interleaving manner, Left-eye view is first column
yading@10 7021
yading@10 7022 =item B<anaglyph_cyan_red>
yading@10 7023
yading@10 7024 All frames are in anaglyph format viewable through red-cyan filters
yading@10 7025
yading@10 7026 =item B<right_left>
yading@10 7027
yading@10 7028 Both views are arranged side by side, Right-eye view is on the left
yading@10 7029
yading@10 7030 =item B<anaglyph_green_magenta>
yading@10 7031
yading@10 7032 All frames are in anaglyph format viewable through green-magenta filters
yading@10 7033
yading@10 7034 =item B<block_lr>
yading@10 7035
yading@10 7036 Both eyes laced in one Block, Left-eye view is first
yading@10 7037
yading@10 7038 =item B<block_rl>
yading@10 7039
yading@10 7040 Both eyes laced in one Block, Right-eye view is first
yading@10 7041
yading@10 7042 =back
yading@10 7043
yading@10 7044
yading@10 7045 =back
yading@10 7046
yading@10 7047
yading@10 7048 For example a 3D WebM clip can be created using the following command line:
yading@10 7049
yading@10 7050 ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
yading@10 7051
yading@10 7052
yading@10 7053
yading@10 7054 =head2 segment, stream_segment, ssegment
yading@10 7055
yading@10 7056
yading@10 7057 Basic stream segmenter.
yading@10 7058
yading@10 7059 The segmenter muxer outputs streams to a number of separate files of nearly
yading@10 7060 fixed duration. Output filename pattern can be set in a fashion similar to
yading@10 7061 image2.
yading@10 7062
yading@10 7063 C<stream_segment> is a variant of the muxer used to write to
yading@10 7064 streaming output formats, i.e. which do not require global headers,
yading@10 7065 and is recommended for outputting e.g. to MPEG transport stream segments.
yading@10 7066 C<ssegment> is a shorter alias for C<stream_segment>.
yading@10 7067
yading@10 7068 Every segment starts with a keyframe of the selected reference stream,
yading@10 7069 which is set through the B<reference_stream> option.
yading@10 7070
yading@10 7071 Note that if you want accurate splitting for a video file, you need to
yading@10 7072 make the input key frames correspond to the exact splitting times
yading@10 7073 expected by the segmenter, or the segment muxer will start the new
yading@10 7074 segment with the key frame found next after the specified start
yading@10 7075 time.
yading@10 7076
yading@10 7077 The segment muxer works best with a single constant frame rate video.
yading@10 7078
yading@10 7079 Optionally it can generate a list of the created segments, by setting
yading@10 7080 the option I<segment_list>. The list type is specified by the
yading@10 7081 I<segment_list_type> option.
yading@10 7082
yading@10 7083 The segment muxer supports the following options:
yading@10 7084
yading@10 7085
yading@10 7086 =over 4
yading@10 7087
yading@10 7088
yading@10 7089 =item B<reference_stream> I<specifier>
yading@10 7090
yading@10 7091 Set the reference stream, as specified by the string I<specifier>.
yading@10 7092 If I<specifier> is set to C<auto>, the reference is choosen
yading@10 7093 automatically. Otherwise it must be a stream specifier (see the ``Stream
yading@10 7094 specifiers'' chapter in the ffmpeg manual) which specifies the
yading@10 7095 reference stream. The default value is ``auto''.
yading@10 7096
yading@10 7097
yading@10 7098 =item B<segment_format> I<format>
yading@10 7099
yading@10 7100 Override the inner container format, by default it is guessed by the filename
yading@10 7101 extension.
yading@10 7102
yading@10 7103
yading@10 7104 =item B<segment_list> I<name>
yading@10 7105
yading@10 7106 Generate also a listfile named I<name>. If not specified no
yading@10 7107 listfile is generated.
yading@10 7108
yading@10 7109
yading@10 7110 =item B<segment_list_flags> I<flags>
yading@10 7111
yading@10 7112 Set flags affecting the segment list generation.
yading@10 7113
yading@10 7114 It currently supports the following flags:
yading@10 7115
yading@10 7116 =over 4
yading@10 7117
yading@10 7118
yading@10 7119 =item I<cache>
yading@10 7120
yading@10 7121 Allow caching (only affects M3U8 list files).
yading@10 7122
yading@10 7123
yading@10 7124 =item I<live>
yading@10 7125
yading@10 7126 Allow live-friendly file generation.
yading@10 7127
yading@10 7128 =back
yading@10 7129
yading@10 7130
yading@10 7131 Default value is C<cache>.
yading@10 7132
yading@10 7133
yading@10 7134 =item B<segment_list_size> I<size>
yading@10 7135
yading@10 7136 Update the list file so that it contains at most the last I<size>
yading@10 7137 segments. If 0 the list file will contain all the segments. Default
yading@10 7138 value is 0.
yading@10 7139
yading@10 7140
yading@10 7141 =item B<segment_list type> I<type>
yading@10 7142
yading@10 7143 Specify the format for the segment list file.
yading@10 7144
yading@10 7145 The following values are recognized:
yading@10 7146
yading@10 7147 =over 4
yading@10 7148
yading@10 7149
yading@10 7150 =item B<flat>
yading@10 7151
yading@10 7152 Generate a flat list for the created segments, one segment per line.
yading@10 7153
yading@10 7154
yading@10 7155 =item B<csv, ext>
yading@10 7156
yading@10 7157 Generate a list for the created segments, one segment per line,
yading@10 7158 each line matching the format (comma-separated values):
yading@10 7159
yading@10 7160 <segment_filename>,<segment_start_time>,<segment_end_time>
yading@10 7161
yading@10 7162
yading@10 7163 I<segment_filename> is the name of the output file generated by the
yading@10 7164 muxer according to the provided pattern. CSV escaping (according to
yading@10 7165 RFC4180) is applied if required.
yading@10 7166
yading@10 7167 I<segment_start_time> and I<segment_end_time> specify
yading@10 7168 the segment start and end time expressed in seconds.
yading@10 7169
yading@10 7170 A list file with the suffix C<".csv"> or C<".ext"> will
yading@10 7171 auto-select this format.
yading@10 7172
yading@10 7173 C<ext> is deprecated in favor or C<csv>.
yading@10 7174
yading@10 7175
yading@10 7176 =item B<ffconcat>
yading@10 7177
yading@10 7178 Generate an ffconcat file for the created segments. The resulting file
yading@10 7179 can be read using the FFmpeg concat demuxer.
yading@10 7180
yading@10 7181 A list file with the suffix C<".ffcat"> or C<".ffconcat"> will
yading@10 7182 auto-select this format.
yading@10 7183
yading@10 7184
yading@10 7185 =item B<m3u8>
yading@10 7186
yading@10 7187 Generate an extended M3U8 file, version 3, compliant with
yading@10 7188 E<lt>B<http://tools.ietf.org/id/draft-pantos-http-live-streaming>E<gt>.
yading@10 7189
yading@10 7190 A list file with the suffix C<".m3u8"> will auto-select this format.
yading@10 7191
yading@10 7192 =back
yading@10 7193
yading@10 7194
yading@10 7195 If not specified the type is guessed from the list file name suffix.
yading@10 7196
yading@10 7197
yading@10 7198 =item B<segment_time> I<time>
yading@10 7199
yading@10 7200 Set segment duration to I<time>, the value must be a duration
yading@10 7201 specification. Default value is "2". See also the
yading@10 7202 B<segment_times> option.
yading@10 7203
yading@10 7204 Note that splitting may not be accurate, unless you force the
yading@10 7205 reference stream key-frames at the given time. See the introductory
yading@10 7206 notice and the examples below.
yading@10 7207
yading@10 7208
yading@10 7209 =item B<segment_time_delta> I<delta>
yading@10 7210
yading@10 7211 Specify the accuracy time when selecting the start time for a
yading@10 7212 segment, expressed as a duration specification. Default value is "0".
yading@10 7213
yading@10 7214 When delta is specified a key-frame will start a new segment if its
yading@10 7215 PTS satisfies the relation:
yading@10 7216
yading@10 7217 PTS >= start_time - time_delta
yading@10 7218
yading@10 7219
yading@10 7220 This option is useful when splitting video content, which is always
yading@10 7221 split at GOP boundaries, in case a key frame is found just before the
yading@10 7222 specified split time.
yading@10 7223
yading@10 7224 In particular may be used in combination with the F<ffmpeg> option
yading@10 7225 I<force_key_frames>. The key frame times specified by
yading@10 7226 I<force_key_frames> may not be set accurately because of rounding
yading@10 7227 issues, with the consequence that a key frame time may result set just
yading@10 7228 before the specified time. For constant frame rate videos a value of
yading@10 7229 1/2*I<frame_rate> should address the worst case mismatch between
yading@10 7230 the specified time and the time set by I<force_key_frames>.
yading@10 7231
yading@10 7232
yading@10 7233 =item B<segment_times> I<times>
yading@10 7234
yading@10 7235 Specify a list of split points. I<times> contains a list of comma
yading@10 7236 separated duration specifications, in increasing order. See also
yading@10 7237 the B<segment_time> option.
yading@10 7238
yading@10 7239
yading@10 7240 =item B<segment_frames> I<frames>
yading@10 7241
yading@10 7242 Specify a list of split video frame numbers. I<frames> contains a
yading@10 7243 list of comma separated integer numbers, in increasing order.
yading@10 7244
yading@10 7245 This option specifies to start a new segment whenever a reference
yading@10 7246 stream key frame is found and the sequential number (starting from 0)
yading@10 7247 of the frame is greater or equal to the next value in the list.
yading@10 7248
yading@10 7249
yading@10 7250 =item B<segment_wrap> I<limit>
yading@10 7251
yading@10 7252 Wrap around segment index once it reaches I<limit>.
yading@10 7253
yading@10 7254
yading@10 7255 =item B<segment_start_number> I<number>
yading@10 7256
yading@10 7257 Set the sequence number of the first segment. Defaults to C<0>.
yading@10 7258
yading@10 7259
yading@10 7260 =item B<reset_timestamps> I<1|0>
yading@10 7261
yading@10 7262 Reset timestamps at the begin of each segment, so that each segment
yading@10 7263 will start with near-zero timestamps. It is meant to ease the playback
yading@10 7264 of the generated segments. May not work with some combinations of
yading@10 7265 muxers/codecs. It is set to C<0> by default.
yading@10 7266
yading@10 7267 =back
yading@10 7268
yading@10 7269
yading@10 7270
yading@10 7271 =head3 Examples
yading@10 7272
yading@10 7273
yading@10 7274
yading@10 7275 =over 4
yading@10 7276
yading@10 7277
yading@10 7278 =item *
yading@10 7279
yading@10 7280 To remux the content of file F<in.mkv> to a list of segments
yading@10 7281 F<out-000.nut>, F<out-001.nut>, etc., and write the list of
yading@10 7282 generated segments to F<out.list>:
yading@10 7283
yading@10 7284 ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.list out%03d.nut
yading@10 7285
yading@10 7286
yading@10 7287
yading@10 7288 =item *
yading@10 7289
yading@10 7290 As the example above, but segment the input file according to the split
yading@10 7291 points specified by the I<segment_times> option:
yading@10 7292
yading@10 7293 ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 out%03d.nut
yading@10 7294
yading@10 7295
yading@10 7296
yading@10 7297 =item *
yading@10 7298
yading@10 7299 As the example above, but use the C<ffmpeg> I<force_key_frames>
yading@10 7300 option to force key frames in the input at the specified location, together
yading@10 7301 with the segment option I<segment_time_delta> to account for
yading@10 7302 possible roundings operated when setting key frame times.
yading@10 7303
yading@10 7304 ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -codec:v mpeg4 -codec:a pcm_s16le -map 0 \
yading@10 7305 -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
yading@10 7306
yading@10 7307 In order to force key frames on the input file, transcoding is
yading@10 7308 required.
yading@10 7309
yading@10 7310
yading@10 7311 =item *
yading@10 7312
yading@10 7313 Segment the input file by splitting the input file according to the
yading@10 7314 frame numbers sequence specified with the I<segment_frames> option:
yading@10 7315
yading@10 7316 ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_frames 100,200,300,500,800 out%03d.nut
yading@10 7317
yading@10 7318
yading@10 7319
yading@10 7320 =item *
yading@10 7321
yading@10 7322 To convert the F<in.mkv> to TS segments using the C<libx264>
yading@10 7323 and C<libfaac> encoders:
yading@10 7324
yading@10 7325 ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a libfaac -f ssegment -segment_list out.list out%03d.ts
yading@10 7326
yading@10 7327
yading@10 7328
yading@10 7329 =item *
yading@10 7330
yading@10 7331 Segment the input file, and create an M3U8 live playlist (can be used
yading@10 7332 as live HLS source):
yading@10 7333
yading@10 7334 ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
yading@10 7335 -segment_list_flags +live -segment_time 10 out%03d.mkv
yading@10 7336
yading@10 7337
yading@10 7338 =back
yading@10 7339
yading@10 7340
yading@10 7341
yading@10 7342 =head2 mp3
yading@10 7343
yading@10 7344
yading@10 7345 The MP3 muxer writes a raw MP3 stream with an ID3v2 header at the beginning and
yading@10 7346 optionally an ID3v1 tag at the end. ID3v2.3 and ID3v2.4 are supported, the
yading@10 7347 C<id3v2_version> option controls which one is used. The legacy ID3v1 tag is
yading@10 7348 not written by default, but may be enabled with the C<write_id3v1> option.
yading@10 7349
yading@10 7350 For seekable output the muxer also writes a Xing frame at the beginning, which
yading@10 7351 contains the number of frames in the file. It is useful for computing duration
yading@10 7352 of VBR files.
yading@10 7353
yading@10 7354 The muxer supports writing ID3v2 attached pictures (APIC frames). The pictures
yading@10 7355 are supplied to the muxer in form of a video stream with a single packet. There
yading@10 7356 can be any number of those streams, each will correspond to a single APIC frame.
yading@10 7357 The stream metadata tags I<title> and I<comment> map to APIC
yading@10 7358 I<description> and I<picture type> respectively. See
yading@10 7359 E<lt>B<http://id3.org/id3v2.4.0-frames>E<gt> for allowed picture types.
yading@10 7360
yading@10 7361 Note that the APIC frames must be written at the beginning, so the muxer will
yading@10 7362 buffer the audio frames until it gets all the pictures. It is therefore advised
yading@10 7363 to provide the pictures as soon as possible to avoid excessive buffering.
yading@10 7364
yading@10 7365 Examples:
yading@10 7366
yading@10 7367 Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
yading@10 7368
yading@10 7369 ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
yading@10 7370
yading@10 7371
yading@10 7372 To attach a picture to an mp3 file select both the audio and the picture stream
yading@10 7373 with C<map>:
yading@10 7374
yading@10 7375 ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
yading@10 7376 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
yading@10 7377
yading@10 7378
yading@10 7379
yading@10 7380 =head2 ogg
yading@10 7381
yading@10 7382
yading@10 7383 Ogg container muxer.
yading@10 7384
yading@10 7385
yading@10 7386 =over 4
yading@10 7387
yading@10 7388
yading@10 7389 =item B<-page_duration> I<duration>
yading@10 7390
yading@10 7391 Preferred page duration, in microseconds. The muxer will attempt to create
yading@10 7392 pages that are approximately I<duration> microseconds long. This allows the
yading@10 7393 user to compromise between seek granularity and container overhead. The default
yading@10 7394 is 1 second. A value of 0 will fill all segments, making pages as large as
yading@10 7395 possible. A value of 1 will effectively use 1 packet-per-page in most
yading@10 7396 situations, giving a small seek granularity at the cost of additional container
yading@10 7397 overhead.
yading@10 7398
yading@10 7399 =back
yading@10 7400
yading@10 7401
yading@10 7402
yading@10 7403 =head2 tee
yading@10 7404
yading@10 7405
yading@10 7406 The tee muxer can be used to write the same data to several files or any
yading@10 7407 other kind of muxer. It can be used, for example, to both stream a video to
yading@10 7408 the network and save it to disk at the same time.
yading@10 7409
yading@10 7410 It is different from specifying several outputs to the B<ffmpeg>
yading@10 7411 command-line tool because the audio and video data will be encoded only once
yading@10 7412 with the tee muxer; encoding can be a very expensive process. It is not
yading@10 7413 useful when using the libavformat API directly because it is then possible
yading@10 7414 to feed the same packets to several muxers directly.
yading@10 7415
yading@10 7416 The slave outputs are specified in the file name given to the muxer,
yading@10 7417 separated by '|'. If any of the slave name contains the '|' separator,
yading@10 7418 leading or trailing spaces or any special character, it must be
yading@10 7419 escaped (see the ``Quoting and escaping'' section in the ffmpeg-utils
yading@10 7420 manual).
yading@10 7421
yading@10 7422 Options can be specified for each slave by prepending them as a list of
yading@10 7423 I<key>=I<value> pairs separated by ':', between square brackets. If
yading@10 7424 the options values contain a special character or the ':' separator, they
yading@10 7425 must be escaped; note that this is a second level escaping.
yading@10 7426
yading@10 7427 Example: encode something and both archive it in a WebM file and stream it
yading@10 7428 as MPEG-TS over UDP (the streams need to be explicitly mapped):
yading@10 7429
yading@10 7430
yading@10 7431 ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
yading@10 7432 "archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
yading@10 7433
yading@10 7434
yading@10 7435 Note: some codecs may need different options depending on the output format;
yading@10 7436 the auto-detection of this can not work with the tee muxer. The main example
yading@10 7437 is the B<global_header> flag.
yading@10 7438
yading@10 7439
yading@10 7440 =head1 METADATA
yading@10 7441
yading@10 7442
yading@10 7443 FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
yading@10 7444 INI-like text file and then load it back using the metadata muxer/demuxer.
yading@10 7445
yading@10 7446 The file format is as follows:
yading@10 7447
yading@10 7448 =over 4
yading@10 7449
yading@10 7450
yading@10 7451
yading@10 7452 =item 1.
yading@10 7453
yading@10 7454 A file consists of a header and a number of metadata tags divided into sections,
yading@10 7455 each on its own line.
yading@10 7456
yading@10 7457
yading@10 7458 =item 2.
yading@10 7459
yading@10 7460 The header is a ';FFMETADATA' string, followed by a version number (now 1).
yading@10 7461
yading@10 7462
yading@10 7463 =item 3.
yading@10 7464
yading@10 7465 Metadata tags are of the form 'key=value'
yading@10 7466
yading@10 7467
yading@10 7468 =item 4.
yading@10 7469
yading@10 7470 Immediately after header follows global metadata
yading@10 7471
yading@10 7472
yading@10 7473 =item 5.
yading@10 7474
yading@10 7475 After global metadata there may be sections with per-stream/per-chapter
yading@10 7476 metadata.
yading@10 7477
yading@10 7478
yading@10 7479 =item 6.
yading@10 7480
yading@10 7481 A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
yading@10 7482 brackets ('[', ']') and ends with next section or end of file.
yading@10 7483
yading@10 7484
yading@10 7485 =item 7.
yading@10 7486
yading@10 7487 At the beginning of a chapter section there may be an optional timebase to be
yading@10 7488 used for start/end values. It must be in form 'TIMEBASE=num/den', where num and
yading@10 7489 den are integers. If the timebase is missing then start/end times are assumed to
yading@10 7490 be in milliseconds.
yading@10 7491 Next a chapter section must contain chapter start and end times in form
yading@10 7492 'START=num', 'END=num', where num is a positive integer.
yading@10 7493
yading@10 7494
yading@10 7495 =item 8.
yading@10 7496
yading@10 7497 Empty lines and lines starting with ';' or '#' are ignored.
yading@10 7498
yading@10 7499
yading@10 7500 =item 9.
yading@10 7501
yading@10 7502 Metadata keys or values containing special characters ('=', ';', '#', '\' and a
yading@10 7503 newline) must be escaped with a backslash '\'.
yading@10 7504
yading@10 7505
yading@10 7506 =item 10.
yading@10 7507
yading@10 7508 Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of
yading@10 7509 the tag (in the example above key is 'foo ', value is ' bar').
yading@10 7510
yading@10 7511 =back
yading@10 7512
yading@10 7513
yading@10 7514 A ffmetadata file might look like this:
yading@10 7515
yading@10 7516 ;FFMETADATA1
yading@10 7517 title=bike\\shed
yading@10 7518 ;this is a comment
yading@10 7519 artist=FFmpeg troll team
yading@10 7520
yading@10 7521 [CHAPTER]
yading@10 7522 TIMEBASE=1/1000
yading@10 7523 START=0
yading@10 7524 #chapter ends at 0:01:00
yading@10 7525 END=60000
yading@10 7526 title=chapter \#1
yading@10 7527 [STREAM]
yading@10 7528 title=multi\
yading@10 7529 line
yading@10 7530
yading@10 7531
yading@10 7532 =head1 PROTOCOLS
yading@10 7533
yading@10 7534
yading@10 7535 Protocols are configured elements in FFmpeg which allow to access
yading@10 7536 resources which require the use of a particular protocol.
yading@10 7537
yading@10 7538 When you configure your FFmpeg build, all the supported protocols are
yading@10 7539 enabled by default. You can list all available ones using the
yading@10 7540 configure option "--list-protocols".
yading@10 7541
yading@10 7542 You can disable all the protocols using the configure option
yading@10 7543 "--disable-protocols", and selectively enable a protocol using the
yading@10 7544 option "--enable-protocol=I<PROTOCOL>", or you can disable a
yading@10 7545 particular protocol using the option
yading@10 7546 "--disable-protocol=I<PROTOCOL>".
yading@10 7547
yading@10 7548 The option "-protocols" of the ff* tools will display the list of
yading@10 7549 supported protocols.
yading@10 7550
yading@10 7551 A description of the currently available protocols follows.
yading@10 7552
yading@10 7553
yading@10 7554 =head2 bluray
yading@10 7555
yading@10 7556
yading@10 7557 Read BluRay playlist.
yading@10 7558
yading@10 7559 The accepted options are:
yading@10 7560
yading@10 7561 =over 4
yading@10 7562
yading@10 7563
yading@10 7564
yading@10 7565 =item B<angle>
yading@10 7566
yading@10 7567 BluRay angle
yading@10 7568
yading@10 7569
yading@10 7570 =item B<chapter>
yading@10 7571
yading@10 7572 Start chapter (1...N)
yading@10 7573
yading@10 7574
yading@10 7575 =item B<playlist>
yading@10 7576
yading@10 7577 Playlist to read (BDMV/PLAYLIST/?????.mpls)
yading@10 7578
yading@10 7579
yading@10 7580 =back
yading@10 7581
yading@10 7582
yading@10 7583 Examples:
yading@10 7584
yading@10 7585 Read longest playlist from BluRay mounted to /mnt/bluray:
yading@10 7586
yading@10 7587 bluray:/mnt/bluray
yading@10 7588
yading@10 7589
yading@10 7590 Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
yading@10 7591
yading@10 7592 -playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
yading@10 7593
yading@10 7594
yading@10 7595
yading@10 7596 =head2 concat
yading@10 7597
yading@10 7598
yading@10 7599 Physical concatenation protocol.
yading@10 7600
yading@10 7601 Allow to read and seek from many resource in sequence as if they were
yading@10 7602 a unique resource.
yading@10 7603
yading@10 7604 A URL accepted by this protocol has the syntax:
yading@10 7605
yading@10 7606 concat:<URL1>|<URL2>|...|<URLN>
yading@10 7607
yading@10 7608
yading@10 7609 where I<URL1>, I<URL2>, ..., I<URLN> are the urls of the
yading@10 7610 resource to be concatenated, each one possibly specifying a distinct
yading@10 7611 protocol.
yading@10 7612
yading@10 7613 For example to read a sequence of files F<split1.mpeg>,
yading@10 7614 F<split2.mpeg>, F<split3.mpeg> with B<ffplay> use the
yading@10 7615 command:
yading@10 7616
yading@10 7617 ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
yading@10 7618
yading@10 7619
yading@10 7620 Note that you may need to escape the character "|" which is special for
yading@10 7621 many shells.
yading@10 7622
yading@10 7623
yading@10 7624 =head2 data
yading@10 7625
yading@10 7626
yading@10 7627 Data in-line in the URI. See E<lt>B<http://en.wikipedia.org/wiki/Data_URI_scheme>E<gt>.
yading@10 7628
yading@10 7629 For example, to convert a GIF file given inline with B<ffmpeg>:
yading@10 7630
yading@10 7631 ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png
yading@10 7632
yading@10 7633
yading@10 7634
yading@10 7635 =head2 file
yading@10 7636
yading@10 7637
yading@10 7638 File access protocol.
yading@10 7639
yading@10 7640 Allow to read from or read to a file.
yading@10 7641
yading@10 7642 For example to read from a file F<input.mpeg> with B<ffmpeg>
yading@10 7643 use the command:
yading@10 7644
yading@10 7645 ffmpeg -i file:input.mpeg output.mpeg
yading@10 7646
yading@10 7647
yading@10 7648 The ff* tools default to the file protocol, that is a resource
yading@10 7649 specified with the name "FILE.mpeg" is interpreted as the URL
yading@10 7650 "file:FILE.mpeg".
yading@10 7651
yading@10 7652
yading@10 7653 =head2 gopher
yading@10 7654
yading@10 7655
yading@10 7656 Gopher protocol.
yading@10 7657
yading@10 7658
yading@10 7659 =head2 hls
yading@10 7660
yading@10 7661
yading@10 7662 Read Apple HTTP Live Streaming compliant segmented stream as
yading@10 7663 a uniform one. The M3U8 playlists describing the segments can be
yading@10 7664 remote HTTP resources or local files, accessed using the standard
yading@10 7665 file protocol.
yading@10 7666 The nested protocol is declared by specifying
yading@10 7667 "+I<proto>" after the hls URI scheme name, where I<proto>
yading@10 7668 is either "file" or "http".
yading@10 7669
yading@10 7670
yading@10 7671 hls+http://host/path/to/remote/resource.m3u8
yading@10 7672 hls+file://path/to/local/resource.m3u8
yading@10 7673
yading@10 7674
yading@10 7675 Using this protocol is discouraged - the hls demuxer should work
yading@10 7676 just as well (if not, please report the issues) and is more complete.
yading@10 7677 To use the hls demuxer instead, simply use the direct URLs to the
yading@10 7678 m3u8 files.
yading@10 7679
yading@10 7680
yading@10 7681 =head2 http
yading@10 7682
yading@10 7683
yading@10 7684 HTTP (Hyper Text Transfer Protocol).
yading@10 7685
yading@10 7686 This protocol accepts the following options.
yading@10 7687
yading@10 7688
yading@10 7689 =over 4
yading@10 7690
yading@10 7691
yading@10 7692 =item B<seekable>
yading@10 7693
yading@10 7694 Control seekability of connection. If set to 1 the resource is
yading@10 7695 supposed to be seekable, if set to 0 it is assumed not to be seekable,
yading@10 7696 if set to -1 it will try to autodetect if it is seekable. Default
yading@10 7697 value is -1.
yading@10 7698
yading@10 7699
yading@10 7700 =item B<chunked_post>
yading@10 7701
yading@10 7702 If set to 1 use chunked transfer-encoding for posts, default is 1.
yading@10 7703
yading@10 7704
yading@10 7705 =item B<headers>
yading@10 7706
yading@10 7707 Set custom HTTP headers, can override built in default headers. The
yading@10 7708 value must be a string encoding the headers.
yading@10 7709
yading@10 7710
yading@10 7711 =item B<content_type>
yading@10 7712
yading@10 7713 Force a content type.
yading@10 7714
yading@10 7715
yading@10 7716 =item B<user-agent>
yading@10 7717
yading@10 7718 Override User-Agent header. If not specified the protocol will use a
yading@10 7719 string describing the libavformat build.
yading@10 7720
yading@10 7721
yading@10 7722 =item B<multiple_requests>
yading@10 7723
yading@10 7724 Use persistent connections if set to 1. By default it is 0.
yading@10 7725
yading@10 7726
yading@10 7727 =item B<post_data>
yading@10 7728
yading@10 7729 Set custom HTTP post data.
yading@10 7730
yading@10 7731
yading@10 7732 =item B<timeout>
yading@10 7733
yading@10 7734 Set timeout of socket I/O operations used by the underlying low level
yading@10 7735 operation. By default it is set to -1, which means that the timeout is
yading@10 7736 not specified.
yading@10 7737
yading@10 7738
yading@10 7739 =item B<mime_type>
yading@10 7740
yading@10 7741 Set MIME type.
yading@10 7742
yading@10 7743
yading@10 7744 =item B<cookies>
yading@10 7745
yading@10 7746 Set the cookies to be sent in future requests. The format of each cookie is the
yading@10 7747 same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
yading@10 7748 delimited by a newline character.
yading@10 7749
yading@10 7750 =back
yading@10 7751
yading@10 7752
yading@10 7753
yading@10 7754 =head3 HTTP Cookies
yading@10 7755
yading@10 7756
yading@10 7757 Some HTTP requests will be denied unless cookie values are passed in with the
yading@10 7758 request. The B<cookies> option allows these cookies to be specified. At
yading@10 7759 the very least, each cookie must specify a value along with a path and domain.
yading@10 7760 HTTP requests that match both the domain and path will automatically include the
yading@10 7761 cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
yading@10 7762 by a newline.
yading@10 7763
yading@10 7764 The required syntax to play a stream specifying a cookie is:
yading@10 7765
yading@10 7766 ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
yading@10 7767
yading@10 7768
yading@10 7769
yading@10 7770 =head2 mmst
yading@10 7771
yading@10 7772
yading@10 7773 MMS (Microsoft Media Server) protocol over TCP.
yading@10 7774
yading@10 7775
yading@10 7776 =head2 mmsh
yading@10 7777
yading@10 7778
yading@10 7779 MMS (Microsoft Media Server) protocol over HTTP.
yading@10 7780
yading@10 7781 The required syntax is:
yading@10 7782
yading@10 7783 mmsh://<server>[:<port>][/<app>][/<playpath>]
yading@10 7784
yading@10 7785
yading@10 7786
yading@10 7787 =head2 md5
yading@10 7788
yading@10 7789
yading@10 7790 MD5 output protocol.
yading@10 7791
yading@10 7792 Computes the MD5 hash of the data to be written, and on close writes
yading@10 7793 this to the designated output or stdout if none is specified. It can
yading@10 7794 be used to test muxers without writing an actual file.
yading@10 7795
yading@10 7796 Some examples follow.
yading@10 7797
yading@10 7798 # Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
yading@10 7799 ffmpeg -i input.flv -f avi -y md5:output.avi.md5
yading@10 7800
yading@10 7801 # Write the MD5 hash of the encoded AVI file to stdout.
yading@10 7802 ffmpeg -i input.flv -f avi -y md5:
yading@10 7803
yading@10 7804
yading@10 7805 Note that some formats (typically MOV) require the output protocol to
yading@10 7806 be seekable, so they will fail with the MD5 output protocol.
yading@10 7807
yading@10 7808
yading@10 7809 =head2 pipe
yading@10 7810
yading@10 7811
yading@10 7812 UNIX pipe access protocol.
yading@10 7813
yading@10 7814 Allow to read and write from UNIX pipes.
yading@10 7815
yading@10 7816 The accepted syntax is:
yading@10 7817
yading@10 7818 pipe:[<number>]
yading@10 7819
yading@10 7820
yading@10 7821 I<number> is the number corresponding to the file descriptor of the
yading@10 7822 pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If I<number>
yading@10 7823 is not specified, by default the stdout file descriptor will be used
yading@10 7824 for writing, stdin for reading.
yading@10 7825
yading@10 7826 For example to read from stdin with B<ffmpeg>:
yading@10 7827
yading@10 7828 cat test.wav | ffmpeg -i pipe:0
yading@10 7829 # ...this is the same as...
yading@10 7830 cat test.wav | ffmpeg -i pipe:
yading@10 7831
yading@10 7832
yading@10 7833 For writing to stdout with B<ffmpeg>:
yading@10 7834
yading@10 7835 ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
yading@10 7836 # ...this is the same as...
yading@10 7837 ffmpeg -i test.wav -f avi pipe: | cat > test.avi
yading@10 7838
yading@10 7839
yading@10 7840 Note that some formats (typically MOV), require the output protocol to
yading@10 7841 be seekable, so they will fail with the pipe output protocol.
yading@10 7842
yading@10 7843
yading@10 7844 =head2 rtmp
yading@10 7845
yading@10 7846
yading@10 7847 Real-Time Messaging Protocol.
yading@10 7848
yading@10 7849 The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
yading@10 7850 content across a TCP/IP network.
yading@10 7851
yading@10 7852 The required syntax is:
yading@10 7853
yading@10 7854 rtmp://<server>[:<port>][/<app>][/<instance>][/<playpath>]
yading@10 7855
yading@10 7856
yading@10 7857 The accepted parameters are:
yading@10 7858
yading@10 7859 =over 4
yading@10 7860
yading@10 7861
yading@10 7862
yading@10 7863 =item B<server>
yading@10 7864
yading@10 7865 The address of the RTMP server.
yading@10 7866
yading@10 7867
yading@10 7868 =item B<port>
yading@10 7869
yading@10 7870 The number of the TCP port to use (by default is 1935).
yading@10 7871
yading@10 7872
yading@10 7873 =item B<app>
yading@10 7874
yading@10 7875 It is the name of the application to access. It usually corresponds to
yading@10 7876 the path where the application is installed on the RTMP server
yading@10 7877 (e.g. F</ondemand/>, F</flash/live/>, etc.). You can override
yading@10 7878 the value parsed from the URI through the C<rtmp_app> option, too.
yading@10 7879
yading@10 7880
yading@10 7881 =item B<playpath>
yading@10 7882
yading@10 7883 It is the path or name of the resource to play with reference to the
yading@10 7884 application specified in I<app>, may be prefixed by "mp4:". You
yading@10 7885 can override the value parsed from the URI through the C<rtmp_playpath>
yading@10 7886 option, too.
yading@10 7887
yading@10 7888
yading@10 7889 =item B<listen>
yading@10 7890
yading@10 7891 Act as a server, listening for an incoming connection.
yading@10 7892
yading@10 7893
yading@10 7894 =item B<timeout>
yading@10 7895
yading@10 7896 Maximum time to wait for the incoming connection. Implies listen.
yading@10 7897
yading@10 7898 =back
yading@10 7899
yading@10 7900
yading@10 7901 Additionally, the following parameters can be set via command line options
yading@10 7902 (or in code via C<AVOption>s):
yading@10 7903
yading@10 7904 =over 4
yading@10 7905
yading@10 7906
yading@10 7907
yading@10 7908 =item B<rtmp_app>
yading@10 7909
yading@10 7910 Name of application to connect on the RTMP server. This option
yading@10 7911 overrides the parameter specified in the URI.
yading@10 7912
yading@10 7913
yading@10 7914 =item B<rtmp_buffer>
yading@10 7915
yading@10 7916 Set the client buffer time in milliseconds. The default is 3000.
yading@10 7917
yading@10 7918
yading@10 7919 =item B<rtmp_conn>
yading@10 7920
yading@10 7921 Extra arbitrary AMF connection parameters, parsed from a string,
yading@10 7922 e.g. like C<B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0>.
yading@10 7923 Each value is prefixed by a single character denoting the type,
yading@10 7924 B for Boolean, N for number, S for string, O for object, or Z for null,
yading@10 7925 followed by a colon. For Booleans the data must be either 0 or 1 for
yading@10 7926 FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or
yading@10 7927 1 to end or begin an object, respectively. Data items in subobjects may
yading@10 7928 be named, by prefixing the type with 'N' and specifying the name before
yading@10 7929 the value (i.e. C<NB:myFlag:1>). This option may be used multiple
yading@10 7930 times to construct arbitrary AMF sequences.
yading@10 7931
yading@10 7932
yading@10 7933 =item B<rtmp_flashver>
yading@10 7934
yading@10 7935 Version of the Flash plugin used to run the SWF player. The default
yading@10 7936 is LNX 9,0,124,2.
yading@10 7937
yading@10 7938
yading@10 7939 =item B<rtmp_flush_interval>
yading@10 7940
yading@10 7941 Number of packets flushed in the same request (RTMPT only). The default
yading@10 7942 is 10.
yading@10 7943
yading@10 7944
yading@10 7945 =item B<rtmp_live>
yading@10 7946
yading@10 7947 Specify that the media is a live stream. No resuming or seeking in
yading@10 7948 live streams is possible. The default value is C<any>, which means the
yading@10 7949 subscriber first tries to play the live stream specified in the
yading@10 7950 playpath. If a live stream of that name is not found, it plays the
yading@10 7951 recorded stream. The other possible values are C<live> and
yading@10 7952 C<recorded>.
yading@10 7953
yading@10 7954
yading@10 7955 =item B<rtmp_pageurl>
yading@10 7956
yading@10 7957 URL of the web page in which the media was embedded. By default no
yading@10 7958 value will be sent.
yading@10 7959
yading@10 7960
yading@10 7961 =item B<rtmp_playpath>
yading@10 7962
yading@10 7963 Stream identifier to play or to publish. This option overrides the
yading@10 7964 parameter specified in the URI.
yading@10 7965
yading@10 7966
yading@10 7967 =item B<rtmp_subscribe>
yading@10 7968
yading@10 7969 Name of live stream to subscribe to. By default no value will be sent.
yading@10 7970 It is only sent if the option is specified or if rtmp_live
yading@10 7971 is set to live.
yading@10 7972
yading@10 7973
yading@10 7974 =item B<rtmp_swfhash>
yading@10 7975
yading@10 7976 SHA256 hash of the decompressed SWF file (32 bytes).
yading@10 7977
yading@10 7978
yading@10 7979 =item B<rtmp_swfsize>
yading@10 7980
yading@10 7981 Size of the decompressed SWF file, required for SWFVerification.
yading@10 7982
yading@10 7983
yading@10 7984 =item B<rtmp_swfurl>
yading@10 7985
yading@10 7986 URL of the SWF player for the media. By default no value will be sent.
yading@10 7987
yading@10 7988
yading@10 7989 =item B<rtmp_swfverify>
yading@10 7990
yading@10 7991 URL to player swf file, compute hash/size automatically.
yading@10 7992
yading@10 7993
yading@10 7994 =item B<rtmp_tcurl>
yading@10 7995
yading@10 7996 URL of the target stream. Defaults to proto://host[:port]/app.
yading@10 7997
yading@10 7998
yading@10 7999 =back
yading@10 8000
yading@10 8001
yading@10 8002 For example to read with B<ffplay> a multimedia resource named
yading@10 8003 "sample" from the application "vod" from an RTMP server "myserver":
yading@10 8004
yading@10 8005 ffplay rtmp://myserver/vod/sample
yading@10 8006
yading@10 8007
yading@10 8008
yading@10 8009 =head2 rtmpe
yading@10 8010
yading@10 8011
yading@10 8012 Encrypted Real-Time Messaging Protocol.
yading@10 8013
yading@10 8014 The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
yading@10 8015 streaming multimedia content within standard cryptographic primitives,
yading@10 8016 consisting of Diffie-Hellman key exchange and HMACSHA256, generating
yading@10 8017 a pair of RC4 keys.
yading@10 8018
yading@10 8019
yading@10 8020 =head2 rtmps
yading@10 8021
yading@10 8022
yading@10 8023 Real-Time Messaging Protocol over a secure SSL connection.
yading@10 8024
yading@10 8025 The Real-Time Messaging Protocol (RTMPS) is used for streaming
yading@10 8026 multimedia content across an encrypted connection.
yading@10 8027
yading@10 8028
yading@10 8029 =head2 rtmpt
yading@10 8030
yading@10 8031
yading@10 8032 Real-Time Messaging Protocol tunneled through HTTP.
yading@10 8033
yading@10 8034 The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
yading@10 8035 for streaming multimedia content within HTTP requests to traverse
yading@10 8036 firewalls.
yading@10 8037
yading@10 8038
yading@10 8039 =head2 rtmpte
yading@10 8040
yading@10 8041
yading@10 8042 Encrypted Real-Time Messaging Protocol tunneled through HTTP.
yading@10 8043
yading@10 8044 The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
yading@10 8045 is used for streaming multimedia content within HTTP requests to traverse
yading@10 8046 firewalls.
yading@10 8047
yading@10 8048
yading@10 8049 =head2 rtmpts
yading@10 8050
yading@10 8051
yading@10 8052 Real-Time Messaging Protocol tunneled through HTTPS.
yading@10 8053
yading@10 8054 The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
yading@10 8055 for streaming multimedia content within HTTPS requests to traverse
yading@10 8056 firewalls.
yading@10 8057
yading@10 8058
yading@10 8059 =head2 rtmp, rtmpe, rtmps, rtmpt, rtmpte
yading@10 8060
yading@10 8061
yading@10 8062 Real-Time Messaging Protocol and its variants supported through
yading@10 8063 librtmp.
yading@10 8064
yading@10 8065 Requires the presence of the librtmp headers and library during
yading@10 8066 configuration. You need to explicitly configure the build with
yading@10 8067 "--enable-librtmp". If enabled this will replace the native RTMP
yading@10 8068 protocol.
yading@10 8069
yading@10 8070 This protocol provides most client functions and a few server
yading@10 8071 functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
yading@10 8072 encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
yading@10 8073 variants of these encrypted types (RTMPTE, RTMPTS).
yading@10 8074
yading@10 8075 The required syntax is:
yading@10 8076
yading@10 8077 <rtmp_proto>://<server>[:<port>][/<app>][/<playpath>] <options>
yading@10 8078
yading@10 8079
yading@10 8080 where I<rtmp_proto> is one of the strings "rtmp", "rtmpt", "rtmpe",
yading@10 8081 "rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and
yading@10 8082 I<server>, I<port>, I<app> and I<playpath> have the same
yading@10 8083 meaning as specified for the RTMP native protocol.
yading@10 8084 I<options> contains a list of space-separated options of the form
yading@10 8085 I<key>=I<val>.
yading@10 8086
yading@10 8087 See the librtmp manual page (man 3 librtmp) for more information.
yading@10 8088
yading@10 8089 For example, to stream a file in real-time to an RTMP server using
yading@10 8090 B<ffmpeg>:
yading@10 8091
yading@10 8092 ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
yading@10 8093
yading@10 8094
yading@10 8095 To play the same stream using B<ffplay>:
yading@10 8096
yading@10 8097 ffplay "rtmp://myserver/live/mystream live=1"
yading@10 8098
yading@10 8099
yading@10 8100
yading@10 8101 =head2 rtp
yading@10 8102
yading@10 8103
yading@10 8104 Real-Time Protocol.
yading@10 8105
yading@10 8106
yading@10 8107 =head2 rtsp
yading@10 8108
yading@10 8109
yading@10 8110 RTSP is not technically a protocol handler in libavformat, it is a demuxer
yading@10 8111 and muxer. The demuxer supports both normal RTSP (with data transferred
yading@10 8112 over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
yading@10 8113 data transferred over RDT).
yading@10 8114
yading@10 8115 The muxer can be used to send a stream using RTSP ANNOUNCE to a server
yading@10 8116 supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's
yading@10 8117 E<lt>B<http://github.com/revmischa/rtsp-server>E<gt>).
yading@10 8118
yading@10 8119 The required syntax for a RTSP url is:
yading@10 8120
yading@10 8121 rtsp://<hostname>[:<port>]/<path>
yading@10 8122
yading@10 8123
yading@10 8124 The following options (set on the B<ffmpeg>/B<ffplay> command
yading@10 8125 line, or set in code via C<AVOption>s or in C<avformat_open_input>),
yading@10 8126 are supported:
yading@10 8127
yading@10 8128 Flags for C<rtsp_transport>:
yading@10 8129
yading@10 8130
yading@10 8131 =over 4
yading@10 8132
yading@10 8133
yading@10 8134
yading@10 8135 =item B<udp>
yading@10 8136
yading@10 8137 Use UDP as lower transport protocol.
yading@10 8138
yading@10 8139
yading@10 8140 =item B<tcp>
yading@10 8141
yading@10 8142 Use TCP (interleaving within the RTSP control channel) as lower
yading@10 8143 transport protocol.
yading@10 8144
yading@10 8145
yading@10 8146 =item B<udp_multicast>
yading@10 8147
yading@10 8148 Use UDP multicast as lower transport protocol.
yading@10 8149
yading@10 8150
yading@10 8151 =item B<http>
yading@10 8152
yading@10 8153 Use HTTP tunneling as lower transport protocol, which is useful for
yading@10 8154 passing proxies.
yading@10 8155
yading@10 8156 =back
yading@10 8157
yading@10 8158
yading@10 8159 Multiple lower transport protocols may be specified, in that case they are
yading@10 8160 tried one at a time (if the setup of one fails, the next one is tried).
yading@10 8161 For the muxer, only the C<tcp> and C<udp> options are supported.
yading@10 8162
yading@10 8163 Flags for C<rtsp_flags>:
yading@10 8164
yading@10 8165
yading@10 8166 =over 4
yading@10 8167
yading@10 8168
yading@10 8169 =item B<filter_src>
yading@10 8170
yading@10 8171 Accept packets only from negotiated peer address and port.
yading@10 8172
yading@10 8173 =item B<listen>
yading@10 8174
yading@10 8175 Act as a server, listening for an incoming connection.
yading@10 8176
yading@10 8177 =back
yading@10 8178
yading@10 8179
yading@10 8180 When receiving data over UDP, the demuxer tries to reorder received packets
yading@10 8181 (since they may arrive out of order, or packets may get lost totally). This
yading@10 8182 can be disabled by setting the maximum demuxing delay to zero (via
yading@10 8183 the C<max_delay> field of AVFormatContext).
yading@10 8184
yading@10 8185 When watching multi-bitrate Real-RTSP streams with B<ffplay>, the
yading@10 8186 streams to display can be chosen with C<-vst> I<n> and
yading@10 8187 C<-ast> I<n> for video and audio respectively, and can be switched
yading@10 8188 on the fly by pressing C<v> and C<a>.
yading@10 8189
yading@10 8190 Example command lines:
yading@10 8191
yading@10 8192 To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
yading@10 8193
yading@10 8194
yading@10 8195 ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
yading@10 8196
yading@10 8197
yading@10 8198 To watch a stream tunneled over HTTP:
yading@10 8199
yading@10 8200
yading@10 8201 ffplay -rtsp_transport http rtsp://server/video.mp4
yading@10 8202
yading@10 8203
yading@10 8204 To send a stream in realtime to a RTSP server, for others to watch:
yading@10 8205
yading@10 8206
yading@10 8207 ffmpeg -re -i <input> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
yading@10 8208
yading@10 8209
yading@10 8210 To receive a stream in realtime:
yading@10 8211
yading@10 8212
yading@10 8213 ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <output>
yading@10 8214
yading@10 8215
yading@10 8216
yading@10 8217 =over 4
yading@10 8218
yading@10 8219
yading@10 8220 =item B<stimeout>
yading@10 8221
yading@10 8222 Socket IO timeout in micro seconds.
yading@10 8223
yading@10 8224 =back
yading@10 8225
yading@10 8226
yading@10 8227
yading@10 8228 =head2 sap
yading@10 8229
yading@10 8230
yading@10 8231 Session Announcement Protocol (RFC 2974). This is not technically a
yading@10 8232 protocol handler in libavformat, it is a muxer and demuxer.
yading@10 8233 It is used for signalling of RTP streams, by announcing the SDP for the
yading@10 8234 streams regularly on a separate port.
yading@10 8235
yading@10 8236
yading@10 8237 =head3 Muxer
yading@10 8238
yading@10 8239
yading@10 8240 The syntax for a SAP url given to the muxer is:
yading@10 8241
yading@10 8242 sap://<destination>[:<port>][?<options>]
yading@10 8243
yading@10 8244
yading@10 8245 The RTP packets are sent to I<destination> on port I<port>,
yading@10 8246 or to port 5004 if no port is specified.
yading@10 8247 I<options> is a C<&>-separated list. The following options
yading@10 8248 are supported:
yading@10 8249
yading@10 8250
yading@10 8251 =over 4
yading@10 8252
yading@10 8253
yading@10 8254
yading@10 8255 =item B<announce_addr=>I<address>
yading@10 8256
yading@10 8257 Specify the destination IP address for sending the announcements to.
yading@10 8258 If omitted, the announcements are sent to the commonly used SAP
yading@10 8259 announcement multicast address 224.2.127.254 (sap.mcast.net), or
yading@10 8260 ff0e::2:7ffe if I<destination> is an IPv6 address.
yading@10 8261
yading@10 8262
yading@10 8263 =item B<announce_port=>I<port>
yading@10 8264
yading@10 8265 Specify the port to send the announcements on, defaults to
yading@10 8266 9875 if not specified.
yading@10 8267
yading@10 8268
yading@10 8269 =item B<ttl=>I<ttl>
yading@10 8270
yading@10 8271 Specify the time to live value for the announcements and RTP packets,
yading@10 8272 defaults to 255.
yading@10 8273
yading@10 8274
yading@10 8275 =item B<same_port=>I<0|1>
yading@10 8276
yading@10 8277 If set to 1, send all RTP streams on the same port pair. If zero (the
yading@10 8278 default), all streams are sent on unique ports, with each stream on a
yading@10 8279 port 2 numbers higher than the previous.
yading@10 8280 VLC/Live555 requires this to be set to 1, to be able to receive the stream.
yading@10 8281 The RTP stack in libavformat for receiving requires all streams to be sent
yading@10 8282 on unique ports.
yading@10 8283
yading@10 8284 =back
yading@10 8285
yading@10 8286
yading@10 8287 Example command lines follow.
yading@10 8288
yading@10 8289 To broadcast a stream on the local subnet, for watching in VLC:
yading@10 8290
yading@10 8291
yading@10 8292 ffmpeg -re -i <input> -f sap sap://224.0.0.255?same_port=1
yading@10 8293
yading@10 8294
yading@10 8295 Similarly, for watching in B<ffplay>:
yading@10 8296
yading@10 8297
yading@10 8298 ffmpeg -re -i <input> -f sap sap://224.0.0.255
yading@10 8299
yading@10 8300
yading@10 8301 And for watching in B<ffplay>, over IPv6:
yading@10 8302
yading@10 8303
yading@10 8304 ffmpeg -re -i <input> -f sap sap://[ff0e::1:2:3:4]
yading@10 8305
yading@10 8306
yading@10 8307
yading@10 8308 =head3 Demuxer
yading@10 8309
yading@10 8310
yading@10 8311 The syntax for a SAP url given to the demuxer is:
yading@10 8312
yading@10 8313 sap://[<address>][:<port>]
yading@10 8314
yading@10 8315
yading@10 8316 I<address> is the multicast address to listen for announcements on,
yading@10 8317 if omitted, the default 224.2.127.254 (sap.mcast.net) is used. I<port>
yading@10 8318 is the port that is listened on, 9875 if omitted.
yading@10 8319
yading@10 8320 The demuxers listens for announcements on the given address and port.
yading@10 8321 Once an announcement is received, it tries to receive that particular stream.
yading@10 8322
yading@10 8323 Example command lines follow.
yading@10 8324
yading@10 8325 To play back the first stream announced on the normal SAP multicast address:
yading@10 8326
yading@10 8327
yading@10 8328 ffplay sap://
yading@10 8329
yading@10 8330
yading@10 8331 To play back the first stream announced on one the default IPv6 SAP multicast address:
yading@10 8332
yading@10 8333
yading@10 8334 ffplay sap://[ff0e::2:7ffe]
yading@10 8335
yading@10 8336
yading@10 8337
yading@10 8338 =head2 tcp
yading@10 8339
yading@10 8340
yading@10 8341 Trasmission Control Protocol.
yading@10 8342
yading@10 8343 The required syntax for a TCP url is:
yading@10 8344
yading@10 8345 tcp://<hostname>:<port>[?<options>]
yading@10 8346
yading@10 8347
yading@10 8348
yading@10 8349 =over 4
yading@10 8350
yading@10 8351
yading@10 8352
yading@10 8353 =item B<listen>
yading@10 8354
yading@10 8355 Listen for an incoming connection
yading@10 8356
yading@10 8357
yading@10 8358 =item B<timeout=>I<microseconds>
yading@10 8359
yading@10 8360 In read mode: if no data arrived in more than this time interval, raise error.
yading@10 8361 In write mode: if socket cannot be written in more than this time interval, raise error.
yading@10 8362 This also sets timeout on TCP connection establishing.
yading@10 8363
yading@10 8364
yading@10 8365 ffmpeg -i <input> -f <format> tcp://<hostname>:<port>?listen
yading@10 8366 ffplay tcp://<hostname>:<port>
yading@10 8367
yading@10 8368
yading@10 8369
yading@10 8370 =back
yading@10 8371
yading@10 8372
yading@10 8373
yading@10 8374 =head2 tls
yading@10 8375
yading@10 8376
yading@10 8377 Transport Layer Security/Secure Sockets Layer
yading@10 8378
yading@10 8379 The required syntax for a TLS/SSL url is:
yading@10 8380
yading@10 8381 tls://<hostname>:<port>[?<options>]
yading@10 8382
yading@10 8383
yading@10 8384
yading@10 8385 =over 4
yading@10 8386
yading@10 8387
yading@10 8388
yading@10 8389 =item B<listen>
yading@10 8390
yading@10 8391 Act as a server, listening for an incoming connection.
yading@10 8392
yading@10 8393
yading@10 8394 =item B<cafile=>I<filename>
yading@10 8395
yading@10 8396 Certificate authority file. The file must be in OpenSSL PEM format.
yading@10 8397
yading@10 8398
yading@10 8399 =item B<cert=>I<filename>
yading@10 8400
yading@10 8401 Certificate file. The file must be in OpenSSL PEM format.
yading@10 8402
yading@10 8403
yading@10 8404 =item B<key=>I<filename>
yading@10 8405
yading@10 8406 Private key file.
yading@10 8407
yading@10 8408
yading@10 8409 =item B<verify=>I<0|1>
yading@10 8410
yading@10 8411 Verify the peer's certificate.
yading@10 8412
yading@10 8413
yading@10 8414 =back
yading@10 8415
yading@10 8416
yading@10 8417 Example command lines:
yading@10 8418
yading@10 8419 To create a TLS/SSL server that serves an input stream.
yading@10 8420
yading@10 8421
yading@10 8422 ffmpeg -i <input> -f <format> tls://<hostname>:<port>?listen&cert=<server.crt>&key=<server.key>
yading@10 8423
yading@10 8424
yading@10 8425 To play back a stream from the TLS/SSL server using B<ffplay>:
yading@10 8426
yading@10 8427
yading@10 8428 ffplay tls://<hostname>:<port>
yading@10 8429
yading@10 8430
yading@10 8431
yading@10 8432 =head2 udp
yading@10 8433
yading@10 8434
yading@10 8435 User Datagram Protocol.
yading@10 8436
yading@10 8437 The required syntax for a UDP url is:
yading@10 8438
yading@10 8439 udp://<hostname>:<port>[?<options>]
yading@10 8440
yading@10 8441
yading@10 8442 I<options> contains a list of &-separated options of the form I<key>=I<val>.
yading@10 8443
yading@10 8444 In case threading is enabled on the system, a circular buffer is used
yading@10 8445 to store the incoming data, which allows to reduce loss of data due to
yading@10 8446 UDP socket buffer overruns. The I<fifo_size> and
yading@10 8447 I<overrun_nonfatal> options are related to this buffer.
yading@10 8448
yading@10 8449 The list of supported options follows.
yading@10 8450
yading@10 8451
yading@10 8452 =over 4
yading@10 8453
yading@10 8454
yading@10 8455
yading@10 8456 =item B<buffer_size=>I<size>
yading@10 8457
yading@10 8458 Set the UDP socket buffer size in bytes. This is used both for the
yading@10 8459 receiving and the sending buffer size.
yading@10 8460
yading@10 8461
yading@10 8462 =item B<localport=>I<port>
yading@10 8463
yading@10 8464 Override the local UDP port to bind with.
yading@10 8465
yading@10 8466
yading@10 8467 =item B<localaddr=>I<addr>
yading@10 8468
yading@10 8469 Choose the local IP address. This is useful e.g. if sending multicast
yading@10 8470 and the host has multiple interfaces, where the user can choose
yading@10 8471 which interface to send on by specifying the IP address of that interface.
yading@10 8472
yading@10 8473
yading@10 8474 =item B<pkt_size=>I<size>
yading@10 8475
yading@10 8476 Set the size in bytes of UDP packets.
yading@10 8477
yading@10 8478
yading@10 8479 =item B<reuse=>I<1|0>
yading@10 8480
yading@10 8481 Explicitly allow or disallow reusing UDP sockets.
yading@10 8482
yading@10 8483
yading@10 8484 =item B<ttl=>I<ttl>
yading@10 8485
yading@10 8486 Set the time to live value (for multicast only).
yading@10 8487
yading@10 8488
yading@10 8489 =item B<connect=>I<1|0>
yading@10 8490
yading@10 8491 Initialize the UDP socket with C<connect()>. In this case, the
yading@10 8492 destination address can't be changed with ff_udp_set_remote_url later.
yading@10 8493 If the destination address isn't known at the start, this option can
yading@10 8494 be specified in ff_udp_set_remote_url, too.
yading@10 8495 This allows finding out the source address for the packets with getsockname,
yading@10 8496 and makes writes return with AVERROR(ECONNREFUSED) if "destination
yading@10 8497 unreachable" is received.
yading@10 8498 For receiving, this gives the benefit of only receiving packets from
yading@10 8499 the specified peer address/port.
yading@10 8500
yading@10 8501
yading@10 8502 =item B<sources=>I<address>B<[,>I<address>B<]>
yading@10 8503
yading@10 8504 Only receive packets sent to the multicast group from one of the
yading@10 8505 specified sender IP addresses.
yading@10 8506
yading@10 8507
yading@10 8508 =item B<block=>I<address>B<[,>I<address>B<]>
yading@10 8509
yading@10 8510 Ignore packets sent to the multicast group from the specified
yading@10 8511 sender IP addresses.
yading@10 8512
yading@10 8513
yading@10 8514 =item B<fifo_size=>I<units>
yading@10 8515
yading@10 8516 Set the UDP receiving circular buffer size, expressed as a number of
yading@10 8517 packets with size of 188 bytes. If not specified defaults to 7*4096.
yading@10 8518
yading@10 8519
yading@10 8520 =item B<overrun_nonfatal=>I<1|0>
yading@10 8521
yading@10 8522 Survive in case of UDP receiving circular buffer overrun. Default
yading@10 8523 value is 0.
yading@10 8524
yading@10 8525
yading@10 8526 =item B<timeout=>I<microseconds>
yading@10 8527
yading@10 8528 In read mode: if no data arrived in more than this time interval, raise error.
yading@10 8529
yading@10 8530 =back
yading@10 8531
yading@10 8532
yading@10 8533 Some usage examples of the UDP protocol with B<ffmpeg> follow.
yading@10 8534
yading@10 8535 To stream over UDP to a remote endpoint:
yading@10 8536
yading@10 8537 ffmpeg -i <input> -f <format> udp://<hostname>:<port>
yading@10 8538
yading@10 8539
yading@10 8540 To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
yading@10 8541
yading@10 8542 ffmpeg -i <input> -f mpegts udp://<hostname>:<port>?pkt_size=188&buffer_size=65535
yading@10 8543
yading@10 8544
yading@10 8545 To receive over UDP from a remote endpoint:
yading@10 8546
yading@10 8547 ffmpeg -i udp://[<multicast-address>]:<port>
yading@10 8548
yading@10 8549
yading@10 8550
yading@10 8551
yading@10 8552 =head1 DEVICE OPTIONS
yading@10 8553
yading@10 8554
yading@10 8555 The libavdevice library provides the same interface as
yading@10 8556 libavformat. Namely, an input device is considered like a demuxer, and
yading@10 8557 an output device like a muxer, and the interface and generic device
yading@10 8558 options are the same provided by libavformat (see the ffmpeg-formats
yading@10 8559 manual).
yading@10 8560
yading@10 8561 In addition each input or output device may support so-called private
yading@10 8562 options, which are specific for that component.
yading@10 8563
yading@10 8564 Options may be set by specifying -I<option> I<value> in the
yading@10 8565 FFmpeg tools, or by setting the value explicitly in the device
yading@10 8566 C<AVFormatContext> options or using the F<libavutil/opt.h> API
yading@10 8567 for programmatic use.
yading@10 8568
yading@10 8569
yading@10 8570
yading@10 8571 =head1 INPUT DEVICES
yading@10 8572
yading@10 8573
yading@10 8574 Input devices are configured elements in FFmpeg which allow to access
yading@10 8575 the data coming from a multimedia device attached to your system.
yading@10 8576
yading@10 8577 When you configure your FFmpeg build, all the supported input devices
yading@10 8578 are enabled by default. You can list all available ones using the
yading@10 8579 configure option "--list-indevs".
yading@10 8580
yading@10 8581 You can disable all the input devices using the configure option
yading@10 8582 "--disable-indevs", and selectively enable an input device using the
yading@10 8583 option "--enable-indev=I<INDEV>", or you can disable a particular
yading@10 8584 input device using the option "--disable-indev=I<INDEV>".
yading@10 8585
yading@10 8586 The option "-formats" of the ff* tools will display the list of
yading@10 8587 supported input devices (amongst the demuxers).
yading@10 8588
yading@10 8589 A description of the currently available input devices follows.
yading@10 8590
yading@10 8591
yading@10 8592 =head2 alsa
yading@10 8593
yading@10 8594
yading@10 8595 ALSA (Advanced Linux Sound Architecture) input device.
yading@10 8596
yading@10 8597 To enable this input device during configuration you need libasound
yading@10 8598 installed on your system.
yading@10 8599
yading@10 8600 This device allows capturing from an ALSA device. The name of the
yading@10 8601 device to capture has to be an ALSA card identifier.
yading@10 8602
yading@10 8603 An ALSA identifier has the syntax:
yading@10 8604
yading@10 8605 hw:<CARD>[,<DEV>[,<SUBDEV>]]
yading@10 8606
yading@10 8607
yading@10 8608 where the I<DEV> and I<SUBDEV> components are optional.
yading@10 8609
yading@10 8610 The three arguments (in order: I<CARD>,I<DEV>,I<SUBDEV>)
yading@10 8611 specify card number or identifier, device number and subdevice number
yading@10 8612 (-1 means any).
yading@10 8613
yading@10 8614 To see the list of cards currently recognized by your system check the
yading@10 8615 files F</proc/asound/cards> and F</proc/asound/devices>.
yading@10 8616
yading@10 8617 For example to capture with B<ffmpeg> from an ALSA device with
yading@10 8618 card id 0, you may run the command:
yading@10 8619
yading@10 8620 ffmpeg -f alsa -i hw:0 alsaout.wav
yading@10 8621
yading@10 8622
yading@10 8623 For more information see:
yading@10 8624 E<lt>B<http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html>E<gt>
yading@10 8625
yading@10 8626
yading@10 8627 =head2 bktr
yading@10 8628
yading@10 8629
yading@10 8630 BSD video input device.
yading@10 8631
yading@10 8632
yading@10 8633 =head2 dshow
yading@10 8634
yading@10 8635
yading@10 8636 Windows DirectShow input device.
yading@10 8637
yading@10 8638 DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
yading@10 8639 Currently only audio and video devices are supported.
yading@10 8640
yading@10 8641 Multiple devices may be opened as separate inputs, but they may also be
yading@10 8642 opened on the same input, which should improve synchronism between them.
yading@10 8643
yading@10 8644 The input name should be in the format:
yading@10 8645
yading@10 8646
yading@10 8647 <TYPE>=<NAME>[:<TYPE>=<NAME>]
yading@10 8648
yading@10 8649
yading@10 8650 where I<TYPE> can be either I<audio> or I<video>,
yading@10 8651 and I<NAME> is the device's name.
yading@10 8652
yading@10 8653
yading@10 8654 =head3 Options
yading@10 8655
yading@10 8656
yading@10 8657 If no options are specified, the device's defaults are used.
yading@10 8658 If the device does not support the requested options, it will
yading@10 8659 fail to open.
yading@10 8660
yading@10 8661
yading@10 8662 =over 4
yading@10 8663
yading@10 8664
yading@10 8665
yading@10 8666 =item B<video_size>
yading@10 8667
yading@10 8668 Set the video size in the captured video.
yading@10 8669
yading@10 8670
yading@10 8671 =item B<framerate>
yading@10 8672
yading@10 8673 Set the frame rate in the captured video.
yading@10 8674
yading@10 8675
yading@10 8676 =item B<sample_rate>
yading@10 8677
yading@10 8678 Set the sample rate (in Hz) of the captured audio.
yading@10 8679
yading@10 8680
yading@10 8681 =item B<sample_size>
yading@10 8682
yading@10 8683 Set the sample size (in bits) of the captured audio.
yading@10 8684
yading@10 8685
yading@10 8686 =item B<channels>
yading@10 8687
yading@10 8688 Set the number of channels in the captured audio.
yading@10 8689
yading@10 8690
yading@10 8691 =item B<list_devices>
yading@10 8692
yading@10 8693 If set to B<true>, print a list of devices and exit.
yading@10 8694
yading@10 8695
yading@10 8696 =item B<list_options>
yading@10 8697
yading@10 8698 If set to B<true>, print a list of selected device's options
yading@10 8699 and exit.
yading@10 8700
yading@10 8701
yading@10 8702 =item B<video_device_number>
yading@10 8703
yading@10 8704 Set video device number for devices with same name (starts at 0,
yading@10 8705 defaults to 0).
yading@10 8706
yading@10 8707
yading@10 8708 =item B<audio_device_number>
yading@10 8709
yading@10 8710 Set audio device number for devices with same name (starts at 0,
yading@10 8711 defaults to 0).
yading@10 8712
yading@10 8713
yading@10 8714 =item B<pixel_format>
yading@10 8715
yading@10 8716 Select pixel format to be used by DirectShow. This may only be set when
yading@10 8717 the video codec is not set or set to rawvideo.
yading@10 8718
yading@10 8719
yading@10 8720 =item B<audio_buffer_size>
yading@10 8721
yading@10 8722 Set audio device buffer size in milliseconds (which can directly
yading@10 8723 impact latency, depending on the device).
yading@10 8724 Defaults to using the audio device's
yading@10 8725 default buffer size (typically some multiple of 500ms).
yading@10 8726 Setting this value too low can degrade performance.
yading@10 8727 See also
yading@10 8728 E<lt>B<http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx>E<gt>
yading@10 8729
yading@10 8730
yading@10 8731 =back
yading@10 8732
yading@10 8733
yading@10 8734
yading@10 8735 =head3 Examples
yading@10 8736
yading@10 8737
yading@10 8738
yading@10 8739 =over 4
yading@10 8740
yading@10 8741
yading@10 8742
yading@10 8743 =item *
yading@10 8744
yading@10 8745 Print the list of DirectShow supported devices and exit:
yading@10 8746
yading@10 8747 $ ffmpeg -list_devices true -f dshow -i dummy
yading@10 8748
yading@10 8749
yading@10 8750
yading@10 8751 =item *
yading@10 8752
yading@10 8753 Open video device I<Camera>:
yading@10 8754
yading@10 8755 $ ffmpeg -f dshow -i video="Camera"
yading@10 8756
yading@10 8757
yading@10 8758
yading@10 8759 =item *
yading@10 8760
yading@10 8761 Open second video device with name I<Camera>:
yading@10 8762
yading@10 8763 $ ffmpeg -f dshow -video_device_number 1 -i video="Camera"
yading@10 8764
yading@10 8765
yading@10 8766
yading@10 8767 =item *
yading@10 8768
yading@10 8769 Open video device I<Camera> and audio device I<Microphone>:
yading@10 8770
yading@10 8771 $ ffmpeg -f dshow -i video="Camera":audio="Microphone"
yading@10 8772
yading@10 8773
yading@10 8774
yading@10 8775 =item *
yading@10 8776
yading@10 8777 Print the list of supported options in selected device and exit:
yading@10 8778
yading@10 8779 $ ffmpeg -list_options true -f dshow -i video="Camera"
yading@10 8780
yading@10 8781
yading@10 8782
yading@10 8783 =back
yading@10 8784
yading@10 8785
yading@10 8786
yading@10 8787 =head2 dv1394
yading@10 8788
yading@10 8789
yading@10 8790 Linux DV 1394 input device.
yading@10 8791
yading@10 8792
yading@10 8793 =head2 fbdev
yading@10 8794
yading@10 8795
yading@10 8796 Linux framebuffer input device.
yading@10 8797
yading@10 8798 The Linux framebuffer is a graphic hardware-independent abstraction
yading@10 8799 layer to show graphics on a computer monitor, typically on the
yading@10 8800 console. It is accessed through a file device node, usually
yading@10 8801 F</dev/fb0>.
yading@10 8802
yading@10 8803 For more detailed information read the file
yading@10 8804 Documentation/fb/framebuffer.txt included in the Linux source tree.
yading@10 8805
yading@10 8806 To record from the framebuffer device F</dev/fb0> with
yading@10 8807 B<ffmpeg>:
yading@10 8808
yading@10 8809 ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
yading@10 8810
yading@10 8811
yading@10 8812 You can take a single screenshot image with the command:
yading@10 8813
yading@10 8814 ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
yading@10 8815
yading@10 8816
yading@10 8817 See also E<lt>B<http://linux-fbdev.sourceforge.net/>E<gt>, and fbset(1).
yading@10 8818
yading@10 8819
yading@10 8820 =head2 iec61883
yading@10 8821
yading@10 8822
yading@10 8823 FireWire DV/HDV input device using libiec61883.
yading@10 8824
yading@10 8825 To enable this input device, you need libiec61883, libraw1394 and
yading@10 8826 libavc1394 installed on your system. Use the configure option
yading@10 8827 C<--enable-libiec61883> to compile with the device enabled.
yading@10 8828
yading@10 8829 The iec61883 capture device supports capturing from a video device
yading@10 8830 connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
yading@10 8831 FireWire stack (juju). This is the default DV/HDV input method in Linux
yading@10 8832 Kernel 2.6.37 and later, since the old FireWire stack was removed.
yading@10 8833
yading@10 8834 Specify the FireWire port to be used as input file, or "auto"
yading@10 8835 to choose the first port connected.
yading@10 8836
yading@10 8837
yading@10 8838 =head3 Options
yading@10 8839
yading@10 8840
yading@10 8841
yading@10 8842 =over 4
yading@10 8843
yading@10 8844
yading@10 8845
yading@10 8846 =item B<dvtype>
yading@10 8847
yading@10 8848 Override autodetection of DV/HDV. This should only be used if auto
yading@10 8849 detection does not work, or if usage of a different device type
yading@10 8850 should be prohibited. Treating a DV device as HDV (or vice versa) will
yading@10 8851 not work and result in undefined behavior.
yading@10 8852 The values B<auto>, B<dv> and B<hdv> are supported.
yading@10 8853
yading@10 8854
yading@10 8855 =item B<dvbuffer>
yading@10 8856
yading@10 8857 Set maxiumum size of buffer for incoming data, in frames. For DV, this
yading@10 8858 is an exact value. For HDV, it is not frame exact, since HDV does
yading@10 8859 not have a fixed frame size.
yading@10 8860
yading@10 8861
yading@10 8862 =item B<dvguid>
yading@10 8863
yading@10 8864 Select the capture device by specifying it's GUID. Capturing will only
yading@10 8865 be performed from the specified device and fails if no device with the
yading@10 8866 given GUID is found. This is useful to select the input if multiple
yading@10 8867 devices are connected at the same time.
yading@10 8868 Look at /sys/bus/firewire/devices to find out the GUIDs.
yading@10 8869
yading@10 8870
yading@10 8871 =back
yading@10 8872
yading@10 8873
yading@10 8874
yading@10 8875 =head3 Examples
yading@10 8876
yading@10 8877
yading@10 8878
yading@10 8879 =over 4
yading@10 8880
yading@10 8881
yading@10 8882
yading@10 8883 =item *
yading@10 8884
yading@10 8885 Grab and show the input of a FireWire DV/HDV device.
yading@10 8886
yading@10 8887 ffplay -f iec61883 -i auto
yading@10 8888
yading@10 8889
yading@10 8890
yading@10 8891 =item *
yading@10 8892
yading@10 8893 Grab and record the input of a FireWire DV/HDV device,
yading@10 8894 using a packet buffer of 100000 packets if the source is HDV.
yading@10 8895
yading@10 8896 ffmpeg -f iec61883 -i auto -hdvbuffer 100000 out.mpg
yading@10 8897
yading@10 8898
yading@10 8899
yading@10 8900 =back
yading@10 8901
yading@10 8902
yading@10 8903
yading@10 8904 =head2 jack
yading@10 8905
yading@10 8906
yading@10 8907 JACK input device.
yading@10 8908
yading@10 8909 To enable this input device during configuration you need libjack
yading@10 8910 installed on your system.
yading@10 8911
yading@10 8912 A JACK input device creates one or more JACK writable clients, one for
yading@10 8913 each audio channel, with name I<client_name>:input_I<N>, where
yading@10 8914 I<client_name> is the name provided by the application, and I<N>
yading@10 8915 is a number which identifies the channel.
yading@10 8916 Each writable client will send the acquired data to the FFmpeg input
yading@10 8917 device.
yading@10 8918
yading@10 8919 Once you have created one or more JACK readable clients, you need to
yading@10 8920 connect them to one or more JACK writable clients.
yading@10 8921
yading@10 8922 To connect or disconnect JACK clients you can use the B<jack_connect>
yading@10 8923 and B<jack_disconnect> programs, or do it through a graphical interface,
yading@10 8924 for example with B<qjackctl>.
yading@10 8925
yading@10 8926 To list the JACK clients and their properties you can invoke the command
yading@10 8927 B<jack_lsp>.
yading@10 8928
yading@10 8929 Follows an example which shows how to capture a JACK readable client
yading@10 8930 with B<ffmpeg>.
yading@10 8931
yading@10 8932 # Create a JACK writable client with name "ffmpeg".
yading@10 8933 $ ffmpeg -f jack -i ffmpeg -y out.wav
yading@10 8934
yading@10 8935 # Start the sample jack_metro readable client.
yading@10 8936 $ jack_metro -b 120 -d 0.2 -f 4000
yading@10 8937
yading@10 8938 # List the current JACK clients.
yading@10 8939 $ jack_lsp -c
yading@10 8940 system:capture_1
yading@10 8941 system:capture_2
yading@10 8942 system:playback_1
yading@10 8943 system:playback_2
yading@10 8944 ffmpeg:input_1
yading@10 8945 metro:120_bpm
yading@10 8946
yading@10 8947 # Connect metro to the ffmpeg writable client.
yading@10 8948 $ jack_connect metro:120_bpm ffmpeg:input_1
yading@10 8949
yading@10 8950
yading@10 8951 For more information read:
yading@10 8952 E<lt>B<http://jackaudio.org/>E<gt>
yading@10 8953
yading@10 8954
yading@10 8955 =head2 lavfi
yading@10 8956
yading@10 8957
yading@10 8958 Libavfilter input virtual device.
yading@10 8959
yading@10 8960 This input device reads data from the open output pads of a libavfilter
yading@10 8961 filtergraph.
yading@10 8962
yading@10 8963 For each filtergraph open output, the input device will create a
yading@10 8964 corresponding stream which is mapped to the generated output. Currently
yading@10 8965 only video data is supported. The filtergraph is specified through the
yading@10 8966 option B<graph>.
yading@10 8967
yading@10 8968
yading@10 8969 =head3 Options
yading@10 8970
yading@10 8971
yading@10 8972
yading@10 8973 =over 4
yading@10 8974
yading@10 8975
yading@10 8976
yading@10 8977 =item B<graph>
yading@10 8978
yading@10 8979 Specify the filtergraph to use as input. Each video open output must be
yading@10 8980 labelled by a unique string of the form "outI<N>", where I<N> is a
yading@10 8981 number starting from 0 corresponding to the mapped input stream
yading@10 8982 generated by the device.
yading@10 8983 The first unlabelled output is automatically assigned to the "out0"
yading@10 8984 label, but all the others need to be specified explicitly.
yading@10 8985
yading@10 8986 If not specified defaults to the filename specified for the input
yading@10 8987 device.
yading@10 8988
yading@10 8989
yading@10 8990 =item B<graph_file>
yading@10 8991
yading@10 8992 Set the filename of the filtergraph to be read and sent to the other
yading@10 8993 filters. Syntax of the filtergraph is the same as the one specified by
yading@10 8994 the option I<graph>.
yading@10 8995
yading@10 8996
yading@10 8997 =back
yading@10 8998
yading@10 8999
yading@10 9000
yading@10 9001 =head3 Examples
yading@10 9002
yading@10 9003
yading@10 9004
yading@10 9005 =over 4
yading@10 9006
yading@10 9007
yading@10 9008 =item *
yading@10 9009
yading@10 9010 Create a color video stream and play it back with B<ffplay>:
yading@10 9011
yading@10 9012 ffplay -f lavfi -graph "color=c=pink [out0]" dummy
yading@10 9013
yading@10 9014
yading@10 9015
yading@10 9016 =item *
yading@10 9017
yading@10 9018 As the previous example, but use filename for specifying the graph
yading@10 9019 description, and omit the "out0" label:
yading@10 9020
yading@10 9021 ffplay -f lavfi color=c=pink
yading@10 9022
yading@10 9023
yading@10 9024
yading@10 9025 =item *
yading@10 9026
yading@10 9027 Create three different video test filtered sources and play them:
yading@10 9028
yading@10 9029 ffplay -f lavfi -graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3
yading@10 9030
yading@10 9031
yading@10 9032
yading@10 9033 =item *
yading@10 9034
yading@10 9035 Read an audio stream from a file using the amovie source and play it
yading@10 9036 back with B<ffplay>:
yading@10 9037
yading@10 9038 ffplay -f lavfi "amovie=test.wav"
yading@10 9039
yading@10 9040
yading@10 9041
yading@10 9042 =item *
yading@10 9043
yading@10 9044 Read an audio stream and a video stream and play it back with
yading@10 9045 B<ffplay>:
yading@10 9046
yading@10 9047 ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
yading@10 9048
yading@10 9049
yading@10 9050
yading@10 9051 =back
yading@10 9052
yading@10 9053
yading@10 9054
yading@10 9055 =head2 libdc1394
yading@10 9056
yading@10 9057
yading@10 9058 IIDC1394 input device, based on libdc1394 and libraw1394.
yading@10 9059
yading@10 9060
yading@10 9061 =head2 openal
yading@10 9062
yading@10 9063
yading@10 9064 The OpenAL input device provides audio capture on all systems with a
yading@10 9065 working OpenAL 1.1 implementation.
yading@10 9066
yading@10 9067 To enable this input device during configuration, you need OpenAL
yading@10 9068 headers and libraries installed on your system, and need to configure
yading@10 9069 FFmpeg with C<--enable-openal>.
yading@10 9070
yading@10 9071 OpenAL headers and libraries should be provided as part of your OpenAL
yading@10 9072 implementation, or as an additional download (an SDK). Depending on your
yading@10 9073 installation you may need to specify additional flags via the
yading@10 9074 C<--extra-cflags> and C<--extra-ldflags> for allowing the build
yading@10 9075 system to locate the OpenAL headers and libraries.
yading@10 9076
yading@10 9077 An incomplete list of OpenAL implementations follows:
yading@10 9078
yading@10 9079
yading@10 9080 =over 4
yading@10 9081
yading@10 9082
yading@10 9083 =item B<Creative>
yading@10 9084
yading@10 9085 The official Windows implementation, providing hardware acceleration
yading@10 9086 with supported devices and software fallback.
yading@10 9087 See E<lt>B<http://openal.org/>E<gt>.
yading@10 9088
yading@10 9089 =item B<OpenAL Soft>
yading@10 9090
yading@10 9091 Portable, open source (LGPL) software implementation. Includes
yading@10 9092 backends for the most common sound APIs on the Windows, Linux,
yading@10 9093 Solaris, and BSD operating systems.
yading@10 9094 See E<lt>B<http://kcat.strangesoft.net/openal.html>E<gt>.
yading@10 9095
yading@10 9096 =item B<Apple>
yading@10 9097
yading@10 9098 OpenAL is part of Core Audio, the official Mac OS X Audio interface.
yading@10 9099 See E<lt>B<http://developer.apple.com/technologies/mac/audio-and-video.html>E<gt>
yading@10 9100
yading@10 9101 =back
yading@10 9102
yading@10 9103
yading@10 9104 This device allows to capture from an audio input device handled
yading@10 9105 through OpenAL.
yading@10 9106
yading@10 9107 You need to specify the name of the device to capture in the provided
yading@10 9108 filename. If the empty string is provided, the device will
yading@10 9109 automatically select the default device. You can get the list of the
yading@10 9110 supported devices by using the option I<list_devices>.
yading@10 9111
yading@10 9112
yading@10 9113 =head3 Options
yading@10 9114
yading@10 9115
yading@10 9116
yading@10 9117 =over 4
yading@10 9118
yading@10 9119
yading@10 9120
yading@10 9121 =item B<channels>
yading@10 9122
yading@10 9123 Set the number of channels in the captured audio. Only the values
yading@10 9124 B<1> (monaural) and B<2> (stereo) are currently supported.
yading@10 9125 Defaults to B<2>.
yading@10 9126
yading@10 9127
yading@10 9128 =item B<sample_size>
yading@10 9129
yading@10 9130 Set the sample size (in bits) of the captured audio. Only the values
yading@10 9131 B<8> and B<16> are currently supported. Defaults to
yading@10 9132 B<16>.
yading@10 9133
yading@10 9134
yading@10 9135 =item B<sample_rate>
yading@10 9136
yading@10 9137 Set the sample rate (in Hz) of the captured audio.
yading@10 9138 Defaults to B<44.1k>.
yading@10 9139
yading@10 9140
yading@10 9141 =item B<list_devices>
yading@10 9142
yading@10 9143 If set to B<true>, print a list of devices and exit.
yading@10 9144 Defaults to B<false>.
yading@10 9145
yading@10 9146
yading@10 9147 =back
yading@10 9148
yading@10 9149
yading@10 9150
yading@10 9151 =head3 Examples
yading@10 9152
yading@10 9153
yading@10 9154 Print the list of OpenAL supported devices and exit:
yading@10 9155
yading@10 9156 $ ffmpeg -list_devices true -f openal -i dummy out.ogg
yading@10 9157
yading@10 9158
yading@10 9159 Capture from the OpenAL device F<DR-BT101 via PulseAudio>:
yading@10 9160
yading@10 9161 $ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
yading@10 9162
yading@10 9163
yading@10 9164 Capture from the default device (note the empty string '' as filename):
yading@10 9165
yading@10 9166 $ ffmpeg -f openal -i '' out.ogg
yading@10 9167
yading@10 9168
yading@10 9169 Capture from two devices simultaneously, writing to two different files,
yading@10 9170 within the same B<ffmpeg> command:
yading@10 9171
yading@10 9172 $ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
yading@10 9173
yading@10 9174 Note: not all OpenAL implementations support multiple simultaneous capture -
yading@10 9175 try the latest OpenAL Soft if the above does not work.
yading@10 9176
yading@10 9177
yading@10 9178 =head2 oss
yading@10 9179
yading@10 9180
yading@10 9181 Open Sound System input device.
yading@10 9182
yading@10 9183 The filename to provide to the input device is the device node
yading@10 9184 representing the OSS input device, and is usually set to
yading@10 9185 F</dev/dsp>.
yading@10 9186
yading@10 9187 For example to grab from F</dev/dsp> using B<ffmpeg> use the
yading@10 9188 command:
yading@10 9189
yading@10 9190 ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
yading@10 9191
yading@10 9192
yading@10 9193 For more information about OSS see:
yading@10 9194 E<lt>B<http://manuals.opensound.com/usersguide/dsp.html>E<gt>
yading@10 9195
yading@10 9196
yading@10 9197 =head2 pulse
yading@10 9198
yading@10 9199
yading@10 9200 pulseaudio input device.
yading@10 9201
yading@10 9202 To enable this input device during configuration you need libpulse-simple
yading@10 9203 installed in your system.
yading@10 9204
yading@10 9205 The filename to provide to the input device is a source device or the
yading@10 9206 string "default"
yading@10 9207
yading@10 9208 To list the pulse source devices and their properties you can invoke
yading@10 9209 the command B<pactl list sources>.
yading@10 9210
yading@10 9211
yading@10 9212 ffmpeg -f pulse -i default /tmp/pulse.wav
yading@10 9213
yading@10 9214
yading@10 9215
yading@10 9216 =head3 I<server> AVOption
yading@10 9217
yading@10 9218
yading@10 9219 The syntax is:
yading@10 9220
yading@10 9221 -server <server name>
yading@10 9222
yading@10 9223
yading@10 9224 Connects to a specific server.
yading@10 9225
yading@10 9226
yading@10 9227 =head3 I<name> AVOption
yading@10 9228
yading@10 9229
yading@10 9230 The syntax is:
yading@10 9231
yading@10 9232 -name <application name>
yading@10 9233
yading@10 9234
yading@10 9235 Specify the application name pulse will use when showing active clients,
yading@10 9236 by default it is the LIBAVFORMAT_IDENT string
yading@10 9237
yading@10 9238
yading@10 9239 =head3 I<stream_name> AVOption
yading@10 9240
yading@10 9241
yading@10 9242 The syntax is:
yading@10 9243
yading@10 9244 -stream_name <stream name>
yading@10 9245
yading@10 9246
yading@10 9247 Specify the stream name pulse will use when showing active streams,
yading@10 9248 by default it is "record"
yading@10 9249
yading@10 9250
yading@10 9251 =head3 I<sample_rate> AVOption
yading@10 9252
yading@10 9253
yading@10 9254 The syntax is:
yading@10 9255
yading@10 9256 -sample_rate <samplerate>
yading@10 9257
yading@10 9258
yading@10 9259 Specify the samplerate in Hz, by default 48kHz is used.
yading@10 9260
yading@10 9261
yading@10 9262 =head3 I<channels> AVOption
yading@10 9263
yading@10 9264
yading@10 9265 The syntax is:
yading@10 9266
yading@10 9267 -channels <N>
yading@10 9268
yading@10 9269
yading@10 9270 Specify the channels in use, by default 2 (stereo) is set.
yading@10 9271
yading@10 9272
yading@10 9273 =head3 I<frame_size> AVOption
yading@10 9274
yading@10 9275
yading@10 9276 The syntax is:
yading@10 9277
yading@10 9278 -frame_size <bytes>
yading@10 9279
yading@10 9280
yading@10 9281 Specify the number of byte per frame, by default it is set to 1024.
yading@10 9282
yading@10 9283
yading@10 9284 =head3 I<fragment_size> AVOption
yading@10 9285
yading@10 9286
yading@10 9287 The syntax is:
yading@10 9288
yading@10 9289 -fragment_size <bytes>
yading@10 9290
yading@10 9291
yading@10 9292 Specify the minimal buffering fragment in pulseaudio, it will affect the
yading@10 9293 audio latency. By default it is unset.
yading@10 9294
yading@10 9295
yading@10 9296 =head2 sndio
yading@10 9297
yading@10 9298
yading@10 9299 sndio input device.
yading@10 9300
yading@10 9301 To enable this input device during configuration you need libsndio
yading@10 9302 installed on your system.
yading@10 9303
yading@10 9304 The filename to provide to the input device is the device node
yading@10 9305 representing the sndio input device, and is usually set to
yading@10 9306 F</dev/audio0>.
yading@10 9307
yading@10 9308 For example to grab from F</dev/audio0> using B<ffmpeg> use the
yading@10 9309 command:
yading@10 9310
yading@10 9311 ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
yading@10 9312
yading@10 9313
yading@10 9314
yading@10 9315 =head2 video4linux2, v4l2
yading@10 9316
yading@10 9317
yading@10 9318 Video4Linux2 input video device.
yading@10 9319
yading@10 9320 "v4l2" can be used as alias for "video4linux2".
yading@10 9321
yading@10 9322 If FFmpeg is built with v4l-utils support (by using the
yading@10 9323 C<--enable-libv4l2> configure option), the device will always rely
yading@10 9324 on libv4l2.
yading@10 9325
yading@10 9326 The name of the device to grab is a file device node, usually Linux
yading@10 9327 systems tend to automatically create such nodes when the device
yading@10 9328 (e.g. an USB webcam) is plugged into the system, and has a name of the
yading@10 9329 kind F</dev/videoI<N>>, where I<N> is a number associated to
yading@10 9330 the device.
yading@10 9331
yading@10 9332 Video4Linux2 devices usually support a limited set of
yading@10 9333 I<width>xI<height> sizes and frame rates. You can check which are
yading@10 9334 supported using B<-list_formats all> for Video4Linux2 devices.
yading@10 9335 Some devices, like TV cards, support one or more standards. It is possible
yading@10 9336 to list all the supported standards using B<-list_standards all>.
yading@10 9337
yading@10 9338 The time base for the timestamps is 1 microsecond. Depending on the kernel
yading@10 9339 version and configuration, the timestamps may be derived from the real time
yading@10 9340 clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
yading@10 9341 boot time, unaffected by NTP or manual changes to the clock). The
yading@10 9342 B<-timestamps abs> or B<-ts abs> option can be used to force
yading@10 9343 conversion into the real time clock.
yading@10 9344
yading@10 9345 Some usage examples of the video4linux2 device with B<ffmpeg>
yading@10 9346 and B<ffplay>:
yading@10 9347
yading@10 9348 =over 4
yading@10 9349
yading@10 9350
yading@10 9351 =item *
yading@10 9352
yading@10 9353 Grab and show the input of a video4linux2 device:
yading@10 9354
yading@10 9355 ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
yading@10 9356
yading@10 9357
yading@10 9358
yading@10 9359 =item *
yading@10 9360
yading@10 9361 Grab and record the input of a video4linux2 device, leave the
yading@10 9362 frame rate and size as previously set:
yading@10 9363
yading@10 9364 ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
yading@10 9365
yading@10 9366
yading@10 9367 =back
yading@10 9368
yading@10 9369
yading@10 9370 For more information about Video4Linux, check E<lt>B<http://linuxtv.org/>E<gt>.
yading@10 9371
yading@10 9372
yading@10 9373 =head3 Options
yading@10 9374
yading@10 9375
yading@10 9376
yading@10 9377 =over 4
yading@10 9378
yading@10 9379
yading@10 9380 =item B<standard>
yading@10 9381
yading@10 9382 Set the standard. Must be the name of a supported standard. To get a
yading@10 9383 list of the supported standards, use the B<list_standards>
yading@10 9384 option.
yading@10 9385
yading@10 9386
yading@10 9387 =item B<channel>
yading@10 9388
yading@10 9389 Set the input channel number. Default to -1, which means using the
yading@10 9390 previously selected channel.
yading@10 9391
yading@10 9392
yading@10 9393 =item B<video_size>
yading@10 9394
yading@10 9395 Set the video frame size. The argument must be a string in the form
yading@10 9396 I<WIDTH>xI<HEIGHT> or a valid size abbreviation.
yading@10 9397
yading@10 9398
yading@10 9399 =item B<pixel_format>
yading@10 9400
yading@10 9401 Select the pixel format (only valid for raw video input).
yading@10 9402
yading@10 9403
yading@10 9404 =item B<input_format>
yading@10 9405
yading@10 9406 Set the preferred pixel format (for raw video) or a codec name.
yading@10 9407 This option allows to select the input format, when several are
yading@10 9408 available.
yading@10 9409
yading@10 9410
yading@10 9411 =item B<framerate>
yading@10 9412
yading@10 9413 Set the preferred video frame rate.
yading@10 9414
yading@10 9415
yading@10 9416 =item B<list_formats>
yading@10 9417
yading@10 9418 List available formats (supported pixel formats, codecs, and frame
yading@10 9419 sizes) and exit.
yading@10 9420
yading@10 9421 Available values are:
yading@10 9422
yading@10 9423 =over 4
yading@10 9424
yading@10 9425
yading@10 9426 =item B<all>
yading@10 9427
yading@10 9428 Show all available (compressed and non-compressed) formats.
yading@10 9429
yading@10 9430
yading@10 9431 =item B<raw>
yading@10 9432
yading@10 9433 Show only raw video (non-compressed) formats.
yading@10 9434
yading@10 9435
yading@10 9436 =item B<compressed>
yading@10 9437
yading@10 9438 Show only compressed formats.
yading@10 9439
yading@10 9440 =back
yading@10 9441
yading@10 9442
yading@10 9443
yading@10 9444 =item B<list_standards>
yading@10 9445
yading@10 9446 List supported standards and exit.
yading@10 9447
yading@10 9448 Available values are:
yading@10 9449
yading@10 9450 =over 4
yading@10 9451
yading@10 9452
yading@10 9453 =item B<all>
yading@10 9454
yading@10 9455 Show all supported standards.
yading@10 9456
yading@10 9457 =back
yading@10 9458
yading@10 9459
yading@10 9460
yading@10 9461 =item B<timestamps, ts>
yading@10 9462
yading@10 9463 Set type of timestamps for grabbed frames.
yading@10 9464
yading@10 9465 Available values are:
yading@10 9466
yading@10 9467 =over 4
yading@10 9468
yading@10 9469
yading@10 9470 =item B<default>
yading@10 9471
yading@10 9472 Use timestamps from the kernel.
yading@10 9473
yading@10 9474
yading@10 9475 =item B<abs>
yading@10 9476
yading@10 9477 Use absolute timestamps (wall clock).
yading@10 9478
yading@10 9479
yading@10 9480 =item B<mono2abs>
yading@10 9481
yading@10 9482 Force conversion from monotonic to absolute timestamps.
yading@10 9483
yading@10 9484 =back
yading@10 9485
yading@10 9486
yading@10 9487 Default value is C<default>.
yading@10 9488
yading@10 9489 =back
yading@10 9490
yading@10 9491
yading@10 9492
yading@10 9493 =head2 vfwcap
yading@10 9494
yading@10 9495
yading@10 9496 VfW (Video for Windows) capture input device.
yading@10 9497
yading@10 9498 The filename passed as input is the capture driver number, ranging from
yading@10 9499 0 to 9. You may use "list" as filename to print a list of drivers. Any
yading@10 9500 other filename will be interpreted as device number 0.
yading@10 9501
yading@10 9502
yading@10 9503 =head2 x11grab
yading@10 9504
yading@10 9505
yading@10 9506 X11 video input device.
yading@10 9507
yading@10 9508 This device allows to capture a region of an X11 display.
yading@10 9509
yading@10 9510 The filename passed as input has the syntax:
yading@10 9511
yading@10 9512 [<hostname>]:<display_number>.<screen_number>[+<x_offset>,<y_offset>]
yading@10 9513
yading@10 9514
yading@10 9515 I<hostname>:I<display_number>.I<screen_number> specifies the
yading@10 9516 X11 display name of the screen to grab from. I<hostname> can be
yading@10 9517 omitted, and defaults to "localhost". The environment variable
yading@10 9518 B<DISPLAY> contains the default display name.
yading@10 9519
yading@10 9520 I<x_offset> and I<y_offset> specify the offsets of the grabbed
yading@10 9521 area with respect to the top-left border of the X11 screen. They
yading@10 9522 default to 0.
yading@10 9523
yading@10 9524 Check the X11 documentation (e.g. man X) for more detailed information.
yading@10 9525
yading@10 9526 Use the B<dpyinfo> program for getting basic information about the
yading@10 9527 properties of your X11 display (e.g. grep for "name" or "dimensions").
yading@10 9528
yading@10 9529 For example to grab from F<:0.0> using B<ffmpeg>:
yading@10 9530
yading@10 9531 ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
yading@10 9532
yading@10 9533
yading@10 9534 Grab at position C<10,20>:
yading@10 9535
yading@10 9536 ffmpeg -f x11grab -r 25 -s cif -i :0.0+10,20 out.mpg
yading@10 9537
yading@10 9538
yading@10 9539
yading@10 9540 =head3 Options
yading@10 9541
yading@10 9542
yading@10 9543
yading@10 9544 =over 4
yading@10 9545
yading@10 9546
yading@10 9547 =item B<draw_mouse>
yading@10 9548
yading@10 9549 Specify whether to draw the mouse pointer. A value of C<0> specify
yading@10 9550 not to draw the pointer. Default value is C<1>.
yading@10 9551
yading@10 9552
yading@10 9553 =item B<follow_mouse>
yading@10 9554
yading@10 9555 Make the grabbed area follow the mouse. The argument can be
yading@10 9556 C<centered> or a number of pixels I<PIXELS>.
yading@10 9557
yading@10 9558 When it is specified with "centered", the grabbing region follows the mouse
yading@10 9559 pointer and keeps the pointer at the center of region; otherwise, the region
yading@10 9560 follows only when the mouse pointer reaches within I<PIXELS> (greater than
yading@10 9561 zero) to the edge of region.
yading@10 9562
yading@10 9563 For example:
yading@10 9564
yading@10 9565 ffmpeg -f x11grab -follow_mouse centered -r 25 -s cif -i :0.0 out.mpg
yading@10 9566
yading@10 9567
yading@10 9568 To follow only when the mouse pointer reaches within 100 pixels to edge:
yading@10 9569
yading@10 9570 ffmpeg -f x11grab -follow_mouse 100 -r 25 -s cif -i :0.0 out.mpg
yading@10 9571
yading@10 9572
yading@10 9573
yading@10 9574 =item B<framerate>
yading@10 9575
yading@10 9576 Set the grabbing frame rate. Default value is C<ntsc>,
yading@10 9577 corresponding to a frame rate of C<30000/1001>.
yading@10 9578
yading@10 9579
yading@10 9580 =item B<show_region>
yading@10 9581
yading@10 9582 Show grabbed region on screen.
yading@10 9583
yading@10 9584 If I<show_region> is specified with C<1>, then the grabbing
yading@10 9585 region will be indicated on screen. With this option, it is easy to
yading@10 9586 know what is being grabbed if only a portion of the screen is grabbed.
yading@10 9587
yading@10 9588 For example:
yading@10 9589
yading@10 9590 ffmpeg -f x11grab -show_region 1 -r 25 -s cif -i :0.0+10,20 out.mpg
yading@10 9591
yading@10 9592
yading@10 9593 With I<follow_mouse>:
yading@10 9594
yading@10 9595 ffmpeg -f x11grab -follow_mouse centered -show_region 1 -r 25 -s cif -i :0.0 out.mpg
yading@10 9596
yading@10 9597
yading@10 9598
yading@10 9599 =item B<video_size>
yading@10 9600
yading@10 9601 Set the video frame size. Default value is C<vga>.
yading@10 9602
yading@10 9603 =back
yading@10 9604
yading@10 9605
yading@10 9606
yading@10 9607 =head1 OUTPUT DEVICES
yading@10 9608
yading@10 9609
yading@10 9610 Output devices are configured elements in FFmpeg which allow to write
yading@10 9611 multimedia data to an output device attached to your system.
yading@10 9612
yading@10 9613 When you configure your FFmpeg build, all the supported output devices
yading@10 9614 are enabled by default. You can list all available ones using the
yading@10 9615 configure option "--list-outdevs".
yading@10 9616
yading@10 9617 You can disable all the output devices using the configure option
yading@10 9618 "--disable-outdevs", and selectively enable an output device using the
yading@10 9619 option "--enable-outdev=I<OUTDEV>", or you can disable a particular
yading@10 9620 input device using the option "--disable-outdev=I<OUTDEV>".
yading@10 9621
yading@10 9622 The option "-formats" of the ff* tools will display the list of
yading@10 9623 enabled output devices (amongst the muxers).
yading@10 9624
yading@10 9625 A description of the currently available output devices follows.
yading@10 9626
yading@10 9627
yading@10 9628 =head2 alsa
yading@10 9629
yading@10 9630
yading@10 9631 ALSA (Advanced Linux Sound Architecture) output device.
yading@10 9632
yading@10 9633
yading@10 9634 =head2 caca
yading@10 9635
yading@10 9636
yading@10 9637 CACA output device.
yading@10 9638
yading@10 9639 This output devices allows to show a video stream in CACA window.
yading@10 9640 Only one CACA window is allowed per application, so you can
yading@10 9641 have only one instance of this output device in an application.
yading@10 9642
yading@10 9643 To enable this output device you need to configure FFmpeg with
yading@10 9644 C<--enable-libcaca>.
yading@10 9645 libcaca is a graphics library that outputs text instead of pixels.
yading@10 9646
yading@10 9647 For more information about libcaca, check:
yading@10 9648 E<lt>B<http://caca.zoy.org/wiki/libcaca>E<gt>
yading@10 9649
yading@10 9650
yading@10 9651 =head3 Options
yading@10 9652
yading@10 9653
yading@10 9654
yading@10 9655 =over 4
yading@10 9656
yading@10 9657
yading@10 9658
yading@10 9659 =item B<window_title>
yading@10 9660
yading@10 9661 Set the CACA window title, if not specified default to the filename
yading@10 9662 specified for the output device.
yading@10 9663
yading@10 9664
yading@10 9665 =item B<window_size>
yading@10 9666
yading@10 9667 Set the CACA window size, can be a string of the form
yading@10 9668 I<width>xI<height> or a video size abbreviation.
yading@10 9669 If not specified it defaults to the size of the input video.
yading@10 9670
yading@10 9671
yading@10 9672 =item B<driver>
yading@10 9673
yading@10 9674 Set display driver.
yading@10 9675
yading@10 9676
yading@10 9677 =item B<algorithm>
yading@10 9678
yading@10 9679 Set dithering algorithm. Dithering is necessary
yading@10 9680 because the picture being rendered has usually far more colours than
yading@10 9681 the available palette.
yading@10 9682 The accepted values are listed with C<-list_dither algorithms>.
yading@10 9683
yading@10 9684
yading@10 9685 =item B<antialias>
yading@10 9686
yading@10 9687 Set antialias method. Antialiasing smoothens the rendered
yading@10 9688 image and avoids the commonly seen staircase effect.
yading@10 9689 The accepted values are listed with C<-list_dither antialiases>.
yading@10 9690
yading@10 9691
yading@10 9692 =item B<charset>
yading@10 9693
yading@10 9694 Set which characters are going to be used when rendering text.
yading@10 9695 The accepted values are listed with C<-list_dither charsets>.
yading@10 9696
yading@10 9697
yading@10 9698 =item B<color>
yading@10 9699
yading@10 9700 Set color to be used when rendering text.
yading@10 9701 The accepted values are listed with C<-list_dither colors>.
yading@10 9702
yading@10 9703
yading@10 9704 =item B<list_drivers>
yading@10 9705
yading@10 9706 If set to B<true>, print a list of available drivers and exit.
yading@10 9707
yading@10 9708
yading@10 9709 =item B<list_dither>
yading@10 9710
yading@10 9711 List available dither options related to the argument.
yading@10 9712 The argument must be one of C<algorithms>, C<antialiases>,
yading@10 9713 C<charsets>, C<colors>.
yading@10 9714
yading@10 9715 =back
yading@10 9716
yading@10 9717
yading@10 9718
yading@10 9719 =head3 Examples
yading@10 9720
yading@10 9721
yading@10 9722
yading@10 9723 =over 4
yading@10 9724
yading@10 9725
yading@10 9726 =item *
yading@10 9727
yading@10 9728 The following command shows the B<ffmpeg> output is an
yading@10 9729 CACA window, forcing its size to 80x25:
yading@10 9730
yading@10 9731 ffmpeg -i INPUT -vcodec rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
yading@10 9732
yading@10 9733
yading@10 9734
yading@10 9735 =item *
yading@10 9736
yading@10 9737 Show the list of available drivers and exit:
yading@10 9738
yading@10 9739 ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
yading@10 9740
yading@10 9741
yading@10 9742
yading@10 9743 =item *
yading@10 9744
yading@10 9745 Show the list of available dither colors and exit:
yading@10 9746
yading@10 9747 ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
yading@10 9748
yading@10 9749
yading@10 9750 =back
yading@10 9751
yading@10 9752
yading@10 9753
yading@10 9754 =head2 oss
yading@10 9755
yading@10 9756
yading@10 9757 OSS (Open Sound System) output device.
yading@10 9758
yading@10 9759
yading@10 9760 =head2 sdl
yading@10 9761
yading@10 9762
yading@10 9763 SDL (Simple DirectMedia Layer) output device.
yading@10 9764
yading@10 9765 This output devices allows to show a video stream in an SDL
yading@10 9766 window. Only one SDL window is allowed per application, so you can
yading@10 9767 have only one instance of this output device in an application.
yading@10 9768
yading@10 9769 To enable this output device you need libsdl installed on your system
yading@10 9770 when configuring your build.
yading@10 9771
yading@10 9772 For more information about SDL, check:
yading@10 9773 E<lt>B<http://www.libsdl.org/>E<gt>
yading@10 9774
yading@10 9775
yading@10 9776 =head3 Options
yading@10 9777
yading@10 9778
yading@10 9779
yading@10 9780 =over 4
yading@10 9781
yading@10 9782
yading@10 9783
yading@10 9784 =item B<window_title>
yading@10 9785
yading@10 9786 Set the SDL window title, if not specified default to the filename
yading@10 9787 specified for the output device.
yading@10 9788
yading@10 9789
yading@10 9790 =item B<icon_title>
yading@10 9791
yading@10 9792 Set the name of the iconified SDL window, if not specified it is set
yading@10 9793 to the same value of I<window_title>.
yading@10 9794
yading@10 9795
yading@10 9796 =item B<window_size>
yading@10 9797
yading@10 9798 Set the SDL window size, can be a string of the form
yading@10 9799 I<width>xI<height> or a video size abbreviation.
yading@10 9800 If not specified it defaults to the size of the input video,
yading@10 9801 downscaled according to the aspect ratio.
yading@10 9802
yading@10 9803 =back
yading@10 9804
yading@10 9805
yading@10 9806
yading@10 9807 =head3 Examples
yading@10 9808
yading@10 9809
yading@10 9810 The following command shows the B<ffmpeg> output is an
yading@10 9811 SDL window, forcing its size to the qcif format:
yading@10 9812
yading@10 9813 ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
yading@10 9814
yading@10 9815
yading@10 9816
yading@10 9817 =head2 sndio
yading@10 9818
yading@10 9819
yading@10 9820 sndio audio output device.
yading@10 9821
yading@10 9822
yading@10 9823
yading@10 9824 =head1 RESAMPLER OPTIONS
yading@10 9825
yading@10 9826
yading@10 9827 The audio resampler supports the following named options.
yading@10 9828
yading@10 9829 Options may be set by specifying -I<option> I<value> in the
yading@10 9830 FFmpeg tools, I<option>=I<value> for the aresample filter,
yading@10 9831 by setting the value explicitly in the
yading@10 9832 C<SwrContext> options or using the F<libavutil/opt.h> API for
yading@10 9833 programmatic use.
yading@10 9834
yading@10 9835
yading@10 9836 =over 4
yading@10 9837
yading@10 9838
yading@10 9839
yading@10 9840 =item B<ich, in_channel_count>
yading@10 9841
yading@10 9842 Set the number of input channels. Default value is 0. Setting this
yading@10 9843 value is not mandatory if the corresponding channel layout
yading@10 9844 B<in_channel_layout> is set.
yading@10 9845
yading@10 9846
yading@10 9847 =item B<och, out_channel_count>
yading@10 9848
yading@10 9849 Set the number of output channels. Default value is 0. Setting this
yading@10 9850 value is not mandatory if the corresponding channel layout
yading@10 9851 B<out_channel_layout> is set.
yading@10 9852
yading@10 9853
yading@10 9854 =item B<uch, used_channel_count>
yading@10 9855
yading@10 9856 Set the number of used input channels. Default value is 0. This option is
yading@10 9857 only used for special remapping.
yading@10 9858
yading@10 9859
yading@10 9860 =item B<isr, in_sample_rate>
yading@10 9861
yading@10 9862 Set the input sample rate. Default value is 0.
yading@10 9863
yading@10 9864
yading@10 9865 =item B<osr, out_sample_rate>
yading@10 9866
yading@10 9867 Set the output sample rate. Default value is 0.
yading@10 9868
yading@10 9869
yading@10 9870 =item B<isf, in_sample_fmt>
yading@10 9871
yading@10 9872 Specify the input sample format. It is set by default to C<none>.
yading@10 9873
yading@10 9874
yading@10 9875 =item B<osf, out_sample_fmt>
yading@10 9876
yading@10 9877 Specify the output sample format. It is set by default to C<none>.
yading@10 9878
yading@10 9879
yading@10 9880 =item B<tsf, internal_sample_fmt>
yading@10 9881
yading@10 9882 Set the internal sample format. Default value is C<none>.
yading@10 9883 This will automatically be chosen when it is not explicitly set.
yading@10 9884
yading@10 9885
yading@10 9886 =item B<icl, in_channel_layout>
yading@10 9887
yading@10 9888 Set the input channel layout.
yading@10 9889
yading@10 9890
yading@10 9891 =item B<ocl, out_channel_layout>
yading@10 9892
yading@10 9893 Set the output channel layout.
yading@10 9894
yading@10 9895
yading@10 9896 =item B<clev, center_mix_level>
yading@10 9897
yading@10 9898 Set the center mix level. It is a value expressed in deciBel, and must be
yading@10 9899 in the interval [-32,32].
yading@10 9900
yading@10 9901
yading@10 9902 =item B<slev, surround_mix_level>
yading@10 9903
yading@10 9904 Set the surround mix level. It is a value expressed in deciBel, and must
yading@10 9905 be in the interval [-32,32].
yading@10 9906
yading@10 9907
yading@10 9908 =item B<lfe_mix_level>
yading@10 9909
yading@10 9910 Set LFE mix into non LFE level. It is used when there is a LFE input but no
yading@10 9911 LFE output. It is a value expressed in deciBel, and must
yading@10 9912 be in the interval [-32,32].
yading@10 9913
yading@10 9914
yading@10 9915 =item B<rmvol, rematrix_volume>
yading@10 9916
yading@10 9917 Set rematrix volume. Default value is 1.0.
yading@10 9918
yading@10 9919
yading@10 9920 =item B<flags, swr_flags>
yading@10 9921
yading@10 9922 Set flags used by the converter. Default value is 0.
yading@10 9923
yading@10 9924 It supports the following individual flags:
yading@10 9925
yading@10 9926 =over 4
yading@10 9927
yading@10 9928
yading@10 9929 =item B<res>
yading@10 9930
yading@10 9931 force resampling, this flag forces resampling to be used even when the
yading@10 9932 input and output sample rates match.
yading@10 9933
yading@10 9934 =back
yading@10 9935
yading@10 9936
yading@10 9937
yading@10 9938 =item B<dither_scale>
yading@10 9939
yading@10 9940 Set the dither scale. Default value is 1.
yading@10 9941
yading@10 9942
yading@10 9943 =item B<dither_method>
yading@10 9944
yading@10 9945 Set dither method. Default value is 0.
yading@10 9946
yading@10 9947 Supported values:
yading@10 9948
yading@10 9949 =over 4
yading@10 9950
yading@10 9951
yading@10 9952 =item B<rectangular>
yading@10 9953
yading@10 9954 select rectangular dither
yading@10 9955
yading@10 9956 =item B<triangular>
yading@10 9957
yading@10 9958 select triangular dither
yading@10 9959
yading@10 9960 =item B<triangular_hp>
yading@10 9961
yading@10 9962 select triangular dither with high pass
yading@10 9963
yading@10 9964 =item B<lipshitz>
yading@10 9965
yading@10 9966 select lipshitz noise shaping dither
yading@10 9967
yading@10 9968 =item B<shibata>
yading@10 9969
yading@10 9970 select shibata noise shaping dither
yading@10 9971
yading@10 9972 =item B<low_shibata>
yading@10 9973
yading@10 9974 select low shibata noise shaping dither
yading@10 9975
yading@10 9976 =item B<high_shibata>
yading@10 9977
yading@10 9978 select high shibata noise shaping dither
yading@10 9979
yading@10 9980 =item B<f_weighted>
yading@10 9981
yading@10 9982 select f-weighted noise shaping dither
yading@10 9983
yading@10 9984 =item B<modified_e_weighted>
yading@10 9985
yading@10 9986 select modified-e-weighted noise shaping dither
yading@10 9987
yading@10 9988 =item B<improved_e_weighted>
yading@10 9989
yading@10 9990 select improved-e-weighted noise shaping dither
yading@10 9991
yading@10 9992
yading@10 9993 =back
yading@10 9994
yading@10 9995
yading@10 9996
yading@10 9997 =item B<resampler>
yading@10 9998
yading@10 9999 Set resampling engine. Default value is swr.
yading@10 10000
yading@10 10001 Supported values:
yading@10 10002
yading@10 10003 =over 4
yading@10 10004
yading@10 10005
yading@10 10006 =item B<swr>
yading@10 10007
yading@10 10008 select the native SW Resampler; filter options precision and cheby are not
yading@10 10009 applicable in this case.
yading@10 10010
yading@10 10011 =item B<soxr>
yading@10 10012
yading@10 10013 select the SoX Resampler (where available); compensation, and filter options
yading@10 10014 filter_size, phase_shift, filter_type & kaiser_beta, are not applicable in this
yading@10 10015 case.
yading@10 10016
yading@10 10017 =back
yading@10 10018
yading@10 10019
yading@10 10020
yading@10 10021 =item B<filter_size>
yading@10 10022
yading@10 10023 For swr only, set resampling filter size, default value is 32.
yading@10 10024
yading@10 10025
yading@10 10026 =item B<phase_shift>
yading@10 10027
yading@10 10028 For swr only, set resampling phase shift, default value is 10, and must be in
yading@10 10029 the interval [0,30].
yading@10 10030
yading@10 10031
yading@10 10032 =item B<linear_interp>
yading@10 10033
yading@10 10034 Use Linear Interpolation if set to 1, default value is 0.
yading@10 10035
yading@10 10036
yading@10 10037 =item B<cutoff>
yading@10 10038
yading@10 10039 Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
yading@10 10040 value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
yading@10 10041 (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
yading@10 10042
yading@10 10043
yading@10 10044 =item B<precision>
yading@10 10045
yading@10 10046 For soxr only, the precision in bits to which the resampled signal will be
yading@10 10047 calculated. The default value of 20 (which, with suitable dithering, is
yading@10 10048 appropriate for a destination bit-depth of 16) gives SoX's 'High Quality'; a
yading@10 10049 value of 28 gives SoX's 'Very High Quality'.
yading@10 10050
yading@10 10051
yading@10 10052 =item B<cheby>
yading@10 10053
yading@10 10054 For soxr only, selects passband rolloff none (Chebyshev) & higher-precision
yading@10 10055 approximation for 'irrational' ratios. Default value is 0.
yading@10 10056
yading@10 10057
yading@10 10058 =item B<async>
yading@10 10059
yading@10 10060 For swr only, simple 1 parameter audio sync to timestamps using stretching,
yading@10 10061 squeezing, filling and trimming. Setting this to 1 will enable filling and
yading@10 10062 trimming, larger values represent the maximum amount in samples that the data
yading@10 10063 may be stretched or squeezed for each second.
yading@10 10064 Default value is 0, thus no compensation is applied to make the samples match
yading@10 10065 the audio timestamps.
yading@10 10066
yading@10 10067
yading@10 10068 =item B<first_pts>
yading@10 10069
yading@10 10070 For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
yading@10 10071 This allows for padding/trimming at the start of stream. By default, no
yading@10 10072 assumption is made about the first frame's expected pts, so no padding or
yading@10 10073 trimming is done. For example, this could be set to 0 to pad the beginning with
yading@10 10074 silence if an audio stream starts after the video stream or to trim any samples
yading@10 10075 with a negative pts due to encoder delay.
yading@10 10076
yading@10 10077
yading@10 10078 =item B<min_comp>
yading@10 10079
yading@10 10080 For swr only, set the minimum difference between timestamps and audio data (in
yading@10 10081 seconds) to trigger stretching/squeezing/filling or trimming of the
yading@10 10082 data to make it match the timestamps. The default is that
yading@10 10083 stretching/squeezing/filling and trimming is disabled
yading@10 10084 (B<min_comp> = C<FLT_MAX>).
yading@10 10085
yading@10 10086
yading@10 10087 =item B<min_hard_comp>
yading@10 10088
yading@10 10089 For swr only, set the minimum difference between timestamps and audio data (in
yading@10 10090 seconds) to trigger adding/dropping samples to make it match the
yading@10 10091 timestamps. This option effectively is a threshold to select between
yading@10 10092 hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
yading@10 10093 all compensation is by default disabled through B<min_comp>.
yading@10 10094 The default is 0.1.
yading@10 10095
yading@10 10096
yading@10 10097 =item B<comp_duration>
yading@10 10098
yading@10 10099 For swr only, set duration (in seconds) over which data is stretched/squeezed
yading@10 10100 to make it match the timestamps. Must be a non-negative double float value,
yading@10 10101 default value is 1.0.
yading@10 10102
yading@10 10103
yading@10 10104 =item B<max_soft_comp>
yading@10 10105
yading@10 10106 For swr only, set maximum factor by which data is stretched/squeezed to make it
yading@10 10107 match the timestamps. Must be a non-negative double float value, default value
yading@10 10108 is 0.
yading@10 10109
yading@10 10110
yading@10 10111 =item B<matrix_encoding>
yading@10 10112
yading@10 10113 Select matrixed stereo encoding.
yading@10 10114
yading@10 10115 It accepts the following values:
yading@10 10116
yading@10 10117 =over 4
yading@10 10118
yading@10 10119
yading@10 10120 =item B<none>
yading@10 10121
yading@10 10122 select none
yading@10 10123
yading@10 10124 =item B<dolby>
yading@10 10125
yading@10 10126 select Dolby
yading@10 10127
yading@10 10128 =item B<dplii>
yading@10 10129
yading@10 10130 select Dolby Pro Logic II
yading@10 10131
yading@10 10132 =back
yading@10 10133
yading@10 10134
yading@10 10135 Default value is C<none>.
yading@10 10136
yading@10 10137
yading@10 10138 =item B<filter_type>
yading@10 10139
yading@10 10140 For swr only, select resampling filter type. This only affects resampling
yading@10 10141 operations.
yading@10 10142
yading@10 10143 It accepts the following values:
yading@10 10144
yading@10 10145 =over 4
yading@10 10146
yading@10 10147
yading@10 10148 =item B<cubic>
yading@10 10149
yading@10 10150 select cubic
yading@10 10151
yading@10 10152 =item B<blackman_nuttall>
yading@10 10153
yading@10 10154 select Blackman Nuttall Windowed Sinc
yading@10 10155
yading@10 10156 =item B<kaiser>
yading@10 10157
yading@10 10158 select Kaiser Windowed Sinc
yading@10 10159
yading@10 10160 =back
yading@10 10161
yading@10 10162
yading@10 10163
yading@10 10164 =item B<kaiser_beta>
yading@10 10165
yading@10 10166 For swr only, set Kaiser Window Beta value. Must be an integer in the
yading@10 10167 interval [2,16], default value is 9.
yading@10 10168
yading@10 10169
yading@10 10170 =back
yading@10 10171
yading@10 10172
yading@10 10173
yading@10 10174
yading@10 10175 =head1 SCALER OPTIONS
yading@10 10176
yading@10 10177
yading@10 10178 The video scaler supports the following named options.
yading@10 10179
yading@10 10180 Options may be set by specifying -I<option> I<value> in the
yading@10 10181 FFmpeg tools. For programmatic use, they can be set explicitly in the
yading@10 10182 C<SwsContext> options or through the F<libavutil/opt.h> API.
yading@10 10183
yading@10 10184
yading@10 10185 =over 4
yading@10 10186
yading@10 10187
yading@10 10188
yading@10 10189 =item B<sws_flags>
yading@10 10190
yading@10 10191 Set the scaler flags. This is also used to set the scaling
yading@10 10192 algorithm. Only a single algorithm should be selected.
yading@10 10193
yading@10 10194 It accepts the following values:
yading@10 10195
yading@10 10196 =over 4
yading@10 10197
yading@10 10198
yading@10 10199 =item B<fast_bilinear>
yading@10 10200
yading@10 10201 Select fast bilinear scaling algorithm.
yading@10 10202
yading@10 10203
yading@10 10204 =item B<bilinear>
yading@10 10205
yading@10 10206 Select bilinear scaling algorithm.
yading@10 10207
yading@10 10208
yading@10 10209 =item B<bicubic>
yading@10 10210
yading@10 10211 Select bicubic scaling algorithm.
yading@10 10212
yading@10 10213
yading@10 10214 =item B<experimental>
yading@10 10215
yading@10 10216 Select experimental scaling algorithm.
yading@10 10217
yading@10 10218
yading@10 10219 =item B<neighbor>
yading@10 10220
yading@10 10221 Select nearest neighbor rescaling algorithm.
yading@10 10222
yading@10 10223
yading@10 10224 =item B<area>
yading@10 10225
yading@10 10226 Select averaging area rescaling algorithm.
yading@10 10227
yading@10 10228
yading@10 10229 =item B<bicubiclin>
yading@10 10230
yading@10 10231 Select bicubic scaling algorithm for the luma component, bilinear for
yading@10 10232 chroma components.
yading@10 10233
yading@10 10234
yading@10 10235 =item B<gauss>
yading@10 10236
yading@10 10237 Select Gaussian rescaling algorithm.
yading@10 10238
yading@10 10239
yading@10 10240 =item B<sinc>
yading@10 10241
yading@10 10242 Select sinc rescaling algorithm.
yading@10 10243
yading@10 10244
yading@10 10245 =item B<lanczos>
yading@10 10246
yading@10 10247 Select lanczos rescaling algorithm.
yading@10 10248
yading@10 10249
yading@10 10250 =item B<spline>
yading@10 10251
yading@10 10252 Select natural bicubic spline rescaling algorithm.
yading@10 10253
yading@10 10254
yading@10 10255 =item B<print_info>
yading@10 10256
yading@10 10257 Enable printing/debug logging.
yading@10 10258
yading@10 10259
yading@10 10260 =item B<accurate_rnd>
yading@10 10261
yading@10 10262 Enable accurate rounding.
yading@10 10263
yading@10 10264
yading@10 10265 =item B<full_chroma_int>
yading@10 10266
yading@10 10267 Enable full chroma interpolation.
yading@10 10268
yading@10 10269
yading@10 10270 =item B<full_chroma_inp>
yading@10 10271
yading@10 10272 Select full chroma input.
yading@10 10273
yading@10 10274
yading@10 10275 =item B<bitexact>
yading@10 10276
yading@10 10277 Enable bitexact output.
yading@10 10278
yading@10 10279 =back
yading@10 10280
yading@10 10281
yading@10 10282
yading@10 10283 =item B<srcw>
yading@10 10284
yading@10 10285 Set source width.
yading@10 10286
yading@10 10287
yading@10 10288 =item B<srch>
yading@10 10289
yading@10 10290 Set source height.
yading@10 10291
yading@10 10292
yading@10 10293 =item B<dstw>
yading@10 10294
yading@10 10295 Set destination width.
yading@10 10296
yading@10 10297
yading@10 10298 =item B<dsth>
yading@10 10299
yading@10 10300 Set destination height.
yading@10 10301
yading@10 10302
yading@10 10303 =item B<src_format>
yading@10 10304
yading@10 10305 Set source pixel format (must be expressed as an integer).
yading@10 10306
yading@10 10307
yading@10 10308 =item B<dst_format>
yading@10 10309
yading@10 10310 Set destination pixel format (must be expressed as an integer).
yading@10 10311
yading@10 10312
yading@10 10313 =item B<src_range>
yading@10 10314
yading@10 10315 Select source range.
yading@10 10316
yading@10 10317
yading@10 10318 =item B<dst_range>
yading@10 10319
yading@10 10320 Select destination range.
yading@10 10321
yading@10 10322
yading@10 10323 =item B<param0, param1>
yading@10 10324
yading@10 10325 Set scaling algorithm parameters. The specified values are specific of
yading@10 10326 some scaling algorithms and ignored by others. The specified values
yading@10 10327 are floating point number values.
yading@10 10328
yading@10 10329
yading@10 10330 =back
yading@10 10331
yading@10 10332
yading@10 10333
yading@10 10334
yading@10 10335 =head1 FILTERING INTRODUCTION
yading@10 10336
yading@10 10337
yading@10 10338 Filtering in FFmpeg is enabled through the libavfilter library.
yading@10 10339
yading@10 10340 In libavfilter, a filter can have multiple inputs and multiple
yading@10 10341 outputs.
yading@10 10342 To illustrate the sorts of things that are possible, we consider the
yading@10 10343 following filtergraph.
yading@10 10344
yading@10 10345
yading@10 10346 input --> split ---------------------> overlay --> output
yading@10 10347 | ^
yading@10 10348 | |
yading@10 10349 +-----> crop --> vflip -------+
yading@10 10350
yading@10 10351
yading@10 10352 This filtergraph splits the input stream in two streams, sends one
yading@10 10353 stream through the crop filter and the vflip filter before merging it
yading@10 10354 back with the other stream by overlaying it on top. You can use the
yading@10 10355 following command to achieve this:
yading@10 10356
yading@10 10357
yading@10 10358 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 10359
yading@10 10360
yading@10 10361 The result will be that in output the top half of the video is mirrored
yading@10 10362 onto the bottom half.
yading@10 10363
yading@10 10364 Filters in the same linear chain are separated by commas, and distinct
yading@10 10365 linear chains of filters are separated by semicolons. In our example,
yading@10 10366 I<crop,vflip> are in one linear chain, I<split> and
yading@10 10367 I<overlay> are separately in another. The points where the linear
yading@10 10368 chains join are labelled by names enclosed in square brackets. In the
yading@10 10369 example, the split filter generates two outputs that are associated to
yading@10 10370 the labels I<[main]> and I<[tmp]>.
yading@10 10371
yading@10 10372 The stream sent to the second output of I<split>, labelled as
yading@10 10373 I<[tmp]>, is processed through the I<crop> filter, which crops
yading@10 10374 away the lower half part of the video, and then vertically flipped. The
yading@10 10375 I<overlay> filter takes in input the first unchanged output of the
yading@10 10376 split filter (which was labelled as I<[main]>), and overlay on its
yading@10 10377 lower half the output generated by the I<crop,vflip> filterchain.
yading@10 10378
yading@10 10379 Some filters take in input a list of parameters: they are specified
yading@10 10380 after the filter name and an equal sign, and are separated from each other
yading@10 10381 by a colon.
yading@10 10382
yading@10 10383 There exist so-called I<source filters> that do not have an
yading@10 10384 audio/video input, and I<sink filters> that will not have audio/video
yading@10 10385 output.
yading@10 10386
yading@10 10387
yading@10 10388
yading@10 10389 =head1 GRAPH
yading@10 10390
yading@10 10391
yading@10 10392 The F<graph2dot> program included in the FFmpeg F<tools>
yading@10 10393 directory can be used to parse a filtergraph description and issue a
yading@10 10394 corresponding textual representation in the dot language.
yading@10 10395
yading@10 10396 Invoke the command:
yading@10 10397
yading@10 10398 graph2dot -h
yading@10 10399
yading@10 10400
yading@10 10401 to see how to use F<graph2dot>.
yading@10 10402
yading@10 10403 You can then pass the dot description to the F<dot> program (from
yading@10 10404 the graphviz suite of programs) and obtain a graphical representation
yading@10 10405 of the filtergraph.
yading@10 10406
yading@10 10407 For example the sequence of commands:
yading@10 10408
yading@10 10409 echo <GRAPH_DESCRIPTION> | \
yading@10 10410 tools/graph2dot -o graph.tmp && \
yading@10 10411 dot -Tpng graph.tmp -o graph.png && \
yading@10 10412 display graph.png
yading@10 10413
yading@10 10414
yading@10 10415 can be used to create and display an image representing the graph
yading@10 10416 described by the I<GRAPH_DESCRIPTION> string. Note that this string must be
yading@10 10417 a complete self-contained graph, with its inputs and outputs explicitly defined.
yading@10 10418 For example if your command line is of the form:
yading@10 10419
yading@10 10420 ffmpeg -i infile -vf scale=640:360 outfile
yading@10 10421
yading@10 10422 your I<GRAPH_DESCRIPTION> string will need to be of the form:
yading@10 10423
yading@10 10424 nullsrc,scale=640:360,nullsink
yading@10 10425
yading@10 10426 you may also need to set the I<nullsrc> parameters and add a I<format>
yading@10 10427 filter in order to simulate a specific input file.
yading@10 10428
yading@10 10429
yading@10 10430
yading@10 10431 =head1 FILTERGRAPH DESCRIPTION
yading@10 10432
yading@10 10433
yading@10 10434 A filtergraph is a directed graph of connected filters. It can contain
yading@10 10435 cycles, and there can be multiple links between a pair of
yading@10 10436 filters. Each link has one input pad on one side connecting it to one
yading@10 10437 filter from which it takes its input, and one output pad on the other
yading@10 10438 side connecting it to the one filter accepting its output.
yading@10 10439
yading@10 10440 Each filter in a filtergraph is an instance of a filter class
yading@10 10441 registered in the application, which defines the features and the
yading@10 10442 number of input and output pads of the filter.
yading@10 10443
yading@10 10444 A filter with no input pads is called a "source", a filter with no
yading@10 10445 output pads is called a "sink".
yading@10 10446
yading@10 10447
yading@10 10448
yading@10 10449 =head2 Filtergraph syntax
yading@10 10450
yading@10 10451
yading@10 10452 A filtergraph can be represented using a textual representation, which is
yading@10 10453 recognized by the B<-filter>/B<-vf> and B<-filter_complex>
yading@10 10454 options in B<ffmpeg> and B<-vf> in B<ffplay>, and by the
yading@10 10455 C<avfilter_graph_parse()>/C<avfilter_graph_parse2()> function defined in
yading@10 10456 F<libavfilter/avfilter.h>.
yading@10 10457
yading@10 10458 A filterchain consists of a sequence of connected filters, each one
yading@10 10459 connected to the previous one in the sequence. A filterchain is
yading@10 10460 represented by a list of ","-separated filter descriptions.
yading@10 10461
yading@10 10462 A filtergraph consists of a sequence of filterchains. A sequence of
yading@10 10463 filterchains is represented by a list of ";"-separated filterchain
yading@10 10464 descriptions.
yading@10 10465
yading@10 10466 A filter is represented by a string of the form:
yading@10 10467 [I<in_link_1>]...[I<in_link_N>]I<filter_name>=I<arguments>[I<out_link_1>]...[I<out_link_M>]
yading@10 10468
yading@10 10469 I<filter_name> is the name of the filter class of which the
yading@10 10470 described filter is an instance of, and has to be the name of one of
yading@10 10471 the filter classes registered in the program.
yading@10 10472 The name of the filter class is optionally followed by a string
yading@10 10473 "=I<arguments>".
yading@10 10474
yading@10 10475 I<arguments> is a string which contains the parameters used to
yading@10 10476 initialize the filter instance. It may have one of the following forms:
yading@10 10477
yading@10 10478 =over 4
yading@10 10479
yading@10 10480
yading@10 10481
yading@10 10482 =item *
yading@10 10483
yading@10 10484 A ':'-separated list of I<key=value> pairs.
yading@10 10485
yading@10 10486
yading@10 10487 =item *
yading@10 10488
yading@10 10489 A ':'-separated list of I<value>. In this case, the keys are assumed to be
yading@10 10490 the option names in the order they are declared. E.g. the C<fade> filter
yading@10 10491 declares three options in this order -- B<type>, B<start_frame> and
yading@10 10492 B<nb_frames>. Then the parameter list I<in:0:30> means that the value
yading@10 10493 I<in> is assigned to the option B<type>, I<0> to
yading@10 10494 B<start_frame> and I<30> to B<nb_frames>.
yading@10 10495
yading@10 10496
yading@10 10497 =item *
yading@10 10498
yading@10 10499 A ':'-separated list of mixed direct I<value> and long I<key=value>
yading@10 10500 pairs. The direct I<value> must precede the I<key=value> pairs, and
yading@10 10501 follow the same constraints order of the previous point. The following
yading@10 10502 I<key=value> pairs can be set in any preferred order.
yading@10 10503
yading@10 10504
yading@10 10505 =back
yading@10 10506
yading@10 10507
yading@10 10508 If the option value itself is a list of items (e.g. the C<format> filter
yading@10 10509 takes a list of pixel formats), the items in the list are usually separated by
yading@10 10510 '|'.
yading@10 10511
yading@10 10512 The list of arguments can be quoted using the character "'" as initial
yading@10 10513 and ending mark, and the character '\' for escaping the characters
yading@10 10514 within the quoted text; otherwise the argument string is considered
yading@10 10515 terminated when the next special character (belonging to the set
yading@10 10516 "[]=;,") is encountered.
yading@10 10517
yading@10 10518 The name and arguments of the filter are optionally preceded and
yading@10 10519 followed by a list of link labels.
yading@10 10520 A link label allows to name a link and associate it to a filter output
yading@10 10521 or input pad. The preceding labels I<in_link_1>
yading@10 10522 ... I<in_link_N>, are associated to the filter input pads,
yading@10 10523 the following labels I<out_link_1> ... I<out_link_M>, are
yading@10 10524 associated to the output pads.
yading@10 10525
yading@10 10526 When two link labels with the same name are found in the
yading@10 10527 filtergraph, a link between the corresponding input and output pad is
yading@10 10528 created.
yading@10 10529
yading@10 10530 If an output pad is not labelled, it is linked by default to the first
yading@10 10531 unlabelled input pad of the next filter in the filterchain.
yading@10 10532 For example in the filterchain:
yading@10 10533
yading@10 10534 nullsrc, split[L1], [L2]overlay, nullsink
yading@10 10535
yading@10 10536 the split filter instance has two output pads, and the overlay filter
yading@10 10537 instance two input pads. The first output pad of split is labelled
yading@10 10538 "L1", the first input pad of overlay is labelled "L2", and the second
yading@10 10539 output pad of split is linked to the second input pad of overlay,
yading@10 10540 which are both unlabelled.
yading@10 10541
yading@10 10542 In a complete filterchain all the unlabelled filter input and output
yading@10 10543 pads must be connected. A filtergraph is considered valid if all the
yading@10 10544 filter input and output pads of all the filterchains are connected.
yading@10 10545
yading@10 10546 Libavfilter will automatically insert scale filters where format
yading@10 10547 conversion is required. It is possible to specify swscale flags
yading@10 10548 for those automatically inserted scalers by prepending
yading@10 10549 C<sws_flags=I<flags>;>
yading@10 10550 to the filtergraph description.
yading@10 10551
yading@10 10552 Follows a BNF description for the filtergraph syntax:
yading@10 10553
yading@10 10554 <NAME> ::= sequence of alphanumeric characters and '_'
yading@10 10555 <LINKLABEL> ::= "[" <NAME> "]"
yading@10 10556 <LINKLABELS> ::= <LINKLABEL> [<LINKLABELS>]
yading@10 10557 <FILTER_ARGUMENTS> ::= sequence of chars (eventually quoted)
yading@10 10558 <FILTER> ::= [<LINKLABELS>] <NAME> ["=" <FILTER_ARGUMENTS>] [<LINKLABELS>]
yading@10 10559 <FILTERCHAIN> ::= <FILTER> [,<FILTERCHAIN>]
yading@10 10560 <FILTERGRAPH> ::= [sws_flags=<flags>;] <FILTERCHAIN> [;<FILTERGRAPH>]
yading@10 10561
yading@10 10562
yading@10 10563
yading@10 10564 =head2 Notes on filtergraph escaping
yading@10 10565
yading@10 10566
yading@10 10567 Some filter arguments require the use of special characters, typically
yading@10 10568 C<:> to separate key=value pairs in a named options list. In this
yading@10 10569 case the user should perform a first level escaping when specifying
yading@10 10570 the filter arguments. For example, consider the following literal
yading@10 10571 string to be embedded in the drawtext filter arguments:
yading@10 10572
yading@10 10573 this is a 'string': may contain one, or more, special characters
yading@10 10574
yading@10 10575
yading@10 10576 Since C<:> is special for the filter arguments syntax, it needs to
yading@10 10577 be escaped, so you get:
yading@10 10578
yading@10 10579 text=this is a \'string\'\: may contain one, or more, special characters
yading@10 10580
yading@10 10581
yading@10 10582 A second level of escaping is required when embedding the filter
yading@10 10583 arguments in a filtergraph description, in order to escape all the
yading@10 10584 filtergraph special characters. Thus the example above becomes:
yading@10 10585
yading@10 10586 drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
yading@10 10587
yading@10 10588
yading@10 10589 Finally an additional level of escaping may be needed when writing the
yading@10 10590 filtergraph description in a shell command, which depends on the
yading@10 10591 escaping rules of the adopted shell. For example, assuming that
yading@10 10592 C<\> is special and needs to be escaped with another C<\>, the
yading@10 10593 previous string will finally result in:
yading@10 10594
yading@10 10595 -vf "drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters"
yading@10 10596
yading@10 10597
yading@10 10598 Sometimes, it might be more convenient to employ quoting in place of
yading@10 10599 escaping. For example the string:
yading@10 10600
yading@10 10601 Caesar: tu quoque, Brute, fili mi
yading@10 10602
yading@10 10603
yading@10 10604 Can be quoted in the filter arguments as:
yading@10 10605
yading@10 10606 text='Caesar: tu quoque, Brute, fili mi'
yading@10 10607
yading@10 10608
yading@10 10609 And finally inserted in a filtergraph like:
yading@10 10610
yading@10 10611 drawtext=text=\'Caesar: tu quoque\, Brute\, fili mi\'
yading@10 10612
yading@10 10613
yading@10 10614 See the ``Quoting and escaping'' section in the ffmpeg-utils manual
yading@10 10615 for more information about the escaping and quoting rules adopted by
yading@10 10616 FFmpeg.
yading@10 10617
yading@10 10618
yading@10 10619
yading@10 10620 =head1 AUDIO FILTERS
yading@10 10621
yading@10 10622
yading@10 10623 When you configure your FFmpeg build, you can disable any of the
yading@10 10624 existing filters using C<--disable-filters>.
yading@10 10625 The configure output will show the audio filters included in your
yading@10 10626 build.
yading@10 10627
yading@10 10628 Below is a description of the currently available audio filters.
yading@10 10629
yading@10 10630
yading@10 10631 =head2 aconvert
yading@10 10632
yading@10 10633
yading@10 10634 Convert the input audio format to the specified formats.
yading@10 10635
yading@10 10636 I<This filter is deprecated. Use aformat> instead.
yading@10 10637
yading@10 10638 The filter accepts a string of the form:
yading@10 10639 "I<sample_format>:I<channel_layout>".
yading@10 10640
yading@10 10641 I<sample_format> specifies the sample format, and can be a string or the
yading@10 10642 corresponding numeric value defined in F<libavutil/samplefmt.h>. Use 'p'
yading@10 10643 suffix for a planar sample format.
yading@10 10644
yading@10 10645 I<channel_layout> specifies the channel layout, and can be a string
yading@10 10646 or the corresponding number value defined in F<libavutil/channel_layout.h>.
yading@10 10647
yading@10 10648 The special parameter "auto", signifies that the filter will
yading@10 10649 automatically select the output format depending on the output filter.
yading@10 10650
yading@10 10651
yading@10 10652 =head3 Examples
yading@10 10653
yading@10 10654
yading@10 10655
yading@10 10656 =over 4
yading@10 10657
yading@10 10658
yading@10 10659 =item *
yading@10 10660
yading@10 10661 Convert input to float, planar, stereo:
yading@10 10662
yading@10 10663 aconvert=fltp:stereo
yading@10 10664
yading@10 10665
yading@10 10666
yading@10 10667 =item *
yading@10 10668
yading@10 10669 Convert input to unsigned 8-bit, automatically select out channel layout:
yading@10 10670
yading@10 10671 aconvert=u8:auto
yading@10 10672
yading@10 10673
yading@10 10674 =back
yading@10 10675
yading@10 10676
yading@10 10677
yading@10 10678 =head2 allpass
yading@10 10679
yading@10 10680
yading@10 10681 Apply a two-pole all-pass filter with central frequency (in Hz)
yading@10 10682 I<frequency>, and filter-width I<width>.
yading@10 10683 An all-pass filter changes the audio's frequency to phase relationship
yading@10 10684 without changing its frequency to amplitude relationship.
yading@10 10685
yading@10 10686 The filter accepts the following options:
yading@10 10687
yading@10 10688
yading@10 10689 =over 4
yading@10 10690
yading@10 10691
yading@10 10692 =item B<frequency, f>
yading@10 10693
yading@10 10694 Set frequency in Hz.
yading@10 10695
yading@10 10696
yading@10 10697 =item B<width_type>
yading@10 10698
yading@10 10699 Set method to specify band-width of filter.
yading@10 10700
yading@10 10701 =over 4
yading@10 10702
yading@10 10703
yading@10 10704 =item B<h>
yading@10 10705
yading@10 10706 Hz
yading@10 10707
yading@10 10708 =item B<q>
yading@10 10709
yading@10 10710 Q-Factor
yading@10 10711
yading@10 10712 =item B<o>
yading@10 10713
yading@10 10714 octave
yading@10 10715
yading@10 10716 =item B<s>
yading@10 10717
yading@10 10718 slope
yading@10 10719
yading@10 10720 =back
yading@10 10721
yading@10 10722
yading@10 10723
yading@10 10724 =item B<width, w>
yading@10 10725
yading@10 10726 Specify the band-width of a filter in width_type units.
yading@10 10727
yading@10 10728 =back
yading@10 10729
yading@10 10730
yading@10 10731
yading@10 10732 =head2 highpass
yading@10 10733
yading@10 10734
yading@10 10735 Apply a high-pass filter with 3dB point frequency.
yading@10 10736 The filter can be either single-pole, or double-pole (the default).
yading@10 10737 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
yading@10 10738
yading@10 10739 The filter accepts the following options:
yading@10 10740
yading@10 10741
yading@10 10742 =over 4
yading@10 10743
yading@10 10744
yading@10 10745 =item B<frequency, f>
yading@10 10746
yading@10 10747 Set frequency in Hz. Default is 3000.
yading@10 10748
yading@10 10749
yading@10 10750 =item B<poles, p>
yading@10 10751
yading@10 10752 Set number of poles. Default is 2.
yading@10 10753
yading@10 10754
yading@10 10755 =item B<width_type>
yading@10 10756
yading@10 10757 Set method to specify band-width of filter.
yading@10 10758
yading@10 10759 =over 4
yading@10 10760
yading@10 10761
yading@10 10762 =item B<h>
yading@10 10763
yading@10 10764 Hz
yading@10 10765
yading@10 10766 =item B<q>
yading@10 10767
yading@10 10768 Q-Factor
yading@10 10769
yading@10 10770 =item B<o>
yading@10 10771
yading@10 10772 octave
yading@10 10773
yading@10 10774 =item B<s>
yading@10 10775
yading@10 10776 slope
yading@10 10777
yading@10 10778 =back
yading@10 10779
yading@10 10780
yading@10 10781
yading@10 10782 =item B<width, w>
yading@10 10783
yading@10 10784 Specify the band-width of a filter in width_type units.
yading@10 10785 Applies only to double-pole filter.
yading@10 10786 The default is 0.707q and gives a Butterworth response.
yading@10 10787
yading@10 10788 =back
yading@10 10789
yading@10 10790
yading@10 10791
yading@10 10792 =head2 lowpass
yading@10 10793
yading@10 10794
yading@10 10795 Apply a low-pass filter with 3dB point frequency.
yading@10 10796 The filter can be either single-pole or double-pole (the default).
yading@10 10797 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
yading@10 10798
yading@10 10799 The filter accepts the following options:
yading@10 10800
yading@10 10801
yading@10 10802 =over 4
yading@10 10803
yading@10 10804
yading@10 10805 =item B<frequency, f>
yading@10 10806
yading@10 10807 Set frequency in Hz. Default is 500.
yading@10 10808
yading@10 10809
yading@10 10810 =item B<poles, p>
yading@10 10811
yading@10 10812 Set number of poles. Default is 2.
yading@10 10813
yading@10 10814
yading@10 10815 =item B<width_type>
yading@10 10816
yading@10 10817 Set method to specify band-width of filter.
yading@10 10818
yading@10 10819 =over 4
yading@10 10820
yading@10 10821
yading@10 10822 =item B<h>
yading@10 10823
yading@10 10824 Hz
yading@10 10825
yading@10 10826 =item B<q>
yading@10 10827
yading@10 10828 Q-Factor
yading@10 10829
yading@10 10830 =item B<o>
yading@10 10831
yading@10 10832 octave
yading@10 10833
yading@10 10834 =item B<s>
yading@10 10835
yading@10 10836 slope
yading@10 10837
yading@10 10838 =back
yading@10 10839
yading@10 10840
yading@10 10841
yading@10 10842 =item B<width, w>
yading@10 10843
yading@10 10844 Specify the band-width of a filter in width_type units.
yading@10 10845 Applies only to double-pole filter.
yading@10 10846 The default is 0.707q and gives a Butterworth response.
yading@10 10847
yading@10 10848 =back
yading@10 10849
yading@10 10850
yading@10 10851
yading@10 10852 =head2 bass
yading@10 10853
yading@10 10854
yading@10 10855 Boost or cut the bass (lower) frequencies of the audio using a two-pole
yading@10 10856 shelving filter with a response similar to that of a standard
yading@10 10857 hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
yading@10 10858
yading@10 10859 The filter accepts the following options:
yading@10 10860
yading@10 10861
yading@10 10862 =over 4
yading@10 10863
yading@10 10864
yading@10 10865 =item B<gain, g>
yading@10 10866
yading@10 10867 Give the gain at 0 Hz. Its useful range is about -20
yading@10 10868 (for a large cut) to +20 (for a large boost).
yading@10 10869 Beware of clipping when using a positive gain.
yading@10 10870
yading@10 10871
yading@10 10872 =item B<frequency, f>
yading@10 10873
yading@10 10874 Set the filter's central frequency and so can be used
yading@10 10875 to extend or reduce the frequency range to be boosted or cut.
yading@10 10876 The default value is C<100> Hz.
yading@10 10877
yading@10 10878
yading@10 10879 =item B<width_type>
yading@10 10880
yading@10 10881 Set method to specify band-width of filter.
yading@10 10882
yading@10 10883 =over 4
yading@10 10884
yading@10 10885
yading@10 10886 =item B<h>
yading@10 10887
yading@10 10888 Hz
yading@10 10889
yading@10 10890 =item B<q>
yading@10 10891
yading@10 10892 Q-Factor
yading@10 10893
yading@10 10894 =item B<o>
yading@10 10895
yading@10 10896 octave
yading@10 10897
yading@10 10898 =item B<s>
yading@10 10899
yading@10 10900 slope
yading@10 10901
yading@10 10902 =back
yading@10 10903
yading@10 10904
yading@10 10905
yading@10 10906 =item B<width, w>
yading@10 10907
yading@10 10908 Determine how steep is the filter's shelf transition.
yading@10 10909
yading@10 10910 =back
yading@10 10911
yading@10 10912
yading@10 10913
yading@10 10914 =head2 treble
yading@10 10915
yading@10 10916
yading@10 10917 Boost or cut treble (upper) frequencies of the audio using a two-pole
yading@10 10918 shelving filter with a response similar to that of a standard
yading@10 10919 hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
yading@10 10920
yading@10 10921 The filter accepts the following options:
yading@10 10922
yading@10 10923
yading@10 10924 =over 4
yading@10 10925
yading@10 10926
yading@10 10927 =item B<gain, g>
yading@10 10928
yading@10 10929 Give the gain at whichever is the lower of ~22 kHz and the
yading@10 10930 Nyquist frequency. Its useful range is about -20 (for a large cut)
yading@10 10931 to +20 (for a large boost). Beware of clipping when using a positive gain.
yading@10 10932
yading@10 10933
yading@10 10934 =item B<frequency, f>
yading@10 10935
yading@10 10936 Set the filter's central frequency and so can be used
yading@10 10937 to extend or reduce the frequency range to be boosted or cut.
yading@10 10938 The default value is C<3000> Hz.
yading@10 10939
yading@10 10940
yading@10 10941 =item B<width_type>
yading@10 10942
yading@10 10943 Set method to specify band-width of filter.
yading@10 10944
yading@10 10945 =over 4
yading@10 10946
yading@10 10947
yading@10 10948 =item B<h>
yading@10 10949
yading@10 10950 Hz
yading@10 10951
yading@10 10952 =item B<q>
yading@10 10953
yading@10 10954 Q-Factor
yading@10 10955
yading@10 10956 =item B<o>
yading@10 10957
yading@10 10958 octave
yading@10 10959
yading@10 10960 =item B<s>
yading@10 10961
yading@10 10962 slope
yading@10 10963
yading@10 10964 =back
yading@10 10965
yading@10 10966
yading@10 10967
yading@10 10968 =item B<width, w>
yading@10 10969
yading@10 10970 Determine how steep is the filter's shelf transition.
yading@10 10971
yading@10 10972 =back
yading@10 10973
yading@10 10974
yading@10 10975
yading@10 10976 =head2 bandpass
yading@10 10977
yading@10 10978
yading@10 10979 Apply a two-pole Butterworth band-pass filter with central
yading@10 10980 frequency I<frequency>, and (3dB-point) band-width width.
yading@10 10981 The I<csg> option selects a constant skirt gain (peak gain = Q)
yading@10 10982 instead of the default: constant 0dB peak gain.
yading@10 10983 The filter roll off at 6dB per octave (20dB per decade).
yading@10 10984
yading@10 10985 The filter accepts the following options:
yading@10 10986
yading@10 10987
yading@10 10988 =over 4
yading@10 10989
yading@10 10990
yading@10 10991 =item B<frequency, f>
yading@10 10992
yading@10 10993 Set the filter's central frequency. Default is C<3000>.
yading@10 10994
yading@10 10995
yading@10 10996 =item B<csg>
yading@10 10997
yading@10 10998 Constant skirt gain if set to 1. Defaults to 0.
yading@10 10999
yading@10 11000
yading@10 11001 =item B<width_type>
yading@10 11002
yading@10 11003 Set method to specify band-width of filter.
yading@10 11004
yading@10 11005 =over 4
yading@10 11006
yading@10 11007
yading@10 11008 =item B<h>
yading@10 11009
yading@10 11010 Hz
yading@10 11011
yading@10 11012 =item B<q>
yading@10 11013
yading@10 11014 Q-Factor
yading@10 11015
yading@10 11016 =item B<o>
yading@10 11017
yading@10 11018 octave
yading@10 11019
yading@10 11020 =item B<s>
yading@10 11021
yading@10 11022 slope
yading@10 11023
yading@10 11024 =back
yading@10 11025
yading@10 11026
yading@10 11027
yading@10 11028 =item B<width, w>
yading@10 11029
yading@10 11030 Specify the band-width of a filter in width_type units.
yading@10 11031
yading@10 11032 =back
yading@10 11033
yading@10 11034
yading@10 11035
yading@10 11036 =head2 bandreject
yading@10 11037
yading@10 11038
yading@10 11039 Apply a two-pole Butterworth band-reject filter with central
yading@10 11040 frequency I<frequency>, and (3dB-point) band-width I<width>.
yading@10 11041 The filter roll off at 6dB per octave (20dB per decade).
yading@10 11042
yading@10 11043 The filter accepts the following options:
yading@10 11044
yading@10 11045
yading@10 11046 =over 4
yading@10 11047
yading@10 11048
yading@10 11049 =item B<frequency, f>
yading@10 11050
yading@10 11051 Set the filter's central frequency. Default is C<3000>.
yading@10 11052
yading@10 11053
yading@10 11054 =item B<width_type>
yading@10 11055
yading@10 11056 Set method to specify band-width of filter.
yading@10 11057
yading@10 11058 =over 4
yading@10 11059
yading@10 11060
yading@10 11061 =item B<h>
yading@10 11062
yading@10 11063 Hz
yading@10 11064
yading@10 11065 =item B<q>
yading@10 11066
yading@10 11067 Q-Factor
yading@10 11068
yading@10 11069 =item B<o>
yading@10 11070
yading@10 11071 octave
yading@10 11072
yading@10 11073 =item B<s>
yading@10 11074
yading@10 11075 slope
yading@10 11076
yading@10 11077 =back
yading@10 11078
yading@10 11079
yading@10 11080
yading@10 11081 =item B<width, w>
yading@10 11082
yading@10 11083 Specify the band-width of a filter in width_type units.
yading@10 11084
yading@10 11085 =back
yading@10 11086
yading@10 11087
yading@10 11088
yading@10 11089 =head2 biquad
yading@10 11090
yading@10 11091
yading@10 11092 Apply a biquad IIR filter with the given coefficients.
yading@10 11093 Where I<b0>, I<b1>, I<b2> and I<a0>, I<a1>, I<a2>
yading@10 11094 are the numerator and denominator coefficients respectively.
yading@10 11095
yading@10 11096
yading@10 11097 =head2 equalizer
yading@10 11098
yading@10 11099
yading@10 11100 Apply a two-pole peaking equalisation (EQ) filter. With this
yading@10 11101 filter, the signal-level at and around a selected frequency can
yading@10 11102 be increased or decreased, whilst (unlike bandpass and bandreject
yading@10 11103 filters) that at all other frequencies is unchanged.
yading@10 11104
yading@10 11105 In order to produce complex equalisation curves, this filter can
yading@10 11106 be given several times, each with a different central frequency.
yading@10 11107
yading@10 11108 The filter accepts the following options:
yading@10 11109
yading@10 11110
yading@10 11111 =over 4
yading@10 11112
yading@10 11113
yading@10 11114 =item B<frequency, f>
yading@10 11115
yading@10 11116 Set the filter's central frequency in Hz.
yading@10 11117
yading@10 11118
yading@10 11119 =item B<width_type>
yading@10 11120
yading@10 11121 Set method to specify band-width of filter.
yading@10 11122
yading@10 11123 =over 4
yading@10 11124
yading@10 11125
yading@10 11126 =item B<h>
yading@10 11127
yading@10 11128 Hz
yading@10 11129
yading@10 11130 =item B<q>
yading@10 11131
yading@10 11132 Q-Factor
yading@10 11133
yading@10 11134 =item B<o>
yading@10 11135
yading@10 11136 octave
yading@10 11137
yading@10 11138 =item B<s>
yading@10 11139
yading@10 11140 slope
yading@10 11141
yading@10 11142 =back
yading@10 11143
yading@10 11144
yading@10 11145
yading@10 11146 =item B<width, w>
yading@10 11147
yading@10 11148 Specify the band-width of a filter in width_type units.
yading@10 11149
yading@10 11150
yading@10 11151 =item B<gain, g>
yading@10 11152
yading@10 11153 Set the required gain or attenuation in dB.
yading@10 11154 Beware of clipping when using a positive gain.
yading@10 11155
yading@10 11156 =back
yading@10 11157
yading@10 11158
yading@10 11159
yading@10 11160 =head2 afade
yading@10 11161
yading@10 11162
yading@10 11163 Apply fade-in/out effect to input audio.
yading@10 11164
yading@10 11165 A description of the accepted parameters follows.
yading@10 11166
yading@10 11167
yading@10 11168 =over 4
yading@10 11169
yading@10 11170
yading@10 11171 =item B<type, t>
yading@10 11172
yading@10 11173 Specify the effect type, can be either C<in> for fade-in, or
yading@10 11174 C<out> for a fade-out effect. Default is C<in>.
yading@10 11175
yading@10 11176
yading@10 11177 =item B<start_sample, ss>
yading@10 11178
yading@10 11179 Specify the number of the start sample for starting to apply the fade
yading@10 11180 effect. Default is 0.
yading@10 11181
yading@10 11182
yading@10 11183 =item B<nb_samples, ns>
yading@10 11184
yading@10 11185 Specify the number of samples for which the fade effect has to last. At
yading@10 11186 the end of the fade-in effect the output audio will have the same
yading@10 11187 volume as the input audio, at the end of the fade-out transition
yading@10 11188 the output audio will be silence. Default is 44100.
yading@10 11189
yading@10 11190
yading@10 11191 =item B<start_time, st>
yading@10 11192
yading@10 11193 Specify time for starting to apply the fade effect. Default is 0.
yading@10 11194 The accepted syntax is:
yading@10 11195
yading@10 11196 [-]HH[:MM[:SS[.m...]]]
yading@10 11197 [-]S+[.m...]
yading@10 11198
yading@10 11199 See also the function C<av_parse_time()>.
yading@10 11200 If set this option is used instead of I<start_sample> one.
yading@10 11201
yading@10 11202
yading@10 11203 =item B<duration, d>
yading@10 11204
yading@10 11205 Specify the duration for which the fade effect has to last. Default is 0.
yading@10 11206 The accepted syntax is:
yading@10 11207
yading@10 11208 [-]HH[:MM[:SS[.m...]]]
yading@10 11209 [-]S+[.m...]
yading@10 11210
yading@10 11211 See also the function C<av_parse_time()>.
yading@10 11212 At the end of the fade-in effect the output audio will have the same
yading@10 11213 volume as the input audio, at the end of the fade-out transition
yading@10 11214 the output audio will be silence.
yading@10 11215 If set this option is used instead of I<nb_samples> one.
yading@10 11216
yading@10 11217
yading@10 11218 =item B<curve>
yading@10 11219
yading@10 11220 Set curve for fade transition.
yading@10 11221
yading@10 11222 It accepts the following values:
yading@10 11223
yading@10 11224 =over 4
yading@10 11225
yading@10 11226
yading@10 11227 =item B<tri>
yading@10 11228
yading@10 11229 select triangular, linear slope (default)
yading@10 11230
yading@10 11231 =item B<qsin>
yading@10 11232
yading@10 11233 select quarter of sine wave
yading@10 11234
yading@10 11235 =item B<hsin>
yading@10 11236
yading@10 11237 select half of sine wave
yading@10 11238
yading@10 11239 =item B<esin>
yading@10 11240
yading@10 11241 select exponential sine wave
yading@10 11242
yading@10 11243 =item B<log>
yading@10 11244
yading@10 11245 select logarithmic
yading@10 11246
yading@10 11247 =item B<par>
yading@10 11248
yading@10 11249 select inverted parabola
yading@10 11250
yading@10 11251 =item B<qua>
yading@10 11252
yading@10 11253 select quadratic
yading@10 11254
yading@10 11255 =item B<cub>
yading@10 11256
yading@10 11257 select cubic
yading@10 11258
yading@10 11259 =item B<squ>
yading@10 11260
yading@10 11261 select square root
yading@10 11262
yading@10 11263 =item B<cbr>
yading@10 11264
yading@10 11265 select cubic root
yading@10 11266
yading@10 11267 =back
yading@10 11268
yading@10 11269
yading@10 11270 =back
yading@10 11271
yading@10 11272
yading@10 11273
yading@10 11274 =head3 Examples
yading@10 11275
yading@10 11276
yading@10 11277
yading@10 11278 =over 4
yading@10 11279
yading@10 11280
yading@10 11281 =item *
yading@10 11282
yading@10 11283 Fade in first 15 seconds of audio:
yading@10 11284
yading@10 11285 afade=t=in:ss=0:d=15
yading@10 11286
yading@10 11287
yading@10 11288
yading@10 11289 =item *
yading@10 11290
yading@10 11291 Fade out last 25 seconds of a 900 seconds audio:
yading@10 11292
yading@10 11293 afade=t=out:ss=875:d=25
yading@10 11294
yading@10 11295
yading@10 11296 =back
yading@10 11297
yading@10 11298
yading@10 11299
yading@10 11300
yading@10 11301 =head2 aformat
yading@10 11302
yading@10 11303
yading@10 11304 Set output format constraints for the input audio. The framework will
yading@10 11305 negotiate the most appropriate format to minimize conversions.
yading@10 11306
yading@10 11307 The filter accepts the following named parameters:
yading@10 11308
yading@10 11309 =over 4
yading@10 11310
yading@10 11311
yading@10 11312
yading@10 11313 =item B<sample_fmts>
yading@10 11314
yading@10 11315 A '|'-separated list of requested sample formats.
yading@10 11316
yading@10 11317
yading@10 11318 =item B<sample_rates>
yading@10 11319
yading@10 11320 A '|'-separated list of requested sample rates.
yading@10 11321
yading@10 11322
yading@10 11323 =item B<channel_layouts>
yading@10 11324
yading@10 11325 A '|'-separated list of requested channel layouts.
yading@10 11326
yading@10 11327
yading@10 11328 =back
yading@10 11329
yading@10 11330
yading@10 11331 If a parameter is omitted, all values are allowed.
yading@10 11332
yading@10 11333 For example to force the output to either unsigned 8-bit or signed 16-bit stereo:
yading@10 11334
yading@10 11335 aformat=sample_fmts=u8|s16:channel_layouts=stereo
yading@10 11336
yading@10 11337
yading@10 11338
yading@10 11339 =head2 amerge
yading@10 11340
yading@10 11341
yading@10 11342 Merge two or more audio streams into a single multi-channel stream.
yading@10 11343
yading@10 11344 The filter accepts the following options:
yading@10 11345
yading@10 11346
yading@10 11347 =over 4
yading@10 11348
yading@10 11349
yading@10 11350
yading@10 11351 =item B<inputs>
yading@10 11352
yading@10 11353 Set the number of inputs. Default is 2.
yading@10 11354
yading@10 11355
yading@10 11356 =back
yading@10 11357
yading@10 11358
yading@10 11359 If the channel layouts of the inputs are disjoint, and therefore compatible,
yading@10 11360 the channel layout of the output will be set accordingly and the channels
yading@10 11361 will be reordered as necessary. If the channel layouts of the inputs are not
yading@10 11362 disjoint, the output will have all the channels of the first input then all
yading@10 11363 the channels of the second input, in that order, and the channel layout of
yading@10 11364 the output will be the default value corresponding to the total number of
yading@10 11365 channels.
yading@10 11366
yading@10 11367 For example, if the first input is in 2.1 (FL+FR+LF) and the second input
yading@10 11368 is FC+BL+BR, then the output will be in 5.1, with the channels in the
yading@10 11369 following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
yading@10 11370 first input, b1 is the first channel of the second input).
yading@10 11371
yading@10 11372 On the other hand, if both input are in stereo, the output channels will be
yading@10 11373 in the default order: a1, a2, b1, b2, and the channel layout will be
yading@10 11374 arbitrarily set to 4.0, which may or may not be the expected value.
yading@10 11375
yading@10 11376 All inputs must have the same sample rate, and format.
yading@10 11377
yading@10 11378 If inputs do not have the same duration, the output will stop with the
yading@10 11379 shortest.
yading@10 11380
yading@10 11381
yading@10 11382 =head3 Examples
yading@10 11383
yading@10 11384
yading@10 11385
yading@10 11386 =over 4
yading@10 11387
yading@10 11388
yading@10 11389 =item *
yading@10 11390
yading@10 11391 Merge two mono files into a stereo stream:
yading@10 11392
yading@10 11393 amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
yading@10 11394
yading@10 11395
yading@10 11396
yading@10 11397 =item *
yading@10 11398
yading@10 11399 Multiple merges assuming 1 video stream and 6 audio streams in F<input.mkv>:
yading@10 11400
yading@10 11401 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 11402
yading@10 11403
yading@10 11404 =back
yading@10 11405
yading@10 11406
yading@10 11407
yading@10 11408 =head2 amix
yading@10 11409
yading@10 11410
yading@10 11411 Mixes multiple audio inputs into a single output.
yading@10 11412
yading@10 11413 For example
yading@10 11414
yading@10 11415 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
yading@10 11416
yading@10 11417 will mix 3 input audio streams to a single output with the same duration as the
yading@10 11418 first input and a dropout transition time of 3 seconds.
yading@10 11419
yading@10 11420 The filter accepts the following named parameters:
yading@10 11421
yading@10 11422 =over 4
yading@10 11423
yading@10 11424
yading@10 11425
yading@10 11426 =item B<inputs>
yading@10 11427
yading@10 11428 Number of inputs. If unspecified, it defaults to 2.
yading@10 11429
yading@10 11430
yading@10 11431 =item B<duration>
yading@10 11432
yading@10 11433 How to determine the end-of-stream.
yading@10 11434
yading@10 11435 =over 4
yading@10 11436
yading@10 11437
yading@10 11438
yading@10 11439 =item B<longest>
yading@10 11440
yading@10 11441 Duration of longest input. (default)
yading@10 11442
yading@10 11443
yading@10 11444 =item B<shortest>
yading@10 11445
yading@10 11446 Duration of shortest input.
yading@10 11447
yading@10 11448
yading@10 11449 =item B<first>
yading@10 11450
yading@10 11451 Duration of first input.
yading@10 11452
yading@10 11453
yading@10 11454 =back
yading@10 11455
yading@10 11456
yading@10 11457
yading@10 11458 =item B<dropout_transition>
yading@10 11459
yading@10 11460 Transition time, in seconds, for volume renormalization when an input
yading@10 11461 stream ends. The default value is 2 seconds.
yading@10 11462
yading@10 11463
yading@10 11464 =back
yading@10 11465
yading@10 11466
yading@10 11467
yading@10 11468 =head2 anull
yading@10 11469
yading@10 11470
yading@10 11471 Pass the audio source unchanged to the output.
yading@10 11472
yading@10 11473
yading@10 11474 =head2 apad
yading@10 11475
yading@10 11476
yading@10 11477 Pad the end of a audio stream with silence, this can be used together with
yading@10 11478 -shortest to extend audio streams to the same length as the video stream.
yading@10 11479
yading@10 11480
yading@10 11481 =head2 aphaser
yading@10 11482
yading@10 11483 Add a phasing effect to the input audio.
yading@10 11484
yading@10 11485 A phaser filter creates series of peaks and troughs in the frequency spectrum.
yading@10 11486 The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
yading@10 11487
yading@10 11488 A description of the accepted parameters follows.
yading@10 11489
yading@10 11490
yading@10 11491 =over 4
yading@10 11492
yading@10 11493
yading@10 11494 =item B<in_gain>
yading@10 11495
yading@10 11496 Set input gain. Default is 0.4.
yading@10 11497
yading@10 11498
yading@10 11499 =item B<out_gain>
yading@10 11500
yading@10 11501 Set output gain. Default is 0.74
yading@10 11502
yading@10 11503
yading@10 11504 =item B<delay>
yading@10 11505
yading@10 11506 Set delay in milliseconds. Default is 3.0.
yading@10 11507
yading@10 11508
yading@10 11509 =item B<decay>
yading@10 11510
yading@10 11511 Set decay. Default is 0.4.
yading@10 11512
yading@10 11513
yading@10 11514 =item B<speed>
yading@10 11515
yading@10 11516 Set modulation speed in Hz. Default is 0.5.
yading@10 11517
yading@10 11518
yading@10 11519 =item B<type>
yading@10 11520
yading@10 11521 Set modulation type. Default is triangular.
yading@10 11522
yading@10 11523 It accepts the following values:
yading@10 11524
yading@10 11525 =over 4
yading@10 11526
yading@10 11527
yading@10 11528 =item B<triangular, t>
yading@10 11529
yading@10 11530
yading@10 11531 =item B<sinusoidal, s>
yading@10 11532
yading@10 11533
yading@10 11534 =back
yading@10 11535
yading@10 11536
yading@10 11537 =back
yading@10 11538
yading@10 11539
yading@10 11540
yading@10 11541
yading@10 11542 =head2 aresample
yading@10 11543
yading@10 11544
yading@10 11545 Resample the input audio to the specified parameters, using the
yading@10 11546 libswresample library. If none are specified then the filter will
yading@10 11547 automatically convert between its input and output.
yading@10 11548
yading@10 11549 This filter is also able to stretch/squeeze the audio data to make it match
yading@10 11550 the timestamps or to inject silence / cut out audio to make it match the
yading@10 11551 timestamps, do a combination of both or do neither.
yading@10 11552
yading@10 11553 The filter accepts the syntax
yading@10 11554 [I<sample_rate>:]I<resampler_options>, where I<sample_rate>
yading@10 11555 expresses a sample rate and I<resampler_options> is a list of
yading@10 11556 I<key>=I<value> pairs, separated by ":". See the
yading@10 11557 ffmpeg-resampler manual for the complete list of supported options.
yading@10 11558
yading@10 11559
yading@10 11560 =head3 Examples
yading@10 11561
yading@10 11562
yading@10 11563
yading@10 11564 =over 4
yading@10 11565
yading@10 11566
yading@10 11567 =item *
yading@10 11568
yading@10 11569 Resample the input audio to 44100Hz:
yading@10 11570
yading@10 11571 aresample=44100
yading@10 11572
yading@10 11573
yading@10 11574
yading@10 11575 =item *
yading@10 11576
yading@10 11577 Stretch/squeeze samples to the given timestamps, with a maximum of 1000
yading@10 11578 samples per second compensation:
yading@10 11579
yading@10 11580 aresample=async=1000
yading@10 11581
yading@10 11582
yading@10 11583 =back
yading@10 11584
yading@10 11585
yading@10 11586
yading@10 11587 =head2 asetnsamples
yading@10 11588
yading@10 11589
yading@10 11590 Set the number of samples per each output audio frame.
yading@10 11591
yading@10 11592 The last output packet may contain a different number of samples, as
yading@10 11593 the filter will flush all the remaining samples when the input audio
yading@10 11594 signal its end.
yading@10 11595
yading@10 11596 The filter accepts the following options:
yading@10 11597
yading@10 11598
yading@10 11599 =over 4
yading@10 11600
yading@10 11601
yading@10 11602
yading@10 11603 =item B<nb_out_samples, n>
yading@10 11604
yading@10 11605 Set the number of frames per each output audio frame. The number is
yading@10 11606 intended as the number of samples I<per each channel>.
yading@10 11607 Default value is 1024.
yading@10 11608
yading@10 11609
yading@10 11610 =item B<pad, p>
yading@10 11611
yading@10 11612 If set to 1, the filter will pad the last audio frame with zeroes, so
yading@10 11613 that the last frame will contain the same number of samples as the
yading@10 11614 previous ones. Default value is 1.
yading@10 11615
yading@10 11616 =back
yading@10 11617
yading@10 11618
yading@10 11619 For example, to set the number of per-frame samples to 1234 and
yading@10 11620 disable padding for the last frame, use:
yading@10 11621
yading@10 11622 asetnsamples=n=1234:p=0
yading@10 11623
yading@10 11624
yading@10 11625
yading@10 11626 =head2 ashowinfo
yading@10 11627
yading@10 11628
yading@10 11629 Show a line containing various information for each input audio frame.
yading@10 11630 The input audio is not modified.
yading@10 11631
yading@10 11632 The shown line contains a sequence of key/value pairs of the form
yading@10 11633 I<key>:I<value>.
yading@10 11634
yading@10 11635 A description of each shown parameter follows:
yading@10 11636
yading@10 11637
yading@10 11638 =over 4
yading@10 11639
yading@10 11640
yading@10 11641 =item B<n>
yading@10 11642
yading@10 11643 sequential number of the input frame, starting from 0
yading@10 11644
yading@10 11645
yading@10 11646 =item B<pts>
yading@10 11647
yading@10 11648 Presentation timestamp of the input frame, in time base units; the time base
yading@10 11649 depends on the filter input pad, and is usually 1/I<sample_rate>.
yading@10 11650
yading@10 11651
yading@10 11652 =item B<pts_time>
yading@10 11653
yading@10 11654 presentation timestamp of the input frame in seconds
yading@10 11655
yading@10 11656
yading@10 11657 =item B<pos>
yading@10 11658
yading@10 11659 position of the frame in the input stream, -1 if this information in
yading@10 11660 unavailable and/or meaningless (for example in case of synthetic audio)
yading@10 11661
yading@10 11662
yading@10 11663 =item B<fmt>
yading@10 11664
yading@10 11665 sample format
yading@10 11666
yading@10 11667
yading@10 11668 =item B<chlayout>
yading@10 11669
yading@10 11670 channel layout
yading@10 11671
yading@10 11672
yading@10 11673 =item B<rate>
yading@10 11674
yading@10 11675 sample rate for the audio frame
yading@10 11676
yading@10 11677
yading@10 11678 =item B<nb_samples>
yading@10 11679
yading@10 11680 number of samples (per channel) in the frame
yading@10 11681
yading@10 11682
yading@10 11683 =item B<checksum>
yading@10 11684
yading@10 11685 Adler-32 checksum (printed in hexadecimal) of the audio data. For planar audio
yading@10 11686 the data is treated as if all the planes were concatenated.
yading@10 11687
yading@10 11688
yading@10 11689 =item B<plane_checksums>
yading@10 11690
yading@10 11691 A list of Adler-32 checksums for each data plane.
yading@10 11692
yading@10 11693 =back
yading@10 11694
yading@10 11695
yading@10 11696
yading@10 11697 =head2 astreamsync
yading@10 11698
yading@10 11699
yading@10 11700 Forward two audio streams and control the order the buffers are forwarded.
yading@10 11701
yading@10 11702 The filter accepts the following options:
yading@10 11703
yading@10 11704
yading@10 11705 =over 4
yading@10 11706
yading@10 11707
yading@10 11708 =item B<expr, e>
yading@10 11709
yading@10 11710 Set the expression deciding which stream should be
yading@10 11711 forwarded next: if the result is negative, the first stream is forwarded; if
yading@10 11712 the result is positive or zero, the second stream is forwarded. It can use
yading@10 11713 the following variables:
yading@10 11714
yading@10 11715
yading@10 11716 =over 4
yading@10 11717
yading@10 11718
yading@10 11719 =item I<b1 b2>
yading@10 11720
yading@10 11721 number of buffers forwarded so far on each stream
yading@10 11722
yading@10 11723 =item I<s1 s2>
yading@10 11724
yading@10 11725 number of samples forwarded so far on each stream
yading@10 11726
yading@10 11727 =item I<t1 t2>
yading@10 11728
yading@10 11729 current timestamp of each stream
yading@10 11730
yading@10 11731 =back
yading@10 11732
yading@10 11733
yading@10 11734 The default value is C<t1-t2>, which means to always forward the stream
yading@10 11735 that has a smaller timestamp.
yading@10 11736
yading@10 11737 =back
yading@10 11738
yading@10 11739
yading@10 11740
yading@10 11741 =head3 Examples
yading@10 11742
yading@10 11743
yading@10 11744 Stress-test C<amerge> by randomly sending buffers on the wrong
yading@10 11745 input, while avoiding too much of a desynchronization:
yading@10 11746
yading@10 11747 amovie=file.ogg [a] ; amovie=file.mp3 [b] ;
yading@10 11748 [a] [b] astreamsync=(2*random(1))-1+tanh(5*(t1-t2)) [a2] [b2] ;
yading@10 11749 [a2] [b2] amerge
yading@10 11750
yading@10 11751
yading@10 11752
yading@10 11753 =head2 atempo
yading@10 11754
yading@10 11755
yading@10 11756 Adjust audio tempo.
yading@10 11757
yading@10 11758 The filter accepts exactly one parameter, the audio tempo. If not
yading@10 11759 specified then the filter will assume nominal 1.0 tempo. Tempo must
yading@10 11760 be in the [0.5, 2.0] range.
yading@10 11761
yading@10 11762
yading@10 11763 =head3 Examples
yading@10 11764
yading@10 11765
yading@10 11766
yading@10 11767 =over 4
yading@10 11768
yading@10 11769
yading@10 11770 =item *
yading@10 11771
yading@10 11772 Slow down audio to 80% tempo:
yading@10 11773
yading@10 11774 atempo=0.8
yading@10 11775
yading@10 11776
yading@10 11777
yading@10 11778 =item *
yading@10 11779
yading@10 11780 To speed up audio to 125% tempo:
yading@10 11781
yading@10 11782 atempo=1.25
yading@10 11783
yading@10 11784
yading@10 11785 =back
yading@10 11786
yading@10 11787
yading@10 11788
yading@10 11789 =head2 earwax
yading@10 11790
yading@10 11791
yading@10 11792 Make audio easier to listen to on headphones.
yading@10 11793
yading@10 11794 This filter adds `cues' to 44.1kHz stereo (i.e. audio CD format) audio
yading@10 11795 so that when listened to on headphones the stereo image is moved from
yading@10 11796 inside your head (standard for headphones) to outside and in front of
yading@10 11797 the listener (standard for speakers).
yading@10 11798
yading@10 11799 Ported from SoX.
yading@10 11800
yading@10 11801
yading@10 11802 =head2 pan
yading@10 11803
yading@10 11804
yading@10 11805 Mix channels with specific gain levels. The filter accepts the output
yading@10 11806 channel layout followed by a set of channels definitions.
yading@10 11807
yading@10 11808 This filter is also designed to remap efficiently the channels of an audio
yading@10 11809 stream.
yading@10 11810
yading@10 11811 The filter accepts parameters of the form:
yading@10 11812 "I<l>:I<outdef>:I<outdef>:..."
yading@10 11813
yading@10 11814
yading@10 11815 =over 4
yading@10 11816
yading@10 11817
yading@10 11818 =item B<l>
yading@10 11819
yading@10 11820 output channel layout or number of channels
yading@10 11821
yading@10 11822
yading@10 11823 =item B<outdef>
yading@10 11824
yading@10 11825 output channel specification, of the form:
yading@10 11826 "I<out_name>=[I<gain>*]I<in_name>[+[I<gain>*]I<in_name>...]"
yading@10 11827
yading@10 11828
yading@10 11829 =item B<out_name>
yading@10 11830
yading@10 11831 output channel to define, either a channel name (FL, FR, etc.) or a channel
yading@10 11832 number (c0, c1, etc.)
yading@10 11833
yading@10 11834
yading@10 11835 =item B<gain>
yading@10 11836
yading@10 11837 multiplicative coefficient for the channel, 1 leaving the volume unchanged
yading@10 11838
yading@10 11839
yading@10 11840 =item B<in_name>
yading@10 11841
yading@10 11842 input channel to use, see out_name for details; it is not possible to mix
yading@10 11843 named and numbered input channels
yading@10 11844
yading@10 11845 =back
yading@10 11846
yading@10 11847
yading@10 11848 If the `=' in a channel specification is replaced by `E<lt>', then the gains for
yading@10 11849 that specification will be renormalized so that the total is 1, thus
yading@10 11850 avoiding clipping noise.
yading@10 11851
yading@10 11852
yading@10 11853 =head3 Mixing examples
yading@10 11854
yading@10 11855
yading@10 11856 For example, if you want to down-mix from stereo to mono, but with a bigger
yading@10 11857 factor for the left channel:
yading@10 11858
yading@10 11859 pan=1:c0=0.9*c0+0.1*c1
yading@10 11860
yading@10 11861
yading@10 11862 A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
yading@10 11863 7-channels surround:
yading@10 11864
yading@10 11865 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 11866
yading@10 11867
yading@10 11868 Note that B<ffmpeg> integrates a default down-mix (and up-mix) system
yading@10 11869 that should be preferred (see "-ac" option) unless you have very specific
yading@10 11870 needs.
yading@10 11871
yading@10 11872
yading@10 11873 =head3 Remapping examples
yading@10 11874
yading@10 11875
yading@10 11876 The channel remapping will be effective if, and only if:
yading@10 11877
yading@10 11878
yading@10 11879 =over 4
yading@10 11880
yading@10 11881
yading@10 11882 =item *<gain coefficients are zeroes or ones,>
yading@10 11883
yading@10 11884
yading@10 11885 =item *<only one input per channel output,>
yading@10 11886
yading@10 11887
yading@10 11888 =back
yading@10 11889
yading@10 11890
yading@10 11891 If all these conditions are satisfied, the filter will notify the user ("Pure
yading@10 11892 channel mapping detected"), and use an optimized and lossless method to do the
yading@10 11893 remapping.
yading@10 11894
yading@10 11895 For example, if you have a 5.1 source and want a stereo audio stream by
yading@10 11896 dropping the extra channels:
yading@10 11897
yading@10 11898 pan="stereo: c0=FL : c1=FR"
yading@10 11899
yading@10 11900
yading@10 11901 Given the same source, you can also switch front left and front right channels
yading@10 11902 and keep the input channel layout:
yading@10 11903
yading@10 11904 pan="5.1: c0=c1 : c1=c0 : c2=c2 : c3=c3 : c4=c4 : c5=c5"
yading@10 11905
yading@10 11906
yading@10 11907 If the input is a stereo audio stream, you can mute the front left channel (and
yading@10 11908 still keep the stereo channel layout) with:
yading@10 11909
yading@10 11910 pan="stereo:c1=c1"
yading@10 11911
yading@10 11912
yading@10 11913 Still with a stereo audio stream input, you can copy the right channel in both
yading@10 11914 front left and right:
yading@10 11915
yading@10 11916 pan="stereo: c0=FR : c1=FR"
yading@10 11917
yading@10 11918
yading@10 11919
yading@10 11920 =head2 silencedetect
yading@10 11921
yading@10 11922
yading@10 11923 Detect silence in an audio stream.
yading@10 11924
yading@10 11925 This filter logs a message when it detects that the input audio volume is less
yading@10 11926 or equal to a noise tolerance value for a duration greater or equal to the
yading@10 11927 minimum detected noise duration.
yading@10 11928
yading@10 11929 The printed times and duration are expressed in seconds.
yading@10 11930
yading@10 11931 The filter accepts the following options:
yading@10 11932
yading@10 11933
yading@10 11934 =over 4
yading@10 11935
yading@10 11936
yading@10 11937 =item B<duration, d>
yading@10 11938
yading@10 11939 Set silence duration until notification (default is 2 seconds).
yading@10 11940
yading@10 11941
yading@10 11942 =item B<noise, n>
yading@10 11943
yading@10 11944 Set noise tolerance. Can be specified in dB (in case "dB" is appended to the
yading@10 11945 specified value) or amplitude ratio. Default is -60dB, or 0.001.
yading@10 11946
yading@10 11947 =back
yading@10 11948
yading@10 11949
yading@10 11950
yading@10 11951 =head3 Examples
yading@10 11952
yading@10 11953
yading@10 11954
yading@10 11955 =over 4
yading@10 11956
yading@10 11957
yading@10 11958 =item *
yading@10 11959
yading@10 11960 Detect 5 seconds of silence with -50dB noise tolerance:
yading@10 11961
yading@10 11962 silencedetect=n=-50dB:d=5
yading@10 11963
yading@10 11964
yading@10 11965
yading@10 11966 =item *
yading@10 11967
yading@10 11968 Complete example with B<ffmpeg> to detect silence with 0.0001 noise
yading@10 11969 tolerance in F<silence.mp3>:
yading@10 11970
yading@10 11971 ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
yading@10 11972
yading@10 11973
yading@10 11974 =back
yading@10 11975
yading@10 11976
yading@10 11977
yading@10 11978 =head2 asyncts
yading@10 11979
yading@10 11980 Synchronize audio data with timestamps by squeezing/stretching it and/or
yading@10 11981 dropping samples/adding silence when needed.
yading@10 11982
yading@10 11983 This filter is not built by default, please use aresample to do squeezing/stretching.
yading@10 11984
yading@10 11985 The filter accepts the following named parameters:
yading@10 11986
yading@10 11987 =over 4
yading@10 11988
yading@10 11989
yading@10 11990
yading@10 11991 =item B<compensate>
yading@10 11992
yading@10 11993 Enable stretching/squeezing the data to make it match the timestamps. Disabled
yading@10 11994 by default. When disabled, time gaps are covered with silence.
yading@10 11995
yading@10 11996
yading@10 11997 =item B<min_delta>
yading@10 11998
yading@10 11999 Minimum difference between timestamps and audio data (in seconds) to trigger
yading@10 12000 adding/dropping samples. Default value is 0.1. If you get non-perfect sync with
yading@10 12001 this filter, try setting this parameter to 0.
yading@10 12002
yading@10 12003
yading@10 12004 =item B<max_comp>
yading@10 12005
yading@10 12006 Maximum compensation in samples per second. Relevant only with compensate=1.
yading@10 12007 Default value 500.
yading@10 12008
yading@10 12009
yading@10 12010 =item B<first_pts>
yading@10 12011
yading@10 12012 Assume the first pts should be this value. The time base is 1 / sample rate.
yading@10 12013 This allows for padding/trimming at the start of stream. By default, no
yading@10 12014 assumption is made about the first frame's expected pts, so no padding or
yading@10 12015 trimming is done. For example, this could be set to 0 to pad the beginning with
yading@10 12016 silence if an audio stream starts after the video stream or to trim any samples
yading@10 12017 with a negative pts due to encoder delay.
yading@10 12018
yading@10 12019
yading@10 12020 =back
yading@10 12021
yading@10 12022
yading@10 12023
yading@10 12024 =head2 channelsplit
yading@10 12025
yading@10 12026 Split each channel in input audio stream into a separate output stream.
yading@10 12027
yading@10 12028 This filter accepts the following named parameters:
yading@10 12029
yading@10 12030 =over 4
yading@10 12031
yading@10 12032
yading@10 12033 =item B<channel_layout>
yading@10 12034
yading@10 12035 Channel layout of the input stream. Default is "stereo".
yading@10 12036
yading@10 12037 =back
yading@10 12038
yading@10 12039
yading@10 12040 For example, assuming a stereo input MP3 file
yading@10 12041
yading@10 12042 ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
yading@10 12043
yading@10 12044 will create an output Matroska file with two audio streams, one containing only
yading@10 12045 the left channel and the other the right channel.
yading@10 12046
yading@10 12047 To split a 5.1 WAV file into per-channel files
yading@10 12048
yading@10 12049 ffmpeg -i in.wav -filter_complex
yading@10 12050 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
yading@10 12051 -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
yading@10 12052 front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
yading@10 12053 side_right.wav
yading@10 12054
yading@10 12055
yading@10 12056
yading@10 12057 =head2 channelmap
yading@10 12058
yading@10 12059 Remap input channels to new locations.
yading@10 12060
yading@10 12061 This filter accepts the following named parameters:
yading@10 12062
yading@10 12063 =over 4
yading@10 12064
yading@10 12065
yading@10 12066 =item B<channel_layout>
yading@10 12067
yading@10 12068 Channel layout of the output stream.
yading@10 12069
yading@10 12070
yading@10 12071 =item B<map>
yading@10 12072
yading@10 12073 Map channels from input to output. The argument is a '|'-separated list of
yading@10 12074 mappings, each in the C<I<in_channel>-I<out_channel>> or
yading@10 12075 I<in_channel> form. I<in_channel> can be either the name of the input
yading@10 12076 channel (e.g. FL for front left) or its index in the input channel layout.
yading@10 12077 I<out_channel> is the name of the output channel or its index in the output
yading@10 12078 channel layout. If I<out_channel> is not given then it is implicitly an
yading@10 12079 index, starting with zero and increasing by one for each mapping.
yading@10 12080
yading@10 12081 =back
yading@10 12082
yading@10 12083
yading@10 12084 If no mapping is present, the filter will implicitly map input channels to
yading@10 12085 output channels preserving index.
yading@10 12086
yading@10 12087 For example, assuming a 5.1+downmix input MOV file
yading@10 12088
yading@10 12089 ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
yading@10 12090
yading@10 12091 will create an output WAV file tagged as stereo from the downmix channels of
yading@10 12092 the input.
yading@10 12093
yading@10 12094 To fix a 5.1 WAV improperly encoded in AAC's native channel order
yading@10 12095
yading@10 12096 ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:channel_layout=5.1' out.wav
yading@10 12097
yading@10 12098
yading@10 12099
yading@10 12100 =head2 join
yading@10 12101
yading@10 12102 Join multiple input streams into one multi-channel stream.
yading@10 12103
yading@10 12104 The filter accepts the following named parameters:
yading@10 12105
yading@10 12106 =over 4
yading@10 12107
yading@10 12108
yading@10 12109
yading@10 12110 =item B<inputs>
yading@10 12111
yading@10 12112 Number of input streams. Defaults to 2.
yading@10 12113
yading@10 12114
yading@10 12115 =item B<channel_layout>
yading@10 12116
yading@10 12117 Desired output channel layout. Defaults to stereo.
yading@10 12118
yading@10 12119
yading@10 12120 =item B<map>
yading@10 12121
yading@10 12122 Map channels from inputs to output. The argument is a '|'-separated list of
yading@10 12123 mappings, each in the C<I<input_idx>.I<in_channel>-I<out_channel>>
yading@10 12124 form. I<input_idx> is the 0-based index of the input stream. I<in_channel>
yading@10 12125 can be either the name of the input channel (e.g. FL for front left) or its
yading@10 12126 index in the specified input stream. I<out_channel> is the name of the output
yading@10 12127 channel.
yading@10 12128
yading@10 12129 =back
yading@10 12130
yading@10 12131
yading@10 12132 The filter will attempt to guess the mappings when those are not specified
yading@10 12133 explicitly. It does so by first trying to find an unused matching input channel
yading@10 12134 and if that fails it picks the first unused input channel.
yading@10 12135
yading@10 12136 E.g. to join 3 inputs (with properly set channel layouts)
yading@10 12137
yading@10 12138 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
yading@10 12139
yading@10 12140
yading@10 12141 To build a 5.1 output from 6 single-channel streams:
yading@10 12142
yading@10 12143 ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
yading@10 12144 '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 12145 out
yading@10 12146
yading@10 12147
yading@10 12148
yading@10 12149 =head2 resample
yading@10 12150
yading@10 12151 Convert the audio sample format, sample rate and channel layout. This filter is
yading@10 12152 not meant to be used directly.
yading@10 12153
yading@10 12154
yading@10 12155 =head2 volume
yading@10 12156
yading@10 12157
yading@10 12158 Adjust the input audio volume.
yading@10 12159
yading@10 12160 The filter accepts the following options:
yading@10 12161
yading@10 12162
yading@10 12163 =over 4
yading@10 12164
yading@10 12165
yading@10 12166
yading@10 12167 =item B<volume>
yading@10 12168
yading@10 12169 Expresses how the audio volume will be increased or decreased.
yading@10 12170
yading@10 12171 Output values are clipped to the maximum value.
yading@10 12172
yading@10 12173 The output audio volume is given by the relation:
yading@10 12174
yading@10 12175 <output_volume> = <volume> * <input_volume>
yading@10 12176
yading@10 12177
yading@10 12178 Default value for I<volume> is 1.0.
yading@10 12179
yading@10 12180
yading@10 12181 =item B<precision>
yading@10 12182
yading@10 12183 Set the mathematical precision.
yading@10 12184
yading@10 12185 This determines which input sample formats will be allowed, which affects the
yading@10 12186 precision of the volume scaling.
yading@10 12187
yading@10 12188
yading@10 12189 =over 4
yading@10 12190
yading@10 12191
yading@10 12192 =item B<fixed>
yading@10 12193
yading@10 12194 8-bit fixed-point; limits input sample format to U8, S16, and S32.
yading@10 12195
yading@10 12196 =item B<float>
yading@10 12197
yading@10 12198 32-bit floating-point; limits input sample format to FLT. (default)
yading@10 12199
yading@10 12200 =item B<double>
yading@10 12201
yading@10 12202 64-bit floating-point; limits input sample format to DBL.
yading@10 12203
yading@10 12204 =back
yading@10 12205
yading@10 12206
yading@10 12207 =back
yading@10 12208
yading@10 12209
yading@10 12210
yading@10 12211 =head3 Examples
yading@10 12212
yading@10 12213
yading@10 12214
yading@10 12215 =over 4
yading@10 12216
yading@10 12217
yading@10 12218 =item *
yading@10 12219
yading@10 12220 Halve the input audio volume:
yading@10 12221
yading@10 12222 volume=volume=0.5
yading@10 12223 volume=volume=1/2
yading@10 12224 volume=volume=-6.0206dB
yading@10 12225
yading@10 12226
yading@10 12227 In all the above example the named key for B<volume> can be
yading@10 12228 omitted, for example like in:
yading@10 12229
yading@10 12230 volume=0.5
yading@10 12231
yading@10 12232
yading@10 12233
yading@10 12234 =item *
yading@10 12235
yading@10 12236 Increase input audio power by 6 decibels using fixed-point precision:
yading@10 12237
yading@10 12238 volume=volume=6dB:precision=fixed
yading@10 12239
yading@10 12240
yading@10 12241 =back
yading@10 12242
yading@10 12243
yading@10 12244
yading@10 12245 =head2 volumedetect
yading@10 12246
yading@10 12247
yading@10 12248 Detect the volume of the input video.
yading@10 12249
yading@10 12250 The filter has no parameters. The input is not modified. Statistics about
yading@10 12251 the volume will be printed in the log when the input stream end is reached.
yading@10 12252
yading@10 12253 In particular it will show the mean volume (root mean square), maximum
yading@10 12254 volume (on a per-sample basis), and the beginning of an histogram of the
yading@10 12255 registered volume values (from the maximum value to a cumulated 1/1000 of
yading@10 12256 the samples).
yading@10 12257
yading@10 12258 All volumes are in decibels relative to the maximum PCM value.
yading@10 12259
yading@10 12260
yading@10 12261 =head3 Examples
yading@10 12262
yading@10 12263
yading@10 12264 Here is an excerpt of the output:
yading@10 12265
yading@10 12266 [Parsed_volumedetect_0 0xa23120] mean_volume: -27 dB
yading@10 12267 [Parsed_volumedetect_0 0xa23120] max_volume: -4 dB
yading@10 12268 [Parsed_volumedetect_0 0xa23120] histogram_4db: 6
yading@10 12269 [Parsed_volumedetect_0 0xa23120] histogram_5db: 62
yading@10 12270 [Parsed_volumedetect_0 0xa23120] histogram_6db: 286
yading@10 12271 [Parsed_volumedetect_0 0xa23120] histogram_7db: 1042
yading@10 12272 [Parsed_volumedetect_0 0xa23120] histogram_8db: 2551
yading@10 12273 [Parsed_volumedetect_0 0xa23120] histogram_9db: 4609
yading@10 12274 [Parsed_volumedetect_0 0xa23120] histogram_10db: 8409
yading@10 12275
yading@10 12276
yading@10 12277 It means that:
yading@10 12278
yading@10 12279 =over 4
yading@10 12280
yading@10 12281
yading@10 12282 =item *
yading@10 12283
yading@10 12284 The mean square energy is approximately -27 dB, or 10^-2.7.
yading@10 12285
yading@10 12286 =item *
yading@10 12287
yading@10 12288 The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
yading@10 12289
yading@10 12290 =item *
yading@10 12291
yading@10 12292 There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
yading@10 12293
yading@10 12294 =back
yading@10 12295
yading@10 12296
yading@10 12297 In other words, raising the volume by +4 dB does not cause any clipping,
yading@10 12298 raising it by +5 dB causes clipping for 6 samples, etc.
yading@10 12299
yading@10 12300
yading@10 12301
yading@10 12302 =head1 AUDIO SOURCES
yading@10 12303
yading@10 12304
yading@10 12305 Below is a description of the currently available audio sources.
yading@10 12306
yading@10 12307
yading@10 12308 =head2 abuffer
yading@10 12309
yading@10 12310
yading@10 12311 Buffer audio frames, and make them available to the filter chain.
yading@10 12312
yading@10 12313 This source is mainly intended for a programmatic use, in particular
yading@10 12314 through the interface defined in F<libavfilter/asrc_abuffer.h>.
yading@10 12315
yading@10 12316 It accepts the following named parameters:
yading@10 12317
yading@10 12318
yading@10 12319 =over 4
yading@10 12320
yading@10 12321
yading@10 12322
yading@10 12323 =item B<time_base>
yading@10 12324
yading@10 12325 Timebase which will be used for timestamps of submitted frames. It must be
yading@10 12326 either a floating-point number or in I<numerator>/I<denominator> form.
yading@10 12327
yading@10 12328
yading@10 12329 =item B<sample_rate>
yading@10 12330
yading@10 12331 The sample rate of the incoming audio buffers.
yading@10 12332
yading@10 12333
yading@10 12334 =item B<sample_fmt>
yading@10 12335
yading@10 12336 The sample format of the incoming audio buffers.
yading@10 12337 Either a sample format name or its corresponging integer representation from
yading@10 12338 the enum AVSampleFormat in F<libavutil/samplefmt.h>
yading@10 12339
yading@10 12340
yading@10 12341 =item B<channel_layout>
yading@10 12342
yading@10 12343 The channel layout of the incoming audio buffers.
yading@10 12344 Either a channel layout name from channel_layout_map in
yading@10 12345 F<libavutil/channel_layout.c> or its corresponding integer representation
yading@10 12346 from the AV_CH_LAYOUT_* macros in F<libavutil/channel_layout.h>
yading@10 12347
yading@10 12348
yading@10 12349 =item B<channels>
yading@10 12350
yading@10 12351 The number of channels of the incoming audio buffers.
yading@10 12352 If both I<channels> and I<channel_layout> are specified, then they
yading@10 12353 must be consistent.
yading@10 12354
yading@10 12355
yading@10 12356 =back
yading@10 12357
yading@10 12358
yading@10 12359
yading@10 12360 =head3 Examples
yading@10 12361
yading@10 12362
yading@10 12363
yading@10 12364 abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
yading@10 12365
yading@10 12366
yading@10 12367 will instruct the source to accept planar 16bit signed stereo at 44100Hz.
yading@10 12368 Since the sample format with name "s16p" corresponds to the number
yading@10 12369 6 and the "stereo" channel layout corresponds to the value 0x3, this is
yading@10 12370 equivalent to:
yading@10 12371
yading@10 12372 abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
yading@10 12373
yading@10 12374
yading@10 12375
yading@10 12376 =head2 aevalsrc
yading@10 12377
yading@10 12378
yading@10 12379 Generate an audio signal specified by an expression.
yading@10 12380
yading@10 12381 This source accepts in input one or more expressions (one for each
yading@10 12382 channel), which are evaluated and used to generate a corresponding
yading@10 12383 audio signal.
yading@10 12384
yading@10 12385 This source accepts the following options:
yading@10 12386
yading@10 12387
yading@10 12388 =over 4
yading@10 12389
yading@10 12390
yading@10 12391 =item B<exprs>
yading@10 12392
yading@10 12393 Set the '|'-separated expressions list for each separate channel. In case the
yading@10 12394 B<channel_layout> option is not specified, the selected channel layout
yading@10 12395 depends on the number of provided expressions.
yading@10 12396
yading@10 12397
yading@10 12398 =item B<channel_layout, c>
yading@10 12399
yading@10 12400 Set the channel layout. The number of channels in the specified layout
yading@10 12401 must be equal to the number of specified expressions.
yading@10 12402
yading@10 12403
yading@10 12404 =item B<duration, d>
yading@10 12405
yading@10 12406 Set the minimum duration of the sourced audio. See the function
yading@10 12407 C<av_parse_time()> for the accepted format.
yading@10 12408 Note that the resulting duration may be greater than the specified
yading@10 12409 duration, as the generated audio is always cut at the end of a
yading@10 12410 complete frame.
yading@10 12411
yading@10 12412 If not specified, or the expressed duration is negative, the audio is
yading@10 12413 supposed to be generated forever.
yading@10 12414
yading@10 12415
yading@10 12416 =item B<nb_samples, n>
yading@10 12417
yading@10 12418 Set the number of samples per channel per each output frame,
yading@10 12419 default to 1024.
yading@10 12420
yading@10 12421
yading@10 12422 =item B<sample_rate, s>
yading@10 12423
yading@10 12424 Specify the sample rate, default to 44100.
yading@10 12425
yading@10 12426 =back
yading@10 12427
yading@10 12428
yading@10 12429 Each expression in I<exprs> can contain the following constants:
yading@10 12430
yading@10 12431
yading@10 12432 =over 4
yading@10 12433
yading@10 12434
yading@10 12435 =item B<n>
yading@10 12436
yading@10 12437 number of the evaluated sample, starting from 0
yading@10 12438
yading@10 12439
yading@10 12440 =item B<t>
yading@10 12441
yading@10 12442 time of the evaluated sample expressed in seconds, starting from 0
yading@10 12443
yading@10 12444
yading@10 12445 =item B<s>
yading@10 12446
yading@10 12447 sample rate
yading@10 12448
yading@10 12449
yading@10 12450 =back
yading@10 12451
yading@10 12452
yading@10 12453
yading@10 12454 =head3 Examples
yading@10 12455
yading@10 12456
yading@10 12457
yading@10 12458 =over 4
yading@10 12459
yading@10 12460
yading@10 12461 =item *
yading@10 12462
yading@10 12463 Generate silence:
yading@10 12464
yading@10 12465 aevalsrc=0
yading@10 12466
yading@10 12467
yading@10 12468
yading@10 12469 =item *
yading@10 12470
yading@10 12471 Generate a sin signal with frequency of 440 Hz, set sample rate to
yading@10 12472 8000 Hz:
yading@10 12473
yading@10 12474 aevalsrc="sin(440*2*PI*t):s=8000"
yading@10 12475
yading@10 12476
yading@10 12477
yading@10 12478 =item *
yading@10 12479
yading@10 12480 Generate a two channels signal, specify the channel layout (Front
yading@10 12481 Center + Back Center) explicitly:
yading@10 12482
yading@10 12483 aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC"
yading@10 12484
yading@10 12485
yading@10 12486
yading@10 12487 =item *
yading@10 12488
yading@10 12489 Generate white noise:
yading@10 12490
yading@10 12491 aevalsrc="-2+random(0)"
yading@10 12492
yading@10 12493
yading@10 12494
yading@10 12495 =item *
yading@10 12496
yading@10 12497 Generate an amplitude modulated signal:
yading@10 12498
yading@10 12499 aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)"
yading@10 12500
yading@10 12501
yading@10 12502
yading@10 12503 =item *
yading@10 12504
yading@10 12505 Generate 2.5 Hz binaural beats on a 360 Hz carrier:
yading@10 12506
yading@10 12507 aevalsrc="0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)"
yading@10 12508
yading@10 12509
yading@10 12510
yading@10 12511 =back
yading@10 12512
yading@10 12513
yading@10 12514
yading@10 12515 =head2 anullsrc
yading@10 12516
yading@10 12517
yading@10 12518 Null audio source, return unprocessed audio frames. It is mainly useful
yading@10 12519 as a template and to be employed in analysis / debugging tools, or as
yading@10 12520 the source for filters which ignore the input data (for example the sox
yading@10 12521 synth filter).
yading@10 12522
yading@10 12523 This source accepts the following options:
yading@10 12524
yading@10 12525
yading@10 12526 =over 4
yading@10 12527
yading@10 12528
yading@10 12529
yading@10 12530 =item B<channel_layout, cl>
yading@10 12531
yading@10 12532
yading@10 12533 Specify the channel layout, and can be either an integer or a string
yading@10 12534 representing a channel layout. The default value of I<channel_layout>
yading@10 12535 is "stereo".
yading@10 12536
yading@10 12537 Check the channel_layout_map definition in
yading@10 12538 F<libavutil/channel_layout.c> for the mapping between strings and
yading@10 12539 channel layout values.
yading@10 12540
yading@10 12541
yading@10 12542 =item B<sample_rate, r>
yading@10 12543
yading@10 12544 Specify the sample rate, and defaults to 44100.
yading@10 12545
yading@10 12546
yading@10 12547 =item B<nb_samples, n>
yading@10 12548
yading@10 12549 Set the number of samples per requested frames.
yading@10 12550
yading@10 12551
yading@10 12552 =back
yading@10 12553
yading@10 12554
yading@10 12555
yading@10 12556 =head3 Examples
yading@10 12557
yading@10 12558
yading@10 12559
yading@10 12560 =over 4
yading@10 12561
yading@10 12562
yading@10 12563 =item *
yading@10 12564
yading@10 12565 Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
yading@10 12566
yading@10 12567 anullsrc=r=48000:cl=4
yading@10 12568
yading@10 12569
yading@10 12570
yading@10 12571 =item *
yading@10 12572
yading@10 12573 Do the same operation with a more obvious syntax:
yading@10 12574
yading@10 12575 anullsrc=r=48000:cl=mono
yading@10 12576
yading@10 12577
yading@10 12578 =back
yading@10 12579
yading@10 12580
yading@10 12581
yading@10 12582 =head2 abuffer
yading@10 12583
yading@10 12584 Buffer audio frames, and make them available to the filter chain.
yading@10 12585
yading@10 12586 This source is not intended to be part of user-supplied graph descriptions but
yading@10 12587 for insertion by calling programs through the interface defined in
yading@10 12588 F<libavfilter/buffersrc.h>.
yading@10 12589
yading@10 12590 It accepts the following named parameters:
yading@10 12591
yading@10 12592 =over 4
yading@10 12593
yading@10 12594
yading@10 12595
yading@10 12596 =item B<time_base>
yading@10 12597
yading@10 12598 Timebase which will be used for timestamps of submitted frames. It must be
yading@10 12599 either a floating-point number or in I<numerator>/I<denominator> form.
yading@10 12600
yading@10 12601
yading@10 12602 =item B<sample_rate>
yading@10 12603
yading@10 12604 Audio sample rate.
yading@10 12605
yading@10 12606
yading@10 12607 =item B<sample_fmt>
yading@10 12608
yading@10 12609 Name of the sample format, as returned by C<av_get_sample_fmt_name()>.
yading@10 12610
yading@10 12611
yading@10 12612 =item B<channel_layout>
yading@10 12613
yading@10 12614 Channel layout of the audio data, in the form that can be accepted by
yading@10 12615 C<av_get_channel_layout()>.
yading@10 12616
yading@10 12617 =back
yading@10 12618
yading@10 12619
yading@10 12620 All the parameters need to be explicitly defined.
yading@10 12621
yading@10 12622
yading@10 12623 =head2 flite
yading@10 12624
yading@10 12625
yading@10 12626 Synthesize a voice utterance using the libflite library.
yading@10 12627
yading@10 12628 To enable compilation of this filter you need to configure FFmpeg with
yading@10 12629 C<--enable-libflite>.
yading@10 12630
yading@10 12631 Note that the flite library is not thread-safe.
yading@10 12632
yading@10 12633 The filter accepts the following options:
yading@10 12634
yading@10 12635
yading@10 12636 =over 4
yading@10 12637
yading@10 12638
yading@10 12639
yading@10 12640 =item B<list_voices>
yading@10 12641
yading@10 12642 If set to 1, list the names of the available voices and exit
yading@10 12643 immediately. Default value is 0.
yading@10 12644
yading@10 12645
yading@10 12646 =item B<nb_samples, n>
yading@10 12647
yading@10 12648 Set the maximum number of samples per frame. Default value is 512.
yading@10 12649
yading@10 12650
yading@10 12651 =item B<textfile>
yading@10 12652
yading@10 12653 Set the filename containing the text to speak.
yading@10 12654
yading@10 12655
yading@10 12656 =item B<text>
yading@10 12657
yading@10 12658 Set the text to speak.
yading@10 12659
yading@10 12660
yading@10 12661 =item B<voice, v>
yading@10 12662
yading@10 12663 Set the voice to use for the speech synthesis. Default value is
yading@10 12664 C<kal>. See also the I<list_voices> option.
yading@10 12665
yading@10 12666 =back
yading@10 12667
yading@10 12668
yading@10 12669
yading@10 12670 =head3 Examples
yading@10 12671
yading@10 12672
yading@10 12673
yading@10 12674 =over 4
yading@10 12675
yading@10 12676
yading@10 12677 =item *
yading@10 12678
yading@10 12679 Read from file F<speech.txt>, and synthetize the text using the
yading@10 12680 standard flite voice:
yading@10 12681
yading@10 12682 flite=textfile=speech.txt
yading@10 12683
yading@10 12684
yading@10 12685
yading@10 12686 =item *
yading@10 12687
yading@10 12688 Read the specified text selecting the C<slt> voice:
yading@10 12689
yading@10 12690 flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
yading@10 12691
yading@10 12692
yading@10 12693
yading@10 12694 =item *
yading@10 12695
yading@10 12696 Input text to ffmpeg:
yading@10 12697
yading@10 12698 ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
yading@10 12699
yading@10 12700
yading@10 12701
yading@10 12702 =item *
yading@10 12703
yading@10 12704 Make F<ffplay> speak the specified text, using C<flite> and
yading@10 12705 the C<lavfi> device:
yading@10 12706
yading@10 12707 ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
yading@10 12708
yading@10 12709
yading@10 12710 =back
yading@10 12711
yading@10 12712
yading@10 12713 For more information about libflite, check:
yading@10 12714 E<lt>B<http://www.speech.cs.cmu.edu/flite/>E<gt>
yading@10 12715
yading@10 12716
yading@10 12717 =head2 sine
yading@10 12718
yading@10 12719
yading@10 12720 Generate an audio signal made of a sine wave with amplitude 1/8.
yading@10 12721
yading@10 12722 The audio signal is bit-exact.
yading@10 12723
yading@10 12724 The filter accepts the following options:
yading@10 12725
yading@10 12726
yading@10 12727 =over 4
yading@10 12728
yading@10 12729
yading@10 12730
yading@10 12731 =item B<frequency, f>
yading@10 12732
yading@10 12733 Set the carrier frequency. Default is 440 Hz.
yading@10 12734
yading@10 12735
yading@10 12736 =item B<beep_factor, b>
yading@10 12737
yading@10 12738 Enable a periodic beep every second with frequency I<beep_factor> times
yading@10 12739 the carrier frequency. Default is 0, meaning the beep is disabled.
yading@10 12740
yading@10 12741
yading@10 12742 =item B<sample_rate, s>
yading@10 12743
yading@10 12744 Specify the sample rate, default is 44100.
yading@10 12745
yading@10 12746
yading@10 12747 =item B<duration, d>
yading@10 12748
yading@10 12749 Specify the duration of the generated audio stream.
yading@10 12750
yading@10 12751
yading@10 12752 =item B<samples_per_frame>
yading@10 12753
yading@10 12754 Set the number of samples per output frame, default is 1024.
yading@10 12755
yading@10 12756 =back
yading@10 12757
yading@10 12758
yading@10 12759
yading@10 12760 =head3 Examples
yading@10 12761
yading@10 12762
yading@10 12763
yading@10 12764 =over 4
yading@10 12765
yading@10 12766
yading@10 12767
yading@10 12768 =item *
yading@10 12769
yading@10 12770 Generate a simple 440 Hz sine wave:
yading@10 12771
yading@10 12772 sine
yading@10 12773
yading@10 12774
yading@10 12775
yading@10 12776 =item *
yading@10 12777
yading@10 12778 Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
yading@10 12779
yading@10 12780 sine=220:4:d=5
yading@10 12781 sine=f=220:b=4:d=5
yading@10 12782 sine=frequency=220:beep_factor=4:duration=5
yading@10 12783
yading@10 12784
yading@10 12785
yading@10 12786 =back
yading@10 12787
yading@10 12788
yading@10 12789
yading@10 12790
yading@10 12791 =head1 AUDIO SINKS
yading@10 12792
yading@10 12793
yading@10 12794 Below is a description of the currently available audio sinks.
yading@10 12795
yading@10 12796
yading@10 12797 =head2 abuffersink
yading@10 12798
yading@10 12799
yading@10 12800 Buffer audio frames, and make them available to the end of filter chain.
yading@10 12801
yading@10 12802 This sink is mainly intended for programmatic use, in particular
yading@10 12803 through the interface defined in F<libavfilter/buffersink.h>
yading@10 12804 or the options system.
yading@10 12805
yading@10 12806 It accepts a pointer to an AVABufferSinkContext structure, which
yading@10 12807 defines the incoming buffers' formats, to be passed as the opaque
yading@10 12808 parameter to C<avfilter_init_filter> for initialization.
yading@10 12809
yading@10 12810
yading@10 12811 =head2 anullsink
yading@10 12812
yading@10 12813
yading@10 12814 Null audio sink, do absolutely nothing with the input audio. It is
yading@10 12815 mainly useful as a template and to be employed in analysis / debugging
yading@10 12816 tools.
yading@10 12817
yading@10 12818
yading@10 12819
yading@10 12820 =head1 VIDEO FILTERS
yading@10 12821
yading@10 12822
yading@10 12823 When you configure your FFmpeg build, you can disable any of the
yading@10 12824 existing filters using C<--disable-filters>.
yading@10 12825 The configure output will show the video filters included in your
yading@10 12826 build.
yading@10 12827
yading@10 12828 Below is a description of the currently available video filters.
yading@10 12829
yading@10 12830
yading@10 12831 =head2 alphaextract
yading@10 12832
yading@10 12833
yading@10 12834 Extract the alpha component from the input as a grayscale video. This
yading@10 12835 is especially useful with the I<alphamerge> filter.
yading@10 12836
yading@10 12837
yading@10 12838 =head2 alphamerge
yading@10 12839
yading@10 12840
yading@10 12841 Add or replace the alpha component of the primary input with the
yading@10 12842 grayscale value of a second input. This is intended for use with
yading@10 12843 I<alphaextract> to allow the transmission or storage of frame
yading@10 12844 sequences that have alpha in a format that doesn't support an alpha
yading@10 12845 channel.
yading@10 12846
yading@10 12847 For example, to reconstruct full frames from a normal YUV-encoded video
yading@10 12848 and a separate video created with I<alphaextract>, you might use:
yading@10 12849
yading@10 12850 movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
yading@10 12851
yading@10 12852
yading@10 12853 Since this filter is designed for reconstruction, it operates on frame
yading@10 12854 sequences without considering timestamps, and terminates when either
yading@10 12855 input reaches end of stream. This will cause problems if your encoding
yading@10 12856 pipeline drops frames. If you're trying to apply an image as an
yading@10 12857 overlay to a video stream, consider the I<overlay> filter instead.
yading@10 12858
yading@10 12859
yading@10 12860 =head2 ass
yading@10 12861
yading@10 12862
yading@10 12863 Same as the subtitles filter, except that it doesn't require libavcodec
yading@10 12864 and libavformat to work. On the other hand, it is limited to ASS (Advanced
yading@10 12865 Substation Alpha) subtitles files.
yading@10 12866
yading@10 12867
yading@10 12868 =head2 bbox
yading@10 12869
yading@10 12870
yading@10 12871 Compute the bounding box for the non-black pixels in the input frame
yading@10 12872 luminance plane.
yading@10 12873
yading@10 12874 This filter computes the bounding box containing all the pixels with a
yading@10 12875 luminance value greater than the minimum allowed value.
yading@10 12876 The parameters describing the bounding box are printed on the filter
yading@10 12877 log.
yading@10 12878
yading@10 12879
yading@10 12880 =head2 blackdetect
yading@10 12881
yading@10 12882
yading@10 12883 Detect video intervals that are (almost) completely black. Can be
yading@10 12884 useful to detect chapter transitions, commercials, or invalid
yading@10 12885 recordings. Output lines contains the time for the start, end and
yading@10 12886 duration of the detected black interval expressed in seconds.
yading@10 12887
yading@10 12888 In order to display the output lines, you need to set the loglevel at
yading@10 12889 least to the AV_LOG_INFO value.
yading@10 12890
yading@10 12891 The filter accepts the following options:
yading@10 12892
yading@10 12893
yading@10 12894 =over 4
yading@10 12895
yading@10 12896
yading@10 12897 =item B<black_min_duration, d>
yading@10 12898
yading@10 12899 Set the minimum detected black duration expressed in seconds. It must
yading@10 12900 be a non-negative floating point number.
yading@10 12901
yading@10 12902 Default value is 2.0.
yading@10 12903
yading@10 12904
yading@10 12905 =item B<picture_black_ratio_th, pic_th>
yading@10 12906
yading@10 12907 Set the threshold for considering a picture "black".
yading@10 12908 Express the minimum value for the ratio:
yading@10 12909
yading@10 12910 <nb_black_pixels> / <nb_pixels>
yading@10 12911
yading@10 12912
yading@10 12913 for which a picture is considered black.
yading@10 12914 Default value is 0.98.
yading@10 12915
yading@10 12916
yading@10 12917 =item B<pixel_black_th, pix_th>
yading@10 12918
yading@10 12919 Set the threshold for considering a pixel "black".
yading@10 12920
yading@10 12921 The threshold expresses the maximum pixel luminance value for which a
yading@10 12922 pixel is considered "black". The provided value is scaled according to
yading@10 12923 the following equation:
yading@10 12924
yading@10 12925 <absolute_threshold> = <luminance_minimum_value> + <pixel_black_th> * <luminance_range_size>
yading@10 12926
yading@10 12927
yading@10 12928 I<luminance_range_size> and I<luminance_minimum_value> depend on
yading@10 12929 the input video format, the range is [0-255] for YUV full-range
yading@10 12930 formats and [16-235] for YUV non full-range formats.
yading@10 12931
yading@10 12932 Default value is 0.10.
yading@10 12933
yading@10 12934 =back
yading@10 12935
yading@10 12936
yading@10 12937 The following example sets the maximum pixel threshold to the minimum
yading@10 12938 value, and detects only black intervals of 2 or more seconds:
yading@10 12939
yading@10 12940 blackdetect=d=2:pix_th=0.00
yading@10 12941
yading@10 12942
yading@10 12943
yading@10 12944 =head2 blackframe
yading@10 12945
yading@10 12946
yading@10 12947 Detect frames that are (almost) completely black. Can be useful to
yading@10 12948 detect chapter transitions or commercials. Output lines consist of
yading@10 12949 the frame number of the detected frame, the percentage of blackness,
yading@10 12950 the position in the file if known or -1 and the timestamp in seconds.
yading@10 12951
yading@10 12952 In order to display the output lines, you need to set the loglevel at
yading@10 12953 least to the AV_LOG_INFO value.
yading@10 12954
yading@10 12955 The filter accepts the following options:
yading@10 12956
yading@10 12957
yading@10 12958 =over 4
yading@10 12959
yading@10 12960
yading@10 12961
yading@10 12962 =item B<amount>
yading@10 12963
yading@10 12964 Set the percentage of the pixels that have to be below the threshold, defaults
yading@10 12965 to C<98>.
yading@10 12966
yading@10 12967
yading@10 12968 =item B<threshold, thresh>
yading@10 12969
yading@10 12970 Set the threshold below which a pixel value is considered black, defaults to
yading@10 12971 C<32>.
yading@10 12972
yading@10 12973
yading@10 12974 =back
yading@10 12975
yading@10 12976
yading@10 12977
yading@10 12978 =head2 blend
yading@10 12979
yading@10 12980
yading@10 12981 Blend two video frames into each other.
yading@10 12982
yading@10 12983 It takes two input streams and outputs one stream, the first input is the
yading@10 12984 "top" layer and second input is "bottom" layer.
yading@10 12985 Output terminates when shortest input terminates.
yading@10 12986
yading@10 12987 A description of the accepted options follows.
yading@10 12988
yading@10 12989
yading@10 12990 =over 4
yading@10 12991
yading@10 12992
yading@10 12993 =item B<c0_mode>
yading@10 12994
yading@10 12995
yading@10 12996 =item B<c1_mode>
yading@10 12997
yading@10 12998
yading@10 12999 =item B<c2_mode>
yading@10 13000
yading@10 13001
yading@10 13002 =item B<c3_mode>
yading@10 13003
yading@10 13004
yading@10 13005 =item B<all_mode>
yading@10 13006
yading@10 13007 Set blend mode for specific pixel component or all pixel components in case
yading@10 13008 of I<all_mode>. Default value is C<normal>.
yading@10 13009
yading@10 13010 Available values for component modes are:
yading@10 13011
yading@10 13012 =over 4
yading@10 13013
yading@10 13014
yading@10 13015 =item B<addition>
yading@10 13016
yading@10 13017
yading@10 13018 =item B<and>
yading@10 13019
yading@10 13020
yading@10 13021 =item B<average>
yading@10 13022
yading@10 13023
yading@10 13024 =item B<burn>
yading@10 13025
yading@10 13026
yading@10 13027 =item B<darken>
yading@10 13028
yading@10 13029
yading@10 13030 =item B<difference>
yading@10 13031
yading@10 13032
yading@10 13033 =item B<divide>
yading@10 13034
yading@10 13035
yading@10 13036 =item B<dodge>
yading@10 13037
yading@10 13038
yading@10 13039 =item B<exclusion>
yading@10 13040
yading@10 13041
yading@10 13042 =item B<hardlight>
yading@10 13043
yading@10 13044
yading@10 13045 =item B<lighten>
yading@10 13046
yading@10 13047
yading@10 13048 =item B<multiply>
yading@10 13049
yading@10 13050
yading@10 13051 =item B<negation>
yading@10 13052
yading@10 13053
yading@10 13054 =item B<normal>
yading@10 13055
yading@10 13056
yading@10 13057 =item B<or>
yading@10 13058
yading@10 13059
yading@10 13060 =item B<overlay>
yading@10 13061
yading@10 13062
yading@10 13063 =item B<phoenix>
yading@10 13064
yading@10 13065
yading@10 13066 =item B<pinlight>
yading@10 13067
yading@10 13068
yading@10 13069 =item B<reflect>
yading@10 13070
yading@10 13071
yading@10 13072 =item B<screen>
yading@10 13073
yading@10 13074
yading@10 13075 =item B<softlight>
yading@10 13076
yading@10 13077
yading@10 13078 =item B<subtract>
yading@10 13079
yading@10 13080
yading@10 13081 =item B<vividlight>
yading@10 13082
yading@10 13083
yading@10 13084 =item B<xor>
yading@10 13085
yading@10 13086
yading@10 13087 =back
yading@10 13088
yading@10 13089
yading@10 13090
yading@10 13091 =item B<c0_opacity>
yading@10 13092
yading@10 13093
yading@10 13094 =item B<c1_opacity>
yading@10 13095
yading@10 13096
yading@10 13097 =item B<c2_opacity>
yading@10 13098
yading@10 13099
yading@10 13100 =item B<c3_opacity>
yading@10 13101
yading@10 13102
yading@10 13103 =item B<all_opacity>
yading@10 13104
yading@10 13105 Set blend opacity for specific pixel component or all pixel components in case
yading@10 13106 of I<all_opacity>. Only used in combination with pixel component blend modes.
yading@10 13107
yading@10 13108
yading@10 13109 =item B<c0_expr>
yading@10 13110
yading@10 13111
yading@10 13112 =item B<c1_expr>
yading@10 13113
yading@10 13114
yading@10 13115 =item B<c2_expr>
yading@10 13116
yading@10 13117
yading@10 13118 =item B<c3_expr>
yading@10 13119
yading@10 13120
yading@10 13121 =item B<all_expr>
yading@10 13122
yading@10 13123 Set blend expression for specific pixel component or all pixel components in case
yading@10 13124 of I<all_expr>. Note that related mode options will be ignored if those are set.
yading@10 13125
yading@10 13126 The expressions can use the following variables:
yading@10 13127
yading@10 13128
yading@10 13129 =over 4
yading@10 13130
yading@10 13131
yading@10 13132 =item B<N>
yading@10 13133
yading@10 13134 The sequential number of the filtered frame, starting from C<0>.
yading@10 13135
yading@10 13136
yading@10 13137 =item B<X>
yading@10 13138
yading@10 13139
yading@10 13140 =item B<Y>
yading@10 13141
yading@10 13142 the coordinates of the current sample
yading@10 13143
yading@10 13144
yading@10 13145 =item B<W>
yading@10 13146
yading@10 13147
yading@10 13148 =item B<H>
yading@10 13149
yading@10 13150 the width and height of currently filtered plane
yading@10 13151
yading@10 13152
yading@10 13153 =item B<SW>
yading@10 13154
yading@10 13155
yading@10 13156 =item B<SH>
yading@10 13157
yading@10 13158 Width and height scale depending on the currently filtered plane. It is the
yading@10 13159 ratio between the corresponding luma plane number of pixels and the current
yading@10 13160 plane ones. E.g. for YUV4:2:0 the values are C<1,1> for the luma plane, and
yading@10 13161 C<0.5,0.5> for chroma planes.
yading@10 13162
yading@10 13163
yading@10 13164 =item B<T>
yading@10 13165
yading@10 13166 Time of the current frame, expressed in seconds.
yading@10 13167
yading@10 13168
yading@10 13169 =item B<TOP, A>
yading@10 13170
yading@10 13171 Value of pixel component at current location for first video frame (top layer).
yading@10 13172
yading@10 13173
yading@10 13174 =item B<BOTTOM, B>
yading@10 13175
yading@10 13176 Value of pixel component at current location for second video frame (bottom layer).
yading@10 13177
yading@10 13178 =back
yading@10 13179
yading@10 13180
yading@10 13181 =back
yading@10 13182
yading@10 13183
yading@10 13184
yading@10 13185 =head3 Examples
yading@10 13186
yading@10 13187
yading@10 13188
yading@10 13189 =over 4
yading@10 13190
yading@10 13191
yading@10 13192 =item *
yading@10 13193
yading@10 13194 Apply transition from bottom layer to top layer in first 10 seconds:
yading@10 13195
yading@10 13196 blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
yading@10 13197
yading@10 13198
yading@10 13199
yading@10 13200 =item *
yading@10 13201
yading@10 13202 Apply 1x1 checkerboard effect:
yading@10 13203
yading@10 13204 blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
yading@10 13205
yading@10 13206
yading@10 13207 =back
yading@10 13208
yading@10 13209
yading@10 13210
yading@10 13211 =head2 boxblur
yading@10 13212
yading@10 13213
yading@10 13214 Apply boxblur algorithm to the input video.
yading@10 13215
yading@10 13216 The filter accepts the following options:
yading@10 13217
yading@10 13218
yading@10 13219 =over 4
yading@10 13220
yading@10 13221
yading@10 13222
yading@10 13223 =item B<luma_radius, lr>
yading@10 13224
yading@10 13225
yading@10 13226 =item B<luma_power, lp>
yading@10 13227
yading@10 13228
yading@10 13229 =item B<chroma_radius, cr>
yading@10 13230
yading@10 13231
yading@10 13232 =item B<chroma_power, cp>
yading@10 13233
yading@10 13234
yading@10 13235 =item B<alpha_radius, ar>
yading@10 13236
yading@10 13237
yading@10 13238 =item B<alpha_power, ap>
yading@10 13239
yading@10 13240
yading@10 13241
yading@10 13242 =back
yading@10 13243
yading@10 13244
yading@10 13245 A description of the accepted options follows.
yading@10 13246
yading@10 13247
yading@10 13248 =over 4
yading@10 13249
yading@10 13250
yading@10 13251 =item B<luma_radius, lr>
yading@10 13252
yading@10 13253
yading@10 13254 =item B<chroma_radius, cr>
yading@10 13255
yading@10 13256
yading@10 13257 =item B<alpha_radius, ar>
yading@10 13258
yading@10 13259 Set an expression for the box radius in pixels used for blurring the
yading@10 13260 corresponding input plane.
yading@10 13261
yading@10 13262 The radius value must be a non-negative number, and must not be
yading@10 13263 greater than the value of the expression C<min(w,h)/2> for the
yading@10 13264 luma and alpha planes, and of C<min(cw,ch)/2> for the chroma
yading@10 13265 planes.
yading@10 13266
yading@10 13267 Default value for B<luma_radius> is "2". If not specified,
yading@10 13268 B<chroma_radius> and B<alpha_radius> default to the
yading@10 13269 corresponding value set for B<luma_radius>.
yading@10 13270
yading@10 13271 The expressions can contain the following constants:
yading@10 13272
yading@10 13273 =over 4
yading@10 13274
yading@10 13275
yading@10 13276 =item B<w, h>
yading@10 13277
yading@10 13278 the input width and height in pixels
yading@10 13279
yading@10 13280
yading@10 13281 =item B<cw, ch>
yading@10 13282
yading@10 13283 the input chroma image width and height in pixels
yading@10 13284
yading@10 13285
yading@10 13286 =item B<hsub, vsub>
yading@10 13287
yading@10 13288 horizontal and vertical chroma subsample values. For example for the
yading@10 13289 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 13290
yading@10 13291 =back
yading@10 13292
yading@10 13293
yading@10 13294
yading@10 13295 =item B<luma_power, lp>
yading@10 13296
yading@10 13297
yading@10 13298 =item B<chroma_power, cp>
yading@10 13299
yading@10 13300
yading@10 13301 =item B<alpha_power, ap>
yading@10 13302
yading@10 13303 Specify how many times the boxblur filter is applied to the
yading@10 13304 corresponding plane.
yading@10 13305
yading@10 13306 Default value for B<luma_power> is 2. If not specified,
yading@10 13307 B<chroma_power> and B<alpha_power> default to the
yading@10 13308 corresponding value set for B<luma_power>.
yading@10 13309
yading@10 13310 A value of 0 will disable the effect.
yading@10 13311
yading@10 13312 =back
yading@10 13313
yading@10 13314
yading@10 13315
yading@10 13316 =head3 Examples
yading@10 13317
yading@10 13318
yading@10 13319
yading@10 13320 =over 4
yading@10 13321
yading@10 13322
yading@10 13323 =item *
yading@10 13324
yading@10 13325 Apply a boxblur filter with luma, chroma, and alpha radius
yading@10 13326 set to 2:
yading@10 13327
yading@10 13328 boxblur=luma_radius=2:luma_power=1
yading@10 13329 boxblur=2:1
yading@10 13330
yading@10 13331
yading@10 13332
yading@10 13333 =item *
yading@10 13334
yading@10 13335 Set luma radius to 2, alpha and chroma radius to 0:
yading@10 13336
yading@10 13337 boxblur=2:1:cr=0:ar=0
yading@10 13338
yading@10 13339
yading@10 13340
yading@10 13341 =item *
yading@10 13342
yading@10 13343 Set luma and chroma radius to a fraction of the video dimension:
yading@10 13344
yading@10 13345 boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
yading@10 13346
yading@10 13347
yading@10 13348 =back
yading@10 13349
yading@10 13350
yading@10 13351
yading@10 13352 =head2 colorbalance
yading@10 13353
yading@10 13354 Modify intensity of primary colors (red, green and blue) of input frames.
yading@10 13355
yading@10 13356 The filter allows an input frame to be adjusted in the shadows, midtones or highlights
yading@10 13357 regions for the red-cyan, green-magenta or blue-yellow balance.
yading@10 13358
yading@10 13359 A positive adjustment value shifts the balance towards the primary color, a negative
yading@10 13360 value towards the complementary color.
yading@10 13361
yading@10 13362 The filter accepts the following options:
yading@10 13363
yading@10 13364
yading@10 13365 =over 4
yading@10 13366
yading@10 13367
yading@10 13368 =item B<rs>
yading@10 13369
yading@10 13370
yading@10 13371 =item B<gs>
yading@10 13372
yading@10 13373
yading@10 13374 =item B<bs>
yading@10 13375
yading@10 13376 Adjust red, green and blue shadows (darkest pixels).
yading@10 13377
yading@10 13378
yading@10 13379 =item B<rm>
yading@10 13380
yading@10 13381
yading@10 13382 =item B<gm>
yading@10 13383
yading@10 13384
yading@10 13385 =item B<bm>
yading@10 13386
yading@10 13387 Adjust red, green and blue midtones (medium pixels).
yading@10 13388
yading@10 13389
yading@10 13390 =item B<rh>
yading@10 13391
yading@10 13392
yading@10 13393 =item B<gh>
yading@10 13394
yading@10 13395
yading@10 13396 =item B<bh>
yading@10 13397
yading@10 13398 Adjust red, green and blue highlights (brightest pixels).
yading@10 13399
yading@10 13400 Allowed ranges for options are C<[-1.0, 1.0]>. Defaults are C<0>.
yading@10 13401
yading@10 13402 =back
yading@10 13403
yading@10 13404
yading@10 13405
yading@10 13406 =head3 Examples
yading@10 13407
yading@10 13408
yading@10 13409
yading@10 13410 =over 4
yading@10 13411
yading@10 13412
yading@10 13413 =item *
yading@10 13414
yading@10 13415 Add red color cast to shadows:
yading@10 13416
yading@10 13417 colorbalance=rs=.3
yading@10 13418
yading@10 13419
yading@10 13420 =back
yading@10 13421
yading@10 13422
yading@10 13423
yading@10 13424 =head2 colorchannelmixer
yading@10 13425
yading@10 13426
yading@10 13427 Adjust video input frames by re-mixing color channels.
yading@10 13428
yading@10 13429 This filter modifies a color channel by adding the values associated to
yading@10 13430 the other channels of the same pixels. For example if the value to
yading@10 13431 modify is red, the output value will be:
yading@10 13432
yading@10 13433 <red>=<red>*<rr> + <blue>*<rb> + <green>*<rg> + <alpha>*<ra>
yading@10 13434
yading@10 13435
yading@10 13436 The filter accepts the following options:
yading@10 13437
yading@10 13438
yading@10 13439 =over 4
yading@10 13440
yading@10 13441
yading@10 13442 =item B<rr>
yading@10 13443
yading@10 13444
yading@10 13445 =item B<rg>
yading@10 13446
yading@10 13447
yading@10 13448 =item B<rb>
yading@10 13449
yading@10 13450
yading@10 13451 =item B<ra>
yading@10 13452
yading@10 13453 Adjust contribution of input red, green, blue and alpha channels for output red channel.
yading@10 13454 Default is C<1> for I<rr>, and C<0> for I<rg>, I<rb> and I<ra>.
yading@10 13455
yading@10 13456
yading@10 13457 =item B<gr>
yading@10 13458
yading@10 13459
yading@10 13460 =item B<gg>
yading@10 13461
yading@10 13462
yading@10 13463 =item B<gb>
yading@10 13464
yading@10 13465
yading@10 13466 =item B<ga>
yading@10 13467
yading@10 13468 Adjust contribution of input red, green, blue and alpha channels for output green channel.
yading@10 13469 Default is C<1> for I<gg>, and C<0> for I<gr>, I<gb> and I<ga>.
yading@10 13470
yading@10 13471
yading@10 13472 =item B<br>
yading@10 13473
yading@10 13474
yading@10 13475 =item B<bg>
yading@10 13476
yading@10 13477
yading@10 13478 =item B<bb>
yading@10 13479
yading@10 13480
yading@10 13481 =item B<ba>
yading@10 13482
yading@10 13483 Adjust contribution of input red, green, blue and alpha channels for output blue channel.
yading@10 13484 Default is C<1> for I<bb>, and C<0> for I<br>, I<bg> and I<ba>.
yading@10 13485
yading@10 13486
yading@10 13487 =item B<ar>
yading@10 13488
yading@10 13489
yading@10 13490 =item B<ag>
yading@10 13491
yading@10 13492
yading@10 13493 =item B<ab>
yading@10 13494
yading@10 13495
yading@10 13496 =item B<aa>
yading@10 13497
yading@10 13498 Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
yading@10 13499 Default is C<1> for I<aa>, and C<0> for I<ar>, I<ag> and I<ab>.
yading@10 13500
yading@10 13501 Allowed ranges for options are C<[-2.0, 2.0]>.
yading@10 13502
yading@10 13503 =back
yading@10 13504
yading@10 13505
yading@10 13506
yading@10 13507 =head3 Examples
yading@10 13508
yading@10 13509
yading@10 13510
yading@10 13511 =over 4
yading@10 13512
yading@10 13513
yading@10 13514 =item *
yading@10 13515
yading@10 13516 Convert source to grayscale:
yading@10 13517
yading@10 13518 colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
yading@10 13519
yading@10 13520
yading@10 13521 =back
yading@10 13522
yading@10 13523
yading@10 13524
yading@10 13525 =head2 colormatrix
yading@10 13526
yading@10 13527
yading@10 13528 Convert color matrix.
yading@10 13529
yading@10 13530 The filter accepts the following options:
yading@10 13531
yading@10 13532
yading@10 13533 =over 4
yading@10 13534
yading@10 13535
yading@10 13536 =item B<src>
yading@10 13537
yading@10 13538
yading@10 13539 =item B<dst>
yading@10 13540
yading@10 13541 Specify the source and destination color matrix. Both values must be
yading@10 13542 specified.
yading@10 13543
yading@10 13544 The accepted values are:
yading@10 13545
yading@10 13546 =over 4
yading@10 13547
yading@10 13548
yading@10 13549 =item B<bt709>
yading@10 13550
yading@10 13551 BT.709
yading@10 13552
yading@10 13553
yading@10 13554 =item B<bt601>
yading@10 13555
yading@10 13556 BT.601
yading@10 13557
yading@10 13558
yading@10 13559 =item B<smpte240m>
yading@10 13560
yading@10 13561 SMPTE-240M
yading@10 13562
yading@10 13563
yading@10 13564 =item B<fcc>
yading@10 13565
yading@10 13566 FCC
yading@10 13567
yading@10 13568 =back
yading@10 13569
yading@10 13570
yading@10 13571 =back
yading@10 13572
yading@10 13573
yading@10 13574 For example to convert from BT.601 to SMPTE-240M, use the command:
yading@10 13575
yading@10 13576 colormatrix=bt601:smpte240m
yading@10 13577
yading@10 13578
yading@10 13579
yading@10 13580 =head2 copy
yading@10 13581
yading@10 13582
yading@10 13583 Copy the input source unchanged to the output. Mainly useful for
yading@10 13584 testing purposes.
yading@10 13585
yading@10 13586
yading@10 13587 =head2 crop
yading@10 13588
yading@10 13589
yading@10 13590 Crop the input video to given dimensions.
yading@10 13591
yading@10 13592 The filter accepts the following options:
yading@10 13593
yading@10 13594
yading@10 13595 =over 4
yading@10 13596
yading@10 13597
yading@10 13598 =item B<w, out_w>
yading@10 13599
yading@10 13600 Width of the output video. It defaults to C<iw>.
yading@10 13601 This expression is evaluated only once during the filter
yading@10 13602 configuration.
yading@10 13603
yading@10 13604
yading@10 13605 =item B<h, out_h>
yading@10 13606
yading@10 13607 Height of the output video. It defaults to C<ih>.
yading@10 13608 This expression is evaluated only once during the filter
yading@10 13609 configuration.
yading@10 13610
yading@10 13611
yading@10 13612 =item B<x>
yading@10 13613
yading@10 13614 Horizontal position, in the input video, of the left edge of the output video.
yading@10 13615 It defaults to C<(in_w-out_w)/2>.
yading@10 13616 This expression is evaluated per-frame.
yading@10 13617
yading@10 13618
yading@10 13619 =item B<y>
yading@10 13620
yading@10 13621 Vertical position, in the input video, of the top edge of the output video.
yading@10 13622 It defaults to C<(in_h-out_h)/2>.
yading@10 13623 This expression is evaluated per-frame.
yading@10 13624
yading@10 13625
yading@10 13626 =item B<keep_aspect>
yading@10 13627
yading@10 13628 If set to 1 will force the output display aspect ratio
yading@10 13629 to be the same of the input, by changing the output sample aspect
yading@10 13630 ratio. It defaults to 0.
yading@10 13631
yading@10 13632 =back
yading@10 13633
yading@10 13634
yading@10 13635 The I<out_w>, I<out_h>, I<x>, I<y> parameters are
yading@10 13636 expressions containing the following constants:
yading@10 13637
yading@10 13638
yading@10 13639 =over 4
yading@10 13640
yading@10 13641
yading@10 13642 =item B<x, y>
yading@10 13643
yading@10 13644 the computed values for I<x> and I<y>. They are evaluated for
yading@10 13645 each new frame.
yading@10 13646
yading@10 13647
yading@10 13648 =item B<in_w, in_h>
yading@10 13649
yading@10 13650 the input width and height
yading@10 13651
yading@10 13652
yading@10 13653 =item B<iw, ih>
yading@10 13654
yading@10 13655 same as I<in_w> and I<in_h>
yading@10 13656
yading@10 13657
yading@10 13658 =item B<out_w, out_h>
yading@10 13659
yading@10 13660 the output (cropped) width and height
yading@10 13661
yading@10 13662
yading@10 13663 =item B<ow, oh>
yading@10 13664
yading@10 13665 same as I<out_w> and I<out_h>
yading@10 13666
yading@10 13667
yading@10 13668 =item B<a>
yading@10 13669
yading@10 13670 same as I<iw> / I<ih>
yading@10 13671
yading@10 13672
yading@10 13673 =item B<sar>
yading@10 13674
yading@10 13675 input sample aspect ratio
yading@10 13676
yading@10 13677
yading@10 13678 =item B<dar>
yading@10 13679
yading@10 13680 input display aspect ratio, it is the same as (I<iw> / I<ih>) * I<sar>
yading@10 13681
yading@10 13682
yading@10 13683 =item B<hsub, vsub>
yading@10 13684
yading@10 13685 horizontal and vertical chroma subsample values. For example for the
yading@10 13686 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 13687
yading@10 13688
yading@10 13689 =item B<n>
yading@10 13690
yading@10 13691 the number of input frame, starting from 0
yading@10 13692
yading@10 13693
yading@10 13694 =item B<pos>
yading@10 13695
yading@10 13696 the position in the file of the input frame, NAN if unknown
yading@10 13697
yading@10 13698
yading@10 13699 =item B<t>
yading@10 13700
yading@10 13701 timestamp expressed in seconds, NAN if the input timestamp is unknown
yading@10 13702
yading@10 13703
yading@10 13704 =back
yading@10 13705
yading@10 13706
yading@10 13707 The expression for I<out_w> may depend on the value of I<out_h>,
yading@10 13708 and the expression for I<out_h> may depend on I<out_w>, but they
yading@10 13709 cannot depend on I<x> and I<y>, as I<x> and I<y> are
yading@10 13710 evaluated after I<out_w> and I<out_h>.
yading@10 13711
yading@10 13712 The I<x> and I<y> parameters specify the expressions for the
yading@10 13713 position of the top-left corner of the output (non-cropped) area. They
yading@10 13714 are evaluated for each frame. If the evaluated value is not valid, it
yading@10 13715 is approximated to the nearest valid value.
yading@10 13716
yading@10 13717 The expression for I<x> may depend on I<y>, and the expression
yading@10 13718 for I<y> may depend on I<x>.
yading@10 13719
yading@10 13720
yading@10 13721 =head3 Examples
yading@10 13722
yading@10 13723
yading@10 13724
yading@10 13725 =over 4
yading@10 13726
yading@10 13727
yading@10 13728 =item *
yading@10 13729
yading@10 13730 Crop area with size 100x100 at position (12,34).
yading@10 13731
yading@10 13732 crop=100:100:12:34
yading@10 13733
yading@10 13734
yading@10 13735 Using named options, the example above becomes:
yading@10 13736
yading@10 13737 crop=w=100:h=100:x=12:y=34
yading@10 13738
yading@10 13739
yading@10 13740
yading@10 13741 =item *
yading@10 13742
yading@10 13743 Crop the central input area with size 100x100:
yading@10 13744
yading@10 13745 crop=100:100
yading@10 13746
yading@10 13747
yading@10 13748
yading@10 13749 =item *
yading@10 13750
yading@10 13751 Crop the central input area with size 2/3 of the input video:
yading@10 13752
yading@10 13753 crop=2/3*in_w:2/3*in_h
yading@10 13754
yading@10 13755
yading@10 13756
yading@10 13757 =item *
yading@10 13758
yading@10 13759 Crop the input video central square:
yading@10 13760
yading@10 13761 crop=out_w=in_h
yading@10 13762 crop=in_h
yading@10 13763
yading@10 13764
yading@10 13765
yading@10 13766 =item *
yading@10 13767
yading@10 13768 Delimit the rectangle with the top-left corner placed at position
yading@10 13769 100:100 and the right-bottom corner corresponding to the right-bottom
yading@10 13770 corner of the input image:
yading@10 13771
yading@10 13772 crop=in_w-100:in_h-100:100:100
yading@10 13773
yading@10 13774
yading@10 13775
yading@10 13776 =item *
yading@10 13777
yading@10 13778 Crop 10 pixels from the left and right borders, and 20 pixels from
yading@10 13779 the top and bottom borders
yading@10 13780
yading@10 13781 crop=in_w-2*10:in_h-2*20
yading@10 13782
yading@10 13783
yading@10 13784
yading@10 13785 =item *
yading@10 13786
yading@10 13787 Keep only the bottom right quarter of the input image:
yading@10 13788
yading@10 13789 crop=in_w/2:in_h/2:in_w/2:in_h/2
yading@10 13790
yading@10 13791
yading@10 13792
yading@10 13793 =item *
yading@10 13794
yading@10 13795 Crop height for getting Greek harmony:
yading@10 13796
yading@10 13797 crop=in_w:1/PHI*in_w
yading@10 13798
yading@10 13799
yading@10 13800
yading@10 13801 =item *
yading@10 13802
yading@10 13803 Appply trembling effect:
yading@10 13804
yading@10 13805 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 13806
yading@10 13807
yading@10 13808
yading@10 13809 =item *
yading@10 13810
yading@10 13811 Apply erratic camera effect depending on timestamp:
yading@10 13812
yading@10 13813 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 13814
yading@10 13815
yading@10 13816
yading@10 13817 =item *
yading@10 13818
yading@10 13819 Set x depending on the value of y:
yading@10 13820
yading@10 13821 crop=in_w/2:in_h/2:y:10+10*sin(n/10)
yading@10 13822
yading@10 13823
yading@10 13824 =back
yading@10 13825
yading@10 13826
yading@10 13827
yading@10 13828 =head2 cropdetect
yading@10 13829
yading@10 13830
yading@10 13831 Auto-detect crop size.
yading@10 13832
yading@10 13833 Calculate necessary cropping parameters and prints the recommended
yading@10 13834 parameters through the logging system. The detected dimensions
yading@10 13835 correspond to the non-black area of the input video.
yading@10 13836
yading@10 13837 The filter accepts the following options:
yading@10 13838
yading@10 13839
yading@10 13840 =over 4
yading@10 13841
yading@10 13842
yading@10 13843
yading@10 13844 =item B<limit>
yading@10 13845
yading@10 13846 Set higher black value threshold, which can be optionally specified
yading@10 13847 from nothing (0) to everything (255). An intensity value greater
yading@10 13848 to the set value is considered non-black. Default value is 24.
yading@10 13849
yading@10 13850
yading@10 13851 =item B<round>
yading@10 13852
yading@10 13853 Set the value for which the width/height should be divisible by. The
yading@10 13854 offset is automatically adjusted to center the video. Use 2 to get
yading@10 13855 only even dimensions (needed for 4:2:2 video). 16 is best when
yading@10 13856 encoding to most video codecs. Default value is 16.
yading@10 13857
yading@10 13858
yading@10 13859 =item B<reset_count, reset>
yading@10 13860
yading@10 13861 Set the counter that determines after how many frames cropdetect will
yading@10 13862 reset the previously detected largest video area and start over to
yading@10 13863 detect the current optimal crop area. Default value is 0.
yading@10 13864
yading@10 13865 This can be useful when channel logos distort the video area. 0
yading@10 13866 indicates never reset and return the largest area encountered during
yading@10 13867 playback.
yading@10 13868
yading@10 13869 =back
yading@10 13870
yading@10 13871
yading@10 13872
yading@10 13873 =head2 curves
yading@10 13874
yading@10 13875
yading@10 13876 Apply color adjustments using curves.
yading@10 13877
yading@10 13878 This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
yading@10 13879 component (red, green and blue) has its values defined by I<N> key points
yading@10 13880 tied from each other using a smooth curve. The x-axis represents the pixel
yading@10 13881 values from the input frame, and the y-axis the new pixel values to be set for
yading@10 13882 the output frame.
yading@10 13883
yading@10 13884 By default, a component curve is defined by the two points I<(0;0)> and
yading@10 13885 I<(1;1)>. This creates a straight line where each original pixel value is
yading@10 13886 "adjusted" to its own value, which means no change to the image.
yading@10 13887
yading@10 13888 The filter allows you to redefine these two points and add some more. A new
yading@10 13889 curve (using a natural cubic spline interpolation) will be define to pass
yading@10 13890 smoothly through all these new coordinates. The new defined points needs to be
yading@10 13891 strictly increasing over the x-axis, and their I<x> and I<y> values must
yading@10 13892 be in the I<[0;1]> interval. If the computed curves happened to go outside
yading@10 13893 the vector spaces, the values will be clipped accordingly.
yading@10 13894
yading@10 13895 If there is no key point defined in C<x=0>, the filter will automatically
yading@10 13896 insert a I<(0;0)> point. In the same way, if there is no key point defined
yading@10 13897 in C<x=1>, the filter will automatically insert a I<(1;1)> point.
yading@10 13898
yading@10 13899 The filter accepts the following options:
yading@10 13900
yading@10 13901
yading@10 13902 =over 4
yading@10 13903
yading@10 13904
yading@10 13905 =item B<preset>
yading@10 13906
yading@10 13907 Select one of the available color presets. This option can be used in addition
yading@10 13908 to the B<r>, B<g>, B<b> parameters; in this case, the later
yading@10 13909 options takes priority on the preset values.
yading@10 13910 Available presets are:
yading@10 13911
yading@10 13912 =over 4
yading@10 13913
yading@10 13914
yading@10 13915 =item B<none>
yading@10 13916
yading@10 13917
yading@10 13918 =item B<color_negative>
yading@10 13919
yading@10 13920
yading@10 13921 =item B<cross_process>
yading@10 13922
yading@10 13923
yading@10 13924 =item B<darker>
yading@10 13925
yading@10 13926
yading@10 13927 =item B<increase_contrast>
yading@10 13928
yading@10 13929
yading@10 13930 =item B<lighter>
yading@10 13931
yading@10 13932
yading@10 13933 =item B<linear_contrast>
yading@10 13934
yading@10 13935
yading@10 13936 =item B<medium_contrast>
yading@10 13937
yading@10 13938
yading@10 13939 =item B<negative>
yading@10 13940
yading@10 13941
yading@10 13942 =item B<strong_contrast>
yading@10 13943
yading@10 13944
yading@10 13945 =item B<vintage>
yading@10 13946
yading@10 13947
yading@10 13948 =back
yading@10 13949
yading@10 13950 Default is C<none>.
yading@10 13951
yading@10 13952 =item B<master, m>
yading@10 13953
yading@10 13954 Set the master key points. These points will define a second pass mapping. It
yading@10 13955 is sometimes called a "luminance" or "value" mapping. It can be used with
yading@10 13956 B<r>, B<g>, B<b> or B<all> since it acts like a
yading@10 13957 post-processing LUT.
yading@10 13958
yading@10 13959 =item B<red, r>
yading@10 13960
yading@10 13961 Set the key points for the red component.
yading@10 13962
yading@10 13963 =item B<green, g>
yading@10 13964
yading@10 13965 Set the key points for the green component.
yading@10 13966
yading@10 13967 =item B<blue, b>
yading@10 13968
yading@10 13969 Set the key points for the blue component.
yading@10 13970
yading@10 13971 =item B<all>
yading@10 13972
yading@10 13973 Set the key points for all components (not including master).
yading@10 13974 Can be used in addition to the other key points component
yading@10 13975 options. In this case, the unset component(s) will fallback on this
yading@10 13976 B<all> setting.
yading@10 13977
yading@10 13978 =item B<psfile>
yading@10 13979
yading@10 13980 Specify a Photoshop curves file (C<.asv>) to import the settings from.
yading@10 13981
yading@10 13982 =back
yading@10 13983
yading@10 13984
yading@10 13985 To avoid some filtergraph syntax conflicts, each key points list need to be
yading@10 13986 defined using the following syntax: C<x0/y0 x1/y1 x2/y2 ...>.
yading@10 13987
yading@10 13988
yading@10 13989 =head3 Examples
yading@10 13990
yading@10 13991
yading@10 13992
yading@10 13993 =over 4
yading@10 13994
yading@10 13995
yading@10 13996 =item *
yading@10 13997
yading@10 13998 Increase slightly the middle level of blue:
yading@10 13999
yading@10 14000 curves=blue='0.5/0.58'
yading@10 14001
yading@10 14002
yading@10 14003
yading@10 14004 =item *
yading@10 14005
yading@10 14006 Vintage effect:
yading@10 14007
yading@10 14008 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 14009
yading@10 14010 Here we obtain the following coordinates for each components:
yading@10 14011
yading@10 14012 =over 4
yading@10 14013
yading@10 14014
yading@10 14015 =item I<red>
yading@10 14016
yading@10 14017 C<(0;0.11) (0.42;0.51) (1;0.95)>
yading@10 14018
yading@10 14019 =item I<green>
yading@10 14020
yading@10 14021 C<(0;0) (0.50;0.48) (1;1)>
yading@10 14022
yading@10 14023 =item I<blue>
yading@10 14024
yading@10 14025 C<(0;0.22) (0.49;0.44) (1;0.80)>
yading@10 14026
yading@10 14027 =back
yading@10 14028
yading@10 14029
yading@10 14030
yading@10 14031 =item *
yading@10 14032
yading@10 14033 The previous example can also be achieved with the associated built-in preset:
yading@10 14034
yading@10 14035 curves=preset=vintage
yading@10 14036
yading@10 14037
yading@10 14038
yading@10 14039 =item *
yading@10 14040
yading@10 14041 Or simply:
yading@10 14042
yading@10 14043 curves=vintage
yading@10 14044
yading@10 14045
yading@10 14046
yading@10 14047 =item *
yading@10 14048
yading@10 14049 Use a Photoshop preset and redefine the points of the green component:
yading@10 14050
yading@10 14051 curves=psfile='MyCurvesPresets/purple.asv':green='0.45/0.53'
yading@10 14052
yading@10 14053
yading@10 14054 =back
yading@10 14055
yading@10 14056
yading@10 14057
yading@10 14058
yading@10 14059 =head2 decimate
yading@10 14060
yading@10 14061
yading@10 14062 Drop duplicated frames at regular intervals.
yading@10 14063
yading@10 14064 The filter accepts the following options:
yading@10 14065
yading@10 14066
yading@10 14067 =over 4
yading@10 14068
yading@10 14069
yading@10 14070 =item B<cycle>
yading@10 14071
yading@10 14072 Set the number of frames from which one will be dropped. Setting this to
yading@10 14073 I<N> means one frame in every batch of I<N> frames will be dropped.
yading@10 14074 Default is C<5>.
yading@10 14075
yading@10 14076
yading@10 14077 =item B<dupthresh>
yading@10 14078
yading@10 14079 Set the threshold for duplicate detection. If the difference metric for a frame
yading@10 14080 is less than or equal to this value, then it is declared as duplicate. Default
yading@10 14081 is C<1.1>
yading@10 14082
yading@10 14083
yading@10 14084 =item B<scthresh>
yading@10 14085
yading@10 14086 Set scene change threshold. Default is C<15>.
yading@10 14087
yading@10 14088
yading@10 14089 =item B<blockx>
yading@10 14090
yading@10 14091
yading@10 14092 =item B<blocky>
yading@10 14093
yading@10 14094 Set the size of the x and y-axis blocks used during metric calculations.
yading@10 14095 Larger blocks give better noise suppression, but also give worse detection of
yading@10 14096 small movements. Must be a power of two. Default is C<32>.
yading@10 14097
yading@10 14098
yading@10 14099 =item B<ppsrc>
yading@10 14100
yading@10 14101 Mark main input as a pre-processed input and activate clean source input
yading@10 14102 stream. This allows the input to be pre-processed with various filters to help
yading@10 14103 the metrics calculation while keeping the frame selection lossless. When set to
yading@10 14104 C<1>, the first stream is for the pre-processed input, and the second
yading@10 14105 stream is the clean source from where the kept frames are chosen. Default is
yading@10 14106 C<0>.
yading@10 14107
yading@10 14108
yading@10 14109 =item B<chroma>
yading@10 14110
yading@10 14111 Set whether or not chroma is considered in the metric calculations. Default is
yading@10 14112 C<1>.
yading@10 14113
yading@10 14114 =back
yading@10 14115
yading@10 14116
yading@10 14117
yading@10 14118 =head2 delogo
yading@10 14119
yading@10 14120
yading@10 14121 Suppress a TV station logo by a simple interpolation of the surrounding
yading@10 14122 pixels. Just set a rectangle covering the logo and watch it disappear
yading@10 14123 (and sometimes something even uglier appear - your mileage may vary).
yading@10 14124
yading@10 14125 This filter accepts the following options:
yading@10 14126
yading@10 14127 =over 4
yading@10 14128
yading@10 14129
yading@10 14130
yading@10 14131 =item B<x, y>
yading@10 14132
yading@10 14133 Specify the top left corner coordinates of the logo. They must be
yading@10 14134 specified.
yading@10 14135
yading@10 14136
yading@10 14137 =item B<w, h>
yading@10 14138
yading@10 14139 Specify the width and height of the logo to clear. They must be
yading@10 14140 specified.
yading@10 14141
yading@10 14142
yading@10 14143 =item B<band, t>
yading@10 14144
yading@10 14145 Specify the thickness of the fuzzy edge of the rectangle (added to
yading@10 14146 I<w> and I<h>). The default value is 4.
yading@10 14147
yading@10 14148
yading@10 14149 =item B<show>
yading@10 14150
yading@10 14151 When set to 1, a green rectangle is drawn on the screen to simplify
yading@10 14152 finding the right I<x>, I<y>, I<w>, I<h> parameters, and
yading@10 14153 I<band> is set to 4. The default value is 0.
yading@10 14154
yading@10 14155
yading@10 14156 =back
yading@10 14157
yading@10 14158
yading@10 14159
yading@10 14160 =head3 Examples
yading@10 14161
yading@10 14162
yading@10 14163
yading@10 14164 =over 4
yading@10 14165
yading@10 14166
yading@10 14167 =item *
yading@10 14168
yading@10 14169 Set a rectangle covering the area with top left corner coordinates 0,0
yading@10 14170 and size 100x77, setting a band of size 10:
yading@10 14171
yading@10 14172 delogo=x=0:y=0:w=100:h=77:band=10
yading@10 14173
yading@10 14174
yading@10 14175
yading@10 14176 =back
yading@10 14177
yading@10 14178
yading@10 14179
yading@10 14180 =head2 deshake
yading@10 14181
yading@10 14182
yading@10 14183 Attempt to fix small changes in horizontal and/or vertical shift. This
yading@10 14184 filter helps remove camera shake from hand-holding a camera, bumping a
yading@10 14185 tripod, moving on a vehicle, etc.
yading@10 14186
yading@10 14187 The filter accepts the following options:
yading@10 14188
yading@10 14189
yading@10 14190 =over 4
yading@10 14191
yading@10 14192
yading@10 14193
yading@10 14194 =item B<x>
yading@10 14195
yading@10 14196
yading@10 14197 =item B<y>
yading@10 14198
yading@10 14199
yading@10 14200 =item B<w>
yading@10 14201
yading@10 14202
yading@10 14203 =item B<h>
yading@10 14204
yading@10 14205 Specify a rectangular area where to limit the search for motion
yading@10 14206 vectors.
yading@10 14207 If desired the search for motion vectors can be limited to a
yading@10 14208 rectangular area of the frame defined by its top left corner, width
yading@10 14209 and height. These parameters have the same meaning as the drawbox
yading@10 14210 filter which can be used to visualise the position of the bounding
yading@10 14211 box.
yading@10 14212
yading@10 14213 This is useful when simultaneous movement of subjects within the frame
yading@10 14214 might be confused for camera motion by the motion vector search.
yading@10 14215
yading@10 14216 If any or all of I<x>, I<y>, I<w> and I<h> are set to -1
yading@10 14217 then the full frame is used. This allows later options to be set
yading@10 14218 without specifying the bounding box for the motion vector search.
yading@10 14219
yading@10 14220 Default - search the whole frame.
yading@10 14221
yading@10 14222
yading@10 14223 =item B<rx>
yading@10 14224
yading@10 14225
yading@10 14226 =item B<ry>
yading@10 14227
yading@10 14228 Specify the maximum extent of movement in x and y directions in the
yading@10 14229 range 0-64 pixels. Default 16.
yading@10 14230
yading@10 14231
yading@10 14232 =item B<edge>
yading@10 14233
yading@10 14234 Specify how to generate pixels to fill blanks at the edge of the
yading@10 14235 frame. Available values are:
yading@10 14236
yading@10 14237 =over 4
yading@10 14238
yading@10 14239
yading@10 14240 =item B<blank, 0>
yading@10 14241
yading@10 14242 Fill zeroes at blank locations
yading@10 14243
yading@10 14244 =item B<original, 1>
yading@10 14245
yading@10 14246 Original image at blank locations
yading@10 14247
yading@10 14248 =item B<clamp, 2>
yading@10 14249
yading@10 14250 Extruded edge value at blank locations
yading@10 14251
yading@10 14252 =item B<mirror, 3>
yading@10 14253
yading@10 14254 Mirrored edge at blank locations
yading@10 14255
yading@10 14256 =back
yading@10 14257
yading@10 14258 Default value is B<mirror>.
yading@10 14259
yading@10 14260
yading@10 14261 =item B<blocksize>
yading@10 14262
yading@10 14263 Specify the blocksize to use for motion search. Range 4-128 pixels,
yading@10 14264 default 8.
yading@10 14265
yading@10 14266
yading@10 14267 =item B<contrast>
yading@10 14268
yading@10 14269 Specify the contrast threshold for blocks. Only blocks with more than
yading@10 14270 the specified contrast (difference between darkest and lightest
yading@10 14271 pixels) will be considered. Range 1-255, default 125.
yading@10 14272
yading@10 14273
yading@10 14274 =item B<search>
yading@10 14275
yading@10 14276 Specify the search strategy. Available values are:
yading@10 14277
yading@10 14278 =over 4
yading@10 14279
yading@10 14280
yading@10 14281 =item B<exhaustive, 0>
yading@10 14282
yading@10 14283 Set exhaustive search
yading@10 14284
yading@10 14285 =item B<less, 1>
yading@10 14286
yading@10 14287 Set less exhaustive search.
yading@10 14288
yading@10 14289 =back
yading@10 14290
yading@10 14291 Default value is B<exhaustive>.
yading@10 14292
yading@10 14293
yading@10 14294 =item B<filename>
yading@10 14295
yading@10 14296 If set then a detailed log of the motion search is written to the
yading@10 14297 specified file.
yading@10 14298
yading@10 14299
yading@10 14300 =item B<opencl>
yading@10 14301
yading@10 14302 If set to 1, specify using OpenCL capabilities, only available if
yading@10 14303 FFmpeg was configured with C<--enable-opencl>. Default value is 0.
yading@10 14304
yading@10 14305
yading@10 14306 =back
yading@10 14307
yading@10 14308
yading@10 14309
yading@10 14310 =head2 drawbox
yading@10 14311
yading@10 14312
yading@10 14313 Draw a colored box on the input image.
yading@10 14314
yading@10 14315 This filter accepts the following options:
yading@10 14316
yading@10 14317
yading@10 14318 =over 4
yading@10 14319
yading@10 14320
yading@10 14321 =item B<x, y>
yading@10 14322
yading@10 14323 Specify the top left corner coordinates of the box. Default to 0.
yading@10 14324
yading@10 14325
yading@10 14326 =item B<width, w>
yading@10 14327
yading@10 14328
yading@10 14329 =item B<height, h>
yading@10 14330
yading@10 14331 Specify the width and height of the box, if 0 they are interpreted as
yading@10 14332 the input width and height. Default to 0.
yading@10 14333
yading@10 14334
yading@10 14335 =item B<color, c>
yading@10 14336
yading@10 14337 Specify the color of the box to write, it can be the name of a color
yading@10 14338 (case insensitive match) or a 0xRRGGBB[AA] sequence. If the special
yading@10 14339 value C<invert> is used, the box edge color is the same as the
yading@10 14340 video with inverted luma.
yading@10 14341
yading@10 14342
yading@10 14343 =item B<thickness, t>
yading@10 14344
yading@10 14345 Set the thickness of the box edge. Default value is C<4>.
yading@10 14346
yading@10 14347 =back
yading@10 14348
yading@10 14349
yading@10 14350
yading@10 14351 =head3 Examples
yading@10 14352
yading@10 14353
yading@10 14354
yading@10 14355 =over 4
yading@10 14356
yading@10 14357
yading@10 14358 =item *
yading@10 14359
yading@10 14360 Draw a black box around the edge of the input image:
yading@10 14361
yading@10 14362 drawbox
yading@10 14363
yading@10 14364
yading@10 14365
yading@10 14366 =item *
yading@10 14367
yading@10 14368 Draw a box with color red and an opacity of 50%:
yading@10 14369
yading@10 14370 drawbox=10:20:200:60:red@0.5
yading@10 14371
yading@10 14372
yading@10 14373 The previous example can be specified as:
yading@10 14374
yading@10 14375 drawbox=x=10:y=20:w=200:h=60:color=red@0.5
yading@10 14376
yading@10 14377
yading@10 14378
yading@10 14379 =item *
yading@10 14380
yading@10 14381 Fill the box with pink color:
yading@10 14382
yading@10 14383 drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=max
yading@10 14384
yading@10 14385
yading@10 14386 =back
yading@10 14387
yading@10 14388
yading@10 14389
yading@10 14390
yading@10 14391 =head2 drawtext
yading@10 14392
yading@10 14393
yading@10 14394 Draw text string or text from specified file on top of video using the
yading@10 14395 libfreetype library.
yading@10 14396
yading@10 14397 To enable compilation of this filter you need to configure FFmpeg with
yading@10 14398 C<--enable-libfreetype>.
yading@10 14399
yading@10 14400
yading@10 14401 =head3 Syntax
yading@10 14402
yading@10 14403
yading@10 14404 The description of the accepted parameters follows.
yading@10 14405
yading@10 14406
yading@10 14407 =over 4
yading@10 14408
yading@10 14409
yading@10 14410
yading@10 14411 =item B<box>
yading@10 14412
yading@10 14413 Used to draw a box around text using background color.
yading@10 14414 Value should be either 1 (enable) or 0 (disable).
yading@10 14415 The default value of I<box> is 0.
yading@10 14416
yading@10 14417
yading@10 14418 =item B<boxcolor>
yading@10 14419
yading@10 14420 The color to be used for drawing box around text.
yading@10 14421 Either a string (e.g. "yellow") or in 0xRRGGBB[AA] format
yading@10 14422 (e.g. "0xff00ff"), possibly followed by an alpha specifier.
yading@10 14423 The default value of I<boxcolor> is "white".
yading@10 14424
yading@10 14425
yading@10 14426 =item B<draw>
yading@10 14427
yading@10 14428 Set an expression which specifies if the text should be drawn. If the
yading@10 14429 expression evaluates to 0, the text is not drawn. This is useful for
yading@10 14430 specifying that the text should be drawn only when specific conditions
yading@10 14431 are met.
yading@10 14432
yading@10 14433 Default value is "1".
yading@10 14434
yading@10 14435 See below for the list of accepted constants and functions.
yading@10 14436
yading@10 14437
yading@10 14438 =item B<expansion>
yading@10 14439
yading@10 14440 Select how the I<text> is expanded. Can be either C<none>,
yading@10 14441 C<strftime> (deprecated) or
yading@10 14442 C<normal> (default). See the drawtext_expansion, Text expansion section
yading@10 14443 below for details.
yading@10 14444
yading@10 14445
yading@10 14446 =item B<fix_bounds>
yading@10 14447
yading@10 14448 If true, check and fix text coords to avoid clipping.
yading@10 14449
yading@10 14450
yading@10 14451 =item B<fontcolor>
yading@10 14452
yading@10 14453 The color to be used for drawing fonts.
yading@10 14454 Either a string (e.g. "red") or in 0xRRGGBB[AA] format
yading@10 14455 (e.g. "0xff000033"), possibly followed by an alpha specifier.
yading@10 14456 The default value of I<fontcolor> is "black".
yading@10 14457
yading@10 14458
yading@10 14459 =item B<fontfile>
yading@10 14460
yading@10 14461 The font file to be used for drawing text. Path must be included.
yading@10 14462 This parameter is mandatory.
yading@10 14463
yading@10 14464
yading@10 14465 =item B<fontsize>
yading@10 14466
yading@10 14467 The font size to be used for drawing text.
yading@10 14468 The default value of I<fontsize> is 16.
yading@10 14469
yading@10 14470
yading@10 14471 =item B<ft_load_flags>
yading@10 14472
yading@10 14473 Flags to be used for loading the fonts.
yading@10 14474
yading@10 14475 The flags map the corresponding flags supported by libfreetype, and are
yading@10 14476 a combination of the following values:
yading@10 14477
yading@10 14478 =over 4
yading@10 14479
yading@10 14480
yading@10 14481 =item I<default>
yading@10 14482
yading@10 14483
yading@10 14484 =item I<no_scale>
yading@10 14485
yading@10 14486
yading@10 14487 =item I<no_hinting>
yading@10 14488
yading@10 14489
yading@10 14490 =item I<render>
yading@10 14491
yading@10 14492
yading@10 14493 =item I<no_bitmap>
yading@10 14494
yading@10 14495
yading@10 14496 =item I<vertical_layout>
yading@10 14497
yading@10 14498
yading@10 14499 =item I<force_autohint>
yading@10 14500
yading@10 14501
yading@10 14502 =item I<crop_bitmap>
yading@10 14503
yading@10 14504
yading@10 14505 =item I<pedantic>
yading@10 14506
yading@10 14507
yading@10 14508 =item I<ignore_global_advance_width>
yading@10 14509
yading@10 14510
yading@10 14511 =item I<no_recurse>
yading@10 14512
yading@10 14513
yading@10 14514 =item I<ignore_transform>
yading@10 14515
yading@10 14516
yading@10 14517 =item I<monochrome>
yading@10 14518
yading@10 14519
yading@10 14520 =item I<linear_design>
yading@10 14521
yading@10 14522
yading@10 14523 =item I<no_autohint>
yading@10 14524
yading@10 14525
yading@10 14526 =item I<end table>
yading@10 14527
yading@10 14528
yading@10 14529 =back
yading@10 14530
yading@10 14531
yading@10 14532 Default value is "render".
yading@10 14533
yading@10 14534 For more information consult the documentation for the FT_LOAD_*
yading@10 14535 libfreetype flags.
yading@10 14536
yading@10 14537
yading@10 14538 =item B<shadowcolor>
yading@10 14539
yading@10 14540 The color to be used for drawing a shadow behind the drawn text. It
yading@10 14541 can be a color name (e.g. "yellow") or a string in the 0xRRGGBB[AA]
yading@10 14542 form (e.g. "0xff00ff"), possibly followed by an alpha specifier.
yading@10 14543 The default value of I<shadowcolor> is "black".
yading@10 14544
yading@10 14545
yading@10 14546 =item B<shadowx, shadowy>
yading@10 14547
yading@10 14548 The x and y offsets for the text shadow position with respect to the
yading@10 14549 position of the text. They can be either positive or negative
yading@10 14550 values. Default value for both is "0".
yading@10 14551
yading@10 14552
yading@10 14553 =item B<tabsize>
yading@10 14554
yading@10 14555 The size in number of spaces to use for rendering the tab.
yading@10 14556 Default value is 4.
yading@10 14557
yading@10 14558
yading@10 14559 =item B<timecode>
yading@10 14560
yading@10 14561 Set the initial timecode representation in "hh:mm:ss[:;.]ff"
yading@10 14562 format. It can be used with or without text parameter. I<timecode_rate>
yading@10 14563 option must be specified.
yading@10 14564
yading@10 14565
yading@10 14566 =item B<timecode_rate, rate, r>
yading@10 14567
yading@10 14568 Set the timecode frame rate (timecode only).
yading@10 14569
yading@10 14570
yading@10 14571 =item B<text>
yading@10 14572
yading@10 14573 The text string to be drawn. The text must be a sequence of UTF-8
yading@10 14574 encoded characters.
yading@10 14575 This parameter is mandatory if no file is specified with the parameter
yading@10 14576 I<textfile>.
yading@10 14577
yading@10 14578
yading@10 14579 =item B<textfile>
yading@10 14580
yading@10 14581 A text file containing text to be drawn. The text must be a sequence
yading@10 14582 of UTF-8 encoded characters.
yading@10 14583
yading@10 14584 This parameter is mandatory if no text string is specified with the
yading@10 14585 parameter I<text>.
yading@10 14586
yading@10 14587 If both I<text> and I<textfile> are specified, an error is thrown.
yading@10 14588
yading@10 14589
yading@10 14590 =item B<reload>
yading@10 14591
yading@10 14592 If set to 1, the I<textfile> will be reloaded before each frame.
yading@10 14593 Be sure to update it atomically, or it may be read partially, or even fail.
yading@10 14594
yading@10 14595
yading@10 14596 =item B<x, y>
yading@10 14597
yading@10 14598 The expressions which specify the offsets where text will be drawn
yading@10 14599 within the video frame. They are relative to the top/left border of the
yading@10 14600 output image.
yading@10 14601
yading@10 14602 The default value of I<x> and I<y> is "0".
yading@10 14603
yading@10 14604 See below for the list of accepted constants and functions.
yading@10 14605
yading@10 14606 =back
yading@10 14607
yading@10 14608
yading@10 14609 The parameters for I<x> and I<y> are expressions containing the
yading@10 14610 following constants and functions:
yading@10 14611
yading@10 14612
yading@10 14613 =over 4
yading@10 14614
yading@10 14615
yading@10 14616 =item B<dar>
yading@10 14617
yading@10 14618 input display aspect ratio, it is the same as (I<w> / I<h>) * I<sar>
yading@10 14619
yading@10 14620
yading@10 14621 =item B<hsub, vsub>
yading@10 14622
yading@10 14623 horizontal and vertical chroma subsample values. For example for the
yading@10 14624 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 14625
yading@10 14626
yading@10 14627 =item B<line_h, lh>
yading@10 14628
yading@10 14629 the height of each text line
yading@10 14630
yading@10 14631
yading@10 14632 =item B<main_h, h, H>
yading@10 14633
yading@10 14634 the input height
yading@10 14635
yading@10 14636
yading@10 14637 =item B<main_w, w, W>
yading@10 14638
yading@10 14639 the input width
yading@10 14640
yading@10 14641
yading@10 14642 =item B<max_glyph_a, ascent>
yading@10 14643
yading@10 14644 the maximum distance from the baseline to the highest/upper grid
yading@10 14645 coordinate used to place a glyph outline point, for all the rendered
yading@10 14646 glyphs.
yading@10 14647 It is a positive value, due to the grid's orientation with the Y axis
yading@10 14648 upwards.
yading@10 14649
yading@10 14650
yading@10 14651 =item B<max_glyph_d, descent>
yading@10 14652
yading@10 14653 the maximum distance from the baseline to the lowest grid coordinate
yading@10 14654 used to place a glyph outline point, for all the rendered glyphs.
yading@10 14655 This is a negative value, due to the grid's orientation, with the Y axis
yading@10 14656 upwards.
yading@10 14657
yading@10 14658
yading@10 14659 =item B<max_glyph_h>
yading@10 14660
yading@10 14661 maximum glyph height, that is the maximum height for all the glyphs
yading@10 14662 contained in the rendered text, it is equivalent to I<ascent> -
yading@10 14663 I<descent>.
yading@10 14664
yading@10 14665
yading@10 14666 =item B<max_glyph_w>
yading@10 14667
yading@10 14668 maximum glyph width, that is the maximum width for all the glyphs
yading@10 14669 contained in the rendered text
yading@10 14670
yading@10 14671
yading@10 14672 =item B<n>
yading@10 14673
yading@10 14674 the number of input frame, starting from 0
yading@10 14675
yading@10 14676
yading@10 14677 =item B<rand(min, max)>
yading@10 14678
yading@10 14679 return a random number included between I<min> and I<max>
yading@10 14680
yading@10 14681
yading@10 14682 =item B<sar>
yading@10 14683
yading@10 14684 input sample aspect ratio
yading@10 14685
yading@10 14686
yading@10 14687 =item B<t>
yading@10 14688
yading@10 14689 timestamp expressed in seconds, NAN if the input timestamp is unknown
yading@10 14690
yading@10 14691
yading@10 14692 =item B<text_h, th>
yading@10 14693
yading@10 14694 the height of the rendered text
yading@10 14695
yading@10 14696
yading@10 14697 =item B<text_w, tw>
yading@10 14698
yading@10 14699 the width of the rendered text
yading@10 14700
yading@10 14701
yading@10 14702 =item B<x, y>
yading@10 14703
yading@10 14704 the x and y offset coordinates where the text is drawn.
yading@10 14705
yading@10 14706 These parameters allow the I<x> and I<y> expressions to refer
yading@10 14707 each other, so you can for example specify C<y=x/dar>.
yading@10 14708
yading@10 14709 =back
yading@10 14710
yading@10 14711
yading@10 14712 If libavfilter was built with C<--enable-fontconfig>, then
yading@10 14713 B<fontfile> can be a fontconfig pattern or omitted.
yading@10 14714
yading@10 14715
yading@10 14716
yading@10 14717 =head3 Text expansion
yading@10 14718
yading@10 14719
yading@10 14720 If B<expansion> is set to C<strftime>,
yading@10 14721 the filter recognizes strftime() sequences in the provided text and
yading@10 14722 expands them accordingly. Check the documentation of strftime(). This
yading@10 14723 feature is deprecated.
yading@10 14724
yading@10 14725 If B<expansion> is set to C<none>, the text is printed verbatim.
yading@10 14726
yading@10 14727 If B<expansion> is set to C<normal> (which is the default),
yading@10 14728 the following expansion mechanism is used.
yading@10 14729
yading@10 14730 The backslash character '\', followed by any character, always expands to
yading@10 14731 the second character.
yading@10 14732
yading@10 14733 Sequence of the form C<%{...}> are expanded. The text between the
yading@10 14734 braces is a function name, possibly followed by arguments separated by ':'.
yading@10 14735 If the arguments contain special characters or delimiters (':' or '}'),
yading@10 14736 they should be escaped.
yading@10 14737
yading@10 14738 Note that they probably must also be escaped as the value for the
yading@10 14739 B<text> option in the filter argument string and as the filter
yading@10 14740 argument in the filtergraph description, and possibly also for the shell,
yading@10 14741 that makes up to four levels of escaping; using a text file avoids these
yading@10 14742 problems.
yading@10 14743
yading@10 14744 The following functions are available:
yading@10 14745
yading@10 14746
yading@10 14747 =over 4
yading@10 14748
yading@10 14749
yading@10 14750
yading@10 14751 =item B<expr, e>
yading@10 14752
yading@10 14753 The expression evaluation result.
yading@10 14754
yading@10 14755 It must take one argument specifying the expression to be evaluated,
yading@10 14756 which accepts the same constants and functions as the I<x> and
yading@10 14757 I<y> values. Note that not all constants should be used, for
yading@10 14758 example the text size is not known when evaluating the expression, so
yading@10 14759 the constants I<text_w> and I<text_h> will have an undefined
yading@10 14760 value.
yading@10 14761
yading@10 14762
yading@10 14763 =item B<gmtime>
yading@10 14764
yading@10 14765 The time at which the filter is running, expressed in UTC.
yading@10 14766 It can accept an argument: a strftime() format string.
yading@10 14767
yading@10 14768
yading@10 14769 =item B<localtime>
yading@10 14770
yading@10 14771 The time at which the filter is running, expressed in the local time zone.
yading@10 14772 It can accept an argument: a strftime() format string.
yading@10 14773
yading@10 14774
yading@10 14775 =item B<n, frame_num>
yading@10 14776
yading@10 14777 The frame number, starting from 0.
yading@10 14778
yading@10 14779
yading@10 14780 =item B<pts>
yading@10 14781
yading@10 14782 The timestamp of the current frame, in seconds, with microsecond accuracy.
yading@10 14783
yading@10 14784
yading@10 14785 =back
yading@10 14786
yading@10 14787
yading@10 14788
yading@10 14789 =head3 Examples
yading@10 14790
yading@10 14791
yading@10 14792
yading@10 14793 =over 4
yading@10 14794
yading@10 14795
yading@10 14796 =item *
yading@10 14797
yading@10 14798 Draw "Test Text" with font FreeSerif, using the default values for the
yading@10 14799 optional parameters.
yading@10 14800
yading@10 14801
yading@10 14802 drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
yading@10 14803
yading@10 14804
yading@10 14805
yading@10 14806 =item *
yading@10 14807
yading@10 14808 Draw 'Test Text' with font FreeSerif of size 24 at position x=100
yading@10 14809 and y=50 (counting from the top-left corner of the screen), text is
yading@10 14810 yellow with a red box around it. Both the text and the box have an
yading@10 14811 opacity of 20%.
yading@10 14812
yading@10 14813
yading@10 14814 drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
yading@10 14815 x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2"
yading@10 14816
yading@10 14817
yading@10 14818 Note that the double quotes are not necessary if spaces are not used
yading@10 14819 within the parameter list.
yading@10 14820
yading@10 14821
yading@10 14822 =item *
yading@10 14823
yading@10 14824 Show the text at the center of the video frame:
yading@10 14825
yading@10 14826 drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h-line_h)/2"
yading@10 14827
yading@10 14828
yading@10 14829
yading@10 14830 =item *
yading@10 14831
yading@10 14832 Show a text line sliding from right to left in the last row of the video
yading@10 14833 frame. The file F<LONG_LINE> is assumed to contain a single line
yading@10 14834 with no newlines.
yading@10 14835
yading@10 14836 drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t"
yading@10 14837
yading@10 14838
yading@10 14839
yading@10 14840 =item *
yading@10 14841
yading@10 14842 Show the content of file F<CREDITS> off the bottom of the frame and scroll up.
yading@10 14843
yading@10 14844 drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t"
yading@10 14845
yading@10 14846
yading@10 14847
yading@10 14848 =item *
yading@10 14849
yading@10 14850 Draw a single green letter "g", at the center of the input video.
yading@10 14851 The glyph baseline is placed at half screen height.
yading@10 14852
yading@10 14853 drawtext="fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent"
yading@10 14854
yading@10 14855
yading@10 14856
yading@10 14857 =item *
yading@10 14858
yading@10 14859 Show text for 1 second every 3 seconds:
yading@10 14860
yading@10 14861 drawtext="fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:draw=lt(mod(t\,3)\,1):text='blink'"
yading@10 14862
yading@10 14863
yading@10 14864
yading@10 14865 =item *
yading@10 14866
yading@10 14867 Use fontconfig to set the font. Note that the colons need to be escaped.
yading@10 14868
yading@10 14869 drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
yading@10 14870
yading@10 14871
yading@10 14872
yading@10 14873 =item *
yading@10 14874
yading@10 14875 Print the date of a real-time encoding (see strftime(3)):
yading@10 14876
yading@10 14877 drawtext='fontfile=FreeSans.ttf:text=%{localtime:%a %b %d %Y}'
yading@10 14878
yading@10 14879
yading@10 14880
yading@10 14881 =back
yading@10 14882
yading@10 14883
yading@10 14884 For more information about libfreetype, check:
yading@10 14885 E<lt>B<http://www.freetype.org/>E<gt>.
yading@10 14886
yading@10 14887 For more information about fontconfig, check:
yading@10 14888 E<lt>B<http://freedesktop.org/software/fontconfig/fontconfig-user.html>E<gt>.
yading@10 14889
yading@10 14890
yading@10 14891 =head2 edgedetect
yading@10 14892
yading@10 14893
yading@10 14894 Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
yading@10 14895
yading@10 14896 The filter accepts the following options:
yading@10 14897
yading@10 14898
yading@10 14899 =over 4
yading@10 14900
yading@10 14901
yading@10 14902 =item B<low, high>
yading@10 14903
yading@10 14904 Set low and high threshold values used by the Canny thresholding
yading@10 14905 algorithm.
yading@10 14906
yading@10 14907 The high threshold selects the "strong" edge pixels, which are then
yading@10 14908 connected through 8-connectivity with the "weak" edge pixels selected
yading@10 14909 by the low threshold.
yading@10 14910
yading@10 14911 I<low> and I<high> threshold values must be choosen in the range
yading@10 14912 [0,1], and I<low> should be lesser or equal to I<high>.
yading@10 14913
yading@10 14914 Default value for I<low> is C<20/255>, and default value for I<high>
yading@10 14915 is C<50/255>.
yading@10 14916
yading@10 14917 =back
yading@10 14918
yading@10 14919
yading@10 14920 Example:
yading@10 14921
yading@10 14922 edgedetect=low=0.1:high=0.4
yading@10 14923
yading@10 14924
yading@10 14925
yading@10 14926 =head2 fade
yading@10 14927
yading@10 14928
yading@10 14929 Apply fade-in/out effect to input video.
yading@10 14930
yading@10 14931 This filter accepts the following options:
yading@10 14932
yading@10 14933
yading@10 14934 =over 4
yading@10 14935
yading@10 14936
yading@10 14937 =item B<type, t>
yading@10 14938
yading@10 14939 The effect type -- can be either "in" for fade-in, or "out" for a fade-out
yading@10 14940 effect.
yading@10 14941 Default is C<in>.
yading@10 14942
yading@10 14943
yading@10 14944 =item B<start_frame, s>
yading@10 14945
yading@10 14946 Specify the number of the start frame for starting to apply the fade
yading@10 14947 effect. Default is 0.
yading@10 14948
yading@10 14949
yading@10 14950 =item B<nb_frames, n>
yading@10 14951
yading@10 14952 The number of frames for which the fade effect has to last. At the end of the
yading@10 14953 fade-in effect the output video will have the same intensity as the input video,
yading@10 14954 at the end of the fade-out transition the output video will be completely black.
yading@10 14955 Default is 25.
yading@10 14956
yading@10 14957
yading@10 14958 =item B<alpha>
yading@10 14959
yading@10 14960 If set to 1, fade only alpha channel, if one exists on the input.
yading@10 14961 Default value is 0.
yading@10 14962
yading@10 14963 =back
yading@10 14964
yading@10 14965
yading@10 14966
yading@10 14967 =head3 Examples
yading@10 14968
yading@10 14969
yading@10 14970
yading@10 14971 =over 4
yading@10 14972
yading@10 14973
yading@10 14974 =item *
yading@10 14975
yading@10 14976 Fade in first 30 frames of video:
yading@10 14977
yading@10 14978 fade=in:0:30
yading@10 14979
yading@10 14980
yading@10 14981 The command above is equivalent to:
yading@10 14982
yading@10 14983 fade=t=in:s=0:n=30
yading@10 14984
yading@10 14985
yading@10 14986
yading@10 14987 =item *
yading@10 14988
yading@10 14989 Fade out last 45 frames of a 200-frame video:
yading@10 14990
yading@10 14991 fade=out:155:45
yading@10 14992 fade=type=out:start_frame=155:nb_frames=45
yading@10 14993
yading@10 14994
yading@10 14995
yading@10 14996 =item *
yading@10 14997
yading@10 14998 Fade in first 25 frames and fade out last 25 frames of a 1000-frame video:
yading@10 14999
yading@10 15000 fade=in:0:25, fade=out:975:25
yading@10 15001
yading@10 15002
yading@10 15003
yading@10 15004 =item *
yading@10 15005
yading@10 15006 Make first 5 frames black, then fade in from frame 5-24:
yading@10 15007
yading@10 15008 fade=in:5:20
yading@10 15009
yading@10 15010
yading@10 15011
yading@10 15012 =item *
yading@10 15013
yading@10 15014 Fade in alpha over first 25 frames of video:
yading@10 15015
yading@10 15016 fade=in:0:25:alpha=1
yading@10 15017
yading@10 15018
yading@10 15019 =back
yading@10 15020
yading@10 15021
yading@10 15022
yading@10 15023 =head2 field
yading@10 15024
yading@10 15025
yading@10 15026 Extract a single field from an interlaced image using stride
yading@10 15027 arithmetic to avoid wasting CPU time. The output frames are marked as
yading@10 15028 non-interlaced.
yading@10 15029
yading@10 15030 The filter accepts the following options:
yading@10 15031
yading@10 15032
yading@10 15033 =over 4
yading@10 15034
yading@10 15035
yading@10 15036 =item B<type>
yading@10 15037
yading@10 15038 Specify whether to extract the top (if the value is C<0> or
yading@10 15039 C<top>) or the bottom field (if the value is C<1> or
yading@10 15040 C<bottom>).
yading@10 15041
yading@10 15042 =back
yading@10 15043
yading@10 15044
yading@10 15045
yading@10 15046 =head2 fieldmatch
yading@10 15047
yading@10 15048
yading@10 15049 Field matching filter for inverse telecine. It is meant to reconstruct the
yading@10 15050 progressive frames from a telecined stream. The filter does not drop duplicated
yading@10 15051 frames, so to achieve a complete inverse telecine C<fieldmatch> needs to be
yading@10 15052 followed by a decimation filter such as decimate in the filtergraph.
yading@10 15053
yading@10 15054 The separation of the field matching and the decimation is notably motivated by
yading@10 15055 the possibility of inserting a de-interlacing filter fallback between the two.
yading@10 15056 If the source has mixed telecined and real interlaced content,
yading@10 15057 C<fieldmatch> will not be able to match fields for the interlaced parts.
yading@10 15058 But these remaining combed frames will be marked as interlaced, and thus can be
yading@10 15059 de-interlaced by a later filter such as yadif before decimation.
yading@10 15060
yading@10 15061 In addition to the various configuration options, C<fieldmatch> can take an
yading@10 15062 optional second stream, activated through the B<ppsrc> option. If
yading@10 15063 enabled, the frames reconstruction will be based on the fields and frames from
yading@10 15064 this second stream. This allows the first input to be pre-processed in order to
yading@10 15065 help the various algorithms of the filter, while keeping the output lossless
yading@10 15066 (assuming the fields are matched properly). Typically, a field-aware denoiser,
yading@10 15067 or brightness/contrast adjustments can help.
yading@10 15068
yading@10 15069 Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
yading@10 15070 and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
yading@10 15071 which C<fieldmatch> is based on. While the semantic and usage are very
yading@10 15072 close, some behaviour and options names can differ.
yading@10 15073
yading@10 15074 The filter accepts the following options:
yading@10 15075
yading@10 15076
yading@10 15077 =over 4
yading@10 15078
yading@10 15079
yading@10 15080 =item B<order>
yading@10 15081
yading@10 15082 Specify the assumed field order of the input stream. Available values are:
yading@10 15083
yading@10 15084
yading@10 15085 =over 4
yading@10 15086
yading@10 15087
yading@10 15088 =item B<auto>
yading@10 15089
yading@10 15090 Auto detect parity (use FFmpeg's internal parity value).
yading@10 15091
yading@10 15092 =item B<bff>
yading@10 15093
yading@10 15094 Assume bottom field first.
yading@10 15095
yading@10 15096 =item B<tff>
yading@10 15097
yading@10 15098 Assume top field first.
yading@10 15099
yading@10 15100 =back
yading@10 15101
yading@10 15102
yading@10 15103 Note that it is sometimes recommended not to trust the parity announced by the
yading@10 15104 stream.
yading@10 15105
yading@10 15106 Default value is I<auto>.
yading@10 15107
yading@10 15108
yading@10 15109 =item B<mode>
yading@10 15110
yading@10 15111 Set the matching mode or strategy to use. B<pc> mode is the safest in the
yading@10 15112 sense that it wont risk creating jerkiness due to duplicate frames when
yading@10 15113 possible, but if there are bad edits or blended fields it will end up
yading@10 15114 outputting combed frames when a good match might actually exist. On the other
yading@10 15115 hand, B<pcn_ub> mode is the most risky in terms of creating jerkiness,
yading@10 15116 but will almost always find a good frame if there is one. The other values are
yading@10 15117 all somewhere in between B<pc> and B<pcn_ub> in terms of risking
yading@10 15118 jerkiness and creating duplicate frames versus finding good matches in sections
yading@10 15119 with bad edits, orphaned fields, blended fields, etc.
yading@10 15120
yading@10 15121 More details about p/c/n/u/b are available in p/c/n/u/b meaning section.
yading@10 15122
yading@10 15123 Available values are:
yading@10 15124
yading@10 15125
yading@10 15126 =over 4
yading@10 15127
yading@10 15128
yading@10 15129 =item B<pc>
yading@10 15130
yading@10 15131 2-way matching (p/c)
yading@10 15132
yading@10 15133 =item B<pc_n>
yading@10 15134
yading@10 15135 2-way matching, and trying 3rd match if still combed (p/c + n)
yading@10 15136
yading@10 15137 =item B<pc_u>
yading@10 15138
yading@10 15139 2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
yading@10 15140
yading@10 15141 =item B<pc_n_ub>
yading@10 15142
yading@10 15143 2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
yading@10 15144 still combed (p/c + n + u/b)
yading@10 15145
yading@10 15146 =item B<pcn>
yading@10 15147
yading@10 15148 3-way matching (p/c/n)
yading@10 15149
yading@10 15150 =item B<pcn_ub>
yading@10 15151
yading@10 15152 3-way matching, and trying 4th/5th matches if all 3 of the original matches are
yading@10 15153 detected as combed (p/c/n + u/b)
yading@10 15154
yading@10 15155 =back
yading@10 15156
yading@10 15157
yading@10 15158 The parenthesis at the end indicate the matches that would be used for that
yading@10 15159 mode assuming B<order>=I<tff> (and B<field> on I<auto> or
yading@10 15160 I<top>).
yading@10 15161
yading@10 15162 In terms of speed B<pc> mode is by far the fastest and B<pcn_ub> is
yading@10 15163 the slowest.
yading@10 15164
yading@10 15165 Default value is I<pc_n>.
yading@10 15166
yading@10 15167
yading@10 15168 =item B<ppsrc>
yading@10 15169
yading@10 15170 Mark the main input stream as a pre-processed input, and enable the secondary
yading@10 15171 input stream as the clean source to pick the fields from. See the filter
yading@10 15172 introduction for more details. It is similar to the B<clip2> feature from
yading@10 15173 VFM/TFM.
yading@10 15174
yading@10 15175 Default value is C<0> (disabled).
yading@10 15176
yading@10 15177
yading@10 15178 =item B<field>
yading@10 15179
yading@10 15180 Set the field to match from. It is recommended to set this to the same value as
yading@10 15181 B<order> unless you experience matching failures with that setting. In
yading@10 15182 certain circumstances changing the field that is used to match from can have a
yading@10 15183 large impact on matching performance. Available values are:
yading@10 15184
yading@10 15185
yading@10 15186 =over 4
yading@10 15187
yading@10 15188
yading@10 15189 =item B<auto>
yading@10 15190
yading@10 15191 Automatic (same value as B<order>).
yading@10 15192
yading@10 15193 =item B<bottom>
yading@10 15194
yading@10 15195 Match from the bottom field.
yading@10 15196
yading@10 15197 =item B<top>
yading@10 15198
yading@10 15199 Match from the top field.
yading@10 15200
yading@10 15201 =back
yading@10 15202
yading@10 15203
yading@10 15204 Default value is I<auto>.
yading@10 15205
yading@10 15206
yading@10 15207 =item B<mchroma>
yading@10 15208
yading@10 15209 Set whether or not chroma is included during the match comparisons. In most
yading@10 15210 cases it is recommended to leave this enabled. You should set this to C<0>
yading@10 15211 only if your clip has bad chroma problems such as heavy rainbowing or other
yading@10 15212 artifacts. Setting this to C<0> could also be used to speed things up at
yading@10 15213 the cost of some accuracy.
yading@10 15214
yading@10 15215 Default value is C<1>.
yading@10 15216
yading@10 15217
yading@10 15218 =item B<y0>
yading@10 15219
yading@10 15220
yading@10 15221 =item B<y1>
yading@10 15222
yading@10 15223 These define an exclusion band which excludes the lines between B<y0> and
yading@10 15224 B<y1> from being included in the field matching decision. An exclusion
yading@10 15225 band can be used to ignore subtitles, a logo, or other things that may
yading@10 15226 interfere with the matching. B<y0> sets the starting scan line and
yading@10 15227 B<y1> sets the ending line; all lines in between B<y0> and
yading@10 15228 B<y1> (including B<y0> and B<y1>) will be ignored. Setting
yading@10 15229 B<y0> and B<y1> to the same value will disable the feature.
yading@10 15230 B<y0> and B<y1> defaults to C<0>.
yading@10 15231
yading@10 15232
yading@10 15233 =item B<scthresh>
yading@10 15234
yading@10 15235 Set the scene change detection threshold as a percentage of maximum change on
yading@10 15236 the luma plane. Good values are in the C<[8.0, 14.0]> range. Scene change
yading@10 15237 detection is only relevant in case B<combmatch>=I<sc>. The range for
yading@10 15238 B<scthresh> is C<[0.0, 100.0]>.
yading@10 15239
yading@10 15240 Default value is C<12.0>.
yading@10 15241
yading@10 15242
yading@10 15243 =item B<combmatch>
yading@10 15244
yading@10 15245 When B<combatch> is not I<none>, C<fieldmatch> will take into
yading@10 15246 account the combed scores of matches when deciding what match to use as the
yading@10 15247 final match. Available values are:
yading@10 15248
yading@10 15249
yading@10 15250 =over 4
yading@10 15251
yading@10 15252
yading@10 15253 =item B<none>
yading@10 15254
yading@10 15255 No final matching based on combed scores.
yading@10 15256
yading@10 15257 =item B<sc>
yading@10 15258
yading@10 15259 Combed scores are only used when a scene change is detected.
yading@10 15260
yading@10 15261 =item B<full>
yading@10 15262
yading@10 15263 Use combed scores all the time.
yading@10 15264
yading@10 15265 =back
yading@10 15266
yading@10 15267
yading@10 15268 Default is I<sc>.
yading@10 15269
yading@10 15270
yading@10 15271 =item B<combdbg>
yading@10 15272
yading@10 15273 Force C<fieldmatch> to calculate the combed metrics for certain matches and
yading@10 15274 print them. This setting is known as B<micout> in TFM/VFM vocabulary.
yading@10 15275 Available values are:
yading@10 15276
yading@10 15277
yading@10 15278 =over 4
yading@10 15279
yading@10 15280
yading@10 15281 =item B<none>
yading@10 15282
yading@10 15283 No forced calculation.
yading@10 15284
yading@10 15285 =item B<pcn>
yading@10 15286
yading@10 15287 Force p/c/n calculations.
yading@10 15288
yading@10 15289 =item B<pcnub>
yading@10 15290
yading@10 15291 Force p/c/n/u/b calculations.
yading@10 15292
yading@10 15293 =back
yading@10 15294
yading@10 15295
yading@10 15296 Default value is I<none>.
yading@10 15297
yading@10 15298
yading@10 15299 =item B<cthresh>
yading@10 15300
yading@10 15301 This is the area combing threshold used for combed frame detection. This
yading@10 15302 essentially controls how "strong" or "visible" combing must be to be detected.
yading@10 15303 Larger values mean combing must be more visible and smaller values mean combing
yading@10 15304 can be less visible or strong and still be detected. Valid settings are from
yading@10 15305 C<-1> (every pixel will be detected as combed) to C<255> (no pixel will
yading@10 15306 be detected as combed). This is basically a pixel difference value. A good
yading@10 15307 range is C<[8, 12]>.
yading@10 15308
yading@10 15309 Default value is C<9>.
yading@10 15310
yading@10 15311
yading@10 15312 =item B<chroma>
yading@10 15313
yading@10 15314 Sets whether or not chroma is considered in the combed frame decision. Only
yading@10 15315 disable this if your source has chroma problems (rainbowing, etc.) that are
yading@10 15316 causing problems for the combed frame detection with chroma enabled. Actually,
yading@10 15317 using B<chroma>=I<0> is usually more reliable, except for the case
yading@10 15318 where there is chroma only combing in the source.
yading@10 15319
yading@10 15320 Default value is C<0>.
yading@10 15321
yading@10 15322
yading@10 15323 =item B<blockx>
yading@10 15324
yading@10 15325
yading@10 15326 =item B<blocky>
yading@10 15327
yading@10 15328 Respectively set the x-axis and y-axis size of the window used during combed
yading@10 15329 frame detection. This has to do with the size of the area in which
yading@10 15330 B<combpel> pixels are required to be detected as combed for a frame to be
yading@10 15331 declared combed. See the B<combpel> parameter description for more info.
yading@10 15332 Possible values are any number that is a power of 2 starting at 4 and going up
yading@10 15333 to 512.
yading@10 15334
yading@10 15335 Default value is C<16>.
yading@10 15336
yading@10 15337
yading@10 15338 =item B<combpel>
yading@10 15339
yading@10 15340 The number of combed pixels inside any of the B<blocky> by
yading@10 15341 B<blockx> size blocks on the frame for the frame to be detected as
yading@10 15342 combed. While B<cthresh> controls how "visible" the combing must be, this
yading@10 15343 setting controls "how much" combing there must be in any localized area (a
yading@10 15344 window defined by the B<blockx> and B<blocky> settings) on the
yading@10 15345 frame. Minimum value is C<0> and maximum is C<blocky x blockx> (at
yading@10 15346 which point no frames will ever be detected as combed). This setting is known
yading@10 15347 as B<MI> in TFM/VFM vocabulary.
yading@10 15348
yading@10 15349 Default value is C<80>.
yading@10 15350
yading@10 15351 =back
yading@10 15352
yading@10 15353
yading@10 15354
yading@10 15355
yading@10 15356 =head3 p/c/n/u/b meaning
yading@10 15357
yading@10 15358
yading@10 15359
yading@10 15360 =head4 p/c/n
yading@10 15361
yading@10 15362
yading@10 15363 We assume the following telecined stream:
yading@10 15364
yading@10 15365
yading@10 15366 Top fields: 1 2 2 3 4
yading@10 15367 Bottom fields: 1 2 3 4 4
yading@10 15368
yading@10 15369
yading@10 15370 The numbers correspond to the progressive frame the fields relate to. Here, the
yading@10 15371 first two frames are progressive, the 3rd and 4th are combed, and so on.
yading@10 15372
yading@10 15373 When C<fieldmatch> is configured to run a matching from bottom
yading@10 15374 (B<field>=I<bottom>) this is how this input stream get transformed:
yading@10 15375
yading@10 15376
yading@10 15377 Input stream:
yading@10 15378 T 1 2 2 3 4
yading@10 15379 B 1 2 3 4 4 <-- matching reference
yading@10 15380
yading@10 15381 Matches: c c n n c
yading@10 15382
yading@10 15383 Output stream:
yading@10 15384 T 1 2 3 4 4
yading@10 15385 B 1 2 3 4 4
yading@10 15386
yading@10 15387
yading@10 15388 As a result of the field matching, we can see that some frames get duplicated.
yading@10 15389 To perform a complete inverse telecine, you need to rely on a decimation filter
yading@10 15390 after this operation. See for instance the decimate filter.
yading@10 15391
yading@10 15392 The same operation now matching from top fields (B<field>=I<top>)
yading@10 15393 looks like this:
yading@10 15394
yading@10 15395
yading@10 15396 Input stream:
yading@10 15397 T 1 2 2 3 4 <-- matching reference
yading@10 15398 B 1 2 3 4 4
yading@10 15399
yading@10 15400 Matches: c c p p c
yading@10 15401
yading@10 15402 Output stream:
yading@10 15403 T 1 2 2 3 4
yading@10 15404 B 1 2 2 3 4
yading@10 15405
yading@10 15406
yading@10 15407 In these examples, we can see what I<p>, I<c> and I<n> mean;
yading@10 15408 basically, they refer to the frame and field of the opposite parity:
yading@10 15409
yading@10 15410
yading@10 15411 =over 4
yading@10 15412
yading@10 15413
yading@10 15414 =item *<I<p> matches the field of the opposite parity in the previous frame>
yading@10 15415
yading@10 15416
yading@10 15417 =item *<I<c> matches the field of the opposite parity in the current frame>
yading@10 15418
yading@10 15419
yading@10 15420 =item *<I<n> matches the field of the opposite parity in the next frame>
yading@10 15421
yading@10 15422
yading@10 15423 =back
yading@10 15424
yading@10 15425
yading@10 15426
yading@10 15427 =head4 u/b
yading@10 15428
yading@10 15429
yading@10 15430 The I<u> and I<b> matching are a bit special in the sense that they match
yading@10 15431 from the opposite parity flag. In the following examples, we assume that we are
yading@10 15432 currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
yading@10 15433 'x' is placed above and below each matched fields.
yading@10 15434
yading@10 15435 With bottom matching (B<field>=I<bottom>):
yading@10 15436
yading@10 15437 Match: c p n b u
yading@10 15438
yading@10 15439 x x x x x
yading@10 15440 Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
yading@10 15441 Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
yading@10 15442 x x x x x
yading@10 15443
yading@10 15444 Output frames:
yading@10 15445 2 1 2 2 2
yading@10 15446 2 2 2 1 3
yading@10 15447
yading@10 15448
yading@10 15449 With top matching (B<field>=I<top>):
yading@10 15450
yading@10 15451 Match: c p n b u
yading@10 15452
yading@10 15453 x x x x x
yading@10 15454 Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
yading@10 15455 Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
yading@10 15456 x x x x x
yading@10 15457
yading@10 15458 Output frames:
yading@10 15459 2 2 2 1 2
yading@10 15460 2 1 3 2 2
yading@10 15461
yading@10 15462
yading@10 15463
yading@10 15464 =head3 Examples
yading@10 15465
yading@10 15466
yading@10 15467 Simple IVTC of a top field first telecined stream:
yading@10 15468
yading@10 15469 fieldmatch=order=tff:combmatch=none, decimate
yading@10 15470
yading@10 15471
yading@10 15472 Advanced IVTC, with fallback on yadif for still combed frames:
yading@10 15473
yading@10 15474 fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
yading@10 15475
yading@10 15476
yading@10 15477
yading@10 15478 =head2 fieldorder
yading@10 15479
yading@10 15480
yading@10 15481 Transform the field order of the input video.
yading@10 15482
yading@10 15483 This filter accepts the following options:
yading@10 15484
yading@10 15485
yading@10 15486 =over 4
yading@10 15487
yading@10 15488
yading@10 15489
yading@10 15490 =item B<order>
yading@10 15491
yading@10 15492 Output field order. Valid values are I<tff> for top field first or I<bff>
yading@10 15493 for bottom field first.
yading@10 15494
yading@10 15495 =back
yading@10 15496
yading@10 15497
yading@10 15498 Default value is B<tff>.
yading@10 15499
yading@10 15500 Transformation is achieved by shifting the picture content up or down
yading@10 15501 by one line, and filling the remaining line with appropriate picture content.
yading@10 15502 This method is consistent with most broadcast field order converters.
yading@10 15503
yading@10 15504 If the input video is not flagged as being interlaced, or it is already
yading@10 15505 flagged as being of the required output field order then this filter does
yading@10 15506 not alter the incoming video.
yading@10 15507
yading@10 15508 This filter is very useful when converting to or from PAL DV material,
yading@10 15509 which is bottom field first.
yading@10 15510
yading@10 15511 For example:
yading@10 15512
yading@10 15513 ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
yading@10 15514
yading@10 15515
yading@10 15516
yading@10 15517 =head2 fifo
yading@10 15518
yading@10 15519
yading@10 15520 Buffer input images and send them when they are requested.
yading@10 15521
yading@10 15522 This filter is mainly useful when auto-inserted by the libavfilter
yading@10 15523 framework.
yading@10 15524
yading@10 15525 The filter does not take parameters.
yading@10 15526
yading@10 15527
yading@10 15528
yading@10 15529 =head2 format
yading@10 15530
yading@10 15531
yading@10 15532 Convert the input video to one of the specified pixel formats.
yading@10 15533 Libavfilter will try to pick one that is supported for the input to
yading@10 15534 the next filter.
yading@10 15535
yading@10 15536 This filter accepts the following parameters:
yading@10 15537
yading@10 15538 =over 4
yading@10 15539
yading@10 15540
yading@10 15541
yading@10 15542 =item B<pix_fmts>
yading@10 15543
yading@10 15544 A '|'-separated list of pixel format names, for example
yading@10 15545 "pix_fmts=yuv420p|monow|rgb24".
yading@10 15546
yading@10 15547
yading@10 15548 =back
yading@10 15549
yading@10 15550
yading@10 15551
yading@10 15552 =head3 Examples
yading@10 15553
yading@10 15554
yading@10 15555
yading@10 15556 =over 4
yading@10 15557
yading@10 15558
yading@10 15559 =item *
yading@10 15560
yading@10 15561 Convert the input video to the format I<yuv420p>
yading@10 15562
yading@10 15563 format=pix_fmts=yuv420p
yading@10 15564
yading@10 15565
yading@10 15566 Convert the input video to any of the formats in the list
yading@10 15567
yading@10 15568 format=pix_fmts=yuv420p|yuv444p|yuv410p
yading@10 15569
yading@10 15570
yading@10 15571 =back
yading@10 15572
yading@10 15573
yading@10 15574
yading@10 15575 =head2 fps
yading@10 15576
yading@10 15577
yading@10 15578 Convert the video to specified constant frame rate by duplicating or dropping
yading@10 15579 frames as necessary.
yading@10 15580
yading@10 15581 This filter accepts the following named parameters:
yading@10 15582
yading@10 15583 =over 4
yading@10 15584
yading@10 15585
yading@10 15586
yading@10 15587 =item B<fps>
yading@10 15588
yading@10 15589 Desired output frame rate. The default is C<25>.
yading@10 15590
yading@10 15591
yading@10 15592 =item B<round>
yading@10 15593
yading@10 15594 Rounding method.
yading@10 15595
yading@10 15596 Possible values are:
yading@10 15597
yading@10 15598 =over 4
yading@10 15599
yading@10 15600
yading@10 15601 =item B<zero>
yading@10 15602
yading@10 15603 zero round towards 0
yading@10 15604
yading@10 15605 =item B<inf>
yading@10 15606
yading@10 15607 round away from 0
yading@10 15608
yading@10 15609 =item B<down>
yading@10 15610
yading@10 15611 round towards -infinity
yading@10 15612
yading@10 15613 =item B<up>
yading@10 15614
yading@10 15615 round towards +infinity
yading@10 15616
yading@10 15617 =item B<near>
yading@10 15618
yading@10 15619 round to nearest
yading@10 15620
yading@10 15621 =back
yading@10 15622
yading@10 15623 The default is C<near>.
yading@10 15624
yading@10 15625
yading@10 15626 =back
yading@10 15627
yading@10 15628
yading@10 15629 Alternatively, the options can be specified as a flat string:
yading@10 15630 I<fps>[:I<round>].
yading@10 15631
yading@10 15632 See also the setpts filter.
yading@10 15633
yading@10 15634
yading@10 15635 =head2 framestep
yading@10 15636
yading@10 15637
yading@10 15638 Select one frame every N-th frame.
yading@10 15639
yading@10 15640 This filter accepts the following option:
yading@10 15641
yading@10 15642 =over 4
yading@10 15643
yading@10 15644
yading@10 15645 =item B<step>
yading@10 15646
yading@10 15647 Select frame after every C<step> frames.
yading@10 15648 Allowed values are positive integers higher than 0. Default value is C<1>.
yading@10 15649
yading@10 15650 =back
yading@10 15651
yading@10 15652
yading@10 15653
yading@10 15654
yading@10 15655 =head2 frei0r
yading@10 15656
yading@10 15657
yading@10 15658 Apply a frei0r effect to the input video.
yading@10 15659
yading@10 15660 To enable compilation of this filter you need to install the frei0r
yading@10 15661 header and configure FFmpeg with C<--enable-frei0r>.
yading@10 15662
yading@10 15663 This filter accepts the following options:
yading@10 15664
yading@10 15665
yading@10 15666 =over 4
yading@10 15667
yading@10 15668
yading@10 15669
yading@10 15670 =item B<filter_name>
yading@10 15671
yading@10 15672 The name to the frei0r effect to load. If the environment variable
yading@10 15673 B<FREI0R_PATH> is defined, the frei0r effect is searched in each one of the
yading@10 15674 directories specified by the colon separated list in B<FREIOR_PATH>,
yading@10 15675 otherwise in the standard frei0r paths, which are in this order:
yading@10 15676 F<HOME/.frei0r-1/lib/>, F</usr/local/lib/frei0r-1/>,
yading@10 15677 F</usr/lib/frei0r-1/>.
yading@10 15678
yading@10 15679
yading@10 15680 =item B<filter_params>
yading@10 15681
yading@10 15682 A '|'-separated list of parameters to pass to the frei0r effect.
yading@10 15683
yading@10 15684
yading@10 15685 =back
yading@10 15686
yading@10 15687
yading@10 15688 A frei0r effect parameter can be a boolean (whose values are specified
yading@10 15689 with "y" and "n"), a double, a color (specified by the syntax
yading@10 15690 I<R>/I<G>/I<B>, I<R>, I<G>, and I<B> being float
yading@10 15691 numbers from 0.0 to 1.0) or by an C<av_parse_color()> color
yading@10 15692 description), a position (specified by the syntax I<X>/I<Y>,
yading@10 15693 I<X> and I<Y> being float numbers) and a string.
yading@10 15694
yading@10 15695 The number and kind of parameters depend on the loaded effect. If an
yading@10 15696 effect parameter is not specified the default value is set.
yading@10 15697
yading@10 15698
yading@10 15699 =head3 Examples
yading@10 15700
yading@10 15701
yading@10 15702
yading@10 15703 =over 4
yading@10 15704
yading@10 15705
yading@10 15706 =item *
yading@10 15707
yading@10 15708 Apply the distort0r effect, set the first two double parameters:
yading@10 15709
yading@10 15710 frei0r=filter_name=distort0r:filter_params=0.5|0.01
yading@10 15711
yading@10 15712
yading@10 15713
yading@10 15714 =item *
yading@10 15715
yading@10 15716 Apply the colordistance effect, take a color as first parameter:
yading@10 15717
yading@10 15718 frei0r=colordistance:0.2/0.3/0.4
yading@10 15719 frei0r=colordistance:violet
yading@10 15720 frei0r=colordistance:0x112233
yading@10 15721
yading@10 15722
yading@10 15723
yading@10 15724 =item *
yading@10 15725
yading@10 15726 Apply the perspective effect, specify the top left and top right image
yading@10 15727 positions:
yading@10 15728
yading@10 15729 frei0r=perspective:0.2/0.2|0.8/0.2
yading@10 15730
yading@10 15731
yading@10 15732 =back
yading@10 15733
yading@10 15734
yading@10 15735 For more information see:
yading@10 15736 E<lt>B<http://frei0r.dyne.org>E<gt>
yading@10 15737
yading@10 15738
yading@10 15739 =head2 geq
yading@10 15740
yading@10 15741
yading@10 15742 The filter accepts the following options:
yading@10 15743
yading@10 15744
yading@10 15745 =over 4
yading@10 15746
yading@10 15747
yading@10 15748 =item B<lum_expr>
yading@10 15749
yading@10 15750 the luminance expression
yading@10 15751
yading@10 15752 =item B<cb_expr>
yading@10 15753
yading@10 15754 the chrominance blue expression
yading@10 15755
yading@10 15756 =item B<cr_expr>
yading@10 15757
yading@10 15758 the chrominance red expression
yading@10 15759
yading@10 15760 =item B<alpha_expr>
yading@10 15761
yading@10 15762 the alpha expression
yading@10 15763
yading@10 15764 =back
yading@10 15765
yading@10 15766
yading@10 15767 If one of the chrominance expression is not defined, it falls back on the other
yading@10 15768 one. If no alpha expression is specified it will evaluate to opaque value.
yading@10 15769 If none of chrominance expressions are
yading@10 15770 specified, they will evaluate the luminance expression.
yading@10 15771
yading@10 15772 The expressions can use the following variables and functions:
yading@10 15773
yading@10 15774
yading@10 15775 =over 4
yading@10 15776
yading@10 15777
yading@10 15778 =item B<N>
yading@10 15779
yading@10 15780 The sequential number of the filtered frame, starting from C<0>.
yading@10 15781
yading@10 15782
yading@10 15783 =item B<X>
yading@10 15784
yading@10 15785
yading@10 15786 =item B<Y>
yading@10 15787
yading@10 15788 The coordinates of the current sample.
yading@10 15789
yading@10 15790
yading@10 15791 =item B<W>
yading@10 15792
yading@10 15793
yading@10 15794 =item B<H>
yading@10 15795
yading@10 15796 The width and height of the image.
yading@10 15797
yading@10 15798
yading@10 15799 =item B<SW>
yading@10 15800
yading@10 15801
yading@10 15802 =item B<SH>
yading@10 15803
yading@10 15804 Width and height scale depending on the currently filtered plane. It is the
yading@10 15805 ratio between the corresponding luma plane number of pixels and the current
yading@10 15806 plane ones. E.g. for YUV4:2:0 the values are C<1,1> for the luma plane, and
yading@10 15807 C<0.5,0.5> for chroma planes.
yading@10 15808
yading@10 15809
yading@10 15810 =item B<T>
yading@10 15811
yading@10 15812 Time of the current frame, expressed in seconds.
yading@10 15813
yading@10 15814
yading@10 15815 =item B<p(x, y)>
yading@10 15816
yading@10 15817 Return the value of the pixel at location (I<x>,I<y>) of the current
yading@10 15818 plane.
yading@10 15819
yading@10 15820
yading@10 15821 =item B<lum(x, y)>
yading@10 15822
yading@10 15823 Return the value of the pixel at location (I<x>,I<y>) of the luminance
yading@10 15824 plane.
yading@10 15825
yading@10 15826
yading@10 15827 =item B<cb(x, y)>
yading@10 15828
yading@10 15829 Return the value of the pixel at location (I<x>,I<y>) of the
yading@10 15830 blue-difference chroma plane. Returns 0 if there is no such plane.
yading@10 15831
yading@10 15832
yading@10 15833 =item B<cr(x, y)>
yading@10 15834
yading@10 15835 Return the value of the pixel at location (I<x>,I<y>) of the
yading@10 15836 red-difference chroma plane. Returns 0 if there is no such plane.
yading@10 15837
yading@10 15838
yading@10 15839 =item B<alpha(x, y)>
yading@10 15840
yading@10 15841 Return the value of the pixel at location (I<x>,I<y>) of the alpha
yading@10 15842 plane. Returns 0 if there is no such plane.
yading@10 15843
yading@10 15844 =back
yading@10 15845
yading@10 15846
yading@10 15847 For functions, if I<x> and I<y> are outside the area, the value will be
yading@10 15848 automatically clipped to the closer edge.
yading@10 15849
yading@10 15850
yading@10 15851 =head3 Examples
yading@10 15852
yading@10 15853
yading@10 15854
yading@10 15855 =over 4
yading@10 15856
yading@10 15857
yading@10 15858 =item *
yading@10 15859
yading@10 15860 Flip the image horizontally:
yading@10 15861
yading@10 15862 geq=p(W-X\,Y)
yading@10 15863
yading@10 15864
yading@10 15865
yading@10 15866 =item *
yading@10 15867
yading@10 15868 Generate a bidimensional sine wave, with angle C<PI/3> and a
yading@10 15869 wavelength of 100 pixels:
yading@10 15870
yading@10 15871 geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
yading@10 15872
yading@10 15873
yading@10 15874
yading@10 15875 =item *
yading@10 15876
yading@10 15877 Generate a fancy enigmatic moving light:
yading@10 15878
yading@10 15879 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 15880
yading@10 15881
yading@10 15882
yading@10 15883 =item *
yading@10 15884
yading@10 15885 Generate a quick emboss effect:
yading@10 15886
yading@10 15887 format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
yading@10 15888
yading@10 15889
yading@10 15890 =back
yading@10 15891
yading@10 15892
yading@10 15893
yading@10 15894 =head2 gradfun
yading@10 15895
yading@10 15896
yading@10 15897 Fix the banding artifacts that are sometimes introduced into nearly flat
yading@10 15898 regions by truncation to 8bit color depth.
yading@10 15899 Interpolate the gradients that should go where the bands are, and
yading@10 15900 dither them.
yading@10 15901
yading@10 15902 This filter is designed for playback only. Do not use it prior to
yading@10 15903 lossy compression, because compression tends to lose the dither and
yading@10 15904 bring back the bands.
yading@10 15905
yading@10 15906 This filter accepts the following options:
yading@10 15907
yading@10 15908
yading@10 15909 =over 4
yading@10 15910
yading@10 15911
yading@10 15912
yading@10 15913 =item B<strength>
yading@10 15914
yading@10 15915 The maximum amount by which the filter will change any one pixel. Also the
yading@10 15916 threshold for detecting nearly flat regions. Acceptable values range from .51 to
yading@10 15917 64, default value is 1.2, out-of-range values will be clipped to the valid
yading@10 15918 range.
yading@10 15919
yading@10 15920
yading@10 15921 =item B<radius>
yading@10 15922
yading@10 15923 The neighborhood to fit the gradient to. A larger radius makes for smoother
yading@10 15924 gradients, but also prevents the filter from modifying the pixels near detailed
yading@10 15925 regions. Acceptable values are 8-32, default value is 16, out-of-range values
yading@10 15926 will be clipped to the valid range.
yading@10 15927
yading@10 15928
yading@10 15929 =back
yading@10 15930
yading@10 15931
yading@10 15932 Alternatively, the options can be specified as a flat string:
yading@10 15933 I<strength>[:I<radius>]
yading@10 15934
yading@10 15935
yading@10 15936 =head3 Examples
yading@10 15937
yading@10 15938
yading@10 15939
yading@10 15940 =over 4
yading@10 15941
yading@10 15942
yading@10 15943 =item *
yading@10 15944
yading@10 15945 Apply the filter with a C<3.5> strength and radius of C<8>:
yading@10 15946
yading@10 15947 gradfun=3.5:8
yading@10 15948
yading@10 15949
yading@10 15950
yading@10 15951 =item *
yading@10 15952
yading@10 15953 Specify radius, omitting the strength (which will fall-back to the default
yading@10 15954 value):
yading@10 15955
yading@10 15956 gradfun=radius=8
yading@10 15957
yading@10 15958
yading@10 15959
yading@10 15960 =back
yading@10 15961
yading@10 15962
yading@10 15963
yading@10 15964 =head2 hflip
yading@10 15965
yading@10 15966
yading@10 15967 Flip the input video horizontally.
yading@10 15968
yading@10 15969 For example to horizontally flip the input video with B<ffmpeg>:
yading@10 15970
yading@10 15971 ffmpeg -i in.avi -vf "hflip" out.avi
yading@10 15972
yading@10 15973
yading@10 15974
yading@10 15975 =head2 histeq
yading@10 15976
yading@10 15977 This filter applies a global color histogram equalization on a
yading@10 15978 per-frame basis.
yading@10 15979
yading@10 15980 It can be used to correct video that has a compressed range of pixel
yading@10 15981 intensities. The filter redistributes the pixel intensities to
yading@10 15982 equalize their distribution across the intensity range. It may be
yading@10 15983 viewed as an "automatically adjusting contrast filter". This filter is
yading@10 15984 useful only for correcting degraded or poorly captured source
yading@10 15985 video.
yading@10 15986
yading@10 15987 The filter accepts the following options:
yading@10 15988
yading@10 15989
yading@10 15990 =over 4
yading@10 15991
yading@10 15992
yading@10 15993 =item B<strength>
yading@10 15994
yading@10 15995 Determine the amount of equalization to be applied. As the strength
yading@10 15996 is reduced, the distribution of pixel intensities more-and-more
yading@10 15997 approaches that of the input frame. The value must be a float number
yading@10 15998 in the range [0,1] and defaults to 0.200.
yading@10 15999
yading@10 16000
yading@10 16001 =item B<intensity>
yading@10 16002
yading@10 16003 Set the maximum intensity that can generated and scale the output
yading@10 16004 values appropriately. The strength should be set as desired and then
yading@10 16005 the intensity can be limited if needed to avoid washing-out. The value
yading@10 16006 must be a float number in the range [0,1] and defaults to 0.210.
yading@10 16007
yading@10 16008
yading@10 16009 =item B<antibanding>
yading@10 16010
yading@10 16011 Set the antibanding level. If enabled the filter will randomly vary
yading@10 16012 the luminance of output pixels by a small amount to avoid banding of
yading@10 16013 the histogram. Possible values are C<none>, C<weak> or
yading@10 16014 C<strong>. It defaults to C<none>.
yading@10 16015
yading@10 16016 =back
yading@10 16017
yading@10 16018
yading@10 16019
yading@10 16020 =head2 histogram
yading@10 16021
yading@10 16022
yading@10 16023 Compute and draw a color distribution histogram for the input video.
yading@10 16024
yading@10 16025 The computed histogram is a representation of distribution of color components
yading@10 16026 in an image.
yading@10 16027
yading@10 16028 The filter accepts the following options:
yading@10 16029
yading@10 16030
yading@10 16031 =over 4
yading@10 16032
yading@10 16033
yading@10 16034 =item B<mode>
yading@10 16035
yading@10 16036 Set histogram mode.
yading@10 16037
yading@10 16038 It accepts the following values:
yading@10 16039
yading@10 16040 =over 4
yading@10 16041
yading@10 16042
yading@10 16043 =item B<levels>
yading@10 16044
yading@10 16045 standard histogram that display color components distribution in an image.
yading@10 16046 Displays color graph for each color component. Shows distribution
yading@10 16047 of the Y, U, V, A or G, B, R components, depending on input format,
yading@10 16048 in current frame. Bellow each graph is color component scale meter.
yading@10 16049
yading@10 16050
yading@10 16051 =item B<color>
yading@10 16052
yading@10 16053 chroma values in vectorscope, if brighter more such chroma values are
yading@10 16054 distributed in an image.
yading@10 16055 Displays chroma values (U/V color placement) in two dimensional graph
yading@10 16056 (which is called a vectorscope). It can be used to read of the hue and
yading@10 16057 saturation of the current frame. At a same time it is a histogram.
yading@10 16058 The whiter a pixel in the vectorscope, the more pixels of the input frame
yading@10 16059 correspond to that pixel (that is the more pixels have this chroma value).
yading@10 16060 The V component is displayed on the horizontal (X) axis, with the leftmost
yading@10 16061 side being V = 0 and the rightmost side being V = 255.
yading@10 16062 The U component is displayed on the vertical (Y) axis, with the top
yading@10 16063 representing U = 0 and the bottom representing U = 255.
yading@10 16064
yading@10 16065 The position of a white pixel in the graph corresponds to the chroma value
yading@10 16066 of a pixel of the input clip. So the graph can be used to read of the
yading@10 16067 hue (color flavor) and the saturation (the dominance of the hue in the color).
yading@10 16068 As the hue of a color changes, it moves around the square. At the center of
yading@10 16069 the square, the saturation is zero, which means that the corresponding pixel
yading@10 16070 has no color. If you increase the amount of a specific color, while leaving
yading@10 16071 the other colors unchanged, the saturation increases, and you move towards
yading@10 16072 the edge of the square.
yading@10 16073
yading@10 16074
yading@10 16075 =item B<color2>
yading@10 16076
yading@10 16077 chroma values in vectorscope, similar as C<color> but actual chroma values
yading@10 16078 are displayed.
yading@10 16079
yading@10 16080
yading@10 16081 =item B<waveform>
yading@10 16082
yading@10 16083 per row/column color component graph. In row mode graph in the left side represents
yading@10 16084 color component value 0 and right side represents value = 255. In column mode top
yading@10 16085 side represents color component value = 0 and bottom side represents value = 255.
yading@10 16086
yading@10 16087 =back
yading@10 16088
yading@10 16089 Default value is C<levels>.
yading@10 16090
yading@10 16091
yading@10 16092 =item B<level_height>
yading@10 16093
yading@10 16094 Set height of level in C<levels>. Default value is C<200>.
yading@10 16095 Allowed range is [50, 2048].
yading@10 16096
yading@10 16097
yading@10 16098 =item B<scale_height>
yading@10 16099
yading@10 16100 Set height of color scale in C<levels>. Default value is C<12>.
yading@10 16101 Allowed range is [0, 40].
yading@10 16102
yading@10 16103
yading@10 16104 =item B<step>
yading@10 16105
yading@10 16106 Set step for C<waveform> mode. Smaller values are useful to find out how much
yading@10 16107 of same luminance values across input rows/columns are distributed.
yading@10 16108 Default value is C<10>. Allowed range is [1, 255].
yading@10 16109
yading@10 16110
yading@10 16111 =item B<waveform_mode>
yading@10 16112
yading@10 16113 Set mode for C<waveform>. Can be either C<row>, or C<column>.
yading@10 16114 Default is C<row>.
yading@10 16115
yading@10 16116
yading@10 16117 =item B<display_mode>
yading@10 16118
yading@10 16119 Set display mode for C<waveform> and C<levels>.
yading@10 16120 It accepts the following values:
yading@10 16121
yading@10 16122 =over 4
yading@10 16123
yading@10 16124
yading@10 16125 =item B<parade>
yading@10 16126
yading@10 16127 Display separate graph for the color components side by side in
yading@10 16128 C<row> waveform mode or one below other in C<column> waveform mode
yading@10 16129 for C<waveform> histogram mode. For C<levels> histogram mode
yading@10 16130 per color component graphs are placed one bellow other.
yading@10 16131
yading@10 16132 This display mode in C<waveform> histogram mode makes it easy to spot
yading@10 16133 color casts in the highlights and shadows of an image, by comparing the
yading@10 16134 contours of the top and the bottom of each waveform.
yading@10 16135 Since whites, grays, and blacks are characterized by
yading@10 16136 exactly equal amounts of red, green, and blue, neutral areas of the
yading@10 16137 picture should display three waveforms of roughly equal width/height.
yading@10 16138 If not, the correction is easy to make by making adjustments to level the
yading@10 16139 three waveforms.
yading@10 16140
yading@10 16141
yading@10 16142 =item B<overlay>
yading@10 16143
yading@10 16144 Presents information that's identical to that in the C<parade>, except
yading@10 16145 that the graphs representing color components are superimposed directly
yading@10 16146 over one another.
yading@10 16147
yading@10 16148 This display mode in C<waveform> histogram mode can make it easier to spot
yading@10 16149 the relative differences or similarities in overlapping areas of the color
yading@10 16150 components that are supposed to be identical, such as neutral whites, grays,
yading@10 16151 or blacks.
yading@10 16152
yading@10 16153 =back
yading@10 16154
yading@10 16155 Default is C<parade>.
yading@10 16156
yading@10 16157 =back
yading@10 16158
yading@10 16159
yading@10 16160
yading@10 16161 =head3 Examples
yading@10 16162
yading@10 16163
yading@10 16164
yading@10 16165 =over 4
yading@10 16166
yading@10 16167
yading@10 16168
yading@10 16169 =item *
yading@10 16170
yading@10 16171 Calculate and draw histogram:
yading@10 16172
yading@10 16173 ffplay -i input -vf histogram
yading@10 16174
yading@10 16175
yading@10 16176
yading@10 16177 =back
yading@10 16178
yading@10 16179
yading@10 16180
yading@10 16181 =head2 hqdn3d
yading@10 16182
yading@10 16183
yading@10 16184 High precision/quality 3d denoise filter. This filter aims to reduce
yading@10 16185 image noise producing smooth images and making still images really
yading@10 16186 still. It should enhance compressibility.
yading@10 16187
yading@10 16188 It accepts the following optional parameters:
yading@10 16189
yading@10 16190
yading@10 16191 =over 4
yading@10 16192
yading@10 16193
yading@10 16194 =item B<luma_spatial>
yading@10 16195
yading@10 16196 a non-negative float number which specifies spatial luma strength,
yading@10 16197 defaults to 4.0
yading@10 16198
yading@10 16199
yading@10 16200 =item B<chroma_spatial>
yading@10 16201
yading@10 16202 a non-negative float number which specifies spatial chroma strength,
yading@10 16203 defaults to 3.0*I<luma_spatial>/4.0
yading@10 16204
yading@10 16205
yading@10 16206 =item B<luma_tmp>
yading@10 16207
yading@10 16208 a float number which specifies luma temporal strength, defaults to
yading@10 16209 6.0*I<luma_spatial>/4.0
yading@10 16210
yading@10 16211
yading@10 16212 =item B<chroma_tmp>
yading@10 16213
yading@10 16214 a float number which specifies chroma temporal strength, defaults to
yading@10 16215 I<luma_tmp>*I<chroma_spatial>/I<luma_spatial>
yading@10 16216
yading@10 16217 =back
yading@10 16218
yading@10 16219
yading@10 16220
yading@10 16221 =head2 hue
yading@10 16222
yading@10 16223
yading@10 16224 Modify the hue and/or the saturation of the input.
yading@10 16225
yading@10 16226 This filter accepts the following options:
yading@10 16227
yading@10 16228
yading@10 16229 =over 4
yading@10 16230
yading@10 16231
yading@10 16232 =item B<h>
yading@10 16233
yading@10 16234 Specify the hue angle as a number of degrees. It accepts an expression,
yading@10 16235 and defaults to "0".
yading@10 16236
yading@10 16237
yading@10 16238 =item B<s>
yading@10 16239
yading@10 16240 Specify the saturation in the [-10,10] range. It accepts a float number and
yading@10 16241 defaults to "1".
yading@10 16242
yading@10 16243
yading@10 16244 =item B<H>
yading@10 16245
yading@10 16246 Specify the hue angle as a number of radians. It accepts a float
yading@10 16247 number or an expression, and defaults to "0".
yading@10 16248
yading@10 16249 =back
yading@10 16250
yading@10 16251
yading@10 16252 B<h> and B<H> are mutually exclusive, and can't be
yading@10 16253 specified at the same time.
yading@10 16254
yading@10 16255 The B<h>, B<H> and B<s> option values are
yading@10 16256 expressions containing the following constants:
yading@10 16257
yading@10 16258
yading@10 16259 =over 4
yading@10 16260
yading@10 16261
yading@10 16262 =item B<n>
yading@10 16263
yading@10 16264 frame count of the input frame starting from 0
yading@10 16265
yading@10 16266
yading@10 16267 =item B<pts>
yading@10 16268
yading@10 16269 presentation timestamp of the input frame expressed in time base units
yading@10 16270
yading@10 16271
yading@10 16272 =item B<r>
yading@10 16273
yading@10 16274 frame rate of the input video, NAN if the input frame rate is unknown
yading@10 16275
yading@10 16276
yading@10 16277 =item B<t>
yading@10 16278
yading@10 16279 timestamp expressed in seconds, NAN if the input timestamp is unknown
yading@10 16280
yading@10 16281
yading@10 16282 =item B<tb>
yading@10 16283
yading@10 16284 time base of the input video
yading@10 16285
yading@10 16286 =back
yading@10 16287
yading@10 16288
yading@10 16289
yading@10 16290 =head3 Examples
yading@10 16291
yading@10 16292
yading@10 16293
yading@10 16294 =over 4
yading@10 16295
yading@10 16296
yading@10 16297 =item *
yading@10 16298
yading@10 16299 Set the hue to 90 degrees and the saturation to 1.0:
yading@10 16300
yading@10 16301 hue=h=90:s=1
yading@10 16302
yading@10 16303
yading@10 16304
yading@10 16305 =item *
yading@10 16306
yading@10 16307 Same command but expressing the hue in radians:
yading@10 16308
yading@10 16309 hue=H=PI/2:s=1
yading@10 16310
yading@10 16311
yading@10 16312
yading@10 16313 =item *
yading@10 16314
yading@10 16315 Rotate hue and make the saturation swing between 0
yading@10 16316 and 2 over a period of 1 second:
yading@10 16317
yading@10 16318 hue="H=2*PI*t: s=sin(2*PI*t)+1"
yading@10 16319
yading@10 16320
yading@10 16321
yading@10 16322 =item *
yading@10 16323
yading@10 16324 Apply a 3 seconds saturation fade-in effect starting at 0:
yading@10 16325
yading@10 16326 hue="s=min(t/3\,1)"
yading@10 16327
yading@10 16328
yading@10 16329 The general fade-in expression can be written as:
yading@10 16330
yading@10 16331 hue="s=min(0\, max((t-START)/DURATION\, 1))"
yading@10 16332
yading@10 16333
yading@10 16334
yading@10 16335 =item *
yading@10 16336
yading@10 16337 Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
yading@10 16338
yading@10 16339 hue="s=max(0\, min(1\, (8-t)/3))"
yading@10 16340
yading@10 16341
yading@10 16342 The general fade-out expression can be written as:
yading@10 16343
yading@10 16344 hue="s=max(0\, min(1\, (START+DURATION-t)/DURATION))"
yading@10 16345
yading@10 16346
yading@10 16347
yading@10 16348 =back
yading@10 16349
yading@10 16350
yading@10 16351
yading@10 16352 =head3 Commands
yading@10 16353
yading@10 16354
yading@10 16355 This filter supports the following commands:
yading@10 16356
yading@10 16357 =over 4
yading@10 16358
yading@10 16359
yading@10 16360 =item B<s>
yading@10 16361
yading@10 16362
yading@10 16363 =item B<h>
yading@10 16364
yading@10 16365
yading@10 16366 =item B<H>
yading@10 16367
yading@10 16368 Modify the hue and/or the saturation of the input video.
yading@10 16369 The command accepts the same syntax of the corresponding option.
yading@10 16370
yading@10 16371 If the specified expression is not valid, it is kept at its current
yading@10 16372 value.
yading@10 16373
yading@10 16374 =back
yading@10 16375
yading@10 16376
yading@10 16377
yading@10 16378 =head2 idet
yading@10 16379
yading@10 16380
yading@10 16381 Detect video interlacing type.
yading@10 16382
yading@10 16383 This filter tries to detect if the input is interlaced or progressive,
yading@10 16384 top or bottom field first.
yading@10 16385
yading@10 16386 The filter accepts the following options:
yading@10 16387
yading@10 16388
yading@10 16389 =over 4
yading@10 16390
yading@10 16391
yading@10 16392 =item B<intl_thres>
yading@10 16393
yading@10 16394 Set interlacing threshold.
yading@10 16395
yading@10 16396 =item B<prog_thres>
yading@10 16397
yading@10 16398 Set progressive threshold.
yading@10 16399
yading@10 16400 =back
yading@10 16401
yading@10 16402
yading@10 16403
yading@10 16404 =head2 il
yading@10 16405
yading@10 16406
yading@10 16407 Deinterleave or interleave fields.
yading@10 16408
yading@10 16409 This filter allows to process interlaced images fields without
yading@10 16410 deinterlacing them. Deinterleaving splits the input frame into 2
yading@10 16411 fields (so called half pictures). Odd lines are moved to the top
yading@10 16412 half of the output image, even lines to the bottom half.
yading@10 16413 You can process (filter) them independently and then re-interleave them.
yading@10 16414
yading@10 16415 The filter accepts the following options:
yading@10 16416
yading@10 16417
yading@10 16418 =over 4
yading@10 16419
yading@10 16420
yading@10 16421 =item B<luma_mode, l>
yading@10 16422
yading@10 16423
yading@10 16424 =item B<chroma_mode, s>
yading@10 16425
yading@10 16426
yading@10 16427 =item B<alpha_mode, a>
yading@10 16428
yading@10 16429 Available values for I<luma_mode>, I<chroma_mode> and
yading@10 16430 I<alpha_mode> are:
yading@10 16431
yading@10 16432
yading@10 16433 =over 4
yading@10 16434
yading@10 16435
yading@10 16436 =item B<none>
yading@10 16437
yading@10 16438 Do nothing.
yading@10 16439
yading@10 16440
yading@10 16441 =item B<deinterleave, d>
yading@10 16442
yading@10 16443 Deinterleave fields, placing one above the other.
yading@10 16444
yading@10 16445
yading@10 16446 =item B<interleave, i>
yading@10 16447
yading@10 16448 Interleave fields. Reverse the effect of deinterleaving.
yading@10 16449
yading@10 16450 =back
yading@10 16451
yading@10 16452 Default value is C<none>.
yading@10 16453
yading@10 16454
yading@10 16455 =item B<luma_swap, ls>
yading@10 16456
yading@10 16457
yading@10 16458 =item B<chroma_swap, cs>
yading@10 16459
yading@10 16460
yading@10 16461 =item B<alpha_swap, as>
yading@10 16462
yading@10 16463 Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is C<0>.
yading@10 16464
yading@10 16465 =back
yading@10 16466
yading@10 16467
yading@10 16468
yading@10 16469 =head2 interlace
yading@10 16470
yading@10 16471
yading@10 16472 Simple interlacing filter from progressive contents. This interleaves upper (or
yading@10 16473 lower) lines from odd frames with lower (or upper) lines from even frames,
yading@10 16474 halving the frame rate and preserving image height.
yading@10 16475
yading@10 16476
yading@10 16477 Original Original New Frame
yading@10 16478 Frame 'j' Frame 'j+1' (tff)
yading@10 16479 ========== =========== ==================
yading@10 16480 Line 0 --------------------> Frame 'j' Line 0
yading@10 16481 Line 1 Line 1 ----> Frame 'j+1' Line 1
yading@10 16482 Line 2 ---------------------> Frame 'j' Line 2
yading@10 16483 Line 3 Line 3 ----> Frame 'j+1' Line 3
yading@10 16484 ... ... ...
yading@10 16485 New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
yading@10 16486
yading@10 16487
yading@10 16488 It accepts the following optional parameters:
yading@10 16489
yading@10 16490
yading@10 16491 =over 4
yading@10 16492
yading@10 16493
yading@10 16494 =item B<scan>
yading@10 16495
yading@10 16496 determines whether the interlaced frame is taken from the even (tff - default)
yading@10 16497 or odd (bff) lines of the progressive frame.
yading@10 16498
yading@10 16499
yading@10 16500 =item B<lowpass>
yading@10 16501
yading@10 16502 Enable (default) or disable the vertical lowpass filter to avoid twitter
yading@10 16503 interlacing and reduce moire patterns.
yading@10 16504
yading@10 16505 =back
yading@10 16506
yading@10 16507
yading@10 16508
yading@10 16509 =head2 kerndeint
yading@10 16510
yading@10 16511
yading@10 16512 Deinterlace input video by applying Donald Graft's adaptive kernel
yading@10 16513 deinterling. Work on interlaced parts of a video to produce
yading@10 16514 progressive frames.
yading@10 16515
yading@10 16516 The description of the accepted parameters follows.
yading@10 16517
yading@10 16518
yading@10 16519 =over 4
yading@10 16520
yading@10 16521
yading@10 16522 =item B<thresh>
yading@10 16523
yading@10 16524 Set the threshold which affects the filter's tolerance when
yading@10 16525 determining if a pixel line must be processed. It must be an integer
yading@10 16526 in the range [0,255] and defaults to 10. A value of 0 will result in
yading@10 16527 applying the process on every pixels.
yading@10 16528
yading@10 16529
yading@10 16530 =item B<map>
yading@10 16531
yading@10 16532 Paint pixels exceeding the threshold value to white if set to 1.
yading@10 16533 Default is 0.
yading@10 16534
yading@10 16535
yading@10 16536 =item B<order>
yading@10 16537
yading@10 16538 Set the fields order. Swap fields if set to 1, leave fields alone if
yading@10 16539 0. Default is 0.
yading@10 16540
yading@10 16541
yading@10 16542 =item B<sharp>
yading@10 16543
yading@10 16544 Enable additional sharpening if set to 1. Default is 0.
yading@10 16545
yading@10 16546
yading@10 16547 =item B<twoway>
yading@10 16548
yading@10 16549 Enable twoway sharpening if set to 1. Default is 0.
yading@10 16550
yading@10 16551 =back
yading@10 16552
yading@10 16553
yading@10 16554
yading@10 16555 =head3 Examples
yading@10 16556
yading@10 16557
yading@10 16558
yading@10 16559 =over 4
yading@10 16560
yading@10 16561
yading@10 16562 =item *
yading@10 16563
yading@10 16564 Apply default values:
yading@10 16565
yading@10 16566 kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
yading@10 16567
yading@10 16568
yading@10 16569
yading@10 16570 =item *
yading@10 16571
yading@10 16572 Enable additional sharpening:
yading@10 16573
yading@10 16574 kerndeint=sharp=1
yading@10 16575
yading@10 16576
yading@10 16577
yading@10 16578 =item *
yading@10 16579
yading@10 16580 Paint processed pixels in white:
yading@10 16581
yading@10 16582 kerndeint=map=1
yading@10 16583
yading@10 16584
yading@10 16585 =back
yading@10 16586
yading@10 16587
yading@10 16588
yading@10 16589 =head2 lut, lutrgb, lutyuv
yading@10 16590
yading@10 16591
yading@10 16592 Compute a look-up table for binding each pixel component input value
yading@10 16593 to an output value, and apply it to input video.
yading@10 16594
yading@10 16595 I<lutyuv> applies a lookup table to a YUV input video, I<lutrgb>
yading@10 16596 to an RGB input video.
yading@10 16597
yading@10 16598 These filters accept the following options:
yading@10 16599
yading@10 16600 =over 4
yading@10 16601
yading@10 16602
yading@10 16603 =item B<c0>
yading@10 16604
yading@10 16605 set first pixel component expression
yading@10 16606
yading@10 16607 =item B<c1>
yading@10 16608
yading@10 16609 set second pixel component expression
yading@10 16610
yading@10 16611 =item B<c2>
yading@10 16612
yading@10 16613 set third pixel component expression
yading@10 16614
yading@10 16615 =item B<c3>
yading@10 16616
yading@10 16617 set fourth pixel component expression, corresponds to the alpha component
yading@10 16618
yading@10 16619
yading@10 16620 =item B<r>
yading@10 16621
yading@10 16622 set red component expression
yading@10 16623
yading@10 16624 =item B<g>
yading@10 16625
yading@10 16626 set green component expression
yading@10 16627
yading@10 16628 =item B<b>
yading@10 16629
yading@10 16630 set blue component expression
yading@10 16631
yading@10 16632 =item B<a>
yading@10 16633
yading@10 16634 alpha component expression
yading@10 16635
yading@10 16636
yading@10 16637 =item B<y>
yading@10 16638
yading@10 16639 set Y/luminance component expression
yading@10 16640
yading@10 16641 =item B<u>
yading@10 16642
yading@10 16643 set U/Cb component expression
yading@10 16644
yading@10 16645 =item B<v>
yading@10 16646
yading@10 16647 set V/Cr component expression
yading@10 16648
yading@10 16649 =back
yading@10 16650
yading@10 16651
yading@10 16652 Each of them specifies the expression to use for computing the lookup table for
yading@10 16653 the corresponding pixel component values.
yading@10 16654
yading@10 16655 The exact component associated to each of the I<c*> options depends on the
yading@10 16656 format in input.
yading@10 16657
yading@10 16658 The I<lut> filter requires either YUV or RGB pixel formats in input,
yading@10 16659 I<lutrgb> requires RGB pixel formats in input, and I<lutyuv> requires YUV.
yading@10 16660
yading@10 16661 The expressions can contain the following constants and functions:
yading@10 16662
yading@10 16663
yading@10 16664 =over 4
yading@10 16665
yading@10 16666
yading@10 16667 =item B<w, h>
yading@10 16668
yading@10 16669 the input width and height
yading@10 16670
yading@10 16671
yading@10 16672 =item B<val>
yading@10 16673
yading@10 16674 input value for the pixel component
yading@10 16675
yading@10 16676
yading@10 16677 =item B<clipval>
yading@10 16678
yading@10 16679 the input value clipped in the I<minval>-I<maxval> range
yading@10 16680
yading@10 16681
yading@10 16682 =item B<maxval>
yading@10 16683
yading@10 16684 maximum value for the pixel component
yading@10 16685
yading@10 16686
yading@10 16687 =item B<minval>
yading@10 16688
yading@10 16689 minimum value for the pixel component
yading@10 16690
yading@10 16691
yading@10 16692 =item B<negval>
yading@10 16693
yading@10 16694 the negated value for the pixel component value clipped in the
yading@10 16695 I<minval>-I<maxval> range , it corresponds to the expression
yading@10 16696 "maxval-clipval+minval"
yading@10 16697
yading@10 16698
yading@10 16699 =item B<clip(val)>
yading@10 16700
yading@10 16701 the computed value in I<val> clipped in the
yading@10 16702 I<minval>-I<maxval> range
yading@10 16703
yading@10 16704
yading@10 16705 =item B<gammaval(gamma)>
yading@10 16706
yading@10 16707 the computed gamma correction value of the pixel component value
yading@10 16708 clipped in the I<minval>-I<maxval> range, corresponds to the
yading@10 16709 expression
yading@10 16710 "pow((clipval-minval)/(maxval-minval)\,I<gamma>)*(maxval-minval)+minval"
yading@10 16711
yading@10 16712
yading@10 16713 =back
yading@10 16714
yading@10 16715
yading@10 16716 All expressions default to "val".
yading@10 16717
yading@10 16718
yading@10 16719 =head3 Examples
yading@10 16720
yading@10 16721
yading@10 16722
yading@10 16723 =over 4
yading@10 16724
yading@10 16725
yading@10 16726 =item *
yading@10 16727
yading@10 16728 Negate input video:
yading@10 16729
yading@10 16730 lutrgb="r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val"
yading@10 16731 lutyuv="y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val"
yading@10 16732
yading@10 16733
yading@10 16734 The above is the same as:
yading@10 16735
yading@10 16736 lutrgb="r=negval:g=negval:b=negval"
yading@10 16737 lutyuv="y=negval:u=negval:v=negval"
yading@10 16738
yading@10 16739
yading@10 16740
yading@10 16741 =item *
yading@10 16742
yading@10 16743 Negate luminance:
yading@10 16744
yading@10 16745 lutyuv=y=negval
yading@10 16746
yading@10 16747
yading@10 16748
yading@10 16749 =item *
yading@10 16750
yading@10 16751 Remove chroma components, turns the video into a graytone image:
yading@10 16752
yading@10 16753 lutyuv="u=128:v=128"
yading@10 16754
yading@10 16755
yading@10 16756
yading@10 16757 =item *
yading@10 16758
yading@10 16759 Apply a luma burning effect:
yading@10 16760
yading@10 16761 lutyuv="y=2*val"
yading@10 16762
yading@10 16763
yading@10 16764
yading@10 16765 =item *
yading@10 16766
yading@10 16767 Remove green and blue components:
yading@10 16768
yading@10 16769 lutrgb="g=0:b=0"
yading@10 16770
yading@10 16771
yading@10 16772
yading@10 16773 =item *
yading@10 16774
yading@10 16775 Set a constant alpha channel value on input:
yading@10 16776
yading@10 16777 format=rgba,lutrgb=a="maxval-minval/2"
yading@10 16778
yading@10 16779
yading@10 16780
yading@10 16781 =item *
yading@10 16782
yading@10 16783 Correct luminance gamma by a 0.5 factor:
yading@10 16784
yading@10 16785 lutyuv=y=gammaval(0.5)
yading@10 16786
yading@10 16787
yading@10 16788
yading@10 16789 =item *
yading@10 16790
yading@10 16791 Discard least significant bits of luma:
yading@10 16792
yading@10 16793 lutyuv=y='bitand(val, 128+64+32)'
yading@10 16794
yading@10 16795
yading@10 16796 =back
yading@10 16797
yading@10 16798
yading@10 16799
yading@10 16800 =head2 mp
yading@10 16801
yading@10 16802
yading@10 16803 Apply an MPlayer filter to the input video.
yading@10 16804
yading@10 16805 This filter provides a wrapper around most of the filters of
yading@10 16806 MPlayer/MEncoder.
yading@10 16807
yading@10 16808 This wrapper is considered experimental. Some of the wrapped filters
yading@10 16809 may not work properly and we may drop support for them, as they will
yading@10 16810 be implemented natively into FFmpeg. Thus you should avoid
yading@10 16811 depending on them when writing portable scripts.
yading@10 16812
yading@10 16813 The filters accepts the parameters:
yading@10 16814 I<filter_name>[:=]I<filter_params>
yading@10 16815
yading@10 16816 I<filter_name> is the name of a supported MPlayer filter,
yading@10 16817 I<filter_params> is a string containing the parameters accepted by
yading@10 16818 the named filter.
yading@10 16819
yading@10 16820 The list of the currently supported filters follows:
yading@10 16821
yading@10 16822 =over 4
yading@10 16823
yading@10 16824
yading@10 16825 =item I<dint>
yading@10 16826
yading@10 16827
yading@10 16828 =item I<down3dright>
yading@10 16829
yading@10 16830
yading@10 16831 =item I<eq2>
yading@10 16832
yading@10 16833
yading@10 16834 =item I<eq>
yading@10 16835
yading@10 16836
yading@10 16837 =item I<fil>
yading@10 16838
yading@10 16839
yading@10 16840 =item I<fspp>
yading@10 16841
yading@10 16842
yading@10 16843 =item I<ilpack>
yading@10 16844
yading@10 16845
yading@10 16846 =item I<mcdeint>
yading@10 16847
yading@10 16848
yading@10 16849 =item I<ow>
yading@10 16850
yading@10 16851
yading@10 16852 =item I<perspective>
yading@10 16853
yading@10 16854
yading@10 16855 =item I<phase>
yading@10 16856
yading@10 16857
yading@10 16858 =item I<pp7>
yading@10 16859
yading@10 16860
yading@10 16861 =item I<pullup>
yading@10 16862
yading@10 16863
yading@10 16864 =item I<qp>
yading@10 16865
yading@10 16866
yading@10 16867 =item I<sab>
yading@10 16868
yading@10 16869
yading@10 16870 =item I<softpulldown>
yading@10 16871
yading@10 16872
yading@10 16873 =item I<spp>
yading@10 16874
yading@10 16875
yading@10 16876 =item I<tinterlace>
yading@10 16877
yading@10 16878
yading@10 16879 =item I<uspp>
yading@10 16880
yading@10 16881
yading@10 16882 =back
yading@10 16883
yading@10 16884
yading@10 16885 The parameter syntax and behavior for the listed filters are the same
yading@10 16886 of the corresponding MPlayer filters. For detailed instructions check
yading@10 16887 the "VIDEO FILTERS" section in the MPlayer manual.
yading@10 16888
yading@10 16889
yading@10 16890 =head3 Examples
yading@10 16891
yading@10 16892
yading@10 16893
yading@10 16894 =over 4
yading@10 16895
yading@10 16896
yading@10 16897 =item *
yading@10 16898
yading@10 16899 Adjust gamma, brightness, contrast:
yading@10 16900
yading@10 16901 mp=eq2=1.0:2:0.5
yading@10 16902
yading@10 16903
yading@10 16904 =back
yading@10 16905
yading@10 16906
yading@10 16907 See also mplayer(1), E<lt>B<http://www.mplayerhq.hu/>E<gt>.
yading@10 16908
yading@10 16909
yading@10 16910 =head2 mpdecimate
yading@10 16911
yading@10 16912
yading@10 16913 Drop frames that do not differ greatly from the previous frame in
yading@10 16914 order to reduce frame rate.
yading@10 16915
yading@10 16916 The main use of this filter is for very-low-bitrate encoding
yading@10 16917 (e.g. streaming over dialup modem), but it could in theory be used for
yading@10 16918 fixing movies that were inverse-telecined incorrectly.
yading@10 16919
yading@10 16920 A description of the accepted options follows.
yading@10 16921
yading@10 16922
yading@10 16923 =over 4
yading@10 16924
yading@10 16925
yading@10 16926 =item B<max>
yading@10 16927
yading@10 16928 Set the maximum number of consecutive frames which can be dropped (if
yading@10 16929 positive), or the minimum interval between dropped frames (if
yading@10 16930 negative). If the value is 0, the frame is dropped unregarding the
yading@10 16931 number of previous sequentially dropped frames.
yading@10 16932
yading@10 16933 Default value is 0.
yading@10 16934
yading@10 16935
yading@10 16936 =item B<hi>
yading@10 16937
yading@10 16938
yading@10 16939 =item B<lo>
yading@10 16940
yading@10 16941
yading@10 16942 =item B<frac>
yading@10 16943
yading@10 16944 Set the dropping threshold values.
yading@10 16945
yading@10 16946 Values for B<hi> and B<lo> are for 8x8 pixel blocks and
yading@10 16947 represent actual pixel value differences, so a threshold of 64
yading@10 16948 corresponds to 1 unit of difference for each pixel, or the same spread
yading@10 16949 out differently over the block.
yading@10 16950
yading@10 16951 A frame is a candidate for dropping if no 8x8 blocks differ by more
yading@10 16952 than a threshold of B<hi>, and if no more than B<frac> blocks (1
yading@10 16953 meaning the whole image) differ by more than a threshold of B<lo>.
yading@10 16954
yading@10 16955 Default value for B<hi> is 64*12, default value for B<lo> is
yading@10 16956 64*5, and default value for B<frac> is 0.33.
yading@10 16957
yading@10 16958 =back
yading@10 16959
yading@10 16960
yading@10 16961
yading@10 16962
yading@10 16963 =head2 negate
yading@10 16964
yading@10 16965
yading@10 16966 Negate input video.
yading@10 16967
yading@10 16968 This filter accepts an integer in input, if non-zero it negates the
yading@10 16969 alpha component (if available). The default value in input is 0.
yading@10 16970
yading@10 16971
yading@10 16972 =head2 noformat
yading@10 16973
yading@10 16974
yading@10 16975 Force libavfilter not to use any of the specified pixel formats for the
yading@10 16976 input to the next filter.
yading@10 16977
yading@10 16978 This filter accepts the following parameters:
yading@10 16979
yading@10 16980 =over 4
yading@10 16981
yading@10 16982
yading@10 16983
yading@10 16984 =item B<pix_fmts>
yading@10 16985
yading@10 16986 A '|'-separated list of pixel format names, for example
yading@10 16987 "pix_fmts=yuv420p|monow|rgb24".
yading@10 16988
yading@10 16989
yading@10 16990 =back
yading@10 16991
yading@10 16992
yading@10 16993
yading@10 16994 =head3 Examples
yading@10 16995
yading@10 16996
yading@10 16997
yading@10 16998 =over 4
yading@10 16999
yading@10 17000
yading@10 17001 =item *
yading@10 17002
yading@10 17003 Force libavfilter to use a format different from I<yuv420p> for the
yading@10 17004 input to the vflip filter:
yading@10 17005
yading@10 17006 noformat=pix_fmts=yuv420p,vflip
yading@10 17007
yading@10 17008
yading@10 17009
yading@10 17010 =item *
yading@10 17011
yading@10 17012 Convert the input video to any of the formats not contained in the list:
yading@10 17013
yading@10 17014 noformat=yuv420p|yuv444p|yuv410p
yading@10 17015
yading@10 17016
yading@10 17017 =back
yading@10 17018
yading@10 17019
yading@10 17020
yading@10 17021 =head2 noise
yading@10 17022
yading@10 17023
yading@10 17024 Add noise on video input frame.
yading@10 17025
yading@10 17026 The filter accepts the following options:
yading@10 17027
yading@10 17028
yading@10 17029 =over 4
yading@10 17030
yading@10 17031
yading@10 17032 =item B<all_seed>
yading@10 17033
yading@10 17034
yading@10 17035 =item B<c0_seed>
yading@10 17036
yading@10 17037
yading@10 17038 =item B<c1_seed>
yading@10 17039
yading@10 17040
yading@10 17041 =item B<c2_seed>
yading@10 17042
yading@10 17043
yading@10 17044 =item B<c3_seed>
yading@10 17045
yading@10 17046 Set noise seed for specific pixel component or all pixel components in case
yading@10 17047 of I<all_seed>. Default value is C<123457>.
yading@10 17048
yading@10 17049
yading@10 17050 =item B<all_strength, alls>
yading@10 17051
yading@10 17052
yading@10 17053 =item B<c0_strength, c0s>
yading@10 17054
yading@10 17055
yading@10 17056 =item B<c1_strength, c1s>
yading@10 17057
yading@10 17058
yading@10 17059 =item B<c2_strength, c2s>
yading@10 17060
yading@10 17061
yading@10 17062 =item B<c3_strength, c3s>
yading@10 17063
yading@10 17064 Set noise strength for specific pixel component or all pixel components in case
yading@10 17065 I<all_strength>. Default value is C<0>. Allowed range is [0, 100].
yading@10 17066
yading@10 17067
yading@10 17068 =item B<all_flags, allf>
yading@10 17069
yading@10 17070
yading@10 17071 =item B<c0_flags, c0f>
yading@10 17072
yading@10 17073
yading@10 17074 =item B<c1_flags, c1f>
yading@10 17075
yading@10 17076
yading@10 17077 =item B<c2_flags, c2f>
yading@10 17078
yading@10 17079
yading@10 17080 =item B<c3_flags, c3f>
yading@10 17081
yading@10 17082 Set pixel component flags or set flags for all components if I<all_flags>.
yading@10 17083 Available values for component flags are:
yading@10 17084
yading@10 17085 =over 4
yading@10 17086
yading@10 17087
yading@10 17088 =item B<a>
yading@10 17089
yading@10 17090 averaged temporal noise (smoother)
yading@10 17091
yading@10 17092 =item B<p>
yading@10 17093
yading@10 17094 mix random noise with a (semi)regular pattern
yading@10 17095
yading@10 17096 =item B<q>
yading@10 17097
yading@10 17098 higher quality (slightly better looking, slightly slower)
yading@10 17099
yading@10 17100 =item B<t>
yading@10 17101
yading@10 17102 temporal noise (noise pattern changes between frames)
yading@10 17103
yading@10 17104 =item B<u>
yading@10 17105
yading@10 17106 uniform noise (gaussian otherwise)
yading@10 17107
yading@10 17108 =back
yading@10 17109
yading@10 17110
yading@10 17111 =back
yading@10 17112
yading@10 17113
yading@10 17114
yading@10 17115 =head3 Examples
yading@10 17116
yading@10 17117
yading@10 17118 Add temporal and uniform noise to input video:
yading@10 17119
yading@10 17120 noise=alls=20:allf=t+u
yading@10 17121
yading@10 17122
yading@10 17123
yading@10 17124 =head2 null
yading@10 17125
yading@10 17126
yading@10 17127 Pass the video source unchanged to the output.
yading@10 17128
yading@10 17129
yading@10 17130 =head2 ocv
yading@10 17131
yading@10 17132
yading@10 17133 Apply video transform using libopencv.
yading@10 17134
yading@10 17135 To enable this filter install libopencv library and headers and
yading@10 17136 configure FFmpeg with C<--enable-libopencv>.
yading@10 17137
yading@10 17138 This filter accepts the following parameters:
yading@10 17139
yading@10 17140
yading@10 17141 =over 4
yading@10 17142
yading@10 17143
yading@10 17144
yading@10 17145 =item B<filter_name>
yading@10 17146
yading@10 17147 The name of the libopencv filter to apply.
yading@10 17148
yading@10 17149
yading@10 17150 =item B<filter_params>
yading@10 17151
yading@10 17152 The parameters to pass to the libopencv filter. If not specified the default
yading@10 17153 values are assumed.
yading@10 17154
yading@10 17155
yading@10 17156 =back
yading@10 17157
yading@10 17158
yading@10 17159 Refer to the official libopencv documentation for more precise
yading@10 17160 information:
yading@10 17161 E<lt>B<http://opencv.willowgarage.com/documentation/c/image_filtering.html>E<gt>
yading@10 17162
yading@10 17163 Follows the list of supported libopencv filters.
yading@10 17164
yading@10 17165
yading@10 17166
yading@10 17167 =head3 dilate
yading@10 17168
yading@10 17169
yading@10 17170 Dilate an image by using a specific structuring element.
yading@10 17171 This filter corresponds to the libopencv function C<cvDilate>.
yading@10 17172
yading@10 17173 It accepts the parameters: I<struct_el>|I<nb_iterations>.
yading@10 17174
yading@10 17175 I<struct_el> represents a structuring element, and has the syntax:
yading@10 17176 I<cols>xI<rows>+I<anchor_x>xI<anchor_y>/I<shape>
yading@10 17177
yading@10 17178 I<cols> and I<rows> represent the number of columns and rows of
yading@10 17179 the structuring element, I<anchor_x> and I<anchor_y> the anchor
yading@10 17180 point, and I<shape> the shape for the structuring element, and
yading@10 17181 can be one of the values "rect", "cross", "ellipse", "custom".
yading@10 17182
yading@10 17183 If the value for I<shape> is "custom", it must be followed by a
yading@10 17184 string of the form "=I<filename>". The file with name
yading@10 17185 I<filename> is assumed to represent a binary image, with each
yading@10 17186 printable character corresponding to a bright pixel. When a custom
yading@10 17187 I<shape> is used, I<cols> and I<rows> are ignored, the number
yading@10 17188 or columns and rows of the read file are assumed instead.
yading@10 17189
yading@10 17190 The default value for I<struct_el> is "3x3+0x0/rect".
yading@10 17191
yading@10 17192 I<nb_iterations> specifies the number of times the transform is
yading@10 17193 applied to the image, and defaults to 1.
yading@10 17194
yading@10 17195 Follow some example:
yading@10 17196
yading@10 17197 # use the default values
yading@10 17198 ocv=dilate
yading@10 17199
yading@10 17200 # dilate using a structuring element with a 5x5 cross, iterate two times
yading@10 17201 ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
yading@10 17202
yading@10 17203 # read the shape from the file diamond.shape, iterate two times
yading@10 17204 # the file diamond.shape may contain a pattern of characters like this:
yading@10 17205 # *
yading@10 17206 # ***
yading@10 17207 # *****
yading@10 17208 # ***
yading@10 17209 # *
yading@10 17210 # the specified cols and rows are ignored (but not the anchor point coordinates)
yading@10 17211 ocv=dilate:0x0+2x2/custom=diamond.shape|2
yading@10 17212
yading@10 17213
yading@10 17214
yading@10 17215 =head3 erode
yading@10 17216
yading@10 17217
yading@10 17218 Erode an image by using a specific structuring element.
yading@10 17219 This filter corresponds to the libopencv function C<cvErode>.
yading@10 17220
yading@10 17221 The filter accepts the parameters: I<struct_el>:I<nb_iterations>,
yading@10 17222 with the same syntax and semantics as the dilate filter.
yading@10 17223
yading@10 17224
yading@10 17225 =head3 smooth
yading@10 17226
yading@10 17227
yading@10 17228 Smooth the input video.
yading@10 17229
yading@10 17230 The filter takes the following parameters:
yading@10 17231 I<type>|I<param1>|I<param2>|I<param3>|I<param4>.
yading@10 17232
yading@10 17233 I<type> is the type of smooth filter to apply, and can be one of
yading@10 17234 the following values: "blur", "blur_no_scale", "median", "gaussian",
yading@10 17235 "bilateral". The default value is "gaussian".
yading@10 17236
yading@10 17237 I<param1>, I<param2>, I<param3>, and I<param4> are
yading@10 17238 parameters whose meanings depend on smooth type. I<param1> and
yading@10 17239 I<param2> accept integer positive values or 0, I<param3> and
yading@10 17240 I<param4> accept float values.
yading@10 17241
yading@10 17242 The default value for I<param1> is 3, the default value for the
yading@10 17243 other parameters is 0.
yading@10 17244
yading@10 17245 These parameters correspond to the parameters assigned to the
yading@10 17246 libopencv function C<cvSmooth>.
yading@10 17247
yading@10 17248
yading@10 17249
yading@10 17250 =head2 overlay
yading@10 17251
yading@10 17252
yading@10 17253 Overlay one video on top of another.
yading@10 17254
yading@10 17255 It takes two inputs and one output, the first input is the "main"
yading@10 17256 video on which the second input is overlayed.
yading@10 17257
yading@10 17258 This filter accepts the following parameters:
yading@10 17259
yading@10 17260 A description of the accepted options follows.
yading@10 17261
yading@10 17262
yading@10 17263 =over 4
yading@10 17264
yading@10 17265
yading@10 17266 =item B<x>
yading@10 17267
yading@10 17268
yading@10 17269 =item B<y>
yading@10 17270
yading@10 17271 Set the expression for the x and y coordinates of the overlayed video
yading@10 17272 on the main video. Default value is "0" for both expressions. In case
yading@10 17273 the expression is invalid, it is set to a huge value (meaning that the
yading@10 17274 overlay will not be displayed within the output visible area).
yading@10 17275
yading@10 17276
yading@10 17277 =item B<enable>
yading@10 17278
yading@10 17279 Set the expression which enables the overlay. If the evaluation is
yading@10 17280 different from 0, the overlay is displayed on top of the input
yading@10 17281 frame. By default it is "1".
yading@10 17282
yading@10 17283
yading@10 17284 =item B<eval>
yading@10 17285
yading@10 17286 Set when the expressions for B<x>, B<y>, and
yading@10 17287 B<enable> are evaluated.
yading@10 17288
yading@10 17289 It accepts the following values:
yading@10 17290
yading@10 17291 =over 4
yading@10 17292
yading@10 17293
yading@10 17294 =item B<init>
yading@10 17295
yading@10 17296 only evaluate expressions once during the filter initialization or
yading@10 17297 when a command is processed
yading@10 17298
yading@10 17299
yading@10 17300 =item B<frame>
yading@10 17301
yading@10 17302 evaluate expressions for each incoming frame
yading@10 17303
yading@10 17304 =back
yading@10 17305
yading@10 17306
yading@10 17307 Default value is B<frame>.
yading@10 17308
yading@10 17309
yading@10 17310 =item B<shortest>
yading@10 17311
yading@10 17312 If set to 1, force the output to terminate when the shortest input
yading@10 17313 terminates. Default value is 0.
yading@10 17314
yading@10 17315
yading@10 17316 =item B<format>
yading@10 17317
yading@10 17318 Set the format for the output video.
yading@10 17319
yading@10 17320 It accepts the following values:
yading@10 17321
yading@10 17322 =over 4
yading@10 17323
yading@10 17324
yading@10 17325 =item B<yuv420>
yading@10 17326
yading@10 17327 force YUV420 output
yading@10 17328
yading@10 17329
yading@10 17330 =item B<yuv444>
yading@10 17331
yading@10 17332 force YUV444 output
yading@10 17333
yading@10 17334
yading@10 17335 =item B<rgb>
yading@10 17336
yading@10 17337 force RGB output
yading@10 17338
yading@10 17339 =back
yading@10 17340
yading@10 17341
yading@10 17342 Default value is B<yuv420>.
yading@10 17343
yading@10 17344
yading@10 17345 =item B<rgb> I<(deprecated)>
yading@10 17346
yading@10 17347 If set to 1, force the filter to accept inputs in the RGB
yading@10 17348 color space. Default value is 0. This option is deprecated, use
yading@10 17349 B<format> instead.
yading@10 17350
yading@10 17351
yading@10 17352 =item B<repeatlast>
yading@10 17353
yading@10 17354 If set to 1, force the filter to draw the last overlay frame over the
yading@10 17355 main input until the end of the stream. A value of 0 disables this
yading@10 17356 behavior, which is enabled by default.
yading@10 17357
yading@10 17358 =back
yading@10 17359
yading@10 17360
yading@10 17361 The B<x>, B<y>, and B<enable> expressions can
yading@10 17362 contain the following parameters.
yading@10 17363
yading@10 17364
yading@10 17365 =over 4
yading@10 17366
yading@10 17367
yading@10 17368 =item B<main_w, W>
yading@10 17369
yading@10 17370
yading@10 17371 =item B<main_h, H>
yading@10 17372
yading@10 17373 main input width and height
yading@10 17374
yading@10 17375
yading@10 17376 =item B<overlay_w, w>
yading@10 17377
yading@10 17378
yading@10 17379 =item B<overlay_h, h>
yading@10 17380
yading@10 17381 overlay input width and height
yading@10 17382
yading@10 17383
yading@10 17384 =item B<x>
yading@10 17385
yading@10 17386
yading@10 17387 =item B<y>
yading@10 17388
yading@10 17389 the computed values for I<x> and I<y>. They are evaluated for
yading@10 17390 each new frame.
yading@10 17391
yading@10 17392
yading@10 17393 =item B<hsub>
yading@10 17394
yading@10 17395
yading@10 17396 =item B<vsub>
yading@10 17397
yading@10 17398 horizontal and vertical chroma subsample values of the output
yading@10 17399 format. For example for the pixel format "yuv422p" I<hsub> is 2 and
yading@10 17400 I<vsub> is 1.
yading@10 17401
yading@10 17402
yading@10 17403 =item B<n>
yading@10 17404
yading@10 17405 the number of input frame, starting from 0
yading@10 17406
yading@10 17407
yading@10 17408 =item B<pos>
yading@10 17409
yading@10 17410 the position in the file of the input frame, NAN if unknown
yading@10 17411
yading@10 17412
yading@10 17413 =item B<t>
yading@10 17414
yading@10 17415 timestamp expressed in seconds, NAN if the input timestamp is unknown
yading@10 17416
yading@10 17417 =back
yading@10 17418
yading@10 17419
yading@10 17420 Note that the I<n>, I<pos>, I<t> variables are available only
yading@10 17421 when evaluation is done I<per frame>, and will evaluate to NAN
yading@10 17422 when B<eval> is set to B<init>.
yading@10 17423
yading@10 17424 Be aware that frames are taken from each input video in timestamp
yading@10 17425 order, hence, if their initial timestamps differ, it is a a good idea
yading@10 17426 to pass the two inputs through a I<setpts=PTS-STARTPTS> filter to
yading@10 17427 have them begin in the same zero timestamp, as it does the example for
yading@10 17428 the I<movie> filter.
yading@10 17429
yading@10 17430 You can chain together more overlays but you should test the
yading@10 17431 efficiency of such approach.
yading@10 17432
yading@10 17433
yading@10 17434 =head3 Commands
yading@10 17435
yading@10 17436
yading@10 17437 This filter supports the following commands:
yading@10 17438
yading@10 17439 =over 4
yading@10 17440
yading@10 17441
yading@10 17442 =item B<x>
yading@10 17443
yading@10 17444
yading@10 17445 =item B<y>
yading@10 17446
yading@10 17447
yading@10 17448 =item B<enable>
yading@10 17449
yading@10 17450 Modify the x/y and enable overlay of the overlay input.
yading@10 17451 The command accepts the same syntax of the corresponding option.
yading@10 17452
yading@10 17453 If the specified expression is not valid, it is kept at its current
yading@10 17454 value.
yading@10 17455
yading@10 17456 =back
yading@10 17457
yading@10 17458
yading@10 17459
yading@10 17460 =head3 Examples
yading@10 17461
yading@10 17462
yading@10 17463
yading@10 17464 =over 4
yading@10 17465
yading@10 17466
yading@10 17467 =item *
yading@10 17468
yading@10 17469 Draw the overlay at 10 pixels from the bottom right corner of the main
yading@10 17470 video:
yading@10 17471
yading@10 17472 overlay=main_w-overlay_w-10:main_h-overlay_h-10
yading@10 17473
yading@10 17474
yading@10 17475 Using named options the example above becomes:
yading@10 17476
yading@10 17477 overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
yading@10 17478
yading@10 17479
yading@10 17480
yading@10 17481 =item *
yading@10 17482
yading@10 17483 Insert a transparent PNG logo in the bottom left corner of the input,
yading@10 17484 using the B<ffmpeg> tool with the C<-filter_complex> option:
yading@10 17485
yading@10 17486 ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
yading@10 17487
yading@10 17488
yading@10 17489
yading@10 17490 =item *
yading@10 17491
yading@10 17492 Insert 2 different transparent PNG logos (second logo on bottom
yading@10 17493 right corner) using the B<ffmpeg> tool:
yading@10 17494
yading@10 17495 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 17496
yading@10 17497
yading@10 17498
yading@10 17499 =item *
yading@10 17500
yading@10 17501 Add a transparent color layer on top of the main video, C<WxH>
yading@10 17502 must specify the size of the main input to the overlay filter:
yading@10 17503
yading@10 17504 color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
yading@10 17505
yading@10 17506
yading@10 17507
yading@10 17508 =item *
yading@10 17509
yading@10 17510 Play an original video and a filtered version (here with the deshake
yading@10 17511 filter) side by side using the B<ffplay> tool:
yading@10 17512
yading@10 17513 ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
yading@10 17514
yading@10 17515
yading@10 17516 The above command is the same as:
yading@10 17517
yading@10 17518 ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
yading@10 17519
yading@10 17520
yading@10 17521
yading@10 17522 =item *
yading@10 17523
yading@10 17524 Make a sliding overlay appearing from the left to the right top part of the
yading@10 17525 screen starting since time 2:
yading@10 17526
yading@10 17527 overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
yading@10 17528
yading@10 17529
yading@10 17530
yading@10 17531 =item *
yading@10 17532
yading@10 17533 Compose output by putting two input videos side to side:
yading@10 17534
yading@10 17535 ffmpeg -i left.avi -i right.avi -filter_complex "
yading@10 17536 nullsrc=size=200x100 [background];
yading@10 17537 [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
yading@10 17538 [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
yading@10 17539 [background][left] overlay=shortest=1 [background+left];
yading@10 17540 [background+left][right] overlay=shortest=1:x=100 [left+right]
yading@10 17541 "
yading@10 17542
yading@10 17543
yading@10 17544
yading@10 17545 =item *
yading@10 17546
yading@10 17547 Chain several overlays in cascade:
yading@10 17548
yading@10 17549 nullsrc=s=200x200 [bg];
yading@10 17550 testsrc=s=100x100, split=4 [in0][in1][in2][in3];
yading@10 17551 [in0] lutrgb=r=0, [bg] overlay=0:0 [mid0];
yading@10 17552 [in1] lutrgb=g=0, [mid0] overlay=100:0 [mid1];
yading@10 17553 [in2] lutrgb=b=0, [mid1] overlay=0:100 [mid2];
yading@10 17554 [in3] null, [mid2] overlay=100:100 [out0]
yading@10 17555
yading@10 17556
yading@10 17557
yading@10 17558 =back
yading@10 17559
yading@10 17560
yading@10 17561
yading@10 17562 =head2 pad
yading@10 17563
yading@10 17564
yading@10 17565 Add paddings to the input image, and place the original input at the
yading@10 17566 given coordinates I<x>, I<y>.
yading@10 17567
yading@10 17568 This filter accepts the following parameters:
yading@10 17569
yading@10 17570
yading@10 17571 =over 4
yading@10 17572
yading@10 17573
yading@10 17574 =item B<width, w>
yading@10 17575
yading@10 17576
yading@10 17577 =item B<height, h>
yading@10 17578
yading@10 17579 Specify an expression for the size of the output image with the
yading@10 17580 paddings added. If the value for I<width> or I<height> is 0, the
yading@10 17581 corresponding input size is used for the output.
yading@10 17582
yading@10 17583 The I<width> expression can reference the value set by the
yading@10 17584 I<height> expression, and vice versa.
yading@10 17585
yading@10 17586 The default value of I<width> and I<height> is 0.
yading@10 17587
yading@10 17588
yading@10 17589 =item B<x>
yading@10 17590
yading@10 17591
yading@10 17592 =item B<y>
yading@10 17593
yading@10 17594 Specify an expression for the offsets where to place the input image
yading@10 17595 in the padded area with respect to the top/left border of the output
yading@10 17596 image.
yading@10 17597
yading@10 17598 The I<x> expression can reference the value set by the I<y>
yading@10 17599 expression, and vice versa.
yading@10 17600
yading@10 17601 The default value of I<x> and I<y> is 0.
yading@10 17602
yading@10 17603
yading@10 17604 =item B<color>
yading@10 17605
yading@10 17606 Specify the color of the padded area, it can be the name of a color
yading@10 17607 (case insensitive match) or a 0xRRGGBB[AA] sequence.
yading@10 17608
yading@10 17609 The default value of I<color> is "black".
yading@10 17610
yading@10 17611 =back
yading@10 17612
yading@10 17613
yading@10 17614 The value for the I<width>, I<height>, I<x>, and I<y>
yading@10 17615 options are expressions containing the following constants:
yading@10 17616
yading@10 17617
yading@10 17618 =over 4
yading@10 17619
yading@10 17620
yading@10 17621 =item B<in_w, in_h>
yading@10 17622
yading@10 17623 the input video width and height
yading@10 17624
yading@10 17625
yading@10 17626 =item B<iw, ih>
yading@10 17627
yading@10 17628 same as I<in_w> and I<in_h>
yading@10 17629
yading@10 17630
yading@10 17631 =item B<out_w, out_h>
yading@10 17632
yading@10 17633 the output width and height, that is the size of the padded area as
yading@10 17634 specified by the I<width> and I<height> expressions
yading@10 17635
yading@10 17636
yading@10 17637 =item B<ow, oh>
yading@10 17638
yading@10 17639 same as I<out_w> and I<out_h>
yading@10 17640
yading@10 17641
yading@10 17642 =item B<x, y>
yading@10 17643
yading@10 17644 x and y offsets as specified by the I<x> and I<y>
yading@10 17645 expressions, or NAN if not yet specified
yading@10 17646
yading@10 17647
yading@10 17648 =item B<a>
yading@10 17649
yading@10 17650 same as I<iw> / I<ih>
yading@10 17651
yading@10 17652
yading@10 17653 =item B<sar>
yading@10 17654
yading@10 17655 input sample aspect ratio
yading@10 17656
yading@10 17657
yading@10 17658 =item B<dar>
yading@10 17659
yading@10 17660 input display aspect ratio, it is the same as (I<iw> / I<ih>) * I<sar>
yading@10 17661
yading@10 17662
yading@10 17663 =item B<hsub, vsub>
yading@10 17664
yading@10 17665 horizontal and vertical chroma subsample values. For example for the
yading@10 17666 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 17667
yading@10 17668 =back
yading@10 17669
yading@10 17670
yading@10 17671
yading@10 17672 =head3 Examples
yading@10 17673
yading@10 17674
yading@10 17675
yading@10 17676 =over 4
yading@10 17677
yading@10 17678
yading@10 17679 =item *
yading@10 17680
yading@10 17681 Add paddings with color "violet" to the input video. Output video
yading@10 17682 size is 640x480, the top-left corner of the input video is placed at
yading@10 17683 column 0, row 40:
yading@10 17684
yading@10 17685 pad=640:480:0:40:violet
yading@10 17686
yading@10 17687
yading@10 17688 The example above is equivalent to the following command:
yading@10 17689
yading@10 17690 pad=width=640:height=480:x=0:y=40:color=violet
yading@10 17691
yading@10 17692
yading@10 17693
yading@10 17694 =item *
yading@10 17695
yading@10 17696 Pad the input to get an output with dimensions increased by 3/2,
yading@10 17697 and put the input video at the center of the padded area:
yading@10 17698
yading@10 17699 pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
yading@10 17700
yading@10 17701
yading@10 17702
yading@10 17703 =item *
yading@10 17704
yading@10 17705 Pad the input to get a squared output with size equal to the maximum
yading@10 17706 value between the input width and height, and put the input video at
yading@10 17707 the center of the padded area:
yading@10 17708
yading@10 17709 pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
yading@10 17710
yading@10 17711
yading@10 17712
yading@10 17713 =item *
yading@10 17714
yading@10 17715 Pad the input to get a final w/h ratio of 16:9:
yading@10 17716
yading@10 17717 pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
yading@10 17718
yading@10 17719
yading@10 17720
yading@10 17721 =item *
yading@10 17722
yading@10 17723 In case of anamorphic video, in order to set the output display aspect
yading@10 17724 correctly, it is necessary to use I<sar> in the expression,
yading@10 17725 according to the relation:
yading@10 17726
yading@10 17727 (ih * X / ih) * sar = output_dar
yading@10 17728 X = output_dar / sar
yading@10 17729
yading@10 17730
yading@10 17731 Thus the previous example needs to be modified to:
yading@10 17732
yading@10 17733 pad="ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2"
yading@10 17734
yading@10 17735
yading@10 17736
yading@10 17737 =item *
yading@10 17738
yading@10 17739 Double output size and put the input video in the bottom-right
yading@10 17740 corner of the output padded area:
yading@10 17741
yading@10 17742 pad="2*iw:2*ih:ow-iw:oh-ih"
yading@10 17743
yading@10 17744
yading@10 17745 =back
yading@10 17746
yading@10 17747
yading@10 17748
yading@10 17749 =head2 pixdesctest
yading@10 17750
yading@10 17751
yading@10 17752 Pixel format descriptor test filter, mainly useful for internal
yading@10 17753 testing. The output video should be equal to the input video.
yading@10 17754
yading@10 17755 For example:
yading@10 17756
yading@10 17757 format=monow, pixdesctest
yading@10 17758
yading@10 17759
yading@10 17760 can be used to test the monowhite pixel format descriptor definition.
yading@10 17761
yading@10 17762
yading@10 17763 =head2 pp
yading@10 17764
yading@10 17765
yading@10 17766 Enable the specified chain of postprocessing subfilters using libpostproc. This
yading@10 17767 library should be automatically selected with a GPL build (C<--enable-gpl>).
yading@10 17768 Subfilters must be separated by '/' and can be disabled by prepending a '-'.
yading@10 17769 Each subfilter and some options have a short and a long name that can be used
yading@10 17770 interchangeably, i.e. dr/dering are the same.
yading@10 17771
yading@10 17772 The filters accept the following options:
yading@10 17773
yading@10 17774
yading@10 17775 =over 4
yading@10 17776
yading@10 17777
yading@10 17778 =item B<subfilters>
yading@10 17779
yading@10 17780 Set postprocessing subfilters string.
yading@10 17781
yading@10 17782 =back
yading@10 17783
yading@10 17784
yading@10 17785 All subfilters share common options to determine their scope:
yading@10 17786
yading@10 17787
yading@10 17788 =over 4
yading@10 17789
yading@10 17790
yading@10 17791 =item B<a/autoq>
yading@10 17792
yading@10 17793 Honor the quality commands for this subfilter.
yading@10 17794
yading@10 17795
yading@10 17796 =item B<c/chrom>
yading@10 17797
yading@10 17798 Do chrominance filtering, too (default).
yading@10 17799
yading@10 17800
yading@10 17801 =item B<y/nochrom>
yading@10 17802
yading@10 17803 Do luminance filtering only (no chrominance).
yading@10 17804
yading@10 17805
yading@10 17806 =item B<n/noluma>
yading@10 17807
yading@10 17808 Do chrominance filtering only (no luminance).
yading@10 17809
yading@10 17810 =back
yading@10 17811
yading@10 17812
yading@10 17813 These options can be appended after the subfilter name, separated by a '|'.
yading@10 17814
yading@10 17815 Available subfilters are:
yading@10 17816
yading@10 17817
yading@10 17818 =over 4
yading@10 17819
yading@10 17820
yading@10 17821 =item B<hb/hdeblock[|difference[|flatness]]>
yading@10 17822
yading@10 17823 Horizontal deblocking filter
yading@10 17824
yading@10 17825 =over 4
yading@10 17826
yading@10 17827
yading@10 17828 =item B<difference>
yading@10 17829
yading@10 17830 Difference factor where higher values mean more deblocking (default: C<32>).
yading@10 17831
yading@10 17832 =item B<flatness>
yading@10 17833
yading@10 17834 Flatness threshold where lower values mean more deblocking (default: C<39>).
yading@10 17835
yading@10 17836 =back
yading@10 17837
yading@10 17838
yading@10 17839
yading@10 17840 =item B<vb/vdeblock[|difference[|flatness]]>
yading@10 17841
yading@10 17842 Vertical deblocking filter
yading@10 17843
yading@10 17844 =over 4
yading@10 17845
yading@10 17846
yading@10 17847 =item B<difference>
yading@10 17848
yading@10 17849 Difference factor where higher values mean more deblocking (default: C<32>).
yading@10 17850
yading@10 17851 =item B<flatness>
yading@10 17852
yading@10 17853 Flatness threshold where lower values mean more deblocking (default: C<39>).
yading@10 17854
yading@10 17855 =back
yading@10 17856
yading@10 17857
yading@10 17858
yading@10 17859 =item B<ha/hadeblock[|difference[|flatness]]>
yading@10 17860
yading@10 17861 Accurate horizontal deblocking filter
yading@10 17862
yading@10 17863 =over 4
yading@10 17864
yading@10 17865
yading@10 17866 =item B<difference>
yading@10 17867
yading@10 17868 Difference factor where higher values mean more deblocking (default: C<32>).
yading@10 17869
yading@10 17870 =item B<flatness>
yading@10 17871
yading@10 17872 Flatness threshold where lower values mean more deblocking (default: C<39>).
yading@10 17873
yading@10 17874 =back
yading@10 17875
yading@10 17876
yading@10 17877
yading@10 17878 =item B<va/vadeblock[|difference[|flatness]]>
yading@10 17879
yading@10 17880 Accurate vertical deblocking filter
yading@10 17881
yading@10 17882 =over 4
yading@10 17883
yading@10 17884
yading@10 17885 =item B<difference>
yading@10 17886
yading@10 17887 Difference factor where higher values mean more deblocking (default: C<32>).
yading@10 17888
yading@10 17889 =item B<flatness>
yading@10 17890
yading@10 17891 Flatness threshold where lower values mean more deblocking (default: C<39>).
yading@10 17892
yading@10 17893 =back
yading@10 17894
yading@10 17895
yading@10 17896 =back
yading@10 17897
yading@10 17898
yading@10 17899 The horizontal and vertical deblocking filters share the difference and
yading@10 17900 flatness values so you cannot set different horizontal and vertical
yading@10 17901 thresholds.
yading@10 17902
yading@10 17903
yading@10 17904 =over 4
yading@10 17905
yading@10 17906
yading@10 17907 =item B<h1/x1hdeblock>
yading@10 17908
yading@10 17909 Experimental horizontal deblocking filter
yading@10 17910
yading@10 17911
yading@10 17912 =item B<v1/x1vdeblock>
yading@10 17913
yading@10 17914 Experimental vertical deblocking filter
yading@10 17915
yading@10 17916
yading@10 17917 =item B<dr/dering>
yading@10 17918
yading@10 17919 Deringing filter
yading@10 17920
yading@10 17921
yading@10 17922 =item B<tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer>
yading@10 17923
yading@10 17924
yading@10 17925 =over 4
yading@10 17926
yading@10 17927
yading@10 17928 =item B<threshold1>
yading@10 17929
yading@10 17930 larger -E<gt> stronger filtering
yading@10 17931
yading@10 17932 =item B<threshold2>
yading@10 17933
yading@10 17934 larger -E<gt> stronger filtering
yading@10 17935
yading@10 17936 =item B<threshold3>
yading@10 17937
yading@10 17938 larger -E<gt> stronger filtering
yading@10 17939
yading@10 17940 =back
yading@10 17941
yading@10 17942
yading@10 17943
yading@10 17944 =item B<al/autolevels[:f/fullyrange], automatic brightness / contrast correction>
yading@10 17945
yading@10 17946
yading@10 17947 =over 4
yading@10 17948
yading@10 17949
yading@10 17950 =item B<f/fullyrange>
yading@10 17951
yading@10 17952 Stretch luminance to C<0-255>.
yading@10 17953
yading@10 17954 =back
yading@10 17955
yading@10 17956
yading@10 17957
yading@10 17958 =item B<lb/linblenddeint>
yading@10 17959
yading@10 17960 Linear blend deinterlacing filter that deinterlaces the given block by
yading@10 17961 filtering all lines with a C<(1 2 1)> filter.
yading@10 17962
yading@10 17963
yading@10 17964 =item B<li/linipoldeint>
yading@10 17965
yading@10 17966 Linear interpolating deinterlacing filter that deinterlaces the given block by
yading@10 17967 linearly interpolating every second line.
yading@10 17968
yading@10 17969
yading@10 17970 =item B<ci/cubicipoldeint>
yading@10 17971
yading@10 17972 Cubic interpolating deinterlacing filter deinterlaces the given block by
yading@10 17973 cubically interpolating every second line.
yading@10 17974
yading@10 17975
yading@10 17976 =item B<md/mediandeint>
yading@10 17977
yading@10 17978 Median deinterlacing filter that deinterlaces the given block by applying a
yading@10 17979 median filter to every second line.
yading@10 17980
yading@10 17981
yading@10 17982 =item B<fd/ffmpegdeint>
yading@10 17983
yading@10 17984 FFmpeg deinterlacing filter that deinterlaces the given block by filtering every
yading@10 17985 second line with a C<(-1 4 2 4 -1)> filter.
yading@10 17986
yading@10 17987
yading@10 17988 =item B<l5/lowpass5>
yading@10 17989
yading@10 17990 Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given
yading@10 17991 block by filtering all lines with a C<(-1 2 6 2 -1)> filter.
yading@10 17992
yading@10 17993
yading@10 17994 =item B<fq/forceQuant[|quantizer]>
yading@10 17995
yading@10 17996 Overrides the quantizer table from the input with the constant quantizer you
yading@10 17997 specify.
yading@10 17998
yading@10 17999 =over 4
yading@10 18000
yading@10 18001
yading@10 18002 =item B<quantizer>
yading@10 18003
yading@10 18004 Quantizer to use
yading@10 18005
yading@10 18006 =back
yading@10 18007
yading@10 18008
yading@10 18009
yading@10 18010 =item B<de/default>
yading@10 18011
yading@10 18012 Default pp filter combination (C<hb|a,vb|a,dr|a>)
yading@10 18013
yading@10 18014
yading@10 18015 =item B<fa/fast>
yading@10 18016
yading@10 18017 Fast pp filter combination (C<h1|a,v1|a,dr|a>)
yading@10 18018
yading@10 18019
yading@10 18020 =item B<ac>
yading@10 18021
yading@10 18022 High quality pp filter combination (C<ha|a|128|7,va|a,dr|a>)
yading@10 18023
yading@10 18024 =back
yading@10 18025
yading@10 18026
yading@10 18027
yading@10 18028 =head3 Examples
yading@10 18029
yading@10 18030
yading@10 18031
yading@10 18032 =over 4
yading@10 18033
yading@10 18034
yading@10 18035 =item *
yading@10 18036
yading@10 18037 Apply horizontal and vertical deblocking, deringing and automatic
yading@10 18038 brightness/contrast:
yading@10 18039
yading@10 18040 pp=hb/vb/dr/al
yading@10 18041
yading@10 18042
yading@10 18043
yading@10 18044 =item *
yading@10 18045
yading@10 18046 Apply default filters without brightness/contrast correction:
yading@10 18047
yading@10 18048 pp=de/-al
yading@10 18049
yading@10 18050
yading@10 18051
yading@10 18052 =item *
yading@10 18053
yading@10 18054 Apply default filters and temporal denoiser:
yading@10 18055
yading@10 18056 pp=default/tmpnoise|1|2|3
yading@10 18057
yading@10 18058
yading@10 18059
yading@10 18060 =item *
yading@10 18061
yading@10 18062 Apply deblocking on luminance only, and switch vertical deblocking on or off
yading@10 18063 automatically depending on available CPU time:
yading@10 18064
yading@10 18065 pp=hb|y/vb|a
yading@10 18066
yading@10 18067
yading@10 18068 =back
yading@10 18069
yading@10 18070
yading@10 18071
yading@10 18072 =head2 removelogo
yading@10 18073
yading@10 18074
yading@10 18075 Suppress a TV station logo, using an image file to determine which
yading@10 18076 pixels comprise the logo. It works by filling in the pixels that
yading@10 18077 comprise the logo with neighboring pixels.
yading@10 18078
yading@10 18079 The filters accept the following options:
yading@10 18080
yading@10 18081
yading@10 18082 =over 4
yading@10 18083
yading@10 18084
yading@10 18085 =item B<filename, f>
yading@10 18086
yading@10 18087 Set the filter bitmap file, which can be any image format supported by
yading@10 18088 libavformat. The width and height of the image file must match those of the
yading@10 18089 video stream being processed.
yading@10 18090
yading@10 18091 =back
yading@10 18092
yading@10 18093
yading@10 18094 Pixels in the provided bitmap image with a value of zero are not
yading@10 18095 considered part of the logo, non-zero pixels are considered part of
yading@10 18096 the logo. If you use white (255) for the logo and black (0) for the
yading@10 18097 rest, you will be safe. For making the filter bitmap, it is
yading@10 18098 recommended to take a screen capture of a black frame with the logo
yading@10 18099 visible, and then using a threshold filter followed by the erode
yading@10 18100 filter once or twice.
yading@10 18101
yading@10 18102 If needed, little splotches can be fixed manually. Remember that if
yading@10 18103 logo pixels are not covered, the filter quality will be much
yading@10 18104 reduced. Marking too many pixels as part of the logo does not hurt as
yading@10 18105 much, but it will increase the amount of blurring needed to cover over
yading@10 18106 the image and will destroy more information than necessary, and extra
yading@10 18107 pixels will slow things down on a large logo.
yading@10 18108
yading@10 18109
yading@10 18110 =head2 scale
yading@10 18111
yading@10 18112
yading@10 18113 Scale (resize) the input video, using the libswscale library.
yading@10 18114
yading@10 18115 The scale filter forces the output display aspect ratio to be the same
yading@10 18116 of the input, by changing the output sample aspect ratio.
yading@10 18117
yading@10 18118 The filter accepts the following options:
yading@10 18119
yading@10 18120
yading@10 18121 =over 4
yading@10 18122
yading@10 18123
yading@10 18124 =item B<width, w>
yading@10 18125
yading@10 18126 Output video width.
yading@10 18127 default value is C<iw>. See below
yading@10 18128 for the list of accepted constants.
yading@10 18129
yading@10 18130
yading@10 18131 =item B<height, h>
yading@10 18132
yading@10 18133 Output video height.
yading@10 18134 default value is C<ih>.
yading@10 18135 See below for the list of accepted constants.
yading@10 18136
yading@10 18137
yading@10 18138 =item B<interl>
yading@10 18139
yading@10 18140 Set the interlacing. It accepts the following values:
yading@10 18141
yading@10 18142
yading@10 18143 =over 4
yading@10 18144
yading@10 18145
yading@10 18146 =item B<1>
yading@10 18147
yading@10 18148 force interlaced aware scaling
yading@10 18149
yading@10 18150
yading@10 18151 =item B<0>
yading@10 18152
yading@10 18153 do not apply interlaced scaling
yading@10 18154
yading@10 18155
yading@10 18156 =item B<-1>
yading@10 18157
yading@10 18158 select interlaced aware scaling depending on whether the source frames
yading@10 18159 are flagged as interlaced or not
yading@10 18160
yading@10 18161 =back
yading@10 18162
yading@10 18163
yading@10 18164 Default value is C<0>.
yading@10 18165
yading@10 18166
yading@10 18167 =item B<flags>
yading@10 18168
yading@10 18169 Set libswscale scaling flags. If not explictly specified the filter
yading@10 18170 applies a bilinear scaling algorithm.
yading@10 18171
yading@10 18172
yading@10 18173 =item B<size, s>
yading@10 18174
yading@10 18175 Set the video size, the value must be a valid abbreviation or in the
yading@10 18176 form I<width>xI<height>.
yading@10 18177
yading@10 18178 =back
yading@10 18179
yading@10 18180
yading@10 18181 The values of the I<w> and I<h> options are expressions
yading@10 18182 containing the following constants:
yading@10 18183
yading@10 18184
yading@10 18185 =over 4
yading@10 18186
yading@10 18187
yading@10 18188 =item B<in_w, in_h>
yading@10 18189
yading@10 18190 the input width and height
yading@10 18191
yading@10 18192
yading@10 18193 =item B<iw, ih>
yading@10 18194
yading@10 18195 same as I<in_w> and I<in_h>
yading@10 18196
yading@10 18197
yading@10 18198 =item B<out_w, out_h>
yading@10 18199
yading@10 18200 the output (cropped) width and height
yading@10 18201
yading@10 18202
yading@10 18203 =item B<ow, oh>
yading@10 18204
yading@10 18205 same as I<out_w> and I<out_h>
yading@10 18206
yading@10 18207
yading@10 18208 =item B<a>
yading@10 18209
yading@10 18210 same as I<iw> / I<ih>
yading@10 18211
yading@10 18212
yading@10 18213 =item B<sar>
yading@10 18214
yading@10 18215 input sample aspect ratio
yading@10 18216
yading@10 18217
yading@10 18218 =item B<dar>
yading@10 18219
yading@10 18220 input display aspect ratio, it is the same as (I<iw> / I<ih>) * I<sar>
yading@10 18221
yading@10 18222
yading@10 18223 =item B<hsub, vsub>
yading@10 18224
yading@10 18225 horizontal and vertical chroma subsample values. For example for the
yading@10 18226 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 18227
yading@10 18228 =back
yading@10 18229
yading@10 18230
yading@10 18231 If the input image format is different from the format requested by
yading@10 18232 the next filter, the scale filter will convert the input to the
yading@10 18233 requested format.
yading@10 18234
yading@10 18235 If the value for I<w> or I<h> is 0, the respective input
yading@10 18236 size is used for the output.
yading@10 18237
yading@10 18238 If the value for I<w> or I<h> is -1, the scale filter will use, for the
yading@10 18239 respective output size, a value that maintains the aspect ratio of the input
yading@10 18240 image.
yading@10 18241
yading@10 18242
yading@10 18243 =head3 Examples
yading@10 18244
yading@10 18245
yading@10 18246
yading@10 18247 =over 4
yading@10 18248
yading@10 18249
yading@10 18250 =item *
yading@10 18251
yading@10 18252 Scale the input video to a size of 200x100:
yading@10 18253
yading@10 18254 scale=w=200:h=100
yading@10 18255
yading@10 18256
yading@10 18257 This is equivalent to:
yading@10 18258
yading@10 18259 scale=w=200:h=100
yading@10 18260
yading@10 18261
yading@10 18262 or:
yading@10 18263
yading@10 18264 scale=200x100
yading@10 18265
yading@10 18266
yading@10 18267
yading@10 18268 =item *
yading@10 18269
yading@10 18270 Specify a size abbreviation for the output size:
yading@10 18271
yading@10 18272 scale=qcif
yading@10 18273
yading@10 18274
yading@10 18275 which can also be written as:
yading@10 18276
yading@10 18277 scale=size=qcif
yading@10 18278
yading@10 18279
yading@10 18280
yading@10 18281 =item *
yading@10 18282
yading@10 18283 Scale the input to 2x:
yading@10 18284
yading@10 18285 scale=w=2*iw:h=2*ih
yading@10 18286
yading@10 18287
yading@10 18288
yading@10 18289 =item *
yading@10 18290
yading@10 18291 The above is the same as:
yading@10 18292
yading@10 18293 scale=2*in_w:2*in_h
yading@10 18294
yading@10 18295
yading@10 18296
yading@10 18297 =item *
yading@10 18298
yading@10 18299 Scale the input to 2x with forced interlaced scaling:
yading@10 18300
yading@10 18301 scale=2*iw:2*ih:interl=1
yading@10 18302
yading@10 18303
yading@10 18304
yading@10 18305 =item *
yading@10 18306
yading@10 18307 Scale the input to half size:
yading@10 18308
yading@10 18309 scale=w=iw/2:h=ih/2
yading@10 18310
yading@10 18311
yading@10 18312
yading@10 18313 =item *
yading@10 18314
yading@10 18315 Increase the width, and set the height to the same size:
yading@10 18316
yading@10 18317 scale=3/2*iw:ow
yading@10 18318
yading@10 18319
yading@10 18320
yading@10 18321 =item *
yading@10 18322
yading@10 18323 Seek for Greek harmony:
yading@10 18324
yading@10 18325 scale=iw:1/PHI*iw
yading@10 18326 scale=ih*PHI:ih
yading@10 18327
yading@10 18328
yading@10 18329
yading@10 18330 =item *
yading@10 18331
yading@10 18332 Increase the height, and set the width to 3/2 of the height:
yading@10 18333
yading@10 18334 scale=w=3/2*oh:h=3/5*ih
yading@10 18335
yading@10 18336
yading@10 18337
yading@10 18338 =item *
yading@10 18339
yading@10 18340 Increase the size, but make the size a multiple of the chroma
yading@10 18341 subsample values:
yading@10 18342
yading@10 18343 scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
yading@10 18344
yading@10 18345
yading@10 18346
yading@10 18347 =item *
yading@10 18348
yading@10 18349 Increase the width to a maximum of 500 pixels, keep the same input
yading@10 18350 aspect ratio:
yading@10 18351
yading@10 18352 scale=w='min(500\, iw*3/2):h=-1'
yading@10 18353
yading@10 18354
yading@10 18355 =back
yading@10 18356
yading@10 18357
yading@10 18358
yading@10 18359 =head2 separatefields
yading@10 18360
yading@10 18361
yading@10 18362 The C<separatefields> takes a frame-based video input and splits
yading@10 18363 each frame into its components fields, producing a new half height clip
yading@10 18364 with twice the frame rate and twice the frame count.
yading@10 18365
yading@10 18366 This filter use field-dominance information in frame to decide which
yading@10 18367 of each pair of fields to place first in the output.
yading@10 18368 If it gets it wrong use setfield filter before C<separatefields> filter.
yading@10 18369
yading@10 18370
yading@10 18371 =head2 setdar, setsar
yading@10 18372
yading@10 18373
yading@10 18374 The C<setdar> filter sets the Display Aspect Ratio for the filter
yading@10 18375 output video.
yading@10 18376
yading@10 18377 This is done by changing the specified Sample (aka Pixel) Aspect
yading@10 18378 Ratio, according to the following equation:
yading@10 18379
yading@10 18380 <DAR> = <HORIZONTAL_RESOLUTION> / <VERTICAL_RESOLUTION> * <SAR>
yading@10 18381
yading@10 18382
yading@10 18383 Keep in mind that the C<setdar> filter does not modify the pixel
yading@10 18384 dimensions of the video frame. Also the display aspect ratio set by
yading@10 18385 this filter may be changed by later filters in the filterchain,
yading@10 18386 e.g. in case of scaling or if another "setdar" or a "setsar" filter is
yading@10 18387 applied.
yading@10 18388
yading@10 18389 The C<setsar> filter sets the Sample (aka Pixel) Aspect Ratio for
yading@10 18390 the filter output video.
yading@10 18391
yading@10 18392 Note that as a consequence of the application of this filter, the
yading@10 18393 output display aspect ratio will change according to the equation
yading@10 18394 above.
yading@10 18395
yading@10 18396 Keep in mind that the sample aspect ratio set by the C<setsar>
yading@10 18397 filter may be changed by later filters in the filterchain, e.g. if
yading@10 18398 another "setsar" or a "setdar" filter is applied.
yading@10 18399
yading@10 18400 The filters accept the following options:
yading@10 18401
yading@10 18402
yading@10 18403 =over 4
yading@10 18404
yading@10 18405
yading@10 18406 =item B<r, ratio, dar (C<setdar> only), sar (C<setsar> only)>
yading@10 18407
yading@10 18408 Set the aspect ratio used by the filter.
yading@10 18409
yading@10 18410 The parameter can be a floating point number string, an expression, or
yading@10 18411 a string of the form I<num>:I<den>, where I<num> and
yading@10 18412 I<den> are the numerator and denominator of the aspect ratio. If
yading@10 18413 the parameter is not specified, it is assumed the value "0".
yading@10 18414 In case the form "I<num>:I<den>" is used, the C<:> character
yading@10 18415 should be escaped.
yading@10 18416
yading@10 18417
yading@10 18418 =item B<max>
yading@10 18419
yading@10 18420 Set the maximum integer value to use for expressing numerator and
yading@10 18421 denominator when reducing the expressed aspect ratio to a rational.
yading@10 18422 Default value is C<100>.
yading@10 18423
yading@10 18424
yading@10 18425 =back
yading@10 18426
yading@10 18427
yading@10 18428
yading@10 18429 =head3 Examples
yading@10 18430
yading@10 18431
yading@10 18432
yading@10 18433 =over 4
yading@10 18434
yading@10 18435
yading@10 18436
yading@10 18437 =item *
yading@10 18438
yading@10 18439 To change the display aspect ratio to 16:9, specify one of the following:
yading@10 18440
yading@10 18441 setdar=dar=1.77777
yading@10 18442 setdar=dar=16/9
yading@10 18443 setdar=dar=1.77777
yading@10 18444
yading@10 18445
yading@10 18446
yading@10 18447 =item *
yading@10 18448
yading@10 18449 To change the sample aspect ratio to 10:11, specify:
yading@10 18450
yading@10 18451 setsar=sar=10/11
yading@10 18452
yading@10 18453
yading@10 18454
yading@10 18455 =item *
yading@10 18456
yading@10 18457 To set a display aspect ratio of 16:9, and specify a maximum integer value of
yading@10 18458 1000 in the aspect ratio reduction, use the command:
yading@10 18459
yading@10 18460 setdar=ratio=16/9:max=1000
yading@10 18461
yading@10 18462
yading@10 18463
yading@10 18464 =back
yading@10 18465
yading@10 18466
yading@10 18467
yading@10 18468
yading@10 18469 =head2 setfield
yading@10 18470
yading@10 18471
yading@10 18472 Force field for the output video frame.
yading@10 18473
yading@10 18474 The C<setfield> filter marks the interlace type field for the
yading@10 18475 output frames. It does not change the input frame, but only sets the
yading@10 18476 corresponding property, which affects how the frame is treated by
yading@10 18477 following filters (e.g. C<fieldorder> or C<yadif>).
yading@10 18478
yading@10 18479 The filter accepts the following options:
yading@10 18480
yading@10 18481
yading@10 18482 =over 4
yading@10 18483
yading@10 18484
yading@10 18485
yading@10 18486 =item B<mode>
yading@10 18487
yading@10 18488 Available values are:
yading@10 18489
yading@10 18490
yading@10 18491 =over 4
yading@10 18492
yading@10 18493
yading@10 18494 =item B<auto>
yading@10 18495
yading@10 18496 Keep the same field property.
yading@10 18497
yading@10 18498
yading@10 18499 =item B<bff>
yading@10 18500
yading@10 18501 Mark the frame as bottom-field-first.
yading@10 18502
yading@10 18503
yading@10 18504 =item B<tff>
yading@10 18505
yading@10 18506 Mark the frame as top-field-first.
yading@10 18507
yading@10 18508
yading@10 18509 =item B<prog>
yading@10 18510
yading@10 18511 Mark the frame as progressive.
yading@10 18512
yading@10 18513 =back
yading@10 18514
yading@10 18515
yading@10 18516 =back
yading@10 18517
yading@10 18518
yading@10 18519
yading@10 18520 =head2 showinfo
yading@10 18521
yading@10 18522
yading@10 18523 Show a line containing various information for each input video frame.
yading@10 18524 The input video is not modified.
yading@10 18525
yading@10 18526 The shown line contains a sequence of key/value pairs of the form
yading@10 18527 I<key>:I<value>.
yading@10 18528
yading@10 18529 A description of each shown parameter follows:
yading@10 18530
yading@10 18531
yading@10 18532 =over 4
yading@10 18533
yading@10 18534
yading@10 18535 =item B<n>
yading@10 18536
yading@10 18537 sequential number of the input frame, starting from 0
yading@10 18538
yading@10 18539
yading@10 18540 =item B<pts>
yading@10 18541
yading@10 18542 Presentation TimeStamp of the input frame, expressed as a number of
yading@10 18543 time base units. The time base unit depends on the filter input pad.
yading@10 18544
yading@10 18545
yading@10 18546 =item B<pts_time>
yading@10 18547
yading@10 18548 Presentation TimeStamp of the input frame, expressed as a number of
yading@10 18549 seconds
yading@10 18550
yading@10 18551
yading@10 18552 =item B<pos>
yading@10 18553
yading@10 18554 position of the frame in the input stream, -1 if this information in
yading@10 18555 unavailable and/or meaningless (for example in case of synthetic video)
yading@10 18556
yading@10 18557
yading@10 18558 =item B<fmt>
yading@10 18559
yading@10 18560 pixel format name
yading@10 18561
yading@10 18562
yading@10 18563 =item B<sar>
yading@10 18564
yading@10 18565 sample aspect ratio of the input frame, expressed in the form
yading@10 18566 I<num>/I<den>
yading@10 18567
yading@10 18568
yading@10 18569 =item B<s>
yading@10 18570
yading@10 18571 size of the input frame, expressed in the form
yading@10 18572 I<width>xI<height>
yading@10 18573
yading@10 18574
yading@10 18575 =item B<i>
yading@10 18576
yading@10 18577 interlaced mode ("P" for "progressive", "T" for top field first, "B"
yading@10 18578 for bottom field first)
yading@10 18579
yading@10 18580
yading@10 18581 =item B<iskey>
yading@10 18582
yading@10 18583 1 if the frame is a key frame, 0 otherwise
yading@10 18584
yading@10 18585
yading@10 18586 =item B<type>
yading@10 18587
yading@10 18588 picture type of the input frame ("I" for an I-frame, "P" for a
yading@10 18589 P-frame, "B" for a B-frame, "?" for unknown type).
yading@10 18590 Check also the documentation of the C<AVPictureType> enum and of
yading@10 18591 the C<av_get_picture_type_char> function defined in
yading@10 18592 F<libavutil/avutil.h>.
yading@10 18593
yading@10 18594
yading@10 18595 =item B<checksum>
yading@10 18596
yading@10 18597 Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame
yading@10 18598
yading@10 18599
yading@10 18600 =item B<plane_checksum>
yading@10 18601
yading@10 18602 Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
yading@10 18603 expressed in the form "[I<c0> I<c1> I<c2> I<c3>]"
yading@10 18604
yading@10 18605 =back
yading@10 18606
yading@10 18607
yading@10 18608
yading@10 18609 =head2 smartblur
yading@10 18610
yading@10 18611
yading@10 18612 Blur the input video without impacting the outlines.
yading@10 18613
yading@10 18614 The filter accepts the following options:
yading@10 18615
yading@10 18616
yading@10 18617 =over 4
yading@10 18618
yading@10 18619
yading@10 18620 =item B<luma_radius, lr>
yading@10 18621
yading@10 18622 Set the luma radius. The option value must be a float number in
yading@10 18623 the range [0.1,5.0] that specifies the variance of the gaussian filter
yading@10 18624 used to blur the image (slower if larger). Default value is 1.0.
yading@10 18625
yading@10 18626
yading@10 18627 =item B<luma_strength, ls>
yading@10 18628
yading@10 18629 Set the luma strength. The option value must be a float number
yading@10 18630 in the range [-1.0,1.0] that configures the blurring. A value included
yading@10 18631 in [0.0,1.0] will blur the image whereas a value included in
yading@10 18632 [-1.0,0.0] will sharpen the image. Default value is 1.0.
yading@10 18633
yading@10 18634
yading@10 18635 =item B<luma_threshold, lt>
yading@10 18636
yading@10 18637 Set the luma threshold used as a coefficient to determine
yading@10 18638 whether a pixel should be blurred or not. The option value must be an
yading@10 18639 integer in the range [-30,30]. A value of 0 will filter all the image,
yading@10 18640 a value included in [0,30] will filter flat areas and a value included
yading@10 18641 in [-30,0] will filter edges. Default value is 0.
yading@10 18642
yading@10 18643
yading@10 18644 =item B<chroma_radius, cr>
yading@10 18645
yading@10 18646 Set the chroma radius. The option value must be a float number in
yading@10 18647 the range [0.1,5.0] that specifies the variance of the gaussian filter
yading@10 18648 used to blur the image (slower if larger). Default value is 1.0.
yading@10 18649
yading@10 18650
yading@10 18651 =item B<chroma_strength, cs>
yading@10 18652
yading@10 18653 Set the chroma strength. The option value must be a float number
yading@10 18654 in the range [-1.0,1.0] that configures the blurring. A value included
yading@10 18655 in [0.0,1.0] will blur the image whereas a value included in
yading@10 18656 [-1.0,0.0] will sharpen the image. Default value is 1.0.
yading@10 18657
yading@10 18658
yading@10 18659 =item B<chroma_threshold, ct>
yading@10 18660
yading@10 18661 Set the chroma threshold used as a coefficient to determine
yading@10 18662 whether a pixel should be blurred or not. The option value must be an
yading@10 18663 integer in the range [-30,30]. A value of 0 will filter all the image,
yading@10 18664 a value included in [0,30] will filter flat areas and a value included
yading@10 18665 in [-30,0] will filter edges. Default value is 0.
yading@10 18666
yading@10 18667 =back
yading@10 18668
yading@10 18669
yading@10 18670 If a chroma option is not explicitly set, the corresponding luma value
yading@10 18671 is set.
yading@10 18672
yading@10 18673
yading@10 18674 =head2 stereo3d
yading@10 18675
yading@10 18676
yading@10 18677 Convert between different stereoscopic image formats.
yading@10 18678
yading@10 18679 The filters accept the following options:
yading@10 18680
yading@10 18681
yading@10 18682 =over 4
yading@10 18683
yading@10 18684
yading@10 18685 =item B<in>
yading@10 18686
yading@10 18687 Set stereoscopic image format of input.
yading@10 18688
yading@10 18689 Available values for input image formats are:
yading@10 18690
yading@10 18691 =over 4
yading@10 18692
yading@10 18693
yading@10 18694 =item B<sbsl>
yading@10 18695
yading@10 18696 side by side parallel (left eye left, right eye right)
yading@10 18697
yading@10 18698
yading@10 18699 =item B<sbsr>
yading@10 18700
yading@10 18701 side by side crosseye (right eye left, left eye right)
yading@10 18702
yading@10 18703
yading@10 18704 =item B<sbs2l>
yading@10 18705
yading@10 18706 side by side parallel with half width resolution
yading@10 18707 (left eye left, right eye right)
yading@10 18708
yading@10 18709
yading@10 18710 =item B<sbs2r>
yading@10 18711
yading@10 18712 side by side crosseye with half width resolution
yading@10 18713 (right eye left, left eye right)
yading@10 18714
yading@10 18715
yading@10 18716 =item B<abl>
yading@10 18717
yading@10 18718 above-below (left eye above, right eye below)
yading@10 18719
yading@10 18720
yading@10 18721 =item B<abr>
yading@10 18722
yading@10 18723 above-below (right eye above, left eye below)
yading@10 18724
yading@10 18725
yading@10 18726 =item B<ab2l>
yading@10 18727
yading@10 18728 above-below with half height resolution
yading@10 18729 (left eye above, right eye below)
yading@10 18730
yading@10 18731
yading@10 18732 =item B<ab2r>
yading@10 18733
yading@10 18734 above-below with half height resolution
yading@10 18735 (right eye above, left eye below)
yading@10 18736
yading@10 18737 Default value is B<sbsl>.
yading@10 18738
yading@10 18739 =back
yading@10 18740
yading@10 18741
yading@10 18742
yading@10 18743 =item B<out>
yading@10 18744
yading@10 18745 Set stereoscopic image format of output.
yading@10 18746
yading@10 18747 Available values for output image formats are all the input formats as well as:
yading@10 18748
yading@10 18749 =over 4
yading@10 18750
yading@10 18751
yading@10 18752 =item B<arbg>
yading@10 18753
yading@10 18754 anaglyph red/blue gray
yading@10 18755 (red filter on left eye, blue filter on right eye)
yading@10 18756
yading@10 18757
yading@10 18758 =item B<argg>
yading@10 18759
yading@10 18760 anaglyph red/green gray
yading@10 18761 (red filter on left eye, green filter on right eye)
yading@10 18762
yading@10 18763
yading@10 18764 =item B<arcg>
yading@10 18765
yading@10 18766 anaglyph red/cyan gray
yading@10 18767 (red filter on left eye, cyan filter on right eye)
yading@10 18768
yading@10 18769
yading@10 18770 =item B<arch>
yading@10 18771
yading@10 18772 anaglyph red/cyan half colored
yading@10 18773 (red filter on left eye, cyan filter on right eye)
yading@10 18774
yading@10 18775
yading@10 18776 =item B<arcc>
yading@10 18777
yading@10 18778 anaglyph red/cyan color
yading@10 18779 (red filter on left eye, cyan filter on right eye)
yading@10 18780
yading@10 18781
yading@10 18782 =item B<arcd>
yading@10 18783
yading@10 18784 anaglyph red/cyan color optimized with the least squares projection of dubois
yading@10 18785 (red filter on left eye, cyan filter on right eye)
yading@10 18786
yading@10 18787
yading@10 18788 =item B<agmg>
yading@10 18789
yading@10 18790 anaglyph green/magenta gray
yading@10 18791 (green filter on left eye, magenta filter on right eye)
yading@10 18792
yading@10 18793
yading@10 18794 =item B<agmh>
yading@10 18795
yading@10 18796 anaglyph green/magenta half colored
yading@10 18797 (green filter on left eye, magenta filter on right eye)
yading@10 18798
yading@10 18799
yading@10 18800 =item B<agmc>
yading@10 18801
yading@10 18802 anaglyph green/magenta colored
yading@10 18803 (green filter on left eye, magenta filter on right eye)
yading@10 18804
yading@10 18805
yading@10 18806 =item B<agmd>
yading@10 18807
yading@10 18808 anaglyph green/magenta color optimized with the least squares projection of dubois
yading@10 18809 (green filter on left eye, magenta filter on right eye)
yading@10 18810
yading@10 18811
yading@10 18812 =item B<aybg>
yading@10 18813
yading@10 18814 anaglyph yellow/blue gray
yading@10 18815 (yellow filter on left eye, blue filter on right eye)
yading@10 18816
yading@10 18817
yading@10 18818 =item B<aybh>
yading@10 18819
yading@10 18820 anaglyph yellow/blue half colored
yading@10 18821 (yellow filter on left eye, blue filter on right eye)
yading@10 18822
yading@10 18823
yading@10 18824 =item B<aybc>
yading@10 18825
yading@10 18826 anaglyph yellow/blue colored
yading@10 18827 (yellow filter on left eye, blue filter on right eye)
yading@10 18828
yading@10 18829
yading@10 18830 =item B<aybd>
yading@10 18831
yading@10 18832 anaglyph yellow/blue color optimized with the least squares projection of dubois
yading@10 18833 (yellow filter on left eye, blue filter on right eye)
yading@10 18834
yading@10 18835
yading@10 18836 =item B<irl>
yading@10 18837
yading@10 18838 interleaved rows (left eye has top row, right eye starts on next row)
yading@10 18839
yading@10 18840
yading@10 18841 =item B<irr>
yading@10 18842
yading@10 18843 interleaved rows (right eye has top row, left eye starts on next row)
yading@10 18844
yading@10 18845
yading@10 18846 =item B<ml>
yading@10 18847
yading@10 18848 mono output (left eye only)
yading@10 18849
yading@10 18850
yading@10 18851 =item B<mr>
yading@10 18852
yading@10 18853 mono output (right eye only)
yading@10 18854
yading@10 18855 =back
yading@10 18856
yading@10 18857
yading@10 18858 Default value is B<arcd>.
yading@10 18859
yading@10 18860 =back
yading@10 18861
yading@10 18862
yading@10 18863
yading@10 18864
yading@10 18865 =head2 subtitles
yading@10 18866
yading@10 18867
yading@10 18868 Draw subtitles on top of input video using the libass library.
yading@10 18869
yading@10 18870 To enable compilation of this filter you need to configure FFmpeg with
yading@10 18871 C<--enable-libass>. This filter also requires a build with libavcodec and
yading@10 18872 libavformat to convert the passed subtitles file to ASS (Advanced Substation
yading@10 18873 Alpha) subtitles format.
yading@10 18874
yading@10 18875 The filter accepts the following options:
yading@10 18876
yading@10 18877
yading@10 18878 =over 4
yading@10 18879
yading@10 18880
yading@10 18881 =item B<filename, f>
yading@10 18882
yading@10 18883 Set the filename of the subtitle file to read. It must be specified.
yading@10 18884
yading@10 18885
yading@10 18886 =item B<original_size>
yading@10 18887
yading@10 18888 Specify the size of the original video, the video for which the ASS file
yading@10 18889 was composed. Due to a misdesign in ASS aspect ratio arithmetic, this is
yading@10 18890 necessary to correctly scale the fonts if the aspect ratio has been changed.
yading@10 18891
yading@10 18892
yading@10 18893 =item B<charenc>
yading@10 18894
yading@10 18895 Set subtitles input character encoding. C<subtitles> filter only. Only
yading@10 18896 useful if not UTF-8.
yading@10 18897
yading@10 18898 =back
yading@10 18899
yading@10 18900
yading@10 18901 If the first key is not specified, it is assumed that the first value
yading@10 18902 specifies the B<filename>.
yading@10 18903
yading@10 18904 For example, to render the file F<sub.srt> on top of the input
yading@10 18905 video, use the command:
yading@10 18906
yading@10 18907 subtitles=sub.srt
yading@10 18908
yading@10 18909
yading@10 18910 which is equivalent to:
yading@10 18911
yading@10 18912 subtitles=filename=sub.srt
yading@10 18913
yading@10 18914
yading@10 18915
yading@10 18916 =head2 super2xsai
yading@10 18917
yading@10 18918
yading@10 18919 Scale the input by 2x and smooth using the Super2xSaI (Scale and
yading@10 18920 Interpolate) pixel art scaling algorithm.
yading@10 18921
yading@10 18922 Useful for enlarging pixel art images without reducing sharpness.
yading@10 18923
yading@10 18924
yading@10 18925 =head2 swapuv
yading@10 18926
yading@10 18927 Swap U & V plane.
yading@10 18928
yading@10 18929
yading@10 18930 =head2 telecine
yading@10 18931
yading@10 18932
yading@10 18933 Apply telecine process to the video.
yading@10 18934
yading@10 18935 This filter accepts the following options:
yading@10 18936
yading@10 18937
yading@10 18938 =over 4
yading@10 18939
yading@10 18940
yading@10 18941 =item B<first_field>
yading@10 18942
yading@10 18943
yading@10 18944 =over 4
yading@10 18945
yading@10 18946
yading@10 18947 =item B<top, t>
yading@10 18948
yading@10 18949 top field first
yading@10 18950
yading@10 18951 =item B<bottom, b>
yading@10 18952
yading@10 18953 bottom field first
yading@10 18954 The default value is C<top>.
yading@10 18955
yading@10 18956 =back
yading@10 18957
yading@10 18958
yading@10 18959
yading@10 18960 =item B<pattern>
yading@10 18961
yading@10 18962 A string of numbers representing the pulldown pattern you wish to apply.
yading@10 18963 The default value is C<23>.
yading@10 18964
yading@10 18965 =back
yading@10 18966
yading@10 18967
yading@10 18968
yading@10 18969 Some typical patterns:
yading@10 18970
yading@10 18971 NTSC output (30i):
yading@10 18972 27.5p: 32222
yading@10 18973 24p: 23 (classic)
yading@10 18974 24p: 2332 (preferred)
yading@10 18975 20p: 33
yading@10 18976 18p: 334
yading@10 18977 16p: 3444
yading@10 18978
yading@10 18979 PAL output (25i):
yading@10 18980 27.5p: 12222
yading@10 18981 24p: 222222222223 ("Euro pulldown")
yading@10 18982 16.67p: 33
yading@10 18983 16p: 33333334
yading@10 18984
yading@10 18985
yading@10 18986
yading@10 18987 =head2 thumbnail
yading@10 18988
yading@10 18989 Select the most representative frame in a given sequence of consecutive frames.
yading@10 18990
yading@10 18991 The filter accepts the following options:
yading@10 18992
yading@10 18993
yading@10 18994 =over 4
yading@10 18995
yading@10 18996
yading@10 18997 =item B<n>
yading@10 18998
yading@10 18999 Set the frames batch size to analyze; in a set of I<n> frames, the filter
yading@10 19000 will pick one of them, and then handle the next batch of I<n> frames until
yading@10 19001 the end. Default is C<100>.
yading@10 19002
yading@10 19003 =back
yading@10 19004
yading@10 19005
yading@10 19006 Since the filter keeps track of the whole frames sequence, a bigger I<n>
yading@10 19007 value will result in a higher memory usage, so a high value is not recommended.
yading@10 19008
yading@10 19009
yading@10 19010 =head3 Examples
yading@10 19011
yading@10 19012
yading@10 19013
yading@10 19014 =over 4
yading@10 19015
yading@10 19016
yading@10 19017 =item *
yading@10 19018
yading@10 19019 Extract one picture each 50 frames:
yading@10 19020
yading@10 19021 thumbnail=50
yading@10 19022
yading@10 19023
yading@10 19024
yading@10 19025 =item *
yading@10 19026
yading@10 19027 Complete example of a thumbnail creation with B<ffmpeg>:
yading@10 19028
yading@10 19029 ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
yading@10 19030
yading@10 19031
yading@10 19032 =back
yading@10 19033
yading@10 19034
yading@10 19035
yading@10 19036 =head2 tile
yading@10 19037
yading@10 19038
yading@10 19039 Tile several successive frames together.
yading@10 19040
yading@10 19041 The filter accepts the following options:
yading@10 19042
yading@10 19043
yading@10 19044 =over 4
yading@10 19045
yading@10 19046
yading@10 19047
yading@10 19048 =item B<layout>
yading@10 19049
yading@10 19050 Set the grid size (i.e. the number of lines and columns) in the form
yading@10 19051 "I<w>xI<h>".
yading@10 19052
yading@10 19053
yading@10 19054 =item B<nb_frames>
yading@10 19055
yading@10 19056 Set the maximum number of frames to render in the given area. It must be less
yading@10 19057 than or equal to I<w>xI<h>. The default value is C<0>, meaning all
yading@10 19058 the area will be used.
yading@10 19059
yading@10 19060
yading@10 19061 =item B<margin>
yading@10 19062
yading@10 19063 Set the outer border margin in pixels.
yading@10 19064
yading@10 19065
yading@10 19066 =item B<padding>
yading@10 19067
yading@10 19068 Set the inner border thickness (i.e. the number of pixels between frames). For
yading@10 19069 more advanced padding options (such as having different values for the edges),
yading@10 19070 refer to the pad video filter.
yading@10 19071
yading@10 19072
yading@10 19073 =back
yading@10 19074
yading@10 19075
yading@10 19076
yading@10 19077 =head3 Examples
yading@10 19078
yading@10 19079
yading@10 19080
yading@10 19081 =over 4
yading@10 19082
yading@10 19083
yading@10 19084 =item *
yading@10 19085
yading@10 19086 Produce 8x8 PNG tiles of all keyframes (B<-skip_frame nokey>) in a movie:
yading@10 19087
yading@10 19088 ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
yading@10 19089
yading@10 19090 The B<-vsync 0> is necessary to prevent B<ffmpeg> from
yading@10 19091 duplicating each output frame to accomodate the originally detected frame
yading@10 19092 rate.
yading@10 19093
yading@10 19094
yading@10 19095 =item *
yading@10 19096
yading@10 19097 Display C<5> pictures in an area of C<3x2> frames,
yading@10 19098 with C<7> pixels between them, and C<2> pixels of initial margin, using
yading@10 19099 mixed flat and named options:
yading@10 19100
yading@10 19101 tile=3x2:nb_frames=5:padding=7:margin=2
yading@10 19102
yading@10 19103
yading@10 19104 =back
yading@10 19105
yading@10 19106
yading@10 19107
yading@10 19108 =head2 tinterlace
yading@10 19109
yading@10 19110
yading@10 19111 Perform various types of temporal field interlacing.
yading@10 19112
yading@10 19113 Frames are counted starting from 1, so the first input frame is
yading@10 19114 considered odd.
yading@10 19115
yading@10 19116 The filter accepts the following options:
yading@10 19117
yading@10 19118
yading@10 19119 =over 4
yading@10 19120
yading@10 19121
yading@10 19122
yading@10 19123 =item B<mode>
yading@10 19124
yading@10 19125 Specify the mode of the interlacing. This option can also be specified
yading@10 19126 as a value alone. See below for a list of values for this option.
yading@10 19127
yading@10 19128 Available values are:
yading@10 19129
yading@10 19130
yading@10 19131 =over 4
yading@10 19132
yading@10 19133
yading@10 19134 =item B<merge, 0>
yading@10 19135
yading@10 19136 Move odd frames into the upper field, even into the lower field,
yading@10 19137 generating a double height frame at half frame rate.
yading@10 19138
yading@10 19139
yading@10 19140 =item B<drop_odd, 1>
yading@10 19141
yading@10 19142 Only output even frames, odd frames are dropped, generating a frame with
yading@10 19143 unchanged height at half frame rate.
yading@10 19144
yading@10 19145
yading@10 19146 =item B<drop_even, 2>
yading@10 19147
yading@10 19148 Only output odd frames, even frames are dropped, generating a frame with
yading@10 19149 unchanged height at half frame rate.
yading@10 19150
yading@10 19151
yading@10 19152 =item B<pad, 3>
yading@10 19153
yading@10 19154 Expand each frame to full height, but pad alternate lines with black,
yading@10 19155 generating a frame with double height at the same input frame rate.
yading@10 19156
yading@10 19157
yading@10 19158 =item B<interleave_top, 4>
yading@10 19159
yading@10 19160 Interleave the upper field from odd frames with the lower field from
yading@10 19161 even frames, generating a frame with unchanged height at half frame rate.
yading@10 19162
yading@10 19163
yading@10 19164 =item B<interleave_bottom, 5>
yading@10 19165
yading@10 19166 Interleave the lower field from odd frames with the upper field from
yading@10 19167 even frames, generating a frame with unchanged height at half frame rate.
yading@10 19168
yading@10 19169
yading@10 19170 =item B<interlacex2, 6>
yading@10 19171
yading@10 19172 Double frame rate with unchanged height. Frames are inserted each
yading@10 19173 containing the second temporal field from the previous input frame and
yading@10 19174 the first temporal field from the next input frame. This mode relies on
yading@10 19175 the top_field_first flag. Useful for interlaced video displays with no
yading@10 19176 field synchronisation.
yading@10 19177
yading@10 19178 =back
yading@10 19179
yading@10 19180
yading@10 19181 Numeric values are deprecated but are accepted for backward
yading@10 19182 compatibility reasons.
yading@10 19183
yading@10 19184 Default mode is C<merge>.
yading@10 19185
yading@10 19186
yading@10 19187 =item B<flags>
yading@10 19188
yading@10 19189 Specify flags influencing the filter process.
yading@10 19190
yading@10 19191 Available value for I<flags> is:
yading@10 19192
yading@10 19193
yading@10 19194 =over 4
yading@10 19195
yading@10 19196
yading@10 19197 =item B<low_pass_filter, vlfp>
yading@10 19198
yading@10 19199 Enable vertical low-pass filtering in the filter.
yading@10 19200 Vertical low-pass filtering is required when creating an interlaced
yading@10 19201 destination from a progressive source which contains high-frequency
yading@10 19202 vertical detail. Filtering will reduce interlace 'twitter' and Moire
yading@10 19203 patterning.
yading@10 19204
yading@10 19205 Vertical low-pass filtering can only be enabled for B<mode>
yading@10 19206 I<interleave_top> and I<interleave_bottom>.
yading@10 19207
yading@10 19208
yading@10 19209 =back
yading@10 19210
yading@10 19211
yading@10 19212 =back
yading@10 19213
yading@10 19214
yading@10 19215
yading@10 19216 =head2 transpose
yading@10 19217
yading@10 19218
yading@10 19219 Transpose rows with columns in the input video and optionally flip it.
yading@10 19220
yading@10 19221 This filter accepts the following options:
yading@10 19222
yading@10 19223
yading@10 19224 =over 4
yading@10 19225
yading@10 19226
yading@10 19227
yading@10 19228 =item B<dir>
yading@10 19229
yading@10 19230 The direction of the transpose.
yading@10 19231
yading@10 19232
yading@10 19233 =over 4
yading@10 19234
yading@10 19235
yading@10 19236 =item B<0, 4, cclock_flip>
yading@10 19237
yading@10 19238 Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
yading@10 19239
yading@10 19240 L.R L.l
yading@10 19241 . . -> . .
yading@10 19242 l.r R.r
yading@10 19243
yading@10 19244
yading@10 19245
yading@10 19246 =item B<1, 5, clock>
yading@10 19247
yading@10 19248 Rotate by 90 degrees clockwise, that is:
yading@10 19249
yading@10 19250 L.R l.L
yading@10 19251 . . -> . .
yading@10 19252 l.r r.R
yading@10 19253
yading@10 19254
yading@10 19255
yading@10 19256 =item B<2, 6, cclock>
yading@10 19257
yading@10 19258 Rotate by 90 degrees counterclockwise, that is:
yading@10 19259
yading@10 19260 L.R R.r
yading@10 19261 . . -> . .
yading@10 19262 l.r L.l
yading@10 19263
yading@10 19264
yading@10 19265
yading@10 19266 =item B<3, 7, clock_flip>
yading@10 19267
yading@10 19268 Rotate by 90 degrees clockwise and vertically flip, that is:
yading@10 19269
yading@10 19270 L.R r.R
yading@10 19271 . . -> . .
yading@10 19272 l.r l.L
yading@10 19273
yading@10 19274
yading@10 19275 =back
yading@10 19276
yading@10 19277
yading@10 19278 For values between 4-7, the transposition is only done if the input
yading@10 19279 video geometry is portrait and not landscape. These values are
yading@10 19280 deprecated, the C<passthrough> option should be used instead.
yading@10 19281
yading@10 19282
yading@10 19283 =item B<passthrough>
yading@10 19284
yading@10 19285 Do not apply the transposition if the input geometry matches the one
yading@10 19286 specified by the specified value. It accepts the following values:
yading@10 19287
yading@10 19288 =over 4
yading@10 19289
yading@10 19290
yading@10 19291 =item B<none>
yading@10 19292
yading@10 19293 Always apply transposition.
yading@10 19294
yading@10 19295 =item B<portrait>
yading@10 19296
yading@10 19297 Preserve portrait geometry (when I<height> E<gt>= I<width>).
yading@10 19298
yading@10 19299 =item B<landscape>
yading@10 19300
yading@10 19301 Preserve landscape geometry (when I<width> E<gt>= I<height>).
yading@10 19302
yading@10 19303 =back
yading@10 19304
yading@10 19305
yading@10 19306 Default value is C<none>.
yading@10 19307
yading@10 19308 =back
yading@10 19309
yading@10 19310
yading@10 19311 For example to rotate by 90 degrees clockwise and preserve portrait
yading@10 19312 layout:
yading@10 19313
yading@10 19314 transpose=dir=1:passthrough=portrait
yading@10 19315
yading@10 19316
yading@10 19317 The command above can also be specified as:
yading@10 19318
yading@10 19319 transpose=1:portrait
yading@10 19320
yading@10 19321
yading@10 19322
yading@10 19323 =head2 unsharp
yading@10 19324
yading@10 19325
yading@10 19326 Sharpen or blur the input video.
yading@10 19327
yading@10 19328 It accepts the following parameters:
yading@10 19329
yading@10 19330
yading@10 19331 =over 4
yading@10 19332
yading@10 19333
yading@10 19334 =item B<luma_msize_x, lx>
yading@10 19335
yading@10 19336
yading@10 19337 =item B<chroma_msize_x, cx>
yading@10 19338
yading@10 19339 Set the luma/chroma matrix horizontal size. It must be an odd integer
yading@10 19340 between 3 and 63, default value is 5.
yading@10 19341
yading@10 19342
yading@10 19343 =item B<luma_msize_y, ly>
yading@10 19344
yading@10 19345
yading@10 19346 =item B<chroma_msize_y, cy>
yading@10 19347
yading@10 19348 Set the luma/chroma matrix vertical size. It must be an odd integer
yading@10 19349 between 3 and 63, default value is 5.
yading@10 19350
yading@10 19351
yading@10 19352 =item B<luma_amount, la>
yading@10 19353
yading@10 19354
yading@10 19355 =item B<chroma_amount, ca>
yading@10 19356
yading@10 19357 Set the luma/chroma effect strength. It can be a float number,
yading@10 19358 reasonable values lay between -1.5 and 1.5.
yading@10 19359
yading@10 19360 Negative values will blur the input video, while positive values will
yading@10 19361 sharpen it, a value of zero will disable the effect.
yading@10 19362
yading@10 19363 Default value is 1.0 for B<luma_amount>, 0.0 for
yading@10 19364 B<chroma_amount>.
yading@10 19365
yading@10 19366 =back
yading@10 19367
yading@10 19368
yading@10 19369 All parameters are optional and default to the
yading@10 19370 equivalent of the string '5:5:1.0:5:5:0.0'.
yading@10 19371
yading@10 19372
yading@10 19373 =head3 Examples
yading@10 19374
yading@10 19375
yading@10 19376
yading@10 19377 =over 4
yading@10 19378
yading@10 19379
yading@10 19380 =item *
yading@10 19381
yading@10 19382 Apply strong luma sharpen effect:
yading@10 19383
yading@10 19384 unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
yading@10 19385
yading@10 19386
yading@10 19387
yading@10 19388 =item *
yading@10 19389
yading@10 19390 Apply strong blur of both luma and chroma parameters:
yading@10 19391
yading@10 19392 unsharp=7:7:-2:7:7:-2
yading@10 19393
yading@10 19394
yading@10 19395 =back
yading@10 19396
yading@10 19397
yading@10 19398
yading@10 19399 =head2 vflip
yading@10 19400
yading@10 19401
yading@10 19402 Flip the input video vertically.
yading@10 19403
yading@10 19404
yading@10 19405 ffmpeg -i in.avi -vf "vflip" out.avi
yading@10 19406
yading@10 19407
yading@10 19408
yading@10 19409
yading@10 19410 =head2 yadif
yading@10 19411
yading@10 19412
yading@10 19413 Deinterlace the input video ("yadif" means "yet another deinterlacing
yading@10 19414 filter").
yading@10 19415
yading@10 19416 This filter accepts the following options:
yading@10 19417
yading@10 19418
yading@10 19419
yading@10 19420 =over 4
yading@10 19421
yading@10 19422
yading@10 19423
yading@10 19424 =item B<mode>
yading@10 19425
yading@10 19426 The interlacing mode to adopt, accepts one of the following values:
yading@10 19427
yading@10 19428
yading@10 19429 =over 4
yading@10 19430
yading@10 19431
yading@10 19432 =item B<0, send_frame>
yading@10 19433
yading@10 19434 output 1 frame for each frame
yading@10 19435
yading@10 19436 =item B<1, send_field>
yading@10 19437
yading@10 19438 output 1 frame for each field
yading@10 19439
yading@10 19440 =item B<2, send_frame_nospatial>
yading@10 19441
yading@10 19442 like C<send_frame> but skip spatial interlacing check
yading@10 19443
yading@10 19444 =item B<3, send_field_nospatial>
yading@10 19445
yading@10 19446 like C<send_field> but skip spatial interlacing check
yading@10 19447
yading@10 19448 =back
yading@10 19449
yading@10 19450
yading@10 19451 Default value is C<send_frame>.
yading@10 19452
yading@10 19453
yading@10 19454 =item B<parity>
yading@10 19455
yading@10 19456 The picture field parity assumed for the input interlaced video, accepts one of
yading@10 19457 the following values:
yading@10 19458
yading@10 19459
yading@10 19460 =over 4
yading@10 19461
yading@10 19462
yading@10 19463 =item B<0, tff>
yading@10 19464
yading@10 19465 assume top field first
yading@10 19466
yading@10 19467 =item B<1, bff>
yading@10 19468
yading@10 19469 assume bottom field first
yading@10 19470
yading@10 19471 =item B<-1, auto>
yading@10 19472
yading@10 19473 enable automatic detection
yading@10 19474
yading@10 19475 =back
yading@10 19476
yading@10 19477
yading@10 19478 Default value is C<auto>.
yading@10 19479 If interlacing is unknown or decoder does not export this information,
yading@10 19480 top field first will be assumed.
yading@10 19481
yading@10 19482
yading@10 19483 =item B<deint>
yading@10 19484
yading@10 19485 Specify which frames to deinterlace. Accept one of the following
yading@10 19486 values:
yading@10 19487
yading@10 19488
yading@10 19489 =over 4
yading@10 19490
yading@10 19491
yading@10 19492 =item B<0, all>
yading@10 19493
yading@10 19494 deinterlace all frames
yading@10 19495
yading@10 19496 =item B<1, interlaced>
yading@10 19497
yading@10 19498 only deinterlace frames marked as interlaced
yading@10 19499
yading@10 19500 =back
yading@10 19501
yading@10 19502
yading@10 19503 Default value is C<all>.
yading@10 19504
yading@10 19505 =back
yading@10 19506
yading@10 19507
yading@10 19508
yading@10 19509
yading@10 19510 =head1 VIDEO SOURCES
yading@10 19511
yading@10 19512
yading@10 19513 Below is a description of the currently available video sources.
yading@10 19514
yading@10 19515
yading@10 19516 =head2 buffer
yading@10 19517
yading@10 19518
yading@10 19519 Buffer video frames, and make them available to the filter chain.
yading@10 19520
yading@10 19521 This source is mainly intended for a programmatic use, in particular
yading@10 19522 through the interface defined in F<libavfilter/vsrc_buffer.h>.
yading@10 19523
yading@10 19524 This source accepts the following options:
yading@10 19525
yading@10 19526
yading@10 19527 =over 4
yading@10 19528
yading@10 19529
yading@10 19530
yading@10 19531 =item B<video_size>
yading@10 19532
yading@10 19533 Specify the size (width and height) of the buffered video frames.
yading@10 19534
yading@10 19535
yading@10 19536 =item B<width>
yading@10 19537
yading@10 19538 Input video width.
yading@10 19539
yading@10 19540
yading@10 19541 =item B<height>
yading@10 19542
yading@10 19543 Input video height.
yading@10 19544
yading@10 19545
yading@10 19546 =item B<pix_fmt>
yading@10 19547
yading@10 19548 A string representing the pixel format of the buffered video frames.
yading@10 19549 It may be a number corresponding to a pixel format, or a pixel format
yading@10 19550 name.
yading@10 19551
yading@10 19552
yading@10 19553 =item B<time_base>
yading@10 19554
yading@10 19555 Specify the timebase assumed by the timestamps of the buffered frames.
yading@10 19556
yading@10 19557
yading@10 19558 =item B<frame_rate>
yading@10 19559
yading@10 19560 Specify the frame rate expected for the video stream.
yading@10 19561
yading@10 19562
yading@10 19563 =item B<pixel_aspect, sar>
yading@10 19564
yading@10 19565 Specify the sample aspect ratio assumed by the video frames.
yading@10 19566
yading@10 19567
yading@10 19568 =item B<sws_param>
yading@10 19569
yading@10 19570 Specify the optional parameters to be used for the scale filter which
yading@10 19571 is automatically inserted when an input change is detected in the
yading@10 19572 input size or format.
yading@10 19573
yading@10 19574 =back
yading@10 19575
yading@10 19576
yading@10 19577 For example:
yading@10 19578
yading@10 19579 buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
yading@10 19580
yading@10 19581
yading@10 19582 will instruct the source to accept video frames with size 320x240 and
yading@10 19583 with format "yuv410p", assuming 1/24 as the timestamps timebase and
yading@10 19584 square pixels (1:1 sample aspect ratio).
yading@10 19585 Since the pixel format with name "yuv410p" corresponds to the number 6
yading@10 19586 (check the enum AVPixelFormat definition in F<libavutil/pixfmt.h>),
yading@10 19587 this example corresponds to:
yading@10 19588
yading@10 19589 buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
yading@10 19590
yading@10 19591
yading@10 19592 Alternatively, the options can be specified as a flat string, but this
yading@10 19593 syntax is deprecated:
yading@10 19594
yading@10 19595 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 19596
yading@10 19597
yading@10 19598 =head2 cellauto
yading@10 19599
yading@10 19600
yading@10 19601 Create a pattern generated by an elementary cellular automaton.
yading@10 19602
yading@10 19603 The initial state of the cellular automaton can be defined through the
yading@10 19604 B<filename>, and B<pattern> options. If such options are
yading@10 19605 not specified an initial state is created randomly.
yading@10 19606
yading@10 19607 At each new frame a new row in the video is filled with the result of
yading@10 19608 the cellular automaton next generation. The behavior when the whole
yading@10 19609 frame is filled is defined by the B<scroll> option.
yading@10 19610
yading@10 19611 This source accepts the following options:
yading@10 19612
yading@10 19613
yading@10 19614 =over 4
yading@10 19615
yading@10 19616
yading@10 19617 =item B<filename, f>
yading@10 19618
yading@10 19619 Read the initial cellular automaton state, i.e. the starting row, from
yading@10 19620 the specified file.
yading@10 19621 In the file, each non-whitespace character is considered an alive
yading@10 19622 cell, a newline will terminate the row, and further characters in the
yading@10 19623 file will be ignored.
yading@10 19624
yading@10 19625
yading@10 19626 =item B<pattern, p>
yading@10 19627
yading@10 19628 Read the initial cellular automaton state, i.e. the starting row, from
yading@10 19629 the specified string.
yading@10 19630
yading@10 19631 Each non-whitespace character in the string is considered an alive
yading@10 19632 cell, a newline will terminate the row, and further characters in the
yading@10 19633 string will be ignored.
yading@10 19634
yading@10 19635
yading@10 19636 =item B<rate, r>
yading@10 19637
yading@10 19638 Set the video rate, that is the number of frames generated per second.
yading@10 19639 Default is 25.
yading@10 19640
yading@10 19641
yading@10 19642 =item B<random_fill_ratio, ratio>
yading@10 19643
yading@10 19644 Set the random fill ratio for the initial cellular automaton row. It
yading@10 19645 is a floating point number value ranging from 0 to 1, defaults to
yading@10 19646 1/PHI.
yading@10 19647
yading@10 19648 This option is ignored when a file or a pattern is specified.
yading@10 19649
yading@10 19650
yading@10 19651 =item B<random_seed, seed>
yading@10 19652
yading@10 19653 Set the seed for filling randomly the initial row, must be an integer
yading@10 19654 included between 0 and UINT32_MAX. If not specified, or if explicitly
yading@10 19655 set to -1, the filter will try to use a good random seed on a best
yading@10 19656 effort basis.
yading@10 19657
yading@10 19658
yading@10 19659 =item B<rule>
yading@10 19660
yading@10 19661 Set the cellular automaton rule, it is a number ranging from 0 to 255.
yading@10 19662 Default value is 110.
yading@10 19663
yading@10 19664
yading@10 19665 =item B<size, s>
yading@10 19666
yading@10 19667 Set the size of the output video.
yading@10 19668
yading@10 19669 If B<filename> or B<pattern> is specified, the size is set
yading@10 19670 by default to the width of the specified initial state row, and the
yading@10 19671 height is set to I<width> * PHI.
yading@10 19672
yading@10 19673 If B<size> is set, it must contain the width of the specified
yading@10 19674 pattern string, and the specified pattern will be centered in the
yading@10 19675 larger row.
yading@10 19676
yading@10 19677 If a filename or a pattern string is not specified, the size value
yading@10 19678 defaults to "320x518" (used for a randomly generated initial state).
yading@10 19679
yading@10 19680
yading@10 19681 =item B<scroll>
yading@10 19682
yading@10 19683 If set to 1, scroll the output upward when all the rows in the output
yading@10 19684 have been already filled. If set to 0, the new generated row will be
yading@10 19685 written over the top row just after the bottom row is filled.
yading@10 19686 Defaults to 1.
yading@10 19687
yading@10 19688
yading@10 19689 =item B<start_full, full>
yading@10 19690
yading@10 19691 If set to 1, completely fill the output with generated rows before
yading@10 19692 outputting the first frame.
yading@10 19693 This is the default behavior, for disabling set the value to 0.
yading@10 19694
yading@10 19695
yading@10 19696 =item B<stitch>
yading@10 19697
yading@10 19698 If set to 1, stitch the left and right row edges together.
yading@10 19699 This is the default behavior, for disabling set the value to 0.
yading@10 19700
yading@10 19701 =back
yading@10 19702
yading@10 19703
yading@10 19704
yading@10 19705 =head3 Examples
yading@10 19706
yading@10 19707
yading@10 19708
yading@10 19709 =over 4
yading@10 19710
yading@10 19711
yading@10 19712 =item *
yading@10 19713
yading@10 19714 Read the initial state from F<pattern>, and specify an output of
yading@10 19715 size 200x400.
yading@10 19716
yading@10 19717 cellauto=f=pattern:s=200x400
yading@10 19718
yading@10 19719
yading@10 19720
yading@10 19721 =item *
yading@10 19722
yading@10 19723 Generate a random initial row with a width of 200 cells, with a fill
yading@10 19724 ratio of 2/3:
yading@10 19725
yading@10 19726 cellauto=ratio=2/3:s=200x200
yading@10 19727
yading@10 19728
yading@10 19729
yading@10 19730 =item *
yading@10 19731
yading@10 19732 Create a pattern generated by rule 18 starting by a single alive cell
yading@10 19733 centered on an initial row with width 100:
yading@10 19734
yading@10 19735 cellauto=p=@s=100x400:full=0:rule=18
yading@10 19736
yading@10 19737
yading@10 19738
yading@10 19739 =item *
yading@10 19740
yading@10 19741 Specify a more elaborated initial pattern:
yading@10 19742
yading@10 19743 cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
yading@10 19744
yading@10 19745
yading@10 19746
yading@10 19747 =back
yading@10 19748
yading@10 19749
yading@10 19750
yading@10 19751 =head2 mandelbrot
yading@10 19752
yading@10 19753
yading@10 19754 Generate a Mandelbrot set fractal, and progressively zoom towards the
yading@10 19755 point specified with I<start_x> and I<start_y>.
yading@10 19756
yading@10 19757 This source accepts the following options:
yading@10 19758
yading@10 19759
yading@10 19760 =over 4
yading@10 19761
yading@10 19762
yading@10 19763
yading@10 19764 =item B<end_pts>
yading@10 19765
yading@10 19766 Set the terminal pts value. Default value is 400.
yading@10 19767
yading@10 19768
yading@10 19769 =item B<end_scale>
yading@10 19770
yading@10 19771 Set the terminal scale value.
yading@10 19772 Must be a floating point value. Default value is 0.3.
yading@10 19773
yading@10 19774
yading@10 19775 =item B<inner>
yading@10 19776
yading@10 19777 Set the inner coloring mode, that is the algorithm used to draw the
yading@10 19778 Mandelbrot fractal internal region.
yading@10 19779
yading@10 19780 It shall assume one of the following values:
yading@10 19781
yading@10 19782 =over 4
yading@10 19783
yading@10 19784
yading@10 19785 =item B<black>
yading@10 19786
yading@10 19787 Set black mode.
yading@10 19788
yading@10 19789 =item B<convergence>
yading@10 19790
yading@10 19791 Show time until convergence.
yading@10 19792
yading@10 19793 =item B<mincol>
yading@10 19794
yading@10 19795 Set color based on point closest to the origin of the iterations.
yading@10 19796
yading@10 19797 =item B<period>
yading@10 19798
yading@10 19799 Set period mode.
yading@10 19800
yading@10 19801 =back
yading@10 19802
yading@10 19803
yading@10 19804 Default value is I<mincol>.
yading@10 19805
yading@10 19806
yading@10 19807 =item B<bailout>
yading@10 19808
yading@10 19809 Set the bailout value. Default value is 10.0.
yading@10 19810
yading@10 19811
yading@10 19812 =item B<maxiter>
yading@10 19813
yading@10 19814 Set the maximum of iterations performed by the rendering
yading@10 19815 algorithm. Default value is 7189.
yading@10 19816
yading@10 19817
yading@10 19818 =item B<outer>
yading@10 19819
yading@10 19820 Set outer coloring mode.
yading@10 19821 It shall assume one of following values:
yading@10 19822
yading@10 19823 =over 4
yading@10 19824
yading@10 19825
yading@10 19826 =item B<iteration_count>
yading@10 19827
yading@10 19828 Set iteration cound mode.
yading@10 19829
yading@10 19830 =item B<normalized_iteration_count>
yading@10 19831
yading@10 19832 set normalized iteration count mode.
yading@10 19833
yading@10 19834 =back
yading@10 19835
yading@10 19836 Default value is I<normalized_iteration_count>.
yading@10 19837
yading@10 19838
yading@10 19839 =item B<rate, r>
yading@10 19840
yading@10 19841 Set frame rate, expressed as number of frames per second. Default
yading@10 19842 value is "25".
yading@10 19843
yading@10 19844
yading@10 19845 =item B<size, s>
yading@10 19846
yading@10 19847 Set frame size. Default value is "640x480".
yading@10 19848
yading@10 19849
yading@10 19850 =item B<start_scale>
yading@10 19851
yading@10 19852 Set the initial scale value. Default value is 3.0.
yading@10 19853
yading@10 19854
yading@10 19855 =item B<start_x>
yading@10 19856
yading@10 19857 Set the initial x position. Must be a floating point value between
yading@10 19858 -100 and 100. Default value is -0.743643887037158704752191506114774.
yading@10 19859
yading@10 19860
yading@10 19861 =item B<start_y>
yading@10 19862
yading@10 19863 Set the initial y position. Must be a floating point value between
yading@10 19864 -100 and 100. Default value is -0.131825904205311970493132056385139.
yading@10 19865
yading@10 19866 =back
yading@10 19867
yading@10 19868
yading@10 19869
yading@10 19870 =head2 mptestsrc
yading@10 19871
yading@10 19872
yading@10 19873 Generate various test patterns, as generated by the MPlayer test filter.
yading@10 19874
yading@10 19875 The size of the generated video is fixed, and is 256x256.
yading@10 19876 This source is useful in particular for testing encoding features.
yading@10 19877
yading@10 19878 This source accepts the following options:
yading@10 19879
yading@10 19880
yading@10 19881 =over 4
yading@10 19882
yading@10 19883
yading@10 19884
yading@10 19885 =item B<rate, r>
yading@10 19886
yading@10 19887 Specify the frame rate of the sourced video, as the number of frames
yading@10 19888 generated per second. It has to be a string in the format
yading@10 19889 I<frame_rate_num>/I<frame_rate_den>, an integer number, a float
yading@10 19890 number or a valid video frame rate abbreviation. The default value is
yading@10 19891 "25".
yading@10 19892
yading@10 19893
yading@10 19894 =item B<duration, d>
yading@10 19895
yading@10 19896 Set the video duration of the sourced video. The accepted syntax is:
yading@10 19897
yading@10 19898 [-]HH:MM:SS[.m...]
yading@10 19899 [-]S+[.m...]
yading@10 19900
yading@10 19901 See also the function C<av_parse_time()>.
yading@10 19902
yading@10 19903 If not specified, or the expressed duration is negative, the video is
yading@10 19904 supposed to be generated forever.
yading@10 19905
yading@10 19906
yading@10 19907 =item B<test, t>
yading@10 19908
yading@10 19909
yading@10 19910 Set the number or the name of the test to perform. Supported tests are:
yading@10 19911
yading@10 19912 =over 4
yading@10 19913
yading@10 19914
yading@10 19915 =item B<dc_luma>
yading@10 19916
yading@10 19917
yading@10 19918 =item B<dc_chroma>
yading@10 19919
yading@10 19920
yading@10 19921 =item B<freq_luma>
yading@10 19922
yading@10 19923
yading@10 19924 =item B<freq_chroma>
yading@10 19925
yading@10 19926
yading@10 19927 =item B<amp_luma>
yading@10 19928
yading@10 19929
yading@10 19930 =item B<amp_chroma>
yading@10 19931
yading@10 19932
yading@10 19933 =item B<cbp>
yading@10 19934
yading@10 19935
yading@10 19936 =item B<mv>
yading@10 19937
yading@10 19938
yading@10 19939 =item B<ring1>
yading@10 19940
yading@10 19941
yading@10 19942 =item B<ring2>
yading@10 19943
yading@10 19944
yading@10 19945 =item B<all>
yading@10 19946
yading@10 19947
yading@10 19948 =back
yading@10 19949
yading@10 19950
yading@10 19951 Default value is "all", which will cycle through the list of all tests.
yading@10 19952
yading@10 19953 =back
yading@10 19954
yading@10 19955
yading@10 19956 For example the following:
yading@10 19957
yading@10 19958 testsrc=t=dc_luma
yading@10 19959
yading@10 19960
yading@10 19961 will generate a "dc_luma" test pattern.
yading@10 19962
yading@10 19963
yading@10 19964 =head2 frei0r_src
yading@10 19965
yading@10 19966
yading@10 19967 Provide a frei0r source.
yading@10 19968
yading@10 19969 To enable compilation of this filter you need to install the frei0r
yading@10 19970 header and configure FFmpeg with C<--enable-frei0r>.
yading@10 19971
yading@10 19972 This source accepts the following options:
yading@10 19973
yading@10 19974
yading@10 19975 =over 4
yading@10 19976
yading@10 19977
yading@10 19978
yading@10 19979 =item B<size>
yading@10 19980
yading@10 19981 The size of the video to generate, may be a string of the form
yading@10 19982 I<width>xI<height> or a frame size abbreviation.
yading@10 19983
yading@10 19984
yading@10 19985 =item B<framerate>
yading@10 19986
yading@10 19987 Framerate of the generated video, may be a string of the form
yading@10 19988 I<num>/I<den> or a frame rate abbreviation.
yading@10 19989
yading@10 19990
yading@10 19991 =item B<filter_name>
yading@10 19992
yading@10 19993 The name to the frei0r source to load. For more information regarding frei0r and
yading@10 19994 how to set the parameters read the section frei0r in the description of
yading@10 19995 the video filters.
yading@10 19996
yading@10 19997
yading@10 19998 =item B<filter_params>
yading@10 19999
yading@10 20000 A '|'-separated list of parameters to pass to the frei0r source.
yading@10 20001
yading@10 20002
yading@10 20003 =back
yading@10 20004
yading@10 20005
yading@10 20006 For example, to generate a frei0r partik0l source with size 200x200
yading@10 20007 and frame rate 10 which is overlayed on the overlay filter main input:
yading@10 20008
yading@10 20009 frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
yading@10 20010
yading@10 20011
yading@10 20012
yading@10 20013 =head2 life
yading@10 20014
yading@10 20015
yading@10 20016 Generate a life pattern.
yading@10 20017
yading@10 20018 This source is based on a generalization of John Conway's life game.
yading@10 20019
yading@10 20020 The sourced input represents a life grid, each pixel represents a cell
yading@10 20021 which can be in one of two possible states, alive or dead. Every cell
yading@10 20022 interacts with its eight neighbours, which are the cells that are
yading@10 20023 horizontally, vertically, or diagonally adjacent.
yading@10 20024
yading@10 20025 At each interaction the grid evolves according to the adopted rule,
yading@10 20026 which specifies the number of neighbor alive cells which will make a
yading@10 20027 cell stay alive or born. The B<rule> option allows to specify
yading@10 20028 the rule to adopt.
yading@10 20029
yading@10 20030 This source accepts the following options:
yading@10 20031
yading@10 20032
yading@10 20033 =over 4
yading@10 20034
yading@10 20035
yading@10 20036 =item B<filename, f>
yading@10 20037
yading@10 20038 Set the file from which to read the initial grid state. In the file,
yading@10 20039 each non-whitespace character is considered an alive cell, and newline
yading@10 20040 is used to delimit the end of each row.
yading@10 20041
yading@10 20042 If this option is not specified, the initial grid is generated
yading@10 20043 randomly.
yading@10 20044
yading@10 20045
yading@10 20046 =item B<rate, r>
yading@10 20047
yading@10 20048 Set the video rate, that is the number of frames generated per second.
yading@10 20049 Default is 25.
yading@10 20050
yading@10 20051
yading@10 20052 =item B<random_fill_ratio, ratio>
yading@10 20053
yading@10 20054 Set the random fill ratio for the initial random grid. It is a
yading@10 20055 floating point number value ranging from 0 to 1, defaults to 1/PHI.
yading@10 20056 It is ignored when a file is specified.
yading@10 20057
yading@10 20058
yading@10 20059 =item B<random_seed, seed>
yading@10 20060
yading@10 20061 Set the seed for filling the initial random grid, must be an integer
yading@10 20062 included between 0 and UINT32_MAX. If not specified, or if explicitly
yading@10 20063 set to -1, the filter will try to use a good random seed on a best
yading@10 20064 effort basis.
yading@10 20065
yading@10 20066
yading@10 20067 =item B<rule>
yading@10 20068
yading@10 20069 Set the life rule.
yading@10 20070
yading@10 20071 A rule can be specified with a code of the kind "SI<NS>/BI<NB>",
yading@10 20072 where I<NS> and I<NB> are sequences of numbers in the range 0-8,
yading@10 20073 I<NS> specifies the number of alive neighbor cells which make a
yading@10 20074 live cell stay alive, and I<NB> the number of alive neighbor cells
yading@10 20075 which make a dead cell to become alive (i.e. to "born").
yading@10 20076 "s" and "b" can be used in place of "S" and "B", respectively.
yading@10 20077
yading@10 20078 Alternatively a rule can be specified by an 18-bits integer. The 9
yading@10 20079 high order bits are used to encode the next cell state if it is alive
yading@10 20080 for each number of neighbor alive cells, the low order bits specify
yading@10 20081 the rule for "borning" new cells. Higher order bits encode for an
yading@10 20082 higher number of neighbor cells.
yading@10 20083 For example the number 6153 = C<(12E<lt>E<lt>9)+9> specifies a stay alive
yading@10 20084 rule of 12 and a born rule of 9, which corresponds to "S23/B03".
yading@10 20085
yading@10 20086 Default value is "S23/B3", which is the original Conway's game of life
yading@10 20087 rule, and will keep a cell alive if it has 2 or 3 neighbor alive
yading@10 20088 cells, and will born a new cell if there are three alive cells around
yading@10 20089 a dead cell.
yading@10 20090
yading@10 20091
yading@10 20092 =item B<size, s>
yading@10 20093
yading@10 20094 Set the size of the output video.
yading@10 20095
yading@10 20096 If B<filename> is specified, the size is set by default to the
yading@10 20097 same size of the input file. If B<size> is set, it must contain
yading@10 20098 the size specified in the input file, and the initial grid defined in
yading@10 20099 that file is centered in the larger resulting area.
yading@10 20100
yading@10 20101 If a filename is not specified, the size value defaults to "320x240"
yading@10 20102 (used for a randomly generated initial grid).
yading@10 20103
yading@10 20104
yading@10 20105 =item B<stitch>
yading@10 20106
yading@10 20107 If set to 1, stitch the left and right grid edges together, and the
yading@10 20108 top and bottom edges also. Defaults to 1.
yading@10 20109
yading@10 20110
yading@10 20111 =item B<mold>
yading@10 20112
yading@10 20113 Set cell mold speed. If set, a dead cell will go from B<death_color> to
yading@10 20114 B<mold_color> with a step of B<mold>. B<mold> can have a
yading@10 20115 value from 0 to 255.
yading@10 20116
yading@10 20117
yading@10 20118 =item B<life_color>
yading@10 20119
yading@10 20120 Set the color of living (or new born) cells.
yading@10 20121
yading@10 20122
yading@10 20123 =item B<death_color>
yading@10 20124
yading@10 20125 Set the color of dead cells. If B<mold> is set, this is the first color
yading@10 20126 used to represent a dead cell.
yading@10 20127
yading@10 20128
yading@10 20129 =item B<mold_color>
yading@10 20130
yading@10 20131 Set mold color, for definitely dead and moldy cells.
yading@10 20132
yading@10 20133 =back
yading@10 20134
yading@10 20135
yading@10 20136
yading@10 20137 =head3 Examples
yading@10 20138
yading@10 20139
yading@10 20140
yading@10 20141 =over 4
yading@10 20142
yading@10 20143
yading@10 20144 =item *
yading@10 20145
yading@10 20146 Read a grid from F<pattern>, and center it on a grid of size
yading@10 20147 300x300 pixels:
yading@10 20148
yading@10 20149 life=f=pattern:s=300x300
yading@10 20150
yading@10 20151
yading@10 20152
yading@10 20153 =item *
yading@10 20154
yading@10 20155 Generate a random grid of size 200x200, with a fill ratio of 2/3:
yading@10 20156
yading@10 20157 life=ratio=2/3:s=200x200
yading@10 20158
yading@10 20159
yading@10 20160
yading@10 20161 =item *
yading@10 20162
yading@10 20163 Specify a custom rule for evolving a randomly generated grid:
yading@10 20164
yading@10 20165 life=rule=S14/B34
yading@10 20166
yading@10 20167
yading@10 20168
yading@10 20169 =item *
yading@10 20170
yading@10 20171 Full example with slow death effect (mold) using B<ffplay>:
yading@10 20172
yading@10 20173 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 20174
yading@10 20175
yading@10 20176 =back
yading@10 20177
yading@10 20178
yading@10 20179
yading@10 20180 =head2 color, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc
yading@10 20181
yading@10 20182
yading@10 20183 The C<color> source provides an uniformly colored input.
yading@10 20184
yading@10 20185 The C<nullsrc> source returns unprocessed video frames. It is
yading@10 20186 mainly useful to be employed in analysis / debugging tools, or as the
yading@10 20187 source for filters which ignore the input data.
yading@10 20188
yading@10 20189 The C<rgbtestsrc> source generates an RGB test pattern useful for
yading@10 20190 detecting RGB vs BGR issues. You should see a red, green and blue
yading@10 20191 stripe from top to bottom.
yading@10 20192
yading@10 20193 The C<smptebars> source generates a color bars pattern, based on
yading@10 20194 the SMPTE Engineering Guideline EG 1-1990.
yading@10 20195
yading@10 20196 The C<smptehdbars> source generates a color bars pattern, based on
yading@10 20197 the SMPTE RP 219-2002.
yading@10 20198
yading@10 20199 The C<testsrc> source generates a test video pattern, showing a
yading@10 20200 color pattern, a scrolling gradient and a timestamp. This is mainly
yading@10 20201 intended for testing purposes.
yading@10 20202
yading@10 20203 The sources accept the following options:
yading@10 20204
yading@10 20205
yading@10 20206 =over 4
yading@10 20207
yading@10 20208
yading@10 20209
yading@10 20210 =item B<color, c>
yading@10 20211
yading@10 20212 Specify the color of the source, only used in the C<color>
yading@10 20213 source. It can be the name of a color (case insensitive match) or a
yading@10 20214 0xRRGGBB[AA] sequence, possibly followed by an alpha specifier. The
yading@10 20215 default value is "black".
yading@10 20216
yading@10 20217
yading@10 20218 =item B<size, s>
yading@10 20219
yading@10 20220 Specify the size of the sourced video, it may be a string of the form
yading@10 20221 I<width>xI<height>, or the name of a size abbreviation. The
yading@10 20222 default value is "320x240".
yading@10 20223
yading@10 20224
yading@10 20225 =item B<rate, r>
yading@10 20226
yading@10 20227 Specify the frame rate of the sourced video, as the number of frames
yading@10 20228 generated per second. It has to be a string in the format
yading@10 20229 I<frame_rate_num>/I<frame_rate_den>, an integer number, a float
yading@10 20230 number or a valid video frame rate abbreviation. The default value is
yading@10 20231 "25".
yading@10 20232
yading@10 20233
yading@10 20234 =item B<sar>
yading@10 20235
yading@10 20236 Set the sample aspect ratio of the sourced video.
yading@10 20237
yading@10 20238
yading@10 20239 =item B<duration, d>
yading@10 20240
yading@10 20241 Set the video duration of the sourced video. The accepted syntax is:
yading@10 20242
yading@10 20243 [-]HH[:MM[:SS[.m...]]]
yading@10 20244 [-]S+[.m...]
yading@10 20245
yading@10 20246 See also the function C<av_parse_time()>.
yading@10 20247
yading@10 20248 If not specified, or the expressed duration is negative, the video is
yading@10 20249 supposed to be generated forever.
yading@10 20250
yading@10 20251
yading@10 20252 =item B<decimals, n>
yading@10 20253
yading@10 20254 Set the number of decimals to show in the timestamp, only used in the
yading@10 20255 C<testsrc> source.
yading@10 20256
yading@10 20257 The displayed timestamp value will correspond to the original
yading@10 20258 timestamp value multiplied by the power of 10 of the specified
yading@10 20259 value. Default value is 0.
yading@10 20260
yading@10 20261 =back
yading@10 20262
yading@10 20263
yading@10 20264 For example the following:
yading@10 20265
yading@10 20266 testsrc=duration=5.3:size=qcif:rate=10
yading@10 20267
yading@10 20268
yading@10 20269 will generate a video with a duration of 5.3 seconds, with size
yading@10 20270 176x144 and a frame rate of 10 frames per second.
yading@10 20271
yading@10 20272 The following graph description will generate a red source
yading@10 20273 with an opacity of 0.2, with size "qcif" and a frame rate of 10
yading@10 20274 frames per second.
yading@10 20275
yading@10 20276 color=c=red@0.2:s=qcif:r=10
yading@10 20277
yading@10 20278
yading@10 20279 If the input content is to be ignored, C<nullsrc> can be used. The
yading@10 20280 following command generates noise in the luminance plane by employing
yading@10 20281 the C<geq> filter:
yading@10 20282
yading@10 20283 nullsrc=s=256x256, geq=random(1)*255:128:128
yading@10 20284
yading@10 20285
yading@10 20286
yading@10 20287
yading@10 20288 =head1 VIDEO SINKS
yading@10 20289
yading@10 20290
yading@10 20291 Below is a description of the currently available video sinks.
yading@10 20292
yading@10 20293
yading@10 20294 =head2 buffersink
yading@10 20295
yading@10 20296
yading@10 20297 Buffer video frames, and make them available to the end of the filter
yading@10 20298 graph.
yading@10 20299
yading@10 20300 This sink is mainly intended for a programmatic use, in particular
yading@10 20301 through the interface defined in F<libavfilter/buffersink.h>
yading@10 20302 or the options system.
yading@10 20303
yading@10 20304 It accepts a pointer to an AVBufferSinkContext structure, which
yading@10 20305 defines the incoming buffers' formats, to be passed as the opaque
yading@10 20306 parameter to C<avfilter_init_filter> for initialization.
yading@10 20307
yading@10 20308
yading@10 20309 =head2 nullsink
yading@10 20310
yading@10 20311
yading@10 20312 Null video sink, do absolutely nothing with the input video. It is
yading@10 20313 mainly useful as a template and to be employed in analysis / debugging
yading@10 20314 tools.
yading@10 20315
yading@10 20316
yading@10 20317
yading@10 20318 =head1 MULTIMEDIA FILTERS
yading@10 20319
yading@10 20320
yading@10 20321 Below is a description of the currently available multimedia filters.
yading@10 20322
yading@10 20323
yading@10 20324 =head2 aperms, perms
yading@10 20325
yading@10 20326
yading@10 20327 Set read/write permissions for the output frames.
yading@10 20328
yading@10 20329 These filters are mainly aimed at developers to test direct path in the
yading@10 20330 following filter in the filtergraph.
yading@10 20331
yading@10 20332 The filters accept the following options:
yading@10 20333
yading@10 20334
yading@10 20335 =over 4
yading@10 20336
yading@10 20337
yading@10 20338 =item B<mode>
yading@10 20339
yading@10 20340 Select the permissions mode.
yading@10 20341
yading@10 20342 It accepts the following values:
yading@10 20343
yading@10 20344 =over 4
yading@10 20345
yading@10 20346
yading@10 20347 =item B<none>
yading@10 20348
yading@10 20349 Do nothing. This is the default.
yading@10 20350
yading@10 20351 =item B<ro>
yading@10 20352
yading@10 20353 Set all the output frames read-only.
yading@10 20354
yading@10 20355 =item B<rw>
yading@10 20356
yading@10 20357 Set all the output frames directly writable.
yading@10 20358
yading@10 20359 =item B<toggle>
yading@10 20360
yading@10 20361 Make the frame read-only if writable, and writable if read-only.
yading@10 20362
yading@10 20363 =item B<random>
yading@10 20364
yading@10 20365 Set each output frame read-only or writable randomly.
yading@10 20366
yading@10 20367 =back
yading@10 20368
yading@10 20369
yading@10 20370
yading@10 20371 =item B<seed>
yading@10 20372
yading@10 20373 Set the seed for the I<random> mode, must be an integer included between
yading@10 20374 C<0> and C<UINT32_MAX>. If not specified, or if explicitly set to
yading@10 20375 C<-1>, the filter will try to use a good random seed on a best effort
yading@10 20376 basis.
yading@10 20377
yading@10 20378 =back
yading@10 20379
yading@10 20380
yading@10 20381 Note: in case of auto-inserted filter between the permission filter and the
yading@10 20382 following one, the permission might not be received as expected in that
yading@10 20383 following filter. Inserting a format or aformat filter before the
yading@10 20384 perms/aperms filter can avoid this problem.
yading@10 20385
yading@10 20386
yading@10 20387 =head2 aselect, select
yading@10 20388
yading@10 20389 Select frames to pass in output.
yading@10 20390
yading@10 20391 This filter accepts the following options:
yading@10 20392
yading@10 20393
yading@10 20394 =over 4
yading@10 20395
yading@10 20396
yading@10 20397
yading@10 20398 =item B<expr, e>
yading@10 20399
yading@10 20400 Set expression, which is evaluated for each input frame.
yading@10 20401
yading@10 20402 If the expression is evaluated to zero, the frame is discarded.
yading@10 20403
yading@10 20404 If the evaluation result is negative or NaN, the frame is sent to the
yading@10 20405 first output; otherwise it is sent to the output with index
yading@10 20406 C<ceil(val)-1>, assuming that the input index starts from 0.
yading@10 20407
yading@10 20408 For example a value of C<1.2> corresponds to the output with index
yading@10 20409 C<ceil(1.2)-1 = 2-1 = 1>, that is the second output.
yading@10 20410
yading@10 20411
yading@10 20412 =item B<outputs, n>
yading@10 20413
yading@10 20414 Set the number of outputs. The output to which to send the selected
yading@10 20415 frame is based on the result of the evaluation. Default value is 1.
yading@10 20416
yading@10 20417 =back
yading@10 20418
yading@10 20419
yading@10 20420 The expression can contain the following constants:
yading@10 20421
yading@10 20422
yading@10 20423 =over 4
yading@10 20424
yading@10 20425
yading@10 20426 =item B<n>
yading@10 20427
yading@10 20428 the sequential number of the filtered frame, starting from 0
yading@10 20429
yading@10 20430
yading@10 20431 =item B<selected_n>
yading@10 20432
yading@10 20433 the sequential number of the selected frame, starting from 0
yading@10 20434
yading@10 20435
yading@10 20436 =item B<prev_selected_n>
yading@10 20437
yading@10 20438 the sequential number of the last selected frame, NAN if undefined
yading@10 20439
yading@10 20440
yading@10 20441 =item B<TB>
yading@10 20442
yading@10 20443 timebase of the input timestamps
yading@10 20444
yading@10 20445
yading@10 20446 =item B<pts>
yading@10 20447
yading@10 20448 the PTS (Presentation TimeStamp) of the filtered video frame,
yading@10 20449 expressed in I<TB> units, NAN if undefined
yading@10 20450
yading@10 20451
yading@10 20452 =item B<t>
yading@10 20453
yading@10 20454 the PTS (Presentation TimeStamp) of the filtered video frame,
yading@10 20455 expressed in seconds, NAN if undefined
yading@10 20456
yading@10 20457
yading@10 20458 =item B<prev_pts>
yading@10 20459
yading@10 20460 the PTS of the previously filtered video frame, NAN if undefined
yading@10 20461
yading@10 20462
yading@10 20463 =item B<prev_selected_pts>
yading@10 20464
yading@10 20465 the PTS of the last previously filtered video frame, NAN if undefined
yading@10 20466
yading@10 20467
yading@10 20468 =item B<prev_selected_t>
yading@10 20469
yading@10 20470 the PTS of the last previously selected video frame, NAN if undefined
yading@10 20471
yading@10 20472
yading@10 20473 =item B<start_pts>
yading@10 20474
yading@10 20475 the PTS of the first video frame in the video, NAN if undefined
yading@10 20476
yading@10 20477
yading@10 20478 =item B<start_t>
yading@10 20479
yading@10 20480 the time of the first video frame in the video, NAN if undefined
yading@10 20481
yading@10 20482
yading@10 20483 =item B<pict_type> I<(video only)>
yading@10 20484
yading@10 20485 the type of the filtered frame, can assume one of the following
yading@10 20486 values:
yading@10 20487
yading@10 20488 =over 4
yading@10 20489
yading@10 20490
yading@10 20491 =item B<I>
yading@10 20492
yading@10 20493
yading@10 20494 =item B<P>
yading@10 20495
yading@10 20496
yading@10 20497 =item B<B>
yading@10 20498
yading@10 20499
yading@10 20500 =item B<S>
yading@10 20501
yading@10 20502
yading@10 20503 =item B<SI>
yading@10 20504
yading@10 20505
yading@10 20506 =item B<SP>
yading@10 20507
yading@10 20508
yading@10 20509 =item B<BI>
yading@10 20510
yading@10 20511
yading@10 20512 =back
yading@10 20513
yading@10 20514
yading@10 20515
yading@10 20516 =item B<interlace_type> I<(video only)>
yading@10 20517
yading@10 20518 the frame interlace type, can assume one of the following values:
yading@10 20519
yading@10 20520 =over 4
yading@10 20521
yading@10 20522
yading@10 20523 =item B<PROGRESSIVE>
yading@10 20524
yading@10 20525 the frame is progressive (not interlaced)
yading@10 20526
yading@10 20527 =item B<TOPFIRST>
yading@10 20528
yading@10 20529 the frame is top-field-first
yading@10 20530
yading@10 20531 =item B<BOTTOMFIRST>
yading@10 20532
yading@10 20533 the frame is bottom-field-first
yading@10 20534
yading@10 20535 =back
yading@10 20536
yading@10 20537
yading@10 20538
yading@10 20539 =item B<consumed_sample_n> I<(audio only)>
yading@10 20540
yading@10 20541 the number of selected samples before the current frame
yading@10 20542
yading@10 20543
yading@10 20544 =item B<samples_n> I<(audio only)>
yading@10 20545
yading@10 20546 the number of samples in the current frame
yading@10 20547
yading@10 20548
yading@10 20549 =item B<sample_rate> I<(audio only)>
yading@10 20550
yading@10 20551 the input sample rate
yading@10 20552
yading@10 20553
yading@10 20554 =item B<key>
yading@10 20555
yading@10 20556 1 if the filtered frame is a key-frame, 0 otherwise
yading@10 20557
yading@10 20558
yading@10 20559 =item B<pos>
yading@10 20560
yading@10 20561 the position in the file of the filtered frame, -1 if the information
yading@10 20562 is not available (e.g. for synthetic video)
yading@10 20563
yading@10 20564
yading@10 20565 =item B<scene> I<(video only)>
yading@10 20566
yading@10 20567 value between 0 and 1 to indicate a new scene; a low value reflects a low
yading@10 20568 probability for the current frame to introduce a new scene, while a higher
yading@10 20569 value means the current frame is more likely to be one (see the example below)
yading@10 20570
yading@10 20571
yading@10 20572 =back
yading@10 20573
yading@10 20574
yading@10 20575 The default value of the select expression is "1".
yading@10 20576
yading@10 20577
yading@10 20578 =head3 Examples
yading@10 20579
yading@10 20580
yading@10 20581
yading@10 20582 =over 4
yading@10 20583
yading@10 20584
yading@10 20585 =item *
yading@10 20586
yading@10 20587 Select all frames in input:
yading@10 20588
yading@10 20589 select
yading@10 20590
yading@10 20591
yading@10 20592 The example above is the same as:
yading@10 20593
yading@10 20594 select=1
yading@10 20595
yading@10 20596
yading@10 20597
yading@10 20598 =item *
yading@10 20599
yading@10 20600 Skip all frames:
yading@10 20601
yading@10 20602 select=0
yading@10 20603
yading@10 20604
yading@10 20605
yading@10 20606 =item *
yading@10 20607
yading@10 20608 Select only I-frames:
yading@10 20609
yading@10 20610 select='eq(pict_type\,I)'
yading@10 20611
yading@10 20612
yading@10 20613
yading@10 20614 =item *
yading@10 20615
yading@10 20616 Select one frame every 100:
yading@10 20617
yading@10 20618 select='not(mod(n\,100))'
yading@10 20619
yading@10 20620
yading@10 20621
yading@10 20622 =item *
yading@10 20623
yading@10 20624 Select only frames contained in the 10-20 time interval:
yading@10 20625
yading@10 20626 select='gte(t\,10)*lte(t\,20)'
yading@10 20627
yading@10 20628
yading@10 20629
yading@10 20630 =item *
yading@10 20631
yading@10 20632 Select only I frames contained in the 10-20 time interval:
yading@10 20633
yading@10 20634 select='gte(t\,10)*lte(t\,20)*eq(pict_type\,I)'
yading@10 20635
yading@10 20636
yading@10 20637
yading@10 20638 =item *
yading@10 20639
yading@10 20640 Select frames with a minimum distance of 10 seconds:
yading@10 20641
yading@10 20642 select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
yading@10 20643
yading@10 20644
yading@10 20645
yading@10 20646 =item *
yading@10 20647
yading@10 20648 Use aselect to select only audio frames with samples number E<gt> 100:
yading@10 20649
yading@10 20650 aselect='gt(samples_n\,100)'
yading@10 20651
yading@10 20652
yading@10 20653
yading@10 20654 =item *
yading@10 20655
yading@10 20656 Create a mosaic of the first scenes:
yading@10 20657
yading@10 20658 ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
yading@10 20659
yading@10 20660
yading@10 20661 Comparing I<scene> against a value between 0.3 and 0.5 is generally a sane
yading@10 20662 choice.
yading@10 20663
yading@10 20664
yading@10 20665 =item *
yading@10 20666
yading@10 20667 Send even and odd frames to separate outputs, and compose them:
yading@10 20668
yading@10 20669 select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
yading@10 20670
yading@10 20671
yading@10 20672 =back
yading@10 20673
yading@10 20674
yading@10 20675
yading@10 20676 =head2 asendcmd, sendcmd
yading@10 20677
yading@10 20678
yading@10 20679 Send commands to filters in the filtergraph.
yading@10 20680
yading@10 20681 These filters read commands to be sent to other filters in the
yading@10 20682 filtergraph.
yading@10 20683
yading@10 20684 C<asendcmd> must be inserted between two audio filters,
yading@10 20685 C<sendcmd> must be inserted between two video filters, but apart
yading@10 20686 from that they act the same way.
yading@10 20687
yading@10 20688 The specification of commands can be provided in the filter arguments
yading@10 20689 with the I<commands> option, or in a file specified by the
yading@10 20690 I<filename> option.
yading@10 20691
yading@10 20692 These filters accept the following options:
yading@10 20693
yading@10 20694 =over 4
yading@10 20695
yading@10 20696
yading@10 20697 =item B<commands, c>
yading@10 20698
yading@10 20699 Set the commands to be read and sent to the other filters.
yading@10 20700
yading@10 20701 =item B<filename, f>
yading@10 20702
yading@10 20703 Set the filename of the commands to be read and sent to the other
yading@10 20704 filters.
yading@10 20705
yading@10 20706 =back
yading@10 20707
yading@10 20708
yading@10 20709
yading@10 20710 =head3 Commands syntax
yading@10 20711
yading@10 20712
yading@10 20713 A commands description consists of a sequence of interval
yading@10 20714 specifications, comprising a list of commands to be executed when a
yading@10 20715 particular event related to that interval occurs. The occurring event
yading@10 20716 is typically the current frame time entering or leaving a given time
yading@10 20717 interval.
yading@10 20718
yading@10 20719 An interval is specified by the following syntax:
yading@10 20720
yading@10 20721 <START>[-<END>] <COMMANDS>;
yading@10 20722
yading@10 20723
yading@10 20724 The time interval is specified by the I<START> and I<END> times.
yading@10 20725 I<END> is optional and defaults to the maximum time.
yading@10 20726
yading@10 20727 The current frame time is considered within the specified interval if
yading@10 20728 it is included in the interval [I<START>, I<END>), that is when
yading@10 20729 the time is greater or equal to I<START> and is lesser than
yading@10 20730 I<END>.
yading@10 20731
yading@10 20732 I<COMMANDS> consists of a sequence of one or more command
yading@10 20733 specifications, separated by ",", relating to that interval. The
yading@10 20734 syntax of a command specification is given by:
yading@10 20735
yading@10 20736 [<FLAGS>] <TARGET> <COMMAND> <ARG>
yading@10 20737
yading@10 20738
yading@10 20739 I<FLAGS> is optional and specifies the type of events relating to
yading@10 20740 the time interval which enable sending the specified command, and must
yading@10 20741 be a non-null sequence of identifier flags separated by "+" or "|" and
yading@10 20742 enclosed between "[" and "]".
yading@10 20743
yading@10 20744 The following flags are recognized:
yading@10 20745
yading@10 20746 =over 4
yading@10 20747
yading@10 20748
yading@10 20749 =item B<enter>
yading@10 20750
yading@10 20751 The command is sent when the current frame timestamp enters the
yading@10 20752 specified interval. In other words, the command is sent when the
yading@10 20753 previous frame timestamp was not in the given interval, and the
yading@10 20754 current is.
yading@10 20755
yading@10 20756
yading@10 20757 =item B<leave>
yading@10 20758
yading@10 20759 The command is sent when the current frame timestamp leaves the
yading@10 20760 specified interval. In other words, the command is sent when the
yading@10 20761 previous frame timestamp was in the given interval, and the
yading@10 20762 current is not.
yading@10 20763
yading@10 20764 =back
yading@10 20765
yading@10 20766
yading@10 20767 If I<FLAGS> is not specified, a default value of C<[enter]> is
yading@10 20768 assumed.
yading@10 20769
yading@10 20770 I<TARGET> specifies the target of the command, usually the name of
yading@10 20771 the filter class or a specific filter instance name.
yading@10 20772
yading@10 20773 I<COMMAND> specifies the name of the command for the target filter.
yading@10 20774
yading@10 20775 I<ARG> is optional and specifies the optional list of argument for
yading@10 20776 the given I<COMMAND>.
yading@10 20777
yading@10 20778 Between one interval specification and another, whitespaces, or
yading@10 20779 sequences of characters starting with C<#> until the end of line,
yading@10 20780 are ignored and can be used to annotate comments.
yading@10 20781
yading@10 20782 A simplified BNF description of the commands specification syntax
yading@10 20783 follows:
yading@10 20784
yading@10 20785 <COMMAND_FLAG> ::= "enter" | "leave"
yading@10 20786 <COMMAND_FLAGS> ::= <COMMAND_FLAG> [(+|"|")<COMMAND_FLAG>]
yading@10 20787 <COMMAND> ::= ["[" <COMMAND_FLAGS> "]"] <TARGET> <COMMAND> [<ARG>]
yading@10 20788 <COMMANDS> ::= <COMMAND> [,<COMMANDS>]
yading@10 20789 <INTERVAL> ::= <START>[-<END>] <COMMANDS>
yading@10 20790 <INTERVALS> ::= <INTERVAL>[;<INTERVALS>]
yading@10 20791
yading@10 20792
yading@10 20793
yading@10 20794 =head3 Examples
yading@10 20795
yading@10 20796
yading@10 20797
yading@10 20798 =over 4
yading@10 20799
yading@10 20800
yading@10 20801 =item *
yading@10 20802
yading@10 20803 Specify audio tempo change at second 4:
yading@10 20804
yading@10 20805 asendcmd=c='4.0 atempo tempo 1.5',atempo
yading@10 20806
yading@10 20807
yading@10 20808
yading@10 20809 =item *
yading@10 20810
yading@10 20811 Specify a list of drawtext and hue commands in a file.
yading@10 20812
yading@10 20813 # show text in the interval 5-10
yading@10 20814 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
yading@10 20815 [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
yading@10 20816
yading@10 20817 # desaturate the image in the interval 15-20
yading@10 20818 15.0-20.0 [enter] hue s 0,
yading@10 20819 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
yading@10 20820 [leave] hue s 1,
yading@10 20821 [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
yading@10 20822
yading@10 20823 # apply an exponential saturation fade-out effect, starting from time 25
yading@10 20824 25 [enter] hue s exp(25-t)
yading@10 20825
yading@10 20826
yading@10 20827 A filtergraph allowing to read and process the above command list
yading@10 20828 stored in a file F<test.cmd>, can be specified with:
yading@10 20829
yading@10 20830 sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
yading@10 20831
yading@10 20832
yading@10 20833 =back
yading@10 20834
yading@10 20835
yading@10 20836
yading@10 20837
yading@10 20838 =head2 asetpts, setpts
yading@10 20839
yading@10 20840
yading@10 20841 Change the PTS (presentation timestamp) of the input frames.
yading@10 20842
yading@10 20843 C<asetpts> works on audio frames, C<setpts> on video frames.
yading@10 20844
yading@10 20845 This filter accepts the following options:
yading@10 20846
yading@10 20847
yading@10 20848 =over 4
yading@10 20849
yading@10 20850
yading@10 20851
yading@10 20852 =item B<expr>
yading@10 20853
yading@10 20854 The expression which is evaluated for each frame to construct its timestamp.
yading@10 20855
yading@10 20856
yading@10 20857 =back
yading@10 20858
yading@10 20859
yading@10 20860 The expression is evaluated through the eval API and can contain the following
yading@10 20861 constants:
yading@10 20862
yading@10 20863
yading@10 20864 =over 4
yading@10 20865
yading@10 20866
yading@10 20867 =item B<FRAME_RATE>
yading@10 20868
yading@10 20869 frame rate, only defined for constant frame-rate video
yading@10 20870
yading@10 20871
yading@10 20872 =item B<PTS>
yading@10 20873
yading@10 20874 the presentation timestamp in input
yading@10 20875
yading@10 20876
yading@10 20877 =item B<N>
yading@10 20878
yading@10 20879 the count of the input frame, starting from 0.
yading@10 20880
yading@10 20881
yading@10 20882 =item B<NB_CONSUMED_SAMPLES>
yading@10 20883
yading@10 20884 the number of consumed samples, not including the current frame (only
yading@10 20885 audio)
yading@10 20886
yading@10 20887
yading@10 20888 =item B<NB_SAMPLES>
yading@10 20889
yading@10 20890 the number of samples in the current frame (only audio)
yading@10 20891
yading@10 20892
yading@10 20893 =item B<SAMPLE_RATE>
yading@10 20894
yading@10 20895 audio sample rate
yading@10 20896
yading@10 20897
yading@10 20898 =item B<STARTPTS>
yading@10 20899
yading@10 20900 the PTS of the first frame
yading@10 20901
yading@10 20902
yading@10 20903 =item B<STARTT>
yading@10 20904
yading@10 20905 the time in seconds of the first frame
yading@10 20906
yading@10 20907
yading@10 20908 =item B<INTERLACED>
yading@10 20909
yading@10 20910 tell if the current frame is interlaced
yading@10 20911
yading@10 20912
yading@10 20913 =item B<T>
yading@10 20914
yading@10 20915 the time in seconds of the current frame
yading@10 20916
yading@10 20917
yading@10 20918 =item B<TB>
yading@10 20919
yading@10 20920 the time base
yading@10 20921
yading@10 20922
yading@10 20923 =item B<POS>
yading@10 20924
yading@10 20925 original position in the file of the frame, or undefined if undefined
yading@10 20926 for the current frame
yading@10 20927
yading@10 20928
yading@10 20929 =item B<PREV_INPTS>
yading@10 20930
yading@10 20931 previous input PTS
yading@10 20932
yading@10 20933
yading@10 20934 =item B<PREV_INT>
yading@10 20935
yading@10 20936 previous input time in seconds
yading@10 20937
yading@10 20938
yading@10 20939 =item B<PREV_OUTPTS>
yading@10 20940
yading@10 20941 previous output PTS
yading@10 20942
yading@10 20943
yading@10 20944 =item B<PREV_OUTT>
yading@10 20945
yading@10 20946 previous output time in seconds
yading@10 20947
yading@10 20948
yading@10 20949 =item B<RTCTIME>
yading@10 20950
yading@10 20951 wallclock (RTC) time in microseconds. This is deprecated, use time(0)
yading@10 20952 instead.
yading@10 20953
yading@10 20954
yading@10 20955 =item B<RTCSTART>
yading@10 20956
yading@10 20957 wallclock (RTC) time at the start of the movie in microseconds
yading@10 20958
yading@10 20959 =back
yading@10 20960
yading@10 20961
yading@10 20962
yading@10 20963 =head3 Examples
yading@10 20964
yading@10 20965
yading@10 20966
yading@10 20967 =over 4
yading@10 20968
yading@10 20969
yading@10 20970 =item *
yading@10 20971
yading@10 20972 Start counting PTS from zero
yading@10 20973
yading@10 20974 setpts=PTS-STARTPTS
yading@10 20975
yading@10 20976
yading@10 20977
yading@10 20978 =item *
yading@10 20979
yading@10 20980 Apply fast motion effect:
yading@10 20981
yading@10 20982 setpts=0.5*PTS
yading@10 20983
yading@10 20984
yading@10 20985
yading@10 20986 =item *
yading@10 20987
yading@10 20988 Apply slow motion effect:
yading@10 20989
yading@10 20990 setpts=2.0*PTS
yading@10 20991
yading@10 20992
yading@10 20993
yading@10 20994 =item *
yading@10 20995
yading@10 20996 Set fixed rate of 25 frames per second:
yading@10 20997
yading@10 20998 setpts=N/(25*TB)
yading@10 20999
yading@10 21000
yading@10 21001
yading@10 21002 =item *
yading@10 21003
yading@10 21004 Set fixed rate 25 fps with some jitter:
yading@10 21005
yading@10 21006 setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
yading@10 21007
yading@10 21008
yading@10 21009
yading@10 21010 =item *
yading@10 21011
yading@10 21012 Apply an offset of 10 seconds to the input PTS:
yading@10 21013
yading@10 21014 setpts=PTS+10/TB
yading@10 21015
yading@10 21016
yading@10 21017
yading@10 21018 =item *
yading@10 21019
yading@10 21020 Generate timestamps from a "live source" and rebase onto the current timebase:
yading@10 21021
yading@10 21022 setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
yading@10 21023
yading@10 21024
yading@10 21025 =back
yading@10 21026
yading@10 21027
yading@10 21028
yading@10 21029 =head2 ebur128
yading@10 21030
yading@10 21031
yading@10 21032 EBU R128 scanner filter. This filter takes an audio stream as input and outputs
yading@10 21033 it unchanged. By default, it logs a message at a frequency of 10Hz with the
yading@10 21034 Momentary loudness (identified by C<M>), Short-term loudness (C<S>),
yading@10 21035 Integrated loudness (C<I>) and Loudness Range (C<LRA>).
yading@10 21036
yading@10 21037 The filter also has a video output (see the I<video> option) with a real
yading@10 21038 time graph to observe the loudness evolution. The graphic contains the logged
yading@10 21039 message mentioned above, so it is not printed anymore when this option is set,
yading@10 21040 unless the verbose logging is set. The main graphing area contains the
yading@10 21041 short-term loudness (3 seconds of analysis), and the gauge on the right is for
yading@10 21042 the momentary loudness (400 milliseconds).
yading@10 21043
yading@10 21044 More information about the Loudness Recommendation EBU R128 on
yading@10 21045 E<lt>B<http://tech.ebu.ch/loudness>E<gt>.
yading@10 21046
yading@10 21047 The filter accepts the following options:
yading@10 21048
yading@10 21049
yading@10 21050 =over 4
yading@10 21051
yading@10 21052
yading@10 21053
yading@10 21054 =item B<video>
yading@10 21055
yading@10 21056 Activate the video output. The audio stream is passed unchanged whether this
yading@10 21057 option is set or no. The video stream will be the first output stream if
yading@10 21058 activated. Default is C<0>.
yading@10 21059
yading@10 21060
yading@10 21061 =item B<size>
yading@10 21062
yading@10 21063 Set the video size. This option is for video only. Default and minimum
yading@10 21064 resolution is C<640x480>.
yading@10 21065
yading@10 21066
yading@10 21067 =item B<meter>
yading@10 21068
yading@10 21069 Set the EBU scale meter. Default is C<9>. Common values are C<9> and
yading@10 21070 C<18>, respectively for EBU scale meter +9 and EBU scale meter +18. Any
yading@10 21071 other integer value between this range is allowed.
yading@10 21072
yading@10 21073
yading@10 21074 =item B<metadata>
yading@10 21075
yading@10 21076 Set metadata injection. If set to C<1>, the audio input will be segmented
yading@10 21077 into 100ms output frames, each of them containing various loudness information
yading@10 21078 in metadata. All the metadata keys are prefixed with C<lavfi.r128.>.
yading@10 21079
yading@10 21080 Default is C<0>.
yading@10 21081
yading@10 21082
yading@10 21083 =item B<framelog>
yading@10 21084
yading@10 21085 Force the frame logging level.
yading@10 21086
yading@10 21087 Available values are:
yading@10 21088
yading@10 21089 =over 4
yading@10 21090
yading@10 21091
yading@10 21092 =item B<info>
yading@10 21093
yading@10 21094 information logging level
yading@10 21095
yading@10 21096 =item B<verbose>
yading@10 21097
yading@10 21098 verbose logging level
yading@10 21099
yading@10 21100 =back
yading@10 21101
yading@10 21102
yading@10 21103 By default, the logging level is set to I<info>. If the B<video> or
yading@10 21104 the B<metadata> options are set, it switches to I<verbose>.
yading@10 21105
yading@10 21106 =back
yading@10 21107
yading@10 21108
yading@10 21109
yading@10 21110 =head3 Examples
yading@10 21111
yading@10 21112
yading@10 21113
yading@10 21114 =over 4
yading@10 21115
yading@10 21116
yading@10 21117 =item *
yading@10 21118
yading@10 21119 Real-time graph using B<ffplay>, with a EBU scale meter +18:
yading@10 21120
yading@10 21121 ffplay -f lavfi -i "amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]"
yading@10 21122
yading@10 21123
yading@10 21124
yading@10 21125 =item *
yading@10 21126
yading@10 21127 Run an analysis with B<ffmpeg>:
yading@10 21128
yading@10 21129 ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
yading@10 21130
yading@10 21131
yading@10 21132 =back
yading@10 21133
yading@10 21134
yading@10 21135
yading@10 21136 =head2 settb, asettb
yading@10 21137
yading@10 21138
yading@10 21139 Set the timebase to use for the output frames timestamps.
yading@10 21140 It is mainly useful for testing timebase configuration.
yading@10 21141
yading@10 21142 This filter accepts the following options:
yading@10 21143
yading@10 21144
yading@10 21145 =over 4
yading@10 21146
yading@10 21147
yading@10 21148
yading@10 21149 =item B<expr, tb>
yading@10 21150
yading@10 21151 The expression which is evaluated into the output timebase.
yading@10 21152
yading@10 21153
yading@10 21154 =back
yading@10 21155
yading@10 21156
yading@10 21157 The value for B<tb> is an arithmetic expression representing a
yading@10 21158 rational. The expression can contain the constants "AVTB" (the default
yading@10 21159 timebase), "intb" (the input timebase) and "sr" (the sample rate,
yading@10 21160 audio only). Default value is "intb".
yading@10 21161
yading@10 21162
yading@10 21163 =head3 Examples
yading@10 21164
yading@10 21165
yading@10 21166
yading@10 21167 =over 4
yading@10 21168
yading@10 21169
yading@10 21170 =item *
yading@10 21171
yading@10 21172 Set the timebase to 1/25:
yading@10 21173
yading@10 21174 settb=expr=1/25
yading@10 21175
yading@10 21176
yading@10 21177
yading@10 21178 =item *
yading@10 21179
yading@10 21180 Set the timebase to 1/10:
yading@10 21181
yading@10 21182 settb=expr=0.1
yading@10 21183
yading@10 21184
yading@10 21185
yading@10 21186 =item *
yading@10 21187
yading@10 21188 Set the timebase to 1001/1000:
yading@10 21189
yading@10 21190 settb=1+0.001
yading@10 21191
yading@10 21192
yading@10 21193
yading@10 21194 =item *
yading@10 21195
yading@10 21196 Set the timebase to 2*intb:
yading@10 21197
yading@10 21198 settb=2*intb
yading@10 21199
yading@10 21200
yading@10 21201
yading@10 21202 =item *
yading@10 21203
yading@10 21204 Set the default timebase value:
yading@10 21205
yading@10 21206 settb=AVTB
yading@10 21207
yading@10 21208
yading@10 21209 =back
yading@10 21210
yading@10 21211
yading@10 21212
yading@10 21213 =head2 concat
yading@10 21214
yading@10 21215
yading@10 21216 Concatenate audio and video streams, joining them together one after the
yading@10 21217 other.
yading@10 21218
yading@10 21219 The filter works on segments of synchronized video and audio streams. All
yading@10 21220 segments must have the same number of streams of each type, and that will
yading@10 21221 also be the number of streams at output.
yading@10 21222
yading@10 21223 The filter accepts the following options:
yading@10 21224
yading@10 21225
yading@10 21226 =over 4
yading@10 21227
yading@10 21228
yading@10 21229
yading@10 21230 =item B<n>
yading@10 21231
yading@10 21232 Set the number of segments. Default is 2.
yading@10 21233
yading@10 21234
yading@10 21235 =item B<v>
yading@10 21236
yading@10 21237 Set the number of output video streams, that is also the number of video
yading@10 21238 streams in each segment. Default is 1.
yading@10 21239
yading@10 21240
yading@10 21241 =item B<a>
yading@10 21242
yading@10 21243 Set the number of output audio streams, that is also the number of video
yading@10 21244 streams in each segment. Default is 0.
yading@10 21245
yading@10 21246
yading@10 21247 =item B<unsafe>
yading@10 21248
yading@10 21249 Activate unsafe mode: do not fail if segments have a different format.
yading@10 21250
yading@10 21251
yading@10 21252 =back
yading@10 21253
yading@10 21254
yading@10 21255 The filter has I<v>+I<a> outputs: first I<v> video outputs, then
yading@10 21256 I<a> audio outputs.
yading@10 21257
yading@10 21258 There are I<n>x(I<v>+I<a>) inputs: first the inputs for the first
yading@10 21259 segment, in the same order as the outputs, then the inputs for the second
yading@10 21260 segment, etc.
yading@10 21261
yading@10 21262 Related streams do not always have exactly the same duration, for various
yading@10 21263 reasons including codec frame size or sloppy authoring. For that reason,
yading@10 21264 related synchronized streams (e.g. a video and its audio track) should be
yading@10 21265 concatenated at once. The concat filter will use the duration of the longest
yading@10 21266 stream in each segment (except the last one), and if necessary pad shorter
yading@10 21267 audio streams with silence.
yading@10 21268
yading@10 21269 For this filter to work correctly, all segments must start at timestamp 0.
yading@10 21270
yading@10 21271 All corresponding streams must have the same parameters in all segments; the
yading@10 21272 filtering system will automatically select a common pixel format for video
yading@10 21273 streams, and a common sample format, sample rate and channel layout for
yading@10 21274 audio streams, but other settings, such as resolution, must be converted
yading@10 21275 explicitly by the user.
yading@10 21276
yading@10 21277 Different frame rates are acceptable but will result in variable frame rate
yading@10 21278 at output; be sure to configure the output file to handle it.
yading@10 21279
yading@10 21280
yading@10 21281 =head3 Examples
yading@10 21282
yading@10 21283
yading@10 21284
yading@10 21285 =over 4
yading@10 21286
yading@10 21287
yading@10 21288 =item *
yading@10 21289
yading@10 21290 Concatenate an opening, an episode and an ending, all in bilingual version
yading@10 21291 (video in stream 0, audio in streams 1 and 2):
yading@10 21292
yading@10 21293 ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
yading@10 21294 '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
yading@10 21295 concat=n=3:v=1:a=2 [v] [a1] [a2]' \
yading@10 21296 -map '[v]' -map '[a1]' -map '[a2]' output.mkv
yading@10 21297
yading@10 21298
yading@10 21299
yading@10 21300 =item *
yading@10 21301
yading@10 21302 Concatenate two parts, handling audio and video separately, using the
yading@10 21303 (a)movie sources, and adjusting the resolution:
yading@10 21304
yading@10 21305 movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
yading@10 21306 movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
yading@10 21307 [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
yading@10 21308
yading@10 21309 Note that a desync will happen at the stitch if the audio and video streams
yading@10 21310 do not have exactly the same duration in the first file.
yading@10 21311
yading@10 21312
yading@10 21313 =back
yading@10 21314
yading@10 21315
yading@10 21316
yading@10 21317 =head2 showspectrum
yading@10 21318
yading@10 21319
yading@10 21320 Convert input audio to a video output, representing the audio frequency
yading@10 21321 spectrum.
yading@10 21322
yading@10 21323 The filter accepts the following options:
yading@10 21324
yading@10 21325
yading@10 21326 =over 4
yading@10 21327
yading@10 21328
yading@10 21329 =item B<size, s>
yading@10 21330
yading@10 21331 Specify the video size for the output. Default value is C<640x512>.
yading@10 21332
yading@10 21333
yading@10 21334 =item B<slide>
yading@10 21335
yading@10 21336 Specify if the spectrum should slide along the window. Default value is
yading@10 21337 C<0>.
yading@10 21338
yading@10 21339
yading@10 21340 =item B<mode>
yading@10 21341
yading@10 21342 Specify display mode.
yading@10 21343
yading@10 21344 It accepts the following values:
yading@10 21345
yading@10 21346 =over 4
yading@10 21347
yading@10 21348
yading@10 21349 =item B<combined>
yading@10 21350
yading@10 21351 all channels are displayed in the same row
yading@10 21352
yading@10 21353 =item B<separate>
yading@10 21354
yading@10 21355 all channels are displayed in separate rows
yading@10 21356
yading@10 21357 =back
yading@10 21358
yading@10 21359
yading@10 21360 Default value is B<combined>.
yading@10 21361
yading@10 21362
yading@10 21363 =item B<color>
yading@10 21364
yading@10 21365 Specify display color mode.
yading@10 21366
yading@10 21367 It accepts the following values:
yading@10 21368
yading@10 21369 =over 4
yading@10 21370
yading@10 21371
yading@10 21372 =item B<channel>
yading@10 21373
yading@10 21374 each channel is displayed in a separate color
yading@10 21375
yading@10 21376 =item B<intensity>
yading@10 21377
yading@10 21378 each channel is is displayed using the same color scheme
yading@10 21379
yading@10 21380 =back
yading@10 21381
yading@10 21382
yading@10 21383 Default value is B<channel>.
yading@10 21384
yading@10 21385
yading@10 21386 =item B<scale>
yading@10 21387
yading@10 21388 Specify scale used for calculating intensity color values.
yading@10 21389
yading@10 21390 It accepts the following values:
yading@10 21391
yading@10 21392 =over 4
yading@10 21393
yading@10 21394
yading@10 21395 =item B<lin>
yading@10 21396
yading@10 21397 linear
yading@10 21398
yading@10 21399 =item B<sqrt>
yading@10 21400
yading@10 21401 square root, default
yading@10 21402
yading@10 21403 =item B<cbrt>
yading@10 21404
yading@10 21405 cubic root
yading@10 21406
yading@10 21407 =item B<log>
yading@10 21408
yading@10 21409 logarithmic
yading@10 21410
yading@10 21411 =back
yading@10 21412
yading@10 21413
yading@10 21414 Default value is B<sqrt>.
yading@10 21415
yading@10 21416
yading@10 21417 =item B<saturation>
yading@10 21418
yading@10 21419 Set saturation modifier for displayed colors. Negative values provide
yading@10 21420 alternative color scheme. C<0> is no saturation at all.
yading@10 21421 Saturation must be in [-10.0, 10.0] range.
yading@10 21422 Default value is C<1>.
yading@10 21423
yading@10 21424 =back
yading@10 21425
yading@10 21426
yading@10 21427 The usage is very similar to the showwaves filter; see the examples in that
yading@10 21428 section.
yading@10 21429
yading@10 21430
yading@10 21431 =head3 Examples
yading@10 21432
yading@10 21433
yading@10 21434
yading@10 21435 =over 4
yading@10 21436
yading@10 21437
yading@10 21438 =item *
yading@10 21439
yading@10 21440 Large window with logarithmic color scaling:
yading@10 21441
yading@10 21442 showspectrum=s=1280x480:scale=log
yading@10 21443
yading@10 21444
yading@10 21445
yading@10 21446 =item *
yading@10 21447
yading@10 21448 Complete example for a colored and sliding spectrum per channel using B<ffplay>:
yading@10 21449
yading@10 21450 ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
yading@10 21451 [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
yading@10 21452
yading@10 21453
yading@10 21454 =back
yading@10 21455
yading@10 21456
yading@10 21457
yading@10 21458 =head2 showwaves
yading@10 21459
yading@10 21460
yading@10 21461 Convert input audio to a video output, representing the samples waves.
yading@10 21462
yading@10 21463 The filter accepts the following options:
yading@10 21464
yading@10 21465
yading@10 21466 =over 4
yading@10 21467
yading@10 21468
yading@10 21469 =item B<size, s>
yading@10 21470
yading@10 21471 Specify the video size for the output. Default value is "600x240".
yading@10 21472
yading@10 21473
yading@10 21474 =item B<mode>
yading@10 21475
yading@10 21476 Set display mode.
yading@10 21477
yading@10 21478 Available values are:
yading@10 21479
yading@10 21480 =over 4
yading@10 21481
yading@10 21482
yading@10 21483 =item B<point>
yading@10 21484
yading@10 21485 Draw a point for each sample.
yading@10 21486
yading@10 21487
yading@10 21488 =item B<line>
yading@10 21489
yading@10 21490 Draw a vertical line for each sample.
yading@10 21491
yading@10 21492 =back
yading@10 21493
yading@10 21494
yading@10 21495 Default value is C<point>.
yading@10 21496
yading@10 21497
yading@10 21498 =item B<n>
yading@10 21499
yading@10 21500 Set the number of samples which are printed on the same column. A
yading@10 21501 larger value will decrease the frame rate. Must be a positive
yading@10 21502 integer. This option can be set only if the value for I<rate>
yading@10 21503 is not explicitly specified.
yading@10 21504
yading@10 21505
yading@10 21506 =item B<rate, r>
yading@10 21507
yading@10 21508 Set the (approximate) output frame rate. This is done by setting the
yading@10 21509 option I<n>. Default value is "25".
yading@10 21510
yading@10 21511
yading@10 21512 =back
yading@10 21513
yading@10 21514
yading@10 21515
yading@10 21516 =head3 Examples
yading@10 21517
yading@10 21518
yading@10 21519
yading@10 21520 =over 4
yading@10 21521
yading@10 21522
yading@10 21523 =item *
yading@10 21524
yading@10 21525 Output the input file audio and the corresponding video representation
yading@10 21526 at the same time:
yading@10 21527
yading@10 21528 amovie=a.mp3,asplit[out0],showwaves[out1]
yading@10 21529
yading@10 21530
yading@10 21531
yading@10 21532 =item *
yading@10 21533
yading@10 21534 Create a synthetic signal and show it with showwaves, forcing a
yading@10 21535 frame rate of 30 frames per second:
yading@10 21536
yading@10 21537 aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
yading@10 21538
yading@10 21539
yading@10 21540 =back
yading@10 21541
yading@10 21542
yading@10 21543
yading@10 21544 =head2 split, asplit
yading@10 21545
yading@10 21546
yading@10 21547 Split input into several identical outputs.
yading@10 21548
yading@10 21549 C<asplit> works with audio input, C<split> with video.
yading@10 21550
yading@10 21551 The filter accepts a single parameter which specifies the number of outputs. If
yading@10 21552 unspecified, it defaults to 2.
yading@10 21553
yading@10 21554
yading@10 21555 =head3 Examples
yading@10 21556
yading@10 21557
yading@10 21558
yading@10 21559 =over 4
yading@10 21560
yading@10 21561
yading@10 21562 =item *
yading@10 21563
yading@10 21564 Create two separate outputs from the same input:
yading@10 21565
yading@10 21566 [in] split [out0][out1]
yading@10 21567
yading@10 21568
yading@10 21569
yading@10 21570 =item *
yading@10 21571
yading@10 21572 To create 3 or more outputs, you need to specify the number of
yading@10 21573 outputs, like in:
yading@10 21574
yading@10 21575 [in] asplit=3 [out0][out1][out2]
yading@10 21576
yading@10 21577
yading@10 21578
yading@10 21579 =item *
yading@10 21580
yading@10 21581 Create two separate outputs from the same input, one cropped and
yading@10 21582 one padded:
yading@10 21583
yading@10 21584 [in] split [splitout1][splitout2];
yading@10 21585 [splitout1] crop=100:100:0:0 [cropout];
yading@10 21586 [splitout2] pad=200:200:100:100 [padout];
yading@10 21587
yading@10 21588
yading@10 21589
yading@10 21590 =item *
yading@10 21591
yading@10 21592 Create 5 copies of the input audio with B<ffmpeg>:
yading@10 21593
yading@10 21594 ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
yading@10 21595
yading@10 21596
yading@10 21597 =back
yading@10 21598
yading@10 21599
yading@10 21600
yading@10 21601
yading@10 21602 =head1 MULTIMEDIA SOURCES
yading@10 21603
yading@10 21604
yading@10 21605 Below is a description of the currently available multimedia sources.
yading@10 21606
yading@10 21607
yading@10 21608 =head2 amovie
yading@10 21609
yading@10 21610
yading@10 21611 This is the same as movie source, except it selects an audio
yading@10 21612 stream by default.
yading@10 21613
yading@10 21614
yading@10 21615
yading@10 21616 =head2 movie
yading@10 21617
yading@10 21618
yading@10 21619 Read audio and/or video stream(s) from a movie container.
yading@10 21620
yading@10 21621 This filter accepts the following options:
yading@10 21622
yading@10 21623
yading@10 21624 =over 4
yading@10 21625
yading@10 21626
yading@10 21627 =item B<filename>
yading@10 21628
yading@10 21629 The name of the resource to read (not necessarily a file but also a device or a
yading@10 21630 stream accessed through some protocol).
yading@10 21631
yading@10 21632
yading@10 21633 =item B<format_name, f>
yading@10 21634
yading@10 21635 Specifies the format assumed for the movie to read, and can be either
yading@10 21636 the name of a container or an input device. If not specified the
yading@10 21637 format is guessed from I<movie_name> or by probing.
yading@10 21638
yading@10 21639
yading@10 21640 =item B<seek_point, sp>
yading@10 21641
yading@10 21642 Specifies the seek point in seconds, the frames will be output
yading@10 21643 starting from this seek point, the parameter is evaluated with
yading@10 21644 C<av_strtod> so the numerical value may be suffixed by an IS
yading@10 21645 postfix. Default value is "0".
yading@10 21646
yading@10 21647
yading@10 21648 =item B<streams, s>
yading@10 21649
yading@10 21650 Specifies the streams to read. Several streams can be specified,
yading@10 21651 separated by "+". The source will then have as many outputs, in the
yading@10 21652 same order. The syntax is explained in the ``Stream specifiers''
yading@10 21653 section in the ffmpeg manual. Two special names, "dv" and "da" specify
yading@10 21654 respectively the default (best suited) video and audio stream. Default
yading@10 21655 is "dv", or "da" if the filter is called as "amovie".
yading@10 21656
yading@10 21657
yading@10 21658 =item B<stream_index, si>
yading@10 21659
yading@10 21660 Specifies the index of the video stream to read. If the value is -1,
yading@10 21661 the best suited video stream will be automatically selected. Default
yading@10 21662 value is "-1". Deprecated. If the filter is called "amovie", it will select
yading@10 21663 audio instead of video.
yading@10 21664
yading@10 21665
yading@10 21666 =item B<loop>
yading@10 21667
yading@10 21668 Specifies how many times to read the stream in sequence.
yading@10 21669 If the value is less than 1, the stream will be read again and again.
yading@10 21670 Default value is "1".
yading@10 21671
yading@10 21672 Note that when the movie is looped the source timestamps are not
yading@10 21673 changed, so it will generate non monotonically increasing timestamps.
yading@10 21674
yading@10 21675 =back
yading@10 21676
yading@10 21677
yading@10 21678 This filter allows to overlay a second video on top of main input of
yading@10 21679 a filtergraph as shown in this graph:
yading@10 21680
yading@10 21681 input -----------> deltapts0 --> overlay --> output
yading@10 21682 ^
yading@10 21683 |
yading@10 21684 movie --> scale--> deltapts1 -------+
yading@10 21685
yading@10 21686
yading@10 21687
yading@10 21688 =head3 Examples
yading@10 21689
yading@10 21690
yading@10 21691
yading@10 21692 =over 4
yading@10 21693
yading@10 21694
yading@10 21695 =item *
yading@10 21696
yading@10 21697 Skip 3.2 seconds from the start of the avi file in.avi, and overlay it
yading@10 21698 on top of the input labelled as "in":
yading@10 21699
yading@10 21700 movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
yading@10 21701 [in] setpts=PTS-STARTPTS [main];
yading@10 21702 [main][over] overlay=16:16 [out]
yading@10 21703
yading@10 21704
yading@10 21705
yading@10 21706 =item *
yading@10 21707
yading@10 21708 Read from a video4linux2 device, and overlay it on top of the input
yading@10 21709 labelled as "in":
yading@10 21710
yading@10 21711 movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
yading@10 21712 [in] setpts=PTS-STARTPTS [main];
yading@10 21713 [main][over] overlay=16:16 [out]
yading@10 21714
yading@10 21715
yading@10 21716
yading@10 21717 =item *
yading@10 21718
yading@10 21719 Read the first video stream and the audio stream with id 0x81 from
yading@10 21720 dvd.vob; the video is connected to the pad named "video" and the audio is
yading@10 21721 connected to the pad named "audio":
yading@10 21722
yading@10 21723 movie=dvd.vob:s=v:0+#0x81 [video] [audio]
yading@10 21724
yading@10 21725
yading@10 21726 =back
yading@10 21727
yading@10 21728
yading@10 21729
yading@10 21730
yading@10 21731 =head1 SEE ALSO
yading@10 21732
yading@10 21733
yading@10 21734
yading@10 21735 ffprobe(1),
yading@10 21736 ffmpeg(1), ffplay(1), ffserver(1),
yading@10 21737 ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1),
yading@10 21738 ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1),
yading@10 21739 ffmpeg-devices(1), ffmpeg-protocols(1), ffmpeg-filters(1)
yading@10 21740
yading@10 21741
yading@10 21742 =head1 AUTHORS
yading@10 21743
yading@10 21744
yading@10 21745 The FFmpeg developers.
yading@10 21746
yading@10 21747 For details about the authorship, see the Git history of the project
yading@10 21748 (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
yading@10 21749 B<git log> in the FFmpeg source directory, or browsing the
yading@10 21750 online repository at E<lt>B<http://source.ffmpeg.org>E<gt>.
yading@10 21751
yading@10 21752 Maintainers for the specific components are listed in the file
yading@10 21753 F<MAINTAINERS> in the source code tree.
yading@10 21754
yading@10 21755
yading@10 21756