annotate ffmpeg/doc/ffmpeg-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 ffmpeg - ffmpeg video converter
yading@10 4
yading@10 5 =head1 SYNOPSIS
yading@10 6
yading@10 7
yading@10 8 ffmpeg [I<global_options>] {[I<input_file_options>] -i F<input_file>} ... {[I<output_file_options>] F<output_file>} ...
yading@10 9
yading@10 10
yading@10 11 =head1 DESCRIPTION
yading@10 12
yading@10 13
yading@10 14 B<ffmpeg> is a very fast video and audio converter that can also grab from
yading@10 15 a live audio/video source. It can also convert between arbitrary sample
yading@10 16 rates and resize video on the fly with a high quality polyphase filter.
yading@10 17
yading@10 18 B<ffmpeg> reads from an arbitrary number of input "files" (which can be regular
yading@10 19 files, pipes, network streams, grabbing devices, etc.), specified by the
yading@10 20 C<-i> option, and writes to an arbitrary number of output "files", which are
yading@10 21 specified by a plain output filename. Anything found on the command line which
yading@10 22 cannot be interpreted as an option is considered to be an output filename.
yading@10 23
yading@10 24 Each input or output file can, in principle, contain any number of streams of
yading@10 25 different types (video/audio/subtitle/attachment/data). The allowed number and/or
yading@10 26 types of streams may be limited by the container format. Selecting which
yading@10 27 streams from which inputs will go into which output is either done automatically
yading@10 28 or with the C<-map> option (see the Stream selection chapter).
yading@10 29
yading@10 30 To refer to input files in options, you must use their indices (0-based). E.g.
yading@10 31 the first input file is C<0>, the second is C<1>, etc. Similarly, streams
yading@10 32 within a file are referred to by their indices. E.g. C<2:3> refers to the
yading@10 33 fourth stream in the third input file. Also see the Stream specifiers chapter.
yading@10 34
yading@10 35 As a general rule, options are applied to the next specified
yading@10 36 file. Therefore, order is important, and you can have the same
yading@10 37 option on the command line multiple times. Each occurrence is
yading@10 38 then applied to the next input or output file.
yading@10 39 Exceptions from this rule are the global options (e.g. verbosity level),
yading@10 40 which should be specified first.
yading@10 41
yading@10 42 Do not mix input and output files -- first specify all input files, then all
yading@10 43 output files. Also do not mix options which belong to different files. All
yading@10 44 options apply ONLY to the next input or output file and are reset between files.
yading@10 45
yading@10 46
yading@10 47 =over 4
yading@10 48
yading@10 49
yading@10 50 =item *
yading@10 51
yading@10 52 To set the video bitrate of the output file to 64 kbit/s:
yading@10 53
yading@10 54 ffmpeg -i input.avi -b:v 64k -bufsize 64k output.avi
yading@10 55
yading@10 56
yading@10 57
yading@10 58 =item *
yading@10 59
yading@10 60 To force the frame rate of the output file to 24 fps:
yading@10 61
yading@10 62 ffmpeg -i input.avi -r 24 output.avi
yading@10 63
yading@10 64
yading@10 65
yading@10 66 =item *
yading@10 67
yading@10 68 To force the frame rate of the input file (valid for raw formats only)
yading@10 69 to 1 fps and the frame rate of the output file to 24 fps:
yading@10 70
yading@10 71 ffmpeg -r 1 -i input.m2v -r 24 output.avi
yading@10 72
yading@10 73
yading@10 74 =back
yading@10 75
yading@10 76
yading@10 77 The format option may be needed for raw input files.
yading@10 78
yading@10 79
yading@10 80
yading@10 81 =head1 DETAILED DESCRIPTION
yading@10 82
yading@10 83
yading@10 84 The transcoding process in B<ffmpeg> for each output can be described by
yading@10 85 the following diagram:
yading@10 86
yading@10 87
yading@10 88 _______ ______________ _________ ______________ ________
yading@10 89 | | | | | | | | | |
yading@10 90 | input | demuxer | encoded data | decoder | decoded | encoder | encoded data | muxer | output |
yading@10 91 | file | ---------> | packets | ---------> | frames | ---------> | packets | -------> | file |
yading@10 92 |_______| |______________| |_________| |______________| |________|
yading@10 93
yading@10 94
yading@10 95
yading@10 96 B<ffmpeg> calls the libavformat library (containing demuxers) to read
yading@10 97 input files and get packets containing encoded data from them. When there are
yading@10 98 multiple input files, B<ffmpeg> tries to keep them synchronized by
yading@10 99 tracking lowest timestamp on any active input stream.
yading@10 100
yading@10 101 Encoded packets are then passed to the decoder (unless streamcopy is selected
yading@10 102 for the stream, see further for a description). The decoder produces
yading@10 103 uncompressed frames (raw video/PCM audio/...) which can be processed further by
yading@10 104 filtering (see next section). After filtering, the frames are passed to the
yading@10 105 encoder, which encodes them and outputs encoded packets. Finally those are
yading@10 106 passed to the muxer, which writes the encoded packets to the output file.
yading@10 107
yading@10 108
yading@10 109 =head2 Filtering
yading@10 110
yading@10 111 Before encoding, B<ffmpeg> can process raw audio and video frames using
yading@10 112 filters from the libavfilter library. Several chained filters form a filter
yading@10 113 graph. B<ffmpeg> distinguishes between two types of filtergraphs:
yading@10 114 simple and complex.
yading@10 115
yading@10 116
yading@10 117 =head3 Simple filtergraphs
yading@10 118
yading@10 119 Simple filtergraphs are those that have exactly one input and output, both of
yading@10 120 the same type. In the above diagram they can be represented by simply inserting
yading@10 121 an additional step between decoding and encoding:
yading@10 122
yading@10 123
yading@10 124 _________ __________ ______________
yading@10 125 | | | | | |
yading@10 126 | decoded | simple filtergraph | filtered | encoder | encoded data |
yading@10 127 | frames | -------------------> | frames | ---------> | packets |
yading@10 128 |_________| |__________| |______________|
yading@10 129
yading@10 130
yading@10 131
yading@10 132 Simple filtergraphs are configured with the per-stream B<-filter> option
yading@10 133 (with B<-vf> and B<-af> aliases for video and audio respectively).
yading@10 134 A simple filtergraph for video can look for example like this:
yading@10 135
yading@10 136
yading@10 137 _______ _____________ _______ _____ ________
yading@10 138 | | | | | | | | | |
yading@10 139 | input | ---> | deinterlace | ---> | scale | ---> | fps | ---> | output |
yading@10 140 |_______| |_____________| |_______| |_____| |________|
yading@10 141
yading@10 142
yading@10 143
yading@10 144 Note that some filters change frame properties but not frame contents. E.g. the
yading@10 145 C<fps> filter in the example above changes number of frames, but does not
yading@10 146 touch the frame contents. Another example is the C<setpts> filter, which
yading@10 147 only sets timestamps and otherwise passes the frames unchanged.
yading@10 148
yading@10 149
yading@10 150 =head3 Complex filtergraphs
yading@10 151
yading@10 152 Complex filtergraphs are those which cannot be described as simply a linear
yading@10 153 processing chain applied to one stream. This is the case, for example, when the graph has
yading@10 154 more than one input and/or output, or when output stream type is different from
yading@10 155 input. They can be represented with the following diagram:
yading@10 156
yading@10 157
yading@10 158 _________
yading@10 159 | |
yading@10 160 | input 0 |\ __________
yading@10 161 |_________| \ | |
yading@10 162 \ _________ /| output 0 |
yading@10 163 \ | | / |__________|
yading@10 164 _________ \| complex | /
yading@10 165 | | | |/
yading@10 166 | input 1 |---->| filter |\
yading@10 167 |_________| | | \ __________
yading@10 168 /| graph | \ | |
yading@10 169 / | | \| output 1 |
yading@10 170 _________ / |_________| |__________|
yading@10 171 | | /
yading@10 172 | input 2 |/
yading@10 173 |_________|
yading@10 174
yading@10 175
yading@10 176
yading@10 177 Complex filtergraphs are configured with the B<-filter_complex> option.
yading@10 178 Note that this option is global, since a complex filtergraph, by its nature,
yading@10 179 cannot be unambiguously associated with a single stream or file.
yading@10 180
yading@10 181 The B<-lavfi> option is equivalent to B<-filter_complex>.
yading@10 182
yading@10 183 A trivial example of a complex filtergraph is the C<overlay> filter, which
yading@10 184 has two video inputs and one video output, containing one video overlaid on top
yading@10 185 of the other. Its audio counterpart is the C<amix> filter.
yading@10 186
yading@10 187
yading@10 188 =head2 Stream copy
yading@10 189
yading@10 190 Stream copy is a mode selected by supplying the C<copy> parameter to the
yading@10 191 B<-codec> option. It makes B<ffmpeg> omit the decoding and encoding
yading@10 192 step for the specified stream, so it does only demuxing and muxing. It is useful
yading@10 193 for changing the container format or modifying container-level metadata. The
yading@10 194 diagram above will, in this case, simplify to this:
yading@10 195
yading@10 196
yading@10 197 _______ ______________ ________
yading@10 198 | | | | | |
yading@10 199 | input | demuxer | encoded data | muxer | output |
yading@10 200 | file | ---------> | packets | -------> | file |
yading@10 201 |_______| |______________| |________|
yading@10 202
yading@10 203
yading@10 204
yading@10 205 Since there is no decoding or encoding, it is very fast and there is no quality
yading@10 206 loss. However, it might not work in some cases because of many factors. Applying
yading@10 207 filters is obviously also impossible, since filters work on uncompressed data.
yading@10 208
yading@10 209
yading@10 210
yading@10 211 =head1 STREAM SELECTION
yading@10 212
yading@10 213
yading@10 214 By default, B<ffmpeg> includes only one stream of each type (video, audio, subtitle)
yading@10 215 present in the input files and adds them to each output file. It picks the
yading@10 216 "best" of each based upon the following criteria: for video, it is the stream
yading@10 217 with the highest resolution, for audio, it is the stream with the most channels, for
yading@10 218 subtitles, it is the first subtitle stream. In the case where several streams of
yading@10 219 the same type rate equally, the stream with the lowest index is chosen.
yading@10 220
yading@10 221 You can disable some of those defaults by using the C<-vn/-an/-sn> options. For
yading@10 222 full manual control, use the C<-map> option, which disables the defaults just
yading@10 223 described.
yading@10 224
yading@10 225
yading@10 226
yading@10 227 =head1 OPTIONS
yading@10 228
yading@10 229
yading@10 230 All the numerical options, if not specified otherwise, accept a string
yading@10 231 representing a number as input, which may be followed by one of the SI
yading@10 232 unit prefixes, for example: 'K', 'M', or 'G'.
yading@10 233
yading@10 234 If 'i' is appended to the SI unit prefix, the complete prefix will be
yading@10 235 interpreted as a unit prefix for binary multiplies, which are based on
yading@10 236 powers of 1024 instead of powers of 1000. Appending 'B' to the SI unit
yading@10 237 prefix multiplies the value by 8. This allows using, for example:
yading@10 238 'KB', 'MiB', 'G' and 'B' as number suffixes.
yading@10 239
yading@10 240 Options which do not take arguments are boolean options, and set the
yading@10 241 corresponding value to true. They can be set to false by prefixing
yading@10 242 the option name with "no". For example using "-nofoo"
yading@10 243 will set the boolean option with name "foo" to false.
yading@10 244
yading@10 245
yading@10 246
yading@10 247 =head2 Stream specifiers
yading@10 248
yading@10 249 Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
yading@10 250 are used to precisely specify which stream(s) a given option belongs to.
yading@10 251
yading@10 252 A stream specifier is a string generally appended to the option name and
yading@10 253 separated from it by a colon. E.g. C<-codec:a:1 ac3> contains the
yading@10 254 C<a:1> stream specifier, which matches the second audio stream. Therefore, it
yading@10 255 would select the ac3 codec for the second audio stream.
yading@10 256
yading@10 257 A stream specifier can match several streams, so that the option is applied to all
yading@10 258 of them. E.g. the stream specifier in C<-b:a 128k> matches all audio
yading@10 259 streams.
yading@10 260
yading@10 261 An empty stream specifier matches all streams. For example, C<-codec copy>
yading@10 262 or C<-codec: copy> would copy all the streams without reencoding.
yading@10 263
yading@10 264 Possible forms of stream specifiers are:
yading@10 265
yading@10 266 =over 4
yading@10 267
yading@10 268
yading@10 269 =item I<stream_index>
yading@10 270
yading@10 271 Matches the stream with this index. E.g. C<-threads:1 4> would set the
yading@10 272 thread count for the second stream to 4.
yading@10 273
yading@10 274 =item I<stream_type>B<[:>I<stream_index>B<]>
yading@10 275
yading@10 276 I<stream_type> is one of following: 'v' for video, 'a' for audio, 's' for subtitle,
yading@10 277 'd' for data, and 't' for attachments. If I<stream_index> is given, then it matches
yading@10 278 stream number I<stream_index> of this type. Otherwise, it matches all
yading@10 279 streams of this type.
yading@10 280
yading@10 281 =item B<p:>I<program_id>B<[:>I<stream_index>B<]>
yading@10 282
yading@10 283 If I<stream_index> is given, then it matches the stream with number I<stream_index>
yading@10 284 in the program with the id I<program_id>. Otherwise, it matches all streams in the
yading@10 285 program.
yading@10 286
yading@10 287 =item B<#>I<stream_id>
yading@10 288
yading@10 289 Matches the stream by a format-specific ID.
yading@10 290
yading@10 291 =back
yading@10 292
yading@10 293
yading@10 294
yading@10 295 =head2 Generic options
yading@10 296
yading@10 297
yading@10 298 These options are shared amongst the ff* tools.
yading@10 299
yading@10 300
yading@10 301 =over 4
yading@10 302
yading@10 303
yading@10 304
yading@10 305 =item B<-L>
yading@10 306
yading@10 307 Show license.
yading@10 308
yading@10 309
yading@10 310 =item B<-h, -?, -help, --help [>I<arg>B<]>
yading@10 311
yading@10 312 Show help. An optional parameter may be specified to print help about a specific
yading@10 313 item.
yading@10 314
yading@10 315 Possible values of I<arg> are:
yading@10 316
yading@10 317 =over 4
yading@10 318
yading@10 319
yading@10 320 =item B<decoder=>I<decoder_name>
yading@10 321
yading@10 322 Print detailed information about the decoder named I<decoder_name>. Use the
yading@10 323 B<-decoders> option to get a list of all decoders.
yading@10 324
yading@10 325
yading@10 326 =item B<encoder=>I<encoder_name>
yading@10 327
yading@10 328 Print detailed information about the encoder named I<encoder_name>. Use the
yading@10 329 B<-encoders> option to get a list of all encoders.
yading@10 330
yading@10 331
yading@10 332 =item B<demuxer=>I<demuxer_name>
yading@10 333
yading@10 334 Print detailed information about the demuxer named I<demuxer_name>. Use the
yading@10 335 B<-formats> option to get a list of all demuxers and muxers.
yading@10 336
yading@10 337
yading@10 338 =item B<muxer=>I<muxer_name>
yading@10 339
yading@10 340 Print detailed information about the muxer named I<muxer_name>. Use the
yading@10 341 B<-formats> option to get a list of all muxers and demuxers.
yading@10 342
yading@10 343
yading@10 344 =item B<filter=>I<filter_name>
yading@10 345
yading@10 346 Print detailed information about the filter name I<filter_name>. Use the
yading@10 347 B<-filters> option to get a list of all filters.
yading@10 348
yading@10 349
yading@10 350 =back
yading@10 351
yading@10 352
yading@10 353
yading@10 354 =item B<-version>
yading@10 355
yading@10 356 Show version.
yading@10 357
yading@10 358
yading@10 359 =item B<-formats>
yading@10 360
yading@10 361 Show available formats.
yading@10 362
yading@10 363
yading@10 364 =item B<-codecs>
yading@10 365
yading@10 366 Show all codecs known to libavcodec.
yading@10 367
yading@10 368 Note that the term 'codec' is used throughout this documentation as a shortcut
yading@10 369 for what is more correctly called a media bitstream format.
yading@10 370
yading@10 371
yading@10 372 =item B<-decoders>
yading@10 373
yading@10 374 Show available decoders.
yading@10 375
yading@10 376
yading@10 377 =item B<-encoders>
yading@10 378
yading@10 379 Show all available encoders.
yading@10 380
yading@10 381
yading@10 382 =item B<-bsfs>
yading@10 383
yading@10 384 Show available bitstream filters.
yading@10 385
yading@10 386
yading@10 387 =item B<-protocols>
yading@10 388
yading@10 389 Show available protocols.
yading@10 390
yading@10 391
yading@10 392 =item B<-filters>
yading@10 393
yading@10 394 Show available libavfilter filters.
yading@10 395
yading@10 396
yading@10 397 =item B<-pix_fmts>
yading@10 398
yading@10 399 Show available pixel formats.
yading@10 400
yading@10 401
yading@10 402 =item B<-sample_fmts>
yading@10 403
yading@10 404 Show available sample formats.
yading@10 405
yading@10 406
yading@10 407 =item B<-layouts>
yading@10 408
yading@10 409 Show channel names and standard channel layouts.
yading@10 410
yading@10 411
yading@10 412 =item B<-loglevel [repeat+]>I<loglevel> B<| -v [repeat+]>I<loglevel>
yading@10 413
yading@10 414 Set the logging level used by the library.
yading@10 415 Adding "repeat+" indicates that repeated log output should not be compressed
yading@10 416 to the first line and the "Last message repeated n times" line will be
yading@10 417 omitted. "repeat" can also be used alone.
yading@10 418 If "repeat" is used alone, and with no prior loglevel set, the default
yading@10 419 loglevel will be used. If multiple loglevel parameters are given, using
yading@10 420 'repeat' will not change the loglevel.
yading@10 421 I<loglevel> is a number or a string containing one of the following values:
yading@10 422
yading@10 423 =over 4
yading@10 424
yading@10 425
yading@10 426 =item B<quiet>
yading@10 427
yading@10 428 Show nothing at all; be silent.
yading@10 429
yading@10 430 =item B<panic>
yading@10 431
yading@10 432 Only show fatal errors which could lead the process to crash, such as
yading@10 433 and assert failure. This is not currently used for anything.
yading@10 434
yading@10 435 =item B<fatal>
yading@10 436
yading@10 437 Only show fatal errors. These are errors after which the process absolutely
yading@10 438 cannot continue after.
yading@10 439
yading@10 440 =item B<error>
yading@10 441
yading@10 442 Show all errors, including ones which can be recovered from.
yading@10 443
yading@10 444 =item B<warning>
yading@10 445
yading@10 446 Show all warnings and errors. Any message related to possibly
yading@10 447 incorrect or unexpected events will be shown.
yading@10 448
yading@10 449 =item B<info>
yading@10 450
yading@10 451 Show informative messages during processing. This is in addition to
yading@10 452 warnings and errors. This is the default value.
yading@10 453
yading@10 454 =item B<verbose>
yading@10 455
yading@10 456 Same as C<info>, except more verbose.
yading@10 457
yading@10 458 =item B<debug>
yading@10 459
yading@10 460 Show everything, including debugging information.
yading@10 461
yading@10 462 =back
yading@10 463
yading@10 464
yading@10 465 By default the program logs to stderr, if coloring is supported by the
yading@10 466 terminal, colors are used to mark errors and warnings. Log coloring
yading@10 467 can be disabled setting the environment variable
yading@10 468 B<AV_LOG_FORCE_NOCOLOR> or B<NO_COLOR>, or can be forced setting
yading@10 469 the environment variable B<AV_LOG_FORCE_COLOR>.
yading@10 470 The use of the environment variable B<NO_COLOR> is deprecated and
yading@10 471 will be dropped in a following FFmpeg version.
yading@10 472
yading@10 473
yading@10 474 =item B<-report>
yading@10 475
yading@10 476 Dump full command line and console output to a file named
yading@10 477 C<I<program>-I<YYYYMMDD>-I<HHMMSS>.log> in the current
yading@10 478 directory.
yading@10 479 This file can be useful for bug reports.
yading@10 480 It also implies C<-loglevel verbose>.
yading@10 481
yading@10 482 Setting the environment variable C<FFREPORT> to any value has the
yading@10 483 same effect. If the value is a ':'-separated key=value sequence, these
yading@10 484 options will affect the report; options values must be escaped if they
yading@10 485 contain special characters or the options delimiter ':' (see the
yading@10 486 ``Quoting and escaping'' section in the ffmpeg-utils manual). The
yading@10 487 following option is recognized:
yading@10 488
yading@10 489 =over 4
yading@10 490
yading@10 491
yading@10 492 =item B<file>
yading@10 493
yading@10 494 set the file name to use for the report; C<%p> is expanded to the name
yading@10 495 of the program, C<%t> is expanded to a timestamp, C<%%> is expanded
yading@10 496 to a plain C<%>
yading@10 497
yading@10 498 =back
yading@10 499
yading@10 500
yading@10 501 Errors in parsing the environment variable are not fatal, and will not
yading@10 502 appear in the report.
yading@10 503
yading@10 504
yading@10 505 =item B<-cpuflags flags (>I<global>B<)>
yading@10 506
yading@10 507 Allows setting and clearing cpu flags. This option is intended
yading@10 508 for testing. Do not use it unless you know what you're doing.
yading@10 509
yading@10 510 ffmpeg -cpuflags -sse+mmx ...
yading@10 511 ffmpeg -cpuflags mmx ...
yading@10 512 ffmpeg -cpuflags 0 ...
yading@10 513
yading@10 514 Possible flags for this option are:
yading@10 515
yading@10 516 =over 4
yading@10 517
yading@10 518
yading@10 519 =item B<x86>
yading@10 520
yading@10 521
yading@10 522 =over 4
yading@10 523
yading@10 524
yading@10 525 =item B<mmx>
yading@10 526
yading@10 527
yading@10 528 =item B<mmxext>
yading@10 529
yading@10 530
yading@10 531 =item B<sse>
yading@10 532
yading@10 533
yading@10 534 =item B<sse2>
yading@10 535
yading@10 536
yading@10 537 =item B<sse2slow>
yading@10 538
yading@10 539
yading@10 540 =item B<sse3>
yading@10 541
yading@10 542
yading@10 543 =item B<sse3slow>
yading@10 544
yading@10 545
yading@10 546 =item B<ssse3>
yading@10 547
yading@10 548
yading@10 549 =item B<atom>
yading@10 550
yading@10 551
yading@10 552 =item B<sse4.1>
yading@10 553
yading@10 554
yading@10 555 =item B<sse4.2>
yading@10 556
yading@10 557
yading@10 558 =item B<avx>
yading@10 559
yading@10 560
yading@10 561 =item B<xop>
yading@10 562
yading@10 563
yading@10 564 =item B<fma4>
yading@10 565
yading@10 566
yading@10 567 =item B<3dnow>
yading@10 568
yading@10 569
yading@10 570 =item B<3dnowext>
yading@10 571
yading@10 572
yading@10 573 =item B<cmov>
yading@10 574
yading@10 575
yading@10 576 =back
yading@10 577
yading@10 578
yading@10 579 =item B<ARM>
yading@10 580
yading@10 581
yading@10 582 =over 4
yading@10 583
yading@10 584
yading@10 585 =item B<armv5te>
yading@10 586
yading@10 587
yading@10 588 =item B<armv6>
yading@10 589
yading@10 590
yading@10 591 =item B<armv6t2>
yading@10 592
yading@10 593
yading@10 594 =item B<vfp>
yading@10 595
yading@10 596
yading@10 597 =item B<vfpv3>
yading@10 598
yading@10 599
yading@10 600 =item B<neon>
yading@10 601
yading@10 602
yading@10 603 =back
yading@10 604
yading@10 605
yading@10 606 =item B<PowerPC>
yading@10 607
yading@10 608
yading@10 609 =over 4
yading@10 610
yading@10 611
yading@10 612 =item B<altivec>
yading@10 613
yading@10 614
yading@10 615 =back
yading@10 616
yading@10 617
yading@10 618 =item B<Specific Processors>
yading@10 619
yading@10 620
yading@10 621 =over 4
yading@10 622
yading@10 623
yading@10 624 =item B<pentium2>
yading@10 625
yading@10 626
yading@10 627 =item B<pentium3>
yading@10 628
yading@10 629
yading@10 630 =item B<pentium4>
yading@10 631
yading@10 632
yading@10 633 =item B<k6>
yading@10 634
yading@10 635
yading@10 636 =item B<k62>
yading@10 637
yading@10 638
yading@10 639 =item B<athlon>
yading@10 640
yading@10 641
yading@10 642 =item B<athlonxp>
yading@10 643
yading@10 644
yading@10 645 =item B<k8>
yading@10 646
yading@10 647
yading@10 648 =back
yading@10 649
yading@10 650
yading@10 651 =back
yading@10 652
yading@10 653
yading@10 654
yading@10 655 =item B<-opencl_options options (>I<global>B<)>
yading@10 656
yading@10 657 Set OpenCL environment options. This option is only available when
yading@10 658 FFmpeg has been compiled with C<--enable-opencl>.
yading@10 659
yading@10 660 I<options> must be a list of I<key>=I<value> option pairs
yading@10 661 separated by ':'. See the ``OpenCL Options'' section in the
yading@10 662 ffmpeg-utils manual for the list of supported options.
yading@10 663
yading@10 664 =back
yading@10 665
yading@10 666
yading@10 667
yading@10 668 =head2 AVOptions
yading@10 669
yading@10 670
yading@10 671 These options are provided directly by the libavformat, libavdevice and
yading@10 672 libavcodec libraries. To see the list of available AVOptions, use the
yading@10 673 B<-help> option. They are separated into two categories:
yading@10 674
yading@10 675 =over 4
yading@10 676
yading@10 677
yading@10 678 =item B<generic>
yading@10 679
yading@10 680 These options can be set for any container, codec or device. Generic options
yading@10 681 are listed under AVFormatContext options for containers/devices and under
yading@10 682 AVCodecContext options for codecs.
yading@10 683
yading@10 684 =item B<private>
yading@10 685
yading@10 686 These options are specific to the given container, device or codec. Private
yading@10 687 options are listed under their corresponding containers/devices/codecs.
yading@10 688
yading@10 689 =back
yading@10 690
yading@10 691
yading@10 692 For example to write an ID3v2.3 header instead of a default ID3v2.4 to
yading@10 693 an MP3 file, use the B<id3v2_version> private option of the MP3
yading@10 694 muxer:
yading@10 695
yading@10 696 ffmpeg -i input.flac -id3v2_version 3 out.mp3
yading@10 697
yading@10 698
yading@10 699 All codec AVOptions are obviously per-stream, so the chapter on stream
yading@10 700 specifiers applies to them
yading@10 701
yading@10 702 Note B<-nooption> syntax cannot be used for boolean AVOptions,
yading@10 703 use B<-option 0>/B<-option 1>.
yading@10 704
yading@10 705 Note2 old undocumented way of specifying per-stream AVOptions by prepending
yading@10 706 v/a/s to the options name is now obsolete and will be removed soon.
yading@10 707
yading@10 708
yading@10 709 =head2 Main options
yading@10 710
yading@10 711
yading@10 712
yading@10 713 =over 4
yading@10 714
yading@10 715
yading@10 716
yading@10 717 =item B<-f> I<fmt> B<(>I<input/output>B<)>
yading@10 718
yading@10 719 Force input or output file format. The format is normally auto detected for input
yading@10 720 files and guessed from the file extension for output files, so this option is not
yading@10 721 needed in most cases.
yading@10 722
yading@10 723
yading@10 724 =item B<-i> I<filename> B<(>I<input>B<)>
yading@10 725
yading@10 726 input file name
yading@10 727
yading@10 728
yading@10 729 =item B<-y (>I<global>B<)>
yading@10 730
yading@10 731 Overwrite output files without asking.
yading@10 732
yading@10 733
yading@10 734 =item B<-n (>I<global>B<)>
yading@10 735
yading@10 736 Do not overwrite output files, and exit immediately if a specified
yading@10 737 output file already exists.
yading@10 738
yading@10 739
yading@10 740 =item B<-c[:>I<stream_specifier>B<]> I<codec> B<(>I<input/output,per-stream>B<)>
yading@10 741
yading@10 742
yading@10 743 =item B<-codec[:>I<stream_specifier>B<]> I<codec> B<(>I<input/output,per-stream>B<)>
yading@10 744
yading@10 745 Select an encoder (when used before an output file) or a decoder (when used
yading@10 746 before an input file) for one or more streams. I<codec> is the name of a
yading@10 747 decoder/encoder or a special value C<copy> (output only) to indicate that
yading@10 748 the stream is not to be re-encoded.
yading@10 749
yading@10 750 For example
yading@10 751
yading@10 752 ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
yading@10 753
yading@10 754 encodes all video streams with libx264 and copies all audio streams.
yading@10 755
yading@10 756 For each stream, the last matching C<c> option is applied, so
yading@10 757
yading@10 758 ffmpeg -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT
yading@10 759
yading@10 760 will copy all the streams except the second video, which will be encoded with
yading@10 761 libx264, and the 138th audio, which will be encoded with libvorbis.
yading@10 762
yading@10 763
yading@10 764 =item B<-t> I<duration> B<(>I<output>B<)>
yading@10 765
yading@10 766 Stop writing the output after its duration reaches I<duration>.
yading@10 767 I<duration> may be a number in seconds, or in C<hh:mm:ss[.xxx]> form.
yading@10 768
yading@10 769 -to and -t are mutually exclusive and -t has priority.
yading@10 770
yading@10 771
yading@10 772 =item B<-to> I<position> B<(>I<output>B<)>
yading@10 773
yading@10 774 Stop writing the output at I<position>.
yading@10 775 I<position> may be a number in seconds, or in C<hh:mm:ss[.xxx]> form.
yading@10 776
yading@10 777 -to and -t are mutually exclusive and -t has priority.
yading@10 778
yading@10 779
yading@10 780 =item B<-fs> I<limit_size> B<(>I<output>B<)>
yading@10 781
yading@10 782 Set the file size limit, expressed in bytes.
yading@10 783
yading@10 784
yading@10 785 =item B<-ss> I<position> B<(>I<input/output>B<)>
yading@10 786
yading@10 787 When used as an input option (before C<-i>), seeks in this input file to
yading@10 788 I<position>. When used as an output option (before an output filename),
yading@10 789 decodes but discards input until the timestamps reach I<position>. This is
yading@10 790 slower, but more accurate.
yading@10 791
yading@10 792 I<position> may be either in seconds or in C<hh:mm:ss[.xxx]> form.
yading@10 793
yading@10 794
yading@10 795 =item B<-itsoffset> I<offset> B<(>I<input>B<)>
yading@10 796
yading@10 797 Set the input time offset in seconds.
yading@10 798 C<[-]hh:mm:ss[.xxx]> syntax is also supported.
yading@10 799 The offset is added to the timestamps of the input files.
yading@10 800 Specifying a positive offset means that the corresponding
yading@10 801 streams are delayed by I<offset> seconds.
yading@10 802
yading@10 803
yading@10 804 =item B<-timestamp> I<time> B<(>I<output>B<)>
yading@10 805
yading@10 806 Set the recording timestamp in the container.
yading@10 807 The syntax for I<time> is:
yading@10 808
yading@10 809 now|([(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...])|(HHMMSS[.m...]))[Z|z])
yading@10 810
yading@10 811 If the value is "now" it takes the current time.
yading@10 812 Time is local time unless 'Z' or 'z' is appended, in which case it is
yading@10 813 interpreted as UTC.
yading@10 814 If the year-month-day part is not specified it takes the current
yading@10 815 year-month-day.
yading@10 816
yading@10 817
yading@10 818 =item B<-metadata[:metadata_specifier]> I<key>B<=>I<value> B<(>I<output,per-metadata>B<)>
yading@10 819
yading@10 820 Set a metadata key/value pair.
yading@10 821
yading@10 822 An optional I<metadata_specifier> may be given to set metadata
yading@10 823 on streams or chapters. See C<-map_metadata> documentation for
yading@10 824 details.
yading@10 825
yading@10 826 This option overrides metadata set with C<-map_metadata>. It is
yading@10 827 also possible to delete metadata by using an empty value.
yading@10 828
yading@10 829 For example, for setting the title in the output file:
yading@10 830
yading@10 831 ffmpeg -i in.avi -metadata title="my title" out.flv
yading@10 832
yading@10 833
yading@10 834 To set the language of the first audio stream:
yading@10 835
yading@10 836 ffmpeg -i INPUT -metadata:s:a:1 language=eng OUTPUT
yading@10 837
yading@10 838
yading@10 839
yading@10 840 =item B<-target> I<type> B<(>I<output>B<)>
yading@10 841
yading@10 842 Specify target file type (C<vcd>, C<svcd>, C<dvd>, C<dv>,
yading@10 843 C<dv50>). I<type> may be prefixed with C<pal->, C<ntsc-> or
yading@10 844 C<film-> to use the corresponding standard. All the format options
yading@10 845 (bitrate, codecs, buffer sizes) are then set automatically. You can just type:
yading@10 846
yading@10 847
yading@10 848 ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
yading@10 849
yading@10 850
yading@10 851 Nevertheless you can specify additional options as long as you know
yading@10 852 they do not conflict with the standard, as in:
yading@10 853
yading@10 854
yading@10 855 ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
yading@10 856
yading@10 857
yading@10 858
yading@10 859 =item B<-dframes> I<number> B<(>I<output>B<)>
yading@10 860
yading@10 861 Set the number of data frames to record. This is an alias for C<-frames:d>.
yading@10 862
yading@10 863
yading@10 864 =item B<-frames[:>I<stream_specifier>B<]> I<framecount> B<(>I<output,per-stream>B<)>
yading@10 865
yading@10 866 Stop writing to the stream after I<framecount> frames.
yading@10 867
yading@10 868
yading@10 869 =item B<-q[:>I<stream_specifier>B<]> I<q> B<(>I<output,per-stream>B<)>
yading@10 870
yading@10 871
yading@10 872 =item B<-qscale[:>I<stream_specifier>B<]> I<q> B<(>I<output,per-stream>B<)>
yading@10 873
yading@10 874 Use fixed quality scale (VBR). The meaning of I<q> is
yading@10 875 codec-dependent.
yading@10 876
yading@10 877
yading@10 878
yading@10 879 =item B<-filter[:>I<stream_specifier>B<]> I<filtergraph> B<(>I<output,per-stream>B<)>
yading@10 880
yading@10 881 Create the filtergraph specified by I<filtergraph> and use it to
yading@10 882 filter the stream.
yading@10 883
yading@10 884 I<filtergraph> is a description of the filtergraph to apply to
yading@10 885 the stream, and must have a single input and a single output of the
yading@10 886 same type of the stream. In the filtergraph, the input is associated
yading@10 887 to the label C<in>, and the output to the label C<out>. See
yading@10 888 the ffmpeg-filters manual for more information about the filtergraph
yading@10 889 syntax.
yading@10 890
yading@10 891 See the -filter_complex option if you
yading@10 892 want to create filtergraphs with multiple inputs and/or outputs.
yading@10 893
yading@10 894
yading@10 895 =item B<-filter_script[:>I<stream_specifier>B<]> I<filename> B<(>I<output,per-stream>B<)>
yading@10 896
yading@10 897 This option is similar to B<-filter>, the only difference is that its
yading@10 898 argument is the name of the file from which a filtergraph description is to be
yading@10 899 read.
yading@10 900
yading@10 901
yading@10 902 =item B<-pre[:>I<stream_specifier>B<]> I<preset_name> B<(>I<output,per-stream>B<)>
yading@10 903
yading@10 904 Specify the preset for matching stream(s).
yading@10 905
yading@10 906
yading@10 907 =item B<-stats (>I<global>B<)>
yading@10 908
yading@10 909 Print encoding progress/statistics. It is on by default, to explicitly
yading@10 910 disable it you need to specify C<-nostats>.
yading@10 911
yading@10 912
yading@10 913 =item B<-progress> I<url> B<(>I<global>B<)>
yading@10 914
yading@10 915 Send program-friendly progress information to I<url>.
yading@10 916
yading@10 917 Progress information is written approximately every second and at the end of
yading@10 918 the encoding process. It is made of "I<key>=I<value>" lines. I<key>
yading@10 919 consists of only alphanumeric characters. The last key of a sequence of
yading@10 920 progress information is always "progress".
yading@10 921
yading@10 922
yading@10 923 =item B<-stdin>
yading@10 924
yading@10 925 Enable interaction on standard input. On by default unless standard input is
yading@10 926 used as an input. To explicitly disable interaction you need to specify
yading@10 927 C<-nostdin>.
yading@10 928
yading@10 929 Disabling interaction on standard input is useful, for example, if
yading@10 930 ffmpeg is in the background process group. Roughly the same result can
yading@10 931 be achieved with C<ffmpeg ... E<lt> /dev/null> but it requires a
yading@10 932 shell.
yading@10 933
yading@10 934
yading@10 935 =item B<-debug_ts (>I<global>B<)>
yading@10 936
yading@10 937 Print timestamp information. It is off by default. This option is
yading@10 938 mostly useful for testing and debugging purposes, and the output
yading@10 939 format may change from one version to another, so it should not be
yading@10 940 employed by portable scripts.
yading@10 941
yading@10 942 See also the option C<-fdebug ts>.
yading@10 943
yading@10 944
yading@10 945 =item B<-attach> I<filename> B<(>I<output>B<)>
yading@10 946
yading@10 947 Add an attachment to the output file. This is supported by a few formats
yading@10 948 like Matroska for e.g. fonts used in rendering subtitles. Attachments
yading@10 949 are implemented as a specific type of stream, so this option will add
yading@10 950 a new stream to the file. It is then possible to use per-stream options
yading@10 951 on this stream in the usual way. Attachment streams created with this
yading@10 952 option will be created after all the other streams (i.e. those created
yading@10 953 with C<-map> or automatic mappings).
yading@10 954
yading@10 955 Note that for Matroska you also have to set the mimetype metadata tag:
yading@10 956
yading@10 957 ffmpeg -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv
yading@10 958
yading@10 959 (assuming that the attachment stream will be third in the output file).
yading@10 960
yading@10 961
yading@10 962 =item B<-dump_attachment[:>I<stream_specifier>B<]> I<filename> B<(>I<input,per-stream>B<)>
yading@10 963
yading@10 964 Extract the matching attachment stream into a file named I<filename>. If
yading@10 965 I<filename> is empty, then the value of the C<filename> metadata tag
yading@10 966 will be used.
yading@10 967
yading@10 968 E.g. to extract the first attachment to a file named 'out.ttf':
yading@10 969
yading@10 970 ffmpeg -dump_attachment:t:0 out.ttf -i INPUT
yading@10 971
yading@10 972 To extract all attachments to files determined by the C<filename> tag:
yading@10 973
yading@10 974 ffmpeg -dump_attachment:t "" -i INPUT
yading@10 975
yading@10 976
yading@10 977 Technical note -- attachments are implemented as codec extradata, so this
yading@10 978 option can actually be used to extract extradata from any stream, not just
yading@10 979 attachments.
yading@10 980
yading@10 981
yading@10 982 =back
yading@10 983
yading@10 984
yading@10 985
yading@10 986 =head2 Video Options
yading@10 987
yading@10 988
yading@10 989
yading@10 990 =over 4
yading@10 991
yading@10 992
yading@10 993 =item B<-vframes> I<number> B<(>I<output>B<)>
yading@10 994
yading@10 995 Set the number of video frames to record. This is an alias for C<-frames:v>.
yading@10 996
yading@10 997 =item B<-r[:>I<stream_specifier>B<]> I<fps> B<(>I<input/output,per-stream>B<)>
yading@10 998
yading@10 999 Set frame rate (Hz value, fraction or abbreviation).
yading@10 1000
yading@10 1001 As an input option, ignore any timestamps stored in the file and instead
yading@10 1002 generate timestamps assuming constant frame rate I<fps>.
yading@10 1003
yading@10 1004 As an output option, duplicate or drop input frames to achieve constant output
yading@10 1005 frame rate I<fps>.
yading@10 1006
yading@10 1007
yading@10 1008 =item B<-s[:>I<stream_specifier>B<]> I<size> B<(>I<input/output,per-stream>B<)>
yading@10 1009
yading@10 1010 Set frame size.
yading@10 1011
yading@10 1012 As an input option, this is a shortcut for the B<video_size> private
yading@10 1013 option, recognized by some demuxers for which the frame size is either not
yading@10 1014 stored in the file or is configurable -- e.g. raw video or video grabbers.
yading@10 1015
yading@10 1016 As an output option, this inserts the C<scale> video filter to the
yading@10 1017 I<end> of the corresponding filtergraph. Please use the C<scale> filter
yading@10 1018 directly to insert it at the beginning or some other place.
yading@10 1019
yading@10 1020 The format is B<wxh> (default - same as source).
yading@10 1021
yading@10 1022
yading@10 1023 =item B<-aspect[:>I<stream_specifier>B<]> I<aspect> B<(>I<output,per-stream>B<)>
yading@10 1024
yading@10 1025 Set the video display aspect ratio specified by I<aspect>.
yading@10 1026
yading@10 1027 I<aspect> can be a floating point number string, or a string of the
yading@10 1028 form I<num>:I<den>, where I<num> and I<den> are the
yading@10 1029 numerator and denominator of the aspect ratio. For example "4:3",
yading@10 1030 "16:9", "1.3333", and "1.7777" are valid argument values.
yading@10 1031
yading@10 1032 If used together with B<-vcodec copy>, it will affect the aspect ratio
yading@10 1033 stored at container level, but not the aspect ratio stored in encoded
yading@10 1034 frames, if it exists.
yading@10 1035
yading@10 1036
yading@10 1037 =item B<-vn (>I<output>B<)>
yading@10 1038
yading@10 1039 Disable video recording.
yading@10 1040
yading@10 1041
yading@10 1042 =item B<-vcodec> I<codec> B<(>I<output>B<)>
yading@10 1043
yading@10 1044 Set the video codec. This is an alias for C<-codec:v>.
yading@10 1045
yading@10 1046
yading@10 1047 =item B<-pass[:>I<stream_specifier>B<]> I<n> B<(>I<output,per-stream>B<)>
yading@10 1048
yading@10 1049 Select the pass number (1 or 2). It is used to do two-pass
yading@10 1050 video encoding. The statistics of the video are recorded in the first
yading@10 1051 pass into a log file (see also the option -passlogfile),
yading@10 1052 and in the second pass that log file is used to generate the video
yading@10 1053 at the exact requested bitrate.
yading@10 1054 On pass 1, you may just deactivate audio and set output to null,
yading@10 1055 examples for Windows and Unix:
yading@10 1056
yading@10 1057 ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL
yading@10 1058 ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null
yading@10 1059
yading@10 1060
yading@10 1061
yading@10 1062 =item B<-passlogfile[:>I<stream_specifier>B<]> I<prefix> B<(>I<output,per-stream>B<)>
yading@10 1063
yading@10 1064 Set two-pass log file name prefix to I<prefix>, the default file name
yading@10 1065 prefix is ``ffmpeg2pass''. The complete file name will be
yading@10 1066 F<PREFIX-N.log>, where N is a number specific to the output
yading@10 1067 stream
yading@10 1068
yading@10 1069
yading@10 1070 =item B<-vlang> I<code>
yading@10 1071
yading@10 1072 Set the ISO 639 language code (3 letters) of the current video stream.
yading@10 1073
yading@10 1074
yading@10 1075 =item B<-vf> I<filtergraph> B<(>I<output>B<)>
yading@10 1076
yading@10 1077 Create the filtergraph specified by I<filtergraph> and use it to
yading@10 1078 filter the stream.
yading@10 1079
yading@10 1080 This is an alias for C<-filter:v>, see the -filter option.
yading@10 1081
yading@10 1082 =back
yading@10 1083
yading@10 1084
yading@10 1085
yading@10 1086 =head2 Advanced Video Options
yading@10 1087
yading@10 1088
yading@10 1089
yading@10 1090 =over 4
yading@10 1091
yading@10 1092
yading@10 1093 =item B<-pix_fmt[:>I<stream_specifier>B<]> I<format> B<(>I<input/output,per-stream>B<)>
yading@10 1094
yading@10 1095 Set pixel format. Use C<-pix_fmts> to show all the supported
yading@10 1096 pixel formats.
yading@10 1097 If the selected pixel format can not be selected, ffmpeg will print a
yading@10 1098 warning and select the best pixel format supported by the encoder.
yading@10 1099 If I<pix_fmt> is prefixed by a C<+>, ffmpeg will exit with an error
yading@10 1100 if the requested pixel format can not be selected, and automatic conversions
yading@10 1101 inside filtergraphs are disabled.
yading@10 1102 If I<pix_fmt> is a single C<+>, ffmpeg selects the same pixel format
yading@10 1103 as the input (or graph output) and automatic conversions are disabled.
yading@10 1104
yading@10 1105
yading@10 1106 =item B<-sws_flags> I<flags> B<(>I<input/output>B<)>
yading@10 1107
yading@10 1108 Set SwScaler flags.
yading@10 1109
yading@10 1110 =item B<-vdt> I<n>
yading@10 1111
yading@10 1112 Discard threshold.
yading@10 1113
yading@10 1114
yading@10 1115 =item B<-rc_override[:>I<stream_specifier>B<]> I<override> B<(>I<output,per-stream>B<)>
yading@10 1116
yading@10 1117 Rate control override for specific intervals, formatted as "int,int,int"
yading@10 1118 list separated with slashes. Two first values are the beginning and
yading@10 1119 end frame numbers, last one is quantizer to use if positive, or quality
yading@10 1120 factor if negative.
yading@10 1121
yading@10 1122
yading@10 1123 =item B<-deinterlace>
yading@10 1124
yading@10 1125 Deinterlace pictures.
yading@10 1126 This option is deprecated since the deinterlacing is very low quality.
yading@10 1127 Use the yadif filter with C<-filter:v yadif>.
yading@10 1128
yading@10 1129 =item B<-ilme>
yading@10 1130
yading@10 1131 Force interlacing support in encoder (MPEG-2 and MPEG-4 only).
yading@10 1132 Use this option if your input file is interlaced and you want
yading@10 1133 to keep the interlaced format for minimum losses.
yading@10 1134 The alternative is to deinterlace the input stream with
yading@10 1135 B<-deinterlace>, but deinterlacing introduces losses.
yading@10 1136
yading@10 1137 =item B<-psnr>
yading@10 1138
yading@10 1139 Calculate PSNR of compressed frames.
yading@10 1140
yading@10 1141 =item B<-vstats>
yading@10 1142
yading@10 1143 Dump video coding statistics to F<vstats_HHMMSS.log>.
yading@10 1144
yading@10 1145 =item B<-vstats_file> I<file>
yading@10 1146
yading@10 1147 Dump video coding statistics to I<file>.
yading@10 1148
yading@10 1149 =item B<-top[:>I<stream_specifier>B<]> I<n> B<(>I<output,per-stream>B<)>
yading@10 1150
yading@10 1151 top=1/bottom=0/auto=-1 field first
yading@10 1152
yading@10 1153 =item B<-dc> I<precision>
yading@10 1154
yading@10 1155 Intra_dc_precision.
yading@10 1156
yading@10 1157 =item B<-vtag> I<fourcc/tag> B<(>I<output>B<)>
yading@10 1158
yading@10 1159 Force video tag/fourcc. This is an alias for C<-tag:v>.
yading@10 1160
yading@10 1161 =item B<-qphist (>I<global>B<)>
yading@10 1162
yading@10 1163 Show QP histogram
yading@10 1164
yading@10 1165 =item B<-vbsf> I<bitstream_filter>
yading@10 1166
yading@10 1167 Deprecated see -bsf
yading@10 1168
yading@10 1169
yading@10 1170 =item B<-force_key_frames[:>I<stream_specifier>B<]> I<time>B<[,>I<time>B<...] (>I<output,per-stream>B<)>
yading@10 1171
yading@10 1172
yading@10 1173 =item B<-force_key_frames[:>I<stream_specifier>B<] expr:>I<expr> B<(>I<output,per-stream>B<)>
yading@10 1174
yading@10 1175 Force key frames at the specified timestamps, more precisely at the first
yading@10 1176 frames after each specified time.
yading@10 1177
yading@10 1178 If the argument is prefixed with C<expr:>, the string I<expr>
yading@10 1179 is interpreted like an expression and is evaluated for each frame. A
yading@10 1180 key frame is forced in case the evaluation is non-zero.
yading@10 1181
yading@10 1182 If one of the times is "C<chapters>[I<delta>]", it is expanded into
yading@10 1183 the time of the beginning of all chapters in the file, shifted by
yading@10 1184 I<delta>, expressed as a time in seconds.
yading@10 1185 This option can be useful to ensure that a seek point is present at a
yading@10 1186 chapter mark or any other designated place in the output file.
yading@10 1187
yading@10 1188 For example, to insert a key frame at 5 minutes, plus key frames 0.1 second
yading@10 1189 before the beginning of every chapter:
yading@10 1190
yading@10 1191 -force_key_frames 0:05:00,chapters-0.1
yading@10 1192
yading@10 1193
yading@10 1194 The expression in I<expr> can contain the following constants:
yading@10 1195
yading@10 1196 =over 4
yading@10 1197
yading@10 1198
yading@10 1199 =item B<n>
yading@10 1200
yading@10 1201 the number of current processed frame, starting from 0
yading@10 1202
yading@10 1203 =item B<n_forced>
yading@10 1204
yading@10 1205 the number of forced frames
yading@10 1206
yading@10 1207 =item B<prev_forced_n>
yading@10 1208
yading@10 1209 the number of the previous forced frame, it is C<NAN> when no
yading@10 1210 keyframe was forced yet
yading@10 1211
yading@10 1212 =item B<prev_forced_t>
yading@10 1213
yading@10 1214 the time of the previous forced frame, it is C<NAN> when no
yading@10 1215 keyframe was forced yet
yading@10 1216
yading@10 1217 =item B<t>
yading@10 1218
yading@10 1219 the time of the current processed frame
yading@10 1220
yading@10 1221 =back
yading@10 1222
yading@10 1223
yading@10 1224 For example to force a key frame every 5 seconds, you can specify:
yading@10 1225
yading@10 1226 -force_key_frames expr:gte(t,n_forced*5)
yading@10 1227
yading@10 1228
yading@10 1229 To force a key frame 5 seconds after the time of the last forced one,
yading@10 1230 starting from second 13:
yading@10 1231
yading@10 1232 -force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))
yading@10 1233
yading@10 1234
yading@10 1235 Note that forcing too many keyframes is very harmful for the lookahead
yading@10 1236 algorithms of certain encoders: using fixed-GOP options or similar
yading@10 1237 would be more efficient.
yading@10 1238
yading@10 1239
yading@10 1240 =item B<-copyinkf[:>I<stream_specifier>B<] (>I<output,per-stream>B<)>
yading@10 1241
yading@10 1242 When doing stream copy, copy also non-key frames found at the
yading@10 1243 beginning.
yading@10 1244
yading@10 1245 =back
yading@10 1246
yading@10 1247
yading@10 1248
yading@10 1249 =head2 Audio Options
yading@10 1250
yading@10 1251
yading@10 1252
yading@10 1253 =over 4
yading@10 1254
yading@10 1255
yading@10 1256 =item B<-aframes> I<number> B<(>I<output>B<)>
yading@10 1257
yading@10 1258 Set the number of audio frames to record. This is an alias for C<-frames:a>.
yading@10 1259
yading@10 1260 =item B<-ar[:>I<stream_specifier>B<]> I<freq> B<(>I<input/output,per-stream>B<)>
yading@10 1261
yading@10 1262 Set the audio sampling frequency. For output streams it is set by
yading@10 1263 default to the frequency of the corresponding input stream. For input
yading@10 1264 streams this option only makes sense for audio grabbing devices and raw
yading@10 1265 demuxers and is mapped to the corresponding demuxer options.
yading@10 1266
yading@10 1267 =item B<-aq> I<q> B<(>I<output>B<)>
yading@10 1268
yading@10 1269 Set the audio quality (codec-specific, VBR). This is an alias for -q:a.
yading@10 1270
yading@10 1271 =item B<-ac[:>I<stream_specifier>B<]> I<channels> B<(>I<input/output,per-stream>B<)>
yading@10 1272
yading@10 1273 Set the number of audio channels. For output streams it is set by
yading@10 1274 default to the number of input audio channels. For input streams
yading@10 1275 this option only makes sense for audio grabbing devices and raw demuxers
yading@10 1276 and is mapped to the corresponding demuxer options.
yading@10 1277
yading@10 1278 =item B<-an (>I<output>B<)>
yading@10 1279
yading@10 1280 Disable audio recording.
yading@10 1281
yading@10 1282 =item B<-acodec> I<codec> B<(>I<input/output>B<)>
yading@10 1283
yading@10 1284 Set the audio codec. This is an alias for C<-codec:a>.
yading@10 1285
yading@10 1286 =item B<-sample_fmt[:>I<stream_specifier>B<]> I<sample_fmt> B<(>I<output,per-stream>B<)>
yading@10 1287
yading@10 1288 Set the audio sample format. Use C<-sample_fmts> to get a list
yading@10 1289 of supported sample formats.
yading@10 1290
yading@10 1291
yading@10 1292 =item B<-af> I<filtergraph> B<(>I<output>B<)>
yading@10 1293
yading@10 1294 Create the filtergraph specified by I<filtergraph> and use it to
yading@10 1295 filter the stream.
yading@10 1296
yading@10 1297 This is an alias for C<-filter:a>, see the -filter option.
yading@10 1298
yading@10 1299 =back
yading@10 1300
yading@10 1301
yading@10 1302
yading@10 1303 =head2 Advanced Audio options:
yading@10 1304
yading@10 1305
yading@10 1306
yading@10 1307 =over 4
yading@10 1308
yading@10 1309
yading@10 1310 =item B<-atag> I<fourcc/tag> B<(>I<output>B<)>
yading@10 1311
yading@10 1312 Force audio tag/fourcc. This is an alias for C<-tag:a>.
yading@10 1313
yading@10 1314 =item B<-absf> I<bitstream_filter>
yading@10 1315
yading@10 1316 Deprecated, see -bsf
yading@10 1317
yading@10 1318 =item B<-guess_layout_max> I<channels> B<(>I<input,per-stream>B<)>
yading@10 1319
yading@10 1320 If some input channel layout is not known, try to guess only if it
yading@10 1321 corresponds to at most the specified number of channels. For example, 2
yading@10 1322 tells to B<ffmpeg> to recognize 1 channel as mono and 2 channels as
yading@10 1323 stereo but not 6 channels as 5.1. The default is to always try to guess. Use
yading@10 1324 0 to disable all guessing.
yading@10 1325
yading@10 1326 =back
yading@10 1327
yading@10 1328
yading@10 1329
yading@10 1330 =head2 Subtitle options:
yading@10 1331
yading@10 1332
yading@10 1333
yading@10 1334 =over 4
yading@10 1335
yading@10 1336
yading@10 1337 =item B<-slang> I<code>
yading@10 1338
yading@10 1339 Set the ISO 639 language code (3 letters) of the current subtitle stream.
yading@10 1340
yading@10 1341 =item B<-scodec> I<codec> B<(>I<input/output>B<)>
yading@10 1342
yading@10 1343 Set the subtitle codec. This is an alias for C<-codec:s>.
yading@10 1344
yading@10 1345 =item B<-sn (>I<output>B<)>
yading@10 1346
yading@10 1347 Disable subtitle recording.
yading@10 1348
yading@10 1349 =item B<-sbsf> I<bitstream_filter>
yading@10 1350
yading@10 1351 Deprecated, see -bsf
yading@10 1352
yading@10 1353 =back
yading@10 1354
yading@10 1355
yading@10 1356
yading@10 1357 =head2 Advanced Subtitle options:
yading@10 1358
yading@10 1359
yading@10 1360
yading@10 1361 =over 4
yading@10 1362
yading@10 1363
yading@10 1364
yading@10 1365 =item B<-fix_sub_duration>
yading@10 1366
yading@10 1367 Fix subtitles durations. For each subtitle, wait for the next packet in the
yading@10 1368 same stream and adjust the duration of the first to avoid overlap. This is
yading@10 1369 necessary with some subtitles codecs, especially DVB subtitles, because the
yading@10 1370 duration in the original packet is only a rough estimate and the end is
yading@10 1371 actually marked by an empty subtitle frame. Failing to use this option when
yading@10 1372 necessary can result in exaggerated durations or muxing failures due to
yading@10 1373 non-monotonic timestamps.
yading@10 1374
yading@10 1375 Note that this option will delay the output of all data until the next
yading@10 1376 subtitle packet is decoded: it may increase memory consumption and latency a
yading@10 1377 lot.
yading@10 1378
yading@10 1379
yading@10 1380 =item B<-canvas_size> I<size>
yading@10 1381
yading@10 1382 Set the size of the canvas used to render subtitles.
yading@10 1383
yading@10 1384
yading@10 1385 =back
yading@10 1386
yading@10 1387
yading@10 1388
yading@10 1389 =head2 Advanced options
yading@10 1390
yading@10 1391
yading@10 1392
yading@10 1393 =over 4
yading@10 1394
yading@10 1395
yading@10 1396 =item B<-map [-]>I<input_file_id>B<[:>I<stream_specifier>B<][,>I<sync_file_id>B<[:>I<stream_specifier>B<]] |> I<[linklabel]> B<(>I<output>B<)>
yading@10 1397
yading@10 1398
yading@10 1399 Designate one or more input streams as a source for the output file. Each input
yading@10 1400 stream is identified by the input file index I<input_file_id> and
yading@10 1401 the input stream index I<input_stream_id> within the input
yading@10 1402 file. Both indices start at 0. If specified,
yading@10 1403 I<sync_file_id>:I<stream_specifier> sets which input stream
yading@10 1404 is used as a presentation sync reference.
yading@10 1405
yading@10 1406 The first C<-map> option on the command line specifies the
yading@10 1407 source for output stream 0, the second C<-map> option specifies
yading@10 1408 the source for output stream 1, etc.
yading@10 1409
yading@10 1410 A C<-> character before the stream identifier creates a "negative" mapping.
yading@10 1411 It disables matching streams from already created mappings.
yading@10 1412
yading@10 1413 An alternative I<[linklabel]> form will map outputs from complex filter
yading@10 1414 graphs (see the B<-filter_complex> option) to the output file.
yading@10 1415 I<linklabel> must correspond to a defined output link label in the graph.
yading@10 1416
yading@10 1417 For example, to map ALL streams from the first input file to output
yading@10 1418
yading@10 1419 ffmpeg -i INPUT -map 0 output
yading@10 1420
yading@10 1421
yading@10 1422 For example, if you have two audio streams in the first input file,
yading@10 1423 these streams are identified by "0:0" and "0:1". You can use
yading@10 1424 C<-map> to select which streams to place in an output file. For
yading@10 1425 example:
yading@10 1426
yading@10 1427 ffmpeg -i INPUT -map 0:1 out.wav
yading@10 1428
yading@10 1429 will map the input stream in F<INPUT> identified by "0:1" to
yading@10 1430 the (single) output stream in F<out.wav>.
yading@10 1431
yading@10 1432 For example, to select the stream with index 2 from input file
yading@10 1433 F<a.mov> (specified by the identifier "0:2"), and stream with
yading@10 1434 index 6 from input F<b.mov> (specified by the identifier "1:6"),
yading@10 1435 and copy them to the output file F<out.mov>:
yading@10 1436
yading@10 1437 ffmpeg -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov
yading@10 1438
yading@10 1439
yading@10 1440 To select all video and the third audio stream from an input file:
yading@10 1441
yading@10 1442 ffmpeg -i INPUT -map 0:v -map 0:a:2 OUTPUT
yading@10 1443
yading@10 1444
yading@10 1445 To map all the streams except the second audio, use negative mappings
yading@10 1446
yading@10 1447 ffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT
yading@10 1448
yading@10 1449
yading@10 1450 Note that using this option disables the default mappings for this output file.
yading@10 1451
yading@10 1452
yading@10 1453 =item B<-map_channel [>I<input_file_id>B<.>I<stream_specifier>B<.>I<channel_id>B<|-1][:>I<output_file_id>B<.>I<stream_specifier>B<]>
yading@10 1454
yading@10 1455 Map an audio channel from a given input to an output. If
yading@10 1456 I<output_file_id>.I<stream_specifier> is not set, the audio channel will
yading@10 1457 be mapped on all the audio streams.
yading@10 1458
yading@10 1459 Using "-1" instead of
yading@10 1460 I<input_file_id>.I<stream_specifier>.I<channel_id> will map a muted
yading@10 1461 channel.
yading@10 1462
yading@10 1463 For example, assuming I<INPUT> is a stereo audio file, you can switch the
yading@10 1464 two audio channels with the following command:
yading@10 1465
yading@10 1466 ffmpeg -i INPUT -map_channel 0.0.1 -map_channel 0.0.0 OUTPUT
yading@10 1467
yading@10 1468
yading@10 1469 If you want to mute the first channel and keep the second:
yading@10 1470
yading@10 1471 ffmpeg -i INPUT -map_channel -1 -map_channel 0.0.1 OUTPUT
yading@10 1472
yading@10 1473
yading@10 1474 The order of the "-map_channel" option specifies the order of the channels in
yading@10 1475 the output stream. The output channel layout is guessed from the number of
yading@10 1476 channels mapped (mono if one "-map_channel", stereo if two, etc.). Using "-ac"
yading@10 1477 in combination of "-map_channel" makes the channel gain levels to be updated if
yading@10 1478 input and output channel layouts don't match (for instance two "-map_channel"
yading@10 1479 options and "-ac 6").
yading@10 1480
yading@10 1481 You can also extract each channel of an input to specific outputs; the following
yading@10 1482 command extracts two channels of the I<INPUT> audio stream (file 0, stream 0)
yading@10 1483 to the respective I<OUTPUT_CH0> and I<OUTPUT_CH1> outputs:
yading@10 1484
yading@10 1485 ffmpeg -i INPUT -map_channel 0.0.0 OUTPUT_CH0 -map_channel 0.0.1 OUTPUT_CH1
yading@10 1486
yading@10 1487
yading@10 1488 The following example splits the channels of a stereo input into two separate
yading@10 1489 streams, which are put into the same output file:
yading@10 1490
yading@10 1491 ffmpeg -i stereo.wav -map 0:0 -map 0:0 -map_channel 0.0.0:0.0 -map_channel 0.0.1:0.1 -y out.ogg
yading@10 1492
yading@10 1493
yading@10 1494 Note that currently each output stream can only contain channels from a single
yading@10 1495 input stream; you can't for example use "-map_channel" to pick multiple input
yading@10 1496 audio channels contained in different streams (from the same or different files)
yading@10 1497 and merge them into a single output stream. It is therefore not currently
yading@10 1498 possible, for example, to turn two separate mono streams into a single stereo
yading@10 1499 stream. However splitting a stereo stream into two single channel mono streams
yading@10 1500 is possible.
yading@10 1501
yading@10 1502 If you need this feature, a possible workaround is to use the I<amerge>
yading@10 1503 filter. For example, if you need to merge a media (here F<input.mkv>) with 2
yading@10 1504 mono audio streams into one single stereo channel audio stream (and keep the
yading@10 1505 video stream), you can use the following command:
yading@10 1506
yading@10 1507 ffmpeg -i input.mkv -filter_complex "[0:1] [0:2] amerge" -c:a pcm_s16le -c:v copy output.mkv
yading@10 1508
yading@10 1509
yading@10 1510
yading@10 1511 =item B<-map_metadata[:>I<metadata_spec_out>B<]> I<infile>B<[:>I<metadata_spec_in>B<] (>I<output,per-metadata>B<)>
yading@10 1512
yading@10 1513 Set metadata information of the next output file from I<infile>. Note that
yading@10 1514 those are file indices (zero-based), not filenames.
yading@10 1515 Optional I<metadata_spec_in/out> parameters specify, which metadata to copy.
yading@10 1516 A metadata specifier can have the following forms:
yading@10 1517
yading@10 1518 =over 4
yading@10 1519
yading@10 1520
yading@10 1521 =item I<g>
yading@10 1522
yading@10 1523 global metadata, i.e. metadata that applies to the whole file
yading@10 1524
yading@10 1525
yading@10 1526 =item I<s>B<[:>I<stream_spec>B<]>
yading@10 1527
yading@10 1528 per-stream metadata. I<stream_spec> is a stream specifier as described
yading@10 1529 in the Stream specifiers chapter. In an input metadata specifier, the first
yading@10 1530 matching stream is copied from. In an output metadata specifier, all matching
yading@10 1531 streams are copied to.
yading@10 1532
yading@10 1533
yading@10 1534 =item I<c>B<:>I<chapter_index>
yading@10 1535
yading@10 1536 per-chapter metadata. I<chapter_index> is the zero-based chapter index.
yading@10 1537
yading@10 1538
yading@10 1539 =item I<p>B<:>I<program_index>
yading@10 1540
yading@10 1541 per-program metadata. I<program_index> is the zero-based program index.
yading@10 1542
yading@10 1543 =back
yading@10 1544
yading@10 1545 If metadata specifier is omitted, it defaults to global.
yading@10 1546
yading@10 1547 By default, global metadata is copied from the first input file,
yading@10 1548 per-stream and per-chapter metadata is copied along with streams/chapters. These
yading@10 1549 default mappings are disabled by creating any mapping of the relevant type. A negative
yading@10 1550 file index can be used to create a dummy mapping that just disables automatic copying.
yading@10 1551
yading@10 1552 For example to copy metadata from the first stream of the input file to global metadata
yading@10 1553 of the output file:
yading@10 1554
yading@10 1555 ffmpeg -i in.ogg -map_metadata 0:s:0 out.mp3
yading@10 1556
yading@10 1557
yading@10 1558 To do the reverse, i.e. copy global metadata to all audio streams:
yading@10 1559
yading@10 1560 ffmpeg -i in.mkv -map_metadata:s:a 0:g out.mkv
yading@10 1561
yading@10 1562 Note that simple C<0> would work as well in this example, since global
yading@10 1563 metadata is assumed by default.
yading@10 1564
yading@10 1565
yading@10 1566 =item B<-map_chapters> I<input_file_index> B<(>I<output>B<)>
yading@10 1567
yading@10 1568 Copy chapters from input file with index I<input_file_index> to the next
yading@10 1569 output file. If no chapter mapping is specified, then chapters are copied from
yading@10 1570 the first input file with at least one chapter. Use a negative file index to
yading@10 1571 disable any chapter copying.
yading@10 1572
yading@10 1573
yading@10 1574 =item B<-benchmark (>I<global>B<)>
yading@10 1575
yading@10 1576 Show benchmarking information at the end of an encode.
yading@10 1577 Shows CPU time used and maximum memory consumption.
yading@10 1578 Maximum memory consumption is not supported on all systems,
yading@10 1579 it will usually display as 0 if not supported.
yading@10 1580
yading@10 1581 =item B<-benchmark_all (>I<global>B<)>
yading@10 1582
yading@10 1583 Show benchmarking information during the encode.
yading@10 1584 Shows CPU time used in various steps (audio/video encode/decode).
yading@10 1585
yading@10 1586 =item B<-timelimit> I<duration> B<(>I<global>B<)>
yading@10 1587
yading@10 1588 Exit after ffmpeg has been running for I<duration> seconds.
yading@10 1589
yading@10 1590 =item B<-dump (>I<global>B<)>
yading@10 1591
yading@10 1592 Dump each input packet to stderr.
yading@10 1593
yading@10 1594 =item B<-hex (>I<global>B<)>
yading@10 1595
yading@10 1596 When dumping packets, also dump the payload.
yading@10 1597
yading@10 1598 =item B<-re (>I<input>B<)>
yading@10 1599
yading@10 1600 Read input at native frame rate. Mainly used to simulate a grab device.
yading@10 1601 By default B<ffmpeg> attempts to read the input(s) as fast as possible.
yading@10 1602 This option will slow down the reading of the input(s) to the native frame rate
yading@10 1603 of the input(s). It is useful for real-time output (e.g. live streaming). If
yading@10 1604 your input(s) is coming from some other live streaming source (through HTTP or
yading@10 1605 UDP for example) the server might already be in real-time, thus the option will
yading@10 1606 likely not be required. On the other hand, this is meaningful if your input(s)
yading@10 1607 is a file you are trying to push in real-time.
yading@10 1608
yading@10 1609 =item B<-loop_input>
yading@10 1610
yading@10 1611 Loop over the input stream. Currently it works only for image
yading@10 1612 streams. This option is used for automatic FFserver testing.
yading@10 1613 This option is deprecated, use -loop 1.
yading@10 1614
yading@10 1615 =item B<-loop_output> I<number_of_times>
yading@10 1616
yading@10 1617 Repeatedly loop output for formats that support looping such as animated GIF
yading@10 1618 (0 will loop the output infinitely).
yading@10 1619 This option is deprecated, use -loop.
yading@10 1620
yading@10 1621 =item B<-vsync> I<parameter>
yading@10 1622
yading@10 1623 Video sync method.
yading@10 1624 For compatibility reasons old values can be specified as numbers.
yading@10 1625 Newly added values will have to be specified as strings always.
yading@10 1626
yading@10 1627
yading@10 1628 =over 4
yading@10 1629
yading@10 1630
yading@10 1631 =item B<0, passthrough>
yading@10 1632
yading@10 1633 Each frame is passed with its timestamp from the demuxer to the muxer.
yading@10 1634
yading@10 1635 =item B<1, cfr>
yading@10 1636
yading@10 1637 Frames will be duplicated and dropped to achieve exactly the requested
yading@10 1638 constant frame rate.
yading@10 1639
yading@10 1640 =item B<2, vfr>
yading@10 1641
yading@10 1642 Frames are passed through with their timestamp or dropped so as to
yading@10 1643 prevent 2 frames from having the same timestamp.
yading@10 1644
yading@10 1645 =item B<drop>
yading@10 1646
yading@10 1647 As passthrough but destroys all timestamps, making the muxer generate
yading@10 1648 fresh timestamps based on frame-rate.
yading@10 1649
yading@10 1650 =item B<-1, auto>
yading@10 1651
yading@10 1652 Chooses between 1 and 2 depending on muxer capabilities. This is the
yading@10 1653 default method.
yading@10 1654
yading@10 1655 =back
yading@10 1656
yading@10 1657
yading@10 1658 Note that the timestamps may be further modified by the muxer, after this.
yading@10 1659 For example, in the case that the format option B<avoid_negative_ts>
yading@10 1660 is enabled.
yading@10 1661
yading@10 1662 With -map you can select from which stream the timestamps should be
yading@10 1663 taken. You can leave either video or audio unchanged and sync the
yading@10 1664 remaining stream(s) to the unchanged one.
yading@10 1665
yading@10 1666
yading@10 1667 =item B<-async> I<samples_per_second>
yading@10 1668
yading@10 1669 Audio sync method. "Stretches/squeezes" the audio stream to match the timestamps,
yading@10 1670 the parameter is the maximum samples per second by which the audio is changed.
yading@10 1671 -async 1 is a special case where only the start of the audio stream is corrected
yading@10 1672 without any later correction.
yading@10 1673
yading@10 1674 Note that the timestamps may be further modified by the muxer, after this.
yading@10 1675 For example, in the case that the format option B<avoid_negative_ts>
yading@10 1676 is enabled.
yading@10 1677
yading@10 1678 This option has been deprecated. Use the C<aresample> audio filter instead.
yading@10 1679
yading@10 1680
yading@10 1681 =item B<-copyts>
yading@10 1682
yading@10 1683 Do not process input timestamps, but keep their values without trying
yading@10 1684 to sanitize them. In particular, do not remove the initial start time
yading@10 1685 offset value.
yading@10 1686
yading@10 1687 Note that, depending on the B<vsync> option or on specific muxer
yading@10 1688 processing (e.g. in case the format option B<avoid_negative_ts>
yading@10 1689 is enabled) the output timestamps may mismatch with the input
yading@10 1690 timestamps even when this option is selected.
yading@10 1691
yading@10 1692
yading@10 1693 =item B<-copytb> I<mode>
yading@10 1694
yading@10 1695 Specify how to set the encoder timebase when stream copying. I<mode> is an
yading@10 1696 integer numeric value, and can assume one of the following values:
yading@10 1697
yading@10 1698
yading@10 1699 =over 4
yading@10 1700
yading@10 1701
yading@10 1702 =item B<1>
yading@10 1703
yading@10 1704 Use the demuxer timebase.
yading@10 1705
yading@10 1706 The time base is copied to the output encoder from the corresponding input
yading@10 1707 demuxer. This is sometimes required to avoid non monotonically increasing
yading@10 1708 timestamps when copying video streams with variable frame rate.
yading@10 1709
yading@10 1710
yading@10 1711 =item B<0>
yading@10 1712
yading@10 1713 Use the decoder timebase.
yading@10 1714
yading@10 1715 The time base is copied to the output encoder from the corresponding input
yading@10 1716 decoder.
yading@10 1717
yading@10 1718
yading@10 1719 =item B<-1>
yading@10 1720
yading@10 1721 Try to make the choice automatically, in order to generate a sane output.
yading@10 1722
yading@10 1723 =back
yading@10 1724
yading@10 1725
yading@10 1726 Default value is -1.
yading@10 1727
yading@10 1728
yading@10 1729 =item B<-shortest (>I<output>B<)>
yading@10 1730
yading@10 1731 Finish encoding when the shortest input stream ends.
yading@10 1732
yading@10 1733 =item B<-dts_delta_threshold>
yading@10 1734
yading@10 1735 Timestamp discontinuity delta threshold.
yading@10 1736
yading@10 1737 =item B<-muxdelay> I<seconds> B<(>I<input>B<)>
yading@10 1738
yading@10 1739 Set the maximum demux-decode delay.
yading@10 1740
yading@10 1741 =item B<-muxpreload> I<seconds> B<(>I<input>B<)>
yading@10 1742
yading@10 1743 Set the initial demux-decode delay.
yading@10 1744
yading@10 1745 =item B<-streamid> I<output-stream-index>B<:>I<new-value> B<(>I<output>B<)>
yading@10 1746
yading@10 1747 Assign a new stream-id value to an output stream. This option should be
yading@10 1748 specified prior to the output filename to which it applies.
yading@10 1749 For the situation where multiple output files exist, a streamid
yading@10 1750 may be reassigned to a different value.
yading@10 1751
yading@10 1752 For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for
yading@10 1753 an output mpegts file:
yading@10 1754
yading@10 1755 ffmpeg -i infile -streamid 0:33 -streamid 1:36 out.ts
yading@10 1756
yading@10 1757
yading@10 1758
yading@10 1759 =item B<-bsf[:>I<stream_specifier>B<]> I<bitstream_filters> B<(>I<output,per-stream>B<)>
yading@10 1760
yading@10 1761 Set bitstream filters for matching streams. I<bitstream_filters> is
yading@10 1762 a comma-separated list of bitstream filters. Use the C<-bsfs> option
yading@10 1763 to get the list of bitstream filters.
yading@10 1764
yading@10 1765 ffmpeg -i h264.mp4 -c:v copy -bsf:v h264_mp4toannexb -an out.h264
yading@10 1766
yading@10 1767
yading@10 1768 ffmpeg -i file.mov -an -vn -bsf:s mov2textsub -c:s copy -f rawvideo sub.txt
yading@10 1769
yading@10 1770
yading@10 1771
yading@10 1772 =item B<-tag[:>I<stream_specifier>B<]> I<codec_tag> B<(>I<per-stream>B<)>
yading@10 1773
yading@10 1774 Force a tag/fourcc for matching streams.
yading@10 1775
yading@10 1776
yading@10 1777 =item B<-timecode> I<hh>B<:>I<mm>B<:>I<ss>B<SEP>I<ff>
yading@10 1778
yading@10 1779 Specify Timecode for writing. I<SEP> is ':' for non drop timecode and ';'
yading@10 1780 (or '.') for drop.
yading@10 1781
yading@10 1782 ffmpeg -i input.mpg -timecode 01:02:03.04 -r 30000/1001 -s ntsc output.mpg
yading@10 1783
yading@10 1784
yading@10 1785
yading@10 1786
yading@10 1787 =item B<-filter_complex> I<filtergraph> B<(>I<global>B<)>
yading@10 1788
yading@10 1789 Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
yading@10 1790 outputs. For simple graphs -- those with one input and one output of the same
yading@10 1791 type -- see the B<-filter> options. I<filtergraph> is a description of
yading@10 1792 the filtergraph, as described in the ``Filtergraph syntax'' section of the
yading@10 1793 ffmpeg-filters manual.
yading@10 1794
yading@10 1795 Input link labels must refer to input streams using the
yading@10 1796 C<[file_index:stream_specifier]> syntax (i.e. the same as B<-map>
yading@10 1797 uses). If I<stream_specifier> matches multiple streams, the first one will be
yading@10 1798 used. An unlabeled input will be connected to the first unused input stream of
yading@10 1799 the matching type.
yading@10 1800
yading@10 1801 Output link labels are referred to with B<-map>. Unlabeled outputs are
yading@10 1802 added to the first output file.
yading@10 1803
yading@10 1804 Note that with this option it is possible to use only lavfi sources without
yading@10 1805 normal input files.
yading@10 1806
yading@10 1807 For example, to overlay an image over video
yading@10 1808
yading@10 1809 ffmpeg -i video.mkv -i image.png -filter_complex '[0:v][1:v]overlay[out]' -map
yading@10 1810 '[out]' out.mkv
yading@10 1811
yading@10 1812 Here C<[0:v]> refers to the first video stream in the first input file,
yading@10 1813 which is linked to the first (main) input of the overlay filter. Similarly the
yading@10 1814 first video stream in the second input is linked to the second (overlay) input
yading@10 1815 of overlay.
yading@10 1816
yading@10 1817 Assuming there is only one video stream in each input file, we can omit input
yading@10 1818 labels, so the above is equivalent to
yading@10 1819
yading@10 1820 ffmpeg -i video.mkv -i image.png -filter_complex 'overlay[out]' -map
yading@10 1821 '[out]' out.mkv
yading@10 1822
yading@10 1823
yading@10 1824 Furthermore we can omit the output label and the single output from the filter
yading@10 1825 graph will be added to the output file automatically, so we can simply write
yading@10 1826
yading@10 1827 ffmpeg -i video.mkv -i image.png -filter_complex 'overlay' out.mkv
yading@10 1828
yading@10 1829
yading@10 1830 To generate 5 seconds of pure red video using lavfi C<color> source:
yading@10 1831
yading@10 1832 ffmpeg -filter_complex 'color=c=red' -t 5 out.mkv
yading@10 1833
yading@10 1834
yading@10 1835
yading@10 1836 =item B<-lavfi> I<filtergraph> B<(>I<global>B<)>
yading@10 1837
yading@10 1838 Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
yading@10 1839 outputs. Equivalent to B<-filter_complex>.
yading@10 1840
yading@10 1841
yading@10 1842 =item B<-filter_complex_script> I<filename> B<(>I<global>B<)>
yading@10 1843
yading@10 1844 This option is similar to B<-filter_complex>, the only difference is that
yading@10 1845 its argument is the name of the file from which a complex filtergraph
yading@10 1846 description is to be read.
yading@10 1847
yading@10 1848
yading@10 1849 =back
yading@10 1850
yading@10 1851
yading@10 1852 As a special exception, you can use a bitmap subtitle stream as input: it
yading@10 1853 will be converted into a video with the same size as the largest video in
yading@10 1854 the file, or 720x576 if no video is present. Note that this is an
yading@10 1855 experimental and temporary solution. It will be removed once libavfilter has
yading@10 1856 proper support for subtitles.
yading@10 1857
yading@10 1858 For example, to hardcode subtitles on top of a DVB-T recording stored in
yading@10 1859 MPEG-TS format, delaying the subtitles by 1 second:
yading@10 1860
yading@10 1861 ffmpeg -i input.ts -filter_complex \
yading@10 1862 '[#0x2ef] setpts=PTS+1/TB [sub] ; [#0x2d0] [sub] overlay' \
yading@10 1863 -sn -map '#0x2dc' output.mkv
yading@10 1864
yading@10 1865 (0x2d0, 0x2dc and 0x2ef are the MPEG-TS PIDs of respectively the video,
yading@10 1866 audio and subtitles streams; 0:0, 0:3 and 0:7 would have worked too)
yading@10 1867
yading@10 1868
yading@10 1869 =head2 Preset files
yading@10 1870
yading@10 1871 A preset file contains a sequence of I<option>=I<value> pairs,
yading@10 1872 one for each line, specifying a sequence of options which would be
yading@10 1873 awkward to specify on the command line. Lines starting with the hash
yading@10 1874 ('#') character are ignored and are used to provide comments. Check
yading@10 1875 the F<presets> directory in the FFmpeg source tree for examples.
yading@10 1876
yading@10 1877 Preset files are specified with the C<vpre>, C<apre>,
yading@10 1878 C<spre>, and C<fpre> options. The C<fpre> option takes the
yading@10 1879 filename of the preset instead of a preset name as input and can be
yading@10 1880 used for any kind of codec. For the C<vpre>, C<apre>, and
yading@10 1881 C<spre> options, the options specified in a preset file are
yading@10 1882 applied to the currently selected codec of the same type as the preset
yading@10 1883 option.
yading@10 1884
yading@10 1885 The argument passed to the C<vpre>, C<apre>, and C<spre>
yading@10 1886 preset options identifies the preset file to use according to the
yading@10 1887 following rules:
yading@10 1888
yading@10 1889 First ffmpeg searches for a file named I<arg>.ffpreset in the
yading@10 1890 directories F<$FFMPEG_DATADIR> (if set), and F<$HOME/.ffmpeg>, and in
yading@10 1891 the datadir defined at configuration time (usually F<PREFIX/share/ffmpeg>)
yading@10 1892 or in a F<ffpresets> folder along the executable on win32,
yading@10 1893 in that order. For example, if the argument is C<libvpx-1080p>, it will
yading@10 1894 search for the file F<libvpx-1080p.ffpreset>.
yading@10 1895
yading@10 1896 If no such file is found, then ffmpeg will search for a file named
yading@10 1897 I<codec_name>-I<arg>.ffpreset in the above-mentioned
yading@10 1898 directories, where I<codec_name> is the name of the codec to which
yading@10 1899 the preset file options will be applied. For example, if you select
yading@10 1900 the video codec with C<-vcodec libvpx> and use C<-vpre 1080p>,
yading@10 1901 then it will search for the file F<libvpx-1080p.ffpreset>.
yading@10 1902
yading@10 1903
yading@10 1904 =head1 TIPS
yading@10 1905
yading@10 1906
yading@10 1907
yading@10 1908 =over 4
yading@10 1909
yading@10 1910
yading@10 1911 =item *
yading@10 1912
yading@10 1913 For streaming at very low bitrate application, use a low frame rate
yading@10 1914 and a small GOP size. This is especially true for RealVideo where
yading@10 1915 the Linux player does not seem to be very fast, so it can miss
yading@10 1916 frames. An example is:
yading@10 1917
yading@10 1918
yading@10 1919 ffmpeg -g 3 -r 3 -t 10 -b:v 50k -s qcif -f rv10 /tmp/b.rm
yading@10 1920
yading@10 1921
yading@10 1922
yading@10 1923 =item *
yading@10 1924
yading@10 1925 The parameter 'q' which is displayed while encoding is the current
yading@10 1926 quantizer. The value 1 indicates that a very good quality could
yading@10 1927 be achieved. The value 31 indicates the worst quality. If q=31 appears
yading@10 1928 too often, it means that the encoder cannot compress enough to meet
yading@10 1929 your bitrate. You must either increase the bitrate, decrease the
yading@10 1930 frame rate or decrease the frame size.
yading@10 1931
yading@10 1932
yading@10 1933 =item *
yading@10 1934
yading@10 1935 If your computer is not fast enough, you can speed up the
yading@10 1936 compression at the expense of the compression ratio. You can use
yading@10 1937 '-me zero' to speed up motion estimation, and '-g 0' to disable
yading@10 1938 motion estimation completely (you have only I-frames, which means it
yading@10 1939 is about as good as JPEG compression).
yading@10 1940
yading@10 1941
yading@10 1942 =item *
yading@10 1943
yading@10 1944 To have very low audio bitrates, reduce the sampling frequency
yading@10 1945 (down to 22050 Hz for MPEG audio, 22050 or 11025 for AC-3).
yading@10 1946
yading@10 1947
yading@10 1948 =item *
yading@10 1949
yading@10 1950 To have a constant quality (but a variable bitrate), use the option
yading@10 1951 '-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
yading@10 1952 quality).
yading@10 1953
yading@10 1954
yading@10 1955 =back
yading@10 1956
yading@10 1957
yading@10 1958
yading@10 1959 =head1 EXAMPLES
yading@10 1960
yading@10 1961
yading@10 1962
yading@10 1963 =head2 Preset files
yading@10 1964
yading@10 1965
yading@10 1966 A preset file contains a sequence of I<option=value> pairs, one for
yading@10 1967 each line, specifying a sequence of options which can be specified also on
yading@10 1968 the command line. Lines starting with the hash ('#') character are ignored and
yading@10 1969 are used to provide comments. Empty lines are also ignored. Check the
yading@10 1970 F<presets> directory in the FFmpeg source tree for examples.
yading@10 1971
yading@10 1972 Preset files are specified with the C<pre> option, this option takes a
yading@10 1973 preset name as input. FFmpeg searches for a file named I<preset_name>.avpreset in
yading@10 1974 the directories F<$AVCONV_DATADIR> (if set), and F<$HOME/.ffmpeg>, and in
yading@10 1975 the data directory defined at configuration time (usually F<$PREFIX/share/ffmpeg>)
yading@10 1976 in that order. For example, if the argument is C<libx264-max>, it will
yading@10 1977 search for the file F<libx264-max.avpreset>.
yading@10 1978
yading@10 1979
yading@10 1980 =head2 Video and Audio grabbing
yading@10 1981
yading@10 1982
yading@10 1983 If you specify the input format and device then ffmpeg can grab video
yading@10 1984 and audio directly.
yading@10 1985
yading@10 1986
yading@10 1987 ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
yading@10 1988
yading@10 1989
yading@10 1990 Or with an ALSA audio source (mono input, card id 1) instead of OSS:
yading@10 1991
yading@10 1992 ffmpeg -f alsa -ac 1 -i hw:1 -f video4linux2 -i /dev/video0 /tmp/out.mpg
yading@10 1993
yading@10 1994
yading@10 1995 Note that you must activate the right video source and channel before
yading@10 1996 launching ffmpeg with any TV viewer such as
yading@10 1997 E<lt>B<http://linux.bytesex.org/xawtv/>E<gt> by Gerd Knorr. You also
yading@10 1998 have to set the audio recording levels correctly with a
yading@10 1999 standard mixer.
yading@10 2000
yading@10 2001
yading@10 2002 =head2 X11 grabbing
yading@10 2003
yading@10 2004
yading@10 2005 Grab the X11 display with ffmpeg via
yading@10 2006
yading@10 2007
yading@10 2008 ffmpeg -f x11grab -s cif -r 25 -i :0.0 /tmp/out.mpg
yading@10 2009
yading@10 2010
yading@10 2011 0.0 is display.screen number of your X11 server, same as
yading@10 2012 the DISPLAY environment variable.
yading@10 2013
yading@10 2014
yading@10 2015 ffmpeg -f x11grab -s cif -r 25 -i :0.0+10,20 /tmp/out.mpg
yading@10 2016
yading@10 2017
yading@10 2018 0.0 is display.screen number of your X11 server, same as the DISPLAY environment
yading@10 2019 variable. 10 is the x-offset and 20 the y-offset for the grabbing.
yading@10 2020
yading@10 2021
yading@10 2022 =head2 Video and Audio file format conversion
yading@10 2023
yading@10 2024
yading@10 2025 Any supported file format and protocol can serve as input to ffmpeg:
yading@10 2026
yading@10 2027 Examples:
yading@10 2028
yading@10 2029 =over 4
yading@10 2030
yading@10 2031
yading@10 2032 =item *
yading@10 2033
yading@10 2034 You can use YUV files as input:
yading@10 2035
yading@10 2036
yading@10 2037 ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
yading@10 2038
yading@10 2039
yading@10 2040 It will use the files:
yading@10 2041
yading@10 2042 /tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
yading@10 2043 /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
yading@10 2044
yading@10 2045
yading@10 2046 The Y files use twice the resolution of the U and V files. They are
yading@10 2047 raw files, without header. They can be generated by all decent video
yading@10 2048 decoders. You must specify the size of the image with the B<-s> option
yading@10 2049 if ffmpeg cannot guess it.
yading@10 2050
yading@10 2051
yading@10 2052 =item *
yading@10 2053
yading@10 2054 You can input from a raw YUV420P file:
yading@10 2055
yading@10 2056
yading@10 2057 ffmpeg -i /tmp/test.yuv /tmp/out.avi
yading@10 2058
yading@10 2059
yading@10 2060 test.yuv is a file containing raw YUV planar data. Each frame is composed
yading@10 2061 of the Y plane followed by the U and V planes at half vertical and
yading@10 2062 horizontal resolution.
yading@10 2063
yading@10 2064
yading@10 2065 =item *
yading@10 2066
yading@10 2067 You can output to a raw YUV420P file:
yading@10 2068
yading@10 2069
yading@10 2070 ffmpeg -i mydivx.avi hugefile.yuv
yading@10 2071
yading@10 2072
yading@10 2073
yading@10 2074 =item *
yading@10 2075
yading@10 2076 You can set several input files and output files:
yading@10 2077
yading@10 2078
yading@10 2079 ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
yading@10 2080
yading@10 2081
yading@10 2082 Converts the audio file a.wav and the raw YUV video file a.yuv
yading@10 2083 to MPEG file a.mpg.
yading@10 2084
yading@10 2085
yading@10 2086 =item *
yading@10 2087
yading@10 2088 You can also do audio and video conversions at the same time:
yading@10 2089
yading@10 2090
yading@10 2091 ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
yading@10 2092
yading@10 2093
yading@10 2094 Converts a.wav to MPEG audio at 22050 Hz sample rate.
yading@10 2095
yading@10 2096
yading@10 2097 =item *
yading@10 2098
yading@10 2099 You can encode to several formats at the same time and define a
yading@10 2100 mapping from input stream to output streams:
yading@10 2101
yading@10 2102
yading@10 2103 ffmpeg -i /tmp/a.wav -map 0:a -b:a 64k /tmp/a.mp2 -map 0:a -b:a 128k /tmp/b.mp2
yading@10 2104
yading@10 2105
yading@10 2106 Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. '-map
yading@10 2107 file:index' specifies which input stream is used for each output
yading@10 2108 stream, in the order of the definition of output streams.
yading@10 2109
yading@10 2110
yading@10 2111 =item *
yading@10 2112
yading@10 2113 You can transcode decrypted VOBs:
yading@10 2114
yading@10 2115
yading@10 2116 ffmpeg -i snatch_1.vob -f avi -c:v mpeg4 -b:v 800k -g 300 -bf 2 -c:a libmp3lame -b:a 128k snatch.avi
yading@10 2117
yading@10 2118
yading@10 2119 This is a typical DVD ripping example; the input is a VOB file, the
yading@10 2120 output an AVI file with MPEG-4 video and MP3 audio. Note that in this
yading@10 2121 command we use B-frames so the MPEG-4 stream is DivX5 compatible, and
yading@10 2122 GOP size is 300 which means one intra frame every 10 seconds for 29.97fps
yading@10 2123 input video. Furthermore, the audio stream is MP3-encoded so you need
yading@10 2124 to enable LAME support by passing C<--enable-libmp3lame> to configure.
yading@10 2125 The mapping is particularly useful for DVD transcoding
yading@10 2126 to get the desired audio language.
yading@10 2127
yading@10 2128 NOTE: To see the supported input formats, use C<ffmpeg -formats>.
yading@10 2129
yading@10 2130
yading@10 2131 =item *
yading@10 2132
yading@10 2133 You can extract images from a video, or create a video from many images:
yading@10 2134
yading@10 2135 For extracting images from a video:
yading@10 2136
yading@10 2137 ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
yading@10 2138
yading@10 2139
yading@10 2140 This will extract one video frame per second from the video and will
yading@10 2141 output them in files named F<foo-001.jpeg>, F<foo-002.jpeg>,
yading@10 2142 etc. Images will be rescaled to fit the new WxH values.
yading@10 2143
yading@10 2144 If you want to extract just a limited number of frames, you can use the
yading@10 2145 above command in combination with the -vframes or -t option, or in
yading@10 2146 combination with -ss to start extracting from a certain point in time.
yading@10 2147
yading@10 2148 For creating a video from many images:
yading@10 2149
yading@10 2150 ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi
yading@10 2151
yading@10 2152
yading@10 2153 The syntax C<foo-%03d.jpeg> specifies to use a decimal number
yading@10 2154 composed of three digits padded with zeroes to express the sequence
yading@10 2155 number. It is the same syntax supported by the C printf function, but
yading@10 2156 only formats accepting a normal integer are suitable.
yading@10 2157
yading@10 2158 When importing an image sequence, -i also supports expanding
yading@10 2159 shell-like wildcard patterns (globbing) internally, by selecting the
yading@10 2160 image2-specific C<-pattern_type glob> option.
yading@10 2161
yading@10 2162 For example, for creating a video from filenames matching the glob pattern
yading@10 2163 C<foo-*.jpeg>:
yading@10 2164
yading@10 2165 ffmpeg -f image2 -pattern_type glob -i 'foo-*.jpeg' -r 12 -s WxH foo.avi
yading@10 2166
yading@10 2167
yading@10 2168
yading@10 2169 =item *
yading@10 2170
yading@10 2171 You can put many streams of the same type in the output:
yading@10 2172
yading@10 2173
yading@10 2174 ffmpeg -i test1.avi -i test2.avi -map 0:3 -map 0:2 -map 0:1 -map 0:0 -c copy test12.nut
yading@10 2175
yading@10 2176
yading@10 2177 The resulting output file F<test12.avi> will contain first four streams from
yading@10 2178 the input file in reverse order.
yading@10 2179
yading@10 2180
yading@10 2181 =item *
yading@10 2182
yading@10 2183 To force CBR video output:
yading@10 2184
yading@10 2185 ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
yading@10 2186
yading@10 2187
yading@10 2188
yading@10 2189 =item *
yading@10 2190
yading@10 2191 The four options lmin, lmax, mblmin and mblmax use 'lambda' units,
yading@10 2192 but you may use the QP2LAMBDA constant to easily convert from 'q' units:
yading@10 2193
yading@10 2194 ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
yading@10 2195
yading@10 2196
yading@10 2197
yading@10 2198 =back
yading@10 2199
yading@10 2200
yading@10 2201
yading@10 2202
yading@10 2203 =head1 SYNTAX
yading@10 2204
yading@10 2205
yading@10 2206 This section documents the syntax and formats employed by the FFmpeg
yading@10 2207 libraries and tools.
yading@10 2208
yading@10 2209
yading@10 2210
yading@10 2211 =head2 Quoting and escaping
yading@10 2212
yading@10 2213
yading@10 2214 FFmpeg adopts the following quoting and escaping mechanism, unless
yading@10 2215 explicitly specified. The following rules are applied:
yading@10 2216
yading@10 2217
yading@10 2218 =over 4
yading@10 2219
yading@10 2220
yading@10 2221 =item *
yading@10 2222
yading@10 2223 C<'> and C<\> are special characters (respectively used for
yading@10 2224 quoting and escaping). In addition to them, there might be other
yading@10 2225 special characters depending on the specific syntax where the escaping
yading@10 2226 and quoting are employed.
yading@10 2227
yading@10 2228
yading@10 2229 =item *
yading@10 2230
yading@10 2231 A special character is escaped by prefixing it with a '\'.
yading@10 2232
yading@10 2233
yading@10 2234 =item *
yading@10 2235
yading@10 2236 All characters enclosed between '' are included literally in the
yading@10 2237 parsed string. The quote character C<'> itself cannot be quoted,
yading@10 2238 so you may need to close the quote and escape it.
yading@10 2239
yading@10 2240
yading@10 2241 =item *
yading@10 2242
yading@10 2243 Leading and trailing whitespaces, unless escaped or quoted, are
yading@10 2244 removed from the parsed string.
yading@10 2245
yading@10 2246 =back
yading@10 2247
yading@10 2248
yading@10 2249 Note that you may need to add a second level of escaping when using
yading@10 2250 the command line or a script, which depends on the syntax of the
yading@10 2251 adopted shell language.
yading@10 2252
yading@10 2253 The function C<av_get_token> defined in
yading@10 2254 F<libavutil/avstring.h> can be used to parse a token quoted or
yading@10 2255 escaped according to the rules defined above.
yading@10 2256
yading@10 2257 The tool F<tools/ffescape> in the FFmpeg source tree can be used
yading@10 2258 to automatically quote or escape a string in a script.
yading@10 2259
yading@10 2260
yading@10 2261 =head3 Examples
yading@10 2262
yading@10 2263
yading@10 2264
yading@10 2265 =over 4
yading@10 2266
yading@10 2267
yading@10 2268 =item *
yading@10 2269
yading@10 2270 Escape the string C<Crime d'Amour> containing the C<'> special
yading@10 2271 character:
yading@10 2272
yading@10 2273 Crime d\'Amour
yading@10 2274
yading@10 2275
yading@10 2276
yading@10 2277 =item *
yading@10 2278
yading@10 2279 The string above contains a quote, so the C<'> needs to be escaped
yading@10 2280 when quoting it:
yading@10 2281
yading@10 2282 'Crime d'\''Amour'
yading@10 2283
yading@10 2284
yading@10 2285
yading@10 2286 =item *
yading@10 2287
yading@10 2288 Include leading or trailing whitespaces using quoting:
yading@10 2289
yading@10 2290 ' this string starts and ends with whitespaces '
yading@10 2291
yading@10 2292
yading@10 2293
yading@10 2294 =item *
yading@10 2295
yading@10 2296 Escaping and quoting can be mixed together:
yading@10 2297
yading@10 2298 ' The string '\'string\'' is a string '
yading@10 2299
yading@10 2300
yading@10 2301
yading@10 2302 =item *
yading@10 2303
yading@10 2304 To include a literal C<\> you can use either escaping or quoting:
yading@10 2305
yading@10 2306 'c:\foo' can be written as c:\\foo
yading@10 2307
yading@10 2308
yading@10 2309 =back
yading@10 2310
yading@10 2311
yading@10 2312
yading@10 2313
yading@10 2314 =head2 Date
yading@10 2315
yading@10 2316
yading@10 2317 The accepted syntax is:
yading@10 2318
yading@10 2319 [(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
yading@10 2320 now
yading@10 2321
yading@10 2322
yading@10 2323 If the value is "now" it takes the current time.
yading@10 2324
yading@10 2325 Time is local time unless Z is appended, in which case it is
yading@10 2326 interpreted as UTC.
yading@10 2327 If the year-month-day part is not specified it takes the current
yading@10 2328 year-month-day.
yading@10 2329
yading@10 2330
yading@10 2331
yading@10 2332 =head2 Time duration
yading@10 2333
yading@10 2334
yading@10 2335 The accepted syntax is:
yading@10 2336
yading@10 2337 [-][HH:]MM:SS[.m...]
yading@10 2338 [-]S+[.m...]
yading@10 2339
yading@10 2340
yading@10 2341 I<HH> expresses the number of hours, I<MM> the number a of minutes
yading@10 2342 and I<SS> the number of seconds.
yading@10 2343
yading@10 2344
yading@10 2345
yading@10 2346 =head2 Video size
yading@10 2347
yading@10 2348 Specify the size of the sourced video, it may be a string of the form
yading@10 2349 I<width>xI<height>, or the name of a size abbreviation.
yading@10 2350
yading@10 2351 The following abbreviations are recognized:
yading@10 2352
yading@10 2353 =over 4
yading@10 2354
yading@10 2355
yading@10 2356 =item B<ntsc>
yading@10 2357
yading@10 2358 720x480
yading@10 2359
yading@10 2360 =item B<pal>
yading@10 2361
yading@10 2362 720x576
yading@10 2363
yading@10 2364 =item B<qntsc>
yading@10 2365
yading@10 2366 352x240
yading@10 2367
yading@10 2368 =item B<qpal>
yading@10 2369
yading@10 2370 352x288
yading@10 2371
yading@10 2372 =item B<sntsc>
yading@10 2373
yading@10 2374 640x480
yading@10 2375
yading@10 2376 =item B<spal>
yading@10 2377
yading@10 2378 768x576
yading@10 2379
yading@10 2380 =item B<film>
yading@10 2381
yading@10 2382 352x240
yading@10 2383
yading@10 2384 =item B<ntsc-film>
yading@10 2385
yading@10 2386 352x240
yading@10 2387
yading@10 2388 =item B<sqcif>
yading@10 2389
yading@10 2390 128x96
yading@10 2391
yading@10 2392 =item B<qcif>
yading@10 2393
yading@10 2394 176x144
yading@10 2395
yading@10 2396 =item B<cif>
yading@10 2397
yading@10 2398 352x288
yading@10 2399
yading@10 2400 =item B<4cif>
yading@10 2401
yading@10 2402 704x576
yading@10 2403
yading@10 2404 =item B<16cif>
yading@10 2405
yading@10 2406 1408x1152
yading@10 2407
yading@10 2408 =item B<qqvga>
yading@10 2409
yading@10 2410 160x120
yading@10 2411
yading@10 2412 =item B<qvga>
yading@10 2413
yading@10 2414 320x240
yading@10 2415
yading@10 2416 =item B<vga>
yading@10 2417
yading@10 2418 640x480
yading@10 2419
yading@10 2420 =item B<svga>
yading@10 2421
yading@10 2422 800x600
yading@10 2423
yading@10 2424 =item B<xga>
yading@10 2425
yading@10 2426 1024x768
yading@10 2427
yading@10 2428 =item B<uxga>
yading@10 2429
yading@10 2430 1600x1200
yading@10 2431
yading@10 2432 =item B<qxga>
yading@10 2433
yading@10 2434 2048x1536
yading@10 2435
yading@10 2436 =item B<sxga>
yading@10 2437
yading@10 2438 1280x1024
yading@10 2439
yading@10 2440 =item B<qsxga>
yading@10 2441
yading@10 2442 2560x2048
yading@10 2443
yading@10 2444 =item B<hsxga>
yading@10 2445
yading@10 2446 5120x4096
yading@10 2447
yading@10 2448 =item B<wvga>
yading@10 2449
yading@10 2450 852x480
yading@10 2451
yading@10 2452 =item B<wxga>
yading@10 2453
yading@10 2454 1366x768
yading@10 2455
yading@10 2456 =item B<wsxga>
yading@10 2457
yading@10 2458 1600x1024
yading@10 2459
yading@10 2460 =item B<wuxga>
yading@10 2461
yading@10 2462 1920x1200
yading@10 2463
yading@10 2464 =item B<woxga>
yading@10 2465
yading@10 2466 2560x1600
yading@10 2467
yading@10 2468 =item B<wqsxga>
yading@10 2469
yading@10 2470 3200x2048
yading@10 2471
yading@10 2472 =item B<wquxga>
yading@10 2473
yading@10 2474 3840x2400
yading@10 2475
yading@10 2476 =item B<whsxga>
yading@10 2477
yading@10 2478 6400x4096
yading@10 2479
yading@10 2480 =item B<whuxga>
yading@10 2481
yading@10 2482 7680x4800
yading@10 2483
yading@10 2484 =item B<cga>
yading@10 2485
yading@10 2486 320x200
yading@10 2487
yading@10 2488 =item B<ega>
yading@10 2489
yading@10 2490 640x350
yading@10 2491
yading@10 2492 =item B<hd480>
yading@10 2493
yading@10 2494 852x480
yading@10 2495
yading@10 2496 =item B<hd720>
yading@10 2497
yading@10 2498 1280x720
yading@10 2499
yading@10 2500 =item B<hd1080>
yading@10 2501
yading@10 2502 1920x1080
yading@10 2503
yading@10 2504 =item B<2k>
yading@10 2505
yading@10 2506 2048x1080
yading@10 2507
yading@10 2508 =item B<2kflat>
yading@10 2509
yading@10 2510 1998x1080
yading@10 2511
yading@10 2512 =item B<2kscope>
yading@10 2513
yading@10 2514 2048x858
yading@10 2515
yading@10 2516 =item B<4k>
yading@10 2517
yading@10 2518 4096x2160
yading@10 2519
yading@10 2520 =item B<4kflat>
yading@10 2521
yading@10 2522 3996x2160
yading@10 2523
yading@10 2524 =item B<4kscope>
yading@10 2525
yading@10 2526 4096x1716
yading@10 2527
yading@10 2528 =back
yading@10 2529
yading@10 2530
yading@10 2531
yading@10 2532
yading@10 2533 =head2 Video rate
yading@10 2534
yading@10 2535
yading@10 2536 Specify the frame rate of a video, expressed as the number of frames
yading@10 2537 generated per second. It has to be a string in the format
yading@10 2538 I<frame_rate_num>/I<frame_rate_den>, an integer number, a float
yading@10 2539 number or a valid video frame rate abbreviation.
yading@10 2540
yading@10 2541 The following abbreviations are recognized:
yading@10 2542
yading@10 2543 =over 4
yading@10 2544
yading@10 2545
yading@10 2546 =item B<ntsc>
yading@10 2547
yading@10 2548 30000/1001
yading@10 2549
yading@10 2550 =item B<pal>
yading@10 2551
yading@10 2552 25/1
yading@10 2553
yading@10 2554 =item B<qntsc>
yading@10 2555
yading@10 2556 30000/1001
yading@10 2557
yading@10 2558 =item B<qpal>
yading@10 2559
yading@10 2560 25/1
yading@10 2561
yading@10 2562 =item B<sntsc>
yading@10 2563
yading@10 2564 30000/1001
yading@10 2565
yading@10 2566 =item B<spal>
yading@10 2567
yading@10 2568 25/1
yading@10 2569
yading@10 2570 =item B<film>
yading@10 2571
yading@10 2572 24/1
yading@10 2573
yading@10 2574 =item B<ntsc-film>
yading@10 2575
yading@10 2576 24000/1001
yading@10 2577
yading@10 2578 =back
yading@10 2579
yading@10 2580
yading@10 2581
yading@10 2582
yading@10 2583 =head2 Ratio
yading@10 2584
yading@10 2585
yading@10 2586 A ratio can be expressed as an expression, or in the form
yading@10 2587 I<numerator>:I<denominator>.
yading@10 2588
yading@10 2589 Note that a ratio with infinite (1/0) or negative value is
yading@10 2590 considered valid, so you should check on the returned value if you
yading@10 2591 want to exclude those values.
yading@10 2592
yading@10 2593 The undefined value can be expressed using the "0:0" string.
yading@10 2594
yading@10 2595
yading@10 2596
yading@10 2597 =head2 Color
yading@10 2598
yading@10 2599
yading@10 2600 It can be the name of a color (case insensitive match) or a
yading@10 2601 [0x|#]RRGGBB[AA] sequence, possibly followed by "@" and a string
yading@10 2602 representing the alpha component.
yading@10 2603
yading@10 2604 The alpha component may be a string composed by "0x" followed by an
yading@10 2605 hexadecimal number or a decimal number between 0.0 and 1.0, which
yading@10 2606 represents the opacity value (0x00/0.0 means completely transparent,
yading@10 2607 0xff/1.0 completely opaque).
yading@10 2608 If the alpha component is not specified then 0xff is assumed.
yading@10 2609
yading@10 2610 The string "random" will result in a random color.
yading@10 2611
yading@10 2612
yading@10 2613
yading@10 2614 =head1 EXPRESSION EVALUATION
yading@10 2615
yading@10 2616
yading@10 2617 When evaluating an arithmetic expression, FFmpeg uses an internal
yading@10 2618 formula evaluator, implemented through the F<libavutil/eval.h>
yading@10 2619 interface.
yading@10 2620
yading@10 2621 An expression may contain unary, binary operators, constants, and
yading@10 2622 functions.
yading@10 2623
yading@10 2624 Two expressions I<expr1> and I<expr2> can be combined to form
yading@10 2625 another expression "I<expr1>;I<expr2>".
yading@10 2626 I<expr1> and I<expr2> are evaluated in turn, and the new
yading@10 2627 expression evaluates to the value of I<expr2>.
yading@10 2628
yading@10 2629 The following binary operators are available: C<+>, C<->,
yading@10 2630 C<*>, C</>, C<^>.
yading@10 2631
yading@10 2632 The following unary operators are available: C<+>, C<->.
yading@10 2633
yading@10 2634 The following functions are available:
yading@10 2635
yading@10 2636 =over 4
yading@10 2637
yading@10 2638
yading@10 2639 =item B<abs(x)>
yading@10 2640
yading@10 2641 Compute absolute value of I<x>.
yading@10 2642
yading@10 2643
yading@10 2644 =item B<acos(x)>
yading@10 2645
yading@10 2646 Compute arccosine of I<x>.
yading@10 2647
yading@10 2648
yading@10 2649 =item B<asin(x)>
yading@10 2650
yading@10 2651 Compute arcsine of I<x>.
yading@10 2652
yading@10 2653
yading@10 2654 =item B<atan(x)>
yading@10 2655
yading@10 2656 Compute arctangent of I<x>.
yading@10 2657
yading@10 2658
yading@10 2659 =item B<between(x, min, max)>
yading@10 2660
yading@10 2661 Return 1 if I<x> is greater than or equal to I<min> and lesser than or
yading@10 2662 equal to I<max>, 0 otherwise.
yading@10 2663
yading@10 2664
yading@10 2665 =item B<bitand(x, y)>
yading@10 2666
yading@10 2667
yading@10 2668 =item B<bitor(x, y)>
yading@10 2669
yading@10 2670 Compute bitwise and/or operation on I<x> and I<y>.
yading@10 2671
yading@10 2672 The results of the evaluation of I<x> and I<y> are converted to
yading@10 2673 integers before executing the bitwise operation.
yading@10 2674
yading@10 2675 Note that both the conversion to integer and the conversion back to
yading@10 2676 floating point can lose precision. Beware of unexpected results for
yading@10 2677 large numbers (usually 2^53 and larger).
yading@10 2678
yading@10 2679
yading@10 2680 =item B<ceil(expr)>
yading@10 2681
yading@10 2682 Round the value of expression I<expr> upwards to the nearest
yading@10 2683 integer. For example, "ceil(1.5)" is "2.0".
yading@10 2684
yading@10 2685
yading@10 2686 =item B<cos(x)>
yading@10 2687
yading@10 2688 Compute cosine of I<x>.
yading@10 2689
yading@10 2690
yading@10 2691 =item B<cosh(x)>
yading@10 2692
yading@10 2693 Compute hyperbolic cosine of I<x>.
yading@10 2694
yading@10 2695
yading@10 2696 =item B<eq(x, y)>
yading@10 2697
yading@10 2698 Return 1 if I<x> and I<y> are equivalent, 0 otherwise.
yading@10 2699
yading@10 2700
yading@10 2701 =item B<exp(x)>
yading@10 2702
yading@10 2703 Compute exponential of I<x> (with base C<e>, the Euler's number).
yading@10 2704
yading@10 2705
yading@10 2706 =item B<floor(expr)>
yading@10 2707
yading@10 2708 Round the value of expression I<expr> downwards to the nearest
yading@10 2709 integer. For example, "floor(-1.5)" is "-2.0".
yading@10 2710
yading@10 2711
yading@10 2712 =item B<gauss(x)>
yading@10 2713
yading@10 2714 Compute Gauss function of I<x>, corresponding to
yading@10 2715 C<exp(-x*x/2) / sqrt(2*PI)>.
yading@10 2716
yading@10 2717
yading@10 2718 =item B<gcd(x, y)>
yading@10 2719
yading@10 2720 Return the greatest common divisor of I<x> and I<y>. If both I<x> and
yading@10 2721 I<y> are 0 or either or both are less than zero then behavior is undefined.
yading@10 2722
yading@10 2723
yading@10 2724 =item B<gt(x, y)>
yading@10 2725
yading@10 2726 Return 1 if I<x> is greater than I<y>, 0 otherwise.
yading@10 2727
yading@10 2728
yading@10 2729 =item B<gte(x, y)>
yading@10 2730
yading@10 2731 Return 1 if I<x> is greater than or equal to I<y>, 0 otherwise.
yading@10 2732
yading@10 2733
yading@10 2734 =item B<hypot(x, y)>
yading@10 2735
yading@10 2736 This function is similar to the C function with the same name; it returns
yading@10 2737 "sqrt(I<x>*I<x> + I<y>*I<y>)", the length of the hypotenuse of a
yading@10 2738 right triangle with sides of length I<x> and I<y>, or the distance of the
yading@10 2739 point (I<x>, I<y>) from the origin.
yading@10 2740
yading@10 2741
yading@10 2742 =item B<if(x, y)>
yading@10 2743
yading@10 2744 Evaluate I<x>, and if the result is non-zero return the result of
yading@10 2745 the evaluation of I<y>, return 0 otherwise.
yading@10 2746
yading@10 2747
yading@10 2748 =item B<if(x, y, z)>
yading@10 2749
yading@10 2750 Evaluate I<x>, and if the result is non-zero return the evaluation
yading@10 2751 result of I<y>, otherwise the evaluation result of I<z>.
yading@10 2752
yading@10 2753
yading@10 2754 =item B<ifnot(x, y)>
yading@10 2755
yading@10 2756 Evaluate I<x>, and if the result is zero return the result of the
yading@10 2757 evaluation of I<y>, return 0 otherwise.
yading@10 2758
yading@10 2759
yading@10 2760 =item B<ifnot(x, y, z)>
yading@10 2761
yading@10 2762 Evaluate I<x>, and if the result is zero return the evaluation
yading@10 2763 result of I<y>, otherwise the evaluation result of I<z>.
yading@10 2764
yading@10 2765
yading@10 2766 =item B<isinf(x)>
yading@10 2767
yading@10 2768 Return 1.0 if I<x> is +/-INFINITY, 0.0 otherwise.
yading@10 2769
yading@10 2770
yading@10 2771 =item B<isnan(x)>
yading@10 2772
yading@10 2773 Return 1.0 if I<x> is NAN, 0.0 otherwise.
yading@10 2774
yading@10 2775
yading@10 2776 =item B<ld(var)>
yading@10 2777
yading@10 2778 Allow to load the value of the internal variable with number
yading@10 2779 I<var>, which was previously stored with st(I<var>, I<expr>).
yading@10 2780 The function returns the loaded value.
yading@10 2781
yading@10 2782
yading@10 2783 =item B<log(x)>
yading@10 2784
yading@10 2785 Compute natural logarithm of I<x>.
yading@10 2786
yading@10 2787
yading@10 2788 =item B<lt(x, y)>
yading@10 2789
yading@10 2790 Return 1 if I<x> is lesser than I<y>, 0 otherwise.
yading@10 2791
yading@10 2792
yading@10 2793 =item B<lte(x, y)>
yading@10 2794
yading@10 2795 Return 1 if I<x> is lesser than or equal to I<y>, 0 otherwise.
yading@10 2796
yading@10 2797
yading@10 2798 =item B<max(x, y)>
yading@10 2799
yading@10 2800 Return the maximum between I<x> and I<y>.
yading@10 2801
yading@10 2802
yading@10 2803 =item B<min(x, y)>
yading@10 2804
yading@10 2805 Return the maximum between I<x> and I<y>.
yading@10 2806
yading@10 2807
yading@10 2808 =item B<mod(x, y)>
yading@10 2809
yading@10 2810 Compute the remainder of division of I<x> by I<y>.
yading@10 2811
yading@10 2812
yading@10 2813 =item B<not(expr)>
yading@10 2814
yading@10 2815 Return 1.0 if I<expr> is zero, 0.0 otherwise.
yading@10 2816
yading@10 2817
yading@10 2818 =item B<pow(x, y)>
yading@10 2819
yading@10 2820 Compute the power of I<x> elevated I<y>, it is equivalent to
yading@10 2821 "(I<x>)^(I<y>)".
yading@10 2822
yading@10 2823
yading@10 2824 =item B<print(t)>
yading@10 2825
yading@10 2826
yading@10 2827 =item B<print(t, l)>
yading@10 2828
yading@10 2829 Print the value of expression I<t> with loglevel I<l>. If
yading@10 2830 I<l> is not specified then a default log level is used.
yading@10 2831 Returns the value of the expression printed.
yading@10 2832
yading@10 2833 Prints t with loglevel l
yading@10 2834
yading@10 2835
yading@10 2836 =item B<random(x)>
yading@10 2837
yading@10 2838 Return a pseudo random value between 0.0 and 1.0. I<x> is the index of the
yading@10 2839 internal variable which will be used to save the seed/state.
yading@10 2840
yading@10 2841
yading@10 2842 =item B<root(expr, max)>
yading@10 2843
yading@10 2844 Find an input value for which the function represented by I<expr>
yading@10 2845 with argument I<ld(0)> is 0 in the interval 0..I<max>.
yading@10 2846
yading@10 2847 The expression in I<expr> must denote a continuous function or the
yading@10 2848 result is undefined.
yading@10 2849
yading@10 2850 I<ld(0)> is used to represent the function input value, which means
yading@10 2851 that the given expression will be evaluated multiple times with
yading@10 2852 various input values that the expression can access through
yading@10 2853 C<ld(0)>. When the expression evaluates to 0 then the
yading@10 2854 corresponding input value will be returned.
yading@10 2855
yading@10 2856
yading@10 2857 =item B<sin(x)>
yading@10 2858
yading@10 2859 Compute sine of I<x>.
yading@10 2860
yading@10 2861
yading@10 2862 =item B<sinh(x)>
yading@10 2863
yading@10 2864 Compute hyperbolic sine of I<x>.
yading@10 2865
yading@10 2866
yading@10 2867 =item B<sqrt(expr)>
yading@10 2868
yading@10 2869 Compute the square root of I<expr>. This is equivalent to
yading@10 2870 "(I<expr>)^.5".
yading@10 2871
yading@10 2872
yading@10 2873 =item B<squish(x)>
yading@10 2874
yading@10 2875 Compute expression C<1/(1 + exp(4*x))>.
yading@10 2876
yading@10 2877
yading@10 2878 =item B<st(var, expr)>
yading@10 2879
yading@10 2880 Allow to store the value of the expression I<expr> in an internal
yading@10 2881 variable. I<var> specifies the number of the variable where to
yading@10 2882 store the value, and it is a value ranging from 0 to 9. The function
yading@10 2883 returns the value stored in the internal variable.
yading@10 2884 Note, Variables are currently not shared between expressions.
yading@10 2885
yading@10 2886
yading@10 2887 =item B<tan(x)>
yading@10 2888
yading@10 2889 Compute tangent of I<x>.
yading@10 2890
yading@10 2891
yading@10 2892 =item B<tanh(x)>
yading@10 2893
yading@10 2894 Compute hyperbolic tangent of I<x>.
yading@10 2895
yading@10 2896
yading@10 2897 =item B<taylor(expr, x)>
yading@10 2898
yading@10 2899
yading@10 2900 =item B<taylor(expr, x, id)>
yading@10 2901
yading@10 2902 Evaluate a Taylor series at I<x>, given an expression representing
yading@10 2903 the C<ld(id)>-th derivative of a function at 0.
yading@10 2904
yading@10 2905 When the series does not converge the result is undefined.
yading@10 2906
yading@10 2907 I<ld(id)> is used to represent the derivative order in I<expr>,
yading@10 2908 which means that the given expression will be evaluated multiple times
yading@10 2909 with various input values that the expression can access through
yading@10 2910 C<ld(id)>. If I<id> is not specified then 0 is assumed.
yading@10 2911
yading@10 2912 Note, when you have the derivatives at y instead of 0,
yading@10 2913 C<taylor(expr, x-y)> can be used.
yading@10 2914
yading@10 2915
yading@10 2916 =item B<time(0)>
yading@10 2917
yading@10 2918 Return the current (wallclock) time in seconds.
yading@10 2919
yading@10 2920
yading@10 2921 =item B<trunc(expr)>
yading@10 2922
yading@10 2923 Round the value of expression I<expr> towards zero to the nearest
yading@10 2924 integer. For example, "trunc(-1.5)" is "-1.0".
yading@10 2925
yading@10 2926
yading@10 2927 =item B<while(cond, expr)>
yading@10 2928
yading@10 2929 Evaluate expression I<expr> while the expression I<cond> is
yading@10 2930 non-zero, and returns the value of the last I<expr> evaluation, or
yading@10 2931 NAN if I<cond> was always false.
yading@10 2932
yading@10 2933 =back
yading@10 2934
yading@10 2935
yading@10 2936 The following constants are available:
yading@10 2937
yading@10 2938 =over 4
yading@10 2939
yading@10 2940
yading@10 2941 =item B<PI>
yading@10 2942
yading@10 2943 area of the unit disc, approximately 3.14
yading@10 2944
yading@10 2945 =item B<E>
yading@10 2946
yading@10 2947 exp(1) (Euler's number), approximately 2.718
yading@10 2948
yading@10 2949 =item B<PHI>
yading@10 2950
yading@10 2951 golden ratio (1+sqrt(5))/2, approximately 1.618
yading@10 2952
yading@10 2953 =back
yading@10 2954
yading@10 2955
yading@10 2956 Assuming that an expression is considered "true" if it has a non-zero
yading@10 2957 value, note that:
yading@10 2958
yading@10 2959 C<*> works like AND
yading@10 2960
yading@10 2961 C<+> works like OR
yading@10 2962
yading@10 2963 For example the construct:
yading@10 2964
yading@10 2965 if (A AND B) then C
yading@10 2966
yading@10 2967 is equivalent to:
yading@10 2968
yading@10 2969 if(A*B, C)
yading@10 2970
yading@10 2971
yading@10 2972 In your C code, you can extend the list of unary and binary functions,
yading@10 2973 and define recognized constants, so that they are available for your
yading@10 2974 expressions.
yading@10 2975
yading@10 2976 The evaluator also recognizes the International System unit prefixes.
yading@10 2977 If 'i' is appended after the prefix, binary prefixes are used, which
yading@10 2978 are based on powers of 1024 instead of powers of 1000.
yading@10 2979 The 'B' postfix multiplies the value by 8, and can be appended after a
yading@10 2980 unit prefix or used alone. This allows using for example 'KB', 'MiB',
yading@10 2981 'G' and 'B' as number postfix.
yading@10 2982
yading@10 2983 The list of available International System prefixes follows, with
yading@10 2984 indication of the corresponding powers of 10 and of 2.
yading@10 2985
yading@10 2986 =over 4
yading@10 2987
yading@10 2988
yading@10 2989 =item B<y>
yading@10 2990
yading@10 2991 10^-24 / 2^-80
yading@10 2992
yading@10 2993 =item B<z>
yading@10 2994
yading@10 2995 10^-21 / 2^-70
yading@10 2996
yading@10 2997 =item B<a>
yading@10 2998
yading@10 2999 10^-18 / 2^-60
yading@10 3000
yading@10 3001 =item B<f>
yading@10 3002
yading@10 3003 10^-15 / 2^-50
yading@10 3004
yading@10 3005 =item B<p>
yading@10 3006
yading@10 3007 10^-12 / 2^-40
yading@10 3008
yading@10 3009 =item B<n>
yading@10 3010
yading@10 3011 10^-9 / 2^-30
yading@10 3012
yading@10 3013 =item B<u>
yading@10 3014
yading@10 3015 10^-6 / 2^-20
yading@10 3016
yading@10 3017 =item B<m>
yading@10 3018
yading@10 3019 10^-3 / 2^-10
yading@10 3020
yading@10 3021 =item B<c>
yading@10 3022
yading@10 3023 10^-2
yading@10 3024
yading@10 3025 =item B<d>
yading@10 3026
yading@10 3027 10^-1
yading@10 3028
yading@10 3029 =item B<h>
yading@10 3030
yading@10 3031 10^2
yading@10 3032
yading@10 3033 =item B<k>
yading@10 3034
yading@10 3035 10^3 / 2^10
yading@10 3036
yading@10 3037 =item B<K>
yading@10 3038
yading@10 3039 10^3 / 2^10
yading@10 3040
yading@10 3041 =item B<M>
yading@10 3042
yading@10 3043 10^6 / 2^20
yading@10 3044
yading@10 3045 =item B<G>
yading@10 3046
yading@10 3047 10^9 / 2^30
yading@10 3048
yading@10 3049 =item B<T>
yading@10 3050
yading@10 3051 10^12 / 2^40
yading@10 3052
yading@10 3053 =item B<P>
yading@10 3054
yading@10 3055 10^15 / 2^40
yading@10 3056
yading@10 3057 =item B<E>
yading@10 3058
yading@10 3059 10^18 / 2^50
yading@10 3060
yading@10 3061 =item B<Z>
yading@10 3062
yading@10 3063 10^21 / 2^60
yading@10 3064
yading@10 3065 =item B<Y>
yading@10 3066
yading@10 3067 10^24 / 2^70
yading@10 3068
yading@10 3069 =back
yading@10 3070
yading@10 3071
yading@10 3072
yading@10 3073
yading@10 3074 =head1 OPENCL OPTIONS
yading@10 3075
yading@10 3076
yading@10 3077 When FFmpeg is configured with C<--enable-opencl>, it is possible
yading@10 3078 to set the options for the global OpenCL context.
yading@10 3079
yading@10 3080 The list of supported options follows:
yading@10 3081
yading@10 3082
yading@10 3083 =over 4
yading@10 3084
yading@10 3085
yading@10 3086 =item B<build_options>
yading@10 3087
yading@10 3088 Set build options used to compile the registered kernels.
yading@10 3089
yading@10 3090 See reference "OpenCL Specification Version: 1.2 chapter 5.6.4".
yading@10 3091
yading@10 3092
yading@10 3093 =item B<platform_idx>
yading@10 3094
yading@10 3095 Select the index of the platform to run OpenCL code.
yading@10 3096
yading@10 3097 The specified index must be one of the indexes in the device list
yading@10 3098 which can be obtained with C<av_opencl_get_device_list()>.
yading@10 3099
yading@10 3100
yading@10 3101 =item B<device_idx>
yading@10 3102
yading@10 3103 Select the index of the device used to run OpenCL code.
yading@10 3104
yading@10 3105 The specifed index must be one of the indexes in the device list which
yading@10 3106 can be obtained with C<av_opencl_get_device_list()>.
yading@10 3107
yading@10 3108
yading@10 3109 =back
yading@10 3110
yading@10 3111
yading@10 3112
yading@10 3113
yading@10 3114 =head1 CODEC OPTIONS
yading@10 3115
yading@10 3116
yading@10 3117 libavcodec provides some generic global options, which can be set on
yading@10 3118 all the encoders and decoders. In addition each codec may support
yading@10 3119 so-called private options, which are specific for a given codec.
yading@10 3120
yading@10 3121 Sometimes, a global option may only affect a specific kind of codec,
yading@10 3122 and may be unsensical or ignored by another, so you need to be aware
yading@10 3123 of the meaning of the specified options. Also some options are
yading@10 3124 meant only for decoding or encoding.
yading@10 3125
yading@10 3126 Options may be set by specifying -I<option> I<value> in the
yading@10 3127 FFmpeg tools, or by setting the value explicitly in the
yading@10 3128 C<AVCodecContext> options or using the F<libavutil/opt.h> API
yading@10 3129 for programmatic use.
yading@10 3130
yading@10 3131 The list of supported options follow:
yading@10 3132
yading@10 3133
yading@10 3134 =over 4
yading@10 3135
yading@10 3136
yading@10 3137 =item B<b> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 3138
yading@10 3139 Set bitrate in bits/s. Default value is 200K.
yading@10 3140
yading@10 3141
yading@10 3142 =item B<ab> I<integer> B<(>I<encoding,audio>B<)>
yading@10 3143
yading@10 3144 Set audio bitrate (in bits/s). Default value is 128K.
yading@10 3145
yading@10 3146
yading@10 3147 =item B<bt> I<integer> B<(>I<encoding,video>B<)>
yading@10 3148
yading@10 3149 Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate
yading@10 3150 tolerance specifies how far ratecontrol is willing to deviate from the
yading@10 3151 target average bitrate value. This is not related to min/max
yading@10 3152 bitrate. Lowering tolerance too much has an adverse effect on quality.
yading@10 3153
yading@10 3154
yading@10 3155 =item B<flags> I<flags> B<(>I<decoding/encoding,audio,video,subtitles>B<)>
yading@10 3156
yading@10 3157 Set generic flags.
yading@10 3158
yading@10 3159 Possible values:
yading@10 3160
yading@10 3161 =over 4
yading@10 3162
yading@10 3163
yading@10 3164 =item B<mv4>
yading@10 3165
yading@10 3166 Use four motion vector by macroblock (mpeg4).
yading@10 3167
yading@10 3168 =item B<qpel>
yading@10 3169
yading@10 3170 Use 1/4 pel motion compensation.
yading@10 3171
yading@10 3172 =item B<loop>
yading@10 3173
yading@10 3174 Use loop filter.
yading@10 3175
yading@10 3176 =item B<qscale>
yading@10 3177
yading@10 3178 Use fixed qscale.
yading@10 3179
yading@10 3180 =item B<gmc>
yading@10 3181
yading@10 3182 Use gmc.
yading@10 3183
yading@10 3184 =item B<mv0>
yading@10 3185
yading@10 3186 Always try a mb with mv=E<lt>0,0E<gt>.
yading@10 3187
yading@10 3188 =item B<input_preserved>
yading@10 3189
yading@10 3190
yading@10 3191
yading@10 3192 =item B<pass1>
yading@10 3193
yading@10 3194 Use internal 2pass ratecontrol in first pass mode.
yading@10 3195
yading@10 3196 =item B<pass2>
yading@10 3197
yading@10 3198 Use internal 2pass ratecontrol in second pass mode.
yading@10 3199
yading@10 3200 =item B<gray>
yading@10 3201
yading@10 3202 Only decode/encode grayscale.
yading@10 3203
yading@10 3204 =item B<emu_edge>
yading@10 3205
yading@10 3206 Do not draw edges.
yading@10 3207
yading@10 3208 =item B<psnr>
yading@10 3209
yading@10 3210 Set error[?] variables during encoding.
yading@10 3211
yading@10 3212 =item B<truncated>
yading@10 3213
yading@10 3214
yading@10 3215
yading@10 3216 =item B<naq>
yading@10 3217
yading@10 3218 Normalize adaptive quantization.
yading@10 3219
yading@10 3220 =item B<ildct>
yading@10 3221
yading@10 3222 Use interlaced DCT.
yading@10 3223
yading@10 3224 =item B<low_delay>
yading@10 3225
yading@10 3226 Force low delay.
yading@10 3227
yading@10 3228 =item B<global_header>
yading@10 3229
yading@10 3230 Place global headers in extradata instead of every keyframe.
yading@10 3231
yading@10 3232 =item B<bitexact>
yading@10 3233
yading@10 3234 Use only bitexact stuff (except (I)DCT).
yading@10 3235
yading@10 3236 =item B<aic>
yading@10 3237
yading@10 3238 Apply H263 advanced intra coding / mpeg4 ac prediction.
yading@10 3239
yading@10 3240 =item B<cbp>
yading@10 3241
yading@10 3242 Deprecated, use mpegvideo private options instead.
yading@10 3243
yading@10 3244 =item B<qprd>
yading@10 3245
yading@10 3246 Deprecated, use mpegvideo private options instead.
yading@10 3247
yading@10 3248 =item B<ilme>
yading@10 3249
yading@10 3250 Apply interlaced motion estimation.
yading@10 3251
yading@10 3252 =item B<cgop>
yading@10 3253
yading@10 3254 Use closed gop.
yading@10 3255
yading@10 3256 =back
yading@10 3257
yading@10 3258
yading@10 3259
yading@10 3260 =item B<sub_id> I<integer>
yading@10 3261
yading@10 3262 Deprecated, currently unused.
yading@10 3263
yading@10 3264
yading@10 3265 =item B<me_method> I<integer> B<(>I<encoding,video>B<)>
yading@10 3266
yading@10 3267 Set motion estimation method.
yading@10 3268
yading@10 3269 Possible values:
yading@10 3270
yading@10 3271 =over 4
yading@10 3272
yading@10 3273
yading@10 3274 =item B<zero>
yading@10 3275
yading@10 3276 zero motion estimation (fastest)
yading@10 3277
yading@10 3278 =item B<full>
yading@10 3279
yading@10 3280 full motion estimation (slowest)
yading@10 3281
yading@10 3282 =item B<epzs>
yading@10 3283
yading@10 3284 EPZS motion estimation (default)
yading@10 3285
yading@10 3286 =item B<esa>
yading@10 3287
yading@10 3288 esa motion estimation (alias for full)
yading@10 3289
yading@10 3290 =item B<tesa>
yading@10 3291
yading@10 3292 tesa motion estimation
yading@10 3293
yading@10 3294 =item B<dia>
yading@10 3295
yading@10 3296 dia motion estimation (alias for epzs)
yading@10 3297
yading@10 3298 =item B<log>
yading@10 3299
yading@10 3300 log motion estimation
yading@10 3301
yading@10 3302 =item B<phods>
yading@10 3303
yading@10 3304 phods motion estimation
yading@10 3305
yading@10 3306 =item B<x1>
yading@10 3307
yading@10 3308 X1 motion estimation
yading@10 3309
yading@10 3310 =item B<hex>
yading@10 3311
yading@10 3312 hex motion estimation
yading@10 3313
yading@10 3314 =item B<umh>
yading@10 3315
yading@10 3316 umh motion estimation
yading@10 3317
yading@10 3318 =item B<iter>
yading@10 3319
yading@10 3320 iter motion estimation
yading@10 3321
yading@10 3322 =back
yading@10 3323
yading@10 3324
yading@10 3325
yading@10 3326 =item B<extradata_size> I<integer>
yading@10 3327
yading@10 3328 Set extradata size.
yading@10 3329
yading@10 3330
yading@10 3331 =item B<time_base> I<rational number>
yading@10 3332
yading@10 3333 Set codec time base.
yading@10 3334
yading@10 3335 It is the fundamental unit of time (in seconds) in terms of which
yading@10 3336 frame timestamps are represented. For fixed-fps content, timebase
yading@10 3337 should be C<1 / frame_rate> and timestamp increments should be
yading@10 3338 identically 1.
yading@10 3339
yading@10 3340
yading@10 3341 =item B<g> I<integer> B<(>I<encoding,video>B<)>
yading@10 3342
yading@10 3343 Set the group of picture size. Default value is 12.
yading@10 3344
yading@10 3345
yading@10 3346 =item B<ar> I<integer> B<(>I<decoding/encoding,audio>B<)>
yading@10 3347
yading@10 3348 Set audio sampling rate (in Hz).
yading@10 3349
yading@10 3350
yading@10 3351 =item B<ac> I<integer> B<(>I<decoding/encoding,audio>B<)>
yading@10 3352
yading@10 3353 Set number of audio channels.
yading@10 3354
yading@10 3355
yading@10 3356 =item B<cutoff> I<integer> B<(>I<encoding,audio>B<)>
yading@10 3357
yading@10 3358 Set cutoff bandwidth.
yading@10 3359
yading@10 3360
yading@10 3361 =item B<frame_size> I<integer> B<(>I<encoding,audio>B<)>
yading@10 3362
yading@10 3363 Set audio frame size.
yading@10 3364
yading@10 3365 Each submitted frame except the last must contain exactly frame_size
yading@10 3366 samples per channel. May be 0 when the codec has
yading@10 3367 CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
yading@10 3368 restricted. It is set by some decoders to indicate constant frame
yading@10 3369 size.
yading@10 3370
yading@10 3371
yading@10 3372 =item B<frame_number> I<integer>
yading@10 3373
yading@10 3374 Set the frame number.
yading@10 3375
yading@10 3376
yading@10 3377 =item B<delay> I<integer>
yading@10 3378
yading@10 3379
yading@10 3380
yading@10 3381 =item B<qcomp> I<float> B<(>I<encoding,video>B<)>
yading@10 3382
yading@10 3383 Set video quantizer scale compression (VBR). It is used as a constant
yading@10 3384 in the ratecontrol equation. Recommended range for default rc_eq:
yading@10 3385 0.0-1.0.
yading@10 3386
yading@10 3387
yading@10 3388 =item B<qblur> I<float> B<(>I<encoding,video>B<)>
yading@10 3389
yading@10 3390 Set video quantizer scale blur (VBR).
yading@10 3391
yading@10 3392
yading@10 3393 =item B<qmin> I<integer> B<(>I<encoding,video>B<)>
yading@10 3394
yading@10 3395 Set min video quantizer scale (VBR). Must be included between -1 and
yading@10 3396 69, default value is 2.
yading@10 3397
yading@10 3398
yading@10 3399 =item B<qmax> I<integer> B<(>I<encoding,video>B<)>
yading@10 3400
yading@10 3401 Set max video quantizer scale (VBR). Must be included between -1 and
yading@10 3402 1024, default value is 31.
yading@10 3403
yading@10 3404
yading@10 3405 =item B<qdiff> I<integer> B<(>I<encoding,video>B<)>
yading@10 3406
yading@10 3407 Set max difference between the quantizer scale (VBR).
yading@10 3408
yading@10 3409
yading@10 3410 =item B<bf> I<integer> B<(>I<encoding,video>B<)>
yading@10 3411
yading@10 3412 Set max number of B frames.
yading@10 3413
yading@10 3414
yading@10 3415 =item B<b_qfactor> I<float> B<(>I<encoding,video>B<)>
yading@10 3416
yading@10 3417 Set qp factor between P and B frames.
yading@10 3418
yading@10 3419
yading@10 3420 =item B<rc_strategy> I<integer> B<(>I<encoding,video>B<)>
yading@10 3421
yading@10 3422 Set ratecontrol method.
yading@10 3423
yading@10 3424
yading@10 3425 =item B<b_strategy> I<integer> B<(>I<encoding,video>B<)>
yading@10 3426
yading@10 3427 Set strategy to choose between I/P/B-frames.
yading@10 3428
yading@10 3429
yading@10 3430 =item B<ps> I<integer> B<(>I<encoding,video>B<)>
yading@10 3431
yading@10 3432 Set RTP payload size in bytes.
yading@10 3433
yading@10 3434
yading@10 3435 =item B<mv_bits> I<integer>
yading@10 3436
yading@10 3437
yading@10 3438 =item B<header_bits> I<integer>
yading@10 3439
yading@10 3440
yading@10 3441 =item B<i_tex_bits> I<integer>
yading@10 3442
yading@10 3443
yading@10 3444 =item B<p_tex_bits> I<integer>
yading@10 3445
yading@10 3446
yading@10 3447 =item B<i_count> I<integer>
yading@10 3448
yading@10 3449
yading@10 3450 =item B<p_count> I<integer>
yading@10 3451
yading@10 3452
yading@10 3453 =item B<skip_count> I<integer>
yading@10 3454
yading@10 3455
yading@10 3456 =item B<misc_bits> I<integer>
yading@10 3457
yading@10 3458
yading@10 3459 =item B<frame_bits> I<integer>
yading@10 3460
yading@10 3461
yading@10 3462 =item B<codec_tag> I<integer>
yading@10 3463
yading@10 3464
yading@10 3465 =item B<bug> I<flags> B<(>I<decoding,video>B<)>
yading@10 3466
yading@10 3467 Workaround not auto detected encoder bugs.
yading@10 3468
yading@10 3469 Possible values:
yading@10 3470
yading@10 3471 =over 4
yading@10 3472
yading@10 3473
yading@10 3474 =item B<autodetect>
yading@10 3475
yading@10 3476
yading@10 3477
yading@10 3478 =item B<old_msmpeg4>
yading@10 3479
yading@10 3480 some old lavc generated msmpeg4v3 files (no autodetection)
yading@10 3481
yading@10 3482 =item B<xvid_ilace>
yading@10 3483
yading@10 3484 Xvid interlacing bug (autodetected if fourcc==XVIX)
yading@10 3485
yading@10 3486 =item B<ump4>
yading@10 3487
yading@10 3488 (autodetected if fourcc==UMP4)
yading@10 3489
yading@10 3490 =item B<no_padding>
yading@10 3491
yading@10 3492 padding bug (autodetected)
yading@10 3493
yading@10 3494 =item B<amv>
yading@10 3495
yading@10 3496
yading@10 3497
yading@10 3498 =item B<ac_vlc>
yading@10 3499
yading@10 3500 illegal vlc bug (autodetected per fourcc)
yading@10 3501
yading@10 3502 =item B<qpel_chroma>
yading@10 3503
yading@10 3504
yading@10 3505
yading@10 3506 =item B<std_qpel>
yading@10 3507
yading@10 3508 old standard qpel (autodetected per fourcc/version)
yading@10 3509
yading@10 3510 =item B<qpel_chroma2>
yading@10 3511
yading@10 3512
yading@10 3513
yading@10 3514 =item B<direct_blocksize>
yading@10 3515
yading@10 3516 direct-qpel-blocksize bug (autodetected per fourcc/version)
yading@10 3517
yading@10 3518 =item B<edge>
yading@10 3519
yading@10 3520 edge padding bug (autodetected per fourcc/version)
yading@10 3521
yading@10 3522 =item B<hpel_chroma>
yading@10 3523
yading@10 3524
yading@10 3525
yading@10 3526 =item B<dc_clip>
yading@10 3527
yading@10 3528
yading@10 3529
yading@10 3530 =item B<ms>
yading@10 3531
yading@10 3532 Workaround various bugs in microsoft broken decoders.
yading@10 3533
yading@10 3534 =item B<trunc>
yading@10 3535
yading@10 3536 trancated frames
yading@10 3537
yading@10 3538 =back
yading@10 3539
yading@10 3540
yading@10 3541
yading@10 3542 =item B<lelim> I<integer> B<(>I<encoding,video>B<)>
yading@10 3543
yading@10 3544 Set single coefficient elimination threshold for luminance (negative
yading@10 3545 values also consider DC coefficient).
yading@10 3546
yading@10 3547
yading@10 3548 =item B<celim> I<integer> B<(>I<encoding,video>B<)>
yading@10 3549
yading@10 3550 Set single coefficient elimination threshold for chrominance (negative
yading@10 3551 values also consider dc coefficient)
yading@10 3552
yading@10 3553
yading@10 3554 =item B<strict> I<integer> B<(>I<decoding/encoding,audio,video>B<)>
yading@10 3555
yading@10 3556 Specify how strictly to follow the standards.
yading@10 3557
yading@10 3558 Possible values:
yading@10 3559
yading@10 3560 =over 4
yading@10 3561
yading@10 3562
yading@10 3563 =item B<very>
yading@10 3564
yading@10 3565 strictly conform to a older more strict version of the spec or reference software
yading@10 3566
yading@10 3567 =item B<strict>
yading@10 3568
yading@10 3569 strictly conform to all the things in the spec no matter what consequences
yading@10 3570
yading@10 3571 =item B<normal>
yading@10 3572
yading@10 3573
yading@10 3574
yading@10 3575 =item B<unofficial>
yading@10 3576
yading@10 3577 allow unofficial extensions
yading@10 3578
yading@10 3579 =item B<experimental>
yading@10 3580
yading@10 3581 allow non standardized experimental things
yading@10 3582
yading@10 3583 =back
yading@10 3584
yading@10 3585
yading@10 3586
yading@10 3587 =item B<b_qoffset> I<float> B<(>I<encoding,video>B<)>
yading@10 3588
yading@10 3589 Set QP offset between P and B frames.
yading@10 3590
yading@10 3591
yading@10 3592 =item B<err_detect> I<flags> B<(>I<decoding,audio,video>B<)>
yading@10 3593
yading@10 3594 Set error detection flags.
yading@10 3595
yading@10 3596 Possible values:
yading@10 3597
yading@10 3598 =over 4
yading@10 3599
yading@10 3600
yading@10 3601 =item B<crccheck>
yading@10 3602
yading@10 3603 verify embedded CRCs
yading@10 3604
yading@10 3605 =item B<bitstream>
yading@10 3606
yading@10 3607 detect bitstream specification deviations
yading@10 3608
yading@10 3609 =item B<buffer>
yading@10 3610
yading@10 3611 detect improper bitstream length
yading@10 3612
yading@10 3613 =item B<explode>
yading@10 3614
yading@10 3615 abort decoding on minor error detection
yading@10 3616
yading@10 3617 =item B<careful>
yading@10 3618
yading@10 3619 consider things that violate the spec and have not been seen in the wild as errors
yading@10 3620
yading@10 3621 =item B<compliant>
yading@10 3622
yading@10 3623 consider all spec non compliancies as errors
yading@10 3624
yading@10 3625 =item B<aggressive>
yading@10 3626
yading@10 3627 consider things that a sane encoder should not do as an error
yading@10 3628
yading@10 3629 =back
yading@10 3630
yading@10 3631
yading@10 3632
yading@10 3633 =item B<has_b_frames> I<integer>
yading@10 3634
yading@10 3635
yading@10 3636
yading@10 3637 =item B<block_align> I<integer>
yading@10 3638
yading@10 3639
yading@10 3640
yading@10 3641 =item B<mpeg_quant> I<integer> B<(>I<encoding,video>B<)>
yading@10 3642
yading@10 3643 Use MPEG quantizers instead of H.263.
yading@10 3644
yading@10 3645
yading@10 3646 =item B<qsquish> I<float> B<(>I<encoding,video>B<)>
yading@10 3647
yading@10 3648 How to keep quantizer between qmin and qmax (0 = clip, 1 = use
yading@10 3649 differentiable function).
yading@10 3650
yading@10 3651
yading@10 3652 =item B<rc_qmod_amp> I<float> B<(>I<encoding,video>B<)>
yading@10 3653
yading@10 3654 Set experimental quantizer modulation.
yading@10 3655
yading@10 3656
yading@10 3657 =item B<rc_qmod_freq> I<integer> B<(>I<encoding,video>B<)>
yading@10 3658
yading@10 3659 Set experimental quantizer modulation.
yading@10 3660
yading@10 3661
yading@10 3662 =item B<rc_override_count> I<integer>
yading@10 3663
yading@10 3664
yading@10 3665
yading@10 3666 =item B<rc_eq> I<string> B<(>I<encoding,video>B<)>
yading@10 3667
yading@10 3668 Set rate control equation. When computing the expression, besides the
yading@10 3669 standard functions defined in the section 'Expression Evaluation', the
yading@10 3670 following functions are available: bits2qp(bits), qp2bits(qp). Also
yading@10 3671 the following constants are available: iTex pTex tex mv fCode iCount
yading@10 3672 mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
yading@10 3673 avgTex.
yading@10 3674
yading@10 3675
yading@10 3676 =item B<maxrate> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 3677
yading@10 3678 Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
yading@10 3679
yading@10 3680
yading@10 3681 =item B<minrate> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 3682
yading@10 3683 Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
yading@10 3684 encode. It is of little use elsewise.
yading@10 3685
yading@10 3686
yading@10 3687 =item B<bufsize> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 3688
yading@10 3689 Set ratecontrol buffer size (in bits).
yading@10 3690
yading@10 3691
yading@10 3692 =item B<rc_buf_aggressivity> I<float> B<(>I<encoding,video>B<)>
yading@10 3693
yading@10 3694 Currently useless.
yading@10 3695
yading@10 3696
yading@10 3697 =item B<i_qfactor> I<float> B<(>I<encoding,video>B<)>
yading@10 3698
yading@10 3699 Set QP factor between P and I frames.
yading@10 3700
yading@10 3701
yading@10 3702 =item B<i_qoffset> I<float> B<(>I<encoding,video>B<)>
yading@10 3703
yading@10 3704 Set QP offset between P and I frames.
yading@10 3705
yading@10 3706
yading@10 3707 =item B<rc_init_cplx> I<float> B<(>I<encoding,video>B<)>
yading@10 3708
yading@10 3709 Set initial complexity for 1-pass encoding.
yading@10 3710
yading@10 3711
yading@10 3712 =item B<dct> I<integer> B<(>I<encoding,video>B<)>
yading@10 3713
yading@10 3714 Set DCT algorithm.
yading@10 3715
yading@10 3716 Possible values:
yading@10 3717
yading@10 3718 =over 4
yading@10 3719
yading@10 3720
yading@10 3721 =item B<auto>
yading@10 3722
yading@10 3723 autoselect a good one (default)
yading@10 3724
yading@10 3725 =item B<fastint>
yading@10 3726
yading@10 3727 fast integer
yading@10 3728
yading@10 3729 =item B<int>
yading@10 3730
yading@10 3731 accurate integer
yading@10 3732
yading@10 3733 =item B<mmx>
yading@10 3734
yading@10 3735
yading@10 3736
yading@10 3737 =item B<altivec>
yading@10 3738
yading@10 3739
yading@10 3740
yading@10 3741 =item B<faan>
yading@10 3742
yading@10 3743 floating point AAN DCT
yading@10 3744
yading@10 3745 =back
yading@10 3746
yading@10 3747
yading@10 3748
yading@10 3749 =item B<lumi_mask> I<float> B<(>I<encoding,video>B<)>
yading@10 3750
yading@10 3751 Compress bright areas stronger than medium ones.
yading@10 3752
yading@10 3753
yading@10 3754 =item B<tcplx_mask> I<float> B<(>I<encoding,video>B<)>
yading@10 3755
yading@10 3756 Set temporal complexity masking.
yading@10 3757
yading@10 3758
yading@10 3759 =item B<scplx_mask> I<float> B<(>I<encoding,video>B<)>
yading@10 3760
yading@10 3761 Set spatial complexity masking.
yading@10 3762
yading@10 3763
yading@10 3764 =item B<p_mask> I<float> B<(>I<encoding,video>B<)>
yading@10 3765
yading@10 3766 Set inter masking.
yading@10 3767
yading@10 3768
yading@10 3769 =item B<dark_mask> I<float> B<(>I<encoding,video>B<)>
yading@10 3770
yading@10 3771 Compress dark areas stronger than medium ones.
yading@10 3772
yading@10 3773
yading@10 3774 =item B<idct> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 3775
yading@10 3776 Select IDCT implementation.
yading@10 3777
yading@10 3778 Possible values:
yading@10 3779
yading@10 3780 =over 4
yading@10 3781
yading@10 3782
yading@10 3783 =item B<auto>
yading@10 3784
yading@10 3785
yading@10 3786
yading@10 3787 =item B<int>
yading@10 3788
yading@10 3789
yading@10 3790
yading@10 3791 =item B<simple>
yading@10 3792
yading@10 3793
yading@10 3794
yading@10 3795 =item B<simplemmx>
yading@10 3796
yading@10 3797
yading@10 3798
yading@10 3799 =item B<libmpeg2mmx>
yading@10 3800
yading@10 3801
yading@10 3802
yading@10 3803 =item B<mmi>
yading@10 3804
yading@10 3805
yading@10 3806
yading@10 3807 =item B<arm>
yading@10 3808
yading@10 3809
yading@10 3810
yading@10 3811 =item B<altivec>
yading@10 3812
yading@10 3813
yading@10 3814
yading@10 3815 =item B<sh4>
yading@10 3816
yading@10 3817
yading@10 3818
yading@10 3819 =item B<simplearm>
yading@10 3820
yading@10 3821
yading@10 3822
yading@10 3823 =item B<simplearmv5te>
yading@10 3824
yading@10 3825
yading@10 3826
yading@10 3827 =item B<simplearmv6>
yading@10 3828
yading@10 3829
yading@10 3830
yading@10 3831 =item B<simpleneon>
yading@10 3832
yading@10 3833
yading@10 3834
yading@10 3835 =item B<simplealpha>
yading@10 3836
yading@10 3837
yading@10 3838
yading@10 3839 =item B<h264>
yading@10 3840
yading@10 3841
yading@10 3842
yading@10 3843 =item B<vp3>
yading@10 3844
yading@10 3845
yading@10 3846
yading@10 3847 =item B<ipp>
yading@10 3848
yading@10 3849
yading@10 3850
yading@10 3851 =item B<xvidmmx>
yading@10 3852
yading@10 3853
yading@10 3854
yading@10 3855 =item B<faani>
yading@10 3856
yading@10 3857 floating point AAN IDCT
yading@10 3858
yading@10 3859 =back
yading@10 3860
yading@10 3861
yading@10 3862
yading@10 3863 =item B<slice_count> I<integer>
yading@10 3864
yading@10 3865
yading@10 3866
yading@10 3867 =item B<ec> I<flags> B<(>I<decoding,video>B<)>
yading@10 3868
yading@10 3869 Set error concealment strategy.
yading@10 3870
yading@10 3871 Possible values:
yading@10 3872
yading@10 3873 =over 4
yading@10 3874
yading@10 3875
yading@10 3876 =item B<guess_mvs>
yading@10 3877
yading@10 3878 iterative motion vector (MV) search (slow)
yading@10 3879
yading@10 3880 =item B<deblock>
yading@10 3881
yading@10 3882 use strong deblock filter for damaged MBs
yading@10 3883
yading@10 3884 =back
yading@10 3885
yading@10 3886
yading@10 3887
yading@10 3888 =item B<bits_per_coded_sample> I<integer>
yading@10 3889
yading@10 3890
yading@10 3891
yading@10 3892 =item B<pred> I<integer> B<(>I<encoding,video>B<)>
yading@10 3893
yading@10 3894 Set prediction method.
yading@10 3895
yading@10 3896 Possible values:
yading@10 3897
yading@10 3898 =over 4
yading@10 3899
yading@10 3900
yading@10 3901 =item B<left>
yading@10 3902
yading@10 3903
yading@10 3904
yading@10 3905 =item B<plane>
yading@10 3906
yading@10 3907
yading@10 3908
yading@10 3909 =item B<median>
yading@10 3910
yading@10 3911
yading@10 3912
yading@10 3913 =back
yading@10 3914
yading@10 3915
yading@10 3916
yading@10 3917 =item B<aspect> I<rational number> B<(>I<encoding,video>B<)>
yading@10 3918
yading@10 3919 Set sample aspect ratio.
yading@10 3920
yading@10 3921
yading@10 3922 =item B<debug> I<flags> B<(>I<decoding/encoding,audio,video,subtitles>B<)>
yading@10 3923
yading@10 3924 Print specific debug info.
yading@10 3925
yading@10 3926 Possible values:
yading@10 3927
yading@10 3928 =over 4
yading@10 3929
yading@10 3930
yading@10 3931 =item B<pict>
yading@10 3932
yading@10 3933 picture info
yading@10 3934
yading@10 3935 =item B<rc>
yading@10 3936
yading@10 3937 rate control
yading@10 3938
yading@10 3939 =item B<bitstream>
yading@10 3940
yading@10 3941
yading@10 3942
yading@10 3943 =item B<mb_type>
yading@10 3944
yading@10 3945 macroblock (MB) type
yading@10 3946
yading@10 3947 =item B<qp>
yading@10 3948
yading@10 3949 per-block quantization parameter (QP)
yading@10 3950
yading@10 3951 =item B<mv>
yading@10 3952
yading@10 3953 motion vector
yading@10 3954
yading@10 3955 =item B<dct_coeff>
yading@10 3956
yading@10 3957
yading@10 3958
yading@10 3959 =item B<skip>
yading@10 3960
yading@10 3961
yading@10 3962
yading@10 3963 =item B<startcode>
yading@10 3964
yading@10 3965
yading@10 3966
yading@10 3967 =item B<pts>
yading@10 3968
yading@10 3969
yading@10 3970
yading@10 3971 =item B<er>
yading@10 3972
yading@10 3973 error recognition
yading@10 3974
yading@10 3975 =item B<mmco>
yading@10 3976
yading@10 3977 memory management control operations (H.264)
yading@10 3978
yading@10 3979 =item B<bugs>
yading@10 3980
yading@10 3981
yading@10 3982
yading@10 3983 =item B<vis_qp>
yading@10 3984
yading@10 3985 visualize quantization parameter (QP), lower QP are tinted greener
yading@10 3986
yading@10 3987 =item B<vis_mb_type>
yading@10 3988
yading@10 3989 visualize block types
yading@10 3990
yading@10 3991 =item B<buffers>
yading@10 3992
yading@10 3993 picture buffer allocations
yading@10 3994
yading@10 3995 =item B<thread_ops>
yading@10 3996
yading@10 3997 threading operations
yading@10 3998
yading@10 3999 =back
yading@10 4000
yading@10 4001
yading@10 4002
yading@10 4003 =item B<vismv> I<integer> B<(>I<decoding,video>B<)>
yading@10 4004
yading@10 4005 Visualize motion vectors (MVs).
yading@10 4006
yading@10 4007 Possible values:
yading@10 4008
yading@10 4009 =over 4
yading@10 4010
yading@10 4011
yading@10 4012 =item B<pf>
yading@10 4013
yading@10 4014 forward predicted MVs of P-frames
yading@10 4015
yading@10 4016 =item B<bf>
yading@10 4017
yading@10 4018 forward predicted MVs of B-frames
yading@10 4019
yading@10 4020 =item B<bb>
yading@10 4021
yading@10 4022 backward predicted MVs of B-frames
yading@10 4023
yading@10 4024 =back
yading@10 4025
yading@10 4026
yading@10 4027
yading@10 4028 =item B<cmp> I<integer> B<(>I<encoding,video>B<)>
yading@10 4029
yading@10 4030 Set full pel me compare function.
yading@10 4031
yading@10 4032 Possible values:
yading@10 4033
yading@10 4034 =over 4
yading@10 4035
yading@10 4036
yading@10 4037 =item B<sad>
yading@10 4038
yading@10 4039 sum of absolute differences, fast (default)
yading@10 4040
yading@10 4041 =item B<sse>
yading@10 4042
yading@10 4043 sum of squared errors
yading@10 4044
yading@10 4045 =item B<satd>
yading@10 4046
yading@10 4047 sum of absolute Hadamard transformed differences
yading@10 4048
yading@10 4049 =item B<dct>
yading@10 4050
yading@10 4051 sum of absolute DCT transformed differences
yading@10 4052
yading@10 4053 =item B<psnr>
yading@10 4054
yading@10 4055 sum of squared quantization errors (avoid, low quality)
yading@10 4056
yading@10 4057 =item B<bit>
yading@10 4058
yading@10 4059 number of bits needed for the block
yading@10 4060
yading@10 4061 =item B<rd>
yading@10 4062
yading@10 4063 rate distortion optimal, slow
yading@10 4064
yading@10 4065 =item B<zero>
yading@10 4066
yading@10 4067 0
yading@10 4068
yading@10 4069 =item B<vsad>
yading@10 4070
yading@10 4071 sum of absolute vertical differences
yading@10 4072
yading@10 4073 =item B<vsse>
yading@10 4074
yading@10 4075 sum of squared vertical differences
yading@10 4076
yading@10 4077 =item B<nsse>
yading@10 4078
yading@10 4079 noise preserving sum of squared differences
yading@10 4080
yading@10 4081 =item B<w53>
yading@10 4082
yading@10 4083 5/3 wavelet, only used in snow
yading@10 4084
yading@10 4085 =item B<w97>
yading@10 4086
yading@10 4087 9/7 wavelet, only used in snow
yading@10 4088
yading@10 4089 =item B<dctmax>
yading@10 4090
yading@10 4091
yading@10 4092
yading@10 4093 =item B<chroma>
yading@10 4094
yading@10 4095
yading@10 4096
yading@10 4097 =back
yading@10 4098
yading@10 4099
yading@10 4100
yading@10 4101 =item B<subcmp> I<integer> B<(>I<encoding,video>B<)>
yading@10 4102
yading@10 4103 Set sub pel me compare function.
yading@10 4104
yading@10 4105 Possible values:
yading@10 4106
yading@10 4107 =over 4
yading@10 4108
yading@10 4109
yading@10 4110 =item B<sad>
yading@10 4111
yading@10 4112 sum of absolute differences, fast (default)
yading@10 4113
yading@10 4114 =item B<sse>
yading@10 4115
yading@10 4116 sum of squared errors
yading@10 4117
yading@10 4118 =item B<satd>
yading@10 4119
yading@10 4120 sum of absolute Hadamard transformed differences
yading@10 4121
yading@10 4122 =item B<dct>
yading@10 4123
yading@10 4124 sum of absolute DCT transformed differences
yading@10 4125
yading@10 4126 =item B<psnr>
yading@10 4127
yading@10 4128 sum of squared quantization errors (avoid, low quality)
yading@10 4129
yading@10 4130 =item B<bit>
yading@10 4131
yading@10 4132 number of bits needed for the block
yading@10 4133
yading@10 4134 =item B<rd>
yading@10 4135
yading@10 4136 rate distortion optimal, slow
yading@10 4137
yading@10 4138 =item B<zero>
yading@10 4139
yading@10 4140 0
yading@10 4141
yading@10 4142 =item B<vsad>
yading@10 4143
yading@10 4144 sum of absolute vertical differences
yading@10 4145
yading@10 4146 =item B<vsse>
yading@10 4147
yading@10 4148 sum of squared vertical differences
yading@10 4149
yading@10 4150 =item B<nsse>
yading@10 4151
yading@10 4152 noise preserving sum of squared differences
yading@10 4153
yading@10 4154 =item B<w53>
yading@10 4155
yading@10 4156 5/3 wavelet, only used in snow
yading@10 4157
yading@10 4158 =item B<w97>
yading@10 4159
yading@10 4160 9/7 wavelet, only used in snow
yading@10 4161
yading@10 4162 =item B<dctmax>
yading@10 4163
yading@10 4164
yading@10 4165
yading@10 4166 =item B<chroma>
yading@10 4167
yading@10 4168
yading@10 4169
yading@10 4170 =back
yading@10 4171
yading@10 4172
yading@10 4173
yading@10 4174 =item B<mbcmp> I<integer> B<(>I<encoding,video>B<)>
yading@10 4175
yading@10 4176 Set macroblock compare function.
yading@10 4177
yading@10 4178 Possible values:
yading@10 4179
yading@10 4180 =over 4
yading@10 4181
yading@10 4182
yading@10 4183 =item B<sad>
yading@10 4184
yading@10 4185 sum of absolute differences, fast (default)
yading@10 4186
yading@10 4187 =item B<sse>
yading@10 4188
yading@10 4189 sum of squared errors
yading@10 4190
yading@10 4191 =item B<satd>
yading@10 4192
yading@10 4193 sum of absolute Hadamard transformed differences
yading@10 4194
yading@10 4195 =item B<dct>
yading@10 4196
yading@10 4197 sum of absolute DCT transformed differences
yading@10 4198
yading@10 4199 =item B<psnr>
yading@10 4200
yading@10 4201 sum of squared quantization errors (avoid, low quality)
yading@10 4202
yading@10 4203 =item B<bit>
yading@10 4204
yading@10 4205 number of bits needed for the block
yading@10 4206
yading@10 4207 =item B<rd>
yading@10 4208
yading@10 4209 rate distortion optimal, slow
yading@10 4210
yading@10 4211 =item B<zero>
yading@10 4212
yading@10 4213 0
yading@10 4214
yading@10 4215 =item B<vsad>
yading@10 4216
yading@10 4217 sum of absolute vertical differences
yading@10 4218
yading@10 4219 =item B<vsse>
yading@10 4220
yading@10 4221 sum of squared vertical differences
yading@10 4222
yading@10 4223 =item B<nsse>
yading@10 4224
yading@10 4225 noise preserving sum of squared differences
yading@10 4226
yading@10 4227 =item B<w53>
yading@10 4228
yading@10 4229 5/3 wavelet, only used in snow
yading@10 4230
yading@10 4231 =item B<w97>
yading@10 4232
yading@10 4233 9/7 wavelet, only used in snow
yading@10 4234
yading@10 4235 =item B<dctmax>
yading@10 4236
yading@10 4237
yading@10 4238
yading@10 4239 =item B<chroma>
yading@10 4240
yading@10 4241
yading@10 4242
yading@10 4243 =back
yading@10 4244
yading@10 4245
yading@10 4246
yading@10 4247 =item B<ildctcmp> I<integer> B<(>I<encoding,video>B<)>
yading@10 4248
yading@10 4249 Set interlaced dct compare function.
yading@10 4250
yading@10 4251 Possible values:
yading@10 4252
yading@10 4253 =over 4
yading@10 4254
yading@10 4255
yading@10 4256 =item B<sad>
yading@10 4257
yading@10 4258 sum of absolute differences, fast (default)
yading@10 4259
yading@10 4260 =item B<sse>
yading@10 4261
yading@10 4262 sum of squared errors
yading@10 4263
yading@10 4264 =item B<satd>
yading@10 4265
yading@10 4266 sum of absolute Hadamard transformed differences
yading@10 4267
yading@10 4268 =item B<dct>
yading@10 4269
yading@10 4270 sum of absolute DCT transformed differences
yading@10 4271
yading@10 4272 =item B<psnr>
yading@10 4273
yading@10 4274 sum of squared quantization errors (avoid, low quality)
yading@10 4275
yading@10 4276 =item B<bit>
yading@10 4277
yading@10 4278 number of bits needed for the block
yading@10 4279
yading@10 4280 =item B<rd>
yading@10 4281
yading@10 4282 rate distortion optimal, slow
yading@10 4283
yading@10 4284 =item B<zero>
yading@10 4285
yading@10 4286 0
yading@10 4287
yading@10 4288 =item B<vsad>
yading@10 4289
yading@10 4290 sum of absolute vertical differences
yading@10 4291
yading@10 4292 =item B<vsse>
yading@10 4293
yading@10 4294 sum of squared vertical differences
yading@10 4295
yading@10 4296 =item B<nsse>
yading@10 4297
yading@10 4298 noise preserving sum of squared differences
yading@10 4299
yading@10 4300 =item B<w53>
yading@10 4301
yading@10 4302 5/3 wavelet, only used in snow
yading@10 4303
yading@10 4304 =item B<w97>
yading@10 4305
yading@10 4306 9/7 wavelet, only used in snow
yading@10 4307
yading@10 4308 =item B<dctmax>
yading@10 4309
yading@10 4310
yading@10 4311
yading@10 4312 =item B<chroma>
yading@10 4313
yading@10 4314
yading@10 4315
yading@10 4316 =back
yading@10 4317
yading@10 4318
yading@10 4319
yading@10 4320 =item B<dia_size> I<integer> B<(>I<encoding,video>B<)>
yading@10 4321
yading@10 4322 Set diamond type & size for motion estimation.
yading@10 4323
yading@10 4324
yading@10 4325 =item B<last_pred> I<integer> B<(>I<encoding,video>B<)>
yading@10 4326
yading@10 4327 Set amount of motion predictors from the previous frame.
yading@10 4328
yading@10 4329
yading@10 4330 =item B<preme> I<integer> B<(>I<encoding,video>B<)>
yading@10 4331
yading@10 4332 Set pre motion estimation.
yading@10 4333
yading@10 4334
yading@10 4335 =item B<precmp> I<integer> B<(>I<encoding,video>B<)>
yading@10 4336
yading@10 4337 Set pre motion estimation compare function.
yading@10 4338
yading@10 4339 Possible values:
yading@10 4340
yading@10 4341 =over 4
yading@10 4342
yading@10 4343
yading@10 4344 =item B<sad>
yading@10 4345
yading@10 4346 sum of absolute differences, fast (default)
yading@10 4347
yading@10 4348 =item B<sse>
yading@10 4349
yading@10 4350 sum of squared errors
yading@10 4351
yading@10 4352 =item B<satd>
yading@10 4353
yading@10 4354 sum of absolute Hadamard transformed differences
yading@10 4355
yading@10 4356 =item B<dct>
yading@10 4357
yading@10 4358 sum of absolute DCT transformed differences
yading@10 4359
yading@10 4360 =item B<psnr>
yading@10 4361
yading@10 4362 sum of squared quantization errors (avoid, low quality)
yading@10 4363
yading@10 4364 =item B<bit>
yading@10 4365
yading@10 4366 number of bits needed for the block
yading@10 4367
yading@10 4368 =item B<rd>
yading@10 4369
yading@10 4370 rate distortion optimal, slow
yading@10 4371
yading@10 4372 =item B<zero>
yading@10 4373
yading@10 4374 0
yading@10 4375
yading@10 4376 =item B<vsad>
yading@10 4377
yading@10 4378 sum of absolute vertical differences
yading@10 4379
yading@10 4380 =item B<vsse>
yading@10 4381
yading@10 4382 sum of squared vertical differences
yading@10 4383
yading@10 4384 =item B<nsse>
yading@10 4385
yading@10 4386 noise preserving sum of squared differences
yading@10 4387
yading@10 4388 =item B<w53>
yading@10 4389
yading@10 4390 5/3 wavelet, only used in snow
yading@10 4391
yading@10 4392 =item B<w97>
yading@10 4393
yading@10 4394 9/7 wavelet, only used in snow
yading@10 4395
yading@10 4396 =item B<dctmax>
yading@10 4397
yading@10 4398
yading@10 4399
yading@10 4400 =item B<chroma>
yading@10 4401
yading@10 4402
yading@10 4403
yading@10 4404 =back
yading@10 4405
yading@10 4406
yading@10 4407
yading@10 4408 =item B<pre_dia_size> I<integer> B<(>I<encoding,video>B<)>
yading@10 4409
yading@10 4410 Set diamond type & size for motion estimation pre-pass.
yading@10 4411
yading@10 4412
yading@10 4413 =item B<subq> I<integer> B<(>I<encoding,video>B<)>
yading@10 4414
yading@10 4415 Set sub pel motion estimation quality.
yading@10 4416
yading@10 4417
yading@10 4418 =item B<dtg_active_format> I<integer>
yading@10 4419
yading@10 4420
yading@10 4421
yading@10 4422 =item B<me_range> I<integer> B<(>I<encoding,video>B<)>
yading@10 4423
yading@10 4424 Set limit motion vectors range (1023 for DivX player).
yading@10 4425
yading@10 4426
yading@10 4427 =item B<ibias> I<integer> B<(>I<encoding,video>B<)>
yading@10 4428
yading@10 4429 Set intra quant bias.
yading@10 4430
yading@10 4431
yading@10 4432 =item B<pbias> I<integer> B<(>I<encoding,video>B<)>
yading@10 4433
yading@10 4434 Set inter quant bias.
yading@10 4435
yading@10 4436
yading@10 4437 =item B<color_table_id> I<integer>
yading@10 4438
yading@10 4439
yading@10 4440
yading@10 4441 =item B<global_quality> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 4442
yading@10 4443
yading@10 4444
yading@10 4445 =item B<coder> I<integer> B<(>I<encoding,video>B<)>
yading@10 4446
yading@10 4447
yading@10 4448 Possible values:
yading@10 4449
yading@10 4450 =over 4
yading@10 4451
yading@10 4452
yading@10 4453 =item B<vlc>
yading@10 4454
yading@10 4455 variable length coder / huffman coder
yading@10 4456
yading@10 4457 =item B<ac>
yading@10 4458
yading@10 4459 arithmetic coder
yading@10 4460
yading@10 4461 =item B<raw>
yading@10 4462
yading@10 4463 raw (no encoding)
yading@10 4464
yading@10 4465 =item B<rle>
yading@10 4466
yading@10 4467 run-length coder
yading@10 4468
yading@10 4469 =item B<deflate>
yading@10 4470
yading@10 4471 deflate-based coder
yading@10 4472
yading@10 4473 =back
yading@10 4474
yading@10 4475
yading@10 4476
yading@10 4477 =item B<context> I<integer> B<(>I<encoding,video>B<)>
yading@10 4478
yading@10 4479 Set context model.
yading@10 4480
yading@10 4481
yading@10 4482 =item B<slice_flags> I<integer>
yading@10 4483
yading@10 4484
yading@10 4485
yading@10 4486 =item B<xvmc_acceleration> I<integer>
yading@10 4487
yading@10 4488
yading@10 4489
yading@10 4490 =item B<mbd> I<integer> B<(>I<encoding,video>B<)>
yading@10 4491
yading@10 4492 Set macroblock decision algorithm (high quality mode).
yading@10 4493
yading@10 4494 Possible values:
yading@10 4495
yading@10 4496 =over 4
yading@10 4497
yading@10 4498
yading@10 4499 =item B<simple>
yading@10 4500
yading@10 4501 use mbcmp (default)
yading@10 4502
yading@10 4503 =item B<bits>
yading@10 4504
yading@10 4505 use fewest bits
yading@10 4506
yading@10 4507 =item B<rd>
yading@10 4508
yading@10 4509 use best rate distortion
yading@10 4510
yading@10 4511 =back
yading@10 4512
yading@10 4513
yading@10 4514
yading@10 4515 =item B<stream_codec_tag> I<integer>
yading@10 4516
yading@10 4517
yading@10 4518
yading@10 4519 =item B<sc_threshold> I<integer> B<(>I<encoding,video>B<)>
yading@10 4520
yading@10 4521 Set scene change threshold.
yading@10 4522
yading@10 4523
yading@10 4524 =item B<lmin> I<integer> B<(>I<encoding,video>B<)>
yading@10 4525
yading@10 4526 Set min lagrange factor (VBR).
yading@10 4527
yading@10 4528
yading@10 4529 =item B<lmax> I<integer> B<(>I<encoding,video>B<)>
yading@10 4530
yading@10 4531 Set max lagrange factor (VBR).
yading@10 4532
yading@10 4533
yading@10 4534 =item B<nr> I<integer> B<(>I<encoding,video>B<)>
yading@10 4535
yading@10 4536 Set noise reduction.
yading@10 4537
yading@10 4538
yading@10 4539 =item B<rc_init_occupancy> I<integer> B<(>I<encoding,video>B<)>
yading@10 4540
yading@10 4541 Set number of bits which should be loaded into the rc buffer before
yading@10 4542 decoding starts.
yading@10 4543
yading@10 4544
yading@10 4545 =item B<inter_threshold> I<integer> B<(>I<encoding,video>B<)>
yading@10 4546
yading@10 4547
yading@10 4548
yading@10 4549 =item B<flags2> I<flags> B<(>I<decoding/encoding,audio,video>B<)>
yading@10 4550
yading@10 4551
yading@10 4552 Possible values:
yading@10 4553
yading@10 4554 =over 4
yading@10 4555
yading@10 4556
yading@10 4557 =item B<fast>
yading@10 4558
yading@10 4559 allow non spec compliant speedup tricks
yading@10 4560
yading@10 4561 =item B<sgop>
yading@10 4562
yading@10 4563 Deprecated, use mpegvideo private options instead
yading@10 4564
yading@10 4565 =item B<noout>
yading@10 4566
yading@10 4567 skip bitstream encoding
yading@10 4568
yading@10 4569 =item B<local_header>
yading@10 4570
yading@10 4571 place global headers at every keyframe instead of in extradata
yading@10 4572
yading@10 4573 =item B<chunks>
yading@10 4574
yading@10 4575 Frame data might be split into multiple chunks
yading@10 4576
yading@10 4577 =item B<showall>
yading@10 4578
yading@10 4579 Show all frames before the first keyframe
yading@10 4580
yading@10 4581 =item B<skiprd>
yading@10 4582
yading@10 4583 Deprecated, use mpegvideo private options instead
yading@10 4584
yading@10 4585 =back
yading@10 4586
yading@10 4587
yading@10 4588
yading@10 4589 =item B<error> I<integer> B<(>I<encoding,video>B<)>
yading@10 4590
yading@10 4591
yading@10 4592
yading@10 4593 =item B<qns> I<integer> B<(>I<encoding,video>B<)>
yading@10 4594
yading@10 4595 Deprecated, use mpegvideo private options instead.
yading@10 4596
yading@10 4597
yading@10 4598 =item B<threads> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 4599
yading@10 4600
yading@10 4601 Possible values:
yading@10 4602
yading@10 4603 =over 4
yading@10 4604
yading@10 4605
yading@10 4606 =item B<auto>
yading@10 4607
yading@10 4608 detect a good number of threads
yading@10 4609
yading@10 4610 =back
yading@10 4611
yading@10 4612
yading@10 4613
yading@10 4614 =item B<me_threshold> I<integer> B<(>I<encoding,video>B<)>
yading@10 4615
yading@10 4616 Set motion estimation threshold.
yading@10 4617
yading@10 4618
yading@10 4619 =item B<mb_threshold> I<integer> B<(>I<encoding,video>B<)>
yading@10 4620
yading@10 4621 Set macroblock threshold.
yading@10 4622
yading@10 4623
yading@10 4624 =item B<dc> I<integer> B<(>I<encoding,video>B<)>
yading@10 4625
yading@10 4626 Set intra_dc_precision.
yading@10 4627
yading@10 4628
yading@10 4629 =item B<nssew> I<integer> B<(>I<encoding,video>B<)>
yading@10 4630
yading@10 4631 Set nsse weight.
yading@10 4632
yading@10 4633
yading@10 4634 =item B<skip_top> I<integer> B<(>I<decoding,video>B<)>
yading@10 4635
yading@10 4636 Set number of macroblock rows at the top which are skipped.
yading@10 4637
yading@10 4638
yading@10 4639 =item B<skip_bottom> I<integer> B<(>I<decoding,video>B<)>
yading@10 4640
yading@10 4641 Set number of macroblock rows at the bottom which are skipped.
yading@10 4642
yading@10 4643
yading@10 4644 =item B<profile> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 4645
yading@10 4646
yading@10 4647 Possible values:
yading@10 4648
yading@10 4649 =over 4
yading@10 4650
yading@10 4651
yading@10 4652 =item B<unknown>
yading@10 4653
yading@10 4654
yading@10 4655
yading@10 4656 =item B<aac_main>
yading@10 4657
yading@10 4658
yading@10 4659
yading@10 4660 =item B<aac_low>
yading@10 4661
yading@10 4662
yading@10 4663
yading@10 4664 =item B<aac_ssr>
yading@10 4665
yading@10 4666
yading@10 4667
yading@10 4668 =item B<aac_ltp>
yading@10 4669
yading@10 4670
yading@10 4671
yading@10 4672 =item B<aac_he>
yading@10 4673
yading@10 4674
yading@10 4675
yading@10 4676 =item B<aac_he_v2>
yading@10 4677
yading@10 4678
yading@10 4679
yading@10 4680 =item B<aac_ld>
yading@10 4681
yading@10 4682
yading@10 4683
yading@10 4684 =item B<aac_eld>
yading@10 4685
yading@10 4686
yading@10 4687
yading@10 4688 =item B<dts>
yading@10 4689
yading@10 4690
yading@10 4691
yading@10 4692 =item B<dts_es>
yading@10 4693
yading@10 4694
yading@10 4695
yading@10 4696 =item B<dts_96_24>
yading@10 4697
yading@10 4698
yading@10 4699
yading@10 4700 =item B<dts_hd_hra>
yading@10 4701
yading@10 4702
yading@10 4703
yading@10 4704 =item B<dts_hd_ma>
yading@10 4705
yading@10 4706
yading@10 4707
yading@10 4708 =back
yading@10 4709
yading@10 4710
yading@10 4711
yading@10 4712 =item B<level> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 4713
yading@10 4714
yading@10 4715 Possible values:
yading@10 4716
yading@10 4717 =over 4
yading@10 4718
yading@10 4719
yading@10 4720 =item B<unknown>
yading@10 4721
yading@10 4722
yading@10 4723
yading@10 4724 =back
yading@10 4725
yading@10 4726
yading@10 4727
yading@10 4728 =item B<lowres> I<integer> B<(>I<decoding,audio,video>B<)>
yading@10 4729
yading@10 4730 Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
yading@10 4731
yading@10 4732
yading@10 4733 =item B<skip_threshold> I<integer> B<(>I<encoding,video>B<)>
yading@10 4734
yading@10 4735 Set frame skip threshold.
yading@10 4736
yading@10 4737
yading@10 4738 =item B<skip_factor> I<integer> B<(>I<encoding,video>B<)>
yading@10 4739
yading@10 4740 Set frame skip factor.
yading@10 4741
yading@10 4742
yading@10 4743 =item B<skip_exp> I<integer> B<(>I<encoding,video>B<)>
yading@10 4744
yading@10 4745 Set frame skip exponent.
yading@10 4746
yading@10 4747
yading@10 4748 =item B<skipcmp> I<integer> B<(>I<encoding,video>B<)>
yading@10 4749
yading@10 4750 Set frame skip compare function.
yading@10 4751
yading@10 4752 Possible values:
yading@10 4753
yading@10 4754 =over 4
yading@10 4755
yading@10 4756
yading@10 4757 =item B<sad>
yading@10 4758
yading@10 4759 sum of absolute differences, fast (default)
yading@10 4760
yading@10 4761 =item B<sse>
yading@10 4762
yading@10 4763 sum of squared errors
yading@10 4764
yading@10 4765 =item B<satd>
yading@10 4766
yading@10 4767 sum of absolute Hadamard transformed differences
yading@10 4768
yading@10 4769 =item B<dct>
yading@10 4770
yading@10 4771 sum of absolute DCT transformed differences
yading@10 4772
yading@10 4773 =item B<psnr>
yading@10 4774
yading@10 4775 sum of squared quantization errors (avoid, low quality)
yading@10 4776
yading@10 4777 =item B<bit>
yading@10 4778
yading@10 4779 number of bits needed for the block
yading@10 4780
yading@10 4781 =item B<rd>
yading@10 4782
yading@10 4783 rate distortion optimal, slow
yading@10 4784
yading@10 4785 =item B<zero>
yading@10 4786
yading@10 4787 0
yading@10 4788
yading@10 4789 =item B<vsad>
yading@10 4790
yading@10 4791 sum of absolute vertical differences
yading@10 4792
yading@10 4793 =item B<vsse>
yading@10 4794
yading@10 4795 sum of squared vertical differences
yading@10 4796
yading@10 4797 =item B<nsse>
yading@10 4798
yading@10 4799 noise preserving sum of squared differences
yading@10 4800
yading@10 4801 =item B<w53>
yading@10 4802
yading@10 4803 5/3 wavelet, only used in snow
yading@10 4804
yading@10 4805 =item B<w97>
yading@10 4806
yading@10 4807 9/7 wavelet, only used in snow
yading@10 4808
yading@10 4809 =item B<dctmax>
yading@10 4810
yading@10 4811
yading@10 4812
yading@10 4813 =item B<chroma>
yading@10 4814
yading@10 4815
yading@10 4816
yading@10 4817 =back
yading@10 4818
yading@10 4819
yading@10 4820
yading@10 4821 =item B<border_mask> I<float> B<(>I<encoding,video>B<)>
yading@10 4822
yading@10 4823 Increase the quantizer for macroblocks close to borders.
yading@10 4824
yading@10 4825
yading@10 4826 =item B<mblmin> I<integer> B<(>I<encoding,video>B<)>
yading@10 4827
yading@10 4828 Set min macroblock lagrange factor (VBR).
yading@10 4829
yading@10 4830
yading@10 4831 =item B<mblmax> I<integer> B<(>I<encoding,video>B<)>
yading@10 4832
yading@10 4833 Set max macroblock lagrange factor (VBR).
yading@10 4834
yading@10 4835
yading@10 4836 =item B<mepc> I<integer> B<(>I<encoding,video>B<)>
yading@10 4837
yading@10 4838 Set motion estimation bitrate penalty compensation (1.0 = 256).
yading@10 4839
yading@10 4840
yading@10 4841 =item B<skip_loop_filter> I<integer> B<(>I<decoding,video>B<)>
yading@10 4842
yading@10 4843
yading@10 4844 =item B<skip_idct> I<integer> B<(>I<decoding,video>B<)>
yading@10 4845
yading@10 4846
yading@10 4847 =item B<skip_frame> I<integer> B<(>I<decoding,video>B<)>
yading@10 4848
yading@10 4849
yading@10 4850 Make decoder discard processing depending on the frame type selected
yading@10 4851 by the option value.
yading@10 4852
yading@10 4853 B<skip_loop_filter> skips frame loop filtering, B<skip_idct>
yading@10 4854 skips frame IDCT/dequantization, B<skip_frame> skips decoding.
yading@10 4855
yading@10 4856 Possible values:
yading@10 4857
yading@10 4858 =over 4
yading@10 4859
yading@10 4860
yading@10 4861 =item B<none>
yading@10 4862
yading@10 4863 Discard no frame.
yading@10 4864
yading@10 4865
yading@10 4866 =item B<default>
yading@10 4867
yading@10 4868 Discard useless frames like 0-sized frames.
yading@10 4869
yading@10 4870
yading@10 4871 =item B<noref>
yading@10 4872
yading@10 4873 Discard all non-reference frames.
yading@10 4874
yading@10 4875
yading@10 4876 =item B<bidir>
yading@10 4877
yading@10 4878 Discard all bidirectional frames.
yading@10 4879
yading@10 4880
yading@10 4881 =item B<nokey>
yading@10 4882
yading@10 4883 Discard all frames excepts keyframes.
yading@10 4884
yading@10 4885
yading@10 4886 =item B<all>
yading@10 4887
yading@10 4888 Discard all frames.
yading@10 4889
yading@10 4890 =back
yading@10 4891
yading@10 4892
yading@10 4893 Default value is B<default>.
yading@10 4894
yading@10 4895
yading@10 4896 =item B<bidir_refine> I<integer> B<(>I<encoding,video>B<)>
yading@10 4897
yading@10 4898 Refine the two motion vectors used in bidirectional macroblocks.
yading@10 4899
yading@10 4900
yading@10 4901 =item B<brd_scale> I<integer> B<(>I<encoding,video>B<)>
yading@10 4902
yading@10 4903 Downscale frames for dynamic B-frame decision.
yading@10 4904
yading@10 4905
yading@10 4906 =item B<keyint_min> I<integer> B<(>I<encoding,video>B<)>
yading@10 4907
yading@10 4908 Set minimum interval between IDR-frames.
yading@10 4909
yading@10 4910
yading@10 4911 =item B<refs> I<integer> B<(>I<encoding,video>B<)>
yading@10 4912
yading@10 4913 Set reference frames to consider for motion compensation.
yading@10 4914
yading@10 4915
yading@10 4916 =item B<chromaoffset> I<integer> B<(>I<encoding,video>B<)>
yading@10 4917
yading@10 4918 Set chroma qp offset from luma.
yading@10 4919
yading@10 4920
yading@10 4921 =item B<trellis> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 4922
yading@10 4923 Set rate-distortion optimal quantization.
yading@10 4924
yading@10 4925
yading@10 4926 =item B<sc_factor> I<integer> B<(>I<encoding,video>B<)>
yading@10 4927
yading@10 4928 Set value multiplied by qscale for each frame and added to
yading@10 4929 scene_change_score.
yading@10 4930
yading@10 4931
yading@10 4932 =item B<mv0_threshold> I<integer> B<(>I<encoding,video>B<)>
yading@10 4933
yading@10 4934
yading@10 4935 =item B<b_sensitivity> I<integer> B<(>I<encoding,video>B<)>
yading@10 4936
yading@10 4937 Adjust sensitivity of b_frame_strategy 1.
yading@10 4938
yading@10 4939
yading@10 4940 =item B<compression_level> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 4941
yading@10 4942
yading@10 4943 =item B<min_prediction_order> I<integer> B<(>I<encoding,audio>B<)>
yading@10 4944
yading@10 4945
yading@10 4946 =item B<max_prediction_order> I<integer> B<(>I<encoding,audio>B<)>
yading@10 4947
yading@10 4948
yading@10 4949 =item B<timecode_frame_start> I<integer> B<(>I<encoding,video>B<)>
yading@10 4950
yading@10 4951 Set GOP timecode frame start number, in non drop frame format.
yading@10 4952
yading@10 4953
yading@10 4954 =item B<request_channels> I<integer> B<(>I<decoding,audio>B<)>
yading@10 4955
yading@10 4956 Set desired number of audio channels.
yading@10 4957
yading@10 4958
yading@10 4959 =item B<bits_per_raw_sample> I<integer>
yading@10 4960
yading@10 4961
yading@10 4962 =item B<channel_layout> I<integer> B<(>I<decoding/encoding,audio>B<)>
yading@10 4963
yading@10 4964
yading@10 4965 Possible values:
yading@10 4966
yading@10 4967 =over 4
yading@10 4968
yading@10 4969
yading@10 4970 =back
yading@10 4971
yading@10 4972
yading@10 4973 =item B<request_channel_layout> I<integer> B<(>I<decoding,audio>B<)>
yading@10 4974
yading@10 4975
yading@10 4976 Possible values:
yading@10 4977
yading@10 4978 =over 4
yading@10 4979
yading@10 4980
yading@10 4981 =back
yading@10 4982
yading@10 4983
yading@10 4984 =item B<rc_max_vbv_use> I<float> B<(>I<encoding,video>B<)>
yading@10 4985
yading@10 4986
yading@10 4987 =item B<rc_min_vbv_use> I<float> B<(>I<encoding,video>B<)>
yading@10 4988
yading@10 4989
yading@10 4990 =item B<ticks_per_frame> I<integer> B<(>I<decoding/encoding,audio,video>B<)>
yading@10 4991
yading@10 4992
yading@10 4993 =item B<color_primaries> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 4994
yading@10 4995
yading@10 4996 =item B<color_trc> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 4997
yading@10 4998
yading@10 4999 =item B<colorspace> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 5000
yading@10 5001
yading@10 5002 =item B<color_range> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 5003
yading@10 5004
yading@10 5005 =item B<chroma_sample_location> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 5006
yading@10 5007
yading@10 5008
yading@10 5009 =item B<log_level_offset> I<integer>
yading@10 5010
yading@10 5011 Set the log level offset.
yading@10 5012
yading@10 5013
yading@10 5014 =item B<slices> I<integer> B<(>I<encoding,video>B<)>
yading@10 5015
yading@10 5016 Number of slices, used in parallelized encoding.
yading@10 5017
yading@10 5018
yading@10 5019 =item B<thread_type> I<flags> B<(>I<decoding/encoding,video>B<)>
yading@10 5020
yading@10 5021 Select multithreading type.
yading@10 5022
yading@10 5023 Possible values:
yading@10 5024
yading@10 5025 =over 4
yading@10 5026
yading@10 5027
yading@10 5028 =item B<slice>
yading@10 5029
yading@10 5030
yading@10 5031
yading@10 5032 =item B<frame>
yading@10 5033
yading@10 5034
yading@10 5035
yading@10 5036 =back
yading@10 5037
yading@10 5038
yading@10 5039 =item B<audio_service_type> I<integer> B<(>I<encoding,audio>B<)>
yading@10 5040
yading@10 5041 Set audio service type.
yading@10 5042
yading@10 5043 Possible values:
yading@10 5044
yading@10 5045 =over 4
yading@10 5046
yading@10 5047
yading@10 5048 =item B<ma>
yading@10 5049
yading@10 5050 Main Audio Service
yading@10 5051
yading@10 5052 =item B<ef>
yading@10 5053
yading@10 5054 Effects
yading@10 5055
yading@10 5056 =item B<vi>
yading@10 5057
yading@10 5058 Visually Impaired
yading@10 5059
yading@10 5060 =item B<hi>
yading@10 5061
yading@10 5062 Hearing Impaired
yading@10 5063
yading@10 5064 =item B<di>
yading@10 5065
yading@10 5066 Dialogue
yading@10 5067
yading@10 5068 =item B<co>
yading@10 5069
yading@10 5070 Commentary
yading@10 5071
yading@10 5072 =item B<em>
yading@10 5073
yading@10 5074 Emergency
yading@10 5075
yading@10 5076 =item B<vo>
yading@10 5077
yading@10 5078 Voice Over
yading@10 5079
yading@10 5080 =item B<ka>
yading@10 5081
yading@10 5082 Karaoke
yading@10 5083
yading@10 5084 =back
yading@10 5085
yading@10 5086
yading@10 5087
yading@10 5088 =item B<request_sample_fmt> I<sample_fmt> B<(>I<decoding,audio>B<)>
yading@10 5089
yading@10 5090 Set sample format audio decoders should prefer. Default value is
yading@10 5091 C<none>.
yading@10 5092
yading@10 5093
yading@10 5094 =item B<pkt_timebase> I<rational number>
yading@10 5095
yading@10 5096
yading@10 5097
yading@10 5098 =item B<sub_charenc> I<encoding> B<(>I<decoding,subtitles>B<)>
yading@10 5099
yading@10 5100 Set the input subtitles character encoding.
yading@10 5101
yading@10 5102 =back
yading@10 5103
yading@10 5104
yading@10 5105
yading@10 5106
yading@10 5107 =head1 DECODERS
yading@10 5108
yading@10 5109
yading@10 5110 Decoders are configured elements in FFmpeg which allow the decoding of
yading@10 5111 multimedia streams.
yading@10 5112
yading@10 5113 When you configure your FFmpeg build, all the supported native decoders
yading@10 5114 are enabled by default. Decoders requiring an external library must be enabled
yading@10 5115 manually via the corresponding C<--enable-lib> option. You can list all
yading@10 5116 available decoders using the configure option C<--list-decoders>.
yading@10 5117
yading@10 5118 You can disable all the decoders with the configure option
yading@10 5119 C<--disable-decoders> and selectively enable / disable single decoders
yading@10 5120 with the options C<--enable-decoder=I<DECODER>> /
yading@10 5121 C<--disable-decoder=I<DECODER>>.
yading@10 5122
yading@10 5123 The option C<-codecs> of the ff* tools will display the list of
yading@10 5124 enabled decoders.
yading@10 5125
yading@10 5126
yading@10 5127
yading@10 5128 =head1 VIDEO DECODERS
yading@10 5129
yading@10 5130
yading@10 5131 A description of some of the currently available video decoders
yading@10 5132 follows.
yading@10 5133
yading@10 5134
yading@10 5135 =head2 rawvideo
yading@10 5136
yading@10 5137
yading@10 5138 Raw video decoder.
yading@10 5139
yading@10 5140 This decoder decodes rawvideo streams.
yading@10 5141
yading@10 5142
yading@10 5143 =head3 Options
yading@10 5144
yading@10 5145
yading@10 5146
yading@10 5147 =over 4
yading@10 5148
yading@10 5149
yading@10 5150 =item B<top> I<top_field_first>
yading@10 5151
yading@10 5152 Specify the assumed field type of the input video.
yading@10 5153
yading@10 5154 =over 4
yading@10 5155
yading@10 5156
yading@10 5157 =item B<-1>
yading@10 5158
yading@10 5159 the video is assumed to be progressive (default)
yading@10 5160
yading@10 5161 =item B<0>
yading@10 5162
yading@10 5163 bottom-field-first is assumed
yading@10 5164
yading@10 5165 =item B<1>
yading@10 5166
yading@10 5167 top-field-first is assumed
yading@10 5168
yading@10 5169 =back
yading@10 5170
yading@10 5171
yading@10 5172
yading@10 5173 =back
yading@10 5174
yading@10 5175
yading@10 5176
yading@10 5177
yading@10 5178 =head1 AUDIO DECODERS
yading@10 5179
yading@10 5180
yading@10 5181
yading@10 5182 =head2 ffwavesynth
yading@10 5183
yading@10 5184
yading@10 5185 Internal wave synthetizer.
yading@10 5186
yading@10 5187 This decoder generates wave patterns according to predefined sequences. Its
yading@10 5188 use is purely internal and the format of the data it accepts is not publicly
yading@10 5189 documented.
yading@10 5190
yading@10 5191
yading@10 5192
yading@10 5193 =head1 SUBTITLES DECODERS
yading@10 5194
yading@10 5195
yading@10 5196
yading@10 5197 =head2 dvdsub
yading@10 5198
yading@10 5199
yading@10 5200 This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
yading@10 5201 also be found in VobSub file pairs and in some Matroska files.
yading@10 5202
yading@10 5203
yading@10 5204 =head3 Options
yading@10 5205
yading@10 5206
yading@10 5207
yading@10 5208 =over 4
yading@10 5209
yading@10 5210
yading@10 5211 =item B<palette>
yading@10 5212
yading@10 5213 Specify the global palette used by the bitmaps. When stored in VobSub, the
yading@10 5214 palette is normally specified in the index file; in Matroska, the palette is
yading@10 5215 stored in the codec extra-data in the same format as in VobSub. In DVDs, the
yading@10 5216 palette is stored in the IFO file, and therefore not available when reading
yading@10 5217 from dumped VOB files.
yading@10 5218
yading@10 5219 The format for this option is a string containing 16 24-bits hexadecimal
yading@10 5220 numbers (without 0x prefix) separated by comas, for example C<0d00ee,
yading@10 5221 ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
yading@10 5222 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b>.
yading@10 5223
yading@10 5224 =back
yading@10 5225
yading@10 5226
yading@10 5227
yading@10 5228 =head1 ENCODERS
yading@10 5229
yading@10 5230
yading@10 5231 Encoders are configured elements in FFmpeg which allow the encoding of
yading@10 5232 multimedia streams.
yading@10 5233
yading@10 5234 When you configure your FFmpeg build, all the supported native encoders
yading@10 5235 are enabled by default. Encoders requiring an external library must be enabled
yading@10 5236 manually via the corresponding C<--enable-lib> option. You can list all
yading@10 5237 available encoders using the configure option C<--list-encoders>.
yading@10 5238
yading@10 5239 You can disable all the encoders with the configure option
yading@10 5240 C<--disable-encoders> and selectively enable / disable single encoders
yading@10 5241 with the options C<--enable-encoder=I<ENCODER>> /
yading@10 5242 C<--disable-encoder=I<ENCODER>>.
yading@10 5243
yading@10 5244 The option C<-codecs> of the ff* tools will display the list of
yading@10 5245 enabled encoders.
yading@10 5246
yading@10 5247
yading@10 5248
yading@10 5249 =head1 AUDIO ENCODERS
yading@10 5250
yading@10 5251
yading@10 5252 A description of some of the currently available audio encoders
yading@10 5253 follows.
yading@10 5254
yading@10 5255
yading@10 5256 =head2 ac3 and ac3_fixed
yading@10 5257
yading@10 5258
yading@10 5259 AC-3 audio encoders.
yading@10 5260
yading@10 5261 These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
yading@10 5262 the undocumented RealAudio 3 (a.k.a. dnet).
yading@10 5263
yading@10 5264 The I<ac3> encoder uses floating-point math, while the I<ac3_fixed>
yading@10 5265 encoder only uses fixed-point integer math. This does not mean that one is
yading@10 5266 always faster, just that one or the other may be better suited to a
yading@10 5267 particular system. The floating-point encoder will generally produce better
yading@10 5268 quality audio for a given bitrate. The I<ac3_fixed> encoder is not the
yading@10 5269 default codec for any of the output formats, so it must be specified explicitly
yading@10 5270 using the option C<-acodec ac3_fixed> in order to use it.
yading@10 5271
yading@10 5272
yading@10 5273 =head3 AC-3 Metadata
yading@10 5274
yading@10 5275
yading@10 5276 The AC-3 metadata options are used to set parameters that describe the audio,
yading@10 5277 but in most cases do not affect the audio encoding itself. Some of the options
yading@10 5278 do directly affect or influence the decoding and playback of the resulting
yading@10 5279 bitstream, while others are just for informational purposes. A few of the
yading@10 5280 options will add bits to the output stream that could otherwise be used for
yading@10 5281 audio data, and will thus affect the quality of the output. Those will be
yading@10 5282 indicated accordingly with a note in the option list below.
yading@10 5283
yading@10 5284 These parameters are described in detail in several publicly-available
yading@10 5285 documents.
yading@10 5286
yading@10 5287 =over 4
yading@10 5288
yading@10 5289
yading@10 5290 =item *<E<lt>B<http://www.atsc.org/cms/standards/a_52-2010.pdf>E<gt>>
yading@10 5291
yading@10 5292
yading@10 5293 =item *<E<lt>B<http://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf>E<gt>>
yading@10 5294
yading@10 5295
yading@10 5296 =item *<E<lt>B<http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf>E<gt>>
yading@10 5297
yading@10 5298
yading@10 5299 =item *<E<lt>B<http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf>E<gt>>
yading@10 5300
yading@10 5301
yading@10 5302 =back
yading@10 5303
yading@10 5304
yading@10 5305
yading@10 5306 =head4 Metadata Control Options
yading@10 5307
yading@10 5308
yading@10 5309
yading@10 5310 =over 4
yading@10 5311
yading@10 5312
yading@10 5313
yading@10 5314 =item B<-per_frame_metadata> I<boolean>
yading@10 5315
yading@10 5316 Allow Per-Frame Metadata. Specifies if the encoder should check for changing
yading@10 5317 metadata for each frame.
yading@10 5318
yading@10 5319 =over 4
yading@10 5320
yading@10 5321
yading@10 5322 =item B<0>
yading@10 5323
yading@10 5324 The metadata values set at initialization will be used for every frame in the
yading@10 5325 stream. (default)
yading@10 5326
yading@10 5327 =item B<1>
yading@10 5328
yading@10 5329 Metadata values can be changed before encoding each frame.
yading@10 5330
yading@10 5331 =back
yading@10 5332
yading@10 5333
yading@10 5334
yading@10 5335 =back
yading@10 5336
yading@10 5337
yading@10 5338
yading@10 5339 =head4 Downmix Levels
yading@10 5340
yading@10 5341
yading@10 5342
yading@10 5343 =over 4
yading@10 5344
yading@10 5345
yading@10 5346
yading@10 5347 =item B<-center_mixlev> I<level>
yading@10 5348
yading@10 5349 Center Mix Level. The amount of gain the decoder should apply to the center
yading@10 5350 channel when downmixing to stereo. This field will only be written to the
yading@10 5351 bitstream if a center channel is present. The value is specified as a scale
yading@10 5352 factor. There are 3 valid values:
yading@10 5353
yading@10 5354 =over 4
yading@10 5355
yading@10 5356
yading@10 5357 =item B<0.707>
yading@10 5358
yading@10 5359 Apply -3dB gain
yading@10 5360
yading@10 5361 =item B<0.595>
yading@10 5362
yading@10 5363 Apply -4.5dB gain (default)
yading@10 5364
yading@10 5365 =item B<0.500>
yading@10 5366
yading@10 5367 Apply -6dB gain
yading@10 5368
yading@10 5369 =back
yading@10 5370
yading@10 5371
yading@10 5372
yading@10 5373 =item B<-surround_mixlev> I<level>
yading@10 5374
yading@10 5375 Surround Mix Level. The amount of gain the decoder should apply to the surround
yading@10 5376 channel(s) when downmixing to stereo. This field will only be written to the
yading@10 5377 bitstream if one or more surround channels are present. The value is specified
yading@10 5378 as a scale factor. There are 3 valid values:
yading@10 5379
yading@10 5380 =over 4
yading@10 5381
yading@10 5382
yading@10 5383 =item B<0.707>
yading@10 5384
yading@10 5385 Apply -3dB gain
yading@10 5386
yading@10 5387 =item B<0.500>
yading@10 5388
yading@10 5389 Apply -6dB gain (default)
yading@10 5390
yading@10 5391 =item B<0.000>
yading@10 5392
yading@10 5393 Silence Surround Channel(s)
yading@10 5394
yading@10 5395 =back
yading@10 5396
yading@10 5397
yading@10 5398
yading@10 5399 =back
yading@10 5400
yading@10 5401
yading@10 5402
yading@10 5403 =head4 Audio Production Information
yading@10 5404
yading@10 5405 Audio Production Information is optional information describing the mixing
yading@10 5406 environment. Either none or both of the fields are written to the bitstream.
yading@10 5407
yading@10 5408
yading@10 5409 =over 4
yading@10 5410
yading@10 5411
yading@10 5412
yading@10 5413 =item B<-mixing_level> I<number>
yading@10 5414
yading@10 5415 Mixing Level. Specifies peak sound pressure level (SPL) in the production
yading@10 5416 environment when the mix was mastered. Valid values are 80 to 111, or -1 for
yading@10 5417 unknown or not indicated. The default value is -1, but that value cannot be
yading@10 5418 used if the Audio Production Information is written to the bitstream. Therefore,
yading@10 5419 if the C<room_type> option is not the default value, the C<mixing_level>
yading@10 5420 option must not be -1.
yading@10 5421
yading@10 5422
yading@10 5423 =item B<-room_type> I<type>
yading@10 5424
yading@10 5425 Room Type. Describes the equalization used during the final mixing session at
yading@10 5426 the studio or on the dubbing stage. A large room is a dubbing stage with the
yading@10 5427 industry standard X-curve equalization; a small room has flat equalization.
yading@10 5428 This field will not be written to the bitstream if both the C<mixing_level>
yading@10 5429 option and the C<room_type> option have the default values.
yading@10 5430
yading@10 5431 =over 4
yading@10 5432
yading@10 5433
yading@10 5434 =item B<0>
yading@10 5435
yading@10 5436
yading@10 5437 =item B<notindicated>
yading@10 5438
yading@10 5439 Not Indicated (default)
yading@10 5440
yading@10 5441 =item B<1>
yading@10 5442
yading@10 5443
yading@10 5444 =item B<large>
yading@10 5445
yading@10 5446 Large Room
yading@10 5447
yading@10 5448 =item B<2>
yading@10 5449
yading@10 5450
yading@10 5451 =item B<small>
yading@10 5452
yading@10 5453 Small Room
yading@10 5454
yading@10 5455 =back
yading@10 5456
yading@10 5457
yading@10 5458
yading@10 5459 =back
yading@10 5460
yading@10 5461
yading@10 5462
yading@10 5463 =head4 Other Metadata Options
yading@10 5464
yading@10 5465
yading@10 5466
yading@10 5467 =over 4
yading@10 5468
yading@10 5469
yading@10 5470
yading@10 5471 =item B<-copyright> I<boolean>
yading@10 5472
yading@10 5473 Copyright Indicator. Specifies whether a copyright exists for this audio.
yading@10 5474
yading@10 5475 =over 4
yading@10 5476
yading@10 5477
yading@10 5478 =item B<0>
yading@10 5479
yading@10 5480
yading@10 5481 =item B<off>
yading@10 5482
yading@10 5483 No Copyright Exists (default)
yading@10 5484
yading@10 5485 =item B<1>
yading@10 5486
yading@10 5487
yading@10 5488 =item B<on>
yading@10 5489
yading@10 5490 Copyright Exists
yading@10 5491
yading@10 5492 =back
yading@10 5493
yading@10 5494
yading@10 5495
yading@10 5496 =item B<-dialnorm> I<value>
yading@10 5497
yading@10 5498 Dialogue Normalization. Indicates how far the average dialogue level of the
yading@10 5499 program is below digital 100% full scale (0 dBFS). This parameter determines a
yading@10 5500 level shift during audio reproduction that sets the average volume of the
yading@10 5501 dialogue to a preset level. The goal is to match volume level between program
yading@10 5502 sources. A value of -31dB will result in no volume level change, relative to
yading@10 5503 the source volume, during audio reproduction. Valid values are whole numbers in
yading@10 5504 the range -31 to -1, with -31 being the default.
yading@10 5505
yading@10 5506
yading@10 5507 =item B<-dsur_mode> I<mode>
yading@10 5508
yading@10 5509 Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
yading@10 5510 (Pro Logic). This field will only be written to the bitstream if the audio
yading@10 5511 stream is stereo. Using this option does B<NOT> mean the encoder will actually
yading@10 5512 apply Dolby Surround processing.
yading@10 5513
yading@10 5514 =over 4
yading@10 5515
yading@10 5516
yading@10 5517 =item B<0>
yading@10 5518
yading@10 5519
yading@10 5520 =item B<notindicated>
yading@10 5521
yading@10 5522 Not Indicated (default)
yading@10 5523
yading@10 5524 =item B<1>
yading@10 5525
yading@10 5526
yading@10 5527 =item B<off>
yading@10 5528
yading@10 5529 Not Dolby Surround Encoded
yading@10 5530
yading@10 5531 =item B<2>
yading@10 5532
yading@10 5533
yading@10 5534 =item B<on>
yading@10 5535
yading@10 5536 Dolby Surround Encoded
yading@10 5537
yading@10 5538 =back
yading@10 5539
yading@10 5540
yading@10 5541
yading@10 5542 =item B<-original> I<boolean>
yading@10 5543
yading@10 5544 Original Bit Stream Indicator. Specifies whether this audio is from the
yading@10 5545 original source and not a copy.
yading@10 5546
yading@10 5547 =over 4
yading@10 5548
yading@10 5549
yading@10 5550 =item B<0>
yading@10 5551
yading@10 5552
yading@10 5553 =item B<off>
yading@10 5554
yading@10 5555 Not Original Source
yading@10 5556
yading@10 5557 =item B<1>
yading@10 5558
yading@10 5559
yading@10 5560 =item B<on>
yading@10 5561
yading@10 5562 Original Source (default)
yading@10 5563
yading@10 5564 =back
yading@10 5565
yading@10 5566
yading@10 5567
yading@10 5568 =back
yading@10 5569
yading@10 5570
yading@10 5571
yading@10 5572 =head3 Extended Bitstream Information
yading@10 5573
yading@10 5574 The extended bitstream options are part of the Alternate Bit Stream Syntax as
yading@10 5575 specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
yading@10 5576 If any one parameter in a group is specified, all values in that group will be
yading@10 5577 written to the bitstream. Default values are used for those that are written
yading@10 5578 but have not been specified. If the mixing levels are written, the decoder
yading@10 5579 will use these values instead of the ones specified in the C<center_mixlev>
yading@10 5580 and C<surround_mixlev> options if it supports the Alternate Bit Stream
yading@10 5581 Syntax.
yading@10 5582
yading@10 5583
yading@10 5584 =head4 Extended Bitstream Information - Part 1
yading@10 5585
yading@10 5586
yading@10 5587
yading@10 5588 =over 4
yading@10 5589
yading@10 5590
yading@10 5591
yading@10 5592 =item B<-dmix_mode> I<mode>
yading@10 5593
yading@10 5594 Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
yading@10 5595 (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
yading@10 5596
yading@10 5597 =over 4
yading@10 5598
yading@10 5599
yading@10 5600 =item B<0>
yading@10 5601
yading@10 5602
yading@10 5603 =item B<notindicated>
yading@10 5604
yading@10 5605 Not Indicated (default)
yading@10 5606
yading@10 5607 =item B<1>
yading@10 5608
yading@10 5609
yading@10 5610 =item B<ltrt>
yading@10 5611
yading@10 5612 Lt/Rt Downmix Preferred
yading@10 5613
yading@10 5614 =item B<2>
yading@10 5615
yading@10 5616
yading@10 5617 =item B<loro>
yading@10 5618
yading@10 5619 Lo/Ro Downmix Preferred
yading@10 5620
yading@10 5621 =back
yading@10 5622
yading@10 5623
yading@10 5624
yading@10 5625 =item B<-ltrt_cmixlev> I<level>
yading@10 5626
yading@10 5627 Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
yading@10 5628 center channel when downmixing to stereo in Lt/Rt mode.
yading@10 5629
yading@10 5630 =over 4
yading@10 5631
yading@10 5632
yading@10 5633 =item B<1.414>
yading@10 5634
yading@10 5635 Apply +3dB gain
yading@10 5636
yading@10 5637 =item B<1.189>
yading@10 5638
yading@10 5639 Apply +1.5dB gain
yading@10 5640
yading@10 5641 =item B<1.000>
yading@10 5642
yading@10 5643 Apply 0dB gain
yading@10 5644
yading@10 5645 =item B<0.841>
yading@10 5646
yading@10 5647 Apply -1.5dB gain
yading@10 5648
yading@10 5649 =item B<0.707>
yading@10 5650
yading@10 5651 Apply -3.0dB gain
yading@10 5652
yading@10 5653 =item B<0.595>
yading@10 5654
yading@10 5655 Apply -4.5dB gain (default)
yading@10 5656
yading@10 5657 =item B<0.500>
yading@10 5658
yading@10 5659 Apply -6.0dB gain
yading@10 5660
yading@10 5661 =item B<0.000>
yading@10 5662
yading@10 5663 Silence Center Channel
yading@10 5664
yading@10 5665 =back
yading@10 5666
yading@10 5667
yading@10 5668
yading@10 5669 =item B<-ltrt_surmixlev> I<level>
yading@10 5670
yading@10 5671 Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
yading@10 5672 surround channel(s) when downmixing to stereo in Lt/Rt mode.
yading@10 5673
yading@10 5674 =over 4
yading@10 5675
yading@10 5676
yading@10 5677 =item B<0.841>
yading@10 5678
yading@10 5679 Apply -1.5dB gain
yading@10 5680
yading@10 5681 =item B<0.707>
yading@10 5682
yading@10 5683 Apply -3.0dB gain
yading@10 5684
yading@10 5685 =item B<0.595>
yading@10 5686
yading@10 5687 Apply -4.5dB gain
yading@10 5688
yading@10 5689 =item B<0.500>
yading@10 5690
yading@10 5691 Apply -6.0dB gain (default)
yading@10 5692
yading@10 5693 =item B<0.000>
yading@10 5694
yading@10 5695 Silence Surround Channel(s)
yading@10 5696
yading@10 5697 =back
yading@10 5698
yading@10 5699
yading@10 5700
yading@10 5701 =item B<-loro_cmixlev> I<level>
yading@10 5702
yading@10 5703 Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
yading@10 5704 center channel when downmixing to stereo in Lo/Ro mode.
yading@10 5705
yading@10 5706 =over 4
yading@10 5707
yading@10 5708
yading@10 5709 =item B<1.414>
yading@10 5710
yading@10 5711 Apply +3dB gain
yading@10 5712
yading@10 5713 =item B<1.189>
yading@10 5714
yading@10 5715 Apply +1.5dB gain
yading@10 5716
yading@10 5717 =item B<1.000>
yading@10 5718
yading@10 5719 Apply 0dB gain
yading@10 5720
yading@10 5721 =item B<0.841>
yading@10 5722
yading@10 5723 Apply -1.5dB gain
yading@10 5724
yading@10 5725 =item B<0.707>
yading@10 5726
yading@10 5727 Apply -3.0dB gain
yading@10 5728
yading@10 5729 =item B<0.595>
yading@10 5730
yading@10 5731 Apply -4.5dB gain (default)
yading@10 5732
yading@10 5733 =item B<0.500>
yading@10 5734
yading@10 5735 Apply -6.0dB gain
yading@10 5736
yading@10 5737 =item B<0.000>
yading@10 5738
yading@10 5739 Silence Center Channel
yading@10 5740
yading@10 5741 =back
yading@10 5742
yading@10 5743
yading@10 5744
yading@10 5745 =item B<-loro_surmixlev> I<level>
yading@10 5746
yading@10 5747 Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
yading@10 5748 surround channel(s) when downmixing to stereo in Lo/Ro mode.
yading@10 5749
yading@10 5750 =over 4
yading@10 5751
yading@10 5752
yading@10 5753 =item B<0.841>
yading@10 5754
yading@10 5755 Apply -1.5dB gain
yading@10 5756
yading@10 5757 =item B<0.707>
yading@10 5758
yading@10 5759 Apply -3.0dB gain
yading@10 5760
yading@10 5761 =item B<0.595>
yading@10 5762
yading@10 5763 Apply -4.5dB gain
yading@10 5764
yading@10 5765 =item B<0.500>
yading@10 5766
yading@10 5767 Apply -6.0dB gain (default)
yading@10 5768
yading@10 5769 =item B<0.000>
yading@10 5770
yading@10 5771 Silence Surround Channel(s)
yading@10 5772
yading@10 5773 =back
yading@10 5774
yading@10 5775
yading@10 5776
yading@10 5777 =back
yading@10 5778
yading@10 5779
yading@10 5780
yading@10 5781 =head4 Extended Bitstream Information - Part 2
yading@10 5782
yading@10 5783
yading@10 5784
yading@10 5785 =over 4
yading@10 5786
yading@10 5787
yading@10 5788
yading@10 5789 =item B<-dsurex_mode> I<mode>
yading@10 5790
yading@10 5791 Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
yading@10 5792 (7.1 matrixed to 5.1). Using this option does B<NOT> mean the encoder will actually
yading@10 5793 apply Dolby Surround EX processing.
yading@10 5794
yading@10 5795 =over 4
yading@10 5796
yading@10 5797
yading@10 5798 =item B<0>
yading@10 5799
yading@10 5800
yading@10 5801 =item B<notindicated>
yading@10 5802
yading@10 5803 Not Indicated (default)
yading@10 5804
yading@10 5805 =item B<1>
yading@10 5806
yading@10 5807
yading@10 5808 =item B<on>
yading@10 5809
yading@10 5810 Dolby Surround EX Off
yading@10 5811
yading@10 5812 =item B<2>
yading@10 5813
yading@10 5814
yading@10 5815 =item B<off>
yading@10 5816
yading@10 5817 Dolby Surround EX On
yading@10 5818
yading@10 5819 =back
yading@10 5820
yading@10 5821
yading@10 5822
yading@10 5823 =item B<-dheadphone_mode> I<mode>
yading@10 5824
yading@10 5825 Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
yading@10 5826 encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
yading@10 5827 option does B<NOT> mean the encoder will actually apply Dolby Headphone
yading@10 5828 processing.
yading@10 5829
yading@10 5830 =over 4
yading@10 5831
yading@10 5832
yading@10 5833 =item B<0>
yading@10 5834
yading@10 5835
yading@10 5836 =item B<notindicated>
yading@10 5837
yading@10 5838 Not Indicated (default)
yading@10 5839
yading@10 5840 =item B<1>
yading@10 5841
yading@10 5842
yading@10 5843 =item B<on>
yading@10 5844
yading@10 5845 Dolby Headphone Off
yading@10 5846
yading@10 5847 =item B<2>
yading@10 5848
yading@10 5849
yading@10 5850 =item B<off>
yading@10 5851
yading@10 5852 Dolby Headphone On
yading@10 5853
yading@10 5854 =back
yading@10 5855
yading@10 5856
yading@10 5857
yading@10 5858 =item B<-ad_conv_type> I<type>
yading@10 5859
yading@10 5860 A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
yading@10 5861 conversion.
yading@10 5862
yading@10 5863 =over 4
yading@10 5864
yading@10 5865
yading@10 5866 =item B<0>
yading@10 5867
yading@10 5868
yading@10 5869 =item B<standard>
yading@10 5870
yading@10 5871 Standard A/D Converter (default)
yading@10 5872
yading@10 5873 =item B<1>
yading@10 5874
yading@10 5875
yading@10 5876 =item B<hdcd>
yading@10 5877
yading@10 5878 HDCD A/D Converter
yading@10 5879
yading@10 5880 =back
yading@10 5881
yading@10 5882
yading@10 5883
yading@10 5884 =back
yading@10 5885
yading@10 5886
yading@10 5887
yading@10 5888 =head3 Other AC-3 Encoding Options
yading@10 5889
yading@10 5890
yading@10 5891
yading@10 5892 =over 4
yading@10 5893
yading@10 5894
yading@10 5895
yading@10 5896 =item B<-stereo_rematrixing> I<boolean>
yading@10 5897
yading@10 5898 Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
yading@10 5899 is an optional AC-3 feature that increases quality by selectively encoding
yading@10 5900 the left/right channels as mid/side. This option is enabled by default, and it
yading@10 5901 is highly recommended that it be left as enabled except for testing purposes.
yading@10 5902
yading@10 5903
yading@10 5904 =back
yading@10 5905
yading@10 5906
yading@10 5907
yading@10 5908 =head3 Floating-Point-Only AC-3 Encoding Options
yading@10 5909
yading@10 5910
yading@10 5911 These options are only valid for the floating-point encoder and do not exist
yading@10 5912 for the fixed-point encoder due to the corresponding features not being
yading@10 5913 implemented in fixed-point.
yading@10 5914
yading@10 5915
yading@10 5916 =over 4
yading@10 5917
yading@10 5918
yading@10 5919
yading@10 5920 =item B<-channel_coupling> I<boolean>
yading@10 5921
yading@10 5922 Enables/Disables use of channel coupling, which is an optional AC-3 feature
yading@10 5923 that increases quality by combining high frequency information from multiple
yading@10 5924 channels into a single channel. The per-channel high frequency information is
yading@10 5925 sent with less accuracy in both the frequency and time domains. This allows
yading@10 5926 more bits to be used for lower frequencies while preserving enough information
yading@10 5927 to reconstruct the high frequencies. This option is enabled by default for the
yading@10 5928 floating-point encoder and should generally be left as enabled except for
yading@10 5929 testing purposes or to increase encoding speed.
yading@10 5930
yading@10 5931 =over 4
yading@10 5932
yading@10 5933
yading@10 5934 =item B<-1>
yading@10 5935
yading@10 5936
yading@10 5937 =item B<auto>
yading@10 5938
yading@10 5939 Selected by Encoder (default)
yading@10 5940
yading@10 5941 =item B<0>
yading@10 5942
yading@10 5943
yading@10 5944 =item B<off>
yading@10 5945
yading@10 5946 Disable Channel Coupling
yading@10 5947
yading@10 5948 =item B<1>
yading@10 5949
yading@10 5950
yading@10 5951 =item B<on>
yading@10 5952
yading@10 5953 Enable Channel Coupling
yading@10 5954
yading@10 5955 =back
yading@10 5956
yading@10 5957
yading@10 5958
yading@10 5959 =item B<-cpl_start_band> I<number>
yading@10 5960
yading@10 5961 Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
yading@10 5962 value higher than the bandwidth is used, it will be reduced to 1 less than the
yading@10 5963 coupling end band. If I<auto> is used, the start band will be determined by
yading@10 5964 the encoder based on the bit rate, sample rate, and channel layout. This option
yading@10 5965 has no effect if channel coupling is disabled.
yading@10 5966
yading@10 5967 =over 4
yading@10 5968
yading@10 5969
yading@10 5970 =item B<-1>
yading@10 5971
yading@10 5972
yading@10 5973 =item B<auto>
yading@10 5974
yading@10 5975 Selected by Encoder (default)
yading@10 5976
yading@10 5977 =back
yading@10 5978
yading@10 5979
yading@10 5980
yading@10 5981 =back
yading@10 5982
yading@10 5983
yading@10 5984
yading@10 5985
yading@10 5986 =head1 VIDEO ENCODERS
yading@10 5987
yading@10 5988
yading@10 5989 A description of some of the currently available video encoders
yading@10 5990 follows.
yading@10 5991
yading@10 5992
yading@10 5993 =head2 libtheora
yading@10 5994
yading@10 5995
yading@10 5996 Theora format supported through libtheora.
yading@10 5997
yading@10 5998 Requires the presence of the libtheora headers and library during
yading@10 5999 configuration. You need to explicitly configure the build with
yading@10 6000 C<--enable-libtheora>.
yading@10 6001
yading@10 6002
yading@10 6003 =head3 Options
yading@10 6004
yading@10 6005
yading@10 6006 The following global options are mapped to internal libtheora options
yading@10 6007 which affect the quality and the bitrate of the encoded stream.
yading@10 6008
yading@10 6009
yading@10 6010 =over 4
yading@10 6011
yading@10 6012
yading@10 6013 =item B<b>
yading@10 6014
yading@10 6015 Set the video bitrate, only works if the C<qscale> flag in
yading@10 6016 B<flags> is not enabled.
yading@10 6017
yading@10 6018
yading@10 6019 =item B<flags>
yading@10 6020
yading@10 6021 Used to enable constant quality mode encoding through the
yading@10 6022 B<qscale> flag, and to enable the C<pass1> and C<pass2>
yading@10 6023 modes.
yading@10 6024
yading@10 6025
yading@10 6026 =item B<g>
yading@10 6027
yading@10 6028 Set the GOP size.
yading@10 6029
yading@10 6030
yading@10 6031 =item B<global_quality>
yading@10 6032
yading@10 6033 Set the global quality in lambda units, only works if the
yading@10 6034 C<qscale> flag in B<flags> is enabled. The value is clipped
yading@10 6035 in the [0 - 10*C<FF_QP2LAMBDA>] range, and then multiplied for 6.3
yading@10 6036 to get a value in the native libtheora range [0-63]. A higher value
yading@10 6037 corresponds to a higher quality.
yading@10 6038
yading@10 6039 For example, to set maximum constant quality encoding with
yading@10 6040 B<ffmpeg>:
yading@10 6041
yading@10 6042 ffmpeg -i INPUT -flags:v qscale -global_quality:v "10*QP2LAMBDA" -codec:v libtheora OUTPUT.ogg
yading@10 6043
yading@10 6044
yading@10 6045 =back
yading@10 6046
yading@10 6047
yading@10 6048
yading@10 6049 =head2 libvpx
yading@10 6050
yading@10 6051
yading@10 6052 VP8 format supported through libvpx.
yading@10 6053
yading@10 6054 Requires the presence of the libvpx headers and library during configuration.
yading@10 6055 You need to explicitly configure the build with C<--enable-libvpx>.
yading@10 6056
yading@10 6057
yading@10 6058 =head3 Options
yading@10 6059
yading@10 6060
yading@10 6061 Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
yading@10 6062
yading@10 6063
yading@10 6064 =over 4
yading@10 6065
yading@10 6066
yading@10 6067
yading@10 6068 =item B<threads>
yading@10 6069
yading@10 6070 g_threads
yading@10 6071
yading@10 6072
yading@10 6073 =item B<profile>
yading@10 6074
yading@10 6075 g_profile
yading@10 6076
yading@10 6077
yading@10 6078 =item B<vb>
yading@10 6079
yading@10 6080 rc_target_bitrate
yading@10 6081
yading@10 6082
yading@10 6083 =item B<g>
yading@10 6084
yading@10 6085 kf_max_dist
yading@10 6086
yading@10 6087
yading@10 6088 =item B<keyint_min>
yading@10 6089
yading@10 6090 kf_min_dist
yading@10 6091
yading@10 6092
yading@10 6093 =item B<qmin>
yading@10 6094
yading@10 6095 rc_min_quantizer
yading@10 6096
yading@10 6097
yading@10 6098 =item B<qmax>
yading@10 6099
yading@10 6100 rc_max_quantizer
yading@10 6101
yading@10 6102
yading@10 6103 =item B<bufsize, vb>
yading@10 6104
yading@10 6105 rc_buf_sz
yading@10 6106 C<(bufsize * 1000 / vb)>
yading@10 6107
yading@10 6108 rc_buf_optimal_sz
yading@10 6109 C<(bufsize * 1000 / vb * 5 / 6)>
yading@10 6110
yading@10 6111
yading@10 6112 =item B<rc_init_occupancy, vb>
yading@10 6113
yading@10 6114 rc_buf_initial_sz
yading@10 6115 C<(rc_init_occupancy * 1000 / vb)>
yading@10 6116
yading@10 6117
yading@10 6118 =item B<rc_buffer_aggressivity>
yading@10 6119
yading@10 6120 rc_undershoot_pct
yading@10 6121
yading@10 6122
yading@10 6123 =item B<skip_threshold>
yading@10 6124
yading@10 6125 rc_dropframe_thresh
yading@10 6126
yading@10 6127
yading@10 6128 =item B<qcomp>
yading@10 6129
yading@10 6130 rc_2pass_vbr_bias_pct
yading@10 6131
yading@10 6132
yading@10 6133 =item B<maxrate, vb>
yading@10 6134
yading@10 6135 rc_2pass_vbr_maxsection_pct
yading@10 6136 C<(maxrate * 100 / vb)>
yading@10 6137
yading@10 6138
yading@10 6139 =item B<minrate, vb>
yading@10 6140
yading@10 6141 rc_2pass_vbr_minsection_pct
yading@10 6142 C<(minrate * 100 / vb)>
yading@10 6143
yading@10 6144
yading@10 6145 =item B<minrate, maxrate, vb>
yading@10 6146
yading@10 6147 C<VPX_CBR>
yading@10 6148 C<(minrate == maxrate == vb)>
yading@10 6149
yading@10 6150
yading@10 6151 =item B<crf>
yading@10 6152
yading@10 6153 C<VPX_CQ>, C<VP8E_SET_CQ_LEVEL>
yading@10 6154
yading@10 6155
yading@10 6156 =item B<quality>
yading@10 6157
yading@10 6158
yading@10 6159 =over 4
yading@10 6160
yading@10 6161
yading@10 6162 =item I<best>
yading@10 6163
yading@10 6164 C<VPX_DL_BEST_QUALITY>
yading@10 6165
yading@10 6166 =item I<good>
yading@10 6167
yading@10 6168 C<VPX_DL_GOOD_QUALITY>
yading@10 6169
yading@10 6170 =item I<realtime>
yading@10 6171
yading@10 6172 C<VPX_DL_REALTIME>
yading@10 6173
yading@10 6174 =back
yading@10 6175
yading@10 6176
yading@10 6177
yading@10 6178 =item B<speed>
yading@10 6179
yading@10 6180 C<VP8E_SET_CPUUSED>
yading@10 6181
yading@10 6182
yading@10 6183 =item B<nr>
yading@10 6184
yading@10 6185 C<VP8E_SET_NOISE_SENSITIVITY>
yading@10 6186
yading@10 6187
yading@10 6188 =item B<mb_threshold>
yading@10 6189
yading@10 6190 C<VP8E_SET_STATIC_THRESHOLD>
yading@10 6191
yading@10 6192
yading@10 6193 =item B<slices>
yading@10 6194
yading@10 6195 C<VP8E_SET_TOKEN_PARTITIONS>
yading@10 6196
yading@10 6197
yading@10 6198 =item B<max-intra-rate>
yading@10 6199
yading@10 6200 C<VP8E_SET_MAX_INTRA_BITRATE_PCT>
yading@10 6201
yading@10 6202
yading@10 6203 =item B<force_key_frames>
yading@10 6204
yading@10 6205 C<VPX_EFLAG_FORCE_KF>
yading@10 6206
yading@10 6207
yading@10 6208 =item B<Alternate reference frame related>
yading@10 6209
yading@10 6210
yading@10 6211 =over 4
yading@10 6212
yading@10 6213
yading@10 6214 =item B<vp8flags altref>
yading@10 6215
yading@10 6216 C<VP8E_SET_ENABLEAUTOALTREF>
yading@10 6217
yading@10 6218 =item I<arnr_max_frames>
yading@10 6219
yading@10 6220 C<VP8E_SET_ARNR_MAXFRAMES>
yading@10 6221
yading@10 6222 =item I<arnr_type>
yading@10 6223
yading@10 6224 C<VP8E_SET_ARNR_TYPE>
yading@10 6225
yading@10 6226 =item I<arnr_strength>
yading@10 6227
yading@10 6228 C<VP8E_SET_ARNR_STRENGTH>
yading@10 6229
yading@10 6230 =item I<rc_lookahead>
yading@10 6231
yading@10 6232 g_lag_in_frames
yading@10 6233
yading@10 6234 =back
yading@10 6235
yading@10 6236
yading@10 6237
yading@10 6238 =item B<vp8flags error_resilient>
yading@10 6239
yading@10 6240 g_error_resilient
yading@10 6241
yading@10 6242
yading@10 6243 =back
yading@10 6244
yading@10 6245
yading@10 6246 For more information about libvpx see:
yading@10 6247 E<lt>B<http://www.webmproject.org/>E<gt>
yading@10 6248
yading@10 6249
yading@10 6250 =head2 libx264
yading@10 6251
yading@10 6252
yading@10 6253 x264 H.264/MPEG-4 AVC encoder wrapper
yading@10 6254
yading@10 6255 Requires the presence of the libx264 headers and library during
yading@10 6256 configuration. You need to explicitly configure the build with
yading@10 6257 C<--enable-libx264>.
yading@10 6258
yading@10 6259 x264 supports an impressive number of features, including 8x8 and 4x4 adaptive
yading@10 6260 spatial transform, adaptive B-frame placement, CAVLC/CABAC entropy coding,
yading@10 6261 interlacing (MBAFF), lossless mode, psy optimizations for detail retention
yading@10 6262 (adaptive quantization, psy-RD, psy-trellis).
yading@10 6263
yading@10 6264 The FFmpeg wrapper provides a mapping for most of them using global options
yading@10 6265 that match those of the encoders and provides private options for the unique
yading@10 6266 encoder options. Additionally an expert override is provided to directly pass
yading@10 6267 a list of key=value tuples as accepted by x264_param_parse.
yading@10 6268
yading@10 6269
yading@10 6270 =head3 Option Mapping
yading@10 6271
yading@10 6272
yading@10 6273 The following options are supported by the x264 wrapper, the x264-equivalent
yading@10 6274 options follow the FFmpeg ones.
yading@10 6275
yading@10 6276
yading@10 6277 =over 4
yading@10 6278
yading@10 6279
yading@10 6280 =item B<b : bitrate>
yading@10 6281
yading@10 6282 FFmpeg C<b> option is expressed in bits/s, x264 C<bitrate> in kilobits/s.
yading@10 6283
yading@10 6284 =item B<bf : bframes>
yading@10 6285
yading@10 6286 Maximum number of B-frames.
yading@10 6287
yading@10 6288 =item B<g : keyint>
yading@10 6289
yading@10 6290 Maximum GOP size.
yading@10 6291
yading@10 6292 =item B<qmin : qpmin>
yading@10 6293
yading@10 6294
yading@10 6295 =item B<qmax : qpmax>
yading@10 6296
yading@10 6297
yading@10 6298 =item B<qdiff : qpstep>
yading@10 6299
yading@10 6300
yading@10 6301 =item B<qblur : qblur>
yading@10 6302
yading@10 6303
yading@10 6304 =item B<qcomp : qcomp>
yading@10 6305
yading@10 6306
yading@10 6307 =item B<refs : ref>
yading@10 6308
yading@10 6309
yading@10 6310 =item B<sc_threshold : scenecut>
yading@10 6311
yading@10 6312
yading@10 6313 =item B<trellis : trellis>
yading@10 6314
yading@10 6315
yading@10 6316 =item B<nr : nr>
yading@10 6317
yading@10 6318 Noise reduction.
yading@10 6319
yading@10 6320 =item B<me_range : merange>
yading@10 6321
yading@10 6322
yading@10 6323 =item B<me_method : me>
yading@10 6324
yading@10 6325
yading@10 6326 =item B<subq : subme>
yading@10 6327
yading@10 6328
yading@10 6329 =item B<b_strategy : b-adapt>
yading@10 6330
yading@10 6331
yading@10 6332 =item B<keyint_min : keyint-min>
yading@10 6333
yading@10 6334
yading@10 6335 =item B<coder : cabac>
yading@10 6336
yading@10 6337 Set coder to C<ac> to use CABAC.
yading@10 6338
yading@10 6339 =item B<cmp : chroma-me>
yading@10 6340
yading@10 6341 Set to C<chroma> to use chroma motion estimation.
yading@10 6342
yading@10 6343 =item B<threads : threads>
yading@10 6344
yading@10 6345
yading@10 6346 =item B<thread_type : sliced_threads>
yading@10 6347
yading@10 6348 Set to C<slice> to use sliced threading instead of frame threading.
yading@10 6349
yading@10 6350 =item B<flags -cgop : open-gop>
yading@10 6351
yading@10 6352 Set C<-cgop> to use recovery points to close GOPs.
yading@10 6353
yading@10 6354 =item B<rc_init_occupancy : vbv-init>
yading@10 6355
yading@10 6356 Initial buffer occupancy.
yading@10 6357
yading@10 6358 =back
yading@10 6359
yading@10 6360
yading@10 6361
yading@10 6362 =head3 Private Options
yading@10 6363
yading@10 6364
yading@10 6365 =over 4
yading@10 6366
yading@10 6367
yading@10 6368 =item B<-preset> I<string>
yading@10 6369
yading@10 6370 Set the encoding preset (cf. x264 --fullhelp).
yading@10 6371
yading@10 6372 =item B<-tune> I<string>
yading@10 6373
yading@10 6374 Tune the encoding params (cf. x264 --fullhelp).
yading@10 6375
yading@10 6376 =item B<-profile> I<string>
yading@10 6377
yading@10 6378 Set profile restrictions (cf. x264 --fullhelp).
yading@10 6379
yading@10 6380 =item B<-fastfirstpass> I<integer>
yading@10 6381
yading@10 6382 Use fast settings when encoding first pass.
yading@10 6383
yading@10 6384 =item B<-crf> I<float>
yading@10 6385
yading@10 6386 Select the quality for constant quality mode.
yading@10 6387
yading@10 6388 =item B<-crf_max> I<float>
yading@10 6389
yading@10 6390 In CRF mode, prevents VBV from lowering quality beyond this point.
yading@10 6391
yading@10 6392 =item B<-qp> I<integer>
yading@10 6393
yading@10 6394 Constant quantization parameter rate control method.
yading@10 6395
yading@10 6396 =item B<-aq-mode> I<integer>
yading@10 6397
yading@10 6398 AQ method
yading@10 6399
yading@10 6400 Possible values:
yading@10 6401
yading@10 6402 =over 4
yading@10 6403
yading@10 6404
yading@10 6405 =item B<none>
yading@10 6406
yading@10 6407
yading@10 6408
yading@10 6409 =item B<variance>
yading@10 6410
yading@10 6411 Variance AQ (complexity mask).
yading@10 6412
yading@10 6413 =item B<autovariance>
yading@10 6414
yading@10 6415 Auto-variance AQ (experimental).
yading@10 6416
yading@10 6417 =back
yading@10 6418
yading@10 6419
yading@10 6420 =item B<-aq-strength> I<float>
yading@10 6421
yading@10 6422 AQ strength, reduces blocking and blurring in flat and textured areas.
yading@10 6423
yading@10 6424 =item B<-psy> I<integer>
yading@10 6425
yading@10 6426 Use psychovisual optimizations.
yading@10 6427
yading@10 6428 =item B<-psy-rd> I<string>
yading@10 6429
yading@10 6430 Strength of psychovisual optimization, in E<lt>psy-rdE<gt>:E<lt>psy-trellisE<gt> format.
yading@10 6431
yading@10 6432 =item B<-rc-lookahead> I<integer>
yading@10 6433
yading@10 6434 Number of frames to look ahead for frametype and ratecontrol.
yading@10 6435
yading@10 6436 =item B<-weightb> I<integer>
yading@10 6437
yading@10 6438 Weighted prediction for B-frames.
yading@10 6439
yading@10 6440 =item B<-weightp> I<integer>
yading@10 6441
yading@10 6442 Weighted prediction analysis method.
yading@10 6443
yading@10 6444 Possible values:
yading@10 6445
yading@10 6446 =over 4
yading@10 6447
yading@10 6448
yading@10 6449 =item B<none>
yading@10 6450
yading@10 6451
yading@10 6452
yading@10 6453 =item B<simple>
yading@10 6454
yading@10 6455
yading@10 6456
yading@10 6457 =item B<smart>
yading@10 6458
yading@10 6459
yading@10 6460
yading@10 6461 =back
yading@10 6462
yading@10 6463
yading@10 6464 =item B<-ssim> I<integer>
yading@10 6465
yading@10 6466 Calculate and print SSIM stats.
yading@10 6467
yading@10 6468 =item B<-intra-refresh> I<integer>
yading@10 6469
yading@10 6470 Use Periodic Intra Refresh instead of IDR frames.
yading@10 6471
yading@10 6472 =item B<-b-bias> I<integer>
yading@10 6473
yading@10 6474 Influences how often B-frames are used.
yading@10 6475
yading@10 6476 =item B<-b-pyramid> I<integer>
yading@10 6477
yading@10 6478 Keep some B-frames as references.
yading@10 6479
yading@10 6480 Possible values:
yading@10 6481
yading@10 6482 =over 4
yading@10 6483
yading@10 6484
yading@10 6485 =item B<none>
yading@10 6486
yading@10 6487
yading@10 6488
yading@10 6489 =item B<strict>
yading@10 6490
yading@10 6491 Strictly hierarchical pyramid.
yading@10 6492
yading@10 6493 =item B<normal>
yading@10 6494
yading@10 6495 Non-strict (not Blu-ray compatible).
yading@10 6496
yading@10 6497 =back
yading@10 6498
yading@10 6499
yading@10 6500 =item B<-mixed-refs> I<integer>
yading@10 6501
yading@10 6502 One reference per partition, as opposed to one reference per macroblock.
yading@10 6503
yading@10 6504 =item B<-8x8dct> I<integer>
yading@10 6505
yading@10 6506 High profile 8x8 transform.
yading@10 6507
yading@10 6508 =item B<-fast-pskip> I<integer>
yading@10 6509
yading@10 6510
yading@10 6511 =item B<-aud> I<integer>
yading@10 6512
yading@10 6513 Use access unit delimiters.
yading@10 6514
yading@10 6515 =item B<-mbtree> I<integer>
yading@10 6516
yading@10 6517 Use macroblock tree ratecontrol.
yading@10 6518
yading@10 6519 =item B<-deblock> I<string>
yading@10 6520
yading@10 6521 Loop filter parameters, in E<lt>alpha:betaE<gt> form.
yading@10 6522
yading@10 6523 =item B<-cplxblur> I<float>
yading@10 6524
yading@10 6525 Reduce fluctuations in QP (before curve compression).
yading@10 6526
yading@10 6527 =item B<-partitions> I<string>
yading@10 6528
yading@10 6529 A comma-separated list of partitions to consider, possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, all.
yading@10 6530
yading@10 6531 =item B<-direct-pred> I<integer>
yading@10 6532
yading@10 6533 Direct MV prediction mode
yading@10 6534
yading@10 6535 Possible values:
yading@10 6536
yading@10 6537 =over 4
yading@10 6538
yading@10 6539
yading@10 6540 =item B<none>
yading@10 6541
yading@10 6542
yading@10 6543
yading@10 6544 =item B<spatial>
yading@10 6545
yading@10 6546
yading@10 6547
yading@10 6548 =item B<temporal>
yading@10 6549
yading@10 6550
yading@10 6551
yading@10 6552 =item B<auto>
yading@10 6553
yading@10 6554
yading@10 6555
yading@10 6556 =back
yading@10 6557
yading@10 6558
yading@10 6559 =item B<-slice-max-size> I<integer>
yading@10 6560
yading@10 6561 Limit the size of each slice in bytes.
yading@10 6562
yading@10 6563 =item B<-stats> I<string>
yading@10 6564
yading@10 6565 Filename for 2 pass stats.
yading@10 6566
yading@10 6567 =item B<-nal-hrd> I<integer>
yading@10 6568
yading@10 6569 Signal HRD information (requires vbv-bufsize; cbr not allowed in .mp4).
yading@10 6570
yading@10 6571 Possible values:
yading@10 6572
yading@10 6573 =over 4
yading@10 6574
yading@10 6575
yading@10 6576 =item B<none>
yading@10 6577
yading@10 6578
yading@10 6579
yading@10 6580 =item B<vbr>
yading@10 6581
yading@10 6582
yading@10 6583
yading@10 6584 =item B<cbr>
yading@10 6585
yading@10 6586
yading@10 6587
yading@10 6588 =back
yading@10 6589
yading@10 6590
yading@10 6591
yading@10 6592 =item B<x264opts> I<options>
yading@10 6593
yading@10 6594 Allow to set any x264 option, see C<x264 --fullhelp> for a list.
yading@10 6595
yading@10 6596 I<options> is a list of I<key>=I<value> couples separated by
yading@10 6597 ":". In I<filter> and I<psy-rd> options that use ":" as a separator
yading@10 6598 themselves, use "," instead. They accept it as well since long ago but this
yading@10 6599 is kept undocumented for some reason.
yading@10 6600
yading@10 6601 For example to specify libx264 encoding options with B<ffmpeg>:
yading@10 6602
yading@10 6603 ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
yading@10 6604
yading@10 6605
yading@10 6606 For more information about libx264 and the supported options see:
yading@10 6607 E<lt>B<http://www.videolan.org/developers/x264.html>E<gt>
yading@10 6608
yading@10 6609
yading@10 6610 =item B<-x264-params> I<string>
yading@10 6611
yading@10 6612 Override the x264 configuration using a :-separated list of key=value parameters.
yading@10 6613
yading@10 6614 -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 6615
yading@10 6616
yading@10 6617 =back
yading@10 6618
yading@10 6619
yading@10 6620 Encoding avpresets for common usages are provided so they can be used with the
yading@10 6621 general presets system (e.g. passing the C<-pre> option).
yading@10 6622
yading@10 6623
yading@10 6624 =head2 ProRes
yading@10 6625
yading@10 6626
yading@10 6627 Apple ProRes encoder.
yading@10 6628
yading@10 6629 FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
yading@10 6630 The used encoder can be choosen with the C<-vcodec> option.
yading@10 6631
yading@10 6632
yading@10 6633 =head3 Private Options for prores-ks
yading@10 6634
yading@10 6635
yading@10 6636
yading@10 6637 =over 4
yading@10 6638
yading@10 6639
yading@10 6640 =item B<profile> I<integer>
yading@10 6641
yading@10 6642 Select the ProRes profile to encode
yading@10 6643
yading@10 6644 =over 4
yading@10 6645
yading@10 6646
yading@10 6647 =item B<proxy>
yading@10 6648
yading@10 6649
yading@10 6650 =item B<lt>
yading@10 6651
yading@10 6652
yading@10 6653 =item B<standard>
yading@10 6654
yading@10 6655
yading@10 6656 =item B<hq>
yading@10 6657
yading@10 6658
yading@10 6659 =back
yading@10 6660
yading@10 6661
yading@10 6662
yading@10 6663 =item B<quant_mat> I<integer>
yading@10 6664
yading@10 6665 Select quantization matrix.
yading@10 6666
yading@10 6667 =over 4
yading@10 6668
yading@10 6669
yading@10 6670 =item B<auto>
yading@10 6671
yading@10 6672
yading@10 6673 =item B<default>
yading@10 6674
yading@10 6675
yading@10 6676 =item B<proxy>
yading@10 6677
yading@10 6678
yading@10 6679 =item B<lt>
yading@10 6680
yading@10 6681
yading@10 6682 =item B<standard>
yading@10 6683
yading@10 6684
yading@10 6685 =item B<hq>
yading@10 6686
yading@10 6687
yading@10 6688 =back
yading@10 6689
yading@10 6690 If set to I<auto>, the matrix matching the profile will be picked.
yading@10 6691 If not set, the matrix providing the highest quality, I<default>, will be
yading@10 6692 picked.
yading@10 6693
yading@10 6694
yading@10 6695 =item B<bits_per_mb> I<integer>
yading@10 6696
yading@10 6697 How many bits to allot for coding one macroblock. Different profiles use
yading@10 6698 between 200 and 2400 bits per macroblock, the maximum is 8000.
yading@10 6699
yading@10 6700
yading@10 6701 =item B<mbs_per_slice> I<integer>
yading@10 6702
yading@10 6703 Number of macroblocks in each slice (1-8); the default value (8)
yading@10 6704 should be good in almost all situations.
yading@10 6705
yading@10 6706
yading@10 6707 =item B<vendor> I<string>
yading@10 6708
yading@10 6709 Override the 4-byte vendor ID.
yading@10 6710 A custom vendor ID like I<apl0> would claim the stream was produced by
yading@10 6711 the Apple encoder.
yading@10 6712
yading@10 6713
yading@10 6714 =back
yading@10 6715
yading@10 6716
yading@10 6717
yading@10 6718 =head3 Speed considerations
yading@10 6719
yading@10 6720
yading@10 6721 In the default mode of operation the encoder has to honor frame constraints
yading@10 6722 (i.e. not produc frames with size bigger than requested) while still making
yading@10 6723 output picture as good as possible.
yading@10 6724 A frame containing a lot of small details is harder to compress and the encoder
yading@10 6725 would spend more time searching for appropriate quantizers for each slice.
yading@10 6726
yading@10 6727 Setting a higher B<bits_per_mb> limit will improve the speed.
yading@10 6728
yading@10 6729 For the fastest encoding speed set the B<qscale> parameter (4 is the
yading@10 6730 recommended value) and do not set a size constraint.
yading@10 6731
yading@10 6732
yading@10 6733 =head1 BITSTREAM FILTERS
yading@10 6734
yading@10 6735
yading@10 6736 When you configure your FFmpeg build, all the supported bitstream
yading@10 6737 filters are enabled by default. You can list all available ones using
yading@10 6738 the configure option C<--list-bsfs>.
yading@10 6739
yading@10 6740 You can disable all the bitstream filters using the configure option
yading@10 6741 C<--disable-bsfs>, and selectively enable any bitstream filter using
yading@10 6742 the option C<--enable-bsf=BSF>, or you can disable a particular
yading@10 6743 bitstream filter using the option C<--disable-bsf=BSF>.
yading@10 6744
yading@10 6745 The option C<-bsfs> of the ff* tools will display the list of
yading@10 6746 all the supported bitstream filters included in your build.
yading@10 6747
yading@10 6748 Below is a description of the currently available bitstream filters.
yading@10 6749
yading@10 6750
yading@10 6751 =head2 aac_adtstoasc
yading@10 6752
yading@10 6753
yading@10 6754
yading@10 6755 =head2 chomp
yading@10 6756
yading@10 6757
yading@10 6758
yading@10 6759 =head2 dump_extradata
yading@10 6760
yading@10 6761
yading@10 6762
yading@10 6763 =head2 h264_mp4toannexb
yading@10 6764
yading@10 6765
yading@10 6766 Convert an H.264 bitstream from length prefixed mode to start code
yading@10 6767 prefixed mode (as defined in the Annex B of the ITU-T H.264
yading@10 6768 specification).
yading@10 6769
yading@10 6770 This is required by some streaming formats, typically the MPEG-2
yading@10 6771 transport stream format ("mpegts").
yading@10 6772
yading@10 6773 For example to remux an MP4 file containing an H.264 stream to mpegts
yading@10 6774 format with B<ffmpeg>, you can use the command:
yading@10 6775
yading@10 6776
yading@10 6777 ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
yading@10 6778
yading@10 6779
yading@10 6780
yading@10 6781 =head2 imx_dump_header
yading@10 6782
yading@10 6783
yading@10 6784
yading@10 6785 =head2 mjpeg2jpeg
yading@10 6786
yading@10 6787
yading@10 6788 Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
yading@10 6789
yading@10 6790 MJPEG is a video codec wherein each video frame is essentially a
yading@10 6791 JPEG image. The individual frames can be extracted without loss,
yading@10 6792 e.g. by
yading@10 6793
yading@10 6794
yading@10 6795 ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
yading@10 6796
yading@10 6797
yading@10 6798 Unfortunately, these chunks are incomplete JPEG images, because
yading@10 6799 they lack the DHT segment required for decoding. Quoting from
yading@10 6800 E<lt>B<http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml>E<gt>:
yading@10 6801
yading@10 6802 Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
yading@10 6803 commented that "MJPEG, or at least the MJPEG in AVIs having the
yading@10 6804 MJPG fourcc, is restricted JPEG with a fixed -- and *omitted* --
yading@10 6805 Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
yading@10 6806 and it must use basic Huffman encoding, not arithmetic or
yading@10 6807 progressive. . . . You can indeed extract the MJPEG frames and
yading@10 6808 decode them with a regular JPEG decoder, but you have to prepend
yading@10 6809 the DHT segment to them, or else the decoder won't have any idea
yading@10 6810 how to decompress the data. The exact table necessary is given in
yading@10 6811 the OpenDML spec."
yading@10 6812
yading@10 6813 This bitstream filter patches the header of frames extracted from an MJPEG
yading@10 6814 stream (carrying the AVI1 header ID and lacking a DHT segment) to
yading@10 6815 produce fully qualified JPEG images.
yading@10 6816
yading@10 6817
yading@10 6818 ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
yading@10 6819 exiftran -i -9 frame*.jpg
yading@10 6820 ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
yading@10 6821
yading@10 6822
yading@10 6823
yading@10 6824 =head2 mjpega_dump_header
yading@10 6825
yading@10 6826
yading@10 6827
yading@10 6828 =head2 movsub
yading@10 6829
yading@10 6830
yading@10 6831
yading@10 6832 =head2 mp3_header_compress
yading@10 6833
yading@10 6834
yading@10 6835
yading@10 6836 =head2 mp3_header_decompress
yading@10 6837
yading@10 6838
yading@10 6839
yading@10 6840 =head2 noise
yading@10 6841
yading@10 6842
yading@10 6843
yading@10 6844 =head2 remove_extradata
yading@10 6845
yading@10 6846
yading@10 6847
yading@10 6848
yading@10 6849 =head1 FORMAT OPTIONS
yading@10 6850
yading@10 6851
yading@10 6852 The libavformat library provides some generic global options, which
yading@10 6853 can be set on all the muxers and demuxers. In addition each muxer or
yading@10 6854 demuxer may support so-called private options, which are specific for
yading@10 6855 that component.
yading@10 6856
yading@10 6857 Options may be set by specifying -I<option> I<value> in the
yading@10 6858 FFmpeg tools, or by setting the value explicitly in the
yading@10 6859 C<AVFormatContext> options or using the F<libavutil/opt.h> API
yading@10 6860 for programmatic use.
yading@10 6861
yading@10 6862 The list of supported options follows:
yading@10 6863
yading@10 6864
yading@10 6865 =over 4
yading@10 6866
yading@10 6867
yading@10 6868 =item B<avioflags> I<flags> B<(>I<input/output>B<)>
yading@10 6869
yading@10 6870 Possible values:
yading@10 6871
yading@10 6872 =over 4
yading@10 6873
yading@10 6874
yading@10 6875 =item B<direct>
yading@10 6876
yading@10 6877 Reduce buffering.
yading@10 6878
yading@10 6879 =back
yading@10 6880
yading@10 6881
yading@10 6882
yading@10 6883 =item B<probesize> I<integer> B<(>I<input>B<)>
yading@10 6884
yading@10 6885 Set probing size in bytes, i.e. the size of the data to analyze to get
yading@10 6886 stream information. A higher value will allow to detect more
yading@10 6887 information in case it is dispersed into the stream, but will increase
yading@10 6888 latency. Must be an integer not lesser than 32. It is 5000000 by default.
yading@10 6889
yading@10 6890
yading@10 6891 =item B<packetsize> I<integer> B<(>I<output>B<)>
yading@10 6892
yading@10 6893 Set packet size.
yading@10 6894
yading@10 6895
yading@10 6896 =item B<fflags> I<flags> B<(>I<input/output>B<)>
yading@10 6897
yading@10 6898 Set format flags.
yading@10 6899
yading@10 6900 Possible values:
yading@10 6901
yading@10 6902 =over 4
yading@10 6903
yading@10 6904
yading@10 6905 =item B<ignidx>
yading@10 6906
yading@10 6907 Ignore index.
yading@10 6908
yading@10 6909 =item B<genpts>
yading@10 6910
yading@10 6911 Generate PTS.
yading@10 6912
yading@10 6913 =item B<nofillin>
yading@10 6914
yading@10 6915 Do not fill in missing values that can be exactly calculated.
yading@10 6916
yading@10 6917 =item B<noparse>
yading@10 6918
yading@10 6919 Disable AVParsers, this needs C<+nofillin> too.
yading@10 6920
yading@10 6921 =item B<igndts>
yading@10 6922
yading@10 6923 Ignore DTS.
yading@10 6924
yading@10 6925 =item B<discardcorrupt>
yading@10 6926
yading@10 6927 Discard corrupted frames.
yading@10 6928
yading@10 6929 =item B<sortdts>
yading@10 6930
yading@10 6931 Try to interleave output packets by DTS.
yading@10 6932
yading@10 6933 =item B<keepside>
yading@10 6934
yading@10 6935 Do not merge side data.
yading@10 6936
yading@10 6937 =item B<latm>
yading@10 6938
yading@10 6939 Enable RTP MP4A-LATM payload.
yading@10 6940
yading@10 6941 =item B<nobuffer>
yading@10 6942
yading@10 6943 Reduce the latency introduced by optional buffering
yading@10 6944
yading@10 6945 =back
yading@10 6946
yading@10 6947
yading@10 6948
yading@10 6949 =item B<analyzeduration> I<integer> B<(>I<input>B<)>
yading@10 6950
yading@10 6951 Specify how many microseconds are analyzed to probe the input. A
yading@10 6952 higher value will allow to detect more accurate information, but will
yading@10 6953 increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
yading@10 6954
yading@10 6955
yading@10 6956 =item B<cryptokey> I<hexadecimal string> B<(>I<input>B<)>
yading@10 6957
yading@10 6958 Set decryption key.
yading@10 6959
yading@10 6960
yading@10 6961 =item B<indexmem> I<integer> B<(>I<input>B<)>
yading@10 6962
yading@10 6963 Set max memory used for timestamp index (per stream).
yading@10 6964
yading@10 6965
yading@10 6966 =item B<rtbufsize> I<integer> B<(>I<input>B<)>
yading@10 6967
yading@10 6968 Set max memory used for buffering real-time frames.
yading@10 6969
yading@10 6970
yading@10 6971 =item B<fdebug> I<flags> B<(>I<input/output>B<)>
yading@10 6972
yading@10 6973 Print specific debug info.
yading@10 6974
yading@10 6975 Possible values:
yading@10 6976
yading@10 6977 =over 4
yading@10 6978
yading@10 6979
yading@10 6980 =item B<ts>
yading@10 6981
yading@10 6982
yading@10 6983 =back
yading@10 6984
yading@10 6985
yading@10 6986
yading@10 6987 =item B<max_delay> I<integer> B<(>I<input/output>B<)>
yading@10 6988
yading@10 6989 Set maximum muxing or demuxing delay in microseconds.
yading@10 6990
yading@10 6991
yading@10 6992 =item B<fpsprobesize> I<integer> B<(>I<input>B<)>
yading@10 6993
yading@10 6994 Set number of frames used to probe fps.
yading@10 6995
yading@10 6996
yading@10 6997 =item B<audio_preload> I<integer> B<(>I<output>B<)>
yading@10 6998
yading@10 6999 Set microseconds by which audio packets should be interleaved earlier.
yading@10 7000
yading@10 7001
yading@10 7002 =item B<chunk_duration> I<integer> B<(>I<output>B<)>
yading@10 7003
yading@10 7004 Set microseconds for each chunk.
yading@10 7005
yading@10 7006
yading@10 7007 =item B<chunk_size> I<integer> B<(>I<output>B<)>
yading@10 7008
yading@10 7009 Set size in bytes for each chunk.
yading@10 7010
yading@10 7011
yading@10 7012 =item B<err_detect, f_err_detect> I<flags> B<(>I<input>B<)>
yading@10 7013
yading@10 7014 Set error detection flags. C<f_err_detect> is deprecated and
yading@10 7015 should be used only via the B<ffmpeg> tool.
yading@10 7016
yading@10 7017 Possible values:
yading@10 7018
yading@10 7019 =over 4
yading@10 7020
yading@10 7021
yading@10 7022 =item B<crccheck>
yading@10 7023
yading@10 7024 Verify embedded CRCs.
yading@10 7025
yading@10 7026 =item B<bitstream>
yading@10 7027
yading@10 7028 Detect bitstream specification deviations.
yading@10 7029
yading@10 7030 =item B<buffer>
yading@10 7031
yading@10 7032 Detect improper bitstream length.
yading@10 7033
yading@10 7034 =item B<explode>
yading@10 7035
yading@10 7036 Abort decoding on minor error detection.
yading@10 7037
yading@10 7038 =item B<careful>
yading@10 7039
yading@10 7040 Consider things that violate the spec and have not been seen in the
yading@10 7041 wild as errors.
yading@10 7042
yading@10 7043 =item B<compliant>
yading@10 7044
yading@10 7045 Consider all spec non compliancies as errors.
yading@10 7046
yading@10 7047 =item B<aggressive>
yading@10 7048
yading@10 7049 Consider things that a sane encoder should not do as an error.
yading@10 7050
yading@10 7051 =back
yading@10 7052
yading@10 7053
yading@10 7054
yading@10 7055 =item B<use_wallclock_as_timestamps> I<integer> B<(>I<input>B<)>
yading@10 7056
yading@10 7057 Use wallclock as timestamps.
yading@10 7058
yading@10 7059
yading@10 7060 =item B<avoid_negative_ts> I<integer> B<(>I<output>B<)>
yading@10 7061
yading@10 7062 Shift timestamps to make them positive. A value of 1 enables shifting,
yading@10 7063 a value of 0 disables it, the default value of -1 enables shifting
yading@10 7064 when required by the target format.
yading@10 7065
yading@10 7066 When shifting is enabled, all output timestamps are shifted by the
yading@10 7067 same amount. Audio, video, and subtitles desynching and relative
yading@10 7068 timestamp differences are preserved compared to how they would have
yading@10 7069 been without shifting.
yading@10 7070
yading@10 7071 Also note that this affects only leading negative timestamps, and not
yading@10 7072 non-monotonic negative timestamps.
yading@10 7073
yading@10 7074
yading@10 7075 =item B<flush_packets> I<integer> B<(>I<output>B<)>
yading@10 7076
yading@10 7077 Flush the underlying I/O stream after each packet. Default 1 enables it, and
yading@10 7078 has the effect of reducing the latency; 0 disables it and may slightly
yading@10 7079 increase performance in some cases.
yading@10 7080
yading@10 7081 =back
yading@10 7082
yading@10 7083
yading@10 7084
yading@10 7085
yading@10 7086 =head1 DEMUXERS
yading@10 7087
yading@10 7088
yading@10 7089 Demuxers are configured elements in FFmpeg which allow to read the
yading@10 7090 multimedia streams from a particular type of file.
yading@10 7091
yading@10 7092 When you configure your FFmpeg build, all the supported demuxers
yading@10 7093 are enabled by default. You can list all available ones using the
yading@10 7094 configure option C<--list-demuxers>.
yading@10 7095
yading@10 7096 You can disable all the demuxers using the configure option
yading@10 7097 C<--disable-demuxers>, and selectively enable a single demuxer with
yading@10 7098 the option C<--enable-demuxer=I<DEMUXER>>, or disable it
yading@10 7099 with the option C<--disable-demuxer=I<DEMUXER>>.
yading@10 7100
yading@10 7101 The option C<-formats> of the ff* tools will display the list of
yading@10 7102 enabled demuxers.
yading@10 7103
yading@10 7104 The description of some of the currently available demuxers follows.
yading@10 7105
yading@10 7106
yading@10 7107 =head2 applehttp
yading@10 7108
yading@10 7109
yading@10 7110 Apple HTTP Live Streaming demuxer.
yading@10 7111
yading@10 7112 This demuxer presents all AVStreams from all variant streams.
yading@10 7113 The id field is set to the bitrate variant index number. By setting
yading@10 7114 the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
yading@10 7115 the caller can decide which variant streams to actually receive.
yading@10 7116 The total bitrate of the variant that the stream belongs to is
yading@10 7117 available in a metadata key named "variant_bitrate".
yading@10 7118
yading@10 7119
yading@10 7120
yading@10 7121 =head2 concat
yading@10 7122
yading@10 7123
yading@10 7124 Virtual concatenation script demuxer.
yading@10 7125
yading@10 7126 This demuxer reads a list of files and other directives from a text file and
yading@10 7127 demuxes them one after the other, as if all their packet had been muxed
yading@10 7128 together.
yading@10 7129
yading@10 7130 The timestamps in the files are adjusted so that the first file starts at 0
yading@10 7131 and each next file starts where the previous one finishes. Note that it is
yading@10 7132 done globally and may cause gaps if all streams do not have exactly the same
yading@10 7133 length.
yading@10 7134
yading@10 7135 All files must have the same streams (same codecs, same time base, etc.).
yading@10 7136
yading@10 7137 The duration of each file is used to adjust the timestamps of the next file:
yading@10 7138 if the duration is incorrect (because it was computed using the bit-rate or
yading@10 7139 because the file is truncated, for example), it can cause artifacts. The
yading@10 7140 C<duration> directive can be used to override the duration stored in
yading@10 7141 each file.
yading@10 7142
yading@10 7143
yading@10 7144 =head3 Syntax
yading@10 7145
yading@10 7146
yading@10 7147 The script is a text file in extended-ASCII, with one directive per line.
yading@10 7148 Empty lines, leading spaces and lines starting with '#' are ignored. The
yading@10 7149 following directive is recognized:
yading@10 7150
yading@10 7151
yading@10 7152 =over 4
yading@10 7153
yading@10 7154
yading@10 7155
yading@10 7156 =item B<C<file I<path>>>
yading@10 7157
yading@10 7158 Path to a file to read; special characters and spaces must be escaped with
yading@10 7159 backslash or single quotes.
yading@10 7160
yading@10 7161 All subsequent directives apply to that file.
yading@10 7162
yading@10 7163
yading@10 7164 =item B<C<ffconcat version 1.0>>
yading@10 7165
yading@10 7166 Identify the script type and version. It also sets the B<safe> option
yading@10 7167 to 1 if it was to its default -1.
yading@10 7168
yading@10 7169 To make FFmpeg recognize the format automatically, this directive must
yading@10 7170 appears exactly as is (no extra space or byte-order-mark) on the very first
yading@10 7171 line of the script.
yading@10 7172
yading@10 7173
yading@10 7174 =item B<C<duration I<dur>>>
yading@10 7175
yading@10 7176 Duration of the file. This information can be specified from the file;
yading@10 7177 specifying it here may be more efficient or help if the information from the
yading@10 7178 file is not available or accurate.
yading@10 7179
yading@10 7180 If the duration is set for all files, then it is possible to seek in the
yading@10 7181 whole concatenated video.
yading@10 7182
yading@10 7183
yading@10 7184 =back
yading@10 7185
yading@10 7186
yading@10 7187
yading@10 7188 =head3 Options
yading@10 7189
yading@10 7190
yading@10 7191 This demuxer accepts the following option:
yading@10 7192
yading@10 7193
yading@10 7194 =over 4
yading@10 7195
yading@10 7196
yading@10 7197
yading@10 7198 =item B<safe>
yading@10 7199
yading@10 7200 If set to 1, reject unsafe file paths. A file path is considered safe if it
yading@10 7201 does not contain a protocol specification and is relative and all components
yading@10 7202 only contain characters from the portable character set (letters, digits,
yading@10 7203 period, underscore and hyphen) and have no period at the beginning of a
yading@10 7204 component.
yading@10 7205
yading@10 7206 If set to 0, any file name is accepted.
yading@10 7207
yading@10 7208 The default is -1, it is equivalent to 1 if the format was automatically
yading@10 7209 probed and 0 otherwise.
yading@10 7210
yading@10 7211
yading@10 7212 =back
yading@10 7213
yading@10 7214
yading@10 7215
yading@10 7216 =head2 libquvi
yading@10 7217
yading@10 7218
yading@10 7219 Play media from Internet services using the quvi project.
yading@10 7220
yading@10 7221 The demuxer accepts a B<format> option to request a specific quality. It
yading@10 7222 is by default set to I<best>.
yading@10 7223
yading@10 7224 See E<lt>B<http://quvi.sourceforge.net/>E<gt> for more information.
yading@10 7225
yading@10 7226 FFmpeg needs to be built with C<--enable-libquvi> for this demuxer to be
yading@10 7227 enabled.
yading@10 7228
yading@10 7229
yading@10 7230 =head2 image2
yading@10 7231
yading@10 7232
yading@10 7233 Image file demuxer.
yading@10 7234
yading@10 7235 This demuxer reads from a list of image files specified by a pattern.
yading@10 7236 The syntax and meaning of the pattern is specified by the
yading@10 7237 option I<pattern_type>.
yading@10 7238
yading@10 7239 The pattern may contain a suffix which is used to automatically
yading@10 7240 determine the format of the images contained in the files.
yading@10 7241
yading@10 7242 The size, the pixel format, and the format of each image must be the
yading@10 7243 same for all the files in the sequence.
yading@10 7244
yading@10 7245 This demuxer accepts the following options:
yading@10 7246
yading@10 7247 =over 4
yading@10 7248
yading@10 7249
yading@10 7250 =item B<framerate>
yading@10 7251
yading@10 7252 Set the frame rate for the video stream. It defaults to 25.
yading@10 7253
yading@10 7254 =item B<loop>
yading@10 7255
yading@10 7256 If set to 1, loop over the input. Default value is 0.
yading@10 7257
yading@10 7258 =item B<pattern_type>
yading@10 7259
yading@10 7260 Select the pattern type used to interpret the provided filename.
yading@10 7261
yading@10 7262 I<pattern_type> accepts one of the following values.
yading@10 7263
yading@10 7264 =over 4
yading@10 7265
yading@10 7266
yading@10 7267 =item B<sequence>
yading@10 7268
yading@10 7269 Select a sequence pattern type, used to specify a sequence of files
yading@10 7270 indexed by sequential numbers.
yading@10 7271
yading@10 7272 A sequence pattern may contain the string "%d" or "%0I<N>d", which
yading@10 7273 specifies the position of the characters representing a sequential
yading@10 7274 number in each filename matched by the pattern. If the form
yading@10 7275 "%d0I<N>d" is used, the string representing the number in each
yading@10 7276 filename is 0-padded and I<N> is the total number of 0-padded
yading@10 7277 digits representing the number. The literal character '%' can be
yading@10 7278 specified in the pattern with the string "%%".
yading@10 7279
yading@10 7280 If the sequence pattern contains "%d" or "%0I<N>d", the first filename of
yading@10 7281 the file list specified by the pattern must contain a number
yading@10 7282 inclusively contained between I<start_number> and
yading@10 7283 I<start_number>+I<start_number_range>-1, and all the following
yading@10 7284 numbers must be sequential.
yading@10 7285
yading@10 7286 For example the pattern "img-%03d.bmp" will match a sequence of
yading@10 7287 filenames of the form F<img-001.bmp>, F<img-002.bmp>, ...,
yading@10 7288 F<img-010.bmp>, etc.; the pattern "i%%m%%g-%d.jpg" will match a
yading@10 7289 sequence of filenames of the form F<i%m%g-1.jpg>,
yading@10 7290 F<i%m%g-2.jpg>, ..., F<i%m%g-10.jpg>, etc.
yading@10 7291
yading@10 7292 Note that the pattern must not necessarily contain "%d" or
yading@10 7293 "%0I<N>d", for example to convert a single image file
yading@10 7294 F<img.jpeg> you can employ the command:
yading@10 7295
yading@10 7296 ffmpeg -i img.jpeg img.png
yading@10 7297
yading@10 7298
yading@10 7299
yading@10 7300 =item B<glob>
yading@10 7301
yading@10 7302 Select a glob wildcard pattern type.
yading@10 7303
yading@10 7304 The pattern is interpreted like a C<glob()> pattern. This is only
yading@10 7305 selectable if libavformat was compiled with globbing support.
yading@10 7306
yading@10 7307
yading@10 7308 =item B<glob_sequence> I<(deprecated, will be removed)>
yading@10 7309
yading@10 7310 Select a mixed glob wildcard/sequence pattern.
yading@10 7311
yading@10 7312 If your version of libavformat was compiled with globbing support, and
yading@10 7313 the provided pattern contains at least one glob meta character among
yading@10 7314 C<%*?[]{}> that is preceded by an unescaped "%", the pattern is
yading@10 7315 interpreted like a C<glob()> pattern, otherwise it is interpreted
yading@10 7316 like a sequence pattern.
yading@10 7317
yading@10 7318 All glob special characters C<%*?[]{}> must be prefixed
yading@10 7319 with "%". To escape a literal "%" you shall use "%%".
yading@10 7320
yading@10 7321 For example the pattern C<foo-%*.jpeg> will match all the
yading@10 7322 filenames prefixed by "foo-" and terminating with ".jpeg", and
yading@10 7323 C<foo-%?%?%?.jpeg> will match all the filenames prefixed with
yading@10 7324 "foo-", followed by a sequence of three characters, and terminating
yading@10 7325 with ".jpeg".
yading@10 7326
yading@10 7327 This pattern type is deprecated in favor of I<glob> and
yading@10 7328 I<sequence>.
yading@10 7329
yading@10 7330 =back
yading@10 7331
yading@10 7332
yading@10 7333 Default value is I<glob_sequence>.
yading@10 7334
yading@10 7335 =item B<pixel_format>
yading@10 7336
yading@10 7337 Set the pixel format of the images to read. If not specified the pixel
yading@10 7338 format is guessed from the first image file in the sequence.
yading@10 7339
yading@10 7340 =item B<start_number>
yading@10 7341
yading@10 7342 Set the index of the file matched by the image file pattern to start
yading@10 7343 to read from. Default value is 0.
yading@10 7344
yading@10 7345 =item B<start_number_range>
yading@10 7346
yading@10 7347 Set the index interval range to check when looking for the first image
yading@10 7348 file in the sequence, starting from I<start_number>. Default value
yading@10 7349 is 5.
yading@10 7350
yading@10 7351 =item B<video_size>
yading@10 7352
yading@10 7353 Set the video size of the images to read. If not specified the video
yading@10 7354 size is guessed from the first image file in the sequence.
yading@10 7355
yading@10 7356 =back
yading@10 7357
yading@10 7358
yading@10 7359
yading@10 7360 =head3 Examples
yading@10 7361
yading@10 7362
yading@10 7363
yading@10 7364 =over 4
yading@10 7365
yading@10 7366
yading@10 7367 =item *
yading@10 7368
yading@10 7369 Use B<ffmpeg> for creating a video from the images in the file
yading@10 7370 sequence F<img-001.jpeg>, F<img-002.jpeg>, ..., assuming an
yading@10 7371 input frame rate of 10 frames per second:
yading@10 7372
yading@10 7373 ffmpeg -i 'img-%03d.jpeg' -r 10 out.mkv
yading@10 7374
yading@10 7375
yading@10 7376
yading@10 7377 =item *
yading@10 7378
yading@10 7379 As above, but start by reading from a file with index 100 in the sequence:
yading@10 7380
yading@10 7381 ffmpeg -start_number 100 -i 'img-%03d.jpeg' -r 10 out.mkv
yading@10 7382
yading@10 7383
yading@10 7384
yading@10 7385 =item *
yading@10 7386
yading@10 7387 Read images matching the "*.png" glob pattern , that is all the files
yading@10 7388 terminating with the ".png" suffix:
yading@10 7389
yading@10 7390 ffmpeg -pattern_type glob -i "*.png" -r 10 out.mkv
yading@10 7391
yading@10 7392
yading@10 7393 =back
yading@10 7394
yading@10 7395
yading@10 7396
yading@10 7397 =head2 rawvideo
yading@10 7398
yading@10 7399
yading@10 7400 Raw video demuxer.
yading@10 7401
yading@10 7402 This demuxer allows to read raw video data. Since there is no header
yading@10 7403 specifying the assumed video parameters, the user must specify them
yading@10 7404 in order to be able to decode the data correctly.
yading@10 7405
yading@10 7406 This demuxer accepts the following options:
yading@10 7407
yading@10 7408 =over 4
yading@10 7409
yading@10 7410
yading@10 7411
yading@10 7412 =item B<framerate>
yading@10 7413
yading@10 7414 Set input video frame rate. Default value is 25.
yading@10 7415
yading@10 7416
yading@10 7417 =item B<pixel_format>
yading@10 7418
yading@10 7419 Set the input video pixel format. Default value is C<yuv420p>.
yading@10 7420
yading@10 7421
yading@10 7422 =item B<video_size>
yading@10 7423
yading@10 7424 Set the input video size. This value must be specified explicitly.
yading@10 7425
yading@10 7426 =back
yading@10 7427
yading@10 7428
yading@10 7429 For example to read a rawvideo file F<input.raw> with
yading@10 7430 B<ffplay>, assuming a pixel format of C<rgb24>, a video
yading@10 7431 size of C<320x240>, and a frame rate of 10 images per second, use
yading@10 7432 the command:
yading@10 7433
yading@10 7434 ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
yading@10 7435
yading@10 7436
yading@10 7437
yading@10 7438 =head2 sbg
yading@10 7439
yading@10 7440
yading@10 7441 SBaGen script demuxer.
yading@10 7442
yading@10 7443 This demuxer reads the script language used by SBaGen
yading@10 7444 E<lt>B<http://uazu.net/sbagen/>E<gt> to generate binaural beats sessions. A SBG
yading@10 7445 script looks like that:
yading@10 7446
yading@10 7447 -SE
yading@10 7448 a: 300-2.5/3 440+4.5/0
yading@10 7449 b: 300-2.5/0 440+4.5/3
yading@10 7450 off: -
yading@10 7451 NOW == a
yading@10 7452 +0:07:00 == b
yading@10 7453 +0:14:00 == a
yading@10 7454 +0:21:00 == b
yading@10 7455 +0:30:00 off
yading@10 7456
yading@10 7457
yading@10 7458 A SBG script can mix absolute and relative timestamps. If the script uses
yading@10 7459 either only absolute timestamps (including the script start time) or only
yading@10 7460 relative ones, then its layout is fixed, and the conversion is
yading@10 7461 straightforward. On the other hand, if the script mixes both kind of
yading@10 7462 timestamps, then the I<NOW> reference for relative timestamps will be
yading@10 7463 taken from the current time of day at the time the script is read, and the
yading@10 7464 script layout will be frozen according to that reference. That means that if
yading@10 7465 the script is directly played, the actual times will match the absolute
yading@10 7466 timestamps up to the sound controller's clock accuracy, but if the user
yading@10 7467 somehow pauses the playback or seeks, all times will be shifted accordingly.
yading@10 7468
yading@10 7469
yading@10 7470 =head2 tedcaptions
yading@10 7471
yading@10 7472
yading@10 7473 JSON captions used for E<lt>B<http://www.ted.com/>E<gt>.
yading@10 7474
yading@10 7475 TED does not provide links to the captions, but they can be guessed from the
yading@10 7476 page. The file F<tools/bookmarklets.html> from the FFmpeg source tree
yading@10 7477 contains a bookmarklet to expose them.
yading@10 7478
yading@10 7479 This demuxer accepts the following option:
yading@10 7480
yading@10 7481 =over 4
yading@10 7482
yading@10 7483
yading@10 7484 =item B<start_time>
yading@10 7485
yading@10 7486 Set the start time of the TED talk, in milliseconds. The default is 15000
yading@10 7487 (15s). It is used to sync the captions with the downloadable videos, because
yading@10 7488 they include a 15s intro.
yading@10 7489
yading@10 7490 =back
yading@10 7491
yading@10 7492
yading@10 7493 Example: convert the captions to a format most players understand:
yading@10 7494
yading@10 7495 ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
yading@10 7496
yading@10 7497
yading@10 7498
yading@10 7499 =head1 MUXERS
yading@10 7500
yading@10 7501
yading@10 7502 Muxers are configured elements in FFmpeg which allow writing
yading@10 7503 multimedia streams to a particular type of file.
yading@10 7504
yading@10 7505 When you configure your FFmpeg build, all the supported muxers
yading@10 7506 are enabled by default. You can list all available muxers using the
yading@10 7507 configure option C<--list-muxers>.
yading@10 7508
yading@10 7509 You can disable all the muxers with the configure option
yading@10 7510 C<--disable-muxers> and selectively enable / disable single muxers
yading@10 7511 with the options C<--enable-muxer=I<MUXER>> /
yading@10 7512 C<--disable-muxer=I<MUXER>>.
yading@10 7513
yading@10 7514 The option C<-formats> of the ff* tools will display the list of
yading@10 7515 enabled muxers.
yading@10 7516
yading@10 7517 A description of some of the currently available muxers follows.
yading@10 7518
yading@10 7519
yading@10 7520
yading@10 7521 =head2 crc
yading@10 7522
yading@10 7523
yading@10 7524 CRC (Cyclic Redundancy Check) testing format.
yading@10 7525
yading@10 7526 This muxer computes and prints the Adler-32 CRC of all the input audio
yading@10 7527 and video frames. By default audio frames are converted to signed
yading@10 7528 16-bit raw audio and video frames to raw video before computing the
yading@10 7529 CRC.
yading@10 7530
yading@10 7531 The output of the muxer consists of a single line of the form:
yading@10 7532 CRC=0xI<CRC>, where I<CRC> is a hexadecimal number 0-padded to
yading@10 7533 8 digits containing the CRC for all the decoded input frames.
yading@10 7534
yading@10 7535 For example to compute the CRC of the input, and store it in the file
yading@10 7536 F<out.crc>:
yading@10 7537
yading@10 7538 ffmpeg -i INPUT -f crc out.crc
yading@10 7539
yading@10 7540
yading@10 7541 You can print the CRC to stdout with the command:
yading@10 7542
yading@10 7543 ffmpeg -i INPUT -f crc -
yading@10 7544
yading@10 7545
yading@10 7546 You can select the output format of each frame with B<ffmpeg> by
yading@10 7547 specifying the audio and video codec and format. For example to
yading@10 7548 compute the CRC of the input audio converted to PCM unsigned 8-bit
yading@10 7549 and the input video converted to MPEG-2 video, use the command:
yading@10 7550
yading@10 7551 ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
yading@10 7552
yading@10 7553
yading@10 7554 See also the framecrc muxer.
yading@10 7555
yading@10 7556
yading@10 7557
yading@10 7558 =head2 framecrc
yading@10 7559
yading@10 7560
yading@10 7561 Per-packet CRC (Cyclic Redundancy Check) testing format.
yading@10 7562
yading@10 7563 This muxer computes and prints the Adler-32 CRC for each audio
yading@10 7564 and video packet. By default audio frames are converted to signed
yading@10 7565 16-bit raw audio and video frames to raw video before computing the
yading@10 7566 CRC.
yading@10 7567
yading@10 7568 The output of the muxer consists of a line for each audio and video
yading@10 7569 packet of the form:
yading@10 7570
yading@10 7571 <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, 0x<CRC>
yading@10 7572
yading@10 7573
yading@10 7574 I<CRC> is a hexadecimal number 0-padded to 8 digits containing the
yading@10 7575 CRC of the packet.
yading@10 7576
yading@10 7577 For example to compute the CRC of the audio and video frames in
yading@10 7578 F<INPUT>, converted to raw audio and video packets, and store it
yading@10 7579 in the file F<out.crc>:
yading@10 7580
yading@10 7581 ffmpeg -i INPUT -f framecrc out.crc
yading@10 7582
yading@10 7583
yading@10 7584 To print the information to stdout, use the command:
yading@10 7585
yading@10 7586 ffmpeg -i INPUT -f framecrc -
yading@10 7587
yading@10 7588
yading@10 7589 With B<ffmpeg>, you can select the output format to which the
yading@10 7590 audio and video frames are encoded before computing the CRC for each
yading@10 7591 packet by specifying the audio and video codec. For example, to
yading@10 7592 compute the CRC of each decoded input audio frame converted to PCM
yading@10 7593 unsigned 8-bit and of each decoded input video frame converted to
yading@10 7594 MPEG-2 video, use the command:
yading@10 7595
yading@10 7596 ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
yading@10 7597
yading@10 7598
yading@10 7599 See also the crc muxer.
yading@10 7600
yading@10 7601
yading@10 7602
yading@10 7603 =head2 framemd5
yading@10 7604
yading@10 7605
yading@10 7606 Per-packet MD5 testing format.
yading@10 7607
yading@10 7608 This muxer computes and prints the MD5 hash for each audio
yading@10 7609 and video packet. By default audio frames are converted to signed
yading@10 7610 16-bit raw audio and video frames to raw video before computing the
yading@10 7611 hash.
yading@10 7612
yading@10 7613 The output of the muxer consists of a line for each audio and video
yading@10 7614 packet of the form:
yading@10 7615
yading@10 7616 <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, <MD5>
yading@10 7617
yading@10 7618
yading@10 7619 I<MD5> is a hexadecimal number representing the computed MD5 hash
yading@10 7620 for the packet.
yading@10 7621
yading@10 7622 For example to compute the MD5 of the audio and video frames in
yading@10 7623 F<INPUT>, converted to raw audio and video packets, and store it
yading@10 7624 in the file F<out.md5>:
yading@10 7625
yading@10 7626 ffmpeg -i INPUT -f framemd5 out.md5
yading@10 7627
yading@10 7628
yading@10 7629 To print the information to stdout, use the command:
yading@10 7630
yading@10 7631 ffmpeg -i INPUT -f framemd5 -
yading@10 7632
yading@10 7633
yading@10 7634 See also the md5 muxer.
yading@10 7635
yading@10 7636
yading@10 7637
yading@10 7638 =head2 hls
yading@10 7639
yading@10 7640
yading@10 7641 Apple HTTP Live Streaming muxer that segments MPEG-TS according to
yading@10 7642 the HTTP Live Streaming specification.
yading@10 7643
yading@10 7644 It creates a playlist file and numbered segment files. The output
yading@10 7645 filename specifies the playlist filename; the segment filenames
yading@10 7646 receive the same basename as the playlist, a sequential number and
yading@10 7647 a .ts extension.
yading@10 7648
yading@10 7649
yading@10 7650 ffmpeg -i in.nut out.m3u8
yading@10 7651
yading@10 7652
yading@10 7653
yading@10 7654 =over 4
yading@10 7655
yading@10 7656
yading@10 7657 =item B<-hls_time> I<seconds>
yading@10 7658
yading@10 7659 Set the segment length in seconds.
yading@10 7660
yading@10 7661 =item B<-hls_list_size> I<size>
yading@10 7662
yading@10 7663 Set the maximum number of playlist entries.
yading@10 7664
yading@10 7665 =item B<-hls_wrap> I<wrap>
yading@10 7666
yading@10 7667 Set the number after which index wraps.
yading@10 7668
yading@10 7669 =item B<-start_number> I<number>
yading@10 7670
yading@10 7671 Start the sequence from I<number>.
yading@10 7672
yading@10 7673 =back
yading@10 7674
yading@10 7675
yading@10 7676
yading@10 7677
yading@10 7678 =head2 ico
yading@10 7679
yading@10 7680
yading@10 7681 ICO file muxer.
yading@10 7682
yading@10 7683 Microsoft's icon file format (ICO) has some strict limitations that should be noted:
yading@10 7684
yading@10 7685
yading@10 7686 =over 4
yading@10 7687
yading@10 7688
yading@10 7689 =item *
yading@10 7690
yading@10 7691 Size cannot exceed 256 pixels in any dimension
yading@10 7692
yading@10 7693
yading@10 7694 =item *
yading@10 7695
yading@10 7696 Only BMP and PNG images can be stored
yading@10 7697
yading@10 7698
yading@10 7699 =item *
yading@10 7700
yading@10 7701 If a BMP image is used, it must be one of the following pixel formats:
yading@10 7702
yading@10 7703 BMP Bit Depth FFmpeg Pixel Format
yading@10 7704 1bit pal8
yading@10 7705 4bit pal8
yading@10 7706 8bit pal8
yading@10 7707 16bit rgb555le
yading@10 7708 24bit bgr24
yading@10 7709 32bit bgra
yading@10 7710
yading@10 7711
yading@10 7712
yading@10 7713 =item *
yading@10 7714
yading@10 7715 If a BMP image is used, it must use the BITMAPINFOHEADER DIB header
yading@10 7716
yading@10 7717
yading@10 7718 =item *
yading@10 7719
yading@10 7720 If a PNG image is used, it must use the rgba pixel format
yading@10 7721
yading@10 7722 =back
yading@10 7723
yading@10 7724
yading@10 7725
yading@10 7726
yading@10 7727 =head2 image2
yading@10 7728
yading@10 7729
yading@10 7730 Image file muxer.
yading@10 7731
yading@10 7732 The image file muxer writes video frames to image files.
yading@10 7733
yading@10 7734 The output filenames are specified by a pattern, which can be used to
yading@10 7735 produce sequentially numbered series of files.
yading@10 7736 The pattern may contain the string "%d" or "%0I<N>d", this string
yading@10 7737 specifies the position of the characters representing a numbering in
yading@10 7738 the filenames. If the form "%0I<N>d" is used, the string
yading@10 7739 representing the number in each filename is 0-padded to I<N>
yading@10 7740 digits. The literal character '%' can be specified in the pattern with
yading@10 7741 the string "%%".
yading@10 7742
yading@10 7743 If the pattern contains "%d" or "%0I<N>d", the first filename of
yading@10 7744 the file list specified will contain the number 1, all the following
yading@10 7745 numbers will be sequential.
yading@10 7746
yading@10 7747 The pattern may contain a suffix which is used to automatically
yading@10 7748 determine the format of the image files to write.
yading@10 7749
yading@10 7750 For example the pattern "img-%03d.bmp" will specify a sequence of
yading@10 7751 filenames of the form F<img-001.bmp>, F<img-002.bmp>, ...,
yading@10 7752 F<img-010.bmp>, etc.
yading@10 7753 The pattern "img%%-%d.jpg" will specify a sequence of filenames of the
yading@10 7754 form F<img%-1.jpg>, F<img%-2.jpg>, ..., F<img%-10.jpg>,
yading@10 7755 etc.
yading@10 7756
yading@10 7757 The following example shows how to use B<ffmpeg> for creating a
yading@10 7758 sequence of files F<img-001.jpeg>, F<img-002.jpeg>, ...,
yading@10 7759 taking one image every second from the input video:
yading@10 7760
yading@10 7761 ffmpeg -i in.avi -vsync 1 -r 1 -f image2 'img-%03d.jpeg'
yading@10 7762
yading@10 7763
yading@10 7764 Note that with B<ffmpeg>, if the format is not specified with the
yading@10 7765 C<-f> option and the output filename specifies an image file
yading@10 7766 format, the image2 muxer is automatically selected, so the previous
yading@10 7767 command can be written as:
yading@10 7768
yading@10 7769 ffmpeg -i in.avi -vsync 1 -r 1 'img-%03d.jpeg'
yading@10 7770
yading@10 7771
yading@10 7772 Note also that the pattern must not necessarily contain "%d" or
yading@10 7773 "%0I<N>d", for example to create a single image file
yading@10 7774 F<img.jpeg> from the input video you can employ the command:
yading@10 7775
yading@10 7776 ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
yading@10 7777
yading@10 7778
yading@10 7779
yading@10 7780 =over 4
yading@10 7781
yading@10 7782
yading@10 7783 =item B<start_number> I<number>
yading@10 7784
yading@10 7785 Start the sequence from I<number>. Default value is 1. Must be a
yading@10 7786 positive number.
yading@10 7787
yading@10 7788
yading@10 7789 =item B<-update> I<number>
yading@10 7790
yading@10 7791 If I<number> is nonzero, the filename will always be interpreted as just a
yading@10 7792 filename, not a pattern, and this file will be continuously overwritten with new
yading@10 7793 images.
yading@10 7794
yading@10 7795
yading@10 7796 =back
yading@10 7797
yading@10 7798
yading@10 7799 The image muxer supports the .Y.U.V image file format. This format is
yading@10 7800 special in that that each image frame consists of three files, for
yading@10 7801 each of the YUV420P components. To read or write this image file format,
yading@10 7802 specify the name of the '.Y' file. The muxer will automatically open the
yading@10 7803 '.U' and '.V' files as required.
yading@10 7804
yading@10 7805
yading@10 7806
yading@10 7807 =head2 md5
yading@10 7808
yading@10 7809
yading@10 7810 MD5 testing format.
yading@10 7811
yading@10 7812 This muxer computes and prints the MD5 hash of all the input audio
yading@10 7813 and video frames. By default audio frames are converted to signed
yading@10 7814 16-bit raw audio and video frames to raw video before computing the
yading@10 7815 hash.
yading@10 7816
yading@10 7817 The output of the muxer consists of a single line of the form:
yading@10 7818 MD5=I<MD5>, where I<MD5> is a hexadecimal number representing
yading@10 7819 the computed MD5 hash.
yading@10 7820
yading@10 7821 For example to compute the MD5 hash of the input converted to raw
yading@10 7822 audio and video, and store it in the file F<out.md5>:
yading@10 7823
yading@10 7824 ffmpeg -i INPUT -f md5 out.md5
yading@10 7825
yading@10 7826
yading@10 7827 You can print the MD5 to stdout with the command:
yading@10 7828
yading@10 7829 ffmpeg -i INPUT -f md5 -
yading@10 7830
yading@10 7831
yading@10 7832 See also the framemd5 muxer.
yading@10 7833
yading@10 7834
yading@10 7835 =head2 MOV/MP4/ISMV
yading@10 7836
yading@10 7837
yading@10 7838 The mov/mp4/ismv muxer supports fragmentation. Normally, a MOV/MP4
yading@10 7839 file has all the metadata about all packets stored in one location
yading@10 7840 (written at the end of the file, it can be moved to the start for
yading@10 7841 better playback by adding I<faststart> to the I<movflags>, or
yading@10 7842 using the B<qt-faststart> tool). A fragmented
yading@10 7843 file consists of a number of fragments, where packets and metadata
yading@10 7844 about these packets are stored together. Writing a fragmented
yading@10 7845 file has the advantage that the file is decodable even if the
yading@10 7846 writing is interrupted (while a normal MOV/MP4 is undecodable if
yading@10 7847 it is not properly finished), and it requires less memory when writing
yading@10 7848 very long files (since writing normal MOV/MP4 files stores info about
yading@10 7849 every single packet in memory until the file is closed). The downside
yading@10 7850 is that it is less compatible with other applications.
yading@10 7851
yading@10 7852 Fragmentation is enabled by setting one of the AVOptions that define
yading@10 7853 how to cut the file into fragments:
yading@10 7854
yading@10 7855
yading@10 7856 =over 4
yading@10 7857
yading@10 7858
yading@10 7859 =item B<-moov_size> I<bytes>
yading@10 7860
yading@10 7861 Reserves space for the moov atom at the beginning of the file instead of placing the
yading@10 7862 moov atom at the end. If the space reserved is insufficient, muxing will fail.
yading@10 7863
yading@10 7864 =item B<-movflags frag_keyframe>
yading@10 7865
yading@10 7866 Start a new fragment at each video keyframe.
yading@10 7867
yading@10 7868 =item B<-frag_duration> I<duration>
yading@10 7869
yading@10 7870 Create fragments that are I<duration> microseconds long.
yading@10 7871
yading@10 7872 =item B<-frag_size> I<size>
yading@10 7873
yading@10 7874 Create fragments that contain up to I<size> bytes of payload data.
yading@10 7875
yading@10 7876 =item B<-movflags frag_custom>
yading@10 7877
yading@10 7878 Allow the caller to manually choose when to cut fragments, by
yading@10 7879 calling C<av_write_frame(ctx, NULL)> to write a fragment with
yading@10 7880 the packets written so far. (This is only useful with other
yading@10 7881 applications integrating libavformat, not from B<ffmpeg>.)
yading@10 7882
yading@10 7883 =item B<-min_frag_duration> I<duration>
yading@10 7884
yading@10 7885 Don't create fragments that are shorter than I<duration> microseconds long.
yading@10 7886
yading@10 7887 =back
yading@10 7888
yading@10 7889
yading@10 7890 If more than one condition is specified, fragments are cut when
yading@10 7891 one of the specified conditions is fulfilled. The exception to this is
yading@10 7892 C<-min_frag_duration>, which has to be fulfilled for any of the other
yading@10 7893 conditions to apply.
yading@10 7894
yading@10 7895 Additionally, the way the output file is written can be adjusted
yading@10 7896 through a few other options:
yading@10 7897
yading@10 7898
yading@10 7899 =over 4
yading@10 7900
yading@10 7901
yading@10 7902 =item B<-movflags empty_moov>
yading@10 7903
yading@10 7904 Write an initial moov atom directly at the start of the file, without
yading@10 7905 describing any samples in it. Generally, an mdat/moov pair is written
yading@10 7906 at the start of the file, as a normal MOV/MP4 file, containing only
yading@10 7907 a short portion of the file. With this option set, there is no initial
yading@10 7908 mdat atom, and the moov atom only describes the tracks but has
yading@10 7909 a zero duration.
yading@10 7910
yading@10 7911 Files written with this option set do not work in QuickTime.
yading@10 7912 This option is implicitly set when writing ismv (Smooth Streaming) files.
yading@10 7913
yading@10 7914 =item B<-movflags separate_moof>
yading@10 7915
yading@10 7916 Write a separate moof (movie fragment) atom for each track. Normally,
yading@10 7917 packets for all tracks are written in a moof atom (which is slightly
yading@10 7918 more efficient), but with this option set, the muxer writes one moof/mdat
yading@10 7919 pair for each track, making it easier to separate tracks.
yading@10 7920
yading@10 7921 This option is implicitly set when writing ismv (Smooth Streaming) files.
yading@10 7922
yading@10 7923 =item B<-movflags faststart>
yading@10 7924
yading@10 7925 Run a second pass moving the moov atom on top of the file. This
yading@10 7926 operation can take a while, and will not work in various situations such
yading@10 7927 as fragmented output, thus it is not enabled by default.
yading@10 7928
yading@10 7929 =item B<-movflags rtphint>
yading@10 7930
yading@10 7931 Add RTP hinting tracks to the output file.
yading@10 7932
yading@10 7933 =back
yading@10 7934
yading@10 7935
yading@10 7936 Smooth Streaming content can be pushed in real time to a publishing
yading@10 7937 point on IIS with this muxer. Example:
yading@10 7938
yading@10 7939 ffmpeg -re <<normal input/transcoding options>> -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
yading@10 7940
yading@10 7941
yading@10 7942
yading@10 7943 =head2 mpegts
yading@10 7944
yading@10 7945
yading@10 7946 MPEG transport stream muxer.
yading@10 7947
yading@10 7948 This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
yading@10 7949
yading@10 7950 The muxer options are:
yading@10 7951
yading@10 7952
yading@10 7953 =over 4
yading@10 7954
yading@10 7955
yading@10 7956 =item B<-mpegts_original_network_id> I<number>
yading@10 7957
yading@10 7958 Set the original_network_id (default 0x0001). This is unique identifier
yading@10 7959 of a network in DVB. Its main use is in the unique identification of a
yading@10 7960 service through the path Original_Network_ID, Transport_Stream_ID.
yading@10 7961
yading@10 7962 =item B<-mpegts_transport_stream_id> I<number>
yading@10 7963
yading@10 7964 Set the transport_stream_id (default 0x0001). This identifies a
yading@10 7965 transponder in DVB.
yading@10 7966
yading@10 7967 =item B<-mpegts_service_id> I<number>
yading@10 7968
yading@10 7969 Set the service_id (default 0x0001) also known as program in DVB.
yading@10 7970
yading@10 7971 =item B<-mpegts_pmt_start_pid> I<number>
yading@10 7972
yading@10 7973 Set the first PID for PMT (default 0x1000, max 0x1f00).
yading@10 7974
yading@10 7975 =item B<-mpegts_start_pid> I<number>
yading@10 7976
yading@10 7977 Set the first PID for data packets (default 0x0100, max 0x0f00).
yading@10 7978
yading@10 7979 =back
yading@10 7980
yading@10 7981
yading@10 7982 The recognized metadata settings in mpegts muxer are C<service_provider>
yading@10 7983 and C<service_name>. If they are not set the default for
yading@10 7984 C<service_provider> is "FFmpeg" and the default for
yading@10 7985 C<service_name> is "Service01".
yading@10 7986
yading@10 7987
yading@10 7988 ffmpeg -i file.mpg -c copy \
yading@10 7989 -mpegts_original_network_id 0x1122 \
yading@10 7990 -mpegts_transport_stream_id 0x3344 \
yading@10 7991 -mpegts_service_id 0x5566 \
yading@10 7992 -mpegts_pmt_start_pid 0x1500 \
yading@10 7993 -mpegts_start_pid 0x150 \
yading@10 7994 -metadata service_provider="Some provider" \
yading@10 7995 -metadata service_name="Some Channel" \
yading@10 7996 -y out.ts
yading@10 7997
yading@10 7998
yading@10 7999
yading@10 8000 =head2 null
yading@10 8001
yading@10 8002
yading@10 8003 Null muxer.
yading@10 8004
yading@10 8005 This muxer does not generate any output file, it is mainly useful for
yading@10 8006 testing or benchmarking purposes.
yading@10 8007
yading@10 8008 For example to benchmark decoding with B<ffmpeg> you can use the
yading@10 8009 command:
yading@10 8010
yading@10 8011 ffmpeg -benchmark -i INPUT -f null out.null
yading@10 8012
yading@10 8013
yading@10 8014 Note that the above command does not read or write the F<out.null>
yading@10 8015 file, but specifying the output file is required by the B<ffmpeg>
yading@10 8016 syntax.
yading@10 8017
yading@10 8018 Alternatively you can write the command as:
yading@10 8019
yading@10 8020 ffmpeg -benchmark -i INPUT -f null -
yading@10 8021
yading@10 8022
yading@10 8023
yading@10 8024 =head2 matroska
yading@10 8025
yading@10 8026
yading@10 8027 Matroska container muxer.
yading@10 8028
yading@10 8029 This muxer implements the matroska and webm container specs.
yading@10 8030
yading@10 8031 The recognized metadata settings in this muxer are:
yading@10 8032
yading@10 8033
yading@10 8034 =over 4
yading@10 8035
yading@10 8036
yading@10 8037
yading@10 8038 =item B<title=>I<title name>
yading@10 8039
yading@10 8040 Name provided to a single track
yading@10 8041
yading@10 8042 =back
yading@10 8043
yading@10 8044
yading@10 8045
yading@10 8046 =over 4
yading@10 8047
yading@10 8048
yading@10 8049
yading@10 8050 =item B<language=>I<language name>
yading@10 8051
yading@10 8052 Specifies the language of the track in the Matroska languages form
yading@10 8053
yading@10 8054 =back
yading@10 8055
yading@10 8056
yading@10 8057
yading@10 8058 =over 4
yading@10 8059
yading@10 8060
yading@10 8061
yading@10 8062 =item B<stereo_mode=>I<mode>
yading@10 8063
yading@10 8064 Stereo 3D video layout of two views in a single video track
yading@10 8065
yading@10 8066 =over 4
yading@10 8067
yading@10 8068
yading@10 8069 =item B<mono>
yading@10 8070
yading@10 8071 video is not stereo
yading@10 8072
yading@10 8073 =item B<left_right>
yading@10 8074
yading@10 8075 Both views are arranged side by side, Left-eye view is on the left
yading@10 8076
yading@10 8077 =item B<bottom_top>
yading@10 8078
yading@10 8079 Both views are arranged in top-bottom orientation, Left-eye view is at bottom
yading@10 8080
yading@10 8081 =item B<top_bottom>
yading@10 8082
yading@10 8083 Both views are arranged in top-bottom orientation, Left-eye view is on top
yading@10 8084
yading@10 8085 =item B<checkerboard_rl>
yading@10 8086
yading@10 8087 Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
yading@10 8088
yading@10 8089 =item B<checkerboard_lr>
yading@10 8090
yading@10 8091 Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
yading@10 8092
yading@10 8093 =item B<row_interleaved_rl>
yading@10 8094
yading@10 8095 Each view is constituted by a row based interleaving, Right-eye view is first row
yading@10 8096
yading@10 8097 =item B<row_interleaved_lr>
yading@10 8098
yading@10 8099 Each view is constituted by a row based interleaving, Left-eye view is first row
yading@10 8100
yading@10 8101 =item B<col_interleaved_rl>
yading@10 8102
yading@10 8103 Both views are arranged in a column based interleaving manner, Right-eye view is first column
yading@10 8104
yading@10 8105 =item B<col_interleaved_lr>
yading@10 8106
yading@10 8107 Both views are arranged in a column based interleaving manner, Left-eye view is first column
yading@10 8108
yading@10 8109 =item B<anaglyph_cyan_red>
yading@10 8110
yading@10 8111 All frames are in anaglyph format viewable through red-cyan filters
yading@10 8112
yading@10 8113 =item B<right_left>
yading@10 8114
yading@10 8115 Both views are arranged side by side, Right-eye view is on the left
yading@10 8116
yading@10 8117 =item B<anaglyph_green_magenta>
yading@10 8118
yading@10 8119 All frames are in anaglyph format viewable through green-magenta filters
yading@10 8120
yading@10 8121 =item B<block_lr>
yading@10 8122
yading@10 8123 Both eyes laced in one Block, Left-eye view is first
yading@10 8124
yading@10 8125 =item B<block_rl>
yading@10 8126
yading@10 8127 Both eyes laced in one Block, Right-eye view is first
yading@10 8128
yading@10 8129 =back
yading@10 8130
yading@10 8131
yading@10 8132 =back
yading@10 8133
yading@10 8134
yading@10 8135 For example a 3D WebM clip can be created using the following command line:
yading@10 8136
yading@10 8137 ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
yading@10 8138
yading@10 8139
yading@10 8140
yading@10 8141 =head2 segment, stream_segment, ssegment
yading@10 8142
yading@10 8143
yading@10 8144 Basic stream segmenter.
yading@10 8145
yading@10 8146 The segmenter muxer outputs streams to a number of separate files of nearly
yading@10 8147 fixed duration. Output filename pattern can be set in a fashion similar to
yading@10 8148 image2.
yading@10 8149
yading@10 8150 C<stream_segment> is a variant of the muxer used to write to
yading@10 8151 streaming output formats, i.e. which do not require global headers,
yading@10 8152 and is recommended for outputting e.g. to MPEG transport stream segments.
yading@10 8153 C<ssegment> is a shorter alias for C<stream_segment>.
yading@10 8154
yading@10 8155 Every segment starts with a keyframe of the selected reference stream,
yading@10 8156 which is set through the B<reference_stream> option.
yading@10 8157
yading@10 8158 Note that if you want accurate splitting for a video file, you need to
yading@10 8159 make the input key frames correspond to the exact splitting times
yading@10 8160 expected by the segmenter, or the segment muxer will start the new
yading@10 8161 segment with the key frame found next after the specified start
yading@10 8162 time.
yading@10 8163
yading@10 8164 The segment muxer works best with a single constant frame rate video.
yading@10 8165
yading@10 8166 Optionally it can generate a list of the created segments, by setting
yading@10 8167 the option I<segment_list>. The list type is specified by the
yading@10 8168 I<segment_list_type> option.
yading@10 8169
yading@10 8170 The segment muxer supports the following options:
yading@10 8171
yading@10 8172
yading@10 8173 =over 4
yading@10 8174
yading@10 8175
yading@10 8176 =item B<reference_stream> I<specifier>
yading@10 8177
yading@10 8178 Set the reference stream, as specified by the string I<specifier>.
yading@10 8179 If I<specifier> is set to C<auto>, the reference is choosen
yading@10 8180 automatically. Otherwise it must be a stream specifier (see the ``Stream
yading@10 8181 specifiers'' chapter in the ffmpeg manual) which specifies the
yading@10 8182 reference stream. The default value is ``auto''.
yading@10 8183
yading@10 8184
yading@10 8185 =item B<segment_format> I<format>
yading@10 8186
yading@10 8187 Override the inner container format, by default it is guessed by the filename
yading@10 8188 extension.
yading@10 8189
yading@10 8190
yading@10 8191 =item B<segment_list> I<name>
yading@10 8192
yading@10 8193 Generate also a listfile named I<name>. If not specified no
yading@10 8194 listfile is generated.
yading@10 8195
yading@10 8196
yading@10 8197 =item B<segment_list_flags> I<flags>
yading@10 8198
yading@10 8199 Set flags affecting the segment list generation.
yading@10 8200
yading@10 8201 It currently supports the following flags:
yading@10 8202
yading@10 8203 =over 4
yading@10 8204
yading@10 8205
yading@10 8206 =item I<cache>
yading@10 8207
yading@10 8208 Allow caching (only affects M3U8 list files).
yading@10 8209
yading@10 8210
yading@10 8211 =item I<live>
yading@10 8212
yading@10 8213 Allow live-friendly file generation.
yading@10 8214
yading@10 8215 =back
yading@10 8216
yading@10 8217
yading@10 8218 Default value is C<cache>.
yading@10 8219
yading@10 8220
yading@10 8221 =item B<segment_list_size> I<size>
yading@10 8222
yading@10 8223 Update the list file so that it contains at most the last I<size>
yading@10 8224 segments. If 0 the list file will contain all the segments. Default
yading@10 8225 value is 0.
yading@10 8226
yading@10 8227
yading@10 8228 =item B<segment_list type> I<type>
yading@10 8229
yading@10 8230 Specify the format for the segment list file.
yading@10 8231
yading@10 8232 The following values are recognized:
yading@10 8233
yading@10 8234 =over 4
yading@10 8235
yading@10 8236
yading@10 8237 =item B<flat>
yading@10 8238
yading@10 8239 Generate a flat list for the created segments, one segment per line.
yading@10 8240
yading@10 8241
yading@10 8242 =item B<csv, ext>
yading@10 8243
yading@10 8244 Generate a list for the created segments, one segment per line,
yading@10 8245 each line matching the format (comma-separated values):
yading@10 8246
yading@10 8247 <segment_filename>,<segment_start_time>,<segment_end_time>
yading@10 8248
yading@10 8249
yading@10 8250 I<segment_filename> is the name of the output file generated by the
yading@10 8251 muxer according to the provided pattern. CSV escaping (according to
yading@10 8252 RFC4180) is applied if required.
yading@10 8253
yading@10 8254 I<segment_start_time> and I<segment_end_time> specify
yading@10 8255 the segment start and end time expressed in seconds.
yading@10 8256
yading@10 8257 A list file with the suffix C<".csv"> or C<".ext"> will
yading@10 8258 auto-select this format.
yading@10 8259
yading@10 8260 C<ext> is deprecated in favor or C<csv>.
yading@10 8261
yading@10 8262
yading@10 8263 =item B<ffconcat>
yading@10 8264
yading@10 8265 Generate an ffconcat file for the created segments. The resulting file
yading@10 8266 can be read using the FFmpeg concat demuxer.
yading@10 8267
yading@10 8268 A list file with the suffix C<".ffcat"> or C<".ffconcat"> will
yading@10 8269 auto-select this format.
yading@10 8270
yading@10 8271
yading@10 8272 =item B<m3u8>
yading@10 8273
yading@10 8274 Generate an extended M3U8 file, version 3, compliant with
yading@10 8275 E<lt>B<http://tools.ietf.org/id/draft-pantos-http-live-streaming>E<gt>.
yading@10 8276
yading@10 8277 A list file with the suffix C<".m3u8"> will auto-select this format.
yading@10 8278
yading@10 8279 =back
yading@10 8280
yading@10 8281
yading@10 8282 If not specified the type is guessed from the list file name suffix.
yading@10 8283
yading@10 8284
yading@10 8285 =item B<segment_time> I<time>
yading@10 8286
yading@10 8287 Set segment duration to I<time>, the value must be a duration
yading@10 8288 specification. Default value is "2". See also the
yading@10 8289 B<segment_times> option.
yading@10 8290
yading@10 8291 Note that splitting may not be accurate, unless you force the
yading@10 8292 reference stream key-frames at the given time. See the introductory
yading@10 8293 notice and the examples below.
yading@10 8294
yading@10 8295
yading@10 8296 =item B<segment_time_delta> I<delta>
yading@10 8297
yading@10 8298 Specify the accuracy time when selecting the start time for a
yading@10 8299 segment, expressed as a duration specification. Default value is "0".
yading@10 8300
yading@10 8301 When delta is specified a key-frame will start a new segment if its
yading@10 8302 PTS satisfies the relation:
yading@10 8303
yading@10 8304 PTS >= start_time - time_delta
yading@10 8305
yading@10 8306
yading@10 8307 This option is useful when splitting video content, which is always
yading@10 8308 split at GOP boundaries, in case a key frame is found just before the
yading@10 8309 specified split time.
yading@10 8310
yading@10 8311 In particular may be used in combination with the F<ffmpeg> option
yading@10 8312 I<force_key_frames>. The key frame times specified by
yading@10 8313 I<force_key_frames> may not be set accurately because of rounding
yading@10 8314 issues, with the consequence that a key frame time may result set just
yading@10 8315 before the specified time. For constant frame rate videos a value of
yading@10 8316 1/2*I<frame_rate> should address the worst case mismatch between
yading@10 8317 the specified time and the time set by I<force_key_frames>.
yading@10 8318
yading@10 8319
yading@10 8320 =item B<segment_times> I<times>
yading@10 8321
yading@10 8322 Specify a list of split points. I<times> contains a list of comma
yading@10 8323 separated duration specifications, in increasing order. See also
yading@10 8324 the B<segment_time> option.
yading@10 8325
yading@10 8326
yading@10 8327 =item B<segment_frames> I<frames>
yading@10 8328
yading@10 8329 Specify a list of split video frame numbers. I<frames> contains a
yading@10 8330 list of comma separated integer numbers, in increasing order.
yading@10 8331
yading@10 8332 This option specifies to start a new segment whenever a reference
yading@10 8333 stream key frame is found and the sequential number (starting from 0)
yading@10 8334 of the frame is greater or equal to the next value in the list.
yading@10 8335
yading@10 8336
yading@10 8337 =item B<segment_wrap> I<limit>
yading@10 8338
yading@10 8339 Wrap around segment index once it reaches I<limit>.
yading@10 8340
yading@10 8341
yading@10 8342 =item B<segment_start_number> I<number>
yading@10 8343
yading@10 8344 Set the sequence number of the first segment. Defaults to C<0>.
yading@10 8345
yading@10 8346
yading@10 8347 =item B<reset_timestamps> I<1|0>
yading@10 8348
yading@10 8349 Reset timestamps at the begin of each segment, so that each segment
yading@10 8350 will start with near-zero timestamps. It is meant to ease the playback
yading@10 8351 of the generated segments. May not work with some combinations of
yading@10 8352 muxers/codecs. It is set to C<0> by default.
yading@10 8353
yading@10 8354 =back
yading@10 8355
yading@10 8356
yading@10 8357
yading@10 8358 =head3 Examples
yading@10 8359
yading@10 8360
yading@10 8361
yading@10 8362 =over 4
yading@10 8363
yading@10 8364
yading@10 8365 =item *
yading@10 8366
yading@10 8367 To remux the content of file F<in.mkv> to a list of segments
yading@10 8368 F<out-000.nut>, F<out-001.nut>, etc., and write the list of
yading@10 8369 generated segments to F<out.list>:
yading@10 8370
yading@10 8371 ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.list out%03d.nut
yading@10 8372
yading@10 8373
yading@10 8374
yading@10 8375 =item *
yading@10 8376
yading@10 8377 As the example above, but segment the input file according to the split
yading@10 8378 points specified by the I<segment_times> option:
yading@10 8379
yading@10 8380 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 8381
yading@10 8382
yading@10 8383
yading@10 8384 =item *
yading@10 8385
yading@10 8386 As the example above, but use the C<ffmpeg> I<force_key_frames>
yading@10 8387 option to force key frames in the input at the specified location, together
yading@10 8388 with the segment option I<segment_time_delta> to account for
yading@10 8389 possible roundings operated when setting key frame times.
yading@10 8390
yading@10 8391 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 8392 -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 8393
yading@10 8394 In order to force key frames on the input file, transcoding is
yading@10 8395 required.
yading@10 8396
yading@10 8397
yading@10 8398 =item *
yading@10 8399
yading@10 8400 Segment the input file by splitting the input file according to the
yading@10 8401 frame numbers sequence specified with the I<segment_frames> option:
yading@10 8402
yading@10 8403 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 8404
yading@10 8405
yading@10 8406
yading@10 8407 =item *
yading@10 8408
yading@10 8409 To convert the F<in.mkv> to TS segments using the C<libx264>
yading@10 8410 and C<libfaac> encoders:
yading@10 8411
yading@10 8412 ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a libfaac -f ssegment -segment_list out.list out%03d.ts
yading@10 8413
yading@10 8414
yading@10 8415
yading@10 8416 =item *
yading@10 8417
yading@10 8418 Segment the input file, and create an M3U8 live playlist (can be used
yading@10 8419 as live HLS source):
yading@10 8420
yading@10 8421 ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
yading@10 8422 -segment_list_flags +live -segment_time 10 out%03d.mkv
yading@10 8423
yading@10 8424
yading@10 8425 =back
yading@10 8426
yading@10 8427
yading@10 8428
yading@10 8429 =head2 mp3
yading@10 8430
yading@10 8431
yading@10 8432 The MP3 muxer writes a raw MP3 stream with an ID3v2 header at the beginning and
yading@10 8433 optionally an ID3v1 tag at the end. ID3v2.3 and ID3v2.4 are supported, the
yading@10 8434 C<id3v2_version> option controls which one is used. The legacy ID3v1 tag is
yading@10 8435 not written by default, but may be enabled with the C<write_id3v1> option.
yading@10 8436
yading@10 8437 For seekable output the muxer also writes a Xing frame at the beginning, which
yading@10 8438 contains the number of frames in the file. It is useful for computing duration
yading@10 8439 of VBR files.
yading@10 8440
yading@10 8441 The muxer supports writing ID3v2 attached pictures (APIC frames). The pictures
yading@10 8442 are supplied to the muxer in form of a video stream with a single packet. There
yading@10 8443 can be any number of those streams, each will correspond to a single APIC frame.
yading@10 8444 The stream metadata tags I<title> and I<comment> map to APIC
yading@10 8445 I<description> and I<picture type> respectively. See
yading@10 8446 E<lt>B<http://id3.org/id3v2.4.0-frames>E<gt> for allowed picture types.
yading@10 8447
yading@10 8448 Note that the APIC frames must be written at the beginning, so the muxer will
yading@10 8449 buffer the audio frames until it gets all the pictures. It is therefore advised
yading@10 8450 to provide the pictures as soon as possible to avoid excessive buffering.
yading@10 8451
yading@10 8452 Examples:
yading@10 8453
yading@10 8454 Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
yading@10 8455
yading@10 8456 ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
yading@10 8457
yading@10 8458
yading@10 8459 To attach a picture to an mp3 file select both the audio and the picture stream
yading@10 8460 with C<map>:
yading@10 8461
yading@10 8462 ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
yading@10 8463 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
yading@10 8464
yading@10 8465
yading@10 8466
yading@10 8467 =head2 ogg
yading@10 8468
yading@10 8469
yading@10 8470 Ogg container muxer.
yading@10 8471
yading@10 8472
yading@10 8473 =over 4
yading@10 8474
yading@10 8475
yading@10 8476 =item B<-page_duration> I<duration>
yading@10 8477
yading@10 8478 Preferred page duration, in microseconds. The muxer will attempt to create
yading@10 8479 pages that are approximately I<duration> microseconds long. This allows the
yading@10 8480 user to compromise between seek granularity and container overhead. The default
yading@10 8481 is 1 second. A value of 0 will fill all segments, making pages as large as
yading@10 8482 possible. A value of 1 will effectively use 1 packet-per-page in most
yading@10 8483 situations, giving a small seek granularity at the cost of additional container
yading@10 8484 overhead.
yading@10 8485
yading@10 8486 =back
yading@10 8487
yading@10 8488
yading@10 8489
yading@10 8490 =head2 tee
yading@10 8491
yading@10 8492
yading@10 8493 The tee muxer can be used to write the same data to several files or any
yading@10 8494 other kind of muxer. It can be used, for example, to both stream a video to
yading@10 8495 the network and save it to disk at the same time.
yading@10 8496
yading@10 8497 It is different from specifying several outputs to the B<ffmpeg>
yading@10 8498 command-line tool because the audio and video data will be encoded only once
yading@10 8499 with the tee muxer; encoding can be a very expensive process. It is not
yading@10 8500 useful when using the libavformat API directly because it is then possible
yading@10 8501 to feed the same packets to several muxers directly.
yading@10 8502
yading@10 8503 The slave outputs are specified in the file name given to the muxer,
yading@10 8504 separated by '|'. If any of the slave name contains the '|' separator,
yading@10 8505 leading or trailing spaces or any special character, it must be
yading@10 8506 escaped (see the ``Quoting and escaping'' section in the ffmpeg-utils
yading@10 8507 manual).
yading@10 8508
yading@10 8509 Options can be specified for each slave by prepending them as a list of
yading@10 8510 I<key>=I<value> pairs separated by ':', between square brackets. If
yading@10 8511 the options values contain a special character or the ':' separator, they
yading@10 8512 must be escaped; note that this is a second level escaping.
yading@10 8513
yading@10 8514 Example: encode something and both archive it in a WebM file and stream it
yading@10 8515 as MPEG-TS over UDP (the streams need to be explicitly mapped):
yading@10 8516
yading@10 8517
yading@10 8518 ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
yading@10 8519 "archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
yading@10 8520
yading@10 8521
yading@10 8522 Note: some codecs may need different options depending on the output format;
yading@10 8523 the auto-detection of this can not work with the tee muxer. The main example
yading@10 8524 is the B<global_header> flag.
yading@10 8525
yading@10 8526
yading@10 8527 =head1 METADATA
yading@10 8528
yading@10 8529
yading@10 8530 FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
yading@10 8531 INI-like text file and then load it back using the metadata muxer/demuxer.
yading@10 8532
yading@10 8533 The file format is as follows:
yading@10 8534
yading@10 8535 =over 4
yading@10 8536
yading@10 8537
yading@10 8538
yading@10 8539 =item 1.
yading@10 8540
yading@10 8541 A file consists of a header and a number of metadata tags divided into sections,
yading@10 8542 each on its own line.
yading@10 8543
yading@10 8544
yading@10 8545 =item 2.
yading@10 8546
yading@10 8547 The header is a ';FFMETADATA' string, followed by a version number (now 1).
yading@10 8548
yading@10 8549
yading@10 8550 =item 3.
yading@10 8551
yading@10 8552 Metadata tags are of the form 'key=value'
yading@10 8553
yading@10 8554
yading@10 8555 =item 4.
yading@10 8556
yading@10 8557 Immediately after header follows global metadata
yading@10 8558
yading@10 8559
yading@10 8560 =item 5.
yading@10 8561
yading@10 8562 After global metadata there may be sections with per-stream/per-chapter
yading@10 8563 metadata.
yading@10 8564
yading@10 8565
yading@10 8566 =item 6.
yading@10 8567
yading@10 8568 A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
yading@10 8569 brackets ('[', ']') and ends with next section or end of file.
yading@10 8570
yading@10 8571
yading@10 8572 =item 7.
yading@10 8573
yading@10 8574 At the beginning of a chapter section there may be an optional timebase to be
yading@10 8575 used for start/end values. It must be in form 'TIMEBASE=num/den', where num and
yading@10 8576 den are integers. If the timebase is missing then start/end times are assumed to
yading@10 8577 be in milliseconds.
yading@10 8578 Next a chapter section must contain chapter start and end times in form
yading@10 8579 'START=num', 'END=num', where num is a positive integer.
yading@10 8580
yading@10 8581
yading@10 8582 =item 8.
yading@10 8583
yading@10 8584 Empty lines and lines starting with ';' or '#' are ignored.
yading@10 8585
yading@10 8586
yading@10 8587 =item 9.
yading@10 8588
yading@10 8589 Metadata keys or values containing special characters ('=', ';', '#', '\' and a
yading@10 8590 newline) must be escaped with a backslash '\'.
yading@10 8591
yading@10 8592
yading@10 8593 =item 10.
yading@10 8594
yading@10 8595 Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of
yading@10 8596 the tag (in the example above key is 'foo ', value is ' bar').
yading@10 8597
yading@10 8598 =back
yading@10 8599
yading@10 8600
yading@10 8601 A ffmetadata file might look like this:
yading@10 8602
yading@10 8603 ;FFMETADATA1
yading@10 8604 title=bike\\shed
yading@10 8605 ;this is a comment
yading@10 8606 artist=FFmpeg troll team
yading@10 8607
yading@10 8608 [CHAPTER]
yading@10 8609 TIMEBASE=1/1000
yading@10 8610 START=0
yading@10 8611 #chapter ends at 0:01:00
yading@10 8612 END=60000
yading@10 8613 title=chapter \#1
yading@10 8614 [STREAM]
yading@10 8615 title=multi\
yading@10 8616 line
yading@10 8617
yading@10 8618
yading@10 8619 =head1 PROTOCOLS
yading@10 8620
yading@10 8621
yading@10 8622 Protocols are configured elements in FFmpeg which allow to access
yading@10 8623 resources which require the use of a particular protocol.
yading@10 8624
yading@10 8625 When you configure your FFmpeg build, all the supported protocols are
yading@10 8626 enabled by default. You can list all available ones using the
yading@10 8627 configure option "--list-protocols".
yading@10 8628
yading@10 8629 You can disable all the protocols using the configure option
yading@10 8630 "--disable-protocols", and selectively enable a protocol using the
yading@10 8631 option "--enable-protocol=I<PROTOCOL>", or you can disable a
yading@10 8632 particular protocol using the option
yading@10 8633 "--disable-protocol=I<PROTOCOL>".
yading@10 8634
yading@10 8635 The option "-protocols" of the ff* tools will display the list of
yading@10 8636 supported protocols.
yading@10 8637
yading@10 8638 A description of the currently available protocols follows.
yading@10 8639
yading@10 8640
yading@10 8641 =head2 bluray
yading@10 8642
yading@10 8643
yading@10 8644 Read BluRay playlist.
yading@10 8645
yading@10 8646 The accepted options are:
yading@10 8647
yading@10 8648 =over 4
yading@10 8649
yading@10 8650
yading@10 8651
yading@10 8652 =item B<angle>
yading@10 8653
yading@10 8654 BluRay angle
yading@10 8655
yading@10 8656
yading@10 8657 =item B<chapter>
yading@10 8658
yading@10 8659 Start chapter (1...N)
yading@10 8660
yading@10 8661
yading@10 8662 =item B<playlist>
yading@10 8663
yading@10 8664 Playlist to read (BDMV/PLAYLIST/?????.mpls)
yading@10 8665
yading@10 8666
yading@10 8667 =back
yading@10 8668
yading@10 8669
yading@10 8670 Examples:
yading@10 8671
yading@10 8672 Read longest playlist from BluRay mounted to /mnt/bluray:
yading@10 8673
yading@10 8674 bluray:/mnt/bluray
yading@10 8675
yading@10 8676
yading@10 8677 Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
yading@10 8678
yading@10 8679 -playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
yading@10 8680
yading@10 8681
yading@10 8682
yading@10 8683 =head2 concat
yading@10 8684
yading@10 8685
yading@10 8686 Physical concatenation protocol.
yading@10 8687
yading@10 8688 Allow to read and seek from many resource in sequence as if they were
yading@10 8689 a unique resource.
yading@10 8690
yading@10 8691 A URL accepted by this protocol has the syntax:
yading@10 8692
yading@10 8693 concat:<URL1>|<URL2>|...|<URLN>
yading@10 8694
yading@10 8695
yading@10 8696 where I<URL1>, I<URL2>, ..., I<URLN> are the urls of the
yading@10 8697 resource to be concatenated, each one possibly specifying a distinct
yading@10 8698 protocol.
yading@10 8699
yading@10 8700 For example to read a sequence of files F<split1.mpeg>,
yading@10 8701 F<split2.mpeg>, F<split3.mpeg> with B<ffplay> use the
yading@10 8702 command:
yading@10 8703
yading@10 8704 ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
yading@10 8705
yading@10 8706
yading@10 8707 Note that you may need to escape the character "|" which is special for
yading@10 8708 many shells.
yading@10 8709
yading@10 8710
yading@10 8711 =head2 data
yading@10 8712
yading@10 8713
yading@10 8714 Data in-line in the URI. See E<lt>B<http://en.wikipedia.org/wiki/Data_URI_scheme>E<gt>.
yading@10 8715
yading@10 8716 For example, to convert a GIF file given inline with B<ffmpeg>:
yading@10 8717
yading@10 8718 ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png
yading@10 8719
yading@10 8720
yading@10 8721
yading@10 8722 =head2 file
yading@10 8723
yading@10 8724
yading@10 8725 File access protocol.
yading@10 8726
yading@10 8727 Allow to read from or read to a file.
yading@10 8728
yading@10 8729 For example to read from a file F<input.mpeg> with B<ffmpeg>
yading@10 8730 use the command:
yading@10 8731
yading@10 8732 ffmpeg -i file:input.mpeg output.mpeg
yading@10 8733
yading@10 8734
yading@10 8735 The ff* tools default to the file protocol, that is a resource
yading@10 8736 specified with the name "FILE.mpeg" is interpreted as the URL
yading@10 8737 "file:FILE.mpeg".
yading@10 8738
yading@10 8739
yading@10 8740 =head2 gopher
yading@10 8741
yading@10 8742
yading@10 8743 Gopher protocol.
yading@10 8744
yading@10 8745
yading@10 8746 =head2 hls
yading@10 8747
yading@10 8748
yading@10 8749 Read Apple HTTP Live Streaming compliant segmented stream as
yading@10 8750 a uniform one. The M3U8 playlists describing the segments can be
yading@10 8751 remote HTTP resources or local files, accessed using the standard
yading@10 8752 file protocol.
yading@10 8753 The nested protocol is declared by specifying
yading@10 8754 "+I<proto>" after the hls URI scheme name, where I<proto>
yading@10 8755 is either "file" or "http".
yading@10 8756
yading@10 8757
yading@10 8758 hls+http://host/path/to/remote/resource.m3u8
yading@10 8759 hls+file://path/to/local/resource.m3u8
yading@10 8760
yading@10 8761
yading@10 8762 Using this protocol is discouraged - the hls demuxer should work
yading@10 8763 just as well (if not, please report the issues) and is more complete.
yading@10 8764 To use the hls demuxer instead, simply use the direct URLs to the
yading@10 8765 m3u8 files.
yading@10 8766
yading@10 8767
yading@10 8768 =head2 http
yading@10 8769
yading@10 8770
yading@10 8771 HTTP (Hyper Text Transfer Protocol).
yading@10 8772
yading@10 8773 This protocol accepts the following options.
yading@10 8774
yading@10 8775
yading@10 8776 =over 4
yading@10 8777
yading@10 8778
yading@10 8779 =item B<seekable>
yading@10 8780
yading@10 8781 Control seekability of connection. If set to 1 the resource is
yading@10 8782 supposed to be seekable, if set to 0 it is assumed not to be seekable,
yading@10 8783 if set to -1 it will try to autodetect if it is seekable. Default
yading@10 8784 value is -1.
yading@10 8785
yading@10 8786
yading@10 8787 =item B<chunked_post>
yading@10 8788
yading@10 8789 If set to 1 use chunked transfer-encoding for posts, default is 1.
yading@10 8790
yading@10 8791
yading@10 8792 =item B<headers>
yading@10 8793
yading@10 8794 Set custom HTTP headers, can override built in default headers. The
yading@10 8795 value must be a string encoding the headers.
yading@10 8796
yading@10 8797
yading@10 8798 =item B<content_type>
yading@10 8799
yading@10 8800 Force a content type.
yading@10 8801
yading@10 8802
yading@10 8803 =item B<user-agent>
yading@10 8804
yading@10 8805 Override User-Agent header. If not specified the protocol will use a
yading@10 8806 string describing the libavformat build.
yading@10 8807
yading@10 8808
yading@10 8809 =item B<multiple_requests>
yading@10 8810
yading@10 8811 Use persistent connections if set to 1. By default it is 0.
yading@10 8812
yading@10 8813
yading@10 8814 =item B<post_data>
yading@10 8815
yading@10 8816 Set custom HTTP post data.
yading@10 8817
yading@10 8818
yading@10 8819 =item B<timeout>
yading@10 8820
yading@10 8821 Set timeout of socket I/O operations used by the underlying low level
yading@10 8822 operation. By default it is set to -1, which means that the timeout is
yading@10 8823 not specified.
yading@10 8824
yading@10 8825
yading@10 8826 =item B<mime_type>
yading@10 8827
yading@10 8828 Set MIME type.
yading@10 8829
yading@10 8830
yading@10 8831 =item B<cookies>
yading@10 8832
yading@10 8833 Set the cookies to be sent in future requests. The format of each cookie is the
yading@10 8834 same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
yading@10 8835 delimited by a newline character.
yading@10 8836
yading@10 8837 =back
yading@10 8838
yading@10 8839
yading@10 8840
yading@10 8841 =head3 HTTP Cookies
yading@10 8842
yading@10 8843
yading@10 8844 Some HTTP requests will be denied unless cookie values are passed in with the
yading@10 8845 request. The B<cookies> option allows these cookies to be specified. At
yading@10 8846 the very least, each cookie must specify a value along with a path and domain.
yading@10 8847 HTTP requests that match both the domain and path will automatically include the
yading@10 8848 cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
yading@10 8849 by a newline.
yading@10 8850
yading@10 8851 The required syntax to play a stream specifying a cookie is:
yading@10 8852
yading@10 8853 ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
yading@10 8854
yading@10 8855
yading@10 8856
yading@10 8857 =head2 mmst
yading@10 8858
yading@10 8859
yading@10 8860 MMS (Microsoft Media Server) protocol over TCP.
yading@10 8861
yading@10 8862
yading@10 8863 =head2 mmsh
yading@10 8864
yading@10 8865
yading@10 8866 MMS (Microsoft Media Server) protocol over HTTP.
yading@10 8867
yading@10 8868 The required syntax is:
yading@10 8869
yading@10 8870 mmsh://<server>[:<port>][/<app>][/<playpath>]
yading@10 8871
yading@10 8872
yading@10 8873
yading@10 8874 =head2 md5
yading@10 8875
yading@10 8876
yading@10 8877 MD5 output protocol.
yading@10 8878
yading@10 8879 Computes the MD5 hash of the data to be written, and on close writes
yading@10 8880 this to the designated output or stdout if none is specified. It can
yading@10 8881 be used to test muxers without writing an actual file.
yading@10 8882
yading@10 8883 Some examples follow.
yading@10 8884
yading@10 8885 # Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
yading@10 8886 ffmpeg -i input.flv -f avi -y md5:output.avi.md5
yading@10 8887
yading@10 8888 # Write the MD5 hash of the encoded AVI file to stdout.
yading@10 8889 ffmpeg -i input.flv -f avi -y md5:
yading@10 8890
yading@10 8891
yading@10 8892 Note that some formats (typically MOV) require the output protocol to
yading@10 8893 be seekable, so they will fail with the MD5 output protocol.
yading@10 8894
yading@10 8895
yading@10 8896 =head2 pipe
yading@10 8897
yading@10 8898
yading@10 8899 UNIX pipe access protocol.
yading@10 8900
yading@10 8901 Allow to read and write from UNIX pipes.
yading@10 8902
yading@10 8903 The accepted syntax is:
yading@10 8904
yading@10 8905 pipe:[<number>]
yading@10 8906
yading@10 8907
yading@10 8908 I<number> is the number corresponding to the file descriptor of the
yading@10 8909 pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If I<number>
yading@10 8910 is not specified, by default the stdout file descriptor will be used
yading@10 8911 for writing, stdin for reading.
yading@10 8912
yading@10 8913 For example to read from stdin with B<ffmpeg>:
yading@10 8914
yading@10 8915 cat test.wav | ffmpeg -i pipe:0
yading@10 8916 # ...this is the same as...
yading@10 8917 cat test.wav | ffmpeg -i pipe:
yading@10 8918
yading@10 8919
yading@10 8920 For writing to stdout with B<ffmpeg>:
yading@10 8921
yading@10 8922 ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
yading@10 8923 # ...this is the same as...
yading@10 8924 ffmpeg -i test.wav -f avi pipe: | cat > test.avi
yading@10 8925
yading@10 8926
yading@10 8927 Note that some formats (typically MOV), require the output protocol to
yading@10 8928 be seekable, so they will fail with the pipe output protocol.
yading@10 8929
yading@10 8930
yading@10 8931 =head2 rtmp
yading@10 8932
yading@10 8933
yading@10 8934 Real-Time Messaging Protocol.
yading@10 8935
yading@10 8936 The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
yading@10 8937 content across a TCP/IP network.
yading@10 8938
yading@10 8939 The required syntax is:
yading@10 8940
yading@10 8941 rtmp://<server>[:<port>][/<app>][/<instance>][/<playpath>]
yading@10 8942
yading@10 8943
yading@10 8944 The accepted parameters are:
yading@10 8945
yading@10 8946 =over 4
yading@10 8947
yading@10 8948
yading@10 8949
yading@10 8950 =item B<server>
yading@10 8951
yading@10 8952 The address of the RTMP server.
yading@10 8953
yading@10 8954
yading@10 8955 =item B<port>
yading@10 8956
yading@10 8957 The number of the TCP port to use (by default is 1935).
yading@10 8958
yading@10 8959
yading@10 8960 =item B<app>
yading@10 8961
yading@10 8962 It is the name of the application to access. It usually corresponds to
yading@10 8963 the path where the application is installed on the RTMP server
yading@10 8964 (e.g. F</ondemand/>, F</flash/live/>, etc.). You can override
yading@10 8965 the value parsed from the URI through the C<rtmp_app> option, too.
yading@10 8966
yading@10 8967
yading@10 8968 =item B<playpath>
yading@10 8969
yading@10 8970 It is the path or name of the resource to play with reference to the
yading@10 8971 application specified in I<app>, may be prefixed by "mp4:". You
yading@10 8972 can override the value parsed from the URI through the C<rtmp_playpath>
yading@10 8973 option, too.
yading@10 8974
yading@10 8975
yading@10 8976 =item B<listen>
yading@10 8977
yading@10 8978 Act as a server, listening for an incoming connection.
yading@10 8979
yading@10 8980
yading@10 8981 =item B<timeout>
yading@10 8982
yading@10 8983 Maximum time to wait for the incoming connection. Implies listen.
yading@10 8984
yading@10 8985 =back
yading@10 8986
yading@10 8987
yading@10 8988 Additionally, the following parameters can be set via command line options
yading@10 8989 (or in code via C<AVOption>s):
yading@10 8990
yading@10 8991 =over 4
yading@10 8992
yading@10 8993
yading@10 8994
yading@10 8995 =item B<rtmp_app>
yading@10 8996
yading@10 8997 Name of application to connect on the RTMP server. This option
yading@10 8998 overrides the parameter specified in the URI.
yading@10 8999
yading@10 9000
yading@10 9001 =item B<rtmp_buffer>
yading@10 9002
yading@10 9003 Set the client buffer time in milliseconds. The default is 3000.
yading@10 9004
yading@10 9005
yading@10 9006 =item B<rtmp_conn>
yading@10 9007
yading@10 9008 Extra arbitrary AMF connection parameters, parsed from a string,
yading@10 9009 e.g. like C<B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0>.
yading@10 9010 Each value is prefixed by a single character denoting the type,
yading@10 9011 B for Boolean, N for number, S for string, O for object, or Z for null,
yading@10 9012 followed by a colon. For Booleans the data must be either 0 or 1 for
yading@10 9013 FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or
yading@10 9014 1 to end or begin an object, respectively. Data items in subobjects may
yading@10 9015 be named, by prefixing the type with 'N' and specifying the name before
yading@10 9016 the value (i.e. C<NB:myFlag:1>). This option may be used multiple
yading@10 9017 times to construct arbitrary AMF sequences.
yading@10 9018
yading@10 9019
yading@10 9020 =item B<rtmp_flashver>
yading@10 9021
yading@10 9022 Version of the Flash plugin used to run the SWF player. The default
yading@10 9023 is LNX 9,0,124,2.
yading@10 9024
yading@10 9025
yading@10 9026 =item B<rtmp_flush_interval>
yading@10 9027
yading@10 9028 Number of packets flushed in the same request (RTMPT only). The default
yading@10 9029 is 10.
yading@10 9030
yading@10 9031
yading@10 9032 =item B<rtmp_live>
yading@10 9033
yading@10 9034 Specify that the media is a live stream. No resuming or seeking in
yading@10 9035 live streams is possible. The default value is C<any>, which means the
yading@10 9036 subscriber first tries to play the live stream specified in the
yading@10 9037 playpath. If a live stream of that name is not found, it plays the
yading@10 9038 recorded stream. The other possible values are C<live> and
yading@10 9039 C<recorded>.
yading@10 9040
yading@10 9041
yading@10 9042 =item B<rtmp_pageurl>
yading@10 9043
yading@10 9044 URL of the web page in which the media was embedded. By default no
yading@10 9045 value will be sent.
yading@10 9046
yading@10 9047
yading@10 9048 =item B<rtmp_playpath>
yading@10 9049
yading@10 9050 Stream identifier to play or to publish. This option overrides the
yading@10 9051 parameter specified in the URI.
yading@10 9052
yading@10 9053
yading@10 9054 =item B<rtmp_subscribe>
yading@10 9055
yading@10 9056 Name of live stream to subscribe to. By default no value will be sent.
yading@10 9057 It is only sent if the option is specified or if rtmp_live
yading@10 9058 is set to live.
yading@10 9059
yading@10 9060
yading@10 9061 =item B<rtmp_swfhash>
yading@10 9062
yading@10 9063 SHA256 hash of the decompressed SWF file (32 bytes).
yading@10 9064
yading@10 9065
yading@10 9066 =item B<rtmp_swfsize>
yading@10 9067
yading@10 9068 Size of the decompressed SWF file, required for SWFVerification.
yading@10 9069
yading@10 9070
yading@10 9071 =item B<rtmp_swfurl>
yading@10 9072
yading@10 9073 URL of the SWF player for the media. By default no value will be sent.
yading@10 9074
yading@10 9075
yading@10 9076 =item B<rtmp_swfverify>
yading@10 9077
yading@10 9078 URL to player swf file, compute hash/size automatically.
yading@10 9079
yading@10 9080
yading@10 9081 =item B<rtmp_tcurl>
yading@10 9082
yading@10 9083 URL of the target stream. Defaults to proto://host[:port]/app.
yading@10 9084
yading@10 9085
yading@10 9086 =back
yading@10 9087
yading@10 9088
yading@10 9089 For example to read with B<ffplay> a multimedia resource named
yading@10 9090 "sample" from the application "vod" from an RTMP server "myserver":
yading@10 9091
yading@10 9092 ffplay rtmp://myserver/vod/sample
yading@10 9093
yading@10 9094
yading@10 9095
yading@10 9096 =head2 rtmpe
yading@10 9097
yading@10 9098
yading@10 9099 Encrypted Real-Time Messaging Protocol.
yading@10 9100
yading@10 9101 The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
yading@10 9102 streaming multimedia content within standard cryptographic primitives,
yading@10 9103 consisting of Diffie-Hellman key exchange and HMACSHA256, generating
yading@10 9104 a pair of RC4 keys.
yading@10 9105
yading@10 9106
yading@10 9107 =head2 rtmps
yading@10 9108
yading@10 9109
yading@10 9110 Real-Time Messaging Protocol over a secure SSL connection.
yading@10 9111
yading@10 9112 The Real-Time Messaging Protocol (RTMPS) is used for streaming
yading@10 9113 multimedia content across an encrypted connection.
yading@10 9114
yading@10 9115
yading@10 9116 =head2 rtmpt
yading@10 9117
yading@10 9118
yading@10 9119 Real-Time Messaging Protocol tunneled through HTTP.
yading@10 9120
yading@10 9121 The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
yading@10 9122 for streaming multimedia content within HTTP requests to traverse
yading@10 9123 firewalls.
yading@10 9124
yading@10 9125
yading@10 9126 =head2 rtmpte
yading@10 9127
yading@10 9128
yading@10 9129 Encrypted Real-Time Messaging Protocol tunneled through HTTP.
yading@10 9130
yading@10 9131 The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
yading@10 9132 is used for streaming multimedia content within HTTP requests to traverse
yading@10 9133 firewalls.
yading@10 9134
yading@10 9135
yading@10 9136 =head2 rtmpts
yading@10 9137
yading@10 9138
yading@10 9139 Real-Time Messaging Protocol tunneled through HTTPS.
yading@10 9140
yading@10 9141 The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
yading@10 9142 for streaming multimedia content within HTTPS requests to traverse
yading@10 9143 firewalls.
yading@10 9144
yading@10 9145
yading@10 9146 =head2 rtmp, rtmpe, rtmps, rtmpt, rtmpte
yading@10 9147
yading@10 9148
yading@10 9149 Real-Time Messaging Protocol and its variants supported through
yading@10 9150 librtmp.
yading@10 9151
yading@10 9152 Requires the presence of the librtmp headers and library during
yading@10 9153 configuration. You need to explicitly configure the build with
yading@10 9154 "--enable-librtmp". If enabled this will replace the native RTMP
yading@10 9155 protocol.
yading@10 9156
yading@10 9157 This protocol provides most client functions and a few server
yading@10 9158 functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
yading@10 9159 encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
yading@10 9160 variants of these encrypted types (RTMPTE, RTMPTS).
yading@10 9161
yading@10 9162 The required syntax is:
yading@10 9163
yading@10 9164 <rtmp_proto>://<server>[:<port>][/<app>][/<playpath>] <options>
yading@10 9165
yading@10 9166
yading@10 9167 where I<rtmp_proto> is one of the strings "rtmp", "rtmpt", "rtmpe",
yading@10 9168 "rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and
yading@10 9169 I<server>, I<port>, I<app> and I<playpath> have the same
yading@10 9170 meaning as specified for the RTMP native protocol.
yading@10 9171 I<options> contains a list of space-separated options of the form
yading@10 9172 I<key>=I<val>.
yading@10 9173
yading@10 9174 See the librtmp manual page (man 3 librtmp) for more information.
yading@10 9175
yading@10 9176 For example, to stream a file in real-time to an RTMP server using
yading@10 9177 B<ffmpeg>:
yading@10 9178
yading@10 9179 ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
yading@10 9180
yading@10 9181
yading@10 9182 To play the same stream using B<ffplay>:
yading@10 9183
yading@10 9184 ffplay "rtmp://myserver/live/mystream live=1"
yading@10 9185
yading@10 9186
yading@10 9187
yading@10 9188 =head2 rtp
yading@10 9189
yading@10 9190
yading@10 9191 Real-Time Protocol.
yading@10 9192
yading@10 9193
yading@10 9194 =head2 rtsp
yading@10 9195
yading@10 9196
yading@10 9197 RTSP is not technically a protocol handler in libavformat, it is a demuxer
yading@10 9198 and muxer. The demuxer supports both normal RTSP (with data transferred
yading@10 9199 over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
yading@10 9200 data transferred over RDT).
yading@10 9201
yading@10 9202 The muxer can be used to send a stream using RTSP ANNOUNCE to a server
yading@10 9203 supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's
yading@10 9204 E<lt>B<http://github.com/revmischa/rtsp-server>E<gt>).
yading@10 9205
yading@10 9206 The required syntax for a RTSP url is:
yading@10 9207
yading@10 9208 rtsp://<hostname>[:<port>]/<path>
yading@10 9209
yading@10 9210
yading@10 9211 The following options (set on the B<ffmpeg>/B<ffplay> command
yading@10 9212 line, or set in code via C<AVOption>s or in C<avformat_open_input>),
yading@10 9213 are supported:
yading@10 9214
yading@10 9215 Flags for C<rtsp_transport>:
yading@10 9216
yading@10 9217
yading@10 9218 =over 4
yading@10 9219
yading@10 9220
yading@10 9221
yading@10 9222 =item B<udp>
yading@10 9223
yading@10 9224 Use UDP as lower transport protocol.
yading@10 9225
yading@10 9226
yading@10 9227 =item B<tcp>
yading@10 9228
yading@10 9229 Use TCP (interleaving within the RTSP control channel) as lower
yading@10 9230 transport protocol.
yading@10 9231
yading@10 9232
yading@10 9233 =item B<udp_multicast>
yading@10 9234
yading@10 9235 Use UDP multicast as lower transport protocol.
yading@10 9236
yading@10 9237
yading@10 9238 =item B<http>
yading@10 9239
yading@10 9240 Use HTTP tunneling as lower transport protocol, which is useful for
yading@10 9241 passing proxies.
yading@10 9242
yading@10 9243 =back
yading@10 9244
yading@10 9245
yading@10 9246 Multiple lower transport protocols may be specified, in that case they are
yading@10 9247 tried one at a time (if the setup of one fails, the next one is tried).
yading@10 9248 For the muxer, only the C<tcp> and C<udp> options are supported.
yading@10 9249
yading@10 9250 Flags for C<rtsp_flags>:
yading@10 9251
yading@10 9252
yading@10 9253 =over 4
yading@10 9254
yading@10 9255
yading@10 9256 =item B<filter_src>
yading@10 9257
yading@10 9258 Accept packets only from negotiated peer address and port.
yading@10 9259
yading@10 9260 =item B<listen>
yading@10 9261
yading@10 9262 Act as a server, listening for an incoming connection.
yading@10 9263
yading@10 9264 =back
yading@10 9265
yading@10 9266
yading@10 9267 When receiving data over UDP, the demuxer tries to reorder received packets
yading@10 9268 (since they may arrive out of order, or packets may get lost totally). This
yading@10 9269 can be disabled by setting the maximum demuxing delay to zero (via
yading@10 9270 the C<max_delay> field of AVFormatContext).
yading@10 9271
yading@10 9272 When watching multi-bitrate Real-RTSP streams with B<ffplay>, the
yading@10 9273 streams to display can be chosen with C<-vst> I<n> and
yading@10 9274 C<-ast> I<n> for video and audio respectively, and can be switched
yading@10 9275 on the fly by pressing C<v> and C<a>.
yading@10 9276
yading@10 9277 Example command lines:
yading@10 9278
yading@10 9279 To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
yading@10 9280
yading@10 9281
yading@10 9282 ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
yading@10 9283
yading@10 9284
yading@10 9285 To watch a stream tunneled over HTTP:
yading@10 9286
yading@10 9287
yading@10 9288 ffplay -rtsp_transport http rtsp://server/video.mp4
yading@10 9289
yading@10 9290
yading@10 9291 To send a stream in realtime to a RTSP server, for others to watch:
yading@10 9292
yading@10 9293
yading@10 9294 ffmpeg -re -i <input> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
yading@10 9295
yading@10 9296
yading@10 9297 To receive a stream in realtime:
yading@10 9298
yading@10 9299
yading@10 9300 ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <output>
yading@10 9301
yading@10 9302
yading@10 9303
yading@10 9304 =over 4
yading@10 9305
yading@10 9306
yading@10 9307 =item B<stimeout>
yading@10 9308
yading@10 9309 Socket IO timeout in micro seconds.
yading@10 9310
yading@10 9311 =back
yading@10 9312
yading@10 9313
yading@10 9314
yading@10 9315 =head2 sap
yading@10 9316
yading@10 9317
yading@10 9318 Session Announcement Protocol (RFC 2974). This is not technically a
yading@10 9319 protocol handler in libavformat, it is a muxer and demuxer.
yading@10 9320 It is used for signalling of RTP streams, by announcing the SDP for the
yading@10 9321 streams regularly on a separate port.
yading@10 9322
yading@10 9323
yading@10 9324 =head3 Muxer
yading@10 9325
yading@10 9326
yading@10 9327 The syntax for a SAP url given to the muxer is:
yading@10 9328
yading@10 9329 sap://<destination>[:<port>][?<options>]
yading@10 9330
yading@10 9331
yading@10 9332 The RTP packets are sent to I<destination> on port I<port>,
yading@10 9333 or to port 5004 if no port is specified.
yading@10 9334 I<options> is a C<&>-separated list. The following options
yading@10 9335 are supported:
yading@10 9336
yading@10 9337
yading@10 9338 =over 4
yading@10 9339
yading@10 9340
yading@10 9341
yading@10 9342 =item B<announce_addr=>I<address>
yading@10 9343
yading@10 9344 Specify the destination IP address for sending the announcements to.
yading@10 9345 If omitted, the announcements are sent to the commonly used SAP
yading@10 9346 announcement multicast address 224.2.127.254 (sap.mcast.net), or
yading@10 9347 ff0e::2:7ffe if I<destination> is an IPv6 address.
yading@10 9348
yading@10 9349
yading@10 9350 =item B<announce_port=>I<port>
yading@10 9351
yading@10 9352 Specify the port to send the announcements on, defaults to
yading@10 9353 9875 if not specified.
yading@10 9354
yading@10 9355
yading@10 9356 =item B<ttl=>I<ttl>
yading@10 9357
yading@10 9358 Specify the time to live value for the announcements and RTP packets,
yading@10 9359 defaults to 255.
yading@10 9360
yading@10 9361
yading@10 9362 =item B<same_port=>I<0|1>
yading@10 9363
yading@10 9364 If set to 1, send all RTP streams on the same port pair. If zero (the
yading@10 9365 default), all streams are sent on unique ports, with each stream on a
yading@10 9366 port 2 numbers higher than the previous.
yading@10 9367 VLC/Live555 requires this to be set to 1, to be able to receive the stream.
yading@10 9368 The RTP stack in libavformat for receiving requires all streams to be sent
yading@10 9369 on unique ports.
yading@10 9370
yading@10 9371 =back
yading@10 9372
yading@10 9373
yading@10 9374 Example command lines follow.
yading@10 9375
yading@10 9376 To broadcast a stream on the local subnet, for watching in VLC:
yading@10 9377
yading@10 9378
yading@10 9379 ffmpeg -re -i <input> -f sap sap://224.0.0.255?same_port=1
yading@10 9380
yading@10 9381
yading@10 9382 Similarly, for watching in B<ffplay>:
yading@10 9383
yading@10 9384
yading@10 9385 ffmpeg -re -i <input> -f sap sap://224.0.0.255
yading@10 9386
yading@10 9387
yading@10 9388 And for watching in B<ffplay>, over IPv6:
yading@10 9389
yading@10 9390
yading@10 9391 ffmpeg -re -i <input> -f sap sap://[ff0e::1:2:3:4]
yading@10 9392
yading@10 9393
yading@10 9394
yading@10 9395 =head3 Demuxer
yading@10 9396
yading@10 9397
yading@10 9398 The syntax for a SAP url given to the demuxer is:
yading@10 9399
yading@10 9400 sap://[<address>][:<port>]
yading@10 9401
yading@10 9402
yading@10 9403 I<address> is the multicast address to listen for announcements on,
yading@10 9404 if omitted, the default 224.2.127.254 (sap.mcast.net) is used. I<port>
yading@10 9405 is the port that is listened on, 9875 if omitted.
yading@10 9406
yading@10 9407 The demuxers listens for announcements on the given address and port.
yading@10 9408 Once an announcement is received, it tries to receive that particular stream.
yading@10 9409
yading@10 9410 Example command lines follow.
yading@10 9411
yading@10 9412 To play back the first stream announced on the normal SAP multicast address:
yading@10 9413
yading@10 9414
yading@10 9415 ffplay sap://
yading@10 9416
yading@10 9417
yading@10 9418 To play back the first stream announced on one the default IPv6 SAP multicast address:
yading@10 9419
yading@10 9420
yading@10 9421 ffplay sap://[ff0e::2:7ffe]
yading@10 9422
yading@10 9423
yading@10 9424
yading@10 9425 =head2 tcp
yading@10 9426
yading@10 9427
yading@10 9428 Trasmission Control Protocol.
yading@10 9429
yading@10 9430 The required syntax for a TCP url is:
yading@10 9431
yading@10 9432 tcp://<hostname>:<port>[?<options>]
yading@10 9433
yading@10 9434
yading@10 9435
yading@10 9436 =over 4
yading@10 9437
yading@10 9438
yading@10 9439
yading@10 9440 =item B<listen>
yading@10 9441
yading@10 9442 Listen for an incoming connection
yading@10 9443
yading@10 9444
yading@10 9445 =item B<timeout=>I<microseconds>
yading@10 9446
yading@10 9447 In read mode: if no data arrived in more than this time interval, raise error.
yading@10 9448 In write mode: if socket cannot be written in more than this time interval, raise error.
yading@10 9449 This also sets timeout on TCP connection establishing.
yading@10 9450
yading@10 9451
yading@10 9452 ffmpeg -i <input> -f <format> tcp://<hostname>:<port>?listen
yading@10 9453 ffplay tcp://<hostname>:<port>
yading@10 9454
yading@10 9455
yading@10 9456
yading@10 9457 =back
yading@10 9458
yading@10 9459
yading@10 9460
yading@10 9461 =head2 tls
yading@10 9462
yading@10 9463
yading@10 9464 Transport Layer Security/Secure Sockets Layer
yading@10 9465
yading@10 9466 The required syntax for a TLS/SSL url is:
yading@10 9467
yading@10 9468 tls://<hostname>:<port>[?<options>]
yading@10 9469
yading@10 9470
yading@10 9471
yading@10 9472 =over 4
yading@10 9473
yading@10 9474
yading@10 9475
yading@10 9476 =item B<listen>
yading@10 9477
yading@10 9478 Act as a server, listening for an incoming connection.
yading@10 9479
yading@10 9480
yading@10 9481 =item B<cafile=>I<filename>
yading@10 9482
yading@10 9483 Certificate authority file. The file must be in OpenSSL PEM format.
yading@10 9484
yading@10 9485
yading@10 9486 =item B<cert=>I<filename>
yading@10 9487
yading@10 9488 Certificate file. The file must be in OpenSSL PEM format.
yading@10 9489
yading@10 9490
yading@10 9491 =item B<key=>I<filename>
yading@10 9492
yading@10 9493 Private key file.
yading@10 9494
yading@10 9495
yading@10 9496 =item B<verify=>I<0|1>
yading@10 9497
yading@10 9498 Verify the peer's certificate.
yading@10 9499
yading@10 9500
yading@10 9501 =back
yading@10 9502
yading@10 9503
yading@10 9504 Example command lines:
yading@10 9505
yading@10 9506 To create a TLS/SSL server that serves an input stream.
yading@10 9507
yading@10 9508
yading@10 9509 ffmpeg -i <input> -f <format> tls://<hostname>:<port>?listen&cert=<server.crt>&key=<server.key>
yading@10 9510
yading@10 9511
yading@10 9512 To play back a stream from the TLS/SSL server using B<ffplay>:
yading@10 9513
yading@10 9514
yading@10 9515 ffplay tls://<hostname>:<port>
yading@10 9516
yading@10 9517
yading@10 9518
yading@10 9519 =head2 udp
yading@10 9520
yading@10 9521
yading@10 9522 User Datagram Protocol.
yading@10 9523
yading@10 9524 The required syntax for a UDP url is:
yading@10 9525
yading@10 9526 udp://<hostname>:<port>[?<options>]
yading@10 9527
yading@10 9528
yading@10 9529 I<options> contains a list of &-separated options of the form I<key>=I<val>.
yading@10 9530
yading@10 9531 In case threading is enabled on the system, a circular buffer is used
yading@10 9532 to store the incoming data, which allows to reduce loss of data due to
yading@10 9533 UDP socket buffer overruns. The I<fifo_size> and
yading@10 9534 I<overrun_nonfatal> options are related to this buffer.
yading@10 9535
yading@10 9536 The list of supported options follows.
yading@10 9537
yading@10 9538
yading@10 9539 =over 4
yading@10 9540
yading@10 9541
yading@10 9542
yading@10 9543 =item B<buffer_size=>I<size>
yading@10 9544
yading@10 9545 Set the UDP socket buffer size in bytes. This is used both for the
yading@10 9546 receiving and the sending buffer size.
yading@10 9547
yading@10 9548
yading@10 9549 =item B<localport=>I<port>
yading@10 9550
yading@10 9551 Override the local UDP port to bind with.
yading@10 9552
yading@10 9553
yading@10 9554 =item B<localaddr=>I<addr>
yading@10 9555
yading@10 9556 Choose the local IP address. This is useful e.g. if sending multicast
yading@10 9557 and the host has multiple interfaces, where the user can choose
yading@10 9558 which interface to send on by specifying the IP address of that interface.
yading@10 9559
yading@10 9560
yading@10 9561 =item B<pkt_size=>I<size>
yading@10 9562
yading@10 9563 Set the size in bytes of UDP packets.
yading@10 9564
yading@10 9565
yading@10 9566 =item B<reuse=>I<1|0>
yading@10 9567
yading@10 9568 Explicitly allow or disallow reusing UDP sockets.
yading@10 9569
yading@10 9570
yading@10 9571 =item B<ttl=>I<ttl>
yading@10 9572
yading@10 9573 Set the time to live value (for multicast only).
yading@10 9574
yading@10 9575
yading@10 9576 =item B<connect=>I<1|0>
yading@10 9577
yading@10 9578 Initialize the UDP socket with C<connect()>. In this case, the
yading@10 9579 destination address can't be changed with ff_udp_set_remote_url later.
yading@10 9580 If the destination address isn't known at the start, this option can
yading@10 9581 be specified in ff_udp_set_remote_url, too.
yading@10 9582 This allows finding out the source address for the packets with getsockname,
yading@10 9583 and makes writes return with AVERROR(ECONNREFUSED) if "destination
yading@10 9584 unreachable" is received.
yading@10 9585 For receiving, this gives the benefit of only receiving packets from
yading@10 9586 the specified peer address/port.
yading@10 9587
yading@10 9588
yading@10 9589 =item B<sources=>I<address>B<[,>I<address>B<]>
yading@10 9590
yading@10 9591 Only receive packets sent to the multicast group from one of the
yading@10 9592 specified sender IP addresses.
yading@10 9593
yading@10 9594
yading@10 9595 =item B<block=>I<address>B<[,>I<address>B<]>
yading@10 9596
yading@10 9597 Ignore packets sent to the multicast group from the specified
yading@10 9598 sender IP addresses.
yading@10 9599
yading@10 9600
yading@10 9601 =item B<fifo_size=>I<units>
yading@10 9602
yading@10 9603 Set the UDP receiving circular buffer size, expressed as a number of
yading@10 9604 packets with size of 188 bytes. If not specified defaults to 7*4096.
yading@10 9605
yading@10 9606
yading@10 9607 =item B<overrun_nonfatal=>I<1|0>
yading@10 9608
yading@10 9609 Survive in case of UDP receiving circular buffer overrun. Default
yading@10 9610 value is 0.
yading@10 9611
yading@10 9612
yading@10 9613 =item B<timeout=>I<microseconds>
yading@10 9614
yading@10 9615 In read mode: if no data arrived in more than this time interval, raise error.
yading@10 9616
yading@10 9617 =back
yading@10 9618
yading@10 9619
yading@10 9620 Some usage examples of the UDP protocol with B<ffmpeg> follow.
yading@10 9621
yading@10 9622 To stream over UDP to a remote endpoint:
yading@10 9623
yading@10 9624 ffmpeg -i <input> -f <format> udp://<hostname>:<port>
yading@10 9625
yading@10 9626
yading@10 9627 To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
yading@10 9628
yading@10 9629 ffmpeg -i <input> -f mpegts udp://<hostname>:<port>?pkt_size=188&buffer_size=65535
yading@10 9630
yading@10 9631
yading@10 9632 To receive over UDP from a remote endpoint:
yading@10 9633
yading@10 9634 ffmpeg -i udp://[<multicast-address>]:<port>
yading@10 9635
yading@10 9636
yading@10 9637
yading@10 9638
yading@10 9639 =head1 DEVICE OPTIONS
yading@10 9640
yading@10 9641
yading@10 9642 The libavdevice library provides the same interface as
yading@10 9643 libavformat. Namely, an input device is considered like a demuxer, and
yading@10 9644 an output device like a muxer, and the interface and generic device
yading@10 9645 options are the same provided by libavformat (see the ffmpeg-formats
yading@10 9646 manual).
yading@10 9647
yading@10 9648 In addition each input or output device may support so-called private
yading@10 9649 options, which are specific for that component.
yading@10 9650
yading@10 9651 Options may be set by specifying -I<option> I<value> in the
yading@10 9652 FFmpeg tools, or by setting the value explicitly in the device
yading@10 9653 C<AVFormatContext> options or using the F<libavutil/opt.h> API
yading@10 9654 for programmatic use.
yading@10 9655
yading@10 9656
yading@10 9657
yading@10 9658 =head1 INPUT DEVICES
yading@10 9659
yading@10 9660
yading@10 9661 Input devices are configured elements in FFmpeg which allow to access
yading@10 9662 the data coming from a multimedia device attached to your system.
yading@10 9663
yading@10 9664 When you configure your FFmpeg build, all the supported input devices
yading@10 9665 are enabled by default. You can list all available ones using the
yading@10 9666 configure option "--list-indevs".
yading@10 9667
yading@10 9668 You can disable all the input devices using the configure option
yading@10 9669 "--disable-indevs", and selectively enable an input device using the
yading@10 9670 option "--enable-indev=I<INDEV>", or you can disable a particular
yading@10 9671 input device using the option "--disable-indev=I<INDEV>".
yading@10 9672
yading@10 9673 The option "-formats" of the ff* tools will display the list of
yading@10 9674 supported input devices (amongst the demuxers).
yading@10 9675
yading@10 9676 A description of the currently available input devices follows.
yading@10 9677
yading@10 9678
yading@10 9679 =head2 alsa
yading@10 9680
yading@10 9681
yading@10 9682 ALSA (Advanced Linux Sound Architecture) input device.
yading@10 9683
yading@10 9684 To enable this input device during configuration you need libasound
yading@10 9685 installed on your system.
yading@10 9686
yading@10 9687 This device allows capturing from an ALSA device. The name of the
yading@10 9688 device to capture has to be an ALSA card identifier.
yading@10 9689
yading@10 9690 An ALSA identifier has the syntax:
yading@10 9691
yading@10 9692 hw:<CARD>[,<DEV>[,<SUBDEV>]]
yading@10 9693
yading@10 9694
yading@10 9695 where the I<DEV> and I<SUBDEV> components are optional.
yading@10 9696
yading@10 9697 The three arguments (in order: I<CARD>,I<DEV>,I<SUBDEV>)
yading@10 9698 specify card number or identifier, device number and subdevice number
yading@10 9699 (-1 means any).
yading@10 9700
yading@10 9701 To see the list of cards currently recognized by your system check the
yading@10 9702 files F</proc/asound/cards> and F</proc/asound/devices>.
yading@10 9703
yading@10 9704 For example to capture with B<ffmpeg> from an ALSA device with
yading@10 9705 card id 0, you may run the command:
yading@10 9706
yading@10 9707 ffmpeg -f alsa -i hw:0 alsaout.wav
yading@10 9708
yading@10 9709
yading@10 9710 For more information see:
yading@10 9711 E<lt>B<http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html>E<gt>
yading@10 9712
yading@10 9713
yading@10 9714 =head2 bktr
yading@10 9715
yading@10 9716
yading@10 9717 BSD video input device.
yading@10 9718
yading@10 9719
yading@10 9720 =head2 dshow
yading@10 9721
yading@10 9722
yading@10 9723 Windows DirectShow input device.
yading@10 9724
yading@10 9725 DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
yading@10 9726 Currently only audio and video devices are supported.
yading@10 9727
yading@10 9728 Multiple devices may be opened as separate inputs, but they may also be
yading@10 9729 opened on the same input, which should improve synchronism between them.
yading@10 9730
yading@10 9731 The input name should be in the format:
yading@10 9732
yading@10 9733
yading@10 9734 <TYPE>=<NAME>[:<TYPE>=<NAME>]
yading@10 9735
yading@10 9736
yading@10 9737 where I<TYPE> can be either I<audio> or I<video>,
yading@10 9738 and I<NAME> is the device's name.
yading@10 9739
yading@10 9740
yading@10 9741 =head3 Options
yading@10 9742
yading@10 9743
yading@10 9744 If no options are specified, the device's defaults are used.
yading@10 9745 If the device does not support the requested options, it will
yading@10 9746 fail to open.
yading@10 9747
yading@10 9748
yading@10 9749 =over 4
yading@10 9750
yading@10 9751
yading@10 9752
yading@10 9753 =item B<video_size>
yading@10 9754
yading@10 9755 Set the video size in the captured video.
yading@10 9756
yading@10 9757
yading@10 9758 =item B<framerate>
yading@10 9759
yading@10 9760 Set the frame rate in the captured video.
yading@10 9761
yading@10 9762
yading@10 9763 =item B<sample_rate>
yading@10 9764
yading@10 9765 Set the sample rate (in Hz) of the captured audio.
yading@10 9766
yading@10 9767
yading@10 9768 =item B<sample_size>
yading@10 9769
yading@10 9770 Set the sample size (in bits) of the captured audio.
yading@10 9771
yading@10 9772
yading@10 9773 =item B<channels>
yading@10 9774
yading@10 9775 Set the number of channels in the captured audio.
yading@10 9776
yading@10 9777
yading@10 9778 =item B<list_devices>
yading@10 9779
yading@10 9780 If set to B<true>, print a list of devices and exit.
yading@10 9781
yading@10 9782
yading@10 9783 =item B<list_options>
yading@10 9784
yading@10 9785 If set to B<true>, print a list of selected device's options
yading@10 9786 and exit.
yading@10 9787
yading@10 9788
yading@10 9789 =item B<video_device_number>
yading@10 9790
yading@10 9791 Set video device number for devices with same name (starts at 0,
yading@10 9792 defaults to 0).
yading@10 9793
yading@10 9794
yading@10 9795 =item B<audio_device_number>
yading@10 9796
yading@10 9797 Set audio device number for devices with same name (starts at 0,
yading@10 9798 defaults to 0).
yading@10 9799
yading@10 9800
yading@10 9801 =item B<pixel_format>
yading@10 9802
yading@10 9803 Select pixel format to be used by DirectShow. This may only be set when
yading@10 9804 the video codec is not set or set to rawvideo.
yading@10 9805
yading@10 9806
yading@10 9807 =item B<audio_buffer_size>
yading@10 9808
yading@10 9809 Set audio device buffer size in milliseconds (which can directly
yading@10 9810 impact latency, depending on the device).
yading@10 9811 Defaults to using the audio device's
yading@10 9812 default buffer size (typically some multiple of 500ms).
yading@10 9813 Setting this value too low can degrade performance.
yading@10 9814 See also
yading@10 9815 E<lt>B<http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx>E<gt>
yading@10 9816
yading@10 9817
yading@10 9818 =back
yading@10 9819
yading@10 9820
yading@10 9821
yading@10 9822 =head3 Examples
yading@10 9823
yading@10 9824
yading@10 9825
yading@10 9826 =over 4
yading@10 9827
yading@10 9828
yading@10 9829
yading@10 9830 =item *
yading@10 9831
yading@10 9832 Print the list of DirectShow supported devices and exit:
yading@10 9833
yading@10 9834 $ ffmpeg -list_devices true -f dshow -i dummy
yading@10 9835
yading@10 9836
yading@10 9837
yading@10 9838 =item *
yading@10 9839
yading@10 9840 Open video device I<Camera>:
yading@10 9841
yading@10 9842 $ ffmpeg -f dshow -i video="Camera"
yading@10 9843
yading@10 9844
yading@10 9845
yading@10 9846 =item *
yading@10 9847
yading@10 9848 Open second video device with name I<Camera>:
yading@10 9849
yading@10 9850 $ ffmpeg -f dshow -video_device_number 1 -i video="Camera"
yading@10 9851
yading@10 9852
yading@10 9853
yading@10 9854 =item *
yading@10 9855
yading@10 9856 Open video device I<Camera> and audio device I<Microphone>:
yading@10 9857
yading@10 9858 $ ffmpeg -f dshow -i video="Camera":audio="Microphone"
yading@10 9859
yading@10 9860
yading@10 9861
yading@10 9862 =item *
yading@10 9863
yading@10 9864 Print the list of supported options in selected device and exit:
yading@10 9865
yading@10 9866 $ ffmpeg -list_options true -f dshow -i video="Camera"
yading@10 9867
yading@10 9868
yading@10 9869
yading@10 9870 =back
yading@10 9871
yading@10 9872
yading@10 9873
yading@10 9874 =head2 dv1394
yading@10 9875
yading@10 9876
yading@10 9877 Linux DV 1394 input device.
yading@10 9878
yading@10 9879
yading@10 9880 =head2 fbdev
yading@10 9881
yading@10 9882
yading@10 9883 Linux framebuffer input device.
yading@10 9884
yading@10 9885 The Linux framebuffer is a graphic hardware-independent abstraction
yading@10 9886 layer to show graphics on a computer monitor, typically on the
yading@10 9887 console. It is accessed through a file device node, usually
yading@10 9888 F</dev/fb0>.
yading@10 9889
yading@10 9890 For more detailed information read the file
yading@10 9891 Documentation/fb/framebuffer.txt included in the Linux source tree.
yading@10 9892
yading@10 9893 To record from the framebuffer device F</dev/fb0> with
yading@10 9894 B<ffmpeg>:
yading@10 9895
yading@10 9896 ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
yading@10 9897
yading@10 9898
yading@10 9899 You can take a single screenshot image with the command:
yading@10 9900
yading@10 9901 ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
yading@10 9902
yading@10 9903
yading@10 9904 See also E<lt>B<http://linux-fbdev.sourceforge.net/>E<gt>, and fbset(1).
yading@10 9905
yading@10 9906
yading@10 9907 =head2 iec61883
yading@10 9908
yading@10 9909
yading@10 9910 FireWire DV/HDV input device using libiec61883.
yading@10 9911
yading@10 9912 To enable this input device, you need libiec61883, libraw1394 and
yading@10 9913 libavc1394 installed on your system. Use the configure option
yading@10 9914 C<--enable-libiec61883> to compile with the device enabled.
yading@10 9915
yading@10 9916 The iec61883 capture device supports capturing from a video device
yading@10 9917 connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
yading@10 9918 FireWire stack (juju). This is the default DV/HDV input method in Linux
yading@10 9919 Kernel 2.6.37 and later, since the old FireWire stack was removed.
yading@10 9920
yading@10 9921 Specify the FireWire port to be used as input file, or "auto"
yading@10 9922 to choose the first port connected.
yading@10 9923
yading@10 9924
yading@10 9925 =head3 Options
yading@10 9926
yading@10 9927
yading@10 9928
yading@10 9929 =over 4
yading@10 9930
yading@10 9931
yading@10 9932
yading@10 9933 =item B<dvtype>
yading@10 9934
yading@10 9935 Override autodetection of DV/HDV. This should only be used if auto
yading@10 9936 detection does not work, or if usage of a different device type
yading@10 9937 should be prohibited. Treating a DV device as HDV (or vice versa) will
yading@10 9938 not work and result in undefined behavior.
yading@10 9939 The values B<auto>, B<dv> and B<hdv> are supported.
yading@10 9940
yading@10 9941
yading@10 9942 =item B<dvbuffer>
yading@10 9943
yading@10 9944 Set maxiumum size of buffer for incoming data, in frames. For DV, this
yading@10 9945 is an exact value. For HDV, it is not frame exact, since HDV does
yading@10 9946 not have a fixed frame size.
yading@10 9947
yading@10 9948
yading@10 9949 =item B<dvguid>
yading@10 9950
yading@10 9951 Select the capture device by specifying it's GUID. Capturing will only
yading@10 9952 be performed from the specified device and fails if no device with the
yading@10 9953 given GUID is found. This is useful to select the input if multiple
yading@10 9954 devices are connected at the same time.
yading@10 9955 Look at /sys/bus/firewire/devices to find out the GUIDs.
yading@10 9956
yading@10 9957
yading@10 9958 =back
yading@10 9959
yading@10 9960
yading@10 9961
yading@10 9962 =head3 Examples
yading@10 9963
yading@10 9964
yading@10 9965
yading@10 9966 =over 4
yading@10 9967
yading@10 9968
yading@10 9969
yading@10 9970 =item *
yading@10 9971
yading@10 9972 Grab and show the input of a FireWire DV/HDV device.
yading@10 9973
yading@10 9974 ffplay -f iec61883 -i auto
yading@10 9975
yading@10 9976
yading@10 9977
yading@10 9978 =item *
yading@10 9979
yading@10 9980 Grab and record the input of a FireWire DV/HDV device,
yading@10 9981 using a packet buffer of 100000 packets if the source is HDV.
yading@10 9982
yading@10 9983 ffmpeg -f iec61883 -i auto -hdvbuffer 100000 out.mpg
yading@10 9984
yading@10 9985
yading@10 9986
yading@10 9987 =back
yading@10 9988
yading@10 9989
yading@10 9990
yading@10 9991 =head2 jack
yading@10 9992
yading@10 9993
yading@10 9994 JACK input device.
yading@10 9995
yading@10 9996 To enable this input device during configuration you need libjack
yading@10 9997 installed on your system.
yading@10 9998
yading@10 9999 A JACK input device creates one or more JACK writable clients, one for
yading@10 10000 each audio channel, with name I<client_name>:input_I<N>, where
yading@10 10001 I<client_name> is the name provided by the application, and I<N>
yading@10 10002 is a number which identifies the channel.
yading@10 10003 Each writable client will send the acquired data to the FFmpeg input
yading@10 10004 device.
yading@10 10005
yading@10 10006 Once you have created one or more JACK readable clients, you need to
yading@10 10007 connect them to one or more JACK writable clients.
yading@10 10008
yading@10 10009 To connect or disconnect JACK clients you can use the B<jack_connect>
yading@10 10010 and B<jack_disconnect> programs, or do it through a graphical interface,
yading@10 10011 for example with B<qjackctl>.
yading@10 10012
yading@10 10013 To list the JACK clients and their properties you can invoke the command
yading@10 10014 B<jack_lsp>.
yading@10 10015
yading@10 10016 Follows an example which shows how to capture a JACK readable client
yading@10 10017 with B<ffmpeg>.
yading@10 10018
yading@10 10019 # Create a JACK writable client with name "ffmpeg".
yading@10 10020 $ ffmpeg -f jack -i ffmpeg -y out.wav
yading@10 10021
yading@10 10022 # Start the sample jack_metro readable client.
yading@10 10023 $ jack_metro -b 120 -d 0.2 -f 4000
yading@10 10024
yading@10 10025 # List the current JACK clients.
yading@10 10026 $ jack_lsp -c
yading@10 10027 system:capture_1
yading@10 10028 system:capture_2
yading@10 10029 system:playback_1
yading@10 10030 system:playback_2
yading@10 10031 ffmpeg:input_1
yading@10 10032 metro:120_bpm
yading@10 10033
yading@10 10034 # Connect metro to the ffmpeg writable client.
yading@10 10035 $ jack_connect metro:120_bpm ffmpeg:input_1
yading@10 10036
yading@10 10037
yading@10 10038 For more information read:
yading@10 10039 E<lt>B<http://jackaudio.org/>E<gt>
yading@10 10040
yading@10 10041
yading@10 10042 =head2 lavfi
yading@10 10043
yading@10 10044
yading@10 10045 Libavfilter input virtual device.
yading@10 10046
yading@10 10047 This input device reads data from the open output pads of a libavfilter
yading@10 10048 filtergraph.
yading@10 10049
yading@10 10050 For each filtergraph open output, the input device will create a
yading@10 10051 corresponding stream which is mapped to the generated output. Currently
yading@10 10052 only video data is supported. The filtergraph is specified through the
yading@10 10053 option B<graph>.
yading@10 10054
yading@10 10055
yading@10 10056 =head3 Options
yading@10 10057
yading@10 10058
yading@10 10059
yading@10 10060 =over 4
yading@10 10061
yading@10 10062
yading@10 10063
yading@10 10064 =item B<graph>
yading@10 10065
yading@10 10066 Specify the filtergraph to use as input. Each video open output must be
yading@10 10067 labelled by a unique string of the form "outI<N>", where I<N> is a
yading@10 10068 number starting from 0 corresponding to the mapped input stream
yading@10 10069 generated by the device.
yading@10 10070 The first unlabelled output is automatically assigned to the "out0"
yading@10 10071 label, but all the others need to be specified explicitly.
yading@10 10072
yading@10 10073 If not specified defaults to the filename specified for the input
yading@10 10074 device.
yading@10 10075
yading@10 10076
yading@10 10077 =item B<graph_file>
yading@10 10078
yading@10 10079 Set the filename of the filtergraph to be read and sent to the other
yading@10 10080 filters. Syntax of the filtergraph is the same as the one specified by
yading@10 10081 the option I<graph>.
yading@10 10082
yading@10 10083
yading@10 10084 =back
yading@10 10085
yading@10 10086
yading@10 10087
yading@10 10088 =head3 Examples
yading@10 10089
yading@10 10090
yading@10 10091
yading@10 10092 =over 4
yading@10 10093
yading@10 10094
yading@10 10095 =item *
yading@10 10096
yading@10 10097 Create a color video stream and play it back with B<ffplay>:
yading@10 10098
yading@10 10099 ffplay -f lavfi -graph "color=c=pink [out0]" dummy
yading@10 10100
yading@10 10101
yading@10 10102
yading@10 10103 =item *
yading@10 10104
yading@10 10105 As the previous example, but use filename for specifying the graph
yading@10 10106 description, and omit the "out0" label:
yading@10 10107
yading@10 10108 ffplay -f lavfi color=c=pink
yading@10 10109
yading@10 10110
yading@10 10111
yading@10 10112 =item *
yading@10 10113
yading@10 10114 Create three different video test filtered sources and play them:
yading@10 10115
yading@10 10116 ffplay -f lavfi -graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3
yading@10 10117
yading@10 10118
yading@10 10119
yading@10 10120 =item *
yading@10 10121
yading@10 10122 Read an audio stream from a file using the amovie source and play it
yading@10 10123 back with B<ffplay>:
yading@10 10124
yading@10 10125 ffplay -f lavfi "amovie=test.wav"
yading@10 10126
yading@10 10127
yading@10 10128
yading@10 10129 =item *
yading@10 10130
yading@10 10131 Read an audio stream and a video stream and play it back with
yading@10 10132 B<ffplay>:
yading@10 10133
yading@10 10134 ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
yading@10 10135
yading@10 10136
yading@10 10137
yading@10 10138 =back
yading@10 10139
yading@10 10140
yading@10 10141
yading@10 10142 =head2 libdc1394
yading@10 10143
yading@10 10144
yading@10 10145 IIDC1394 input device, based on libdc1394 and libraw1394.
yading@10 10146
yading@10 10147
yading@10 10148 =head2 openal
yading@10 10149
yading@10 10150
yading@10 10151 The OpenAL input device provides audio capture on all systems with a
yading@10 10152 working OpenAL 1.1 implementation.
yading@10 10153
yading@10 10154 To enable this input device during configuration, you need OpenAL
yading@10 10155 headers and libraries installed on your system, and need to configure
yading@10 10156 FFmpeg with C<--enable-openal>.
yading@10 10157
yading@10 10158 OpenAL headers and libraries should be provided as part of your OpenAL
yading@10 10159 implementation, or as an additional download (an SDK). Depending on your
yading@10 10160 installation you may need to specify additional flags via the
yading@10 10161 C<--extra-cflags> and C<--extra-ldflags> for allowing the build
yading@10 10162 system to locate the OpenAL headers and libraries.
yading@10 10163
yading@10 10164 An incomplete list of OpenAL implementations follows:
yading@10 10165
yading@10 10166
yading@10 10167 =over 4
yading@10 10168
yading@10 10169
yading@10 10170 =item B<Creative>
yading@10 10171
yading@10 10172 The official Windows implementation, providing hardware acceleration
yading@10 10173 with supported devices and software fallback.
yading@10 10174 See E<lt>B<http://openal.org/>E<gt>.
yading@10 10175
yading@10 10176 =item B<OpenAL Soft>
yading@10 10177
yading@10 10178 Portable, open source (LGPL) software implementation. Includes
yading@10 10179 backends for the most common sound APIs on the Windows, Linux,
yading@10 10180 Solaris, and BSD operating systems.
yading@10 10181 See E<lt>B<http://kcat.strangesoft.net/openal.html>E<gt>.
yading@10 10182
yading@10 10183 =item B<Apple>
yading@10 10184
yading@10 10185 OpenAL is part of Core Audio, the official Mac OS X Audio interface.
yading@10 10186 See E<lt>B<http://developer.apple.com/technologies/mac/audio-and-video.html>E<gt>
yading@10 10187
yading@10 10188 =back
yading@10 10189
yading@10 10190
yading@10 10191 This device allows to capture from an audio input device handled
yading@10 10192 through OpenAL.
yading@10 10193
yading@10 10194 You need to specify the name of the device to capture in the provided
yading@10 10195 filename. If the empty string is provided, the device will
yading@10 10196 automatically select the default device. You can get the list of the
yading@10 10197 supported devices by using the option I<list_devices>.
yading@10 10198
yading@10 10199
yading@10 10200 =head3 Options
yading@10 10201
yading@10 10202
yading@10 10203
yading@10 10204 =over 4
yading@10 10205
yading@10 10206
yading@10 10207
yading@10 10208 =item B<channels>
yading@10 10209
yading@10 10210 Set the number of channels in the captured audio. Only the values
yading@10 10211 B<1> (monaural) and B<2> (stereo) are currently supported.
yading@10 10212 Defaults to B<2>.
yading@10 10213
yading@10 10214
yading@10 10215 =item B<sample_size>
yading@10 10216
yading@10 10217 Set the sample size (in bits) of the captured audio. Only the values
yading@10 10218 B<8> and B<16> are currently supported. Defaults to
yading@10 10219 B<16>.
yading@10 10220
yading@10 10221
yading@10 10222 =item B<sample_rate>
yading@10 10223
yading@10 10224 Set the sample rate (in Hz) of the captured audio.
yading@10 10225 Defaults to B<44.1k>.
yading@10 10226
yading@10 10227
yading@10 10228 =item B<list_devices>
yading@10 10229
yading@10 10230 If set to B<true>, print a list of devices and exit.
yading@10 10231 Defaults to B<false>.
yading@10 10232
yading@10 10233
yading@10 10234 =back
yading@10 10235
yading@10 10236
yading@10 10237
yading@10 10238 =head3 Examples
yading@10 10239
yading@10 10240
yading@10 10241 Print the list of OpenAL supported devices and exit:
yading@10 10242
yading@10 10243 $ ffmpeg -list_devices true -f openal -i dummy out.ogg
yading@10 10244
yading@10 10245
yading@10 10246 Capture from the OpenAL device F<DR-BT101 via PulseAudio>:
yading@10 10247
yading@10 10248 $ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
yading@10 10249
yading@10 10250
yading@10 10251 Capture from the default device (note the empty string '' as filename):
yading@10 10252
yading@10 10253 $ ffmpeg -f openal -i '' out.ogg
yading@10 10254
yading@10 10255
yading@10 10256 Capture from two devices simultaneously, writing to two different files,
yading@10 10257 within the same B<ffmpeg> command:
yading@10 10258
yading@10 10259 $ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
yading@10 10260
yading@10 10261 Note: not all OpenAL implementations support multiple simultaneous capture -
yading@10 10262 try the latest OpenAL Soft if the above does not work.
yading@10 10263
yading@10 10264
yading@10 10265 =head2 oss
yading@10 10266
yading@10 10267
yading@10 10268 Open Sound System input device.
yading@10 10269
yading@10 10270 The filename to provide to the input device is the device node
yading@10 10271 representing the OSS input device, and is usually set to
yading@10 10272 F</dev/dsp>.
yading@10 10273
yading@10 10274 For example to grab from F</dev/dsp> using B<ffmpeg> use the
yading@10 10275 command:
yading@10 10276
yading@10 10277 ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
yading@10 10278
yading@10 10279
yading@10 10280 For more information about OSS see:
yading@10 10281 E<lt>B<http://manuals.opensound.com/usersguide/dsp.html>E<gt>
yading@10 10282
yading@10 10283
yading@10 10284 =head2 pulse
yading@10 10285
yading@10 10286
yading@10 10287 pulseaudio input device.
yading@10 10288
yading@10 10289 To enable this input device during configuration you need libpulse-simple
yading@10 10290 installed in your system.
yading@10 10291
yading@10 10292 The filename to provide to the input device is a source device or the
yading@10 10293 string "default"
yading@10 10294
yading@10 10295 To list the pulse source devices and their properties you can invoke
yading@10 10296 the command B<pactl list sources>.
yading@10 10297
yading@10 10298
yading@10 10299 ffmpeg -f pulse -i default /tmp/pulse.wav
yading@10 10300
yading@10 10301
yading@10 10302
yading@10 10303 =head3 I<server> AVOption
yading@10 10304
yading@10 10305
yading@10 10306 The syntax is:
yading@10 10307
yading@10 10308 -server <server name>
yading@10 10309
yading@10 10310
yading@10 10311 Connects to a specific server.
yading@10 10312
yading@10 10313
yading@10 10314 =head3 I<name> AVOption
yading@10 10315
yading@10 10316
yading@10 10317 The syntax is:
yading@10 10318
yading@10 10319 -name <application name>
yading@10 10320
yading@10 10321
yading@10 10322 Specify the application name pulse will use when showing active clients,
yading@10 10323 by default it is the LIBAVFORMAT_IDENT string
yading@10 10324
yading@10 10325
yading@10 10326 =head3 I<stream_name> AVOption
yading@10 10327
yading@10 10328
yading@10 10329 The syntax is:
yading@10 10330
yading@10 10331 -stream_name <stream name>
yading@10 10332
yading@10 10333
yading@10 10334 Specify the stream name pulse will use when showing active streams,
yading@10 10335 by default it is "record"
yading@10 10336
yading@10 10337
yading@10 10338 =head3 I<sample_rate> AVOption
yading@10 10339
yading@10 10340
yading@10 10341 The syntax is:
yading@10 10342
yading@10 10343 -sample_rate <samplerate>
yading@10 10344
yading@10 10345
yading@10 10346 Specify the samplerate in Hz, by default 48kHz is used.
yading@10 10347
yading@10 10348
yading@10 10349 =head3 I<channels> AVOption
yading@10 10350
yading@10 10351
yading@10 10352 The syntax is:
yading@10 10353
yading@10 10354 -channels <N>
yading@10 10355
yading@10 10356
yading@10 10357 Specify the channels in use, by default 2 (stereo) is set.
yading@10 10358
yading@10 10359
yading@10 10360 =head3 I<frame_size> AVOption
yading@10 10361
yading@10 10362
yading@10 10363 The syntax is:
yading@10 10364
yading@10 10365 -frame_size <bytes>
yading@10 10366
yading@10 10367
yading@10 10368 Specify the number of byte per frame, by default it is set to 1024.
yading@10 10369
yading@10 10370
yading@10 10371 =head3 I<fragment_size> AVOption
yading@10 10372
yading@10 10373
yading@10 10374 The syntax is:
yading@10 10375
yading@10 10376 -fragment_size <bytes>
yading@10 10377
yading@10 10378
yading@10 10379 Specify the minimal buffering fragment in pulseaudio, it will affect the
yading@10 10380 audio latency. By default it is unset.
yading@10 10381
yading@10 10382
yading@10 10383 =head2 sndio
yading@10 10384
yading@10 10385
yading@10 10386 sndio input device.
yading@10 10387
yading@10 10388 To enable this input device during configuration you need libsndio
yading@10 10389 installed on your system.
yading@10 10390
yading@10 10391 The filename to provide to the input device is the device node
yading@10 10392 representing the sndio input device, and is usually set to
yading@10 10393 F</dev/audio0>.
yading@10 10394
yading@10 10395 For example to grab from F</dev/audio0> using B<ffmpeg> use the
yading@10 10396 command:
yading@10 10397
yading@10 10398 ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
yading@10 10399
yading@10 10400
yading@10 10401
yading@10 10402 =head2 video4linux2, v4l2
yading@10 10403
yading@10 10404
yading@10 10405 Video4Linux2 input video device.
yading@10 10406
yading@10 10407 "v4l2" can be used as alias for "video4linux2".
yading@10 10408
yading@10 10409 If FFmpeg is built with v4l-utils support (by using the
yading@10 10410 C<--enable-libv4l2> configure option), the device will always rely
yading@10 10411 on libv4l2.
yading@10 10412
yading@10 10413 The name of the device to grab is a file device node, usually Linux
yading@10 10414 systems tend to automatically create such nodes when the device
yading@10 10415 (e.g. an USB webcam) is plugged into the system, and has a name of the
yading@10 10416 kind F</dev/videoI<N>>, where I<N> is a number associated to
yading@10 10417 the device.
yading@10 10418
yading@10 10419 Video4Linux2 devices usually support a limited set of
yading@10 10420 I<width>xI<height> sizes and frame rates. You can check which are
yading@10 10421 supported using B<-list_formats all> for Video4Linux2 devices.
yading@10 10422 Some devices, like TV cards, support one or more standards. It is possible
yading@10 10423 to list all the supported standards using B<-list_standards all>.
yading@10 10424
yading@10 10425 The time base for the timestamps is 1 microsecond. Depending on the kernel
yading@10 10426 version and configuration, the timestamps may be derived from the real time
yading@10 10427 clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
yading@10 10428 boot time, unaffected by NTP or manual changes to the clock). The
yading@10 10429 B<-timestamps abs> or B<-ts abs> option can be used to force
yading@10 10430 conversion into the real time clock.
yading@10 10431
yading@10 10432 Some usage examples of the video4linux2 device with B<ffmpeg>
yading@10 10433 and B<ffplay>:
yading@10 10434
yading@10 10435 =over 4
yading@10 10436
yading@10 10437
yading@10 10438 =item *
yading@10 10439
yading@10 10440 Grab and show the input of a video4linux2 device:
yading@10 10441
yading@10 10442 ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
yading@10 10443
yading@10 10444
yading@10 10445
yading@10 10446 =item *
yading@10 10447
yading@10 10448 Grab and record the input of a video4linux2 device, leave the
yading@10 10449 frame rate and size as previously set:
yading@10 10450
yading@10 10451 ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
yading@10 10452
yading@10 10453
yading@10 10454 =back
yading@10 10455
yading@10 10456
yading@10 10457 For more information about Video4Linux, check E<lt>B<http://linuxtv.org/>E<gt>.
yading@10 10458
yading@10 10459
yading@10 10460 =head3 Options
yading@10 10461
yading@10 10462
yading@10 10463
yading@10 10464 =over 4
yading@10 10465
yading@10 10466
yading@10 10467 =item B<standard>
yading@10 10468
yading@10 10469 Set the standard. Must be the name of a supported standard. To get a
yading@10 10470 list of the supported standards, use the B<list_standards>
yading@10 10471 option.
yading@10 10472
yading@10 10473
yading@10 10474 =item B<channel>
yading@10 10475
yading@10 10476 Set the input channel number. Default to -1, which means using the
yading@10 10477 previously selected channel.
yading@10 10478
yading@10 10479
yading@10 10480 =item B<video_size>
yading@10 10481
yading@10 10482 Set the video frame size. The argument must be a string in the form
yading@10 10483 I<WIDTH>xI<HEIGHT> or a valid size abbreviation.
yading@10 10484
yading@10 10485
yading@10 10486 =item B<pixel_format>
yading@10 10487
yading@10 10488 Select the pixel format (only valid for raw video input).
yading@10 10489
yading@10 10490
yading@10 10491 =item B<input_format>
yading@10 10492
yading@10 10493 Set the preferred pixel format (for raw video) or a codec name.
yading@10 10494 This option allows to select the input format, when several are
yading@10 10495 available.
yading@10 10496
yading@10 10497
yading@10 10498 =item B<framerate>
yading@10 10499
yading@10 10500 Set the preferred video frame rate.
yading@10 10501
yading@10 10502
yading@10 10503 =item B<list_formats>
yading@10 10504
yading@10 10505 List available formats (supported pixel formats, codecs, and frame
yading@10 10506 sizes) and exit.
yading@10 10507
yading@10 10508 Available values are:
yading@10 10509
yading@10 10510 =over 4
yading@10 10511
yading@10 10512
yading@10 10513 =item B<all>
yading@10 10514
yading@10 10515 Show all available (compressed and non-compressed) formats.
yading@10 10516
yading@10 10517
yading@10 10518 =item B<raw>
yading@10 10519
yading@10 10520 Show only raw video (non-compressed) formats.
yading@10 10521
yading@10 10522
yading@10 10523 =item B<compressed>
yading@10 10524
yading@10 10525 Show only compressed formats.
yading@10 10526
yading@10 10527 =back
yading@10 10528
yading@10 10529
yading@10 10530
yading@10 10531 =item B<list_standards>
yading@10 10532
yading@10 10533 List supported standards and exit.
yading@10 10534
yading@10 10535 Available values are:
yading@10 10536
yading@10 10537 =over 4
yading@10 10538
yading@10 10539
yading@10 10540 =item B<all>
yading@10 10541
yading@10 10542 Show all supported standards.
yading@10 10543
yading@10 10544 =back
yading@10 10545
yading@10 10546
yading@10 10547
yading@10 10548 =item B<timestamps, ts>
yading@10 10549
yading@10 10550 Set type of timestamps for grabbed frames.
yading@10 10551
yading@10 10552 Available values are:
yading@10 10553
yading@10 10554 =over 4
yading@10 10555
yading@10 10556
yading@10 10557 =item B<default>
yading@10 10558
yading@10 10559 Use timestamps from the kernel.
yading@10 10560
yading@10 10561
yading@10 10562 =item B<abs>
yading@10 10563
yading@10 10564 Use absolute timestamps (wall clock).
yading@10 10565
yading@10 10566
yading@10 10567 =item B<mono2abs>
yading@10 10568
yading@10 10569 Force conversion from monotonic to absolute timestamps.
yading@10 10570
yading@10 10571 =back
yading@10 10572
yading@10 10573
yading@10 10574 Default value is C<default>.
yading@10 10575
yading@10 10576 =back
yading@10 10577
yading@10 10578
yading@10 10579
yading@10 10580 =head2 vfwcap
yading@10 10581
yading@10 10582
yading@10 10583 VfW (Video for Windows) capture input device.
yading@10 10584
yading@10 10585 The filename passed as input is the capture driver number, ranging from
yading@10 10586 0 to 9. You may use "list" as filename to print a list of drivers. Any
yading@10 10587 other filename will be interpreted as device number 0.
yading@10 10588
yading@10 10589
yading@10 10590 =head2 x11grab
yading@10 10591
yading@10 10592
yading@10 10593 X11 video input device.
yading@10 10594
yading@10 10595 This device allows to capture a region of an X11 display.
yading@10 10596
yading@10 10597 The filename passed as input has the syntax:
yading@10 10598
yading@10 10599 [<hostname>]:<display_number>.<screen_number>[+<x_offset>,<y_offset>]
yading@10 10600
yading@10 10601
yading@10 10602 I<hostname>:I<display_number>.I<screen_number> specifies the
yading@10 10603 X11 display name of the screen to grab from. I<hostname> can be
yading@10 10604 omitted, and defaults to "localhost". The environment variable
yading@10 10605 B<DISPLAY> contains the default display name.
yading@10 10606
yading@10 10607 I<x_offset> and I<y_offset> specify the offsets of the grabbed
yading@10 10608 area with respect to the top-left border of the X11 screen. They
yading@10 10609 default to 0.
yading@10 10610
yading@10 10611 Check the X11 documentation (e.g. man X) for more detailed information.
yading@10 10612
yading@10 10613 Use the B<dpyinfo> program for getting basic information about the
yading@10 10614 properties of your X11 display (e.g. grep for "name" or "dimensions").
yading@10 10615
yading@10 10616 For example to grab from F<:0.0> using B<ffmpeg>:
yading@10 10617
yading@10 10618 ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
yading@10 10619
yading@10 10620
yading@10 10621 Grab at position C<10,20>:
yading@10 10622
yading@10 10623 ffmpeg -f x11grab -r 25 -s cif -i :0.0+10,20 out.mpg
yading@10 10624
yading@10 10625
yading@10 10626
yading@10 10627 =head3 Options
yading@10 10628
yading@10 10629
yading@10 10630
yading@10 10631 =over 4
yading@10 10632
yading@10 10633
yading@10 10634 =item B<draw_mouse>
yading@10 10635
yading@10 10636 Specify whether to draw the mouse pointer. A value of C<0> specify
yading@10 10637 not to draw the pointer. Default value is C<1>.
yading@10 10638
yading@10 10639
yading@10 10640 =item B<follow_mouse>
yading@10 10641
yading@10 10642 Make the grabbed area follow the mouse. The argument can be
yading@10 10643 C<centered> or a number of pixels I<PIXELS>.
yading@10 10644
yading@10 10645 When it is specified with "centered", the grabbing region follows the mouse
yading@10 10646 pointer and keeps the pointer at the center of region; otherwise, the region
yading@10 10647 follows only when the mouse pointer reaches within I<PIXELS> (greater than
yading@10 10648 zero) to the edge of region.
yading@10 10649
yading@10 10650 For example:
yading@10 10651
yading@10 10652 ffmpeg -f x11grab -follow_mouse centered -r 25 -s cif -i :0.0 out.mpg
yading@10 10653
yading@10 10654
yading@10 10655 To follow only when the mouse pointer reaches within 100 pixels to edge:
yading@10 10656
yading@10 10657 ffmpeg -f x11grab -follow_mouse 100 -r 25 -s cif -i :0.0 out.mpg
yading@10 10658
yading@10 10659
yading@10 10660
yading@10 10661 =item B<framerate>
yading@10 10662
yading@10 10663 Set the grabbing frame rate. Default value is C<ntsc>,
yading@10 10664 corresponding to a frame rate of C<30000/1001>.
yading@10 10665
yading@10 10666
yading@10 10667 =item B<show_region>
yading@10 10668
yading@10 10669 Show grabbed region on screen.
yading@10 10670
yading@10 10671 If I<show_region> is specified with C<1>, then the grabbing
yading@10 10672 region will be indicated on screen. With this option, it is easy to
yading@10 10673 know what is being grabbed if only a portion of the screen is grabbed.
yading@10 10674
yading@10 10675 For example:
yading@10 10676
yading@10 10677 ffmpeg -f x11grab -show_region 1 -r 25 -s cif -i :0.0+10,20 out.mpg
yading@10 10678
yading@10 10679
yading@10 10680 With I<follow_mouse>:
yading@10 10681
yading@10 10682 ffmpeg -f x11grab -follow_mouse centered -show_region 1 -r 25 -s cif -i :0.0 out.mpg
yading@10 10683
yading@10 10684
yading@10 10685
yading@10 10686 =item B<video_size>
yading@10 10687
yading@10 10688 Set the video frame size. Default value is C<vga>.
yading@10 10689
yading@10 10690 =back
yading@10 10691
yading@10 10692
yading@10 10693
yading@10 10694 =head1 OUTPUT DEVICES
yading@10 10695
yading@10 10696
yading@10 10697 Output devices are configured elements in FFmpeg which allow to write
yading@10 10698 multimedia data to an output device attached to your system.
yading@10 10699
yading@10 10700 When you configure your FFmpeg build, all the supported output devices
yading@10 10701 are enabled by default. You can list all available ones using the
yading@10 10702 configure option "--list-outdevs".
yading@10 10703
yading@10 10704 You can disable all the output devices using the configure option
yading@10 10705 "--disable-outdevs", and selectively enable an output device using the
yading@10 10706 option "--enable-outdev=I<OUTDEV>", or you can disable a particular
yading@10 10707 input device using the option "--disable-outdev=I<OUTDEV>".
yading@10 10708
yading@10 10709 The option "-formats" of the ff* tools will display the list of
yading@10 10710 enabled output devices (amongst the muxers).
yading@10 10711
yading@10 10712 A description of the currently available output devices follows.
yading@10 10713
yading@10 10714
yading@10 10715 =head2 alsa
yading@10 10716
yading@10 10717
yading@10 10718 ALSA (Advanced Linux Sound Architecture) output device.
yading@10 10719
yading@10 10720
yading@10 10721 =head2 caca
yading@10 10722
yading@10 10723
yading@10 10724 CACA output device.
yading@10 10725
yading@10 10726 This output devices allows to show a video stream in CACA window.
yading@10 10727 Only one CACA window is allowed per application, so you can
yading@10 10728 have only one instance of this output device in an application.
yading@10 10729
yading@10 10730 To enable this output device you need to configure FFmpeg with
yading@10 10731 C<--enable-libcaca>.
yading@10 10732 libcaca is a graphics library that outputs text instead of pixels.
yading@10 10733
yading@10 10734 For more information about libcaca, check:
yading@10 10735 E<lt>B<http://caca.zoy.org/wiki/libcaca>E<gt>
yading@10 10736
yading@10 10737
yading@10 10738 =head3 Options
yading@10 10739
yading@10 10740
yading@10 10741
yading@10 10742 =over 4
yading@10 10743
yading@10 10744
yading@10 10745
yading@10 10746 =item B<window_title>
yading@10 10747
yading@10 10748 Set the CACA window title, if not specified default to the filename
yading@10 10749 specified for the output device.
yading@10 10750
yading@10 10751
yading@10 10752 =item B<window_size>
yading@10 10753
yading@10 10754 Set the CACA window size, can be a string of the form
yading@10 10755 I<width>xI<height> or a video size abbreviation.
yading@10 10756 If not specified it defaults to the size of the input video.
yading@10 10757
yading@10 10758
yading@10 10759 =item B<driver>
yading@10 10760
yading@10 10761 Set display driver.
yading@10 10762
yading@10 10763
yading@10 10764 =item B<algorithm>
yading@10 10765
yading@10 10766 Set dithering algorithm. Dithering is necessary
yading@10 10767 because the picture being rendered has usually far more colours than
yading@10 10768 the available palette.
yading@10 10769 The accepted values are listed with C<-list_dither algorithms>.
yading@10 10770
yading@10 10771
yading@10 10772 =item B<antialias>
yading@10 10773
yading@10 10774 Set antialias method. Antialiasing smoothens the rendered
yading@10 10775 image and avoids the commonly seen staircase effect.
yading@10 10776 The accepted values are listed with C<-list_dither antialiases>.
yading@10 10777
yading@10 10778
yading@10 10779 =item B<charset>
yading@10 10780
yading@10 10781 Set which characters are going to be used when rendering text.
yading@10 10782 The accepted values are listed with C<-list_dither charsets>.
yading@10 10783
yading@10 10784
yading@10 10785 =item B<color>
yading@10 10786
yading@10 10787 Set color to be used when rendering text.
yading@10 10788 The accepted values are listed with C<-list_dither colors>.
yading@10 10789
yading@10 10790
yading@10 10791 =item B<list_drivers>
yading@10 10792
yading@10 10793 If set to B<true>, print a list of available drivers and exit.
yading@10 10794
yading@10 10795
yading@10 10796 =item B<list_dither>
yading@10 10797
yading@10 10798 List available dither options related to the argument.
yading@10 10799 The argument must be one of C<algorithms>, C<antialiases>,
yading@10 10800 C<charsets>, C<colors>.
yading@10 10801
yading@10 10802 =back
yading@10 10803
yading@10 10804
yading@10 10805
yading@10 10806 =head3 Examples
yading@10 10807
yading@10 10808
yading@10 10809
yading@10 10810 =over 4
yading@10 10811
yading@10 10812
yading@10 10813 =item *
yading@10 10814
yading@10 10815 The following command shows the B<ffmpeg> output is an
yading@10 10816 CACA window, forcing its size to 80x25:
yading@10 10817
yading@10 10818 ffmpeg -i INPUT -vcodec rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
yading@10 10819
yading@10 10820
yading@10 10821
yading@10 10822 =item *
yading@10 10823
yading@10 10824 Show the list of available drivers and exit:
yading@10 10825
yading@10 10826 ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
yading@10 10827
yading@10 10828
yading@10 10829
yading@10 10830 =item *
yading@10 10831
yading@10 10832 Show the list of available dither colors and exit:
yading@10 10833
yading@10 10834 ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
yading@10 10835
yading@10 10836
yading@10 10837 =back
yading@10 10838
yading@10 10839
yading@10 10840
yading@10 10841 =head2 oss
yading@10 10842
yading@10 10843
yading@10 10844 OSS (Open Sound System) output device.
yading@10 10845
yading@10 10846
yading@10 10847 =head2 sdl
yading@10 10848
yading@10 10849
yading@10 10850 SDL (Simple DirectMedia Layer) output device.
yading@10 10851
yading@10 10852 This output devices allows to show a video stream in an SDL
yading@10 10853 window. Only one SDL window is allowed per application, so you can
yading@10 10854 have only one instance of this output device in an application.
yading@10 10855
yading@10 10856 To enable this output device you need libsdl installed on your system
yading@10 10857 when configuring your build.
yading@10 10858
yading@10 10859 For more information about SDL, check:
yading@10 10860 E<lt>B<http://www.libsdl.org/>E<gt>
yading@10 10861
yading@10 10862
yading@10 10863 =head3 Options
yading@10 10864
yading@10 10865
yading@10 10866
yading@10 10867 =over 4
yading@10 10868
yading@10 10869
yading@10 10870
yading@10 10871 =item B<window_title>
yading@10 10872
yading@10 10873 Set the SDL window title, if not specified default to the filename
yading@10 10874 specified for the output device.
yading@10 10875
yading@10 10876
yading@10 10877 =item B<icon_title>
yading@10 10878
yading@10 10879 Set the name of the iconified SDL window, if not specified it is set
yading@10 10880 to the same value of I<window_title>.
yading@10 10881
yading@10 10882
yading@10 10883 =item B<window_size>
yading@10 10884
yading@10 10885 Set the SDL window size, can be a string of the form
yading@10 10886 I<width>xI<height> or a video size abbreviation.
yading@10 10887 If not specified it defaults to the size of the input video,
yading@10 10888 downscaled according to the aspect ratio.
yading@10 10889
yading@10 10890 =back
yading@10 10891
yading@10 10892
yading@10 10893
yading@10 10894 =head3 Examples
yading@10 10895
yading@10 10896
yading@10 10897 The following command shows the B<ffmpeg> output is an
yading@10 10898 SDL window, forcing its size to the qcif format:
yading@10 10899
yading@10 10900 ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
yading@10 10901
yading@10 10902
yading@10 10903
yading@10 10904 =head2 sndio
yading@10 10905
yading@10 10906
yading@10 10907 sndio audio output device.
yading@10 10908
yading@10 10909
yading@10 10910
yading@10 10911 =head1 RESAMPLER OPTIONS
yading@10 10912
yading@10 10913
yading@10 10914 The audio resampler supports the following named options.
yading@10 10915
yading@10 10916 Options may be set by specifying -I<option> I<value> in the
yading@10 10917 FFmpeg tools, I<option>=I<value> for the aresample filter,
yading@10 10918 by setting the value explicitly in the
yading@10 10919 C<SwrContext> options or using the F<libavutil/opt.h> API for
yading@10 10920 programmatic use.
yading@10 10921
yading@10 10922
yading@10 10923 =over 4
yading@10 10924
yading@10 10925
yading@10 10926
yading@10 10927 =item B<ich, in_channel_count>
yading@10 10928
yading@10 10929 Set the number of input channels. Default value is 0. Setting this
yading@10 10930 value is not mandatory if the corresponding channel layout
yading@10 10931 B<in_channel_layout> is set.
yading@10 10932
yading@10 10933
yading@10 10934 =item B<och, out_channel_count>
yading@10 10935
yading@10 10936 Set the number of output channels. Default value is 0. Setting this
yading@10 10937 value is not mandatory if the corresponding channel layout
yading@10 10938 B<out_channel_layout> is set.
yading@10 10939
yading@10 10940
yading@10 10941 =item B<uch, used_channel_count>
yading@10 10942
yading@10 10943 Set the number of used input channels. Default value is 0. This option is
yading@10 10944 only used for special remapping.
yading@10 10945
yading@10 10946
yading@10 10947 =item B<isr, in_sample_rate>
yading@10 10948
yading@10 10949 Set the input sample rate. Default value is 0.
yading@10 10950
yading@10 10951
yading@10 10952 =item B<osr, out_sample_rate>
yading@10 10953
yading@10 10954 Set the output sample rate. Default value is 0.
yading@10 10955
yading@10 10956
yading@10 10957 =item B<isf, in_sample_fmt>
yading@10 10958
yading@10 10959 Specify the input sample format. It is set by default to C<none>.
yading@10 10960
yading@10 10961
yading@10 10962 =item B<osf, out_sample_fmt>
yading@10 10963
yading@10 10964 Specify the output sample format. It is set by default to C<none>.
yading@10 10965
yading@10 10966
yading@10 10967 =item B<tsf, internal_sample_fmt>
yading@10 10968
yading@10 10969 Set the internal sample format. Default value is C<none>.
yading@10 10970 This will automatically be chosen when it is not explicitly set.
yading@10 10971
yading@10 10972
yading@10 10973 =item B<icl, in_channel_layout>
yading@10 10974
yading@10 10975 Set the input channel layout.
yading@10 10976
yading@10 10977
yading@10 10978 =item B<ocl, out_channel_layout>
yading@10 10979
yading@10 10980 Set the output channel layout.
yading@10 10981
yading@10 10982
yading@10 10983 =item B<clev, center_mix_level>
yading@10 10984
yading@10 10985 Set the center mix level. It is a value expressed in deciBel, and must be
yading@10 10986 in the interval [-32,32].
yading@10 10987
yading@10 10988
yading@10 10989 =item B<slev, surround_mix_level>
yading@10 10990
yading@10 10991 Set the surround mix level. It is a value expressed in deciBel, and must
yading@10 10992 be in the interval [-32,32].
yading@10 10993
yading@10 10994
yading@10 10995 =item B<lfe_mix_level>
yading@10 10996
yading@10 10997 Set LFE mix into non LFE level. It is used when there is a LFE input but no
yading@10 10998 LFE output. It is a value expressed in deciBel, and must
yading@10 10999 be in the interval [-32,32].
yading@10 11000
yading@10 11001
yading@10 11002 =item B<rmvol, rematrix_volume>
yading@10 11003
yading@10 11004 Set rematrix volume. Default value is 1.0.
yading@10 11005
yading@10 11006
yading@10 11007 =item B<flags, swr_flags>
yading@10 11008
yading@10 11009 Set flags used by the converter. Default value is 0.
yading@10 11010
yading@10 11011 It supports the following individual flags:
yading@10 11012
yading@10 11013 =over 4
yading@10 11014
yading@10 11015
yading@10 11016 =item B<res>
yading@10 11017
yading@10 11018 force resampling, this flag forces resampling to be used even when the
yading@10 11019 input and output sample rates match.
yading@10 11020
yading@10 11021 =back
yading@10 11022
yading@10 11023
yading@10 11024
yading@10 11025 =item B<dither_scale>
yading@10 11026
yading@10 11027 Set the dither scale. Default value is 1.
yading@10 11028
yading@10 11029
yading@10 11030 =item B<dither_method>
yading@10 11031
yading@10 11032 Set dither method. Default value is 0.
yading@10 11033
yading@10 11034 Supported values:
yading@10 11035
yading@10 11036 =over 4
yading@10 11037
yading@10 11038
yading@10 11039 =item B<rectangular>
yading@10 11040
yading@10 11041 select rectangular dither
yading@10 11042
yading@10 11043 =item B<triangular>
yading@10 11044
yading@10 11045 select triangular dither
yading@10 11046
yading@10 11047 =item B<triangular_hp>
yading@10 11048
yading@10 11049 select triangular dither with high pass
yading@10 11050
yading@10 11051 =item B<lipshitz>
yading@10 11052
yading@10 11053 select lipshitz noise shaping dither
yading@10 11054
yading@10 11055 =item B<shibata>
yading@10 11056
yading@10 11057 select shibata noise shaping dither
yading@10 11058
yading@10 11059 =item B<low_shibata>
yading@10 11060
yading@10 11061 select low shibata noise shaping dither
yading@10 11062
yading@10 11063 =item B<high_shibata>
yading@10 11064
yading@10 11065 select high shibata noise shaping dither
yading@10 11066
yading@10 11067 =item B<f_weighted>
yading@10 11068
yading@10 11069 select f-weighted noise shaping dither
yading@10 11070
yading@10 11071 =item B<modified_e_weighted>
yading@10 11072
yading@10 11073 select modified-e-weighted noise shaping dither
yading@10 11074
yading@10 11075 =item B<improved_e_weighted>
yading@10 11076
yading@10 11077 select improved-e-weighted noise shaping dither
yading@10 11078
yading@10 11079
yading@10 11080 =back
yading@10 11081
yading@10 11082
yading@10 11083
yading@10 11084 =item B<resampler>
yading@10 11085
yading@10 11086 Set resampling engine. Default value is swr.
yading@10 11087
yading@10 11088 Supported values:
yading@10 11089
yading@10 11090 =over 4
yading@10 11091
yading@10 11092
yading@10 11093 =item B<swr>
yading@10 11094
yading@10 11095 select the native SW Resampler; filter options precision and cheby are not
yading@10 11096 applicable in this case.
yading@10 11097
yading@10 11098 =item B<soxr>
yading@10 11099
yading@10 11100 select the SoX Resampler (where available); compensation, and filter options
yading@10 11101 filter_size, phase_shift, filter_type & kaiser_beta, are not applicable in this
yading@10 11102 case.
yading@10 11103
yading@10 11104 =back
yading@10 11105
yading@10 11106
yading@10 11107
yading@10 11108 =item B<filter_size>
yading@10 11109
yading@10 11110 For swr only, set resampling filter size, default value is 32.
yading@10 11111
yading@10 11112
yading@10 11113 =item B<phase_shift>
yading@10 11114
yading@10 11115 For swr only, set resampling phase shift, default value is 10, and must be in
yading@10 11116 the interval [0,30].
yading@10 11117
yading@10 11118
yading@10 11119 =item B<linear_interp>
yading@10 11120
yading@10 11121 Use Linear Interpolation if set to 1, default value is 0.
yading@10 11122
yading@10 11123
yading@10 11124 =item B<cutoff>
yading@10 11125
yading@10 11126 Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
yading@10 11127 value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
yading@10 11128 (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
yading@10 11129
yading@10 11130
yading@10 11131 =item B<precision>
yading@10 11132
yading@10 11133 For soxr only, the precision in bits to which the resampled signal will be
yading@10 11134 calculated. The default value of 20 (which, with suitable dithering, is
yading@10 11135 appropriate for a destination bit-depth of 16) gives SoX's 'High Quality'; a
yading@10 11136 value of 28 gives SoX's 'Very High Quality'.
yading@10 11137
yading@10 11138
yading@10 11139 =item B<cheby>
yading@10 11140
yading@10 11141 For soxr only, selects passband rolloff none (Chebyshev) & higher-precision
yading@10 11142 approximation for 'irrational' ratios. Default value is 0.
yading@10 11143
yading@10 11144
yading@10 11145 =item B<async>
yading@10 11146
yading@10 11147 For swr only, simple 1 parameter audio sync to timestamps using stretching,
yading@10 11148 squeezing, filling and trimming. Setting this to 1 will enable filling and
yading@10 11149 trimming, larger values represent the maximum amount in samples that the data
yading@10 11150 may be stretched or squeezed for each second.
yading@10 11151 Default value is 0, thus no compensation is applied to make the samples match
yading@10 11152 the audio timestamps.
yading@10 11153
yading@10 11154
yading@10 11155 =item B<first_pts>
yading@10 11156
yading@10 11157 For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
yading@10 11158 This allows for padding/trimming at the start of stream. By default, no
yading@10 11159 assumption is made about the first frame's expected pts, so no padding or
yading@10 11160 trimming is done. For example, this could be set to 0 to pad the beginning with
yading@10 11161 silence if an audio stream starts after the video stream or to trim any samples
yading@10 11162 with a negative pts due to encoder delay.
yading@10 11163
yading@10 11164
yading@10 11165 =item B<min_comp>
yading@10 11166
yading@10 11167 For swr only, set the minimum difference between timestamps and audio data (in
yading@10 11168 seconds) to trigger stretching/squeezing/filling or trimming of the
yading@10 11169 data to make it match the timestamps. The default is that
yading@10 11170 stretching/squeezing/filling and trimming is disabled
yading@10 11171 (B<min_comp> = C<FLT_MAX>).
yading@10 11172
yading@10 11173
yading@10 11174 =item B<min_hard_comp>
yading@10 11175
yading@10 11176 For swr only, set the minimum difference between timestamps and audio data (in
yading@10 11177 seconds) to trigger adding/dropping samples to make it match the
yading@10 11178 timestamps. This option effectively is a threshold to select between
yading@10 11179 hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
yading@10 11180 all compensation is by default disabled through B<min_comp>.
yading@10 11181 The default is 0.1.
yading@10 11182
yading@10 11183
yading@10 11184 =item B<comp_duration>
yading@10 11185
yading@10 11186 For swr only, set duration (in seconds) over which data is stretched/squeezed
yading@10 11187 to make it match the timestamps. Must be a non-negative double float value,
yading@10 11188 default value is 1.0.
yading@10 11189
yading@10 11190
yading@10 11191 =item B<max_soft_comp>
yading@10 11192
yading@10 11193 For swr only, set maximum factor by which data is stretched/squeezed to make it
yading@10 11194 match the timestamps. Must be a non-negative double float value, default value
yading@10 11195 is 0.
yading@10 11196
yading@10 11197
yading@10 11198 =item B<matrix_encoding>
yading@10 11199
yading@10 11200 Select matrixed stereo encoding.
yading@10 11201
yading@10 11202 It accepts the following values:
yading@10 11203
yading@10 11204 =over 4
yading@10 11205
yading@10 11206
yading@10 11207 =item B<none>
yading@10 11208
yading@10 11209 select none
yading@10 11210
yading@10 11211 =item B<dolby>
yading@10 11212
yading@10 11213 select Dolby
yading@10 11214
yading@10 11215 =item B<dplii>
yading@10 11216
yading@10 11217 select Dolby Pro Logic II
yading@10 11218
yading@10 11219 =back
yading@10 11220
yading@10 11221
yading@10 11222 Default value is C<none>.
yading@10 11223
yading@10 11224
yading@10 11225 =item B<filter_type>
yading@10 11226
yading@10 11227 For swr only, select resampling filter type. This only affects resampling
yading@10 11228 operations.
yading@10 11229
yading@10 11230 It accepts the following values:
yading@10 11231
yading@10 11232 =over 4
yading@10 11233
yading@10 11234
yading@10 11235 =item B<cubic>
yading@10 11236
yading@10 11237 select cubic
yading@10 11238
yading@10 11239 =item B<blackman_nuttall>
yading@10 11240
yading@10 11241 select Blackman Nuttall Windowed Sinc
yading@10 11242
yading@10 11243 =item B<kaiser>
yading@10 11244
yading@10 11245 select Kaiser Windowed Sinc
yading@10 11246
yading@10 11247 =back
yading@10 11248
yading@10 11249
yading@10 11250
yading@10 11251 =item B<kaiser_beta>
yading@10 11252
yading@10 11253 For swr only, set Kaiser Window Beta value. Must be an integer in the
yading@10 11254 interval [2,16], default value is 9.
yading@10 11255
yading@10 11256
yading@10 11257 =back
yading@10 11258
yading@10 11259
yading@10 11260
yading@10 11261
yading@10 11262 =head1 SCALER OPTIONS
yading@10 11263
yading@10 11264
yading@10 11265 The video scaler supports the following named options.
yading@10 11266
yading@10 11267 Options may be set by specifying -I<option> I<value> in the
yading@10 11268 FFmpeg tools. For programmatic use, they can be set explicitly in the
yading@10 11269 C<SwsContext> options or through the F<libavutil/opt.h> API.
yading@10 11270
yading@10 11271
yading@10 11272 =over 4
yading@10 11273
yading@10 11274
yading@10 11275
yading@10 11276 =item B<sws_flags>
yading@10 11277
yading@10 11278 Set the scaler flags. This is also used to set the scaling
yading@10 11279 algorithm. Only a single algorithm should be selected.
yading@10 11280
yading@10 11281 It accepts the following values:
yading@10 11282
yading@10 11283 =over 4
yading@10 11284
yading@10 11285
yading@10 11286 =item B<fast_bilinear>
yading@10 11287
yading@10 11288 Select fast bilinear scaling algorithm.
yading@10 11289
yading@10 11290
yading@10 11291 =item B<bilinear>
yading@10 11292
yading@10 11293 Select bilinear scaling algorithm.
yading@10 11294
yading@10 11295
yading@10 11296 =item B<bicubic>
yading@10 11297
yading@10 11298 Select bicubic scaling algorithm.
yading@10 11299
yading@10 11300
yading@10 11301 =item B<experimental>
yading@10 11302
yading@10 11303 Select experimental scaling algorithm.
yading@10 11304
yading@10 11305
yading@10 11306 =item B<neighbor>
yading@10 11307
yading@10 11308 Select nearest neighbor rescaling algorithm.
yading@10 11309
yading@10 11310
yading@10 11311 =item B<area>
yading@10 11312
yading@10 11313 Select averaging area rescaling algorithm.
yading@10 11314
yading@10 11315
yading@10 11316 =item B<bicubiclin>
yading@10 11317
yading@10 11318 Select bicubic scaling algorithm for the luma component, bilinear for
yading@10 11319 chroma components.
yading@10 11320
yading@10 11321
yading@10 11322 =item B<gauss>
yading@10 11323
yading@10 11324 Select Gaussian rescaling algorithm.
yading@10 11325
yading@10 11326
yading@10 11327 =item B<sinc>
yading@10 11328
yading@10 11329 Select sinc rescaling algorithm.
yading@10 11330
yading@10 11331
yading@10 11332 =item B<lanczos>
yading@10 11333
yading@10 11334 Select lanczos rescaling algorithm.
yading@10 11335
yading@10 11336
yading@10 11337 =item B<spline>
yading@10 11338
yading@10 11339 Select natural bicubic spline rescaling algorithm.
yading@10 11340
yading@10 11341
yading@10 11342 =item B<print_info>
yading@10 11343
yading@10 11344 Enable printing/debug logging.
yading@10 11345
yading@10 11346
yading@10 11347 =item B<accurate_rnd>
yading@10 11348
yading@10 11349 Enable accurate rounding.
yading@10 11350
yading@10 11351
yading@10 11352 =item B<full_chroma_int>
yading@10 11353
yading@10 11354 Enable full chroma interpolation.
yading@10 11355
yading@10 11356
yading@10 11357 =item B<full_chroma_inp>
yading@10 11358
yading@10 11359 Select full chroma input.
yading@10 11360
yading@10 11361
yading@10 11362 =item B<bitexact>
yading@10 11363
yading@10 11364 Enable bitexact output.
yading@10 11365
yading@10 11366 =back
yading@10 11367
yading@10 11368
yading@10 11369
yading@10 11370 =item B<srcw>
yading@10 11371
yading@10 11372 Set source width.
yading@10 11373
yading@10 11374
yading@10 11375 =item B<srch>
yading@10 11376
yading@10 11377 Set source height.
yading@10 11378
yading@10 11379
yading@10 11380 =item B<dstw>
yading@10 11381
yading@10 11382 Set destination width.
yading@10 11383
yading@10 11384
yading@10 11385 =item B<dsth>
yading@10 11386
yading@10 11387 Set destination height.
yading@10 11388
yading@10 11389
yading@10 11390 =item B<src_format>
yading@10 11391
yading@10 11392 Set source pixel format (must be expressed as an integer).
yading@10 11393
yading@10 11394
yading@10 11395 =item B<dst_format>
yading@10 11396
yading@10 11397 Set destination pixel format (must be expressed as an integer).
yading@10 11398
yading@10 11399
yading@10 11400 =item B<src_range>
yading@10 11401
yading@10 11402 Select source range.
yading@10 11403
yading@10 11404
yading@10 11405 =item B<dst_range>
yading@10 11406
yading@10 11407 Select destination range.
yading@10 11408
yading@10 11409
yading@10 11410 =item B<param0, param1>
yading@10 11411
yading@10 11412 Set scaling algorithm parameters. The specified values are specific of
yading@10 11413 some scaling algorithms and ignored by others. The specified values
yading@10 11414 are floating point number values.
yading@10 11415
yading@10 11416
yading@10 11417 =back
yading@10 11418
yading@10 11419
yading@10 11420
yading@10 11421
yading@10 11422 =head1 FILTERING INTRODUCTION
yading@10 11423
yading@10 11424
yading@10 11425 Filtering in FFmpeg is enabled through the libavfilter library.
yading@10 11426
yading@10 11427 In libavfilter, a filter can have multiple inputs and multiple
yading@10 11428 outputs.
yading@10 11429 To illustrate the sorts of things that are possible, we consider the
yading@10 11430 following filtergraph.
yading@10 11431
yading@10 11432
yading@10 11433 input --> split ---------------------> overlay --> output
yading@10 11434 | ^
yading@10 11435 | |
yading@10 11436 +-----> crop --> vflip -------+
yading@10 11437
yading@10 11438
yading@10 11439 This filtergraph splits the input stream in two streams, sends one
yading@10 11440 stream through the crop filter and the vflip filter before merging it
yading@10 11441 back with the other stream by overlaying it on top. You can use the
yading@10 11442 following command to achieve this:
yading@10 11443
yading@10 11444
yading@10 11445 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 11446
yading@10 11447
yading@10 11448 The result will be that in output the top half of the video is mirrored
yading@10 11449 onto the bottom half.
yading@10 11450
yading@10 11451 Filters in the same linear chain are separated by commas, and distinct
yading@10 11452 linear chains of filters are separated by semicolons. In our example,
yading@10 11453 I<crop,vflip> are in one linear chain, I<split> and
yading@10 11454 I<overlay> are separately in another. The points where the linear
yading@10 11455 chains join are labelled by names enclosed in square brackets. In the
yading@10 11456 example, the split filter generates two outputs that are associated to
yading@10 11457 the labels I<[main]> and I<[tmp]>.
yading@10 11458
yading@10 11459 The stream sent to the second output of I<split>, labelled as
yading@10 11460 I<[tmp]>, is processed through the I<crop> filter, which crops
yading@10 11461 away the lower half part of the video, and then vertically flipped. The
yading@10 11462 I<overlay> filter takes in input the first unchanged output of the
yading@10 11463 split filter (which was labelled as I<[main]>), and overlay on its
yading@10 11464 lower half the output generated by the I<crop,vflip> filterchain.
yading@10 11465
yading@10 11466 Some filters take in input a list of parameters: they are specified
yading@10 11467 after the filter name and an equal sign, and are separated from each other
yading@10 11468 by a colon.
yading@10 11469
yading@10 11470 There exist so-called I<source filters> that do not have an
yading@10 11471 audio/video input, and I<sink filters> that will not have audio/video
yading@10 11472 output.
yading@10 11473
yading@10 11474
yading@10 11475
yading@10 11476 =head1 GRAPH
yading@10 11477
yading@10 11478
yading@10 11479 The F<graph2dot> program included in the FFmpeg F<tools>
yading@10 11480 directory can be used to parse a filtergraph description and issue a
yading@10 11481 corresponding textual representation in the dot language.
yading@10 11482
yading@10 11483 Invoke the command:
yading@10 11484
yading@10 11485 graph2dot -h
yading@10 11486
yading@10 11487
yading@10 11488 to see how to use F<graph2dot>.
yading@10 11489
yading@10 11490 You can then pass the dot description to the F<dot> program (from
yading@10 11491 the graphviz suite of programs) and obtain a graphical representation
yading@10 11492 of the filtergraph.
yading@10 11493
yading@10 11494 For example the sequence of commands:
yading@10 11495
yading@10 11496 echo <GRAPH_DESCRIPTION> | \
yading@10 11497 tools/graph2dot -o graph.tmp && \
yading@10 11498 dot -Tpng graph.tmp -o graph.png && \
yading@10 11499 display graph.png
yading@10 11500
yading@10 11501
yading@10 11502 can be used to create and display an image representing the graph
yading@10 11503 described by the I<GRAPH_DESCRIPTION> string. Note that this string must be
yading@10 11504 a complete self-contained graph, with its inputs and outputs explicitly defined.
yading@10 11505 For example if your command line is of the form:
yading@10 11506
yading@10 11507 ffmpeg -i infile -vf scale=640:360 outfile
yading@10 11508
yading@10 11509 your I<GRAPH_DESCRIPTION> string will need to be of the form:
yading@10 11510
yading@10 11511 nullsrc,scale=640:360,nullsink
yading@10 11512
yading@10 11513 you may also need to set the I<nullsrc> parameters and add a I<format>
yading@10 11514 filter in order to simulate a specific input file.
yading@10 11515
yading@10 11516
yading@10 11517
yading@10 11518 =head1 FILTERGRAPH DESCRIPTION
yading@10 11519
yading@10 11520
yading@10 11521 A filtergraph is a directed graph of connected filters. It can contain
yading@10 11522 cycles, and there can be multiple links between a pair of
yading@10 11523 filters. Each link has one input pad on one side connecting it to one
yading@10 11524 filter from which it takes its input, and one output pad on the other
yading@10 11525 side connecting it to the one filter accepting its output.
yading@10 11526
yading@10 11527 Each filter in a filtergraph is an instance of a filter class
yading@10 11528 registered in the application, which defines the features and the
yading@10 11529 number of input and output pads of the filter.
yading@10 11530
yading@10 11531 A filter with no input pads is called a "source", a filter with no
yading@10 11532 output pads is called a "sink".
yading@10 11533
yading@10 11534
yading@10 11535
yading@10 11536 =head2 Filtergraph syntax
yading@10 11537
yading@10 11538
yading@10 11539 A filtergraph can be represented using a textual representation, which is
yading@10 11540 recognized by the B<-filter>/B<-vf> and B<-filter_complex>
yading@10 11541 options in B<ffmpeg> and B<-vf> in B<ffplay>, and by the
yading@10 11542 C<avfilter_graph_parse()>/C<avfilter_graph_parse2()> function defined in
yading@10 11543 F<libavfilter/avfilter.h>.
yading@10 11544
yading@10 11545 A filterchain consists of a sequence of connected filters, each one
yading@10 11546 connected to the previous one in the sequence. A filterchain is
yading@10 11547 represented by a list of ","-separated filter descriptions.
yading@10 11548
yading@10 11549 A filtergraph consists of a sequence of filterchains. A sequence of
yading@10 11550 filterchains is represented by a list of ";"-separated filterchain
yading@10 11551 descriptions.
yading@10 11552
yading@10 11553 A filter is represented by a string of the form:
yading@10 11554 [I<in_link_1>]...[I<in_link_N>]I<filter_name>=I<arguments>[I<out_link_1>]...[I<out_link_M>]
yading@10 11555
yading@10 11556 I<filter_name> is the name of the filter class of which the
yading@10 11557 described filter is an instance of, and has to be the name of one of
yading@10 11558 the filter classes registered in the program.
yading@10 11559 The name of the filter class is optionally followed by a string
yading@10 11560 "=I<arguments>".
yading@10 11561
yading@10 11562 I<arguments> is a string which contains the parameters used to
yading@10 11563 initialize the filter instance. It may have one of the following forms:
yading@10 11564
yading@10 11565 =over 4
yading@10 11566
yading@10 11567
yading@10 11568
yading@10 11569 =item *
yading@10 11570
yading@10 11571 A ':'-separated list of I<key=value> pairs.
yading@10 11572
yading@10 11573
yading@10 11574 =item *
yading@10 11575
yading@10 11576 A ':'-separated list of I<value>. In this case, the keys are assumed to be
yading@10 11577 the option names in the order they are declared. E.g. the C<fade> filter
yading@10 11578 declares three options in this order -- B<type>, B<start_frame> and
yading@10 11579 B<nb_frames>. Then the parameter list I<in:0:30> means that the value
yading@10 11580 I<in> is assigned to the option B<type>, I<0> to
yading@10 11581 B<start_frame> and I<30> to B<nb_frames>.
yading@10 11582
yading@10 11583
yading@10 11584 =item *
yading@10 11585
yading@10 11586 A ':'-separated list of mixed direct I<value> and long I<key=value>
yading@10 11587 pairs. The direct I<value> must precede the I<key=value> pairs, and
yading@10 11588 follow the same constraints order of the previous point. The following
yading@10 11589 I<key=value> pairs can be set in any preferred order.
yading@10 11590
yading@10 11591
yading@10 11592 =back
yading@10 11593
yading@10 11594
yading@10 11595 If the option value itself is a list of items (e.g. the C<format> filter
yading@10 11596 takes a list of pixel formats), the items in the list are usually separated by
yading@10 11597 '|'.
yading@10 11598
yading@10 11599 The list of arguments can be quoted using the character "'" as initial
yading@10 11600 and ending mark, and the character '\' for escaping the characters
yading@10 11601 within the quoted text; otherwise the argument string is considered
yading@10 11602 terminated when the next special character (belonging to the set
yading@10 11603 "[]=;,") is encountered.
yading@10 11604
yading@10 11605 The name and arguments of the filter are optionally preceded and
yading@10 11606 followed by a list of link labels.
yading@10 11607 A link label allows to name a link and associate it to a filter output
yading@10 11608 or input pad. The preceding labels I<in_link_1>
yading@10 11609 ... I<in_link_N>, are associated to the filter input pads,
yading@10 11610 the following labels I<out_link_1> ... I<out_link_M>, are
yading@10 11611 associated to the output pads.
yading@10 11612
yading@10 11613 When two link labels with the same name are found in the
yading@10 11614 filtergraph, a link between the corresponding input and output pad is
yading@10 11615 created.
yading@10 11616
yading@10 11617 If an output pad is not labelled, it is linked by default to the first
yading@10 11618 unlabelled input pad of the next filter in the filterchain.
yading@10 11619 For example in the filterchain:
yading@10 11620
yading@10 11621 nullsrc, split[L1], [L2]overlay, nullsink
yading@10 11622
yading@10 11623 the split filter instance has two output pads, and the overlay filter
yading@10 11624 instance two input pads. The first output pad of split is labelled
yading@10 11625 "L1", the first input pad of overlay is labelled "L2", and the second
yading@10 11626 output pad of split is linked to the second input pad of overlay,
yading@10 11627 which are both unlabelled.
yading@10 11628
yading@10 11629 In a complete filterchain all the unlabelled filter input and output
yading@10 11630 pads must be connected. A filtergraph is considered valid if all the
yading@10 11631 filter input and output pads of all the filterchains are connected.
yading@10 11632
yading@10 11633 Libavfilter will automatically insert scale filters where format
yading@10 11634 conversion is required. It is possible to specify swscale flags
yading@10 11635 for those automatically inserted scalers by prepending
yading@10 11636 C<sws_flags=I<flags>;>
yading@10 11637 to the filtergraph description.
yading@10 11638
yading@10 11639 Follows a BNF description for the filtergraph syntax:
yading@10 11640
yading@10 11641 <NAME> ::= sequence of alphanumeric characters and '_'
yading@10 11642 <LINKLABEL> ::= "[" <NAME> "]"
yading@10 11643 <LINKLABELS> ::= <LINKLABEL> [<LINKLABELS>]
yading@10 11644 <FILTER_ARGUMENTS> ::= sequence of chars (eventually quoted)
yading@10 11645 <FILTER> ::= [<LINKLABELS>] <NAME> ["=" <FILTER_ARGUMENTS>] [<LINKLABELS>]
yading@10 11646 <FILTERCHAIN> ::= <FILTER> [,<FILTERCHAIN>]
yading@10 11647 <FILTERGRAPH> ::= [sws_flags=<flags>;] <FILTERCHAIN> [;<FILTERGRAPH>]
yading@10 11648
yading@10 11649
yading@10 11650
yading@10 11651 =head2 Notes on filtergraph escaping
yading@10 11652
yading@10 11653
yading@10 11654 Some filter arguments require the use of special characters, typically
yading@10 11655 C<:> to separate key=value pairs in a named options list. In this
yading@10 11656 case the user should perform a first level escaping when specifying
yading@10 11657 the filter arguments. For example, consider the following literal
yading@10 11658 string to be embedded in the drawtext filter arguments:
yading@10 11659
yading@10 11660 this is a 'string': may contain one, or more, special characters
yading@10 11661
yading@10 11662
yading@10 11663 Since C<:> is special for the filter arguments syntax, it needs to
yading@10 11664 be escaped, so you get:
yading@10 11665
yading@10 11666 text=this is a \'string\'\: may contain one, or more, special characters
yading@10 11667
yading@10 11668
yading@10 11669 A second level of escaping is required when embedding the filter
yading@10 11670 arguments in a filtergraph description, in order to escape all the
yading@10 11671 filtergraph special characters. Thus the example above becomes:
yading@10 11672
yading@10 11673 drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
yading@10 11674
yading@10 11675
yading@10 11676 Finally an additional level of escaping may be needed when writing the
yading@10 11677 filtergraph description in a shell command, which depends on the
yading@10 11678 escaping rules of the adopted shell. For example, assuming that
yading@10 11679 C<\> is special and needs to be escaped with another C<\>, the
yading@10 11680 previous string will finally result in:
yading@10 11681
yading@10 11682 -vf "drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters"
yading@10 11683
yading@10 11684
yading@10 11685 Sometimes, it might be more convenient to employ quoting in place of
yading@10 11686 escaping. For example the string:
yading@10 11687
yading@10 11688 Caesar: tu quoque, Brute, fili mi
yading@10 11689
yading@10 11690
yading@10 11691 Can be quoted in the filter arguments as:
yading@10 11692
yading@10 11693 text='Caesar: tu quoque, Brute, fili mi'
yading@10 11694
yading@10 11695
yading@10 11696 And finally inserted in a filtergraph like:
yading@10 11697
yading@10 11698 drawtext=text=\'Caesar: tu quoque\, Brute\, fili mi\'
yading@10 11699
yading@10 11700
yading@10 11701 See the ``Quoting and escaping'' section in the ffmpeg-utils manual
yading@10 11702 for more information about the escaping and quoting rules adopted by
yading@10 11703 FFmpeg.
yading@10 11704
yading@10 11705
yading@10 11706
yading@10 11707 =head1 AUDIO FILTERS
yading@10 11708
yading@10 11709
yading@10 11710 When you configure your FFmpeg build, you can disable any of the
yading@10 11711 existing filters using C<--disable-filters>.
yading@10 11712 The configure output will show the audio filters included in your
yading@10 11713 build.
yading@10 11714
yading@10 11715 Below is a description of the currently available audio filters.
yading@10 11716
yading@10 11717
yading@10 11718 =head2 aconvert
yading@10 11719
yading@10 11720
yading@10 11721 Convert the input audio format to the specified formats.
yading@10 11722
yading@10 11723 I<This filter is deprecated. Use aformat> instead.
yading@10 11724
yading@10 11725 The filter accepts a string of the form:
yading@10 11726 "I<sample_format>:I<channel_layout>".
yading@10 11727
yading@10 11728 I<sample_format> specifies the sample format, and can be a string or the
yading@10 11729 corresponding numeric value defined in F<libavutil/samplefmt.h>. Use 'p'
yading@10 11730 suffix for a planar sample format.
yading@10 11731
yading@10 11732 I<channel_layout> specifies the channel layout, and can be a string
yading@10 11733 or the corresponding number value defined in F<libavutil/channel_layout.h>.
yading@10 11734
yading@10 11735 The special parameter "auto", signifies that the filter will
yading@10 11736 automatically select the output format depending on the output filter.
yading@10 11737
yading@10 11738
yading@10 11739 =head3 Examples
yading@10 11740
yading@10 11741
yading@10 11742
yading@10 11743 =over 4
yading@10 11744
yading@10 11745
yading@10 11746 =item *
yading@10 11747
yading@10 11748 Convert input to float, planar, stereo:
yading@10 11749
yading@10 11750 aconvert=fltp:stereo
yading@10 11751
yading@10 11752
yading@10 11753
yading@10 11754 =item *
yading@10 11755
yading@10 11756 Convert input to unsigned 8-bit, automatically select out channel layout:
yading@10 11757
yading@10 11758 aconvert=u8:auto
yading@10 11759
yading@10 11760
yading@10 11761 =back
yading@10 11762
yading@10 11763
yading@10 11764
yading@10 11765 =head2 allpass
yading@10 11766
yading@10 11767
yading@10 11768 Apply a two-pole all-pass filter with central frequency (in Hz)
yading@10 11769 I<frequency>, and filter-width I<width>.
yading@10 11770 An all-pass filter changes the audio's frequency to phase relationship
yading@10 11771 without changing its frequency to amplitude relationship.
yading@10 11772
yading@10 11773 The filter accepts the following options:
yading@10 11774
yading@10 11775
yading@10 11776 =over 4
yading@10 11777
yading@10 11778
yading@10 11779 =item B<frequency, f>
yading@10 11780
yading@10 11781 Set frequency in Hz.
yading@10 11782
yading@10 11783
yading@10 11784 =item B<width_type>
yading@10 11785
yading@10 11786 Set method to specify band-width of filter.
yading@10 11787
yading@10 11788 =over 4
yading@10 11789
yading@10 11790
yading@10 11791 =item B<h>
yading@10 11792
yading@10 11793 Hz
yading@10 11794
yading@10 11795 =item B<q>
yading@10 11796
yading@10 11797 Q-Factor
yading@10 11798
yading@10 11799 =item B<o>
yading@10 11800
yading@10 11801 octave
yading@10 11802
yading@10 11803 =item B<s>
yading@10 11804
yading@10 11805 slope
yading@10 11806
yading@10 11807 =back
yading@10 11808
yading@10 11809
yading@10 11810
yading@10 11811 =item B<width, w>
yading@10 11812
yading@10 11813 Specify the band-width of a filter in width_type units.
yading@10 11814
yading@10 11815 =back
yading@10 11816
yading@10 11817
yading@10 11818
yading@10 11819 =head2 highpass
yading@10 11820
yading@10 11821
yading@10 11822 Apply a high-pass filter with 3dB point frequency.
yading@10 11823 The filter can be either single-pole, or double-pole (the default).
yading@10 11824 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
yading@10 11825
yading@10 11826 The filter accepts the following options:
yading@10 11827
yading@10 11828
yading@10 11829 =over 4
yading@10 11830
yading@10 11831
yading@10 11832 =item B<frequency, f>
yading@10 11833
yading@10 11834 Set frequency in Hz. Default is 3000.
yading@10 11835
yading@10 11836
yading@10 11837 =item B<poles, p>
yading@10 11838
yading@10 11839 Set number of poles. Default is 2.
yading@10 11840
yading@10 11841
yading@10 11842 =item B<width_type>
yading@10 11843
yading@10 11844 Set method to specify band-width of filter.
yading@10 11845
yading@10 11846 =over 4
yading@10 11847
yading@10 11848
yading@10 11849 =item B<h>
yading@10 11850
yading@10 11851 Hz
yading@10 11852
yading@10 11853 =item B<q>
yading@10 11854
yading@10 11855 Q-Factor
yading@10 11856
yading@10 11857 =item B<o>
yading@10 11858
yading@10 11859 octave
yading@10 11860
yading@10 11861 =item B<s>
yading@10 11862
yading@10 11863 slope
yading@10 11864
yading@10 11865 =back
yading@10 11866
yading@10 11867
yading@10 11868
yading@10 11869 =item B<width, w>
yading@10 11870
yading@10 11871 Specify the band-width of a filter in width_type units.
yading@10 11872 Applies only to double-pole filter.
yading@10 11873 The default is 0.707q and gives a Butterworth response.
yading@10 11874
yading@10 11875 =back
yading@10 11876
yading@10 11877
yading@10 11878
yading@10 11879 =head2 lowpass
yading@10 11880
yading@10 11881
yading@10 11882 Apply a low-pass filter with 3dB point frequency.
yading@10 11883 The filter can be either single-pole or double-pole (the default).
yading@10 11884 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
yading@10 11885
yading@10 11886 The filter accepts the following options:
yading@10 11887
yading@10 11888
yading@10 11889 =over 4
yading@10 11890
yading@10 11891
yading@10 11892 =item B<frequency, f>
yading@10 11893
yading@10 11894 Set frequency in Hz. Default is 500.
yading@10 11895
yading@10 11896
yading@10 11897 =item B<poles, p>
yading@10 11898
yading@10 11899 Set number of poles. Default is 2.
yading@10 11900
yading@10 11901
yading@10 11902 =item B<width_type>
yading@10 11903
yading@10 11904 Set method to specify band-width of filter.
yading@10 11905
yading@10 11906 =over 4
yading@10 11907
yading@10 11908
yading@10 11909 =item B<h>
yading@10 11910
yading@10 11911 Hz
yading@10 11912
yading@10 11913 =item B<q>
yading@10 11914
yading@10 11915 Q-Factor
yading@10 11916
yading@10 11917 =item B<o>
yading@10 11918
yading@10 11919 octave
yading@10 11920
yading@10 11921 =item B<s>
yading@10 11922
yading@10 11923 slope
yading@10 11924
yading@10 11925 =back
yading@10 11926
yading@10 11927
yading@10 11928
yading@10 11929 =item B<width, w>
yading@10 11930
yading@10 11931 Specify the band-width of a filter in width_type units.
yading@10 11932 Applies only to double-pole filter.
yading@10 11933 The default is 0.707q and gives a Butterworth response.
yading@10 11934
yading@10 11935 =back
yading@10 11936
yading@10 11937
yading@10 11938
yading@10 11939 =head2 bass
yading@10 11940
yading@10 11941
yading@10 11942 Boost or cut the bass (lower) frequencies of the audio using a two-pole
yading@10 11943 shelving filter with a response similar to that of a standard
yading@10 11944 hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
yading@10 11945
yading@10 11946 The filter accepts the following options:
yading@10 11947
yading@10 11948
yading@10 11949 =over 4
yading@10 11950
yading@10 11951
yading@10 11952 =item B<gain, g>
yading@10 11953
yading@10 11954 Give the gain at 0 Hz. Its useful range is about -20
yading@10 11955 (for a large cut) to +20 (for a large boost).
yading@10 11956 Beware of clipping when using a positive gain.
yading@10 11957
yading@10 11958
yading@10 11959 =item B<frequency, f>
yading@10 11960
yading@10 11961 Set the filter's central frequency and so can be used
yading@10 11962 to extend or reduce the frequency range to be boosted or cut.
yading@10 11963 The default value is C<100> Hz.
yading@10 11964
yading@10 11965
yading@10 11966 =item B<width_type>
yading@10 11967
yading@10 11968 Set method to specify band-width of filter.
yading@10 11969
yading@10 11970 =over 4
yading@10 11971
yading@10 11972
yading@10 11973 =item B<h>
yading@10 11974
yading@10 11975 Hz
yading@10 11976
yading@10 11977 =item B<q>
yading@10 11978
yading@10 11979 Q-Factor
yading@10 11980
yading@10 11981 =item B<o>
yading@10 11982
yading@10 11983 octave
yading@10 11984
yading@10 11985 =item B<s>
yading@10 11986
yading@10 11987 slope
yading@10 11988
yading@10 11989 =back
yading@10 11990
yading@10 11991
yading@10 11992
yading@10 11993 =item B<width, w>
yading@10 11994
yading@10 11995 Determine how steep is the filter's shelf transition.
yading@10 11996
yading@10 11997 =back
yading@10 11998
yading@10 11999
yading@10 12000
yading@10 12001 =head2 treble
yading@10 12002
yading@10 12003
yading@10 12004 Boost or cut treble (upper) frequencies of the audio using a two-pole
yading@10 12005 shelving filter with a response similar to that of a standard
yading@10 12006 hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
yading@10 12007
yading@10 12008 The filter accepts the following options:
yading@10 12009
yading@10 12010
yading@10 12011 =over 4
yading@10 12012
yading@10 12013
yading@10 12014 =item B<gain, g>
yading@10 12015
yading@10 12016 Give the gain at whichever is the lower of ~22 kHz and the
yading@10 12017 Nyquist frequency. Its useful range is about -20 (for a large cut)
yading@10 12018 to +20 (for a large boost). Beware of clipping when using a positive gain.
yading@10 12019
yading@10 12020
yading@10 12021 =item B<frequency, f>
yading@10 12022
yading@10 12023 Set the filter's central frequency and so can be used
yading@10 12024 to extend or reduce the frequency range to be boosted or cut.
yading@10 12025 The default value is C<3000> Hz.
yading@10 12026
yading@10 12027
yading@10 12028 =item B<width_type>
yading@10 12029
yading@10 12030 Set method to specify band-width of filter.
yading@10 12031
yading@10 12032 =over 4
yading@10 12033
yading@10 12034
yading@10 12035 =item B<h>
yading@10 12036
yading@10 12037 Hz
yading@10 12038
yading@10 12039 =item B<q>
yading@10 12040
yading@10 12041 Q-Factor
yading@10 12042
yading@10 12043 =item B<o>
yading@10 12044
yading@10 12045 octave
yading@10 12046
yading@10 12047 =item B<s>
yading@10 12048
yading@10 12049 slope
yading@10 12050
yading@10 12051 =back
yading@10 12052
yading@10 12053
yading@10 12054
yading@10 12055 =item B<width, w>
yading@10 12056
yading@10 12057 Determine how steep is the filter's shelf transition.
yading@10 12058
yading@10 12059 =back
yading@10 12060
yading@10 12061
yading@10 12062
yading@10 12063 =head2 bandpass
yading@10 12064
yading@10 12065
yading@10 12066 Apply a two-pole Butterworth band-pass filter with central
yading@10 12067 frequency I<frequency>, and (3dB-point) band-width width.
yading@10 12068 The I<csg> option selects a constant skirt gain (peak gain = Q)
yading@10 12069 instead of the default: constant 0dB peak gain.
yading@10 12070 The filter roll off at 6dB per octave (20dB per decade).
yading@10 12071
yading@10 12072 The filter accepts the following options:
yading@10 12073
yading@10 12074
yading@10 12075 =over 4
yading@10 12076
yading@10 12077
yading@10 12078 =item B<frequency, f>
yading@10 12079
yading@10 12080 Set the filter's central frequency. Default is C<3000>.
yading@10 12081
yading@10 12082
yading@10 12083 =item B<csg>
yading@10 12084
yading@10 12085 Constant skirt gain if set to 1. Defaults to 0.
yading@10 12086
yading@10 12087
yading@10 12088 =item B<width_type>
yading@10 12089
yading@10 12090 Set method to specify band-width of filter.
yading@10 12091
yading@10 12092 =over 4
yading@10 12093
yading@10 12094
yading@10 12095 =item B<h>
yading@10 12096
yading@10 12097 Hz
yading@10 12098
yading@10 12099 =item B<q>
yading@10 12100
yading@10 12101 Q-Factor
yading@10 12102
yading@10 12103 =item B<o>
yading@10 12104
yading@10 12105 octave
yading@10 12106
yading@10 12107 =item B<s>
yading@10 12108
yading@10 12109 slope
yading@10 12110
yading@10 12111 =back
yading@10 12112
yading@10 12113
yading@10 12114
yading@10 12115 =item B<width, w>
yading@10 12116
yading@10 12117 Specify the band-width of a filter in width_type units.
yading@10 12118
yading@10 12119 =back
yading@10 12120
yading@10 12121
yading@10 12122
yading@10 12123 =head2 bandreject
yading@10 12124
yading@10 12125
yading@10 12126 Apply a two-pole Butterworth band-reject filter with central
yading@10 12127 frequency I<frequency>, and (3dB-point) band-width I<width>.
yading@10 12128 The filter roll off at 6dB per octave (20dB per decade).
yading@10 12129
yading@10 12130 The filter accepts the following options:
yading@10 12131
yading@10 12132
yading@10 12133 =over 4
yading@10 12134
yading@10 12135
yading@10 12136 =item B<frequency, f>
yading@10 12137
yading@10 12138 Set the filter's central frequency. Default is C<3000>.
yading@10 12139
yading@10 12140
yading@10 12141 =item B<width_type>
yading@10 12142
yading@10 12143 Set method to specify band-width of filter.
yading@10 12144
yading@10 12145 =over 4
yading@10 12146
yading@10 12147
yading@10 12148 =item B<h>
yading@10 12149
yading@10 12150 Hz
yading@10 12151
yading@10 12152 =item B<q>
yading@10 12153
yading@10 12154 Q-Factor
yading@10 12155
yading@10 12156 =item B<o>
yading@10 12157
yading@10 12158 octave
yading@10 12159
yading@10 12160 =item B<s>
yading@10 12161
yading@10 12162 slope
yading@10 12163
yading@10 12164 =back
yading@10 12165
yading@10 12166
yading@10 12167
yading@10 12168 =item B<width, w>
yading@10 12169
yading@10 12170 Specify the band-width of a filter in width_type units.
yading@10 12171
yading@10 12172 =back
yading@10 12173
yading@10 12174
yading@10 12175
yading@10 12176 =head2 biquad
yading@10 12177
yading@10 12178
yading@10 12179 Apply a biquad IIR filter with the given coefficients.
yading@10 12180 Where I<b0>, I<b1>, I<b2> and I<a0>, I<a1>, I<a2>
yading@10 12181 are the numerator and denominator coefficients respectively.
yading@10 12182
yading@10 12183
yading@10 12184 =head2 equalizer
yading@10 12185
yading@10 12186
yading@10 12187 Apply a two-pole peaking equalisation (EQ) filter. With this
yading@10 12188 filter, the signal-level at and around a selected frequency can
yading@10 12189 be increased or decreased, whilst (unlike bandpass and bandreject
yading@10 12190 filters) that at all other frequencies is unchanged.
yading@10 12191
yading@10 12192 In order to produce complex equalisation curves, this filter can
yading@10 12193 be given several times, each with a different central frequency.
yading@10 12194
yading@10 12195 The filter accepts the following options:
yading@10 12196
yading@10 12197
yading@10 12198 =over 4
yading@10 12199
yading@10 12200
yading@10 12201 =item B<frequency, f>
yading@10 12202
yading@10 12203 Set the filter's central frequency in Hz.
yading@10 12204
yading@10 12205
yading@10 12206 =item B<width_type>
yading@10 12207
yading@10 12208 Set method to specify band-width of filter.
yading@10 12209
yading@10 12210 =over 4
yading@10 12211
yading@10 12212
yading@10 12213 =item B<h>
yading@10 12214
yading@10 12215 Hz
yading@10 12216
yading@10 12217 =item B<q>
yading@10 12218
yading@10 12219 Q-Factor
yading@10 12220
yading@10 12221 =item B<o>
yading@10 12222
yading@10 12223 octave
yading@10 12224
yading@10 12225 =item B<s>
yading@10 12226
yading@10 12227 slope
yading@10 12228
yading@10 12229 =back
yading@10 12230
yading@10 12231
yading@10 12232
yading@10 12233 =item B<width, w>
yading@10 12234
yading@10 12235 Specify the band-width of a filter in width_type units.
yading@10 12236
yading@10 12237
yading@10 12238 =item B<gain, g>
yading@10 12239
yading@10 12240 Set the required gain or attenuation in dB.
yading@10 12241 Beware of clipping when using a positive gain.
yading@10 12242
yading@10 12243 =back
yading@10 12244
yading@10 12245
yading@10 12246
yading@10 12247 =head2 afade
yading@10 12248
yading@10 12249
yading@10 12250 Apply fade-in/out effect to input audio.
yading@10 12251
yading@10 12252 A description of the accepted parameters follows.
yading@10 12253
yading@10 12254
yading@10 12255 =over 4
yading@10 12256
yading@10 12257
yading@10 12258 =item B<type, t>
yading@10 12259
yading@10 12260 Specify the effect type, can be either C<in> for fade-in, or
yading@10 12261 C<out> for a fade-out effect. Default is C<in>.
yading@10 12262
yading@10 12263
yading@10 12264 =item B<start_sample, ss>
yading@10 12265
yading@10 12266 Specify the number of the start sample for starting to apply the fade
yading@10 12267 effect. Default is 0.
yading@10 12268
yading@10 12269
yading@10 12270 =item B<nb_samples, ns>
yading@10 12271
yading@10 12272 Specify the number of samples for which the fade effect has to last. At
yading@10 12273 the end of the fade-in effect the output audio will have the same
yading@10 12274 volume as the input audio, at the end of the fade-out transition
yading@10 12275 the output audio will be silence. Default is 44100.
yading@10 12276
yading@10 12277
yading@10 12278 =item B<start_time, st>
yading@10 12279
yading@10 12280 Specify time for starting to apply the fade effect. Default is 0.
yading@10 12281 The accepted syntax is:
yading@10 12282
yading@10 12283 [-]HH[:MM[:SS[.m...]]]
yading@10 12284 [-]S+[.m...]
yading@10 12285
yading@10 12286 See also the function C<av_parse_time()>.
yading@10 12287 If set this option is used instead of I<start_sample> one.
yading@10 12288
yading@10 12289
yading@10 12290 =item B<duration, d>
yading@10 12291
yading@10 12292 Specify the duration for which the fade effect has to last. Default is 0.
yading@10 12293 The accepted syntax is:
yading@10 12294
yading@10 12295 [-]HH[:MM[:SS[.m...]]]
yading@10 12296 [-]S+[.m...]
yading@10 12297
yading@10 12298 See also the function C<av_parse_time()>.
yading@10 12299 At the end of the fade-in effect the output audio will have the same
yading@10 12300 volume as the input audio, at the end of the fade-out transition
yading@10 12301 the output audio will be silence.
yading@10 12302 If set this option is used instead of I<nb_samples> one.
yading@10 12303
yading@10 12304
yading@10 12305 =item B<curve>
yading@10 12306
yading@10 12307 Set curve for fade transition.
yading@10 12308
yading@10 12309 It accepts the following values:
yading@10 12310
yading@10 12311 =over 4
yading@10 12312
yading@10 12313
yading@10 12314 =item B<tri>
yading@10 12315
yading@10 12316 select triangular, linear slope (default)
yading@10 12317
yading@10 12318 =item B<qsin>
yading@10 12319
yading@10 12320 select quarter of sine wave
yading@10 12321
yading@10 12322 =item B<hsin>
yading@10 12323
yading@10 12324 select half of sine wave
yading@10 12325
yading@10 12326 =item B<esin>
yading@10 12327
yading@10 12328 select exponential sine wave
yading@10 12329
yading@10 12330 =item B<log>
yading@10 12331
yading@10 12332 select logarithmic
yading@10 12333
yading@10 12334 =item B<par>
yading@10 12335
yading@10 12336 select inverted parabola
yading@10 12337
yading@10 12338 =item B<qua>
yading@10 12339
yading@10 12340 select quadratic
yading@10 12341
yading@10 12342 =item B<cub>
yading@10 12343
yading@10 12344 select cubic
yading@10 12345
yading@10 12346 =item B<squ>
yading@10 12347
yading@10 12348 select square root
yading@10 12349
yading@10 12350 =item B<cbr>
yading@10 12351
yading@10 12352 select cubic root
yading@10 12353
yading@10 12354 =back
yading@10 12355
yading@10 12356
yading@10 12357 =back
yading@10 12358
yading@10 12359
yading@10 12360
yading@10 12361 =head3 Examples
yading@10 12362
yading@10 12363
yading@10 12364
yading@10 12365 =over 4
yading@10 12366
yading@10 12367
yading@10 12368 =item *
yading@10 12369
yading@10 12370 Fade in first 15 seconds of audio:
yading@10 12371
yading@10 12372 afade=t=in:ss=0:d=15
yading@10 12373
yading@10 12374
yading@10 12375
yading@10 12376 =item *
yading@10 12377
yading@10 12378 Fade out last 25 seconds of a 900 seconds audio:
yading@10 12379
yading@10 12380 afade=t=out:ss=875:d=25
yading@10 12381
yading@10 12382
yading@10 12383 =back
yading@10 12384
yading@10 12385
yading@10 12386
yading@10 12387
yading@10 12388 =head2 aformat
yading@10 12389
yading@10 12390
yading@10 12391 Set output format constraints for the input audio. The framework will
yading@10 12392 negotiate the most appropriate format to minimize conversions.
yading@10 12393
yading@10 12394 The filter accepts the following named parameters:
yading@10 12395
yading@10 12396 =over 4
yading@10 12397
yading@10 12398
yading@10 12399
yading@10 12400 =item B<sample_fmts>
yading@10 12401
yading@10 12402 A '|'-separated list of requested sample formats.
yading@10 12403
yading@10 12404
yading@10 12405 =item B<sample_rates>
yading@10 12406
yading@10 12407 A '|'-separated list of requested sample rates.
yading@10 12408
yading@10 12409
yading@10 12410 =item B<channel_layouts>
yading@10 12411
yading@10 12412 A '|'-separated list of requested channel layouts.
yading@10 12413
yading@10 12414
yading@10 12415 =back
yading@10 12416
yading@10 12417
yading@10 12418 If a parameter is omitted, all values are allowed.
yading@10 12419
yading@10 12420 For example to force the output to either unsigned 8-bit or signed 16-bit stereo:
yading@10 12421
yading@10 12422 aformat=sample_fmts=u8|s16:channel_layouts=stereo
yading@10 12423
yading@10 12424
yading@10 12425
yading@10 12426 =head2 amerge
yading@10 12427
yading@10 12428
yading@10 12429 Merge two or more audio streams into a single multi-channel stream.
yading@10 12430
yading@10 12431 The filter accepts the following options:
yading@10 12432
yading@10 12433
yading@10 12434 =over 4
yading@10 12435
yading@10 12436
yading@10 12437
yading@10 12438 =item B<inputs>
yading@10 12439
yading@10 12440 Set the number of inputs. Default is 2.
yading@10 12441
yading@10 12442
yading@10 12443 =back
yading@10 12444
yading@10 12445
yading@10 12446 If the channel layouts of the inputs are disjoint, and therefore compatible,
yading@10 12447 the channel layout of the output will be set accordingly and the channels
yading@10 12448 will be reordered as necessary. If the channel layouts of the inputs are not
yading@10 12449 disjoint, the output will have all the channels of the first input then all
yading@10 12450 the channels of the second input, in that order, and the channel layout of
yading@10 12451 the output will be the default value corresponding to the total number of
yading@10 12452 channels.
yading@10 12453
yading@10 12454 For example, if the first input is in 2.1 (FL+FR+LF) and the second input
yading@10 12455 is FC+BL+BR, then the output will be in 5.1, with the channels in the
yading@10 12456 following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
yading@10 12457 first input, b1 is the first channel of the second input).
yading@10 12458
yading@10 12459 On the other hand, if both input are in stereo, the output channels will be
yading@10 12460 in the default order: a1, a2, b1, b2, and the channel layout will be
yading@10 12461 arbitrarily set to 4.0, which may or may not be the expected value.
yading@10 12462
yading@10 12463 All inputs must have the same sample rate, and format.
yading@10 12464
yading@10 12465 If inputs do not have the same duration, the output will stop with the
yading@10 12466 shortest.
yading@10 12467
yading@10 12468
yading@10 12469 =head3 Examples
yading@10 12470
yading@10 12471
yading@10 12472
yading@10 12473 =over 4
yading@10 12474
yading@10 12475
yading@10 12476 =item *
yading@10 12477
yading@10 12478 Merge two mono files into a stereo stream:
yading@10 12479
yading@10 12480 amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
yading@10 12481
yading@10 12482
yading@10 12483
yading@10 12484 =item *
yading@10 12485
yading@10 12486 Multiple merges assuming 1 video stream and 6 audio streams in F<input.mkv>:
yading@10 12487
yading@10 12488 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 12489
yading@10 12490
yading@10 12491 =back
yading@10 12492
yading@10 12493
yading@10 12494
yading@10 12495 =head2 amix
yading@10 12496
yading@10 12497
yading@10 12498 Mixes multiple audio inputs into a single output.
yading@10 12499
yading@10 12500 For example
yading@10 12501
yading@10 12502 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
yading@10 12503
yading@10 12504 will mix 3 input audio streams to a single output with the same duration as the
yading@10 12505 first input and a dropout transition time of 3 seconds.
yading@10 12506
yading@10 12507 The filter accepts the following named parameters:
yading@10 12508
yading@10 12509 =over 4
yading@10 12510
yading@10 12511
yading@10 12512
yading@10 12513 =item B<inputs>
yading@10 12514
yading@10 12515 Number of inputs. If unspecified, it defaults to 2.
yading@10 12516
yading@10 12517
yading@10 12518 =item B<duration>
yading@10 12519
yading@10 12520 How to determine the end-of-stream.
yading@10 12521
yading@10 12522 =over 4
yading@10 12523
yading@10 12524
yading@10 12525
yading@10 12526 =item B<longest>
yading@10 12527
yading@10 12528 Duration of longest input. (default)
yading@10 12529
yading@10 12530
yading@10 12531 =item B<shortest>
yading@10 12532
yading@10 12533 Duration of shortest input.
yading@10 12534
yading@10 12535
yading@10 12536 =item B<first>
yading@10 12537
yading@10 12538 Duration of first input.
yading@10 12539
yading@10 12540
yading@10 12541 =back
yading@10 12542
yading@10 12543
yading@10 12544
yading@10 12545 =item B<dropout_transition>
yading@10 12546
yading@10 12547 Transition time, in seconds, for volume renormalization when an input
yading@10 12548 stream ends. The default value is 2 seconds.
yading@10 12549
yading@10 12550
yading@10 12551 =back
yading@10 12552
yading@10 12553
yading@10 12554
yading@10 12555 =head2 anull
yading@10 12556
yading@10 12557
yading@10 12558 Pass the audio source unchanged to the output.
yading@10 12559
yading@10 12560
yading@10 12561 =head2 apad
yading@10 12562
yading@10 12563
yading@10 12564 Pad the end of a audio stream with silence, this can be used together with
yading@10 12565 -shortest to extend audio streams to the same length as the video stream.
yading@10 12566
yading@10 12567
yading@10 12568 =head2 aphaser
yading@10 12569
yading@10 12570 Add a phasing effect to the input audio.
yading@10 12571
yading@10 12572 A phaser filter creates series of peaks and troughs in the frequency spectrum.
yading@10 12573 The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
yading@10 12574
yading@10 12575 A description of the accepted parameters follows.
yading@10 12576
yading@10 12577
yading@10 12578 =over 4
yading@10 12579
yading@10 12580
yading@10 12581 =item B<in_gain>
yading@10 12582
yading@10 12583 Set input gain. Default is 0.4.
yading@10 12584
yading@10 12585
yading@10 12586 =item B<out_gain>
yading@10 12587
yading@10 12588 Set output gain. Default is 0.74
yading@10 12589
yading@10 12590
yading@10 12591 =item B<delay>
yading@10 12592
yading@10 12593 Set delay in milliseconds. Default is 3.0.
yading@10 12594
yading@10 12595
yading@10 12596 =item B<decay>
yading@10 12597
yading@10 12598 Set decay. Default is 0.4.
yading@10 12599
yading@10 12600
yading@10 12601 =item B<speed>
yading@10 12602
yading@10 12603 Set modulation speed in Hz. Default is 0.5.
yading@10 12604
yading@10 12605
yading@10 12606 =item B<type>
yading@10 12607
yading@10 12608 Set modulation type. Default is triangular.
yading@10 12609
yading@10 12610 It accepts the following values:
yading@10 12611
yading@10 12612 =over 4
yading@10 12613
yading@10 12614
yading@10 12615 =item B<triangular, t>
yading@10 12616
yading@10 12617
yading@10 12618 =item B<sinusoidal, s>
yading@10 12619
yading@10 12620
yading@10 12621 =back
yading@10 12622
yading@10 12623
yading@10 12624 =back
yading@10 12625
yading@10 12626
yading@10 12627
yading@10 12628
yading@10 12629 =head2 aresample
yading@10 12630
yading@10 12631
yading@10 12632 Resample the input audio to the specified parameters, using the
yading@10 12633 libswresample library. If none are specified then the filter will
yading@10 12634 automatically convert between its input and output.
yading@10 12635
yading@10 12636 This filter is also able to stretch/squeeze the audio data to make it match
yading@10 12637 the timestamps or to inject silence / cut out audio to make it match the
yading@10 12638 timestamps, do a combination of both or do neither.
yading@10 12639
yading@10 12640 The filter accepts the syntax
yading@10 12641 [I<sample_rate>:]I<resampler_options>, where I<sample_rate>
yading@10 12642 expresses a sample rate and I<resampler_options> is a list of
yading@10 12643 I<key>=I<value> pairs, separated by ":". See the
yading@10 12644 ffmpeg-resampler manual for the complete list of supported options.
yading@10 12645
yading@10 12646
yading@10 12647 =head3 Examples
yading@10 12648
yading@10 12649
yading@10 12650
yading@10 12651 =over 4
yading@10 12652
yading@10 12653
yading@10 12654 =item *
yading@10 12655
yading@10 12656 Resample the input audio to 44100Hz:
yading@10 12657
yading@10 12658 aresample=44100
yading@10 12659
yading@10 12660
yading@10 12661
yading@10 12662 =item *
yading@10 12663
yading@10 12664 Stretch/squeeze samples to the given timestamps, with a maximum of 1000
yading@10 12665 samples per second compensation:
yading@10 12666
yading@10 12667 aresample=async=1000
yading@10 12668
yading@10 12669
yading@10 12670 =back
yading@10 12671
yading@10 12672
yading@10 12673
yading@10 12674 =head2 asetnsamples
yading@10 12675
yading@10 12676
yading@10 12677 Set the number of samples per each output audio frame.
yading@10 12678
yading@10 12679 The last output packet may contain a different number of samples, as
yading@10 12680 the filter will flush all the remaining samples when the input audio
yading@10 12681 signal its end.
yading@10 12682
yading@10 12683 The filter accepts the following options:
yading@10 12684
yading@10 12685
yading@10 12686 =over 4
yading@10 12687
yading@10 12688
yading@10 12689
yading@10 12690 =item B<nb_out_samples, n>
yading@10 12691
yading@10 12692 Set the number of frames per each output audio frame. The number is
yading@10 12693 intended as the number of samples I<per each channel>.
yading@10 12694 Default value is 1024.
yading@10 12695
yading@10 12696
yading@10 12697 =item B<pad, p>
yading@10 12698
yading@10 12699 If set to 1, the filter will pad the last audio frame with zeroes, so
yading@10 12700 that the last frame will contain the same number of samples as the
yading@10 12701 previous ones. Default value is 1.
yading@10 12702
yading@10 12703 =back
yading@10 12704
yading@10 12705
yading@10 12706 For example, to set the number of per-frame samples to 1234 and
yading@10 12707 disable padding for the last frame, use:
yading@10 12708
yading@10 12709 asetnsamples=n=1234:p=0
yading@10 12710
yading@10 12711
yading@10 12712
yading@10 12713 =head2 ashowinfo
yading@10 12714
yading@10 12715
yading@10 12716 Show a line containing various information for each input audio frame.
yading@10 12717 The input audio is not modified.
yading@10 12718
yading@10 12719 The shown line contains a sequence of key/value pairs of the form
yading@10 12720 I<key>:I<value>.
yading@10 12721
yading@10 12722 A description of each shown parameter follows:
yading@10 12723
yading@10 12724
yading@10 12725 =over 4
yading@10 12726
yading@10 12727
yading@10 12728 =item B<n>
yading@10 12729
yading@10 12730 sequential number of the input frame, starting from 0
yading@10 12731
yading@10 12732
yading@10 12733 =item B<pts>
yading@10 12734
yading@10 12735 Presentation timestamp of the input frame, in time base units; the time base
yading@10 12736 depends on the filter input pad, and is usually 1/I<sample_rate>.
yading@10 12737
yading@10 12738
yading@10 12739 =item B<pts_time>
yading@10 12740
yading@10 12741 presentation timestamp of the input frame in seconds
yading@10 12742
yading@10 12743
yading@10 12744 =item B<pos>
yading@10 12745
yading@10 12746 position of the frame in the input stream, -1 if this information in
yading@10 12747 unavailable and/or meaningless (for example in case of synthetic audio)
yading@10 12748
yading@10 12749
yading@10 12750 =item B<fmt>
yading@10 12751
yading@10 12752 sample format
yading@10 12753
yading@10 12754
yading@10 12755 =item B<chlayout>
yading@10 12756
yading@10 12757 channel layout
yading@10 12758
yading@10 12759
yading@10 12760 =item B<rate>
yading@10 12761
yading@10 12762 sample rate for the audio frame
yading@10 12763
yading@10 12764
yading@10 12765 =item B<nb_samples>
yading@10 12766
yading@10 12767 number of samples (per channel) in the frame
yading@10 12768
yading@10 12769
yading@10 12770 =item B<checksum>
yading@10 12771
yading@10 12772 Adler-32 checksum (printed in hexadecimal) of the audio data. For planar audio
yading@10 12773 the data is treated as if all the planes were concatenated.
yading@10 12774
yading@10 12775
yading@10 12776 =item B<plane_checksums>
yading@10 12777
yading@10 12778 A list of Adler-32 checksums for each data plane.
yading@10 12779
yading@10 12780 =back
yading@10 12781
yading@10 12782
yading@10 12783
yading@10 12784 =head2 astreamsync
yading@10 12785
yading@10 12786
yading@10 12787 Forward two audio streams and control the order the buffers are forwarded.
yading@10 12788
yading@10 12789 The filter accepts the following options:
yading@10 12790
yading@10 12791
yading@10 12792 =over 4
yading@10 12793
yading@10 12794
yading@10 12795 =item B<expr, e>
yading@10 12796
yading@10 12797 Set the expression deciding which stream should be
yading@10 12798 forwarded next: if the result is negative, the first stream is forwarded; if
yading@10 12799 the result is positive or zero, the second stream is forwarded. It can use
yading@10 12800 the following variables:
yading@10 12801
yading@10 12802
yading@10 12803 =over 4
yading@10 12804
yading@10 12805
yading@10 12806 =item I<b1 b2>
yading@10 12807
yading@10 12808 number of buffers forwarded so far on each stream
yading@10 12809
yading@10 12810 =item I<s1 s2>
yading@10 12811
yading@10 12812 number of samples forwarded so far on each stream
yading@10 12813
yading@10 12814 =item I<t1 t2>
yading@10 12815
yading@10 12816 current timestamp of each stream
yading@10 12817
yading@10 12818 =back
yading@10 12819
yading@10 12820
yading@10 12821 The default value is C<t1-t2>, which means to always forward the stream
yading@10 12822 that has a smaller timestamp.
yading@10 12823
yading@10 12824 =back
yading@10 12825
yading@10 12826
yading@10 12827
yading@10 12828 =head3 Examples
yading@10 12829
yading@10 12830
yading@10 12831 Stress-test C<amerge> by randomly sending buffers on the wrong
yading@10 12832 input, while avoiding too much of a desynchronization:
yading@10 12833
yading@10 12834 amovie=file.ogg [a] ; amovie=file.mp3 [b] ;
yading@10 12835 [a] [b] astreamsync=(2*random(1))-1+tanh(5*(t1-t2)) [a2] [b2] ;
yading@10 12836 [a2] [b2] amerge
yading@10 12837
yading@10 12838
yading@10 12839
yading@10 12840 =head2 atempo
yading@10 12841
yading@10 12842
yading@10 12843 Adjust audio tempo.
yading@10 12844
yading@10 12845 The filter accepts exactly one parameter, the audio tempo. If not
yading@10 12846 specified then the filter will assume nominal 1.0 tempo. Tempo must
yading@10 12847 be in the [0.5, 2.0] range.
yading@10 12848
yading@10 12849
yading@10 12850 =head3 Examples
yading@10 12851
yading@10 12852
yading@10 12853
yading@10 12854 =over 4
yading@10 12855
yading@10 12856
yading@10 12857 =item *
yading@10 12858
yading@10 12859 Slow down audio to 80% tempo:
yading@10 12860
yading@10 12861 atempo=0.8
yading@10 12862
yading@10 12863
yading@10 12864
yading@10 12865 =item *
yading@10 12866
yading@10 12867 To speed up audio to 125% tempo:
yading@10 12868
yading@10 12869 atempo=1.25
yading@10 12870
yading@10 12871
yading@10 12872 =back
yading@10 12873
yading@10 12874
yading@10 12875
yading@10 12876 =head2 earwax
yading@10 12877
yading@10 12878
yading@10 12879 Make audio easier to listen to on headphones.
yading@10 12880
yading@10 12881 This filter adds `cues' to 44.1kHz stereo (i.e. audio CD format) audio
yading@10 12882 so that when listened to on headphones the stereo image is moved from
yading@10 12883 inside your head (standard for headphones) to outside and in front of
yading@10 12884 the listener (standard for speakers).
yading@10 12885
yading@10 12886 Ported from SoX.
yading@10 12887
yading@10 12888
yading@10 12889 =head2 pan
yading@10 12890
yading@10 12891
yading@10 12892 Mix channels with specific gain levels. The filter accepts the output
yading@10 12893 channel layout followed by a set of channels definitions.
yading@10 12894
yading@10 12895 This filter is also designed to remap efficiently the channels of an audio
yading@10 12896 stream.
yading@10 12897
yading@10 12898 The filter accepts parameters of the form:
yading@10 12899 "I<l>:I<outdef>:I<outdef>:..."
yading@10 12900
yading@10 12901
yading@10 12902 =over 4
yading@10 12903
yading@10 12904
yading@10 12905 =item B<l>
yading@10 12906
yading@10 12907 output channel layout or number of channels
yading@10 12908
yading@10 12909
yading@10 12910 =item B<outdef>
yading@10 12911
yading@10 12912 output channel specification, of the form:
yading@10 12913 "I<out_name>=[I<gain>*]I<in_name>[+[I<gain>*]I<in_name>...]"
yading@10 12914
yading@10 12915
yading@10 12916 =item B<out_name>
yading@10 12917
yading@10 12918 output channel to define, either a channel name (FL, FR, etc.) or a channel
yading@10 12919 number (c0, c1, etc.)
yading@10 12920
yading@10 12921
yading@10 12922 =item B<gain>
yading@10 12923
yading@10 12924 multiplicative coefficient for the channel, 1 leaving the volume unchanged
yading@10 12925
yading@10 12926
yading@10 12927 =item B<in_name>
yading@10 12928
yading@10 12929 input channel to use, see out_name for details; it is not possible to mix
yading@10 12930 named and numbered input channels
yading@10 12931
yading@10 12932 =back
yading@10 12933
yading@10 12934
yading@10 12935 If the `=' in a channel specification is replaced by `E<lt>', then the gains for
yading@10 12936 that specification will be renormalized so that the total is 1, thus
yading@10 12937 avoiding clipping noise.
yading@10 12938
yading@10 12939
yading@10 12940 =head3 Mixing examples
yading@10 12941
yading@10 12942
yading@10 12943 For example, if you want to down-mix from stereo to mono, but with a bigger
yading@10 12944 factor for the left channel:
yading@10 12945
yading@10 12946 pan=1:c0=0.9*c0+0.1*c1
yading@10 12947
yading@10 12948
yading@10 12949 A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
yading@10 12950 7-channels surround:
yading@10 12951
yading@10 12952 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 12953
yading@10 12954
yading@10 12955 Note that B<ffmpeg> integrates a default down-mix (and up-mix) system
yading@10 12956 that should be preferred (see "-ac" option) unless you have very specific
yading@10 12957 needs.
yading@10 12958
yading@10 12959
yading@10 12960 =head3 Remapping examples
yading@10 12961
yading@10 12962
yading@10 12963 The channel remapping will be effective if, and only if:
yading@10 12964
yading@10 12965
yading@10 12966 =over 4
yading@10 12967
yading@10 12968
yading@10 12969 =item *<gain coefficients are zeroes or ones,>
yading@10 12970
yading@10 12971
yading@10 12972 =item *<only one input per channel output,>
yading@10 12973
yading@10 12974
yading@10 12975 =back
yading@10 12976
yading@10 12977
yading@10 12978 If all these conditions are satisfied, the filter will notify the user ("Pure
yading@10 12979 channel mapping detected"), and use an optimized and lossless method to do the
yading@10 12980 remapping.
yading@10 12981
yading@10 12982 For example, if you have a 5.1 source and want a stereo audio stream by
yading@10 12983 dropping the extra channels:
yading@10 12984
yading@10 12985 pan="stereo: c0=FL : c1=FR"
yading@10 12986
yading@10 12987
yading@10 12988 Given the same source, you can also switch front left and front right channels
yading@10 12989 and keep the input channel layout:
yading@10 12990
yading@10 12991 pan="5.1: c0=c1 : c1=c0 : c2=c2 : c3=c3 : c4=c4 : c5=c5"
yading@10 12992
yading@10 12993
yading@10 12994 If the input is a stereo audio stream, you can mute the front left channel (and
yading@10 12995 still keep the stereo channel layout) with:
yading@10 12996
yading@10 12997 pan="stereo:c1=c1"
yading@10 12998
yading@10 12999
yading@10 13000 Still with a stereo audio stream input, you can copy the right channel in both
yading@10 13001 front left and right:
yading@10 13002
yading@10 13003 pan="stereo: c0=FR : c1=FR"
yading@10 13004
yading@10 13005
yading@10 13006
yading@10 13007 =head2 silencedetect
yading@10 13008
yading@10 13009
yading@10 13010 Detect silence in an audio stream.
yading@10 13011
yading@10 13012 This filter logs a message when it detects that the input audio volume is less
yading@10 13013 or equal to a noise tolerance value for a duration greater or equal to the
yading@10 13014 minimum detected noise duration.
yading@10 13015
yading@10 13016 The printed times and duration are expressed in seconds.
yading@10 13017
yading@10 13018 The filter accepts the following options:
yading@10 13019
yading@10 13020
yading@10 13021 =over 4
yading@10 13022
yading@10 13023
yading@10 13024 =item B<duration, d>
yading@10 13025
yading@10 13026 Set silence duration until notification (default is 2 seconds).
yading@10 13027
yading@10 13028
yading@10 13029 =item B<noise, n>
yading@10 13030
yading@10 13031 Set noise tolerance. Can be specified in dB (in case "dB" is appended to the
yading@10 13032 specified value) or amplitude ratio. Default is -60dB, or 0.001.
yading@10 13033
yading@10 13034 =back
yading@10 13035
yading@10 13036
yading@10 13037
yading@10 13038 =head3 Examples
yading@10 13039
yading@10 13040
yading@10 13041
yading@10 13042 =over 4
yading@10 13043
yading@10 13044
yading@10 13045 =item *
yading@10 13046
yading@10 13047 Detect 5 seconds of silence with -50dB noise tolerance:
yading@10 13048
yading@10 13049 silencedetect=n=-50dB:d=5
yading@10 13050
yading@10 13051
yading@10 13052
yading@10 13053 =item *
yading@10 13054
yading@10 13055 Complete example with B<ffmpeg> to detect silence with 0.0001 noise
yading@10 13056 tolerance in F<silence.mp3>:
yading@10 13057
yading@10 13058 ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
yading@10 13059
yading@10 13060
yading@10 13061 =back
yading@10 13062
yading@10 13063
yading@10 13064
yading@10 13065 =head2 asyncts
yading@10 13066
yading@10 13067 Synchronize audio data with timestamps by squeezing/stretching it and/or
yading@10 13068 dropping samples/adding silence when needed.
yading@10 13069
yading@10 13070 This filter is not built by default, please use aresample to do squeezing/stretching.
yading@10 13071
yading@10 13072 The filter accepts the following named parameters:
yading@10 13073
yading@10 13074 =over 4
yading@10 13075
yading@10 13076
yading@10 13077
yading@10 13078 =item B<compensate>
yading@10 13079
yading@10 13080 Enable stretching/squeezing the data to make it match the timestamps. Disabled
yading@10 13081 by default. When disabled, time gaps are covered with silence.
yading@10 13082
yading@10 13083
yading@10 13084 =item B<min_delta>
yading@10 13085
yading@10 13086 Minimum difference between timestamps and audio data (in seconds) to trigger
yading@10 13087 adding/dropping samples. Default value is 0.1. If you get non-perfect sync with
yading@10 13088 this filter, try setting this parameter to 0.
yading@10 13089
yading@10 13090
yading@10 13091 =item B<max_comp>
yading@10 13092
yading@10 13093 Maximum compensation in samples per second. Relevant only with compensate=1.
yading@10 13094 Default value 500.
yading@10 13095
yading@10 13096
yading@10 13097 =item B<first_pts>
yading@10 13098
yading@10 13099 Assume the first pts should be this value. The time base is 1 / sample rate.
yading@10 13100 This allows for padding/trimming at the start of stream. By default, no
yading@10 13101 assumption is made about the first frame's expected pts, so no padding or
yading@10 13102 trimming is done. For example, this could be set to 0 to pad the beginning with
yading@10 13103 silence if an audio stream starts after the video stream or to trim any samples
yading@10 13104 with a negative pts due to encoder delay.
yading@10 13105
yading@10 13106
yading@10 13107 =back
yading@10 13108
yading@10 13109
yading@10 13110
yading@10 13111 =head2 channelsplit
yading@10 13112
yading@10 13113 Split each channel in input audio stream into a separate output stream.
yading@10 13114
yading@10 13115 This filter accepts the following named parameters:
yading@10 13116
yading@10 13117 =over 4
yading@10 13118
yading@10 13119
yading@10 13120 =item B<channel_layout>
yading@10 13121
yading@10 13122 Channel layout of the input stream. Default is "stereo".
yading@10 13123
yading@10 13124 =back
yading@10 13125
yading@10 13126
yading@10 13127 For example, assuming a stereo input MP3 file
yading@10 13128
yading@10 13129 ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
yading@10 13130
yading@10 13131 will create an output Matroska file with two audio streams, one containing only
yading@10 13132 the left channel and the other the right channel.
yading@10 13133
yading@10 13134 To split a 5.1 WAV file into per-channel files
yading@10 13135
yading@10 13136 ffmpeg -i in.wav -filter_complex
yading@10 13137 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
yading@10 13138 -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
yading@10 13139 front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
yading@10 13140 side_right.wav
yading@10 13141
yading@10 13142
yading@10 13143
yading@10 13144 =head2 channelmap
yading@10 13145
yading@10 13146 Remap input channels to new locations.
yading@10 13147
yading@10 13148 This filter accepts the following named parameters:
yading@10 13149
yading@10 13150 =over 4
yading@10 13151
yading@10 13152
yading@10 13153 =item B<channel_layout>
yading@10 13154
yading@10 13155 Channel layout of the output stream.
yading@10 13156
yading@10 13157
yading@10 13158 =item B<map>
yading@10 13159
yading@10 13160 Map channels from input to output. The argument is a '|'-separated list of
yading@10 13161 mappings, each in the C<I<in_channel>-I<out_channel>> or
yading@10 13162 I<in_channel> form. I<in_channel> can be either the name of the input
yading@10 13163 channel (e.g. FL for front left) or its index in the input channel layout.
yading@10 13164 I<out_channel> is the name of the output channel or its index in the output
yading@10 13165 channel layout. If I<out_channel> is not given then it is implicitly an
yading@10 13166 index, starting with zero and increasing by one for each mapping.
yading@10 13167
yading@10 13168 =back
yading@10 13169
yading@10 13170
yading@10 13171 If no mapping is present, the filter will implicitly map input channels to
yading@10 13172 output channels preserving index.
yading@10 13173
yading@10 13174 For example, assuming a 5.1+downmix input MOV file
yading@10 13175
yading@10 13176 ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
yading@10 13177
yading@10 13178 will create an output WAV file tagged as stereo from the downmix channels of
yading@10 13179 the input.
yading@10 13180
yading@10 13181 To fix a 5.1 WAV improperly encoded in AAC's native channel order
yading@10 13182
yading@10 13183 ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:channel_layout=5.1' out.wav
yading@10 13184
yading@10 13185
yading@10 13186
yading@10 13187 =head2 join
yading@10 13188
yading@10 13189 Join multiple input streams into one multi-channel stream.
yading@10 13190
yading@10 13191 The filter accepts the following named parameters:
yading@10 13192
yading@10 13193 =over 4
yading@10 13194
yading@10 13195
yading@10 13196
yading@10 13197 =item B<inputs>
yading@10 13198
yading@10 13199 Number of input streams. Defaults to 2.
yading@10 13200
yading@10 13201
yading@10 13202 =item B<channel_layout>
yading@10 13203
yading@10 13204 Desired output channel layout. Defaults to stereo.
yading@10 13205
yading@10 13206
yading@10 13207 =item B<map>
yading@10 13208
yading@10 13209 Map channels from inputs to output. The argument is a '|'-separated list of
yading@10 13210 mappings, each in the C<I<input_idx>.I<in_channel>-I<out_channel>>
yading@10 13211 form. I<input_idx> is the 0-based index of the input stream. I<in_channel>
yading@10 13212 can be either the name of the input channel (e.g. FL for front left) or its
yading@10 13213 index in the specified input stream. I<out_channel> is the name of the output
yading@10 13214 channel.
yading@10 13215
yading@10 13216 =back
yading@10 13217
yading@10 13218
yading@10 13219 The filter will attempt to guess the mappings when those are not specified
yading@10 13220 explicitly. It does so by first trying to find an unused matching input channel
yading@10 13221 and if that fails it picks the first unused input channel.
yading@10 13222
yading@10 13223 E.g. to join 3 inputs (with properly set channel layouts)
yading@10 13224
yading@10 13225 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
yading@10 13226
yading@10 13227
yading@10 13228 To build a 5.1 output from 6 single-channel streams:
yading@10 13229
yading@10 13230 ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
yading@10 13231 '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 13232 out
yading@10 13233
yading@10 13234
yading@10 13235
yading@10 13236 =head2 resample
yading@10 13237
yading@10 13238 Convert the audio sample format, sample rate and channel layout. This filter is
yading@10 13239 not meant to be used directly.
yading@10 13240
yading@10 13241
yading@10 13242 =head2 volume
yading@10 13243
yading@10 13244
yading@10 13245 Adjust the input audio volume.
yading@10 13246
yading@10 13247 The filter accepts the following options:
yading@10 13248
yading@10 13249
yading@10 13250 =over 4
yading@10 13251
yading@10 13252
yading@10 13253
yading@10 13254 =item B<volume>
yading@10 13255
yading@10 13256 Expresses how the audio volume will be increased or decreased.
yading@10 13257
yading@10 13258 Output values are clipped to the maximum value.
yading@10 13259
yading@10 13260 The output audio volume is given by the relation:
yading@10 13261
yading@10 13262 <output_volume> = <volume> * <input_volume>
yading@10 13263
yading@10 13264
yading@10 13265 Default value for I<volume> is 1.0.
yading@10 13266
yading@10 13267
yading@10 13268 =item B<precision>
yading@10 13269
yading@10 13270 Set the mathematical precision.
yading@10 13271
yading@10 13272 This determines which input sample formats will be allowed, which affects the
yading@10 13273 precision of the volume scaling.
yading@10 13274
yading@10 13275
yading@10 13276 =over 4
yading@10 13277
yading@10 13278
yading@10 13279 =item B<fixed>
yading@10 13280
yading@10 13281 8-bit fixed-point; limits input sample format to U8, S16, and S32.
yading@10 13282
yading@10 13283 =item B<float>
yading@10 13284
yading@10 13285 32-bit floating-point; limits input sample format to FLT. (default)
yading@10 13286
yading@10 13287 =item B<double>
yading@10 13288
yading@10 13289 64-bit floating-point; limits input sample format to DBL.
yading@10 13290
yading@10 13291 =back
yading@10 13292
yading@10 13293
yading@10 13294 =back
yading@10 13295
yading@10 13296
yading@10 13297
yading@10 13298 =head3 Examples
yading@10 13299
yading@10 13300
yading@10 13301
yading@10 13302 =over 4
yading@10 13303
yading@10 13304
yading@10 13305 =item *
yading@10 13306
yading@10 13307 Halve the input audio volume:
yading@10 13308
yading@10 13309 volume=volume=0.5
yading@10 13310 volume=volume=1/2
yading@10 13311 volume=volume=-6.0206dB
yading@10 13312
yading@10 13313
yading@10 13314 In all the above example the named key for B<volume> can be
yading@10 13315 omitted, for example like in:
yading@10 13316
yading@10 13317 volume=0.5
yading@10 13318
yading@10 13319
yading@10 13320
yading@10 13321 =item *
yading@10 13322
yading@10 13323 Increase input audio power by 6 decibels using fixed-point precision:
yading@10 13324
yading@10 13325 volume=volume=6dB:precision=fixed
yading@10 13326
yading@10 13327
yading@10 13328 =back
yading@10 13329
yading@10 13330
yading@10 13331
yading@10 13332 =head2 volumedetect
yading@10 13333
yading@10 13334
yading@10 13335 Detect the volume of the input video.
yading@10 13336
yading@10 13337 The filter has no parameters. The input is not modified. Statistics about
yading@10 13338 the volume will be printed in the log when the input stream end is reached.
yading@10 13339
yading@10 13340 In particular it will show the mean volume (root mean square), maximum
yading@10 13341 volume (on a per-sample basis), and the beginning of an histogram of the
yading@10 13342 registered volume values (from the maximum value to a cumulated 1/1000 of
yading@10 13343 the samples).
yading@10 13344
yading@10 13345 All volumes are in decibels relative to the maximum PCM value.
yading@10 13346
yading@10 13347
yading@10 13348 =head3 Examples
yading@10 13349
yading@10 13350
yading@10 13351 Here is an excerpt of the output:
yading@10 13352
yading@10 13353 [Parsed_volumedetect_0 0xa23120] mean_volume: -27 dB
yading@10 13354 [Parsed_volumedetect_0 0xa23120] max_volume: -4 dB
yading@10 13355 [Parsed_volumedetect_0 0xa23120] histogram_4db: 6
yading@10 13356 [Parsed_volumedetect_0 0xa23120] histogram_5db: 62
yading@10 13357 [Parsed_volumedetect_0 0xa23120] histogram_6db: 286
yading@10 13358 [Parsed_volumedetect_0 0xa23120] histogram_7db: 1042
yading@10 13359 [Parsed_volumedetect_0 0xa23120] histogram_8db: 2551
yading@10 13360 [Parsed_volumedetect_0 0xa23120] histogram_9db: 4609
yading@10 13361 [Parsed_volumedetect_0 0xa23120] histogram_10db: 8409
yading@10 13362
yading@10 13363
yading@10 13364 It means that:
yading@10 13365
yading@10 13366 =over 4
yading@10 13367
yading@10 13368
yading@10 13369 =item *
yading@10 13370
yading@10 13371 The mean square energy is approximately -27 dB, or 10^-2.7.
yading@10 13372
yading@10 13373 =item *
yading@10 13374
yading@10 13375 The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
yading@10 13376
yading@10 13377 =item *
yading@10 13378
yading@10 13379 There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
yading@10 13380
yading@10 13381 =back
yading@10 13382
yading@10 13383
yading@10 13384 In other words, raising the volume by +4 dB does not cause any clipping,
yading@10 13385 raising it by +5 dB causes clipping for 6 samples, etc.
yading@10 13386
yading@10 13387
yading@10 13388
yading@10 13389 =head1 AUDIO SOURCES
yading@10 13390
yading@10 13391
yading@10 13392 Below is a description of the currently available audio sources.
yading@10 13393
yading@10 13394
yading@10 13395 =head2 abuffer
yading@10 13396
yading@10 13397
yading@10 13398 Buffer audio frames, and make them available to the filter chain.
yading@10 13399
yading@10 13400 This source is mainly intended for a programmatic use, in particular
yading@10 13401 through the interface defined in F<libavfilter/asrc_abuffer.h>.
yading@10 13402
yading@10 13403 It accepts the following named parameters:
yading@10 13404
yading@10 13405
yading@10 13406 =over 4
yading@10 13407
yading@10 13408
yading@10 13409
yading@10 13410 =item B<time_base>
yading@10 13411
yading@10 13412 Timebase which will be used for timestamps of submitted frames. It must be
yading@10 13413 either a floating-point number or in I<numerator>/I<denominator> form.
yading@10 13414
yading@10 13415
yading@10 13416 =item B<sample_rate>
yading@10 13417
yading@10 13418 The sample rate of the incoming audio buffers.
yading@10 13419
yading@10 13420
yading@10 13421 =item B<sample_fmt>
yading@10 13422
yading@10 13423 The sample format of the incoming audio buffers.
yading@10 13424 Either a sample format name or its corresponging integer representation from
yading@10 13425 the enum AVSampleFormat in F<libavutil/samplefmt.h>
yading@10 13426
yading@10 13427
yading@10 13428 =item B<channel_layout>
yading@10 13429
yading@10 13430 The channel layout of the incoming audio buffers.
yading@10 13431 Either a channel layout name from channel_layout_map in
yading@10 13432 F<libavutil/channel_layout.c> or its corresponding integer representation
yading@10 13433 from the AV_CH_LAYOUT_* macros in F<libavutil/channel_layout.h>
yading@10 13434
yading@10 13435
yading@10 13436 =item B<channels>
yading@10 13437
yading@10 13438 The number of channels of the incoming audio buffers.
yading@10 13439 If both I<channels> and I<channel_layout> are specified, then they
yading@10 13440 must be consistent.
yading@10 13441
yading@10 13442
yading@10 13443 =back
yading@10 13444
yading@10 13445
yading@10 13446
yading@10 13447 =head3 Examples
yading@10 13448
yading@10 13449
yading@10 13450
yading@10 13451 abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
yading@10 13452
yading@10 13453
yading@10 13454 will instruct the source to accept planar 16bit signed stereo at 44100Hz.
yading@10 13455 Since the sample format with name "s16p" corresponds to the number
yading@10 13456 6 and the "stereo" channel layout corresponds to the value 0x3, this is
yading@10 13457 equivalent to:
yading@10 13458
yading@10 13459 abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
yading@10 13460
yading@10 13461
yading@10 13462
yading@10 13463 =head2 aevalsrc
yading@10 13464
yading@10 13465
yading@10 13466 Generate an audio signal specified by an expression.
yading@10 13467
yading@10 13468 This source accepts in input one or more expressions (one for each
yading@10 13469 channel), which are evaluated and used to generate a corresponding
yading@10 13470 audio signal.
yading@10 13471
yading@10 13472 This source accepts the following options:
yading@10 13473
yading@10 13474
yading@10 13475 =over 4
yading@10 13476
yading@10 13477
yading@10 13478 =item B<exprs>
yading@10 13479
yading@10 13480 Set the '|'-separated expressions list for each separate channel. In case the
yading@10 13481 B<channel_layout> option is not specified, the selected channel layout
yading@10 13482 depends on the number of provided expressions.
yading@10 13483
yading@10 13484
yading@10 13485 =item B<channel_layout, c>
yading@10 13486
yading@10 13487 Set the channel layout. The number of channels in the specified layout
yading@10 13488 must be equal to the number of specified expressions.
yading@10 13489
yading@10 13490
yading@10 13491 =item B<duration, d>
yading@10 13492
yading@10 13493 Set the minimum duration of the sourced audio. See the function
yading@10 13494 C<av_parse_time()> for the accepted format.
yading@10 13495 Note that the resulting duration may be greater than the specified
yading@10 13496 duration, as the generated audio is always cut at the end of a
yading@10 13497 complete frame.
yading@10 13498
yading@10 13499 If not specified, or the expressed duration is negative, the audio is
yading@10 13500 supposed to be generated forever.
yading@10 13501
yading@10 13502
yading@10 13503 =item B<nb_samples, n>
yading@10 13504
yading@10 13505 Set the number of samples per channel per each output frame,
yading@10 13506 default to 1024.
yading@10 13507
yading@10 13508
yading@10 13509 =item B<sample_rate, s>
yading@10 13510
yading@10 13511 Specify the sample rate, default to 44100.
yading@10 13512
yading@10 13513 =back
yading@10 13514
yading@10 13515
yading@10 13516 Each expression in I<exprs> can contain the following constants:
yading@10 13517
yading@10 13518
yading@10 13519 =over 4
yading@10 13520
yading@10 13521
yading@10 13522 =item B<n>
yading@10 13523
yading@10 13524 number of the evaluated sample, starting from 0
yading@10 13525
yading@10 13526
yading@10 13527 =item B<t>
yading@10 13528
yading@10 13529 time of the evaluated sample expressed in seconds, starting from 0
yading@10 13530
yading@10 13531
yading@10 13532 =item B<s>
yading@10 13533
yading@10 13534 sample rate
yading@10 13535
yading@10 13536
yading@10 13537 =back
yading@10 13538
yading@10 13539
yading@10 13540
yading@10 13541 =head3 Examples
yading@10 13542
yading@10 13543
yading@10 13544
yading@10 13545 =over 4
yading@10 13546
yading@10 13547
yading@10 13548 =item *
yading@10 13549
yading@10 13550 Generate silence:
yading@10 13551
yading@10 13552 aevalsrc=0
yading@10 13553
yading@10 13554
yading@10 13555
yading@10 13556 =item *
yading@10 13557
yading@10 13558 Generate a sin signal with frequency of 440 Hz, set sample rate to
yading@10 13559 8000 Hz:
yading@10 13560
yading@10 13561 aevalsrc="sin(440*2*PI*t):s=8000"
yading@10 13562
yading@10 13563
yading@10 13564
yading@10 13565 =item *
yading@10 13566
yading@10 13567 Generate a two channels signal, specify the channel layout (Front
yading@10 13568 Center + Back Center) explicitly:
yading@10 13569
yading@10 13570 aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC"
yading@10 13571
yading@10 13572
yading@10 13573
yading@10 13574 =item *
yading@10 13575
yading@10 13576 Generate white noise:
yading@10 13577
yading@10 13578 aevalsrc="-2+random(0)"
yading@10 13579
yading@10 13580
yading@10 13581
yading@10 13582 =item *
yading@10 13583
yading@10 13584 Generate an amplitude modulated signal:
yading@10 13585
yading@10 13586 aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)"
yading@10 13587
yading@10 13588
yading@10 13589
yading@10 13590 =item *
yading@10 13591
yading@10 13592 Generate 2.5 Hz binaural beats on a 360 Hz carrier:
yading@10 13593
yading@10 13594 aevalsrc="0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)"
yading@10 13595
yading@10 13596
yading@10 13597
yading@10 13598 =back
yading@10 13599
yading@10 13600
yading@10 13601
yading@10 13602 =head2 anullsrc
yading@10 13603
yading@10 13604
yading@10 13605 Null audio source, return unprocessed audio frames. It is mainly useful
yading@10 13606 as a template and to be employed in analysis / debugging tools, or as
yading@10 13607 the source for filters which ignore the input data (for example the sox
yading@10 13608 synth filter).
yading@10 13609
yading@10 13610 This source accepts the following options:
yading@10 13611
yading@10 13612
yading@10 13613 =over 4
yading@10 13614
yading@10 13615
yading@10 13616
yading@10 13617 =item B<channel_layout, cl>
yading@10 13618
yading@10 13619
yading@10 13620 Specify the channel layout, and can be either an integer or a string
yading@10 13621 representing a channel layout. The default value of I<channel_layout>
yading@10 13622 is "stereo".
yading@10 13623
yading@10 13624 Check the channel_layout_map definition in
yading@10 13625 F<libavutil/channel_layout.c> for the mapping between strings and
yading@10 13626 channel layout values.
yading@10 13627
yading@10 13628
yading@10 13629 =item B<sample_rate, r>
yading@10 13630
yading@10 13631 Specify the sample rate, and defaults to 44100.
yading@10 13632
yading@10 13633
yading@10 13634 =item B<nb_samples, n>
yading@10 13635
yading@10 13636 Set the number of samples per requested frames.
yading@10 13637
yading@10 13638
yading@10 13639 =back
yading@10 13640
yading@10 13641
yading@10 13642
yading@10 13643 =head3 Examples
yading@10 13644
yading@10 13645
yading@10 13646
yading@10 13647 =over 4
yading@10 13648
yading@10 13649
yading@10 13650 =item *
yading@10 13651
yading@10 13652 Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
yading@10 13653
yading@10 13654 anullsrc=r=48000:cl=4
yading@10 13655
yading@10 13656
yading@10 13657
yading@10 13658 =item *
yading@10 13659
yading@10 13660 Do the same operation with a more obvious syntax:
yading@10 13661
yading@10 13662 anullsrc=r=48000:cl=mono
yading@10 13663
yading@10 13664
yading@10 13665 =back
yading@10 13666
yading@10 13667
yading@10 13668
yading@10 13669 =head2 abuffer
yading@10 13670
yading@10 13671 Buffer audio frames, and make them available to the filter chain.
yading@10 13672
yading@10 13673 This source is not intended to be part of user-supplied graph descriptions but
yading@10 13674 for insertion by calling programs through the interface defined in
yading@10 13675 F<libavfilter/buffersrc.h>.
yading@10 13676
yading@10 13677 It accepts the following named parameters:
yading@10 13678
yading@10 13679 =over 4
yading@10 13680
yading@10 13681
yading@10 13682
yading@10 13683 =item B<time_base>
yading@10 13684
yading@10 13685 Timebase which will be used for timestamps of submitted frames. It must be
yading@10 13686 either a floating-point number or in I<numerator>/I<denominator> form.
yading@10 13687
yading@10 13688
yading@10 13689 =item B<sample_rate>
yading@10 13690
yading@10 13691 Audio sample rate.
yading@10 13692
yading@10 13693
yading@10 13694 =item B<sample_fmt>
yading@10 13695
yading@10 13696 Name of the sample format, as returned by C<av_get_sample_fmt_name()>.
yading@10 13697
yading@10 13698
yading@10 13699 =item B<channel_layout>
yading@10 13700
yading@10 13701 Channel layout of the audio data, in the form that can be accepted by
yading@10 13702 C<av_get_channel_layout()>.
yading@10 13703
yading@10 13704 =back
yading@10 13705
yading@10 13706
yading@10 13707 All the parameters need to be explicitly defined.
yading@10 13708
yading@10 13709
yading@10 13710 =head2 flite
yading@10 13711
yading@10 13712
yading@10 13713 Synthesize a voice utterance using the libflite library.
yading@10 13714
yading@10 13715 To enable compilation of this filter you need to configure FFmpeg with
yading@10 13716 C<--enable-libflite>.
yading@10 13717
yading@10 13718 Note that the flite library is not thread-safe.
yading@10 13719
yading@10 13720 The filter accepts the following options:
yading@10 13721
yading@10 13722
yading@10 13723 =over 4
yading@10 13724
yading@10 13725
yading@10 13726
yading@10 13727 =item B<list_voices>
yading@10 13728
yading@10 13729 If set to 1, list the names of the available voices and exit
yading@10 13730 immediately. Default value is 0.
yading@10 13731
yading@10 13732
yading@10 13733 =item B<nb_samples, n>
yading@10 13734
yading@10 13735 Set the maximum number of samples per frame. Default value is 512.
yading@10 13736
yading@10 13737
yading@10 13738 =item B<textfile>
yading@10 13739
yading@10 13740 Set the filename containing the text to speak.
yading@10 13741
yading@10 13742
yading@10 13743 =item B<text>
yading@10 13744
yading@10 13745 Set the text to speak.
yading@10 13746
yading@10 13747
yading@10 13748 =item B<voice, v>
yading@10 13749
yading@10 13750 Set the voice to use for the speech synthesis. Default value is
yading@10 13751 C<kal>. See also the I<list_voices> option.
yading@10 13752
yading@10 13753 =back
yading@10 13754
yading@10 13755
yading@10 13756
yading@10 13757 =head3 Examples
yading@10 13758
yading@10 13759
yading@10 13760
yading@10 13761 =over 4
yading@10 13762
yading@10 13763
yading@10 13764 =item *
yading@10 13765
yading@10 13766 Read from file F<speech.txt>, and synthetize the text using the
yading@10 13767 standard flite voice:
yading@10 13768
yading@10 13769 flite=textfile=speech.txt
yading@10 13770
yading@10 13771
yading@10 13772
yading@10 13773 =item *
yading@10 13774
yading@10 13775 Read the specified text selecting the C<slt> voice:
yading@10 13776
yading@10 13777 flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
yading@10 13778
yading@10 13779
yading@10 13780
yading@10 13781 =item *
yading@10 13782
yading@10 13783 Input text to ffmpeg:
yading@10 13784
yading@10 13785 ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
yading@10 13786
yading@10 13787
yading@10 13788
yading@10 13789 =item *
yading@10 13790
yading@10 13791 Make F<ffplay> speak the specified text, using C<flite> and
yading@10 13792 the C<lavfi> device:
yading@10 13793
yading@10 13794 ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
yading@10 13795
yading@10 13796
yading@10 13797 =back
yading@10 13798
yading@10 13799
yading@10 13800 For more information about libflite, check:
yading@10 13801 E<lt>B<http://www.speech.cs.cmu.edu/flite/>E<gt>
yading@10 13802
yading@10 13803
yading@10 13804 =head2 sine
yading@10 13805
yading@10 13806
yading@10 13807 Generate an audio signal made of a sine wave with amplitude 1/8.
yading@10 13808
yading@10 13809 The audio signal is bit-exact.
yading@10 13810
yading@10 13811 The filter accepts the following options:
yading@10 13812
yading@10 13813
yading@10 13814 =over 4
yading@10 13815
yading@10 13816
yading@10 13817
yading@10 13818 =item B<frequency, f>
yading@10 13819
yading@10 13820 Set the carrier frequency. Default is 440 Hz.
yading@10 13821
yading@10 13822
yading@10 13823 =item B<beep_factor, b>
yading@10 13824
yading@10 13825 Enable a periodic beep every second with frequency I<beep_factor> times
yading@10 13826 the carrier frequency. Default is 0, meaning the beep is disabled.
yading@10 13827
yading@10 13828
yading@10 13829 =item B<sample_rate, s>
yading@10 13830
yading@10 13831 Specify the sample rate, default is 44100.
yading@10 13832
yading@10 13833
yading@10 13834 =item B<duration, d>
yading@10 13835
yading@10 13836 Specify the duration of the generated audio stream.
yading@10 13837
yading@10 13838
yading@10 13839 =item B<samples_per_frame>
yading@10 13840
yading@10 13841 Set the number of samples per output frame, default is 1024.
yading@10 13842
yading@10 13843 =back
yading@10 13844
yading@10 13845
yading@10 13846
yading@10 13847 =head3 Examples
yading@10 13848
yading@10 13849
yading@10 13850
yading@10 13851 =over 4
yading@10 13852
yading@10 13853
yading@10 13854
yading@10 13855 =item *
yading@10 13856
yading@10 13857 Generate a simple 440 Hz sine wave:
yading@10 13858
yading@10 13859 sine
yading@10 13860
yading@10 13861
yading@10 13862
yading@10 13863 =item *
yading@10 13864
yading@10 13865 Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
yading@10 13866
yading@10 13867 sine=220:4:d=5
yading@10 13868 sine=f=220:b=4:d=5
yading@10 13869 sine=frequency=220:beep_factor=4:duration=5
yading@10 13870
yading@10 13871
yading@10 13872
yading@10 13873 =back
yading@10 13874
yading@10 13875
yading@10 13876
yading@10 13877
yading@10 13878 =head1 AUDIO SINKS
yading@10 13879
yading@10 13880
yading@10 13881 Below is a description of the currently available audio sinks.
yading@10 13882
yading@10 13883
yading@10 13884 =head2 abuffersink
yading@10 13885
yading@10 13886
yading@10 13887 Buffer audio frames, and make them available to the end of filter chain.
yading@10 13888
yading@10 13889 This sink is mainly intended for programmatic use, in particular
yading@10 13890 through the interface defined in F<libavfilter/buffersink.h>
yading@10 13891 or the options system.
yading@10 13892
yading@10 13893 It accepts a pointer to an AVABufferSinkContext structure, which
yading@10 13894 defines the incoming buffers' formats, to be passed as the opaque
yading@10 13895 parameter to C<avfilter_init_filter> for initialization.
yading@10 13896
yading@10 13897
yading@10 13898 =head2 anullsink
yading@10 13899
yading@10 13900
yading@10 13901 Null audio sink, do absolutely nothing with the input audio. It is
yading@10 13902 mainly useful as a template and to be employed in analysis / debugging
yading@10 13903 tools.
yading@10 13904
yading@10 13905
yading@10 13906
yading@10 13907 =head1 VIDEO FILTERS
yading@10 13908
yading@10 13909
yading@10 13910 When you configure your FFmpeg build, you can disable any of the
yading@10 13911 existing filters using C<--disable-filters>.
yading@10 13912 The configure output will show the video filters included in your
yading@10 13913 build.
yading@10 13914
yading@10 13915 Below is a description of the currently available video filters.
yading@10 13916
yading@10 13917
yading@10 13918 =head2 alphaextract
yading@10 13919
yading@10 13920
yading@10 13921 Extract the alpha component from the input as a grayscale video. This
yading@10 13922 is especially useful with the I<alphamerge> filter.
yading@10 13923
yading@10 13924
yading@10 13925 =head2 alphamerge
yading@10 13926
yading@10 13927
yading@10 13928 Add or replace the alpha component of the primary input with the
yading@10 13929 grayscale value of a second input. This is intended for use with
yading@10 13930 I<alphaextract> to allow the transmission or storage of frame
yading@10 13931 sequences that have alpha in a format that doesn't support an alpha
yading@10 13932 channel.
yading@10 13933
yading@10 13934 For example, to reconstruct full frames from a normal YUV-encoded video
yading@10 13935 and a separate video created with I<alphaextract>, you might use:
yading@10 13936
yading@10 13937 movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
yading@10 13938
yading@10 13939
yading@10 13940 Since this filter is designed for reconstruction, it operates on frame
yading@10 13941 sequences without considering timestamps, and terminates when either
yading@10 13942 input reaches end of stream. This will cause problems if your encoding
yading@10 13943 pipeline drops frames. If you're trying to apply an image as an
yading@10 13944 overlay to a video stream, consider the I<overlay> filter instead.
yading@10 13945
yading@10 13946
yading@10 13947 =head2 ass
yading@10 13948
yading@10 13949
yading@10 13950 Same as the subtitles filter, except that it doesn't require libavcodec
yading@10 13951 and libavformat to work. On the other hand, it is limited to ASS (Advanced
yading@10 13952 Substation Alpha) subtitles files.
yading@10 13953
yading@10 13954
yading@10 13955 =head2 bbox
yading@10 13956
yading@10 13957
yading@10 13958 Compute the bounding box for the non-black pixels in the input frame
yading@10 13959 luminance plane.
yading@10 13960
yading@10 13961 This filter computes the bounding box containing all the pixels with a
yading@10 13962 luminance value greater than the minimum allowed value.
yading@10 13963 The parameters describing the bounding box are printed on the filter
yading@10 13964 log.
yading@10 13965
yading@10 13966
yading@10 13967 =head2 blackdetect
yading@10 13968
yading@10 13969
yading@10 13970 Detect video intervals that are (almost) completely black. Can be
yading@10 13971 useful to detect chapter transitions, commercials, or invalid
yading@10 13972 recordings. Output lines contains the time for the start, end and
yading@10 13973 duration of the detected black interval expressed in seconds.
yading@10 13974
yading@10 13975 In order to display the output lines, you need to set the loglevel at
yading@10 13976 least to the AV_LOG_INFO value.
yading@10 13977
yading@10 13978 The filter accepts the following options:
yading@10 13979
yading@10 13980
yading@10 13981 =over 4
yading@10 13982
yading@10 13983
yading@10 13984 =item B<black_min_duration, d>
yading@10 13985
yading@10 13986 Set the minimum detected black duration expressed in seconds. It must
yading@10 13987 be a non-negative floating point number.
yading@10 13988
yading@10 13989 Default value is 2.0.
yading@10 13990
yading@10 13991
yading@10 13992 =item B<picture_black_ratio_th, pic_th>
yading@10 13993
yading@10 13994 Set the threshold for considering a picture "black".
yading@10 13995 Express the minimum value for the ratio:
yading@10 13996
yading@10 13997 <nb_black_pixels> / <nb_pixels>
yading@10 13998
yading@10 13999
yading@10 14000 for which a picture is considered black.
yading@10 14001 Default value is 0.98.
yading@10 14002
yading@10 14003
yading@10 14004 =item B<pixel_black_th, pix_th>
yading@10 14005
yading@10 14006 Set the threshold for considering a pixel "black".
yading@10 14007
yading@10 14008 The threshold expresses the maximum pixel luminance value for which a
yading@10 14009 pixel is considered "black". The provided value is scaled according to
yading@10 14010 the following equation:
yading@10 14011
yading@10 14012 <absolute_threshold> = <luminance_minimum_value> + <pixel_black_th> * <luminance_range_size>
yading@10 14013
yading@10 14014
yading@10 14015 I<luminance_range_size> and I<luminance_minimum_value> depend on
yading@10 14016 the input video format, the range is [0-255] for YUV full-range
yading@10 14017 formats and [16-235] for YUV non full-range formats.
yading@10 14018
yading@10 14019 Default value is 0.10.
yading@10 14020
yading@10 14021 =back
yading@10 14022
yading@10 14023
yading@10 14024 The following example sets the maximum pixel threshold to the minimum
yading@10 14025 value, and detects only black intervals of 2 or more seconds:
yading@10 14026
yading@10 14027 blackdetect=d=2:pix_th=0.00
yading@10 14028
yading@10 14029
yading@10 14030
yading@10 14031 =head2 blackframe
yading@10 14032
yading@10 14033
yading@10 14034 Detect frames that are (almost) completely black. Can be useful to
yading@10 14035 detect chapter transitions or commercials. Output lines consist of
yading@10 14036 the frame number of the detected frame, the percentage of blackness,
yading@10 14037 the position in the file if known or -1 and the timestamp in seconds.
yading@10 14038
yading@10 14039 In order to display the output lines, you need to set the loglevel at
yading@10 14040 least to the AV_LOG_INFO value.
yading@10 14041
yading@10 14042 The filter accepts the following options:
yading@10 14043
yading@10 14044
yading@10 14045 =over 4
yading@10 14046
yading@10 14047
yading@10 14048
yading@10 14049 =item B<amount>
yading@10 14050
yading@10 14051 Set the percentage of the pixels that have to be below the threshold, defaults
yading@10 14052 to C<98>.
yading@10 14053
yading@10 14054
yading@10 14055 =item B<threshold, thresh>
yading@10 14056
yading@10 14057 Set the threshold below which a pixel value is considered black, defaults to
yading@10 14058 C<32>.
yading@10 14059
yading@10 14060
yading@10 14061 =back
yading@10 14062
yading@10 14063
yading@10 14064
yading@10 14065 =head2 blend
yading@10 14066
yading@10 14067
yading@10 14068 Blend two video frames into each other.
yading@10 14069
yading@10 14070 It takes two input streams and outputs one stream, the first input is the
yading@10 14071 "top" layer and second input is "bottom" layer.
yading@10 14072 Output terminates when shortest input terminates.
yading@10 14073
yading@10 14074 A description of the accepted options follows.
yading@10 14075
yading@10 14076
yading@10 14077 =over 4
yading@10 14078
yading@10 14079
yading@10 14080 =item B<c0_mode>
yading@10 14081
yading@10 14082
yading@10 14083 =item B<c1_mode>
yading@10 14084
yading@10 14085
yading@10 14086 =item B<c2_mode>
yading@10 14087
yading@10 14088
yading@10 14089 =item B<c3_mode>
yading@10 14090
yading@10 14091
yading@10 14092 =item B<all_mode>
yading@10 14093
yading@10 14094 Set blend mode for specific pixel component or all pixel components in case
yading@10 14095 of I<all_mode>. Default value is C<normal>.
yading@10 14096
yading@10 14097 Available values for component modes are:
yading@10 14098
yading@10 14099 =over 4
yading@10 14100
yading@10 14101
yading@10 14102 =item B<addition>
yading@10 14103
yading@10 14104
yading@10 14105 =item B<and>
yading@10 14106
yading@10 14107
yading@10 14108 =item B<average>
yading@10 14109
yading@10 14110
yading@10 14111 =item B<burn>
yading@10 14112
yading@10 14113
yading@10 14114 =item B<darken>
yading@10 14115
yading@10 14116
yading@10 14117 =item B<difference>
yading@10 14118
yading@10 14119
yading@10 14120 =item B<divide>
yading@10 14121
yading@10 14122
yading@10 14123 =item B<dodge>
yading@10 14124
yading@10 14125
yading@10 14126 =item B<exclusion>
yading@10 14127
yading@10 14128
yading@10 14129 =item B<hardlight>
yading@10 14130
yading@10 14131
yading@10 14132 =item B<lighten>
yading@10 14133
yading@10 14134
yading@10 14135 =item B<multiply>
yading@10 14136
yading@10 14137
yading@10 14138 =item B<negation>
yading@10 14139
yading@10 14140
yading@10 14141 =item B<normal>
yading@10 14142
yading@10 14143
yading@10 14144 =item B<or>
yading@10 14145
yading@10 14146
yading@10 14147 =item B<overlay>
yading@10 14148
yading@10 14149
yading@10 14150 =item B<phoenix>
yading@10 14151
yading@10 14152
yading@10 14153 =item B<pinlight>
yading@10 14154
yading@10 14155
yading@10 14156 =item B<reflect>
yading@10 14157
yading@10 14158
yading@10 14159 =item B<screen>
yading@10 14160
yading@10 14161
yading@10 14162 =item B<softlight>
yading@10 14163
yading@10 14164
yading@10 14165 =item B<subtract>
yading@10 14166
yading@10 14167
yading@10 14168 =item B<vividlight>
yading@10 14169
yading@10 14170
yading@10 14171 =item B<xor>
yading@10 14172
yading@10 14173
yading@10 14174 =back
yading@10 14175
yading@10 14176
yading@10 14177
yading@10 14178 =item B<c0_opacity>
yading@10 14179
yading@10 14180
yading@10 14181 =item B<c1_opacity>
yading@10 14182
yading@10 14183
yading@10 14184 =item B<c2_opacity>
yading@10 14185
yading@10 14186
yading@10 14187 =item B<c3_opacity>
yading@10 14188
yading@10 14189
yading@10 14190 =item B<all_opacity>
yading@10 14191
yading@10 14192 Set blend opacity for specific pixel component or all pixel components in case
yading@10 14193 of I<all_opacity>. Only used in combination with pixel component blend modes.
yading@10 14194
yading@10 14195
yading@10 14196 =item B<c0_expr>
yading@10 14197
yading@10 14198
yading@10 14199 =item B<c1_expr>
yading@10 14200
yading@10 14201
yading@10 14202 =item B<c2_expr>
yading@10 14203
yading@10 14204
yading@10 14205 =item B<c3_expr>
yading@10 14206
yading@10 14207
yading@10 14208 =item B<all_expr>
yading@10 14209
yading@10 14210 Set blend expression for specific pixel component or all pixel components in case
yading@10 14211 of I<all_expr>. Note that related mode options will be ignored if those are set.
yading@10 14212
yading@10 14213 The expressions can use the following variables:
yading@10 14214
yading@10 14215
yading@10 14216 =over 4
yading@10 14217
yading@10 14218
yading@10 14219 =item B<N>
yading@10 14220
yading@10 14221 The sequential number of the filtered frame, starting from C<0>.
yading@10 14222
yading@10 14223
yading@10 14224 =item B<X>
yading@10 14225
yading@10 14226
yading@10 14227 =item B<Y>
yading@10 14228
yading@10 14229 the coordinates of the current sample
yading@10 14230
yading@10 14231
yading@10 14232 =item B<W>
yading@10 14233
yading@10 14234
yading@10 14235 =item B<H>
yading@10 14236
yading@10 14237 the width and height of currently filtered plane
yading@10 14238
yading@10 14239
yading@10 14240 =item B<SW>
yading@10 14241
yading@10 14242
yading@10 14243 =item B<SH>
yading@10 14244
yading@10 14245 Width and height scale depending on the currently filtered plane. It is the
yading@10 14246 ratio between the corresponding luma plane number of pixels and the current
yading@10 14247 plane ones. E.g. for YUV4:2:0 the values are C<1,1> for the luma plane, and
yading@10 14248 C<0.5,0.5> for chroma planes.
yading@10 14249
yading@10 14250
yading@10 14251 =item B<T>
yading@10 14252
yading@10 14253 Time of the current frame, expressed in seconds.
yading@10 14254
yading@10 14255
yading@10 14256 =item B<TOP, A>
yading@10 14257
yading@10 14258 Value of pixel component at current location for first video frame (top layer).
yading@10 14259
yading@10 14260
yading@10 14261 =item B<BOTTOM, B>
yading@10 14262
yading@10 14263 Value of pixel component at current location for second video frame (bottom layer).
yading@10 14264
yading@10 14265 =back
yading@10 14266
yading@10 14267
yading@10 14268 =back
yading@10 14269
yading@10 14270
yading@10 14271
yading@10 14272 =head3 Examples
yading@10 14273
yading@10 14274
yading@10 14275
yading@10 14276 =over 4
yading@10 14277
yading@10 14278
yading@10 14279 =item *
yading@10 14280
yading@10 14281 Apply transition from bottom layer to top layer in first 10 seconds:
yading@10 14282
yading@10 14283 blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
yading@10 14284
yading@10 14285
yading@10 14286
yading@10 14287 =item *
yading@10 14288
yading@10 14289 Apply 1x1 checkerboard effect:
yading@10 14290
yading@10 14291 blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
yading@10 14292
yading@10 14293
yading@10 14294 =back
yading@10 14295
yading@10 14296
yading@10 14297
yading@10 14298 =head2 boxblur
yading@10 14299
yading@10 14300
yading@10 14301 Apply boxblur algorithm to the input video.
yading@10 14302
yading@10 14303 The filter accepts the following options:
yading@10 14304
yading@10 14305
yading@10 14306 =over 4
yading@10 14307
yading@10 14308
yading@10 14309
yading@10 14310 =item B<luma_radius, lr>
yading@10 14311
yading@10 14312
yading@10 14313 =item B<luma_power, lp>
yading@10 14314
yading@10 14315
yading@10 14316 =item B<chroma_radius, cr>
yading@10 14317
yading@10 14318
yading@10 14319 =item B<chroma_power, cp>
yading@10 14320
yading@10 14321
yading@10 14322 =item B<alpha_radius, ar>
yading@10 14323
yading@10 14324
yading@10 14325 =item B<alpha_power, ap>
yading@10 14326
yading@10 14327
yading@10 14328
yading@10 14329 =back
yading@10 14330
yading@10 14331
yading@10 14332 A description of the accepted options follows.
yading@10 14333
yading@10 14334
yading@10 14335 =over 4
yading@10 14336
yading@10 14337
yading@10 14338 =item B<luma_radius, lr>
yading@10 14339
yading@10 14340
yading@10 14341 =item B<chroma_radius, cr>
yading@10 14342
yading@10 14343
yading@10 14344 =item B<alpha_radius, ar>
yading@10 14345
yading@10 14346 Set an expression for the box radius in pixels used for blurring the
yading@10 14347 corresponding input plane.
yading@10 14348
yading@10 14349 The radius value must be a non-negative number, and must not be
yading@10 14350 greater than the value of the expression C<min(w,h)/2> for the
yading@10 14351 luma and alpha planes, and of C<min(cw,ch)/2> for the chroma
yading@10 14352 planes.
yading@10 14353
yading@10 14354 Default value for B<luma_radius> is "2". If not specified,
yading@10 14355 B<chroma_radius> and B<alpha_radius> default to the
yading@10 14356 corresponding value set for B<luma_radius>.
yading@10 14357
yading@10 14358 The expressions can contain the following constants:
yading@10 14359
yading@10 14360 =over 4
yading@10 14361
yading@10 14362
yading@10 14363 =item B<w, h>
yading@10 14364
yading@10 14365 the input width and height in pixels
yading@10 14366
yading@10 14367
yading@10 14368 =item B<cw, ch>
yading@10 14369
yading@10 14370 the input chroma image width and height in pixels
yading@10 14371
yading@10 14372
yading@10 14373 =item B<hsub, vsub>
yading@10 14374
yading@10 14375 horizontal and vertical chroma subsample values. For example for the
yading@10 14376 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 14377
yading@10 14378 =back
yading@10 14379
yading@10 14380
yading@10 14381
yading@10 14382 =item B<luma_power, lp>
yading@10 14383
yading@10 14384
yading@10 14385 =item B<chroma_power, cp>
yading@10 14386
yading@10 14387
yading@10 14388 =item B<alpha_power, ap>
yading@10 14389
yading@10 14390 Specify how many times the boxblur filter is applied to the
yading@10 14391 corresponding plane.
yading@10 14392
yading@10 14393 Default value for B<luma_power> is 2. If not specified,
yading@10 14394 B<chroma_power> and B<alpha_power> default to the
yading@10 14395 corresponding value set for B<luma_power>.
yading@10 14396
yading@10 14397 A value of 0 will disable the effect.
yading@10 14398
yading@10 14399 =back
yading@10 14400
yading@10 14401
yading@10 14402
yading@10 14403 =head3 Examples
yading@10 14404
yading@10 14405
yading@10 14406
yading@10 14407 =over 4
yading@10 14408
yading@10 14409
yading@10 14410 =item *
yading@10 14411
yading@10 14412 Apply a boxblur filter with luma, chroma, and alpha radius
yading@10 14413 set to 2:
yading@10 14414
yading@10 14415 boxblur=luma_radius=2:luma_power=1
yading@10 14416 boxblur=2:1
yading@10 14417
yading@10 14418
yading@10 14419
yading@10 14420 =item *
yading@10 14421
yading@10 14422 Set luma radius to 2, alpha and chroma radius to 0:
yading@10 14423
yading@10 14424 boxblur=2:1:cr=0:ar=0
yading@10 14425
yading@10 14426
yading@10 14427
yading@10 14428 =item *
yading@10 14429
yading@10 14430 Set luma and chroma radius to a fraction of the video dimension:
yading@10 14431
yading@10 14432 boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
yading@10 14433
yading@10 14434
yading@10 14435 =back
yading@10 14436
yading@10 14437
yading@10 14438
yading@10 14439 =head2 colorbalance
yading@10 14440
yading@10 14441 Modify intensity of primary colors (red, green and blue) of input frames.
yading@10 14442
yading@10 14443 The filter allows an input frame to be adjusted in the shadows, midtones or highlights
yading@10 14444 regions for the red-cyan, green-magenta or blue-yellow balance.
yading@10 14445
yading@10 14446 A positive adjustment value shifts the balance towards the primary color, a negative
yading@10 14447 value towards the complementary color.
yading@10 14448
yading@10 14449 The filter accepts the following options:
yading@10 14450
yading@10 14451
yading@10 14452 =over 4
yading@10 14453
yading@10 14454
yading@10 14455 =item B<rs>
yading@10 14456
yading@10 14457
yading@10 14458 =item B<gs>
yading@10 14459
yading@10 14460
yading@10 14461 =item B<bs>
yading@10 14462
yading@10 14463 Adjust red, green and blue shadows (darkest pixels).
yading@10 14464
yading@10 14465
yading@10 14466 =item B<rm>
yading@10 14467
yading@10 14468
yading@10 14469 =item B<gm>
yading@10 14470
yading@10 14471
yading@10 14472 =item B<bm>
yading@10 14473
yading@10 14474 Adjust red, green and blue midtones (medium pixels).
yading@10 14475
yading@10 14476
yading@10 14477 =item B<rh>
yading@10 14478
yading@10 14479
yading@10 14480 =item B<gh>
yading@10 14481
yading@10 14482
yading@10 14483 =item B<bh>
yading@10 14484
yading@10 14485 Adjust red, green and blue highlights (brightest pixels).
yading@10 14486
yading@10 14487 Allowed ranges for options are C<[-1.0, 1.0]>. Defaults are C<0>.
yading@10 14488
yading@10 14489 =back
yading@10 14490
yading@10 14491
yading@10 14492
yading@10 14493 =head3 Examples
yading@10 14494
yading@10 14495
yading@10 14496
yading@10 14497 =over 4
yading@10 14498
yading@10 14499
yading@10 14500 =item *
yading@10 14501
yading@10 14502 Add red color cast to shadows:
yading@10 14503
yading@10 14504 colorbalance=rs=.3
yading@10 14505
yading@10 14506
yading@10 14507 =back
yading@10 14508
yading@10 14509
yading@10 14510
yading@10 14511 =head2 colorchannelmixer
yading@10 14512
yading@10 14513
yading@10 14514 Adjust video input frames by re-mixing color channels.
yading@10 14515
yading@10 14516 This filter modifies a color channel by adding the values associated to
yading@10 14517 the other channels of the same pixels. For example if the value to
yading@10 14518 modify is red, the output value will be:
yading@10 14519
yading@10 14520 <red>=<red>*<rr> + <blue>*<rb> + <green>*<rg> + <alpha>*<ra>
yading@10 14521
yading@10 14522
yading@10 14523 The filter accepts the following options:
yading@10 14524
yading@10 14525
yading@10 14526 =over 4
yading@10 14527
yading@10 14528
yading@10 14529 =item B<rr>
yading@10 14530
yading@10 14531
yading@10 14532 =item B<rg>
yading@10 14533
yading@10 14534
yading@10 14535 =item B<rb>
yading@10 14536
yading@10 14537
yading@10 14538 =item B<ra>
yading@10 14539
yading@10 14540 Adjust contribution of input red, green, blue and alpha channels for output red channel.
yading@10 14541 Default is C<1> for I<rr>, and C<0> for I<rg>, I<rb> and I<ra>.
yading@10 14542
yading@10 14543
yading@10 14544 =item B<gr>
yading@10 14545
yading@10 14546
yading@10 14547 =item B<gg>
yading@10 14548
yading@10 14549
yading@10 14550 =item B<gb>
yading@10 14551
yading@10 14552
yading@10 14553 =item B<ga>
yading@10 14554
yading@10 14555 Adjust contribution of input red, green, blue and alpha channels for output green channel.
yading@10 14556 Default is C<1> for I<gg>, and C<0> for I<gr>, I<gb> and I<ga>.
yading@10 14557
yading@10 14558
yading@10 14559 =item B<br>
yading@10 14560
yading@10 14561
yading@10 14562 =item B<bg>
yading@10 14563
yading@10 14564
yading@10 14565 =item B<bb>
yading@10 14566
yading@10 14567
yading@10 14568 =item B<ba>
yading@10 14569
yading@10 14570 Adjust contribution of input red, green, blue and alpha channels for output blue channel.
yading@10 14571 Default is C<1> for I<bb>, and C<0> for I<br>, I<bg> and I<ba>.
yading@10 14572
yading@10 14573
yading@10 14574 =item B<ar>
yading@10 14575
yading@10 14576
yading@10 14577 =item B<ag>
yading@10 14578
yading@10 14579
yading@10 14580 =item B<ab>
yading@10 14581
yading@10 14582
yading@10 14583 =item B<aa>
yading@10 14584
yading@10 14585 Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
yading@10 14586 Default is C<1> for I<aa>, and C<0> for I<ar>, I<ag> and I<ab>.
yading@10 14587
yading@10 14588 Allowed ranges for options are C<[-2.0, 2.0]>.
yading@10 14589
yading@10 14590 =back
yading@10 14591
yading@10 14592
yading@10 14593
yading@10 14594 =head3 Examples
yading@10 14595
yading@10 14596
yading@10 14597
yading@10 14598 =over 4
yading@10 14599
yading@10 14600
yading@10 14601 =item *
yading@10 14602
yading@10 14603 Convert source to grayscale:
yading@10 14604
yading@10 14605 colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
yading@10 14606
yading@10 14607
yading@10 14608 =back
yading@10 14609
yading@10 14610
yading@10 14611
yading@10 14612 =head2 colormatrix
yading@10 14613
yading@10 14614
yading@10 14615 Convert color matrix.
yading@10 14616
yading@10 14617 The filter accepts the following options:
yading@10 14618
yading@10 14619
yading@10 14620 =over 4
yading@10 14621
yading@10 14622
yading@10 14623 =item B<src>
yading@10 14624
yading@10 14625
yading@10 14626 =item B<dst>
yading@10 14627
yading@10 14628 Specify the source and destination color matrix. Both values must be
yading@10 14629 specified.
yading@10 14630
yading@10 14631 The accepted values are:
yading@10 14632
yading@10 14633 =over 4
yading@10 14634
yading@10 14635
yading@10 14636 =item B<bt709>
yading@10 14637
yading@10 14638 BT.709
yading@10 14639
yading@10 14640
yading@10 14641 =item B<bt601>
yading@10 14642
yading@10 14643 BT.601
yading@10 14644
yading@10 14645
yading@10 14646 =item B<smpte240m>
yading@10 14647
yading@10 14648 SMPTE-240M
yading@10 14649
yading@10 14650
yading@10 14651 =item B<fcc>
yading@10 14652
yading@10 14653 FCC
yading@10 14654
yading@10 14655 =back
yading@10 14656
yading@10 14657
yading@10 14658 =back
yading@10 14659
yading@10 14660
yading@10 14661 For example to convert from BT.601 to SMPTE-240M, use the command:
yading@10 14662
yading@10 14663 colormatrix=bt601:smpte240m
yading@10 14664
yading@10 14665
yading@10 14666
yading@10 14667 =head2 copy
yading@10 14668
yading@10 14669
yading@10 14670 Copy the input source unchanged to the output. Mainly useful for
yading@10 14671 testing purposes.
yading@10 14672
yading@10 14673
yading@10 14674 =head2 crop
yading@10 14675
yading@10 14676
yading@10 14677 Crop the input video to given dimensions.
yading@10 14678
yading@10 14679 The filter accepts the following options:
yading@10 14680
yading@10 14681
yading@10 14682 =over 4
yading@10 14683
yading@10 14684
yading@10 14685 =item B<w, out_w>
yading@10 14686
yading@10 14687 Width of the output video. It defaults to C<iw>.
yading@10 14688 This expression is evaluated only once during the filter
yading@10 14689 configuration.
yading@10 14690
yading@10 14691
yading@10 14692 =item B<h, out_h>
yading@10 14693
yading@10 14694 Height of the output video. It defaults to C<ih>.
yading@10 14695 This expression is evaluated only once during the filter
yading@10 14696 configuration.
yading@10 14697
yading@10 14698
yading@10 14699 =item B<x>
yading@10 14700
yading@10 14701 Horizontal position, in the input video, of the left edge of the output video.
yading@10 14702 It defaults to C<(in_w-out_w)/2>.
yading@10 14703 This expression is evaluated per-frame.
yading@10 14704
yading@10 14705
yading@10 14706 =item B<y>
yading@10 14707
yading@10 14708 Vertical position, in the input video, of the top edge of the output video.
yading@10 14709 It defaults to C<(in_h-out_h)/2>.
yading@10 14710 This expression is evaluated per-frame.
yading@10 14711
yading@10 14712
yading@10 14713 =item B<keep_aspect>
yading@10 14714
yading@10 14715 If set to 1 will force the output display aspect ratio
yading@10 14716 to be the same of the input, by changing the output sample aspect
yading@10 14717 ratio. It defaults to 0.
yading@10 14718
yading@10 14719 =back
yading@10 14720
yading@10 14721
yading@10 14722 The I<out_w>, I<out_h>, I<x>, I<y> parameters are
yading@10 14723 expressions containing the following constants:
yading@10 14724
yading@10 14725
yading@10 14726 =over 4
yading@10 14727
yading@10 14728
yading@10 14729 =item B<x, y>
yading@10 14730
yading@10 14731 the computed values for I<x> and I<y>. They are evaluated for
yading@10 14732 each new frame.
yading@10 14733
yading@10 14734
yading@10 14735 =item B<in_w, in_h>
yading@10 14736
yading@10 14737 the input width and height
yading@10 14738
yading@10 14739
yading@10 14740 =item B<iw, ih>
yading@10 14741
yading@10 14742 same as I<in_w> and I<in_h>
yading@10 14743
yading@10 14744
yading@10 14745 =item B<out_w, out_h>
yading@10 14746
yading@10 14747 the output (cropped) width and height
yading@10 14748
yading@10 14749
yading@10 14750 =item B<ow, oh>
yading@10 14751
yading@10 14752 same as I<out_w> and I<out_h>
yading@10 14753
yading@10 14754
yading@10 14755 =item B<a>
yading@10 14756
yading@10 14757 same as I<iw> / I<ih>
yading@10 14758
yading@10 14759
yading@10 14760 =item B<sar>
yading@10 14761
yading@10 14762 input sample aspect ratio
yading@10 14763
yading@10 14764
yading@10 14765 =item B<dar>
yading@10 14766
yading@10 14767 input display aspect ratio, it is the same as (I<iw> / I<ih>) * I<sar>
yading@10 14768
yading@10 14769
yading@10 14770 =item B<hsub, vsub>
yading@10 14771
yading@10 14772 horizontal and vertical chroma subsample values. For example for the
yading@10 14773 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 14774
yading@10 14775
yading@10 14776 =item B<n>
yading@10 14777
yading@10 14778 the number of input frame, starting from 0
yading@10 14779
yading@10 14780
yading@10 14781 =item B<pos>
yading@10 14782
yading@10 14783 the position in the file of the input frame, NAN if unknown
yading@10 14784
yading@10 14785
yading@10 14786 =item B<t>
yading@10 14787
yading@10 14788 timestamp expressed in seconds, NAN if the input timestamp is unknown
yading@10 14789
yading@10 14790
yading@10 14791 =back
yading@10 14792
yading@10 14793
yading@10 14794 The expression for I<out_w> may depend on the value of I<out_h>,
yading@10 14795 and the expression for I<out_h> may depend on I<out_w>, but they
yading@10 14796 cannot depend on I<x> and I<y>, as I<x> and I<y> are
yading@10 14797 evaluated after I<out_w> and I<out_h>.
yading@10 14798
yading@10 14799 The I<x> and I<y> parameters specify the expressions for the
yading@10 14800 position of the top-left corner of the output (non-cropped) area. They
yading@10 14801 are evaluated for each frame. If the evaluated value is not valid, it
yading@10 14802 is approximated to the nearest valid value.
yading@10 14803
yading@10 14804 The expression for I<x> may depend on I<y>, and the expression
yading@10 14805 for I<y> may depend on I<x>.
yading@10 14806
yading@10 14807
yading@10 14808 =head3 Examples
yading@10 14809
yading@10 14810
yading@10 14811
yading@10 14812 =over 4
yading@10 14813
yading@10 14814
yading@10 14815 =item *
yading@10 14816
yading@10 14817 Crop area with size 100x100 at position (12,34).
yading@10 14818
yading@10 14819 crop=100:100:12:34
yading@10 14820
yading@10 14821
yading@10 14822 Using named options, the example above becomes:
yading@10 14823
yading@10 14824 crop=w=100:h=100:x=12:y=34
yading@10 14825
yading@10 14826
yading@10 14827
yading@10 14828 =item *
yading@10 14829
yading@10 14830 Crop the central input area with size 100x100:
yading@10 14831
yading@10 14832 crop=100:100
yading@10 14833
yading@10 14834
yading@10 14835
yading@10 14836 =item *
yading@10 14837
yading@10 14838 Crop the central input area with size 2/3 of the input video:
yading@10 14839
yading@10 14840 crop=2/3*in_w:2/3*in_h
yading@10 14841
yading@10 14842
yading@10 14843
yading@10 14844 =item *
yading@10 14845
yading@10 14846 Crop the input video central square:
yading@10 14847
yading@10 14848 crop=out_w=in_h
yading@10 14849 crop=in_h
yading@10 14850
yading@10 14851
yading@10 14852
yading@10 14853 =item *
yading@10 14854
yading@10 14855 Delimit the rectangle with the top-left corner placed at position
yading@10 14856 100:100 and the right-bottom corner corresponding to the right-bottom
yading@10 14857 corner of the input image:
yading@10 14858
yading@10 14859 crop=in_w-100:in_h-100:100:100
yading@10 14860
yading@10 14861
yading@10 14862
yading@10 14863 =item *
yading@10 14864
yading@10 14865 Crop 10 pixels from the left and right borders, and 20 pixels from
yading@10 14866 the top and bottom borders
yading@10 14867
yading@10 14868 crop=in_w-2*10:in_h-2*20
yading@10 14869
yading@10 14870
yading@10 14871
yading@10 14872 =item *
yading@10 14873
yading@10 14874 Keep only the bottom right quarter of the input image:
yading@10 14875
yading@10 14876 crop=in_w/2:in_h/2:in_w/2:in_h/2
yading@10 14877
yading@10 14878
yading@10 14879
yading@10 14880 =item *
yading@10 14881
yading@10 14882 Crop height for getting Greek harmony:
yading@10 14883
yading@10 14884 crop=in_w:1/PHI*in_w
yading@10 14885
yading@10 14886
yading@10 14887
yading@10 14888 =item *
yading@10 14889
yading@10 14890 Appply trembling effect:
yading@10 14891
yading@10 14892 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 14893
yading@10 14894
yading@10 14895
yading@10 14896 =item *
yading@10 14897
yading@10 14898 Apply erratic camera effect depending on timestamp:
yading@10 14899
yading@10 14900 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 14901
yading@10 14902
yading@10 14903
yading@10 14904 =item *
yading@10 14905
yading@10 14906 Set x depending on the value of y:
yading@10 14907
yading@10 14908 crop=in_w/2:in_h/2:y:10+10*sin(n/10)
yading@10 14909
yading@10 14910
yading@10 14911 =back
yading@10 14912
yading@10 14913
yading@10 14914
yading@10 14915 =head2 cropdetect
yading@10 14916
yading@10 14917
yading@10 14918 Auto-detect crop size.
yading@10 14919
yading@10 14920 Calculate necessary cropping parameters and prints the recommended
yading@10 14921 parameters through the logging system. The detected dimensions
yading@10 14922 correspond to the non-black area of the input video.
yading@10 14923
yading@10 14924 The filter accepts the following options:
yading@10 14925
yading@10 14926
yading@10 14927 =over 4
yading@10 14928
yading@10 14929
yading@10 14930
yading@10 14931 =item B<limit>
yading@10 14932
yading@10 14933 Set higher black value threshold, which can be optionally specified
yading@10 14934 from nothing (0) to everything (255). An intensity value greater
yading@10 14935 to the set value is considered non-black. Default value is 24.
yading@10 14936
yading@10 14937
yading@10 14938 =item B<round>
yading@10 14939
yading@10 14940 Set the value for which the width/height should be divisible by. The
yading@10 14941 offset is automatically adjusted to center the video. Use 2 to get
yading@10 14942 only even dimensions (needed for 4:2:2 video). 16 is best when
yading@10 14943 encoding to most video codecs. Default value is 16.
yading@10 14944
yading@10 14945
yading@10 14946 =item B<reset_count, reset>
yading@10 14947
yading@10 14948 Set the counter that determines after how many frames cropdetect will
yading@10 14949 reset the previously detected largest video area and start over to
yading@10 14950 detect the current optimal crop area. Default value is 0.
yading@10 14951
yading@10 14952 This can be useful when channel logos distort the video area. 0
yading@10 14953 indicates never reset and return the largest area encountered during
yading@10 14954 playback.
yading@10 14955
yading@10 14956 =back
yading@10 14957
yading@10 14958
yading@10 14959
yading@10 14960 =head2 curves
yading@10 14961
yading@10 14962
yading@10 14963 Apply color adjustments using curves.
yading@10 14964
yading@10 14965 This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
yading@10 14966 component (red, green and blue) has its values defined by I<N> key points
yading@10 14967 tied from each other using a smooth curve. The x-axis represents the pixel
yading@10 14968 values from the input frame, and the y-axis the new pixel values to be set for
yading@10 14969 the output frame.
yading@10 14970
yading@10 14971 By default, a component curve is defined by the two points I<(0;0)> and
yading@10 14972 I<(1;1)>. This creates a straight line where each original pixel value is
yading@10 14973 "adjusted" to its own value, which means no change to the image.
yading@10 14974
yading@10 14975 The filter allows you to redefine these two points and add some more. A new
yading@10 14976 curve (using a natural cubic spline interpolation) will be define to pass
yading@10 14977 smoothly through all these new coordinates. The new defined points needs to be
yading@10 14978 strictly increasing over the x-axis, and their I<x> and I<y> values must
yading@10 14979 be in the I<[0;1]> interval. If the computed curves happened to go outside
yading@10 14980 the vector spaces, the values will be clipped accordingly.
yading@10 14981
yading@10 14982 If there is no key point defined in C<x=0>, the filter will automatically
yading@10 14983 insert a I<(0;0)> point. In the same way, if there is no key point defined
yading@10 14984 in C<x=1>, the filter will automatically insert a I<(1;1)> point.
yading@10 14985
yading@10 14986 The filter accepts the following options:
yading@10 14987
yading@10 14988
yading@10 14989 =over 4
yading@10 14990
yading@10 14991
yading@10 14992 =item B<preset>
yading@10 14993
yading@10 14994 Select one of the available color presets. This option can be used in addition
yading@10 14995 to the B<r>, B<g>, B<b> parameters; in this case, the later
yading@10 14996 options takes priority on the preset values.
yading@10 14997 Available presets are:
yading@10 14998
yading@10 14999 =over 4
yading@10 15000
yading@10 15001
yading@10 15002 =item B<none>
yading@10 15003
yading@10 15004
yading@10 15005 =item B<color_negative>
yading@10 15006
yading@10 15007
yading@10 15008 =item B<cross_process>
yading@10 15009
yading@10 15010
yading@10 15011 =item B<darker>
yading@10 15012
yading@10 15013
yading@10 15014 =item B<increase_contrast>
yading@10 15015
yading@10 15016
yading@10 15017 =item B<lighter>
yading@10 15018
yading@10 15019
yading@10 15020 =item B<linear_contrast>
yading@10 15021
yading@10 15022
yading@10 15023 =item B<medium_contrast>
yading@10 15024
yading@10 15025
yading@10 15026 =item B<negative>
yading@10 15027
yading@10 15028
yading@10 15029 =item B<strong_contrast>
yading@10 15030
yading@10 15031
yading@10 15032 =item B<vintage>
yading@10 15033
yading@10 15034
yading@10 15035 =back
yading@10 15036
yading@10 15037 Default is C<none>.
yading@10 15038
yading@10 15039 =item B<master, m>
yading@10 15040
yading@10 15041 Set the master key points. These points will define a second pass mapping. It
yading@10 15042 is sometimes called a "luminance" or "value" mapping. It can be used with
yading@10 15043 B<r>, B<g>, B<b> or B<all> since it acts like a
yading@10 15044 post-processing LUT.
yading@10 15045
yading@10 15046 =item B<red, r>
yading@10 15047
yading@10 15048 Set the key points for the red component.
yading@10 15049
yading@10 15050 =item B<green, g>
yading@10 15051
yading@10 15052 Set the key points for the green component.
yading@10 15053
yading@10 15054 =item B<blue, b>
yading@10 15055
yading@10 15056 Set the key points for the blue component.
yading@10 15057
yading@10 15058 =item B<all>
yading@10 15059
yading@10 15060 Set the key points for all components (not including master).
yading@10 15061 Can be used in addition to the other key points component
yading@10 15062 options. In this case, the unset component(s) will fallback on this
yading@10 15063 B<all> setting.
yading@10 15064
yading@10 15065 =item B<psfile>
yading@10 15066
yading@10 15067 Specify a Photoshop curves file (C<.asv>) to import the settings from.
yading@10 15068
yading@10 15069 =back
yading@10 15070
yading@10 15071
yading@10 15072 To avoid some filtergraph syntax conflicts, each key points list need to be
yading@10 15073 defined using the following syntax: C<x0/y0 x1/y1 x2/y2 ...>.
yading@10 15074
yading@10 15075
yading@10 15076 =head3 Examples
yading@10 15077
yading@10 15078
yading@10 15079
yading@10 15080 =over 4
yading@10 15081
yading@10 15082
yading@10 15083 =item *
yading@10 15084
yading@10 15085 Increase slightly the middle level of blue:
yading@10 15086
yading@10 15087 curves=blue='0.5/0.58'
yading@10 15088
yading@10 15089
yading@10 15090
yading@10 15091 =item *
yading@10 15092
yading@10 15093 Vintage effect:
yading@10 15094
yading@10 15095 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 15096
yading@10 15097 Here we obtain the following coordinates for each components:
yading@10 15098
yading@10 15099 =over 4
yading@10 15100
yading@10 15101
yading@10 15102 =item I<red>
yading@10 15103
yading@10 15104 C<(0;0.11) (0.42;0.51) (1;0.95)>
yading@10 15105
yading@10 15106 =item I<green>
yading@10 15107
yading@10 15108 C<(0;0) (0.50;0.48) (1;1)>
yading@10 15109
yading@10 15110 =item I<blue>
yading@10 15111
yading@10 15112 C<(0;0.22) (0.49;0.44) (1;0.80)>
yading@10 15113
yading@10 15114 =back
yading@10 15115
yading@10 15116
yading@10 15117
yading@10 15118 =item *
yading@10 15119
yading@10 15120 The previous example can also be achieved with the associated built-in preset:
yading@10 15121
yading@10 15122 curves=preset=vintage
yading@10 15123
yading@10 15124
yading@10 15125
yading@10 15126 =item *
yading@10 15127
yading@10 15128 Or simply:
yading@10 15129
yading@10 15130 curves=vintage
yading@10 15131
yading@10 15132
yading@10 15133
yading@10 15134 =item *
yading@10 15135
yading@10 15136 Use a Photoshop preset and redefine the points of the green component:
yading@10 15137
yading@10 15138 curves=psfile='MyCurvesPresets/purple.asv':green='0.45/0.53'
yading@10 15139
yading@10 15140
yading@10 15141 =back
yading@10 15142
yading@10 15143
yading@10 15144
yading@10 15145
yading@10 15146 =head2 decimate
yading@10 15147
yading@10 15148
yading@10 15149 Drop duplicated frames at regular intervals.
yading@10 15150
yading@10 15151 The filter accepts the following options:
yading@10 15152
yading@10 15153
yading@10 15154 =over 4
yading@10 15155
yading@10 15156
yading@10 15157 =item B<cycle>
yading@10 15158
yading@10 15159 Set the number of frames from which one will be dropped. Setting this to
yading@10 15160 I<N> means one frame in every batch of I<N> frames will be dropped.
yading@10 15161 Default is C<5>.
yading@10 15162
yading@10 15163
yading@10 15164 =item B<dupthresh>
yading@10 15165
yading@10 15166 Set the threshold for duplicate detection. If the difference metric for a frame
yading@10 15167 is less than or equal to this value, then it is declared as duplicate. Default
yading@10 15168 is C<1.1>
yading@10 15169
yading@10 15170
yading@10 15171 =item B<scthresh>
yading@10 15172
yading@10 15173 Set scene change threshold. Default is C<15>.
yading@10 15174
yading@10 15175
yading@10 15176 =item B<blockx>
yading@10 15177
yading@10 15178
yading@10 15179 =item B<blocky>
yading@10 15180
yading@10 15181 Set the size of the x and y-axis blocks used during metric calculations.
yading@10 15182 Larger blocks give better noise suppression, but also give worse detection of
yading@10 15183 small movements. Must be a power of two. Default is C<32>.
yading@10 15184
yading@10 15185
yading@10 15186 =item B<ppsrc>
yading@10 15187
yading@10 15188 Mark main input as a pre-processed input and activate clean source input
yading@10 15189 stream. This allows the input to be pre-processed with various filters to help
yading@10 15190 the metrics calculation while keeping the frame selection lossless. When set to
yading@10 15191 C<1>, the first stream is for the pre-processed input, and the second
yading@10 15192 stream is the clean source from where the kept frames are chosen. Default is
yading@10 15193 C<0>.
yading@10 15194
yading@10 15195
yading@10 15196 =item B<chroma>
yading@10 15197
yading@10 15198 Set whether or not chroma is considered in the metric calculations. Default is
yading@10 15199 C<1>.
yading@10 15200
yading@10 15201 =back
yading@10 15202
yading@10 15203
yading@10 15204
yading@10 15205 =head2 delogo
yading@10 15206
yading@10 15207
yading@10 15208 Suppress a TV station logo by a simple interpolation of the surrounding
yading@10 15209 pixels. Just set a rectangle covering the logo and watch it disappear
yading@10 15210 (and sometimes something even uglier appear - your mileage may vary).
yading@10 15211
yading@10 15212 This filter accepts the following options:
yading@10 15213
yading@10 15214 =over 4
yading@10 15215
yading@10 15216
yading@10 15217
yading@10 15218 =item B<x, y>
yading@10 15219
yading@10 15220 Specify the top left corner coordinates of the logo. They must be
yading@10 15221 specified.
yading@10 15222
yading@10 15223
yading@10 15224 =item B<w, h>
yading@10 15225
yading@10 15226 Specify the width and height of the logo to clear. They must be
yading@10 15227 specified.
yading@10 15228
yading@10 15229
yading@10 15230 =item B<band, t>
yading@10 15231
yading@10 15232 Specify the thickness of the fuzzy edge of the rectangle (added to
yading@10 15233 I<w> and I<h>). The default value is 4.
yading@10 15234
yading@10 15235
yading@10 15236 =item B<show>
yading@10 15237
yading@10 15238 When set to 1, a green rectangle is drawn on the screen to simplify
yading@10 15239 finding the right I<x>, I<y>, I<w>, I<h> parameters, and
yading@10 15240 I<band> is set to 4. The default value is 0.
yading@10 15241
yading@10 15242
yading@10 15243 =back
yading@10 15244
yading@10 15245
yading@10 15246
yading@10 15247 =head3 Examples
yading@10 15248
yading@10 15249
yading@10 15250
yading@10 15251 =over 4
yading@10 15252
yading@10 15253
yading@10 15254 =item *
yading@10 15255
yading@10 15256 Set a rectangle covering the area with top left corner coordinates 0,0
yading@10 15257 and size 100x77, setting a band of size 10:
yading@10 15258
yading@10 15259 delogo=x=0:y=0:w=100:h=77:band=10
yading@10 15260
yading@10 15261
yading@10 15262
yading@10 15263 =back
yading@10 15264
yading@10 15265
yading@10 15266
yading@10 15267 =head2 deshake
yading@10 15268
yading@10 15269
yading@10 15270 Attempt to fix small changes in horizontal and/or vertical shift. This
yading@10 15271 filter helps remove camera shake from hand-holding a camera, bumping a
yading@10 15272 tripod, moving on a vehicle, etc.
yading@10 15273
yading@10 15274 The filter accepts the following options:
yading@10 15275
yading@10 15276
yading@10 15277 =over 4
yading@10 15278
yading@10 15279
yading@10 15280
yading@10 15281 =item B<x>
yading@10 15282
yading@10 15283
yading@10 15284 =item B<y>
yading@10 15285
yading@10 15286
yading@10 15287 =item B<w>
yading@10 15288
yading@10 15289
yading@10 15290 =item B<h>
yading@10 15291
yading@10 15292 Specify a rectangular area where to limit the search for motion
yading@10 15293 vectors.
yading@10 15294 If desired the search for motion vectors can be limited to a
yading@10 15295 rectangular area of the frame defined by its top left corner, width
yading@10 15296 and height. These parameters have the same meaning as the drawbox
yading@10 15297 filter which can be used to visualise the position of the bounding
yading@10 15298 box.
yading@10 15299
yading@10 15300 This is useful when simultaneous movement of subjects within the frame
yading@10 15301 might be confused for camera motion by the motion vector search.
yading@10 15302
yading@10 15303 If any or all of I<x>, I<y>, I<w> and I<h> are set to -1
yading@10 15304 then the full frame is used. This allows later options to be set
yading@10 15305 without specifying the bounding box for the motion vector search.
yading@10 15306
yading@10 15307 Default - search the whole frame.
yading@10 15308
yading@10 15309
yading@10 15310 =item B<rx>
yading@10 15311
yading@10 15312
yading@10 15313 =item B<ry>
yading@10 15314
yading@10 15315 Specify the maximum extent of movement in x and y directions in the
yading@10 15316 range 0-64 pixels. Default 16.
yading@10 15317
yading@10 15318
yading@10 15319 =item B<edge>
yading@10 15320
yading@10 15321 Specify how to generate pixels to fill blanks at the edge of the
yading@10 15322 frame. Available values are:
yading@10 15323
yading@10 15324 =over 4
yading@10 15325
yading@10 15326
yading@10 15327 =item B<blank, 0>
yading@10 15328
yading@10 15329 Fill zeroes at blank locations
yading@10 15330
yading@10 15331 =item B<original, 1>
yading@10 15332
yading@10 15333 Original image at blank locations
yading@10 15334
yading@10 15335 =item B<clamp, 2>
yading@10 15336
yading@10 15337 Extruded edge value at blank locations
yading@10 15338
yading@10 15339 =item B<mirror, 3>
yading@10 15340
yading@10 15341 Mirrored edge at blank locations
yading@10 15342
yading@10 15343 =back
yading@10 15344
yading@10 15345 Default value is B<mirror>.
yading@10 15346
yading@10 15347
yading@10 15348 =item B<blocksize>
yading@10 15349
yading@10 15350 Specify the blocksize to use for motion search. Range 4-128 pixels,
yading@10 15351 default 8.
yading@10 15352
yading@10 15353
yading@10 15354 =item B<contrast>
yading@10 15355
yading@10 15356 Specify the contrast threshold for blocks. Only blocks with more than
yading@10 15357 the specified contrast (difference between darkest and lightest
yading@10 15358 pixels) will be considered. Range 1-255, default 125.
yading@10 15359
yading@10 15360
yading@10 15361 =item B<search>
yading@10 15362
yading@10 15363 Specify the search strategy. Available values are:
yading@10 15364
yading@10 15365 =over 4
yading@10 15366
yading@10 15367
yading@10 15368 =item B<exhaustive, 0>
yading@10 15369
yading@10 15370 Set exhaustive search
yading@10 15371
yading@10 15372 =item B<less, 1>
yading@10 15373
yading@10 15374 Set less exhaustive search.
yading@10 15375
yading@10 15376 =back
yading@10 15377
yading@10 15378 Default value is B<exhaustive>.
yading@10 15379
yading@10 15380
yading@10 15381 =item B<filename>
yading@10 15382
yading@10 15383 If set then a detailed log of the motion search is written to the
yading@10 15384 specified file.
yading@10 15385
yading@10 15386
yading@10 15387 =item B<opencl>
yading@10 15388
yading@10 15389 If set to 1, specify using OpenCL capabilities, only available if
yading@10 15390 FFmpeg was configured with C<--enable-opencl>. Default value is 0.
yading@10 15391
yading@10 15392
yading@10 15393 =back
yading@10 15394
yading@10 15395
yading@10 15396
yading@10 15397 =head2 drawbox
yading@10 15398
yading@10 15399
yading@10 15400 Draw a colored box on the input image.
yading@10 15401
yading@10 15402 This filter accepts the following options:
yading@10 15403
yading@10 15404
yading@10 15405 =over 4
yading@10 15406
yading@10 15407
yading@10 15408 =item B<x, y>
yading@10 15409
yading@10 15410 Specify the top left corner coordinates of the box. Default to 0.
yading@10 15411
yading@10 15412
yading@10 15413 =item B<width, w>
yading@10 15414
yading@10 15415
yading@10 15416 =item B<height, h>
yading@10 15417
yading@10 15418 Specify the width and height of the box, if 0 they are interpreted as
yading@10 15419 the input width and height. Default to 0.
yading@10 15420
yading@10 15421
yading@10 15422 =item B<color, c>
yading@10 15423
yading@10 15424 Specify the color of the box to write, it can be the name of a color
yading@10 15425 (case insensitive match) or a 0xRRGGBB[AA] sequence. If the special
yading@10 15426 value C<invert> is used, the box edge color is the same as the
yading@10 15427 video with inverted luma.
yading@10 15428
yading@10 15429
yading@10 15430 =item B<thickness, t>
yading@10 15431
yading@10 15432 Set the thickness of the box edge. Default value is C<4>.
yading@10 15433
yading@10 15434 =back
yading@10 15435
yading@10 15436
yading@10 15437
yading@10 15438 =head3 Examples
yading@10 15439
yading@10 15440
yading@10 15441
yading@10 15442 =over 4
yading@10 15443
yading@10 15444
yading@10 15445 =item *
yading@10 15446
yading@10 15447 Draw a black box around the edge of the input image:
yading@10 15448
yading@10 15449 drawbox
yading@10 15450
yading@10 15451
yading@10 15452
yading@10 15453 =item *
yading@10 15454
yading@10 15455 Draw a box with color red and an opacity of 50%:
yading@10 15456
yading@10 15457 drawbox=10:20:200:60:red@0.5
yading@10 15458
yading@10 15459
yading@10 15460 The previous example can be specified as:
yading@10 15461
yading@10 15462 drawbox=x=10:y=20:w=200:h=60:color=red@0.5
yading@10 15463
yading@10 15464
yading@10 15465
yading@10 15466 =item *
yading@10 15467
yading@10 15468 Fill the box with pink color:
yading@10 15469
yading@10 15470 drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=max
yading@10 15471
yading@10 15472
yading@10 15473 =back
yading@10 15474
yading@10 15475
yading@10 15476
yading@10 15477
yading@10 15478 =head2 drawtext
yading@10 15479
yading@10 15480
yading@10 15481 Draw text string or text from specified file on top of video using the
yading@10 15482 libfreetype library.
yading@10 15483
yading@10 15484 To enable compilation of this filter you need to configure FFmpeg with
yading@10 15485 C<--enable-libfreetype>.
yading@10 15486
yading@10 15487
yading@10 15488 =head3 Syntax
yading@10 15489
yading@10 15490
yading@10 15491 The description of the accepted parameters follows.
yading@10 15492
yading@10 15493
yading@10 15494 =over 4
yading@10 15495
yading@10 15496
yading@10 15497
yading@10 15498 =item B<box>
yading@10 15499
yading@10 15500 Used to draw a box around text using background color.
yading@10 15501 Value should be either 1 (enable) or 0 (disable).
yading@10 15502 The default value of I<box> is 0.
yading@10 15503
yading@10 15504
yading@10 15505 =item B<boxcolor>
yading@10 15506
yading@10 15507 The color to be used for drawing box around text.
yading@10 15508 Either a string (e.g. "yellow") or in 0xRRGGBB[AA] format
yading@10 15509 (e.g. "0xff00ff"), possibly followed by an alpha specifier.
yading@10 15510 The default value of I<boxcolor> is "white".
yading@10 15511
yading@10 15512
yading@10 15513 =item B<draw>
yading@10 15514
yading@10 15515 Set an expression which specifies if the text should be drawn. If the
yading@10 15516 expression evaluates to 0, the text is not drawn. This is useful for
yading@10 15517 specifying that the text should be drawn only when specific conditions
yading@10 15518 are met.
yading@10 15519
yading@10 15520 Default value is "1".
yading@10 15521
yading@10 15522 See below for the list of accepted constants and functions.
yading@10 15523
yading@10 15524
yading@10 15525 =item B<expansion>
yading@10 15526
yading@10 15527 Select how the I<text> is expanded. Can be either C<none>,
yading@10 15528 C<strftime> (deprecated) or
yading@10 15529 C<normal> (default). See the drawtext_expansion, Text expansion section
yading@10 15530 below for details.
yading@10 15531
yading@10 15532
yading@10 15533 =item B<fix_bounds>
yading@10 15534
yading@10 15535 If true, check and fix text coords to avoid clipping.
yading@10 15536
yading@10 15537
yading@10 15538 =item B<fontcolor>
yading@10 15539
yading@10 15540 The color to be used for drawing fonts.
yading@10 15541 Either a string (e.g. "red") or in 0xRRGGBB[AA] format
yading@10 15542 (e.g. "0xff000033"), possibly followed by an alpha specifier.
yading@10 15543 The default value of I<fontcolor> is "black".
yading@10 15544
yading@10 15545
yading@10 15546 =item B<fontfile>
yading@10 15547
yading@10 15548 The font file to be used for drawing text. Path must be included.
yading@10 15549 This parameter is mandatory.
yading@10 15550
yading@10 15551
yading@10 15552 =item B<fontsize>
yading@10 15553
yading@10 15554 The font size to be used for drawing text.
yading@10 15555 The default value of I<fontsize> is 16.
yading@10 15556
yading@10 15557
yading@10 15558 =item B<ft_load_flags>
yading@10 15559
yading@10 15560 Flags to be used for loading the fonts.
yading@10 15561
yading@10 15562 The flags map the corresponding flags supported by libfreetype, and are
yading@10 15563 a combination of the following values:
yading@10 15564
yading@10 15565 =over 4
yading@10 15566
yading@10 15567
yading@10 15568 =item I<default>
yading@10 15569
yading@10 15570
yading@10 15571 =item I<no_scale>
yading@10 15572
yading@10 15573
yading@10 15574 =item I<no_hinting>
yading@10 15575
yading@10 15576
yading@10 15577 =item I<render>
yading@10 15578
yading@10 15579
yading@10 15580 =item I<no_bitmap>
yading@10 15581
yading@10 15582
yading@10 15583 =item I<vertical_layout>
yading@10 15584
yading@10 15585
yading@10 15586 =item I<force_autohint>
yading@10 15587
yading@10 15588
yading@10 15589 =item I<crop_bitmap>
yading@10 15590
yading@10 15591
yading@10 15592 =item I<pedantic>
yading@10 15593
yading@10 15594
yading@10 15595 =item I<ignore_global_advance_width>
yading@10 15596
yading@10 15597
yading@10 15598 =item I<no_recurse>
yading@10 15599
yading@10 15600
yading@10 15601 =item I<ignore_transform>
yading@10 15602
yading@10 15603
yading@10 15604 =item I<monochrome>
yading@10 15605
yading@10 15606
yading@10 15607 =item I<linear_design>
yading@10 15608
yading@10 15609
yading@10 15610 =item I<no_autohint>
yading@10 15611
yading@10 15612
yading@10 15613 =item I<end table>
yading@10 15614
yading@10 15615
yading@10 15616 =back
yading@10 15617
yading@10 15618
yading@10 15619 Default value is "render".
yading@10 15620
yading@10 15621 For more information consult the documentation for the FT_LOAD_*
yading@10 15622 libfreetype flags.
yading@10 15623
yading@10 15624
yading@10 15625 =item B<shadowcolor>
yading@10 15626
yading@10 15627 The color to be used for drawing a shadow behind the drawn text. It
yading@10 15628 can be a color name (e.g. "yellow") or a string in the 0xRRGGBB[AA]
yading@10 15629 form (e.g. "0xff00ff"), possibly followed by an alpha specifier.
yading@10 15630 The default value of I<shadowcolor> is "black".
yading@10 15631
yading@10 15632
yading@10 15633 =item B<shadowx, shadowy>
yading@10 15634
yading@10 15635 The x and y offsets for the text shadow position with respect to the
yading@10 15636 position of the text. They can be either positive or negative
yading@10 15637 values. Default value for both is "0".
yading@10 15638
yading@10 15639
yading@10 15640 =item B<tabsize>
yading@10 15641
yading@10 15642 The size in number of spaces to use for rendering the tab.
yading@10 15643 Default value is 4.
yading@10 15644
yading@10 15645
yading@10 15646 =item B<timecode>
yading@10 15647
yading@10 15648 Set the initial timecode representation in "hh:mm:ss[:;.]ff"
yading@10 15649 format. It can be used with or without text parameter. I<timecode_rate>
yading@10 15650 option must be specified.
yading@10 15651
yading@10 15652
yading@10 15653 =item B<timecode_rate, rate, r>
yading@10 15654
yading@10 15655 Set the timecode frame rate (timecode only).
yading@10 15656
yading@10 15657
yading@10 15658 =item B<text>
yading@10 15659
yading@10 15660 The text string to be drawn. The text must be a sequence of UTF-8
yading@10 15661 encoded characters.
yading@10 15662 This parameter is mandatory if no file is specified with the parameter
yading@10 15663 I<textfile>.
yading@10 15664
yading@10 15665
yading@10 15666 =item B<textfile>
yading@10 15667
yading@10 15668 A text file containing text to be drawn. The text must be a sequence
yading@10 15669 of UTF-8 encoded characters.
yading@10 15670
yading@10 15671 This parameter is mandatory if no text string is specified with the
yading@10 15672 parameter I<text>.
yading@10 15673
yading@10 15674 If both I<text> and I<textfile> are specified, an error is thrown.
yading@10 15675
yading@10 15676
yading@10 15677 =item B<reload>
yading@10 15678
yading@10 15679 If set to 1, the I<textfile> will be reloaded before each frame.
yading@10 15680 Be sure to update it atomically, or it may be read partially, or even fail.
yading@10 15681
yading@10 15682
yading@10 15683 =item B<x, y>
yading@10 15684
yading@10 15685 The expressions which specify the offsets where text will be drawn
yading@10 15686 within the video frame. They are relative to the top/left border of the
yading@10 15687 output image.
yading@10 15688
yading@10 15689 The default value of I<x> and I<y> is "0".
yading@10 15690
yading@10 15691 See below for the list of accepted constants and functions.
yading@10 15692
yading@10 15693 =back
yading@10 15694
yading@10 15695
yading@10 15696 The parameters for I<x> and I<y> are expressions containing the
yading@10 15697 following constants and functions:
yading@10 15698
yading@10 15699
yading@10 15700 =over 4
yading@10 15701
yading@10 15702
yading@10 15703 =item B<dar>
yading@10 15704
yading@10 15705 input display aspect ratio, it is the same as (I<w> / I<h>) * I<sar>
yading@10 15706
yading@10 15707
yading@10 15708 =item B<hsub, vsub>
yading@10 15709
yading@10 15710 horizontal and vertical chroma subsample values. For example for the
yading@10 15711 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 15712
yading@10 15713
yading@10 15714 =item B<line_h, lh>
yading@10 15715
yading@10 15716 the height of each text line
yading@10 15717
yading@10 15718
yading@10 15719 =item B<main_h, h, H>
yading@10 15720
yading@10 15721 the input height
yading@10 15722
yading@10 15723
yading@10 15724 =item B<main_w, w, W>
yading@10 15725
yading@10 15726 the input width
yading@10 15727
yading@10 15728
yading@10 15729 =item B<max_glyph_a, ascent>
yading@10 15730
yading@10 15731 the maximum distance from the baseline to the highest/upper grid
yading@10 15732 coordinate used to place a glyph outline point, for all the rendered
yading@10 15733 glyphs.
yading@10 15734 It is a positive value, due to the grid's orientation with the Y axis
yading@10 15735 upwards.
yading@10 15736
yading@10 15737
yading@10 15738 =item B<max_glyph_d, descent>
yading@10 15739
yading@10 15740 the maximum distance from the baseline to the lowest grid coordinate
yading@10 15741 used to place a glyph outline point, for all the rendered glyphs.
yading@10 15742 This is a negative value, due to the grid's orientation, with the Y axis
yading@10 15743 upwards.
yading@10 15744
yading@10 15745
yading@10 15746 =item B<max_glyph_h>
yading@10 15747
yading@10 15748 maximum glyph height, that is the maximum height for all the glyphs
yading@10 15749 contained in the rendered text, it is equivalent to I<ascent> -
yading@10 15750 I<descent>.
yading@10 15751
yading@10 15752
yading@10 15753 =item B<max_glyph_w>
yading@10 15754
yading@10 15755 maximum glyph width, that is the maximum width for all the glyphs
yading@10 15756 contained in the rendered text
yading@10 15757
yading@10 15758
yading@10 15759 =item B<n>
yading@10 15760
yading@10 15761 the number of input frame, starting from 0
yading@10 15762
yading@10 15763
yading@10 15764 =item B<rand(min, max)>
yading@10 15765
yading@10 15766 return a random number included between I<min> and I<max>
yading@10 15767
yading@10 15768
yading@10 15769 =item B<sar>
yading@10 15770
yading@10 15771 input sample aspect ratio
yading@10 15772
yading@10 15773
yading@10 15774 =item B<t>
yading@10 15775
yading@10 15776 timestamp expressed in seconds, NAN if the input timestamp is unknown
yading@10 15777
yading@10 15778
yading@10 15779 =item B<text_h, th>
yading@10 15780
yading@10 15781 the height of the rendered text
yading@10 15782
yading@10 15783
yading@10 15784 =item B<text_w, tw>
yading@10 15785
yading@10 15786 the width of the rendered text
yading@10 15787
yading@10 15788
yading@10 15789 =item B<x, y>
yading@10 15790
yading@10 15791 the x and y offset coordinates where the text is drawn.
yading@10 15792
yading@10 15793 These parameters allow the I<x> and I<y> expressions to refer
yading@10 15794 each other, so you can for example specify C<y=x/dar>.
yading@10 15795
yading@10 15796 =back
yading@10 15797
yading@10 15798
yading@10 15799 If libavfilter was built with C<--enable-fontconfig>, then
yading@10 15800 B<fontfile> can be a fontconfig pattern or omitted.
yading@10 15801
yading@10 15802
yading@10 15803
yading@10 15804 =head3 Text expansion
yading@10 15805
yading@10 15806
yading@10 15807 If B<expansion> is set to C<strftime>,
yading@10 15808 the filter recognizes strftime() sequences in the provided text and
yading@10 15809 expands them accordingly. Check the documentation of strftime(). This
yading@10 15810 feature is deprecated.
yading@10 15811
yading@10 15812 If B<expansion> is set to C<none>, the text is printed verbatim.
yading@10 15813
yading@10 15814 If B<expansion> is set to C<normal> (which is the default),
yading@10 15815 the following expansion mechanism is used.
yading@10 15816
yading@10 15817 The backslash character '\', followed by any character, always expands to
yading@10 15818 the second character.
yading@10 15819
yading@10 15820 Sequence of the form C<%{...}> are expanded. The text between the
yading@10 15821 braces is a function name, possibly followed by arguments separated by ':'.
yading@10 15822 If the arguments contain special characters or delimiters (':' or '}'),
yading@10 15823 they should be escaped.
yading@10 15824
yading@10 15825 Note that they probably must also be escaped as the value for the
yading@10 15826 B<text> option in the filter argument string and as the filter
yading@10 15827 argument in the filtergraph description, and possibly also for the shell,
yading@10 15828 that makes up to four levels of escaping; using a text file avoids these
yading@10 15829 problems.
yading@10 15830
yading@10 15831 The following functions are available:
yading@10 15832
yading@10 15833
yading@10 15834 =over 4
yading@10 15835
yading@10 15836
yading@10 15837
yading@10 15838 =item B<expr, e>
yading@10 15839
yading@10 15840 The expression evaluation result.
yading@10 15841
yading@10 15842 It must take one argument specifying the expression to be evaluated,
yading@10 15843 which accepts the same constants and functions as the I<x> and
yading@10 15844 I<y> values. Note that not all constants should be used, for
yading@10 15845 example the text size is not known when evaluating the expression, so
yading@10 15846 the constants I<text_w> and I<text_h> will have an undefined
yading@10 15847 value.
yading@10 15848
yading@10 15849
yading@10 15850 =item B<gmtime>
yading@10 15851
yading@10 15852 The time at which the filter is running, expressed in UTC.
yading@10 15853 It can accept an argument: a strftime() format string.
yading@10 15854
yading@10 15855
yading@10 15856 =item B<localtime>
yading@10 15857
yading@10 15858 The time at which the filter is running, expressed in the local time zone.
yading@10 15859 It can accept an argument: a strftime() format string.
yading@10 15860
yading@10 15861
yading@10 15862 =item B<n, frame_num>
yading@10 15863
yading@10 15864 The frame number, starting from 0.
yading@10 15865
yading@10 15866
yading@10 15867 =item B<pts>
yading@10 15868
yading@10 15869 The timestamp of the current frame, in seconds, with microsecond accuracy.
yading@10 15870
yading@10 15871
yading@10 15872 =back
yading@10 15873
yading@10 15874
yading@10 15875
yading@10 15876 =head3 Examples
yading@10 15877
yading@10 15878
yading@10 15879
yading@10 15880 =over 4
yading@10 15881
yading@10 15882
yading@10 15883 =item *
yading@10 15884
yading@10 15885 Draw "Test Text" with font FreeSerif, using the default values for the
yading@10 15886 optional parameters.
yading@10 15887
yading@10 15888
yading@10 15889 drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
yading@10 15890
yading@10 15891
yading@10 15892
yading@10 15893 =item *
yading@10 15894
yading@10 15895 Draw 'Test Text' with font FreeSerif of size 24 at position x=100
yading@10 15896 and y=50 (counting from the top-left corner of the screen), text is
yading@10 15897 yellow with a red box around it. Both the text and the box have an
yading@10 15898 opacity of 20%.
yading@10 15899
yading@10 15900
yading@10 15901 drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
yading@10 15902 x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2"
yading@10 15903
yading@10 15904
yading@10 15905 Note that the double quotes are not necessary if spaces are not used
yading@10 15906 within the parameter list.
yading@10 15907
yading@10 15908
yading@10 15909 =item *
yading@10 15910
yading@10 15911 Show the text at the center of the video frame:
yading@10 15912
yading@10 15913 drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h-line_h)/2"
yading@10 15914
yading@10 15915
yading@10 15916
yading@10 15917 =item *
yading@10 15918
yading@10 15919 Show a text line sliding from right to left in the last row of the video
yading@10 15920 frame. The file F<LONG_LINE> is assumed to contain a single line
yading@10 15921 with no newlines.
yading@10 15922
yading@10 15923 drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t"
yading@10 15924
yading@10 15925
yading@10 15926
yading@10 15927 =item *
yading@10 15928
yading@10 15929 Show the content of file F<CREDITS> off the bottom of the frame and scroll up.
yading@10 15930
yading@10 15931 drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t"
yading@10 15932
yading@10 15933
yading@10 15934
yading@10 15935 =item *
yading@10 15936
yading@10 15937 Draw a single green letter "g", at the center of the input video.
yading@10 15938 The glyph baseline is placed at half screen height.
yading@10 15939
yading@10 15940 drawtext="fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent"
yading@10 15941
yading@10 15942
yading@10 15943
yading@10 15944 =item *
yading@10 15945
yading@10 15946 Show text for 1 second every 3 seconds:
yading@10 15947
yading@10 15948 drawtext="fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:draw=lt(mod(t\,3)\,1):text='blink'"
yading@10 15949
yading@10 15950
yading@10 15951
yading@10 15952 =item *
yading@10 15953
yading@10 15954 Use fontconfig to set the font. Note that the colons need to be escaped.
yading@10 15955
yading@10 15956 drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
yading@10 15957
yading@10 15958
yading@10 15959
yading@10 15960 =item *
yading@10 15961
yading@10 15962 Print the date of a real-time encoding (see strftime(3)):
yading@10 15963
yading@10 15964 drawtext='fontfile=FreeSans.ttf:text=%{localtime:%a %b %d %Y}'
yading@10 15965
yading@10 15966
yading@10 15967
yading@10 15968 =back
yading@10 15969
yading@10 15970
yading@10 15971 For more information about libfreetype, check:
yading@10 15972 E<lt>B<http://www.freetype.org/>E<gt>.
yading@10 15973
yading@10 15974 For more information about fontconfig, check:
yading@10 15975 E<lt>B<http://freedesktop.org/software/fontconfig/fontconfig-user.html>E<gt>.
yading@10 15976
yading@10 15977
yading@10 15978 =head2 edgedetect
yading@10 15979
yading@10 15980
yading@10 15981 Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
yading@10 15982
yading@10 15983 The filter accepts the following options:
yading@10 15984
yading@10 15985
yading@10 15986 =over 4
yading@10 15987
yading@10 15988
yading@10 15989 =item B<low, high>
yading@10 15990
yading@10 15991 Set low and high threshold values used by the Canny thresholding
yading@10 15992 algorithm.
yading@10 15993
yading@10 15994 The high threshold selects the "strong" edge pixels, which are then
yading@10 15995 connected through 8-connectivity with the "weak" edge pixels selected
yading@10 15996 by the low threshold.
yading@10 15997
yading@10 15998 I<low> and I<high> threshold values must be choosen in the range
yading@10 15999 [0,1], and I<low> should be lesser or equal to I<high>.
yading@10 16000
yading@10 16001 Default value for I<low> is C<20/255>, and default value for I<high>
yading@10 16002 is C<50/255>.
yading@10 16003
yading@10 16004 =back
yading@10 16005
yading@10 16006
yading@10 16007 Example:
yading@10 16008
yading@10 16009 edgedetect=low=0.1:high=0.4
yading@10 16010
yading@10 16011
yading@10 16012
yading@10 16013 =head2 fade
yading@10 16014
yading@10 16015
yading@10 16016 Apply fade-in/out effect to input video.
yading@10 16017
yading@10 16018 This filter accepts the following options:
yading@10 16019
yading@10 16020
yading@10 16021 =over 4
yading@10 16022
yading@10 16023
yading@10 16024 =item B<type, t>
yading@10 16025
yading@10 16026 The effect type -- can be either "in" for fade-in, or "out" for a fade-out
yading@10 16027 effect.
yading@10 16028 Default is C<in>.
yading@10 16029
yading@10 16030
yading@10 16031 =item B<start_frame, s>
yading@10 16032
yading@10 16033 Specify the number of the start frame for starting to apply the fade
yading@10 16034 effect. Default is 0.
yading@10 16035
yading@10 16036
yading@10 16037 =item B<nb_frames, n>
yading@10 16038
yading@10 16039 The number of frames for which the fade effect has to last. At the end of the
yading@10 16040 fade-in effect the output video will have the same intensity as the input video,
yading@10 16041 at the end of the fade-out transition the output video will be completely black.
yading@10 16042 Default is 25.
yading@10 16043
yading@10 16044
yading@10 16045 =item B<alpha>
yading@10 16046
yading@10 16047 If set to 1, fade only alpha channel, if one exists on the input.
yading@10 16048 Default value is 0.
yading@10 16049
yading@10 16050 =back
yading@10 16051
yading@10 16052
yading@10 16053
yading@10 16054 =head3 Examples
yading@10 16055
yading@10 16056
yading@10 16057
yading@10 16058 =over 4
yading@10 16059
yading@10 16060
yading@10 16061 =item *
yading@10 16062
yading@10 16063 Fade in first 30 frames of video:
yading@10 16064
yading@10 16065 fade=in:0:30
yading@10 16066
yading@10 16067
yading@10 16068 The command above is equivalent to:
yading@10 16069
yading@10 16070 fade=t=in:s=0:n=30
yading@10 16071
yading@10 16072
yading@10 16073
yading@10 16074 =item *
yading@10 16075
yading@10 16076 Fade out last 45 frames of a 200-frame video:
yading@10 16077
yading@10 16078 fade=out:155:45
yading@10 16079 fade=type=out:start_frame=155:nb_frames=45
yading@10 16080
yading@10 16081
yading@10 16082
yading@10 16083 =item *
yading@10 16084
yading@10 16085 Fade in first 25 frames and fade out last 25 frames of a 1000-frame video:
yading@10 16086
yading@10 16087 fade=in:0:25, fade=out:975:25
yading@10 16088
yading@10 16089
yading@10 16090
yading@10 16091 =item *
yading@10 16092
yading@10 16093 Make first 5 frames black, then fade in from frame 5-24:
yading@10 16094
yading@10 16095 fade=in:5:20
yading@10 16096
yading@10 16097
yading@10 16098
yading@10 16099 =item *
yading@10 16100
yading@10 16101 Fade in alpha over first 25 frames of video:
yading@10 16102
yading@10 16103 fade=in:0:25:alpha=1
yading@10 16104
yading@10 16105
yading@10 16106 =back
yading@10 16107
yading@10 16108
yading@10 16109
yading@10 16110 =head2 field
yading@10 16111
yading@10 16112
yading@10 16113 Extract a single field from an interlaced image using stride
yading@10 16114 arithmetic to avoid wasting CPU time. The output frames are marked as
yading@10 16115 non-interlaced.
yading@10 16116
yading@10 16117 The filter accepts the following options:
yading@10 16118
yading@10 16119
yading@10 16120 =over 4
yading@10 16121
yading@10 16122
yading@10 16123 =item B<type>
yading@10 16124
yading@10 16125 Specify whether to extract the top (if the value is C<0> or
yading@10 16126 C<top>) or the bottom field (if the value is C<1> or
yading@10 16127 C<bottom>).
yading@10 16128
yading@10 16129 =back
yading@10 16130
yading@10 16131
yading@10 16132
yading@10 16133 =head2 fieldmatch
yading@10 16134
yading@10 16135
yading@10 16136 Field matching filter for inverse telecine. It is meant to reconstruct the
yading@10 16137 progressive frames from a telecined stream. The filter does not drop duplicated
yading@10 16138 frames, so to achieve a complete inverse telecine C<fieldmatch> needs to be
yading@10 16139 followed by a decimation filter such as decimate in the filtergraph.
yading@10 16140
yading@10 16141 The separation of the field matching and the decimation is notably motivated by
yading@10 16142 the possibility of inserting a de-interlacing filter fallback between the two.
yading@10 16143 If the source has mixed telecined and real interlaced content,
yading@10 16144 C<fieldmatch> will not be able to match fields for the interlaced parts.
yading@10 16145 But these remaining combed frames will be marked as interlaced, and thus can be
yading@10 16146 de-interlaced by a later filter such as yadif before decimation.
yading@10 16147
yading@10 16148 In addition to the various configuration options, C<fieldmatch> can take an
yading@10 16149 optional second stream, activated through the B<ppsrc> option. If
yading@10 16150 enabled, the frames reconstruction will be based on the fields and frames from
yading@10 16151 this second stream. This allows the first input to be pre-processed in order to
yading@10 16152 help the various algorithms of the filter, while keeping the output lossless
yading@10 16153 (assuming the fields are matched properly). Typically, a field-aware denoiser,
yading@10 16154 or brightness/contrast adjustments can help.
yading@10 16155
yading@10 16156 Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
yading@10 16157 and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
yading@10 16158 which C<fieldmatch> is based on. While the semantic and usage are very
yading@10 16159 close, some behaviour and options names can differ.
yading@10 16160
yading@10 16161 The filter accepts the following options:
yading@10 16162
yading@10 16163
yading@10 16164 =over 4
yading@10 16165
yading@10 16166
yading@10 16167 =item B<order>
yading@10 16168
yading@10 16169 Specify the assumed field order of the input stream. Available values are:
yading@10 16170
yading@10 16171
yading@10 16172 =over 4
yading@10 16173
yading@10 16174
yading@10 16175 =item B<auto>
yading@10 16176
yading@10 16177 Auto detect parity (use FFmpeg's internal parity value).
yading@10 16178
yading@10 16179 =item B<bff>
yading@10 16180
yading@10 16181 Assume bottom field first.
yading@10 16182
yading@10 16183 =item B<tff>
yading@10 16184
yading@10 16185 Assume top field first.
yading@10 16186
yading@10 16187 =back
yading@10 16188
yading@10 16189
yading@10 16190 Note that it is sometimes recommended not to trust the parity announced by the
yading@10 16191 stream.
yading@10 16192
yading@10 16193 Default value is I<auto>.
yading@10 16194
yading@10 16195
yading@10 16196 =item B<mode>
yading@10 16197
yading@10 16198 Set the matching mode or strategy to use. B<pc> mode is the safest in the
yading@10 16199 sense that it wont risk creating jerkiness due to duplicate frames when
yading@10 16200 possible, but if there are bad edits or blended fields it will end up
yading@10 16201 outputting combed frames when a good match might actually exist. On the other
yading@10 16202 hand, B<pcn_ub> mode is the most risky in terms of creating jerkiness,
yading@10 16203 but will almost always find a good frame if there is one. The other values are
yading@10 16204 all somewhere in between B<pc> and B<pcn_ub> in terms of risking
yading@10 16205 jerkiness and creating duplicate frames versus finding good matches in sections
yading@10 16206 with bad edits, orphaned fields, blended fields, etc.
yading@10 16207
yading@10 16208 More details about p/c/n/u/b are available in p/c/n/u/b meaning section.
yading@10 16209
yading@10 16210 Available values are:
yading@10 16211
yading@10 16212
yading@10 16213 =over 4
yading@10 16214
yading@10 16215
yading@10 16216 =item B<pc>
yading@10 16217
yading@10 16218 2-way matching (p/c)
yading@10 16219
yading@10 16220 =item B<pc_n>
yading@10 16221
yading@10 16222 2-way matching, and trying 3rd match if still combed (p/c + n)
yading@10 16223
yading@10 16224 =item B<pc_u>
yading@10 16225
yading@10 16226 2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
yading@10 16227
yading@10 16228 =item B<pc_n_ub>
yading@10 16229
yading@10 16230 2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
yading@10 16231 still combed (p/c + n + u/b)
yading@10 16232
yading@10 16233 =item B<pcn>
yading@10 16234
yading@10 16235 3-way matching (p/c/n)
yading@10 16236
yading@10 16237 =item B<pcn_ub>
yading@10 16238
yading@10 16239 3-way matching, and trying 4th/5th matches if all 3 of the original matches are
yading@10 16240 detected as combed (p/c/n + u/b)
yading@10 16241
yading@10 16242 =back
yading@10 16243
yading@10 16244
yading@10 16245 The parenthesis at the end indicate the matches that would be used for that
yading@10 16246 mode assuming B<order>=I<tff> (and B<field> on I<auto> or
yading@10 16247 I<top>).
yading@10 16248
yading@10 16249 In terms of speed B<pc> mode is by far the fastest and B<pcn_ub> is
yading@10 16250 the slowest.
yading@10 16251
yading@10 16252 Default value is I<pc_n>.
yading@10 16253
yading@10 16254
yading@10 16255 =item B<ppsrc>
yading@10 16256
yading@10 16257 Mark the main input stream as a pre-processed input, and enable the secondary
yading@10 16258 input stream as the clean source to pick the fields from. See the filter
yading@10 16259 introduction for more details. It is similar to the B<clip2> feature from
yading@10 16260 VFM/TFM.
yading@10 16261
yading@10 16262 Default value is C<0> (disabled).
yading@10 16263
yading@10 16264
yading@10 16265 =item B<field>
yading@10 16266
yading@10 16267 Set the field to match from. It is recommended to set this to the same value as
yading@10 16268 B<order> unless you experience matching failures with that setting. In
yading@10 16269 certain circumstances changing the field that is used to match from can have a
yading@10 16270 large impact on matching performance. Available values are:
yading@10 16271
yading@10 16272
yading@10 16273 =over 4
yading@10 16274
yading@10 16275
yading@10 16276 =item B<auto>
yading@10 16277
yading@10 16278 Automatic (same value as B<order>).
yading@10 16279
yading@10 16280 =item B<bottom>
yading@10 16281
yading@10 16282 Match from the bottom field.
yading@10 16283
yading@10 16284 =item B<top>
yading@10 16285
yading@10 16286 Match from the top field.
yading@10 16287
yading@10 16288 =back
yading@10 16289
yading@10 16290
yading@10 16291 Default value is I<auto>.
yading@10 16292
yading@10 16293
yading@10 16294 =item B<mchroma>
yading@10 16295
yading@10 16296 Set whether or not chroma is included during the match comparisons. In most
yading@10 16297 cases it is recommended to leave this enabled. You should set this to C<0>
yading@10 16298 only if your clip has bad chroma problems such as heavy rainbowing or other
yading@10 16299 artifacts. Setting this to C<0> could also be used to speed things up at
yading@10 16300 the cost of some accuracy.
yading@10 16301
yading@10 16302 Default value is C<1>.
yading@10 16303
yading@10 16304
yading@10 16305 =item B<y0>
yading@10 16306
yading@10 16307
yading@10 16308 =item B<y1>
yading@10 16309
yading@10 16310 These define an exclusion band which excludes the lines between B<y0> and
yading@10 16311 B<y1> from being included in the field matching decision. An exclusion
yading@10 16312 band can be used to ignore subtitles, a logo, or other things that may
yading@10 16313 interfere with the matching. B<y0> sets the starting scan line and
yading@10 16314 B<y1> sets the ending line; all lines in between B<y0> and
yading@10 16315 B<y1> (including B<y0> and B<y1>) will be ignored. Setting
yading@10 16316 B<y0> and B<y1> to the same value will disable the feature.
yading@10 16317 B<y0> and B<y1> defaults to C<0>.
yading@10 16318
yading@10 16319
yading@10 16320 =item B<scthresh>
yading@10 16321
yading@10 16322 Set the scene change detection threshold as a percentage of maximum change on
yading@10 16323 the luma plane. Good values are in the C<[8.0, 14.0]> range. Scene change
yading@10 16324 detection is only relevant in case B<combmatch>=I<sc>. The range for
yading@10 16325 B<scthresh> is C<[0.0, 100.0]>.
yading@10 16326
yading@10 16327 Default value is C<12.0>.
yading@10 16328
yading@10 16329
yading@10 16330 =item B<combmatch>
yading@10 16331
yading@10 16332 When B<combatch> is not I<none>, C<fieldmatch> will take into
yading@10 16333 account the combed scores of matches when deciding what match to use as the
yading@10 16334 final match. Available values are:
yading@10 16335
yading@10 16336
yading@10 16337 =over 4
yading@10 16338
yading@10 16339
yading@10 16340 =item B<none>
yading@10 16341
yading@10 16342 No final matching based on combed scores.
yading@10 16343
yading@10 16344 =item B<sc>
yading@10 16345
yading@10 16346 Combed scores are only used when a scene change is detected.
yading@10 16347
yading@10 16348 =item B<full>
yading@10 16349
yading@10 16350 Use combed scores all the time.
yading@10 16351
yading@10 16352 =back
yading@10 16353
yading@10 16354
yading@10 16355 Default is I<sc>.
yading@10 16356
yading@10 16357
yading@10 16358 =item B<combdbg>
yading@10 16359
yading@10 16360 Force C<fieldmatch> to calculate the combed metrics for certain matches and
yading@10 16361 print them. This setting is known as B<micout> in TFM/VFM vocabulary.
yading@10 16362 Available values are:
yading@10 16363
yading@10 16364
yading@10 16365 =over 4
yading@10 16366
yading@10 16367
yading@10 16368 =item B<none>
yading@10 16369
yading@10 16370 No forced calculation.
yading@10 16371
yading@10 16372 =item B<pcn>
yading@10 16373
yading@10 16374 Force p/c/n calculations.
yading@10 16375
yading@10 16376 =item B<pcnub>
yading@10 16377
yading@10 16378 Force p/c/n/u/b calculations.
yading@10 16379
yading@10 16380 =back
yading@10 16381
yading@10 16382
yading@10 16383 Default value is I<none>.
yading@10 16384
yading@10 16385
yading@10 16386 =item B<cthresh>
yading@10 16387
yading@10 16388 This is the area combing threshold used for combed frame detection. This
yading@10 16389 essentially controls how "strong" or "visible" combing must be to be detected.
yading@10 16390 Larger values mean combing must be more visible and smaller values mean combing
yading@10 16391 can be less visible or strong and still be detected. Valid settings are from
yading@10 16392 C<-1> (every pixel will be detected as combed) to C<255> (no pixel will
yading@10 16393 be detected as combed). This is basically a pixel difference value. A good
yading@10 16394 range is C<[8, 12]>.
yading@10 16395
yading@10 16396 Default value is C<9>.
yading@10 16397
yading@10 16398
yading@10 16399 =item B<chroma>
yading@10 16400
yading@10 16401 Sets whether or not chroma is considered in the combed frame decision. Only
yading@10 16402 disable this if your source has chroma problems (rainbowing, etc.) that are
yading@10 16403 causing problems for the combed frame detection with chroma enabled. Actually,
yading@10 16404 using B<chroma>=I<0> is usually more reliable, except for the case
yading@10 16405 where there is chroma only combing in the source.
yading@10 16406
yading@10 16407 Default value is C<0>.
yading@10 16408
yading@10 16409
yading@10 16410 =item B<blockx>
yading@10 16411
yading@10 16412
yading@10 16413 =item B<blocky>
yading@10 16414
yading@10 16415 Respectively set the x-axis and y-axis size of the window used during combed
yading@10 16416 frame detection. This has to do with the size of the area in which
yading@10 16417 B<combpel> pixels are required to be detected as combed for a frame to be
yading@10 16418 declared combed. See the B<combpel> parameter description for more info.
yading@10 16419 Possible values are any number that is a power of 2 starting at 4 and going up
yading@10 16420 to 512.
yading@10 16421
yading@10 16422 Default value is C<16>.
yading@10 16423
yading@10 16424
yading@10 16425 =item B<combpel>
yading@10 16426
yading@10 16427 The number of combed pixels inside any of the B<blocky> by
yading@10 16428 B<blockx> size blocks on the frame for the frame to be detected as
yading@10 16429 combed. While B<cthresh> controls how "visible" the combing must be, this
yading@10 16430 setting controls "how much" combing there must be in any localized area (a
yading@10 16431 window defined by the B<blockx> and B<blocky> settings) on the
yading@10 16432 frame. Minimum value is C<0> and maximum is C<blocky x blockx> (at
yading@10 16433 which point no frames will ever be detected as combed). This setting is known
yading@10 16434 as B<MI> in TFM/VFM vocabulary.
yading@10 16435
yading@10 16436 Default value is C<80>.
yading@10 16437
yading@10 16438 =back
yading@10 16439
yading@10 16440
yading@10 16441
yading@10 16442
yading@10 16443 =head3 p/c/n/u/b meaning
yading@10 16444
yading@10 16445
yading@10 16446
yading@10 16447 =head4 p/c/n
yading@10 16448
yading@10 16449
yading@10 16450 We assume the following telecined stream:
yading@10 16451
yading@10 16452
yading@10 16453 Top fields: 1 2 2 3 4
yading@10 16454 Bottom fields: 1 2 3 4 4
yading@10 16455
yading@10 16456
yading@10 16457 The numbers correspond to the progressive frame the fields relate to. Here, the
yading@10 16458 first two frames are progressive, the 3rd and 4th are combed, and so on.
yading@10 16459
yading@10 16460 When C<fieldmatch> is configured to run a matching from bottom
yading@10 16461 (B<field>=I<bottom>) this is how this input stream get transformed:
yading@10 16462
yading@10 16463
yading@10 16464 Input stream:
yading@10 16465 T 1 2 2 3 4
yading@10 16466 B 1 2 3 4 4 <-- matching reference
yading@10 16467
yading@10 16468 Matches: c c n n c
yading@10 16469
yading@10 16470 Output stream:
yading@10 16471 T 1 2 3 4 4
yading@10 16472 B 1 2 3 4 4
yading@10 16473
yading@10 16474
yading@10 16475 As a result of the field matching, we can see that some frames get duplicated.
yading@10 16476 To perform a complete inverse telecine, you need to rely on a decimation filter
yading@10 16477 after this operation. See for instance the decimate filter.
yading@10 16478
yading@10 16479 The same operation now matching from top fields (B<field>=I<top>)
yading@10 16480 looks like this:
yading@10 16481
yading@10 16482
yading@10 16483 Input stream:
yading@10 16484 T 1 2 2 3 4 <-- matching reference
yading@10 16485 B 1 2 3 4 4
yading@10 16486
yading@10 16487 Matches: c c p p c
yading@10 16488
yading@10 16489 Output stream:
yading@10 16490 T 1 2 2 3 4
yading@10 16491 B 1 2 2 3 4
yading@10 16492
yading@10 16493
yading@10 16494 In these examples, we can see what I<p>, I<c> and I<n> mean;
yading@10 16495 basically, they refer to the frame and field of the opposite parity:
yading@10 16496
yading@10 16497
yading@10 16498 =over 4
yading@10 16499
yading@10 16500
yading@10 16501 =item *<I<p> matches the field of the opposite parity in the previous frame>
yading@10 16502
yading@10 16503
yading@10 16504 =item *<I<c> matches the field of the opposite parity in the current frame>
yading@10 16505
yading@10 16506
yading@10 16507 =item *<I<n> matches the field of the opposite parity in the next frame>
yading@10 16508
yading@10 16509
yading@10 16510 =back
yading@10 16511
yading@10 16512
yading@10 16513
yading@10 16514 =head4 u/b
yading@10 16515
yading@10 16516
yading@10 16517 The I<u> and I<b> matching are a bit special in the sense that they match
yading@10 16518 from the opposite parity flag. In the following examples, we assume that we are
yading@10 16519 currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
yading@10 16520 'x' is placed above and below each matched fields.
yading@10 16521
yading@10 16522 With bottom matching (B<field>=I<bottom>):
yading@10 16523
yading@10 16524 Match: c p n b u
yading@10 16525
yading@10 16526 x x x x x
yading@10 16527 Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
yading@10 16528 Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
yading@10 16529 x x x x x
yading@10 16530
yading@10 16531 Output frames:
yading@10 16532 2 1 2 2 2
yading@10 16533 2 2 2 1 3
yading@10 16534
yading@10 16535
yading@10 16536 With top matching (B<field>=I<top>):
yading@10 16537
yading@10 16538 Match: c p n b u
yading@10 16539
yading@10 16540 x x x x x
yading@10 16541 Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
yading@10 16542 Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
yading@10 16543 x x x x x
yading@10 16544
yading@10 16545 Output frames:
yading@10 16546 2 2 2 1 2
yading@10 16547 2 1 3 2 2
yading@10 16548
yading@10 16549
yading@10 16550
yading@10 16551 =head3 Examples
yading@10 16552
yading@10 16553
yading@10 16554 Simple IVTC of a top field first telecined stream:
yading@10 16555
yading@10 16556 fieldmatch=order=tff:combmatch=none, decimate
yading@10 16557
yading@10 16558
yading@10 16559 Advanced IVTC, with fallback on yadif for still combed frames:
yading@10 16560
yading@10 16561 fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
yading@10 16562
yading@10 16563
yading@10 16564
yading@10 16565 =head2 fieldorder
yading@10 16566
yading@10 16567
yading@10 16568 Transform the field order of the input video.
yading@10 16569
yading@10 16570 This filter accepts the following options:
yading@10 16571
yading@10 16572
yading@10 16573 =over 4
yading@10 16574
yading@10 16575
yading@10 16576
yading@10 16577 =item B<order>
yading@10 16578
yading@10 16579 Output field order. Valid values are I<tff> for top field first or I<bff>
yading@10 16580 for bottom field first.
yading@10 16581
yading@10 16582 =back
yading@10 16583
yading@10 16584
yading@10 16585 Default value is B<tff>.
yading@10 16586
yading@10 16587 Transformation is achieved by shifting the picture content up or down
yading@10 16588 by one line, and filling the remaining line with appropriate picture content.
yading@10 16589 This method is consistent with most broadcast field order converters.
yading@10 16590
yading@10 16591 If the input video is not flagged as being interlaced, or it is already
yading@10 16592 flagged as being of the required output field order then this filter does
yading@10 16593 not alter the incoming video.
yading@10 16594
yading@10 16595 This filter is very useful when converting to or from PAL DV material,
yading@10 16596 which is bottom field first.
yading@10 16597
yading@10 16598 For example:
yading@10 16599
yading@10 16600 ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
yading@10 16601
yading@10 16602
yading@10 16603
yading@10 16604 =head2 fifo
yading@10 16605
yading@10 16606
yading@10 16607 Buffer input images and send them when they are requested.
yading@10 16608
yading@10 16609 This filter is mainly useful when auto-inserted by the libavfilter
yading@10 16610 framework.
yading@10 16611
yading@10 16612 The filter does not take parameters.
yading@10 16613
yading@10 16614
yading@10 16615
yading@10 16616 =head2 format
yading@10 16617
yading@10 16618
yading@10 16619 Convert the input video to one of the specified pixel formats.
yading@10 16620 Libavfilter will try to pick one that is supported for the input to
yading@10 16621 the next filter.
yading@10 16622
yading@10 16623 This filter accepts the following parameters:
yading@10 16624
yading@10 16625 =over 4
yading@10 16626
yading@10 16627
yading@10 16628
yading@10 16629 =item B<pix_fmts>
yading@10 16630
yading@10 16631 A '|'-separated list of pixel format names, for example
yading@10 16632 "pix_fmts=yuv420p|monow|rgb24".
yading@10 16633
yading@10 16634
yading@10 16635 =back
yading@10 16636
yading@10 16637
yading@10 16638
yading@10 16639 =head3 Examples
yading@10 16640
yading@10 16641
yading@10 16642
yading@10 16643 =over 4
yading@10 16644
yading@10 16645
yading@10 16646 =item *
yading@10 16647
yading@10 16648 Convert the input video to the format I<yuv420p>
yading@10 16649
yading@10 16650 format=pix_fmts=yuv420p
yading@10 16651
yading@10 16652
yading@10 16653 Convert the input video to any of the formats in the list
yading@10 16654
yading@10 16655 format=pix_fmts=yuv420p|yuv444p|yuv410p
yading@10 16656
yading@10 16657
yading@10 16658 =back
yading@10 16659
yading@10 16660
yading@10 16661
yading@10 16662 =head2 fps
yading@10 16663
yading@10 16664
yading@10 16665 Convert the video to specified constant frame rate by duplicating or dropping
yading@10 16666 frames as necessary.
yading@10 16667
yading@10 16668 This filter accepts the following named parameters:
yading@10 16669
yading@10 16670 =over 4
yading@10 16671
yading@10 16672
yading@10 16673
yading@10 16674 =item B<fps>
yading@10 16675
yading@10 16676 Desired output frame rate. The default is C<25>.
yading@10 16677
yading@10 16678
yading@10 16679 =item B<round>
yading@10 16680
yading@10 16681 Rounding method.
yading@10 16682
yading@10 16683 Possible values are:
yading@10 16684
yading@10 16685 =over 4
yading@10 16686
yading@10 16687
yading@10 16688 =item B<zero>
yading@10 16689
yading@10 16690 zero round towards 0
yading@10 16691
yading@10 16692 =item B<inf>
yading@10 16693
yading@10 16694 round away from 0
yading@10 16695
yading@10 16696 =item B<down>
yading@10 16697
yading@10 16698 round towards -infinity
yading@10 16699
yading@10 16700 =item B<up>
yading@10 16701
yading@10 16702 round towards +infinity
yading@10 16703
yading@10 16704 =item B<near>
yading@10 16705
yading@10 16706 round to nearest
yading@10 16707
yading@10 16708 =back
yading@10 16709
yading@10 16710 The default is C<near>.
yading@10 16711
yading@10 16712
yading@10 16713 =back
yading@10 16714
yading@10 16715
yading@10 16716 Alternatively, the options can be specified as a flat string:
yading@10 16717 I<fps>[:I<round>].
yading@10 16718
yading@10 16719 See also the setpts filter.
yading@10 16720
yading@10 16721
yading@10 16722 =head2 framestep
yading@10 16723
yading@10 16724
yading@10 16725 Select one frame every N-th frame.
yading@10 16726
yading@10 16727 This filter accepts the following option:
yading@10 16728
yading@10 16729 =over 4
yading@10 16730
yading@10 16731
yading@10 16732 =item B<step>
yading@10 16733
yading@10 16734 Select frame after every C<step> frames.
yading@10 16735 Allowed values are positive integers higher than 0. Default value is C<1>.
yading@10 16736
yading@10 16737 =back
yading@10 16738
yading@10 16739
yading@10 16740
yading@10 16741
yading@10 16742 =head2 frei0r
yading@10 16743
yading@10 16744
yading@10 16745 Apply a frei0r effect to the input video.
yading@10 16746
yading@10 16747 To enable compilation of this filter you need to install the frei0r
yading@10 16748 header and configure FFmpeg with C<--enable-frei0r>.
yading@10 16749
yading@10 16750 This filter accepts the following options:
yading@10 16751
yading@10 16752
yading@10 16753 =over 4
yading@10 16754
yading@10 16755
yading@10 16756
yading@10 16757 =item B<filter_name>
yading@10 16758
yading@10 16759 The name to the frei0r effect to load. If the environment variable
yading@10 16760 B<FREI0R_PATH> is defined, the frei0r effect is searched in each one of the
yading@10 16761 directories specified by the colon separated list in B<FREIOR_PATH>,
yading@10 16762 otherwise in the standard frei0r paths, which are in this order:
yading@10 16763 F<HOME/.frei0r-1/lib/>, F</usr/local/lib/frei0r-1/>,
yading@10 16764 F</usr/lib/frei0r-1/>.
yading@10 16765
yading@10 16766
yading@10 16767 =item B<filter_params>
yading@10 16768
yading@10 16769 A '|'-separated list of parameters to pass to the frei0r effect.
yading@10 16770
yading@10 16771
yading@10 16772 =back
yading@10 16773
yading@10 16774
yading@10 16775 A frei0r effect parameter can be a boolean (whose values are specified
yading@10 16776 with "y" and "n"), a double, a color (specified by the syntax
yading@10 16777 I<R>/I<G>/I<B>, I<R>, I<G>, and I<B> being float
yading@10 16778 numbers from 0.0 to 1.0) or by an C<av_parse_color()> color
yading@10 16779 description), a position (specified by the syntax I<X>/I<Y>,
yading@10 16780 I<X> and I<Y> being float numbers) and a string.
yading@10 16781
yading@10 16782 The number and kind of parameters depend on the loaded effect. If an
yading@10 16783 effect parameter is not specified the default value is set.
yading@10 16784
yading@10 16785
yading@10 16786 =head3 Examples
yading@10 16787
yading@10 16788
yading@10 16789
yading@10 16790 =over 4
yading@10 16791
yading@10 16792
yading@10 16793 =item *
yading@10 16794
yading@10 16795 Apply the distort0r effect, set the first two double parameters:
yading@10 16796
yading@10 16797 frei0r=filter_name=distort0r:filter_params=0.5|0.01
yading@10 16798
yading@10 16799
yading@10 16800
yading@10 16801 =item *
yading@10 16802
yading@10 16803 Apply the colordistance effect, take a color as first parameter:
yading@10 16804
yading@10 16805 frei0r=colordistance:0.2/0.3/0.4
yading@10 16806 frei0r=colordistance:violet
yading@10 16807 frei0r=colordistance:0x112233
yading@10 16808
yading@10 16809
yading@10 16810
yading@10 16811 =item *
yading@10 16812
yading@10 16813 Apply the perspective effect, specify the top left and top right image
yading@10 16814 positions:
yading@10 16815
yading@10 16816 frei0r=perspective:0.2/0.2|0.8/0.2
yading@10 16817
yading@10 16818
yading@10 16819 =back
yading@10 16820
yading@10 16821
yading@10 16822 For more information see:
yading@10 16823 E<lt>B<http://frei0r.dyne.org>E<gt>
yading@10 16824
yading@10 16825
yading@10 16826 =head2 geq
yading@10 16827
yading@10 16828
yading@10 16829 The filter accepts the following options:
yading@10 16830
yading@10 16831
yading@10 16832 =over 4
yading@10 16833
yading@10 16834
yading@10 16835 =item B<lum_expr>
yading@10 16836
yading@10 16837 the luminance expression
yading@10 16838
yading@10 16839 =item B<cb_expr>
yading@10 16840
yading@10 16841 the chrominance blue expression
yading@10 16842
yading@10 16843 =item B<cr_expr>
yading@10 16844
yading@10 16845 the chrominance red expression
yading@10 16846
yading@10 16847 =item B<alpha_expr>
yading@10 16848
yading@10 16849 the alpha expression
yading@10 16850
yading@10 16851 =back
yading@10 16852
yading@10 16853
yading@10 16854 If one of the chrominance expression is not defined, it falls back on the other
yading@10 16855 one. If no alpha expression is specified it will evaluate to opaque value.
yading@10 16856 If none of chrominance expressions are
yading@10 16857 specified, they will evaluate the luminance expression.
yading@10 16858
yading@10 16859 The expressions can use the following variables and functions:
yading@10 16860
yading@10 16861
yading@10 16862 =over 4
yading@10 16863
yading@10 16864
yading@10 16865 =item B<N>
yading@10 16866
yading@10 16867 The sequential number of the filtered frame, starting from C<0>.
yading@10 16868
yading@10 16869
yading@10 16870 =item B<X>
yading@10 16871
yading@10 16872
yading@10 16873 =item B<Y>
yading@10 16874
yading@10 16875 The coordinates of the current sample.
yading@10 16876
yading@10 16877
yading@10 16878 =item B<W>
yading@10 16879
yading@10 16880
yading@10 16881 =item B<H>
yading@10 16882
yading@10 16883 The width and height of the image.
yading@10 16884
yading@10 16885
yading@10 16886 =item B<SW>
yading@10 16887
yading@10 16888
yading@10 16889 =item B<SH>
yading@10 16890
yading@10 16891 Width and height scale depending on the currently filtered plane. It is the
yading@10 16892 ratio between the corresponding luma plane number of pixels and the current
yading@10 16893 plane ones. E.g. for YUV4:2:0 the values are C<1,1> for the luma plane, and
yading@10 16894 C<0.5,0.5> for chroma planes.
yading@10 16895
yading@10 16896
yading@10 16897 =item B<T>
yading@10 16898
yading@10 16899 Time of the current frame, expressed in seconds.
yading@10 16900
yading@10 16901
yading@10 16902 =item B<p(x, y)>
yading@10 16903
yading@10 16904 Return the value of the pixel at location (I<x>,I<y>) of the current
yading@10 16905 plane.
yading@10 16906
yading@10 16907
yading@10 16908 =item B<lum(x, y)>
yading@10 16909
yading@10 16910 Return the value of the pixel at location (I<x>,I<y>) of the luminance
yading@10 16911 plane.
yading@10 16912
yading@10 16913
yading@10 16914 =item B<cb(x, y)>
yading@10 16915
yading@10 16916 Return the value of the pixel at location (I<x>,I<y>) of the
yading@10 16917 blue-difference chroma plane. Returns 0 if there is no such plane.
yading@10 16918
yading@10 16919
yading@10 16920 =item B<cr(x, y)>
yading@10 16921
yading@10 16922 Return the value of the pixel at location (I<x>,I<y>) of the
yading@10 16923 red-difference chroma plane. Returns 0 if there is no such plane.
yading@10 16924
yading@10 16925
yading@10 16926 =item B<alpha(x, y)>
yading@10 16927
yading@10 16928 Return the value of the pixel at location (I<x>,I<y>) of the alpha
yading@10 16929 plane. Returns 0 if there is no such plane.
yading@10 16930
yading@10 16931 =back
yading@10 16932
yading@10 16933
yading@10 16934 For functions, if I<x> and I<y> are outside the area, the value will be
yading@10 16935 automatically clipped to the closer edge.
yading@10 16936
yading@10 16937
yading@10 16938 =head3 Examples
yading@10 16939
yading@10 16940
yading@10 16941
yading@10 16942 =over 4
yading@10 16943
yading@10 16944
yading@10 16945 =item *
yading@10 16946
yading@10 16947 Flip the image horizontally:
yading@10 16948
yading@10 16949 geq=p(W-X\,Y)
yading@10 16950
yading@10 16951
yading@10 16952
yading@10 16953 =item *
yading@10 16954
yading@10 16955 Generate a bidimensional sine wave, with angle C<PI/3> and a
yading@10 16956 wavelength of 100 pixels:
yading@10 16957
yading@10 16958 geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
yading@10 16959
yading@10 16960
yading@10 16961
yading@10 16962 =item *
yading@10 16963
yading@10 16964 Generate a fancy enigmatic moving light:
yading@10 16965
yading@10 16966 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 16967
yading@10 16968
yading@10 16969
yading@10 16970 =item *
yading@10 16971
yading@10 16972 Generate a quick emboss effect:
yading@10 16973
yading@10 16974 format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
yading@10 16975
yading@10 16976
yading@10 16977 =back
yading@10 16978
yading@10 16979
yading@10 16980
yading@10 16981 =head2 gradfun
yading@10 16982
yading@10 16983
yading@10 16984 Fix the banding artifacts that are sometimes introduced into nearly flat
yading@10 16985 regions by truncation to 8bit color depth.
yading@10 16986 Interpolate the gradients that should go where the bands are, and
yading@10 16987 dither them.
yading@10 16988
yading@10 16989 This filter is designed for playback only. Do not use it prior to
yading@10 16990 lossy compression, because compression tends to lose the dither and
yading@10 16991 bring back the bands.
yading@10 16992
yading@10 16993 This filter accepts the following options:
yading@10 16994
yading@10 16995
yading@10 16996 =over 4
yading@10 16997
yading@10 16998
yading@10 16999
yading@10 17000 =item B<strength>
yading@10 17001
yading@10 17002 The maximum amount by which the filter will change any one pixel. Also the
yading@10 17003 threshold for detecting nearly flat regions. Acceptable values range from .51 to
yading@10 17004 64, default value is 1.2, out-of-range values will be clipped to the valid
yading@10 17005 range.
yading@10 17006
yading@10 17007
yading@10 17008 =item B<radius>
yading@10 17009
yading@10 17010 The neighborhood to fit the gradient to. A larger radius makes for smoother
yading@10 17011 gradients, but also prevents the filter from modifying the pixels near detailed
yading@10 17012 regions. Acceptable values are 8-32, default value is 16, out-of-range values
yading@10 17013 will be clipped to the valid range.
yading@10 17014
yading@10 17015
yading@10 17016 =back
yading@10 17017
yading@10 17018
yading@10 17019 Alternatively, the options can be specified as a flat string:
yading@10 17020 I<strength>[:I<radius>]
yading@10 17021
yading@10 17022
yading@10 17023 =head3 Examples
yading@10 17024
yading@10 17025
yading@10 17026
yading@10 17027 =over 4
yading@10 17028
yading@10 17029
yading@10 17030 =item *
yading@10 17031
yading@10 17032 Apply the filter with a C<3.5> strength and radius of C<8>:
yading@10 17033
yading@10 17034 gradfun=3.5:8
yading@10 17035
yading@10 17036
yading@10 17037
yading@10 17038 =item *
yading@10 17039
yading@10 17040 Specify radius, omitting the strength (which will fall-back to the default
yading@10 17041 value):
yading@10 17042
yading@10 17043 gradfun=radius=8
yading@10 17044
yading@10 17045
yading@10 17046
yading@10 17047 =back
yading@10 17048
yading@10 17049
yading@10 17050
yading@10 17051 =head2 hflip
yading@10 17052
yading@10 17053
yading@10 17054 Flip the input video horizontally.
yading@10 17055
yading@10 17056 For example to horizontally flip the input video with B<ffmpeg>:
yading@10 17057
yading@10 17058 ffmpeg -i in.avi -vf "hflip" out.avi
yading@10 17059
yading@10 17060
yading@10 17061
yading@10 17062 =head2 histeq
yading@10 17063
yading@10 17064 This filter applies a global color histogram equalization on a
yading@10 17065 per-frame basis.
yading@10 17066
yading@10 17067 It can be used to correct video that has a compressed range of pixel
yading@10 17068 intensities. The filter redistributes the pixel intensities to
yading@10 17069 equalize their distribution across the intensity range. It may be
yading@10 17070 viewed as an "automatically adjusting contrast filter". This filter is
yading@10 17071 useful only for correcting degraded or poorly captured source
yading@10 17072 video.
yading@10 17073
yading@10 17074 The filter accepts the following options:
yading@10 17075
yading@10 17076
yading@10 17077 =over 4
yading@10 17078
yading@10 17079
yading@10 17080 =item B<strength>
yading@10 17081
yading@10 17082 Determine the amount of equalization to be applied. As the strength
yading@10 17083 is reduced, the distribution of pixel intensities more-and-more
yading@10 17084 approaches that of the input frame. The value must be a float number
yading@10 17085 in the range [0,1] and defaults to 0.200.
yading@10 17086
yading@10 17087
yading@10 17088 =item B<intensity>
yading@10 17089
yading@10 17090 Set the maximum intensity that can generated and scale the output
yading@10 17091 values appropriately. The strength should be set as desired and then
yading@10 17092 the intensity can be limited if needed to avoid washing-out. The value
yading@10 17093 must be a float number in the range [0,1] and defaults to 0.210.
yading@10 17094
yading@10 17095
yading@10 17096 =item B<antibanding>
yading@10 17097
yading@10 17098 Set the antibanding level. If enabled the filter will randomly vary
yading@10 17099 the luminance of output pixels by a small amount to avoid banding of
yading@10 17100 the histogram. Possible values are C<none>, C<weak> or
yading@10 17101 C<strong>. It defaults to C<none>.
yading@10 17102
yading@10 17103 =back
yading@10 17104
yading@10 17105
yading@10 17106
yading@10 17107 =head2 histogram
yading@10 17108
yading@10 17109
yading@10 17110 Compute and draw a color distribution histogram for the input video.
yading@10 17111
yading@10 17112 The computed histogram is a representation of distribution of color components
yading@10 17113 in an image.
yading@10 17114
yading@10 17115 The filter accepts the following options:
yading@10 17116
yading@10 17117
yading@10 17118 =over 4
yading@10 17119
yading@10 17120
yading@10 17121 =item B<mode>
yading@10 17122
yading@10 17123 Set histogram mode.
yading@10 17124
yading@10 17125 It accepts the following values:
yading@10 17126
yading@10 17127 =over 4
yading@10 17128
yading@10 17129
yading@10 17130 =item B<levels>
yading@10 17131
yading@10 17132 standard histogram that display color components distribution in an image.
yading@10 17133 Displays color graph for each color component. Shows distribution
yading@10 17134 of the Y, U, V, A or G, B, R components, depending on input format,
yading@10 17135 in current frame. Bellow each graph is color component scale meter.
yading@10 17136
yading@10 17137
yading@10 17138 =item B<color>
yading@10 17139
yading@10 17140 chroma values in vectorscope, if brighter more such chroma values are
yading@10 17141 distributed in an image.
yading@10 17142 Displays chroma values (U/V color placement) in two dimensional graph
yading@10 17143 (which is called a vectorscope). It can be used to read of the hue and
yading@10 17144 saturation of the current frame. At a same time it is a histogram.
yading@10 17145 The whiter a pixel in the vectorscope, the more pixels of the input frame
yading@10 17146 correspond to that pixel (that is the more pixels have this chroma value).
yading@10 17147 The V component is displayed on the horizontal (X) axis, with the leftmost
yading@10 17148 side being V = 0 and the rightmost side being V = 255.
yading@10 17149 The U component is displayed on the vertical (Y) axis, with the top
yading@10 17150 representing U = 0 and the bottom representing U = 255.
yading@10 17151
yading@10 17152 The position of a white pixel in the graph corresponds to the chroma value
yading@10 17153 of a pixel of the input clip. So the graph can be used to read of the
yading@10 17154 hue (color flavor) and the saturation (the dominance of the hue in the color).
yading@10 17155 As the hue of a color changes, it moves around the square. At the center of
yading@10 17156 the square, the saturation is zero, which means that the corresponding pixel
yading@10 17157 has no color. If you increase the amount of a specific color, while leaving
yading@10 17158 the other colors unchanged, the saturation increases, and you move towards
yading@10 17159 the edge of the square.
yading@10 17160
yading@10 17161
yading@10 17162 =item B<color2>
yading@10 17163
yading@10 17164 chroma values in vectorscope, similar as C<color> but actual chroma values
yading@10 17165 are displayed.
yading@10 17166
yading@10 17167
yading@10 17168 =item B<waveform>
yading@10 17169
yading@10 17170 per row/column color component graph. In row mode graph in the left side represents
yading@10 17171 color component value 0 and right side represents value = 255. In column mode top
yading@10 17172 side represents color component value = 0 and bottom side represents value = 255.
yading@10 17173
yading@10 17174 =back
yading@10 17175
yading@10 17176 Default value is C<levels>.
yading@10 17177
yading@10 17178
yading@10 17179 =item B<level_height>
yading@10 17180
yading@10 17181 Set height of level in C<levels>. Default value is C<200>.
yading@10 17182 Allowed range is [50, 2048].
yading@10 17183
yading@10 17184
yading@10 17185 =item B<scale_height>
yading@10 17186
yading@10 17187 Set height of color scale in C<levels>. Default value is C<12>.
yading@10 17188 Allowed range is [0, 40].
yading@10 17189
yading@10 17190
yading@10 17191 =item B<step>
yading@10 17192
yading@10 17193 Set step for C<waveform> mode. Smaller values are useful to find out how much
yading@10 17194 of same luminance values across input rows/columns are distributed.
yading@10 17195 Default value is C<10>. Allowed range is [1, 255].
yading@10 17196
yading@10 17197
yading@10 17198 =item B<waveform_mode>
yading@10 17199
yading@10 17200 Set mode for C<waveform>. Can be either C<row>, or C<column>.
yading@10 17201 Default is C<row>.
yading@10 17202
yading@10 17203
yading@10 17204 =item B<display_mode>
yading@10 17205
yading@10 17206 Set display mode for C<waveform> and C<levels>.
yading@10 17207 It accepts the following values:
yading@10 17208
yading@10 17209 =over 4
yading@10 17210
yading@10 17211
yading@10 17212 =item B<parade>
yading@10 17213
yading@10 17214 Display separate graph for the color components side by side in
yading@10 17215 C<row> waveform mode or one below other in C<column> waveform mode
yading@10 17216 for C<waveform> histogram mode. For C<levels> histogram mode
yading@10 17217 per color component graphs are placed one bellow other.
yading@10 17218
yading@10 17219 This display mode in C<waveform> histogram mode makes it easy to spot
yading@10 17220 color casts in the highlights and shadows of an image, by comparing the
yading@10 17221 contours of the top and the bottom of each waveform.
yading@10 17222 Since whites, grays, and blacks are characterized by
yading@10 17223 exactly equal amounts of red, green, and blue, neutral areas of the
yading@10 17224 picture should display three waveforms of roughly equal width/height.
yading@10 17225 If not, the correction is easy to make by making adjustments to level the
yading@10 17226 three waveforms.
yading@10 17227
yading@10 17228
yading@10 17229 =item B<overlay>
yading@10 17230
yading@10 17231 Presents information that's identical to that in the C<parade>, except
yading@10 17232 that the graphs representing color components are superimposed directly
yading@10 17233 over one another.
yading@10 17234
yading@10 17235 This display mode in C<waveform> histogram mode can make it easier to spot
yading@10 17236 the relative differences or similarities in overlapping areas of the color
yading@10 17237 components that are supposed to be identical, such as neutral whites, grays,
yading@10 17238 or blacks.
yading@10 17239
yading@10 17240 =back
yading@10 17241
yading@10 17242 Default is C<parade>.
yading@10 17243
yading@10 17244 =back
yading@10 17245
yading@10 17246
yading@10 17247
yading@10 17248 =head3 Examples
yading@10 17249
yading@10 17250
yading@10 17251
yading@10 17252 =over 4
yading@10 17253
yading@10 17254
yading@10 17255
yading@10 17256 =item *
yading@10 17257
yading@10 17258 Calculate and draw histogram:
yading@10 17259
yading@10 17260 ffplay -i input -vf histogram
yading@10 17261
yading@10 17262
yading@10 17263
yading@10 17264 =back
yading@10 17265
yading@10 17266
yading@10 17267
yading@10 17268 =head2 hqdn3d
yading@10 17269
yading@10 17270
yading@10 17271 High precision/quality 3d denoise filter. This filter aims to reduce
yading@10 17272 image noise producing smooth images and making still images really
yading@10 17273 still. It should enhance compressibility.
yading@10 17274
yading@10 17275 It accepts the following optional parameters:
yading@10 17276
yading@10 17277
yading@10 17278 =over 4
yading@10 17279
yading@10 17280
yading@10 17281 =item B<luma_spatial>
yading@10 17282
yading@10 17283 a non-negative float number which specifies spatial luma strength,
yading@10 17284 defaults to 4.0
yading@10 17285
yading@10 17286
yading@10 17287 =item B<chroma_spatial>
yading@10 17288
yading@10 17289 a non-negative float number which specifies spatial chroma strength,
yading@10 17290 defaults to 3.0*I<luma_spatial>/4.0
yading@10 17291
yading@10 17292
yading@10 17293 =item B<luma_tmp>
yading@10 17294
yading@10 17295 a float number which specifies luma temporal strength, defaults to
yading@10 17296 6.0*I<luma_spatial>/4.0
yading@10 17297
yading@10 17298
yading@10 17299 =item B<chroma_tmp>
yading@10 17300
yading@10 17301 a float number which specifies chroma temporal strength, defaults to
yading@10 17302 I<luma_tmp>*I<chroma_spatial>/I<luma_spatial>
yading@10 17303
yading@10 17304 =back
yading@10 17305
yading@10 17306
yading@10 17307
yading@10 17308 =head2 hue
yading@10 17309
yading@10 17310
yading@10 17311 Modify the hue and/or the saturation of the input.
yading@10 17312
yading@10 17313 This filter accepts the following options:
yading@10 17314
yading@10 17315
yading@10 17316 =over 4
yading@10 17317
yading@10 17318
yading@10 17319 =item B<h>
yading@10 17320
yading@10 17321 Specify the hue angle as a number of degrees. It accepts an expression,
yading@10 17322 and defaults to "0".
yading@10 17323
yading@10 17324
yading@10 17325 =item B<s>
yading@10 17326
yading@10 17327 Specify the saturation in the [-10,10] range. It accepts a float number and
yading@10 17328 defaults to "1".
yading@10 17329
yading@10 17330
yading@10 17331 =item B<H>
yading@10 17332
yading@10 17333 Specify the hue angle as a number of radians. It accepts a float
yading@10 17334 number or an expression, and defaults to "0".
yading@10 17335
yading@10 17336 =back
yading@10 17337
yading@10 17338
yading@10 17339 B<h> and B<H> are mutually exclusive, and can't be
yading@10 17340 specified at the same time.
yading@10 17341
yading@10 17342 The B<h>, B<H> and B<s> option values are
yading@10 17343 expressions containing the following constants:
yading@10 17344
yading@10 17345
yading@10 17346 =over 4
yading@10 17347
yading@10 17348
yading@10 17349 =item B<n>
yading@10 17350
yading@10 17351 frame count of the input frame starting from 0
yading@10 17352
yading@10 17353
yading@10 17354 =item B<pts>
yading@10 17355
yading@10 17356 presentation timestamp of the input frame expressed in time base units
yading@10 17357
yading@10 17358
yading@10 17359 =item B<r>
yading@10 17360
yading@10 17361 frame rate of the input video, NAN if the input frame rate is unknown
yading@10 17362
yading@10 17363
yading@10 17364 =item B<t>
yading@10 17365
yading@10 17366 timestamp expressed in seconds, NAN if the input timestamp is unknown
yading@10 17367
yading@10 17368
yading@10 17369 =item B<tb>
yading@10 17370
yading@10 17371 time base of the input video
yading@10 17372
yading@10 17373 =back
yading@10 17374
yading@10 17375
yading@10 17376
yading@10 17377 =head3 Examples
yading@10 17378
yading@10 17379
yading@10 17380
yading@10 17381 =over 4
yading@10 17382
yading@10 17383
yading@10 17384 =item *
yading@10 17385
yading@10 17386 Set the hue to 90 degrees and the saturation to 1.0:
yading@10 17387
yading@10 17388 hue=h=90:s=1
yading@10 17389
yading@10 17390
yading@10 17391
yading@10 17392 =item *
yading@10 17393
yading@10 17394 Same command but expressing the hue in radians:
yading@10 17395
yading@10 17396 hue=H=PI/2:s=1
yading@10 17397
yading@10 17398
yading@10 17399
yading@10 17400 =item *
yading@10 17401
yading@10 17402 Rotate hue and make the saturation swing between 0
yading@10 17403 and 2 over a period of 1 second:
yading@10 17404
yading@10 17405 hue="H=2*PI*t: s=sin(2*PI*t)+1"
yading@10 17406
yading@10 17407
yading@10 17408
yading@10 17409 =item *
yading@10 17410
yading@10 17411 Apply a 3 seconds saturation fade-in effect starting at 0:
yading@10 17412
yading@10 17413 hue="s=min(t/3\,1)"
yading@10 17414
yading@10 17415
yading@10 17416 The general fade-in expression can be written as:
yading@10 17417
yading@10 17418 hue="s=min(0\, max((t-START)/DURATION\, 1))"
yading@10 17419
yading@10 17420
yading@10 17421
yading@10 17422 =item *
yading@10 17423
yading@10 17424 Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
yading@10 17425
yading@10 17426 hue="s=max(0\, min(1\, (8-t)/3))"
yading@10 17427
yading@10 17428
yading@10 17429 The general fade-out expression can be written as:
yading@10 17430
yading@10 17431 hue="s=max(0\, min(1\, (START+DURATION-t)/DURATION))"
yading@10 17432
yading@10 17433
yading@10 17434
yading@10 17435 =back
yading@10 17436
yading@10 17437
yading@10 17438
yading@10 17439 =head3 Commands
yading@10 17440
yading@10 17441
yading@10 17442 This filter supports the following commands:
yading@10 17443
yading@10 17444 =over 4
yading@10 17445
yading@10 17446
yading@10 17447 =item B<s>
yading@10 17448
yading@10 17449
yading@10 17450 =item B<h>
yading@10 17451
yading@10 17452
yading@10 17453 =item B<H>
yading@10 17454
yading@10 17455 Modify the hue and/or the saturation of the input video.
yading@10 17456 The command accepts the same syntax of the corresponding option.
yading@10 17457
yading@10 17458 If the specified expression is not valid, it is kept at its current
yading@10 17459 value.
yading@10 17460
yading@10 17461 =back
yading@10 17462
yading@10 17463
yading@10 17464
yading@10 17465 =head2 idet
yading@10 17466
yading@10 17467
yading@10 17468 Detect video interlacing type.
yading@10 17469
yading@10 17470 This filter tries to detect if the input is interlaced or progressive,
yading@10 17471 top or bottom field first.
yading@10 17472
yading@10 17473 The filter accepts the following options:
yading@10 17474
yading@10 17475
yading@10 17476 =over 4
yading@10 17477
yading@10 17478
yading@10 17479 =item B<intl_thres>
yading@10 17480
yading@10 17481 Set interlacing threshold.
yading@10 17482
yading@10 17483 =item B<prog_thres>
yading@10 17484
yading@10 17485 Set progressive threshold.
yading@10 17486
yading@10 17487 =back
yading@10 17488
yading@10 17489
yading@10 17490
yading@10 17491 =head2 il
yading@10 17492
yading@10 17493
yading@10 17494 Deinterleave or interleave fields.
yading@10 17495
yading@10 17496 This filter allows to process interlaced images fields without
yading@10 17497 deinterlacing them. Deinterleaving splits the input frame into 2
yading@10 17498 fields (so called half pictures). Odd lines are moved to the top
yading@10 17499 half of the output image, even lines to the bottom half.
yading@10 17500 You can process (filter) them independently and then re-interleave them.
yading@10 17501
yading@10 17502 The filter accepts the following options:
yading@10 17503
yading@10 17504
yading@10 17505 =over 4
yading@10 17506
yading@10 17507
yading@10 17508 =item B<luma_mode, l>
yading@10 17509
yading@10 17510
yading@10 17511 =item B<chroma_mode, s>
yading@10 17512
yading@10 17513
yading@10 17514 =item B<alpha_mode, a>
yading@10 17515
yading@10 17516 Available values for I<luma_mode>, I<chroma_mode> and
yading@10 17517 I<alpha_mode> are:
yading@10 17518
yading@10 17519
yading@10 17520 =over 4
yading@10 17521
yading@10 17522
yading@10 17523 =item B<none>
yading@10 17524
yading@10 17525 Do nothing.
yading@10 17526
yading@10 17527
yading@10 17528 =item B<deinterleave, d>
yading@10 17529
yading@10 17530 Deinterleave fields, placing one above the other.
yading@10 17531
yading@10 17532
yading@10 17533 =item B<interleave, i>
yading@10 17534
yading@10 17535 Interleave fields. Reverse the effect of deinterleaving.
yading@10 17536
yading@10 17537 =back
yading@10 17538
yading@10 17539 Default value is C<none>.
yading@10 17540
yading@10 17541
yading@10 17542 =item B<luma_swap, ls>
yading@10 17543
yading@10 17544
yading@10 17545 =item B<chroma_swap, cs>
yading@10 17546
yading@10 17547
yading@10 17548 =item B<alpha_swap, as>
yading@10 17549
yading@10 17550 Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is C<0>.
yading@10 17551
yading@10 17552 =back
yading@10 17553
yading@10 17554
yading@10 17555
yading@10 17556 =head2 interlace
yading@10 17557
yading@10 17558
yading@10 17559 Simple interlacing filter from progressive contents. This interleaves upper (or
yading@10 17560 lower) lines from odd frames with lower (or upper) lines from even frames,
yading@10 17561 halving the frame rate and preserving image height.
yading@10 17562
yading@10 17563
yading@10 17564 Original Original New Frame
yading@10 17565 Frame 'j' Frame 'j+1' (tff)
yading@10 17566 ========== =========== ==================
yading@10 17567 Line 0 --------------------> Frame 'j' Line 0
yading@10 17568 Line 1 Line 1 ----> Frame 'j+1' Line 1
yading@10 17569 Line 2 ---------------------> Frame 'j' Line 2
yading@10 17570 Line 3 Line 3 ----> Frame 'j+1' Line 3
yading@10 17571 ... ... ...
yading@10 17572 New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
yading@10 17573
yading@10 17574
yading@10 17575 It accepts the following optional parameters:
yading@10 17576
yading@10 17577
yading@10 17578 =over 4
yading@10 17579
yading@10 17580
yading@10 17581 =item B<scan>
yading@10 17582
yading@10 17583 determines whether the interlaced frame is taken from the even (tff - default)
yading@10 17584 or odd (bff) lines of the progressive frame.
yading@10 17585
yading@10 17586
yading@10 17587 =item B<lowpass>
yading@10 17588
yading@10 17589 Enable (default) or disable the vertical lowpass filter to avoid twitter
yading@10 17590 interlacing and reduce moire patterns.
yading@10 17591
yading@10 17592 =back
yading@10 17593
yading@10 17594
yading@10 17595
yading@10 17596 =head2 kerndeint
yading@10 17597
yading@10 17598
yading@10 17599 Deinterlace input video by applying Donald Graft's adaptive kernel
yading@10 17600 deinterling. Work on interlaced parts of a video to produce
yading@10 17601 progressive frames.
yading@10 17602
yading@10 17603 The description of the accepted parameters follows.
yading@10 17604
yading@10 17605
yading@10 17606 =over 4
yading@10 17607
yading@10 17608
yading@10 17609 =item B<thresh>
yading@10 17610
yading@10 17611 Set the threshold which affects the filter's tolerance when
yading@10 17612 determining if a pixel line must be processed. It must be an integer
yading@10 17613 in the range [0,255] and defaults to 10. A value of 0 will result in
yading@10 17614 applying the process on every pixels.
yading@10 17615
yading@10 17616
yading@10 17617 =item B<map>
yading@10 17618
yading@10 17619 Paint pixels exceeding the threshold value to white if set to 1.
yading@10 17620 Default is 0.
yading@10 17621
yading@10 17622
yading@10 17623 =item B<order>
yading@10 17624
yading@10 17625 Set the fields order. Swap fields if set to 1, leave fields alone if
yading@10 17626 0. Default is 0.
yading@10 17627
yading@10 17628
yading@10 17629 =item B<sharp>
yading@10 17630
yading@10 17631 Enable additional sharpening if set to 1. Default is 0.
yading@10 17632
yading@10 17633
yading@10 17634 =item B<twoway>
yading@10 17635
yading@10 17636 Enable twoway sharpening if set to 1. Default is 0.
yading@10 17637
yading@10 17638 =back
yading@10 17639
yading@10 17640
yading@10 17641
yading@10 17642 =head3 Examples
yading@10 17643
yading@10 17644
yading@10 17645
yading@10 17646 =over 4
yading@10 17647
yading@10 17648
yading@10 17649 =item *
yading@10 17650
yading@10 17651 Apply default values:
yading@10 17652
yading@10 17653 kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
yading@10 17654
yading@10 17655
yading@10 17656
yading@10 17657 =item *
yading@10 17658
yading@10 17659 Enable additional sharpening:
yading@10 17660
yading@10 17661 kerndeint=sharp=1
yading@10 17662
yading@10 17663
yading@10 17664
yading@10 17665 =item *
yading@10 17666
yading@10 17667 Paint processed pixels in white:
yading@10 17668
yading@10 17669 kerndeint=map=1
yading@10 17670
yading@10 17671
yading@10 17672 =back
yading@10 17673
yading@10 17674
yading@10 17675
yading@10 17676 =head2 lut, lutrgb, lutyuv
yading@10 17677
yading@10 17678
yading@10 17679 Compute a look-up table for binding each pixel component input value
yading@10 17680 to an output value, and apply it to input video.
yading@10 17681
yading@10 17682 I<lutyuv> applies a lookup table to a YUV input video, I<lutrgb>
yading@10 17683 to an RGB input video.
yading@10 17684
yading@10 17685 These filters accept the following options:
yading@10 17686
yading@10 17687 =over 4
yading@10 17688
yading@10 17689
yading@10 17690 =item B<c0>
yading@10 17691
yading@10 17692 set first pixel component expression
yading@10 17693
yading@10 17694 =item B<c1>
yading@10 17695
yading@10 17696 set second pixel component expression
yading@10 17697
yading@10 17698 =item B<c2>
yading@10 17699
yading@10 17700 set third pixel component expression
yading@10 17701
yading@10 17702 =item B<c3>
yading@10 17703
yading@10 17704 set fourth pixel component expression, corresponds to the alpha component
yading@10 17705
yading@10 17706
yading@10 17707 =item B<r>
yading@10 17708
yading@10 17709 set red component expression
yading@10 17710
yading@10 17711 =item B<g>
yading@10 17712
yading@10 17713 set green component expression
yading@10 17714
yading@10 17715 =item B<b>
yading@10 17716
yading@10 17717 set blue component expression
yading@10 17718
yading@10 17719 =item B<a>
yading@10 17720
yading@10 17721 alpha component expression
yading@10 17722
yading@10 17723
yading@10 17724 =item B<y>
yading@10 17725
yading@10 17726 set Y/luminance component expression
yading@10 17727
yading@10 17728 =item B<u>
yading@10 17729
yading@10 17730 set U/Cb component expression
yading@10 17731
yading@10 17732 =item B<v>
yading@10 17733
yading@10 17734 set V/Cr component expression
yading@10 17735
yading@10 17736 =back
yading@10 17737
yading@10 17738
yading@10 17739 Each of them specifies the expression to use for computing the lookup table for
yading@10 17740 the corresponding pixel component values.
yading@10 17741
yading@10 17742 The exact component associated to each of the I<c*> options depends on the
yading@10 17743 format in input.
yading@10 17744
yading@10 17745 The I<lut> filter requires either YUV or RGB pixel formats in input,
yading@10 17746 I<lutrgb> requires RGB pixel formats in input, and I<lutyuv> requires YUV.
yading@10 17747
yading@10 17748 The expressions can contain the following constants and functions:
yading@10 17749
yading@10 17750
yading@10 17751 =over 4
yading@10 17752
yading@10 17753
yading@10 17754 =item B<w, h>
yading@10 17755
yading@10 17756 the input width and height
yading@10 17757
yading@10 17758
yading@10 17759 =item B<val>
yading@10 17760
yading@10 17761 input value for the pixel component
yading@10 17762
yading@10 17763
yading@10 17764 =item B<clipval>
yading@10 17765
yading@10 17766 the input value clipped in the I<minval>-I<maxval> range
yading@10 17767
yading@10 17768
yading@10 17769 =item B<maxval>
yading@10 17770
yading@10 17771 maximum value for the pixel component
yading@10 17772
yading@10 17773
yading@10 17774 =item B<minval>
yading@10 17775
yading@10 17776 minimum value for the pixel component
yading@10 17777
yading@10 17778
yading@10 17779 =item B<negval>
yading@10 17780
yading@10 17781 the negated value for the pixel component value clipped in the
yading@10 17782 I<minval>-I<maxval> range , it corresponds to the expression
yading@10 17783 "maxval-clipval+minval"
yading@10 17784
yading@10 17785
yading@10 17786 =item B<clip(val)>
yading@10 17787
yading@10 17788 the computed value in I<val> clipped in the
yading@10 17789 I<minval>-I<maxval> range
yading@10 17790
yading@10 17791
yading@10 17792 =item B<gammaval(gamma)>
yading@10 17793
yading@10 17794 the computed gamma correction value of the pixel component value
yading@10 17795 clipped in the I<minval>-I<maxval> range, corresponds to the
yading@10 17796 expression
yading@10 17797 "pow((clipval-minval)/(maxval-minval)\,I<gamma>)*(maxval-minval)+minval"
yading@10 17798
yading@10 17799
yading@10 17800 =back
yading@10 17801
yading@10 17802
yading@10 17803 All expressions default to "val".
yading@10 17804
yading@10 17805
yading@10 17806 =head3 Examples
yading@10 17807
yading@10 17808
yading@10 17809
yading@10 17810 =over 4
yading@10 17811
yading@10 17812
yading@10 17813 =item *
yading@10 17814
yading@10 17815 Negate input video:
yading@10 17816
yading@10 17817 lutrgb="r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val"
yading@10 17818 lutyuv="y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val"
yading@10 17819
yading@10 17820
yading@10 17821 The above is the same as:
yading@10 17822
yading@10 17823 lutrgb="r=negval:g=negval:b=negval"
yading@10 17824 lutyuv="y=negval:u=negval:v=negval"
yading@10 17825
yading@10 17826
yading@10 17827
yading@10 17828 =item *
yading@10 17829
yading@10 17830 Negate luminance:
yading@10 17831
yading@10 17832 lutyuv=y=negval
yading@10 17833
yading@10 17834
yading@10 17835
yading@10 17836 =item *
yading@10 17837
yading@10 17838 Remove chroma components, turns the video into a graytone image:
yading@10 17839
yading@10 17840 lutyuv="u=128:v=128"
yading@10 17841
yading@10 17842
yading@10 17843
yading@10 17844 =item *
yading@10 17845
yading@10 17846 Apply a luma burning effect:
yading@10 17847
yading@10 17848 lutyuv="y=2*val"
yading@10 17849
yading@10 17850
yading@10 17851
yading@10 17852 =item *
yading@10 17853
yading@10 17854 Remove green and blue components:
yading@10 17855
yading@10 17856 lutrgb="g=0:b=0"
yading@10 17857
yading@10 17858
yading@10 17859
yading@10 17860 =item *
yading@10 17861
yading@10 17862 Set a constant alpha channel value on input:
yading@10 17863
yading@10 17864 format=rgba,lutrgb=a="maxval-minval/2"
yading@10 17865
yading@10 17866
yading@10 17867
yading@10 17868 =item *
yading@10 17869
yading@10 17870 Correct luminance gamma by a 0.5 factor:
yading@10 17871
yading@10 17872 lutyuv=y=gammaval(0.5)
yading@10 17873
yading@10 17874
yading@10 17875
yading@10 17876 =item *
yading@10 17877
yading@10 17878 Discard least significant bits of luma:
yading@10 17879
yading@10 17880 lutyuv=y='bitand(val, 128+64+32)'
yading@10 17881
yading@10 17882
yading@10 17883 =back
yading@10 17884
yading@10 17885
yading@10 17886
yading@10 17887 =head2 mp
yading@10 17888
yading@10 17889
yading@10 17890 Apply an MPlayer filter to the input video.
yading@10 17891
yading@10 17892 This filter provides a wrapper around most of the filters of
yading@10 17893 MPlayer/MEncoder.
yading@10 17894
yading@10 17895 This wrapper is considered experimental. Some of the wrapped filters
yading@10 17896 may not work properly and we may drop support for them, as they will
yading@10 17897 be implemented natively into FFmpeg. Thus you should avoid
yading@10 17898 depending on them when writing portable scripts.
yading@10 17899
yading@10 17900 The filters accepts the parameters:
yading@10 17901 I<filter_name>[:=]I<filter_params>
yading@10 17902
yading@10 17903 I<filter_name> is the name of a supported MPlayer filter,
yading@10 17904 I<filter_params> is a string containing the parameters accepted by
yading@10 17905 the named filter.
yading@10 17906
yading@10 17907 The list of the currently supported filters follows:
yading@10 17908
yading@10 17909 =over 4
yading@10 17910
yading@10 17911
yading@10 17912 =item I<dint>
yading@10 17913
yading@10 17914
yading@10 17915 =item I<down3dright>
yading@10 17916
yading@10 17917
yading@10 17918 =item I<eq2>
yading@10 17919
yading@10 17920
yading@10 17921 =item I<eq>
yading@10 17922
yading@10 17923
yading@10 17924 =item I<fil>
yading@10 17925
yading@10 17926
yading@10 17927 =item I<fspp>
yading@10 17928
yading@10 17929
yading@10 17930 =item I<ilpack>
yading@10 17931
yading@10 17932
yading@10 17933 =item I<mcdeint>
yading@10 17934
yading@10 17935
yading@10 17936 =item I<ow>
yading@10 17937
yading@10 17938
yading@10 17939 =item I<perspective>
yading@10 17940
yading@10 17941
yading@10 17942 =item I<phase>
yading@10 17943
yading@10 17944
yading@10 17945 =item I<pp7>
yading@10 17946
yading@10 17947
yading@10 17948 =item I<pullup>
yading@10 17949
yading@10 17950
yading@10 17951 =item I<qp>
yading@10 17952
yading@10 17953
yading@10 17954 =item I<sab>
yading@10 17955
yading@10 17956
yading@10 17957 =item I<softpulldown>
yading@10 17958
yading@10 17959
yading@10 17960 =item I<spp>
yading@10 17961
yading@10 17962
yading@10 17963 =item I<tinterlace>
yading@10 17964
yading@10 17965
yading@10 17966 =item I<uspp>
yading@10 17967
yading@10 17968
yading@10 17969 =back
yading@10 17970
yading@10 17971
yading@10 17972 The parameter syntax and behavior for the listed filters are the same
yading@10 17973 of the corresponding MPlayer filters. For detailed instructions check
yading@10 17974 the "VIDEO FILTERS" section in the MPlayer manual.
yading@10 17975
yading@10 17976
yading@10 17977 =head3 Examples
yading@10 17978
yading@10 17979
yading@10 17980
yading@10 17981 =over 4
yading@10 17982
yading@10 17983
yading@10 17984 =item *
yading@10 17985
yading@10 17986 Adjust gamma, brightness, contrast:
yading@10 17987
yading@10 17988 mp=eq2=1.0:2:0.5
yading@10 17989
yading@10 17990
yading@10 17991 =back
yading@10 17992
yading@10 17993
yading@10 17994 See also mplayer(1), E<lt>B<http://www.mplayerhq.hu/>E<gt>.
yading@10 17995
yading@10 17996
yading@10 17997 =head2 mpdecimate
yading@10 17998
yading@10 17999
yading@10 18000 Drop frames that do not differ greatly from the previous frame in
yading@10 18001 order to reduce frame rate.
yading@10 18002
yading@10 18003 The main use of this filter is for very-low-bitrate encoding
yading@10 18004 (e.g. streaming over dialup modem), but it could in theory be used for
yading@10 18005 fixing movies that were inverse-telecined incorrectly.
yading@10 18006
yading@10 18007 A description of the accepted options follows.
yading@10 18008
yading@10 18009
yading@10 18010 =over 4
yading@10 18011
yading@10 18012
yading@10 18013 =item B<max>
yading@10 18014
yading@10 18015 Set the maximum number of consecutive frames which can be dropped (if
yading@10 18016 positive), or the minimum interval between dropped frames (if
yading@10 18017 negative). If the value is 0, the frame is dropped unregarding the
yading@10 18018 number of previous sequentially dropped frames.
yading@10 18019
yading@10 18020 Default value is 0.
yading@10 18021
yading@10 18022
yading@10 18023 =item B<hi>
yading@10 18024
yading@10 18025
yading@10 18026 =item B<lo>
yading@10 18027
yading@10 18028
yading@10 18029 =item B<frac>
yading@10 18030
yading@10 18031 Set the dropping threshold values.
yading@10 18032
yading@10 18033 Values for B<hi> and B<lo> are for 8x8 pixel blocks and
yading@10 18034 represent actual pixel value differences, so a threshold of 64
yading@10 18035 corresponds to 1 unit of difference for each pixel, or the same spread
yading@10 18036 out differently over the block.
yading@10 18037
yading@10 18038 A frame is a candidate for dropping if no 8x8 blocks differ by more
yading@10 18039 than a threshold of B<hi>, and if no more than B<frac> blocks (1
yading@10 18040 meaning the whole image) differ by more than a threshold of B<lo>.
yading@10 18041
yading@10 18042 Default value for B<hi> is 64*12, default value for B<lo> is
yading@10 18043 64*5, and default value for B<frac> is 0.33.
yading@10 18044
yading@10 18045 =back
yading@10 18046
yading@10 18047
yading@10 18048
yading@10 18049
yading@10 18050 =head2 negate
yading@10 18051
yading@10 18052
yading@10 18053 Negate input video.
yading@10 18054
yading@10 18055 This filter accepts an integer in input, if non-zero it negates the
yading@10 18056 alpha component (if available). The default value in input is 0.
yading@10 18057
yading@10 18058
yading@10 18059 =head2 noformat
yading@10 18060
yading@10 18061
yading@10 18062 Force libavfilter not to use any of the specified pixel formats for the
yading@10 18063 input to the next filter.
yading@10 18064
yading@10 18065 This filter accepts the following parameters:
yading@10 18066
yading@10 18067 =over 4
yading@10 18068
yading@10 18069
yading@10 18070
yading@10 18071 =item B<pix_fmts>
yading@10 18072
yading@10 18073 A '|'-separated list of pixel format names, for example
yading@10 18074 "pix_fmts=yuv420p|monow|rgb24".
yading@10 18075
yading@10 18076
yading@10 18077 =back
yading@10 18078
yading@10 18079
yading@10 18080
yading@10 18081 =head3 Examples
yading@10 18082
yading@10 18083
yading@10 18084
yading@10 18085 =over 4
yading@10 18086
yading@10 18087
yading@10 18088 =item *
yading@10 18089
yading@10 18090 Force libavfilter to use a format different from I<yuv420p> for the
yading@10 18091 input to the vflip filter:
yading@10 18092
yading@10 18093 noformat=pix_fmts=yuv420p,vflip
yading@10 18094
yading@10 18095
yading@10 18096
yading@10 18097 =item *
yading@10 18098
yading@10 18099 Convert the input video to any of the formats not contained in the list:
yading@10 18100
yading@10 18101 noformat=yuv420p|yuv444p|yuv410p
yading@10 18102
yading@10 18103
yading@10 18104 =back
yading@10 18105
yading@10 18106
yading@10 18107
yading@10 18108 =head2 noise
yading@10 18109
yading@10 18110
yading@10 18111 Add noise on video input frame.
yading@10 18112
yading@10 18113 The filter accepts the following options:
yading@10 18114
yading@10 18115
yading@10 18116 =over 4
yading@10 18117
yading@10 18118
yading@10 18119 =item B<all_seed>
yading@10 18120
yading@10 18121
yading@10 18122 =item B<c0_seed>
yading@10 18123
yading@10 18124
yading@10 18125 =item B<c1_seed>
yading@10 18126
yading@10 18127
yading@10 18128 =item B<c2_seed>
yading@10 18129
yading@10 18130
yading@10 18131 =item B<c3_seed>
yading@10 18132
yading@10 18133 Set noise seed for specific pixel component or all pixel components in case
yading@10 18134 of I<all_seed>. Default value is C<123457>.
yading@10 18135
yading@10 18136
yading@10 18137 =item B<all_strength, alls>
yading@10 18138
yading@10 18139
yading@10 18140 =item B<c0_strength, c0s>
yading@10 18141
yading@10 18142
yading@10 18143 =item B<c1_strength, c1s>
yading@10 18144
yading@10 18145
yading@10 18146 =item B<c2_strength, c2s>
yading@10 18147
yading@10 18148
yading@10 18149 =item B<c3_strength, c3s>
yading@10 18150
yading@10 18151 Set noise strength for specific pixel component or all pixel components in case
yading@10 18152 I<all_strength>. Default value is C<0>. Allowed range is [0, 100].
yading@10 18153
yading@10 18154
yading@10 18155 =item B<all_flags, allf>
yading@10 18156
yading@10 18157
yading@10 18158 =item B<c0_flags, c0f>
yading@10 18159
yading@10 18160
yading@10 18161 =item B<c1_flags, c1f>
yading@10 18162
yading@10 18163
yading@10 18164 =item B<c2_flags, c2f>
yading@10 18165
yading@10 18166
yading@10 18167 =item B<c3_flags, c3f>
yading@10 18168
yading@10 18169 Set pixel component flags or set flags for all components if I<all_flags>.
yading@10 18170 Available values for component flags are:
yading@10 18171
yading@10 18172 =over 4
yading@10 18173
yading@10 18174
yading@10 18175 =item B<a>
yading@10 18176
yading@10 18177 averaged temporal noise (smoother)
yading@10 18178
yading@10 18179 =item B<p>
yading@10 18180
yading@10 18181 mix random noise with a (semi)regular pattern
yading@10 18182
yading@10 18183 =item B<q>
yading@10 18184
yading@10 18185 higher quality (slightly better looking, slightly slower)
yading@10 18186
yading@10 18187 =item B<t>
yading@10 18188
yading@10 18189 temporal noise (noise pattern changes between frames)
yading@10 18190
yading@10 18191 =item B<u>
yading@10 18192
yading@10 18193 uniform noise (gaussian otherwise)
yading@10 18194
yading@10 18195 =back
yading@10 18196
yading@10 18197
yading@10 18198 =back
yading@10 18199
yading@10 18200
yading@10 18201
yading@10 18202 =head3 Examples
yading@10 18203
yading@10 18204
yading@10 18205 Add temporal and uniform noise to input video:
yading@10 18206
yading@10 18207 noise=alls=20:allf=t+u
yading@10 18208
yading@10 18209
yading@10 18210
yading@10 18211 =head2 null
yading@10 18212
yading@10 18213
yading@10 18214 Pass the video source unchanged to the output.
yading@10 18215
yading@10 18216
yading@10 18217 =head2 ocv
yading@10 18218
yading@10 18219
yading@10 18220 Apply video transform using libopencv.
yading@10 18221
yading@10 18222 To enable this filter install libopencv library and headers and
yading@10 18223 configure FFmpeg with C<--enable-libopencv>.
yading@10 18224
yading@10 18225 This filter accepts the following parameters:
yading@10 18226
yading@10 18227
yading@10 18228 =over 4
yading@10 18229
yading@10 18230
yading@10 18231
yading@10 18232 =item B<filter_name>
yading@10 18233
yading@10 18234 The name of the libopencv filter to apply.
yading@10 18235
yading@10 18236
yading@10 18237 =item B<filter_params>
yading@10 18238
yading@10 18239 The parameters to pass to the libopencv filter. If not specified the default
yading@10 18240 values are assumed.
yading@10 18241
yading@10 18242
yading@10 18243 =back
yading@10 18244
yading@10 18245
yading@10 18246 Refer to the official libopencv documentation for more precise
yading@10 18247 information:
yading@10 18248 E<lt>B<http://opencv.willowgarage.com/documentation/c/image_filtering.html>E<gt>
yading@10 18249
yading@10 18250 Follows the list of supported libopencv filters.
yading@10 18251
yading@10 18252
yading@10 18253
yading@10 18254 =head3 dilate
yading@10 18255
yading@10 18256
yading@10 18257 Dilate an image by using a specific structuring element.
yading@10 18258 This filter corresponds to the libopencv function C<cvDilate>.
yading@10 18259
yading@10 18260 It accepts the parameters: I<struct_el>|I<nb_iterations>.
yading@10 18261
yading@10 18262 I<struct_el> represents a structuring element, and has the syntax:
yading@10 18263 I<cols>xI<rows>+I<anchor_x>xI<anchor_y>/I<shape>
yading@10 18264
yading@10 18265 I<cols> and I<rows> represent the number of columns and rows of
yading@10 18266 the structuring element, I<anchor_x> and I<anchor_y> the anchor
yading@10 18267 point, and I<shape> the shape for the structuring element, and
yading@10 18268 can be one of the values "rect", "cross", "ellipse", "custom".
yading@10 18269
yading@10 18270 If the value for I<shape> is "custom", it must be followed by a
yading@10 18271 string of the form "=I<filename>". The file with name
yading@10 18272 I<filename> is assumed to represent a binary image, with each
yading@10 18273 printable character corresponding to a bright pixel. When a custom
yading@10 18274 I<shape> is used, I<cols> and I<rows> are ignored, the number
yading@10 18275 or columns and rows of the read file are assumed instead.
yading@10 18276
yading@10 18277 The default value for I<struct_el> is "3x3+0x0/rect".
yading@10 18278
yading@10 18279 I<nb_iterations> specifies the number of times the transform is
yading@10 18280 applied to the image, and defaults to 1.
yading@10 18281
yading@10 18282 Follow some example:
yading@10 18283
yading@10 18284 # use the default values
yading@10 18285 ocv=dilate
yading@10 18286
yading@10 18287 # dilate using a structuring element with a 5x5 cross, iterate two times
yading@10 18288 ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
yading@10 18289
yading@10 18290 # read the shape from the file diamond.shape, iterate two times
yading@10 18291 # the file diamond.shape may contain a pattern of characters like this:
yading@10 18292 # *
yading@10 18293 # ***
yading@10 18294 # *****
yading@10 18295 # ***
yading@10 18296 # *
yading@10 18297 # the specified cols and rows are ignored (but not the anchor point coordinates)
yading@10 18298 ocv=dilate:0x0+2x2/custom=diamond.shape|2
yading@10 18299
yading@10 18300
yading@10 18301
yading@10 18302 =head3 erode
yading@10 18303
yading@10 18304
yading@10 18305 Erode an image by using a specific structuring element.
yading@10 18306 This filter corresponds to the libopencv function C<cvErode>.
yading@10 18307
yading@10 18308 The filter accepts the parameters: I<struct_el>:I<nb_iterations>,
yading@10 18309 with the same syntax and semantics as the dilate filter.
yading@10 18310
yading@10 18311
yading@10 18312 =head3 smooth
yading@10 18313
yading@10 18314
yading@10 18315 Smooth the input video.
yading@10 18316
yading@10 18317 The filter takes the following parameters:
yading@10 18318 I<type>|I<param1>|I<param2>|I<param3>|I<param4>.
yading@10 18319
yading@10 18320 I<type> is the type of smooth filter to apply, and can be one of
yading@10 18321 the following values: "blur", "blur_no_scale", "median", "gaussian",
yading@10 18322 "bilateral". The default value is "gaussian".
yading@10 18323
yading@10 18324 I<param1>, I<param2>, I<param3>, and I<param4> are
yading@10 18325 parameters whose meanings depend on smooth type. I<param1> and
yading@10 18326 I<param2> accept integer positive values or 0, I<param3> and
yading@10 18327 I<param4> accept float values.
yading@10 18328
yading@10 18329 The default value for I<param1> is 3, the default value for the
yading@10 18330 other parameters is 0.
yading@10 18331
yading@10 18332 These parameters correspond to the parameters assigned to the
yading@10 18333 libopencv function C<cvSmooth>.
yading@10 18334
yading@10 18335
yading@10 18336
yading@10 18337 =head2 overlay
yading@10 18338
yading@10 18339
yading@10 18340 Overlay one video on top of another.
yading@10 18341
yading@10 18342 It takes two inputs and one output, the first input is the "main"
yading@10 18343 video on which the second input is overlayed.
yading@10 18344
yading@10 18345 This filter accepts the following parameters:
yading@10 18346
yading@10 18347 A description of the accepted options follows.
yading@10 18348
yading@10 18349
yading@10 18350 =over 4
yading@10 18351
yading@10 18352
yading@10 18353 =item B<x>
yading@10 18354
yading@10 18355
yading@10 18356 =item B<y>
yading@10 18357
yading@10 18358 Set the expression for the x and y coordinates of the overlayed video
yading@10 18359 on the main video. Default value is "0" for both expressions. In case
yading@10 18360 the expression is invalid, it is set to a huge value (meaning that the
yading@10 18361 overlay will not be displayed within the output visible area).
yading@10 18362
yading@10 18363
yading@10 18364 =item B<enable>
yading@10 18365
yading@10 18366 Set the expression which enables the overlay. If the evaluation is
yading@10 18367 different from 0, the overlay is displayed on top of the input
yading@10 18368 frame. By default it is "1".
yading@10 18369
yading@10 18370
yading@10 18371 =item B<eval>
yading@10 18372
yading@10 18373 Set when the expressions for B<x>, B<y>, and
yading@10 18374 B<enable> are evaluated.
yading@10 18375
yading@10 18376 It accepts the following values:
yading@10 18377
yading@10 18378 =over 4
yading@10 18379
yading@10 18380
yading@10 18381 =item B<init>
yading@10 18382
yading@10 18383 only evaluate expressions once during the filter initialization or
yading@10 18384 when a command is processed
yading@10 18385
yading@10 18386
yading@10 18387 =item B<frame>
yading@10 18388
yading@10 18389 evaluate expressions for each incoming frame
yading@10 18390
yading@10 18391 =back
yading@10 18392
yading@10 18393
yading@10 18394 Default value is B<frame>.
yading@10 18395
yading@10 18396
yading@10 18397 =item B<shortest>
yading@10 18398
yading@10 18399 If set to 1, force the output to terminate when the shortest input
yading@10 18400 terminates. Default value is 0.
yading@10 18401
yading@10 18402
yading@10 18403 =item B<format>
yading@10 18404
yading@10 18405 Set the format for the output video.
yading@10 18406
yading@10 18407 It accepts the following values:
yading@10 18408
yading@10 18409 =over 4
yading@10 18410
yading@10 18411
yading@10 18412 =item B<yuv420>
yading@10 18413
yading@10 18414 force YUV420 output
yading@10 18415
yading@10 18416
yading@10 18417 =item B<yuv444>
yading@10 18418
yading@10 18419 force YUV444 output
yading@10 18420
yading@10 18421
yading@10 18422 =item B<rgb>
yading@10 18423
yading@10 18424 force RGB output
yading@10 18425
yading@10 18426 =back
yading@10 18427
yading@10 18428
yading@10 18429 Default value is B<yuv420>.
yading@10 18430
yading@10 18431
yading@10 18432 =item B<rgb> I<(deprecated)>
yading@10 18433
yading@10 18434 If set to 1, force the filter to accept inputs in the RGB
yading@10 18435 color space. Default value is 0. This option is deprecated, use
yading@10 18436 B<format> instead.
yading@10 18437
yading@10 18438
yading@10 18439 =item B<repeatlast>
yading@10 18440
yading@10 18441 If set to 1, force the filter to draw the last overlay frame over the
yading@10 18442 main input until the end of the stream. A value of 0 disables this
yading@10 18443 behavior, which is enabled by default.
yading@10 18444
yading@10 18445 =back
yading@10 18446
yading@10 18447
yading@10 18448 The B<x>, B<y>, and B<enable> expressions can
yading@10 18449 contain the following parameters.
yading@10 18450
yading@10 18451
yading@10 18452 =over 4
yading@10 18453
yading@10 18454
yading@10 18455 =item B<main_w, W>
yading@10 18456
yading@10 18457
yading@10 18458 =item B<main_h, H>
yading@10 18459
yading@10 18460 main input width and height
yading@10 18461
yading@10 18462
yading@10 18463 =item B<overlay_w, w>
yading@10 18464
yading@10 18465
yading@10 18466 =item B<overlay_h, h>
yading@10 18467
yading@10 18468 overlay input width and height
yading@10 18469
yading@10 18470
yading@10 18471 =item B<x>
yading@10 18472
yading@10 18473
yading@10 18474 =item B<y>
yading@10 18475
yading@10 18476 the computed values for I<x> and I<y>. They are evaluated for
yading@10 18477 each new frame.
yading@10 18478
yading@10 18479
yading@10 18480 =item B<hsub>
yading@10 18481
yading@10 18482
yading@10 18483 =item B<vsub>
yading@10 18484
yading@10 18485 horizontal and vertical chroma subsample values of the output
yading@10 18486 format. For example for the pixel format "yuv422p" I<hsub> is 2 and
yading@10 18487 I<vsub> is 1.
yading@10 18488
yading@10 18489
yading@10 18490 =item B<n>
yading@10 18491
yading@10 18492 the number of input frame, starting from 0
yading@10 18493
yading@10 18494
yading@10 18495 =item B<pos>
yading@10 18496
yading@10 18497 the position in the file of the input frame, NAN if unknown
yading@10 18498
yading@10 18499
yading@10 18500 =item B<t>
yading@10 18501
yading@10 18502 timestamp expressed in seconds, NAN if the input timestamp is unknown
yading@10 18503
yading@10 18504 =back
yading@10 18505
yading@10 18506
yading@10 18507 Note that the I<n>, I<pos>, I<t> variables are available only
yading@10 18508 when evaluation is done I<per frame>, and will evaluate to NAN
yading@10 18509 when B<eval> is set to B<init>.
yading@10 18510
yading@10 18511 Be aware that frames are taken from each input video in timestamp
yading@10 18512 order, hence, if their initial timestamps differ, it is a a good idea
yading@10 18513 to pass the two inputs through a I<setpts=PTS-STARTPTS> filter to
yading@10 18514 have them begin in the same zero timestamp, as it does the example for
yading@10 18515 the I<movie> filter.
yading@10 18516
yading@10 18517 You can chain together more overlays but you should test the
yading@10 18518 efficiency of such approach.
yading@10 18519
yading@10 18520
yading@10 18521 =head3 Commands
yading@10 18522
yading@10 18523
yading@10 18524 This filter supports the following commands:
yading@10 18525
yading@10 18526 =over 4
yading@10 18527
yading@10 18528
yading@10 18529 =item B<x>
yading@10 18530
yading@10 18531
yading@10 18532 =item B<y>
yading@10 18533
yading@10 18534
yading@10 18535 =item B<enable>
yading@10 18536
yading@10 18537 Modify the x/y and enable overlay of the overlay input.
yading@10 18538 The command accepts the same syntax of the corresponding option.
yading@10 18539
yading@10 18540 If the specified expression is not valid, it is kept at its current
yading@10 18541 value.
yading@10 18542
yading@10 18543 =back
yading@10 18544
yading@10 18545
yading@10 18546
yading@10 18547 =head3 Examples
yading@10 18548
yading@10 18549
yading@10 18550
yading@10 18551 =over 4
yading@10 18552
yading@10 18553
yading@10 18554 =item *
yading@10 18555
yading@10 18556 Draw the overlay at 10 pixels from the bottom right corner of the main
yading@10 18557 video:
yading@10 18558
yading@10 18559 overlay=main_w-overlay_w-10:main_h-overlay_h-10
yading@10 18560
yading@10 18561
yading@10 18562 Using named options the example above becomes:
yading@10 18563
yading@10 18564 overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
yading@10 18565
yading@10 18566
yading@10 18567
yading@10 18568 =item *
yading@10 18569
yading@10 18570 Insert a transparent PNG logo in the bottom left corner of the input,
yading@10 18571 using the B<ffmpeg> tool with the C<-filter_complex> option:
yading@10 18572
yading@10 18573 ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
yading@10 18574
yading@10 18575
yading@10 18576
yading@10 18577 =item *
yading@10 18578
yading@10 18579 Insert 2 different transparent PNG logos (second logo on bottom
yading@10 18580 right corner) using the B<ffmpeg> tool:
yading@10 18581
yading@10 18582 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 18583
yading@10 18584
yading@10 18585
yading@10 18586 =item *
yading@10 18587
yading@10 18588 Add a transparent color layer on top of the main video, C<WxH>
yading@10 18589 must specify the size of the main input to the overlay filter:
yading@10 18590
yading@10 18591 color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
yading@10 18592
yading@10 18593
yading@10 18594
yading@10 18595 =item *
yading@10 18596
yading@10 18597 Play an original video and a filtered version (here with the deshake
yading@10 18598 filter) side by side using the B<ffplay> tool:
yading@10 18599
yading@10 18600 ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
yading@10 18601
yading@10 18602
yading@10 18603 The above command is the same as:
yading@10 18604
yading@10 18605 ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
yading@10 18606
yading@10 18607
yading@10 18608
yading@10 18609 =item *
yading@10 18610
yading@10 18611 Make a sliding overlay appearing from the left to the right top part of the
yading@10 18612 screen starting since time 2:
yading@10 18613
yading@10 18614 overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
yading@10 18615
yading@10 18616
yading@10 18617
yading@10 18618 =item *
yading@10 18619
yading@10 18620 Compose output by putting two input videos side to side:
yading@10 18621
yading@10 18622 ffmpeg -i left.avi -i right.avi -filter_complex "
yading@10 18623 nullsrc=size=200x100 [background];
yading@10 18624 [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
yading@10 18625 [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
yading@10 18626 [background][left] overlay=shortest=1 [background+left];
yading@10 18627 [background+left][right] overlay=shortest=1:x=100 [left+right]
yading@10 18628 "
yading@10 18629
yading@10 18630
yading@10 18631
yading@10 18632 =item *
yading@10 18633
yading@10 18634 Chain several overlays in cascade:
yading@10 18635
yading@10 18636 nullsrc=s=200x200 [bg];
yading@10 18637 testsrc=s=100x100, split=4 [in0][in1][in2][in3];
yading@10 18638 [in0] lutrgb=r=0, [bg] overlay=0:0 [mid0];
yading@10 18639 [in1] lutrgb=g=0, [mid0] overlay=100:0 [mid1];
yading@10 18640 [in2] lutrgb=b=0, [mid1] overlay=0:100 [mid2];
yading@10 18641 [in3] null, [mid2] overlay=100:100 [out0]
yading@10 18642
yading@10 18643
yading@10 18644
yading@10 18645 =back
yading@10 18646
yading@10 18647
yading@10 18648
yading@10 18649 =head2 pad
yading@10 18650
yading@10 18651
yading@10 18652 Add paddings to the input image, and place the original input at the
yading@10 18653 given coordinates I<x>, I<y>.
yading@10 18654
yading@10 18655 This filter accepts the following parameters:
yading@10 18656
yading@10 18657
yading@10 18658 =over 4
yading@10 18659
yading@10 18660
yading@10 18661 =item B<width, w>
yading@10 18662
yading@10 18663
yading@10 18664 =item B<height, h>
yading@10 18665
yading@10 18666 Specify an expression for the size of the output image with the
yading@10 18667 paddings added. If the value for I<width> or I<height> is 0, the
yading@10 18668 corresponding input size is used for the output.
yading@10 18669
yading@10 18670 The I<width> expression can reference the value set by the
yading@10 18671 I<height> expression, and vice versa.
yading@10 18672
yading@10 18673 The default value of I<width> and I<height> is 0.
yading@10 18674
yading@10 18675
yading@10 18676 =item B<x>
yading@10 18677
yading@10 18678
yading@10 18679 =item B<y>
yading@10 18680
yading@10 18681 Specify an expression for the offsets where to place the input image
yading@10 18682 in the padded area with respect to the top/left border of the output
yading@10 18683 image.
yading@10 18684
yading@10 18685 The I<x> expression can reference the value set by the I<y>
yading@10 18686 expression, and vice versa.
yading@10 18687
yading@10 18688 The default value of I<x> and I<y> is 0.
yading@10 18689
yading@10 18690
yading@10 18691 =item B<color>
yading@10 18692
yading@10 18693 Specify the color of the padded area, it can be the name of a color
yading@10 18694 (case insensitive match) or a 0xRRGGBB[AA] sequence.
yading@10 18695
yading@10 18696 The default value of I<color> is "black".
yading@10 18697
yading@10 18698 =back
yading@10 18699
yading@10 18700
yading@10 18701 The value for the I<width>, I<height>, I<x>, and I<y>
yading@10 18702 options are expressions containing the following constants:
yading@10 18703
yading@10 18704
yading@10 18705 =over 4
yading@10 18706
yading@10 18707
yading@10 18708 =item B<in_w, in_h>
yading@10 18709
yading@10 18710 the input video width and height
yading@10 18711
yading@10 18712
yading@10 18713 =item B<iw, ih>
yading@10 18714
yading@10 18715 same as I<in_w> and I<in_h>
yading@10 18716
yading@10 18717
yading@10 18718 =item B<out_w, out_h>
yading@10 18719
yading@10 18720 the output width and height, that is the size of the padded area as
yading@10 18721 specified by the I<width> and I<height> expressions
yading@10 18722
yading@10 18723
yading@10 18724 =item B<ow, oh>
yading@10 18725
yading@10 18726 same as I<out_w> and I<out_h>
yading@10 18727
yading@10 18728
yading@10 18729 =item B<x, y>
yading@10 18730
yading@10 18731 x and y offsets as specified by the I<x> and I<y>
yading@10 18732 expressions, or NAN if not yet specified
yading@10 18733
yading@10 18734
yading@10 18735 =item B<a>
yading@10 18736
yading@10 18737 same as I<iw> / I<ih>
yading@10 18738
yading@10 18739
yading@10 18740 =item B<sar>
yading@10 18741
yading@10 18742 input sample aspect ratio
yading@10 18743
yading@10 18744
yading@10 18745 =item B<dar>
yading@10 18746
yading@10 18747 input display aspect ratio, it is the same as (I<iw> / I<ih>) * I<sar>
yading@10 18748
yading@10 18749
yading@10 18750 =item B<hsub, vsub>
yading@10 18751
yading@10 18752 horizontal and vertical chroma subsample values. For example for the
yading@10 18753 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 18754
yading@10 18755 =back
yading@10 18756
yading@10 18757
yading@10 18758
yading@10 18759 =head3 Examples
yading@10 18760
yading@10 18761
yading@10 18762
yading@10 18763 =over 4
yading@10 18764
yading@10 18765
yading@10 18766 =item *
yading@10 18767
yading@10 18768 Add paddings with color "violet" to the input video. Output video
yading@10 18769 size is 640x480, the top-left corner of the input video is placed at
yading@10 18770 column 0, row 40:
yading@10 18771
yading@10 18772 pad=640:480:0:40:violet
yading@10 18773
yading@10 18774
yading@10 18775 The example above is equivalent to the following command:
yading@10 18776
yading@10 18777 pad=width=640:height=480:x=0:y=40:color=violet
yading@10 18778
yading@10 18779
yading@10 18780
yading@10 18781 =item *
yading@10 18782
yading@10 18783 Pad the input to get an output with dimensions increased by 3/2,
yading@10 18784 and put the input video at the center of the padded area:
yading@10 18785
yading@10 18786 pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
yading@10 18787
yading@10 18788
yading@10 18789
yading@10 18790 =item *
yading@10 18791
yading@10 18792 Pad the input to get a squared output with size equal to the maximum
yading@10 18793 value between the input width and height, and put the input video at
yading@10 18794 the center of the padded area:
yading@10 18795
yading@10 18796 pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
yading@10 18797
yading@10 18798
yading@10 18799
yading@10 18800 =item *
yading@10 18801
yading@10 18802 Pad the input to get a final w/h ratio of 16:9:
yading@10 18803
yading@10 18804 pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
yading@10 18805
yading@10 18806
yading@10 18807
yading@10 18808 =item *
yading@10 18809
yading@10 18810 In case of anamorphic video, in order to set the output display aspect
yading@10 18811 correctly, it is necessary to use I<sar> in the expression,
yading@10 18812 according to the relation:
yading@10 18813
yading@10 18814 (ih * X / ih) * sar = output_dar
yading@10 18815 X = output_dar / sar
yading@10 18816
yading@10 18817
yading@10 18818 Thus the previous example needs to be modified to:
yading@10 18819
yading@10 18820 pad="ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2"
yading@10 18821
yading@10 18822
yading@10 18823
yading@10 18824 =item *
yading@10 18825
yading@10 18826 Double output size and put the input video in the bottom-right
yading@10 18827 corner of the output padded area:
yading@10 18828
yading@10 18829 pad="2*iw:2*ih:ow-iw:oh-ih"
yading@10 18830
yading@10 18831
yading@10 18832 =back
yading@10 18833
yading@10 18834
yading@10 18835
yading@10 18836 =head2 pixdesctest
yading@10 18837
yading@10 18838
yading@10 18839 Pixel format descriptor test filter, mainly useful for internal
yading@10 18840 testing. The output video should be equal to the input video.
yading@10 18841
yading@10 18842 For example:
yading@10 18843
yading@10 18844 format=monow, pixdesctest
yading@10 18845
yading@10 18846
yading@10 18847 can be used to test the monowhite pixel format descriptor definition.
yading@10 18848
yading@10 18849
yading@10 18850 =head2 pp
yading@10 18851
yading@10 18852
yading@10 18853 Enable the specified chain of postprocessing subfilters using libpostproc. This
yading@10 18854 library should be automatically selected with a GPL build (C<--enable-gpl>).
yading@10 18855 Subfilters must be separated by '/' and can be disabled by prepending a '-'.
yading@10 18856 Each subfilter and some options have a short and a long name that can be used
yading@10 18857 interchangeably, i.e. dr/dering are the same.
yading@10 18858
yading@10 18859 The filters accept the following options:
yading@10 18860
yading@10 18861
yading@10 18862 =over 4
yading@10 18863
yading@10 18864
yading@10 18865 =item B<subfilters>
yading@10 18866
yading@10 18867 Set postprocessing subfilters string.
yading@10 18868
yading@10 18869 =back
yading@10 18870
yading@10 18871
yading@10 18872 All subfilters share common options to determine their scope:
yading@10 18873
yading@10 18874
yading@10 18875 =over 4
yading@10 18876
yading@10 18877
yading@10 18878 =item B<a/autoq>
yading@10 18879
yading@10 18880 Honor the quality commands for this subfilter.
yading@10 18881
yading@10 18882
yading@10 18883 =item B<c/chrom>
yading@10 18884
yading@10 18885 Do chrominance filtering, too (default).
yading@10 18886
yading@10 18887
yading@10 18888 =item B<y/nochrom>
yading@10 18889
yading@10 18890 Do luminance filtering only (no chrominance).
yading@10 18891
yading@10 18892
yading@10 18893 =item B<n/noluma>
yading@10 18894
yading@10 18895 Do chrominance filtering only (no luminance).
yading@10 18896
yading@10 18897 =back
yading@10 18898
yading@10 18899
yading@10 18900 These options can be appended after the subfilter name, separated by a '|'.
yading@10 18901
yading@10 18902 Available subfilters are:
yading@10 18903
yading@10 18904
yading@10 18905 =over 4
yading@10 18906
yading@10 18907
yading@10 18908 =item B<hb/hdeblock[|difference[|flatness]]>
yading@10 18909
yading@10 18910 Horizontal deblocking filter
yading@10 18911
yading@10 18912 =over 4
yading@10 18913
yading@10 18914
yading@10 18915 =item B<difference>
yading@10 18916
yading@10 18917 Difference factor where higher values mean more deblocking (default: C<32>).
yading@10 18918
yading@10 18919 =item B<flatness>
yading@10 18920
yading@10 18921 Flatness threshold where lower values mean more deblocking (default: C<39>).
yading@10 18922
yading@10 18923 =back
yading@10 18924
yading@10 18925
yading@10 18926
yading@10 18927 =item B<vb/vdeblock[|difference[|flatness]]>
yading@10 18928
yading@10 18929 Vertical deblocking filter
yading@10 18930
yading@10 18931 =over 4
yading@10 18932
yading@10 18933
yading@10 18934 =item B<difference>
yading@10 18935
yading@10 18936 Difference factor where higher values mean more deblocking (default: C<32>).
yading@10 18937
yading@10 18938 =item B<flatness>
yading@10 18939
yading@10 18940 Flatness threshold where lower values mean more deblocking (default: C<39>).
yading@10 18941
yading@10 18942 =back
yading@10 18943
yading@10 18944
yading@10 18945
yading@10 18946 =item B<ha/hadeblock[|difference[|flatness]]>
yading@10 18947
yading@10 18948 Accurate horizontal deblocking filter
yading@10 18949
yading@10 18950 =over 4
yading@10 18951
yading@10 18952
yading@10 18953 =item B<difference>
yading@10 18954
yading@10 18955 Difference factor where higher values mean more deblocking (default: C<32>).
yading@10 18956
yading@10 18957 =item B<flatness>
yading@10 18958
yading@10 18959 Flatness threshold where lower values mean more deblocking (default: C<39>).
yading@10 18960
yading@10 18961 =back
yading@10 18962
yading@10 18963
yading@10 18964
yading@10 18965 =item B<va/vadeblock[|difference[|flatness]]>
yading@10 18966
yading@10 18967 Accurate vertical deblocking filter
yading@10 18968
yading@10 18969 =over 4
yading@10 18970
yading@10 18971
yading@10 18972 =item B<difference>
yading@10 18973
yading@10 18974 Difference factor where higher values mean more deblocking (default: C<32>).
yading@10 18975
yading@10 18976 =item B<flatness>
yading@10 18977
yading@10 18978 Flatness threshold where lower values mean more deblocking (default: C<39>).
yading@10 18979
yading@10 18980 =back
yading@10 18981
yading@10 18982
yading@10 18983 =back
yading@10 18984
yading@10 18985
yading@10 18986 The horizontal and vertical deblocking filters share the difference and
yading@10 18987 flatness values so you cannot set different horizontal and vertical
yading@10 18988 thresholds.
yading@10 18989
yading@10 18990
yading@10 18991 =over 4
yading@10 18992
yading@10 18993
yading@10 18994 =item B<h1/x1hdeblock>
yading@10 18995
yading@10 18996 Experimental horizontal deblocking filter
yading@10 18997
yading@10 18998
yading@10 18999 =item B<v1/x1vdeblock>
yading@10 19000
yading@10 19001 Experimental vertical deblocking filter
yading@10 19002
yading@10 19003
yading@10 19004 =item B<dr/dering>
yading@10 19005
yading@10 19006 Deringing filter
yading@10 19007
yading@10 19008
yading@10 19009 =item B<tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer>
yading@10 19010
yading@10 19011
yading@10 19012 =over 4
yading@10 19013
yading@10 19014
yading@10 19015 =item B<threshold1>
yading@10 19016
yading@10 19017 larger -E<gt> stronger filtering
yading@10 19018
yading@10 19019 =item B<threshold2>
yading@10 19020
yading@10 19021 larger -E<gt> stronger filtering
yading@10 19022
yading@10 19023 =item B<threshold3>
yading@10 19024
yading@10 19025 larger -E<gt> stronger filtering
yading@10 19026
yading@10 19027 =back
yading@10 19028
yading@10 19029
yading@10 19030
yading@10 19031 =item B<al/autolevels[:f/fullyrange], automatic brightness / contrast correction>
yading@10 19032
yading@10 19033
yading@10 19034 =over 4
yading@10 19035
yading@10 19036
yading@10 19037 =item B<f/fullyrange>
yading@10 19038
yading@10 19039 Stretch luminance to C<0-255>.
yading@10 19040
yading@10 19041 =back
yading@10 19042
yading@10 19043
yading@10 19044
yading@10 19045 =item B<lb/linblenddeint>
yading@10 19046
yading@10 19047 Linear blend deinterlacing filter that deinterlaces the given block by
yading@10 19048 filtering all lines with a C<(1 2 1)> filter.
yading@10 19049
yading@10 19050
yading@10 19051 =item B<li/linipoldeint>
yading@10 19052
yading@10 19053 Linear interpolating deinterlacing filter that deinterlaces the given block by
yading@10 19054 linearly interpolating every second line.
yading@10 19055
yading@10 19056
yading@10 19057 =item B<ci/cubicipoldeint>
yading@10 19058
yading@10 19059 Cubic interpolating deinterlacing filter deinterlaces the given block by
yading@10 19060 cubically interpolating every second line.
yading@10 19061
yading@10 19062
yading@10 19063 =item B<md/mediandeint>
yading@10 19064
yading@10 19065 Median deinterlacing filter that deinterlaces the given block by applying a
yading@10 19066 median filter to every second line.
yading@10 19067
yading@10 19068
yading@10 19069 =item B<fd/ffmpegdeint>
yading@10 19070
yading@10 19071 FFmpeg deinterlacing filter that deinterlaces the given block by filtering every
yading@10 19072 second line with a C<(-1 4 2 4 -1)> filter.
yading@10 19073
yading@10 19074
yading@10 19075 =item B<l5/lowpass5>
yading@10 19076
yading@10 19077 Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given
yading@10 19078 block by filtering all lines with a C<(-1 2 6 2 -1)> filter.
yading@10 19079
yading@10 19080
yading@10 19081 =item B<fq/forceQuant[|quantizer]>
yading@10 19082
yading@10 19083 Overrides the quantizer table from the input with the constant quantizer you
yading@10 19084 specify.
yading@10 19085
yading@10 19086 =over 4
yading@10 19087
yading@10 19088
yading@10 19089 =item B<quantizer>
yading@10 19090
yading@10 19091 Quantizer to use
yading@10 19092
yading@10 19093 =back
yading@10 19094
yading@10 19095
yading@10 19096
yading@10 19097 =item B<de/default>
yading@10 19098
yading@10 19099 Default pp filter combination (C<hb|a,vb|a,dr|a>)
yading@10 19100
yading@10 19101
yading@10 19102 =item B<fa/fast>
yading@10 19103
yading@10 19104 Fast pp filter combination (C<h1|a,v1|a,dr|a>)
yading@10 19105
yading@10 19106
yading@10 19107 =item B<ac>
yading@10 19108
yading@10 19109 High quality pp filter combination (C<ha|a|128|7,va|a,dr|a>)
yading@10 19110
yading@10 19111 =back
yading@10 19112
yading@10 19113
yading@10 19114
yading@10 19115 =head3 Examples
yading@10 19116
yading@10 19117
yading@10 19118
yading@10 19119 =over 4
yading@10 19120
yading@10 19121
yading@10 19122 =item *
yading@10 19123
yading@10 19124 Apply horizontal and vertical deblocking, deringing and automatic
yading@10 19125 brightness/contrast:
yading@10 19126
yading@10 19127 pp=hb/vb/dr/al
yading@10 19128
yading@10 19129
yading@10 19130
yading@10 19131 =item *
yading@10 19132
yading@10 19133 Apply default filters without brightness/contrast correction:
yading@10 19134
yading@10 19135 pp=de/-al
yading@10 19136
yading@10 19137
yading@10 19138
yading@10 19139 =item *
yading@10 19140
yading@10 19141 Apply default filters and temporal denoiser:
yading@10 19142
yading@10 19143 pp=default/tmpnoise|1|2|3
yading@10 19144
yading@10 19145
yading@10 19146
yading@10 19147 =item *
yading@10 19148
yading@10 19149 Apply deblocking on luminance only, and switch vertical deblocking on or off
yading@10 19150 automatically depending on available CPU time:
yading@10 19151
yading@10 19152 pp=hb|y/vb|a
yading@10 19153
yading@10 19154
yading@10 19155 =back
yading@10 19156
yading@10 19157
yading@10 19158
yading@10 19159 =head2 removelogo
yading@10 19160
yading@10 19161
yading@10 19162 Suppress a TV station logo, using an image file to determine which
yading@10 19163 pixels comprise the logo. It works by filling in the pixels that
yading@10 19164 comprise the logo with neighboring pixels.
yading@10 19165
yading@10 19166 The filters accept the following options:
yading@10 19167
yading@10 19168
yading@10 19169 =over 4
yading@10 19170
yading@10 19171
yading@10 19172 =item B<filename, f>
yading@10 19173
yading@10 19174 Set the filter bitmap file, which can be any image format supported by
yading@10 19175 libavformat. The width and height of the image file must match those of the
yading@10 19176 video stream being processed.
yading@10 19177
yading@10 19178 =back
yading@10 19179
yading@10 19180
yading@10 19181 Pixels in the provided bitmap image with a value of zero are not
yading@10 19182 considered part of the logo, non-zero pixels are considered part of
yading@10 19183 the logo. If you use white (255) for the logo and black (0) for the
yading@10 19184 rest, you will be safe. For making the filter bitmap, it is
yading@10 19185 recommended to take a screen capture of a black frame with the logo
yading@10 19186 visible, and then using a threshold filter followed by the erode
yading@10 19187 filter once or twice.
yading@10 19188
yading@10 19189 If needed, little splotches can be fixed manually. Remember that if
yading@10 19190 logo pixels are not covered, the filter quality will be much
yading@10 19191 reduced. Marking too many pixels as part of the logo does not hurt as
yading@10 19192 much, but it will increase the amount of blurring needed to cover over
yading@10 19193 the image and will destroy more information than necessary, and extra
yading@10 19194 pixels will slow things down on a large logo.
yading@10 19195
yading@10 19196
yading@10 19197 =head2 scale
yading@10 19198
yading@10 19199
yading@10 19200 Scale (resize) the input video, using the libswscale library.
yading@10 19201
yading@10 19202 The scale filter forces the output display aspect ratio to be the same
yading@10 19203 of the input, by changing the output sample aspect ratio.
yading@10 19204
yading@10 19205 The filter accepts the following options:
yading@10 19206
yading@10 19207
yading@10 19208 =over 4
yading@10 19209
yading@10 19210
yading@10 19211 =item B<width, w>
yading@10 19212
yading@10 19213 Output video width.
yading@10 19214 default value is C<iw>. See below
yading@10 19215 for the list of accepted constants.
yading@10 19216
yading@10 19217
yading@10 19218 =item B<height, h>
yading@10 19219
yading@10 19220 Output video height.
yading@10 19221 default value is C<ih>.
yading@10 19222 See below for the list of accepted constants.
yading@10 19223
yading@10 19224
yading@10 19225 =item B<interl>
yading@10 19226
yading@10 19227 Set the interlacing. It accepts the following values:
yading@10 19228
yading@10 19229
yading@10 19230 =over 4
yading@10 19231
yading@10 19232
yading@10 19233 =item B<1>
yading@10 19234
yading@10 19235 force interlaced aware scaling
yading@10 19236
yading@10 19237
yading@10 19238 =item B<0>
yading@10 19239
yading@10 19240 do not apply interlaced scaling
yading@10 19241
yading@10 19242
yading@10 19243 =item B<-1>
yading@10 19244
yading@10 19245 select interlaced aware scaling depending on whether the source frames
yading@10 19246 are flagged as interlaced or not
yading@10 19247
yading@10 19248 =back
yading@10 19249
yading@10 19250
yading@10 19251 Default value is C<0>.
yading@10 19252
yading@10 19253
yading@10 19254 =item B<flags>
yading@10 19255
yading@10 19256 Set libswscale scaling flags. If not explictly specified the filter
yading@10 19257 applies a bilinear scaling algorithm.
yading@10 19258
yading@10 19259
yading@10 19260 =item B<size, s>
yading@10 19261
yading@10 19262 Set the video size, the value must be a valid abbreviation or in the
yading@10 19263 form I<width>xI<height>.
yading@10 19264
yading@10 19265 =back
yading@10 19266
yading@10 19267
yading@10 19268 The values of the I<w> and I<h> options are expressions
yading@10 19269 containing the following constants:
yading@10 19270
yading@10 19271
yading@10 19272 =over 4
yading@10 19273
yading@10 19274
yading@10 19275 =item B<in_w, in_h>
yading@10 19276
yading@10 19277 the input width and height
yading@10 19278
yading@10 19279
yading@10 19280 =item B<iw, ih>
yading@10 19281
yading@10 19282 same as I<in_w> and I<in_h>
yading@10 19283
yading@10 19284
yading@10 19285 =item B<out_w, out_h>
yading@10 19286
yading@10 19287 the output (cropped) width and height
yading@10 19288
yading@10 19289
yading@10 19290 =item B<ow, oh>
yading@10 19291
yading@10 19292 same as I<out_w> and I<out_h>
yading@10 19293
yading@10 19294
yading@10 19295 =item B<a>
yading@10 19296
yading@10 19297 same as I<iw> / I<ih>
yading@10 19298
yading@10 19299
yading@10 19300 =item B<sar>
yading@10 19301
yading@10 19302 input sample aspect ratio
yading@10 19303
yading@10 19304
yading@10 19305 =item B<dar>
yading@10 19306
yading@10 19307 input display aspect ratio, it is the same as (I<iw> / I<ih>) * I<sar>
yading@10 19308
yading@10 19309
yading@10 19310 =item B<hsub, vsub>
yading@10 19311
yading@10 19312 horizontal and vertical chroma subsample values. For example for the
yading@10 19313 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 19314
yading@10 19315 =back
yading@10 19316
yading@10 19317
yading@10 19318 If the input image format is different from the format requested by
yading@10 19319 the next filter, the scale filter will convert the input to the
yading@10 19320 requested format.
yading@10 19321
yading@10 19322 If the value for I<w> or I<h> is 0, the respective input
yading@10 19323 size is used for the output.
yading@10 19324
yading@10 19325 If the value for I<w> or I<h> is -1, the scale filter will use, for the
yading@10 19326 respective output size, a value that maintains the aspect ratio of the input
yading@10 19327 image.
yading@10 19328
yading@10 19329
yading@10 19330 =head3 Examples
yading@10 19331
yading@10 19332
yading@10 19333
yading@10 19334 =over 4
yading@10 19335
yading@10 19336
yading@10 19337 =item *
yading@10 19338
yading@10 19339 Scale the input video to a size of 200x100:
yading@10 19340
yading@10 19341 scale=w=200:h=100
yading@10 19342
yading@10 19343
yading@10 19344 This is equivalent to:
yading@10 19345
yading@10 19346 scale=w=200:h=100
yading@10 19347
yading@10 19348
yading@10 19349 or:
yading@10 19350
yading@10 19351 scale=200x100
yading@10 19352
yading@10 19353
yading@10 19354
yading@10 19355 =item *
yading@10 19356
yading@10 19357 Specify a size abbreviation for the output size:
yading@10 19358
yading@10 19359 scale=qcif
yading@10 19360
yading@10 19361
yading@10 19362 which can also be written as:
yading@10 19363
yading@10 19364 scale=size=qcif
yading@10 19365
yading@10 19366
yading@10 19367
yading@10 19368 =item *
yading@10 19369
yading@10 19370 Scale the input to 2x:
yading@10 19371
yading@10 19372 scale=w=2*iw:h=2*ih
yading@10 19373
yading@10 19374
yading@10 19375
yading@10 19376 =item *
yading@10 19377
yading@10 19378 The above is the same as:
yading@10 19379
yading@10 19380 scale=2*in_w:2*in_h
yading@10 19381
yading@10 19382
yading@10 19383
yading@10 19384 =item *
yading@10 19385
yading@10 19386 Scale the input to 2x with forced interlaced scaling:
yading@10 19387
yading@10 19388 scale=2*iw:2*ih:interl=1
yading@10 19389
yading@10 19390
yading@10 19391
yading@10 19392 =item *
yading@10 19393
yading@10 19394 Scale the input to half size:
yading@10 19395
yading@10 19396 scale=w=iw/2:h=ih/2
yading@10 19397
yading@10 19398
yading@10 19399
yading@10 19400 =item *
yading@10 19401
yading@10 19402 Increase the width, and set the height to the same size:
yading@10 19403
yading@10 19404 scale=3/2*iw:ow
yading@10 19405
yading@10 19406
yading@10 19407
yading@10 19408 =item *
yading@10 19409
yading@10 19410 Seek for Greek harmony:
yading@10 19411
yading@10 19412 scale=iw:1/PHI*iw
yading@10 19413 scale=ih*PHI:ih
yading@10 19414
yading@10 19415
yading@10 19416
yading@10 19417 =item *
yading@10 19418
yading@10 19419 Increase the height, and set the width to 3/2 of the height:
yading@10 19420
yading@10 19421 scale=w=3/2*oh:h=3/5*ih
yading@10 19422
yading@10 19423
yading@10 19424
yading@10 19425 =item *
yading@10 19426
yading@10 19427 Increase the size, but make the size a multiple of the chroma
yading@10 19428 subsample values:
yading@10 19429
yading@10 19430 scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
yading@10 19431
yading@10 19432
yading@10 19433
yading@10 19434 =item *
yading@10 19435
yading@10 19436 Increase the width to a maximum of 500 pixels, keep the same input
yading@10 19437 aspect ratio:
yading@10 19438
yading@10 19439 scale=w='min(500\, iw*3/2):h=-1'
yading@10 19440
yading@10 19441
yading@10 19442 =back
yading@10 19443
yading@10 19444
yading@10 19445
yading@10 19446 =head2 separatefields
yading@10 19447
yading@10 19448
yading@10 19449 The C<separatefields> takes a frame-based video input and splits
yading@10 19450 each frame into its components fields, producing a new half height clip
yading@10 19451 with twice the frame rate and twice the frame count.
yading@10 19452
yading@10 19453 This filter use field-dominance information in frame to decide which
yading@10 19454 of each pair of fields to place first in the output.
yading@10 19455 If it gets it wrong use setfield filter before C<separatefields> filter.
yading@10 19456
yading@10 19457
yading@10 19458 =head2 setdar, setsar
yading@10 19459
yading@10 19460
yading@10 19461 The C<setdar> filter sets the Display Aspect Ratio for the filter
yading@10 19462 output video.
yading@10 19463
yading@10 19464 This is done by changing the specified Sample (aka Pixel) Aspect
yading@10 19465 Ratio, according to the following equation:
yading@10 19466
yading@10 19467 <DAR> = <HORIZONTAL_RESOLUTION> / <VERTICAL_RESOLUTION> * <SAR>
yading@10 19468
yading@10 19469
yading@10 19470 Keep in mind that the C<setdar> filter does not modify the pixel
yading@10 19471 dimensions of the video frame. Also the display aspect ratio set by
yading@10 19472 this filter may be changed by later filters in the filterchain,
yading@10 19473 e.g. in case of scaling or if another "setdar" or a "setsar" filter is
yading@10 19474 applied.
yading@10 19475
yading@10 19476 The C<setsar> filter sets the Sample (aka Pixel) Aspect Ratio for
yading@10 19477 the filter output video.
yading@10 19478
yading@10 19479 Note that as a consequence of the application of this filter, the
yading@10 19480 output display aspect ratio will change according to the equation
yading@10 19481 above.
yading@10 19482
yading@10 19483 Keep in mind that the sample aspect ratio set by the C<setsar>
yading@10 19484 filter may be changed by later filters in the filterchain, e.g. if
yading@10 19485 another "setsar" or a "setdar" filter is applied.
yading@10 19486
yading@10 19487 The filters accept the following options:
yading@10 19488
yading@10 19489
yading@10 19490 =over 4
yading@10 19491
yading@10 19492
yading@10 19493 =item B<r, ratio, dar (C<setdar> only), sar (C<setsar> only)>
yading@10 19494
yading@10 19495 Set the aspect ratio used by the filter.
yading@10 19496
yading@10 19497 The parameter can be a floating point number string, an expression, or
yading@10 19498 a string of the form I<num>:I<den>, where I<num> and
yading@10 19499 I<den> are the numerator and denominator of the aspect ratio. If
yading@10 19500 the parameter is not specified, it is assumed the value "0".
yading@10 19501 In case the form "I<num>:I<den>" is used, the C<:> character
yading@10 19502 should be escaped.
yading@10 19503
yading@10 19504
yading@10 19505 =item B<max>
yading@10 19506
yading@10 19507 Set the maximum integer value to use for expressing numerator and
yading@10 19508 denominator when reducing the expressed aspect ratio to a rational.
yading@10 19509 Default value is C<100>.
yading@10 19510
yading@10 19511
yading@10 19512 =back
yading@10 19513
yading@10 19514
yading@10 19515
yading@10 19516 =head3 Examples
yading@10 19517
yading@10 19518
yading@10 19519
yading@10 19520 =over 4
yading@10 19521
yading@10 19522
yading@10 19523
yading@10 19524 =item *
yading@10 19525
yading@10 19526 To change the display aspect ratio to 16:9, specify one of the following:
yading@10 19527
yading@10 19528 setdar=dar=1.77777
yading@10 19529 setdar=dar=16/9
yading@10 19530 setdar=dar=1.77777
yading@10 19531
yading@10 19532
yading@10 19533
yading@10 19534 =item *
yading@10 19535
yading@10 19536 To change the sample aspect ratio to 10:11, specify:
yading@10 19537
yading@10 19538 setsar=sar=10/11
yading@10 19539
yading@10 19540
yading@10 19541
yading@10 19542 =item *
yading@10 19543
yading@10 19544 To set a display aspect ratio of 16:9, and specify a maximum integer value of
yading@10 19545 1000 in the aspect ratio reduction, use the command:
yading@10 19546
yading@10 19547 setdar=ratio=16/9:max=1000
yading@10 19548
yading@10 19549
yading@10 19550
yading@10 19551 =back
yading@10 19552
yading@10 19553
yading@10 19554
yading@10 19555
yading@10 19556 =head2 setfield
yading@10 19557
yading@10 19558
yading@10 19559 Force field for the output video frame.
yading@10 19560
yading@10 19561 The C<setfield> filter marks the interlace type field for the
yading@10 19562 output frames. It does not change the input frame, but only sets the
yading@10 19563 corresponding property, which affects how the frame is treated by
yading@10 19564 following filters (e.g. C<fieldorder> or C<yadif>).
yading@10 19565
yading@10 19566 The filter accepts the following options:
yading@10 19567
yading@10 19568
yading@10 19569 =over 4
yading@10 19570
yading@10 19571
yading@10 19572
yading@10 19573 =item B<mode>
yading@10 19574
yading@10 19575 Available values are:
yading@10 19576
yading@10 19577
yading@10 19578 =over 4
yading@10 19579
yading@10 19580
yading@10 19581 =item B<auto>
yading@10 19582
yading@10 19583 Keep the same field property.
yading@10 19584
yading@10 19585
yading@10 19586 =item B<bff>
yading@10 19587
yading@10 19588 Mark the frame as bottom-field-first.
yading@10 19589
yading@10 19590
yading@10 19591 =item B<tff>
yading@10 19592
yading@10 19593 Mark the frame as top-field-first.
yading@10 19594
yading@10 19595
yading@10 19596 =item B<prog>
yading@10 19597
yading@10 19598 Mark the frame as progressive.
yading@10 19599
yading@10 19600 =back
yading@10 19601
yading@10 19602
yading@10 19603 =back
yading@10 19604
yading@10 19605
yading@10 19606
yading@10 19607 =head2 showinfo
yading@10 19608
yading@10 19609
yading@10 19610 Show a line containing various information for each input video frame.
yading@10 19611 The input video is not modified.
yading@10 19612
yading@10 19613 The shown line contains a sequence of key/value pairs of the form
yading@10 19614 I<key>:I<value>.
yading@10 19615
yading@10 19616 A description of each shown parameter follows:
yading@10 19617
yading@10 19618
yading@10 19619 =over 4
yading@10 19620
yading@10 19621
yading@10 19622 =item B<n>
yading@10 19623
yading@10 19624 sequential number of the input frame, starting from 0
yading@10 19625
yading@10 19626
yading@10 19627 =item B<pts>
yading@10 19628
yading@10 19629 Presentation TimeStamp of the input frame, expressed as a number of
yading@10 19630 time base units. The time base unit depends on the filter input pad.
yading@10 19631
yading@10 19632
yading@10 19633 =item B<pts_time>
yading@10 19634
yading@10 19635 Presentation TimeStamp of the input frame, expressed as a number of
yading@10 19636 seconds
yading@10 19637
yading@10 19638
yading@10 19639 =item B<pos>
yading@10 19640
yading@10 19641 position of the frame in the input stream, -1 if this information in
yading@10 19642 unavailable and/or meaningless (for example in case of synthetic video)
yading@10 19643
yading@10 19644
yading@10 19645 =item B<fmt>
yading@10 19646
yading@10 19647 pixel format name
yading@10 19648
yading@10 19649
yading@10 19650 =item B<sar>
yading@10 19651
yading@10 19652 sample aspect ratio of the input frame, expressed in the form
yading@10 19653 I<num>/I<den>
yading@10 19654
yading@10 19655
yading@10 19656 =item B<s>
yading@10 19657
yading@10 19658 size of the input frame, expressed in the form
yading@10 19659 I<width>xI<height>
yading@10 19660
yading@10 19661
yading@10 19662 =item B<i>
yading@10 19663
yading@10 19664 interlaced mode ("P" for "progressive", "T" for top field first, "B"
yading@10 19665 for bottom field first)
yading@10 19666
yading@10 19667
yading@10 19668 =item B<iskey>
yading@10 19669
yading@10 19670 1 if the frame is a key frame, 0 otherwise
yading@10 19671
yading@10 19672
yading@10 19673 =item B<type>
yading@10 19674
yading@10 19675 picture type of the input frame ("I" for an I-frame, "P" for a
yading@10 19676 P-frame, "B" for a B-frame, "?" for unknown type).
yading@10 19677 Check also the documentation of the C<AVPictureType> enum and of
yading@10 19678 the C<av_get_picture_type_char> function defined in
yading@10 19679 F<libavutil/avutil.h>.
yading@10 19680
yading@10 19681
yading@10 19682 =item B<checksum>
yading@10 19683
yading@10 19684 Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame
yading@10 19685
yading@10 19686
yading@10 19687 =item B<plane_checksum>
yading@10 19688
yading@10 19689 Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
yading@10 19690 expressed in the form "[I<c0> I<c1> I<c2> I<c3>]"
yading@10 19691
yading@10 19692 =back
yading@10 19693
yading@10 19694
yading@10 19695
yading@10 19696 =head2 smartblur
yading@10 19697
yading@10 19698
yading@10 19699 Blur the input video without impacting the outlines.
yading@10 19700
yading@10 19701 The filter accepts the following options:
yading@10 19702
yading@10 19703
yading@10 19704 =over 4
yading@10 19705
yading@10 19706
yading@10 19707 =item B<luma_radius, lr>
yading@10 19708
yading@10 19709 Set the luma radius. The option value must be a float number in
yading@10 19710 the range [0.1,5.0] that specifies the variance of the gaussian filter
yading@10 19711 used to blur the image (slower if larger). Default value is 1.0.
yading@10 19712
yading@10 19713
yading@10 19714 =item B<luma_strength, ls>
yading@10 19715
yading@10 19716 Set the luma strength. The option value must be a float number
yading@10 19717 in the range [-1.0,1.0] that configures the blurring. A value included
yading@10 19718 in [0.0,1.0] will blur the image whereas a value included in
yading@10 19719 [-1.0,0.0] will sharpen the image. Default value is 1.0.
yading@10 19720
yading@10 19721
yading@10 19722 =item B<luma_threshold, lt>
yading@10 19723
yading@10 19724 Set the luma threshold used as a coefficient to determine
yading@10 19725 whether a pixel should be blurred or not. The option value must be an
yading@10 19726 integer in the range [-30,30]. A value of 0 will filter all the image,
yading@10 19727 a value included in [0,30] will filter flat areas and a value included
yading@10 19728 in [-30,0] will filter edges. Default value is 0.
yading@10 19729
yading@10 19730
yading@10 19731 =item B<chroma_radius, cr>
yading@10 19732
yading@10 19733 Set the chroma radius. The option value must be a float number in
yading@10 19734 the range [0.1,5.0] that specifies the variance of the gaussian filter
yading@10 19735 used to blur the image (slower if larger). Default value is 1.0.
yading@10 19736
yading@10 19737
yading@10 19738 =item B<chroma_strength, cs>
yading@10 19739
yading@10 19740 Set the chroma strength. The option value must be a float number
yading@10 19741 in the range [-1.0,1.0] that configures the blurring. A value included
yading@10 19742 in [0.0,1.0] will blur the image whereas a value included in
yading@10 19743 [-1.0,0.0] will sharpen the image. Default value is 1.0.
yading@10 19744
yading@10 19745
yading@10 19746 =item B<chroma_threshold, ct>
yading@10 19747
yading@10 19748 Set the chroma threshold used as a coefficient to determine
yading@10 19749 whether a pixel should be blurred or not. The option value must be an
yading@10 19750 integer in the range [-30,30]. A value of 0 will filter all the image,
yading@10 19751 a value included in [0,30] will filter flat areas and a value included
yading@10 19752 in [-30,0] will filter edges. Default value is 0.
yading@10 19753
yading@10 19754 =back
yading@10 19755
yading@10 19756
yading@10 19757 If a chroma option is not explicitly set, the corresponding luma value
yading@10 19758 is set.
yading@10 19759
yading@10 19760
yading@10 19761 =head2 stereo3d
yading@10 19762
yading@10 19763
yading@10 19764 Convert between different stereoscopic image formats.
yading@10 19765
yading@10 19766 The filters accept the following options:
yading@10 19767
yading@10 19768
yading@10 19769 =over 4
yading@10 19770
yading@10 19771
yading@10 19772 =item B<in>
yading@10 19773
yading@10 19774 Set stereoscopic image format of input.
yading@10 19775
yading@10 19776 Available values for input image formats are:
yading@10 19777
yading@10 19778 =over 4
yading@10 19779
yading@10 19780
yading@10 19781 =item B<sbsl>
yading@10 19782
yading@10 19783 side by side parallel (left eye left, right eye right)
yading@10 19784
yading@10 19785
yading@10 19786 =item B<sbsr>
yading@10 19787
yading@10 19788 side by side crosseye (right eye left, left eye right)
yading@10 19789
yading@10 19790
yading@10 19791 =item B<sbs2l>
yading@10 19792
yading@10 19793 side by side parallel with half width resolution
yading@10 19794 (left eye left, right eye right)
yading@10 19795
yading@10 19796
yading@10 19797 =item B<sbs2r>
yading@10 19798
yading@10 19799 side by side crosseye with half width resolution
yading@10 19800 (right eye left, left eye right)
yading@10 19801
yading@10 19802
yading@10 19803 =item B<abl>
yading@10 19804
yading@10 19805 above-below (left eye above, right eye below)
yading@10 19806
yading@10 19807
yading@10 19808 =item B<abr>
yading@10 19809
yading@10 19810 above-below (right eye above, left eye below)
yading@10 19811
yading@10 19812
yading@10 19813 =item B<ab2l>
yading@10 19814
yading@10 19815 above-below with half height resolution
yading@10 19816 (left eye above, right eye below)
yading@10 19817
yading@10 19818
yading@10 19819 =item B<ab2r>
yading@10 19820
yading@10 19821 above-below with half height resolution
yading@10 19822 (right eye above, left eye below)
yading@10 19823
yading@10 19824 Default value is B<sbsl>.
yading@10 19825
yading@10 19826 =back
yading@10 19827
yading@10 19828
yading@10 19829
yading@10 19830 =item B<out>
yading@10 19831
yading@10 19832 Set stereoscopic image format of output.
yading@10 19833
yading@10 19834 Available values for output image formats are all the input formats as well as:
yading@10 19835
yading@10 19836 =over 4
yading@10 19837
yading@10 19838
yading@10 19839 =item B<arbg>
yading@10 19840
yading@10 19841 anaglyph red/blue gray
yading@10 19842 (red filter on left eye, blue filter on right eye)
yading@10 19843
yading@10 19844
yading@10 19845 =item B<argg>
yading@10 19846
yading@10 19847 anaglyph red/green gray
yading@10 19848 (red filter on left eye, green filter on right eye)
yading@10 19849
yading@10 19850
yading@10 19851 =item B<arcg>
yading@10 19852
yading@10 19853 anaglyph red/cyan gray
yading@10 19854 (red filter on left eye, cyan filter on right eye)
yading@10 19855
yading@10 19856
yading@10 19857 =item B<arch>
yading@10 19858
yading@10 19859 anaglyph red/cyan half colored
yading@10 19860 (red filter on left eye, cyan filter on right eye)
yading@10 19861
yading@10 19862
yading@10 19863 =item B<arcc>
yading@10 19864
yading@10 19865 anaglyph red/cyan color
yading@10 19866 (red filter on left eye, cyan filter on right eye)
yading@10 19867
yading@10 19868
yading@10 19869 =item B<arcd>
yading@10 19870
yading@10 19871 anaglyph red/cyan color optimized with the least squares projection of dubois
yading@10 19872 (red filter on left eye, cyan filter on right eye)
yading@10 19873
yading@10 19874
yading@10 19875 =item B<agmg>
yading@10 19876
yading@10 19877 anaglyph green/magenta gray
yading@10 19878 (green filter on left eye, magenta filter on right eye)
yading@10 19879
yading@10 19880
yading@10 19881 =item B<agmh>
yading@10 19882
yading@10 19883 anaglyph green/magenta half colored
yading@10 19884 (green filter on left eye, magenta filter on right eye)
yading@10 19885
yading@10 19886
yading@10 19887 =item B<agmc>
yading@10 19888
yading@10 19889 anaglyph green/magenta colored
yading@10 19890 (green filter on left eye, magenta filter on right eye)
yading@10 19891
yading@10 19892
yading@10 19893 =item B<agmd>
yading@10 19894
yading@10 19895 anaglyph green/magenta color optimized with the least squares projection of dubois
yading@10 19896 (green filter on left eye, magenta filter on right eye)
yading@10 19897
yading@10 19898
yading@10 19899 =item B<aybg>
yading@10 19900
yading@10 19901 anaglyph yellow/blue gray
yading@10 19902 (yellow filter on left eye, blue filter on right eye)
yading@10 19903
yading@10 19904
yading@10 19905 =item B<aybh>
yading@10 19906
yading@10 19907 anaglyph yellow/blue half colored
yading@10 19908 (yellow filter on left eye, blue filter on right eye)
yading@10 19909
yading@10 19910
yading@10 19911 =item B<aybc>
yading@10 19912
yading@10 19913 anaglyph yellow/blue colored
yading@10 19914 (yellow filter on left eye, blue filter on right eye)
yading@10 19915
yading@10 19916
yading@10 19917 =item B<aybd>
yading@10 19918
yading@10 19919 anaglyph yellow/blue color optimized with the least squares projection of dubois
yading@10 19920 (yellow filter on left eye, blue filter on right eye)
yading@10 19921
yading@10 19922
yading@10 19923 =item B<irl>
yading@10 19924
yading@10 19925 interleaved rows (left eye has top row, right eye starts on next row)
yading@10 19926
yading@10 19927
yading@10 19928 =item B<irr>
yading@10 19929
yading@10 19930 interleaved rows (right eye has top row, left eye starts on next row)
yading@10 19931
yading@10 19932
yading@10 19933 =item B<ml>
yading@10 19934
yading@10 19935 mono output (left eye only)
yading@10 19936
yading@10 19937
yading@10 19938 =item B<mr>
yading@10 19939
yading@10 19940 mono output (right eye only)
yading@10 19941
yading@10 19942 =back
yading@10 19943
yading@10 19944
yading@10 19945 Default value is B<arcd>.
yading@10 19946
yading@10 19947 =back
yading@10 19948
yading@10 19949
yading@10 19950
yading@10 19951
yading@10 19952 =head2 subtitles
yading@10 19953
yading@10 19954
yading@10 19955 Draw subtitles on top of input video using the libass library.
yading@10 19956
yading@10 19957 To enable compilation of this filter you need to configure FFmpeg with
yading@10 19958 C<--enable-libass>. This filter also requires a build with libavcodec and
yading@10 19959 libavformat to convert the passed subtitles file to ASS (Advanced Substation
yading@10 19960 Alpha) subtitles format.
yading@10 19961
yading@10 19962 The filter accepts the following options:
yading@10 19963
yading@10 19964
yading@10 19965 =over 4
yading@10 19966
yading@10 19967
yading@10 19968 =item B<filename, f>
yading@10 19969
yading@10 19970 Set the filename of the subtitle file to read. It must be specified.
yading@10 19971
yading@10 19972
yading@10 19973 =item B<original_size>
yading@10 19974
yading@10 19975 Specify the size of the original video, the video for which the ASS file
yading@10 19976 was composed. Due to a misdesign in ASS aspect ratio arithmetic, this is
yading@10 19977 necessary to correctly scale the fonts if the aspect ratio has been changed.
yading@10 19978
yading@10 19979
yading@10 19980 =item B<charenc>
yading@10 19981
yading@10 19982 Set subtitles input character encoding. C<subtitles> filter only. Only
yading@10 19983 useful if not UTF-8.
yading@10 19984
yading@10 19985 =back
yading@10 19986
yading@10 19987
yading@10 19988 If the first key is not specified, it is assumed that the first value
yading@10 19989 specifies the B<filename>.
yading@10 19990
yading@10 19991 For example, to render the file F<sub.srt> on top of the input
yading@10 19992 video, use the command:
yading@10 19993
yading@10 19994 subtitles=sub.srt
yading@10 19995
yading@10 19996
yading@10 19997 which is equivalent to:
yading@10 19998
yading@10 19999 subtitles=filename=sub.srt
yading@10 20000
yading@10 20001
yading@10 20002
yading@10 20003 =head2 super2xsai
yading@10 20004
yading@10 20005
yading@10 20006 Scale the input by 2x and smooth using the Super2xSaI (Scale and
yading@10 20007 Interpolate) pixel art scaling algorithm.
yading@10 20008
yading@10 20009 Useful for enlarging pixel art images without reducing sharpness.
yading@10 20010
yading@10 20011
yading@10 20012 =head2 swapuv
yading@10 20013
yading@10 20014 Swap U & V plane.
yading@10 20015
yading@10 20016
yading@10 20017 =head2 telecine
yading@10 20018
yading@10 20019
yading@10 20020 Apply telecine process to the video.
yading@10 20021
yading@10 20022 This filter accepts the following options:
yading@10 20023
yading@10 20024
yading@10 20025 =over 4
yading@10 20026
yading@10 20027
yading@10 20028 =item B<first_field>
yading@10 20029
yading@10 20030
yading@10 20031 =over 4
yading@10 20032
yading@10 20033
yading@10 20034 =item B<top, t>
yading@10 20035
yading@10 20036 top field first
yading@10 20037
yading@10 20038 =item B<bottom, b>
yading@10 20039
yading@10 20040 bottom field first
yading@10 20041 The default value is C<top>.
yading@10 20042
yading@10 20043 =back
yading@10 20044
yading@10 20045
yading@10 20046
yading@10 20047 =item B<pattern>
yading@10 20048
yading@10 20049 A string of numbers representing the pulldown pattern you wish to apply.
yading@10 20050 The default value is C<23>.
yading@10 20051
yading@10 20052 =back
yading@10 20053
yading@10 20054
yading@10 20055
yading@10 20056 Some typical patterns:
yading@10 20057
yading@10 20058 NTSC output (30i):
yading@10 20059 27.5p: 32222
yading@10 20060 24p: 23 (classic)
yading@10 20061 24p: 2332 (preferred)
yading@10 20062 20p: 33
yading@10 20063 18p: 334
yading@10 20064 16p: 3444
yading@10 20065
yading@10 20066 PAL output (25i):
yading@10 20067 27.5p: 12222
yading@10 20068 24p: 222222222223 ("Euro pulldown")
yading@10 20069 16.67p: 33
yading@10 20070 16p: 33333334
yading@10 20071
yading@10 20072
yading@10 20073
yading@10 20074 =head2 thumbnail
yading@10 20075
yading@10 20076 Select the most representative frame in a given sequence of consecutive frames.
yading@10 20077
yading@10 20078 The filter accepts the following options:
yading@10 20079
yading@10 20080
yading@10 20081 =over 4
yading@10 20082
yading@10 20083
yading@10 20084 =item B<n>
yading@10 20085
yading@10 20086 Set the frames batch size to analyze; in a set of I<n> frames, the filter
yading@10 20087 will pick one of them, and then handle the next batch of I<n> frames until
yading@10 20088 the end. Default is C<100>.
yading@10 20089
yading@10 20090 =back
yading@10 20091
yading@10 20092
yading@10 20093 Since the filter keeps track of the whole frames sequence, a bigger I<n>
yading@10 20094 value will result in a higher memory usage, so a high value is not recommended.
yading@10 20095
yading@10 20096
yading@10 20097 =head3 Examples
yading@10 20098
yading@10 20099
yading@10 20100
yading@10 20101 =over 4
yading@10 20102
yading@10 20103
yading@10 20104 =item *
yading@10 20105
yading@10 20106 Extract one picture each 50 frames:
yading@10 20107
yading@10 20108 thumbnail=50
yading@10 20109
yading@10 20110
yading@10 20111
yading@10 20112 =item *
yading@10 20113
yading@10 20114 Complete example of a thumbnail creation with B<ffmpeg>:
yading@10 20115
yading@10 20116 ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
yading@10 20117
yading@10 20118
yading@10 20119 =back
yading@10 20120
yading@10 20121
yading@10 20122
yading@10 20123 =head2 tile
yading@10 20124
yading@10 20125
yading@10 20126 Tile several successive frames together.
yading@10 20127
yading@10 20128 The filter accepts the following options:
yading@10 20129
yading@10 20130
yading@10 20131 =over 4
yading@10 20132
yading@10 20133
yading@10 20134
yading@10 20135 =item B<layout>
yading@10 20136
yading@10 20137 Set the grid size (i.e. the number of lines and columns) in the form
yading@10 20138 "I<w>xI<h>".
yading@10 20139
yading@10 20140
yading@10 20141 =item B<nb_frames>
yading@10 20142
yading@10 20143 Set the maximum number of frames to render in the given area. It must be less
yading@10 20144 than or equal to I<w>xI<h>. The default value is C<0>, meaning all
yading@10 20145 the area will be used.
yading@10 20146
yading@10 20147
yading@10 20148 =item B<margin>
yading@10 20149
yading@10 20150 Set the outer border margin in pixels.
yading@10 20151
yading@10 20152
yading@10 20153 =item B<padding>
yading@10 20154
yading@10 20155 Set the inner border thickness (i.e. the number of pixels between frames). For
yading@10 20156 more advanced padding options (such as having different values for the edges),
yading@10 20157 refer to the pad video filter.
yading@10 20158
yading@10 20159
yading@10 20160 =back
yading@10 20161
yading@10 20162
yading@10 20163
yading@10 20164 =head3 Examples
yading@10 20165
yading@10 20166
yading@10 20167
yading@10 20168 =over 4
yading@10 20169
yading@10 20170
yading@10 20171 =item *
yading@10 20172
yading@10 20173 Produce 8x8 PNG tiles of all keyframes (B<-skip_frame nokey>) in a movie:
yading@10 20174
yading@10 20175 ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
yading@10 20176
yading@10 20177 The B<-vsync 0> is necessary to prevent B<ffmpeg> from
yading@10 20178 duplicating each output frame to accomodate the originally detected frame
yading@10 20179 rate.
yading@10 20180
yading@10 20181
yading@10 20182 =item *
yading@10 20183
yading@10 20184 Display C<5> pictures in an area of C<3x2> frames,
yading@10 20185 with C<7> pixels between them, and C<2> pixels of initial margin, using
yading@10 20186 mixed flat and named options:
yading@10 20187
yading@10 20188 tile=3x2:nb_frames=5:padding=7:margin=2
yading@10 20189
yading@10 20190
yading@10 20191 =back
yading@10 20192
yading@10 20193
yading@10 20194
yading@10 20195 =head2 tinterlace
yading@10 20196
yading@10 20197
yading@10 20198 Perform various types of temporal field interlacing.
yading@10 20199
yading@10 20200 Frames are counted starting from 1, so the first input frame is
yading@10 20201 considered odd.
yading@10 20202
yading@10 20203 The filter accepts 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<mode>
yading@10 20211
yading@10 20212 Specify the mode of the interlacing. This option can also be specified
yading@10 20213 as a value alone. See below for a list of values for this option.
yading@10 20214
yading@10 20215 Available values are:
yading@10 20216
yading@10 20217
yading@10 20218 =over 4
yading@10 20219
yading@10 20220
yading@10 20221 =item B<merge, 0>
yading@10 20222
yading@10 20223 Move odd frames into the upper field, even into the lower field,
yading@10 20224 generating a double height frame at half frame rate.
yading@10 20225
yading@10 20226
yading@10 20227 =item B<drop_odd, 1>
yading@10 20228
yading@10 20229 Only output even frames, odd frames are dropped, generating a frame with
yading@10 20230 unchanged height at half frame rate.
yading@10 20231
yading@10 20232
yading@10 20233 =item B<drop_even, 2>
yading@10 20234
yading@10 20235 Only output odd frames, even frames are dropped, generating a frame with
yading@10 20236 unchanged height at half frame rate.
yading@10 20237
yading@10 20238
yading@10 20239 =item B<pad, 3>
yading@10 20240
yading@10 20241 Expand each frame to full height, but pad alternate lines with black,
yading@10 20242 generating a frame with double height at the same input frame rate.
yading@10 20243
yading@10 20244
yading@10 20245 =item B<interleave_top, 4>
yading@10 20246
yading@10 20247 Interleave the upper field from odd frames with the lower field from
yading@10 20248 even frames, generating a frame with unchanged height at half frame rate.
yading@10 20249
yading@10 20250
yading@10 20251 =item B<interleave_bottom, 5>
yading@10 20252
yading@10 20253 Interleave the lower field from odd frames with the upper field from
yading@10 20254 even frames, generating a frame with unchanged height at half frame rate.
yading@10 20255
yading@10 20256
yading@10 20257 =item B<interlacex2, 6>
yading@10 20258
yading@10 20259 Double frame rate with unchanged height. Frames are inserted each
yading@10 20260 containing the second temporal field from the previous input frame and
yading@10 20261 the first temporal field from the next input frame. This mode relies on
yading@10 20262 the top_field_first flag. Useful for interlaced video displays with no
yading@10 20263 field synchronisation.
yading@10 20264
yading@10 20265 =back
yading@10 20266
yading@10 20267
yading@10 20268 Numeric values are deprecated but are accepted for backward
yading@10 20269 compatibility reasons.
yading@10 20270
yading@10 20271 Default mode is C<merge>.
yading@10 20272
yading@10 20273
yading@10 20274 =item B<flags>
yading@10 20275
yading@10 20276 Specify flags influencing the filter process.
yading@10 20277
yading@10 20278 Available value for I<flags> is:
yading@10 20279
yading@10 20280
yading@10 20281 =over 4
yading@10 20282
yading@10 20283
yading@10 20284 =item B<low_pass_filter, vlfp>
yading@10 20285
yading@10 20286 Enable vertical low-pass filtering in the filter.
yading@10 20287 Vertical low-pass filtering is required when creating an interlaced
yading@10 20288 destination from a progressive source which contains high-frequency
yading@10 20289 vertical detail. Filtering will reduce interlace 'twitter' and Moire
yading@10 20290 patterning.
yading@10 20291
yading@10 20292 Vertical low-pass filtering can only be enabled for B<mode>
yading@10 20293 I<interleave_top> and I<interleave_bottom>.
yading@10 20294
yading@10 20295
yading@10 20296 =back
yading@10 20297
yading@10 20298
yading@10 20299 =back
yading@10 20300
yading@10 20301
yading@10 20302
yading@10 20303 =head2 transpose
yading@10 20304
yading@10 20305
yading@10 20306 Transpose rows with columns in the input video and optionally flip it.
yading@10 20307
yading@10 20308 This filter accepts the following options:
yading@10 20309
yading@10 20310
yading@10 20311 =over 4
yading@10 20312
yading@10 20313
yading@10 20314
yading@10 20315 =item B<dir>
yading@10 20316
yading@10 20317 The direction of the transpose.
yading@10 20318
yading@10 20319
yading@10 20320 =over 4
yading@10 20321
yading@10 20322
yading@10 20323 =item B<0, 4, cclock_flip>
yading@10 20324
yading@10 20325 Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
yading@10 20326
yading@10 20327 L.R L.l
yading@10 20328 . . -> . .
yading@10 20329 l.r R.r
yading@10 20330
yading@10 20331
yading@10 20332
yading@10 20333 =item B<1, 5, clock>
yading@10 20334
yading@10 20335 Rotate by 90 degrees clockwise, that is:
yading@10 20336
yading@10 20337 L.R l.L
yading@10 20338 . . -> . .
yading@10 20339 l.r r.R
yading@10 20340
yading@10 20341
yading@10 20342
yading@10 20343 =item B<2, 6, cclock>
yading@10 20344
yading@10 20345 Rotate by 90 degrees counterclockwise, that is:
yading@10 20346
yading@10 20347 L.R R.r
yading@10 20348 . . -> . .
yading@10 20349 l.r L.l
yading@10 20350
yading@10 20351
yading@10 20352
yading@10 20353 =item B<3, 7, clock_flip>
yading@10 20354
yading@10 20355 Rotate by 90 degrees clockwise and vertically flip, that is:
yading@10 20356
yading@10 20357 L.R r.R
yading@10 20358 . . -> . .
yading@10 20359 l.r l.L
yading@10 20360
yading@10 20361
yading@10 20362 =back
yading@10 20363
yading@10 20364
yading@10 20365 For values between 4-7, the transposition is only done if the input
yading@10 20366 video geometry is portrait and not landscape. These values are
yading@10 20367 deprecated, the C<passthrough> option should be used instead.
yading@10 20368
yading@10 20369
yading@10 20370 =item B<passthrough>
yading@10 20371
yading@10 20372 Do not apply the transposition if the input geometry matches the one
yading@10 20373 specified by the specified value. It accepts the following values:
yading@10 20374
yading@10 20375 =over 4
yading@10 20376
yading@10 20377
yading@10 20378 =item B<none>
yading@10 20379
yading@10 20380 Always apply transposition.
yading@10 20381
yading@10 20382 =item B<portrait>
yading@10 20383
yading@10 20384 Preserve portrait geometry (when I<height> E<gt>= I<width>).
yading@10 20385
yading@10 20386 =item B<landscape>
yading@10 20387
yading@10 20388 Preserve landscape geometry (when I<width> E<gt>= I<height>).
yading@10 20389
yading@10 20390 =back
yading@10 20391
yading@10 20392
yading@10 20393 Default value is C<none>.
yading@10 20394
yading@10 20395 =back
yading@10 20396
yading@10 20397
yading@10 20398 For example to rotate by 90 degrees clockwise and preserve portrait
yading@10 20399 layout:
yading@10 20400
yading@10 20401 transpose=dir=1:passthrough=portrait
yading@10 20402
yading@10 20403
yading@10 20404 The command above can also be specified as:
yading@10 20405
yading@10 20406 transpose=1:portrait
yading@10 20407
yading@10 20408
yading@10 20409
yading@10 20410 =head2 unsharp
yading@10 20411
yading@10 20412
yading@10 20413 Sharpen or blur the input video.
yading@10 20414
yading@10 20415 It accepts the following parameters:
yading@10 20416
yading@10 20417
yading@10 20418 =over 4
yading@10 20419
yading@10 20420
yading@10 20421 =item B<luma_msize_x, lx>
yading@10 20422
yading@10 20423
yading@10 20424 =item B<chroma_msize_x, cx>
yading@10 20425
yading@10 20426 Set the luma/chroma matrix horizontal size. It must be an odd integer
yading@10 20427 between 3 and 63, default value is 5.
yading@10 20428
yading@10 20429
yading@10 20430 =item B<luma_msize_y, ly>
yading@10 20431
yading@10 20432
yading@10 20433 =item B<chroma_msize_y, cy>
yading@10 20434
yading@10 20435 Set the luma/chroma matrix vertical size. It must be an odd integer
yading@10 20436 between 3 and 63, default value is 5.
yading@10 20437
yading@10 20438
yading@10 20439 =item B<luma_amount, la>
yading@10 20440
yading@10 20441
yading@10 20442 =item B<chroma_amount, ca>
yading@10 20443
yading@10 20444 Set the luma/chroma effect strength. It can be a float number,
yading@10 20445 reasonable values lay between -1.5 and 1.5.
yading@10 20446
yading@10 20447 Negative values will blur the input video, while positive values will
yading@10 20448 sharpen it, a value of zero will disable the effect.
yading@10 20449
yading@10 20450 Default value is 1.0 for B<luma_amount>, 0.0 for
yading@10 20451 B<chroma_amount>.
yading@10 20452
yading@10 20453 =back
yading@10 20454
yading@10 20455
yading@10 20456 All parameters are optional and default to the
yading@10 20457 equivalent of the string '5:5:1.0:5:5:0.0'.
yading@10 20458
yading@10 20459
yading@10 20460 =head3 Examples
yading@10 20461
yading@10 20462
yading@10 20463
yading@10 20464 =over 4
yading@10 20465
yading@10 20466
yading@10 20467 =item *
yading@10 20468
yading@10 20469 Apply strong luma sharpen effect:
yading@10 20470
yading@10 20471 unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
yading@10 20472
yading@10 20473
yading@10 20474
yading@10 20475 =item *
yading@10 20476
yading@10 20477 Apply strong blur of both luma and chroma parameters:
yading@10 20478
yading@10 20479 unsharp=7:7:-2:7:7:-2
yading@10 20480
yading@10 20481
yading@10 20482 =back
yading@10 20483
yading@10 20484
yading@10 20485
yading@10 20486 =head2 vflip
yading@10 20487
yading@10 20488
yading@10 20489 Flip the input video vertically.
yading@10 20490
yading@10 20491
yading@10 20492 ffmpeg -i in.avi -vf "vflip" out.avi
yading@10 20493
yading@10 20494
yading@10 20495
yading@10 20496
yading@10 20497 =head2 yadif
yading@10 20498
yading@10 20499
yading@10 20500 Deinterlace the input video ("yadif" means "yet another deinterlacing
yading@10 20501 filter").
yading@10 20502
yading@10 20503 This filter accepts the following options:
yading@10 20504
yading@10 20505
yading@10 20506
yading@10 20507 =over 4
yading@10 20508
yading@10 20509
yading@10 20510
yading@10 20511 =item B<mode>
yading@10 20512
yading@10 20513 The interlacing mode to adopt, accepts one of the following values:
yading@10 20514
yading@10 20515
yading@10 20516 =over 4
yading@10 20517
yading@10 20518
yading@10 20519 =item B<0, send_frame>
yading@10 20520
yading@10 20521 output 1 frame for each frame
yading@10 20522
yading@10 20523 =item B<1, send_field>
yading@10 20524
yading@10 20525 output 1 frame for each field
yading@10 20526
yading@10 20527 =item B<2, send_frame_nospatial>
yading@10 20528
yading@10 20529 like C<send_frame> but skip spatial interlacing check
yading@10 20530
yading@10 20531 =item B<3, send_field_nospatial>
yading@10 20532
yading@10 20533 like C<send_field> but skip spatial interlacing check
yading@10 20534
yading@10 20535 =back
yading@10 20536
yading@10 20537
yading@10 20538 Default value is C<send_frame>.
yading@10 20539
yading@10 20540
yading@10 20541 =item B<parity>
yading@10 20542
yading@10 20543 The picture field parity assumed for the input interlaced video, accepts one of
yading@10 20544 the following values:
yading@10 20545
yading@10 20546
yading@10 20547 =over 4
yading@10 20548
yading@10 20549
yading@10 20550 =item B<0, tff>
yading@10 20551
yading@10 20552 assume top field first
yading@10 20553
yading@10 20554 =item B<1, bff>
yading@10 20555
yading@10 20556 assume bottom field first
yading@10 20557
yading@10 20558 =item B<-1, auto>
yading@10 20559
yading@10 20560 enable automatic detection
yading@10 20561
yading@10 20562 =back
yading@10 20563
yading@10 20564
yading@10 20565 Default value is C<auto>.
yading@10 20566 If interlacing is unknown or decoder does not export this information,
yading@10 20567 top field first will be assumed.
yading@10 20568
yading@10 20569
yading@10 20570 =item B<deint>
yading@10 20571
yading@10 20572 Specify which frames to deinterlace. Accept one of the following
yading@10 20573 values:
yading@10 20574
yading@10 20575
yading@10 20576 =over 4
yading@10 20577
yading@10 20578
yading@10 20579 =item B<0, all>
yading@10 20580
yading@10 20581 deinterlace all frames
yading@10 20582
yading@10 20583 =item B<1, interlaced>
yading@10 20584
yading@10 20585 only deinterlace frames marked as interlaced
yading@10 20586
yading@10 20587 =back
yading@10 20588
yading@10 20589
yading@10 20590 Default value is C<all>.
yading@10 20591
yading@10 20592 =back
yading@10 20593
yading@10 20594
yading@10 20595
yading@10 20596
yading@10 20597 =head1 VIDEO SOURCES
yading@10 20598
yading@10 20599
yading@10 20600 Below is a description of the currently available video sources.
yading@10 20601
yading@10 20602
yading@10 20603 =head2 buffer
yading@10 20604
yading@10 20605
yading@10 20606 Buffer video frames, and make them available to the filter chain.
yading@10 20607
yading@10 20608 This source is mainly intended for a programmatic use, in particular
yading@10 20609 through the interface defined in F<libavfilter/vsrc_buffer.h>.
yading@10 20610
yading@10 20611 This source accepts the following options:
yading@10 20612
yading@10 20613
yading@10 20614 =over 4
yading@10 20615
yading@10 20616
yading@10 20617
yading@10 20618 =item B<video_size>
yading@10 20619
yading@10 20620 Specify the size (width and height) of the buffered video frames.
yading@10 20621
yading@10 20622
yading@10 20623 =item B<width>
yading@10 20624
yading@10 20625 Input video width.
yading@10 20626
yading@10 20627
yading@10 20628 =item B<height>
yading@10 20629
yading@10 20630 Input video height.
yading@10 20631
yading@10 20632
yading@10 20633 =item B<pix_fmt>
yading@10 20634
yading@10 20635 A string representing the pixel format of the buffered video frames.
yading@10 20636 It may be a number corresponding to a pixel format, or a pixel format
yading@10 20637 name.
yading@10 20638
yading@10 20639
yading@10 20640 =item B<time_base>
yading@10 20641
yading@10 20642 Specify the timebase assumed by the timestamps of the buffered frames.
yading@10 20643
yading@10 20644
yading@10 20645 =item B<frame_rate>
yading@10 20646
yading@10 20647 Specify the frame rate expected for the video stream.
yading@10 20648
yading@10 20649
yading@10 20650 =item B<pixel_aspect, sar>
yading@10 20651
yading@10 20652 Specify the sample aspect ratio assumed by the video frames.
yading@10 20653
yading@10 20654
yading@10 20655 =item B<sws_param>
yading@10 20656
yading@10 20657 Specify the optional parameters to be used for the scale filter which
yading@10 20658 is automatically inserted when an input change is detected in the
yading@10 20659 input size or format.
yading@10 20660
yading@10 20661 =back
yading@10 20662
yading@10 20663
yading@10 20664 For example:
yading@10 20665
yading@10 20666 buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
yading@10 20667
yading@10 20668
yading@10 20669 will instruct the source to accept video frames with size 320x240 and
yading@10 20670 with format "yuv410p", assuming 1/24 as the timestamps timebase and
yading@10 20671 square pixels (1:1 sample aspect ratio).
yading@10 20672 Since the pixel format with name "yuv410p" corresponds to the number 6
yading@10 20673 (check the enum AVPixelFormat definition in F<libavutil/pixfmt.h>),
yading@10 20674 this example corresponds to:
yading@10 20675
yading@10 20676 buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
yading@10 20677
yading@10 20678
yading@10 20679 Alternatively, the options can be specified as a flat string, but this
yading@10 20680 syntax is deprecated:
yading@10 20681
yading@10 20682 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 20683
yading@10 20684
yading@10 20685 =head2 cellauto
yading@10 20686
yading@10 20687
yading@10 20688 Create a pattern generated by an elementary cellular automaton.
yading@10 20689
yading@10 20690 The initial state of the cellular automaton can be defined through the
yading@10 20691 B<filename>, and B<pattern> options. If such options are
yading@10 20692 not specified an initial state is created randomly.
yading@10 20693
yading@10 20694 At each new frame a new row in the video is filled with the result of
yading@10 20695 the cellular automaton next generation. The behavior when the whole
yading@10 20696 frame is filled is defined by the B<scroll> option.
yading@10 20697
yading@10 20698 This source accepts the following options:
yading@10 20699
yading@10 20700
yading@10 20701 =over 4
yading@10 20702
yading@10 20703
yading@10 20704 =item B<filename, f>
yading@10 20705
yading@10 20706 Read the initial cellular automaton state, i.e. the starting row, from
yading@10 20707 the specified file.
yading@10 20708 In the file, each non-whitespace character is considered an alive
yading@10 20709 cell, a newline will terminate the row, and further characters in the
yading@10 20710 file will be ignored.
yading@10 20711
yading@10 20712
yading@10 20713 =item B<pattern, p>
yading@10 20714
yading@10 20715 Read the initial cellular automaton state, i.e. the starting row, from
yading@10 20716 the specified string.
yading@10 20717
yading@10 20718 Each non-whitespace character in the string is considered an alive
yading@10 20719 cell, a newline will terminate the row, and further characters in the
yading@10 20720 string will be ignored.
yading@10 20721
yading@10 20722
yading@10 20723 =item B<rate, r>
yading@10 20724
yading@10 20725 Set the video rate, that is the number of frames generated per second.
yading@10 20726 Default is 25.
yading@10 20727
yading@10 20728
yading@10 20729 =item B<random_fill_ratio, ratio>
yading@10 20730
yading@10 20731 Set the random fill ratio for the initial cellular automaton row. It
yading@10 20732 is a floating point number value ranging from 0 to 1, defaults to
yading@10 20733 1/PHI.
yading@10 20734
yading@10 20735 This option is ignored when a file or a pattern is specified.
yading@10 20736
yading@10 20737
yading@10 20738 =item B<random_seed, seed>
yading@10 20739
yading@10 20740 Set the seed for filling randomly the initial row, must be an integer
yading@10 20741 included between 0 and UINT32_MAX. If not specified, or if explicitly
yading@10 20742 set to -1, the filter will try to use a good random seed on a best
yading@10 20743 effort basis.
yading@10 20744
yading@10 20745
yading@10 20746 =item B<rule>
yading@10 20747
yading@10 20748 Set the cellular automaton rule, it is a number ranging from 0 to 255.
yading@10 20749 Default value is 110.
yading@10 20750
yading@10 20751
yading@10 20752 =item B<size, s>
yading@10 20753
yading@10 20754 Set the size of the output video.
yading@10 20755
yading@10 20756 If B<filename> or B<pattern> is specified, the size is set
yading@10 20757 by default to the width of the specified initial state row, and the
yading@10 20758 height is set to I<width> * PHI.
yading@10 20759
yading@10 20760 If B<size> is set, it must contain the width of the specified
yading@10 20761 pattern string, and the specified pattern will be centered in the
yading@10 20762 larger row.
yading@10 20763
yading@10 20764 If a filename or a pattern string is not specified, the size value
yading@10 20765 defaults to "320x518" (used for a randomly generated initial state).
yading@10 20766
yading@10 20767
yading@10 20768 =item B<scroll>
yading@10 20769
yading@10 20770 If set to 1, scroll the output upward when all the rows in the output
yading@10 20771 have been already filled. If set to 0, the new generated row will be
yading@10 20772 written over the top row just after the bottom row is filled.
yading@10 20773 Defaults to 1.
yading@10 20774
yading@10 20775
yading@10 20776 =item B<start_full, full>
yading@10 20777
yading@10 20778 If set to 1, completely fill the output with generated rows before
yading@10 20779 outputting the first frame.
yading@10 20780 This is the default behavior, for disabling set the value to 0.
yading@10 20781
yading@10 20782
yading@10 20783 =item B<stitch>
yading@10 20784
yading@10 20785 If set to 1, stitch the left and right row edges together.
yading@10 20786 This is the default behavior, for disabling set the value to 0.
yading@10 20787
yading@10 20788 =back
yading@10 20789
yading@10 20790
yading@10 20791
yading@10 20792 =head3 Examples
yading@10 20793
yading@10 20794
yading@10 20795
yading@10 20796 =over 4
yading@10 20797
yading@10 20798
yading@10 20799 =item *
yading@10 20800
yading@10 20801 Read the initial state from F<pattern>, and specify an output of
yading@10 20802 size 200x400.
yading@10 20803
yading@10 20804 cellauto=f=pattern:s=200x400
yading@10 20805
yading@10 20806
yading@10 20807
yading@10 20808 =item *
yading@10 20809
yading@10 20810 Generate a random initial row with a width of 200 cells, with a fill
yading@10 20811 ratio of 2/3:
yading@10 20812
yading@10 20813 cellauto=ratio=2/3:s=200x200
yading@10 20814
yading@10 20815
yading@10 20816
yading@10 20817 =item *
yading@10 20818
yading@10 20819 Create a pattern generated by rule 18 starting by a single alive cell
yading@10 20820 centered on an initial row with width 100:
yading@10 20821
yading@10 20822 cellauto=p=@s=100x400:full=0:rule=18
yading@10 20823
yading@10 20824
yading@10 20825
yading@10 20826 =item *
yading@10 20827
yading@10 20828 Specify a more elaborated initial pattern:
yading@10 20829
yading@10 20830 cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
yading@10 20831
yading@10 20832
yading@10 20833
yading@10 20834 =back
yading@10 20835
yading@10 20836
yading@10 20837
yading@10 20838 =head2 mandelbrot
yading@10 20839
yading@10 20840
yading@10 20841 Generate a Mandelbrot set fractal, and progressively zoom towards the
yading@10 20842 point specified with I<start_x> and I<start_y>.
yading@10 20843
yading@10 20844 This source accepts the following options:
yading@10 20845
yading@10 20846
yading@10 20847 =over 4
yading@10 20848
yading@10 20849
yading@10 20850
yading@10 20851 =item B<end_pts>
yading@10 20852
yading@10 20853 Set the terminal pts value. Default value is 400.
yading@10 20854
yading@10 20855
yading@10 20856 =item B<end_scale>
yading@10 20857
yading@10 20858 Set the terminal scale value.
yading@10 20859 Must be a floating point value. Default value is 0.3.
yading@10 20860
yading@10 20861
yading@10 20862 =item B<inner>
yading@10 20863
yading@10 20864 Set the inner coloring mode, that is the algorithm used to draw the
yading@10 20865 Mandelbrot fractal internal region.
yading@10 20866
yading@10 20867 It shall assume one of the following values:
yading@10 20868
yading@10 20869 =over 4
yading@10 20870
yading@10 20871
yading@10 20872 =item B<black>
yading@10 20873
yading@10 20874 Set black mode.
yading@10 20875
yading@10 20876 =item B<convergence>
yading@10 20877
yading@10 20878 Show time until convergence.
yading@10 20879
yading@10 20880 =item B<mincol>
yading@10 20881
yading@10 20882 Set color based on point closest to the origin of the iterations.
yading@10 20883
yading@10 20884 =item B<period>
yading@10 20885
yading@10 20886 Set period mode.
yading@10 20887
yading@10 20888 =back
yading@10 20889
yading@10 20890
yading@10 20891 Default value is I<mincol>.
yading@10 20892
yading@10 20893
yading@10 20894 =item B<bailout>
yading@10 20895
yading@10 20896 Set the bailout value. Default value is 10.0.
yading@10 20897
yading@10 20898
yading@10 20899 =item B<maxiter>
yading@10 20900
yading@10 20901 Set the maximum of iterations performed by the rendering
yading@10 20902 algorithm. Default value is 7189.
yading@10 20903
yading@10 20904
yading@10 20905 =item B<outer>
yading@10 20906
yading@10 20907 Set outer coloring mode.
yading@10 20908 It shall assume one of following values:
yading@10 20909
yading@10 20910 =over 4
yading@10 20911
yading@10 20912
yading@10 20913 =item B<iteration_count>
yading@10 20914
yading@10 20915 Set iteration cound mode.
yading@10 20916
yading@10 20917 =item B<normalized_iteration_count>
yading@10 20918
yading@10 20919 set normalized iteration count mode.
yading@10 20920
yading@10 20921 =back
yading@10 20922
yading@10 20923 Default value is I<normalized_iteration_count>.
yading@10 20924
yading@10 20925
yading@10 20926 =item B<rate, r>
yading@10 20927
yading@10 20928 Set frame rate, expressed as number of frames per second. Default
yading@10 20929 value is "25".
yading@10 20930
yading@10 20931
yading@10 20932 =item B<size, s>
yading@10 20933
yading@10 20934 Set frame size. Default value is "640x480".
yading@10 20935
yading@10 20936
yading@10 20937 =item B<start_scale>
yading@10 20938
yading@10 20939 Set the initial scale value. Default value is 3.0.
yading@10 20940
yading@10 20941
yading@10 20942 =item B<start_x>
yading@10 20943
yading@10 20944 Set the initial x position. Must be a floating point value between
yading@10 20945 -100 and 100. Default value is -0.743643887037158704752191506114774.
yading@10 20946
yading@10 20947
yading@10 20948 =item B<start_y>
yading@10 20949
yading@10 20950 Set the initial y position. Must be a floating point value between
yading@10 20951 -100 and 100. Default value is -0.131825904205311970493132056385139.
yading@10 20952
yading@10 20953 =back
yading@10 20954
yading@10 20955
yading@10 20956
yading@10 20957 =head2 mptestsrc
yading@10 20958
yading@10 20959
yading@10 20960 Generate various test patterns, as generated by the MPlayer test filter.
yading@10 20961
yading@10 20962 The size of the generated video is fixed, and is 256x256.
yading@10 20963 This source is useful in particular for testing encoding features.
yading@10 20964
yading@10 20965 This source accepts the following options:
yading@10 20966
yading@10 20967
yading@10 20968 =over 4
yading@10 20969
yading@10 20970
yading@10 20971
yading@10 20972 =item B<rate, r>
yading@10 20973
yading@10 20974 Specify the frame rate of the sourced video, as the number of frames
yading@10 20975 generated per second. It has to be a string in the format
yading@10 20976 I<frame_rate_num>/I<frame_rate_den>, an integer number, a float
yading@10 20977 number or a valid video frame rate abbreviation. The default value is
yading@10 20978 "25".
yading@10 20979
yading@10 20980
yading@10 20981 =item B<duration, d>
yading@10 20982
yading@10 20983 Set the video duration of the sourced video. The accepted syntax is:
yading@10 20984
yading@10 20985 [-]HH:MM:SS[.m...]
yading@10 20986 [-]S+[.m...]
yading@10 20987
yading@10 20988 See also the function C<av_parse_time()>.
yading@10 20989
yading@10 20990 If not specified, or the expressed duration is negative, the video is
yading@10 20991 supposed to be generated forever.
yading@10 20992
yading@10 20993
yading@10 20994 =item B<test, t>
yading@10 20995
yading@10 20996
yading@10 20997 Set the number or the name of the test to perform. Supported tests are:
yading@10 20998
yading@10 20999 =over 4
yading@10 21000
yading@10 21001
yading@10 21002 =item B<dc_luma>
yading@10 21003
yading@10 21004
yading@10 21005 =item B<dc_chroma>
yading@10 21006
yading@10 21007
yading@10 21008 =item B<freq_luma>
yading@10 21009
yading@10 21010
yading@10 21011 =item B<freq_chroma>
yading@10 21012
yading@10 21013
yading@10 21014 =item B<amp_luma>
yading@10 21015
yading@10 21016
yading@10 21017 =item B<amp_chroma>
yading@10 21018
yading@10 21019
yading@10 21020 =item B<cbp>
yading@10 21021
yading@10 21022
yading@10 21023 =item B<mv>
yading@10 21024
yading@10 21025
yading@10 21026 =item B<ring1>
yading@10 21027
yading@10 21028
yading@10 21029 =item B<ring2>
yading@10 21030
yading@10 21031
yading@10 21032 =item B<all>
yading@10 21033
yading@10 21034
yading@10 21035 =back
yading@10 21036
yading@10 21037
yading@10 21038 Default value is "all", which will cycle through the list of all tests.
yading@10 21039
yading@10 21040 =back
yading@10 21041
yading@10 21042
yading@10 21043 For example the following:
yading@10 21044
yading@10 21045 testsrc=t=dc_luma
yading@10 21046
yading@10 21047
yading@10 21048 will generate a "dc_luma" test pattern.
yading@10 21049
yading@10 21050
yading@10 21051 =head2 frei0r_src
yading@10 21052
yading@10 21053
yading@10 21054 Provide a frei0r source.
yading@10 21055
yading@10 21056 To enable compilation of this filter you need to install the frei0r
yading@10 21057 header and configure FFmpeg with C<--enable-frei0r>.
yading@10 21058
yading@10 21059 This source accepts the following options:
yading@10 21060
yading@10 21061
yading@10 21062 =over 4
yading@10 21063
yading@10 21064
yading@10 21065
yading@10 21066 =item B<size>
yading@10 21067
yading@10 21068 The size of the video to generate, may be a string of the form
yading@10 21069 I<width>xI<height> or a frame size abbreviation.
yading@10 21070
yading@10 21071
yading@10 21072 =item B<framerate>
yading@10 21073
yading@10 21074 Framerate of the generated video, may be a string of the form
yading@10 21075 I<num>/I<den> or a frame rate abbreviation.
yading@10 21076
yading@10 21077
yading@10 21078 =item B<filter_name>
yading@10 21079
yading@10 21080 The name to the frei0r source to load. For more information regarding frei0r and
yading@10 21081 how to set the parameters read the section frei0r in the description of
yading@10 21082 the video filters.
yading@10 21083
yading@10 21084
yading@10 21085 =item B<filter_params>
yading@10 21086
yading@10 21087 A '|'-separated list of parameters to pass to the frei0r source.
yading@10 21088
yading@10 21089
yading@10 21090 =back
yading@10 21091
yading@10 21092
yading@10 21093 For example, to generate a frei0r partik0l source with size 200x200
yading@10 21094 and frame rate 10 which is overlayed on the overlay filter main input:
yading@10 21095
yading@10 21096 frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
yading@10 21097
yading@10 21098
yading@10 21099
yading@10 21100 =head2 life
yading@10 21101
yading@10 21102
yading@10 21103 Generate a life pattern.
yading@10 21104
yading@10 21105 This source is based on a generalization of John Conway's life game.
yading@10 21106
yading@10 21107 The sourced input represents a life grid, each pixel represents a cell
yading@10 21108 which can be in one of two possible states, alive or dead. Every cell
yading@10 21109 interacts with its eight neighbours, which are the cells that are
yading@10 21110 horizontally, vertically, or diagonally adjacent.
yading@10 21111
yading@10 21112 At each interaction the grid evolves according to the adopted rule,
yading@10 21113 which specifies the number of neighbor alive cells which will make a
yading@10 21114 cell stay alive or born. The B<rule> option allows to specify
yading@10 21115 the rule to adopt.
yading@10 21116
yading@10 21117 This source accepts the following options:
yading@10 21118
yading@10 21119
yading@10 21120 =over 4
yading@10 21121
yading@10 21122
yading@10 21123 =item B<filename, f>
yading@10 21124
yading@10 21125 Set the file from which to read the initial grid state. In the file,
yading@10 21126 each non-whitespace character is considered an alive cell, and newline
yading@10 21127 is used to delimit the end of each row.
yading@10 21128
yading@10 21129 If this option is not specified, the initial grid is generated
yading@10 21130 randomly.
yading@10 21131
yading@10 21132
yading@10 21133 =item B<rate, r>
yading@10 21134
yading@10 21135 Set the video rate, that is the number of frames generated per second.
yading@10 21136 Default is 25.
yading@10 21137
yading@10 21138
yading@10 21139 =item B<random_fill_ratio, ratio>
yading@10 21140
yading@10 21141 Set the random fill ratio for the initial random grid. It is a
yading@10 21142 floating point number value ranging from 0 to 1, defaults to 1/PHI.
yading@10 21143 It is ignored when a file is specified.
yading@10 21144
yading@10 21145
yading@10 21146 =item B<random_seed, seed>
yading@10 21147
yading@10 21148 Set the seed for filling the initial random grid, must be an integer
yading@10 21149 included between 0 and UINT32_MAX. If not specified, or if explicitly
yading@10 21150 set to -1, the filter will try to use a good random seed on a best
yading@10 21151 effort basis.
yading@10 21152
yading@10 21153
yading@10 21154 =item B<rule>
yading@10 21155
yading@10 21156 Set the life rule.
yading@10 21157
yading@10 21158 A rule can be specified with a code of the kind "SI<NS>/BI<NB>",
yading@10 21159 where I<NS> and I<NB> are sequences of numbers in the range 0-8,
yading@10 21160 I<NS> specifies the number of alive neighbor cells which make a
yading@10 21161 live cell stay alive, and I<NB> the number of alive neighbor cells
yading@10 21162 which make a dead cell to become alive (i.e. to "born").
yading@10 21163 "s" and "b" can be used in place of "S" and "B", respectively.
yading@10 21164
yading@10 21165 Alternatively a rule can be specified by an 18-bits integer. The 9
yading@10 21166 high order bits are used to encode the next cell state if it is alive
yading@10 21167 for each number of neighbor alive cells, the low order bits specify
yading@10 21168 the rule for "borning" new cells. Higher order bits encode for an
yading@10 21169 higher number of neighbor cells.
yading@10 21170 For example the number 6153 = C<(12E<lt>E<lt>9)+9> specifies a stay alive
yading@10 21171 rule of 12 and a born rule of 9, which corresponds to "S23/B03".
yading@10 21172
yading@10 21173 Default value is "S23/B3", which is the original Conway's game of life
yading@10 21174 rule, and will keep a cell alive if it has 2 or 3 neighbor alive
yading@10 21175 cells, and will born a new cell if there are three alive cells around
yading@10 21176 a dead cell.
yading@10 21177
yading@10 21178
yading@10 21179 =item B<size, s>
yading@10 21180
yading@10 21181 Set the size of the output video.
yading@10 21182
yading@10 21183 If B<filename> is specified, the size is set by default to the
yading@10 21184 same size of the input file. If B<size> is set, it must contain
yading@10 21185 the size specified in the input file, and the initial grid defined in
yading@10 21186 that file is centered in the larger resulting area.
yading@10 21187
yading@10 21188 If a filename is not specified, the size value defaults to "320x240"
yading@10 21189 (used for a randomly generated initial grid).
yading@10 21190
yading@10 21191
yading@10 21192 =item B<stitch>
yading@10 21193
yading@10 21194 If set to 1, stitch the left and right grid edges together, and the
yading@10 21195 top and bottom edges also. Defaults to 1.
yading@10 21196
yading@10 21197
yading@10 21198 =item B<mold>
yading@10 21199
yading@10 21200 Set cell mold speed. If set, a dead cell will go from B<death_color> to
yading@10 21201 B<mold_color> with a step of B<mold>. B<mold> can have a
yading@10 21202 value from 0 to 255.
yading@10 21203
yading@10 21204
yading@10 21205 =item B<life_color>
yading@10 21206
yading@10 21207 Set the color of living (or new born) cells.
yading@10 21208
yading@10 21209
yading@10 21210 =item B<death_color>
yading@10 21211
yading@10 21212 Set the color of dead cells. If B<mold> is set, this is the first color
yading@10 21213 used to represent a dead cell.
yading@10 21214
yading@10 21215
yading@10 21216 =item B<mold_color>
yading@10 21217
yading@10 21218 Set mold color, for definitely dead and moldy cells.
yading@10 21219
yading@10 21220 =back
yading@10 21221
yading@10 21222
yading@10 21223
yading@10 21224 =head3 Examples
yading@10 21225
yading@10 21226
yading@10 21227
yading@10 21228 =over 4
yading@10 21229
yading@10 21230
yading@10 21231 =item *
yading@10 21232
yading@10 21233 Read a grid from F<pattern>, and center it on a grid of size
yading@10 21234 300x300 pixels:
yading@10 21235
yading@10 21236 life=f=pattern:s=300x300
yading@10 21237
yading@10 21238
yading@10 21239
yading@10 21240 =item *
yading@10 21241
yading@10 21242 Generate a random grid of size 200x200, with a fill ratio of 2/3:
yading@10 21243
yading@10 21244 life=ratio=2/3:s=200x200
yading@10 21245
yading@10 21246
yading@10 21247
yading@10 21248 =item *
yading@10 21249
yading@10 21250 Specify a custom rule for evolving a randomly generated grid:
yading@10 21251
yading@10 21252 life=rule=S14/B34
yading@10 21253
yading@10 21254
yading@10 21255
yading@10 21256 =item *
yading@10 21257
yading@10 21258 Full example with slow death effect (mold) using B<ffplay>:
yading@10 21259
yading@10 21260 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 21261
yading@10 21262
yading@10 21263 =back
yading@10 21264
yading@10 21265
yading@10 21266
yading@10 21267 =head2 color, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc
yading@10 21268
yading@10 21269
yading@10 21270 The C<color> source provides an uniformly colored input.
yading@10 21271
yading@10 21272 The C<nullsrc> source returns unprocessed video frames. It is
yading@10 21273 mainly useful to be employed in analysis / debugging tools, or as the
yading@10 21274 source for filters which ignore the input data.
yading@10 21275
yading@10 21276 The C<rgbtestsrc> source generates an RGB test pattern useful for
yading@10 21277 detecting RGB vs BGR issues. You should see a red, green and blue
yading@10 21278 stripe from top to bottom.
yading@10 21279
yading@10 21280 The C<smptebars> source generates a color bars pattern, based on
yading@10 21281 the SMPTE Engineering Guideline EG 1-1990.
yading@10 21282
yading@10 21283 The C<smptehdbars> source generates a color bars pattern, based on
yading@10 21284 the SMPTE RP 219-2002.
yading@10 21285
yading@10 21286 The C<testsrc> source generates a test video pattern, showing a
yading@10 21287 color pattern, a scrolling gradient and a timestamp. This is mainly
yading@10 21288 intended for testing purposes.
yading@10 21289
yading@10 21290 The sources accept the following options:
yading@10 21291
yading@10 21292
yading@10 21293 =over 4
yading@10 21294
yading@10 21295
yading@10 21296
yading@10 21297 =item B<color, c>
yading@10 21298
yading@10 21299 Specify the color of the source, only used in the C<color>
yading@10 21300 source. It can be the name of a color (case insensitive match) or a
yading@10 21301 0xRRGGBB[AA] sequence, possibly followed by an alpha specifier. The
yading@10 21302 default value is "black".
yading@10 21303
yading@10 21304
yading@10 21305 =item B<size, s>
yading@10 21306
yading@10 21307 Specify the size of the sourced video, it may be a string of the form
yading@10 21308 I<width>xI<height>, or the name of a size abbreviation. The
yading@10 21309 default value is "320x240".
yading@10 21310
yading@10 21311
yading@10 21312 =item B<rate, r>
yading@10 21313
yading@10 21314 Specify the frame rate of the sourced video, as the number of frames
yading@10 21315 generated per second. It has to be a string in the format
yading@10 21316 I<frame_rate_num>/I<frame_rate_den>, an integer number, a float
yading@10 21317 number or a valid video frame rate abbreviation. The default value is
yading@10 21318 "25".
yading@10 21319
yading@10 21320
yading@10 21321 =item B<sar>
yading@10 21322
yading@10 21323 Set the sample aspect ratio of the sourced video.
yading@10 21324
yading@10 21325
yading@10 21326 =item B<duration, d>
yading@10 21327
yading@10 21328 Set the video duration of the sourced video. The accepted syntax is:
yading@10 21329
yading@10 21330 [-]HH[:MM[:SS[.m...]]]
yading@10 21331 [-]S+[.m...]
yading@10 21332
yading@10 21333 See also the function C<av_parse_time()>.
yading@10 21334
yading@10 21335 If not specified, or the expressed duration is negative, the video is
yading@10 21336 supposed to be generated forever.
yading@10 21337
yading@10 21338
yading@10 21339 =item B<decimals, n>
yading@10 21340
yading@10 21341 Set the number of decimals to show in the timestamp, only used in the
yading@10 21342 C<testsrc> source.
yading@10 21343
yading@10 21344 The displayed timestamp value will correspond to the original
yading@10 21345 timestamp value multiplied by the power of 10 of the specified
yading@10 21346 value. Default value is 0.
yading@10 21347
yading@10 21348 =back
yading@10 21349
yading@10 21350
yading@10 21351 For example the following:
yading@10 21352
yading@10 21353 testsrc=duration=5.3:size=qcif:rate=10
yading@10 21354
yading@10 21355
yading@10 21356 will generate a video with a duration of 5.3 seconds, with size
yading@10 21357 176x144 and a frame rate of 10 frames per second.
yading@10 21358
yading@10 21359 The following graph description will generate a red source
yading@10 21360 with an opacity of 0.2, with size "qcif" and a frame rate of 10
yading@10 21361 frames per second.
yading@10 21362
yading@10 21363 color=c=red@0.2:s=qcif:r=10
yading@10 21364
yading@10 21365
yading@10 21366 If the input content is to be ignored, C<nullsrc> can be used. The
yading@10 21367 following command generates noise in the luminance plane by employing
yading@10 21368 the C<geq> filter:
yading@10 21369
yading@10 21370 nullsrc=s=256x256, geq=random(1)*255:128:128
yading@10 21371
yading@10 21372
yading@10 21373
yading@10 21374
yading@10 21375 =head1 VIDEO SINKS
yading@10 21376
yading@10 21377
yading@10 21378 Below is a description of the currently available video sinks.
yading@10 21379
yading@10 21380
yading@10 21381 =head2 buffersink
yading@10 21382
yading@10 21383
yading@10 21384 Buffer video frames, and make them available to the end of the filter
yading@10 21385 graph.
yading@10 21386
yading@10 21387 This sink is mainly intended for a programmatic use, in particular
yading@10 21388 through the interface defined in F<libavfilter/buffersink.h>
yading@10 21389 or the options system.
yading@10 21390
yading@10 21391 It accepts a pointer to an AVBufferSinkContext structure, which
yading@10 21392 defines the incoming buffers' formats, to be passed as the opaque
yading@10 21393 parameter to C<avfilter_init_filter> for initialization.
yading@10 21394
yading@10 21395
yading@10 21396 =head2 nullsink
yading@10 21397
yading@10 21398
yading@10 21399 Null video sink, do absolutely nothing with the input video. It is
yading@10 21400 mainly useful as a template and to be employed in analysis / debugging
yading@10 21401 tools.
yading@10 21402
yading@10 21403
yading@10 21404
yading@10 21405 =head1 MULTIMEDIA FILTERS
yading@10 21406
yading@10 21407
yading@10 21408 Below is a description of the currently available multimedia filters.
yading@10 21409
yading@10 21410
yading@10 21411 =head2 aperms, perms
yading@10 21412
yading@10 21413
yading@10 21414 Set read/write permissions for the output frames.
yading@10 21415
yading@10 21416 These filters are mainly aimed at developers to test direct path in the
yading@10 21417 following filter in the filtergraph.
yading@10 21418
yading@10 21419 The filters accept the following options:
yading@10 21420
yading@10 21421
yading@10 21422 =over 4
yading@10 21423
yading@10 21424
yading@10 21425 =item B<mode>
yading@10 21426
yading@10 21427 Select the permissions mode.
yading@10 21428
yading@10 21429 It accepts the following values:
yading@10 21430
yading@10 21431 =over 4
yading@10 21432
yading@10 21433
yading@10 21434 =item B<none>
yading@10 21435
yading@10 21436 Do nothing. This is the default.
yading@10 21437
yading@10 21438 =item B<ro>
yading@10 21439
yading@10 21440 Set all the output frames read-only.
yading@10 21441
yading@10 21442 =item B<rw>
yading@10 21443
yading@10 21444 Set all the output frames directly writable.
yading@10 21445
yading@10 21446 =item B<toggle>
yading@10 21447
yading@10 21448 Make the frame read-only if writable, and writable if read-only.
yading@10 21449
yading@10 21450 =item B<random>
yading@10 21451
yading@10 21452 Set each output frame read-only or writable randomly.
yading@10 21453
yading@10 21454 =back
yading@10 21455
yading@10 21456
yading@10 21457
yading@10 21458 =item B<seed>
yading@10 21459
yading@10 21460 Set the seed for the I<random> mode, must be an integer included between
yading@10 21461 C<0> and C<UINT32_MAX>. If not specified, or if explicitly set to
yading@10 21462 C<-1>, the filter will try to use a good random seed on a best effort
yading@10 21463 basis.
yading@10 21464
yading@10 21465 =back
yading@10 21466
yading@10 21467
yading@10 21468 Note: in case of auto-inserted filter between the permission filter and the
yading@10 21469 following one, the permission might not be received as expected in that
yading@10 21470 following filter. Inserting a format or aformat filter before the
yading@10 21471 perms/aperms filter can avoid this problem.
yading@10 21472
yading@10 21473
yading@10 21474 =head2 aselect, select
yading@10 21475
yading@10 21476 Select frames to pass in output.
yading@10 21477
yading@10 21478 This filter accepts the following options:
yading@10 21479
yading@10 21480
yading@10 21481 =over 4
yading@10 21482
yading@10 21483
yading@10 21484
yading@10 21485 =item B<expr, e>
yading@10 21486
yading@10 21487 Set expression, which is evaluated for each input frame.
yading@10 21488
yading@10 21489 If the expression is evaluated to zero, the frame is discarded.
yading@10 21490
yading@10 21491 If the evaluation result is negative or NaN, the frame is sent to the
yading@10 21492 first output; otherwise it is sent to the output with index
yading@10 21493 C<ceil(val)-1>, assuming that the input index starts from 0.
yading@10 21494
yading@10 21495 For example a value of C<1.2> corresponds to the output with index
yading@10 21496 C<ceil(1.2)-1 = 2-1 = 1>, that is the second output.
yading@10 21497
yading@10 21498
yading@10 21499 =item B<outputs, n>
yading@10 21500
yading@10 21501 Set the number of outputs. The output to which to send the selected
yading@10 21502 frame is based on the result of the evaluation. Default value is 1.
yading@10 21503
yading@10 21504 =back
yading@10 21505
yading@10 21506
yading@10 21507 The expression can contain the following constants:
yading@10 21508
yading@10 21509
yading@10 21510 =over 4
yading@10 21511
yading@10 21512
yading@10 21513 =item B<n>
yading@10 21514
yading@10 21515 the sequential number of the filtered frame, starting from 0
yading@10 21516
yading@10 21517
yading@10 21518 =item B<selected_n>
yading@10 21519
yading@10 21520 the sequential number of the selected frame, starting from 0
yading@10 21521
yading@10 21522
yading@10 21523 =item B<prev_selected_n>
yading@10 21524
yading@10 21525 the sequential number of the last selected frame, NAN if undefined
yading@10 21526
yading@10 21527
yading@10 21528 =item B<TB>
yading@10 21529
yading@10 21530 timebase of the input timestamps
yading@10 21531
yading@10 21532
yading@10 21533 =item B<pts>
yading@10 21534
yading@10 21535 the PTS (Presentation TimeStamp) of the filtered video frame,
yading@10 21536 expressed in I<TB> units, NAN if undefined
yading@10 21537
yading@10 21538
yading@10 21539 =item B<t>
yading@10 21540
yading@10 21541 the PTS (Presentation TimeStamp) of the filtered video frame,
yading@10 21542 expressed in seconds, NAN if undefined
yading@10 21543
yading@10 21544
yading@10 21545 =item B<prev_pts>
yading@10 21546
yading@10 21547 the PTS of the previously filtered video frame, NAN if undefined
yading@10 21548
yading@10 21549
yading@10 21550 =item B<prev_selected_pts>
yading@10 21551
yading@10 21552 the PTS of the last previously filtered video frame, NAN if undefined
yading@10 21553
yading@10 21554
yading@10 21555 =item B<prev_selected_t>
yading@10 21556
yading@10 21557 the PTS of the last previously selected video frame, NAN if undefined
yading@10 21558
yading@10 21559
yading@10 21560 =item B<start_pts>
yading@10 21561
yading@10 21562 the PTS of the first video frame in the video, NAN if undefined
yading@10 21563
yading@10 21564
yading@10 21565 =item B<start_t>
yading@10 21566
yading@10 21567 the time of the first video frame in the video, NAN if undefined
yading@10 21568
yading@10 21569
yading@10 21570 =item B<pict_type> I<(video only)>
yading@10 21571
yading@10 21572 the type of the filtered frame, can assume one of the following
yading@10 21573 values:
yading@10 21574
yading@10 21575 =over 4
yading@10 21576
yading@10 21577
yading@10 21578 =item B<I>
yading@10 21579
yading@10 21580
yading@10 21581 =item B<P>
yading@10 21582
yading@10 21583
yading@10 21584 =item B<B>
yading@10 21585
yading@10 21586
yading@10 21587 =item B<S>
yading@10 21588
yading@10 21589
yading@10 21590 =item B<SI>
yading@10 21591
yading@10 21592
yading@10 21593 =item B<SP>
yading@10 21594
yading@10 21595
yading@10 21596 =item B<BI>
yading@10 21597
yading@10 21598
yading@10 21599 =back
yading@10 21600
yading@10 21601
yading@10 21602
yading@10 21603 =item B<interlace_type> I<(video only)>
yading@10 21604
yading@10 21605 the frame interlace type, can assume one of the following values:
yading@10 21606
yading@10 21607 =over 4
yading@10 21608
yading@10 21609
yading@10 21610 =item B<PROGRESSIVE>
yading@10 21611
yading@10 21612 the frame is progressive (not interlaced)
yading@10 21613
yading@10 21614 =item B<TOPFIRST>
yading@10 21615
yading@10 21616 the frame is top-field-first
yading@10 21617
yading@10 21618 =item B<BOTTOMFIRST>
yading@10 21619
yading@10 21620 the frame is bottom-field-first
yading@10 21621
yading@10 21622 =back
yading@10 21623
yading@10 21624
yading@10 21625
yading@10 21626 =item B<consumed_sample_n> I<(audio only)>
yading@10 21627
yading@10 21628 the number of selected samples before the current frame
yading@10 21629
yading@10 21630
yading@10 21631 =item B<samples_n> I<(audio only)>
yading@10 21632
yading@10 21633 the number of samples in the current frame
yading@10 21634
yading@10 21635
yading@10 21636 =item B<sample_rate> I<(audio only)>
yading@10 21637
yading@10 21638 the input sample rate
yading@10 21639
yading@10 21640
yading@10 21641 =item B<key>
yading@10 21642
yading@10 21643 1 if the filtered frame is a key-frame, 0 otherwise
yading@10 21644
yading@10 21645
yading@10 21646 =item B<pos>
yading@10 21647
yading@10 21648 the position in the file of the filtered frame, -1 if the information
yading@10 21649 is not available (e.g. for synthetic video)
yading@10 21650
yading@10 21651
yading@10 21652 =item B<scene> I<(video only)>
yading@10 21653
yading@10 21654 value between 0 and 1 to indicate a new scene; a low value reflects a low
yading@10 21655 probability for the current frame to introduce a new scene, while a higher
yading@10 21656 value means the current frame is more likely to be one (see the example below)
yading@10 21657
yading@10 21658
yading@10 21659 =back
yading@10 21660
yading@10 21661
yading@10 21662 The default value of the select expression is "1".
yading@10 21663
yading@10 21664
yading@10 21665 =head3 Examples
yading@10 21666
yading@10 21667
yading@10 21668
yading@10 21669 =over 4
yading@10 21670
yading@10 21671
yading@10 21672 =item *
yading@10 21673
yading@10 21674 Select all frames in input:
yading@10 21675
yading@10 21676 select
yading@10 21677
yading@10 21678
yading@10 21679 The example above is the same as:
yading@10 21680
yading@10 21681 select=1
yading@10 21682
yading@10 21683
yading@10 21684
yading@10 21685 =item *
yading@10 21686
yading@10 21687 Skip all frames:
yading@10 21688
yading@10 21689 select=0
yading@10 21690
yading@10 21691
yading@10 21692
yading@10 21693 =item *
yading@10 21694
yading@10 21695 Select only I-frames:
yading@10 21696
yading@10 21697 select='eq(pict_type\,I)'
yading@10 21698
yading@10 21699
yading@10 21700
yading@10 21701 =item *
yading@10 21702
yading@10 21703 Select one frame every 100:
yading@10 21704
yading@10 21705 select='not(mod(n\,100))'
yading@10 21706
yading@10 21707
yading@10 21708
yading@10 21709 =item *
yading@10 21710
yading@10 21711 Select only frames contained in the 10-20 time interval:
yading@10 21712
yading@10 21713 select='gte(t\,10)*lte(t\,20)'
yading@10 21714
yading@10 21715
yading@10 21716
yading@10 21717 =item *
yading@10 21718
yading@10 21719 Select only I frames contained in the 10-20 time interval:
yading@10 21720
yading@10 21721 select='gte(t\,10)*lte(t\,20)*eq(pict_type\,I)'
yading@10 21722
yading@10 21723
yading@10 21724
yading@10 21725 =item *
yading@10 21726
yading@10 21727 Select frames with a minimum distance of 10 seconds:
yading@10 21728
yading@10 21729 select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
yading@10 21730
yading@10 21731
yading@10 21732
yading@10 21733 =item *
yading@10 21734
yading@10 21735 Use aselect to select only audio frames with samples number E<gt> 100:
yading@10 21736
yading@10 21737 aselect='gt(samples_n\,100)'
yading@10 21738
yading@10 21739
yading@10 21740
yading@10 21741 =item *
yading@10 21742
yading@10 21743 Create a mosaic of the first scenes:
yading@10 21744
yading@10 21745 ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
yading@10 21746
yading@10 21747
yading@10 21748 Comparing I<scene> against a value between 0.3 and 0.5 is generally a sane
yading@10 21749 choice.
yading@10 21750
yading@10 21751
yading@10 21752 =item *
yading@10 21753
yading@10 21754 Send even and odd frames to separate outputs, and compose them:
yading@10 21755
yading@10 21756 select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
yading@10 21757
yading@10 21758
yading@10 21759 =back
yading@10 21760
yading@10 21761
yading@10 21762
yading@10 21763 =head2 asendcmd, sendcmd
yading@10 21764
yading@10 21765
yading@10 21766 Send commands to filters in the filtergraph.
yading@10 21767
yading@10 21768 These filters read commands to be sent to other filters in the
yading@10 21769 filtergraph.
yading@10 21770
yading@10 21771 C<asendcmd> must be inserted between two audio filters,
yading@10 21772 C<sendcmd> must be inserted between two video filters, but apart
yading@10 21773 from that they act the same way.
yading@10 21774
yading@10 21775 The specification of commands can be provided in the filter arguments
yading@10 21776 with the I<commands> option, or in a file specified by the
yading@10 21777 I<filename> option.
yading@10 21778
yading@10 21779 These filters accept the following options:
yading@10 21780
yading@10 21781 =over 4
yading@10 21782
yading@10 21783
yading@10 21784 =item B<commands, c>
yading@10 21785
yading@10 21786 Set the commands to be read and sent to the other filters.
yading@10 21787
yading@10 21788 =item B<filename, f>
yading@10 21789
yading@10 21790 Set the filename of the commands to be read and sent to the other
yading@10 21791 filters.
yading@10 21792
yading@10 21793 =back
yading@10 21794
yading@10 21795
yading@10 21796
yading@10 21797 =head3 Commands syntax
yading@10 21798
yading@10 21799
yading@10 21800 A commands description consists of a sequence of interval
yading@10 21801 specifications, comprising a list of commands to be executed when a
yading@10 21802 particular event related to that interval occurs. The occurring event
yading@10 21803 is typically the current frame time entering or leaving a given time
yading@10 21804 interval.
yading@10 21805
yading@10 21806 An interval is specified by the following syntax:
yading@10 21807
yading@10 21808 <START>[-<END>] <COMMANDS>;
yading@10 21809
yading@10 21810
yading@10 21811 The time interval is specified by the I<START> and I<END> times.
yading@10 21812 I<END> is optional and defaults to the maximum time.
yading@10 21813
yading@10 21814 The current frame time is considered within the specified interval if
yading@10 21815 it is included in the interval [I<START>, I<END>), that is when
yading@10 21816 the time is greater or equal to I<START> and is lesser than
yading@10 21817 I<END>.
yading@10 21818
yading@10 21819 I<COMMANDS> consists of a sequence of one or more command
yading@10 21820 specifications, separated by ",", relating to that interval. The
yading@10 21821 syntax of a command specification is given by:
yading@10 21822
yading@10 21823 [<FLAGS>] <TARGET> <COMMAND> <ARG>
yading@10 21824
yading@10 21825
yading@10 21826 I<FLAGS> is optional and specifies the type of events relating to
yading@10 21827 the time interval which enable sending the specified command, and must
yading@10 21828 be a non-null sequence of identifier flags separated by "+" or "|" and
yading@10 21829 enclosed between "[" and "]".
yading@10 21830
yading@10 21831 The following flags are recognized:
yading@10 21832
yading@10 21833 =over 4
yading@10 21834
yading@10 21835
yading@10 21836 =item B<enter>
yading@10 21837
yading@10 21838 The command is sent when the current frame timestamp enters the
yading@10 21839 specified interval. In other words, the command is sent when the
yading@10 21840 previous frame timestamp was not in the given interval, and the
yading@10 21841 current is.
yading@10 21842
yading@10 21843
yading@10 21844 =item B<leave>
yading@10 21845
yading@10 21846 The command is sent when the current frame timestamp leaves the
yading@10 21847 specified interval. In other words, the command is sent when the
yading@10 21848 previous frame timestamp was in the given interval, and the
yading@10 21849 current is not.
yading@10 21850
yading@10 21851 =back
yading@10 21852
yading@10 21853
yading@10 21854 If I<FLAGS> is not specified, a default value of C<[enter]> is
yading@10 21855 assumed.
yading@10 21856
yading@10 21857 I<TARGET> specifies the target of the command, usually the name of
yading@10 21858 the filter class or a specific filter instance name.
yading@10 21859
yading@10 21860 I<COMMAND> specifies the name of the command for the target filter.
yading@10 21861
yading@10 21862 I<ARG> is optional and specifies the optional list of argument for
yading@10 21863 the given I<COMMAND>.
yading@10 21864
yading@10 21865 Between one interval specification and another, whitespaces, or
yading@10 21866 sequences of characters starting with C<#> until the end of line,
yading@10 21867 are ignored and can be used to annotate comments.
yading@10 21868
yading@10 21869 A simplified BNF description of the commands specification syntax
yading@10 21870 follows:
yading@10 21871
yading@10 21872 <COMMAND_FLAG> ::= "enter" | "leave"
yading@10 21873 <COMMAND_FLAGS> ::= <COMMAND_FLAG> [(+|"|")<COMMAND_FLAG>]
yading@10 21874 <COMMAND> ::= ["[" <COMMAND_FLAGS> "]"] <TARGET> <COMMAND> [<ARG>]
yading@10 21875 <COMMANDS> ::= <COMMAND> [,<COMMANDS>]
yading@10 21876 <INTERVAL> ::= <START>[-<END>] <COMMANDS>
yading@10 21877 <INTERVALS> ::= <INTERVAL>[;<INTERVALS>]
yading@10 21878
yading@10 21879
yading@10 21880
yading@10 21881 =head3 Examples
yading@10 21882
yading@10 21883
yading@10 21884
yading@10 21885 =over 4
yading@10 21886
yading@10 21887
yading@10 21888 =item *
yading@10 21889
yading@10 21890 Specify audio tempo change at second 4:
yading@10 21891
yading@10 21892 asendcmd=c='4.0 atempo tempo 1.5',atempo
yading@10 21893
yading@10 21894
yading@10 21895
yading@10 21896 =item *
yading@10 21897
yading@10 21898 Specify a list of drawtext and hue commands in a file.
yading@10 21899
yading@10 21900 # show text in the interval 5-10
yading@10 21901 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
yading@10 21902 [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
yading@10 21903
yading@10 21904 # desaturate the image in the interval 15-20
yading@10 21905 15.0-20.0 [enter] hue s 0,
yading@10 21906 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
yading@10 21907 [leave] hue s 1,
yading@10 21908 [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
yading@10 21909
yading@10 21910 # apply an exponential saturation fade-out effect, starting from time 25
yading@10 21911 25 [enter] hue s exp(25-t)
yading@10 21912
yading@10 21913
yading@10 21914 A filtergraph allowing to read and process the above command list
yading@10 21915 stored in a file F<test.cmd>, can be specified with:
yading@10 21916
yading@10 21917 sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
yading@10 21918
yading@10 21919
yading@10 21920 =back
yading@10 21921
yading@10 21922
yading@10 21923
yading@10 21924
yading@10 21925 =head2 asetpts, setpts
yading@10 21926
yading@10 21927
yading@10 21928 Change the PTS (presentation timestamp) of the input frames.
yading@10 21929
yading@10 21930 C<asetpts> works on audio frames, C<setpts> on video frames.
yading@10 21931
yading@10 21932 This filter accepts the following options:
yading@10 21933
yading@10 21934
yading@10 21935 =over 4
yading@10 21936
yading@10 21937
yading@10 21938
yading@10 21939 =item B<expr>
yading@10 21940
yading@10 21941 The expression which is evaluated for each frame to construct its timestamp.
yading@10 21942
yading@10 21943
yading@10 21944 =back
yading@10 21945
yading@10 21946
yading@10 21947 The expression is evaluated through the eval API and can contain the following
yading@10 21948 constants:
yading@10 21949
yading@10 21950
yading@10 21951 =over 4
yading@10 21952
yading@10 21953
yading@10 21954 =item B<FRAME_RATE>
yading@10 21955
yading@10 21956 frame rate, only defined for constant frame-rate video
yading@10 21957
yading@10 21958
yading@10 21959 =item B<PTS>
yading@10 21960
yading@10 21961 the presentation timestamp in input
yading@10 21962
yading@10 21963
yading@10 21964 =item B<N>
yading@10 21965
yading@10 21966 the count of the input frame, starting from 0.
yading@10 21967
yading@10 21968
yading@10 21969 =item B<NB_CONSUMED_SAMPLES>
yading@10 21970
yading@10 21971 the number of consumed samples, not including the current frame (only
yading@10 21972 audio)
yading@10 21973
yading@10 21974
yading@10 21975 =item B<NB_SAMPLES>
yading@10 21976
yading@10 21977 the number of samples in the current frame (only audio)
yading@10 21978
yading@10 21979
yading@10 21980 =item B<SAMPLE_RATE>
yading@10 21981
yading@10 21982 audio sample rate
yading@10 21983
yading@10 21984
yading@10 21985 =item B<STARTPTS>
yading@10 21986
yading@10 21987 the PTS of the first frame
yading@10 21988
yading@10 21989
yading@10 21990 =item B<STARTT>
yading@10 21991
yading@10 21992 the time in seconds of the first frame
yading@10 21993
yading@10 21994
yading@10 21995 =item B<INTERLACED>
yading@10 21996
yading@10 21997 tell if the current frame is interlaced
yading@10 21998
yading@10 21999
yading@10 22000 =item B<T>
yading@10 22001
yading@10 22002 the time in seconds of the current frame
yading@10 22003
yading@10 22004
yading@10 22005 =item B<TB>
yading@10 22006
yading@10 22007 the time base
yading@10 22008
yading@10 22009
yading@10 22010 =item B<POS>
yading@10 22011
yading@10 22012 original position in the file of the frame, or undefined if undefined
yading@10 22013 for the current frame
yading@10 22014
yading@10 22015
yading@10 22016 =item B<PREV_INPTS>
yading@10 22017
yading@10 22018 previous input PTS
yading@10 22019
yading@10 22020
yading@10 22021 =item B<PREV_INT>
yading@10 22022
yading@10 22023 previous input time in seconds
yading@10 22024
yading@10 22025
yading@10 22026 =item B<PREV_OUTPTS>
yading@10 22027
yading@10 22028 previous output PTS
yading@10 22029
yading@10 22030
yading@10 22031 =item B<PREV_OUTT>
yading@10 22032
yading@10 22033 previous output time in seconds
yading@10 22034
yading@10 22035
yading@10 22036 =item B<RTCTIME>
yading@10 22037
yading@10 22038 wallclock (RTC) time in microseconds. This is deprecated, use time(0)
yading@10 22039 instead.
yading@10 22040
yading@10 22041
yading@10 22042 =item B<RTCSTART>
yading@10 22043
yading@10 22044 wallclock (RTC) time at the start of the movie in microseconds
yading@10 22045
yading@10 22046 =back
yading@10 22047
yading@10 22048
yading@10 22049
yading@10 22050 =head3 Examples
yading@10 22051
yading@10 22052
yading@10 22053
yading@10 22054 =over 4
yading@10 22055
yading@10 22056
yading@10 22057 =item *
yading@10 22058
yading@10 22059 Start counting PTS from zero
yading@10 22060
yading@10 22061 setpts=PTS-STARTPTS
yading@10 22062
yading@10 22063
yading@10 22064
yading@10 22065 =item *
yading@10 22066
yading@10 22067 Apply fast motion effect:
yading@10 22068
yading@10 22069 setpts=0.5*PTS
yading@10 22070
yading@10 22071
yading@10 22072
yading@10 22073 =item *
yading@10 22074
yading@10 22075 Apply slow motion effect:
yading@10 22076
yading@10 22077 setpts=2.0*PTS
yading@10 22078
yading@10 22079
yading@10 22080
yading@10 22081 =item *
yading@10 22082
yading@10 22083 Set fixed rate of 25 frames per second:
yading@10 22084
yading@10 22085 setpts=N/(25*TB)
yading@10 22086
yading@10 22087
yading@10 22088
yading@10 22089 =item *
yading@10 22090
yading@10 22091 Set fixed rate 25 fps with some jitter:
yading@10 22092
yading@10 22093 setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
yading@10 22094
yading@10 22095
yading@10 22096
yading@10 22097 =item *
yading@10 22098
yading@10 22099 Apply an offset of 10 seconds to the input PTS:
yading@10 22100
yading@10 22101 setpts=PTS+10/TB
yading@10 22102
yading@10 22103
yading@10 22104
yading@10 22105 =item *
yading@10 22106
yading@10 22107 Generate timestamps from a "live source" and rebase onto the current timebase:
yading@10 22108
yading@10 22109 setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
yading@10 22110
yading@10 22111
yading@10 22112 =back
yading@10 22113
yading@10 22114
yading@10 22115
yading@10 22116 =head2 ebur128
yading@10 22117
yading@10 22118
yading@10 22119 EBU R128 scanner filter. This filter takes an audio stream as input and outputs
yading@10 22120 it unchanged. By default, it logs a message at a frequency of 10Hz with the
yading@10 22121 Momentary loudness (identified by C<M>), Short-term loudness (C<S>),
yading@10 22122 Integrated loudness (C<I>) and Loudness Range (C<LRA>).
yading@10 22123
yading@10 22124 The filter also has a video output (see the I<video> option) with a real
yading@10 22125 time graph to observe the loudness evolution. The graphic contains the logged
yading@10 22126 message mentioned above, so it is not printed anymore when this option is set,
yading@10 22127 unless the verbose logging is set. The main graphing area contains the
yading@10 22128 short-term loudness (3 seconds of analysis), and the gauge on the right is for
yading@10 22129 the momentary loudness (400 milliseconds).
yading@10 22130
yading@10 22131 More information about the Loudness Recommendation EBU R128 on
yading@10 22132 E<lt>B<http://tech.ebu.ch/loudness>E<gt>.
yading@10 22133
yading@10 22134 The filter accepts the following options:
yading@10 22135
yading@10 22136
yading@10 22137 =over 4
yading@10 22138
yading@10 22139
yading@10 22140
yading@10 22141 =item B<video>
yading@10 22142
yading@10 22143 Activate the video output. The audio stream is passed unchanged whether this
yading@10 22144 option is set or no. The video stream will be the first output stream if
yading@10 22145 activated. Default is C<0>.
yading@10 22146
yading@10 22147
yading@10 22148 =item B<size>
yading@10 22149
yading@10 22150 Set the video size. This option is for video only. Default and minimum
yading@10 22151 resolution is C<640x480>.
yading@10 22152
yading@10 22153
yading@10 22154 =item B<meter>
yading@10 22155
yading@10 22156 Set the EBU scale meter. Default is C<9>. Common values are C<9> and
yading@10 22157 C<18>, respectively for EBU scale meter +9 and EBU scale meter +18. Any
yading@10 22158 other integer value between this range is allowed.
yading@10 22159
yading@10 22160
yading@10 22161 =item B<metadata>
yading@10 22162
yading@10 22163 Set metadata injection. If set to C<1>, the audio input will be segmented
yading@10 22164 into 100ms output frames, each of them containing various loudness information
yading@10 22165 in metadata. All the metadata keys are prefixed with C<lavfi.r128.>.
yading@10 22166
yading@10 22167 Default is C<0>.
yading@10 22168
yading@10 22169
yading@10 22170 =item B<framelog>
yading@10 22171
yading@10 22172 Force the frame logging level.
yading@10 22173
yading@10 22174 Available values are:
yading@10 22175
yading@10 22176 =over 4
yading@10 22177
yading@10 22178
yading@10 22179 =item B<info>
yading@10 22180
yading@10 22181 information logging level
yading@10 22182
yading@10 22183 =item B<verbose>
yading@10 22184
yading@10 22185 verbose logging level
yading@10 22186
yading@10 22187 =back
yading@10 22188
yading@10 22189
yading@10 22190 By default, the logging level is set to I<info>. If the B<video> or
yading@10 22191 the B<metadata> options are set, it switches to I<verbose>.
yading@10 22192
yading@10 22193 =back
yading@10 22194
yading@10 22195
yading@10 22196
yading@10 22197 =head3 Examples
yading@10 22198
yading@10 22199
yading@10 22200
yading@10 22201 =over 4
yading@10 22202
yading@10 22203
yading@10 22204 =item *
yading@10 22205
yading@10 22206 Real-time graph using B<ffplay>, with a EBU scale meter +18:
yading@10 22207
yading@10 22208 ffplay -f lavfi -i "amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]"
yading@10 22209
yading@10 22210
yading@10 22211
yading@10 22212 =item *
yading@10 22213
yading@10 22214 Run an analysis with B<ffmpeg>:
yading@10 22215
yading@10 22216 ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
yading@10 22217
yading@10 22218
yading@10 22219 =back
yading@10 22220
yading@10 22221
yading@10 22222
yading@10 22223 =head2 settb, asettb
yading@10 22224
yading@10 22225
yading@10 22226 Set the timebase to use for the output frames timestamps.
yading@10 22227 It is mainly useful for testing timebase configuration.
yading@10 22228
yading@10 22229 This filter accepts the following options:
yading@10 22230
yading@10 22231
yading@10 22232 =over 4
yading@10 22233
yading@10 22234
yading@10 22235
yading@10 22236 =item B<expr, tb>
yading@10 22237
yading@10 22238 The expression which is evaluated into the output timebase.
yading@10 22239
yading@10 22240
yading@10 22241 =back
yading@10 22242
yading@10 22243
yading@10 22244 The value for B<tb> is an arithmetic expression representing a
yading@10 22245 rational. The expression can contain the constants "AVTB" (the default
yading@10 22246 timebase), "intb" (the input timebase) and "sr" (the sample rate,
yading@10 22247 audio only). Default value is "intb".
yading@10 22248
yading@10 22249
yading@10 22250 =head3 Examples
yading@10 22251
yading@10 22252
yading@10 22253
yading@10 22254 =over 4
yading@10 22255
yading@10 22256
yading@10 22257 =item *
yading@10 22258
yading@10 22259 Set the timebase to 1/25:
yading@10 22260
yading@10 22261 settb=expr=1/25
yading@10 22262
yading@10 22263
yading@10 22264
yading@10 22265 =item *
yading@10 22266
yading@10 22267 Set the timebase to 1/10:
yading@10 22268
yading@10 22269 settb=expr=0.1
yading@10 22270
yading@10 22271
yading@10 22272
yading@10 22273 =item *
yading@10 22274
yading@10 22275 Set the timebase to 1001/1000:
yading@10 22276
yading@10 22277 settb=1+0.001
yading@10 22278
yading@10 22279
yading@10 22280
yading@10 22281 =item *
yading@10 22282
yading@10 22283 Set the timebase to 2*intb:
yading@10 22284
yading@10 22285 settb=2*intb
yading@10 22286
yading@10 22287
yading@10 22288
yading@10 22289 =item *
yading@10 22290
yading@10 22291 Set the default timebase value:
yading@10 22292
yading@10 22293 settb=AVTB
yading@10 22294
yading@10 22295
yading@10 22296 =back
yading@10 22297
yading@10 22298
yading@10 22299
yading@10 22300 =head2 concat
yading@10 22301
yading@10 22302
yading@10 22303 Concatenate audio and video streams, joining them together one after the
yading@10 22304 other.
yading@10 22305
yading@10 22306 The filter works on segments of synchronized video and audio streams. All
yading@10 22307 segments must have the same number of streams of each type, and that will
yading@10 22308 also be the number of streams at output.
yading@10 22309
yading@10 22310 The filter accepts the following options:
yading@10 22311
yading@10 22312
yading@10 22313 =over 4
yading@10 22314
yading@10 22315
yading@10 22316
yading@10 22317 =item B<n>
yading@10 22318
yading@10 22319 Set the number of segments. Default is 2.
yading@10 22320
yading@10 22321
yading@10 22322 =item B<v>
yading@10 22323
yading@10 22324 Set the number of output video streams, that is also the number of video
yading@10 22325 streams in each segment. Default is 1.
yading@10 22326
yading@10 22327
yading@10 22328 =item B<a>
yading@10 22329
yading@10 22330 Set the number of output audio streams, that is also the number of video
yading@10 22331 streams in each segment. Default is 0.
yading@10 22332
yading@10 22333
yading@10 22334 =item B<unsafe>
yading@10 22335
yading@10 22336 Activate unsafe mode: do not fail if segments have a different format.
yading@10 22337
yading@10 22338
yading@10 22339 =back
yading@10 22340
yading@10 22341
yading@10 22342 The filter has I<v>+I<a> outputs: first I<v> video outputs, then
yading@10 22343 I<a> audio outputs.
yading@10 22344
yading@10 22345 There are I<n>x(I<v>+I<a>) inputs: first the inputs for the first
yading@10 22346 segment, in the same order as the outputs, then the inputs for the second
yading@10 22347 segment, etc.
yading@10 22348
yading@10 22349 Related streams do not always have exactly the same duration, for various
yading@10 22350 reasons including codec frame size or sloppy authoring. For that reason,
yading@10 22351 related synchronized streams (e.g. a video and its audio track) should be
yading@10 22352 concatenated at once. The concat filter will use the duration of the longest
yading@10 22353 stream in each segment (except the last one), and if necessary pad shorter
yading@10 22354 audio streams with silence.
yading@10 22355
yading@10 22356 For this filter to work correctly, all segments must start at timestamp 0.
yading@10 22357
yading@10 22358 All corresponding streams must have the same parameters in all segments; the
yading@10 22359 filtering system will automatically select a common pixel format for video
yading@10 22360 streams, and a common sample format, sample rate and channel layout for
yading@10 22361 audio streams, but other settings, such as resolution, must be converted
yading@10 22362 explicitly by the user.
yading@10 22363
yading@10 22364 Different frame rates are acceptable but will result in variable frame rate
yading@10 22365 at output; be sure to configure the output file to handle it.
yading@10 22366
yading@10 22367
yading@10 22368 =head3 Examples
yading@10 22369
yading@10 22370
yading@10 22371
yading@10 22372 =over 4
yading@10 22373
yading@10 22374
yading@10 22375 =item *
yading@10 22376
yading@10 22377 Concatenate an opening, an episode and an ending, all in bilingual version
yading@10 22378 (video in stream 0, audio in streams 1 and 2):
yading@10 22379
yading@10 22380 ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
yading@10 22381 '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
yading@10 22382 concat=n=3:v=1:a=2 [v] [a1] [a2]' \
yading@10 22383 -map '[v]' -map '[a1]' -map '[a2]' output.mkv
yading@10 22384
yading@10 22385
yading@10 22386
yading@10 22387 =item *
yading@10 22388
yading@10 22389 Concatenate two parts, handling audio and video separately, using the
yading@10 22390 (a)movie sources, and adjusting the resolution:
yading@10 22391
yading@10 22392 movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
yading@10 22393 movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
yading@10 22394 [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
yading@10 22395
yading@10 22396 Note that a desync will happen at the stitch if the audio and video streams
yading@10 22397 do not have exactly the same duration in the first file.
yading@10 22398
yading@10 22399
yading@10 22400 =back
yading@10 22401
yading@10 22402
yading@10 22403
yading@10 22404 =head2 showspectrum
yading@10 22405
yading@10 22406
yading@10 22407 Convert input audio to a video output, representing the audio frequency
yading@10 22408 spectrum.
yading@10 22409
yading@10 22410 The filter accepts the following options:
yading@10 22411
yading@10 22412
yading@10 22413 =over 4
yading@10 22414
yading@10 22415
yading@10 22416 =item B<size, s>
yading@10 22417
yading@10 22418 Specify the video size for the output. Default value is C<640x512>.
yading@10 22419
yading@10 22420
yading@10 22421 =item B<slide>
yading@10 22422
yading@10 22423 Specify if the spectrum should slide along the window. Default value is
yading@10 22424 C<0>.
yading@10 22425
yading@10 22426
yading@10 22427 =item B<mode>
yading@10 22428
yading@10 22429 Specify display mode.
yading@10 22430
yading@10 22431 It accepts the following values:
yading@10 22432
yading@10 22433 =over 4
yading@10 22434
yading@10 22435
yading@10 22436 =item B<combined>
yading@10 22437
yading@10 22438 all channels are displayed in the same row
yading@10 22439
yading@10 22440 =item B<separate>
yading@10 22441
yading@10 22442 all channels are displayed in separate rows
yading@10 22443
yading@10 22444 =back
yading@10 22445
yading@10 22446
yading@10 22447 Default value is B<combined>.
yading@10 22448
yading@10 22449
yading@10 22450 =item B<color>
yading@10 22451
yading@10 22452 Specify display color mode.
yading@10 22453
yading@10 22454 It accepts the following values:
yading@10 22455
yading@10 22456 =over 4
yading@10 22457
yading@10 22458
yading@10 22459 =item B<channel>
yading@10 22460
yading@10 22461 each channel is displayed in a separate color
yading@10 22462
yading@10 22463 =item B<intensity>
yading@10 22464
yading@10 22465 each channel is is displayed using the same color scheme
yading@10 22466
yading@10 22467 =back
yading@10 22468
yading@10 22469
yading@10 22470 Default value is B<channel>.
yading@10 22471
yading@10 22472
yading@10 22473 =item B<scale>
yading@10 22474
yading@10 22475 Specify scale used for calculating intensity color values.
yading@10 22476
yading@10 22477 It accepts the following values:
yading@10 22478
yading@10 22479 =over 4
yading@10 22480
yading@10 22481
yading@10 22482 =item B<lin>
yading@10 22483
yading@10 22484 linear
yading@10 22485
yading@10 22486 =item B<sqrt>
yading@10 22487
yading@10 22488 square root, default
yading@10 22489
yading@10 22490 =item B<cbrt>
yading@10 22491
yading@10 22492 cubic root
yading@10 22493
yading@10 22494 =item B<log>
yading@10 22495
yading@10 22496 logarithmic
yading@10 22497
yading@10 22498 =back
yading@10 22499
yading@10 22500
yading@10 22501 Default value is B<sqrt>.
yading@10 22502
yading@10 22503
yading@10 22504 =item B<saturation>
yading@10 22505
yading@10 22506 Set saturation modifier for displayed colors. Negative values provide
yading@10 22507 alternative color scheme. C<0> is no saturation at all.
yading@10 22508 Saturation must be in [-10.0, 10.0] range.
yading@10 22509 Default value is C<1>.
yading@10 22510
yading@10 22511 =back
yading@10 22512
yading@10 22513
yading@10 22514 The usage is very similar to the showwaves filter; see the examples in that
yading@10 22515 section.
yading@10 22516
yading@10 22517
yading@10 22518 =head3 Examples
yading@10 22519
yading@10 22520
yading@10 22521
yading@10 22522 =over 4
yading@10 22523
yading@10 22524
yading@10 22525 =item *
yading@10 22526
yading@10 22527 Large window with logarithmic color scaling:
yading@10 22528
yading@10 22529 showspectrum=s=1280x480:scale=log
yading@10 22530
yading@10 22531
yading@10 22532
yading@10 22533 =item *
yading@10 22534
yading@10 22535 Complete example for a colored and sliding spectrum per channel using B<ffplay>:
yading@10 22536
yading@10 22537 ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
yading@10 22538 [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
yading@10 22539
yading@10 22540
yading@10 22541 =back
yading@10 22542
yading@10 22543
yading@10 22544
yading@10 22545 =head2 showwaves
yading@10 22546
yading@10 22547
yading@10 22548 Convert input audio to a video output, representing the samples waves.
yading@10 22549
yading@10 22550 The filter accepts the following options:
yading@10 22551
yading@10 22552
yading@10 22553 =over 4
yading@10 22554
yading@10 22555
yading@10 22556 =item B<size, s>
yading@10 22557
yading@10 22558 Specify the video size for the output. Default value is "600x240".
yading@10 22559
yading@10 22560
yading@10 22561 =item B<mode>
yading@10 22562
yading@10 22563 Set display mode.
yading@10 22564
yading@10 22565 Available values are:
yading@10 22566
yading@10 22567 =over 4
yading@10 22568
yading@10 22569
yading@10 22570 =item B<point>
yading@10 22571
yading@10 22572 Draw a point for each sample.
yading@10 22573
yading@10 22574
yading@10 22575 =item B<line>
yading@10 22576
yading@10 22577 Draw a vertical line for each sample.
yading@10 22578
yading@10 22579 =back
yading@10 22580
yading@10 22581
yading@10 22582 Default value is C<point>.
yading@10 22583
yading@10 22584
yading@10 22585 =item B<n>
yading@10 22586
yading@10 22587 Set the number of samples which are printed on the same column. A
yading@10 22588 larger value will decrease the frame rate. Must be a positive
yading@10 22589 integer. This option can be set only if the value for I<rate>
yading@10 22590 is not explicitly specified.
yading@10 22591
yading@10 22592
yading@10 22593 =item B<rate, r>
yading@10 22594
yading@10 22595 Set the (approximate) output frame rate. This is done by setting the
yading@10 22596 option I<n>. Default value is "25".
yading@10 22597
yading@10 22598
yading@10 22599 =back
yading@10 22600
yading@10 22601
yading@10 22602
yading@10 22603 =head3 Examples
yading@10 22604
yading@10 22605
yading@10 22606
yading@10 22607 =over 4
yading@10 22608
yading@10 22609
yading@10 22610 =item *
yading@10 22611
yading@10 22612 Output the input file audio and the corresponding video representation
yading@10 22613 at the same time:
yading@10 22614
yading@10 22615 amovie=a.mp3,asplit[out0],showwaves[out1]
yading@10 22616
yading@10 22617
yading@10 22618
yading@10 22619 =item *
yading@10 22620
yading@10 22621 Create a synthetic signal and show it with showwaves, forcing a
yading@10 22622 frame rate of 30 frames per second:
yading@10 22623
yading@10 22624 aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
yading@10 22625
yading@10 22626
yading@10 22627 =back
yading@10 22628
yading@10 22629
yading@10 22630
yading@10 22631 =head2 split, asplit
yading@10 22632
yading@10 22633
yading@10 22634 Split input into several identical outputs.
yading@10 22635
yading@10 22636 C<asplit> works with audio input, C<split> with video.
yading@10 22637
yading@10 22638 The filter accepts a single parameter which specifies the number of outputs. If
yading@10 22639 unspecified, it defaults to 2.
yading@10 22640
yading@10 22641
yading@10 22642 =head3 Examples
yading@10 22643
yading@10 22644
yading@10 22645
yading@10 22646 =over 4
yading@10 22647
yading@10 22648
yading@10 22649 =item *
yading@10 22650
yading@10 22651 Create two separate outputs from the same input:
yading@10 22652
yading@10 22653 [in] split [out0][out1]
yading@10 22654
yading@10 22655
yading@10 22656
yading@10 22657 =item *
yading@10 22658
yading@10 22659 To create 3 or more outputs, you need to specify the number of
yading@10 22660 outputs, like in:
yading@10 22661
yading@10 22662 [in] asplit=3 [out0][out1][out2]
yading@10 22663
yading@10 22664
yading@10 22665
yading@10 22666 =item *
yading@10 22667
yading@10 22668 Create two separate outputs from the same input, one cropped and
yading@10 22669 one padded:
yading@10 22670
yading@10 22671 [in] split [splitout1][splitout2];
yading@10 22672 [splitout1] crop=100:100:0:0 [cropout];
yading@10 22673 [splitout2] pad=200:200:100:100 [padout];
yading@10 22674
yading@10 22675
yading@10 22676
yading@10 22677 =item *
yading@10 22678
yading@10 22679 Create 5 copies of the input audio with B<ffmpeg>:
yading@10 22680
yading@10 22681 ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
yading@10 22682
yading@10 22683
yading@10 22684 =back
yading@10 22685
yading@10 22686
yading@10 22687
yading@10 22688
yading@10 22689 =head1 MULTIMEDIA SOURCES
yading@10 22690
yading@10 22691
yading@10 22692 Below is a description of the currently available multimedia sources.
yading@10 22693
yading@10 22694
yading@10 22695 =head2 amovie
yading@10 22696
yading@10 22697
yading@10 22698 This is the same as movie source, except it selects an audio
yading@10 22699 stream by default.
yading@10 22700
yading@10 22701
yading@10 22702
yading@10 22703 =head2 movie
yading@10 22704
yading@10 22705
yading@10 22706 Read audio and/or video stream(s) from a movie container.
yading@10 22707
yading@10 22708 This filter accepts the following options:
yading@10 22709
yading@10 22710
yading@10 22711 =over 4
yading@10 22712
yading@10 22713
yading@10 22714 =item B<filename>
yading@10 22715
yading@10 22716 The name of the resource to read (not necessarily a file but also a device or a
yading@10 22717 stream accessed through some protocol).
yading@10 22718
yading@10 22719
yading@10 22720 =item B<format_name, f>
yading@10 22721
yading@10 22722 Specifies the format assumed for the movie to read, and can be either
yading@10 22723 the name of a container or an input device. If not specified the
yading@10 22724 format is guessed from I<movie_name> or by probing.
yading@10 22725
yading@10 22726
yading@10 22727 =item B<seek_point, sp>
yading@10 22728
yading@10 22729 Specifies the seek point in seconds, the frames will be output
yading@10 22730 starting from this seek point, the parameter is evaluated with
yading@10 22731 C<av_strtod> so the numerical value may be suffixed by an IS
yading@10 22732 postfix. Default value is "0".
yading@10 22733
yading@10 22734
yading@10 22735 =item B<streams, s>
yading@10 22736
yading@10 22737 Specifies the streams to read. Several streams can be specified,
yading@10 22738 separated by "+". The source will then have as many outputs, in the
yading@10 22739 same order. The syntax is explained in the ``Stream specifiers''
yading@10 22740 section in the ffmpeg manual. Two special names, "dv" and "da" specify
yading@10 22741 respectively the default (best suited) video and audio stream. Default
yading@10 22742 is "dv", or "da" if the filter is called as "amovie".
yading@10 22743
yading@10 22744
yading@10 22745 =item B<stream_index, si>
yading@10 22746
yading@10 22747 Specifies the index of the video stream to read. If the value is -1,
yading@10 22748 the best suited video stream will be automatically selected. Default
yading@10 22749 value is "-1". Deprecated. If the filter is called "amovie", it will select
yading@10 22750 audio instead of video.
yading@10 22751
yading@10 22752
yading@10 22753 =item B<loop>
yading@10 22754
yading@10 22755 Specifies how many times to read the stream in sequence.
yading@10 22756 If the value is less than 1, the stream will be read again and again.
yading@10 22757 Default value is "1".
yading@10 22758
yading@10 22759 Note that when the movie is looped the source timestamps are not
yading@10 22760 changed, so it will generate non monotonically increasing timestamps.
yading@10 22761
yading@10 22762 =back
yading@10 22763
yading@10 22764
yading@10 22765 This filter allows to overlay a second video on top of main input of
yading@10 22766 a filtergraph as shown in this graph:
yading@10 22767
yading@10 22768 input -----------> deltapts0 --> overlay --> output
yading@10 22769 ^
yading@10 22770 |
yading@10 22771 movie --> scale--> deltapts1 -------+
yading@10 22772
yading@10 22773
yading@10 22774
yading@10 22775 =head3 Examples
yading@10 22776
yading@10 22777
yading@10 22778
yading@10 22779 =over 4
yading@10 22780
yading@10 22781
yading@10 22782 =item *
yading@10 22783
yading@10 22784 Skip 3.2 seconds from the start of the avi file in.avi, and overlay it
yading@10 22785 on top of the input labelled as "in":
yading@10 22786
yading@10 22787 movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
yading@10 22788 [in] setpts=PTS-STARTPTS [main];
yading@10 22789 [main][over] overlay=16:16 [out]
yading@10 22790
yading@10 22791
yading@10 22792
yading@10 22793 =item *
yading@10 22794
yading@10 22795 Read from a video4linux2 device, and overlay it on top of the input
yading@10 22796 labelled as "in":
yading@10 22797
yading@10 22798 movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
yading@10 22799 [in] setpts=PTS-STARTPTS [main];
yading@10 22800 [main][over] overlay=16:16 [out]
yading@10 22801
yading@10 22802
yading@10 22803
yading@10 22804 =item *
yading@10 22805
yading@10 22806 Read the first video stream and the audio stream with id 0x81 from
yading@10 22807 dvd.vob; the video is connected to the pad named "video" and the audio is
yading@10 22808 connected to the pad named "audio":
yading@10 22809
yading@10 22810 movie=dvd.vob:s=v:0+#0x81 [video] [audio]
yading@10 22811
yading@10 22812
yading@10 22813 =back
yading@10 22814
yading@10 22815
yading@10 22816
yading@10 22817
yading@10 22818 =head1 SEE ALSO
yading@10 22819
yading@10 22820
yading@10 22821
yading@10 22822 ffmpeg(1),
yading@10 22823 ffplay(1), ffprobe(1), ffserver(1),
yading@10 22824 ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1),
yading@10 22825 ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1),
yading@10 22826 ffmpeg-devices(1), ffmpeg-protocols(1), ffmpeg-filters(1)
yading@10 22827
yading@10 22828
yading@10 22829 =head1 AUTHORS
yading@10 22830
yading@10 22831
yading@10 22832 The FFmpeg developers.
yading@10 22833
yading@10 22834 For details about the authorship, see the Git history of the project
yading@10 22835 (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
yading@10 22836 B<git log> in the FFmpeg source directory, or browsing the
yading@10 22837 online repository at E<lt>B<http://source.ffmpeg.org>E<gt>.
yading@10 22838
yading@10 22839 Maintainers for the specific components are listed in the file
yading@10 22840 F<MAINTAINERS> in the source code tree.
yading@10 22841
yading@10 22842
yading@10 22843