annotate ffmpeg/doc/ffserver-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 ffserver - ffserver video server
yading@10 4
yading@10 5 =head1 SYNOPSIS
yading@10 6
yading@10 7
yading@10 8 ffserver [I<options>]
yading@10 9
yading@10 10
yading@10 11 =head1 DESCRIPTION
yading@10 12
yading@10 13
yading@10 14 B<ffserver> is a streaming server for both audio and video. It
yading@10 15 supports several live feeds, streaming from files and time shifting on
yading@10 16 live feeds (you can seek to positions in the past on each live feed,
yading@10 17 provided you specify a big enough feed storage in
yading@10 18 F<ffserver.conf>).
yading@10 19
yading@10 20 B<ffserver> receives prerecorded files or FFM streams from some
yading@10 21 B<ffmpeg> instance as input, then streams them over
yading@10 22 RTP/RTSP/HTTP.
yading@10 23
yading@10 24 An B<ffserver> instance will listen on some port as specified
yading@10 25 in the configuration file. You can launch one or more instances of
yading@10 26 B<ffmpeg> and send one or more FFM streams to the port where
yading@10 27 ffserver is expecting to receive them. Alternately, you can make
yading@10 28 B<ffserver> launch such B<ffmpeg> instances at startup.
yading@10 29
yading@10 30 Input streams are called feeds, and each one is specified by a
yading@10 31 C<E<lt>FeedE<gt>> section in the configuration file.
yading@10 32
yading@10 33 For each feed you can have different output streams in various
yading@10 34 formats, each one specified by a C<E<lt>StreamE<gt>> section in the
yading@10 35 configuration file.
yading@10 36
yading@10 37
yading@10 38 =head2 Status stream
yading@10 39
yading@10 40
yading@10 41 ffserver supports an HTTP interface which exposes the current status
yading@10 42 of the server.
yading@10 43
yading@10 44 Simply point your browser to the address of the special status stream
yading@10 45 specified in the configuration file.
yading@10 46
yading@10 47 For example if you have:
yading@10 48
yading@10 49 <Stream status.html>
yading@10 50 Format status
yading@10 51
yading@10 52 # Only allow local people to get the status
yading@10 53 ACL allow localhost
yading@10 54 ACL allow 192.168.0.0 192.168.255.255
yading@10 55 </Stream>
yading@10 56
yading@10 57
yading@10 58 then the server will post a page with the status information when
yading@10 59 the special stream F<status.html> is requested.
yading@10 60
yading@10 61
yading@10 62 =head2 What can this do?
yading@10 63
yading@10 64
yading@10 65 When properly configured and running, you can capture video and audio in real
yading@10 66 time from a suitable capture card, and stream it out over the Internet to
yading@10 67 either Windows Media Player or RealAudio player (with some restrictions).
yading@10 68
yading@10 69 It can also stream from files, though that is currently broken. Very often, a
yading@10 70 web server can be used to serve up the files just as well.
yading@10 71
yading@10 72 It can stream prerecorded video from .ffm files, though it is somewhat tricky
yading@10 73 to make it work correctly.
yading@10 74
yading@10 75
yading@10 76 =head2 How do I make it work?
yading@10 77
yading@10 78
yading@10 79 First, build the kit. It *really* helps to have installed LAME first. Then when
yading@10 80 you run the ffserver ./configure, make sure that you have the
yading@10 81 C<--enable-libmp3lame> flag turned on.
yading@10 82
yading@10 83 LAME is important as it allows for streaming audio to Windows Media Player.
yading@10 84 Don't ask why the other audio types do not work.
yading@10 85
yading@10 86 As a simple test, just run the following two command lines where INPUTFILE
yading@10 87 is some file which you can decode with ffmpeg:
yading@10 88
yading@10 89
yading@10 90 ffserver -f doc/ffserver.conf &
yading@10 91 ffmpeg -i INPUTFILE http://localhost:8090/feed1.ffm
yading@10 92
yading@10 93
yading@10 94 At this point you should be able to go to your Windows machine and fire up
yading@10 95 Windows Media Player (WMP). Go to Open URL and enter
yading@10 96
yading@10 97
yading@10 98 http://<linuxbox>:8090/test.asf
yading@10 99
yading@10 100
yading@10 101 You should (after a short delay) see video and hear audio.
yading@10 102
yading@10 103 WARNING: trying to stream test1.mpg doesn't work with WMP as it tries to
yading@10 104 transfer the entire file before starting to play.
yading@10 105 The same is true of AVI files.
yading@10 106
yading@10 107
yading@10 108 =head2 What happens next?
yading@10 109
yading@10 110
yading@10 111 You should edit the ffserver.conf file to suit your needs (in terms of
yading@10 112 frame rates etc). Then install ffserver and ffmpeg, write a script to start
yading@10 113 them up, and off you go.
yading@10 114
yading@10 115
yading@10 116 =head2 Troubleshooting
yading@10 117
yading@10 118
yading@10 119
yading@10 120 =head3 I don't hear any audio, but video is fine.
yading@10 121
yading@10 122
yading@10 123 Maybe you didn't install LAME, or got your ./configure statement wrong. Check
yading@10 124 the ffmpeg output to see if a line referring to MP3 is present. If not, then
yading@10 125 your configuration was incorrect. If it is, then maybe your wiring is not
yading@10 126 set up correctly. Maybe the sound card is not getting data from the right
yading@10 127 input source. Maybe you have a really awful audio interface (like I do)
yading@10 128 that only captures in stereo and also requires that one channel be flipped.
yading@10 129 If you are one of these people, then export 'AUDIO_FLIP_LEFT=1' before
yading@10 130 starting ffmpeg.
yading@10 131
yading@10 132
yading@10 133 =head3 The audio and video lose sync after a while.
yading@10 134
yading@10 135
yading@10 136 Yes, they do.
yading@10 137
yading@10 138
yading@10 139 =head3 After a long while, the video update rate goes way down in WMP.
yading@10 140
yading@10 141
yading@10 142 Yes, it does. Who knows why?
yading@10 143
yading@10 144
yading@10 145 =head3 WMP 6.4 behaves differently to WMP 7.
yading@10 146
yading@10 147
yading@10 148 Yes, it does. Any thoughts on this would be gratefully received. These
yading@10 149 differences extend to embedding WMP into a web page. [There are two
yading@10 150 object IDs that you can use: The old one, which does not play well, and
yading@10 151 the new one, which does (both tested on the same system). However,
yading@10 152 I suspect that the new one is not available unless you have installed WMP 7].
yading@10 153
yading@10 154
yading@10 155 =head2 What else can it do?
yading@10 156
yading@10 157
yading@10 158 You can replay video from .ffm files that was recorded earlier.
yading@10 159 However, there are a number of caveats, including the fact that the
yading@10 160 ffserver parameters must match the original parameters used to record the
yading@10 161 file. If they do not, then ffserver deletes the file before recording into it.
yading@10 162 (Now that I write this, it seems broken).
yading@10 163
yading@10 164 You can fiddle with many of the codec choices and encoding parameters, and
yading@10 165 there are a bunch more parameters that you cannot control. Post a message
yading@10 166 to the mailing list if there are some 'must have' parameters. Look in
yading@10 167 ffserver.conf for a list of the currently available controls.
yading@10 168
yading@10 169 It will automatically generate the ASX or RAM files that are often used
yading@10 170 in browsers. These files are actually redirections to the underlying ASF
yading@10 171 or RM file. The reason for this is that the browser often fetches the
yading@10 172 entire file before starting up the external viewer. The redirection files
yading@10 173 are very small and can be transferred quickly. [The stream itself is
yading@10 174 often 'infinite' and thus the browser tries to download it and never
yading@10 175 finishes.]
yading@10 176
yading@10 177
yading@10 178 =head2 Tips
yading@10 179
yading@10 180
yading@10 181 * When you connect to a live stream, most players (WMP, RA, etc) want to
yading@10 182 buffer a certain number of seconds of material so that they can display the
yading@10 183 signal continuously. However, ffserver (by default) starts sending data
yading@10 184 in realtime. This means that there is a pause of a few seconds while the
yading@10 185 buffering is being done by the player. The good news is that this can be
yading@10 186 cured by adding a '?buffer=5' to the end of the URL. This means that the
yading@10 187 stream should start 5 seconds in the past -- and so the first 5 seconds
yading@10 188 of the stream are sent as fast as the network will allow. It will then
yading@10 189 slow down to real time. This noticeably improves the startup experience.
yading@10 190
yading@10 191 You can also add a 'Preroll 15' statement into the ffserver.conf that will
yading@10 192 add the 15 second prebuffering on all requests that do not otherwise
yading@10 193 specify a time. In addition, ffserver will skip frames until a key_frame
yading@10 194 is found. This further reduces the startup delay by not transferring data
yading@10 195 that will be discarded.
yading@10 196
yading@10 197 * You may want to adjust the MaxBandwidth in the ffserver.conf to limit
yading@10 198 the amount of bandwidth consumed by live streams.
yading@10 199
yading@10 200
yading@10 201 =head2 Why does the ?buffer / Preroll stop working after a time?
yading@10 202
yading@10 203
yading@10 204 It turns out that (on my machine at least) the number of frames successfully
yading@10 205 grabbed is marginally less than the number that ought to be grabbed. This
yading@10 206 means that the timestamp in the encoded data stream gets behind realtime.
yading@10 207 This means that if you say 'Preroll 10', then when the stream gets 10
yading@10 208 or more seconds behind, there is no Preroll left.
yading@10 209
yading@10 210 Fixing this requires a change in the internals of how timestamps are
yading@10 211 handled.
yading@10 212
yading@10 213
yading@10 214 =head2 Does the C<?date=> stuff work.
yading@10 215
yading@10 216
yading@10 217 Yes (subject to the limitation outlined above). Also note that whenever you
yading@10 218 start ffserver, it deletes the ffm file (if any parameters have changed),
yading@10 219 thus wiping out what you had recorded before.
yading@10 220
yading@10 221 The format of the C<?date=xxxxxx> is fairly flexible. You should use one
yading@10 222 of the following formats (the 'T' is literal):
yading@10 223
yading@10 224
yading@10 225 * YYYY-MM-DDTHH:MM:SS (localtime)
yading@10 226 * YYYY-MM-DDTHH:MM:SSZ (UTC)
yading@10 227
yading@10 228
yading@10 229 You can omit the YYYY-MM-DD, and then it refers to the current day. However
yading@10 230 note that B<?date=16:00:00> refers to 16:00 on the current day -- this
yading@10 231 may be in the future and so is unlikely to be useful.
yading@10 232
yading@10 233 You use this by adding the ?date= to the end of the URL for the stream.
yading@10 234 For example: B<http://localhost:8080/test.asf?date=2002-07-26T23:05:00>.
yading@10 235
yading@10 236
yading@10 237 =head2 What is FFM, FFM2
yading@10 238
yading@10 239
yading@10 240 FFM and FFM2 are formats used by ffserver. They allow storing a wide variety of
yading@10 241 video and audio streams and encoding options, and can store a moving time segment
yading@10 242 of an infinite movie or a whole movie.
yading@10 243
yading@10 244 FFM is version specific, and there is limited compatibility of FFM files
yading@10 245 generated by one version of ffmpeg/ffserver and another version of
yading@10 246 ffmpeg/ffserver. It may work but it is not guaranteed to work.
yading@10 247
yading@10 248 FFM2 is extensible while maintaining compatibility and should work between
yading@10 249 differing versions of tools. FFM2 is the default.
yading@10 250
yading@10 251
yading@10 252 =head1 OPTIONS
yading@10 253
yading@10 254
yading@10 255 All the numerical options, if not specified otherwise, accept a string
yading@10 256 representing a number as input, which may be followed by one of the SI
yading@10 257 unit prefixes, for example: 'K', 'M', or 'G'.
yading@10 258
yading@10 259 If 'i' is appended to the SI unit prefix, the complete prefix will be
yading@10 260 interpreted as a unit prefix for binary multiplies, which are based on
yading@10 261 powers of 1024 instead of powers of 1000. Appending 'B' to the SI unit
yading@10 262 prefix multiplies the value by 8. This allows using, for example:
yading@10 263 'KB', 'MiB', 'G' and 'B' as number suffixes.
yading@10 264
yading@10 265 Options which do not take arguments are boolean options, and set the
yading@10 266 corresponding value to true. They can be set to false by prefixing
yading@10 267 the option name with "no". For example using "-nofoo"
yading@10 268 will set the boolean option with name "foo" to false.
yading@10 269
yading@10 270
yading@10 271
yading@10 272 =head2 Stream specifiers
yading@10 273
yading@10 274 Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
yading@10 275 are used to precisely specify which stream(s) a given option belongs to.
yading@10 276
yading@10 277 A stream specifier is a string generally appended to the option name and
yading@10 278 separated from it by a colon. E.g. C<-codec:a:1 ac3> contains the
yading@10 279 C<a:1> stream specifier, which matches the second audio stream. Therefore, it
yading@10 280 would select the ac3 codec for the second audio stream.
yading@10 281
yading@10 282 A stream specifier can match several streams, so that the option is applied to all
yading@10 283 of them. E.g. the stream specifier in C<-b:a 128k> matches all audio
yading@10 284 streams.
yading@10 285
yading@10 286 An empty stream specifier matches all streams. For example, C<-codec copy>
yading@10 287 or C<-codec: copy> would copy all the streams without reencoding.
yading@10 288
yading@10 289 Possible forms of stream specifiers are:
yading@10 290
yading@10 291 =over 4
yading@10 292
yading@10 293
yading@10 294 =item I<stream_index>
yading@10 295
yading@10 296 Matches the stream with this index. E.g. C<-threads:1 4> would set the
yading@10 297 thread count for the second stream to 4.
yading@10 298
yading@10 299 =item I<stream_type>B<[:>I<stream_index>B<]>
yading@10 300
yading@10 301 I<stream_type> is one of following: 'v' for video, 'a' for audio, 's' for subtitle,
yading@10 302 'd' for data, and 't' for attachments. If I<stream_index> is given, then it matches
yading@10 303 stream number I<stream_index> of this type. Otherwise, it matches all
yading@10 304 streams of this type.
yading@10 305
yading@10 306 =item B<p:>I<program_id>B<[:>I<stream_index>B<]>
yading@10 307
yading@10 308 If I<stream_index> is given, then it matches the stream with number I<stream_index>
yading@10 309 in the program with the id I<program_id>. Otherwise, it matches all streams in the
yading@10 310 program.
yading@10 311
yading@10 312 =item B<#>I<stream_id>
yading@10 313
yading@10 314 Matches the stream by a format-specific ID.
yading@10 315
yading@10 316 =back
yading@10 317
yading@10 318
yading@10 319
yading@10 320 =head2 Generic options
yading@10 321
yading@10 322
yading@10 323 These options are shared amongst the ff* tools.
yading@10 324
yading@10 325
yading@10 326 =over 4
yading@10 327
yading@10 328
yading@10 329
yading@10 330 =item B<-L>
yading@10 331
yading@10 332 Show license.
yading@10 333
yading@10 334
yading@10 335 =item B<-h, -?, -help, --help [>I<arg>B<]>
yading@10 336
yading@10 337 Show help. An optional parameter may be specified to print help about a specific
yading@10 338 item.
yading@10 339
yading@10 340 Possible values of I<arg> are:
yading@10 341
yading@10 342 =over 4
yading@10 343
yading@10 344
yading@10 345 =item B<decoder=>I<decoder_name>
yading@10 346
yading@10 347 Print detailed information about the decoder named I<decoder_name>. Use the
yading@10 348 B<-decoders> option to get a list of all decoders.
yading@10 349
yading@10 350
yading@10 351 =item B<encoder=>I<encoder_name>
yading@10 352
yading@10 353 Print detailed information about the encoder named I<encoder_name>. Use the
yading@10 354 B<-encoders> option to get a list of all encoders.
yading@10 355
yading@10 356
yading@10 357 =item B<demuxer=>I<demuxer_name>
yading@10 358
yading@10 359 Print detailed information about the demuxer named I<demuxer_name>. Use the
yading@10 360 B<-formats> option to get a list of all demuxers and muxers.
yading@10 361
yading@10 362
yading@10 363 =item B<muxer=>I<muxer_name>
yading@10 364
yading@10 365 Print detailed information about the muxer named I<muxer_name>. Use the
yading@10 366 B<-formats> option to get a list of all muxers and demuxers.
yading@10 367
yading@10 368
yading@10 369 =item B<filter=>I<filter_name>
yading@10 370
yading@10 371 Print detailed information about the filter name I<filter_name>. Use the
yading@10 372 B<-filters> option to get a list of all filters.
yading@10 373
yading@10 374
yading@10 375 =back
yading@10 376
yading@10 377
yading@10 378
yading@10 379 =item B<-version>
yading@10 380
yading@10 381 Show version.
yading@10 382
yading@10 383
yading@10 384 =item B<-formats>
yading@10 385
yading@10 386 Show available formats.
yading@10 387
yading@10 388
yading@10 389 =item B<-codecs>
yading@10 390
yading@10 391 Show all codecs known to libavcodec.
yading@10 392
yading@10 393 Note that the term 'codec' is used throughout this documentation as a shortcut
yading@10 394 for what is more correctly called a media bitstream format.
yading@10 395
yading@10 396
yading@10 397 =item B<-decoders>
yading@10 398
yading@10 399 Show available decoders.
yading@10 400
yading@10 401
yading@10 402 =item B<-encoders>
yading@10 403
yading@10 404 Show all available encoders.
yading@10 405
yading@10 406
yading@10 407 =item B<-bsfs>
yading@10 408
yading@10 409 Show available bitstream filters.
yading@10 410
yading@10 411
yading@10 412 =item B<-protocols>
yading@10 413
yading@10 414 Show available protocols.
yading@10 415
yading@10 416
yading@10 417 =item B<-filters>
yading@10 418
yading@10 419 Show available libavfilter filters.
yading@10 420
yading@10 421
yading@10 422 =item B<-pix_fmts>
yading@10 423
yading@10 424 Show available pixel formats.
yading@10 425
yading@10 426
yading@10 427 =item B<-sample_fmts>
yading@10 428
yading@10 429 Show available sample formats.
yading@10 430
yading@10 431
yading@10 432 =item B<-layouts>
yading@10 433
yading@10 434 Show channel names and standard channel layouts.
yading@10 435
yading@10 436
yading@10 437 =item B<-loglevel [repeat+]>I<loglevel> B<| -v [repeat+]>I<loglevel>
yading@10 438
yading@10 439 Set the logging level used by the library.
yading@10 440 Adding "repeat+" indicates that repeated log output should not be compressed
yading@10 441 to the first line and the "Last message repeated n times" line will be
yading@10 442 omitted. "repeat" can also be used alone.
yading@10 443 If "repeat" is used alone, and with no prior loglevel set, the default
yading@10 444 loglevel will be used. If multiple loglevel parameters are given, using
yading@10 445 'repeat' will not change the loglevel.
yading@10 446 I<loglevel> is a number or a string containing one of the following values:
yading@10 447
yading@10 448 =over 4
yading@10 449
yading@10 450
yading@10 451 =item B<quiet>
yading@10 452
yading@10 453 Show nothing at all; be silent.
yading@10 454
yading@10 455 =item B<panic>
yading@10 456
yading@10 457 Only show fatal errors which could lead the process to crash, such as
yading@10 458 and assert failure. This is not currently used for anything.
yading@10 459
yading@10 460 =item B<fatal>
yading@10 461
yading@10 462 Only show fatal errors. These are errors after which the process absolutely
yading@10 463 cannot continue after.
yading@10 464
yading@10 465 =item B<error>
yading@10 466
yading@10 467 Show all errors, including ones which can be recovered from.
yading@10 468
yading@10 469 =item B<warning>
yading@10 470
yading@10 471 Show all warnings and errors. Any message related to possibly
yading@10 472 incorrect or unexpected events will be shown.
yading@10 473
yading@10 474 =item B<info>
yading@10 475
yading@10 476 Show informative messages during processing. This is in addition to
yading@10 477 warnings and errors. This is the default value.
yading@10 478
yading@10 479 =item B<verbose>
yading@10 480
yading@10 481 Same as C<info>, except more verbose.
yading@10 482
yading@10 483 =item B<debug>
yading@10 484
yading@10 485 Show everything, including debugging information.
yading@10 486
yading@10 487 =back
yading@10 488
yading@10 489
yading@10 490 By default the program logs to stderr, if coloring is supported by the
yading@10 491 terminal, colors are used to mark errors and warnings. Log coloring
yading@10 492 can be disabled setting the environment variable
yading@10 493 B<AV_LOG_FORCE_NOCOLOR> or B<NO_COLOR>, or can be forced setting
yading@10 494 the environment variable B<AV_LOG_FORCE_COLOR>.
yading@10 495 The use of the environment variable B<NO_COLOR> is deprecated and
yading@10 496 will be dropped in a following FFmpeg version.
yading@10 497
yading@10 498
yading@10 499 =item B<-report>
yading@10 500
yading@10 501 Dump full command line and console output to a file named
yading@10 502 C<I<program>-I<YYYYMMDD>-I<HHMMSS>.log> in the current
yading@10 503 directory.
yading@10 504 This file can be useful for bug reports.
yading@10 505 It also implies C<-loglevel verbose>.
yading@10 506
yading@10 507 Setting the environment variable C<FFREPORT> to any value has the
yading@10 508 same effect. If the value is a ':'-separated key=value sequence, these
yading@10 509 options will affect the report; options values must be escaped if they
yading@10 510 contain special characters or the options delimiter ':' (see the
yading@10 511 ``Quoting and escaping'' section in the ffmpeg-utils manual). The
yading@10 512 following option is recognized:
yading@10 513
yading@10 514 =over 4
yading@10 515
yading@10 516
yading@10 517 =item B<file>
yading@10 518
yading@10 519 set the file name to use for the report; C<%p> is expanded to the name
yading@10 520 of the program, C<%t> is expanded to a timestamp, C<%%> is expanded
yading@10 521 to a plain C<%>
yading@10 522
yading@10 523 =back
yading@10 524
yading@10 525
yading@10 526 Errors in parsing the environment variable are not fatal, and will not
yading@10 527 appear in the report.
yading@10 528
yading@10 529
yading@10 530 =item B<-cpuflags flags (>I<global>B<)>
yading@10 531
yading@10 532 Allows setting and clearing cpu flags. This option is intended
yading@10 533 for testing. Do not use it unless you know what you're doing.
yading@10 534
yading@10 535 ffmpeg -cpuflags -sse+mmx ...
yading@10 536 ffmpeg -cpuflags mmx ...
yading@10 537 ffmpeg -cpuflags 0 ...
yading@10 538
yading@10 539 Possible flags for this option are:
yading@10 540
yading@10 541 =over 4
yading@10 542
yading@10 543
yading@10 544 =item B<x86>
yading@10 545
yading@10 546
yading@10 547 =over 4
yading@10 548
yading@10 549
yading@10 550 =item B<mmx>
yading@10 551
yading@10 552
yading@10 553 =item B<mmxext>
yading@10 554
yading@10 555
yading@10 556 =item B<sse>
yading@10 557
yading@10 558
yading@10 559 =item B<sse2>
yading@10 560
yading@10 561
yading@10 562 =item B<sse2slow>
yading@10 563
yading@10 564
yading@10 565 =item B<sse3>
yading@10 566
yading@10 567
yading@10 568 =item B<sse3slow>
yading@10 569
yading@10 570
yading@10 571 =item B<ssse3>
yading@10 572
yading@10 573
yading@10 574 =item B<atom>
yading@10 575
yading@10 576
yading@10 577 =item B<sse4.1>
yading@10 578
yading@10 579
yading@10 580 =item B<sse4.2>
yading@10 581
yading@10 582
yading@10 583 =item B<avx>
yading@10 584
yading@10 585
yading@10 586 =item B<xop>
yading@10 587
yading@10 588
yading@10 589 =item B<fma4>
yading@10 590
yading@10 591
yading@10 592 =item B<3dnow>
yading@10 593
yading@10 594
yading@10 595 =item B<3dnowext>
yading@10 596
yading@10 597
yading@10 598 =item B<cmov>
yading@10 599
yading@10 600
yading@10 601 =back
yading@10 602
yading@10 603
yading@10 604 =item B<ARM>
yading@10 605
yading@10 606
yading@10 607 =over 4
yading@10 608
yading@10 609
yading@10 610 =item B<armv5te>
yading@10 611
yading@10 612
yading@10 613 =item B<armv6>
yading@10 614
yading@10 615
yading@10 616 =item B<armv6t2>
yading@10 617
yading@10 618
yading@10 619 =item B<vfp>
yading@10 620
yading@10 621
yading@10 622 =item B<vfpv3>
yading@10 623
yading@10 624
yading@10 625 =item B<neon>
yading@10 626
yading@10 627
yading@10 628 =back
yading@10 629
yading@10 630
yading@10 631 =item B<PowerPC>
yading@10 632
yading@10 633
yading@10 634 =over 4
yading@10 635
yading@10 636
yading@10 637 =item B<altivec>
yading@10 638
yading@10 639
yading@10 640 =back
yading@10 641
yading@10 642
yading@10 643 =item B<Specific Processors>
yading@10 644
yading@10 645
yading@10 646 =over 4
yading@10 647
yading@10 648
yading@10 649 =item B<pentium2>
yading@10 650
yading@10 651
yading@10 652 =item B<pentium3>
yading@10 653
yading@10 654
yading@10 655 =item B<pentium4>
yading@10 656
yading@10 657
yading@10 658 =item B<k6>
yading@10 659
yading@10 660
yading@10 661 =item B<k62>
yading@10 662
yading@10 663
yading@10 664 =item B<athlon>
yading@10 665
yading@10 666
yading@10 667 =item B<athlonxp>
yading@10 668
yading@10 669
yading@10 670 =item B<k8>
yading@10 671
yading@10 672
yading@10 673 =back
yading@10 674
yading@10 675
yading@10 676 =back
yading@10 677
yading@10 678
yading@10 679
yading@10 680 =item B<-opencl_options options (>I<global>B<)>
yading@10 681
yading@10 682 Set OpenCL environment options. This option is only available when
yading@10 683 FFmpeg has been compiled with C<--enable-opencl>.
yading@10 684
yading@10 685 I<options> must be a list of I<key>=I<value> option pairs
yading@10 686 separated by ':'. See the ``OpenCL Options'' section in the
yading@10 687 ffmpeg-utils manual for the list of supported options.
yading@10 688
yading@10 689 =back
yading@10 690
yading@10 691
yading@10 692
yading@10 693 =head2 AVOptions
yading@10 694
yading@10 695
yading@10 696 These options are provided directly by the libavformat, libavdevice and
yading@10 697 libavcodec libraries. To see the list of available AVOptions, use the
yading@10 698 B<-help> option. They are separated into two categories:
yading@10 699
yading@10 700 =over 4
yading@10 701
yading@10 702
yading@10 703 =item B<generic>
yading@10 704
yading@10 705 These options can be set for any container, codec or device. Generic options
yading@10 706 are listed under AVFormatContext options for containers/devices and under
yading@10 707 AVCodecContext options for codecs.
yading@10 708
yading@10 709 =item B<private>
yading@10 710
yading@10 711 These options are specific to the given container, device or codec. Private
yading@10 712 options are listed under their corresponding containers/devices/codecs.
yading@10 713
yading@10 714 =back
yading@10 715
yading@10 716
yading@10 717 For example to write an ID3v2.3 header instead of a default ID3v2.4 to
yading@10 718 an MP3 file, use the B<id3v2_version> private option of the MP3
yading@10 719 muxer:
yading@10 720
yading@10 721 ffmpeg -i input.flac -id3v2_version 3 out.mp3
yading@10 722
yading@10 723
yading@10 724 All codec AVOptions are obviously per-stream, so the chapter on stream
yading@10 725 specifiers applies to them
yading@10 726
yading@10 727 Note B<-nooption> syntax cannot be used for boolean AVOptions,
yading@10 728 use B<-option 0>/B<-option 1>.
yading@10 729
yading@10 730 Note2 old undocumented way of specifying per-stream AVOptions by prepending
yading@10 731 v/a/s to the options name is now obsolete and will be removed soon.
yading@10 732
yading@10 733
yading@10 734 =head2 Main options
yading@10 735
yading@10 736
yading@10 737
yading@10 738 =over 4
yading@10 739
yading@10 740
yading@10 741 =item B<-f> I<configfile>
yading@10 742
yading@10 743 Use F<configfile> instead of F</etc/ffserver.conf>.
yading@10 744
yading@10 745 =item B<-n>
yading@10 746
yading@10 747 Enable no-launch mode. This option disables all the Launch directives
yading@10 748 within the various E<lt>StreamE<gt> sections. Since ffserver will not launch
yading@10 749 any ffmpeg instances, you will have to launch them manually.
yading@10 750
yading@10 751 =item B<-d>
yading@10 752
yading@10 753 Enable debug mode. This option increases log verbosity, directs log
yading@10 754 messages to stdout.
yading@10 755
yading@10 756 =back
yading@10 757
yading@10 758
yading@10 759
yading@10 760
yading@10 761 =head1 SYNTAX
yading@10 762
yading@10 763
yading@10 764 This section documents the syntax and formats employed by the FFmpeg
yading@10 765 libraries and tools.
yading@10 766
yading@10 767
yading@10 768
yading@10 769 =head2 Quoting and escaping
yading@10 770
yading@10 771
yading@10 772 FFmpeg adopts the following quoting and escaping mechanism, unless
yading@10 773 explicitly specified. The following rules are applied:
yading@10 774
yading@10 775
yading@10 776 =over 4
yading@10 777
yading@10 778
yading@10 779 =item *
yading@10 780
yading@10 781 C<'> and C<\> are special characters (respectively used for
yading@10 782 quoting and escaping). In addition to them, there might be other
yading@10 783 special characters depending on the specific syntax where the escaping
yading@10 784 and quoting are employed.
yading@10 785
yading@10 786
yading@10 787 =item *
yading@10 788
yading@10 789 A special character is escaped by prefixing it with a '\'.
yading@10 790
yading@10 791
yading@10 792 =item *
yading@10 793
yading@10 794 All characters enclosed between '' are included literally in the
yading@10 795 parsed string. The quote character C<'> itself cannot be quoted,
yading@10 796 so you may need to close the quote and escape it.
yading@10 797
yading@10 798
yading@10 799 =item *
yading@10 800
yading@10 801 Leading and trailing whitespaces, unless escaped or quoted, are
yading@10 802 removed from the parsed string.
yading@10 803
yading@10 804 =back
yading@10 805
yading@10 806
yading@10 807 Note that you may need to add a second level of escaping when using
yading@10 808 the command line or a script, which depends on the syntax of the
yading@10 809 adopted shell language.
yading@10 810
yading@10 811 The function C<av_get_token> defined in
yading@10 812 F<libavutil/avstring.h> can be used to parse a token quoted or
yading@10 813 escaped according to the rules defined above.
yading@10 814
yading@10 815 The tool F<tools/ffescape> in the FFmpeg source tree can be used
yading@10 816 to automatically quote or escape a string in a script.
yading@10 817
yading@10 818
yading@10 819 =head3 Examples
yading@10 820
yading@10 821
yading@10 822
yading@10 823 =over 4
yading@10 824
yading@10 825
yading@10 826 =item *
yading@10 827
yading@10 828 Escape the string C<Crime d'Amour> containing the C<'> special
yading@10 829 character:
yading@10 830
yading@10 831 Crime d\'Amour
yading@10 832
yading@10 833
yading@10 834
yading@10 835 =item *
yading@10 836
yading@10 837 The string above contains a quote, so the C<'> needs to be escaped
yading@10 838 when quoting it:
yading@10 839
yading@10 840 'Crime d'\''Amour'
yading@10 841
yading@10 842
yading@10 843
yading@10 844 =item *
yading@10 845
yading@10 846 Include leading or trailing whitespaces using quoting:
yading@10 847
yading@10 848 ' this string starts and ends with whitespaces '
yading@10 849
yading@10 850
yading@10 851
yading@10 852 =item *
yading@10 853
yading@10 854 Escaping and quoting can be mixed together:
yading@10 855
yading@10 856 ' The string '\'string\'' is a string '
yading@10 857
yading@10 858
yading@10 859
yading@10 860 =item *
yading@10 861
yading@10 862 To include a literal C<\> you can use either escaping or quoting:
yading@10 863
yading@10 864 'c:\foo' can be written as c:\\foo
yading@10 865
yading@10 866
yading@10 867 =back
yading@10 868
yading@10 869
yading@10 870
yading@10 871
yading@10 872 =head2 Date
yading@10 873
yading@10 874
yading@10 875 The accepted syntax is:
yading@10 876
yading@10 877 [(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
yading@10 878 now
yading@10 879
yading@10 880
yading@10 881 If the value is "now" it takes the current time.
yading@10 882
yading@10 883 Time is local time unless Z is appended, in which case it is
yading@10 884 interpreted as UTC.
yading@10 885 If the year-month-day part is not specified it takes the current
yading@10 886 year-month-day.
yading@10 887
yading@10 888
yading@10 889
yading@10 890 =head2 Time duration
yading@10 891
yading@10 892
yading@10 893 The accepted syntax is:
yading@10 894
yading@10 895 [-][HH:]MM:SS[.m...]
yading@10 896 [-]S+[.m...]
yading@10 897
yading@10 898
yading@10 899 I<HH> expresses the number of hours, I<MM> the number a of minutes
yading@10 900 and I<SS> the number of seconds.
yading@10 901
yading@10 902
yading@10 903
yading@10 904 =head2 Video size
yading@10 905
yading@10 906 Specify the size of the sourced video, it may be a string of the form
yading@10 907 I<width>xI<height>, or the name of a size abbreviation.
yading@10 908
yading@10 909 The following abbreviations are recognized:
yading@10 910
yading@10 911 =over 4
yading@10 912
yading@10 913
yading@10 914 =item B<ntsc>
yading@10 915
yading@10 916 720x480
yading@10 917
yading@10 918 =item B<pal>
yading@10 919
yading@10 920 720x576
yading@10 921
yading@10 922 =item B<qntsc>
yading@10 923
yading@10 924 352x240
yading@10 925
yading@10 926 =item B<qpal>
yading@10 927
yading@10 928 352x288
yading@10 929
yading@10 930 =item B<sntsc>
yading@10 931
yading@10 932 640x480
yading@10 933
yading@10 934 =item B<spal>
yading@10 935
yading@10 936 768x576
yading@10 937
yading@10 938 =item B<film>
yading@10 939
yading@10 940 352x240
yading@10 941
yading@10 942 =item B<ntsc-film>
yading@10 943
yading@10 944 352x240
yading@10 945
yading@10 946 =item B<sqcif>
yading@10 947
yading@10 948 128x96
yading@10 949
yading@10 950 =item B<qcif>
yading@10 951
yading@10 952 176x144
yading@10 953
yading@10 954 =item B<cif>
yading@10 955
yading@10 956 352x288
yading@10 957
yading@10 958 =item B<4cif>
yading@10 959
yading@10 960 704x576
yading@10 961
yading@10 962 =item B<16cif>
yading@10 963
yading@10 964 1408x1152
yading@10 965
yading@10 966 =item B<qqvga>
yading@10 967
yading@10 968 160x120
yading@10 969
yading@10 970 =item B<qvga>
yading@10 971
yading@10 972 320x240
yading@10 973
yading@10 974 =item B<vga>
yading@10 975
yading@10 976 640x480
yading@10 977
yading@10 978 =item B<svga>
yading@10 979
yading@10 980 800x600
yading@10 981
yading@10 982 =item B<xga>
yading@10 983
yading@10 984 1024x768
yading@10 985
yading@10 986 =item B<uxga>
yading@10 987
yading@10 988 1600x1200
yading@10 989
yading@10 990 =item B<qxga>
yading@10 991
yading@10 992 2048x1536
yading@10 993
yading@10 994 =item B<sxga>
yading@10 995
yading@10 996 1280x1024
yading@10 997
yading@10 998 =item B<qsxga>
yading@10 999
yading@10 1000 2560x2048
yading@10 1001
yading@10 1002 =item B<hsxga>
yading@10 1003
yading@10 1004 5120x4096
yading@10 1005
yading@10 1006 =item B<wvga>
yading@10 1007
yading@10 1008 852x480
yading@10 1009
yading@10 1010 =item B<wxga>
yading@10 1011
yading@10 1012 1366x768
yading@10 1013
yading@10 1014 =item B<wsxga>
yading@10 1015
yading@10 1016 1600x1024
yading@10 1017
yading@10 1018 =item B<wuxga>
yading@10 1019
yading@10 1020 1920x1200
yading@10 1021
yading@10 1022 =item B<woxga>
yading@10 1023
yading@10 1024 2560x1600
yading@10 1025
yading@10 1026 =item B<wqsxga>
yading@10 1027
yading@10 1028 3200x2048
yading@10 1029
yading@10 1030 =item B<wquxga>
yading@10 1031
yading@10 1032 3840x2400
yading@10 1033
yading@10 1034 =item B<whsxga>
yading@10 1035
yading@10 1036 6400x4096
yading@10 1037
yading@10 1038 =item B<whuxga>
yading@10 1039
yading@10 1040 7680x4800
yading@10 1041
yading@10 1042 =item B<cga>
yading@10 1043
yading@10 1044 320x200
yading@10 1045
yading@10 1046 =item B<ega>
yading@10 1047
yading@10 1048 640x350
yading@10 1049
yading@10 1050 =item B<hd480>
yading@10 1051
yading@10 1052 852x480
yading@10 1053
yading@10 1054 =item B<hd720>
yading@10 1055
yading@10 1056 1280x720
yading@10 1057
yading@10 1058 =item B<hd1080>
yading@10 1059
yading@10 1060 1920x1080
yading@10 1061
yading@10 1062 =item B<2k>
yading@10 1063
yading@10 1064 2048x1080
yading@10 1065
yading@10 1066 =item B<2kflat>
yading@10 1067
yading@10 1068 1998x1080
yading@10 1069
yading@10 1070 =item B<2kscope>
yading@10 1071
yading@10 1072 2048x858
yading@10 1073
yading@10 1074 =item B<4k>
yading@10 1075
yading@10 1076 4096x2160
yading@10 1077
yading@10 1078 =item B<4kflat>
yading@10 1079
yading@10 1080 3996x2160
yading@10 1081
yading@10 1082 =item B<4kscope>
yading@10 1083
yading@10 1084 4096x1716
yading@10 1085
yading@10 1086 =back
yading@10 1087
yading@10 1088
yading@10 1089
yading@10 1090
yading@10 1091 =head2 Video rate
yading@10 1092
yading@10 1093
yading@10 1094 Specify the frame rate of a video, expressed as the number of frames
yading@10 1095 generated per second. It has to be a string in the format
yading@10 1096 I<frame_rate_num>/I<frame_rate_den>, an integer number, a float
yading@10 1097 number or a valid video frame rate abbreviation.
yading@10 1098
yading@10 1099 The following abbreviations are recognized:
yading@10 1100
yading@10 1101 =over 4
yading@10 1102
yading@10 1103
yading@10 1104 =item B<ntsc>
yading@10 1105
yading@10 1106 30000/1001
yading@10 1107
yading@10 1108 =item B<pal>
yading@10 1109
yading@10 1110 25/1
yading@10 1111
yading@10 1112 =item B<qntsc>
yading@10 1113
yading@10 1114 30000/1001
yading@10 1115
yading@10 1116 =item B<qpal>
yading@10 1117
yading@10 1118 25/1
yading@10 1119
yading@10 1120 =item B<sntsc>
yading@10 1121
yading@10 1122 30000/1001
yading@10 1123
yading@10 1124 =item B<spal>
yading@10 1125
yading@10 1126 25/1
yading@10 1127
yading@10 1128 =item B<film>
yading@10 1129
yading@10 1130 24/1
yading@10 1131
yading@10 1132 =item B<ntsc-film>
yading@10 1133
yading@10 1134 24000/1001
yading@10 1135
yading@10 1136 =back
yading@10 1137
yading@10 1138
yading@10 1139
yading@10 1140
yading@10 1141 =head2 Ratio
yading@10 1142
yading@10 1143
yading@10 1144 A ratio can be expressed as an expression, or in the form
yading@10 1145 I<numerator>:I<denominator>.
yading@10 1146
yading@10 1147 Note that a ratio with infinite (1/0) or negative value is
yading@10 1148 considered valid, so you should check on the returned value if you
yading@10 1149 want to exclude those values.
yading@10 1150
yading@10 1151 The undefined value can be expressed using the "0:0" string.
yading@10 1152
yading@10 1153
yading@10 1154
yading@10 1155 =head2 Color
yading@10 1156
yading@10 1157
yading@10 1158 It can be the name of a color (case insensitive match) or a
yading@10 1159 [0x|#]RRGGBB[AA] sequence, possibly followed by "@" and a string
yading@10 1160 representing the alpha component.
yading@10 1161
yading@10 1162 The alpha component may be a string composed by "0x" followed by an
yading@10 1163 hexadecimal number or a decimal number between 0.0 and 1.0, which
yading@10 1164 represents the opacity value (0x00/0.0 means completely transparent,
yading@10 1165 0xff/1.0 completely opaque).
yading@10 1166 If the alpha component is not specified then 0xff is assumed.
yading@10 1167
yading@10 1168 The string "random" will result in a random color.
yading@10 1169
yading@10 1170
yading@10 1171
yading@10 1172 =head1 EXPRESSION EVALUATION
yading@10 1173
yading@10 1174
yading@10 1175 When evaluating an arithmetic expression, FFmpeg uses an internal
yading@10 1176 formula evaluator, implemented through the F<libavutil/eval.h>
yading@10 1177 interface.
yading@10 1178
yading@10 1179 An expression may contain unary, binary operators, constants, and
yading@10 1180 functions.
yading@10 1181
yading@10 1182 Two expressions I<expr1> and I<expr2> can be combined to form
yading@10 1183 another expression "I<expr1>;I<expr2>".
yading@10 1184 I<expr1> and I<expr2> are evaluated in turn, and the new
yading@10 1185 expression evaluates to the value of I<expr2>.
yading@10 1186
yading@10 1187 The following binary operators are available: C<+>, C<->,
yading@10 1188 C<*>, C</>, C<^>.
yading@10 1189
yading@10 1190 The following unary operators are available: C<+>, C<->.
yading@10 1191
yading@10 1192 The following functions are available:
yading@10 1193
yading@10 1194 =over 4
yading@10 1195
yading@10 1196
yading@10 1197 =item B<abs(x)>
yading@10 1198
yading@10 1199 Compute absolute value of I<x>.
yading@10 1200
yading@10 1201
yading@10 1202 =item B<acos(x)>
yading@10 1203
yading@10 1204 Compute arccosine of I<x>.
yading@10 1205
yading@10 1206
yading@10 1207 =item B<asin(x)>
yading@10 1208
yading@10 1209 Compute arcsine of I<x>.
yading@10 1210
yading@10 1211
yading@10 1212 =item B<atan(x)>
yading@10 1213
yading@10 1214 Compute arctangent of I<x>.
yading@10 1215
yading@10 1216
yading@10 1217 =item B<between(x, min, max)>
yading@10 1218
yading@10 1219 Return 1 if I<x> is greater than or equal to I<min> and lesser than or
yading@10 1220 equal to I<max>, 0 otherwise.
yading@10 1221
yading@10 1222
yading@10 1223 =item B<bitand(x, y)>
yading@10 1224
yading@10 1225
yading@10 1226 =item B<bitor(x, y)>
yading@10 1227
yading@10 1228 Compute bitwise and/or operation on I<x> and I<y>.
yading@10 1229
yading@10 1230 The results of the evaluation of I<x> and I<y> are converted to
yading@10 1231 integers before executing the bitwise operation.
yading@10 1232
yading@10 1233 Note that both the conversion to integer and the conversion back to
yading@10 1234 floating point can lose precision. Beware of unexpected results for
yading@10 1235 large numbers (usually 2^53 and larger).
yading@10 1236
yading@10 1237
yading@10 1238 =item B<ceil(expr)>
yading@10 1239
yading@10 1240 Round the value of expression I<expr> upwards to the nearest
yading@10 1241 integer. For example, "ceil(1.5)" is "2.0".
yading@10 1242
yading@10 1243
yading@10 1244 =item B<cos(x)>
yading@10 1245
yading@10 1246 Compute cosine of I<x>.
yading@10 1247
yading@10 1248
yading@10 1249 =item B<cosh(x)>
yading@10 1250
yading@10 1251 Compute hyperbolic cosine of I<x>.
yading@10 1252
yading@10 1253
yading@10 1254 =item B<eq(x, y)>
yading@10 1255
yading@10 1256 Return 1 if I<x> and I<y> are equivalent, 0 otherwise.
yading@10 1257
yading@10 1258
yading@10 1259 =item B<exp(x)>
yading@10 1260
yading@10 1261 Compute exponential of I<x> (with base C<e>, the Euler's number).
yading@10 1262
yading@10 1263
yading@10 1264 =item B<floor(expr)>
yading@10 1265
yading@10 1266 Round the value of expression I<expr> downwards to the nearest
yading@10 1267 integer. For example, "floor(-1.5)" is "-2.0".
yading@10 1268
yading@10 1269
yading@10 1270 =item B<gauss(x)>
yading@10 1271
yading@10 1272 Compute Gauss function of I<x>, corresponding to
yading@10 1273 C<exp(-x*x/2) / sqrt(2*PI)>.
yading@10 1274
yading@10 1275
yading@10 1276 =item B<gcd(x, y)>
yading@10 1277
yading@10 1278 Return the greatest common divisor of I<x> and I<y>. If both I<x> and
yading@10 1279 I<y> are 0 or either or both are less than zero then behavior is undefined.
yading@10 1280
yading@10 1281
yading@10 1282 =item B<gt(x, y)>
yading@10 1283
yading@10 1284 Return 1 if I<x> is greater than I<y>, 0 otherwise.
yading@10 1285
yading@10 1286
yading@10 1287 =item B<gte(x, y)>
yading@10 1288
yading@10 1289 Return 1 if I<x> is greater than or equal to I<y>, 0 otherwise.
yading@10 1290
yading@10 1291
yading@10 1292 =item B<hypot(x, y)>
yading@10 1293
yading@10 1294 This function is similar to the C function with the same name; it returns
yading@10 1295 "sqrt(I<x>*I<x> + I<y>*I<y>)", the length of the hypotenuse of a
yading@10 1296 right triangle with sides of length I<x> and I<y>, or the distance of the
yading@10 1297 point (I<x>, I<y>) from the origin.
yading@10 1298
yading@10 1299
yading@10 1300 =item B<if(x, y)>
yading@10 1301
yading@10 1302 Evaluate I<x>, and if the result is non-zero return the result of
yading@10 1303 the evaluation of I<y>, return 0 otherwise.
yading@10 1304
yading@10 1305
yading@10 1306 =item B<if(x, y, z)>
yading@10 1307
yading@10 1308 Evaluate I<x>, and if the result is non-zero return the evaluation
yading@10 1309 result of I<y>, otherwise the evaluation result of I<z>.
yading@10 1310
yading@10 1311
yading@10 1312 =item B<ifnot(x, y)>
yading@10 1313
yading@10 1314 Evaluate I<x>, and if the result is zero return the result of the
yading@10 1315 evaluation of I<y>, return 0 otherwise.
yading@10 1316
yading@10 1317
yading@10 1318 =item B<ifnot(x, y, z)>
yading@10 1319
yading@10 1320 Evaluate I<x>, and if the result is zero return the evaluation
yading@10 1321 result of I<y>, otherwise the evaluation result of I<z>.
yading@10 1322
yading@10 1323
yading@10 1324 =item B<isinf(x)>
yading@10 1325
yading@10 1326 Return 1.0 if I<x> is +/-INFINITY, 0.0 otherwise.
yading@10 1327
yading@10 1328
yading@10 1329 =item B<isnan(x)>
yading@10 1330
yading@10 1331 Return 1.0 if I<x> is NAN, 0.0 otherwise.
yading@10 1332
yading@10 1333
yading@10 1334 =item B<ld(var)>
yading@10 1335
yading@10 1336 Allow to load the value of the internal variable with number
yading@10 1337 I<var>, which was previously stored with st(I<var>, I<expr>).
yading@10 1338 The function returns the loaded value.
yading@10 1339
yading@10 1340
yading@10 1341 =item B<log(x)>
yading@10 1342
yading@10 1343 Compute natural logarithm of I<x>.
yading@10 1344
yading@10 1345
yading@10 1346 =item B<lt(x, y)>
yading@10 1347
yading@10 1348 Return 1 if I<x> is lesser than I<y>, 0 otherwise.
yading@10 1349
yading@10 1350
yading@10 1351 =item B<lte(x, y)>
yading@10 1352
yading@10 1353 Return 1 if I<x> is lesser than or equal to I<y>, 0 otherwise.
yading@10 1354
yading@10 1355
yading@10 1356 =item B<max(x, y)>
yading@10 1357
yading@10 1358 Return the maximum between I<x> and I<y>.
yading@10 1359
yading@10 1360
yading@10 1361 =item B<min(x, y)>
yading@10 1362
yading@10 1363 Return the maximum between I<x> and I<y>.
yading@10 1364
yading@10 1365
yading@10 1366 =item B<mod(x, y)>
yading@10 1367
yading@10 1368 Compute the remainder of division of I<x> by I<y>.
yading@10 1369
yading@10 1370
yading@10 1371 =item B<not(expr)>
yading@10 1372
yading@10 1373 Return 1.0 if I<expr> is zero, 0.0 otherwise.
yading@10 1374
yading@10 1375
yading@10 1376 =item B<pow(x, y)>
yading@10 1377
yading@10 1378 Compute the power of I<x> elevated I<y>, it is equivalent to
yading@10 1379 "(I<x>)^(I<y>)".
yading@10 1380
yading@10 1381
yading@10 1382 =item B<print(t)>
yading@10 1383
yading@10 1384
yading@10 1385 =item B<print(t, l)>
yading@10 1386
yading@10 1387 Print the value of expression I<t> with loglevel I<l>. If
yading@10 1388 I<l> is not specified then a default log level is used.
yading@10 1389 Returns the value of the expression printed.
yading@10 1390
yading@10 1391 Prints t with loglevel l
yading@10 1392
yading@10 1393
yading@10 1394 =item B<random(x)>
yading@10 1395
yading@10 1396 Return a pseudo random value between 0.0 and 1.0. I<x> is the index of the
yading@10 1397 internal variable which will be used to save the seed/state.
yading@10 1398
yading@10 1399
yading@10 1400 =item B<root(expr, max)>
yading@10 1401
yading@10 1402 Find an input value for which the function represented by I<expr>
yading@10 1403 with argument I<ld(0)> is 0 in the interval 0..I<max>.
yading@10 1404
yading@10 1405 The expression in I<expr> must denote a continuous function or the
yading@10 1406 result is undefined.
yading@10 1407
yading@10 1408 I<ld(0)> is used to represent the function input value, which means
yading@10 1409 that the given expression will be evaluated multiple times with
yading@10 1410 various input values that the expression can access through
yading@10 1411 C<ld(0)>. When the expression evaluates to 0 then the
yading@10 1412 corresponding input value will be returned.
yading@10 1413
yading@10 1414
yading@10 1415 =item B<sin(x)>
yading@10 1416
yading@10 1417 Compute sine of I<x>.
yading@10 1418
yading@10 1419
yading@10 1420 =item B<sinh(x)>
yading@10 1421
yading@10 1422 Compute hyperbolic sine of I<x>.
yading@10 1423
yading@10 1424
yading@10 1425 =item B<sqrt(expr)>
yading@10 1426
yading@10 1427 Compute the square root of I<expr>. This is equivalent to
yading@10 1428 "(I<expr>)^.5".
yading@10 1429
yading@10 1430
yading@10 1431 =item B<squish(x)>
yading@10 1432
yading@10 1433 Compute expression C<1/(1 + exp(4*x))>.
yading@10 1434
yading@10 1435
yading@10 1436 =item B<st(var, expr)>
yading@10 1437
yading@10 1438 Allow to store the value of the expression I<expr> in an internal
yading@10 1439 variable. I<var> specifies the number of the variable where to
yading@10 1440 store the value, and it is a value ranging from 0 to 9. The function
yading@10 1441 returns the value stored in the internal variable.
yading@10 1442 Note, Variables are currently not shared between expressions.
yading@10 1443
yading@10 1444
yading@10 1445 =item B<tan(x)>
yading@10 1446
yading@10 1447 Compute tangent of I<x>.
yading@10 1448
yading@10 1449
yading@10 1450 =item B<tanh(x)>
yading@10 1451
yading@10 1452 Compute hyperbolic tangent of I<x>.
yading@10 1453
yading@10 1454
yading@10 1455 =item B<taylor(expr, x)>
yading@10 1456
yading@10 1457
yading@10 1458 =item B<taylor(expr, x, id)>
yading@10 1459
yading@10 1460 Evaluate a Taylor series at I<x>, given an expression representing
yading@10 1461 the C<ld(id)>-th derivative of a function at 0.
yading@10 1462
yading@10 1463 When the series does not converge the result is undefined.
yading@10 1464
yading@10 1465 I<ld(id)> is used to represent the derivative order in I<expr>,
yading@10 1466 which means that the given expression will be evaluated multiple times
yading@10 1467 with various input values that the expression can access through
yading@10 1468 C<ld(id)>. If I<id> is not specified then 0 is assumed.
yading@10 1469
yading@10 1470 Note, when you have the derivatives at y instead of 0,
yading@10 1471 C<taylor(expr, x-y)> can be used.
yading@10 1472
yading@10 1473
yading@10 1474 =item B<time(0)>
yading@10 1475
yading@10 1476 Return the current (wallclock) time in seconds.
yading@10 1477
yading@10 1478
yading@10 1479 =item B<trunc(expr)>
yading@10 1480
yading@10 1481 Round the value of expression I<expr> towards zero to the nearest
yading@10 1482 integer. For example, "trunc(-1.5)" is "-1.0".
yading@10 1483
yading@10 1484
yading@10 1485 =item B<while(cond, expr)>
yading@10 1486
yading@10 1487 Evaluate expression I<expr> while the expression I<cond> is
yading@10 1488 non-zero, and returns the value of the last I<expr> evaluation, or
yading@10 1489 NAN if I<cond> was always false.
yading@10 1490
yading@10 1491 =back
yading@10 1492
yading@10 1493
yading@10 1494 The following constants are available:
yading@10 1495
yading@10 1496 =over 4
yading@10 1497
yading@10 1498
yading@10 1499 =item B<PI>
yading@10 1500
yading@10 1501 area of the unit disc, approximately 3.14
yading@10 1502
yading@10 1503 =item B<E>
yading@10 1504
yading@10 1505 exp(1) (Euler's number), approximately 2.718
yading@10 1506
yading@10 1507 =item B<PHI>
yading@10 1508
yading@10 1509 golden ratio (1+sqrt(5))/2, approximately 1.618
yading@10 1510
yading@10 1511 =back
yading@10 1512
yading@10 1513
yading@10 1514 Assuming that an expression is considered "true" if it has a non-zero
yading@10 1515 value, note that:
yading@10 1516
yading@10 1517 C<*> works like AND
yading@10 1518
yading@10 1519 C<+> works like OR
yading@10 1520
yading@10 1521 For example the construct:
yading@10 1522
yading@10 1523 if (A AND B) then C
yading@10 1524
yading@10 1525 is equivalent to:
yading@10 1526
yading@10 1527 if(A*B, C)
yading@10 1528
yading@10 1529
yading@10 1530 In your C code, you can extend the list of unary and binary functions,
yading@10 1531 and define recognized constants, so that they are available for your
yading@10 1532 expressions.
yading@10 1533
yading@10 1534 The evaluator also recognizes the International System unit prefixes.
yading@10 1535 If 'i' is appended after the prefix, binary prefixes are used, which
yading@10 1536 are based on powers of 1024 instead of powers of 1000.
yading@10 1537 The 'B' postfix multiplies the value by 8, and can be appended after a
yading@10 1538 unit prefix or used alone. This allows using for example 'KB', 'MiB',
yading@10 1539 'G' and 'B' as number postfix.
yading@10 1540
yading@10 1541 The list of available International System prefixes follows, with
yading@10 1542 indication of the corresponding powers of 10 and of 2.
yading@10 1543
yading@10 1544 =over 4
yading@10 1545
yading@10 1546
yading@10 1547 =item B<y>
yading@10 1548
yading@10 1549 10^-24 / 2^-80
yading@10 1550
yading@10 1551 =item B<z>
yading@10 1552
yading@10 1553 10^-21 / 2^-70
yading@10 1554
yading@10 1555 =item B<a>
yading@10 1556
yading@10 1557 10^-18 / 2^-60
yading@10 1558
yading@10 1559 =item B<f>
yading@10 1560
yading@10 1561 10^-15 / 2^-50
yading@10 1562
yading@10 1563 =item B<p>
yading@10 1564
yading@10 1565 10^-12 / 2^-40
yading@10 1566
yading@10 1567 =item B<n>
yading@10 1568
yading@10 1569 10^-9 / 2^-30
yading@10 1570
yading@10 1571 =item B<u>
yading@10 1572
yading@10 1573 10^-6 / 2^-20
yading@10 1574
yading@10 1575 =item B<m>
yading@10 1576
yading@10 1577 10^-3 / 2^-10
yading@10 1578
yading@10 1579 =item B<c>
yading@10 1580
yading@10 1581 10^-2
yading@10 1582
yading@10 1583 =item B<d>
yading@10 1584
yading@10 1585 10^-1
yading@10 1586
yading@10 1587 =item B<h>
yading@10 1588
yading@10 1589 10^2
yading@10 1590
yading@10 1591 =item B<k>
yading@10 1592
yading@10 1593 10^3 / 2^10
yading@10 1594
yading@10 1595 =item B<K>
yading@10 1596
yading@10 1597 10^3 / 2^10
yading@10 1598
yading@10 1599 =item B<M>
yading@10 1600
yading@10 1601 10^6 / 2^20
yading@10 1602
yading@10 1603 =item B<G>
yading@10 1604
yading@10 1605 10^9 / 2^30
yading@10 1606
yading@10 1607 =item B<T>
yading@10 1608
yading@10 1609 10^12 / 2^40
yading@10 1610
yading@10 1611 =item B<P>
yading@10 1612
yading@10 1613 10^15 / 2^40
yading@10 1614
yading@10 1615 =item B<E>
yading@10 1616
yading@10 1617 10^18 / 2^50
yading@10 1618
yading@10 1619 =item B<Z>
yading@10 1620
yading@10 1621 10^21 / 2^60
yading@10 1622
yading@10 1623 =item B<Y>
yading@10 1624
yading@10 1625 10^24 / 2^70
yading@10 1626
yading@10 1627 =back
yading@10 1628
yading@10 1629
yading@10 1630
yading@10 1631
yading@10 1632 =head1 OPENCL OPTIONS
yading@10 1633
yading@10 1634
yading@10 1635 When FFmpeg is configured with C<--enable-opencl>, it is possible
yading@10 1636 to set the options for the global OpenCL context.
yading@10 1637
yading@10 1638 The list of supported options follows:
yading@10 1639
yading@10 1640
yading@10 1641 =over 4
yading@10 1642
yading@10 1643
yading@10 1644 =item B<build_options>
yading@10 1645
yading@10 1646 Set build options used to compile the registered kernels.
yading@10 1647
yading@10 1648 See reference "OpenCL Specification Version: 1.2 chapter 5.6.4".
yading@10 1649
yading@10 1650
yading@10 1651 =item B<platform_idx>
yading@10 1652
yading@10 1653 Select the index of the platform to run OpenCL code.
yading@10 1654
yading@10 1655 The specified index must be one of the indexes in the device list
yading@10 1656 which can be obtained with C<av_opencl_get_device_list()>.
yading@10 1657
yading@10 1658
yading@10 1659 =item B<device_idx>
yading@10 1660
yading@10 1661 Select the index of the device used to run OpenCL code.
yading@10 1662
yading@10 1663 The specifed index must be one of the indexes in the device list which
yading@10 1664 can be obtained with C<av_opencl_get_device_list()>.
yading@10 1665
yading@10 1666
yading@10 1667 =back
yading@10 1668
yading@10 1669
yading@10 1670
yading@10 1671
yading@10 1672 =head1 CODEC OPTIONS
yading@10 1673
yading@10 1674
yading@10 1675 libavcodec provides some generic global options, which can be set on
yading@10 1676 all the encoders and decoders. In addition each codec may support
yading@10 1677 so-called private options, which are specific for a given codec.
yading@10 1678
yading@10 1679 Sometimes, a global option may only affect a specific kind of codec,
yading@10 1680 and may be unsensical or ignored by another, so you need to be aware
yading@10 1681 of the meaning of the specified options. Also some options are
yading@10 1682 meant only for decoding or encoding.
yading@10 1683
yading@10 1684 Options may be set by specifying -I<option> I<value> in the
yading@10 1685 FFmpeg tools, or by setting the value explicitly in the
yading@10 1686 C<AVCodecContext> options or using the F<libavutil/opt.h> API
yading@10 1687 for programmatic use.
yading@10 1688
yading@10 1689 The list of supported options follow:
yading@10 1690
yading@10 1691
yading@10 1692 =over 4
yading@10 1693
yading@10 1694
yading@10 1695 =item B<b> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 1696
yading@10 1697 Set bitrate in bits/s. Default value is 200K.
yading@10 1698
yading@10 1699
yading@10 1700 =item B<ab> I<integer> B<(>I<encoding,audio>B<)>
yading@10 1701
yading@10 1702 Set audio bitrate (in bits/s). Default value is 128K.
yading@10 1703
yading@10 1704
yading@10 1705 =item B<bt> I<integer> B<(>I<encoding,video>B<)>
yading@10 1706
yading@10 1707 Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate
yading@10 1708 tolerance specifies how far ratecontrol is willing to deviate from the
yading@10 1709 target average bitrate value. This is not related to min/max
yading@10 1710 bitrate. Lowering tolerance too much has an adverse effect on quality.
yading@10 1711
yading@10 1712
yading@10 1713 =item B<flags> I<flags> B<(>I<decoding/encoding,audio,video,subtitles>B<)>
yading@10 1714
yading@10 1715 Set generic flags.
yading@10 1716
yading@10 1717 Possible values:
yading@10 1718
yading@10 1719 =over 4
yading@10 1720
yading@10 1721
yading@10 1722 =item B<mv4>
yading@10 1723
yading@10 1724 Use four motion vector by macroblock (mpeg4).
yading@10 1725
yading@10 1726 =item B<qpel>
yading@10 1727
yading@10 1728 Use 1/4 pel motion compensation.
yading@10 1729
yading@10 1730 =item B<loop>
yading@10 1731
yading@10 1732 Use loop filter.
yading@10 1733
yading@10 1734 =item B<qscale>
yading@10 1735
yading@10 1736 Use fixed qscale.
yading@10 1737
yading@10 1738 =item B<gmc>
yading@10 1739
yading@10 1740 Use gmc.
yading@10 1741
yading@10 1742 =item B<mv0>
yading@10 1743
yading@10 1744 Always try a mb with mv=E<lt>0,0E<gt>.
yading@10 1745
yading@10 1746 =item B<input_preserved>
yading@10 1747
yading@10 1748
yading@10 1749
yading@10 1750 =item B<pass1>
yading@10 1751
yading@10 1752 Use internal 2pass ratecontrol in first pass mode.
yading@10 1753
yading@10 1754 =item B<pass2>
yading@10 1755
yading@10 1756 Use internal 2pass ratecontrol in second pass mode.
yading@10 1757
yading@10 1758 =item B<gray>
yading@10 1759
yading@10 1760 Only decode/encode grayscale.
yading@10 1761
yading@10 1762 =item B<emu_edge>
yading@10 1763
yading@10 1764 Do not draw edges.
yading@10 1765
yading@10 1766 =item B<psnr>
yading@10 1767
yading@10 1768 Set error[?] variables during encoding.
yading@10 1769
yading@10 1770 =item B<truncated>
yading@10 1771
yading@10 1772
yading@10 1773
yading@10 1774 =item B<naq>
yading@10 1775
yading@10 1776 Normalize adaptive quantization.
yading@10 1777
yading@10 1778 =item B<ildct>
yading@10 1779
yading@10 1780 Use interlaced DCT.
yading@10 1781
yading@10 1782 =item B<low_delay>
yading@10 1783
yading@10 1784 Force low delay.
yading@10 1785
yading@10 1786 =item B<global_header>
yading@10 1787
yading@10 1788 Place global headers in extradata instead of every keyframe.
yading@10 1789
yading@10 1790 =item B<bitexact>
yading@10 1791
yading@10 1792 Use only bitexact stuff (except (I)DCT).
yading@10 1793
yading@10 1794 =item B<aic>
yading@10 1795
yading@10 1796 Apply H263 advanced intra coding / mpeg4 ac prediction.
yading@10 1797
yading@10 1798 =item B<cbp>
yading@10 1799
yading@10 1800 Deprecated, use mpegvideo private options instead.
yading@10 1801
yading@10 1802 =item B<qprd>
yading@10 1803
yading@10 1804 Deprecated, use mpegvideo private options instead.
yading@10 1805
yading@10 1806 =item B<ilme>
yading@10 1807
yading@10 1808 Apply interlaced motion estimation.
yading@10 1809
yading@10 1810 =item B<cgop>
yading@10 1811
yading@10 1812 Use closed gop.
yading@10 1813
yading@10 1814 =back
yading@10 1815
yading@10 1816
yading@10 1817
yading@10 1818 =item B<sub_id> I<integer>
yading@10 1819
yading@10 1820 Deprecated, currently unused.
yading@10 1821
yading@10 1822
yading@10 1823 =item B<me_method> I<integer> B<(>I<encoding,video>B<)>
yading@10 1824
yading@10 1825 Set motion estimation method.
yading@10 1826
yading@10 1827 Possible values:
yading@10 1828
yading@10 1829 =over 4
yading@10 1830
yading@10 1831
yading@10 1832 =item B<zero>
yading@10 1833
yading@10 1834 zero motion estimation (fastest)
yading@10 1835
yading@10 1836 =item B<full>
yading@10 1837
yading@10 1838 full motion estimation (slowest)
yading@10 1839
yading@10 1840 =item B<epzs>
yading@10 1841
yading@10 1842 EPZS motion estimation (default)
yading@10 1843
yading@10 1844 =item B<esa>
yading@10 1845
yading@10 1846 esa motion estimation (alias for full)
yading@10 1847
yading@10 1848 =item B<tesa>
yading@10 1849
yading@10 1850 tesa motion estimation
yading@10 1851
yading@10 1852 =item B<dia>
yading@10 1853
yading@10 1854 dia motion estimation (alias for epzs)
yading@10 1855
yading@10 1856 =item B<log>
yading@10 1857
yading@10 1858 log motion estimation
yading@10 1859
yading@10 1860 =item B<phods>
yading@10 1861
yading@10 1862 phods motion estimation
yading@10 1863
yading@10 1864 =item B<x1>
yading@10 1865
yading@10 1866 X1 motion estimation
yading@10 1867
yading@10 1868 =item B<hex>
yading@10 1869
yading@10 1870 hex motion estimation
yading@10 1871
yading@10 1872 =item B<umh>
yading@10 1873
yading@10 1874 umh motion estimation
yading@10 1875
yading@10 1876 =item B<iter>
yading@10 1877
yading@10 1878 iter motion estimation
yading@10 1879
yading@10 1880 =back
yading@10 1881
yading@10 1882
yading@10 1883
yading@10 1884 =item B<extradata_size> I<integer>
yading@10 1885
yading@10 1886 Set extradata size.
yading@10 1887
yading@10 1888
yading@10 1889 =item B<time_base> I<rational number>
yading@10 1890
yading@10 1891 Set codec time base.
yading@10 1892
yading@10 1893 It is the fundamental unit of time (in seconds) in terms of which
yading@10 1894 frame timestamps are represented. For fixed-fps content, timebase
yading@10 1895 should be C<1 / frame_rate> and timestamp increments should be
yading@10 1896 identically 1.
yading@10 1897
yading@10 1898
yading@10 1899 =item B<g> I<integer> B<(>I<encoding,video>B<)>
yading@10 1900
yading@10 1901 Set the group of picture size. Default value is 12.
yading@10 1902
yading@10 1903
yading@10 1904 =item B<ar> I<integer> B<(>I<decoding/encoding,audio>B<)>
yading@10 1905
yading@10 1906 Set audio sampling rate (in Hz).
yading@10 1907
yading@10 1908
yading@10 1909 =item B<ac> I<integer> B<(>I<decoding/encoding,audio>B<)>
yading@10 1910
yading@10 1911 Set number of audio channels.
yading@10 1912
yading@10 1913
yading@10 1914 =item B<cutoff> I<integer> B<(>I<encoding,audio>B<)>
yading@10 1915
yading@10 1916 Set cutoff bandwidth.
yading@10 1917
yading@10 1918
yading@10 1919 =item B<frame_size> I<integer> B<(>I<encoding,audio>B<)>
yading@10 1920
yading@10 1921 Set audio frame size.
yading@10 1922
yading@10 1923 Each submitted frame except the last must contain exactly frame_size
yading@10 1924 samples per channel. May be 0 when the codec has
yading@10 1925 CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
yading@10 1926 restricted. It is set by some decoders to indicate constant frame
yading@10 1927 size.
yading@10 1928
yading@10 1929
yading@10 1930 =item B<frame_number> I<integer>
yading@10 1931
yading@10 1932 Set the frame number.
yading@10 1933
yading@10 1934
yading@10 1935 =item B<delay> I<integer>
yading@10 1936
yading@10 1937
yading@10 1938
yading@10 1939 =item B<qcomp> I<float> B<(>I<encoding,video>B<)>
yading@10 1940
yading@10 1941 Set video quantizer scale compression (VBR). It is used as a constant
yading@10 1942 in the ratecontrol equation. Recommended range for default rc_eq:
yading@10 1943 0.0-1.0.
yading@10 1944
yading@10 1945
yading@10 1946 =item B<qblur> I<float> B<(>I<encoding,video>B<)>
yading@10 1947
yading@10 1948 Set video quantizer scale blur (VBR).
yading@10 1949
yading@10 1950
yading@10 1951 =item B<qmin> I<integer> B<(>I<encoding,video>B<)>
yading@10 1952
yading@10 1953 Set min video quantizer scale (VBR). Must be included between -1 and
yading@10 1954 69, default value is 2.
yading@10 1955
yading@10 1956
yading@10 1957 =item B<qmax> I<integer> B<(>I<encoding,video>B<)>
yading@10 1958
yading@10 1959 Set max video quantizer scale (VBR). Must be included between -1 and
yading@10 1960 1024, default value is 31.
yading@10 1961
yading@10 1962
yading@10 1963 =item B<qdiff> I<integer> B<(>I<encoding,video>B<)>
yading@10 1964
yading@10 1965 Set max difference between the quantizer scale (VBR).
yading@10 1966
yading@10 1967
yading@10 1968 =item B<bf> I<integer> B<(>I<encoding,video>B<)>
yading@10 1969
yading@10 1970 Set max number of B frames.
yading@10 1971
yading@10 1972
yading@10 1973 =item B<b_qfactor> I<float> B<(>I<encoding,video>B<)>
yading@10 1974
yading@10 1975 Set qp factor between P and B frames.
yading@10 1976
yading@10 1977
yading@10 1978 =item B<rc_strategy> I<integer> B<(>I<encoding,video>B<)>
yading@10 1979
yading@10 1980 Set ratecontrol method.
yading@10 1981
yading@10 1982
yading@10 1983 =item B<b_strategy> I<integer> B<(>I<encoding,video>B<)>
yading@10 1984
yading@10 1985 Set strategy to choose between I/P/B-frames.
yading@10 1986
yading@10 1987
yading@10 1988 =item B<ps> I<integer> B<(>I<encoding,video>B<)>
yading@10 1989
yading@10 1990 Set RTP payload size in bytes.
yading@10 1991
yading@10 1992
yading@10 1993 =item B<mv_bits> I<integer>
yading@10 1994
yading@10 1995
yading@10 1996 =item B<header_bits> I<integer>
yading@10 1997
yading@10 1998
yading@10 1999 =item B<i_tex_bits> I<integer>
yading@10 2000
yading@10 2001
yading@10 2002 =item B<p_tex_bits> I<integer>
yading@10 2003
yading@10 2004
yading@10 2005 =item B<i_count> I<integer>
yading@10 2006
yading@10 2007
yading@10 2008 =item B<p_count> I<integer>
yading@10 2009
yading@10 2010
yading@10 2011 =item B<skip_count> I<integer>
yading@10 2012
yading@10 2013
yading@10 2014 =item B<misc_bits> I<integer>
yading@10 2015
yading@10 2016
yading@10 2017 =item B<frame_bits> I<integer>
yading@10 2018
yading@10 2019
yading@10 2020 =item B<codec_tag> I<integer>
yading@10 2021
yading@10 2022
yading@10 2023 =item B<bug> I<flags> B<(>I<decoding,video>B<)>
yading@10 2024
yading@10 2025 Workaround not auto detected encoder bugs.
yading@10 2026
yading@10 2027 Possible values:
yading@10 2028
yading@10 2029 =over 4
yading@10 2030
yading@10 2031
yading@10 2032 =item B<autodetect>
yading@10 2033
yading@10 2034
yading@10 2035
yading@10 2036 =item B<old_msmpeg4>
yading@10 2037
yading@10 2038 some old lavc generated msmpeg4v3 files (no autodetection)
yading@10 2039
yading@10 2040 =item B<xvid_ilace>
yading@10 2041
yading@10 2042 Xvid interlacing bug (autodetected if fourcc==XVIX)
yading@10 2043
yading@10 2044 =item B<ump4>
yading@10 2045
yading@10 2046 (autodetected if fourcc==UMP4)
yading@10 2047
yading@10 2048 =item B<no_padding>
yading@10 2049
yading@10 2050 padding bug (autodetected)
yading@10 2051
yading@10 2052 =item B<amv>
yading@10 2053
yading@10 2054
yading@10 2055
yading@10 2056 =item B<ac_vlc>
yading@10 2057
yading@10 2058 illegal vlc bug (autodetected per fourcc)
yading@10 2059
yading@10 2060 =item B<qpel_chroma>
yading@10 2061
yading@10 2062
yading@10 2063
yading@10 2064 =item B<std_qpel>
yading@10 2065
yading@10 2066 old standard qpel (autodetected per fourcc/version)
yading@10 2067
yading@10 2068 =item B<qpel_chroma2>
yading@10 2069
yading@10 2070
yading@10 2071
yading@10 2072 =item B<direct_blocksize>
yading@10 2073
yading@10 2074 direct-qpel-blocksize bug (autodetected per fourcc/version)
yading@10 2075
yading@10 2076 =item B<edge>
yading@10 2077
yading@10 2078 edge padding bug (autodetected per fourcc/version)
yading@10 2079
yading@10 2080 =item B<hpel_chroma>
yading@10 2081
yading@10 2082
yading@10 2083
yading@10 2084 =item B<dc_clip>
yading@10 2085
yading@10 2086
yading@10 2087
yading@10 2088 =item B<ms>
yading@10 2089
yading@10 2090 Workaround various bugs in microsoft broken decoders.
yading@10 2091
yading@10 2092 =item B<trunc>
yading@10 2093
yading@10 2094 trancated frames
yading@10 2095
yading@10 2096 =back
yading@10 2097
yading@10 2098
yading@10 2099
yading@10 2100 =item B<lelim> I<integer> B<(>I<encoding,video>B<)>
yading@10 2101
yading@10 2102 Set single coefficient elimination threshold for luminance (negative
yading@10 2103 values also consider DC coefficient).
yading@10 2104
yading@10 2105
yading@10 2106 =item B<celim> I<integer> B<(>I<encoding,video>B<)>
yading@10 2107
yading@10 2108 Set single coefficient elimination threshold for chrominance (negative
yading@10 2109 values also consider dc coefficient)
yading@10 2110
yading@10 2111
yading@10 2112 =item B<strict> I<integer> B<(>I<decoding/encoding,audio,video>B<)>
yading@10 2113
yading@10 2114 Specify how strictly to follow the standards.
yading@10 2115
yading@10 2116 Possible values:
yading@10 2117
yading@10 2118 =over 4
yading@10 2119
yading@10 2120
yading@10 2121 =item B<very>
yading@10 2122
yading@10 2123 strictly conform to a older more strict version of the spec or reference software
yading@10 2124
yading@10 2125 =item B<strict>
yading@10 2126
yading@10 2127 strictly conform to all the things in the spec no matter what consequences
yading@10 2128
yading@10 2129 =item B<normal>
yading@10 2130
yading@10 2131
yading@10 2132
yading@10 2133 =item B<unofficial>
yading@10 2134
yading@10 2135 allow unofficial extensions
yading@10 2136
yading@10 2137 =item B<experimental>
yading@10 2138
yading@10 2139 allow non standardized experimental things
yading@10 2140
yading@10 2141 =back
yading@10 2142
yading@10 2143
yading@10 2144
yading@10 2145 =item B<b_qoffset> I<float> B<(>I<encoding,video>B<)>
yading@10 2146
yading@10 2147 Set QP offset between P and B frames.
yading@10 2148
yading@10 2149
yading@10 2150 =item B<err_detect> I<flags> B<(>I<decoding,audio,video>B<)>
yading@10 2151
yading@10 2152 Set error detection flags.
yading@10 2153
yading@10 2154 Possible values:
yading@10 2155
yading@10 2156 =over 4
yading@10 2157
yading@10 2158
yading@10 2159 =item B<crccheck>
yading@10 2160
yading@10 2161 verify embedded CRCs
yading@10 2162
yading@10 2163 =item B<bitstream>
yading@10 2164
yading@10 2165 detect bitstream specification deviations
yading@10 2166
yading@10 2167 =item B<buffer>
yading@10 2168
yading@10 2169 detect improper bitstream length
yading@10 2170
yading@10 2171 =item B<explode>
yading@10 2172
yading@10 2173 abort decoding on minor error detection
yading@10 2174
yading@10 2175 =item B<careful>
yading@10 2176
yading@10 2177 consider things that violate the spec and have not been seen in the wild as errors
yading@10 2178
yading@10 2179 =item B<compliant>
yading@10 2180
yading@10 2181 consider all spec non compliancies as errors
yading@10 2182
yading@10 2183 =item B<aggressive>
yading@10 2184
yading@10 2185 consider things that a sane encoder should not do as an error
yading@10 2186
yading@10 2187 =back
yading@10 2188
yading@10 2189
yading@10 2190
yading@10 2191 =item B<has_b_frames> I<integer>
yading@10 2192
yading@10 2193
yading@10 2194
yading@10 2195 =item B<block_align> I<integer>
yading@10 2196
yading@10 2197
yading@10 2198
yading@10 2199 =item B<mpeg_quant> I<integer> B<(>I<encoding,video>B<)>
yading@10 2200
yading@10 2201 Use MPEG quantizers instead of H.263.
yading@10 2202
yading@10 2203
yading@10 2204 =item B<qsquish> I<float> B<(>I<encoding,video>B<)>
yading@10 2205
yading@10 2206 How to keep quantizer between qmin and qmax (0 = clip, 1 = use
yading@10 2207 differentiable function).
yading@10 2208
yading@10 2209
yading@10 2210 =item B<rc_qmod_amp> I<float> B<(>I<encoding,video>B<)>
yading@10 2211
yading@10 2212 Set experimental quantizer modulation.
yading@10 2213
yading@10 2214
yading@10 2215 =item B<rc_qmod_freq> I<integer> B<(>I<encoding,video>B<)>
yading@10 2216
yading@10 2217 Set experimental quantizer modulation.
yading@10 2218
yading@10 2219
yading@10 2220 =item B<rc_override_count> I<integer>
yading@10 2221
yading@10 2222
yading@10 2223
yading@10 2224 =item B<rc_eq> I<string> B<(>I<encoding,video>B<)>
yading@10 2225
yading@10 2226 Set rate control equation. When computing the expression, besides the
yading@10 2227 standard functions defined in the section 'Expression Evaluation', the
yading@10 2228 following functions are available: bits2qp(bits), qp2bits(qp). Also
yading@10 2229 the following constants are available: iTex pTex tex mv fCode iCount
yading@10 2230 mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
yading@10 2231 avgTex.
yading@10 2232
yading@10 2233
yading@10 2234 =item B<maxrate> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 2235
yading@10 2236 Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
yading@10 2237
yading@10 2238
yading@10 2239 =item B<minrate> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 2240
yading@10 2241 Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
yading@10 2242 encode. It is of little use elsewise.
yading@10 2243
yading@10 2244
yading@10 2245 =item B<bufsize> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 2246
yading@10 2247 Set ratecontrol buffer size (in bits).
yading@10 2248
yading@10 2249
yading@10 2250 =item B<rc_buf_aggressivity> I<float> B<(>I<encoding,video>B<)>
yading@10 2251
yading@10 2252 Currently useless.
yading@10 2253
yading@10 2254
yading@10 2255 =item B<i_qfactor> I<float> B<(>I<encoding,video>B<)>
yading@10 2256
yading@10 2257 Set QP factor between P and I frames.
yading@10 2258
yading@10 2259
yading@10 2260 =item B<i_qoffset> I<float> B<(>I<encoding,video>B<)>
yading@10 2261
yading@10 2262 Set QP offset between P and I frames.
yading@10 2263
yading@10 2264
yading@10 2265 =item B<rc_init_cplx> I<float> B<(>I<encoding,video>B<)>
yading@10 2266
yading@10 2267 Set initial complexity for 1-pass encoding.
yading@10 2268
yading@10 2269
yading@10 2270 =item B<dct> I<integer> B<(>I<encoding,video>B<)>
yading@10 2271
yading@10 2272 Set DCT algorithm.
yading@10 2273
yading@10 2274 Possible values:
yading@10 2275
yading@10 2276 =over 4
yading@10 2277
yading@10 2278
yading@10 2279 =item B<auto>
yading@10 2280
yading@10 2281 autoselect a good one (default)
yading@10 2282
yading@10 2283 =item B<fastint>
yading@10 2284
yading@10 2285 fast integer
yading@10 2286
yading@10 2287 =item B<int>
yading@10 2288
yading@10 2289 accurate integer
yading@10 2290
yading@10 2291 =item B<mmx>
yading@10 2292
yading@10 2293
yading@10 2294
yading@10 2295 =item B<altivec>
yading@10 2296
yading@10 2297
yading@10 2298
yading@10 2299 =item B<faan>
yading@10 2300
yading@10 2301 floating point AAN DCT
yading@10 2302
yading@10 2303 =back
yading@10 2304
yading@10 2305
yading@10 2306
yading@10 2307 =item B<lumi_mask> I<float> B<(>I<encoding,video>B<)>
yading@10 2308
yading@10 2309 Compress bright areas stronger than medium ones.
yading@10 2310
yading@10 2311
yading@10 2312 =item B<tcplx_mask> I<float> B<(>I<encoding,video>B<)>
yading@10 2313
yading@10 2314 Set temporal complexity masking.
yading@10 2315
yading@10 2316
yading@10 2317 =item B<scplx_mask> I<float> B<(>I<encoding,video>B<)>
yading@10 2318
yading@10 2319 Set spatial complexity masking.
yading@10 2320
yading@10 2321
yading@10 2322 =item B<p_mask> I<float> B<(>I<encoding,video>B<)>
yading@10 2323
yading@10 2324 Set inter masking.
yading@10 2325
yading@10 2326
yading@10 2327 =item B<dark_mask> I<float> B<(>I<encoding,video>B<)>
yading@10 2328
yading@10 2329 Compress dark areas stronger than medium ones.
yading@10 2330
yading@10 2331
yading@10 2332 =item B<idct> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 2333
yading@10 2334 Select IDCT implementation.
yading@10 2335
yading@10 2336 Possible values:
yading@10 2337
yading@10 2338 =over 4
yading@10 2339
yading@10 2340
yading@10 2341 =item B<auto>
yading@10 2342
yading@10 2343
yading@10 2344
yading@10 2345 =item B<int>
yading@10 2346
yading@10 2347
yading@10 2348
yading@10 2349 =item B<simple>
yading@10 2350
yading@10 2351
yading@10 2352
yading@10 2353 =item B<simplemmx>
yading@10 2354
yading@10 2355
yading@10 2356
yading@10 2357 =item B<libmpeg2mmx>
yading@10 2358
yading@10 2359
yading@10 2360
yading@10 2361 =item B<mmi>
yading@10 2362
yading@10 2363
yading@10 2364
yading@10 2365 =item B<arm>
yading@10 2366
yading@10 2367
yading@10 2368
yading@10 2369 =item B<altivec>
yading@10 2370
yading@10 2371
yading@10 2372
yading@10 2373 =item B<sh4>
yading@10 2374
yading@10 2375
yading@10 2376
yading@10 2377 =item B<simplearm>
yading@10 2378
yading@10 2379
yading@10 2380
yading@10 2381 =item B<simplearmv5te>
yading@10 2382
yading@10 2383
yading@10 2384
yading@10 2385 =item B<simplearmv6>
yading@10 2386
yading@10 2387
yading@10 2388
yading@10 2389 =item B<simpleneon>
yading@10 2390
yading@10 2391
yading@10 2392
yading@10 2393 =item B<simplealpha>
yading@10 2394
yading@10 2395
yading@10 2396
yading@10 2397 =item B<h264>
yading@10 2398
yading@10 2399
yading@10 2400
yading@10 2401 =item B<vp3>
yading@10 2402
yading@10 2403
yading@10 2404
yading@10 2405 =item B<ipp>
yading@10 2406
yading@10 2407
yading@10 2408
yading@10 2409 =item B<xvidmmx>
yading@10 2410
yading@10 2411
yading@10 2412
yading@10 2413 =item B<faani>
yading@10 2414
yading@10 2415 floating point AAN IDCT
yading@10 2416
yading@10 2417 =back
yading@10 2418
yading@10 2419
yading@10 2420
yading@10 2421 =item B<slice_count> I<integer>
yading@10 2422
yading@10 2423
yading@10 2424
yading@10 2425 =item B<ec> I<flags> B<(>I<decoding,video>B<)>
yading@10 2426
yading@10 2427 Set error concealment strategy.
yading@10 2428
yading@10 2429 Possible values:
yading@10 2430
yading@10 2431 =over 4
yading@10 2432
yading@10 2433
yading@10 2434 =item B<guess_mvs>
yading@10 2435
yading@10 2436 iterative motion vector (MV) search (slow)
yading@10 2437
yading@10 2438 =item B<deblock>
yading@10 2439
yading@10 2440 use strong deblock filter for damaged MBs
yading@10 2441
yading@10 2442 =back
yading@10 2443
yading@10 2444
yading@10 2445
yading@10 2446 =item B<bits_per_coded_sample> I<integer>
yading@10 2447
yading@10 2448
yading@10 2449
yading@10 2450 =item B<pred> I<integer> B<(>I<encoding,video>B<)>
yading@10 2451
yading@10 2452 Set prediction method.
yading@10 2453
yading@10 2454 Possible values:
yading@10 2455
yading@10 2456 =over 4
yading@10 2457
yading@10 2458
yading@10 2459 =item B<left>
yading@10 2460
yading@10 2461
yading@10 2462
yading@10 2463 =item B<plane>
yading@10 2464
yading@10 2465
yading@10 2466
yading@10 2467 =item B<median>
yading@10 2468
yading@10 2469
yading@10 2470
yading@10 2471 =back
yading@10 2472
yading@10 2473
yading@10 2474
yading@10 2475 =item B<aspect> I<rational number> B<(>I<encoding,video>B<)>
yading@10 2476
yading@10 2477 Set sample aspect ratio.
yading@10 2478
yading@10 2479
yading@10 2480 =item B<debug> I<flags> B<(>I<decoding/encoding,audio,video,subtitles>B<)>
yading@10 2481
yading@10 2482 Print specific debug info.
yading@10 2483
yading@10 2484 Possible values:
yading@10 2485
yading@10 2486 =over 4
yading@10 2487
yading@10 2488
yading@10 2489 =item B<pict>
yading@10 2490
yading@10 2491 picture info
yading@10 2492
yading@10 2493 =item B<rc>
yading@10 2494
yading@10 2495 rate control
yading@10 2496
yading@10 2497 =item B<bitstream>
yading@10 2498
yading@10 2499
yading@10 2500
yading@10 2501 =item B<mb_type>
yading@10 2502
yading@10 2503 macroblock (MB) type
yading@10 2504
yading@10 2505 =item B<qp>
yading@10 2506
yading@10 2507 per-block quantization parameter (QP)
yading@10 2508
yading@10 2509 =item B<mv>
yading@10 2510
yading@10 2511 motion vector
yading@10 2512
yading@10 2513 =item B<dct_coeff>
yading@10 2514
yading@10 2515
yading@10 2516
yading@10 2517 =item B<skip>
yading@10 2518
yading@10 2519
yading@10 2520
yading@10 2521 =item B<startcode>
yading@10 2522
yading@10 2523
yading@10 2524
yading@10 2525 =item B<pts>
yading@10 2526
yading@10 2527
yading@10 2528
yading@10 2529 =item B<er>
yading@10 2530
yading@10 2531 error recognition
yading@10 2532
yading@10 2533 =item B<mmco>
yading@10 2534
yading@10 2535 memory management control operations (H.264)
yading@10 2536
yading@10 2537 =item B<bugs>
yading@10 2538
yading@10 2539
yading@10 2540
yading@10 2541 =item B<vis_qp>
yading@10 2542
yading@10 2543 visualize quantization parameter (QP), lower QP are tinted greener
yading@10 2544
yading@10 2545 =item B<vis_mb_type>
yading@10 2546
yading@10 2547 visualize block types
yading@10 2548
yading@10 2549 =item B<buffers>
yading@10 2550
yading@10 2551 picture buffer allocations
yading@10 2552
yading@10 2553 =item B<thread_ops>
yading@10 2554
yading@10 2555 threading operations
yading@10 2556
yading@10 2557 =back
yading@10 2558
yading@10 2559
yading@10 2560
yading@10 2561 =item B<vismv> I<integer> B<(>I<decoding,video>B<)>
yading@10 2562
yading@10 2563 Visualize motion vectors (MVs).
yading@10 2564
yading@10 2565 Possible values:
yading@10 2566
yading@10 2567 =over 4
yading@10 2568
yading@10 2569
yading@10 2570 =item B<pf>
yading@10 2571
yading@10 2572 forward predicted MVs of P-frames
yading@10 2573
yading@10 2574 =item B<bf>
yading@10 2575
yading@10 2576 forward predicted MVs of B-frames
yading@10 2577
yading@10 2578 =item B<bb>
yading@10 2579
yading@10 2580 backward predicted MVs of B-frames
yading@10 2581
yading@10 2582 =back
yading@10 2583
yading@10 2584
yading@10 2585
yading@10 2586 =item B<cmp> I<integer> B<(>I<encoding,video>B<)>
yading@10 2587
yading@10 2588 Set full pel me compare function.
yading@10 2589
yading@10 2590 Possible values:
yading@10 2591
yading@10 2592 =over 4
yading@10 2593
yading@10 2594
yading@10 2595 =item B<sad>
yading@10 2596
yading@10 2597 sum of absolute differences, fast (default)
yading@10 2598
yading@10 2599 =item B<sse>
yading@10 2600
yading@10 2601 sum of squared errors
yading@10 2602
yading@10 2603 =item B<satd>
yading@10 2604
yading@10 2605 sum of absolute Hadamard transformed differences
yading@10 2606
yading@10 2607 =item B<dct>
yading@10 2608
yading@10 2609 sum of absolute DCT transformed differences
yading@10 2610
yading@10 2611 =item B<psnr>
yading@10 2612
yading@10 2613 sum of squared quantization errors (avoid, low quality)
yading@10 2614
yading@10 2615 =item B<bit>
yading@10 2616
yading@10 2617 number of bits needed for the block
yading@10 2618
yading@10 2619 =item B<rd>
yading@10 2620
yading@10 2621 rate distortion optimal, slow
yading@10 2622
yading@10 2623 =item B<zero>
yading@10 2624
yading@10 2625 0
yading@10 2626
yading@10 2627 =item B<vsad>
yading@10 2628
yading@10 2629 sum of absolute vertical differences
yading@10 2630
yading@10 2631 =item B<vsse>
yading@10 2632
yading@10 2633 sum of squared vertical differences
yading@10 2634
yading@10 2635 =item B<nsse>
yading@10 2636
yading@10 2637 noise preserving sum of squared differences
yading@10 2638
yading@10 2639 =item B<w53>
yading@10 2640
yading@10 2641 5/3 wavelet, only used in snow
yading@10 2642
yading@10 2643 =item B<w97>
yading@10 2644
yading@10 2645 9/7 wavelet, only used in snow
yading@10 2646
yading@10 2647 =item B<dctmax>
yading@10 2648
yading@10 2649
yading@10 2650
yading@10 2651 =item B<chroma>
yading@10 2652
yading@10 2653
yading@10 2654
yading@10 2655 =back
yading@10 2656
yading@10 2657
yading@10 2658
yading@10 2659 =item B<subcmp> I<integer> B<(>I<encoding,video>B<)>
yading@10 2660
yading@10 2661 Set sub pel me compare function.
yading@10 2662
yading@10 2663 Possible values:
yading@10 2664
yading@10 2665 =over 4
yading@10 2666
yading@10 2667
yading@10 2668 =item B<sad>
yading@10 2669
yading@10 2670 sum of absolute differences, fast (default)
yading@10 2671
yading@10 2672 =item B<sse>
yading@10 2673
yading@10 2674 sum of squared errors
yading@10 2675
yading@10 2676 =item B<satd>
yading@10 2677
yading@10 2678 sum of absolute Hadamard transformed differences
yading@10 2679
yading@10 2680 =item B<dct>
yading@10 2681
yading@10 2682 sum of absolute DCT transformed differences
yading@10 2683
yading@10 2684 =item B<psnr>
yading@10 2685
yading@10 2686 sum of squared quantization errors (avoid, low quality)
yading@10 2687
yading@10 2688 =item B<bit>
yading@10 2689
yading@10 2690 number of bits needed for the block
yading@10 2691
yading@10 2692 =item B<rd>
yading@10 2693
yading@10 2694 rate distortion optimal, slow
yading@10 2695
yading@10 2696 =item B<zero>
yading@10 2697
yading@10 2698 0
yading@10 2699
yading@10 2700 =item B<vsad>
yading@10 2701
yading@10 2702 sum of absolute vertical differences
yading@10 2703
yading@10 2704 =item B<vsse>
yading@10 2705
yading@10 2706 sum of squared vertical differences
yading@10 2707
yading@10 2708 =item B<nsse>
yading@10 2709
yading@10 2710 noise preserving sum of squared differences
yading@10 2711
yading@10 2712 =item B<w53>
yading@10 2713
yading@10 2714 5/3 wavelet, only used in snow
yading@10 2715
yading@10 2716 =item B<w97>
yading@10 2717
yading@10 2718 9/7 wavelet, only used in snow
yading@10 2719
yading@10 2720 =item B<dctmax>
yading@10 2721
yading@10 2722
yading@10 2723
yading@10 2724 =item B<chroma>
yading@10 2725
yading@10 2726
yading@10 2727
yading@10 2728 =back
yading@10 2729
yading@10 2730
yading@10 2731
yading@10 2732 =item B<mbcmp> I<integer> B<(>I<encoding,video>B<)>
yading@10 2733
yading@10 2734 Set macroblock compare function.
yading@10 2735
yading@10 2736 Possible values:
yading@10 2737
yading@10 2738 =over 4
yading@10 2739
yading@10 2740
yading@10 2741 =item B<sad>
yading@10 2742
yading@10 2743 sum of absolute differences, fast (default)
yading@10 2744
yading@10 2745 =item B<sse>
yading@10 2746
yading@10 2747 sum of squared errors
yading@10 2748
yading@10 2749 =item B<satd>
yading@10 2750
yading@10 2751 sum of absolute Hadamard transformed differences
yading@10 2752
yading@10 2753 =item B<dct>
yading@10 2754
yading@10 2755 sum of absolute DCT transformed differences
yading@10 2756
yading@10 2757 =item B<psnr>
yading@10 2758
yading@10 2759 sum of squared quantization errors (avoid, low quality)
yading@10 2760
yading@10 2761 =item B<bit>
yading@10 2762
yading@10 2763 number of bits needed for the block
yading@10 2764
yading@10 2765 =item B<rd>
yading@10 2766
yading@10 2767 rate distortion optimal, slow
yading@10 2768
yading@10 2769 =item B<zero>
yading@10 2770
yading@10 2771 0
yading@10 2772
yading@10 2773 =item B<vsad>
yading@10 2774
yading@10 2775 sum of absolute vertical differences
yading@10 2776
yading@10 2777 =item B<vsse>
yading@10 2778
yading@10 2779 sum of squared vertical differences
yading@10 2780
yading@10 2781 =item B<nsse>
yading@10 2782
yading@10 2783 noise preserving sum of squared differences
yading@10 2784
yading@10 2785 =item B<w53>
yading@10 2786
yading@10 2787 5/3 wavelet, only used in snow
yading@10 2788
yading@10 2789 =item B<w97>
yading@10 2790
yading@10 2791 9/7 wavelet, only used in snow
yading@10 2792
yading@10 2793 =item B<dctmax>
yading@10 2794
yading@10 2795
yading@10 2796
yading@10 2797 =item B<chroma>
yading@10 2798
yading@10 2799
yading@10 2800
yading@10 2801 =back
yading@10 2802
yading@10 2803
yading@10 2804
yading@10 2805 =item B<ildctcmp> I<integer> B<(>I<encoding,video>B<)>
yading@10 2806
yading@10 2807 Set interlaced dct compare function.
yading@10 2808
yading@10 2809 Possible values:
yading@10 2810
yading@10 2811 =over 4
yading@10 2812
yading@10 2813
yading@10 2814 =item B<sad>
yading@10 2815
yading@10 2816 sum of absolute differences, fast (default)
yading@10 2817
yading@10 2818 =item B<sse>
yading@10 2819
yading@10 2820 sum of squared errors
yading@10 2821
yading@10 2822 =item B<satd>
yading@10 2823
yading@10 2824 sum of absolute Hadamard transformed differences
yading@10 2825
yading@10 2826 =item B<dct>
yading@10 2827
yading@10 2828 sum of absolute DCT transformed differences
yading@10 2829
yading@10 2830 =item B<psnr>
yading@10 2831
yading@10 2832 sum of squared quantization errors (avoid, low quality)
yading@10 2833
yading@10 2834 =item B<bit>
yading@10 2835
yading@10 2836 number of bits needed for the block
yading@10 2837
yading@10 2838 =item B<rd>
yading@10 2839
yading@10 2840 rate distortion optimal, slow
yading@10 2841
yading@10 2842 =item B<zero>
yading@10 2843
yading@10 2844 0
yading@10 2845
yading@10 2846 =item B<vsad>
yading@10 2847
yading@10 2848 sum of absolute vertical differences
yading@10 2849
yading@10 2850 =item B<vsse>
yading@10 2851
yading@10 2852 sum of squared vertical differences
yading@10 2853
yading@10 2854 =item B<nsse>
yading@10 2855
yading@10 2856 noise preserving sum of squared differences
yading@10 2857
yading@10 2858 =item B<w53>
yading@10 2859
yading@10 2860 5/3 wavelet, only used in snow
yading@10 2861
yading@10 2862 =item B<w97>
yading@10 2863
yading@10 2864 9/7 wavelet, only used in snow
yading@10 2865
yading@10 2866 =item B<dctmax>
yading@10 2867
yading@10 2868
yading@10 2869
yading@10 2870 =item B<chroma>
yading@10 2871
yading@10 2872
yading@10 2873
yading@10 2874 =back
yading@10 2875
yading@10 2876
yading@10 2877
yading@10 2878 =item B<dia_size> I<integer> B<(>I<encoding,video>B<)>
yading@10 2879
yading@10 2880 Set diamond type & size for motion estimation.
yading@10 2881
yading@10 2882
yading@10 2883 =item B<last_pred> I<integer> B<(>I<encoding,video>B<)>
yading@10 2884
yading@10 2885 Set amount of motion predictors from the previous frame.
yading@10 2886
yading@10 2887
yading@10 2888 =item B<preme> I<integer> B<(>I<encoding,video>B<)>
yading@10 2889
yading@10 2890 Set pre motion estimation.
yading@10 2891
yading@10 2892
yading@10 2893 =item B<precmp> I<integer> B<(>I<encoding,video>B<)>
yading@10 2894
yading@10 2895 Set pre motion estimation compare function.
yading@10 2896
yading@10 2897 Possible values:
yading@10 2898
yading@10 2899 =over 4
yading@10 2900
yading@10 2901
yading@10 2902 =item B<sad>
yading@10 2903
yading@10 2904 sum of absolute differences, fast (default)
yading@10 2905
yading@10 2906 =item B<sse>
yading@10 2907
yading@10 2908 sum of squared errors
yading@10 2909
yading@10 2910 =item B<satd>
yading@10 2911
yading@10 2912 sum of absolute Hadamard transformed differences
yading@10 2913
yading@10 2914 =item B<dct>
yading@10 2915
yading@10 2916 sum of absolute DCT transformed differences
yading@10 2917
yading@10 2918 =item B<psnr>
yading@10 2919
yading@10 2920 sum of squared quantization errors (avoid, low quality)
yading@10 2921
yading@10 2922 =item B<bit>
yading@10 2923
yading@10 2924 number of bits needed for the block
yading@10 2925
yading@10 2926 =item B<rd>
yading@10 2927
yading@10 2928 rate distortion optimal, slow
yading@10 2929
yading@10 2930 =item B<zero>
yading@10 2931
yading@10 2932 0
yading@10 2933
yading@10 2934 =item B<vsad>
yading@10 2935
yading@10 2936 sum of absolute vertical differences
yading@10 2937
yading@10 2938 =item B<vsse>
yading@10 2939
yading@10 2940 sum of squared vertical differences
yading@10 2941
yading@10 2942 =item B<nsse>
yading@10 2943
yading@10 2944 noise preserving sum of squared differences
yading@10 2945
yading@10 2946 =item B<w53>
yading@10 2947
yading@10 2948 5/3 wavelet, only used in snow
yading@10 2949
yading@10 2950 =item B<w97>
yading@10 2951
yading@10 2952 9/7 wavelet, only used in snow
yading@10 2953
yading@10 2954 =item B<dctmax>
yading@10 2955
yading@10 2956
yading@10 2957
yading@10 2958 =item B<chroma>
yading@10 2959
yading@10 2960
yading@10 2961
yading@10 2962 =back
yading@10 2963
yading@10 2964
yading@10 2965
yading@10 2966 =item B<pre_dia_size> I<integer> B<(>I<encoding,video>B<)>
yading@10 2967
yading@10 2968 Set diamond type & size for motion estimation pre-pass.
yading@10 2969
yading@10 2970
yading@10 2971 =item B<subq> I<integer> B<(>I<encoding,video>B<)>
yading@10 2972
yading@10 2973 Set sub pel motion estimation quality.
yading@10 2974
yading@10 2975
yading@10 2976 =item B<dtg_active_format> I<integer>
yading@10 2977
yading@10 2978
yading@10 2979
yading@10 2980 =item B<me_range> I<integer> B<(>I<encoding,video>B<)>
yading@10 2981
yading@10 2982 Set limit motion vectors range (1023 for DivX player).
yading@10 2983
yading@10 2984
yading@10 2985 =item B<ibias> I<integer> B<(>I<encoding,video>B<)>
yading@10 2986
yading@10 2987 Set intra quant bias.
yading@10 2988
yading@10 2989
yading@10 2990 =item B<pbias> I<integer> B<(>I<encoding,video>B<)>
yading@10 2991
yading@10 2992 Set inter quant bias.
yading@10 2993
yading@10 2994
yading@10 2995 =item B<color_table_id> I<integer>
yading@10 2996
yading@10 2997
yading@10 2998
yading@10 2999 =item B<global_quality> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 3000
yading@10 3001
yading@10 3002
yading@10 3003 =item B<coder> I<integer> B<(>I<encoding,video>B<)>
yading@10 3004
yading@10 3005
yading@10 3006 Possible values:
yading@10 3007
yading@10 3008 =over 4
yading@10 3009
yading@10 3010
yading@10 3011 =item B<vlc>
yading@10 3012
yading@10 3013 variable length coder / huffman coder
yading@10 3014
yading@10 3015 =item B<ac>
yading@10 3016
yading@10 3017 arithmetic coder
yading@10 3018
yading@10 3019 =item B<raw>
yading@10 3020
yading@10 3021 raw (no encoding)
yading@10 3022
yading@10 3023 =item B<rle>
yading@10 3024
yading@10 3025 run-length coder
yading@10 3026
yading@10 3027 =item B<deflate>
yading@10 3028
yading@10 3029 deflate-based coder
yading@10 3030
yading@10 3031 =back
yading@10 3032
yading@10 3033
yading@10 3034
yading@10 3035 =item B<context> I<integer> B<(>I<encoding,video>B<)>
yading@10 3036
yading@10 3037 Set context model.
yading@10 3038
yading@10 3039
yading@10 3040 =item B<slice_flags> I<integer>
yading@10 3041
yading@10 3042
yading@10 3043
yading@10 3044 =item B<xvmc_acceleration> I<integer>
yading@10 3045
yading@10 3046
yading@10 3047
yading@10 3048 =item B<mbd> I<integer> B<(>I<encoding,video>B<)>
yading@10 3049
yading@10 3050 Set macroblock decision algorithm (high quality mode).
yading@10 3051
yading@10 3052 Possible values:
yading@10 3053
yading@10 3054 =over 4
yading@10 3055
yading@10 3056
yading@10 3057 =item B<simple>
yading@10 3058
yading@10 3059 use mbcmp (default)
yading@10 3060
yading@10 3061 =item B<bits>
yading@10 3062
yading@10 3063 use fewest bits
yading@10 3064
yading@10 3065 =item B<rd>
yading@10 3066
yading@10 3067 use best rate distortion
yading@10 3068
yading@10 3069 =back
yading@10 3070
yading@10 3071
yading@10 3072
yading@10 3073 =item B<stream_codec_tag> I<integer>
yading@10 3074
yading@10 3075
yading@10 3076
yading@10 3077 =item B<sc_threshold> I<integer> B<(>I<encoding,video>B<)>
yading@10 3078
yading@10 3079 Set scene change threshold.
yading@10 3080
yading@10 3081
yading@10 3082 =item B<lmin> I<integer> B<(>I<encoding,video>B<)>
yading@10 3083
yading@10 3084 Set min lagrange factor (VBR).
yading@10 3085
yading@10 3086
yading@10 3087 =item B<lmax> I<integer> B<(>I<encoding,video>B<)>
yading@10 3088
yading@10 3089 Set max lagrange factor (VBR).
yading@10 3090
yading@10 3091
yading@10 3092 =item B<nr> I<integer> B<(>I<encoding,video>B<)>
yading@10 3093
yading@10 3094 Set noise reduction.
yading@10 3095
yading@10 3096
yading@10 3097 =item B<rc_init_occupancy> I<integer> B<(>I<encoding,video>B<)>
yading@10 3098
yading@10 3099 Set number of bits which should be loaded into the rc buffer before
yading@10 3100 decoding starts.
yading@10 3101
yading@10 3102
yading@10 3103 =item B<inter_threshold> I<integer> B<(>I<encoding,video>B<)>
yading@10 3104
yading@10 3105
yading@10 3106
yading@10 3107 =item B<flags2> I<flags> B<(>I<decoding/encoding,audio,video>B<)>
yading@10 3108
yading@10 3109
yading@10 3110 Possible values:
yading@10 3111
yading@10 3112 =over 4
yading@10 3113
yading@10 3114
yading@10 3115 =item B<fast>
yading@10 3116
yading@10 3117 allow non spec compliant speedup tricks
yading@10 3118
yading@10 3119 =item B<sgop>
yading@10 3120
yading@10 3121 Deprecated, use mpegvideo private options instead
yading@10 3122
yading@10 3123 =item B<noout>
yading@10 3124
yading@10 3125 skip bitstream encoding
yading@10 3126
yading@10 3127 =item B<local_header>
yading@10 3128
yading@10 3129 place global headers at every keyframe instead of in extradata
yading@10 3130
yading@10 3131 =item B<chunks>
yading@10 3132
yading@10 3133 Frame data might be split into multiple chunks
yading@10 3134
yading@10 3135 =item B<showall>
yading@10 3136
yading@10 3137 Show all frames before the first keyframe
yading@10 3138
yading@10 3139 =item B<skiprd>
yading@10 3140
yading@10 3141 Deprecated, use mpegvideo private options instead
yading@10 3142
yading@10 3143 =back
yading@10 3144
yading@10 3145
yading@10 3146
yading@10 3147 =item B<error> I<integer> B<(>I<encoding,video>B<)>
yading@10 3148
yading@10 3149
yading@10 3150
yading@10 3151 =item B<qns> I<integer> B<(>I<encoding,video>B<)>
yading@10 3152
yading@10 3153 Deprecated, use mpegvideo private options instead.
yading@10 3154
yading@10 3155
yading@10 3156 =item B<threads> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 3157
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<auto>
yading@10 3165
yading@10 3166 detect a good number of threads
yading@10 3167
yading@10 3168 =back
yading@10 3169
yading@10 3170
yading@10 3171
yading@10 3172 =item B<me_threshold> I<integer> B<(>I<encoding,video>B<)>
yading@10 3173
yading@10 3174 Set motion estimation threshold.
yading@10 3175
yading@10 3176
yading@10 3177 =item B<mb_threshold> I<integer> B<(>I<encoding,video>B<)>
yading@10 3178
yading@10 3179 Set macroblock threshold.
yading@10 3180
yading@10 3181
yading@10 3182 =item B<dc> I<integer> B<(>I<encoding,video>B<)>
yading@10 3183
yading@10 3184 Set intra_dc_precision.
yading@10 3185
yading@10 3186
yading@10 3187 =item B<nssew> I<integer> B<(>I<encoding,video>B<)>
yading@10 3188
yading@10 3189 Set nsse weight.
yading@10 3190
yading@10 3191
yading@10 3192 =item B<skip_top> I<integer> B<(>I<decoding,video>B<)>
yading@10 3193
yading@10 3194 Set number of macroblock rows at the top which are skipped.
yading@10 3195
yading@10 3196
yading@10 3197 =item B<skip_bottom> I<integer> B<(>I<decoding,video>B<)>
yading@10 3198
yading@10 3199 Set number of macroblock rows at the bottom which are skipped.
yading@10 3200
yading@10 3201
yading@10 3202 =item B<profile> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 3203
yading@10 3204
yading@10 3205 Possible values:
yading@10 3206
yading@10 3207 =over 4
yading@10 3208
yading@10 3209
yading@10 3210 =item B<unknown>
yading@10 3211
yading@10 3212
yading@10 3213
yading@10 3214 =item B<aac_main>
yading@10 3215
yading@10 3216
yading@10 3217
yading@10 3218 =item B<aac_low>
yading@10 3219
yading@10 3220
yading@10 3221
yading@10 3222 =item B<aac_ssr>
yading@10 3223
yading@10 3224
yading@10 3225
yading@10 3226 =item B<aac_ltp>
yading@10 3227
yading@10 3228
yading@10 3229
yading@10 3230 =item B<aac_he>
yading@10 3231
yading@10 3232
yading@10 3233
yading@10 3234 =item B<aac_he_v2>
yading@10 3235
yading@10 3236
yading@10 3237
yading@10 3238 =item B<aac_ld>
yading@10 3239
yading@10 3240
yading@10 3241
yading@10 3242 =item B<aac_eld>
yading@10 3243
yading@10 3244
yading@10 3245
yading@10 3246 =item B<dts>
yading@10 3247
yading@10 3248
yading@10 3249
yading@10 3250 =item B<dts_es>
yading@10 3251
yading@10 3252
yading@10 3253
yading@10 3254 =item B<dts_96_24>
yading@10 3255
yading@10 3256
yading@10 3257
yading@10 3258 =item B<dts_hd_hra>
yading@10 3259
yading@10 3260
yading@10 3261
yading@10 3262 =item B<dts_hd_ma>
yading@10 3263
yading@10 3264
yading@10 3265
yading@10 3266 =back
yading@10 3267
yading@10 3268
yading@10 3269
yading@10 3270 =item B<level> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 3271
yading@10 3272
yading@10 3273 Possible values:
yading@10 3274
yading@10 3275 =over 4
yading@10 3276
yading@10 3277
yading@10 3278 =item B<unknown>
yading@10 3279
yading@10 3280
yading@10 3281
yading@10 3282 =back
yading@10 3283
yading@10 3284
yading@10 3285
yading@10 3286 =item B<lowres> I<integer> B<(>I<decoding,audio,video>B<)>
yading@10 3287
yading@10 3288 Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
yading@10 3289
yading@10 3290
yading@10 3291 =item B<skip_threshold> I<integer> B<(>I<encoding,video>B<)>
yading@10 3292
yading@10 3293 Set frame skip threshold.
yading@10 3294
yading@10 3295
yading@10 3296 =item B<skip_factor> I<integer> B<(>I<encoding,video>B<)>
yading@10 3297
yading@10 3298 Set frame skip factor.
yading@10 3299
yading@10 3300
yading@10 3301 =item B<skip_exp> I<integer> B<(>I<encoding,video>B<)>
yading@10 3302
yading@10 3303 Set frame skip exponent.
yading@10 3304
yading@10 3305
yading@10 3306 =item B<skipcmp> I<integer> B<(>I<encoding,video>B<)>
yading@10 3307
yading@10 3308 Set frame skip compare function.
yading@10 3309
yading@10 3310 Possible values:
yading@10 3311
yading@10 3312 =over 4
yading@10 3313
yading@10 3314
yading@10 3315 =item B<sad>
yading@10 3316
yading@10 3317 sum of absolute differences, fast (default)
yading@10 3318
yading@10 3319 =item B<sse>
yading@10 3320
yading@10 3321 sum of squared errors
yading@10 3322
yading@10 3323 =item B<satd>
yading@10 3324
yading@10 3325 sum of absolute Hadamard transformed differences
yading@10 3326
yading@10 3327 =item B<dct>
yading@10 3328
yading@10 3329 sum of absolute DCT transformed differences
yading@10 3330
yading@10 3331 =item B<psnr>
yading@10 3332
yading@10 3333 sum of squared quantization errors (avoid, low quality)
yading@10 3334
yading@10 3335 =item B<bit>
yading@10 3336
yading@10 3337 number of bits needed for the block
yading@10 3338
yading@10 3339 =item B<rd>
yading@10 3340
yading@10 3341 rate distortion optimal, slow
yading@10 3342
yading@10 3343 =item B<zero>
yading@10 3344
yading@10 3345 0
yading@10 3346
yading@10 3347 =item B<vsad>
yading@10 3348
yading@10 3349 sum of absolute vertical differences
yading@10 3350
yading@10 3351 =item B<vsse>
yading@10 3352
yading@10 3353 sum of squared vertical differences
yading@10 3354
yading@10 3355 =item B<nsse>
yading@10 3356
yading@10 3357 noise preserving sum of squared differences
yading@10 3358
yading@10 3359 =item B<w53>
yading@10 3360
yading@10 3361 5/3 wavelet, only used in snow
yading@10 3362
yading@10 3363 =item B<w97>
yading@10 3364
yading@10 3365 9/7 wavelet, only used in snow
yading@10 3366
yading@10 3367 =item B<dctmax>
yading@10 3368
yading@10 3369
yading@10 3370
yading@10 3371 =item B<chroma>
yading@10 3372
yading@10 3373
yading@10 3374
yading@10 3375 =back
yading@10 3376
yading@10 3377
yading@10 3378
yading@10 3379 =item B<border_mask> I<float> B<(>I<encoding,video>B<)>
yading@10 3380
yading@10 3381 Increase the quantizer for macroblocks close to borders.
yading@10 3382
yading@10 3383
yading@10 3384 =item B<mblmin> I<integer> B<(>I<encoding,video>B<)>
yading@10 3385
yading@10 3386 Set min macroblock lagrange factor (VBR).
yading@10 3387
yading@10 3388
yading@10 3389 =item B<mblmax> I<integer> B<(>I<encoding,video>B<)>
yading@10 3390
yading@10 3391 Set max macroblock lagrange factor (VBR).
yading@10 3392
yading@10 3393
yading@10 3394 =item B<mepc> I<integer> B<(>I<encoding,video>B<)>
yading@10 3395
yading@10 3396 Set motion estimation bitrate penalty compensation (1.0 = 256).
yading@10 3397
yading@10 3398
yading@10 3399 =item B<skip_loop_filter> I<integer> B<(>I<decoding,video>B<)>
yading@10 3400
yading@10 3401
yading@10 3402 =item B<skip_idct> I<integer> B<(>I<decoding,video>B<)>
yading@10 3403
yading@10 3404
yading@10 3405 =item B<skip_frame> I<integer> B<(>I<decoding,video>B<)>
yading@10 3406
yading@10 3407
yading@10 3408 Make decoder discard processing depending on the frame type selected
yading@10 3409 by the option value.
yading@10 3410
yading@10 3411 B<skip_loop_filter> skips frame loop filtering, B<skip_idct>
yading@10 3412 skips frame IDCT/dequantization, B<skip_frame> skips decoding.
yading@10 3413
yading@10 3414 Possible values:
yading@10 3415
yading@10 3416 =over 4
yading@10 3417
yading@10 3418
yading@10 3419 =item B<none>
yading@10 3420
yading@10 3421 Discard no frame.
yading@10 3422
yading@10 3423
yading@10 3424 =item B<default>
yading@10 3425
yading@10 3426 Discard useless frames like 0-sized frames.
yading@10 3427
yading@10 3428
yading@10 3429 =item B<noref>
yading@10 3430
yading@10 3431 Discard all non-reference frames.
yading@10 3432
yading@10 3433
yading@10 3434 =item B<bidir>
yading@10 3435
yading@10 3436 Discard all bidirectional frames.
yading@10 3437
yading@10 3438
yading@10 3439 =item B<nokey>
yading@10 3440
yading@10 3441 Discard all frames excepts keyframes.
yading@10 3442
yading@10 3443
yading@10 3444 =item B<all>
yading@10 3445
yading@10 3446 Discard all frames.
yading@10 3447
yading@10 3448 =back
yading@10 3449
yading@10 3450
yading@10 3451 Default value is B<default>.
yading@10 3452
yading@10 3453
yading@10 3454 =item B<bidir_refine> I<integer> B<(>I<encoding,video>B<)>
yading@10 3455
yading@10 3456 Refine the two motion vectors used in bidirectional macroblocks.
yading@10 3457
yading@10 3458
yading@10 3459 =item B<brd_scale> I<integer> B<(>I<encoding,video>B<)>
yading@10 3460
yading@10 3461 Downscale frames for dynamic B-frame decision.
yading@10 3462
yading@10 3463
yading@10 3464 =item B<keyint_min> I<integer> B<(>I<encoding,video>B<)>
yading@10 3465
yading@10 3466 Set minimum interval between IDR-frames.
yading@10 3467
yading@10 3468
yading@10 3469 =item B<refs> I<integer> B<(>I<encoding,video>B<)>
yading@10 3470
yading@10 3471 Set reference frames to consider for motion compensation.
yading@10 3472
yading@10 3473
yading@10 3474 =item B<chromaoffset> I<integer> B<(>I<encoding,video>B<)>
yading@10 3475
yading@10 3476 Set chroma qp offset from luma.
yading@10 3477
yading@10 3478
yading@10 3479 =item B<trellis> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 3480
yading@10 3481 Set rate-distortion optimal quantization.
yading@10 3482
yading@10 3483
yading@10 3484 =item B<sc_factor> I<integer> B<(>I<encoding,video>B<)>
yading@10 3485
yading@10 3486 Set value multiplied by qscale for each frame and added to
yading@10 3487 scene_change_score.
yading@10 3488
yading@10 3489
yading@10 3490 =item B<mv0_threshold> I<integer> B<(>I<encoding,video>B<)>
yading@10 3491
yading@10 3492
yading@10 3493 =item B<b_sensitivity> I<integer> B<(>I<encoding,video>B<)>
yading@10 3494
yading@10 3495 Adjust sensitivity of b_frame_strategy 1.
yading@10 3496
yading@10 3497
yading@10 3498 =item B<compression_level> I<integer> B<(>I<encoding,audio,video>B<)>
yading@10 3499
yading@10 3500
yading@10 3501 =item B<min_prediction_order> I<integer> B<(>I<encoding,audio>B<)>
yading@10 3502
yading@10 3503
yading@10 3504 =item B<max_prediction_order> I<integer> B<(>I<encoding,audio>B<)>
yading@10 3505
yading@10 3506
yading@10 3507 =item B<timecode_frame_start> I<integer> B<(>I<encoding,video>B<)>
yading@10 3508
yading@10 3509 Set GOP timecode frame start number, in non drop frame format.
yading@10 3510
yading@10 3511
yading@10 3512 =item B<request_channels> I<integer> B<(>I<decoding,audio>B<)>
yading@10 3513
yading@10 3514 Set desired number of audio channels.
yading@10 3515
yading@10 3516
yading@10 3517 =item B<bits_per_raw_sample> I<integer>
yading@10 3518
yading@10 3519
yading@10 3520 =item B<channel_layout> I<integer> B<(>I<decoding/encoding,audio>B<)>
yading@10 3521
yading@10 3522
yading@10 3523 Possible values:
yading@10 3524
yading@10 3525 =over 4
yading@10 3526
yading@10 3527
yading@10 3528 =back
yading@10 3529
yading@10 3530
yading@10 3531 =item B<request_channel_layout> I<integer> B<(>I<decoding,audio>B<)>
yading@10 3532
yading@10 3533
yading@10 3534 Possible values:
yading@10 3535
yading@10 3536 =over 4
yading@10 3537
yading@10 3538
yading@10 3539 =back
yading@10 3540
yading@10 3541
yading@10 3542 =item B<rc_max_vbv_use> I<float> B<(>I<encoding,video>B<)>
yading@10 3543
yading@10 3544
yading@10 3545 =item B<rc_min_vbv_use> I<float> B<(>I<encoding,video>B<)>
yading@10 3546
yading@10 3547
yading@10 3548 =item B<ticks_per_frame> I<integer> B<(>I<decoding/encoding,audio,video>B<)>
yading@10 3549
yading@10 3550
yading@10 3551 =item B<color_primaries> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 3552
yading@10 3553
yading@10 3554 =item B<color_trc> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 3555
yading@10 3556
yading@10 3557 =item B<colorspace> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 3558
yading@10 3559
yading@10 3560 =item B<color_range> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 3561
yading@10 3562
yading@10 3563 =item B<chroma_sample_location> I<integer> B<(>I<decoding/encoding,video>B<)>
yading@10 3564
yading@10 3565
yading@10 3566
yading@10 3567 =item B<log_level_offset> I<integer>
yading@10 3568
yading@10 3569 Set the log level offset.
yading@10 3570
yading@10 3571
yading@10 3572 =item B<slices> I<integer> B<(>I<encoding,video>B<)>
yading@10 3573
yading@10 3574 Number of slices, used in parallelized encoding.
yading@10 3575
yading@10 3576
yading@10 3577 =item B<thread_type> I<flags> B<(>I<decoding/encoding,video>B<)>
yading@10 3578
yading@10 3579 Select multithreading type.
yading@10 3580
yading@10 3581 Possible values:
yading@10 3582
yading@10 3583 =over 4
yading@10 3584
yading@10 3585
yading@10 3586 =item B<slice>
yading@10 3587
yading@10 3588
yading@10 3589
yading@10 3590 =item B<frame>
yading@10 3591
yading@10 3592
yading@10 3593
yading@10 3594 =back
yading@10 3595
yading@10 3596
yading@10 3597 =item B<audio_service_type> I<integer> B<(>I<encoding,audio>B<)>
yading@10 3598
yading@10 3599 Set audio service type.
yading@10 3600
yading@10 3601 Possible values:
yading@10 3602
yading@10 3603 =over 4
yading@10 3604
yading@10 3605
yading@10 3606 =item B<ma>
yading@10 3607
yading@10 3608 Main Audio Service
yading@10 3609
yading@10 3610 =item B<ef>
yading@10 3611
yading@10 3612 Effects
yading@10 3613
yading@10 3614 =item B<vi>
yading@10 3615
yading@10 3616 Visually Impaired
yading@10 3617
yading@10 3618 =item B<hi>
yading@10 3619
yading@10 3620 Hearing Impaired
yading@10 3621
yading@10 3622 =item B<di>
yading@10 3623
yading@10 3624 Dialogue
yading@10 3625
yading@10 3626 =item B<co>
yading@10 3627
yading@10 3628 Commentary
yading@10 3629
yading@10 3630 =item B<em>
yading@10 3631
yading@10 3632 Emergency
yading@10 3633
yading@10 3634 =item B<vo>
yading@10 3635
yading@10 3636 Voice Over
yading@10 3637
yading@10 3638 =item B<ka>
yading@10 3639
yading@10 3640 Karaoke
yading@10 3641
yading@10 3642 =back
yading@10 3643
yading@10 3644
yading@10 3645
yading@10 3646 =item B<request_sample_fmt> I<sample_fmt> B<(>I<decoding,audio>B<)>
yading@10 3647
yading@10 3648 Set sample format audio decoders should prefer. Default value is
yading@10 3649 C<none>.
yading@10 3650
yading@10 3651
yading@10 3652 =item B<pkt_timebase> I<rational number>
yading@10 3653
yading@10 3654
yading@10 3655
yading@10 3656 =item B<sub_charenc> I<encoding> B<(>I<decoding,subtitles>B<)>
yading@10 3657
yading@10 3658 Set the input subtitles character encoding.
yading@10 3659
yading@10 3660 =back
yading@10 3661
yading@10 3662
yading@10 3663
yading@10 3664
yading@10 3665 =head1 DECODERS
yading@10 3666
yading@10 3667
yading@10 3668 Decoders are configured elements in FFmpeg which allow the decoding of
yading@10 3669 multimedia streams.
yading@10 3670
yading@10 3671 When you configure your FFmpeg build, all the supported native decoders
yading@10 3672 are enabled by default. Decoders requiring an external library must be enabled
yading@10 3673 manually via the corresponding C<--enable-lib> option. You can list all
yading@10 3674 available decoders using the configure option C<--list-decoders>.
yading@10 3675
yading@10 3676 You can disable all the decoders with the configure option
yading@10 3677 C<--disable-decoders> and selectively enable / disable single decoders
yading@10 3678 with the options C<--enable-decoder=I<DECODER>> /
yading@10 3679 C<--disable-decoder=I<DECODER>>.
yading@10 3680
yading@10 3681 The option C<-codecs> of the ff* tools will display the list of
yading@10 3682 enabled decoders.
yading@10 3683
yading@10 3684
yading@10 3685
yading@10 3686 =head1 VIDEO DECODERS
yading@10 3687
yading@10 3688
yading@10 3689 A description of some of the currently available video decoders
yading@10 3690 follows.
yading@10 3691
yading@10 3692
yading@10 3693 =head2 rawvideo
yading@10 3694
yading@10 3695
yading@10 3696 Raw video decoder.
yading@10 3697
yading@10 3698 This decoder decodes rawvideo streams.
yading@10 3699
yading@10 3700
yading@10 3701 =head3 Options
yading@10 3702
yading@10 3703
yading@10 3704
yading@10 3705 =over 4
yading@10 3706
yading@10 3707
yading@10 3708 =item B<top> I<top_field_first>
yading@10 3709
yading@10 3710 Specify the assumed field type of the input video.
yading@10 3711
yading@10 3712 =over 4
yading@10 3713
yading@10 3714
yading@10 3715 =item B<-1>
yading@10 3716
yading@10 3717 the video is assumed to be progressive (default)
yading@10 3718
yading@10 3719 =item B<0>
yading@10 3720
yading@10 3721 bottom-field-first is assumed
yading@10 3722
yading@10 3723 =item B<1>
yading@10 3724
yading@10 3725 top-field-first is assumed
yading@10 3726
yading@10 3727 =back
yading@10 3728
yading@10 3729
yading@10 3730
yading@10 3731 =back
yading@10 3732
yading@10 3733
yading@10 3734
yading@10 3735
yading@10 3736 =head1 AUDIO DECODERS
yading@10 3737
yading@10 3738
yading@10 3739
yading@10 3740 =head2 ffwavesynth
yading@10 3741
yading@10 3742
yading@10 3743 Internal wave synthetizer.
yading@10 3744
yading@10 3745 This decoder generates wave patterns according to predefined sequences. Its
yading@10 3746 use is purely internal and the format of the data it accepts is not publicly
yading@10 3747 documented.
yading@10 3748
yading@10 3749
yading@10 3750
yading@10 3751 =head1 SUBTITLES DECODERS
yading@10 3752
yading@10 3753
yading@10 3754
yading@10 3755 =head2 dvdsub
yading@10 3756
yading@10 3757
yading@10 3758 This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
yading@10 3759 also be found in VobSub file pairs and in some Matroska files.
yading@10 3760
yading@10 3761
yading@10 3762 =head3 Options
yading@10 3763
yading@10 3764
yading@10 3765
yading@10 3766 =over 4
yading@10 3767
yading@10 3768
yading@10 3769 =item B<palette>
yading@10 3770
yading@10 3771 Specify the global palette used by the bitmaps. When stored in VobSub, the
yading@10 3772 palette is normally specified in the index file; in Matroska, the palette is
yading@10 3773 stored in the codec extra-data in the same format as in VobSub. In DVDs, the
yading@10 3774 palette is stored in the IFO file, and therefore not available when reading
yading@10 3775 from dumped VOB files.
yading@10 3776
yading@10 3777 The format for this option is a string containing 16 24-bits hexadecimal
yading@10 3778 numbers (without 0x prefix) separated by comas, for example C<0d00ee,
yading@10 3779 ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
yading@10 3780 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b>.
yading@10 3781
yading@10 3782 =back
yading@10 3783
yading@10 3784
yading@10 3785
yading@10 3786 =head1 ENCODERS
yading@10 3787
yading@10 3788
yading@10 3789 Encoders are configured elements in FFmpeg which allow the encoding of
yading@10 3790 multimedia streams.
yading@10 3791
yading@10 3792 When you configure your FFmpeg build, all the supported native encoders
yading@10 3793 are enabled by default. Encoders requiring an external library must be enabled
yading@10 3794 manually via the corresponding C<--enable-lib> option. You can list all
yading@10 3795 available encoders using the configure option C<--list-encoders>.
yading@10 3796
yading@10 3797 You can disable all the encoders with the configure option
yading@10 3798 C<--disable-encoders> and selectively enable / disable single encoders
yading@10 3799 with the options C<--enable-encoder=I<ENCODER>> /
yading@10 3800 C<--disable-encoder=I<ENCODER>>.
yading@10 3801
yading@10 3802 The option C<-codecs> of the ff* tools will display the list of
yading@10 3803 enabled encoders.
yading@10 3804
yading@10 3805
yading@10 3806
yading@10 3807 =head1 AUDIO ENCODERS
yading@10 3808
yading@10 3809
yading@10 3810 A description of some of the currently available audio encoders
yading@10 3811 follows.
yading@10 3812
yading@10 3813
yading@10 3814 =head2 ac3 and ac3_fixed
yading@10 3815
yading@10 3816
yading@10 3817 AC-3 audio encoders.
yading@10 3818
yading@10 3819 These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
yading@10 3820 the undocumented RealAudio 3 (a.k.a. dnet).
yading@10 3821
yading@10 3822 The I<ac3> encoder uses floating-point math, while the I<ac3_fixed>
yading@10 3823 encoder only uses fixed-point integer math. This does not mean that one is
yading@10 3824 always faster, just that one or the other may be better suited to a
yading@10 3825 particular system. The floating-point encoder will generally produce better
yading@10 3826 quality audio for a given bitrate. The I<ac3_fixed> encoder is not the
yading@10 3827 default codec for any of the output formats, so it must be specified explicitly
yading@10 3828 using the option C<-acodec ac3_fixed> in order to use it.
yading@10 3829
yading@10 3830
yading@10 3831 =head3 AC-3 Metadata
yading@10 3832
yading@10 3833
yading@10 3834 The AC-3 metadata options are used to set parameters that describe the audio,
yading@10 3835 but in most cases do not affect the audio encoding itself. Some of the options
yading@10 3836 do directly affect or influence the decoding and playback of the resulting
yading@10 3837 bitstream, while others are just for informational purposes. A few of the
yading@10 3838 options will add bits to the output stream that could otherwise be used for
yading@10 3839 audio data, and will thus affect the quality of the output. Those will be
yading@10 3840 indicated accordingly with a note in the option list below.
yading@10 3841
yading@10 3842 These parameters are described in detail in several publicly-available
yading@10 3843 documents.
yading@10 3844
yading@10 3845 =over 4
yading@10 3846
yading@10 3847
yading@10 3848 =item *<E<lt>B<http://www.atsc.org/cms/standards/a_52-2010.pdf>E<gt>>
yading@10 3849
yading@10 3850
yading@10 3851 =item *<E<lt>B<http://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf>E<gt>>
yading@10 3852
yading@10 3853
yading@10 3854 =item *<E<lt>B<http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf>E<gt>>
yading@10 3855
yading@10 3856
yading@10 3857 =item *<E<lt>B<http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf>E<gt>>
yading@10 3858
yading@10 3859
yading@10 3860 =back
yading@10 3861
yading@10 3862
yading@10 3863
yading@10 3864 =head4 Metadata Control Options
yading@10 3865
yading@10 3866
yading@10 3867
yading@10 3868 =over 4
yading@10 3869
yading@10 3870
yading@10 3871
yading@10 3872 =item B<-per_frame_metadata> I<boolean>
yading@10 3873
yading@10 3874 Allow Per-Frame Metadata. Specifies if the encoder should check for changing
yading@10 3875 metadata for each frame.
yading@10 3876
yading@10 3877 =over 4
yading@10 3878
yading@10 3879
yading@10 3880 =item B<0>
yading@10 3881
yading@10 3882 The metadata values set at initialization will be used for every frame in the
yading@10 3883 stream. (default)
yading@10 3884
yading@10 3885 =item B<1>
yading@10 3886
yading@10 3887 Metadata values can be changed before encoding each frame.
yading@10 3888
yading@10 3889 =back
yading@10 3890
yading@10 3891
yading@10 3892
yading@10 3893 =back
yading@10 3894
yading@10 3895
yading@10 3896
yading@10 3897 =head4 Downmix Levels
yading@10 3898
yading@10 3899
yading@10 3900
yading@10 3901 =over 4
yading@10 3902
yading@10 3903
yading@10 3904
yading@10 3905 =item B<-center_mixlev> I<level>
yading@10 3906
yading@10 3907 Center Mix Level. The amount of gain the decoder should apply to the center
yading@10 3908 channel when downmixing to stereo. This field will only be written to the
yading@10 3909 bitstream if a center channel is present. The value is specified as a scale
yading@10 3910 factor. There are 3 valid values:
yading@10 3911
yading@10 3912 =over 4
yading@10 3913
yading@10 3914
yading@10 3915 =item B<0.707>
yading@10 3916
yading@10 3917 Apply -3dB gain
yading@10 3918
yading@10 3919 =item B<0.595>
yading@10 3920
yading@10 3921 Apply -4.5dB gain (default)
yading@10 3922
yading@10 3923 =item B<0.500>
yading@10 3924
yading@10 3925 Apply -6dB gain
yading@10 3926
yading@10 3927 =back
yading@10 3928
yading@10 3929
yading@10 3930
yading@10 3931 =item B<-surround_mixlev> I<level>
yading@10 3932
yading@10 3933 Surround Mix Level. The amount of gain the decoder should apply to the surround
yading@10 3934 channel(s) when downmixing to stereo. This field will only be written to the
yading@10 3935 bitstream if one or more surround channels are present. The value is specified
yading@10 3936 as a scale factor. There are 3 valid values:
yading@10 3937
yading@10 3938 =over 4
yading@10 3939
yading@10 3940
yading@10 3941 =item B<0.707>
yading@10 3942
yading@10 3943 Apply -3dB gain
yading@10 3944
yading@10 3945 =item B<0.500>
yading@10 3946
yading@10 3947 Apply -6dB gain (default)
yading@10 3948
yading@10 3949 =item B<0.000>
yading@10 3950
yading@10 3951 Silence Surround Channel(s)
yading@10 3952
yading@10 3953 =back
yading@10 3954
yading@10 3955
yading@10 3956
yading@10 3957 =back
yading@10 3958
yading@10 3959
yading@10 3960
yading@10 3961 =head4 Audio Production Information
yading@10 3962
yading@10 3963 Audio Production Information is optional information describing the mixing
yading@10 3964 environment. Either none or both of the fields are written to the bitstream.
yading@10 3965
yading@10 3966
yading@10 3967 =over 4
yading@10 3968
yading@10 3969
yading@10 3970
yading@10 3971 =item B<-mixing_level> I<number>
yading@10 3972
yading@10 3973 Mixing Level. Specifies peak sound pressure level (SPL) in the production
yading@10 3974 environment when the mix was mastered. Valid values are 80 to 111, or -1 for
yading@10 3975 unknown or not indicated. The default value is -1, but that value cannot be
yading@10 3976 used if the Audio Production Information is written to the bitstream. Therefore,
yading@10 3977 if the C<room_type> option is not the default value, the C<mixing_level>
yading@10 3978 option must not be -1.
yading@10 3979
yading@10 3980
yading@10 3981 =item B<-room_type> I<type>
yading@10 3982
yading@10 3983 Room Type. Describes the equalization used during the final mixing session at
yading@10 3984 the studio or on the dubbing stage. A large room is a dubbing stage with the
yading@10 3985 industry standard X-curve equalization; a small room has flat equalization.
yading@10 3986 This field will not be written to the bitstream if both the C<mixing_level>
yading@10 3987 option and the C<room_type> option have the default values.
yading@10 3988
yading@10 3989 =over 4
yading@10 3990
yading@10 3991
yading@10 3992 =item B<0>
yading@10 3993
yading@10 3994
yading@10 3995 =item B<notindicated>
yading@10 3996
yading@10 3997 Not Indicated (default)
yading@10 3998
yading@10 3999 =item B<1>
yading@10 4000
yading@10 4001
yading@10 4002 =item B<large>
yading@10 4003
yading@10 4004 Large Room
yading@10 4005
yading@10 4006 =item B<2>
yading@10 4007
yading@10 4008
yading@10 4009 =item B<small>
yading@10 4010
yading@10 4011 Small Room
yading@10 4012
yading@10 4013 =back
yading@10 4014
yading@10 4015
yading@10 4016
yading@10 4017 =back
yading@10 4018
yading@10 4019
yading@10 4020
yading@10 4021 =head4 Other Metadata Options
yading@10 4022
yading@10 4023
yading@10 4024
yading@10 4025 =over 4
yading@10 4026
yading@10 4027
yading@10 4028
yading@10 4029 =item B<-copyright> I<boolean>
yading@10 4030
yading@10 4031 Copyright Indicator. Specifies whether a copyright exists for this audio.
yading@10 4032
yading@10 4033 =over 4
yading@10 4034
yading@10 4035
yading@10 4036 =item B<0>
yading@10 4037
yading@10 4038
yading@10 4039 =item B<off>
yading@10 4040
yading@10 4041 No Copyright Exists (default)
yading@10 4042
yading@10 4043 =item B<1>
yading@10 4044
yading@10 4045
yading@10 4046 =item B<on>
yading@10 4047
yading@10 4048 Copyright Exists
yading@10 4049
yading@10 4050 =back
yading@10 4051
yading@10 4052
yading@10 4053
yading@10 4054 =item B<-dialnorm> I<value>
yading@10 4055
yading@10 4056 Dialogue Normalization. Indicates how far the average dialogue level of the
yading@10 4057 program is below digital 100% full scale (0 dBFS). This parameter determines a
yading@10 4058 level shift during audio reproduction that sets the average volume of the
yading@10 4059 dialogue to a preset level. The goal is to match volume level between program
yading@10 4060 sources. A value of -31dB will result in no volume level change, relative to
yading@10 4061 the source volume, during audio reproduction. Valid values are whole numbers in
yading@10 4062 the range -31 to -1, with -31 being the default.
yading@10 4063
yading@10 4064
yading@10 4065 =item B<-dsur_mode> I<mode>
yading@10 4066
yading@10 4067 Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
yading@10 4068 (Pro Logic). This field will only be written to the bitstream if the audio
yading@10 4069 stream is stereo. Using this option does B<NOT> mean the encoder will actually
yading@10 4070 apply Dolby Surround processing.
yading@10 4071
yading@10 4072 =over 4
yading@10 4073
yading@10 4074
yading@10 4075 =item B<0>
yading@10 4076
yading@10 4077
yading@10 4078 =item B<notindicated>
yading@10 4079
yading@10 4080 Not Indicated (default)
yading@10 4081
yading@10 4082 =item B<1>
yading@10 4083
yading@10 4084
yading@10 4085 =item B<off>
yading@10 4086
yading@10 4087 Not Dolby Surround Encoded
yading@10 4088
yading@10 4089 =item B<2>
yading@10 4090
yading@10 4091
yading@10 4092 =item B<on>
yading@10 4093
yading@10 4094 Dolby Surround Encoded
yading@10 4095
yading@10 4096 =back
yading@10 4097
yading@10 4098
yading@10 4099
yading@10 4100 =item B<-original> I<boolean>
yading@10 4101
yading@10 4102 Original Bit Stream Indicator. Specifies whether this audio is from the
yading@10 4103 original source and not a copy.
yading@10 4104
yading@10 4105 =over 4
yading@10 4106
yading@10 4107
yading@10 4108 =item B<0>
yading@10 4109
yading@10 4110
yading@10 4111 =item B<off>
yading@10 4112
yading@10 4113 Not Original Source
yading@10 4114
yading@10 4115 =item B<1>
yading@10 4116
yading@10 4117
yading@10 4118 =item B<on>
yading@10 4119
yading@10 4120 Original Source (default)
yading@10 4121
yading@10 4122 =back
yading@10 4123
yading@10 4124
yading@10 4125
yading@10 4126 =back
yading@10 4127
yading@10 4128
yading@10 4129
yading@10 4130 =head3 Extended Bitstream Information
yading@10 4131
yading@10 4132 The extended bitstream options are part of the Alternate Bit Stream Syntax as
yading@10 4133 specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
yading@10 4134 If any one parameter in a group is specified, all values in that group will be
yading@10 4135 written to the bitstream. Default values are used for those that are written
yading@10 4136 but have not been specified. If the mixing levels are written, the decoder
yading@10 4137 will use these values instead of the ones specified in the C<center_mixlev>
yading@10 4138 and C<surround_mixlev> options if it supports the Alternate Bit Stream
yading@10 4139 Syntax.
yading@10 4140
yading@10 4141
yading@10 4142 =head4 Extended Bitstream Information - Part 1
yading@10 4143
yading@10 4144
yading@10 4145
yading@10 4146 =over 4
yading@10 4147
yading@10 4148
yading@10 4149
yading@10 4150 =item B<-dmix_mode> I<mode>
yading@10 4151
yading@10 4152 Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
yading@10 4153 (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
yading@10 4154
yading@10 4155 =over 4
yading@10 4156
yading@10 4157
yading@10 4158 =item B<0>
yading@10 4159
yading@10 4160
yading@10 4161 =item B<notindicated>
yading@10 4162
yading@10 4163 Not Indicated (default)
yading@10 4164
yading@10 4165 =item B<1>
yading@10 4166
yading@10 4167
yading@10 4168 =item B<ltrt>
yading@10 4169
yading@10 4170 Lt/Rt Downmix Preferred
yading@10 4171
yading@10 4172 =item B<2>
yading@10 4173
yading@10 4174
yading@10 4175 =item B<loro>
yading@10 4176
yading@10 4177 Lo/Ro Downmix Preferred
yading@10 4178
yading@10 4179 =back
yading@10 4180
yading@10 4181
yading@10 4182
yading@10 4183 =item B<-ltrt_cmixlev> I<level>
yading@10 4184
yading@10 4185 Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
yading@10 4186 center channel when downmixing to stereo in Lt/Rt mode.
yading@10 4187
yading@10 4188 =over 4
yading@10 4189
yading@10 4190
yading@10 4191 =item B<1.414>
yading@10 4192
yading@10 4193 Apply +3dB gain
yading@10 4194
yading@10 4195 =item B<1.189>
yading@10 4196
yading@10 4197 Apply +1.5dB gain
yading@10 4198
yading@10 4199 =item B<1.000>
yading@10 4200
yading@10 4201 Apply 0dB gain
yading@10 4202
yading@10 4203 =item B<0.841>
yading@10 4204
yading@10 4205 Apply -1.5dB gain
yading@10 4206
yading@10 4207 =item B<0.707>
yading@10 4208
yading@10 4209 Apply -3.0dB gain
yading@10 4210
yading@10 4211 =item B<0.595>
yading@10 4212
yading@10 4213 Apply -4.5dB gain (default)
yading@10 4214
yading@10 4215 =item B<0.500>
yading@10 4216
yading@10 4217 Apply -6.0dB gain
yading@10 4218
yading@10 4219 =item B<0.000>
yading@10 4220
yading@10 4221 Silence Center Channel
yading@10 4222
yading@10 4223 =back
yading@10 4224
yading@10 4225
yading@10 4226
yading@10 4227 =item B<-ltrt_surmixlev> I<level>
yading@10 4228
yading@10 4229 Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
yading@10 4230 surround channel(s) when downmixing to stereo in Lt/Rt mode.
yading@10 4231
yading@10 4232 =over 4
yading@10 4233
yading@10 4234
yading@10 4235 =item B<0.841>
yading@10 4236
yading@10 4237 Apply -1.5dB gain
yading@10 4238
yading@10 4239 =item B<0.707>
yading@10 4240
yading@10 4241 Apply -3.0dB gain
yading@10 4242
yading@10 4243 =item B<0.595>
yading@10 4244
yading@10 4245 Apply -4.5dB gain
yading@10 4246
yading@10 4247 =item B<0.500>
yading@10 4248
yading@10 4249 Apply -6.0dB gain (default)
yading@10 4250
yading@10 4251 =item B<0.000>
yading@10 4252
yading@10 4253 Silence Surround Channel(s)
yading@10 4254
yading@10 4255 =back
yading@10 4256
yading@10 4257
yading@10 4258
yading@10 4259 =item B<-loro_cmixlev> I<level>
yading@10 4260
yading@10 4261 Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
yading@10 4262 center channel when downmixing to stereo in Lo/Ro mode.
yading@10 4263
yading@10 4264 =over 4
yading@10 4265
yading@10 4266
yading@10 4267 =item B<1.414>
yading@10 4268
yading@10 4269 Apply +3dB gain
yading@10 4270
yading@10 4271 =item B<1.189>
yading@10 4272
yading@10 4273 Apply +1.5dB gain
yading@10 4274
yading@10 4275 =item B<1.000>
yading@10 4276
yading@10 4277 Apply 0dB gain
yading@10 4278
yading@10 4279 =item B<0.841>
yading@10 4280
yading@10 4281 Apply -1.5dB gain
yading@10 4282
yading@10 4283 =item B<0.707>
yading@10 4284
yading@10 4285 Apply -3.0dB gain
yading@10 4286
yading@10 4287 =item B<0.595>
yading@10 4288
yading@10 4289 Apply -4.5dB gain (default)
yading@10 4290
yading@10 4291 =item B<0.500>
yading@10 4292
yading@10 4293 Apply -6.0dB gain
yading@10 4294
yading@10 4295 =item B<0.000>
yading@10 4296
yading@10 4297 Silence Center Channel
yading@10 4298
yading@10 4299 =back
yading@10 4300
yading@10 4301
yading@10 4302
yading@10 4303 =item B<-loro_surmixlev> I<level>
yading@10 4304
yading@10 4305 Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
yading@10 4306 surround channel(s) when downmixing to stereo in Lo/Ro mode.
yading@10 4307
yading@10 4308 =over 4
yading@10 4309
yading@10 4310
yading@10 4311 =item B<0.841>
yading@10 4312
yading@10 4313 Apply -1.5dB gain
yading@10 4314
yading@10 4315 =item B<0.707>
yading@10 4316
yading@10 4317 Apply -3.0dB gain
yading@10 4318
yading@10 4319 =item B<0.595>
yading@10 4320
yading@10 4321 Apply -4.5dB gain
yading@10 4322
yading@10 4323 =item B<0.500>
yading@10 4324
yading@10 4325 Apply -6.0dB gain (default)
yading@10 4326
yading@10 4327 =item B<0.000>
yading@10 4328
yading@10 4329 Silence Surround Channel(s)
yading@10 4330
yading@10 4331 =back
yading@10 4332
yading@10 4333
yading@10 4334
yading@10 4335 =back
yading@10 4336
yading@10 4337
yading@10 4338
yading@10 4339 =head4 Extended Bitstream Information - Part 2
yading@10 4340
yading@10 4341
yading@10 4342
yading@10 4343 =over 4
yading@10 4344
yading@10 4345
yading@10 4346
yading@10 4347 =item B<-dsurex_mode> I<mode>
yading@10 4348
yading@10 4349 Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
yading@10 4350 (7.1 matrixed to 5.1). Using this option does B<NOT> mean the encoder will actually
yading@10 4351 apply Dolby Surround EX processing.
yading@10 4352
yading@10 4353 =over 4
yading@10 4354
yading@10 4355
yading@10 4356 =item B<0>
yading@10 4357
yading@10 4358
yading@10 4359 =item B<notindicated>
yading@10 4360
yading@10 4361 Not Indicated (default)
yading@10 4362
yading@10 4363 =item B<1>
yading@10 4364
yading@10 4365
yading@10 4366 =item B<on>
yading@10 4367
yading@10 4368 Dolby Surround EX Off
yading@10 4369
yading@10 4370 =item B<2>
yading@10 4371
yading@10 4372
yading@10 4373 =item B<off>
yading@10 4374
yading@10 4375 Dolby Surround EX On
yading@10 4376
yading@10 4377 =back
yading@10 4378
yading@10 4379
yading@10 4380
yading@10 4381 =item B<-dheadphone_mode> I<mode>
yading@10 4382
yading@10 4383 Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
yading@10 4384 encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
yading@10 4385 option does B<NOT> mean the encoder will actually apply Dolby Headphone
yading@10 4386 processing.
yading@10 4387
yading@10 4388 =over 4
yading@10 4389
yading@10 4390
yading@10 4391 =item B<0>
yading@10 4392
yading@10 4393
yading@10 4394 =item B<notindicated>
yading@10 4395
yading@10 4396 Not Indicated (default)
yading@10 4397
yading@10 4398 =item B<1>
yading@10 4399
yading@10 4400
yading@10 4401 =item B<on>
yading@10 4402
yading@10 4403 Dolby Headphone Off
yading@10 4404
yading@10 4405 =item B<2>
yading@10 4406
yading@10 4407
yading@10 4408 =item B<off>
yading@10 4409
yading@10 4410 Dolby Headphone On
yading@10 4411
yading@10 4412 =back
yading@10 4413
yading@10 4414
yading@10 4415
yading@10 4416 =item B<-ad_conv_type> I<type>
yading@10 4417
yading@10 4418 A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
yading@10 4419 conversion.
yading@10 4420
yading@10 4421 =over 4
yading@10 4422
yading@10 4423
yading@10 4424 =item B<0>
yading@10 4425
yading@10 4426
yading@10 4427 =item B<standard>
yading@10 4428
yading@10 4429 Standard A/D Converter (default)
yading@10 4430
yading@10 4431 =item B<1>
yading@10 4432
yading@10 4433
yading@10 4434 =item B<hdcd>
yading@10 4435
yading@10 4436 HDCD A/D Converter
yading@10 4437
yading@10 4438 =back
yading@10 4439
yading@10 4440
yading@10 4441
yading@10 4442 =back
yading@10 4443
yading@10 4444
yading@10 4445
yading@10 4446 =head3 Other AC-3 Encoding Options
yading@10 4447
yading@10 4448
yading@10 4449
yading@10 4450 =over 4
yading@10 4451
yading@10 4452
yading@10 4453
yading@10 4454 =item B<-stereo_rematrixing> I<boolean>
yading@10 4455
yading@10 4456 Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
yading@10 4457 is an optional AC-3 feature that increases quality by selectively encoding
yading@10 4458 the left/right channels as mid/side. This option is enabled by default, and it
yading@10 4459 is highly recommended that it be left as enabled except for testing purposes.
yading@10 4460
yading@10 4461
yading@10 4462 =back
yading@10 4463
yading@10 4464
yading@10 4465
yading@10 4466 =head3 Floating-Point-Only AC-3 Encoding Options
yading@10 4467
yading@10 4468
yading@10 4469 These options are only valid for the floating-point encoder and do not exist
yading@10 4470 for the fixed-point encoder due to the corresponding features not being
yading@10 4471 implemented in fixed-point.
yading@10 4472
yading@10 4473
yading@10 4474 =over 4
yading@10 4475
yading@10 4476
yading@10 4477
yading@10 4478 =item B<-channel_coupling> I<boolean>
yading@10 4479
yading@10 4480 Enables/Disables use of channel coupling, which is an optional AC-3 feature
yading@10 4481 that increases quality by combining high frequency information from multiple
yading@10 4482 channels into a single channel. The per-channel high frequency information is
yading@10 4483 sent with less accuracy in both the frequency and time domains. This allows
yading@10 4484 more bits to be used for lower frequencies while preserving enough information
yading@10 4485 to reconstruct the high frequencies. This option is enabled by default for the
yading@10 4486 floating-point encoder and should generally be left as enabled except for
yading@10 4487 testing purposes or to increase encoding speed.
yading@10 4488
yading@10 4489 =over 4
yading@10 4490
yading@10 4491
yading@10 4492 =item B<-1>
yading@10 4493
yading@10 4494
yading@10 4495 =item B<auto>
yading@10 4496
yading@10 4497 Selected by Encoder (default)
yading@10 4498
yading@10 4499 =item B<0>
yading@10 4500
yading@10 4501
yading@10 4502 =item B<off>
yading@10 4503
yading@10 4504 Disable Channel Coupling
yading@10 4505
yading@10 4506 =item B<1>
yading@10 4507
yading@10 4508
yading@10 4509 =item B<on>
yading@10 4510
yading@10 4511 Enable Channel Coupling
yading@10 4512
yading@10 4513 =back
yading@10 4514
yading@10 4515
yading@10 4516
yading@10 4517 =item B<-cpl_start_band> I<number>
yading@10 4518
yading@10 4519 Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
yading@10 4520 value higher than the bandwidth is used, it will be reduced to 1 less than the
yading@10 4521 coupling end band. If I<auto> is used, the start band will be determined by
yading@10 4522 the encoder based on the bit rate, sample rate, and channel layout. This option
yading@10 4523 has no effect if channel coupling is disabled.
yading@10 4524
yading@10 4525 =over 4
yading@10 4526
yading@10 4527
yading@10 4528 =item B<-1>
yading@10 4529
yading@10 4530
yading@10 4531 =item B<auto>
yading@10 4532
yading@10 4533 Selected by Encoder (default)
yading@10 4534
yading@10 4535 =back
yading@10 4536
yading@10 4537
yading@10 4538
yading@10 4539 =back
yading@10 4540
yading@10 4541
yading@10 4542
yading@10 4543
yading@10 4544 =head1 VIDEO ENCODERS
yading@10 4545
yading@10 4546
yading@10 4547 A description of some of the currently available video encoders
yading@10 4548 follows.
yading@10 4549
yading@10 4550
yading@10 4551 =head2 libtheora
yading@10 4552
yading@10 4553
yading@10 4554 Theora format supported through libtheora.
yading@10 4555
yading@10 4556 Requires the presence of the libtheora headers and library during
yading@10 4557 configuration. You need to explicitly configure the build with
yading@10 4558 C<--enable-libtheora>.
yading@10 4559
yading@10 4560
yading@10 4561 =head3 Options
yading@10 4562
yading@10 4563
yading@10 4564 The following global options are mapped to internal libtheora options
yading@10 4565 which affect the quality and the bitrate of the encoded stream.
yading@10 4566
yading@10 4567
yading@10 4568 =over 4
yading@10 4569
yading@10 4570
yading@10 4571 =item B<b>
yading@10 4572
yading@10 4573 Set the video bitrate, only works if the C<qscale> flag in
yading@10 4574 B<flags> is not enabled.
yading@10 4575
yading@10 4576
yading@10 4577 =item B<flags>
yading@10 4578
yading@10 4579 Used to enable constant quality mode encoding through the
yading@10 4580 B<qscale> flag, and to enable the C<pass1> and C<pass2>
yading@10 4581 modes.
yading@10 4582
yading@10 4583
yading@10 4584 =item B<g>
yading@10 4585
yading@10 4586 Set the GOP size.
yading@10 4587
yading@10 4588
yading@10 4589 =item B<global_quality>
yading@10 4590
yading@10 4591 Set the global quality in lambda units, only works if the
yading@10 4592 C<qscale> flag in B<flags> is enabled. The value is clipped
yading@10 4593 in the [0 - 10*C<FF_QP2LAMBDA>] range, and then multiplied for 6.3
yading@10 4594 to get a value in the native libtheora range [0-63]. A higher value
yading@10 4595 corresponds to a higher quality.
yading@10 4596
yading@10 4597 For example, to set maximum constant quality encoding with
yading@10 4598 B<ffmpeg>:
yading@10 4599
yading@10 4600 ffmpeg -i INPUT -flags:v qscale -global_quality:v "10*QP2LAMBDA" -codec:v libtheora OUTPUT.ogg
yading@10 4601
yading@10 4602
yading@10 4603 =back
yading@10 4604
yading@10 4605
yading@10 4606
yading@10 4607 =head2 libvpx
yading@10 4608
yading@10 4609
yading@10 4610 VP8 format supported through libvpx.
yading@10 4611
yading@10 4612 Requires the presence of the libvpx headers and library during configuration.
yading@10 4613 You need to explicitly configure the build with C<--enable-libvpx>.
yading@10 4614
yading@10 4615
yading@10 4616 =head3 Options
yading@10 4617
yading@10 4618
yading@10 4619 Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
yading@10 4620
yading@10 4621
yading@10 4622 =over 4
yading@10 4623
yading@10 4624
yading@10 4625
yading@10 4626 =item B<threads>
yading@10 4627
yading@10 4628 g_threads
yading@10 4629
yading@10 4630
yading@10 4631 =item B<profile>
yading@10 4632
yading@10 4633 g_profile
yading@10 4634
yading@10 4635
yading@10 4636 =item B<vb>
yading@10 4637
yading@10 4638 rc_target_bitrate
yading@10 4639
yading@10 4640
yading@10 4641 =item B<g>
yading@10 4642
yading@10 4643 kf_max_dist
yading@10 4644
yading@10 4645
yading@10 4646 =item B<keyint_min>
yading@10 4647
yading@10 4648 kf_min_dist
yading@10 4649
yading@10 4650
yading@10 4651 =item B<qmin>
yading@10 4652
yading@10 4653 rc_min_quantizer
yading@10 4654
yading@10 4655
yading@10 4656 =item B<qmax>
yading@10 4657
yading@10 4658 rc_max_quantizer
yading@10 4659
yading@10 4660
yading@10 4661 =item B<bufsize, vb>
yading@10 4662
yading@10 4663 rc_buf_sz
yading@10 4664 C<(bufsize * 1000 / vb)>
yading@10 4665
yading@10 4666 rc_buf_optimal_sz
yading@10 4667 C<(bufsize * 1000 / vb * 5 / 6)>
yading@10 4668
yading@10 4669
yading@10 4670 =item B<rc_init_occupancy, vb>
yading@10 4671
yading@10 4672 rc_buf_initial_sz
yading@10 4673 C<(rc_init_occupancy * 1000 / vb)>
yading@10 4674
yading@10 4675
yading@10 4676 =item B<rc_buffer_aggressivity>
yading@10 4677
yading@10 4678 rc_undershoot_pct
yading@10 4679
yading@10 4680
yading@10 4681 =item B<skip_threshold>
yading@10 4682
yading@10 4683 rc_dropframe_thresh
yading@10 4684
yading@10 4685
yading@10 4686 =item B<qcomp>
yading@10 4687
yading@10 4688 rc_2pass_vbr_bias_pct
yading@10 4689
yading@10 4690
yading@10 4691 =item B<maxrate, vb>
yading@10 4692
yading@10 4693 rc_2pass_vbr_maxsection_pct
yading@10 4694 C<(maxrate * 100 / vb)>
yading@10 4695
yading@10 4696
yading@10 4697 =item B<minrate, vb>
yading@10 4698
yading@10 4699 rc_2pass_vbr_minsection_pct
yading@10 4700 C<(minrate * 100 / vb)>
yading@10 4701
yading@10 4702
yading@10 4703 =item B<minrate, maxrate, vb>
yading@10 4704
yading@10 4705 C<VPX_CBR>
yading@10 4706 C<(minrate == maxrate == vb)>
yading@10 4707
yading@10 4708
yading@10 4709 =item B<crf>
yading@10 4710
yading@10 4711 C<VPX_CQ>, C<VP8E_SET_CQ_LEVEL>
yading@10 4712
yading@10 4713
yading@10 4714 =item B<quality>
yading@10 4715
yading@10 4716
yading@10 4717 =over 4
yading@10 4718
yading@10 4719
yading@10 4720 =item I<best>
yading@10 4721
yading@10 4722 C<VPX_DL_BEST_QUALITY>
yading@10 4723
yading@10 4724 =item I<good>
yading@10 4725
yading@10 4726 C<VPX_DL_GOOD_QUALITY>
yading@10 4727
yading@10 4728 =item I<realtime>
yading@10 4729
yading@10 4730 C<VPX_DL_REALTIME>
yading@10 4731
yading@10 4732 =back
yading@10 4733
yading@10 4734
yading@10 4735
yading@10 4736 =item B<speed>
yading@10 4737
yading@10 4738 C<VP8E_SET_CPUUSED>
yading@10 4739
yading@10 4740
yading@10 4741 =item B<nr>
yading@10 4742
yading@10 4743 C<VP8E_SET_NOISE_SENSITIVITY>
yading@10 4744
yading@10 4745
yading@10 4746 =item B<mb_threshold>
yading@10 4747
yading@10 4748 C<VP8E_SET_STATIC_THRESHOLD>
yading@10 4749
yading@10 4750
yading@10 4751 =item B<slices>
yading@10 4752
yading@10 4753 C<VP8E_SET_TOKEN_PARTITIONS>
yading@10 4754
yading@10 4755
yading@10 4756 =item B<max-intra-rate>
yading@10 4757
yading@10 4758 C<VP8E_SET_MAX_INTRA_BITRATE_PCT>
yading@10 4759
yading@10 4760
yading@10 4761 =item B<force_key_frames>
yading@10 4762
yading@10 4763 C<VPX_EFLAG_FORCE_KF>
yading@10 4764
yading@10 4765
yading@10 4766 =item B<Alternate reference frame related>
yading@10 4767
yading@10 4768
yading@10 4769 =over 4
yading@10 4770
yading@10 4771
yading@10 4772 =item B<vp8flags altref>
yading@10 4773
yading@10 4774 C<VP8E_SET_ENABLEAUTOALTREF>
yading@10 4775
yading@10 4776 =item I<arnr_max_frames>
yading@10 4777
yading@10 4778 C<VP8E_SET_ARNR_MAXFRAMES>
yading@10 4779
yading@10 4780 =item I<arnr_type>
yading@10 4781
yading@10 4782 C<VP8E_SET_ARNR_TYPE>
yading@10 4783
yading@10 4784 =item I<arnr_strength>
yading@10 4785
yading@10 4786 C<VP8E_SET_ARNR_STRENGTH>
yading@10 4787
yading@10 4788 =item I<rc_lookahead>
yading@10 4789
yading@10 4790 g_lag_in_frames
yading@10 4791
yading@10 4792 =back
yading@10 4793
yading@10 4794
yading@10 4795
yading@10 4796 =item B<vp8flags error_resilient>
yading@10 4797
yading@10 4798 g_error_resilient
yading@10 4799
yading@10 4800
yading@10 4801 =back
yading@10 4802
yading@10 4803
yading@10 4804 For more information about libvpx see:
yading@10 4805 E<lt>B<http://www.webmproject.org/>E<gt>
yading@10 4806
yading@10 4807
yading@10 4808 =head2 libx264
yading@10 4809
yading@10 4810
yading@10 4811 x264 H.264/MPEG-4 AVC encoder wrapper
yading@10 4812
yading@10 4813 Requires the presence of the libx264 headers and library during
yading@10 4814 configuration. You need to explicitly configure the build with
yading@10 4815 C<--enable-libx264>.
yading@10 4816
yading@10 4817 x264 supports an impressive number of features, including 8x8 and 4x4 adaptive
yading@10 4818 spatial transform, adaptive B-frame placement, CAVLC/CABAC entropy coding,
yading@10 4819 interlacing (MBAFF), lossless mode, psy optimizations for detail retention
yading@10 4820 (adaptive quantization, psy-RD, psy-trellis).
yading@10 4821
yading@10 4822 The FFmpeg wrapper provides a mapping for most of them using global options
yading@10 4823 that match those of the encoders and provides private options for the unique
yading@10 4824 encoder options. Additionally an expert override is provided to directly pass
yading@10 4825 a list of key=value tuples as accepted by x264_param_parse.
yading@10 4826
yading@10 4827
yading@10 4828 =head3 Option Mapping
yading@10 4829
yading@10 4830
yading@10 4831 The following options are supported by the x264 wrapper, the x264-equivalent
yading@10 4832 options follow the FFmpeg ones.
yading@10 4833
yading@10 4834
yading@10 4835 =over 4
yading@10 4836
yading@10 4837
yading@10 4838 =item B<b : bitrate>
yading@10 4839
yading@10 4840 FFmpeg C<b> option is expressed in bits/s, x264 C<bitrate> in kilobits/s.
yading@10 4841
yading@10 4842 =item B<bf : bframes>
yading@10 4843
yading@10 4844 Maximum number of B-frames.
yading@10 4845
yading@10 4846 =item B<g : keyint>
yading@10 4847
yading@10 4848 Maximum GOP size.
yading@10 4849
yading@10 4850 =item B<qmin : qpmin>
yading@10 4851
yading@10 4852
yading@10 4853 =item B<qmax : qpmax>
yading@10 4854
yading@10 4855
yading@10 4856 =item B<qdiff : qpstep>
yading@10 4857
yading@10 4858
yading@10 4859 =item B<qblur : qblur>
yading@10 4860
yading@10 4861
yading@10 4862 =item B<qcomp : qcomp>
yading@10 4863
yading@10 4864
yading@10 4865 =item B<refs : ref>
yading@10 4866
yading@10 4867
yading@10 4868 =item B<sc_threshold : scenecut>
yading@10 4869
yading@10 4870
yading@10 4871 =item B<trellis : trellis>
yading@10 4872
yading@10 4873
yading@10 4874 =item B<nr : nr>
yading@10 4875
yading@10 4876 Noise reduction.
yading@10 4877
yading@10 4878 =item B<me_range : merange>
yading@10 4879
yading@10 4880
yading@10 4881 =item B<me_method : me>
yading@10 4882
yading@10 4883
yading@10 4884 =item B<subq : subme>
yading@10 4885
yading@10 4886
yading@10 4887 =item B<b_strategy : b-adapt>
yading@10 4888
yading@10 4889
yading@10 4890 =item B<keyint_min : keyint-min>
yading@10 4891
yading@10 4892
yading@10 4893 =item B<coder : cabac>
yading@10 4894
yading@10 4895 Set coder to C<ac> to use CABAC.
yading@10 4896
yading@10 4897 =item B<cmp : chroma-me>
yading@10 4898
yading@10 4899 Set to C<chroma> to use chroma motion estimation.
yading@10 4900
yading@10 4901 =item B<threads : threads>
yading@10 4902
yading@10 4903
yading@10 4904 =item B<thread_type : sliced_threads>
yading@10 4905
yading@10 4906 Set to C<slice> to use sliced threading instead of frame threading.
yading@10 4907
yading@10 4908 =item B<flags -cgop : open-gop>
yading@10 4909
yading@10 4910 Set C<-cgop> to use recovery points to close GOPs.
yading@10 4911
yading@10 4912 =item B<rc_init_occupancy : vbv-init>
yading@10 4913
yading@10 4914 Initial buffer occupancy.
yading@10 4915
yading@10 4916 =back
yading@10 4917
yading@10 4918
yading@10 4919
yading@10 4920 =head3 Private Options
yading@10 4921
yading@10 4922
yading@10 4923 =over 4
yading@10 4924
yading@10 4925
yading@10 4926 =item B<-preset> I<string>
yading@10 4927
yading@10 4928 Set the encoding preset (cf. x264 --fullhelp).
yading@10 4929
yading@10 4930 =item B<-tune> I<string>
yading@10 4931
yading@10 4932 Tune the encoding params (cf. x264 --fullhelp).
yading@10 4933
yading@10 4934 =item B<-profile> I<string>
yading@10 4935
yading@10 4936 Set profile restrictions (cf. x264 --fullhelp).
yading@10 4937
yading@10 4938 =item B<-fastfirstpass> I<integer>
yading@10 4939
yading@10 4940 Use fast settings when encoding first pass.
yading@10 4941
yading@10 4942 =item B<-crf> I<float>
yading@10 4943
yading@10 4944 Select the quality for constant quality mode.
yading@10 4945
yading@10 4946 =item B<-crf_max> I<float>
yading@10 4947
yading@10 4948 In CRF mode, prevents VBV from lowering quality beyond this point.
yading@10 4949
yading@10 4950 =item B<-qp> I<integer>
yading@10 4951
yading@10 4952 Constant quantization parameter rate control method.
yading@10 4953
yading@10 4954 =item B<-aq-mode> I<integer>
yading@10 4955
yading@10 4956 AQ method
yading@10 4957
yading@10 4958 Possible values:
yading@10 4959
yading@10 4960 =over 4
yading@10 4961
yading@10 4962
yading@10 4963 =item B<none>
yading@10 4964
yading@10 4965
yading@10 4966
yading@10 4967 =item B<variance>
yading@10 4968
yading@10 4969 Variance AQ (complexity mask).
yading@10 4970
yading@10 4971 =item B<autovariance>
yading@10 4972
yading@10 4973 Auto-variance AQ (experimental).
yading@10 4974
yading@10 4975 =back
yading@10 4976
yading@10 4977
yading@10 4978 =item B<-aq-strength> I<float>
yading@10 4979
yading@10 4980 AQ strength, reduces blocking and blurring in flat and textured areas.
yading@10 4981
yading@10 4982 =item B<-psy> I<integer>
yading@10 4983
yading@10 4984 Use psychovisual optimizations.
yading@10 4985
yading@10 4986 =item B<-psy-rd> I<string>
yading@10 4987
yading@10 4988 Strength of psychovisual optimization, in E<lt>psy-rdE<gt>:E<lt>psy-trellisE<gt> format.
yading@10 4989
yading@10 4990 =item B<-rc-lookahead> I<integer>
yading@10 4991
yading@10 4992 Number of frames to look ahead for frametype and ratecontrol.
yading@10 4993
yading@10 4994 =item B<-weightb> I<integer>
yading@10 4995
yading@10 4996 Weighted prediction for B-frames.
yading@10 4997
yading@10 4998 =item B<-weightp> I<integer>
yading@10 4999
yading@10 5000 Weighted prediction analysis method.
yading@10 5001
yading@10 5002 Possible values:
yading@10 5003
yading@10 5004 =over 4
yading@10 5005
yading@10 5006
yading@10 5007 =item B<none>
yading@10 5008
yading@10 5009
yading@10 5010
yading@10 5011 =item B<simple>
yading@10 5012
yading@10 5013
yading@10 5014
yading@10 5015 =item B<smart>
yading@10 5016
yading@10 5017
yading@10 5018
yading@10 5019 =back
yading@10 5020
yading@10 5021
yading@10 5022 =item B<-ssim> I<integer>
yading@10 5023
yading@10 5024 Calculate and print SSIM stats.
yading@10 5025
yading@10 5026 =item B<-intra-refresh> I<integer>
yading@10 5027
yading@10 5028 Use Periodic Intra Refresh instead of IDR frames.
yading@10 5029
yading@10 5030 =item B<-b-bias> I<integer>
yading@10 5031
yading@10 5032 Influences how often B-frames are used.
yading@10 5033
yading@10 5034 =item B<-b-pyramid> I<integer>
yading@10 5035
yading@10 5036 Keep some B-frames as references.
yading@10 5037
yading@10 5038 Possible values:
yading@10 5039
yading@10 5040 =over 4
yading@10 5041
yading@10 5042
yading@10 5043 =item B<none>
yading@10 5044
yading@10 5045
yading@10 5046
yading@10 5047 =item B<strict>
yading@10 5048
yading@10 5049 Strictly hierarchical pyramid.
yading@10 5050
yading@10 5051 =item B<normal>
yading@10 5052
yading@10 5053 Non-strict (not Blu-ray compatible).
yading@10 5054
yading@10 5055 =back
yading@10 5056
yading@10 5057
yading@10 5058 =item B<-mixed-refs> I<integer>
yading@10 5059
yading@10 5060 One reference per partition, as opposed to one reference per macroblock.
yading@10 5061
yading@10 5062 =item B<-8x8dct> I<integer>
yading@10 5063
yading@10 5064 High profile 8x8 transform.
yading@10 5065
yading@10 5066 =item B<-fast-pskip> I<integer>
yading@10 5067
yading@10 5068
yading@10 5069 =item B<-aud> I<integer>
yading@10 5070
yading@10 5071 Use access unit delimiters.
yading@10 5072
yading@10 5073 =item B<-mbtree> I<integer>
yading@10 5074
yading@10 5075 Use macroblock tree ratecontrol.
yading@10 5076
yading@10 5077 =item B<-deblock> I<string>
yading@10 5078
yading@10 5079 Loop filter parameters, in E<lt>alpha:betaE<gt> form.
yading@10 5080
yading@10 5081 =item B<-cplxblur> I<float>
yading@10 5082
yading@10 5083 Reduce fluctuations in QP (before curve compression).
yading@10 5084
yading@10 5085 =item B<-partitions> I<string>
yading@10 5086
yading@10 5087 A comma-separated list of partitions to consider, possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, all.
yading@10 5088
yading@10 5089 =item B<-direct-pred> I<integer>
yading@10 5090
yading@10 5091 Direct MV prediction mode
yading@10 5092
yading@10 5093 Possible values:
yading@10 5094
yading@10 5095 =over 4
yading@10 5096
yading@10 5097
yading@10 5098 =item B<none>
yading@10 5099
yading@10 5100
yading@10 5101
yading@10 5102 =item B<spatial>
yading@10 5103
yading@10 5104
yading@10 5105
yading@10 5106 =item B<temporal>
yading@10 5107
yading@10 5108
yading@10 5109
yading@10 5110 =item B<auto>
yading@10 5111
yading@10 5112
yading@10 5113
yading@10 5114 =back
yading@10 5115
yading@10 5116
yading@10 5117 =item B<-slice-max-size> I<integer>
yading@10 5118
yading@10 5119 Limit the size of each slice in bytes.
yading@10 5120
yading@10 5121 =item B<-stats> I<string>
yading@10 5122
yading@10 5123 Filename for 2 pass stats.
yading@10 5124
yading@10 5125 =item B<-nal-hrd> I<integer>
yading@10 5126
yading@10 5127 Signal HRD information (requires vbv-bufsize; cbr not allowed in .mp4).
yading@10 5128
yading@10 5129 Possible values:
yading@10 5130
yading@10 5131 =over 4
yading@10 5132
yading@10 5133
yading@10 5134 =item B<none>
yading@10 5135
yading@10 5136
yading@10 5137
yading@10 5138 =item B<vbr>
yading@10 5139
yading@10 5140
yading@10 5141
yading@10 5142 =item B<cbr>
yading@10 5143
yading@10 5144
yading@10 5145
yading@10 5146 =back
yading@10 5147
yading@10 5148
yading@10 5149
yading@10 5150 =item B<x264opts> I<options>
yading@10 5151
yading@10 5152 Allow to set any x264 option, see C<x264 --fullhelp> for a list.
yading@10 5153
yading@10 5154 I<options> is a list of I<key>=I<value> couples separated by
yading@10 5155 ":". In I<filter> and I<psy-rd> options that use ":" as a separator
yading@10 5156 themselves, use "," instead. They accept it as well since long ago but this
yading@10 5157 is kept undocumented for some reason.
yading@10 5158
yading@10 5159 For example to specify libx264 encoding options with B<ffmpeg>:
yading@10 5160
yading@10 5161 ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
yading@10 5162
yading@10 5163
yading@10 5164 For more information about libx264 and the supported options see:
yading@10 5165 E<lt>B<http://www.videolan.org/developers/x264.html>E<gt>
yading@10 5166
yading@10 5167
yading@10 5168 =item B<-x264-params> I<string>
yading@10 5169
yading@10 5170 Override the x264 configuration using a :-separated list of key=value parameters.
yading@10 5171
yading@10 5172 -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 5173
yading@10 5174
yading@10 5175 =back
yading@10 5176
yading@10 5177
yading@10 5178 Encoding avpresets for common usages are provided so they can be used with the
yading@10 5179 general presets system (e.g. passing the C<-pre> option).
yading@10 5180
yading@10 5181
yading@10 5182 =head2 ProRes
yading@10 5183
yading@10 5184
yading@10 5185 Apple ProRes encoder.
yading@10 5186
yading@10 5187 FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
yading@10 5188 The used encoder can be choosen with the C<-vcodec> option.
yading@10 5189
yading@10 5190
yading@10 5191 =head3 Private Options for prores-ks
yading@10 5192
yading@10 5193
yading@10 5194
yading@10 5195 =over 4
yading@10 5196
yading@10 5197
yading@10 5198 =item B<profile> I<integer>
yading@10 5199
yading@10 5200 Select the ProRes profile to encode
yading@10 5201
yading@10 5202 =over 4
yading@10 5203
yading@10 5204
yading@10 5205 =item B<proxy>
yading@10 5206
yading@10 5207
yading@10 5208 =item B<lt>
yading@10 5209
yading@10 5210
yading@10 5211 =item B<standard>
yading@10 5212
yading@10 5213
yading@10 5214 =item B<hq>
yading@10 5215
yading@10 5216
yading@10 5217 =back
yading@10 5218
yading@10 5219
yading@10 5220
yading@10 5221 =item B<quant_mat> I<integer>
yading@10 5222
yading@10 5223 Select quantization matrix.
yading@10 5224
yading@10 5225 =over 4
yading@10 5226
yading@10 5227
yading@10 5228 =item B<auto>
yading@10 5229
yading@10 5230
yading@10 5231 =item B<default>
yading@10 5232
yading@10 5233
yading@10 5234 =item B<proxy>
yading@10 5235
yading@10 5236
yading@10 5237 =item B<lt>
yading@10 5238
yading@10 5239
yading@10 5240 =item B<standard>
yading@10 5241
yading@10 5242
yading@10 5243 =item B<hq>
yading@10 5244
yading@10 5245
yading@10 5246 =back
yading@10 5247
yading@10 5248 If set to I<auto>, the matrix matching the profile will be picked.
yading@10 5249 If not set, the matrix providing the highest quality, I<default>, will be
yading@10 5250 picked.
yading@10 5251
yading@10 5252
yading@10 5253 =item B<bits_per_mb> I<integer>
yading@10 5254
yading@10 5255 How many bits to allot for coding one macroblock. Different profiles use
yading@10 5256 between 200 and 2400 bits per macroblock, the maximum is 8000.
yading@10 5257
yading@10 5258
yading@10 5259 =item B<mbs_per_slice> I<integer>
yading@10 5260
yading@10 5261 Number of macroblocks in each slice (1-8); the default value (8)
yading@10 5262 should be good in almost all situations.
yading@10 5263
yading@10 5264
yading@10 5265 =item B<vendor> I<string>
yading@10 5266
yading@10 5267 Override the 4-byte vendor ID.
yading@10 5268 A custom vendor ID like I<apl0> would claim the stream was produced by
yading@10 5269 the Apple encoder.
yading@10 5270
yading@10 5271
yading@10 5272 =back
yading@10 5273
yading@10 5274
yading@10 5275
yading@10 5276 =head3 Speed considerations
yading@10 5277
yading@10 5278
yading@10 5279 In the default mode of operation the encoder has to honor frame constraints
yading@10 5280 (i.e. not produc frames with size bigger than requested) while still making
yading@10 5281 output picture as good as possible.
yading@10 5282 A frame containing a lot of small details is harder to compress and the encoder
yading@10 5283 would spend more time searching for appropriate quantizers for each slice.
yading@10 5284
yading@10 5285 Setting a higher B<bits_per_mb> limit will improve the speed.
yading@10 5286
yading@10 5287 For the fastest encoding speed set the B<qscale> parameter (4 is the
yading@10 5288 recommended value) and do not set a size constraint.
yading@10 5289
yading@10 5290
yading@10 5291 =head1 BITSTREAM FILTERS
yading@10 5292
yading@10 5293
yading@10 5294 When you configure your FFmpeg build, all the supported bitstream
yading@10 5295 filters are enabled by default. You can list all available ones using
yading@10 5296 the configure option C<--list-bsfs>.
yading@10 5297
yading@10 5298 You can disable all the bitstream filters using the configure option
yading@10 5299 C<--disable-bsfs>, and selectively enable any bitstream filter using
yading@10 5300 the option C<--enable-bsf=BSF>, or you can disable a particular
yading@10 5301 bitstream filter using the option C<--disable-bsf=BSF>.
yading@10 5302
yading@10 5303 The option C<-bsfs> of the ff* tools will display the list of
yading@10 5304 all the supported bitstream filters included in your build.
yading@10 5305
yading@10 5306 Below is a description of the currently available bitstream filters.
yading@10 5307
yading@10 5308
yading@10 5309 =head2 aac_adtstoasc
yading@10 5310
yading@10 5311
yading@10 5312
yading@10 5313 =head2 chomp
yading@10 5314
yading@10 5315
yading@10 5316
yading@10 5317 =head2 dump_extradata
yading@10 5318
yading@10 5319
yading@10 5320
yading@10 5321 =head2 h264_mp4toannexb
yading@10 5322
yading@10 5323
yading@10 5324 Convert an H.264 bitstream from length prefixed mode to start code
yading@10 5325 prefixed mode (as defined in the Annex B of the ITU-T H.264
yading@10 5326 specification).
yading@10 5327
yading@10 5328 This is required by some streaming formats, typically the MPEG-2
yading@10 5329 transport stream format ("mpegts").
yading@10 5330
yading@10 5331 For example to remux an MP4 file containing an H.264 stream to mpegts
yading@10 5332 format with B<ffmpeg>, you can use the command:
yading@10 5333
yading@10 5334
yading@10 5335 ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
yading@10 5336
yading@10 5337
yading@10 5338
yading@10 5339 =head2 imx_dump_header
yading@10 5340
yading@10 5341
yading@10 5342
yading@10 5343 =head2 mjpeg2jpeg
yading@10 5344
yading@10 5345
yading@10 5346 Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
yading@10 5347
yading@10 5348 MJPEG is a video codec wherein each video frame is essentially a
yading@10 5349 JPEG image. The individual frames can be extracted without loss,
yading@10 5350 e.g. by
yading@10 5351
yading@10 5352
yading@10 5353 ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
yading@10 5354
yading@10 5355
yading@10 5356 Unfortunately, these chunks are incomplete JPEG images, because
yading@10 5357 they lack the DHT segment required for decoding. Quoting from
yading@10 5358 E<lt>B<http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml>E<gt>:
yading@10 5359
yading@10 5360 Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
yading@10 5361 commented that "MJPEG, or at least the MJPEG in AVIs having the
yading@10 5362 MJPG fourcc, is restricted JPEG with a fixed -- and *omitted* --
yading@10 5363 Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
yading@10 5364 and it must use basic Huffman encoding, not arithmetic or
yading@10 5365 progressive. . . . You can indeed extract the MJPEG frames and
yading@10 5366 decode them with a regular JPEG decoder, but you have to prepend
yading@10 5367 the DHT segment to them, or else the decoder won't have any idea
yading@10 5368 how to decompress the data. The exact table necessary is given in
yading@10 5369 the OpenDML spec."
yading@10 5370
yading@10 5371 This bitstream filter patches the header of frames extracted from an MJPEG
yading@10 5372 stream (carrying the AVI1 header ID and lacking a DHT segment) to
yading@10 5373 produce fully qualified JPEG images.
yading@10 5374
yading@10 5375
yading@10 5376 ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
yading@10 5377 exiftran -i -9 frame*.jpg
yading@10 5378 ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
yading@10 5379
yading@10 5380
yading@10 5381
yading@10 5382 =head2 mjpega_dump_header
yading@10 5383
yading@10 5384
yading@10 5385
yading@10 5386 =head2 movsub
yading@10 5387
yading@10 5388
yading@10 5389
yading@10 5390 =head2 mp3_header_compress
yading@10 5391
yading@10 5392
yading@10 5393
yading@10 5394 =head2 mp3_header_decompress
yading@10 5395
yading@10 5396
yading@10 5397
yading@10 5398 =head2 noise
yading@10 5399
yading@10 5400
yading@10 5401
yading@10 5402 =head2 remove_extradata
yading@10 5403
yading@10 5404
yading@10 5405
yading@10 5406
yading@10 5407 =head1 FORMAT OPTIONS
yading@10 5408
yading@10 5409
yading@10 5410 The libavformat library provides some generic global options, which
yading@10 5411 can be set on all the muxers and demuxers. In addition each muxer or
yading@10 5412 demuxer may support so-called private options, which are specific for
yading@10 5413 that component.
yading@10 5414
yading@10 5415 Options may be set by specifying -I<option> I<value> in the
yading@10 5416 FFmpeg tools, or by setting the value explicitly in the
yading@10 5417 C<AVFormatContext> options or using the F<libavutil/opt.h> API
yading@10 5418 for programmatic use.
yading@10 5419
yading@10 5420 The list of supported options follows:
yading@10 5421
yading@10 5422
yading@10 5423 =over 4
yading@10 5424
yading@10 5425
yading@10 5426 =item B<avioflags> I<flags> B<(>I<input/output>B<)>
yading@10 5427
yading@10 5428 Possible values:
yading@10 5429
yading@10 5430 =over 4
yading@10 5431
yading@10 5432
yading@10 5433 =item B<direct>
yading@10 5434
yading@10 5435 Reduce buffering.
yading@10 5436
yading@10 5437 =back
yading@10 5438
yading@10 5439
yading@10 5440
yading@10 5441 =item B<probesize> I<integer> B<(>I<input>B<)>
yading@10 5442
yading@10 5443 Set probing size in bytes, i.e. the size of the data to analyze to get
yading@10 5444 stream information. A higher value will allow to detect more
yading@10 5445 information in case it is dispersed into the stream, but will increase
yading@10 5446 latency. Must be an integer not lesser than 32. It is 5000000 by default.
yading@10 5447
yading@10 5448
yading@10 5449 =item B<packetsize> I<integer> B<(>I<output>B<)>
yading@10 5450
yading@10 5451 Set packet size.
yading@10 5452
yading@10 5453
yading@10 5454 =item B<fflags> I<flags> B<(>I<input/output>B<)>
yading@10 5455
yading@10 5456 Set format flags.
yading@10 5457
yading@10 5458 Possible values:
yading@10 5459
yading@10 5460 =over 4
yading@10 5461
yading@10 5462
yading@10 5463 =item B<ignidx>
yading@10 5464
yading@10 5465 Ignore index.
yading@10 5466
yading@10 5467 =item B<genpts>
yading@10 5468
yading@10 5469 Generate PTS.
yading@10 5470
yading@10 5471 =item B<nofillin>
yading@10 5472
yading@10 5473 Do not fill in missing values that can be exactly calculated.
yading@10 5474
yading@10 5475 =item B<noparse>
yading@10 5476
yading@10 5477 Disable AVParsers, this needs C<+nofillin> too.
yading@10 5478
yading@10 5479 =item B<igndts>
yading@10 5480
yading@10 5481 Ignore DTS.
yading@10 5482
yading@10 5483 =item B<discardcorrupt>
yading@10 5484
yading@10 5485 Discard corrupted frames.
yading@10 5486
yading@10 5487 =item B<sortdts>
yading@10 5488
yading@10 5489 Try to interleave output packets by DTS.
yading@10 5490
yading@10 5491 =item B<keepside>
yading@10 5492
yading@10 5493 Do not merge side data.
yading@10 5494
yading@10 5495 =item B<latm>
yading@10 5496
yading@10 5497 Enable RTP MP4A-LATM payload.
yading@10 5498
yading@10 5499 =item B<nobuffer>
yading@10 5500
yading@10 5501 Reduce the latency introduced by optional buffering
yading@10 5502
yading@10 5503 =back
yading@10 5504
yading@10 5505
yading@10 5506
yading@10 5507 =item B<analyzeduration> I<integer> B<(>I<input>B<)>
yading@10 5508
yading@10 5509 Specify how many microseconds are analyzed to probe the input. A
yading@10 5510 higher value will allow to detect more accurate information, but will
yading@10 5511 increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
yading@10 5512
yading@10 5513
yading@10 5514 =item B<cryptokey> I<hexadecimal string> B<(>I<input>B<)>
yading@10 5515
yading@10 5516 Set decryption key.
yading@10 5517
yading@10 5518
yading@10 5519 =item B<indexmem> I<integer> B<(>I<input>B<)>
yading@10 5520
yading@10 5521 Set max memory used for timestamp index (per stream).
yading@10 5522
yading@10 5523
yading@10 5524 =item B<rtbufsize> I<integer> B<(>I<input>B<)>
yading@10 5525
yading@10 5526 Set max memory used for buffering real-time frames.
yading@10 5527
yading@10 5528
yading@10 5529 =item B<fdebug> I<flags> B<(>I<input/output>B<)>
yading@10 5530
yading@10 5531 Print specific debug info.
yading@10 5532
yading@10 5533 Possible values:
yading@10 5534
yading@10 5535 =over 4
yading@10 5536
yading@10 5537
yading@10 5538 =item B<ts>
yading@10 5539
yading@10 5540
yading@10 5541 =back
yading@10 5542
yading@10 5543
yading@10 5544
yading@10 5545 =item B<max_delay> I<integer> B<(>I<input/output>B<)>
yading@10 5546
yading@10 5547 Set maximum muxing or demuxing delay in microseconds.
yading@10 5548
yading@10 5549
yading@10 5550 =item B<fpsprobesize> I<integer> B<(>I<input>B<)>
yading@10 5551
yading@10 5552 Set number of frames used to probe fps.
yading@10 5553
yading@10 5554
yading@10 5555 =item B<audio_preload> I<integer> B<(>I<output>B<)>
yading@10 5556
yading@10 5557 Set microseconds by which audio packets should be interleaved earlier.
yading@10 5558
yading@10 5559
yading@10 5560 =item B<chunk_duration> I<integer> B<(>I<output>B<)>
yading@10 5561
yading@10 5562 Set microseconds for each chunk.
yading@10 5563
yading@10 5564
yading@10 5565 =item B<chunk_size> I<integer> B<(>I<output>B<)>
yading@10 5566
yading@10 5567 Set size in bytes for each chunk.
yading@10 5568
yading@10 5569
yading@10 5570 =item B<err_detect, f_err_detect> I<flags> B<(>I<input>B<)>
yading@10 5571
yading@10 5572 Set error detection flags. C<f_err_detect> is deprecated and
yading@10 5573 should be used only via the B<ffmpeg> tool.
yading@10 5574
yading@10 5575 Possible values:
yading@10 5576
yading@10 5577 =over 4
yading@10 5578
yading@10 5579
yading@10 5580 =item B<crccheck>
yading@10 5581
yading@10 5582 Verify embedded CRCs.
yading@10 5583
yading@10 5584 =item B<bitstream>
yading@10 5585
yading@10 5586 Detect bitstream specification deviations.
yading@10 5587
yading@10 5588 =item B<buffer>
yading@10 5589
yading@10 5590 Detect improper bitstream length.
yading@10 5591
yading@10 5592 =item B<explode>
yading@10 5593
yading@10 5594 Abort decoding on minor error detection.
yading@10 5595
yading@10 5596 =item B<careful>
yading@10 5597
yading@10 5598 Consider things that violate the spec and have not been seen in the
yading@10 5599 wild as errors.
yading@10 5600
yading@10 5601 =item B<compliant>
yading@10 5602
yading@10 5603 Consider all spec non compliancies as errors.
yading@10 5604
yading@10 5605 =item B<aggressive>
yading@10 5606
yading@10 5607 Consider things that a sane encoder should not do as an error.
yading@10 5608
yading@10 5609 =back
yading@10 5610
yading@10 5611
yading@10 5612
yading@10 5613 =item B<use_wallclock_as_timestamps> I<integer> B<(>I<input>B<)>
yading@10 5614
yading@10 5615 Use wallclock as timestamps.
yading@10 5616
yading@10 5617
yading@10 5618 =item B<avoid_negative_ts> I<integer> B<(>I<output>B<)>
yading@10 5619
yading@10 5620 Shift timestamps to make them positive. A value of 1 enables shifting,
yading@10 5621 a value of 0 disables it, the default value of -1 enables shifting
yading@10 5622 when required by the target format.
yading@10 5623
yading@10 5624 When shifting is enabled, all output timestamps are shifted by the
yading@10 5625 same amount. Audio, video, and subtitles desynching and relative
yading@10 5626 timestamp differences are preserved compared to how they would have
yading@10 5627 been without shifting.
yading@10 5628
yading@10 5629 Also note that this affects only leading negative timestamps, and not
yading@10 5630 non-monotonic negative timestamps.
yading@10 5631
yading@10 5632
yading@10 5633 =item B<flush_packets> I<integer> B<(>I<output>B<)>
yading@10 5634
yading@10 5635 Flush the underlying I/O stream after each packet. Default 1 enables it, and
yading@10 5636 has the effect of reducing the latency; 0 disables it and may slightly
yading@10 5637 increase performance in some cases.
yading@10 5638
yading@10 5639 =back
yading@10 5640
yading@10 5641
yading@10 5642
yading@10 5643
yading@10 5644 =head1 DEMUXERS
yading@10 5645
yading@10 5646
yading@10 5647 Demuxers are configured elements in FFmpeg which allow to read the
yading@10 5648 multimedia streams from a particular type of file.
yading@10 5649
yading@10 5650 When you configure your FFmpeg build, all the supported demuxers
yading@10 5651 are enabled by default. You can list all available ones using the
yading@10 5652 configure option C<--list-demuxers>.
yading@10 5653
yading@10 5654 You can disable all the demuxers using the configure option
yading@10 5655 C<--disable-demuxers>, and selectively enable a single demuxer with
yading@10 5656 the option C<--enable-demuxer=I<DEMUXER>>, or disable it
yading@10 5657 with the option C<--disable-demuxer=I<DEMUXER>>.
yading@10 5658
yading@10 5659 The option C<-formats> of the ff* tools will display the list of
yading@10 5660 enabled demuxers.
yading@10 5661
yading@10 5662 The description of some of the currently available demuxers follows.
yading@10 5663
yading@10 5664
yading@10 5665 =head2 applehttp
yading@10 5666
yading@10 5667
yading@10 5668 Apple HTTP Live Streaming demuxer.
yading@10 5669
yading@10 5670 This demuxer presents all AVStreams from all variant streams.
yading@10 5671 The id field is set to the bitrate variant index number. By setting
yading@10 5672 the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
yading@10 5673 the caller can decide which variant streams to actually receive.
yading@10 5674 The total bitrate of the variant that the stream belongs to is
yading@10 5675 available in a metadata key named "variant_bitrate".
yading@10 5676
yading@10 5677
yading@10 5678
yading@10 5679 =head2 concat
yading@10 5680
yading@10 5681
yading@10 5682 Virtual concatenation script demuxer.
yading@10 5683
yading@10 5684 This demuxer reads a list of files and other directives from a text file and
yading@10 5685 demuxes them one after the other, as if all their packet had been muxed
yading@10 5686 together.
yading@10 5687
yading@10 5688 The timestamps in the files are adjusted so that the first file starts at 0
yading@10 5689 and each next file starts where the previous one finishes. Note that it is
yading@10 5690 done globally and may cause gaps if all streams do not have exactly the same
yading@10 5691 length.
yading@10 5692
yading@10 5693 All files must have the same streams (same codecs, same time base, etc.).
yading@10 5694
yading@10 5695 The duration of each file is used to adjust the timestamps of the next file:
yading@10 5696 if the duration is incorrect (because it was computed using the bit-rate or
yading@10 5697 because the file is truncated, for example), it can cause artifacts. The
yading@10 5698 C<duration> directive can be used to override the duration stored in
yading@10 5699 each file.
yading@10 5700
yading@10 5701
yading@10 5702 =head3 Syntax
yading@10 5703
yading@10 5704
yading@10 5705 The script is a text file in extended-ASCII, with one directive per line.
yading@10 5706 Empty lines, leading spaces and lines starting with '#' are ignored. The
yading@10 5707 following directive is recognized:
yading@10 5708
yading@10 5709
yading@10 5710 =over 4
yading@10 5711
yading@10 5712
yading@10 5713
yading@10 5714 =item B<C<file I<path>>>
yading@10 5715
yading@10 5716 Path to a file to read; special characters and spaces must be escaped with
yading@10 5717 backslash or single quotes.
yading@10 5718
yading@10 5719 All subsequent directives apply to that file.
yading@10 5720
yading@10 5721
yading@10 5722 =item B<C<ffconcat version 1.0>>
yading@10 5723
yading@10 5724 Identify the script type and version. It also sets the B<safe> option
yading@10 5725 to 1 if it was to its default -1.
yading@10 5726
yading@10 5727 To make FFmpeg recognize the format automatically, this directive must
yading@10 5728 appears exactly as is (no extra space or byte-order-mark) on the very first
yading@10 5729 line of the script.
yading@10 5730
yading@10 5731
yading@10 5732 =item B<C<duration I<dur>>>
yading@10 5733
yading@10 5734 Duration of the file. This information can be specified from the file;
yading@10 5735 specifying it here may be more efficient or help if the information from the
yading@10 5736 file is not available or accurate.
yading@10 5737
yading@10 5738 If the duration is set for all files, then it is possible to seek in the
yading@10 5739 whole concatenated video.
yading@10 5740
yading@10 5741
yading@10 5742 =back
yading@10 5743
yading@10 5744
yading@10 5745
yading@10 5746 =head3 Options
yading@10 5747
yading@10 5748
yading@10 5749 This demuxer accepts the following option:
yading@10 5750
yading@10 5751
yading@10 5752 =over 4
yading@10 5753
yading@10 5754
yading@10 5755
yading@10 5756 =item B<safe>
yading@10 5757
yading@10 5758 If set to 1, reject unsafe file paths. A file path is considered safe if it
yading@10 5759 does not contain a protocol specification and is relative and all components
yading@10 5760 only contain characters from the portable character set (letters, digits,
yading@10 5761 period, underscore and hyphen) and have no period at the beginning of a
yading@10 5762 component.
yading@10 5763
yading@10 5764 If set to 0, any file name is accepted.
yading@10 5765
yading@10 5766 The default is -1, it is equivalent to 1 if the format was automatically
yading@10 5767 probed and 0 otherwise.
yading@10 5768
yading@10 5769
yading@10 5770 =back
yading@10 5771
yading@10 5772
yading@10 5773
yading@10 5774 =head2 libquvi
yading@10 5775
yading@10 5776
yading@10 5777 Play media from Internet services using the quvi project.
yading@10 5778
yading@10 5779 The demuxer accepts a B<format> option to request a specific quality. It
yading@10 5780 is by default set to I<best>.
yading@10 5781
yading@10 5782 See E<lt>B<http://quvi.sourceforge.net/>E<gt> for more information.
yading@10 5783
yading@10 5784 FFmpeg needs to be built with C<--enable-libquvi> for this demuxer to be
yading@10 5785 enabled.
yading@10 5786
yading@10 5787
yading@10 5788 =head2 image2
yading@10 5789
yading@10 5790
yading@10 5791 Image file demuxer.
yading@10 5792
yading@10 5793 This demuxer reads from a list of image files specified by a pattern.
yading@10 5794 The syntax and meaning of the pattern is specified by the
yading@10 5795 option I<pattern_type>.
yading@10 5796
yading@10 5797 The pattern may contain a suffix which is used to automatically
yading@10 5798 determine the format of the images contained in the files.
yading@10 5799
yading@10 5800 The size, the pixel format, and the format of each image must be the
yading@10 5801 same for all the files in the sequence.
yading@10 5802
yading@10 5803 This demuxer accepts the following options:
yading@10 5804
yading@10 5805 =over 4
yading@10 5806
yading@10 5807
yading@10 5808 =item B<framerate>
yading@10 5809
yading@10 5810 Set the frame rate for the video stream. It defaults to 25.
yading@10 5811
yading@10 5812 =item B<loop>
yading@10 5813
yading@10 5814 If set to 1, loop over the input. Default value is 0.
yading@10 5815
yading@10 5816 =item B<pattern_type>
yading@10 5817
yading@10 5818 Select the pattern type used to interpret the provided filename.
yading@10 5819
yading@10 5820 I<pattern_type> accepts one of the following values.
yading@10 5821
yading@10 5822 =over 4
yading@10 5823
yading@10 5824
yading@10 5825 =item B<sequence>
yading@10 5826
yading@10 5827 Select a sequence pattern type, used to specify a sequence of files
yading@10 5828 indexed by sequential numbers.
yading@10 5829
yading@10 5830 A sequence pattern may contain the string "%d" or "%0I<N>d", which
yading@10 5831 specifies the position of the characters representing a sequential
yading@10 5832 number in each filename matched by the pattern. If the form
yading@10 5833 "%d0I<N>d" is used, the string representing the number in each
yading@10 5834 filename is 0-padded and I<N> is the total number of 0-padded
yading@10 5835 digits representing the number. The literal character '%' can be
yading@10 5836 specified in the pattern with the string "%%".
yading@10 5837
yading@10 5838 If the sequence pattern contains "%d" or "%0I<N>d", the first filename of
yading@10 5839 the file list specified by the pattern must contain a number
yading@10 5840 inclusively contained between I<start_number> and
yading@10 5841 I<start_number>+I<start_number_range>-1, and all the following
yading@10 5842 numbers must be sequential.
yading@10 5843
yading@10 5844 For example the pattern "img-%03d.bmp" will match a sequence of
yading@10 5845 filenames of the form F<img-001.bmp>, F<img-002.bmp>, ...,
yading@10 5846 F<img-010.bmp>, etc.; the pattern "i%%m%%g-%d.jpg" will match a
yading@10 5847 sequence of filenames of the form F<i%m%g-1.jpg>,
yading@10 5848 F<i%m%g-2.jpg>, ..., F<i%m%g-10.jpg>, etc.
yading@10 5849
yading@10 5850 Note that the pattern must not necessarily contain "%d" or
yading@10 5851 "%0I<N>d", for example to convert a single image file
yading@10 5852 F<img.jpeg> you can employ the command:
yading@10 5853
yading@10 5854 ffmpeg -i img.jpeg img.png
yading@10 5855
yading@10 5856
yading@10 5857
yading@10 5858 =item B<glob>
yading@10 5859
yading@10 5860 Select a glob wildcard pattern type.
yading@10 5861
yading@10 5862 The pattern is interpreted like a C<glob()> pattern. This is only
yading@10 5863 selectable if libavformat was compiled with globbing support.
yading@10 5864
yading@10 5865
yading@10 5866 =item B<glob_sequence> I<(deprecated, will be removed)>
yading@10 5867
yading@10 5868 Select a mixed glob wildcard/sequence pattern.
yading@10 5869
yading@10 5870 If your version of libavformat was compiled with globbing support, and
yading@10 5871 the provided pattern contains at least one glob meta character among
yading@10 5872 C<%*?[]{}> that is preceded by an unescaped "%", the pattern is
yading@10 5873 interpreted like a C<glob()> pattern, otherwise it is interpreted
yading@10 5874 like a sequence pattern.
yading@10 5875
yading@10 5876 All glob special characters C<%*?[]{}> must be prefixed
yading@10 5877 with "%". To escape a literal "%" you shall use "%%".
yading@10 5878
yading@10 5879 For example the pattern C<foo-%*.jpeg> will match all the
yading@10 5880 filenames prefixed by "foo-" and terminating with ".jpeg", and
yading@10 5881 C<foo-%?%?%?.jpeg> will match all the filenames prefixed with
yading@10 5882 "foo-", followed by a sequence of three characters, and terminating
yading@10 5883 with ".jpeg".
yading@10 5884
yading@10 5885 This pattern type is deprecated in favor of I<glob> and
yading@10 5886 I<sequence>.
yading@10 5887
yading@10 5888 =back
yading@10 5889
yading@10 5890
yading@10 5891 Default value is I<glob_sequence>.
yading@10 5892
yading@10 5893 =item B<pixel_format>
yading@10 5894
yading@10 5895 Set the pixel format of the images to read. If not specified the pixel
yading@10 5896 format is guessed from the first image file in the sequence.
yading@10 5897
yading@10 5898 =item B<start_number>
yading@10 5899
yading@10 5900 Set the index of the file matched by the image file pattern to start
yading@10 5901 to read from. Default value is 0.
yading@10 5902
yading@10 5903 =item B<start_number_range>
yading@10 5904
yading@10 5905 Set the index interval range to check when looking for the first image
yading@10 5906 file in the sequence, starting from I<start_number>. Default value
yading@10 5907 is 5.
yading@10 5908
yading@10 5909 =item B<video_size>
yading@10 5910
yading@10 5911 Set the video size of the images to read. If not specified the video
yading@10 5912 size is guessed from the first image file in the sequence.
yading@10 5913
yading@10 5914 =back
yading@10 5915
yading@10 5916
yading@10 5917
yading@10 5918 =head3 Examples
yading@10 5919
yading@10 5920
yading@10 5921
yading@10 5922 =over 4
yading@10 5923
yading@10 5924
yading@10 5925 =item *
yading@10 5926
yading@10 5927 Use B<ffmpeg> for creating a video from the images in the file
yading@10 5928 sequence F<img-001.jpeg>, F<img-002.jpeg>, ..., assuming an
yading@10 5929 input frame rate of 10 frames per second:
yading@10 5930
yading@10 5931 ffmpeg -i 'img-%03d.jpeg' -r 10 out.mkv
yading@10 5932
yading@10 5933
yading@10 5934
yading@10 5935 =item *
yading@10 5936
yading@10 5937 As above, but start by reading from a file with index 100 in the sequence:
yading@10 5938
yading@10 5939 ffmpeg -start_number 100 -i 'img-%03d.jpeg' -r 10 out.mkv
yading@10 5940
yading@10 5941
yading@10 5942
yading@10 5943 =item *
yading@10 5944
yading@10 5945 Read images matching the "*.png" glob pattern , that is all the files
yading@10 5946 terminating with the ".png" suffix:
yading@10 5947
yading@10 5948 ffmpeg -pattern_type glob -i "*.png" -r 10 out.mkv
yading@10 5949
yading@10 5950
yading@10 5951 =back
yading@10 5952
yading@10 5953
yading@10 5954
yading@10 5955 =head2 rawvideo
yading@10 5956
yading@10 5957
yading@10 5958 Raw video demuxer.
yading@10 5959
yading@10 5960 This demuxer allows to read raw video data. Since there is no header
yading@10 5961 specifying the assumed video parameters, the user must specify them
yading@10 5962 in order to be able to decode the data correctly.
yading@10 5963
yading@10 5964 This demuxer accepts the following options:
yading@10 5965
yading@10 5966 =over 4
yading@10 5967
yading@10 5968
yading@10 5969
yading@10 5970 =item B<framerate>
yading@10 5971
yading@10 5972 Set input video frame rate. Default value is 25.
yading@10 5973
yading@10 5974
yading@10 5975 =item B<pixel_format>
yading@10 5976
yading@10 5977 Set the input video pixel format. Default value is C<yuv420p>.
yading@10 5978
yading@10 5979
yading@10 5980 =item B<video_size>
yading@10 5981
yading@10 5982 Set the input video size. This value must be specified explicitly.
yading@10 5983
yading@10 5984 =back
yading@10 5985
yading@10 5986
yading@10 5987 For example to read a rawvideo file F<input.raw> with
yading@10 5988 B<ffplay>, assuming a pixel format of C<rgb24>, a video
yading@10 5989 size of C<320x240>, and a frame rate of 10 images per second, use
yading@10 5990 the command:
yading@10 5991
yading@10 5992 ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
yading@10 5993
yading@10 5994
yading@10 5995
yading@10 5996 =head2 sbg
yading@10 5997
yading@10 5998
yading@10 5999 SBaGen script demuxer.
yading@10 6000
yading@10 6001 This demuxer reads the script language used by SBaGen
yading@10 6002 E<lt>B<http://uazu.net/sbagen/>E<gt> to generate binaural beats sessions. A SBG
yading@10 6003 script looks like that:
yading@10 6004
yading@10 6005 -SE
yading@10 6006 a: 300-2.5/3 440+4.5/0
yading@10 6007 b: 300-2.5/0 440+4.5/3
yading@10 6008 off: -
yading@10 6009 NOW == a
yading@10 6010 +0:07:00 == b
yading@10 6011 +0:14:00 == a
yading@10 6012 +0:21:00 == b
yading@10 6013 +0:30:00 off
yading@10 6014
yading@10 6015
yading@10 6016 A SBG script can mix absolute and relative timestamps. If the script uses
yading@10 6017 either only absolute timestamps (including the script start time) or only
yading@10 6018 relative ones, then its layout is fixed, and the conversion is
yading@10 6019 straightforward. On the other hand, if the script mixes both kind of
yading@10 6020 timestamps, then the I<NOW> reference for relative timestamps will be
yading@10 6021 taken from the current time of day at the time the script is read, and the
yading@10 6022 script layout will be frozen according to that reference. That means that if
yading@10 6023 the script is directly played, the actual times will match the absolute
yading@10 6024 timestamps up to the sound controller's clock accuracy, but if the user
yading@10 6025 somehow pauses the playback or seeks, all times will be shifted accordingly.
yading@10 6026
yading@10 6027
yading@10 6028 =head2 tedcaptions
yading@10 6029
yading@10 6030
yading@10 6031 JSON captions used for E<lt>B<http://www.ted.com/>E<gt>.
yading@10 6032
yading@10 6033 TED does not provide links to the captions, but they can be guessed from the
yading@10 6034 page. The file F<tools/bookmarklets.html> from the FFmpeg source tree
yading@10 6035 contains a bookmarklet to expose them.
yading@10 6036
yading@10 6037 This demuxer accepts the following option:
yading@10 6038
yading@10 6039 =over 4
yading@10 6040
yading@10 6041
yading@10 6042 =item B<start_time>
yading@10 6043
yading@10 6044 Set the start time of the TED talk, in milliseconds. The default is 15000
yading@10 6045 (15s). It is used to sync the captions with the downloadable videos, because
yading@10 6046 they include a 15s intro.
yading@10 6047
yading@10 6048 =back
yading@10 6049
yading@10 6050
yading@10 6051 Example: convert the captions to a format most players understand:
yading@10 6052
yading@10 6053 ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
yading@10 6054
yading@10 6055
yading@10 6056
yading@10 6057 =head1 MUXERS
yading@10 6058
yading@10 6059
yading@10 6060 Muxers are configured elements in FFmpeg which allow writing
yading@10 6061 multimedia streams to a particular type of file.
yading@10 6062
yading@10 6063 When you configure your FFmpeg build, all the supported muxers
yading@10 6064 are enabled by default. You can list all available muxers using the
yading@10 6065 configure option C<--list-muxers>.
yading@10 6066
yading@10 6067 You can disable all the muxers with the configure option
yading@10 6068 C<--disable-muxers> and selectively enable / disable single muxers
yading@10 6069 with the options C<--enable-muxer=I<MUXER>> /
yading@10 6070 C<--disable-muxer=I<MUXER>>.
yading@10 6071
yading@10 6072 The option C<-formats> of the ff* tools will display the list of
yading@10 6073 enabled muxers.
yading@10 6074
yading@10 6075 A description of some of the currently available muxers follows.
yading@10 6076
yading@10 6077
yading@10 6078
yading@10 6079 =head2 crc
yading@10 6080
yading@10 6081
yading@10 6082 CRC (Cyclic Redundancy Check) testing format.
yading@10 6083
yading@10 6084 This muxer computes and prints the Adler-32 CRC of all the input audio
yading@10 6085 and video frames. By default audio frames are converted to signed
yading@10 6086 16-bit raw audio and video frames to raw video before computing the
yading@10 6087 CRC.
yading@10 6088
yading@10 6089 The output of the muxer consists of a single line of the form:
yading@10 6090 CRC=0xI<CRC>, where I<CRC> is a hexadecimal number 0-padded to
yading@10 6091 8 digits containing the CRC for all the decoded input frames.
yading@10 6092
yading@10 6093 For example to compute the CRC of the input, and store it in the file
yading@10 6094 F<out.crc>:
yading@10 6095
yading@10 6096 ffmpeg -i INPUT -f crc out.crc
yading@10 6097
yading@10 6098
yading@10 6099 You can print the CRC to stdout with the command:
yading@10 6100
yading@10 6101 ffmpeg -i INPUT -f crc -
yading@10 6102
yading@10 6103
yading@10 6104 You can select the output format of each frame with B<ffmpeg> by
yading@10 6105 specifying the audio and video codec and format. For example to
yading@10 6106 compute the CRC of the input audio converted to PCM unsigned 8-bit
yading@10 6107 and the input video converted to MPEG-2 video, use the command:
yading@10 6108
yading@10 6109 ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
yading@10 6110
yading@10 6111
yading@10 6112 See also the framecrc muxer.
yading@10 6113
yading@10 6114
yading@10 6115
yading@10 6116 =head2 framecrc
yading@10 6117
yading@10 6118
yading@10 6119 Per-packet CRC (Cyclic Redundancy Check) testing format.
yading@10 6120
yading@10 6121 This muxer computes and prints the Adler-32 CRC for each audio
yading@10 6122 and video packet. By default audio frames are converted to signed
yading@10 6123 16-bit raw audio and video frames to raw video before computing the
yading@10 6124 CRC.
yading@10 6125
yading@10 6126 The output of the muxer consists of a line for each audio and video
yading@10 6127 packet of the form:
yading@10 6128
yading@10 6129 <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, 0x<CRC>
yading@10 6130
yading@10 6131
yading@10 6132 I<CRC> is a hexadecimal number 0-padded to 8 digits containing the
yading@10 6133 CRC of the packet.
yading@10 6134
yading@10 6135 For example to compute the CRC of the audio and video frames in
yading@10 6136 F<INPUT>, converted to raw audio and video packets, and store it
yading@10 6137 in the file F<out.crc>:
yading@10 6138
yading@10 6139 ffmpeg -i INPUT -f framecrc out.crc
yading@10 6140
yading@10 6141
yading@10 6142 To print the information to stdout, use the command:
yading@10 6143
yading@10 6144 ffmpeg -i INPUT -f framecrc -
yading@10 6145
yading@10 6146
yading@10 6147 With B<ffmpeg>, you can select the output format to which the
yading@10 6148 audio and video frames are encoded before computing the CRC for each
yading@10 6149 packet by specifying the audio and video codec. For example, to
yading@10 6150 compute the CRC of each decoded input audio frame converted to PCM
yading@10 6151 unsigned 8-bit and of each decoded input video frame converted to
yading@10 6152 MPEG-2 video, use the command:
yading@10 6153
yading@10 6154 ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
yading@10 6155
yading@10 6156
yading@10 6157 See also the crc muxer.
yading@10 6158
yading@10 6159
yading@10 6160
yading@10 6161 =head2 framemd5
yading@10 6162
yading@10 6163
yading@10 6164 Per-packet MD5 testing format.
yading@10 6165
yading@10 6166 This muxer computes and prints the MD5 hash for each audio
yading@10 6167 and video packet. By default audio frames are converted to signed
yading@10 6168 16-bit raw audio and video frames to raw video before computing the
yading@10 6169 hash.
yading@10 6170
yading@10 6171 The output of the muxer consists of a line for each audio and video
yading@10 6172 packet of the form:
yading@10 6173
yading@10 6174 <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, <MD5>
yading@10 6175
yading@10 6176
yading@10 6177 I<MD5> is a hexadecimal number representing the computed MD5 hash
yading@10 6178 for the packet.
yading@10 6179
yading@10 6180 For example to compute the MD5 of the audio and video frames in
yading@10 6181 F<INPUT>, converted to raw audio and video packets, and store it
yading@10 6182 in the file F<out.md5>:
yading@10 6183
yading@10 6184 ffmpeg -i INPUT -f framemd5 out.md5
yading@10 6185
yading@10 6186
yading@10 6187 To print the information to stdout, use the command:
yading@10 6188
yading@10 6189 ffmpeg -i INPUT -f framemd5 -
yading@10 6190
yading@10 6191
yading@10 6192 See also the md5 muxer.
yading@10 6193
yading@10 6194
yading@10 6195
yading@10 6196 =head2 hls
yading@10 6197
yading@10 6198
yading@10 6199 Apple HTTP Live Streaming muxer that segments MPEG-TS according to
yading@10 6200 the HTTP Live Streaming specification.
yading@10 6201
yading@10 6202 It creates a playlist file and numbered segment files. The output
yading@10 6203 filename specifies the playlist filename; the segment filenames
yading@10 6204 receive the same basename as the playlist, a sequential number and
yading@10 6205 a .ts extension.
yading@10 6206
yading@10 6207
yading@10 6208 ffmpeg -i in.nut out.m3u8
yading@10 6209
yading@10 6210
yading@10 6211
yading@10 6212 =over 4
yading@10 6213
yading@10 6214
yading@10 6215 =item B<-hls_time> I<seconds>
yading@10 6216
yading@10 6217 Set the segment length in seconds.
yading@10 6218
yading@10 6219 =item B<-hls_list_size> I<size>
yading@10 6220
yading@10 6221 Set the maximum number of playlist entries.
yading@10 6222
yading@10 6223 =item B<-hls_wrap> I<wrap>
yading@10 6224
yading@10 6225 Set the number after which index wraps.
yading@10 6226
yading@10 6227 =item B<-start_number> I<number>
yading@10 6228
yading@10 6229 Start the sequence from I<number>.
yading@10 6230
yading@10 6231 =back
yading@10 6232
yading@10 6233
yading@10 6234
yading@10 6235
yading@10 6236 =head2 ico
yading@10 6237
yading@10 6238
yading@10 6239 ICO file muxer.
yading@10 6240
yading@10 6241 Microsoft's icon file format (ICO) has some strict limitations that should be noted:
yading@10 6242
yading@10 6243
yading@10 6244 =over 4
yading@10 6245
yading@10 6246
yading@10 6247 =item *
yading@10 6248
yading@10 6249 Size cannot exceed 256 pixels in any dimension
yading@10 6250
yading@10 6251
yading@10 6252 =item *
yading@10 6253
yading@10 6254 Only BMP and PNG images can be stored
yading@10 6255
yading@10 6256
yading@10 6257 =item *
yading@10 6258
yading@10 6259 If a BMP image is used, it must be one of the following pixel formats:
yading@10 6260
yading@10 6261 BMP Bit Depth FFmpeg Pixel Format
yading@10 6262 1bit pal8
yading@10 6263 4bit pal8
yading@10 6264 8bit pal8
yading@10 6265 16bit rgb555le
yading@10 6266 24bit bgr24
yading@10 6267 32bit bgra
yading@10 6268
yading@10 6269
yading@10 6270
yading@10 6271 =item *
yading@10 6272
yading@10 6273 If a BMP image is used, it must use the BITMAPINFOHEADER DIB header
yading@10 6274
yading@10 6275
yading@10 6276 =item *
yading@10 6277
yading@10 6278 If a PNG image is used, it must use the rgba pixel format
yading@10 6279
yading@10 6280 =back
yading@10 6281
yading@10 6282
yading@10 6283
yading@10 6284
yading@10 6285 =head2 image2
yading@10 6286
yading@10 6287
yading@10 6288 Image file muxer.
yading@10 6289
yading@10 6290 The image file muxer writes video frames to image files.
yading@10 6291
yading@10 6292 The output filenames are specified by a pattern, which can be used to
yading@10 6293 produce sequentially numbered series of files.
yading@10 6294 The pattern may contain the string "%d" or "%0I<N>d", this string
yading@10 6295 specifies the position of the characters representing a numbering in
yading@10 6296 the filenames. If the form "%0I<N>d" is used, the string
yading@10 6297 representing the number in each filename is 0-padded to I<N>
yading@10 6298 digits. The literal character '%' can be specified in the pattern with
yading@10 6299 the string "%%".
yading@10 6300
yading@10 6301 If the pattern contains "%d" or "%0I<N>d", the first filename of
yading@10 6302 the file list specified will contain the number 1, all the following
yading@10 6303 numbers will be sequential.
yading@10 6304
yading@10 6305 The pattern may contain a suffix which is used to automatically
yading@10 6306 determine the format of the image files to write.
yading@10 6307
yading@10 6308 For example the pattern "img-%03d.bmp" will specify a sequence of
yading@10 6309 filenames of the form F<img-001.bmp>, F<img-002.bmp>, ...,
yading@10 6310 F<img-010.bmp>, etc.
yading@10 6311 The pattern "img%%-%d.jpg" will specify a sequence of filenames of the
yading@10 6312 form F<img%-1.jpg>, F<img%-2.jpg>, ..., F<img%-10.jpg>,
yading@10 6313 etc.
yading@10 6314
yading@10 6315 The following example shows how to use B<ffmpeg> for creating a
yading@10 6316 sequence of files F<img-001.jpeg>, F<img-002.jpeg>, ...,
yading@10 6317 taking one image every second from the input video:
yading@10 6318
yading@10 6319 ffmpeg -i in.avi -vsync 1 -r 1 -f image2 'img-%03d.jpeg'
yading@10 6320
yading@10 6321
yading@10 6322 Note that with B<ffmpeg>, if the format is not specified with the
yading@10 6323 C<-f> option and the output filename specifies an image file
yading@10 6324 format, the image2 muxer is automatically selected, so the previous
yading@10 6325 command can be written as:
yading@10 6326
yading@10 6327 ffmpeg -i in.avi -vsync 1 -r 1 'img-%03d.jpeg'
yading@10 6328
yading@10 6329
yading@10 6330 Note also that the pattern must not necessarily contain "%d" or
yading@10 6331 "%0I<N>d", for example to create a single image file
yading@10 6332 F<img.jpeg> from the input video you can employ the command:
yading@10 6333
yading@10 6334 ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
yading@10 6335
yading@10 6336
yading@10 6337
yading@10 6338 =over 4
yading@10 6339
yading@10 6340
yading@10 6341 =item B<start_number> I<number>
yading@10 6342
yading@10 6343 Start the sequence from I<number>. Default value is 1. Must be a
yading@10 6344 positive number.
yading@10 6345
yading@10 6346
yading@10 6347 =item B<-update> I<number>
yading@10 6348
yading@10 6349 If I<number> is nonzero, the filename will always be interpreted as just a
yading@10 6350 filename, not a pattern, and this file will be continuously overwritten with new
yading@10 6351 images.
yading@10 6352
yading@10 6353
yading@10 6354 =back
yading@10 6355
yading@10 6356
yading@10 6357 The image muxer supports the .Y.U.V image file format. This format is
yading@10 6358 special in that that each image frame consists of three files, for
yading@10 6359 each of the YUV420P components. To read or write this image file format,
yading@10 6360 specify the name of the '.Y' file. The muxer will automatically open the
yading@10 6361 '.U' and '.V' files as required.
yading@10 6362
yading@10 6363
yading@10 6364
yading@10 6365 =head2 md5
yading@10 6366
yading@10 6367
yading@10 6368 MD5 testing format.
yading@10 6369
yading@10 6370 This muxer computes and prints the MD5 hash of all the input audio
yading@10 6371 and video frames. By default audio frames are converted to signed
yading@10 6372 16-bit raw audio and video frames to raw video before computing the
yading@10 6373 hash.
yading@10 6374
yading@10 6375 The output of the muxer consists of a single line of the form:
yading@10 6376 MD5=I<MD5>, where I<MD5> is a hexadecimal number representing
yading@10 6377 the computed MD5 hash.
yading@10 6378
yading@10 6379 For example to compute the MD5 hash of the input converted to raw
yading@10 6380 audio and video, and store it in the file F<out.md5>:
yading@10 6381
yading@10 6382 ffmpeg -i INPUT -f md5 out.md5
yading@10 6383
yading@10 6384
yading@10 6385 You can print the MD5 to stdout with the command:
yading@10 6386
yading@10 6387 ffmpeg -i INPUT -f md5 -
yading@10 6388
yading@10 6389
yading@10 6390 See also the framemd5 muxer.
yading@10 6391
yading@10 6392
yading@10 6393 =head2 MOV/MP4/ISMV
yading@10 6394
yading@10 6395
yading@10 6396 The mov/mp4/ismv muxer supports fragmentation. Normally, a MOV/MP4
yading@10 6397 file has all the metadata about all packets stored in one location
yading@10 6398 (written at the end of the file, it can be moved to the start for
yading@10 6399 better playback by adding I<faststart> to the I<movflags>, or
yading@10 6400 using the B<qt-faststart> tool). A fragmented
yading@10 6401 file consists of a number of fragments, where packets and metadata
yading@10 6402 about these packets are stored together. Writing a fragmented
yading@10 6403 file has the advantage that the file is decodable even if the
yading@10 6404 writing is interrupted (while a normal MOV/MP4 is undecodable if
yading@10 6405 it is not properly finished), and it requires less memory when writing
yading@10 6406 very long files (since writing normal MOV/MP4 files stores info about
yading@10 6407 every single packet in memory until the file is closed). The downside
yading@10 6408 is that it is less compatible with other applications.
yading@10 6409
yading@10 6410 Fragmentation is enabled by setting one of the AVOptions that define
yading@10 6411 how to cut the file into fragments:
yading@10 6412
yading@10 6413
yading@10 6414 =over 4
yading@10 6415
yading@10 6416
yading@10 6417 =item B<-moov_size> I<bytes>
yading@10 6418
yading@10 6419 Reserves space for the moov atom at the beginning of the file instead of placing the
yading@10 6420 moov atom at the end. If the space reserved is insufficient, muxing will fail.
yading@10 6421
yading@10 6422 =item B<-movflags frag_keyframe>
yading@10 6423
yading@10 6424 Start a new fragment at each video keyframe.
yading@10 6425
yading@10 6426 =item B<-frag_duration> I<duration>
yading@10 6427
yading@10 6428 Create fragments that are I<duration> microseconds long.
yading@10 6429
yading@10 6430 =item B<-frag_size> I<size>
yading@10 6431
yading@10 6432 Create fragments that contain up to I<size> bytes of payload data.
yading@10 6433
yading@10 6434 =item B<-movflags frag_custom>
yading@10 6435
yading@10 6436 Allow the caller to manually choose when to cut fragments, by
yading@10 6437 calling C<av_write_frame(ctx, NULL)> to write a fragment with
yading@10 6438 the packets written so far. (This is only useful with other
yading@10 6439 applications integrating libavformat, not from B<ffmpeg>.)
yading@10 6440
yading@10 6441 =item B<-min_frag_duration> I<duration>
yading@10 6442
yading@10 6443 Don't create fragments that are shorter than I<duration> microseconds long.
yading@10 6444
yading@10 6445 =back
yading@10 6446
yading@10 6447
yading@10 6448 If more than one condition is specified, fragments are cut when
yading@10 6449 one of the specified conditions is fulfilled. The exception to this is
yading@10 6450 C<-min_frag_duration>, which has to be fulfilled for any of the other
yading@10 6451 conditions to apply.
yading@10 6452
yading@10 6453 Additionally, the way the output file is written can be adjusted
yading@10 6454 through a few other options:
yading@10 6455
yading@10 6456
yading@10 6457 =over 4
yading@10 6458
yading@10 6459
yading@10 6460 =item B<-movflags empty_moov>
yading@10 6461
yading@10 6462 Write an initial moov atom directly at the start of the file, without
yading@10 6463 describing any samples in it. Generally, an mdat/moov pair is written
yading@10 6464 at the start of the file, as a normal MOV/MP4 file, containing only
yading@10 6465 a short portion of the file. With this option set, there is no initial
yading@10 6466 mdat atom, and the moov atom only describes the tracks but has
yading@10 6467 a zero duration.
yading@10 6468
yading@10 6469 Files written with this option set do not work in QuickTime.
yading@10 6470 This option is implicitly set when writing ismv (Smooth Streaming) files.
yading@10 6471
yading@10 6472 =item B<-movflags separate_moof>
yading@10 6473
yading@10 6474 Write a separate moof (movie fragment) atom for each track. Normally,
yading@10 6475 packets for all tracks are written in a moof atom (which is slightly
yading@10 6476 more efficient), but with this option set, the muxer writes one moof/mdat
yading@10 6477 pair for each track, making it easier to separate tracks.
yading@10 6478
yading@10 6479 This option is implicitly set when writing ismv (Smooth Streaming) files.
yading@10 6480
yading@10 6481 =item B<-movflags faststart>
yading@10 6482
yading@10 6483 Run a second pass moving the moov atom on top of the file. This
yading@10 6484 operation can take a while, and will not work in various situations such
yading@10 6485 as fragmented output, thus it is not enabled by default.
yading@10 6486
yading@10 6487 =item B<-movflags rtphint>
yading@10 6488
yading@10 6489 Add RTP hinting tracks to the output file.
yading@10 6490
yading@10 6491 =back
yading@10 6492
yading@10 6493
yading@10 6494 Smooth Streaming content can be pushed in real time to a publishing
yading@10 6495 point on IIS with this muxer. Example:
yading@10 6496
yading@10 6497 ffmpeg -re <<normal input/transcoding options>> -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
yading@10 6498
yading@10 6499
yading@10 6500
yading@10 6501 =head2 mpegts
yading@10 6502
yading@10 6503
yading@10 6504 MPEG transport stream muxer.
yading@10 6505
yading@10 6506 This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
yading@10 6507
yading@10 6508 The muxer options are:
yading@10 6509
yading@10 6510
yading@10 6511 =over 4
yading@10 6512
yading@10 6513
yading@10 6514 =item B<-mpegts_original_network_id> I<number>
yading@10 6515
yading@10 6516 Set the original_network_id (default 0x0001). This is unique identifier
yading@10 6517 of a network in DVB. Its main use is in the unique identification of a
yading@10 6518 service through the path Original_Network_ID, Transport_Stream_ID.
yading@10 6519
yading@10 6520 =item B<-mpegts_transport_stream_id> I<number>
yading@10 6521
yading@10 6522 Set the transport_stream_id (default 0x0001). This identifies a
yading@10 6523 transponder in DVB.
yading@10 6524
yading@10 6525 =item B<-mpegts_service_id> I<number>
yading@10 6526
yading@10 6527 Set the service_id (default 0x0001) also known as program in DVB.
yading@10 6528
yading@10 6529 =item B<-mpegts_pmt_start_pid> I<number>
yading@10 6530
yading@10 6531 Set the first PID for PMT (default 0x1000, max 0x1f00).
yading@10 6532
yading@10 6533 =item B<-mpegts_start_pid> I<number>
yading@10 6534
yading@10 6535 Set the first PID for data packets (default 0x0100, max 0x0f00).
yading@10 6536
yading@10 6537 =back
yading@10 6538
yading@10 6539
yading@10 6540 The recognized metadata settings in mpegts muxer are C<service_provider>
yading@10 6541 and C<service_name>. If they are not set the default for
yading@10 6542 C<service_provider> is "FFmpeg" and the default for
yading@10 6543 C<service_name> is "Service01".
yading@10 6544
yading@10 6545
yading@10 6546 ffmpeg -i file.mpg -c copy \
yading@10 6547 -mpegts_original_network_id 0x1122 \
yading@10 6548 -mpegts_transport_stream_id 0x3344 \
yading@10 6549 -mpegts_service_id 0x5566 \
yading@10 6550 -mpegts_pmt_start_pid 0x1500 \
yading@10 6551 -mpegts_start_pid 0x150 \
yading@10 6552 -metadata service_provider="Some provider" \
yading@10 6553 -metadata service_name="Some Channel" \
yading@10 6554 -y out.ts
yading@10 6555
yading@10 6556
yading@10 6557
yading@10 6558 =head2 null
yading@10 6559
yading@10 6560
yading@10 6561 Null muxer.
yading@10 6562
yading@10 6563 This muxer does not generate any output file, it is mainly useful for
yading@10 6564 testing or benchmarking purposes.
yading@10 6565
yading@10 6566 For example to benchmark decoding with B<ffmpeg> you can use the
yading@10 6567 command:
yading@10 6568
yading@10 6569 ffmpeg -benchmark -i INPUT -f null out.null
yading@10 6570
yading@10 6571
yading@10 6572 Note that the above command does not read or write the F<out.null>
yading@10 6573 file, but specifying the output file is required by the B<ffmpeg>
yading@10 6574 syntax.
yading@10 6575
yading@10 6576 Alternatively you can write the command as:
yading@10 6577
yading@10 6578 ffmpeg -benchmark -i INPUT -f null -
yading@10 6579
yading@10 6580
yading@10 6581
yading@10 6582 =head2 matroska
yading@10 6583
yading@10 6584
yading@10 6585 Matroska container muxer.
yading@10 6586
yading@10 6587 This muxer implements the matroska and webm container specs.
yading@10 6588
yading@10 6589 The recognized metadata settings in this muxer are:
yading@10 6590
yading@10 6591
yading@10 6592 =over 4
yading@10 6593
yading@10 6594
yading@10 6595
yading@10 6596 =item B<title=>I<title name>
yading@10 6597
yading@10 6598 Name provided to a single track
yading@10 6599
yading@10 6600 =back
yading@10 6601
yading@10 6602
yading@10 6603
yading@10 6604 =over 4
yading@10 6605
yading@10 6606
yading@10 6607
yading@10 6608 =item B<language=>I<language name>
yading@10 6609
yading@10 6610 Specifies the language of the track in the Matroska languages form
yading@10 6611
yading@10 6612 =back
yading@10 6613
yading@10 6614
yading@10 6615
yading@10 6616 =over 4
yading@10 6617
yading@10 6618
yading@10 6619
yading@10 6620 =item B<stereo_mode=>I<mode>
yading@10 6621
yading@10 6622 Stereo 3D video layout of two views in a single video track
yading@10 6623
yading@10 6624 =over 4
yading@10 6625
yading@10 6626
yading@10 6627 =item B<mono>
yading@10 6628
yading@10 6629 video is not stereo
yading@10 6630
yading@10 6631 =item B<left_right>
yading@10 6632
yading@10 6633 Both views are arranged side by side, Left-eye view is on the left
yading@10 6634
yading@10 6635 =item B<bottom_top>
yading@10 6636
yading@10 6637 Both views are arranged in top-bottom orientation, Left-eye view is at bottom
yading@10 6638
yading@10 6639 =item B<top_bottom>
yading@10 6640
yading@10 6641 Both views are arranged in top-bottom orientation, Left-eye view is on top
yading@10 6642
yading@10 6643 =item B<checkerboard_rl>
yading@10 6644
yading@10 6645 Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
yading@10 6646
yading@10 6647 =item B<checkerboard_lr>
yading@10 6648
yading@10 6649 Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
yading@10 6650
yading@10 6651 =item B<row_interleaved_rl>
yading@10 6652
yading@10 6653 Each view is constituted by a row based interleaving, Right-eye view is first row
yading@10 6654
yading@10 6655 =item B<row_interleaved_lr>
yading@10 6656
yading@10 6657 Each view is constituted by a row based interleaving, Left-eye view is first row
yading@10 6658
yading@10 6659 =item B<col_interleaved_rl>
yading@10 6660
yading@10 6661 Both views are arranged in a column based interleaving manner, Right-eye view is first column
yading@10 6662
yading@10 6663 =item B<col_interleaved_lr>
yading@10 6664
yading@10 6665 Both views are arranged in a column based interleaving manner, Left-eye view is first column
yading@10 6666
yading@10 6667 =item B<anaglyph_cyan_red>
yading@10 6668
yading@10 6669 All frames are in anaglyph format viewable through red-cyan filters
yading@10 6670
yading@10 6671 =item B<right_left>
yading@10 6672
yading@10 6673 Both views are arranged side by side, Right-eye view is on the left
yading@10 6674
yading@10 6675 =item B<anaglyph_green_magenta>
yading@10 6676
yading@10 6677 All frames are in anaglyph format viewable through green-magenta filters
yading@10 6678
yading@10 6679 =item B<block_lr>
yading@10 6680
yading@10 6681 Both eyes laced in one Block, Left-eye view is first
yading@10 6682
yading@10 6683 =item B<block_rl>
yading@10 6684
yading@10 6685 Both eyes laced in one Block, Right-eye view is first
yading@10 6686
yading@10 6687 =back
yading@10 6688
yading@10 6689
yading@10 6690 =back
yading@10 6691
yading@10 6692
yading@10 6693 For example a 3D WebM clip can be created using the following command line:
yading@10 6694
yading@10 6695 ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
yading@10 6696
yading@10 6697
yading@10 6698
yading@10 6699 =head2 segment, stream_segment, ssegment
yading@10 6700
yading@10 6701
yading@10 6702 Basic stream segmenter.
yading@10 6703
yading@10 6704 The segmenter muxer outputs streams to a number of separate files of nearly
yading@10 6705 fixed duration. Output filename pattern can be set in a fashion similar to
yading@10 6706 image2.
yading@10 6707
yading@10 6708 C<stream_segment> is a variant of the muxer used to write to
yading@10 6709 streaming output formats, i.e. which do not require global headers,
yading@10 6710 and is recommended for outputting e.g. to MPEG transport stream segments.
yading@10 6711 C<ssegment> is a shorter alias for C<stream_segment>.
yading@10 6712
yading@10 6713 Every segment starts with a keyframe of the selected reference stream,
yading@10 6714 which is set through the B<reference_stream> option.
yading@10 6715
yading@10 6716 Note that if you want accurate splitting for a video file, you need to
yading@10 6717 make the input key frames correspond to the exact splitting times
yading@10 6718 expected by the segmenter, or the segment muxer will start the new
yading@10 6719 segment with the key frame found next after the specified start
yading@10 6720 time.
yading@10 6721
yading@10 6722 The segment muxer works best with a single constant frame rate video.
yading@10 6723
yading@10 6724 Optionally it can generate a list of the created segments, by setting
yading@10 6725 the option I<segment_list>. The list type is specified by the
yading@10 6726 I<segment_list_type> option.
yading@10 6727
yading@10 6728 The segment muxer supports the following options:
yading@10 6729
yading@10 6730
yading@10 6731 =over 4
yading@10 6732
yading@10 6733
yading@10 6734 =item B<reference_stream> I<specifier>
yading@10 6735
yading@10 6736 Set the reference stream, as specified by the string I<specifier>.
yading@10 6737 If I<specifier> is set to C<auto>, the reference is choosen
yading@10 6738 automatically. Otherwise it must be a stream specifier (see the ``Stream
yading@10 6739 specifiers'' chapter in the ffmpeg manual) which specifies the
yading@10 6740 reference stream. The default value is ``auto''.
yading@10 6741
yading@10 6742
yading@10 6743 =item B<segment_format> I<format>
yading@10 6744
yading@10 6745 Override the inner container format, by default it is guessed by the filename
yading@10 6746 extension.
yading@10 6747
yading@10 6748
yading@10 6749 =item B<segment_list> I<name>
yading@10 6750
yading@10 6751 Generate also a listfile named I<name>. If not specified no
yading@10 6752 listfile is generated.
yading@10 6753
yading@10 6754
yading@10 6755 =item B<segment_list_flags> I<flags>
yading@10 6756
yading@10 6757 Set flags affecting the segment list generation.
yading@10 6758
yading@10 6759 It currently supports the following flags:
yading@10 6760
yading@10 6761 =over 4
yading@10 6762
yading@10 6763
yading@10 6764 =item I<cache>
yading@10 6765
yading@10 6766 Allow caching (only affects M3U8 list files).
yading@10 6767
yading@10 6768
yading@10 6769 =item I<live>
yading@10 6770
yading@10 6771 Allow live-friendly file generation.
yading@10 6772
yading@10 6773 =back
yading@10 6774
yading@10 6775
yading@10 6776 Default value is C<cache>.
yading@10 6777
yading@10 6778
yading@10 6779 =item B<segment_list_size> I<size>
yading@10 6780
yading@10 6781 Update the list file so that it contains at most the last I<size>
yading@10 6782 segments. If 0 the list file will contain all the segments. Default
yading@10 6783 value is 0.
yading@10 6784
yading@10 6785
yading@10 6786 =item B<segment_list type> I<type>
yading@10 6787
yading@10 6788 Specify the format for the segment list file.
yading@10 6789
yading@10 6790 The following values are recognized:
yading@10 6791
yading@10 6792 =over 4
yading@10 6793
yading@10 6794
yading@10 6795 =item B<flat>
yading@10 6796
yading@10 6797 Generate a flat list for the created segments, one segment per line.
yading@10 6798
yading@10 6799
yading@10 6800 =item B<csv, ext>
yading@10 6801
yading@10 6802 Generate a list for the created segments, one segment per line,
yading@10 6803 each line matching the format (comma-separated values):
yading@10 6804
yading@10 6805 <segment_filename>,<segment_start_time>,<segment_end_time>
yading@10 6806
yading@10 6807
yading@10 6808 I<segment_filename> is the name of the output file generated by the
yading@10 6809 muxer according to the provided pattern. CSV escaping (according to
yading@10 6810 RFC4180) is applied if required.
yading@10 6811
yading@10 6812 I<segment_start_time> and I<segment_end_time> specify
yading@10 6813 the segment start and end time expressed in seconds.
yading@10 6814
yading@10 6815 A list file with the suffix C<".csv"> or C<".ext"> will
yading@10 6816 auto-select this format.
yading@10 6817
yading@10 6818 C<ext> is deprecated in favor or C<csv>.
yading@10 6819
yading@10 6820
yading@10 6821 =item B<ffconcat>
yading@10 6822
yading@10 6823 Generate an ffconcat file for the created segments. The resulting file
yading@10 6824 can be read using the FFmpeg concat demuxer.
yading@10 6825
yading@10 6826 A list file with the suffix C<".ffcat"> or C<".ffconcat"> will
yading@10 6827 auto-select this format.
yading@10 6828
yading@10 6829
yading@10 6830 =item B<m3u8>
yading@10 6831
yading@10 6832 Generate an extended M3U8 file, version 3, compliant with
yading@10 6833 E<lt>B<http://tools.ietf.org/id/draft-pantos-http-live-streaming>E<gt>.
yading@10 6834
yading@10 6835 A list file with the suffix C<".m3u8"> will auto-select this format.
yading@10 6836
yading@10 6837 =back
yading@10 6838
yading@10 6839
yading@10 6840 If not specified the type is guessed from the list file name suffix.
yading@10 6841
yading@10 6842
yading@10 6843 =item B<segment_time> I<time>
yading@10 6844
yading@10 6845 Set segment duration to I<time>, the value must be a duration
yading@10 6846 specification. Default value is "2". See also the
yading@10 6847 B<segment_times> option.
yading@10 6848
yading@10 6849 Note that splitting may not be accurate, unless you force the
yading@10 6850 reference stream key-frames at the given time. See the introductory
yading@10 6851 notice and the examples below.
yading@10 6852
yading@10 6853
yading@10 6854 =item B<segment_time_delta> I<delta>
yading@10 6855
yading@10 6856 Specify the accuracy time when selecting the start time for a
yading@10 6857 segment, expressed as a duration specification. Default value is "0".
yading@10 6858
yading@10 6859 When delta is specified a key-frame will start a new segment if its
yading@10 6860 PTS satisfies the relation:
yading@10 6861
yading@10 6862 PTS >= start_time - time_delta
yading@10 6863
yading@10 6864
yading@10 6865 This option is useful when splitting video content, which is always
yading@10 6866 split at GOP boundaries, in case a key frame is found just before the
yading@10 6867 specified split time.
yading@10 6868
yading@10 6869 In particular may be used in combination with the F<ffmpeg> option
yading@10 6870 I<force_key_frames>. The key frame times specified by
yading@10 6871 I<force_key_frames> may not be set accurately because of rounding
yading@10 6872 issues, with the consequence that a key frame time may result set just
yading@10 6873 before the specified time. For constant frame rate videos a value of
yading@10 6874 1/2*I<frame_rate> should address the worst case mismatch between
yading@10 6875 the specified time and the time set by I<force_key_frames>.
yading@10 6876
yading@10 6877
yading@10 6878 =item B<segment_times> I<times>
yading@10 6879
yading@10 6880 Specify a list of split points. I<times> contains a list of comma
yading@10 6881 separated duration specifications, in increasing order. See also
yading@10 6882 the B<segment_time> option.
yading@10 6883
yading@10 6884
yading@10 6885 =item B<segment_frames> I<frames>
yading@10 6886
yading@10 6887 Specify a list of split video frame numbers. I<frames> contains a
yading@10 6888 list of comma separated integer numbers, in increasing order.
yading@10 6889
yading@10 6890 This option specifies to start a new segment whenever a reference
yading@10 6891 stream key frame is found and the sequential number (starting from 0)
yading@10 6892 of the frame is greater or equal to the next value in the list.
yading@10 6893
yading@10 6894
yading@10 6895 =item B<segment_wrap> I<limit>
yading@10 6896
yading@10 6897 Wrap around segment index once it reaches I<limit>.
yading@10 6898
yading@10 6899
yading@10 6900 =item B<segment_start_number> I<number>
yading@10 6901
yading@10 6902 Set the sequence number of the first segment. Defaults to C<0>.
yading@10 6903
yading@10 6904
yading@10 6905 =item B<reset_timestamps> I<1|0>
yading@10 6906
yading@10 6907 Reset timestamps at the begin of each segment, so that each segment
yading@10 6908 will start with near-zero timestamps. It is meant to ease the playback
yading@10 6909 of the generated segments. May not work with some combinations of
yading@10 6910 muxers/codecs. It is set to C<0> by default.
yading@10 6911
yading@10 6912 =back
yading@10 6913
yading@10 6914
yading@10 6915
yading@10 6916 =head3 Examples
yading@10 6917
yading@10 6918
yading@10 6919
yading@10 6920 =over 4
yading@10 6921
yading@10 6922
yading@10 6923 =item *
yading@10 6924
yading@10 6925 To remux the content of file F<in.mkv> to a list of segments
yading@10 6926 F<out-000.nut>, F<out-001.nut>, etc., and write the list of
yading@10 6927 generated segments to F<out.list>:
yading@10 6928
yading@10 6929 ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.list out%03d.nut
yading@10 6930
yading@10 6931
yading@10 6932
yading@10 6933 =item *
yading@10 6934
yading@10 6935 As the example above, but segment the input file according to the split
yading@10 6936 points specified by the I<segment_times> option:
yading@10 6937
yading@10 6938 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 6939
yading@10 6940
yading@10 6941
yading@10 6942 =item *
yading@10 6943
yading@10 6944 As the example above, but use the C<ffmpeg> I<force_key_frames>
yading@10 6945 option to force key frames in the input at the specified location, together
yading@10 6946 with the segment option I<segment_time_delta> to account for
yading@10 6947 possible roundings operated when setting key frame times.
yading@10 6948
yading@10 6949 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 6950 -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 6951
yading@10 6952 In order to force key frames on the input file, transcoding is
yading@10 6953 required.
yading@10 6954
yading@10 6955
yading@10 6956 =item *
yading@10 6957
yading@10 6958 Segment the input file by splitting the input file according to the
yading@10 6959 frame numbers sequence specified with the I<segment_frames> option:
yading@10 6960
yading@10 6961 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 6962
yading@10 6963
yading@10 6964
yading@10 6965 =item *
yading@10 6966
yading@10 6967 To convert the F<in.mkv> to TS segments using the C<libx264>
yading@10 6968 and C<libfaac> encoders:
yading@10 6969
yading@10 6970 ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a libfaac -f ssegment -segment_list out.list out%03d.ts
yading@10 6971
yading@10 6972
yading@10 6973
yading@10 6974 =item *
yading@10 6975
yading@10 6976 Segment the input file, and create an M3U8 live playlist (can be used
yading@10 6977 as live HLS source):
yading@10 6978
yading@10 6979 ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
yading@10 6980 -segment_list_flags +live -segment_time 10 out%03d.mkv
yading@10 6981
yading@10 6982
yading@10 6983 =back
yading@10 6984
yading@10 6985
yading@10 6986
yading@10 6987 =head2 mp3
yading@10 6988
yading@10 6989
yading@10 6990 The MP3 muxer writes a raw MP3 stream with an ID3v2 header at the beginning and
yading@10 6991 optionally an ID3v1 tag at the end. ID3v2.3 and ID3v2.4 are supported, the
yading@10 6992 C<id3v2_version> option controls which one is used. The legacy ID3v1 tag is
yading@10 6993 not written by default, but may be enabled with the C<write_id3v1> option.
yading@10 6994
yading@10 6995 For seekable output the muxer also writes a Xing frame at the beginning, which
yading@10 6996 contains the number of frames in the file. It is useful for computing duration
yading@10 6997 of VBR files.
yading@10 6998
yading@10 6999 The muxer supports writing ID3v2 attached pictures (APIC frames). The pictures
yading@10 7000 are supplied to the muxer in form of a video stream with a single packet. There
yading@10 7001 can be any number of those streams, each will correspond to a single APIC frame.
yading@10 7002 The stream metadata tags I<title> and I<comment> map to APIC
yading@10 7003 I<description> and I<picture type> respectively. See
yading@10 7004 E<lt>B<http://id3.org/id3v2.4.0-frames>E<gt> for allowed picture types.
yading@10 7005
yading@10 7006 Note that the APIC frames must be written at the beginning, so the muxer will
yading@10 7007 buffer the audio frames until it gets all the pictures. It is therefore advised
yading@10 7008 to provide the pictures as soon as possible to avoid excessive buffering.
yading@10 7009
yading@10 7010 Examples:
yading@10 7011
yading@10 7012 Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
yading@10 7013
yading@10 7014 ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
yading@10 7015
yading@10 7016
yading@10 7017 To attach a picture to an mp3 file select both the audio and the picture stream
yading@10 7018 with C<map>:
yading@10 7019
yading@10 7020 ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
yading@10 7021 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
yading@10 7022
yading@10 7023
yading@10 7024
yading@10 7025 =head2 ogg
yading@10 7026
yading@10 7027
yading@10 7028 Ogg container muxer.
yading@10 7029
yading@10 7030
yading@10 7031 =over 4
yading@10 7032
yading@10 7033
yading@10 7034 =item B<-page_duration> I<duration>
yading@10 7035
yading@10 7036 Preferred page duration, in microseconds. The muxer will attempt to create
yading@10 7037 pages that are approximately I<duration> microseconds long. This allows the
yading@10 7038 user to compromise between seek granularity and container overhead. The default
yading@10 7039 is 1 second. A value of 0 will fill all segments, making pages as large as
yading@10 7040 possible. A value of 1 will effectively use 1 packet-per-page in most
yading@10 7041 situations, giving a small seek granularity at the cost of additional container
yading@10 7042 overhead.
yading@10 7043
yading@10 7044 =back
yading@10 7045
yading@10 7046
yading@10 7047
yading@10 7048 =head2 tee
yading@10 7049
yading@10 7050
yading@10 7051 The tee muxer can be used to write the same data to several files or any
yading@10 7052 other kind of muxer. It can be used, for example, to both stream a video to
yading@10 7053 the network and save it to disk at the same time.
yading@10 7054
yading@10 7055 It is different from specifying several outputs to the B<ffmpeg>
yading@10 7056 command-line tool because the audio and video data will be encoded only once
yading@10 7057 with the tee muxer; encoding can be a very expensive process. It is not
yading@10 7058 useful when using the libavformat API directly because it is then possible
yading@10 7059 to feed the same packets to several muxers directly.
yading@10 7060
yading@10 7061 The slave outputs are specified in the file name given to the muxer,
yading@10 7062 separated by '|'. If any of the slave name contains the '|' separator,
yading@10 7063 leading or trailing spaces or any special character, it must be
yading@10 7064 escaped (see the ``Quoting and escaping'' section in the ffmpeg-utils
yading@10 7065 manual).
yading@10 7066
yading@10 7067 Options can be specified for each slave by prepending them as a list of
yading@10 7068 I<key>=I<value> pairs separated by ':', between square brackets. If
yading@10 7069 the options values contain a special character or the ':' separator, they
yading@10 7070 must be escaped; note that this is a second level escaping.
yading@10 7071
yading@10 7072 Example: encode something and both archive it in a WebM file and stream it
yading@10 7073 as MPEG-TS over UDP (the streams need to be explicitly mapped):
yading@10 7074
yading@10 7075
yading@10 7076 ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
yading@10 7077 "archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
yading@10 7078
yading@10 7079
yading@10 7080 Note: some codecs may need different options depending on the output format;
yading@10 7081 the auto-detection of this can not work with the tee muxer. The main example
yading@10 7082 is the B<global_header> flag.
yading@10 7083
yading@10 7084
yading@10 7085 =head1 METADATA
yading@10 7086
yading@10 7087
yading@10 7088 FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
yading@10 7089 INI-like text file and then load it back using the metadata muxer/demuxer.
yading@10 7090
yading@10 7091 The file format is as follows:
yading@10 7092
yading@10 7093 =over 4
yading@10 7094
yading@10 7095
yading@10 7096
yading@10 7097 =item 1.
yading@10 7098
yading@10 7099 A file consists of a header and a number of metadata tags divided into sections,
yading@10 7100 each on its own line.
yading@10 7101
yading@10 7102
yading@10 7103 =item 2.
yading@10 7104
yading@10 7105 The header is a ';FFMETADATA' string, followed by a version number (now 1).
yading@10 7106
yading@10 7107
yading@10 7108 =item 3.
yading@10 7109
yading@10 7110 Metadata tags are of the form 'key=value'
yading@10 7111
yading@10 7112
yading@10 7113 =item 4.
yading@10 7114
yading@10 7115 Immediately after header follows global metadata
yading@10 7116
yading@10 7117
yading@10 7118 =item 5.
yading@10 7119
yading@10 7120 After global metadata there may be sections with per-stream/per-chapter
yading@10 7121 metadata.
yading@10 7122
yading@10 7123
yading@10 7124 =item 6.
yading@10 7125
yading@10 7126 A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
yading@10 7127 brackets ('[', ']') and ends with next section or end of file.
yading@10 7128
yading@10 7129
yading@10 7130 =item 7.
yading@10 7131
yading@10 7132 At the beginning of a chapter section there may be an optional timebase to be
yading@10 7133 used for start/end values. It must be in form 'TIMEBASE=num/den', where num and
yading@10 7134 den are integers. If the timebase is missing then start/end times are assumed to
yading@10 7135 be in milliseconds.
yading@10 7136 Next a chapter section must contain chapter start and end times in form
yading@10 7137 'START=num', 'END=num', where num is a positive integer.
yading@10 7138
yading@10 7139
yading@10 7140 =item 8.
yading@10 7141
yading@10 7142 Empty lines and lines starting with ';' or '#' are ignored.
yading@10 7143
yading@10 7144
yading@10 7145 =item 9.
yading@10 7146
yading@10 7147 Metadata keys or values containing special characters ('=', ';', '#', '\' and a
yading@10 7148 newline) must be escaped with a backslash '\'.
yading@10 7149
yading@10 7150
yading@10 7151 =item 10.
yading@10 7152
yading@10 7153 Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of
yading@10 7154 the tag (in the example above key is 'foo ', value is ' bar').
yading@10 7155
yading@10 7156 =back
yading@10 7157
yading@10 7158
yading@10 7159 A ffmetadata file might look like this:
yading@10 7160
yading@10 7161 ;FFMETADATA1
yading@10 7162 title=bike\\shed
yading@10 7163 ;this is a comment
yading@10 7164 artist=FFmpeg troll team
yading@10 7165
yading@10 7166 [CHAPTER]
yading@10 7167 TIMEBASE=1/1000
yading@10 7168 START=0
yading@10 7169 #chapter ends at 0:01:00
yading@10 7170 END=60000
yading@10 7171 title=chapter \#1
yading@10 7172 [STREAM]
yading@10 7173 title=multi\
yading@10 7174 line
yading@10 7175
yading@10 7176
yading@10 7177 =head1 PROTOCOLS
yading@10 7178
yading@10 7179
yading@10 7180 Protocols are configured elements in FFmpeg which allow to access
yading@10 7181 resources which require the use of a particular protocol.
yading@10 7182
yading@10 7183 When you configure your FFmpeg build, all the supported protocols are
yading@10 7184 enabled by default. You can list all available ones using the
yading@10 7185 configure option "--list-protocols".
yading@10 7186
yading@10 7187 You can disable all the protocols using the configure option
yading@10 7188 "--disable-protocols", and selectively enable a protocol using the
yading@10 7189 option "--enable-protocol=I<PROTOCOL>", or you can disable a
yading@10 7190 particular protocol using the option
yading@10 7191 "--disable-protocol=I<PROTOCOL>".
yading@10 7192
yading@10 7193 The option "-protocols" of the ff* tools will display the list of
yading@10 7194 supported protocols.
yading@10 7195
yading@10 7196 A description of the currently available protocols follows.
yading@10 7197
yading@10 7198
yading@10 7199 =head2 bluray
yading@10 7200
yading@10 7201
yading@10 7202 Read BluRay playlist.
yading@10 7203
yading@10 7204 The accepted options are:
yading@10 7205
yading@10 7206 =over 4
yading@10 7207
yading@10 7208
yading@10 7209
yading@10 7210 =item B<angle>
yading@10 7211
yading@10 7212 BluRay angle
yading@10 7213
yading@10 7214
yading@10 7215 =item B<chapter>
yading@10 7216
yading@10 7217 Start chapter (1...N)
yading@10 7218
yading@10 7219
yading@10 7220 =item B<playlist>
yading@10 7221
yading@10 7222 Playlist to read (BDMV/PLAYLIST/?????.mpls)
yading@10 7223
yading@10 7224
yading@10 7225 =back
yading@10 7226
yading@10 7227
yading@10 7228 Examples:
yading@10 7229
yading@10 7230 Read longest playlist from BluRay mounted to /mnt/bluray:
yading@10 7231
yading@10 7232 bluray:/mnt/bluray
yading@10 7233
yading@10 7234
yading@10 7235 Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
yading@10 7236
yading@10 7237 -playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
yading@10 7238
yading@10 7239
yading@10 7240
yading@10 7241 =head2 concat
yading@10 7242
yading@10 7243
yading@10 7244 Physical concatenation protocol.
yading@10 7245
yading@10 7246 Allow to read and seek from many resource in sequence as if they were
yading@10 7247 a unique resource.
yading@10 7248
yading@10 7249 A URL accepted by this protocol has the syntax:
yading@10 7250
yading@10 7251 concat:<URL1>|<URL2>|...|<URLN>
yading@10 7252
yading@10 7253
yading@10 7254 where I<URL1>, I<URL2>, ..., I<URLN> are the urls of the
yading@10 7255 resource to be concatenated, each one possibly specifying a distinct
yading@10 7256 protocol.
yading@10 7257
yading@10 7258 For example to read a sequence of files F<split1.mpeg>,
yading@10 7259 F<split2.mpeg>, F<split3.mpeg> with B<ffplay> use the
yading@10 7260 command:
yading@10 7261
yading@10 7262 ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
yading@10 7263
yading@10 7264
yading@10 7265 Note that you may need to escape the character "|" which is special for
yading@10 7266 many shells.
yading@10 7267
yading@10 7268
yading@10 7269 =head2 data
yading@10 7270
yading@10 7271
yading@10 7272 Data in-line in the URI. See E<lt>B<http://en.wikipedia.org/wiki/Data_URI_scheme>E<gt>.
yading@10 7273
yading@10 7274 For example, to convert a GIF file given inline with B<ffmpeg>:
yading@10 7275
yading@10 7276 ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png
yading@10 7277
yading@10 7278
yading@10 7279
yading@10 7280 =head2 file
yading@10 7281
yading@10 7282
yading@10 7283 File access protocol.
yading@10 7284
yading@10 7285 Allow to read from or read to a file.
yading@10 7286
yading@10 7287 For example to read from a file F<input.mpeg> with B<ffmpeg>
yading@10 7288 use the command:
yading@10 7289
yading@10 7290 ffmpeg -i file:input.mpeg output.mpeg
yading@10 7291
yading@10 7292
yading@10 7293 The ff* tools default to the file protocol, that is a resource
yading@10 7294 specified with the name "FILE.mpeg" is interpreted as the URL
yading@10 7295 "file:FILE.mpeg".
yading@10 7296
yading@10 7297
yading@10 7298 =head2 gopher
yading@10 7299
yading@10 7300
yading@10 7301 Gopher protocol.
yading@10 7302
yading@10 7303
yading@10 7304 =head2 hls
yading@10 7305
yading@10 7306
yading@10 7307 Read Apple HTTP Live Streaming compliant segmented stream as
yading@10 7308 a uniform one. The M3U8 playlists describing the segments can be
yading@10 7309 remote HTTP resources or local files, accessed using the standard
yading@10 7310 file protocol.
yading@10 7311 The nested protocol is declared by specifying
yading@10 7312 "+I<proto>" after the hls URI scheme name, where I<proto>
yading@10 7313 is either "file" or "http".
yading@10 7314
yading@10 7315
yading@10 7316 hls+http://host/path/to/remote/resource.m3u8
yading@10 7317 hls+file://path/to/local/resource.m3u8
yading@10 7318
yading@10 7319
yading@10 7320 Using this protocol is discouraged - the hls demuxer should work
yading@10 7321 just as well (if not, please report the issues) and is more complete.
yading@10 7322 To use the hls demuxer instead, simply use the direct URLs to the
yading@10 7323 m3u8 files.
yading@10 7324
yading@10 7325
yading@10 7326 =head2 http
yading@10 7327
yading@10 7328
yading@10 7329 HTTP (Hyper Text Transfer Protocol).
yading@10 7330
yading@10 7331 This protocol accepts the following options.
yading@10 7332
yading@10 7333
yading@10 7334 =over 4
yading@10 7335
yading@10 7336
yading@10 7337 =item B<seekable>
yading@10 7338
yading@10 7339 Control seekability of connection. If set to 1 the resource is
yading@10 7340 supposed to be seekable, if set to 0 it is assumed not to be seekable,
yading@10 7341 if set to -1 it will try to autodetect if it is seekable. Default
yading@10 7342 value is -1.
yading@10 7343
yading@10 7344
yading@10 7345 =item B<chunked_post>
yading@10 7346
yading@10 7347 If set to 1 use chunked transfer-encoding for posts, default is 1.
yading@10 7348
yading@10 7349
yading@10 7350 =item B<headers>
yading@10 7351
yading@10 7352 Set custom HTTP headers, can override built in default headers. The
yading@10 7353 value must be a string encoding the headers.
yading@10 7354
yading@10 7355
yading@10 7356 =item B<content_type>
yading@10 7357
yading@10 7358 Force a content type.
yading@10 7359
yading@10 7360
yading@10 7361 =item B<user-agent>
yading@10 7362
yading@10 7363 Override User-Agent header. If not specified the protocol will use a
yading@10 7364 string describing the libavformat build.
yading@10 7365
yading@10 7366
yading@10 7367 =item B<multiple_requests>
yading@10 7368
yading@10 7369 Use persistent connections if set to 1. By default it is 0.
yading@10 7370
yading@10 7371
yading@10 7372 =item B<post_data>
yading@10 7373
yading@10 7374 Set custom HTTP post data.
yading@10 7375
yading@10 7376
yading@10 7377 =item B<timeout>
yading@10 7378
yading@10 7379 Set timeout of socket I/O operations used by the underlying low level
yading@10 7380 operation. By default it is set to -1, which means that the timeout is
yading@10 7381 not specified.
yading@10 7382
yading@10 7383
yading@10 7384 =item B<mime_type>
yading@10 7385
yading@10 7386 Set MIME type.
yading@10 7387
yading@10 7388
yading@10 7389 =item B<cookies>
yading@10 7390
yading@10 7391 Set the cookies to be sent in future requests. The format of each cookie is the
yading@10 7392 same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
yading@10 7393 delimited by a newline character.
yading@10 7394
yading@10 7395 =back
yading@10 7396
yading@10 7397
yading@10 7398
yading@10 7399 =head3 HTTP Cookies
yading@10 7400
yading@10 7401
yading@10 7402 Some HTTP requests will be denied unless cookie values are passed in with the
yading@10 7403 request. The B<cookies> option allows these cookies to be specified. At
yading@10 7404 the very least, each cookie must specify a value along with a path and domain.
yading@10 7405 HTTP requests that match both the domain and path will automatically include the
yading@10 7406 cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
yading@10 7407 by a newline.
yading@10 7408
yading@10 7409 The required syntax to play a stream specifying a cookie is:
yading@10 7410
yading@10 7411 ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
yading@10 7412
yading@10 7413
yading@10 7414
yading@10 7415 =head2 mmst
yading@10 7416
yading@10 7417
yading@10 7418 MMS (Microsoft Media Server) protocol over TCP.
yading@10 7419
yading@10 7420
yading@10 7421 =head2 mmsh
yading@10 7422
yading@10 7423
yading@10 7424 MMS (Microsoft Media Server) protocol over HTTP.
yading@10 7425
yading@10 7426 The required syntax is:
yading@10 7427
yading@10 7428 mmsh://<server>[:<port>][/<app>][/<playpath>]
yading@10 7429
yading@10 7430
yading@10 7431
yading@10 7432 =head2 md5
yading@10 7433
yading@10 7434
yading@10 7435 MD5 output protocol.
yading@10 7436
yading@10 7437 Computes the MD5 hash of the data to be written, and on close writes
yading@10 7438 this to the designated output or stdout if none is specified. It can
yading@10 7439 be used to test muxers without writing an actual file.
yading@10 7440
yading@10 7441 Some examples follow.
yading@10 7442
yading@10 7443 # Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
yading@10 7444 ffmpeg -i input.flv -f avi -y md5:output.avi.md5
yading@10 7445
yading@10 7446 # Write the MD5 hash of the encoded AVI file to stdout.
yading@10 7447 ffmpeg -i input.flv -f avi -y md5:
yading@10 7448
yading@10 7449
yading@10 7450 Note that some formats (typically MOV) require the output protocol to
yading@10 7451 be seekable, so they will fail with the MD5 output protocol.
yading@10 7452
yading@10 7453
yading@10 7454 =head2 pipe
yading@10 7455
yading@10 7456
yading@10 7457 UNIX pipe access protocol.
yading@10 7458
yading@10 7459 Allow to read and write from UNIX pipes.
yading@10 7460
yading@10 7461 The accepted syntax is:
yading@10 7462
yading@10 7463 pipe:[<number>]
yading@10 7464
yading@10 7465
yading@10 7466 I<number> is the number corresponding to the file descriptor of the
yading@10 7467 pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If I<number>
yading@10 7468 is not specified, by default the stdout file descriptor will be used
yading@10 7469 for writing, stdin for reading.
yading@10 7470
yading@10 7471 For example to read from stdin with B<ffmpeg>:
yading@10 7472
yading@10 7473 cat test.wav | ffmpeg -i pipe:0
yading@10 7474 # ...this is the same as...
yading@10 7475 cat test.wav | ffmpeg -i pipe:
yading@10 7476
yading@10 7477
yading@10 7478 For writing to stdout with B<ffmpeg>:
yading@10 7479
yading@10 7480 ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
yading@10 7481 # ...this is the same as...
yading@10 7482 ffmpeg -i test.wav -f avi pipe: | cat > test.avi
yading@10 7483
yading@10 7484
yading@10 7485 Note that some formats (typically MOV), require the output protocol to
yading@10 7486 be seekable, so they will fail with the pipe output protocol.
yading@10 7487
yading@10 7488
yading@10 7489 =head2 rtmp
yading@10 7490
yading@10 7491
yading@10 7492 Real-Time Messaging Protocol.
yading@10 7493
yading@10 7494 The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
yading@10 7495 content across a TCP/IP network.
yading@10 7496
yading@10 7497 The required syntax is:
yading@10 7498
yading@10 7499 rtmp://<server>[:<port>][/<app>][/<instance>][/<playpath>]
yading@10 7500
yading@10 7501
yading@10 7502 The accepted parameters are:
yading@10 7503
yading@10 7504 =over 4
yading@10 7505
yading@10 7506
yading@10 7507
yading@10 7508 =item B<server>
yading@10 7509
yading@10 7510 The address of the RTMP server.
yading@10 7511
yading@10 7512
yading@10 7513 =item B<port>
yading@10 7514
yading@10 7515 The number of the TCP port to use (by default is 1935).
yading@10 7516
yading@10 7517
yading@10 7518 =item B<app>
yading@10 7519
yading@10 7520 It is the name of the application to access. It usually corresponds to
yading@10 7521 the path where the application is installed on the RTMP server
yading@10 7522 (e.g. F</ondemand/>, F</flash/live/>, etc.). You can override
yading@10 7523 the value parsed from the URI through the C<rtmp_app> option, too.
yading@10 7524
yading@10 7525
yading@10 7526 =item B<playpath>
yading@10 7527
yading@10 7528 It is the path or name of the resource to play with reference to the
yading@10 7529 application specified in I<app>, may be prefixed by "mp4:". You
yading@10 7530 can override the value parsed from the URI through the C<rtmp_playpath>
yading@10 7531 option, too.
yading@10 7532
yading@10 7533
yading@10 7534 =item B<listen>
yading@10 7535
yading@10 7536 Act as a server, listening for an incoming connection.
yading@10 7537
yading@10 7538
yading@10 7539 =item B<timeout>
yading@10 7540
yading@10 7541 Maximum time to wait for the incoming connection. Implies listen.
yading@10 7542
yading@10 7543 =back
yading@10 7544
yading@10 7545
yading@10 7546 Additionally, the following parameters can be set via command line options
yading@10 7547 (or in code via C<AVOption>s):
yading@10 7548
yading@10 7549 =over 4
yading@10 7550
yading@10 7551
yading@10 7552
yading@10 7553 =item B<rtmp_app>
yading@10 7554
yading@10 7555 Name of application to connect on the RTMP server. This option
yading@10 7556 overrides the parameter specified in the URI.
yading@10 7557
yading@10 7558
yading@10 7559 =item B<rtmp_buffer>
yading@10 7560
yading@10 7561 Set the client buffer time in milliseconds. The default is 3000.
yading@10 7562
yading@10 7563
yading@10 7564 =item B<rtmp_conn>
yading@10 7565
yading@10 7566 Extra arbitrary AMF connection parameters, parsed from a string,
yading@10 7567 e.g. like C<B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0>.
yading@10 7568 Each value is prefixed by a single character denoting the type,
yading@10 7569 B for Boolean, N for number, S for string, O for object, or Z for null,
yading@10 7570 followed by a colon. For Booleans the data must be either 0 or 1 for
yading@10 7571 FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or
yading@10 7572 1 to end or begin an object, respectively. Data items in subobjects may
yading@10 7573 be named, by prefixing the type with 'N' and specifying the name before
yading@10 7574 the value (i.e. C<NB:myFlag:1>). This option may be used multiple
yading@10 7575 times to construct arbitrary AMF sequences.
yading@10 7576
yading@10 7577
yading@10 7578 =item B<rtmp_flashver>
yading@10 7579
yading@10 7580 Version of the Flash plugin used to run the SWF player. The default
yading@10 7581 is LNX 9,0,124,2.
yading@10 7582
yading@10 7583
yading@10 7584 =item B<rtmp_flush_interval>
yading@10 7585
yading@10 7586 Number of packets flushed in the same request (RTMPT only). The default
yading@10 7587 is 10.
yading@10 7588
yading@10 7589
yading@10 7590 =item B<rtmp_live>
yading@10 7591
yading@10 7592 Specify that the media is a live stream. No resuming or seeking in
yading@10 7593 live streams is possible. The default value is C<any>, which means the
yading@10 7594 subscriber first tries to play the live stream specified in the
yading@10 7595 playpath. If a live stream of that name is not found, it plays the
yading@10 7596 recorded stream. The other possible values are C<live> and
yading@10 7597 C<recorded>.
yading@10 7598
yading@10 7599
yading@10 7600 =item B<rtmp_pageurl>
yading@10 7601
yading@10 7602 URL of the web page in which the media was embedded. By default no
yading@10 7603 value will be sent.
yading@10 7604
yading@10 7605
yading@10 7606 =item B<rtmp_playpath>
yading@10 7607
yading@10 7608 Stream identifier to play or to publish. This option overrides the
yading@10 7609 parameter specified in the URI.
yading@10 7610
yading@10 7611
yading@10 7612 =item B<rtmp_subscribe>
yading@10 7613
yading@10 7614 Name of live stream to subscribe to. By default no value will be sent.
yading@10 7615 It is only sent if the option is specified or if rtmp_live
yading@10 7616 is set to live.
yading@10 7617
yading@10 7618
yading@10 7619 =item B<rtmp_swfhash>
yading@10 7620
yading@10 7621 SHA256 hash of the decompressed SWF file (32 bytes).
yading@10 7622
yading@10 7623
yading@10 7624 =item B<rtmp_swfsize>
yading@10 7625
yading@10 7626 Size of the decompressed SWF file, required for SWFVerification.
yading@10 7627
yading@10 7628
yading@10 7629 =item B<rtmp_swfurl>
yading@10 7630
yading@10 7631 URL of the SWF player for the media. By default no value will be sent.
yading@10 7632
yading@10 7633
yading@10 7634 =item B<rtmp_swfverify>
yading@10 7635
yading@10 7636 URL to player swf file, compute hash/size automatically.
yading@10 7637
yading@10 7638
yading@10 7639 =item B<rtmp_tcurl>
yading@10 7640
yading@10 7641 URL of the target stream. Defaults to proto://host[:port]/app.
yading@10 7642
yading@10 7643
yading@10 7644 =back
yading@10 7645
yading@10 7646
yading@10 7647 For example to read with B<ffplay> a multimedia resource named
yading@10 7648 "sample" from the application "vod" from an RTMP server "myserver":
yading@10 7649
yading@10 7650 ffplay rtmp://myserver/vod/sample
yading@10 7651
yading@10 7652
yading@10 7653
yading@10 7654 =head2 rtmpe
yading@10 7655
yading@10 7656
yading@10 7657 Encrypted Real-Time Messaging Protocol.
yading@10 7658
yading@10 7659 The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
yading@10 7660 streaming multimedia content within standard cryptographic primitives,
yading@10 7661 consisting of Diffie-Hellman key exchange and HMACSHA256, generating
yading@10 7662 a pair of RC4 keys.
yading@10 7663
yading@10 7664
yading@10 7665 =head2 rtmps
yading@10 7666
yading@10 7667
yading@10 7668 Real-Time Messaging Protocol over a secure SSL connection.
yading@10 7669
yading@10 7670 The Real-Time Messaging Protocol (RTMPS) is used for streaming
yading@10 7671 multimedia content across an encrypted connection.
yading@10 7672
yading@10 7673
yading@10 7674 =head2 rtmpt
yading@10 7675
yading@10 7676
yading@10 7677 Real-Time Messaging Protocol tunneled through HTTP.
yading@10 7678
yading@10 7679 The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
yading@10 7680 for streaming multimedia content within HTTP requests to traverse
yading@10 7681 firewalls.
yading@10 7682
yading@10 7683
yading@10 7684 =head2 rtmpte
yading@10 7685
yading@10 7686
yading@10 7687 Encrypted Real-Time Messaging Protocol tunneled through HTTP.
yading@10 7688
yading@10 7689 The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
yading@10 7690 is used for streaming multimedia content within HTTP requests to traverse
yading@10 7691 firewalls.
yading@10 7692
yading@10 7693
yading@10 7694 =head2 rtmpts
yading@10 7695
yading@10 7696
yading@10 7697 Real-Time Messaging Protocol tunneled through HTTPS.
yading@10 7698
yading@10 7699 The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
yading@10 7700 for streaming multimedia content within HTTPS requests to traverse
yading@10 7701 firewalls.
yading@10 7702
yading@10 7703
yading@10 7704 =head2 rtmp, rtmpe, rtmps, rtmpt, rtmpte
yading@10 7705
yading@10 7706
yading@10 7707 Real-Time Messaging Protocol and its variants supported through
yading@10 7708 librtmp.
yading@10 7709
yading@10 7710 Requires the presence of the librtmp headers and library during
yading@10 7711 configuration. You need to explicitly configure the build with
yading@10 7712 "--enable-librtmp". If enabled this will replace the native RTMP
yading@10 7713 protocol.
yading@10 7714
yading@10 7715 This protocol provides most client functions and a few server
yading@10 7716 functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
yading@10 7717 encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
yading@10 7718 variants of these encrypted types (RTMPTE, RTMPTS).
yading@10 7719
yading@10 7720 The required syntax is:
yading@10 7721
yading@10 7722 <rtmp_proto>://<server>[:<port>][/<app>][/<playpath>] <options>
yading@10 7723
yading@10 7724
yading@10 7725 where I<rtmp_proto> is one of the strings "rtmp", "rtmpt", "rtmpe",
yading@10 7726 "rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and
yading@10 7727 I<server>, I<port>, I<app> and I<playpath> have the same
yading@10 7728 meaning as specified for the RTMP native protocol.
yading@10 7729 I<options> contains a list of space-separated options of the form
yading@10 7730 I<key>=I<val>.
yading@10 7731
yading@10 7732 See the librtmp manual page (man 3 librtmp) for more information.
yading@10 7733
yading@10 7734 For example, to stream a file in real-time to an RTMP server using
yading@10 7735 B<ffmpeg>:
yading@10 7736
yading@10 7737 ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
yading@10 7738
yading@10 7739
yading@10 7740 To play the same stream using B<ffplay>:
yading@10 7741
yading@10 7742 ffplay "rtmp://myserver/live/mystream live=1"
yading@10 7743
yading@10 7744
yading@10 7745
yading@10 7746 =head2 rtp
yading@10 7747
yading@10 7748
yading@10 7749 Real-Time Protocol.
yading@10 7750
yading@10 7751
yading@10 7752 =head2 rtsp
yading@10 7753
yading@10 7754
yading@10 7755 RTSP is not technically a protocol handler in libavformat, it is a demuxer
yading@10 7756 and muxer. The demuxer supports both normal RTSP (with data transferred
yading@10 7757 over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
yading@10 7758 data transferred over RDT).
yading@10 7759
yading@10 7760 The muxer can be used to send a stream using RTSP ANNOUNCE to a server
yading@10 7761 supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's
yading@10 7762 E<lt>B<http://github.com/revmischa/rtsp-server>E<gt>).
yading@10 7763
yading@10 7764 The required syntax for a RTSP url is:
yading@10 7765
yading@10 7766 rtsp://<hostname>[:<port>]/<path>
yading@10 7767
yading@10 7768
yading@10 7769 The following options (set on the B<ffmpeg>/B<ffplay> command
yading@10 7770 line, or set in code via C<AVOption>s or in C<avformat_open_input>),
yading@10 7771 are supported:
yading@10 7772
yading@10 7773 Flags for C<rtsp_transport>:
yading@10 7774
yading@10 7775
yading@10 7776 =over 4
yading@10 7777
yading@10 7778
yading@10 7779
yading@10 7780 =item B<udp>
yading@10 7781
yading@10 7782 Use UDP as lower transport protocol.
yading@10 7783
yading@10 7784
yading@10 7785 =item B<tcp>
yading@10 7786
yading@10 7787 Use TCP (interleaving within the RTSP control channel) as lower
yading@10 7788 transport protocol.
yading@10 7789
yading@10 7790
yading@10 7791 =item B<udp_multicast>
yading@10 7792
yading@10 7793 Use UDP multicast as lower transport protocol.
yading@10 7794
yading@10 7795
yading@10 7796 =item B<http>
yading@10 7797
yading@10 7798 Use HTTP tunneling as lower transport protocol, which is useful for
yading@10 7799 passing proxies.
yading@10 7800
yading@10 7801 =back
yading@10 7802
yading@10 7803
yading@10 7804 Multiple lower transport protocols may be specified, in that case they are
yading@10 7805 tried one at a time (if the setup of one fails, the next one is tried).
yading@10 7806 For the muxer, only the C<tcp> and C<udp> options are supported.
yading@10 7807
yading@10 7808 Flags for C<rtsp_flags>:
yading@10 7809
yading@10 7810
yading@10 7811 =over 4
yading@10 7812
yading@10 7813
yading@10 7814 =item B<filter_src>
yading@10 7815
yading@10 7816 Accept packets only from negotiated peer address and port.
yading@10 7817
yading@10 7818 =item B<listen>
yading@10 7819
yading@10 7820 Act as a server, listening for an incoming connection.
yading@10 7821
yading@10 7822 =back
yading@10 7823
yading@10 7824
yading@10 7825 When receiving data over UDP, the demuxer tries to reorder received packets
yading@10 7826 (since they may arrive out of order, or packets may get lost totally). This
yading@10 7827 can be disabled by setting the maximum demuxing delay to zero (via
yading@10 7828 the C<max_delay> field of AVFormatContext).
yading@10 7829
yading@10 7830 When watching multi-bitrate Real-RTSP streams with B<ffplay>, the
yading@10 7831 streams to display can be chosen with C<-vst> I<n> and
yading@10 7832 C<-ast> I<n> for video and audio respectively, and can be switched
yading@10 7833 on the fly by pressing C<v> and C<a>.
yading@10 7834
yading@10 7835 Example command lines:
yading@10 7836
yading@10 7837 To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
yading@10 7838
yading@10 7839
yading@10 7840 ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
yading@10 7841
yading@10 7842
yading@10 7843 To watch a stream tunneled over HTTP:
yading@10 7844
yading@10 7845
yading@10 7846 ffplay -rtsp_transport http rtsp://server/video.mp4
yading@10 7847
yading@10 7848
yading@10 7849 To send a stream in realtime to a RTSP server, for others to watch:
yading@10 7850
yading@10 7851
yading@10 7852 ffmpeg -re -i <input> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
yading@10 7853
yading@10 7854
yading@10 7855 To receive a stream in realtime:
yading@10 7856
yading@10 7857
yading@10 7858 ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <output>
yading@10 7859
yading@10 7860
yading@10 7861
yading@10 7862 =over 4
yading@10 7863
yading@10 7864
yading@10 7865 =item B<stimeout>
yading@10 7866
yading@10 7867 Socket IO timeout in micro seconds.
yading@10 7868
yading@10 7869 =back
yading@10 7870
yading@10 7871
yading@10 7872
yading@10 7873 =head2 sap
yading@10 7874
yading@10 7875
yading@10 7876 Session Announcement Protocol (RFC 2974). This is not technically a
yading@10 7877 protocol handler in libavformat, it is a muxer and demuxer.
yading@10 7878 It is used for signalling of RTP streams, by announcing the SDP for the
yading@10 7879 streams regularly on a separate port.
yading@10 7880
yading@10 7881
yading@10 7882 =head3 Muxer
yading@10 7883
yading@10 7884
yading@10 7885 The syntax for a SAP url given to the muxer is:
yading@10 7886
yading@10 7887 sap://<destination>[:<port>][?<options>]
yading@10 7888
yading@10 7889
yading@10 7890 The RTP packets are sent to I<destination> on port I<port>,
yading@10 7891 or to port 5004 if no port is specified.
yading@10 7892 I<options> is a C<&>-separated list. The following options
yading@10 7893 are supported:
yading@10 7894
yading@10 7895
yading@10 7896 =over 4
yading@10 7897
yading@10 7898
yading@10 7899
yading@10 7900 =item B<announce_addr=>I<address>
yading@10 7901
yading@10 7902 Specify the destination IP address for sending the announcements to.
yading@10 7903 If omitted, the announcements are sent to the commonly used SAP
yading@10 7904 announcement multicast address 224.2.127.254 (sap.mcast.net), or
yading@10 7905 ff0e::2:7ffe if I<destination> is an IPv6 address.
yading@10 7906
yading@10 7907
yading@10 7908 =item B<announce_port=>I<port>
yading@10 7909
yading@10 7910 Specify the port to send the announcements on, defaults to
yading@10 7911 9875 if not specified.
yading@10 7912
yading@10 7913
yading@10 7914 =item B<ttl=>I<ttl>
yading@10 7915
yading@10 7916 Specify the time to live value for the announcements and RTP packets,
yading@10 7917 defaults to 255.
yading@10 7918
yading@10 7919
yading@10 7920 =item B<same_port=>I<0|1>
yading@10 7921
yading@10 7922 If set to 1, send all RTP streams on the same port pair. If zero (the
yading@10 7923 default), all streams are sent on unique ports, with each stream on a
yading@10 7924 port 2 numbers higher than the previous.
yading@10 7925 VLC/Live555 requires this to be set to 1, to be able to receive the stream.
yading@10 7926 The RTP stack in libavformat for receiving requires all streams to be sent
yading@10 7927 on unique ports.
yading@10 7928
yading@10 7929 =back
yading@10 7930
yading@10 7931
yading@10 7932 Example command lines follow.
yading@10 7933
yading@10 7934 To broadcast a stream on the local subnet, for watching in VLC:
yading@10 7935
yading@10 7936
yading@10 7937 ffmpeg -re -i <input> -f sap sap://224.0.0.255?same_port=1
yading@10 7938
yading@10 7939
yading@10 7940 Similarly, for watching in B<ffplay>:
yading@10 7941
yading@10 7942
yading@10 7943 ffmpeg -re -i <input> -f sap sap://224.0.0.255
yading@10 7944
yading@10 7945
yading@10 7946 And for watching in B<ffplay>, over IPv6:
yading@10 7947
yading@10 7948
yading@10 7949 ffmpeg -re -i <input> -f sap sap://[ff0e::1:2:3:4]
yading@10 7950
yading@10 7951
yading@10 7952
yading@10 7953 =head3 Demuxer
yading@10 7954
yading@10 7955
yading@10 7956 The syntax for a SAP url given to the demuxer is:
yading@10 7957
yading@10 7958 sap://[<address>][:<port>]
yading@10 7959
yading@10 7960
yading@10 7961 I<address> is the multicast address to listen for announcements on,
yading@10 7962 if omitted, the default 224.2.127.254 (sap.mcast.net) is used. I<port>
yading@10 7963 is the port that is listened on, 9875 if omitted.
yading@10 7964
yading@10 7965 The demuxers listens for announcements on the given address and port.
yading@10 7966 Once an announcement is received, it tries to receive that particular stream.
yading@10 7967
yading@10 7968 Example command lines follow.
yading@10 7969
yading@10 7970 To play back the first stream announced on the normal SAP multicast address:
yading@10 7971
yading@10 7972
yading@10 7973 ffplay sap://
yading@10 7974
yading@10 7975
yading@10 7976 To play back the first stream announced on one the default IPv6 SAP multicast address:
yading@10 7977
yading@10 7978
yading@10 7979 ffplay sap://[ff0e::2:7ffe]
yading@10 7980
yading@10 7981
yading@10 7982
yading@10 7983 =head2 tcp
yading@10 7984
yading@10 7985
yading@10 7986 Trasmission Control Protocol.
yading@10 7987
yading@10 7988 The required syntax for a TCP url is:
yading@10 7989
yading@10 7990 tcp://<hostname>:<port>[?<options>]
yading@10 7991
yading@10 7992
yading@10 7993
yading@10 7994 =over 4
yading@10 7995
yading@10 7996
yading@10 7997
yading@10 7998 =item B<listen>
yading@10 7999
yading@10 8000 Listen for an incoming connection
yading@10 8001
yading@10 8002
yading@10 8003 =item B<timeout=>I<microseconds>
yading@10 8004
yading@10 8005 In read mode: if no data arrived in more than this time interval, raise error.
yading@10 8006 In write mode: if socket cannot be written in more than this time interval, raise error.
yading@10 8007 This also sets timeout on TCP connection establishing.
yading@10 8008
yading@10 8009
yading@10 8010 ffmpeg -i <input> -f <format> tcp://<hostname>:<port>?listen
yading@10 8011 ffplay tcp://<hostname>:<port>
yading@10 8012
yading@10 8013
yading@10 8014
yading@10 8015 =back
yading@10 8016
yading@10 8017
yading@10 8018
yading@10 8019 =head2 tls
yading@10 8020
yading@10 8021
yading@10 8022 Transport Layer Security/Secure Sockets Layer
yading@10 8023
yading@10 8024 The required syntax for a TLS/SSL url is:
yading@10 8025
yading@10 8026 tls://<hostname>:<port>[?<options>]
yading@10 8027
yading@10 8028
yading@10 8029
yading@10 8030 =over 4
yading@10 8031
yading@10 8032
yading@10 8033
yading@10 8034 =item B<listen>
yading@10 8035
yading@10 8036 Act as a server, listening for an incoming connection.
yading@10 8037
yading@10 8038
yading@10 8039 =item B<cafile=>I<filename>
yading@10 8040
yading@10 8041 Certificate authority file. The file must be in OpenSSL PEM format.
yading@10 8042
yading@10 8043
yading@10 8044 =item B<cert=>I<filename>
yading@10 8045
yading@10 8046 Certificate file. The file must be in OpenSSL PEM format.
yading@10 8047
yading@10 8048
yading@10 8049 =item B<key=>I<filename>
yading@10 8050
yading@10 8051 Private key file.
yading@10 8052
yading@10 8053
yading@10 8054 =item B<verify=>I<0|1>
yading@10 8055
yading@10 8056 Verify the peer's certificate.
yading@10 8057
yading@10 8058
yading@10 8059 =back
yading@10 8060
yading@10 8061
yading@10 8062 Example command lines:
yading@10 8063
yading@10 8064 To create a TLS/SSL server that serves an input stream.
yading@10 8065
yading@10 8066
yading@10 8067 ffmpeg -i <input> -f <format> tls://<hostname>:<port>?listen&cert=<server.crt>&key=<server.key>
yading@10 8068
yading@10 8069
yading@10 8070 To play back a stream from the TLS/SSL server using B<ffplay>:
yading@10 8071
yading@10 8072
yading@10 8073 ffplay tls://<hostname>:<port>
yading@10 8074
yading@10 8075
yading@10 8076
yading@10 8077 =head2 udp
yading@10 8078
yading@10 8079
yading@10 8080 User Datagram Protocol.
yading@10 8081
yading@10 8082 The required syntax for a UDP url is:
yading@10 8083
yading@10 8084 udp://<hostname>:<port>[?<options>]
yading@10 8085
yading@10 8086
yading@10 8087 I<options> contains a list of &-separated options of the form I<key>=I<val>.
yading@10 8088
yading@10 8089 In case threading is enabled on the system, a circular buffer is used
yading@10 8090 to store the incoming data, which allows to reduce loss of data due to
yading@10 8091 UDP socket buffer overruns. The I<fifo_size> and
yading@10 8092 I<overrun_nonfatal> options are related to this buffer.
yading@10 8093
yading@10 8094 The list of supported options follows.
yading@10 8095
yading@10 8096
yading@10 8097 =over 4
yading@10 8098
yading@10 8099
yading@10 8100
yading@10 8101 =item B<buffer_size=>I<size>
yading@10 8102
yading@10 8103 Set the UDP socket buffer size in bytes. This is used both for the
yading@10 8104 receiving and the sending buffer size.
yading@10 8105
yading@10 8106
yading@10 8107 =item B<localport=>I<port>
yading@10 8108
yading@10 8109 Override the local UDP port to bind with.
yading@10 8110
yading@10 8111
yading@10 8112 =item B<localaddr=>I<addr>
yading@10 8113
yading@10 8114 Choose the local IP address. This is useful e.g. if sending multicast
yading@10 8115 and the host has multiple interfaces, where the user can choose
yading@10 8116 which interface to send on by specifying the IP address of that interface.
yading@10 8117
yading@10 8118
yading@10 8119 =item B<pkt_size=>I<size>
yading@10 8120
yading@10 8121 Set the size in bytes of UDP packets.
yading@10 8122
yading@10 8123
yading@10 8124 =item B<reuse=>I<1|0>
yading@10 8125
yading@10 8126 Explicitly allow or disallow reusing UDP sockets.
yading@10 8127
yading@10 8128
yading@10 8129 =item B<ttl=>I<ttl>
yading@10 8130
yading@10 8131 Set the time to live value (for multicast only).
yading@10 8132
yading@10 8133
yading@10 8134 =item B<connect=>I<1|0>
yading@10 8135
yading@10 8136 Initialize the UDP socket with C<connect()>. In this case, the
yading@10 8137 destination address can't be changed with ff_udp_set_remote_url later.
yading@10 8138 If the destination address isn't known at the start, this option can
yading@10 8139 be specified in ff_udp_set_remote_url, too.
yading@10 8140 This allows finding out the source address for the packets with getsockname,
yading@10 8141 and makes writes return with AVERROR(ECONNREFUSED) if "destination
yading@10 8142 unreachable" is received.
yading@10 8143 For receiving, this gives the benefit of only receiving packets from
yading@10 8144 the specified peer address/port.
yading@10 8145
yading@10 8146
yading@10 8147 =item B<sources=>I<address>B<[,>I<address>B<]>
yading@10 8148
yading@10 8149 Only receive packets sent to the multicast group from one of the
yading@10 8150 specified sender IP addresses.
yading@10 8151
yading@10 8152
yading@10 8153 =item B<block=>I<address>B<[,>I<address>B<]>
yading@10 8154
yading@10 8155 Ignore packets sent to the multicast group from the specified
yading@10 8156 sender IP addresses.
yading@10 8157
yading@10 8158
yading@10 8159 =item B<fifo_size=>I<units>
yading@10 8160
yading@10 8161 Set the UDP receiving circular buffer size, expressed as a number of
yading@10 8162 packets with size of 188 bytes. If not specified defaults to 7*4096.
yading@10 8163
yading@10 8164
yading@10 8165 =item B<overrun_nonfatal=>I<1|0>
yading@10 8166
yading@10 8167 Survive in case of UDP receiving circular buffer overrun. Default
yading@10 8168 value is 0.
yading@10 8169
yading@10 8170
yading@10 8171 =item B<timeout=>I<microseconds>
yading@10 8172
yading@10 8173 In read mode: if no data arrived in more than this time interval, raise error.
yading@10 8174
yading@10 8175 =back
yading@10 8176
yading@10 8177
yading@10 8178 Some usage examples of the UDP protocol with B<ffmpeg> follow.
yading@10 8179
yading@10 8180 To stream over UDP to a remote endpoint:
yading@10 8181
yading@10 8182 ffmpeg -i <input> -f <format> udp://<hostname>:<port>
yading@10 8183
yading@10 8184
yading@10 8185 To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
yading@10 8186
yading@10 8187 ffmpeg -i <input> -f mpegts udp://<hostname>:<port>?pkt_size=188&buffer_size=65535
yading@10 8188
yading@10 8189
yading@10 8190 To receive over UDP from a remote endpoint:
yading@10 8191
yading@10 8192 ffmpeg -i udp://[<multicast-address>]:<port>
yading@10 8193
yading@10 8194
yading@10 8195
yading@10 8196
yading@10 8197 =head1 DEVICE OPTIONS
yading@10 8198
yading@10 8199
yading@10 8200 The libavdevice library provides the same interface as
yading@10 8201 libavformat. Namely, an input device is considered like a demuxer, and
yading@10 8202 an output device like a muxer, and the interface and generic device
yading@10 8203 options are the same provided by libavformat (see the ffmpeg-formats
yading@10 8204 manual).
yading@10 8205
yading@10 8206 In addition each input or output device may support so-called private
yading@10 8207 options, which are specific for that component.
yading@10 8208
yading@10 8209 Options may be set by specifying -I<option> I<value> in the
yading@10 8210 FFmpeg tools, or by setting the value explicitly in the device
yading@10 8211 C<AVFormatContext> options or using the F<libavutil/opt.h> API
yading@10 8212 for programmatic use.
yading@10 8213
yading@10 8214
yading@10 8215
yading@10 8216 =head1 INPUT DEVICES
yading@10 8217
yading@10 8218
yading@10 8219 Input devices are configured elements in FFmpeg which allow to access
yading@10 8220 the data coming from a multimedia device attached to your system.
yading@10 8221
yading@10 8222 When you configure your FFmpeg build, all the supported input devices
yading@10 8223 are enabled by default. You can list all available ones using the
yading@10 8224 configure option "--list-indevs".
yading@10 8225
yading@10 8226 You can disable all the input devices using the configure option
yading@10 8227 "--disable-indevs", and selectively enable an input device using the
yading@10 8228 option "--enable-indev=I<INDEV>", or you can disable a particular
yading@10 8229 input device using the option "--disable-indev=I<INDEV>".
yading@10 8230
yading@10 8231 The option "-formats" of the ff* tools will display the list of
yading@10 8232 supported input devices (amongst the demuxers).
yading@10 8233
yading@10 8234 A description of the currently available input devices follows.
yading@10 8235
yading@10 8236
yading@10 8237 =head2 alsa
yading@10 8238
yading@10 8239
yading@10 8240 ALSA (Advanced Linux Sound Architecture) input device.
yading@10 8241
yading@10 8242 To enable this input device during configuration you need libasound
yading@10 8243 installed on your system.
yading@10 8244
yading@10 8245 This device allows capturing from an ALSA device. The name of the
yading@10 8246 device to capture has to be an ALSA card identifier.
yading@10 8247
yading@10 8248 An ALSA identifier has the syntax:
yading@10 8249
yading@10 8250 hw:<CARD>[,<DEV>[,<SUBDEV>]]
yading@10 8251
yading@10 8252
yading@10 8253 where the I<DEV> and I<SUBDEV> components are optional.
yading@10 8254
yading@10 8255 The three arguments (in order: I<CARD>,I<DEV>,I<SUBDEV>)
yading@10 8256 specify card number or identifier, device number and subdevice number
yading@10 8257 (-1 means any).
yading@10 8258
yading@10 8259 To see the list of cards currently recognized by your system check the
yading@10 8260 files F</proc/asound/cards> and F</proc/asound/devices>.
yading@10 8261
yading@10 8262 For example to capture with B<ffmpeg> from an ALSA device with
yading@10 8263 card id 0, you may run the command:
yading@10 8264
yading@10 8265 ffmpeg -f alsa -i hw:0 alsaout.wav
yading@10 8266
yading@10 8267
yading@10 8268 For more information see:
yading@10 8269 E<lt>B<http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html>E<gt>
yading@10 8270
yading@10 8271
yading@10 8272 =head2 bktr
yading@10 8273
yading@10 8274
yading@10 8275 BSD video input device.
yading@10 8276
yading@10 8277
yading@10 8278 =head2 dshow
yading@10 8279
yading@10 8280
yading@10 8281 Windows DirectShow input device.
yading@10 8282
yading@10 8283 DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
yading@10 8284 Currently only audio and video devices are supported.
yading@10 8285
yading@10 8286 Multiple devices may be opened as separate inputs, but they may also be
yading@10 8287 opened on the same input, which should improve synchronism between them.
yading@10 8288
yading@10 8289 The input name should be in the format:
yading@10 8290
yading@10 8291
yading@10 8292 <TYPE>=<NAME>[:<TYPE>=<NAME>]
yading@10 8293
yading@10 8294
yading@10 8295 where I<TYPE> can be either I<audio> or I<video>,
yading@10 8296 and I<NAME> is the device's name.
yading@10 8297
yading@10 8298
yading@10 8299 =head3 Options
yading@10 8300
yading@10 8301
yading@10 8302 If no options are specified, the device's defaults are used.
yading@10 8303 If the device does not support the requested options, it will
yading@10 8304 fail to open.
yading@10 8305
yading@10 8306
yading@10 8307 =over 4
yading@10 8308
yading@10 8309
yading@10 8310
yading@10 8311 =item B<video_size>
yading@10 8312
yading@10 8313 Set the video size in the captured video.
yading@10 8314
yading@10 8315
yading@10 8316 =item B<framerate>
yading@10 8317
yading@10 8318 Set the frame rate in the captured video.
yading@10 8319
yading@10 8320
yading@10 8321 =item B<sample_rate>
yading@10 8322
yading@10 8323 Set the sample rate (in Hz) of the captured audio.
yading@10 8324
yading@10 8325
yading@10 8326 =item B<sample_size>
yading@10 8327
yading@10 8328 Set the sample size (in bits) of the captured audio.
yading@10 8329
yading@10 8330
yading@10 8331 =item B<channels>
yading@10 8332
yading@10 8333 Set the number of channels in the captured audio.
yading@10 8334
yading@10 8335
yading@10 8336 =item B<list_devices>
yading@10 8337
yading@10 8338 If set to B<true>, print a list of devices and exit.
yading@10 8339
yading@10 8340
yading@10 8341 =item B<list_options>
yading@10 8342
yading@10 8343 If set to B<true>, print a list of selected device's options
yading@10 8344 and exit.
yading@10 8345
yading@10 8346
yading@10 8347 =item B<video_device_number>
yading@10 8348
yading@10 8349 Set video device number for devices with same name (starts at 0,
yading@10 8350 defaults to 0).
yading@10 8351
yading@10 8352
yading@10 8353 =item B<audio_device_number>
yading@10 8354
yading@10 8355 Set audio device number for devices with same name (starts at 0,
yading@10 8356 defaults to 0).
yading@10 8357
yading@10 8358
yading@10 8359 =item B<pixel_format>
yading@10 8360
yading@10 8361 Select pixel format to be used by DirectShow. This may only be set when
yading@10 8362 the video codec is not set or set to rawvideo.
yading@10 8363
yading@10 8364
yading@10 8365 =item B<audio_buffer_size>
yading@10 8366
yading@10 8367 Set audio device buffer size in milliseconds (which can directly
yading@10 8368 impact latency, depending on the device).
yading@10 8369 Defaults to using the audio device's
yading@10 8370 default buffer size (typically some multiple of 500ms).
yading@10 8371 Setting this value too low can degrade performance.
yading@10 8372 See also
yading@10 8373 E<lt>B<http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx>E<gt>
yading@10 8374
yading@10 8375
yading@10 8376 =back
yading@10 8377
yading@10 8378
yading@10 8379
yading@10 8380 =head3 Examples
yading@10 8381
yading@10 8382
yading@10 8383
yading@10 8384 =over 4
yading@10 8385
yading@10 8386
yading@10 8387
yading@10 8388 =item *
yading@10 8389
yading@10 8390 Print the list of DirectShow supported devices and exit:
yading@10 8391
yading@10 8392 $ ffmpeg -list_devices true -f dshow -i dummy
yading@10 8393
yading@10 8394
yading@10 8395
yading@10 8396 =item *
yading@10 8397
yading@10 8398 Open video device I<Camera>:
yading@10 8399
yading@10 8400 $ ffmpeg -f dshow -i video="Camera"
yading@10 8401
yading@10 8402
yading@10 8403
yading@10 8404 =item *
yading@10 8405
yading@10 8406 Open second video device with name I<Camera>:
yading@10 8407
yading@10 8408 $ ffmpeg -f dshow -video_device_number 1 -i video="Camera"
yading@10 8409
yading@10 8410
yading@10 8411
yading@10 8412 =item *
yading@10 8413
yading@10 8414 Open video device I<Camera> and audio device I<Microphone>:
yading@10 8415
yading@10 8416 $ ffmpeg -f dshow -i video="Camera":audio="Microphone"
yading@10 8417
yading@10 8418
yading@10 8419
yading@10 8420 =item *
yading@10 8421
yading@10 8422 Print the list of supported options in selected device and exit:
yading@10 8423
yading@10 8424 $ ffmpeg -list_options true -f dshow -i video="Camera"
yading@10 8425
yading@10 8426
yading@10 8427
yading@10 8428 =back
yading@10 8429
yading@10 8430
yading@10 8431
yading@10 8432 =head2 dv1394
yading@10 8433
yading@10 8434
yading@10 8435 Linux DV 1394 input device.
yading@10 8436
yading@10 8437
yading@10 8438 =head2 fbdev
yading@10 8439
yading@10 8440
yading@10 8441 Linux framebuffer input device.
yading@10 8442
yading@10 8443 The Linux framebuffer is a graphic hardware-independent abstraction
yading@10 8444 layer to show graphics on a computer monitor, typically on the
yading@10 8445 console. It is accessed through a file device node, usually
yading@10 8446 F</dev/fb0>.
yading@10 8447
yading@10 8448 For more detailed information read the file
yading@10 8449 Documentation/fb/framebuffer.txt included in the Linux source tree.
yading@10 8450
yading@10 8451 To record from the framebuffer device F</dev/fb0> with
yading@10 8452 B<ffmpeg>:
yading@10 8453
yading@10 8454 ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
yading@10 8455
yading@10 8456
yading@10 8457 You can take a single screenshot image with the command:
yading@10 8458
yading@10 8459 ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
yading@10 8460
yading@10 8461
yading@10 8462 See also E<lt>B<http://linux-fbdev.sourceforge.net/>E<gt>, and fbset(1).
yading@10 8463
yading@10 8464
yading@10 8465 =head2 iec61883
yading@10 8466
yading@10 8467
yading@10 8468 FireWire DV/HDV input device using libiec61883.
yading@10 8469
yading@10 8470 To enable this input device, you need libiec61883, libraw1394 and
yading@10 8471 libavc1394 installed on your system. Use the configure option
yading@10 8472 C<--enable-libiec61883> to compile with the device enabled.
yading@10 8473
yading@10 8474 The iec61883 capture device supports capturing from a video device
yading@10 8475 connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
yading@10 8476 FireWire stack (juju). This is the default DV/HDV input method in Linux
yading@10 8477 Kernel 2.6.37 and later, since the old FireWire stack was removed.
yading@10 8478
yading@10 8479 Specify the FireWire port to be used as input file, or "auto"
yading@10 8480 to choose the first port connected.
yading@10 8481
yading@10 8482
yading@10 8483 =head3 Options
yading@10 8484
yading@10 8485
yading@10 8486
yading@10 8487 =over 4
yading@10 8488
yading@10 8489
yading@10 8490
yading@10 8491 =item B<dvtype>
yading@10 8492
yading@10 8493 Override autodetection of DV/HDV. This should only be used if auto
yading@10 8494 detection does not work, or if usage of a different device type
yading@10 8495 should be prohibited. Treating a DV device as HDV (or vice versa) will
yading@10 8496 not work and result in undefined behavior.
yading@10 8497 The values B<auto>, B<dv> and B<hdv> are supported.
yading@10 8498
yading@10 8499
yading@10 8500 =item B<dvbuffer>
yading@10 8501
yading@10 8502 Set maxiumum size of buffer for incoming data, in frames. For DV, this
yading@10 8503 is an exact value. For HDV, it is not frame exact, since HDV does
yading@10 8504 not have a fixed frame size.
yading@10 8505
yading@10 8506
yading@10 8507 =item B<dvguid>
yading@10 8508
yading@10 8509 Select the capture device by specifying it's GUID. Capturing will only
yading@10 8510 be performed from the specified device and fails if no device with the
yading@10 8511 given GUID is found. This is useful to select the input if multiple
yading@10 8512 devices are connected at the same time.
yading@10 8513 Look at /sys/bus/firewire/devices to find out the GUIDs.
yading@10 8514
yading@10 8515
yading@10 8516 =back
yading@10 8517
yading@10 8518
yading@10 8519
yading@10 8520 =head3 Examples
yading@10 8521
yading@10 8522
yading@10 8523
yading@10 8524 =over 4
yading@10 8525
yading@10 8526
yading@10 8527
yading@10 8528 =item *
yading@10 8529
yading@10 8530 Grab and show the input of a FireWire DV/HDV device.
yading@10 8531
yading@10 8532 ffplay -f iec61883 -i auto
yading@10 8533
yading@10 8534
yading@10 8535
yading@10 8536 =item *
yading@10 8537
yading@10 8538 Grab and record the input of a FireWire DV/HDV device,
yading@10 8539 using a packet buffer of 100000 packets if the source is HDV.
yading@10 8540
yading@10 8541 ffmpeg -f iec61883 -i auto -hdvbuffer 100000 out.mpg
yading@10 8542
yading@10 8543
yading@10 8544
yading@10 8545 =back
yading@10 8546
yading@10 8547
yading@10 8548
yading@10 8549 =head2 jack
yading@10 8550
yading@10 8551
yading@10 8552 JACK input device.
yading@10 8553
yading@10 8554 To enable this input device during configuration you need libjack
yading@10 8555 installed on your system.
yading@10 8556
yading@10 8557 A JACK input device creates one or more JACK writable clients, one for
yading@10 8558 each audio channel, with name I<client_name>:input_I<N>, where
yading@10 8559 I<client_name> is the name provided by the application, and I<N>
yading@10 8560 is a number which identifies the channel.
yading@10 8561 Each writable client will send the acquired data to the FFmpeg input
yading@10 8562 device.
yading@10 8563
yading@10 8564 Once you have created one or more JACK readable clients, you need to
yading@10 8565 connect them to one or more JACK writable clients.
yading@10 8566
yading@10 8567 To connect or disconnect JACK clients you can use the B<jack_connect>
yading@10 8568 and B<jack_disconnect> programs, or do it through a graphical interface,
yading@10 8569 for example with B<qjackctl>.
yading@10 8570
yading@10 8571 To list the JACK clients and their properties you can invoke the command
yading@10 8572 B<jack_lsp>.
yading@10 8573
yading@10 8574 Follows an example which shows how to capture a JACK readable client
yading@10 8575 with B<ffmpeg>.
yading@10 8576
yading@10 8577 # Create a JACK writable client with name "ffmpeg".
yading@10 8578 $ ffmpeg -f jack -i ffmpeg -y out.wav
yading@10 8579
yading@10 8580 # Start the sample jack_metro readable client.
yading@10 8581 $ jack_metro -b 120 -d 0.2 -f 4000
yading@10 8582
yading@10 8583 # List the current JACK clients.
yading@10 8584 $ jack_lsp -c
yading@10 8585 system:capture_1
yading@10 8586 system:capture_2
yading@10 8587 system:playback_1
yading@10 8588 system:playback_2
yading@10 8589 ffmpeg:input_1
yading@10 8590 metro:120_bpm
yading@10 8591
yading@10 8592 # Connect metro to the ffmpeg writable client.
yading@10 8593 $ jack_connect metro:120_bpm ffmpeg:input_1
yading@10 8594
yading@10 8595
yading@10 8596 For more information read:
yading@10 8597 E<lt>B<http://jackaudio.org/>E<gt>
yading@10 8598
yading@10 8599
yading@10 8600 =head2 lavfi
yading@10 8601
yading@10 8602
yading@10 8603 Libavfilter input virtual device.
yading@10 8604
yading@10 8605 This input device reads data from the open output pads of a libavfilter
yading@10 8606 filtergraph.
yading@10 8607
yading@10 8608 For each filtergraph open output, the input device will create a
yading@10 8609 corresponding stream which is mapped to the generated output. Currently
yading@10 8610 only video data is supported. The filtergraph is specified through the
yading@10 8611 option B<graph>.
yading@10 8612
yading@10 8613
yading@10 8614 =head3 Options
yading@10 8615
yading@10 8616
yading@10 8617
yading@10 8618 =over 4
yading@10 8619
yading@10 8620
yading@10 8621
yading@10 8622 =item B<graph>
yading@10 8623
yading@10 8624 Specify the filtergraph to use as input. Each video open output must be
yading@10 8625 labelled by a unique string of the form "outI<N>", where I<N> is a
yading@10 8626 number starting from 0 corresponding to the mapped input stream
yading@10 8627 generated by the device.
yading@10 8628 The first unlabelled output is automatically assigned to the "out0"
yading@10 8629 label, but all the others need to be specified explicitly.
yading@10 8630
yading@10 8631 If not specified defaults to the filename specified for the input
yading@10 8632 device.
yading@10 8633
yading@10 8634
yading@10 8635 =item B<graph_file>
yading@10 8636
yading@10 8637 Set the filename of the filtergraph to be read and sent to the other
yading@10 8638 filters. Syntax of the filtergraph is the same as the one specified by
yading@10 8639 the option I<graph>.
yading@10 8640
yading@10 8641
yading@10 8642 =back
yading@10 8643
yading@10 8644
yading@10 8645
yading@10 8646 =head3 Examples
yading@10 8647
yading@10 8648
yading@10 8649
yading@10 8650 =over 4
yading@10 8651
yading@10 8652
yading@10 8653 =item *
yading@10 8654
yading@10 8655 Create a color video stream and play it back with B<ffplay>:
yading@10 8656
yading@10 8657 ffplay -f lavfi -graph "color=c=pink [out0]" dummy
yading@10 8658
yading@10 8659
yading@10 8660
yading@10 8661 =item *
yading@10 8662
yading@10 8663 As the previous example, but use filename for specifying the graph
yading@10 8664 description, and omit the "out0" label:
yading@10 8665
yading@10 8666 ffplay -f lavfi color=c=pink
yading@10 8667
yading@10 8668
yading@10 8669
yading@10 8670 =item *
yading@10 8671
yading@10 8672 Create three different video test filtered sources and play them:
yading@10 8673
yading@10 8674 ffplay -f lavfi -graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3
yading@10 8675
yading@10 8676
yading@10 8677
yading@10 8678 =item *
yading@10 8679
yading@10 8680 Read an audio stream from a file using the amovie source and play it
yading@10 8681 back with B<ffplay>:
yading@10 8682
yading@10 8683 ffplay -f lavfi "amovie=test.wav"
yading@10 8684
yading@10 8685
yading@10 8686
yading@10 8687 =item *
yading@10 8688
yading@10 8689 Read an audio stream and a video stream and play it back with
yading@10 8690 B<ffplay>:
yading@10 8691
yading@10 8692 ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
yading@10 8693
yading@10 8694
yading@10 8695
yading@10 8696 =back
yading@10 8697
yading@10 8698
yading@10 8699
yading@10 8700 =head2 libdc1394
yading@10 8701
yading@10 8702
yading@10 8703 IIDC1394 input device, based on libdc1394 and libraw1394.
yading@10 8704
yading@10 8705
yading@10 8706 =head2 openal
yading@10 8707
yading@10 8708
yading@10 8709 The OpenAL input device provides audio capture on all systems with a
yading@10 8710 working OpenAL 1.1 implementation.
yading@10 8711
yading@10 8712 To enable this input device during configuration, you need OpenAL
yading@10 8713 headers and libraries installed on your system, and need to configure
yading@10 8714 FFmpeg with C<--enable-openal>.
yading@10 8715
yading@10 8716 OpenAL headers and libraries should be provided as part of your OpenAL
yading@10 8717 implementation, or as an additional download (an SDK). Depending on your
yading@10 8718 installation you may need to specify additional flags via the
yading@10 8719 C<--extra-cflags> and C<--extra-ldflags> for allowing the build
yading@10 8720 system to locate the OpenAL headers and libraries.
yading@10 8721
yading@10 8722 An incomplete list of OpenAL implementations follows:
yading@10 8723
yading@10 8724
yading@10 8725 =over 4
yading@10 8726
yading@10 8727
yading@10 8728 =item B<Creative>
yading@10 8729
yading@10 8730 The official Windows implementation, providing hardware acceleration
yading@10 8731 with supported devices and software fallback.
yading@10 8732 See E<lt>B<http://openal.org/>E<gt>.
yading@10 8733
yading@10 8734 =item B<OpenAL Soft>
yading@10 8735
yading@10 8736 Portable, open source (LGPL) software implementation. Includes
yading@10 8737 backends for the most common sound APIs on the Windows, Linux,
yading@10 8738 Solaris, and BSD operating systems.
yading@10 8739 See E<lt>B<http://kcat.strangesoft.net/openal.html>E<gt>.
yading@10 8740
yading@10 8741 =item B<Apple>
yading@10 8742
yading@10 8743 OpenAL is part of Core Audio, the official Mac OS X Audio interface.
yading@10 8744 See E<lt>B<http://developer.apple.com/technologies/mac/audio-and-video.html>E<gt>
yading@10 8745
yading@10 8746 =back
yading@10 8747
yading@10 8748
yading@10 8749 This device allows to capture from an audio input device handled
yading@10 8750 through OpenAL.
yading@10 8751
yading@10 8752 You need to specify the name of the device to capture in the provided
yading@10 8753 filename. If the empty string is provided, the device will
yading@10 8754 automatically select the default device. You can get the list of the
yading@10 8755 supported devices by using the option I<list_devices>.
yading@10 8756
yading@10 8757
yading@10 8758 =head3 Options
yading@10 8759
yading@10 8760
yading@10 8761
yading@10 8762 =over 4
yading@10 8763
yading@10 8764
yading@10 8765
yading@10 8766 =item B<channels>
yading@10 8767
yading@10 8768 Set the number of channels in the captured audio. Only the values
yading@10 8769 B<1> (monaural) and B<2> (stereo) are currently supported.
yading@10 8770 Defaults to B<2>.
yading@10 8771
yading@10 8772
yading@10 8773 =item B<sample_size>
yading@10 8774
yading@10 8775 Set the sample size (in bits) of the captured audio. Only the values
yading@10 8776 B<8> and B<16> are currently supported. Defaults to
yading@10 8777 B<16>.
yading@10 8778
yading@10 8779
yading@10 8780 =item B<sample_rate>
yading@10 8781
yading@10 8782 Set the sample rate (in Hz) of the captured audio.
yading@10 8783 Defaults to B<44.1k>.
yading@10 8784
yading@10 8785
yading@10 8786 =item B<list_devices>
yading@10 8787
yading@10 8788 If set to B<true>, print a list of devices and exit.
yading@10 8789 Defaults to B<false>.
yading@10 8790
yading@10 8791
yading@10 8792 =back
yading@10 8793
yading@10 8794
yading@10 8795
yading@10 8796 =head3 Examples
yading@10 8797
yading@10 8798
yading@10 8799 Print the list of OpenAL supported devices and exit:
yading@10 8800
yading@10 8801 $ ffmpeg -list_devices true -f openal -i dummy out.ogg
yading@10 8802
yading@10 8803
yading@10 8804 Capture from the OpenAL device F<DR-BT101 via PulseAudio>:
yading@10 8805
yading@10 8806 $ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
yading@10 8807
yading@10 8808
yading@10 8809 Capture from the default device (note the empty string '' as filename):
yading@10 8810
yading@10 8811 $ ffmpeg -f openal -i '' out.ogg
yading@10 8812
yading@10 8813
yading@10 8814 Capture from two devices simultaneously, writing to two different files,
yading@10 8815 within the same B<ffmpeg> command:
yading@10 8816
yading@10 8817 $ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
yading@10 8818
yading@10 8819 Note: not all OpenAL implementations support multiple simultaneous capture -
yading@10 8820 try the latest OpenAL Soft if the above does not work.
yading@10 8821
yading@10 8822
yading@10 8823 =head2 oss
yading@10 8824
yading@10 8825
yading@10 8826 Open Sound System input device.
yading@10 8827
yading@10 8828 The filename to provide to the input device is the device node
yading@10 8829 representing the OSS input device, and is usually set to
yading@10 8830 F</dev/dsp>.
yading@10 8831
yading@10 8832 For example to grab from F</dev/dsp> using B<ffmpeg> use the
yading@10 8833 command:
yading@10 8834
yading@10 8835 ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
yading@10 8836
yading@10 8837
yading@10 8838 For more information about OSS see:
yading@10 8839 E<lt>B<http://manuals.opensound.com/usersguide/dsp.html>E<gt>
yading@10 8840
yading@10 8841
yading@10 8842 =head2 pulse
yading@10 8843
yading@10 8844
yading@10 8845 pulseaudio input device.
yading@10 8846
yading@10 8847 To enable this input device during configuration you need libpulse-simple
yading@10 8848 installed in your system.
yading@10 8849
yading@10 8850 The filename to provide to the input device is a source device or the
yading@10 8851 string "default"
yading@10 8852
yading@10 8853 To list the pulse source devices and their properties you can invoke
yading@10 8854 the command B<pactl list sources>.
yading@10 8855
yading@10 8856
yading@10 8857 ffmpeg -f pulse -i default /tmp/pulse.wav
yading@10 8858
yading@10 8859
yading@10 8860
yading@10 8861 =head3 I<server> AVOption
yading@10 8862
yading@10 8863
yading@10 8864 The syntax is:
yading@10 8865
yading@10 8866 -server <server name>
yading@10 8867
yading@10 8868
yading@10 8869 Connects to a specific server.
yading@10 8870
yading@10 8871
yading@10 8872 =head3 I<name> AVOption
yading@10 8873
yading@10 8874
yading@10 8875 The syntax is:
yading@10 8876
yading@10 8877 -name <application name>
yading@10 8878
yading@10 8879
yading@10 8880 Specify the application name pulse will use when showing active clients,
yading@10 8881 by default it is the LIBAVFORMAT_IDENT string
yading@10 8882
yading@10 8883
yading@10 8884 =head3 I<stream_name> AVOption
yading@10 8885
yading@10 8886
yading@10 8887 The syntax is:
yading@10 8888
yading@10 8889 -stream_name <stream name>
yading@10 8890
yading@10 8891
yading@10 8892 Specify the stream name pulse will use when showing active streams,
yading@10 8893 by default it is "record"
yading@10 8894
yading@10 8895
yading@10 8896 =head3 I<sample_rate> AVOption
yading@10 8897
yading@10 8898
yading@10 8899 The syntax is:
yading@10 8900
yading@10 8901 -sample_rate <samplerate>
yading@10 8902
yading@10 8903
yading@10 8904 Specify the samplerate in Hz, by default 48kHz is used.
yading@10 8905
yading@10 8906
yading@10 8907 =head3 I<channels> AVOption
yading@10 8908
yading@10 8909
yading@10 8910 The syntax is:
yading@10 8911
yading@10 8912 -channels <N>
yading@10 8913
yading@10 8914
yading@10 8915 Specify the channels in use, by default 2 (stereo) is set.
yading@10 8916
yading@10 8917
yading@10 8918 =head3 I<frame_size> AVOption
yading@10 8919
yading@10 8920
yading@10 8921 The syntax is:
yading@10 8922
yading@10 8923 -frame_size <bytes>
yading@10 8924
yading@10 8925
yading@10 8926 Specify the number of byte per frame, by default it is set to 1024.
yading@10 8927
yading@10 8928
yading@10 8929 =head3 I<fragment_size> AVOption
yading@10 8930
yading@10 8931
yading@10 8932 The syntax is:
yading@10 8933
yading@10 8934 -fragment_size <bytes>
yading@10 8935
yading@10 8936
yading@10 8937 Specify the minimal buffering fragment in pulseaudio, it will affect the
yading@10 8938 audio latency. By default it is unset.
yading@10 8939
yading@10 8940
yading@10 8941 =head2 sndio
yading@10 8942
yading@10 8943
yading@10 8944 sndio input device.
yading@10 8945
yading@10 8946 To enable this input device during configuration you need libsndio
yading@10 8947 installed on your system.
yading@10 8948
yading@10 8949 The filename to provide to the input device is the device node
yading@10 8950 representing the sndio input device, and is usually set to
yading@10 8951 F</dev/audio0>.
yading@10 8952
yading@10 8953 For example to grab from F</dev/audio0> using B<ffmpeg> use the
yading@10 8954 command:
yading@10 8955
yading@10 8956 ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
yading@10 8957
yading@10 8958
yading@10 8959
yading@10 8960 =head2 video4linux2, v4l2
yading@10 8961
yading@10 8962
yading@10 8963 Video4Linux2 input video device.
yading@10 8964
yading@10 8965 "v4l2" can be used as alias for "video4linux2".
yading@10 8966
yading@10 8967 If FFmpeg is built with v4l-utils support (by using the
yading@10 8968 C<--enable-libv4l2> configure option), the device will always rely
yading@10 8969 on libv4l2.
yading@10 8970
yading@10 8971 The name of the device to grab is a file device node, usually Linux
yading@10 8972 systems tend to automatically create such nodes when the device
yading@10 8973 (e.g. an USB webcam) is plugged into the system, and has a name of the
yading@10 8974 kind F</dev/videoI<N>>, where I<N> is a number associated to
yading@10 8975 the device.
yading@10 8976
yading@10 8977 Video4Linux2 devices usually support a limited set of
yading@10 8978 I<width>xI<height> sizes and frame rates. You can check which are
yading@10 8979 supported using B<-list_formats all> for Video4Linux2 devices.
yading@10 8980 Some devices, like TV cards, support one or more standards. It is possible
yading@10 8981 to list all the supported standards using B<-list_standards all>.
yading@10 8982
yading@10 8983 The time base for the timestamps is 1 microsecond. Depending on the kernel
yading@10 8984 version and configuration, the timestamps may be derived from the real time
yading@10 8985 clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
yading@10 8986 boot time, unaffected by NTP or manual changes to the clock). The
yading@10 8987 B<-timestamps abs> or B<-ts abs> option can be used to force
yading@10 8988 conversion into the real time clock.
yading@10 8989
yading@10 8990 Some usage examples of the video4linux2 device with B<ffmpeg>
yading@10 8991 and B<ffplay>:
yading@10 8992
yading@10 8993 =over 4
yading@10 8994
yading@10 8995
yading@10 8996 =item *
yading@10 8997
yading@10 8998 Grab and show the input of a video4linux2 device:
yading@10 8999
yading@10 9000 ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
yading@10 9001
yading@10 9002
yading@10 9003
yading@10 9004 =item *
yading@10 9005
yading@10 9006 Grab and record the input of a video4linux2 device, leave the
yading@10 9007 frame rate and size as previously set:
yading@10 9008
yading@10 9009 ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
yading@10 9010
yading@10 9011
yading@10 9012 =back
yading@10 9013
yading@10 9014
yading@10 9015 For more information about Video4Linux, check E<lt>B<http://linuxtv.org/>E<gt>.
yading@10 9016
yading@10 9017
yading@10 9018 =head3 Options
yading@10 9019
yading@10 9020
yading@10 9021
yading@10 9022 =over 4
yading@10 9023
yading@10 9024
yading@10 9025 =item B<standard>
yading@10 9026
yading@10 9027 Set the standard. Must be the name of a supported standard. To get a
yading@10 9028 list of the supported standards, use the B<list_standards>
yading@10 9029 option.
yading@10 9030
yading@10 9031
yading@10 9032 =item B<channel>
yading@10 9033
yading@10 9034 Set the input channel number. Default to -1, which means using the
yading@10 9035 previously selected channel.
yading@10 9036
yading@10 9037
yading@10 9038 =item B<video_size>
yading@10 9039
yading@10 9040 Set the video frame size. The argument must be a string in the form
yading@10 9041 I<WIDTH>xI<HEIGHT> or a valid size abbreviation.
yading@10 9042
yading@10 9043
yading@10 9044 =item B<pixel_format>
yading@10 9045
yading@10 9046 Select the pixel format (only valid for raw video input).
yading@10 9047
yading@10 9048
yading@10 9049 =item B<input_format>
yading@10 9050
yading@10 9051 Set the preferred pixel format (for raw video) or a codec name.
yading@10 9052 This option allows to select the input format, when several are
yading@10 9053 available.
yading@10 9054
yading@10 9055
yading@10 9056 =item B<framerate>
yading@10 9057
yading@10 9058 Set the preferred video frame rate.
yading@10 9059
yading@10 9060
yading@10 9061 =item B<list_formats>
yading@10 9062
yading@10 9063 List available formats (supported pixel formats, codecs, and frame
yading@10 9064 sizes) and exit.
yading@10 9065
yading@10 9066 Available values are:
yading@10 9067
yading@10 9068 =over 4
yading@10 9069
yading@10 9070
yading@10 9071 =item B<all>
yading@10 9072
yading@10 9073 Show all available (compressed and non-compressed) formats.
yading@10 9074
yading@10 9075
yading@10 9076 =item B<raw>
yading@10 9077
yading@10 9078 Show only raw video (non-compressed) formats.
yading@10 9079
yading@10 9080
yading@10 9081 =item B<compressed>
yading@10 9082
yading@10 9083 Show only compressed formats.
yading@10 9084
yading@10 9085 =back
yading@10 9086
yading@10 9087
yading@10 9088
yading@10 9089 =item B<list_standards>
yading@10 9090
yading@10 9091 List supported standards and exit.
yading@10 9092
yading@10 9093 Available values are:
yading@10 9094
yading@10 9095 =over 4
yading@10 9096
yading@10 9097
yading@10 9098 =item B<all>
yading@10 9099
yading@10 9100 Show all supported standards.
yading@10 9101
yading@10 9102 =back
yading@10 9103
yading@10 9104
yading@10 9105
yading@10 9106 =item B<timestamps, ts>
yading@10 9107
yading@10 9108 Set type of timestamps for grabbed frames.
yading@10 9109
yading@10 9110 Available values are:
yading@10 9111
yading@10 9112 =over 4
yading@10 9113
yading@10 9114
yading@10 9115 =item B<default>
yading@10 9116
yading@10 9117 Use timestamps from the kernel.
yading@10 9118
yading@10 9119
yading@10 9120 =item B<abs>
yading@10 9121
yading@10 9122 Use absolute timestamps (wall clock).
yading@10 9123
yading@10 9124
yading@10 9125 =item B<mono2abs>
yading@10 9126
yading@10 9127 Force conversion from monotonic to absolute timestamps.
yading@10 9128
yading@10 9129 =back
yading@10 9130
yading@10 9131
yading@10 9132 Default value is C<default>.
yading@10 9133
yading@10 9134 =back
yading@10 9135
yading@10 9136
yading@10 9137
yading@10 9138 =head2 vfwcap
yading@10 9139
yading@10 9140
yading@10 9141 VfW (Video for Windows) capture input device.
yading@10 9142
yading@10 9143 The filename passed as input is the capture driver number, ranging from
yading@10 9144 0 to 9. You may use "list" as filename to print a list of drivers. Any
yading@10 9145 other filename will be interpreted as device number 0.
yading@10 9146
yading@10 9147
yading@10 9148 =head2 x11grab
yading@10 9149
yading@10 9150
yading@10 9151 X11 video input device.
yading@10 9152
yading@10 9153 This device allows to capture a region of an X11 display.
yading@10 9154
yading@10 9155 The filename passed as input has the syntax:
yading@10 9156
yading@10 9157 [<hostname>]:<display_number>.<screen_number>[+<x_offset>,<y_offset>]
yading@10 9158
yading@10 9159
yading@10 9160 I<hostname>:I<display_number>.I<screen_number> specifies the
yading@10 9161 X11 display name of the screen to grab from. I<hostname> can be
yading@10 9162 omitted, and defaults to "localhost". The environment variable
yading@10 9163 B<DISPLAY> contains the default display name.
yading@10 9164
yading@10 9165 I<x_offset> and I<y_offset> specify the offsets of the grabbed
yading@10 9166 area with respect to the top-left border of the X11 screen. They
yading@10 9167 default to 0.
yading@10 9168
yading@10 9169 Check the X11 documentation (e.g. man X) for more detailed information.
yading@10 9170
yading@10 9171 Use the B<dpyinfo> program for getting basic information about the
yading@10 9172 properties of your X11 display (e.g. grep for "name" or "dimensions").
yading@10 9173
yading@10 9174 For example to grab from F<:0.0> using B<ffmpeg>:
yading@10 9175
yading@10 9176 ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
yading@10 9177
yading@10 9178
yading@10 9179 Grab at position C<10,20>:
yading@10 9180
yading@10 9181 ffmpeg -f x11grab -r 25 -s cif -i :0.0+10,20 out.mpg
yading@10 9182
yading@10 9183
yading@10 9184
yading@10 9185 =head3 Options
yading@10 9186
yading@10 9187
yading@10 9188
yading@10 9189 =over 4
yading@10 9190
yading@10 9191
yading@10 9192 =item B<draw_mouse>
yading@10 9193
yading@10 9194 Specify whether to draw the mouse pointer. A value of C<0> specify
yading@10 9195 not to draw the pointer. Default value is C<1>.
yading@10 9196
yading@10 9197
yading@10 9198 =item B<follow_mouse>
yading@10 9199
yading@10 9200 Make the grabbed area follow the mouse. The argument can be
yading@10 9201 C<centered> or a number of pixels I<PIXELS>.
yading@10 9202
yading@10 9203 When it is specified with "centered", the grabbing region follows the mouse
yading@10 9204 pointer and keeps the pointer at the center of region; otherwise, the region
yading@10 9205 follows only when the mouse pointer reaches within I<PIXELS> (greater than
yading@10 9206 zero) to the edge of region.
yading@10 9207
yading@10 9208 For example:
yading@10 9209
yading@10 9210 ffmpeg -f x11grab -follow_mouse centered -r 25 -s cif -i :0.0 out.mpg
yading@10 9211
yading@10 9212
yading@10 9213 To follow only when the mouse pointer reaches within 100 pixels to edge:
yading@10 9214
yading@10 9215 ffmpeg -f x11grab -follow_mouse 100 -r 25 -s cif -i :0.0 out.mpg
yading@10 9216
yading@10 9217
yading@10 9218
yading@10 9219 =item B<framerate>
yading@10 9220
yading@10 9221 Set the grabbing frame rate. Default value is C<ntsc>,
yading@10 9222 corresponding to a frame rate of C<30000/1001>.
yading@10 9223
yading@10 9224
yading@10 9225 =item B<show_region>
yading@10 9226
yading@10 9227 Show grabbed region on screen.
yading@10 9228
yading@10 9229 If I<show_region> is specified with C<1>, then the grabbing
yading@10 9230 region will be indicated on screen. With this option, it is easy to
yading@10 9231 know what is being grabbed if only a portion of the screen is grabbed.
yading@10 9232
yading@10 9233 For example:
yading@10 9234
yading@10 9235 ffmpeg -f x11grab -show_region 1 -r 25 -s cif -i :0.0+10,20 out.mpg
yading@10 9236
yading@10 9237
yading@10 9238 With I<follow_mouse>:
yading@10 9239
yading@10 9240 ffmpeg -f x11grab -follow_mouse centered -show_region 1 -r 25 -s cif -i :0.0 out.mpg
yading@10 9241
yading@10 9242
yading@10 9243
yading@10 9244 =item B<video_size>
yading@10 9245
yading@10 9246 Set the video frame size. Default value is C<vga>.
yading@10 9247
yading@10 9248 =back
yading@10 9249
yading@10 9250
yading@10 9251
yading@10 9252 =head1 OUTPUT DEVICES
yading@10 9253
yading@10 9254
yading@10 9255 Output devices are configured elements in FFmpeg which allow to write
yading@10 9256 multimedia data to an output device attached to your system.
yading@10 9257
yading@10 9258 When you configure your FFmpeg build, all the supported output devices
yading@10 9259 are enabled by default. You can list all available ones using the
yading@10 9260 configure option "--list-outdevs".
yading@10 9261
yading@10 9262 You can disable all the output devices using the configure option
yading@10 9263 "--disable-outdevs", and selectively enable an output device using the
yading@10 9264 option "--enable-outdev=I<OUTDEV>", or you can disable a particular
yading@10 9265 input device using the option "--disable-outdev=I<OUTDEV>".
yading@10 9266
yading@10 9267 The option "-formats" of the ff* tools will display the list of
yading@10 9268 enabled output devices (amongst the muxers).
yading@10 9269
yading@10 9270 A description of the currently available output devices follows.
yading@10 9271
yading@10 9272
yading@10 9273 =head2 alsa
yading@10 9274
yading@10 9275
yading@10 9276 ALSA (Advanced Linux Sound Architecture) output device.
yading@10 9277
yading@10 9278
yading@10 9279 =head2 caca
yading@10 9280
yading@10 9281
yading@10 9282 CACA output device.
yading@10 9283
yading@10 9284 This output devices allows to show a video stream in CACA window.
yading@10 9285 Only one CACA window is allowed per application, so you can
yading@10 9286 have only one instance of this output device in an application.
yading@10 9287
yading@10 9288 To enable this output device you need to configure FFmpeg with
yading@10 9289 C<--enable-libcaca>.
yading@10 9290 libcaca is a graphics library that outputs text instead of pixels.
yading@10 9291
yading@10 9292 For more information about libcaca, check:
yading@10 9293 E<lt>B<http://caca.zoy.org/wiki/libcaca>E<gt>
yading@10 9294
yading@10 9295
yading@10 9296 =head3 Options
yading@10 9297
yading@10 9298
yading@10 9299
yading@10 9300 =over 4
yading@10 9301
yading@10 9302
yading@10 9303
yading@10 9304 =item B<window_title>
yading@10 9305
yading@10 9306 Set the CACA window title, if not specified default to the filename
yading@10 9307 specified for the output device.
yading@10 9308
yading@10 9309
yading@10 9310 =item B<window_size>
yading@10 9311
yading@10 9312 Set the CACA window size, can be a string of the form
yading@10 9313 I<width>xI<height> or a video size abbreviation.
yading@10 9314 If not specified it defaults to the size of the input video.
yading@10 9315
yading@10 9316
yading@10 9317 =item B<driver>
yading@10 9318
yading@10 9319 Set display driver.
yading@10 9320
yading@10 9321
yading@10 9322 =item B<algorithm>
yading@10 9323
yading@10 9324 Set dithering algorithm. Dithering is necessary
yading@10 9325 because the picture being rendered has usually far more colours than
yading@10 9326 the available palette.
yading@10 9327 The accepted values are listed with C<-list_dither algorithms>.
yading@10 9328
yading@10 9329
yading@10 9330 =item B<antialias>
yading@10 9331
yading@10 9332 Set antialias method. Antialiasing smoothens the rendered
yading@10 9333 image and avoids the commonly seen staircase effect.
yading@10 9334 The accepted values are listed with C<-list_dither antialiases>.
yading@10 9335
yading@10 9336
yading@10 9337 =item B<charset>
yading@10 9338
yading@10 9339 Set which characters are going to be used when rendering text.
yading@10 9340 The accepted values are listed with C<-list_dither charsets>.
yading@10 9341
yading@10 9342
yading@10 9343 =item B<color>
yading@10 9344
yading@10 9345 Set color to be used when rendering text.
yading@10 9346 The accepted values are listed with C<-list_dither colors>.
yading@10 9347
yading@10 9348
yading@10 9349 =item B<list_drivers>
yading@10 9350
yading@10 9351 If set to B<true>, print a list of available drivers and exit.
yading@10 9352
yading@10 9353
yading@10 9354 =item B<list_dither>
yading@10 9355
yading@10 9356 List available dither options related to the argument.
yading@10 9357 The argument must be one of C<algorithms>, C<antialiases>,
yading@10 9358 C<charsets>, C<colors>.
yading@10 9359
yading@10 9360 =back
yading@10 9361
yading@10 9362
yading@10 9363
yading@10 9364 =head3 Examples
yading@10 9365
yading@10 9366
yading@10 9367
yading@10 9368 =over 4
yading@10 9369
yading@10 9370
yading@10 9371 =item *
yading@10 9372
yading@10 9373 The following command shows the B<ffmpeg> output is an
yading@10 9374 CACA window, forcing its size to 80x25:
yading@10 9375
yading@10 9376 ffmpeg -i INPUT -vcodec rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
yading@10 9377
yading@10 9378
yading@10 9379
yading@10 9380 =item *
yading@10 9381
yading@10 9382 Show the list of available drivers and exit:
yading@10 9383
yading@10 9384 ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
yading@10 9385
yading@10 9386
yading@10 9387
yading@10 9388 =item *
yading@10 9389
yading@10 9390 Show the list of available dither colors and exit:
yading@10 9391
yading@10 9392 ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
yading@10 9393
yading@10 9394
yading@10 9395 =back
yading@10 9396
yading@10 9397
yading@10 9398
yading@10 9399 =head2 oss
yading@10 9400
yading@10 9401
yading@10 9402 OSS (Open Sound System) output device.
yading@10 9403
yading@10 9404
yading@10 9405 =head2 sdl
yading@10 9406
yading@10 9407
yading@10 9408 SDL (Simple DirectMedia Layer) output device.
yading@10 9409
yading@10 9410 This output devices allows to show a video stream in an SDL
yading@10 9411 window. Only one SDL window is allowed per application, so you can
yading@10 9412 have only one instance of this output device in an application.
yading@10 9413
yading@10 9414 To enable this output device you need libsdl installed on your system
yading@10 9415 when configuring your build.
yading@10 9416
yading@10 9417 For more information about SDL, check:
yading@10 9418 E<lt>B<http://www.libsdl.org/>E<gt>
yading@10 9419
yading@10 9420
yading@10 9421 =head3 Options
yading@10 9422
yading@10 9423
yading@10 9424
yading@10 9425 =over 4
yading@10 9426
yading@10 9427
yading@10 9428
yading@10 9429 =item B<window_title>
yading@10 9430
yading@10 9431 Set the SDL window title, if not specified default to the filename
yading@10 9432 specified for the output device.
yading@10 9433
yading@10 9434
yading@10 9435 =item B<icon_title>
yading@10 9436
yading@10 9437 Set the name of the iconified SDL window, if not specified it is set
yading@10 9438 to the same value of I<window_title>.
yading@10 9439
yading@10 9440
yading@10 9441 =item B<window_size>
yading@10 9442
yading@10 9443 Set the SDL window size, can be a string of the form
yading@10 9444 I<width>xI<height> or a video size abbreviation.
yading@10 9445 If not specified it defaults to the size of the input video,
yading@10 9446 downscaled according to the aspect ratio.
yading@10 9447
yading@10 9448 =back
yading@10 9449
yading@10 9450
yading@10 9451
yading@10 9452 =head3 Examples
yading@10 9453
yading@10 9454
yading@10 9455 The following command shows the B<ffmpeg> output is an
yading@10 9456 SDL window, forcing its size to the qcif format:
yading@10 9457
yading@10 9458 ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
yading@10 9459
yading@10 9460
yading@10 9461
yading@10 9462 =head2 sndio
yading@10 9463
yading@10 9464
yading@10 9465 sndio audio output device.
yading@10 9466
yading@10 9467
yading@10 9468
yading@10 9469 =head1 RESAMPLER OPTIONS
yading@10 9470
yading@10 9471
yading@10 9472 The audio resampler supports the following named options.
yading@10 9473
yading@10 9474 Options may be set by specifying -I<option> I<value> in the
yading@10 9475 FFmpeg tools, I<option>=I<value> for the aresample filter,
yading@10 9476 by setting the value explicitly in the
yading@10 9477 C<SwrContext> options or using the F<libavutil/opt.h> API for
yading@10 9478 programmatic use.
yading@10 9479
yading@10 9480
yading@10 9481 =over 4
yading@10 9482
yading@10 9483
yading@10 9484
yading@10 9485 =item B<ich, in_channel_count>
yading@10 9486
yading@10 9487 Set the number of input channels. Default value is 0. Setting this
yading@10 9488 value is not mandatory if the corresponding channel layout
yading@10 9489 B<in_channel_layout> is set.
yading@10 9490
yading@10 9491
yading@10 9492 =item B<och, out_channel_count>
yading@10 9493
yading@10 9494 Set the number of output channels. Default value is 0. Setting this
yading@10 9495 value is not mandatory if the corresponding channel layout
yading@10 9496 B<out_channel_layout> is set.
yading@10 9497
yading@10 9498
yading@10 9499 =item B<uch, used_channel_count>
yading@10 9500
yading@10 9501 Set the number of used input channels. Default value is 0. This option is
yading@10 9502 only used for special remapping.
yading@10 9503
yading@10 9504
yading@10 9505 =item B<isr, in_sample_rate>
yading@10 9506
yading@10 9507 Set the input sample rate. Default value is 0.
yading@10 9508
yading@10 9509
yading@10 9510 =item B<osr, out_sample_rate>
yading@10 9511
yading@10 9512 Set the output sample rate. Default value is 0.
yading@10 9513
yading@10 9514
yading@10 9515 =item B<isf, in_sample_fmt>
yading@10 9516
yading@10 9517 Specify the input sample format. It is set by default to C<none>.
yading@10 9518
yading@10 9519
yading@10 9520 =item B<osf, out_sample_fmt>
yading@10 9521
yading@10 9522 Specify the output sample format. It is set by default to C<none>.
yading@10 9523
yading@10 9524
yading@10 9525 =item B<tsf, internal_sample_fmt>
yading@10 9526
yading@10 9527 Set the internal sample format. Default value is C<none>.
yading@10 9528 This will automatically be chosen when it is not explicitly set.
yading@10 9529
yading@10 9530
yading@10 9531 =item B<icl, in_channel_layout>
yading@10 9532
yading@10 9533 Set the input channel layout.
yading@10 9534
yading@10 9535
yading@10 9536 =item B<ocl, out_channel_layout>
yading@10 9537
yading@10 9538 Set the output channel layout.
yading@10 9539
yading@10 9540
yading@10 9541 =item B<clev, center_mix_level>
yading@10 9542
yading@10 9543 Set the center mix level. It is a value expressed in deciBel, and must be
yading@10 9544 in the interval [-32,32].
yading@10 9545
yading@10 9546
yading@10 9547 =item B<slev, surround_mix_level>
yading@10 9548
yading@10 9549 Set the surround mix level. It is a value expressed in deciBel, and must
yading@10 9550 be in the interval [-32,32].
yading@10 9551
yading@10 9552
yading@10 9553 =item B<lfe_mix_level>
yading@10 9554
yading@10 9555 Set LFE mix into non LFE level. It is used when there is a LFE input but no
yading@10 9556 LFE output. It is a value expressed in deciBel, and must
yading@10 9557 be in the interval [-32,32].
yading@10 9558
yading@10 9559
yading@10 9560 =item B<rmvol, rematrix_volume>
yading@10 9561
yading@10 9562 Set rematrix volume. Default value is 1.0.
yading@10 9563
yading@10 9564
yading@10 9565 =item B<flags, swr_flags>
yading@10 9566
yading@10 9567 Set flags used by the converter. Default value is 0.
yading@10 9568
yading@10 9569 It supports the following individual flags:
yading@10 9570
yading@10 9571 =over 4
yading@10 9572
yading@10 9573
yading@10 9574 =item B<res>
yading@10 9575
yading@10 9576 force resampling, this flag forces resampling to be used even when the
yading@10 9577 input and output sample rates match.
yading@10 9578
yading@10 9579 =back
yading@10 9580
yading@10 9581
yading@10 9582
yading@10 9583 =item B<dither_scale>
yading@10 9584
yading@10 9585 Set the dither scale. Default value is 1.
yading@10 9586
yading@10 9587
yading@10 9588 =item B<dither_method>
yading@10 9589
yading@10 9590 Set dither method. Default value is 0.
yading@10 9591
yading@10 9592 Supported values:
yading@10 9593
yading@10 9594 =over 4
yading@10 9595
yading@10 9596
yading@10 9597 =item B<rectangular>
yading@10 9598
yading@10 9599 select rectangular dither
yading@10 9600
yading@10 9601 =item B<triangular>
yading@10 9602
yading@10 9603 select triangular dither
yading@10 9604
yading@10 9605 =item B<triangular_hp>
yading@10 9606
yading@10 9607 select triangular dither with high pass
yading@10 9608
yading@10 9609 =item B<lipshitz>
yading@10 9610
yading@10 9611 select lipshitz noise shaping dither
yading@10 9612
yading@10 9613 =item B<shibata>
yading@10 9614
yading@10 9615 select shibata noise shaping dither
yading@10 9616
yading@10 9617 =item B<low_shibata>
yading@10 9618
yading@10 9619 select low shibata noise shaping dither
yading@10 9620
yading@10 9621 =item B<high_shibata>
yading@10 9622
yading@10 9623 select high shibata noise shaping dither
yading@10 9624
yading@10 9625 =item B<f_weighted>
yading@10 9626
yading@10 9627 select f-weighted noise shaping dither
yading@10 9628
yading@10 9629 =item B<modified_e_weighted>
yading@10 9630
yading@10 9631 select modified-e-weighted noise shaping dither
yading@10 9632
yading@10 9633 =item B<improved_e_weighted>
yading@10 9634
yading@10 9635 select improved-e-weighted noise shaping dither
yading@10 9636
yading@10 9637
yading@10 9638 =back
yading@10 9639
yading@10 9640
yading@10 9641
yading@10 9642 =item B<resampler>
yading@10 9643
yading@10 9644 Set resampling engine. Default value is swr.
yading@10 9645
yading@10 9646 Supported values:
yading@10 9647
yading@10 9648 =over 4
yading@10 9649
yading@10 9650
yading@10 9651 =item B<swr>
yading@10 9652
yading@10 9653 select the native SW Resampler; filter options precision and cheby are not
yading@10 9654 applicable in this case.
yading@10 9655
yading@10 9656 =item B<soxr>
yading@10 9657
yading@10 9658 select the SoX Resampler (where available); compensation, and filter options
yading@10 9659 filter_size, phase_shift, filter_type & kaiser_beta, are not applicable in this
yading@10 9660 case.
yading@10 9661
yading@10 9662 =back
yading@10 9663
yading@10 9664
yading@10 9665
yading@10 9666 =item B<filter_size>
yading@10 9667
yading@10 9668 For swr only, set resampling filter size, default value is 32.
yading@10 9669
yading@10 9670
yading@10 9671 =item B<phase_shift>
yading@10 9672
yading@10 9673 For swr only, set resampling phase shift, default value is 10, and must be in
yading@10 9674 the interval [0,30].
yading@10 9675
yading@10 9676
yading@10 9677 =item B<linear_interp>
yading@10 9678
yading@10 9679 Use Linear Interpolation if set to 1, default value is 0.
yading@10 9680
yading@10 9681
yading@10 9682 =item B<cutoff>
yading@10 9683
yading@10 9684 Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
yading@10 9685 value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
yading@10 9686 (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
yading@10 9687
yading@10 9688
yading@10 9689 =item B<precision>
yading@10 9690
yading@10 9691 For soxr only, the precision in bits to which the resampled signal will be
yading@10 9692 calculated. The default value of 20 (which, with suitable dithering, is
yading@10 9693 appropriate for a destination bit-depth of 16) gives SoX's 'High Quality'; a
yading@10 9694 value of 28 gives SoX's 'Very High Quality'.
yading@10 9695
yading@10 9696
yading@10 9697 =item B<cheby>
yading@10 9698
yading@10 9699 For soxr only, selects passband rolloff none (Chebyshev) & higher-precision
yading@10 9700 approximation for 'irrational' ratios. Default value is 0.
yading@10 9701
yading@10 9702
yading@10 9703 =item B<async>
yading@10 9704
yading@10 9705 For swr only, simple 1 parameter audio sync to timestamps using stretching,
yading@10 9706 squeezing, filling and trimming. Setting this to 1 will enable filling and
yading@10 9707 trimming, larger values represent the maximum amount in samples that the data
yading@10 9708 may be stretched or squeezed for each second.
yading@10 9709 Default value is 0, thus no compensation is applied to make the samples match
yading@10 9710 the audio timestamps.
yading@10 9711
yading@10 9712
yading@10 9713 =item B<first_pts>
yading@10 9714
yading@10 9715 For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
yading@10 9716 This allows for padding/trimming at the start of stream. By default, no
yading@10 9717 assumption is made about the first frame's expected pts, so no padding or
yading@10 9718 trimming is done. For example, this could be set to 0 to pad the beginning with
yading@10 9719 silence if an audio stream starts after the video stream or to trim any samples
yading@10 9720 with a negative pts due to encoder delay.
yading@10 9721
yading@10 9722
yading@10 9723 =item B<min_comp>
yading@10 9724
yading@10 9725 For swr only, set the minimum difference between timestamps and audio data (in
yading@10 9726 seconds) to trigger stretching/squeezing/filling or trimming of the
yading@10 9727 data to make it match the timestamps. The default is that
yading@10 9728 stretching/squeezing/filling and trimming is disabled
yading@10 9729 (B<min_comp> = C<FLT_MAX>).
yading@10 9730
yading@10 9731
yading@10 9732 =item B<min_hard_comp>
yading@10 9733
yading@10 9734 For swr only, set the minimum difference between timestamps and audio data (in
yading@10 9735 seconds) to trigger adding/dropping samples to make it match the
yading@10 9736 timestamps. This option effectively is a threshold to select between
yading@10 9737 hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
yading@10 9738 all compensation is by default disabled through B<min_comp>.
yading@10 9739 The default is 0.1.
yading@10 9740
yading@10 9741
yading@10 9742 =item B<comp_duration>
yading@10 9743
yading@10 9744 For swr only, set duration (in seconds) over which data is stretched/squeezed
yading@10 9745 to make it match the timestamps. Must be a non-negative double float value,
yading@10 9746 default value is 1.0.
yading@10 9747
yading@10 9748
yading@10 9749 =item B<max_soft_comp>
yading@10 9750
yading@10 9751 For swr only, set maximum factor by which data is stretched/squeezed to make it
yading@10 9752 match the timestamps. Must be a non-negative double float value, default value
yading@10 9753 is 0.
yading@10 9754
yading@10 9755
yading@10 9756 =item B<matrix_encoding>
yading@10 9757
yading@10 9758 Select matrixed stereo encoding.
yading@10 9759
yading@10 9760 It accepts the following values:
yading@10 9761
yading@10 9762 =over 4
yading@10 9763
yading@10 9764
yading@10 9765 =item B<none>
yading@10 9766
yading@10 9767 select none
yading@10 9768
yading@10 9769 =item B<dolby>
yading@10 9770
yading@10 9771 select Dolby
yading@10 9772
yading@10 9773 =item B<dplii>
yading@10 9774
yading@10 9775 select Dolby Pro Logic II
yading@10 9776
yading@10 9777 =back
yading@10 9778
yading@10 9779
yading@10 9780 Default value is C<none>.
yading@10 9781
yading@10 9782
yading@10 9783 =item B<filter_type>
yading@10 9784
yading@10 9785 For swr only, select resampling filter type. This only affects resampling
yading@10 9786 operations.
yading@10 9787
yading@10 9788 It accepts the following values:
yading@10 9789
yading@10 9790 =over 4
yading@10 9791
yading@10 9792
yading@10 9793 =item B<cubic>
yading@10 9794
yading@10 9795 select cubic
yading@10 9796
yading@10 9797 =item B<blackman_nuttall>
yading@10 9798
yading@10 9799 select Blackman Nuttall Windowed Sinc
yading@10 9800
yading@10 9801 =item B<kaiser>
yading@10 9802
yading@10 9803 select Kaiser Windowed Sinc
yading@10 9804
yading@10 9805 =back
yading@10 9806
yading@10 9807
yading@10 9808
yading@10 9809 =item B<kaiser_beta>
yading@10 9810
yading@10 9811 For swr only, set Kaiser Window Beta value. Must be an integer in the
yading@10 9812 interval [2,16], default value is 9.
yading@10 9813
yading@10 9814
yading@10 9815 =back
yading@10 9816
yading@10 9817
yading@10 9818
yading@10 9819
yading@10 9820 =head1 SCALER OPTIONS
yading@10 9821
yading@10 9822
yading@10 9823 The video scaler supports the following named options.
yading@10 9824
yading@10 9825 Options may be set by specifying -I<option> I<value> in the
yading@10 9826 FFmpeg tools. For programmatic use, they can be set explicitly in the
yading@10 9827 C<SwsContext> options or through the F<libavutil/opt.h> API.
yading@10 9828
yading@10 9829
yading@10 9830 =over 4
yading@10 9831
yading@10 9832
yading@10 9833
yading@10 9834 =item B<sws_flags>
yading@10 9835
yading@10 9836 Set the scaler flags. This is also used to set the scaling
yading@10 9837 algorithm. Only a single algorithm should be selected.
yading@10 9838
yading@10 9839 It accepts the following values:
yading@10 9840
yading@10 9841 =over 4
yading@10 9842
yading@10 9843
yading@10 9844 =item B<fast_bilinear>
yading@10 9845
yading@10 9846 Select fast bilinear scaling algorithm.
yading@10 9847
yading@10 9848
yading@10 9849 =item B<bilinear>
yading@10 9850
yading@10 9851 Select bilinear scaling algorithm.
yading@10 9852
yading@10 9853
yading@10 9854 =item B<bicubic>
yading@10 9855
yading@10 9856 Select bicubic scaling algorithm.
yading@10 9857
yading@10 9858
yading@10 9859 =item B<experimental>
yading@10 9860
yading@10 9861 Select experimental scaling algorithm.
yading@10 9862
yading@10 9863
yading@10 9864 =item B<neighbor>
yading@10 9865
yading@10 9866 Select nearest neighbor rescaling algorithm.
yading@10 9867
yading@10 9868
yading@10 9869 =item B<area>
yading@10 9870
yading@10 9871 Select averaging area rescaling algorithm.
yading@10 9872
yading@10 9873
yading@10 9874 =item B<bicubiclin>
yading@10 9875
yading@10 9876 Select bicubic scaling algorithm for the luma component, bilinear for
yading@10 9877 chroma components.
yading@10 9878
yading@10 9879
yading@10 9880 =item B<gauss>
yading@10 9881
yading@10 9882 Select Gaussian rescaling algorithm.
yading@10 9883
yading@10 9884
yading@10 9885 =item B<sinc>
yading@10 9886
yading@10 9887 Select sinc rescaling algorithm.
yading@10 9888
yading@10 9889
yading@10 9890 =item B<lanczos>
yading@10 9891
yading@10 9892 Select lanczos rescaling algorithm.
yading@10 9893
yading@10 9894
yading@10 9895 =item B<spline>
yading@10 9896
yading@10 9897 Select natural bicubic spline rescaling algorithm.
yading@10 9898
yading@10 9899
yading@10 9900 =item B<print_info>
yading@10 9901
yading@10 9902 Enable printing/debug logging.
yading@10 9903
yading@10 9904
yading@10 9905 =item B<accurate_rnd>
yading@10 9906
yading@10 9907 Enable accurate rounding.
yading@10 9908
yading@10 9909
yading@10 9910 =item B<full_chroma_int>
yading@10 9911
yading@10 9912 Enable full chroma interpolation.
yading@10 9913
yading@10 9914
yading@10 9915 =item B<full_chroma_inp>
yading@10 9916
yading@10 9917 Select full chroma input.
yading@10 9918
yading@10 9919
yading@10 9920 =item B<bitexact>
yading@10 9921
yading@10 9922 Enable bitexact output.
yading@10 9923
yading@10 9924 =back
yading@10 9925
yading@10 9926
yading@10 9927
yading@10 9928 =item B<srcw>
yading@10 9929
yading@10 9930 Set source width.
yading@10 9931
yading@10 9932
yading@10 9933 =item B<srch>
yading@10 9934
yading@10 9935 Set source height.
yading@10 9936
yading@10 9937
yading@10 9938 =item B<dstw>
yading@10 9939
yading@10 9940 Set destination width.
yading@10 9941
yading@10 9942
yading@10 9943 =item B<dsth>
yading@10 9944
yading@10 9945 Set destination height.
yading@10 9946
yading@10 9947
yading@10 9948 =item B<src_format>
yading@10 9949
yading@10 9950 Set source pixel format (must be expressed as an integer).
yading@10 9951
yading@10 9952
yading@10 9953 =item B<dst_format>
yading@10 9954
yading@10 9955 Set destination pixel format (must be expressed as an integer).
yading@10 9956
yading@10 9957
yading@10 9958 =item B<src_range>
yading@10 9959
yading@10 9960 Select source range.
yading@10 9961
yading@10 9962
yading@10 9963 =item B<dst_range>
yading@10 9964
yading@10 9965 Select destination range.
yading@10 9966
yading@10 9967
yading@10 9968 =item B<param0, param1>
yading@10 9969
yading@10 9970 Set scaling algorithm parameters. The specified values are specific of
yading@10 9971 some scaling algorithms and ignored by others. The specified values
yading@10 9972 are floating point number values.
yading@10 9973
yading@10 9974
yading@10 9975 =back
yading@10 9976
yading@10 9977
yading@10 9978
yading@10 9979
yading@10 9980 =head1 FILTERING INTRODUCTION
yading@10 9981
yading@10 9982
yading@10 9983 Filtering in FFmpeg is enabled through the libavfilter library.
yading@10 9984
yading@10 9985 In libavfilter, a filter can have multiple inputs and multiple
yading@10 9986 outputs.
yading@10 9987 To illustrate the sorts of things that are possible, we consider the
yading@10 9988 following filtergraph.
yading@10 9989
yading@10 9990
yading@10 9991 input --> split ---------------------> overlay --> output
yading@10 9992 | ^
yading@10 9993 | |
yading@10 9994 +-----> crop --> vflip -------+
yading@10 9995
yading@10 9996
yading@10 9997 This filtergraph splits the input stream in two streams, sends one
yading@10 9998 stream through the crop filter and the vflip filter before merging it
yading@10 9999 back with the other stream by overlaying it on top. You can use the
yading@10 10000 following command to achieve this:
yading@10 10001
yading@10 10002
yading@10 10003 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 10004
yading@10 10005
yading@10 10006 The result will be that in output the top half of the video is mirrored
yading@10 10007 onto the bottom half.
yading@10 10008
yading@10 10009 Filters in the same linear chain are separated by commas, and distinct
yading@10 10010 linear chains of filters are separated by semicolons. In our example,
yading@10 10011 I<crop,vflip> are in one linear chain, I<split> and
yading@10 10012 I<overlay> are separately in another. The points where the linear
yading@10 10013 chains join are labelled by names enclosed in square brackets. In the
yading@10 10014 example, the split filter generates two outputs that are associated to
yading@10 10015 the labels I<[main]> and I<[tmp]>.
yading@10 10016
yading@10 10017 The stream sent to the second output of I<split>, labelled as
yading@10 10018 I<[tmp]>, is processed through the I<crop> filter, which crops
yading@10 10019 away the lower half part of the video, and then vertically flipped. The
yading@10 10020 I<overlay> filter takes in input the first unchanged output of the
yading@10 10021 split filter (which was labelled as I<[main]>), and overlay on its
yading@10 10022 lower half the output generated by the I<crop,vflip> filterchain.
yading@10 10023
yading@10 10024 Some filters take in input a list of parameters: they are specified
yading@10 10025 after the filter name and an equal sign, and are separated from each other
yading@10 10026 by a colon.
yading@10 10027
yading@10 10028 There exist so-called I<source filters> that do not have an
yading@10 10029 audio/video input, and I<sink filters> that will not have audio/video
yading@10 10030 output.
yading@10 10031
yading@10 10032
yading@10 10033
yading@10 10034 =head1 GRAPH
yading@10 10035
yading@10 10036
yading@10 10037 The F<graph2dot> program included in the FFmpeg F<tools>
yading@10 10038 directory can be used to parse a filtergraph description and issue a
yading@10 10039 corresponding textual representation in the dot language.
yading@10 10040
yading@10 10041 Invoke the command:
yading@10 10042
yading@10 10043 graph2dot -h
yading@10 10044
yading@10 10045
yading@10 10046 to see how to use F<graph2dot>.
yading@10 10047
yading@10 10048 You can then pass the dot description to the F<dot> program (from
yading@10 10049 the graphviz suite of programs) and obtain a graphical representation
yading@10 10050 of the filtergraph.
yading@10 10051
yading@10 10052 For example the sequence of commands:
yading@10 10053
yading@10 10054 echo <GRAPH_DESCRIPTION> | \
yading@10 10055 tools/graph2dot -o graph.tmp && \
yading@10 10056 dot -Tpng graph.tmp -o graph.png && \
yading@10 10057 display graph.png
yading@10 10058
yading@10 10059
yading@10 10060 can be used to create and display an image representing the graph
yading@10 10061 described by the I<GRAPH_DESCRIPTION> string. Note that this string must be
yading@10 10062 a complete self-contained graph, with its inputs and outputs explicitly defined.
yading@10 10063 For example if your command line is of the form:
yading@10 10064
yading@10 10065 ffmpeg -i infile -vf scale=640:360 outfile
yading@10 10066
yading@10 10067 your I<GRAPH_DESCRIPTION> string will need to be of the form:
yading@10 10068
yading@10 10069 nullsrc,scale=640:360,nullsink
yading@10 10070
yading@10 10071 you may also need to set the I<nullsrc> parameters and add a I<format>
yading@10 10072 filter in order to simulate a specific input file.
yading@10 10073
yading@10 10074
yading@10 10075
yading@10 10076 =head1 FILTERGRAPH DESCRIPTION
yading@10 10077
yading@10 10078
yading@10 10079 A filtergraph is a directed graph of connected filters. It can contain
yading@10 10080 cycles, and there can be multiple links between a pair of
yading@10 10081 filters. Each link has one input pad on one side connecting it to one
yading@10 10082 filter from which it takes its input, and one output pad on the other
yading@10 10083 side connecting it to the one filter accepting its output.
yading@10 10084
yading@10 10085 Each filter in a filtergraph is an instance of a filter class
yading@10 10086 registered in the application, which defines the features and the
yading@10 10087 number of input and output pads of the filter.
yading@10 10088
yading@10 10089 A filter with no input pads is called a "source", a filter with no
yading@10 10090 output pads is called a "sink".
yading@10 10091
yading@10 10092
yading@10 10093
yading@10 10094 =head2 Filtergraph syntax
yading@10 10095
yading@10 10096
yading@10 10097 A filtergraph can be represented using a textual representation, which is
yading@10 10098 recognized by the B<-filter>/B<-vf> and B<-filter_complex>
yading@10 10099 options in B<ffmpeg> and B<-vf> in B<ffplay>, and by the
yading@10 10100 C<avfilter_graph_parse()>/C<avfilter_graph_parse2()> function defined in
yading@10 10101 F<libavfilter/avfilter.h>.
yading@10 10102
yading@10 10103 A filterchain consists of a sequence of connected filters, each one
yading@10 10104 connected to the previous one in the sequence. A filterchain is
yading@10 10105 represented by a list of ","-separated filter descriptions.
yading@10 10106
yading@10 10107 A filtergraph consists of a sequence of filterchains. A sequence of
yading@10 10108 filterchains is represented by a list of ";"-separated filterchain
yading@10 10109 descriptions.
yading@10 10110
yading@10 10111 A filter is represented by a string of the form:
yading@10 10112 [I<in_link_1>]...[I<in_link_N>]I<filter_name>=I<arguments>[I<out_link_1>]...[I<out_link_M>]
yading@10 10113
yading@10 10114 I<filter_name> is the name of the filter class of which the
yading@10 10115 described filter is an instance of, and has to be the name of one of
yading@10 10116 the filter classes registered in the program.
yading@10 10117 The name of the filter class is optionally followed by a string
yading@10 10118 "=I<arguments>".
yading@10 10119
yading@10 10120 I<arguments> is a string which contains the parameters used to
yading@10 10121 initialize the filter instance. It may have one of the following forms:
yading@10 10122
yading@10 10123 =over 4
yading@10 10124
yading@10 10125
yading@10 10126
yading@10 10127 =item *
yading@10 10128
yading@10 10129 A ':'-separated list of I<key=value> pairs.
yading@10 10130
yading@10 10131
yading@10 10132 =item *
yading@10 10133
yading@10 10134 A ':'-separated list of I<value>. In this case, the keys are assumed to be
yading@10 10135 the option names in the order they are declared. E.g. the C<fade> filter
yading@10 10136 declares three options in this order -- B<type>, B<start_frame> and
yading@10 10137 B<nb_frames>. Then the parameter list I<in:0:30> means that the value
yading@10 10138 I<in> is assigned to the option B<type>, I<0> to
yading@10 10139 B<start_frame> and I<30> to B<nb_frames>.
yading@10 10140
yading@10 10141
yading@10 10142 =item *
yading@10 10143
yading@10 10144 A ':'-separated list of mixed direct I<value> and long I<key=value>
yading@10 10145 pairs. The direct I<value> must precede the I<key=value> pairs, and
yading@10 10146 follow the same constraints order of the previous point. The following
yading@10 10147 I<key=value> pairs can be set in any preferred order.
yading@10 10148
yading@10 10149
yading@10 10150 =back
yading@10 10151
yading@10 10152
yading@10 10153 If the option value itself is a list of items (e.g. the C<format> filter
yading@10 10154 takes a list of pixel formats), the items in the list are usually separated by
yading@10 10155 '|'.
yading@10 10156
yading@10 10157 The list of arguments can be quoted using the character "'" as initial
yading@10 10158 and ending mark, and the character '\' for escaping the characters
yading@10 10159 within the quoted text; otherwise the argument string is considered
yading@10 10160 terminated when the next special character (belonging to the set
yading@10 10161 "[]=;,") is encountered.
yading@10 10162
yading@10 10163 The name and arguments of the filter are optionally preceded and
yading@10 10164 followed by a list of link labels.
yading@10 10165 A link label allows to name a link and associate it to a filter output
yading@10 10166 or input pad. The preceding labels I<in_link_1>
yading@10 10167 ... I<in_link_N>, are associated to the filter input pads,
yading@10 10168 the following labels I<out_link_1> ... I<out_link_M>, are
yading@10 10169 associated to the output pads.
yading@10 10170
yading@10 10171 When two link labels with the same name are found in the
yading@10 10172 filtergraph, a link between the corresponding input and output pad is
yading@10 10173 created.
yading@10 10174
yading@10 10175 If an output pad is not labelled, it is linked by default to the first
yading@10 10176 unlabelled input pad of the next filter in the filterchain.
yading@10 10177 For example in the filterchain:
yading@10 10178
yading@10 10179 nullsrc, split[L1], [L2]overlay, nullsink
yading@10 10180
yading@10 10181 the split filter instance has two output pads, and the overlay filter
yading@10 10182 instance two input pads. The first output pad of split is labelled
yading@10 10183 "L1", the first input pad of overlay is labelled "L2", and the second
yading@10 10184 output pad of split is linked to the second input pad of overlay,
yading@10 10185 which are both unlabelled.
yading@10 10186
yading@10 10187 In a complete filterchain all the unlabelled filter input and output
yading@10 10188 pads must be connected. A filtergraph is considered valid if all the
yading@10 10189 filter input and output pads of all the filterchains are connected.
yading@10 10190
yading@10 10191 Libavfilter will automatically insert scale filters where format
yading@10 10192 conversion is required. It is possible to specify swscale flags
yading@10 10193 for those automatically inserted scalers by prepending
yading@10 10194 C<sws_flags=I<flags>;>
yading@10 10195 to the filtergraph description.
yading@10 10196
yading@10 10197 Follows a BNF description for the filtergraph syntax:
yading@10 10198
yading@10 10199 <NAME> ::= sequence of alphanumeric characters and '_'
yading@10 10200 <LINKLABEL> ::= "[" <NAME> "]"
yading@10 10201 <LINKLABELS> ::= <LINKLABEL> [<LINKLABELS>]
yading@10 10202 <FILTER_ARGUMENTS> ::= sequence of chars (eventually quoted)
yading@10 10203 <FILTER> ::= [<LINKLABELS>] <NAME> ["=" <FILTER_ARGUMENTS>] [<LINKLABELS>]
yading@10 10204 <FILTERCHAIN> ::= <FILTER> [,<FILTERCHAIN>]
yading@10 10205 <FILTERGRAPH> ::= [sws_flags=<flags>;] <FILTERCHAIN> [;<FILTERGRAPH>]
yading@10 10206
yading@10 10207
yading@10 10208
yading@10 10209 =head2 Notes on filtergraph escaping
yading@10 10210
yading@10 10211
yading@10 10212 Some filter arguments require the use of special characters, typically
yading@10 10213 C<:> to separate key=value pairs in a named options list. In this
yading@10 10214 case the user should perform a first level escaping when specifying
yading@10 10215 the filter arguments. For example, consider the following literal
yading@10 10216 string to be embedded in the drawtext filter arguments:
yading@10 10217
yading@10 10218 this is a 'string': may contain one, or more, special characters
yading@10 10219
yading@10 10220
yading@10 10221 Since C<:> is special for the filter arguments syntax, it needs to
yading@10 10222 be escaped, so you get:
yading@10 10223
yading@10 10224 text=this is a \'string\'\: may contain one, or more, special characters
yading@10 10225
yading@10 10226
yading@10 10227 A second level of escaping is required when embedding the filter
yading@10 10228 arguments in a filtergraph description, in order to escape all the
yading@10 10229 filtergraph special characters. Thus the example above becomes:
yading@10 10230
yading@10 10231 drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
yading@10 10232
yading@10 10233
yading@10 10234 Finally an additional level of escaping may be needed when writing the
yading@10 10235 filtergraph description in a shell command, which depends on the
yading@10 10236 escaping rules of the adopted shell. For example, assuming that
yading@10 10237 C<\> is special and needs to be escaped with another C<\>, the
yading@10 10238 previous string will finally result in:
yading@10 10239
yading@10 10240 -vf "drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters"
yading@10 10241
yading@10 10242
yading@10 10243 Sometimes, it might be more convenient to employ quoting in place of
yading@10 10244 escaping. For example the string:
yading@10 10245
yading@10 10246 Caesar: tu quoque, Brute, fili mi
yading@10 10247
yading@10 10248
yading@10 10249 Can be quoted in the filter arguments as:
yading@10 10250
yading@10 10251 text='Caesar: tu quoque, Brute, fili mi'
yading@10 10252
yading@10 10253
yading@10 10254 And finally inserted in a filtergraph like:
yading@10 10255
yading@10 10256 drawtext=text=\'Caesar: tu quoque\, Brute\, fili mi\'
yading@10 10257
yading@10 10258
yading@10 10259 See the ``Quoting and escaping'' section in the ffmpeg-utils manual
yading@10 10260 for more information about the escaping and quoting rules adopted by
yading@10 10261 FFmpeg.
yading@10 10262
yading@10 10263
yading@10 10264
yading@10 10265 =head1 AUDIO FILTERS
yading@10 10266
yading@10 10267
yading@10 10268 When you configure your FFmpeg build, you can disable any of the
yading@10 10269 existing filters using C<--disable-filters>.
yading@10 10270 The configure output will show the audio filters included in your
yading@10 10271 build.
yading@10 10272
yading@10 10273 Below is a description of the currently available audio filters.
yading@10 10274
yading@10 10275
yading@10 10276 =head2 aconvert
yading@10 10277
yading@10 10278
yading@10 10279 Convert the input audio format to the specified formats.
yading@10 10280
yading@10 10281 I<This filter is deprecated. Use aformat> instead.
yading@10 10282
yading@10 10283 The filter accepts a string of the form:
yading@10 10284 "I<sample_format>:I<channel_layout>".
yading@10 10285
yading@10 10286 I<sample_format> specifies the sample format, and can be a string or the
yading@10 10287 corresponding numeric value defined in F<libavutil/samplefmt.h>. Use 'p'
yading@10 10288 suffix for a planar sample format.
yading@10 10289
yading@10 10290 I<channel_layout> specifies the channel layout, and can be a string
yading@10 10291 or the corresponding number value defined in F<libavutil/channel_layout.h>.
yading@10 10292
yading@10 10293 The special parameter "auto", signifies that the filter will
yading@10 10294 automatically select the output format depending on the output filter.
yading@10 10295
yading@10 10296
yading@10 10297 =head3 Examples
yading@10 10298
yading@10 10299
yading@10 10300
yading@10 10301 =over 4
yading@10 10302
yading@10 10303
yading@10 10304 =item *
yading@10 10305
yading@10 10306 Convert input to float, planar, stereo:
yading@10 10307
yading@10 10308 aconvert=fltp:stereo
yading@10 10309
yading@10 10310
yading@10 10311
yading@10 10312 =item *
yading@10 10313
yading@10 10314 Convert input to unsigned 8-bit, automatically select out channel layout:
yading@10 10315
yading@10 10316 aconvert=u8:auto
yading@10 10317
yading@10 10318
yading@10 10319 =back
yading@10 10320
yading@10 10321
yading@10 10322
yading@10 10323 =head2 allpass
yading@10 10324
yading@10 10325
yading@10 10326 Apply a two-pole all-pass filter with central frequency (in Hz)
yading@10 10327 I<frequency>, and filter-width I<width>.
yading@10 10328 An all-pass filter changes the audio's frequency to phase relationship
yading@10 10329 without changing its frequency to amplitude relationship.
yading@10 10330
yading@10 10331 The filter accepts the following options:
yading@10 10332
yading@10 10333
yading@10 10334 =over 4
yading@10 10335
yading@10 10336
yading@10 10337 =item B<frequency, f>
yading@10 10338
yading@10 10339 Set frequency in Hz.
yading@10 10340
yading@10 10341
yading@10 10342 =item B<width_type>
yading@10 10343
yading@10 10344 Set method to specify band-width of filter.
yading@10 10345
yading@10 10346 =over 4
yading@10 10347
yading@10 10348
yading@10 10349 =item B<h>
yading@10 10350
yading@10 10351 Hz
yading@10 10352
yading@10 10353 =item B<q>
yading@10 10354
yading@10 10355 Q-Factor
yading@10 10356
yading@10 10357 =item B<o>
yading@10 10358
yading@10 10359 octave
yading@10 10360
yading@10 10361 =item B<s>
yading@10 10362
yading@10 10363 slope
yading@10 10364
yading@10 10365 =back
yading@10 10366
yading@10 10367
yading@10 10368
yading@10 10369 =item B<width, w>
yading@10 10370
yading@10 10371 Specify the band-width of a filter in width_type units.
yading@10 10372
yading@10 10373 =back
yading@10 10374
yading@10 10375
yading@10 10376
yading@10 10377 =head2 highpass
yading@10 10378
yading@10 10379
yading@10 10380 Apply a high-pass filter with 3dB point frequency.
yading@10 10381 The filter can be either single-pole, or double-pole (the default).
yading@10 10382 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
yading@10 10383
yading@10 10384 The filter accepts the following options:
yading@10 10385
yading@10 10386
yading@10 10387 =over 4
yading@10 10388
yading@10 10389
yading@10 10390 =item B<frequency, f>
yading@10 10391
yading@10 10392 Set frequency in Hz. Default is 3000.
yading@10 10393
yading@10 10394
yading@10 10395 =item B<poles, p>
yading@10 10396
yading@10 10397 Set number of poles. Default is 2.
yading@10 10398
yading@10 10399
yading@10 10400 =item B<width_type>
yading@10 10401
yading@10 10402 Set method to specify band-width of filter.
yading@10 10403
yading@10 10404 =over 4
yading@10 10405
yading@10 10406
yading@10 10407 =item B<h>
yading@10 10408
yading@10 10409 Hz
yading@10 10410
yading@10 10411 =item B<q>
yading@10 10412
yading@10 10413 Q-Factor
yading@10 10414
yading@10 10415 =item B<o>
yading@10 10416
yading@10 10417 octave
yading@10 10418
yading@10 10419 =item B<s>
yading@10 10420
yading@10 10421 slope
yading@10 10422
yading@10 10423 =back
yading@10 10424
yading@10 10425
yading@10 10426
yading@10 10427 =item B<width, w>
yading@10 10428
yading@10 10429 Specify the band-width of a filter in width_type units.
yading@10 10430 Applies only to double-pole filter.
yading@10 10431 The default is 0.707q and gives a Butterworth response.
yading@10 10432
yading@10 10433 =back
yading@10 10434
yading@10 10435
yading@10 10436
yading@10 10437 =head2 lowpass
yading@10 10438
yading@10 10439
yading@10 10440 Apply a low-pass filter with 3dB point frequency.
yading@10 10441 The filter can be either single-pole or double-pole (the default).
yading@10 10442 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
yading@10 10443
yading@10 10444 The filter accepts the following options:
yading@10 10445
yading@10 10446
yading@10 10447 =over 4
yading@10 10448
yading@10 10449
yading@10 10450 =item B<frequency, f>
yading@10 10451
yading@10 10452 Set frequency in Hz. Default is 500.
yading@10 10453
yading@10 10454
yading@10 10455 =item B<poles, p>
yading@10 10456
yading@10 10457 Set number of poles. Default is 2.
yading@10 10458
yading@10 10459
yading@10 10460 =item B<width_type>
yading@10 10461
yading@10 10462 Set method to specify band-width of filter.
yading@10 10463
yading@10 10464 =over 4
yading@10 10465
yading@10 10466
yading@10 10467 =item B<h>
yading@10 10468
yading@10 10469 Hz
yading@10 10470
yading@10 10471 =item B<q>
yading@10 10472
yading@10 10473 Q-Factor
yading@10 10474
yading@10 10475 =item B<o>
yading@10 10476
yading@10 10477 octave
yading@10 10478
yading@10 10479 =item B<s>
yading@10 10480
yading@10 10481 slope
yading@10 10482
yading@10 10483 =back
yading@10 10484
yading@10 10485
yading@10 10486
yading@10 10487 =item B<width, w>
yading@10 10488
yading@10 10489 Specify the band-width of a filter in width_type units.
yading@10 10490 Applies only to double-pole filter.
yading@10 10491 The default is 0.707q and gives a Butterworth response.
yading@10 10492
yading@10 10493 =back
yading@10 10494
yading@10 10495
yading@10 10496
yading@10 10497 =head2 bass
yading@10 10498
yading@10 10499
yading@10 10500 Boost or cut the bass (lower) frequencies of the audio using a two-pole
yading@10 10501 shelving filter with a response similar to that of a standard
yading@10 10502 hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
yading@10 10503
yading@10 10504 The filter accepts the following options:
yading@10 10505
yading@10 10506
yading@10 10507 =over 4
yading@10 10508
yading@10 10509
yading@10 10510 =item B<gain, g>
yading@10 10511
yading@10 10512 Give the gain at 0 Hz. Its useful range is about -20
yading@10 10513 (for a large cut) to +20 (for a large boost).
yading@10 10514 Beware of clipping when using a positive gain.
yading@10 10515
yading@10 10516
yading@10 10517 =item B<frequency, f>
yading@10 10518
yading@10 10519 Set the filter's central frequency and so can be used
yading@10 10520 to extend or reduce the frequency range to be boosted or cut.
yading@10 10521 The default value is C<100> Hz.
yading@10 10522
yading@10 10523
yading@10 10524 =item B<width_type>
yading@10 10525
yading@10 10526 Set method to specify band-width of filter.
yading@10 10527
yading@10 10528 =over 4
yading@10 10529
yading@10 10530
yading@10 10531 =item B<h>
yading@10 10532
yading@10 10533 Hz
yading@10 10534
yading@10 10535 =item B<q>
yading@10 10536
yading@10 10537 Q-Factor
yading@10 10538
yading@10 10539 =item B<o>
yading@10 10540
yading@10 10541 octave
yading@10 10542
yading@10 10543 =item B<s>
yading@10 10544
yading@10 10545 slope
yading@10 10546
yading@10 10547 =back
yading@10 10548
yading@10 10549
yading@10 10550
yading@10 10551 =item B<width, w>
yading@10 10552
yading@10 10553 Determine how steep is the filter's shelf transition.
yading@10 10554
yading@10 10555 =back
yading@10 10556
yading@10 10557
yading@10 10558
yading@10 10559 =head2 treble
yading@10 10560
yading@10 10561
yading@10 10562 Boost or cut treble (upper) frequencies of the audio using a two-pole
yading@10 10563 shelving filter with a response similar to that of a standard
yading@10 10564 hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
yading@10 10565
yading@10 10566 The filter accepts the following options:
yading@10 10567
yading@10 10568
yading@10 10569 =over 4
yading@10 10570
yading@10 10571
yading@10 10572 =item B<gain, g>
yading@10 10573
yading@10 10574 Give the gain at whichever is the lower of ~22 kHz and the
yading@10 10575 Nyquist frequency. Its useful range is about -20 (for a large cut)
yading@10 10576 to +20 (for a large boost). Beware of clipping when using a positive gain.
yading@10 10577
yading@10 10578
yading@10 10579 =item B<frequency, f>
yading@10 10580
yading@10 10581 Set the filter's central frequency and so can be used
yading@10 10582 to extend or reduce the frequency range to be boosted or cut.
yading@10 10583 The default value is C<3000> Hz.
yading@10 10584
yading@10 10585
yading@10 10586 =item B<width_type>
yading@10 10587
yading@10 10588 Set method to specify band-width of filter.
yading@10 10589
yading@10 10590 =over 4
yading@10 10591
yading@10 10592
yading@10 10593 =item B<h>
yading@10 10594
yading@10 10595 Hz
yading@10 10596
yading@10 10597 =item B<q>
yading@10 10598
yading@10 10599 Q-Factor
yading@10 10600
yading@10 10601 =item B<o>
yading@10 10602
yading@10 10603 octave
yading@10 10604
yading@10 10605 =item B<s>
yading@10 10606
yading@10 10607 slope
yading@10 10608
yading@10 10609 =back
yading@10 10610
yading@10 10611
yading@10 10612
yading@10 10613 =item B<width, w>
yading@10 10614
yading@10 10615 Determine how steep is the filter's shelf transition.
yading@10 10616
yading@10 10617 =back
yading@10 10618
yading@10 10619
yading@10 10620
yading@10 10621 =head2 bandpass
yading@10 10622
yading@10 10623
yading@10 10624 Apply a two-pole Butterworth band-pass filter with central
yading@10 10625 frequency I<frequency>, and (3dB-point) band-width width.
yading@10 10626 The I<csg> option selects a constant skirt gain (peak gain = Q)
yading@10 10627 instead of the default: constant 0dB peak gain.
yading@10 10628 The filter roll off at 6dB per octave (20dB per decade).
yading@10 10629
yading@10 10630 The filter accepts the following options:
yading@10 10631
yading@10 10632
yading@10 10633 =over 4
yading@10 10634
yading@10 10635
yading@10 10636 =item B<frequency, f>
yading@10 10637
yading@10 10638 Set the filter's central frequency. Default is C<3000>.
yading@10 10639
yading@10 10640
yading@10 10641 =item B<csg>
yading@10 10642
yading@10 10643 Constant skirt gain if set to 1. Defaults to 0.
yading@10 10644
yading@10 10645
yading@10 10646 =item B<width_type>
yading@10 10647
yading@10 10648 Set method to specify band-width of filter.
yading@10 10649
yading@10 10650 =over 4
yading@10 10651
yading@10 10652
yading@10 10653 =item B<h>
yading@10 10654
yading@10 10655 Hz
yading@10 10656
yading@10 10657 =item B<q>
yading@10 10658
yading@10 10659 Q-Factor
yading@10 10660
yading@10 10661 =item B<o>
yading@10 10662
yading@10 10663 octave
yading@10 10664
yading@10 10665 =item B<s>
yading@10 10666
yading@10 10667 slope
yading@10 10668
yading@10 10669 =back
yading@10 10670
yading@10 10671
yading@10 10672
yading@10 10673 =item B<width, w>
yading@10 10674
yading@10 10675 Specify the band-width of a filter in width_type units.
yading@10 10676
yading@10 10677 =back
yading@10 10678
yading@10 10679
yading@10 10680
yading@10 10681 =head2 bandreject
yading@10 10682
yading@10 10683
yading@10 10684 Apply a two-pole Butterworth band-reject filter with central
yading@10 10685 frequency I<frequency>, and (3dB-point) band-width I<width>.
yading@10 10686 The filter roll off at 6dB per octave (20dB per decade).
yading@10 10687
yading@10 10688 The filter accepts the following options:
yading@10 10689
yading@10 10690
yading@10 10691 =over 4
yading@10 10692
yading@10 10693
yading@10 10694 =item B<frequency, f>
yading@10 10695
yading@10 10696 Set the filter's central frequency. Default is C<3000>.
yading@10 10697
yading@10 10698
yading@10 10699 =item B<width_type>
yading@10 10700
yading@10 10701 Set method to specify band-width of filter.
yading@10 10702
yading@10 10703 =over 4
yading@10 10704
yading@10 10705
yading@10 10706 =item B<h>
yading@10 10707
yading@10 10708 Hz
yading@10 10709
yading@10 10710 =item B<q>
yading@10 10711
yading@10 10712 Q-Factor
yading@10 10713
yading@10 10714 =item B<o>
yading@10 10715
yading@10 10716 octave
yading@10 10717
yading@10 10718 =item B<s>
yading@10 10719
yading@10 10720 slope
yading@10 10721
yading@10 10722 =back
yading@10 10723
yading@10 10724
yading@10 10725
yading@10 10726 =item B<width, w>
yading@10 10727
yading@10 10728 Specify the band-width of a filter in width_type units.
yading@10 10729
yading@10 10730 =back
yading@10 10731
yading@10 10732
yading@10 10733
yading@10 10734 =head2 biquad
yading@10 10735
yading@10 10736
yading@10 10737 Apply a biquad IIR filter with the given coefficients.
yading@10 10738 Where I<b0>, I<b1>, I<b2> and I<a0>, I<a1>, I<a2>
yading@10 10739 are the numerator and denominator coefficients respectively.
yading@10 10740
yading@10 10741
yading@10 10742 =head2 equalizer
yading@10 10743
yading@10 10744
yading@10 10745 Apply a two-pole peaking equalisation (EQ) filter. With this
yading@10 10746 filter, the signal-level at and around a selected frequency can
yading@10 10747 be increased or decreased, whilst (unlike bandpass and bandreject
yading@10 10748 filters) that at all other frequencies is unchanged.
yading@10 10749
yading@10 10750 In order to produce complex equalisation curves, this filter can
yading@10 10751 be given several times, each with a different central frequency.
yading@10 10752
yading@10 10753 The filter accepts the following options:
yading@10 10754
yading@10 10755
yading@10 10756 =over 4
yading@10 10757
yading@10 10758
yading@10 10759 =item B<frequency, f>
yading@10 10760
yading@10 10761 Set the filter's central frequency in Hz.
yading@10 10762
yading@10 10763
yading@10 10764 =item B<width_type>
yading@10 10765
yading@10 10766 Set method to specify band-width of filter.
yading@10 10767
yading@10 10768 =over 4
yading@10 10769
yading@10 10770
yading@10 10771 =item B<h>
yading@10 10772
yading@10 10773 Hz
yading@10 10774
yading@10 10775 =item B<q>
yading@10 10776
yading@10 10777 Q-Factor
yading@10 10778
yading@10 10779 =item B<o>
yading@10 10780
yading@10 10781 octave
yading@10 10782
yading@10 10783 =item B<s>
yading@10 10784
yading@10 10785 slope
yading@10 10786
yading@10 10787 =back
yading@10 10788
yading@10 10789
yading@10 10790
yading@10 10791 =item B<width, w>
yading@10 10792
yading@10 10793 Specify the band-width of a filter in width_type units.
yading@10 10794
yading@10 10795
yading@10 10796 =item B<gain, g>
yading@10 10797
yading@10 10798 Set the required gain or attenuation in dB.
yading@10 10799 Beware of clipping when using a positive gain.
yading@10 10800
yading@10 10801 =back
yading@10 10802
yading@10 10803
yading@10 10804
yading@10 10805 =head2 afade
yading@10 10806
yading@10 10807
yading@10 10808 Apply fade-in/out effect to input audio.
yading@10 10809
yading@10 10810 A description of the accepted parameters follows.
yading@10 10811
yading@10 10812
yading@10 10813 =over 4
yading@10 10814
yading@10 10815
yading@10 10816 =item B<type, t>
yading@10 10817
yading@10 10818 Specify the effect type, can be either C<in> for fade-in, or
yading@10 10819 C<out> for a fade-out effect. Default is C<in>.
yading@10 10820
yading@10 10821
yading@10 10822 =item B<start_sample, ss>
yading@10 10823
yading@10 10824 Specify the number of the start sample for starting to apply the fade
yading@10 10825 effect. Default is 0.
yading@10 10826
yading@10 10827
yading@10 10828 =item B<nb_samples, ns>
yading@10 10829
yading@10 10830 Specify the number of samples for which the fade effect has to last. At
yading@10 10831 the end of the fade-in effect the output audio will have the same
yading@10 10832 volume as the input audio, at the end of the fade-out transition
yading@10 10833 the output audio will be silence. Default is 44100.
yading@10 10834
yading@10 10835
yading@10 10836 =item B<start_time, st>
yading@10 10837
yading@10 10838 Specify time for starting to apply the fade effect. Default is 0.
yading@10 10839 The accepted syntax is:
yading@10 10840
yading@10 10841 [-]HH[:MM[:SS[.m...]]]
yading@10 10842 [-]S+[.m...]
yading@10 10843
yading@10 10844 See also the function C<av_parse_time()>.
yading@10 10845 If set this option is used instead of I<start_sample> one.
yading@10 10846
yading@10 10847
yading@10 10848 =item B<duration, d>
yading@10 10849
yading@10 10850 Specify the duration for which the fade effect has to last. Default is 0.
yading@10 10851 The accepted syntax is:
yading@10 10852
yading@10 10853 [-]HH[:MM[:SS[.m...]]]
yading@10 10854 [-]S+[.m...]
yading@10 10855
yading@10 10856 See also the function C<av_parse_time()>.
yading@10 10857 At the end of the fade-in effect the output audio will have the same
yading@10 10858 volume as the input audio, at the end of the fade-out transition
yading@10 10859 the output audio will be silence.
yading@10 10860 If set this option is used instead of I<nb_samples> one.
yading@10 10861
yading@10 10862
yading@10 10863 =item B<curve>
yading@10 10864
yading@10 10865 Set curve for fade transition.
yading@10 10866
yading@10 10867 It accepts the following values:
yading@10 10868
yading@10 10869 =over 4
yading@10 10870
yading@10 10871
yading@10 10872 =item B<tri>
yading@10 10873
yading@10 10874 select triangular, linear slope (default)
yading@10 10875
yading@10 10876 =item B<qsin>
yading@10 10877
yading@10 10878 select quarter of sine wave
yading@10 10879
yading@10 10880 =item B<hsin>
yading@10 10881
yading@10 10882 select half of sine wave
yading@10 10883
yading@10 10884 =item B<esin>
yading@10 10885
yading@10 10886 select exponential sine wave
yading@10 10887
yading@10 10888 =item B<log>
yading@10 10889
yading@10 10890 select logarithmic
yading@10 10891
yading@10 10892 =item B<par>
yading@10 10893
yading@10 10894 select inverted parabola
yading@10 10895
yading@10 10896 =item B<qua>
yading@10 10897
yading@10 10898 select quadratic
yading@10 10899
yading@10 10900 =item B<cub>
yading@10 10901
yading@10 10902 select cubic
yading@10 10903
yading@10 10904 =item B<squ>
yading@10 10905
yading@10 10906 select square root
yading@10 10907
yading@10 10908 =item B<cbr>
yading@10 10909
yading@10 10910 select cubic root
yading@10 10911
yading@10 10912 =back
yading@10 10913
yading@10 10914
yading@10 10915 =back
yading@10 10916
yading@10 10917
yading@10 10918
yading@10 10919 =head3 Examples
yading@10 10920
yading@10 10921
yading@10 10922
yading@10 10923 =over 4
yading@10 10924
yading@10 10925
yading@10 10926 =item *
yading@10 10927
yading@10 10928 Fade in first 15 seconds of audio:
yading@10 10929
yading@10 10930 afade=t=in:ss=0:d=15
yading@10 10931
yading@10 10932
yading@10 10933
yading@10 10934 =item *
yading@10 10935
yading@10 10936 Fade out last 25 seconds of a 900 seconds audio:
yading@10 10937
yading@10 10938 afade=t=out:ss=875:d=25
yading@10 10939
yading@10 10940
yading@10 10941 =back
yading@10 10942
yading@10 10943
yading@10 10944
yading@10 10945
yading@10 10946 =head2 aformat
yading@10 10947
yading@10 10948
yading@10 10949 Set output format constraints for the input audio. The framework will
yading@10 10950 negotiate the most appropriate format to minimize conversions.
yading@10 10951
yading@10 10952 The filter accepts the following named parameters:
yading@10 10953
yading@10 10954 =over 4
yading@10 10955
yading@10 10956
yading@10 10957
yading@10 10958 =item B<sample_fmts>
yading@10 10959
yading@10 10960 A '|'-separated list of requested sample formats.
yading@10 10961
yading@10 10962
yading@10 10963 =item B<sample_rates>
yading@10 10964
yading@10 10965 A '|'-separated list of requested sample rates.
yading@10 10966
yading@10 10967
yading@10 10968 =item B<channel_layouts>
yading@10 10969
yading@10 10970 A '|'-separated list of requested channel layouts.
yading@10 10971
yading@10 10972
yading@10 10973 =back
yading@10 10974
yading@10 10975
yading@10 10976 If a parameter is omitted, all values are allowed.
yading@10 10977
yading@10 10978 For example to force the output to either unsigned 8-bit or signed 16-bit stereo:
yading@10 10979
yading@10 10980 aformat=sample_fmts=u8|s16:channel_layouts=stereo
yading@10 10981
yading@10 10982
yading@10 10983
yading@10 10984 =head2 amerge
yading@10 10985
yading@10 10986
yading@10 10987 Merge two or more audio streams into a single multi-channel stream.
yading@10 10988
yading@10 10989 The filter accepts the following options:
yading@10 10990
yading@10 10991
yading@10 10992 =over 4
yading@10 10993
yading@10 10994
yading@10 10995
yading@10 10996 =item B<inputs>
yading@10 10997
yading@10 10998 Set the number of inputs. Default is 2.
yading@10 10999
yading@10 11000
yading@10 11001 =back
yading@10 11002
yading@10 11003
yading@10 11004 If the channel layouts of the inputs are disjoint, and therefore compatible,
yading@10 11005 the channel layout of the output will be set accordingly and the channels
yading@10 11006 will be reordered as necessary. If the channel layouts of the inputs are not
yading@10 11007 disjoint, the output will have all the channels of the first input then all
yading@10 11008 the channels of the second input, in that order, and the channel layout of
yading@10 11009 the output will be the default value corresponding to the total number of
yading@10 11010 channels.
yading@10 11011
yading@10 11012 For example, if the first input is in 2.1 (FL+FR+LF) and the second input
yading@10 11013 is FC+BL+BR, then the output will be in 5.1, with the channels in the
yading@10 11014 following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
yading@10 11015 first input, b1 is the first channel of the second input).
yading@10 11016
yading@10 11017 On the other hand, if both input are in stereo, the output channels will be
yading@10 11018 in the default order: a1, a2, b1, b2, and the channel layout will be
yading@10 11019 arbitrarily set to 4.0, which may or may not be the expected value.
yading@10 11020
yading@10 11021 All inputs must have the same sample rate, and format.
yading@10 11022
yading@10 11023 If inputs do not have the same duration, the output will stop with the
yading@10 11024 shortest.
yading@10 11025
yading@10 11026
yading@10 11027 =head3 Examples
yading@10 11028
yading@10 11029
yading@10 11030
yading@10 11031 =over 4
yading@10 11032
yading@10 11033
yading@10 11034 =item *
yading@10 11035
yading@10 11036 Merge two mono files into a stereo stream:
yading@10 11037
yading@10 11038 amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
yading@10 11039
yading@10 11040
yading@10 11041
yading@10 11042 =item *
yading@10 11043
yading@10 11044 Multiple merges assuming 1 video stream and 6 audio streams in F<input.mkv>:
yading@10 11045
yading@10 11046 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 11047
yading@10 11048
yading@10 11049 =back
yading@10 11050
yading@10 11051
yading@10 11052
yading@10 11053 =head2 amix
yading@10 11054
yading@10 11055
yading@10 11056 Mixes multiple audio inputs into a single output.
yading@10 11057
yading@10 11058 For example
yading@10 11059
yading@10 11060 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
yading@10 11061
yading@10 11062 will mix 3 input audio streams to a single output with the same duration as the
yading@10 11063 first input and a dropout transition time of 3 seconds.
yading@10 11064
yading@10 11065 The filter accepts the following named parameters:
yading@10 11066
yading@10 11067 =over 4
yading@10 11068
yading@10 11069
yading@10 11070
yading@10 11071 =item B<inputs>
yading@10 11072
yading@10 11073 Number of inputs. If unspecified, it defaults to 2.
yading@10 11074
yading@10 11075
yading@10 11076 =item B<duration>
yading@10 11077
yading@10 11078 How to determine the end-of-stream.
yading@10 11079
yading@10 11080 =over 4
yading@10 11081
yading@10 11082
yading@10 11083
yading@10 11084 =item B<longest>
yading@10 11085
yading@10 11086 Duration of longest input. (default)
yading@10 11087
yading@10 11088
yading@10 11089 =item B<shortest>
yading@10 11090
yading@10 11091 Duration of shortest input.
yading@10 11092
yading@10 11093
yading@10 11094 =item B<first>
yading@10 11095
yading@10 11096 Duration of first input.
yading@10 11097
yading@10 11098
yading@10 11099 =back
yading@10 11100
yading@10 11101
yading@10 11102
yading@10 11103 =item B<dropout_transition>
yading@10 11104
yading@10 11105 Transition time, in seconds, for volume renormalization when an input
yading@10 11106 stream ends. The default value is 2 seconds.
yading@10 11107
yading@10 11108
yading@10 11109 =back
yading@10 11110
yading@10 11111
yading@10 11112
yading@10 11113 =head2 anull
yading@10 11114
yading@10 11115
yading@10 11116 Pass the audio source unchanged to the output.
yading@10 11117
yading@10 11118
yading@10 11119 =head2 apad
yading@10 11120
yading@10 11121
yading@10 11122 Pad the end of a audio stream with silence, this can be used together with
yading@10 11123 -shortest to extend audio streams to the same length as the video stream.
yading@10 11124
yading@10 11125
yading@10 11126 =head2 aphaser
yading@10 11127
yading@10 11128 Add a phasing effect to the input audio.
yading@10 11129
yading@10 11130 A phaser filter creates series of peaks and troughs in the frequency spectrum.
yading@10 11131 The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
yading@10 11132
yading@10 11133 A description of the accepted parameters follows.
yading@10 11134
yading@10 11135
yading@10 11136 =over 4
yading@10 11137
yading@10 11138
yading@10 11139 =item B<in_gain>
yading@10 11140
yading@10 11141 Set input gain. Default is 0.4.
yading@10 11142
yading@10 11143
yading@10 11144 =item B<out_gain>
yading@10 11145
yading@10 11146 Set output gain. Default is 0.74
yading@10 11147
yading@10 11148
yading@10 11149 =item B<delay>
yading@10 11150
yading@10 11151 Set delay in milliseconds. Default is 3.0.
yading@10 11152
yading@10 11153
yading@10 11154 =item B<decay>
yading@10 11155
yading@10 11156 Set decay. Default is 0.4.
yading@10 11157
yading@10 11158
yading@10 11159 =item B<speed>
yading@10 11160
yading@10 11161 Set modulation speed in Hz. Default is 0.5.
yading@10 11162
yading@10 11163
yading@10 11164 =item B<type>
yading@10 11165
yading@10 11166 Set modulation type. Default is triangular.
yading@10 11167
yading@10 11168 It accepts the following values:
yading@10 11169
yading@10 11170 =over 4
yading@10 11171
yading@10 11172
yading@10 11173 =item B<triangular, t>
yading@10 11174
yading@10 11175
yading@10 11176 =item B<sinusoidal, s>
yading@10 11177
yading@10 11178
yading@10 11179 =back
yading@10 11180
yading@10 11181
yading@10 11182 =back
yading@10 11183
yading@10 11184
yading@10 11185
yading@10 11186
yading@10 11187 =head2 aresample
yading@10 11188
yading@10 11189
yading@10 11190 Resample the input audio to the specified parameters, using the
yading@10 11191 libswresample library. If none are specified then the filter will
yading@10 11192 automatically convert between its input and output.
yading@10 11193
yading@10 11194 This filter is also able to stretch/squeeze the audio data to make it match
yading@10 11195 the timestamps or to inject silence / cut out audio to make it match the
yading@10 11196 timestamps, do a combination of both or do neither.
yading@10 11197
yading@10 11198 The filter accepts the syntax
yading@10 11199 [I<sample_rate>:]I<resampler_options>, where I<sample_rate>
yading@10 11200 expresses a sample rate and I<resampler_options> is a list of
yading@10 11201 I<key>=I<value> pairs, separated by ":". See the
yading@10 11202 ffmpeg-resampler manual for the complete list of supported options.
yading@10 11203
yading@10 11204
yading@10 11205 =head3 Examples
yading@10 11206
yading@10 11207
yading@10 11208
yading@10 11209 =over 4
yading@10 11210
yading@10 11211
yading@10 11212 =item *
yading@10 11213
yading@10 11214 Resample the input audio to 44100Hz:
yading@10 11215
yading@10 11216 aresample=44100
yading@10 11217
yading@10 11218
yading@10 11219
yading@10 11220 =item *
yading@10 11221
yading@10 11222 Stretch/squeeze samples to the given timestamps, with a maximum of 1000
yading@10 11223 samples per second compensation:
yading@10 11224
yading@10 11225 aresample=async=1000
yading@10 11226
yading@10 11227
yading@10 11228 =back
yading@10 11229
yading@10 11230
yading@10 11231
yading@10 11232 =head2 asetnsamples
yading@10 11233
yading@10 11234
yading@10 11235 Set the number of samples per each output audio frame.
yading@10 11236
yading@10 11237 The last output packet may contain a different number of samples, as
yading@10 11238 the filter will flush all the remaining samples when the input audio
yading@10 11239 signal its end.
yading@10 11240
yading@10 11241 The filter accepts the following options:
yading@10 11242
yading@10 11243
yading@10 11244 =over 4
yading@10 11245
yading@10 11246
yading@10 11247
yading@10 11248 =item B<nb_out_samples, n>
yading@10 11249
yading@10 11250 Set the number of frames per each output audio frame. The number is
yading@10 11251 intended as the number of samples I<per each channel>.
yading@10 11252 Default value is 1024.
yading@10 11253
yading@10 11254
yading@10 11255 =item B<pad, p>
yading@10 11256
yading@10 11257 If set to 1, the filter will pad the last audio frame with zeroes, so
yading@10 11258 that the last frame will contain the same number of samples as the
yading@10 11259 previous ones. Default value is 1.
yading@10 11260
yading@10 11261 =back
yading@10 11262
yading@10 11263
yading@10 11264 For example, to set the number of per-frame samples to 1234 and
yading@10 11265 disable padding for the last frame, use:
yading@10 11266
yading@10 11267 asetnsamples=n=1234:p=0
yading@10 11268
yading@10 11269
yading@10 11270
yading@10 11271 =head2 ashowinfo
yading@10 11272
yading@10 11273
yading@10 11274 Show a line containing various information for each input audio frame.
yading@10 11275 The input audio is not modified.
yading@10 11276
yading@10 11277 The shown line contains a sequence of key/value pairs of the form
yading@10 11278 I<key>:I<value>.
yading@10 11279
yading@10 11280 A description of each shown parameter follows:
yading@10 11281
yading@10 11282
yading@10 11283 =over 4
yading@10 11284
yading@10 11285
yading@10 11286 =item B<n>
yading@10 11287
yading@10 11288 sequential number of the input frame, starting from 0
yading@10 11289
yading@10 11290
yading@10 11291 =item B<pts>
yading@10 11292
yading@10 11293 Presentation timestamp of the input frame, in time base units; the time base
yading@10 11294 depends on the filter input pad, and is usually 1/I<sample_rate>.
yading@10 11295
yading@10 11296
yading@10 11297 =item B<pts_time>
yading@10 11298
yading@10 11299 presentation timestamp of the input frame in seconds
yading@10 11300
yading@10 11301
yading@10 11302 =item B<pos>
yading@10 11303
yading@10 11304 position of the frame in the input stream, -1 if this information in
yading@10 11305 unavailable and/or meaningless (for example in case of synthetic audio)
yading@10 11306
yading@10 11307
yading@10 11308 =item B<fmt>
yading@10 11309
yading@10 11310 sample format
yading@10 11311
yading@10 11312
yading@10 11313 =item B<chlayout>
yading@10 11314
yading@10 11315 channel layout
yading@10 11316
yading@10 11317
yading@10 11318 =item B<rate>
yading@10 11319
yading@10 11320 sample rate for the audio frame
yading@10 11321
yading@10 11322
yading@10 11323 =item B<nb_samples>
yading@10 11324
yading@10 11325 number of samples (per channel) in the frame
yading@10 11326
yading@10 11327
yading@10 11328 =item B<checksum>
yading@10 11329
yading@10 11330 Adler-32 checksum (printed in hexadecimal) of the audio data. For planar audio
yading@10 11331 the data is treated as if all the planes were concatenated.
yading@10 11332
yading@10 11333
yading@10 11334 =item B<plane_checksums>
yading@10 11335
yading@10 11336 A list of Adler-32 checksums for each data plane.
yading@10 11337
yading@10 11338 =back
yading@10 11339
yading@10 11340
yading@10 11341
yading@10 11342 =head2 astreamsync
yading@10 11343
yading@10 11344
yading@10 11345 Forward two audio streams and control the order the buffers are forwarded.
yading@10 11346
yading@10 11347 The filter accepts the following options:
yading@10 11348
yading@10 11349
yading@10 11350 =over 4
yading@10 11351
yading@10 11352
yading@10 11353 =item B<expr, e>
yading@10 11354
yading@10 11355 Set the expression deciding which stream should be
yading@10 11356 forwarded next: if the result is negative, the first stream is forwarded; if
yading@10 11357 the result is positive or zero, the second stream is forwarded. It can use
yading@10 11358 the following variables:
yading@10 11359
yading@10 11360
yading@10 11361 =over 4
yading@10 11362
yading@10 11363
yading@10 11364 =item I<b1 b2>
yading@10 11365
yading@10 11366 number of buffers forwarded so far on each stream
yading@10 11367
yading@10 11368 =item I<s1 s2>
yading@10 11369
yading@10 11370 number of samples forwarded so far on each stream
yading@10 11371
yading@10 11372 =item I<t1 t2>
yading@10 11373
yading@10 11374 current timestamp of each stream
yading@10 11375
yading@10 11376 =back
yading@10 11377
yading@10 11378
yading@10 11379 The default value is C<t1-t2>, which means to always forward the stream
yading@10 11380 that has a smaller timestamp.
yading@10 11381
yading@10 11382 =back
yading@10 11383
yading@10 11384
yading@10 11385
yading@10 11386 =head3 Examples
yading@10 11387
yading@10 11388
yading@10 11389 Stress-test C<amerge> by randomly sending buffers on the wrong
yading@10 11390 input, while avoiding too much of a desynchronization:
yading@10 11391
yading@10 11392 amovie=file.ogg [a] ; amovie=file.mp3 [b] ;
yading@10 11393 [a] [b] astreamsync=(2*random(1))-1+tanh(5*(t1-t2)) [a2] [b2] ;
yading@10 11394 [a2] [b2] amerge
yading@10 11395
yading@10 11396
yading@10 11397
yading@10 11398 =head2 atempo
yading@10 11399
yading@10 11400
yading@10 11401 Adjust audio tempo.
yading@10 11402
yading@10 11403 The filter accepts exactly one parameter, the audio tempo. If not
yading@10 11404 specified then the filter will assume nominal 1.0 tempo. Tempo must
yading@10 11405 be in the [0.5, 2.0] range.
yading@10 11406
yading@10 11407
yading@10 11408 =head3 Examples
yading@10 11409
yading@10 11410
yading@10 11411
yading@10 11412 =over 4
yading@10 11413
yading@10 11414
yading@10 11415 =item *
yading@10 11416
yading@10 11417 Slow down audio to 80% tempo:
yading@10 11418
yading@10 11419 atempo=0.8
yading@10 11420
yading@10 11421
yading@10 11422
yading@10 11423 =item *
yading@10 11424
yading@10 11425 To speed up audio to 125% tempo:
yading@10 11426
yading@10 11427 atempo=1.25
yading@10 11428
yading@10 11429
yading@10 11430 =back
yading@10 11431
yading@10 11432
yading@10 11433
yading@10 11434 =head2 earwax
yading@10 11435
yading@10 11436
yading@10 11437 Make audio easier to listen to on headphones.
yading@10 11438
yading@10 11439 This filter adds `cues' to 44.1kHz stereo (i.e. audio CD format) audio
yading@10 11440 so that when listened to on headphones the stereo image is moved from
yading@10 11441 inside your head (standard for headphones) to outside and in front of
yading@10 11442 the listener (standard for speakers).
yading@10 11443
yading@10 11444 Ported from SoX.
yading@10 11445
yading@10 11446
yading@10 11447 =head2 pan
yading@10 11448
yading@10 11449
yading@10 11450 Mix channels with specific gain levels. The filter accepts the output
yading@10 11451 channel layout followed by a set of channels definitions.
yading@10 11452
yading@10 11453 This filter is also designed to remap efficiently the channels of an audio
yading@10 11454 stream.
yading@10 11455
yading@10 11456 The filter accepts parameters of the form:
yading@10 11457 "I<l>:I<outdef>:I<outdef>:..."
yading@10 11458
yading@10 11459
yading@10 11460 =over 4
yading@10 11461
yading@10 11462
yading@10 11463 =item B<l>
yading@10 11464
yading@10 11465 output channel layout or number of channels
yading@10 11466
yading@10 11467
yading@10 11468 =item B<outdef>
yading@10 11469
yading@10 11470 output channel specification, of the form:
yading@10 11471 "I<out_name>=[I<gain>*]I<in_name>[+[I<gain>*]I<in_name>...]"
yading@10 11472
yading@10 11473
yading@10 11474 =item B<out_name>
yading@10 11475
yading@10 11476 output channel to define, either a channel name (FL, FR, etc.) or a channel
yading@10 11477 number (c0, c1, etc.)
yading@10 11478
yading@10 11479
yading@10 11480 =item B<gain>
yading@10 11481
yading@10 11482 multiplicative coefficient for the channel, 1 leaving the volume unchanged
yading@10 11483
yading@10 11484
yading@10 11485 =item B<in_name>
yading@10 11486
yading@10 11487 input channel to use, see out_name for details; it is not possible to mix
yading@10 11488 named and numbered input channels
yading@10 11489
yading@10 11490 =back
yading@10 11491
yading@10 11492
yading@10 11493 If the `=' in a channel specification is replaced by `E<lt>', then the gains for
yading@10 11494 that specification will be renormalized so that the total is 1, thus
yading@10 11495 avoiding clipping noise.
yading@10 11496
yading@10 11497
yading@10 11498 =head3 Mixing examples
yading@10 11499
yading@10 11500
yading@10 11501 For example, if you want to down-mix from stereo to mono, but with a bigger
yading@10 11502 factor for the left channel:
yading@10 11503
yading@10 11504 pan=1:c0=0.9*c0+0.1*c1
yading@10 11505
yading@10 11506
yading@10 11507 A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
yading@10 11508 7-channels surround:
yading@10 11509
yading@10 11510 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 11511
yading@10 11512
yading@10 11513 Note that B<ffmpeg> integrates a default down-mix (and up-mix) system
yading@10 11514 that should be preferred (see "-ac" option) unless you have very specific
yading@10 11515 needs.
yading@10 11516
yading@10 11517
yading@10 11518 =head3 Remapping examples
yading@10 11519
yading@10 11520
yading@10 11521 The channel remapping will be effective if, and only if:
yading@10 11522
yading@10 11523
yading@10 11524 =over 4
yading@10 11525
yading@10 11526
yading@10 11527 =item *<gain coefficients are zeroes or ones,>
yading@10 11528
yading@10 11529
yading@10 11530 =item *<only one input per channel output,>
yading@10 11531
yading@10 11532
yading@10 11533 =back
yading@10 11534
yading@10 11535
yading@10 11536 If all these conditions are satisfied, the filter will notify the user ("Pure
yading@10 11537 channel mapping detected"), and use an optimized and lossless method to do the
yading@10 11538 remapping.
yading@10 11539
yading@10 11540 For example, if you have a 5.1 source and want a stereo audio stream by
yading@10 11541 dropping the extra channels:
yading@10 11542
yading@10 11543 pan="stereo: c0=FL : c1=FR"
yading@10 11544
yading@10 11545
yading@10 11546 Given the same source, you can also switch front left and front right channels
yading@10 11547 and keep the input channel layout:
yading@10 11548
yading@10 11549 pan="5.1: c0=c1 : c1=c0 : c2=c2 : c3=c3 : c4=c4 : c5=c5"
yading@10 11550
yading@10 11551
yading@10 11552 If the input is a stereo audio stream, you can mute the front left channel (and
yading@10 11553 still keep the stereo channel layout) with:
yading@10 11554
yading@10 11555 pan="stereo:c1=c1"
yading@10 11556
yading@10 11557
yading@10 11558 Still with a stereo audio stream input, you can copy the right channel in both
yading@10 11559 front left and right:
yading@10 11560
yading@10 11561 pan="stereo: c0=FR : c1=FR"
yading@10 11562
yading@10 11563
yading@10 11564
yading@10 11565 =head2 silencedetect
yading@10 11566
yading@10 11567
yading@10 11568 Detect silence in an audio stream.
yading@10 11569
yading@10 11570 This filter logs a message when it detects that the input audio volume is less
yading@10 11571 or equal to a noise tolerance value for a duration greater or equal to the
yading@10 11572 minimum detected noise duration.
yading@10 11573
yading@10 11574 The printed times and duration are expressed in seconds.
yading@10 11575
yading@10 11576 The filter accepts the following options:
yading@10 11577
yading@10 11578
yading@10 11579 =over 4
yading@10 11580
yading@10 11581
yading@10 11582 =item B<duration, d>
yading@10 11583
yading@10 11584 Set silence duration until notification (default is 2 seconds).
yading@10 11585
yading@10 11586
yading@10 11587 =item B<noise, n>
yading@10 11588
yading@10 11589 Set noise tolerance. Can be specified in dB (in case "dB" is appended to the
yading@10 11590 specified value) or amplitude ratio. Default is -60dB, or 0.001.
yading@10 11591
yading@10 11592 =back
yading@10 11593
yading@10 11594
yading@10 11595
yading@10 11596 =head3 Examples
yading@10 11597
yading@10 11598
yading@10 11599
yading@10 11600 =over 4
yading@10 11601
yading@10 11602
yading@10 11603 =item *
yading@10 11604
yading@10 11605 Detect 5 seconds of silence with -50dB noise tolerance:
yading@10 11606
yading@10 11607 silencedetect=n=-50dB:d=5
yading@10 11608
yading@10 11609
yading@10 11610
yading@10 11611 =item *
yading@10 11612
yading@10 11613 Complete example with B<ffmpeg> to detect silence with 0.0001 noise
yading@10 11614 tolerance in F<silence.mp3>:
yading@10 11615
yading@10 11616 ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
yading@10 11617
yading@10 11618
yading@10 11619 =back
yading@10 11620
yading@10 11621
yading@10 11622
yading@10 11623 =head2 asyncts
yading@10 11624
yading@10 11625 Synchronize audio data with timestamps by squeezing/stretching it and/or
yading@10 11626 dropping samples/adding silence when needed.
yading@10 11627
yading@10 11628 This filter is not built by default, please use aresample to do squeezing/stretching.
yading@10 11629
yading@10 11630 The filter accepts the following named parameters:
yading@10 11631
yading@10 11632 =over 4
yading@10 11633
yading@10 11634
yading@10 11635
yading@10 11636 =item B<compensate>
yading@10 11637
yading@10 11638 Enable stretching/squeezing the data to make it match the timestamps. Disabled
yading@10 11639 by default. When disabled, time gaps are covered with silence.
yading@10 11640
yading@10 11641
yading@10 11642 =item B<min_delta>
yading@10 11643
yading@10 11644 Minimum difference between timestamps and audio data (in seconds) to trigger
yading@10 11645 adding/dropping samples. Default value is 0.1. If you get non-perfect sync with
yading@10 11646 this filter, try setting this parameter to 0.
yading@10 11647
yading@10 11648
yading@10 11649 =item B<max_comp>
yading@10 11650
yading@10 11651 Maximum compensation in samples per second. Relevant only with compensate=1.
yading@10 11652 Default value 500.
yading@10 11653
yading@10 11654
yading@10 11655 =item B<first_pts>
yading@10 11656
yading@10 11657 Assume the first pts should be this value. The time base is 1 / sample rate.
yading@10 11658 This allows for padding/trimming at the start of stream. By default, no
yading@10 11659 assumption is made about the first frame's expected pts, so no padding or
yading@10 11660 trimming is done. For example, this could be set to 0 to pad the beginning with
yading@10 11661 silence if an audio stream starts after the video stream or to trim any samples
yading@10 11662 with a negative pts due to encoder delay.
yading@10 11663
yading@10 11664
yading@10 11665 =back
yading@10 11666
yading@10 11667
yading@10 11668
yading@10 11669 =head2 channelsplit
yading@10 11670
yading@10 11671 Split each channel in input audio stream into a separate output stream.
yading@10 11672
yading@10 11673 This filter accepts the following named parameters:
yading@10 11674
yading@10 11675 =over 4
yading@10 11676
yading@10 11677
yading@10 11678 =item B<channel_layout>
yading@10 11679
yading@10 11680 Channel layout of the input stream. Default is "stereo".
yading@10 11681
yading@10 11682 =back
yading@10 11683
yading@10 11684
yading@10 11685 For example, assuming a stereo input MP3 file
yading@10 11686
yading@10 11687 ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
yading@10 11688
yading@10 11689 will create an output Matroska file with two audio streams, one containing only
yading@10 11690 the left channel and the other the right channel.
yading@10 11691
yading@10 11692 To split a 5.1 WAV file into per-channel files
yading@10 11693
yading@10 11694 ffmpeg -i in.wav -filter_complex
yading@10 11695 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
yading@10 11696 -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
yading@10 11697 front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
yading@10 11698 side_right.wav
yading@10 11699
yading@10 11700
yading@10 11701
yading@10 11702 =head2 channelmap
yading@10 11703
yading@10 11704 Remap input channels to new locations.
yading@10 11705
yading@10 11706 This filter accepts the following named parameters:
yading@10 11707
yading@10 11708 =over 4
yading@10 11709
yading@10 11710
yading@10 11711 =item B<channel_layout>
yading@10 11712
yading@10 11713 Channel layout of the output stream.
yading@10 11714
yading@10 11715
yading@10 11716 =item B<map>
yading@10 11717
yading@10 11718 Map channels from input to output. The argument is a '|'-separated list of
yading@10 11719 mappings, each in the C<I<in_channel>-I<out_channel>> or
yading@10 11720 I<in_channel> form. I<in_channel> can be either the name of the input
yading@10 11721 channel (e.g. FL for front left) or its index in the input channel layout.
yading@10 11722 I<out_channel> is the name of the output channel or its index in the output
yading@10 11723 channel layout. If I<out_channel> is not given then it is implicitly an
yading@10 11724 index, starting with zero and increasing by one for each mapping.
yading@10 11725
yading@10 11726 =back
yading@10 11727
yading@10 11728
yading@10 11729 If no mapping is present, the filter will implicitly map input channels to
yading@10 11730 output channels preserving index.
yading@10 11731
yading@10 11732 For example, assuming a 5.1+downmix input MOV file
yading@10 11733
yading@10 11734 ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
yading@10 11735
yading@10 11736 will create an output WAV file tagged as stereo from the downmix channels of
yading@10 11737 the input.
yading@10 11738
yading@10 11739 To fix a 5.1 WAV improperly encoded in AAC's native channel order
yading@10 11740
yading@10 11741 ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:channel_layout=5.1' out.wav
yading@10 11742
yading@10 11743
yading@10 11744
yading@10 11745 =head2 join
yading@10 11746
yading@10 11747 Join multiple input streams into one multi-channel stream.
yading@10 11748
yading@10 11749 The filter accepts the following named parameters:
yading@10 11750
yading@10 11751 =over 4
yading@10 11752
yading@10 11753
yading@10 11754
yading@10 11755 =item B<inputs>
yading@10 11756
yading@10 11757 Number of input streams. Defaults to 2.
yading@10 11758
yading@10 11759
yading@10 11760 =item B<channel_layout>
yading@10 11761
yading@10 11762 Desired output channel layout. Defaults to stereo.
yading@10 11763
yading@10 11764
yading@10 11765 =item B<map>
yading@10 11766
yading@10 11767 Map channels from inputs to output. The argument is a '|'-separated list of
yading@10 11768 mappings, each in the C<I<input_idx>.I<in_channel>-I<out_channel>>
yading@10 11769 form. I<input_idx> is the 0-based index of the input stream. I<in_channel>
yading@10 11770 can be either the name of the input channel (e.g. FL for front left) or its
yading@10 11771 index in the specified input stream. I<out_channel> is the name of the output
yading@10 11772 channel.
yading@10 11773
yading@10 11774 =back
yading@10 11775
yading@10 11776
yading@10 11777 The filter will attempt to guess the mappings when those are not specified
yading@10 11778 explicitly. It does so by first trying to find an unused matching input channel
yading@10 11779 and if that fails it picks the first unused input channel.
yading@10 11780
yading@10 11781 E.g. to join 3 inputs (with properly set channel layouts)
yading@10 11782
yading@10 11783 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
yading@10 11784
yading@10 11785
yading@10 11786 To build a 5.1 output from 6 single-channel streams:
yading@10 11787
yading@10 11788 ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
yading@10 11789 '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 11790 out
yading@10 11791
yading@10 11792
yading@10 11793
yading@10 11794 =head2 resample
yading@10 11795
yading@10 11796 Convert the audio sample format, sample rate and channel layout. This filter is
yading@10 11797 not meant to be used directly.
yading@10 11798
yading@10 11799
yading@10 11800 =head2 volume
yading@10 11801
yading@10 11802
yading@10 11803 Adjust the input audio volume.
yading@10 11804
yading@10 11805 The filter accepts the following options:
yading@10 11806
yading@10 11807
yading@10 11808 =over 4
yading@10 11809
yading@10 11810
yading@10 11811
yading@10 11812 =item B<volume>
yading@10 11813
yading@10 11814 Expresses how the audio volume will be increased or decreased.
yading@10 11815
yading@10 11816 Output values are clipped to the maximum value.
yading@10 11817
yading@10 11818 The output audio volume is given by the relation:
yading@10 11819
yading@10 11820 <output_volume> = <volume> * <input_volume>
yading@10 11821
yading@10 11822
yading@10 11823 Default value for I<volume> is 1.0.
yading@10 11824
yading@10 11825
yading@10 11826 =item B<precision>
yading@10 11827
yading@10 11828 Set the mathematical precision.
yading@10 11829
yading@10 11830 This determines which input sample formats will be allowed, which affects the
yading@10 11831 precision of the volume scaling.
yading@10 11832
yading@10 11833
yading@10 11834 =over 4
yading@10 11835
yading@10 11836
yading@10 11837 =item B<fixed>
yading@10 11838
yading@10 11839 8-bit fixed-point; limits input sample format to U8, S16, and S32.
yading@10 11840
yading@10 11841 =item B<float>
yading@10 11842
yading@10 11843 32-bit floating-point; limits input sample format to FLT. (default)
yading@10 11844
yading@10 11845 =item B<double>
yading@10 11846
yading@10 11847 64-bit floating-point; limits input sample format to DBL.
yading@10 11848
yading@10 11849 =back
yading@10 11850
yading@10 11851
yading@10 11852 =back
yading@10 11853
yading@10 11854
yading@10 11855
yading@10 11856 =head3 Examples
yading@10 11857
yading@10 11858
yading@10 11859
yading@10 11860 =over 4
yading@10 11861
yading@10 11862
yading@10 11863 =item *
yading@10 11864
yading@10 11865 Halve the input audio volume:
yading@10 11866
yading@10 11867 volume=volume=0.5
yading@10 11868 volume=volume=1/2
yading@10 11869 volume=volume=-6.0206dB
yading@10 11870
yading@10 11871
yading@10 11872 In all the above example the named key for B<volume> can be
yading@10 11873 omitted, for example like in:
yading@10 11874
yading@10 11875 volume=0.5
yading@10 11876
yading@10 11877
yading@10 11878
yading@10 11879 =item *
yading@10 11880
yading@10 11881 Increase input audio power by 6 decibels using fixed-point precision:
yading@10 11882
yading@10 11883 volume=volume=6dB:precision=fixed
yading@10 11884
yading@10 11885
yading@10 11886 =back
yading@10 11887
yading@10 11888
yading@10 11889
yading@10 11890 =head2 volumedetect
yading@10 11891
yading@10 11892
yading@10 11893 Detect the volume of the input video.
yading@10 11894
yading@10 11895 The filter has no parameters. The input is not modified. Statistics about
yading@10 11896 the volume will be printed in the log when the input stream end is reached.
yading@10 11897
yading@10 11898 In particular it will show the mean volume (root mean square), maximum
yading@10 11899 volume (on a per-sample basis), and the beginning of an histogram of the
yading@10 11900 registered volume values (from the maximum value to a cumulated 1/1000 of
yading@10 11901 the samples).
yading@10 11902
yading@10 11903 All volumes are in decibels relative to the maximum PCM value.
yading@10 11904
yading@10 11905
yading@10 11906 =head3 Examples
yading@10 11907
yading@10 11908
yading@10 11909 Here is an excerpt of the output:
yading@10 11910
yading@10 11911 [Parsed_volumedetect_0 0xa23120] mean_volume: -27 dB
yading@10 11912 [Parsed_volumedetect_0 0xa23120] max_volume: -4 dB
yading@10 11913 [Parsed_volumedetect_0 0xa23120] histogram_4db: 6
yading@10 11914 [Parsed_volumedetect_0 0xa23120] histogram_5db: 62
yading@10 11915 [Parsed_volumedetect_0 0xa23120] histogram_6db: 286
yading@10 11916 [Parsed_volumedetect_0 0xa23120] histogram_7db: 1042
yading@10 11917 [Parsed_volumedetect_0 0xa23120] histogram_8db: 2551
yading@10 11918 [Parsed_volumedetect_0 0xa23120] histogram_9db: 4609
yading@10 11919 [Parsed_volumedetect_0 0xa23120] histogram_10db: 8409
yading@10 11920
yading@10 11921
yading@10 11922 It means that:
yading@10 11923
yading@10 11924 =over 4
yading@10 11925
yading@10 11926
yading@10 11927 =item *
yading@10 11928
yading@10 11929 The mean square energy is approximately -27 dB, or 10^-2.7.
yading@10 11930
yading@10 11931 =item *
yading@10 11932
yading@10 11933 The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
yading@10 11934
yading@10 11935 =item *
yading@10 11936
yading@10 11937 There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
yading@10 11938
yading@10 11939 =back
yading@10 11940
yading@10 11941
yading@10 11942 In other words, raising the volume by +4 dB does not cause any clipping,
yading@10 11943 raising it by +5 dB causes clipping for 6 samples, etc.
yading@10 11944
yading@10 11945
yading@10 11946
yading@10 11947 =head1 AUDIO SOURCES
yading@10 11948
yading@10 11949
yading@10 11950 Below is a description of the currently available audio sources.
yading@10 11951
yading@10 11952
yading@10 11953 =head2 abuffer
yading@10 11954
yading@10 11955
yading@10 11956 Buffer audio frames, and make them available to the filter chain.
yading@10 11957
yading@10 11958 This source is mainly intended for a programmatic use, in particular
yading@10 11959 through the interface defined in F<libavfilter/asrc_abuffer.h>.
yading@10 11960
yading@10 11961 It accepts the following named parameters:
yading@10 11962
yading@10 11963
yading@10 11964 =over 4
yading@10 11965
yading@10 11966
yading@10 11967
yading@10 11968 =item B<time_base>
yading@10 11969
yading@10 11970 Timebase which will be used for timestamps of submitted frames. It must be
yading@10 11971 either a floating-point number or in I<numerator>/I<denominator> form.
yading@10 11972
yading@10 11973
yading@10 11974 =item B<sample_rate>
yading@10 11975
yading@10 11976 The sample rate of the incoming audio buffers.
yading@10 11977
yading@10 11978
yading@10 11979 =item B<sample_fmt>
yading@10 11980
yading@10 11981 The sample format of the incoming audio buffers.
yading@10 11982 Either a sample format name or its corresponging integer representation from
yading@10 11983 the enum AVSampleFormat in F<libavutil/samplefmt.h>
yading@10 11984
yading@10 11985
yading@10 11986 =item B<channel_layout>
yading@10 11987
yading@10 11988 The channel layout of the incoming audio buffers.
yading@10 11989 Either a channel layout name from channel_layout_map in
yading@10 11990 F<libavutil/channel_layout.c> or its corresponding integer representation
yading@10 11991 from the AV_CH_LAYOUT_* macros in F<libavutil/channel_layout.h>
yading@10 11992
yading@10 11993
yading@10 11994 =item B<channels>
yading@10 11995
yading@10 11996 The number of channels of the incoming audio buffers.
yading@10 11997 If both I<channels> and I<channel_layout> are specified, then they
yading@10 11998 must be consistent.
yading@10 11999
yading@10 12000
yading@10 12001 =back
yading@10 12002
yading@10 12003
yading@10 12004
yading@10 12005 =head3 Examples
yading@10 12006
yading@10 12007
yading@10 12008
yading@10 12009 abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
yading@10 12010
yading@10 12011
yading@10 12012 will instruct the source to accept planar 16bit signed stereo at 44100Hz.
yading@10 12013 Since the sample format with name "s16p" corresponds to the number
yading@10 12014 6 and the "stereo" channel layout corresponds to the value 0x3, this is
yading@10 12015 equivalent to:
yading@10 12016
yading@10 12017 abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
yading@10 12018
yading@10 12019
yading@10 12020
yading@10 12021 =head2 aevalsrc
yading@10 12022
yading@10 12023
yading@10 12024 Generate an audio signal specified by an expression.
yading@10 12025
yading@10 12026 This source accepts in input one or more expressions (one for each
yading@10 12027 channel), which are evaluated and used to generate a corresponding
yading@10 12028 audio signal.
yading@10 12029
yading@10 12030 This source accepts the following options:
yading@10 12031
yading@10 12032
yading@10 12033 =over 4
yading@10 12034
yading@10 12035
yading@10 12036 =item B<exprs>
yading@10 12037
yading@10 12038 Set the '|'-separated expressions list for each separate channel. In case the
yading@10 12039 B<channel_layout> option is not specified, the selected channel layout
yading@10 12040 depends on the number of provided expressions.
yading@10 12041
yading@10 12042
yading@10 12043 =item B<channel_layout, c>
yading@10 12044
yading@10 12045 Set the channel layout. The number of channels in the specified layout
yading@10 12046 must be equal to the number of specified expressions.
yading@10 12047
yading@10 12048
yading@10 12049 =item B<duration, d>
yading@10 12050
yading@10 12051 Set the minimum duration of the sourced audio. See the function
yading@10 12052 C<av_parse_time()> for the accepted format.
yading@10 12053 Note that the resulting duration may be greater than the specified
yading@10 12054 duration, as the generated audio is always cut at the end of a
yading@10 12055 complete frame.
yading@10 12056
yading@10 12057 If not specified, or the expressed duration is negative, the audio is
yading@10 12058 supposed to be generated forever.
yading@10 12059
yading@10 12060
yading@10 12061 =item B<nb_samples, n>
yading@10 12062
yading@10 12063 Set the number of samples per channel per each output frame,
yading@10 12064 default to 1024.
yading@10 12065
yading@10 12066
yading@10 12067 =item B<sample_rate, s>
yading@10 12068
yading@10 12069 Specify the sample rate, default to 44100.
yading@10 12070
yading@10 12071 =back
yading@10 12072
yading@10 12073
yading@10 12074 Each expression in I<exprs> can contain the following constants:
yading@10 12075
yading@10 12076
yading@10 12077 =over 4
yading@10 12078
yading@10 12079
yading@10 12080 =item B<n>
yading@10 12081
yading@10 12082 number of the evaluated sample, starting from 0
yading@10 12083
yading@10 12084
yading@10 12085 =item B<t>
yading@10 12086
yading@10 12087 time of the evaluated sample expressed in seconds, starting from 0
yading@10 12088
yading@10 12089
yading@10 12090 =item B<s>
yading@10 12091
yading@10 12092 sample rate
yading@10 12093
yading@10 12094
yading@10 12095 =back
yading@10 12096
yading@10 12097
yading@10 12098
yading@10 12099 =head3 Examples
yading@10 12100
yading@10 12101
yading@10 12102
yading@10 12103 =over 4
yading@10 12104
yading@10 12105
yading@10 12106 =item *
yading@10 12107
yading@10 12108 Generate silence:
yading@10 12109
yading@10 12110 aevalsrc=0
yading@10 12111
yading@10 12112
yading@10 12113
yading@10 12114 =item *
yading@10 12115
yading@10 12116 Generate a sin signal with frequency of 440 Hz, set sample rate to
yading@10 12117 8000 Hz:
yading@10 12118
yading@10 12119 aevalsrc="sin(440*2*PI*t):s=8000"
yading@10 12120
yading@10 12121
yading@10 12122
yading@10 12123 =item *
yading@10 12124
yading@10 12125 Generate a two channels signal, specify the channel layout (Front
yading@10 12126 Center + Back Center) explicitly:
yading@10 12127
yading@10 12128 aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC"
yading@10 12129
yading@10 12130
yading@10 12131
yading@10 12132 =item *
yading@10 12133
yading@10 12134 Generate white noise:
yading@10 12135
yading@10 12136 aevalsrc="-2+random(0)"
yading@10 12137
yading@10 12138
yading@10 12139
yading@10 12140 =item *
yading@10 12141
yading@10 12142 Generate an amplitude modulated signal:
yading@10 12143
yading@10 12144 aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)"
yading@10 12145
yading@10 12146
yading@10 12147
yading@10 12148 =item *
yading@10 12149
yading@10 12150 Generate 2.5 Hz binaural beats on a 360 Hz carrier:
yading@10 12151
yading@10 12152 aevalsrc="0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)"
yading@10 12153
yading@10 12154
yading@10 12155
yading@10 12156 =back
yading@10 12157
yading@10 12158
yading@10 12159
yading@10 12160 =head2 anullsrc
yading@10 12161
yading@10 12162
yading@10 12163 Null audio source, return unprocessed audio frames. It is mainly useful
yading@10 12164 as a template and to be employed in analysis / debugging tools, or as
yading@10 12165 the source for filters which ignore the input data (for example the sox
yading@10 12166 synth filter).
yading@10 12167
yading@10 12168 This source accepts the following options:
yading@10 12169
yading@10 12170
yading@10 12171 =over 4
yading@10 12172
yading@10 12173
yading@10 12174
yading@10 12175 =item B<channel_layout, cl>
yading@10 12176
yading@10 12177
yading@10 12178 Specify the channel layout, and can be either an integer or a string
yading@10 12179 representing a channel layout. The default value of I<channel_layout>
yading@10 12180 is "stereo".
yading@10 12181
yading@10 12182 Check the channel_layout_map definition in
yading@10 12183 F<libavutil/channel_layout.c> for the mapping between strings and
yading@10 12184 channel layout values.
yading@10 12185
yading@10 12186
yading@10 12187 =item B<sample_rate, r>
yading@10 12188
yading@10 12189 Specify the sample rate, and defaults to 44100.
yading@10 12190
yading@10 12191
yading@10 12192 =item B<nb_samples, n>
yading@10 12193
yading@10 12194 Set the number of samples per requested frames.
yading@10 12195
yading@10 12196
yading@10 12197 =back
yading@10 12198
yading@10 12199
yading@10 12200
yading@10 12201 =head3 Examples
yading@10 12202
yading@10 12203
yading@10 12204
yading@10 12205 =over 4
yading@10 12206
yading@10 12207
yading@10 12208 =item *
yading@10 12209
yading@10 12210 Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
yading@10 12211
yading@10 12212 anullsrc=r=48000:cl=4
yading@10 12213
yading@10 12214
yading@10 12215
yading@10 12216 =item *
yading@10 12217
yading@10 12218 Do the same operation with a more obvious syntax:
yading@10 12219
yading@10 12220 anullsrc=r=48000:cl=mono
yading@10 12221
yading@10 12222
yading@10 12223 =back
yading@10 12224
yading@10 12225
yading@10 12226
yading@10 12227 =head2 abuffer
yading@10 12228
yading@10 12229 Buffer audio frames, and make them available to the filter chain.
yading@10 12230
yading@10 12231 This source is not intended to be part of user-supplied graph descriptions but
yading@10 12232 for insertion by calling programs through the interface defined in
yading@10 12233 F<libavfilter/buffersrc.h>.
yading@10 12234
yading@10 12235 It accepts the following named parameters:
yading@10 12236
yading@10 12237 =over 4
yading@10 12238
yading@10 12239
yading@10 12240
yading@10 12241 =item B<time_base>
yading@10 12242
yading@10 12243 Timebase which will be used for timestamps of submitted frames. It must be
yading@10 12244 either a floating-point number or in I<numerator>/I<denominator> form.
yading@10 12245
yading@10 12246
yading@10 12247 =item B<sample_rate>
yading@10 12248
yading@10 12249 Audio sample rate.
yading@10 12250
yading@10 12251
yading@10 12252 =item B<sample_fmt>
yading@10 12253
yading@10 12254 Name of the sample format, as returned by C<av_get_sample_fmt_name()>.
yading@10 12255
yading@10 12256
yading@10 12257 =item B<channel_layout>
yading@10 12258
yading@10 12259 Channel layout of the audio data, in the form that can be accepted by
yading@10 12260 C<av_get_channel_layout()>.
yading@10 12261
yading@10 12262 =back
yading@10 12263
yading@10 12264
yading@10 12265 All the parameters need to be explicitly defined.
yading@10 12266
yading@10 12267
yading@10 12268 =head2 flite
yading@10 12269
yading@10 12270
yading@10 12271 Synthesize a voice utterance using the libflite library.
yading@10 12272
yading@10 12273 To enable compilation of this filter you need to configure FFmpeg with
yading@10 12274 C<--enable-libflite>.
yading@10 12275
yading@10 12276 Note that the flite library is not thread-safe.
yading@10 12277
yading@10 12278 The filter accepts the following options:
yading@10 12279
yading@10 12280
yading@10 12281 =over 4
yading@10 12282
yading@10 12283
yading@10 12284
yading@10 12285 =item B<list_voices>
yading@10 12286
yading@10 12287 If set to 1, list the names of the available voices and exit
yading@10 12288 immediately. Default value is 0.
yading@10 12289
yading@10 12290
yading@10 12291 =item B<nb_samples, n>
yading@10 12292
yading@10 12293 Set the maximum number of samples per frame. Default value is 512.
yading@10 12294
yading@10 12295
yading@10 12296 =item B<textfile>
yading@10 12297
yading@10 12298 Set the filename containing the text to speak.
yading@10 12299
yading@10 12300
yading@10 12301 =item B<text>
yading@10 12302
yading@10 12303 Set the text to speak.
yading@10 12304
yading@10 12305
yading@10 12306 =item B<voice, v>
yading@10 12307
yading@10 12308 Set the voice to use for the speech synthesis. Default value is
yading@10 12309 C<kal>. See also the I<list_voices> option.
yading@10 12310
yading@10 12311 =back
yading@10 12312
yading@10 12313
yading@10 12314
yading@10 12315 =head3 Examples
yading@10 12316
yading@10 12317
yading@10 12318
yading@10 12319 =over 4
yading@10 12320
yading@10 12321
yading@10 12322 =item *
yading@10 12323
yading@10 12324 Read from file F<speech.txt>, and synthetize the text using the
yading@10 12325 standard flite voice:
yading@10 12326
yading@10 12327 flite=textfile=speech.txt
yading@10 12328
yading@10 12329
yading@10 12330
yading@10 12331 =item *
yading@10 12332
yading@10 12333 Read the specified text selecting the C<slt> voice:
yading@10 12334
yading@10 12335 flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
yading@10 12336
yading@10 12337
yading@10 12338
yading@10 12339 =item *
yading@10 12340
yading@10 12341 Input text to ffmpeg:
yading@10 12342
yading@10 12343 ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
yading@10 12344
yading@10 12345
yading@10 12346
yading@10 12347 =item *
yading@10 12348
yading@10 12349 Make F<ffplay> speak the specified text, using C<flite> and
yading@10 12350 the C<lavfi> device:
yading@10 12351
yading@10 12352 ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
yading@10 12353
yading@10 12354
yading@10 12355 =back
yading@10 12356
yading@10 12357
yading@10 12358 For more information about libflite, check:
yading@10 12359 E<lt>B<http://www.speech.cs.cmu.edu/flite/>E<gt>
yading@10 12360
yading@10 12361
yading@10 12362 =head2 sine
yading@10 12363
yading@10 12364
yading@10 12365 Generate an audio signal made of a sine wave with amplitude 1/8.
yading@10 12366
yading@10 12367 The audio signal is bit-exact.
yading@10 12368
yading@10 12369 The filter accepts the following options:
yading@10 12370
yading@10 12371
yading@10 12372 =over 4
yading@10 12373
yading@10 12374
yading@10 12375
yading@10 12376 =item B<frequency, f>
yading@10 12377
yading@10 12378 Set the carrier frequency. Default is 440 Hz.
yading@10 12379
yading@10 12380
yading@10 12381 =item B<beep_factor, b>
yading@10 12382
yading@10 12383 Enable a periodic beep every second with frequency I<beep_factor> times
yading@10 12384 the carrier frequency. Default is 0, meaning the beep is disabled.
yading@10 12385
yading@10 12386
yading@10 12387 =item B<sample_rate, s>
yading@10 12388
yading@10 12389 Specify the sample rate, default is 44100.
yading@10 12390
yading@10 12391
yading@10 12392 =item B<duration, d>
yading@10 12393
yading@10 12394 Specify the duration of the generated audio stream.
yading@10 12395
yading@10 12396
yading@10 12397 =item B<samples_per_frame>
yading@10 12398
yading@10 12399 Set the number of samples per output frame, default is 1024.
yading@10 12400
yading@10 12401 =back
yading@10 12402
yading@10 12403
yading@10 12404
yading@10 12405 =head3 Examples
yading@10 12406
yading@10 12407
yading@10 12408
yading@10 12409 =over 4
yading@10 12410
yading@10 12411
yading@10 12412
yading@10 12413 =item *
yading@10 12414
yading@10 12415 Generate a simple 440 Hz sine wave:
yading@10 12416
yading@10 12417 sine
yading@10 12418
yading@10 12419
yading@10 12420
yading@10 12421 =item *
yading@10 12422
yading@10 12423 Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
yading@10 12424
yading@10 12425 sine=220:4:d=5
yading@10 12426 sine=f=220:b=4:d=5
yading@10 12427 sine=frequency=220:beep_factor=4:duration=5
yading@10 12428
yading@10 12429
yading@10 12430
yading@10 12431 =back
yading@10 12432
yading@10 12433
yading@10 12434
yading@10 12435
yading@10 12436 =head1 AUDIO SINKS
yading@10 12437
yading@10 12438
yading@10 12439 Below is a description of the currently available audio sinks.
yading@10 12440
yading@10 12441
yading@10 12442 =head2 abuffersink
yading@10 12443
yading@10 12444
yading@10 12445 Buffer audio frames, and make them available to the end of filter chain.
yading@10 12446
yading@10 12447 This sink is mainly intended for programmatic use, in particular
yading@10 12448 through the interface defined in F<libavfilter/buffersink.h>
yading@10 12449 or the options system.
yading@10 12450
yading@10 12451 It accepts a pointer to an AVABufferSinkContext structure, which
yading@10 12452 defines the incoming buffers' formats, to be passed as the opaque
yading@10 12453 parameter to C<avfilter_init_filter> for initialization.
yading@10 12454
yading@10 12455
yading@10 12456 =head2 anullsink
yading@10 12457
yading@10 12458
yading@10 12459 Null audio sink, do absolutely nothing with the input audio. It is
yading@10 12460 mainly useful as a template and to be employed in analysis / debugging
yading@10 12461 tools.
yading@10 12462
yading@10 12463
yading@10 12464
yading@10 12465 =head1 VIDEO FILTERS
yading@10 12466
yading@10 12467
yading@10 12468 When you configure your FFmpeg build, you can disable any of the
yading@10 12469 existing filters using C<--disable-filters>.
yading@10 12470 The configure output will show the video filters included in your
yading@10 12471 build.
yading@10 12472
yading@10 12473 Below is a description of the currently available video filters.
yading@10 12474
yading@10 12475
yading@10 12476 =head2 alphaextract
yading@10 12477
yading@10 12478
yading@10 12479 Extract the alpha component from the input as a grayscale video. This
yading@10 12480 is especially useful with the I<alphamerge> filter.
yading@10 12481
yading@10 12482
yading@10 12483 =head2 alphamerge
yading@10 12484
yading@10 12485
yading@10 12486 Add or replace the alpha component of the primary input with the
yading@10 12487 grayscale value of a second input. This is intended for use with
yading@10 12488 I<alphaextract> to allow the transmission or storage of frame
yading@10 12489 sequences that have alpha in a format that doesn't support an alpha
yading@10 12490 channel.
yading@10 12491
yading@10 12492 For example, to reconstruct full frames from a normal YUV-encoded video
yading@10 12493 and a separate video created with I<alphaextract>, you might use:
yading@10 12494
yading@10 12495 movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
yading@10 12496
yading@10 12497
yading@10 12498 Since this filter is designed for reconstruction, it operates on frame
yading@10 12499 sequences without considering timestamps, and terminates when either
yading@10 12500 input reaches end of stream. This will cause problems if your encoding
yading@10 12501 pipeline drops frames. If you're trying to apply an image as an
yading@10 12502 overlay to a video stream, consider the I<overlay> filter instead.
yading@10 12503
yading@10 12504
yading@10 12505 =head2 ass
yading@10 12506
yading@10 12507
yading@10 12508 Same as the subtitles filter, except that it doesn't require libavcodec
yading@10 12509 and libavformat to work. On the other hand, it is limited to ASS (Advanced
yading@10 12510 Substation Alpha) subtitles files.
yading@10 12511
yading@10 12512
yading@10 12513 =head2 bbox
yading@10 12514
yading@10 12515
yading@10 12516 Compute the bounding box for the non-black pixels in the input frame
yading@10 12517 luminance plane.
yading@10 12518
yading@10 12519 This filter computes the bounding box containing all the pixels with a
yading@10 12520 luminance value greater than the minimum allowed value.
yading@10 12521 The parameters describing the bounding box are printed on the filter
yading@10 12522 log.
yading@10 12523
yading@10 12524
yading@10 12525 =head2 blackdetect
yading@10 12526
yading@10 12527
yading@10 12528 Detect video intervals that are (almost) completely black. Can be
yading@10 12529 useful to detect chapter transitions, commercials, or invalid
yading@10 12530 recordings. Output lines contains the time for the start, end and
yading@10 12531 duration of the detected black interval expressed in seconds.
yading@10 12532
yading@10 12533 In order to display the output lines, you need to set the loglevel at
yading@10 12534 least to the AV_LOG_INFO value.
yading@10 12535
yading@10 12536 The filter accepts the following options:
yading@10 12537
yading@10 12538
yading@10 12539 =over 4
yading@10 12540
yading@10 12541
yading@10 12542 =item B<black_min_duration, d>
yading@10 12543
yading@10 12544 Set the minimum detected black duration expressed in seconds. It must
yading@10 12545 be a non-negative floating point number.
yading@10 12546
yading@10 12547 Default value is 2.0.
yading@10 12548
yading@10 12549
yading@10 12550 =item B<picture_black_ratio_th, pic_th>
yading@10 12551
yading@10 12552 Set the threshold for considering a picture "black".
yading@10 12553 Express the minimum value for the ratio:
yading@10 12554
yading@10 12555 <nb_black_pixels> / <nb_pixels>
yading@10 12556
yading@10 12557
yading@10 12558 for which a picture is considered black.
yading@10 12559 Default value is 0.98.
yading@10 12560
yading@10 12561
yading@10 12562 =item B<pixel_black_th, pix_th>
yading@10 12563
yading@10 12564 Set the threshold for considering a pixel "black".
yading@10 12565
yading@10 12566 The threshold expresses the maximum pixel luminance value for which a
yading@10 12567 pixel is considered "black". The provided value is scaled according to
yading@10 12568 the following equation:
yading@10 12569
yading@10 12570 <absolute_threshold> = <luminance_minimum_value> + <pixel_black_th> * <luminance_range_size>
yading@10 12571
yading@10 12572
yading@10 12573 I<luminance_range_size> and I<luminance_minimum_value> depend on
yading@10 12574 the input video format, the range is [0-255] for YUV full-range
yading@10 12575 formats and [16-235] for YUV non full-range formats.
yading@10 12576
yading@10 12577 Default value is 0.10.
yading@10 12578
yading@10 12579 =back
yading@10 12580
yading@10 12581
yading@10 12582 The following example sets the maximum pixel threshold to the minimum
yading@10 12583 value, and detects only black intervals of 2 or more seconds:
yading@10 12584
yading@10 12585 blackdetect=d=2:pix_th=0.00
yading@10 12586
yading@10 12587
yading@10 12588
yading@10 12589 =head2 blackframe
yading@10 12590
yading@10 12591
yading@10 12592 Detect frames that are (almost) completely black. Can be useful to
yading@10 12593 detect chapter transitions or commercials. Output lines consist of
yading@10 12594 the frame number of the detected frame, the percentage of blackness,
yading@10 12595 the position in the file if known or -1 and the timestamp in seconds.
yading@10 12596
yading@10 12597 In order to display the output lines, you need to set the loglevel at
yading@10 12598 least to the AV_LOG_INFO value.
yading@10 12599
yading@10 12600 The filter accepts the following options:
yading@10 12601
yading@10 12602
yading@10 12603 =over 4
yading@10 12604
yading@10 12605
yading@10 12606
yading@10 12607 =item B<amount>
yading@10 12608
yading@10 12609 Set the percentage of the pixels that have to be below the threshold, defaults
yading@10 12610 to C<98>.
yading@10 12611
yading@10 12612
yading@10 12613 =item B<threshold, thresh>
yading@10 12614
yading@10 12615 Set the threshold below which a pixel value is considered black, defaults to
yading@10 12616 C<32>.
yading@10 12617
yading@10 12618
yading@10 12619 =back
yading@10 12620
yading@10 12621
yading@10 12622
yading@10 12623 =head2 blend
yading@10 12624
yading@10 12625
yading@10 12626 Blend two video frames into each other.
yading@10 12627
yading@10 12628 It takes two input streams and outputs one stream, the first input is the
yading@10 12629 "top" layer and second input is "bottom" layer.
yading@10 12630 Output terminates when shortest input terminates.
yading@10 12631
yading@10 12632 A description of the accepted options follows.
yading@10 12633
yading@10 12634
yading@10 12635 =over 4
yading@10 12636
yading@10 12637
yading@10 12638 =item B<c0_mode>
yading@10 12639
yading@10 12640
yading@10 12641 =item B<c1_mode>
yading@10 12642
yading@10 12643
yading@10 12644 =item B<c2_mode>
yading@10 12645
yading@10 12646
yading@10 12647 =item B<c3_mode>
yading@10 12648
yading@10 12649
yading@10 12650 =item B<all_mode>
yading@10 12651
yading@10 12652 Set blend mode for specific pixel component or all pixel components in case
yading@10 12653 of I<all_mode>. Default value is C<normal>.
yading@10 12654
yading@10 12655 Available values for component modes are:
yading@10 12656
yading@10 12657 =over 4
yading@10 12658
yading@10 12659
yading@10 12660 =item B<addition>
yading@10 12661
yading@10 12662
yading@10 12663 =item B<and>
yading@10 12664
yading@10 12665
yading@10 12666 =item B<average>
yading@10 12667
yading@10 12668
yading@10 12669 =item B<burn>
yading@10 12670
yading@10 12671
yading@10 12672 =item B<darken>
yading@10 12673
yading@10 12674
yading@10 12675 =item B<difference>
yading@10 12676
yading@10 12677
yading@10 12678 =item B<divide>
yading@10 12679
yading@10 12680
yading@10 12681 =item B<dodge>
yading@10 12682
yading@10 12683
yading@10 12684 =item B<exclusion>
yading@10 12685
yading@10 12686
yading@10 12687 =item B<hardlight>
yading@10 12688
yading@10 12689
yading@10 12690 =item B<lighten>
yading@10 12691
yading@10 12692
yading@10 12693 =item B<multiply>
yading@10 12694
yading@10 12695
yading@10 12696 =item B<negation>
yading@10 12697
yading@10 12698
yading@10 12699 =item B<normal>
yading@10 12700
yading@10 12701
yading@10 12702 =item B<or>
yading@10 12703
yading@10 12704
yading@10 12705 =item B<overlay>
yading@10 12706
yading@10 12707
yading@10 12708 =item B<phoenix>
yading@10 12709
yading@10 12710
yading@10 12711 =item B<pinlight>
yading@10 12712
yading@10 12713
yading@10 12714 =item B<reflect>
yading@10 12715
yading@10 12716
yading@10 12717 =item B<screen>
yading@10 12718
yading@10 12719
yading@10 12720 =item B<softlight>
yading@10 12721
yading@10 12722
yading@10 12723 =item B<subtract>
yading@10 12724
yading@10 12725
yading@10 12726 =item B<vividlight>
yading@10 12727
yading@10 12728
yading@10 12729 =item B<xor>
yading@10 12730
yading@10 12731
yading@10 12732 =back
yading@10 12733
yading@10 12734
yading@10 12735
yading@10 12736 =item B<c0_opacity>
yading@10 12737
yading@10 12738
yading@10 12739 =item B<c1_opacity>
yading@10 12740
yading@10 12741
yading@10 12742 =item B<c2_opacity>
yading@10 12743
yading@10 12744
yading@10 12745 =item B<c3_opacity>
yading@10 12746
yading@10 12747
yading@10 12748 =item B<all_opacity>
yading@10 12749
yading@10 12750 Set blend opacity for specific pixel component or all pixel components in case
yading@10 12751 of I<all_opacity>. Only used in combination with pixel component blend modes.
yading@10 12752
yading@10 12753
yading@10 12754 =item B<c0_expr>
yading@10 12755
yading@10 12756
yading@10 12757 =item B<c1_expr>
yading@10 12758
yading@10 12759
yading@10 12760 =item B<c2_expr>
yading@10 12761
yading@10 12762
yading@10 12763 =item B<c3_expr>
yading@10 12764
yading@10 12765
yading@10 12766 =item B<all_expr>
yading@10 12767
yading@10 12768 Set blend expression for specific pixel component or all pixel components in case
yading@10 12769 of I<all_expr>. Note that related mode options will be ignored if those are set.
yading@10 12770
yading@10 12771 The expressions can use the following variables:
yading@10 12772
yading@10 12773
yading@10 12774 =over 4
yading@10 12775
yading@10 12776
yading@10 12777 =item B<N>
yading@10 12778
yading@10 12779 The sequential number of the filtered frame, starting from C<0>.
yading@10 12780
yading@10 12781
yading@10 12782 =item B<X>
yading@10 12783
yading@10 12784
yading@10 12785 =item B<Y>
yading@10 12786
yading@10 12787 the coordinates of the current sample
yading@10 12788
yading@10 12789
yading@10 12790 =item B<W>
yading@10 12791
yading@10 12792
yading@10 12793 =item B<H>
yading@10 12794
yading@10 12795 the width and height of currently filtered plane
yading@10 12796
yading@10 12797
yading@10 12798 =item B<SW>
yading@10 12799
yading@10 12800
yading@10 12801 =item B<SH>
yading@10 12802
yading@10 12803 Width and height scale depending on the currently filtered plane. It is the
yading@10 12804 ratio between the corresponding luma plane number of pixels and the current
yading@10 12805 plane ones. E.g. for YUV4:2:0 the values are C<1,1> for the luma plane, and
yading@10 12806 C<0.5,0.5> for chroma planes.
yading@10 12807
yading@10 12808
yading@10 12809 =item B<T>
yading@10 12810
yading@10 12811 Time of the current frame, expressed in seconds.
yading@10 12812
yading@10 12813
yading@10 12814 =item B<TOP, A>
yading@10 12815
yading@10 12816 Value of pixel component at current location for first video frame (top layer).
yading@10 12817
yading@10 12818
yading@10 12819 =item B<BOTTOM, B>
yading@10 12820
yading@10 12821 Value of pixel component at current location for second video frame (bottom layer).
yading@10 12822
yading@10 12823 =back
yading@10 12824
yading@10 12825
yading@10 12826 =back
yading@10 12827
yading@10 12828
yading@10 12829
yading@10 12830 =head3 Examples
yading@10 12831
yading@10 12832
yading@10 12833
yading@10 12834 =over 4
yading@10 12835
yading@10 12836
yading@10 12837 =item *
yading@10 12838
yading@10 12839 Apply transition from bottom layer to top layer in first 10 seconds:
yading@10 12840
yading@10 12841 blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
yading@10 12842
yading@10 12843
yading@10 12844
yading@10 12845 =item *
yading@10 12846
yading@10 12847 Apply 1x1 checkerboard effect:
yading@10 12848
yading@10 12849 blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
yading@10 12850
yading@10 12851
yading@10 12852 =back
yading@10 12853
yading@10 12854
yading@10 12855
yading@10 12856 =head2 boxblur
yading@10 12857
yading@10 12858
yading@10 12859 Apply boxblur algorithm to the input video.
yading@10 12860
yading@10 12861 The filter accepts the following options:
yading@10 12862
yading@10 12863
yading@10 12864 =over 4
yading@10 12865
yading@10 12866
yading@10 12867
yading@10 12868 =item B<luma_radius, lr>
yading@10 12869
yading@10 12870
yading@10 12871 =item B<luma_power, lp>
yading@10 12872
yading@10 12873
yading@10 12874 =item B<chroma_radius, cr>
yading@10 12875
yading@10 12876
yading@10 12877 =item B<chroma_power, cp>
yading@10 12878
yading@10 12879
yading@10 12880 =item B<alpha_radius, ar>
yading@10 12881
yading@10 12882
yading@10 12883 =item B<alpha_power, ap>
yading@10 12884
yading@10 12885
yading@10 12886
yading@10 12887 =back
yading@10 12888
yading@10 12889
yading@10 12890 A description of the accepted options follows.
yading@10 12891
yading@10 12892
yading@10 12893 =over 4
yading@10 12894
yading@10 12895
yading@10 12896 =item B<luma_radius, lr>
yading@10 12897
yading@10 12898
yading@10 12899 =item B<chroma_radius, cr>
yading@10 12900
yading@10 12901
yading@10 12902 =item B<alpha_radius, ar>
yading@10 12903
yading@10 12904 Set an expression for the box radius in pixels used for blurring the
yading@10 12905 corresponding input plane.
yading@10 12906
yading@10 12907 The radius value must be a non-negative number, and must not be
yading@10 12908 greater than the value of the expression C<min(w,h)/2> for the
yading@10 12909 luma and alpha planes, and of C<min(cw,ch)/2> for the chroma
yading@10 12910 planes.
yading@10 12911
yading@10 12912 Default value for B<luma_radius> is "2". If not specified,
yading@10 12913 B<chroma_radius> and B<alpha_radius> default to the
yading@10 12914 corresponding value set for B<luma_radius>.
yading@10 12915
yading@10 12916 The expressions can contain the following constants:
yading@10 12917
yading@10 12918 =over 4
yading@10 12919
yading@10 12920
yading@10 12921 =item B<w, h>
yading@10 12922
yading@10 12923 the input width and height in pixels
yading@10 12924
yading@10 12925
yading@10 12926 =item B<cw, ch>
yading@10 12927
yading@10 12928 the input chroma image width and height in pixels
yading@10 12929
yading@10 12930
yading@10 12931 =item B<hsub, vsub>
yading@10 12932
yading@10 12933 horizontal and vertical chroma subsample values. For example for the
yading@10 12934 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 12935
yading@10 12936 =back
yading@10 12937
yading@10 12938
yading@10 12939
yading@10 12940 =item B<luma_power, lp>
yading@10 12941
yading@10 12942
yading@10 12943 =item B<chroma_power, cp>
yading@10 12944
yading@10 12945
yading@10 12946 =item B<alpha_power, ap>
yading@10 12947
yading@10 12948 Specify how many times the boxblur filter is applied to the
yading@10 12949 corresponding plane.
yading@10 12950
yading@10 12951 Default value for B<luma_power> is 2. If not specified,
yading@10 12952 B<chroma_power> and B<alpha_power> default to the
yading@10 12953 corresponding value set for B<luma_power>.
yading@10 12954
yading@10 12955 A value of 0 will disable the effect.
yading@10 12956
yading@10 12957 =back
yading@10 12958
yading@10 12959
yading@10 12960
yading@10 12961 =head3 Examples
yading@10 12962
yading@10 12963
yading@10 12964
yading@10 12965 =over 4
yading@10 12966
yading@10 12967
yading@10 12968 =item *
yading@10 12969
yading@10 12970 Apply a boxblur filter with luma, chroma, and alpha radius
yading@10 12971 set to 2:
yading@10 12972
yading@10 12973 boxblur=luma_radius=2:luma_power=1
yading@10 12974 boxblur=2:1
yading@10 12975
yading@10 12976
yading@10 12977
yading@10 12978 =item *
yading@10 12979
yading@10 12980 Set luma radius to 2, alpha and chroma radius to 0:
yading@10 12981
yading@10 12982 boxblur=2:1:cr=0:ar=0
yading@10 12983
yading@10 12984
yading@10 12985
yading@10 12986 =item *
yading@10 12987
yading@10 12988 Set luma and chroma radius to a fraction of the video dimension:
yading@10 12989
yading@10 12990 boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
yading@10 12991
yading@10 12992
yading@10 12993 =back
yading@10 12994
yading@10 12995
yading@10 12996
yading@10 12997 =head2 colorbalance
yading@10 12998
yading@10 12999 Modify intensity of primary colors (red, green and blue) of input frames.
yading@10 13000
yading@10 13001 The filter allows an input frame to be adjusted in the shadows, midtones or highlights
yading@10 13002 regions for the red-cyan, green-magenta or blue-yellow balance.
yading@10 13003
yading@10 13004 A positive adjustment value shifts the balance towards the primary color, a negative
yading@10 13005 value towards the complementary color.
yading@10 13006
yading@10 13007 The filter accepts the following options:
yading@10 13008
yading@10 13009
yading@10 13010 =over 4
yading@10 13011
yading@10 13012
yading@10 13013 =item B<rs>
yading@10 13014
yading@10 13015
yading@10 13016 =item B<gs>
yading@10 13017
yading@10 13018
yading@10 13019 =item B<bs>
yading@10 13020
yading@10 13021 Adjust red, green and blue shadows (darkest pixels).
yading@10 13022
yading@10 13023
yading@10 13024 =item B<rm>
yading@10 13025
yading@10 13026
yading@10 13027 =item B<gm>
yading@10 13028
yading@10 13029
yading@10 13030 =item B<bm>
yading@10 13031
yading@10 13032 Adjust red, green and blue midtones (medium pixels).
yading@10 13033
yading@10 13034
yading@10 13035 =item B<rh>
yading@10 13036
yading@10 13037
yading@10 13038 =item B<gh>
yading@10 13039
yading@10 13040
yading@10 13041 =item B<bh>
yading@10 13042
yading@10 13043 Adjust red, green and blue highlights (brightest pixels).
yading@10 13044
yading@10 13045 Allowed ranges for options are C<[-1.0, 1.0]>. Defaults are C<0>.
yading@10 13046
yading@10 13047 =back
yading@10 13048
yading@10 13049
yading@10 13050
yading@10 13051 =head3 Examples
yading@10 13052
yading@10 13053
yading@10 13054
yading@10 13055 =over 4
yading@10 13056
yading@10 13057
yading@10 13058 =item *
yading@10 13059
yading@10 13060 Add red color cast to shadows:
yading@10 13061
yading@10 13062 colorbalance=rs=.3
yading@10 13063
yading@10 13064
yading@10 13065 =back
yading@10 13066
yading@10 13067
yading@10 13068
yading@10 13069 =head2 colorchannelmixer
yading@10 13070
yading@10 13071
yading@10 13072 Adjust video input frames by re-mixing color channels.
yading@10 13073
yading@10 13074 This filter modifies a color channel by adding the values associated to
yading@10 13075 the other channels of the same pixels. For example if the value to
yading@10 13076 modify is red, the output value will be:
yading@10 13077
yading@10 13078 <red>=<red>*<rr> + <blue>*<rb> + <green>*<rg> + <alpha>*<ra>
yading@10 13079
yading@10 13080
yading@10 13081 The filter accepts the following options:
yading@10 13082
yading@10 13083
yading@10 13084 =over 4
yading@10 13085
yading@10 13086
yading@10 13087 =item B<rr>
yading@10 13088
yading@10 13089
yading@10 13090 =item B<rg>
yading@10 13091
yading@10 13092
yading@10 13093 =item B<rb>
yading@10 13094
yading@10 13095
yading@10 13096 =item B<ra>
yading@10 13097
yading@10 13098 Adjust contribution of input red, green, blue and alpha channels for output red channel.
yading@10 13099 Default is C<1> for I<rr>, and C<0> for I<rg>, I<rb> and I<ra>.
yading@10 13100
yading@10 13101
yading@10 13102 =item B<gr>
yading@10 13103
yading@10 13104
yading@10 13105 =item B<gg>
yading@10 13106
yading@10 13107
yading@10 13108 =item B<gb>
yading@10 13109
yading@10 13110
yading@10 13111 =item B<ga>
yading@10 13112
yading@10 13113 Adjust contribution of input red, green, blue and alpha channels for output green channel.
yading@10 13114 Default is C<1> for I<gg>, and C<0> for I<gr>, I<gb> and I<ga>.
yading@10 13115
yading@10 13116
yading@10 13117 =item B<br>
yading@10 13118
yading@10 13119
yading@10 13120 =item B<bg>
yading@10 13121
yading@10 13122
yading@10 13123 =item B<bb>
yading@10 13124
yading@10 13125
yading@10 13126 =item B<ba>
yading@10 13127
yading@10 13128 Adjust contribution of input red, green, blue and alpha channels for output blue channel.
yading@10 13129 Default is C<1> for I<bb>, and C<0> for I<br>, I<bg> and I<ba>.
yading@10 13130
yading@10 13131
yading@10 13132 =item B<ar>
yading@10 13133
yading@10 13134
yading@10 13135 =item B<ag>
yading@10 13136
yading@10 13137
yading@10 13138 =item B<ab>
yading@10 13139
yading@10 13140
yading@10 13141 =item B<aa>
yading@10 13142
yading@10 13143 Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
yading@10 13144 Default is C<1> for I<aa>, and C<0> for I<ar>, I<ag> and I<ab>.
yading@10 13145
yading@10 13146 Allowed ranges for options are C<[-2.0, 2.0]>.
yading@10 13147
yading@10 13148 =back
yading@10 13149
yading@10 13150
yading@10 13151
yading@10 13152 =head3 Examples
yading@10 13153
yading@10 13154
yading@10 13155
yading@10 13156 =over 4
yading@10 13157
yading@10 13158
yading@10 13159 =item *
yading@10 13160
yading@10 13161 Convert source to grayscale:
yading@10 13162
yading@10 13163 colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
yading@10 13164
yading@10 13165
yading@10 13166 =back
yading@10 13167
yading@10 13168
yading@10 13169
yading@10 13170 =head2 colormatrix
yading@10 13171
yading@10 13172
yading@10 13173 Convert color matrix.
yading@10 13174
yading@10 13175 The filter accepts the following options:
yading@10 13176
yading@10 13177
yading@10 13178 =over 4
yading@10 13179
yading@10 13180
yading@10 13181 =item B<src>
yading@10 13182
yading@10 13183
yading@10 13184 =item B<dst>
yading@10 13185
yading@10 13186 Specify the source and destination color matrix. Both values must be
yading@10 13187 specified.
yading@10 13188
yading@10 13189 The accepted values are:
yading@10 13190
yading@10 13191 =over 4
yading@10 13192
yading@10 13193
yading@10 13194 =item B<bt709>
yading@10 13195
yading@10 13196 BT.709
yading@10 13197
yading@10 13198
yading@10 13199 =item B<bt601>
yading@10 13200
yading@10 13201 BT.601
yading@10 13202
yading@10 13203
yading@10 13204 =item B<smpte240m>
yading@10 13205
yading@10 13206 SMPTE-240M
yading@10 13207
yading@10 13208
yading@10 13209 =item B<fcc>
yading@10 13210
yading@10 13211 FCC
yading@10 13212
yading@10 13213 =back
yading@10 13214
yading@10 13215
yading@10 13216 =back
yading@10 13217
yading@10 13218
yading@10 13219 For example to convert from BT.601 to SMPTE-240M, use the command:
yading@10 13220
yading@10 13221 colormatrix=bt601:smpte240m
yading@10 13222
yading@10 13223
yading@10 13224
yading@10 13225 =head2 copy
yading@10 13226
yading@10 13227
yading@10 13228 Copy the input source unchanged to the output. Mainly useful for
yading@10 13229 testing purposes.
yading@10 13230
yading@10 13231
yading@10 13232 =head2 crop
yading@10 13233
yading@10 13234
yading@10 13235 Crop the input video to given dimensions.
yading@10 13236
yading@10 13237 The filter accepts the following options:
yading@10 13238
yading@10 13239
yading@10 13240 =over 4
yading@10 13241
yading@10 13242
yading@10 13243 =item B<w, out_w>
yading@10 13244
yading@10 13245 Width of the output video. It defaults to C<iw>.
yading@10 13246 This expression is evaluated only once during the filter
yading@10 13247 configuration.
yading@10 13248
yading@10 13249
yading@10 13250 =item B<h, out_h>
yading@10 13251
yading@10 13252 Height of the output video. It defaults to C<ih>.
yading@10 13253 This expression is evaluated only once during the filter
yading@10 13254 configuration.
yading@10 13255
yading@10 13256
yading@10 13257 =item B<x>
yading@10 13258
yading@10 13259 Horizontal position, in the input video, of the left edge of the output video.
yading@10 13260 It defaults to C<(in_w-out_w)/2>.
yading@10 13261 This expression is evaluated per-frame.
yading@10 13262
yading@10 13263
yading@10 13264 =item B<y>
yading@10 13265
yading@10 13266 Vertical position, in the input video, of the top edge of the output video.
yading@10 13267 It defaults to C<(in_h-out_h)/2>.
yading@10 13268 This expression is evaluated per-frame.
yading@10 13269
yading@10 13270
yading@10 13271 =item B<keep_aspect>
yading@10 13272
yading@10 13273 If set to 1 will force the output display aspect ratio
yading@10 13274 to be the same of the input, by changing the output sample aspect
yading@10 13275 ratio. It defaults to 0.
yading@10 13276
yading@10 13277 =back
yading@10 13278
yading@10 13279
yading@10 13280 The I<out_w>, I<out_h>, I<x>, I<y> parameters are
yading@10 13281 expressions containing the following constants:
yading@10 13282
yading@10 13283
yading@10 13284 =over 4
yading@10 13285
yading@10 13286
yading@10 13287 =item B<x, y>
yading@10 13288
yading@10 13289 the computed values for I<x> and I<y>. They are evaluated for
yading@10 13290 each new frame.
yading@10 13291
yading@10 13292
yading@10 13293 =item B<in_w, in_h>
yading@10 13294
yading@10 13295 the input width and height
yading@10 13296
yading@10 13297
yading@10 13298 =item B<iw, ih>
yading@10 13299
yading@10 13300 same as I<in_w> and I<in_h>
yading@10 13301
yading@10 13302
yading@10 13303 =item B<out_w, out_h>
yading@10 13304
yading@10 13305 the output (cropped) width and height
yading@10 13306
yading@10 13307
yading@10 13308 =item B<ow, oh>
yading@10 13309
yading@10 13310 same as I<out_w> and I<out_h>
yading@10 13311
yading@10 13312
yading@10 13313 =item B<a>
yading@10 13314
yading@10 13315 same as I<iw> / I<ih>
yading@10 13316
yading@10 13317
yading@10 13318 =item B<sar>
yading@10 13319
yading@10 13320 input sample aspect ratio
yading@10 13321
yading@10 13322
yading@10 13323 =item B<dar>
yading@10 13324
yading@10 13325 input display aspect ratio, it is the same as (I<iw> / I<ih>) * I<sar>
yading@10 13326
yading@10 13327
yading@10 13328 =item B<hsub, vsub>
yading@10 13329
yading@10 13330 horizontal and vertical chroma subsample values. For example for the
yading@10 13331 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 13332
yading@10 13333
yading@10 13334 =item B<n>
yading@10 13335
yading@10 13336 the number of input frame, starting from 0
yading@10 13337
yading@10 13338
yading@10 13339 =item B<pos>
yading@10 13340
yading@10 13341 the position in the file of the input frame, NAN if unknown
yading@10 13342
yading@10 13343
yading@10 13344 =item B<t>
yading@10 13345
yading@10 13346 timestamp expressed in seconds, NAN if the input timestamp is unknown
yading@10 13347
yading@10 13348
yading@10 13349 =back
yading@10 13350
yading@10 13351
yading@10 13352 The expression for I<out_w> may depend on the value of I<out_h>,
yading@10 13353 and the expression for I<out_h> may depend on I<out_w>, but they
yading@10 13354 cannot depend on I<x> and I<y>, as I<x> and I<y> are
yading@10 13355 evaluated after I<out_w> and I<out_h>.
yading@10 13356
yading@10 13357 The I<x> and I<y> parameters specify the expressions for the
yading@10 13358 position of the top-left corner of the output (non-cropped) area. They
yading@10 13359 are evaluated for each frame. If the evaluated value is not valid, it
yading@10 13360 is approximated to the nearest valid value.
yading@10 13361
yading@10 13362 The expression for I<x> may depend on I<y>, and the expression
yading@10 13363 for I<y> may depend on I<x>.
yading@10 13364
yading@10 13365
yading@10 13366 =head3 Examples
yading@10 13367
yading@10 13368
yading@10 13369
yading@10 13370 =over 4
yading@10 13371
yading@10 13372
yading@10 13373 =item *
yading@10 13374
yading@10 13375 Crop area with size 100x100 at position (12,34).
yading@10 13376
yading@10 13377 crop=100:100:12:34
yading@10 13378
yading@10 13379
yading@10 13380 Using named options, the example above becomes:
yading@10 13381
yading@10 13382 crop=w=100:h=100:x=12:y=34
yading@10 13383
yading@10 13384
yading@10 13385
yading@10 13386 =item *
yading@10 13387
yading@10 13388 Crop the central input area with size 100x100:
yading@10 13389
yading@10 13390 crop=100:100
yading@10 13391
yading@10 13392
yading@10 13393
yading@10 13394 =item *
yading@10 13395
yading@10 13396 Crop the central input area with size 2/3 of the input video:
yading@10 13397
yading@10 13398 crop=2/3*in_w:2/3*in_h
yading@10 13399
yading@10 13400
yading@10 13401
yading@10 13402 =item *
yading@10 13403
yading@10 13404 Crop the input video central square:
yading@10 13405
yading@10 13406 crop=out_w=in_h
yading@10 13407 crop=in_h
yading@10 13408
yading@10 13409
yading@10 13410
yading@10 13411 =item *
yading@10 13412
yading@10 13413 Delimit the rectangle with the top-left corner placed at position
yading@10 13414 100:100 and the right-bottom corner corresponding to the right-bottom
yading@10 13415 corner of the input image:
yading@10 13416
yading@10 13417 crop=in_w-100:in_h-100:100:100
yading@10 13418
yading@10 13419
yading@10 13420
yading@10 13421 =item *
yading@10 13422
yading@10 13423 Crop 10 pixels from the left and right borders, and 20 pixels from
yading@10 13424 the top and bottom borders
yading@10 13425
yading@10 13426 crop=in_w-2*10:in_h-2*20
yading@10 13427
yading@10 13428
yading@10 13429
yading@10 13430 =item *
yading@10 13431
yading@10 13432 Keep only the bottom right quarter of the input image:
yading@10 13433
yading@10 13434 crop=in_w/2:in_h/2:in_w/2:in_h/2
yading@10 13435
yading@10 13436
yading@10 13437
yading@10 13438 =item *
yading@10 13439
yading@10 13440 Crop height for getting Greek harmony:
yading@10 13441
yading@10 13442 crop=in_w:1/PHI*in_w
yading@10 13443
yading@10 13444
yading@10 13445
yading@10 13446 =item *
yading@10 13447
yading@10 13448 Appply trembling effect:
yading@10 13449
yading@10 13450 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 13451
yading@10 13452
yading@10 13453
yading@10 13454 =item *
yading@10 13455
yading@10 13456 Apply erratic camera effect depending on timestamp:
yading@10 13457
yading@10 13458 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 13459
yading@10 13460
yading@10 13461
yading@10 13462 =item *
yading@10 13463
yading@10 13464 Set x depending on the value of y:
yading@10 13465
yading@10 13466 crop=in_w/2:in_h/2:y:10+10*sin(n/10)
yading@10 13467
yading@10 13468
yading@10 13469 =back
yading@10 13470
yading@10 13471
yading@10 13472
yading@10 13473 =head2 cropdetect
yading@10 13474
yading@10 13475
yading@10 13476 Auto-detect crop size.
yading@10 13477
yading@10 13478 Calculate necessary cropping parameters and prints the recommended
yading@10 13479 parameters through the logging system. The detected dimensions
yading@10 13480 correspond to the non-black area of the input video.
yading@10 13481
yading@10 13482 The filter accepts the following options:
yading@10 13483
yading@10 13484
yading@10 13485 =over 4
yading@10 13486
yading@10 13487
yading@10 13488
yading@10 13489 =item B<limit>
yading@10 13490
yading@10 13491 Set higher black value threshold, which can be optionally specified
yading@10 13492 from nothing (0) to everything (255). An intensity value greater
yading@10 13493 to the set value is considered non-black. Default value is 24.
yading@10 13494
yading@10 13495
yading@10 13496 =item B<round>
yading@10 13497
yading@10 13498 Set the value for which the width/height should be divisible by. The
yading@10 13499 offset is automatically adjusted to center the video. Use 2 to get
yading@10 13500 only even dimensions (needed for 4:2:2 video). 16 is best when
yading@10 13501 encoding to most video codecs. Default value is 16.
yading@10 13502
yading@10 13503
yading@10 13504 =item B<reset_count, reset>
yading@10 13505
yading@10 13506 Set the counter that determines after how many frames cropdetect will
yading@10 13507 reset the previously detected largest video area and start over to
yading@10 13508 detect the current optimal crop area. Default value is 0.
yading@10 13509
yading@10 13510 This can be useful when channel logos distort the video area. 0
yading@10 13511 indicates never reset and return the largest area encountered during
yading@10 13512 playback.
yading@10 13513
yading@10 13514 =back
yading@10 13515
yading@10 13516
yading@10 13517
yading@10 13518 =head2 curves
yading@10 13519
yading@10 13520
yading@10 13521 Apply color adjustments using curves.
yading@10 13522
yading@10 13523 This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
yading@10 13524 component (red, green and blue) has its values defined by I<N> key points
yading@10 13525 tied from each other using a smooth curve. The x-axis represents the pixel
yading@10 13526 values from the input frame, and the y-axis the new pixel values to be set for
yading@10 13527 the output frame.
yading@10 13528
yading@10 13529 By default, a component curve is defined by the two points I<(0;0)> and
yading@10 13530 I<(1;1)>. This creates a straight line where each original pixel value is
yading@10 13531 "adjusted" to its own value, which means no change to the image.
yading@10 13532
yading@10 13533 The filter allows you to redefine these two points and add some more. A new
yading@10 13534 curve (using a natural cubic spline interpolation) will be define to pass
yading@10 13535 smoothly through all these new coordinates. The new defined points needs to be
yading@10 13536 strictly increasing over the x-axis, and their I<x> and I<y> values must
yading@10 13537 be in the I<[0;1]> interval. If the computed curves happened to go outside
yading@10 13538 the vector spaces, the values will be clipped accordingly.
yading@10 13539
yading@10 13540 If there is no key point defined in C<x=0>, the filter will automatically
yading@10 13541 insert a I<(0;0)> point. In the same way, if there is no key point defined
yading@10 13542 in C<x=1>, the filter will automatically insert a I<(1;1)> point.
yading@10 13543
yading@10 13544 The filter accepts the following options:
yading@10 13545
yading@10 13546
yading@10 13547 =over 4
yading@10 13548
yading@10 13549
yading@10 13550 =item B<preset>
yading@10 13551
yading@10 13552 Select one of the available color presets. This option can be used in addition
yading@10 13553 to the B<r>, B<g>, B<b> parameters; in this case, the later
yading@10 13554 options takes priority on the preset values.
yading@10 13555 Available presets are:
yading@10 13556
yading@10 13557 =over 4
yading@10 13558
yading@10 13559
yading@10 13560 =item B<none>
yading@10 13561
yading@10 13562
yading@10 13563 =item B<color_negative>
yading@10 13564
yading@10 13565
yading@10 13566 =item B<cross_process>
yading@10 13567
yading@10 13568
yading@10 13569 =item B<darker>
yading@10 13570
yading@10 13571
yading@10 13572 =item B<increase_contrast>
yading@10 13573
yading@10 13574
yading@10 13575 =item B<lighter>
yading@10 13576
yading@10 13577
yading@10 13578 =item B<linear_contrast>
yading@10 13579
yading@10 13580
yading@10 13581 =item B<medium_contrast>
yading@10 13582
yading@10 13583
yading@10 13584 =item B<negative>
yading@10 13585
yading@10 13586
yading@10 13587 =item B<strong_contrast>
yading@10 13588
yading@10 13589
yading@10 13590 =item B<vintage>
yading@10 13591
yading@10 13592
yading@10 13593 =back
yading@10 13594
yading@10 13595 Default is C<none>.
yading@10 13596
yading@10 13597 =item B<master, m>
yading@10 13598
yading@10 13599 Set the master key points. These points will define a second pass mapping. It
yading@10 13600 is sometimes called a "luminance" or "value" mapping. It can be used with
yading@10 13601 B<r>, B<g>, B<b> or B<all> since it acts like a
yading@10 13602 post-processing LUT.
yading@10 13603
yading@10 13604 =item B<red, r>
yading@10 13605
yading@10 13606 Set the key points for the red component.
yading@10 13607
yading@10 13608 =item B<green, g>
yading@10 13609
yading@10 13610 Set the key points for the green component.
yading@10 13611
yading@10 13612 =item B<blue, b>
yading@10 13613
yading@10 13614 Set the key points for the blue component.
yading@10 13615
yading@10 13616 =item B<all>
yading@10 13617
yading@10 13618 Set the key points for all components (not including master).
yading@10 13619 Can be used in addition to the other key points component
yading@10 13620 options. In this case, the unset component(s) will fallback on this
yading@10 13621 B<all> setting.
yading@10 13622
yading@10 13623 =item B<psfile>
yading@10 13624
yading@10 13625 Specify a Photoshop curves file (C<.asv>) to import the settings from.
yading@10 13626
yading@10 13627 =back
yading@10 13628
yading@10 13629
yading@10 13630 To avoid some filtergraph syntax conflicts, each key points list need to be
yading@10 13631 defined using the following syntax: C<x0/y0 x1/y1 x2/y2 ...>.
yading@10 13632
yading@10 13633
yading@10 13634 =head3 Examples
yading@10 13635
yading@10 13636
yading@10 13637
yading@10 13638 =over 4
yading@10 13639
yading@10 13640
yading@10 13641 =item *
yading@10 13642
yading@10 13643 Increase slightly the middle level of blue:
yading@10 13644
yading@10 13645 curves=blue='0.5/0.58'
yading@10 13646
yading@10 13647
yading@10 13648
yading@10 13649 =item *
yading@10 13650
yading@10 13651 Vintage effect:
yading@10 13652
yading@10 13653 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 13654
yading@10 13655 Here we obtain the following coordinates for each components:
yading@10 13656
yading@10 13657 =over 4
yading@10 13658
yading@10 13659
yading@10 13660 =item I<red>
yading@10 13661
yading@10 13662 C<(0;0.11) (0.42;0.51) (1;0.95)>
yading@10 13663
yading@10 13664 =item I<green>
yading@10 13665
yading@10 13666 C<(0;0) (0.50;0.48) (1;1)>
yading@10 13667
yading@10 13668 =item I<blue>
yading@10 13669
yading@10 13670 C<(0;0.22) (0.49;0.44) (1;0.80)>
yading@10 13671
yading@10 13672 =back
yading@10 13673
yading@10 13674
yading@10 13675
yading@10 13676 =item *
yading@10 13677
yading@10 13678 The previous example can also be achieved with the associated built-in preset:
yading@10 13679
yading@10 13680 curves=preset=vintage
yading@10 13681
yading@10 13682
yading@10 13683
yading@10 13684 =item *
yading@10 13685
yading@10 13686 Or simply:
yading@10 13687
yading@10 13688 curves=vintage
yading@10 13689
yading@10 13690
yading@10 13691
yading@10 13692 =item *
yading@10 13693
yading@10 13694 Use a Photoshop preset and redefine the points of the green component:
yading@10 13695
yading@10 13696 curves=psfile='MyCurvesPresets/purple.asv':green='0.45/0.53'
yading@10 13697
yading@10 13698
yading@10 13699 =back
yading@10 13700
yading@10 13701
yading@10 13702
yading@10 13703
yading@10 13704 =head2 decimate
yading@10 13705
yading@10 13706
yading@10 13707 Drop duplicated frames at regular intervals.
yading@10 13708
yading@10 13709 The filter accepts the following options:
yading@10 13710
yading@10 13711
yading@10 13712 =over 4
yading@10 13713
yading@10 13714
yading@10 13715 =item B<cycle>
yading@10 13716
yading@10 13717 Set the number of frames from which one will be dropped. Setting this to
yading@10 13718 I<N> means one frame in every batch of I<N> frames will be dropped.
yading@10 13719 Default is C<5>.
yading@10 13720
yading@10 13721
yading@10 13722 =item B<dupthresh>
yading@10 13723
yading@10 13724 Set the threshold for duplicate detection. If the difference metric for a frame
yading@10 13725 is less than or equal to this value, then it is declared as duplicate. Default
yading@10 13726 is C<1.1>
yading@10 13727
yading@10 13728
yading@10 13729 =item B<scthresh>
yading@10 13730
yading@10 13731 Set scene change threshold. Default is C<15>.
yading@10 13732
yading@10 13733
yading@10 13734 =item B<blockx>
yading@10 13735
yading@10 13736
yading@10 13737 =item B<blocky>
yading@10 13738
yading@10 13739 Set the size of the x and y-axis blocks used during metric calculations.
yading@10 13740 Larger blocks give better noise suppression, but also give worse detection of
yading@10 13741 small movements. Must be a power of two. Default is C<32>.
yading@10 13742
yading@10 13743
yading@10 13744 =item B<ppsrc>
yading@10 13745
yading@10 13746 Mark main input as a pre-processed input and activate clean source input
yading@10 13747 stream. This allows the input to be pre-processed with various filters to help
yading@10 13748 the metrics calculation while keeping the frame selection lossless. When set to
yading@10 13749 C<1>, the first stream is for the pre-processed input, and the second
yading@10 13750 stream is the clean source from where the kept frames are chosen. Default is
yading@10 13751 C<0>.
yading@10 13752
yading@10 13753
yading@10 13754 =item B<chroma>
yading@10 13755
yading@10 13756 Set whether or not chroma is considered in the metric calculations. Default is
yading@10 13757 C<1>.
yading@10 13758
yading@10 13759 =back
yading@10 13760
yading@10 13761
yading@10 13762
yading@10 13763 =head2 delogo
yading@10 13764
yading@10 13765
yading@10 13766 Suppress a TV station logo by a simple interpolation of the surrounding
yading@10 13767 pixels. Just set a rectangle covering the logo and watch it disappear
yading@10 13768 (and sometimes something even uglier appear - your mileage may vary).
yading@10 13769
yading@10 13770 This filter accepts the following options:
yading@10 13771
yading@10 13772 =over 4
yading@10 13773
yading@10 13774
yading@10 13775
yading@10 13776 =item B<x, y>
yading@10 13777
yading@10 13778 Specify the top left corner coordinates of the logo. They must be
yading@10 13779 specified.
yading@10 13780
yading@10 13781
yading@10 13782 =item B<w, h>
yading@10 13783
yading@10 13784 Specify the width and height of the logo to clear. They must be
yading@10 13785 specified.
yading@10 13786
yading@10 13787
yading@10 13788 =item B<band, t>
yading@10 13789
yading@10 13790 Specify the thickness of the fuzzy edge of the rectangle (added to
yading@10 13791 I<w> and I<h>). The default value is 4.
yading@10 13792
yading@10 13793
yading@10 13794 =item B<show>
yading@10 13795
yading@10 13796 When set to 1, a green rectangle is drawn on the screen to simplify
yading@10 13797 finding the right I<x>, I<y>, I<w>, I<h> parameters, and
yading@10 13798 I<band> is set to 4. The default value is 0.
yading@10 13799
yading@10 13800
yading@10 13801 =back
yading@10 13802
yading@10 13803
yading@10 13804
yading@10 13805 =head3 Examples
yading@10 13806
yading@10 13807
yading@10 13808
yading@10 13809 =over 4
yading@10 13810
yading@10 13811
yading@10 13812 =item *
yading@10 13813
yading@10 13814 Set a rectangle covering the area with top left corner coordinates 0,0
yading@10 13815 and size 100x77, setting a band of size 10:
yading@10 13816
yading@10 13817 delogo=x=0:y=0:w=100:h=77:band=10
yading@10 13818
yading@10 13819
yading@10 13820
yading@10 13821 =back
yading@10 13822
yading@10 13823
yading@10 13824
yading@10 13825 =head2 deshake
yading@10 13826
yading@10 13827
yading@10 13828 Attempt to fix small changes in horizontal and/or vertical shift. This
yading@10 13829 filter helps remove camera shake from hand-holding a camera, bumping a
yading@10 13830 tripod, moving on a vehicle, etc.
yading@10 13831
yading@10 13832 The filter accepts the following options:
yading@10 13833
yading@10 13834
yading@10 13835 =over 4
yading@10 13836
yading@10 13837
yading@10 13838
yading@10 13839 =item B<x>
yading@10 13840
yading@10 13841
yading@10 13842 =item B<y>
yading@10 13843
yading@10 13844
yading@10 13845 =item B<w>
yading@10 13846
yading@10 13847
yading@10 13848 =item B<h>
yading@10 13849
yading@10 13850 Specify a rectangular area where to limit the search for motion
yading@10 13851 vectors.
yading@10 13852 If desired the search for motion vectors can be limited to a
yading@10 13853 rectangular area of the frame defined by its top left corner, width
yading@10 13854 and height. These parameters have the same meaning as the drawbox
yading@10 13855 filter which can be used to visualise the position of the bounding
yading@10 13856 box.
yading@10 13857
yading@10 13858 This is useful when simultaneous movement of subjects within the frame
yading@10 13859 might be confused for camera motion by the motion vector search.
yading@10 13860
yading@10 13861 If any or all of I<x>, I<y>, I<w> and I<h> are set to -1
yading@10 13862 then the full frame is used. This allows later options to be set
yading@10 13863 without specifying the bounding box for the motion vector search.
yading@10 13864
yading@10 13865 Default - search the whole frame.
yading@10 13866
yading@10 13867
yading@10 13868 =item B<rx>
yading@10 13869
yading@10 13870
yading@10 13871 =item B<ry>
yading@10 13872
yading@10 13873 Specify the maximum extent of movement in x and y directions in the
yading@10 13874 range 0-64 pixels. Default 16.
yading@10 13875
yading@10 13876
yading@10 13877 =item B<edge>
yading@10 13878
yading@10 13879 Specify how to generate pixels to fill blanks at the edge of the
yading@10 13880 frame. Available values are:
yading@10 13881
yading@10 13882 =over 4
yading@10 13883
yading@10 13884
yading@10 13885 =item B<blank, 0>
yading@10 13886
yading@10 13887 Fill zeroes at blank locations
yading@10 13888
yading@10 13889 =item B<original, 1>
yading@10 13890
yading@10 13891 Original image at blank locations
yading@10 13892
yading@10 13893 =item B<clamp, 2>
yading@10 13894
yading@10 13895 Extruded edge value at blank locations
yading@10 13896
yading@10 13897 =item B<mirror, 3>
yading@10 13898
yading@10 13899 Mirrored edge at blank locations
yading@10 13900
yading@10 13901 =back
yading@10 13902
yading@10 13903 Default value is B<mirror>.
yading@10 13904
yading@10 13905
yading@10 13906 =item B<blocksize>
yading@10 13907
yading@10 13908 Specify the blocksize to use for motion search. Range 4-128 pixels,
yading@10 13909 default 8.
yading@10 13910
yading@10 13911
yading@10 13912 =item B<contrast>
yading@10 13913
yading@10 13914 Specify the contrast threshold for blocks. Only blocks with more than
yading@10 13915 the specified contrast (difference between darkest and lightest
yading@10 13916 pixels) will be considered. Range 1-255, default 125.
yading@10 13917
yading@10 13918
yading@10 13919 =item B<search>
yading@10 13920
yading@10 13921 Specify the search strategy. Available values are:
yading@10 13922
yading@10 13923 =over 4
yading@10 13924
yading@10 13925
yading@10 13926 =item B<exhaustive, 0>
yading@10 13927
yading@10 13928 Set exhaustive search
yading@10 13929
yading@10 13930 =item B<less, 1>
yading@10 13931
yading@10 13932 Set less exhaustive search.
yading@10 13933
yading@10 13934 =back
yading@10 13935
yading@10 13936 Default value is B<exhaustive>.
yading@10 13937
yading@10 13938
yading@10 13939 =item B<filename>
yading@10 13940
yading@10 13941 If set then a detailed log of the motion search is written to the
yading@10 13942 specified file.
yading@10 13943
yading@10 13944
yading@10 13945 =item B<opencl>
yading@10 13946
yading@10 13947 If set to 1, specify using OpenCL capabilities, only available if
yading@10 13948 FFmpeg was configured with C<--enable-opencl>. Default value is 0.
yading@10 13949
yading@10 13950
yading@10 13951 =back
yading@10 13952
yading@10 13953
yading@10 13954
yading@10 13955 =head2 drawbox
yading@10 13956
yading@10 13957
yading@10 13958 Draw a colored box on the input image.
yading@10 13959
yading@10 13960 This filter accepts the following options:
yading@10 13961
yading@10 13962
yading@10 13963 =over 4
yading@10 13964
yading@10 13965
yading@10 13966 =item B<x, y>
yading@10 13967
yading@10 13968 Specify the top left corner coordinates of the box. Default to 0.
yading@10 13969
yading@10 13970
yading@10 13971 =item B<width, w>
yading@10 13972
yading@10 13973
yading@10 13974 =item B<height, h>
yading@10 13975
yading@10 13976 Specify the width and height of the box, if 0 they are interpreted as
yading@10 13977 the input width and height. Default to 0.
yading@10 13978
yading@10 13979
yading@10 13980 =item B<color, c>
yading@10 13981
yading@10 13982 Specify the color of the box to write, it can be the name of a color
yading@10 13983 (case insensitive match) or a 0xRRGGBB[AA] sequence. If the special
yading@10 13984 value C<invert> is used, the box edge color is the same as the
yading@10 13985 video with inverted luma.
yading@10 13986
yading@10 13987
yading@10 13988 =item B<thickness, t>
yading@10 13989
yading@10 13990 Set the thickness of the box edge. Default value is C<4>.
yading@10 13991
yading@10 13992 =back
yading@10 13993
yading@10 13994
yading@10 13995
yading@10 13996 =head3 Examples
yading@10 13997
yading@10 13998
yading@10 13999
yading@10 14000 =over 4
yading@10 14001
yading@10 14002
yading@10 14003 =item *
yading@10 14004
yading@10 14005 Draw a black box around the edge of the input image:
yading@10 14006
yading@10 14007 drawbox
yading@10 14008
yading@10 14009
yading@10 14010
yading@10 14011 =item *
yading@10 14012
yading@10 14013 Draw a box with color red and an opacity of 50%:
yading@10 14014
yading@10 14015 drawbox=10:20:200:60:red@0.5
yading@10 14016
yading@10 14017
yading@10 14018 The previous example can be specified as:
yading@10 14019
yading@10 14020 drawbox=x=10:y=20:w=200:h=60:color=red@0.5
yading@10 14021
yading@10 14022
yading@10 14023
yading@10 14024 =item *
yading@10 14025
yading@10 14026 Fill the box with pink color:
yading@10 14027
yading@10 14028 drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=max
yading@10 14029
yading@10 14030
yading@10 14031 =back
yading@10 14032
yading@10 14033
yading@10 14034
yading@10 14035
yading@10 14036 =head2 drawtext
yading@10 14037
yading@10 14038
yading@10 14039 Draw text string or text from specified file on top of video using the
yading@10 14040 libfreetype library.
yading@10 14041
yading@10 14042 To enable compilation of this filter you need to configure FFmpeg with
yading@10 14043 C<--enable-libfreetype>.
yading@10 14044
yading@10 14045
yading@10 14046 =head3 Syntax
yading@10 14047
yading@10 14048
yading@10 14049 The description of the accepted parameters follows.
yading@10 14050
yading@10 14051
yading@10 14052 =over 4
yading@10 14053
yading@10 14054
yading@10 14055
yading@10 14056 =item B<box>
yading@10 14057
yading@10 14058 Used to draw a box around text using background color.
yading@10 14059 Value should be either 1 (enable) or 0 (disable).
yading@10 14060 The default value of I<box> is 0.
yading@10 14061
yading@10 14062
yading@10 14063 =item B<boxcolor>
yading@10 14064
yading@10 14065 The color to be used for drawing box around text.
yading@10 14066 Either a string (e.g. "yellow") or in 0xRRGGBB[AA] format
yading@10 14067 (e.g. "0xff00ff"), possibly followed by an alpha specifier.
yading@10 14068 The default value of I<boxcolor> is "white".
yading@10 14069
yading@10 14070
yading@10 14071 =item B<draw>
yading@10 14072
yading@10 14073 Set an expression which specifies if the text should be drawn. If the
yading@10 14074 expression evaluates to 0, the text is not drawn. This is useful for
yading@10 14075 specifying that the text should be drawn only when specific conditions
yading@10 14076 are met.
yading@10 14077
yading@10 14078 Default value is "1".
yading@10 14079
yading@10 14080 See below for the list of accepted constants and functions.
yading@10 14081
yading@10 14082
yading@10 14083 =item B<expansion>
yading@10 14084
yading@10 14085 Select how the I<text> is expanded. Can be either C<none>,
yading@10 14086 C<strftime> (deprecated) or
yading@10 14087 C<normal> (default). See the drawtext_expansion, Text expansion section
yading@10 14088 below for details.
yading@10 14089
yading@10 14090
yading@10 14091 =item B<fix_bounds>
yading@10 14092
yading@10 14093 If true, check and fix text coords to avoid clipping.
yading@10 14094
yading@10 14095
yading@10 14096 =item B<fontcolor>
yading@10 14097
yading@10 14098 The color to be used for drawing fonts.
yading@10 14099 Either a string (e.g. "red") or in 0xRRGGBB[AA] format
yading@10 14100 (e.g. "0xff000033"), possibly followed by an alpha specifier.
yading@10 14101 The default value of I<fontcolor> is "black".
yading@10 14102
yading@10 14103
yading@10 14104 =item B<fontfile>
yading@10 14105
yading@10 14106 The font file to be used for drawing text. Path must be included.
yading@10 14107 This parameter is mandatory.
yading@10 14108
yading@10 14109
yading@10 14110 =item B<fontsize>
yading@10 14111
yading@10 14112 The font size to be used for drawing text.
yading@10 14113 The default value of I<fontsize> is 16.
yading@10 14114
yading@10 14115
yading@10 14116 =item B<ft_load_flags>
yading@10 14117
yading@10 14118 Flags to be used for loading the fonts.
yading@10 14119
yading@10 14120 The flags map the corresponding flags supported by libfreetype, and are
yading@10 14121 a combination of the following values:
yading@10 14122
yading@10 14123 =over 4
yading@10 14124
yading@10 14125
yading@10 14126 =item I<default>
yading@10 14127
yading@10 14128
yading@10 14129 =item I<no_scale>
yading@10 14130
yading@10 14131
yading@10 14132 =item I<no_hinting>
yading@10 14133
yading@10 14134
yading@10 14135 =item I<render>
yading@10 14136
yading@10 14137
yading@10 14138 =item I<no_bitmap>
yading@10 14139
yading@10 14140
yading@10 14141 =item I<vertical_layout>
yading@10 14142
yading@10 14143
yading@10 14144 =item I<force_autohint>
yading@10 14145
yading@10 14146
yading@10 14147 =item I<crop_bitmap>
yading@10 14148
yading@10 14149
yading@10 14150 =item I<pedantic>
yading@10 14151
yading@10 14152
yading@10 14153 =item I<ignore_global_advance_width>
yading@10 14154
yading@10 14155
yading@10 14156 =item I<no_recurse>
yading@10 14157
yading@10 14158
yading@10 14159 =item I<ignore_transform>
yading@10 14160
yading@10 14161
yading@10 14162 =item I<monochrome>
yading@10 14163
yading@10 14164
yading@10 14165 =item I<linear_design>
yading@10 14166
yading@10 14167
yading@10 14168 =item I<no_autohint>
yading@10 14169
yading@10 14170
yading@10 14171 =item I<end table>
yading@10 14172
yading@10 14173
yading@10 14174 =back
yading@10 14175
yading@10 14176
yading@10 14177 Default value is "render".
yading@10 14178
yading@10 14179 For more information consult the documentation for the FT_LOAD_*
yading@10 14180 libfreetype flags.
yading@10 14181
yading@10 14182
yading@10 14183 =item B<shadowcolor>
yading@10 14184
yading@10 14185 The color to be used for drawing a shadow behind the drawn text. It
yading@10 14186 can be a color name (e.g. "yellow") or a string in the 0xRRGGBB[AA]
yading@10 14187 form (e.g. "0xff00ff"), possibly followed by an alpha specifier.
yading@10 14188 The default value of I<shadowcolor> is "black".
yading@10 14189
yading@10 14190
yading@10 14191 =item B<shadowx, shadowy>
yading@10 14192
yading@10 14193 The x and y offsets for the text shadow position with respect to the
yading@10 14194 position of the text. They can be either positive or negative
yading@10 14195 values. Default value for both is "0".
yading@10 14196
yading@10 14197
yading@10 14198 =item B<tabsize>
yading@10 14199
yading@10 14200 The size in number of spaces to use for rendering the tab.
yading@10 14201 Default value is 4.
yading@10 14202
yading@10 14203
yading@10 14204 =item B<timecode>
yading@10 14205
yading@10 14206 Set the initial timecode representation in "hh:mm:ss[:;.]ff"
yading@10 14207 format. It can be used with or without text parameter. I<timecode_rate>
yading@10 14208 option must be specified.
yading@10 14209
yading@10 14210
yading@10 14211 =item B<timecode_rate, rate, r>
yading@10 14212
yading@10 14213 Set the timecode frame rate (timecode only).
yading@10 14214
yading@10 14215
yading@10 14216 =item B<text>
yading@10 14217
yading@10 14218 The text string to be drawn. The text must be a sequence of UTF-8
yading@10 14219 encoded characters.
yading@10 14220 This parameter is mandatory if no file is specified with the parameter
yading@10 14221 I<textfile>.
yading@10 14222
yading@10 14223
yading@10 14224 =item B<textfile>
yading@10 14225
yading@10 14226 A text file containing text to be drawn. The text must be a sequence
yading@10 14227 of UTF-8 encoded characters.
yading@10 14228
yading@10 14229 This parameter is mandatory if no text string is specified with the
yading@10 14230 parameter I<text>.
yading@10 14231
yading@10 14232 If both I<text> and I<textfile> are specified, an error is thrown.
yading@10 14233
yading@10 14234
yading@10 14235 =item B<reload>
yading@10 14236
yading@10 14237 If set to 1, the I<textfile> will be reloaded before each frame.
yading@10 14238 Be sure to update it atomically, or it may be read partially, or even fail.
yading@10 14239
yading@10 14240
yading@10 14241 =item B<x, y>
yading@10 14242
yading@10 14243 The expressions which specify the offsets where text will be drawn
yading@10 14244 within the video frame. They are relative to the top/left border of the
yading@10 14245 output image.
yading@10 14246
yading@10 14247 The default value of I<x> and I<y> is "0".
yading@10 14248
yading@10 14249 See below for the list of accepted constants and functions.
yading@10 14250
yading@10 14251 =back
yading@10 14252
yading@10 14253
yading@10 14254 The parameters for I<x> and I<y> are expressions containing the
yading@10 14255 following constants and functions:
yading@10 14256
yading@10 14257
yading@10 14258 =over 4
yading@10 14259
yading@10 14260
yading@10 14261 =item B<dar>
yading@10 14262
yading@10 14263 input display aspect ratio, it is the same as (I<w> / I<h>) * I<sar>
yading@10 14264
yading@10 14265
yading@10 14266 =item B<hsub, vsub>
yading@10 14267
yading@10 14268 horizontal and vertical chroma subsample values. For example for the
yading@10 14269 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 14270
yading@10 14271
yading@10 14272 =item B<line_h, lh>
yading@10 14273
yading@10 14274 the height of each text line
yading@10 14275
yading@10 14276
yading@10 14277 =item B<main_h, h, H>
yading@10 14278
yading@10 14279 the input height
yading@10 14280
yading@10 14281
yading@10 14282 =item B<main_w, w, W>
yading@10 14283
yading@10 14284 the input width
yading@10 14285
yading@10 14286
yading@10 14287 =item B<max_glyph_a, ascent>
yading@10 14288
yading@10 14289 the maximum distance from the baseline to the highest/upper grid
yading@10 14290 coordinate used to place a glyph outline point, for all the rendered
yading@10 14291 glyphs.
yading@10 14292 It is a positive value, due to the grid's orientation with the Y axis
yading@10 14293 upwards.
yading@10 14294
yading@10 14295
yading@10 14296 =item B<max_glyph_d, descent>
yading@10 14297
yading@10 14298 the maximum distance from the baseline to the lowest grid coordinate
yading@10 14299 used to place a glyph outline point, for all the rendered glyphs.
yading@10 14300 This is a negative value, due to the grid's orientation, with the Y axis
yading@10 14301 upwards.
yading@10 14302
yading@10 14303
yading@10 14304 =item B<max_glyph_h>
yading@10 14305
yading@10 14306 maximum glyph height, that is the maximum height for all the glyphs
yading@10 14307 contained in the rendered text, it is equivalent to I<ascent> -
yading@10 14308 I<descent>.
yading@10 14309
yading@10 14310
yading@10 14311 =item B<max_glyph_w>
yading@10 14312
yading@10 14313 maximum glyph width, that is the maximum width for all the glyphs
yading@10 14314 contained in the rendered text
yading@10 14315
yading@10 14316
yading@10 14317 =item B<n>
yading@10 14318
yading@10 14319 the number of input frame, starting from 0
yading@10 14320
yading@10 14321
yading@10 14322 =item B<rand(min, max)>
yading@10 14323
yading@10 14324 return a random number included between I<min> and I<max>
yading@10 14325
yading@10 14326
yading@10 14327 =item B<sar>
yading@10 14328
yading@10 14329 input sample aspect ratio
yading@10 14330
yading@10 14331
yading@10 14332 =item B<t>
yading@10 14333
yading@10 14334 timestamp expressed in seconds, NAN if the input timestamp is unknown
yading@10 14335
yading@10 14336
yading@10 14337 =item B<text_h, th>
yading@10 14338
yading@10 14339 the height of the rendered text
yading@10 14340
yading@10 14341
yading@10 14342 =item B<text_w, tw>
yading@10 14343
yading@10 14344 the width of the rendered text
yading@10 14345
yading@10 14346
yading@10 14347 =item B<x, y>
yading@10 14348
yading@10 14349 the x and y offset coordinates where the text is drawn.
yading@10 14350
yading@10 14351 These parameters allow the I<x> and I<y> expressions to refer
yading@10 14352 each other, so you can for example specify C<y=x/dar>.
yading@10 14353
yading@10 14354 =back
yading@10 14355
yading@10 14356
yading@10 14357 If libavfilter was built with C<--enable-fontconfig>, then
yading@10 14358 B<fontfile> can be a fontconfig pattern or omitted.
yading@10 14359
yading@10 14360
yading@10 14361
yading@10 14362 =head3 Text expansion
yading@10 14363
yading@10 14364
yading@10 14365 If B<expansion> is set to C<strftime>,
yading@10 14366 the filter recognizes strftime() sequences in the provided text and
yading@10 14367 expands them accordingly. Check the documentation of strftime(). This
yading@10 14368 feature is deprecated.
yading@10 14369
yading@10 14370 If B<expansion> is set to C<none>, the text is printed verbatim.
yading@10 14371
yading@10 14372 If B<expansion> is set to C<normal> (which is the default),
yading@10 14373 the following expansion mechanism is used.
yading@10 14374
yading@10 14375 The backslash character '\', followed by any character, always expands to
yading@10 14376 the second character.
yading@10 14377
yading@10 14378 Sequence of the form C<%{...}> are expanded. The text between the
yading@10 14379 braces is a function name, possibly followed by arguments separated by ':'.
yading@10 14380 If the arguments contain special characters or delimiters (':' or '}'),
yading@10 14381 they should be escaped.
yading@10 14382
yading@10 14383 Note that they probably must also be escaped as the value for the
yading@10 14384 B<text> option in the filter argument string and as the filter
yading@10 14385 argument in the filtergraph description, and possibly also for the shell,
yading@10 14386 that makes up to four levels of escaping; using a text file avoids these
yading@10 14387 problems.
yading@10 14388
yading@10 14389 The following functions are available:
yading@10 14390
yading@10 14391
yading@10 14392 =over 4
yading@10 14393
yading@10 14394
yading@10 14395
yading@10 14396 =item B<expr, e>
yading@10 14397
yading@10 14398 The expression evaluation result.
yading@10 14399
yading@10 14400 It must take one argument specifying the expression to be evaluated,
yading@10 14401 which accepts the same constants and functions as the I<x> and
yading@10 14402 I<y> values. Note that not all constants should be used, for
yading@10 14403 example the text size is not known when evaluating the expression, so
yading@10 14404 the constants I<text_w> and I<text_h> will have an undefined
yading@10 14405 value.
yading@10 14406
yading@10 14407
yading@10 14408 =item B<gmtime>
yading@10 14409
yading@10 14410 The time at which the filter is running, expressed in UTC.
yading@10 14411 It can accept an argument: a strftime() format string.
yading@10 14412
yading@10 14413
yading@10 14414 =item B<localtime>
yading@10 14415
yading@10 14416 The time at which the filter is running, expressed in the local time zone.
yading@10 14417 It can accept an argument: a strftime() format string.
yading@10 14418
yading@10 14419
yading@10 14420 =item B<n, frame_num>
yading@10 14421
yading@10 14422 The frame number, starting from 0.
yading@10 14423
yading@10 14424
yading@10 14425 =item B<pts>
yading@10 14426
yading@10 14427 The timestamp of the current frame, in seconds, with microsecond accuracy.
yading@10 14428
yading@10 14429
yading@10 14430 =back
yading@10 14431
yading@10 14432
yading@10 14433
yading@10 14434 =head3 Examples
yading@10 14435
yading@10 14436
yading@10 14437
yading@10 14438 =over 4
yading@10 14439
yading@10 14440
yading@10 14441 =item *
yading@10 14442
yading@10 14443 Draw "Test Text" with font FreeSerif, using the default values for the
yading@10 14444 optional parameters.
yading@10 14445
yading@10 14446
yading@10 14447 drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
yading@10 14448
yading@10 14449
yading@10 14450
yading@10 14451 =item *
yading@10 14452
yading@10 14453 Draw 'Test Text' with font FreeSerif of size 24 at position x=100
yading@10 14454 and y=50 (counting from the top-left corner of the screen), text is
yading@10 14455 yellow with a red box around it. Both the text and the box have an
yading@10 14456 opacity of 20%.
yading@10 14457
yading@10 14458
yading@10 14459 drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
yading@10 14460 x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2"
yading@10 14461
yading@10 14462
yading@10 14463 Note that the double quotes are not necessary if spaces are not used
yading@10 14464 within the parameter list.
yading@10 14465
yading@10 14466
yading@10 14467 =item *
yading@10 14468
yading@10 14469 Show the text at the center of the video frame:
yading@10 14470
yading@10 14471 drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h-line_h)/2"
yading@10 14472
yading@10 14473
yading@10 14474
yading@10 14475 =item *
yading@10 14476
yading@10 14477 Show a text line sliding from right to left in the last row of the video
yading@10 14478 frame. The file F<LONG_LINE> is assumed to contain a single line
yading@10 14479 with no newlines.
yading@10 14480
yading@10 14481 drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t"
yading@10 14482
yading@10 14483
yading@10 14484
yading@10 14485 =item *
yading@10 14486
yading@10 14487 Show the content of file F<CREDITS> off the bottom of the frame and scroll up.
yading@10 14488
yading@10 14489 drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t"
yading@10 14490
yading@10 14491
yading@10 14492
yading@10 14493 =item *
yading@10 14494
yading@10 14495 Draw a single green letter "g", at the center of the input video.
yading@10 14496 The glyph baseline is placed at half screen height.
yading@10 14497
yading@10 14498 drawtext="fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent"
yading@10 14499
yading@10 14500
yading@10 14501
yading@10 14502 =item *
yading@10 14503
yading@10 14504 Show text for 1 second every 3 seconds:
yading@10 14505
yading@10 14506 drawtext="fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:draw=lt(mod(t\,3)\,1):text='blink'"
yading@10 14507
yading@10 14508
yading@10 14509
yading@10 14510 =item *
yading@10 14511
yading@10 14512 Use fontconfig to set the font. Note that the colons need to be escaped.
yading@10 14513
yading@10 14514 drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
yading@10 14515
yading@10 14516
yading@10 14517
yading@10 14518 =item *
yading@10 14519
yading@10 14520 Print the date of a real-time encoding (see strftime(3)):
yading@10 14521
yading@10 14522 drawtext='fontfile=FreeSans.ttf:text=%{localtime:%a %b %d %Y}'
yading@10 14523
yading@10 14524
yading@10 14525
yading@10 14526 =back
yading@10 14527
yading@10 14528
yading@10 14529 For more information about libfreetype, check:
yading@10 14530 E<lt>B<http://www.freetype.org/>E<gt>.
yading@10 14531
yading@10 14532 For more information about fontconfig, check:
yading@10 14533 E<lt>B<http://freedesktop.org/software/fontconfig/fontconfig-user.html>E<gt>.
yading@10 14534
yading@10 14535
yading@10 14536 =head2 edgedetect
yading@10 14537
yading@10 14538
yading@10 14539 Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
yading@10 14540
yading@10 14541 The filter accepts the following options:
yading@10 14542
yading@10 14543
yading@10 14544 =over 4
yading@10 14545
yading@10 14546
yading@10 14547 =item B<low, high>
yading@10 14548
yading@10 14549 Set low and high threshold values used by the Canny thresholding
yading@10 14550 algorithm.
yading@10 14551
yading@10 14552 The high threshold selects the "strong" edge pixels, which are then
yading@10 14553 connected through 8-connectivity with the "weak" edge pixels selected
yading@10 14554 by the low threshold.
yading@10 14555
yading@10 14556 I<low> and I<high> threshold values must be choosen in the range
yading@10 14557 [0,1], and I<low> should be lesser or equal to I<high>.
yading@10 14558
yading@10 14559 Default value for I<low> is C<20/255>, and default value for I<high>
yading@10 14560 is C<50/255>.
yading@10 14561
yading@10 14562 =back
yading@10 14563
yading@10 14564
yading@10 14565 Example:
yading@10 14566
yading@10 14567 edgedetect=low=0.1:high=0.4
yading@10 14568
yading@10 14569
yading@10 14570
yading@10 14571 =head2 fade
yading@10 14572
yading@10 14573
yading@10 14574 Apply fade-in/out effect to input video.
yading@10 14575
yading@10 14576 This filter accepts the following options:
yading@10 14577
yading@10 14578
yading@10 14579 =over 4
yading@10 14580
yading@10 14581
yading@10 14582 =item B<type, t>
yading@10 14583
yading@10 14584 The effect type -- can be either "in" for fade-in, or "out" for a fade-out
yading@10 14585 effect.
yading@10 14586 Default is C<in>.
yading@10 14587
yading@10 14588
yading@10 14589 =item B<start_frame, s>
yading@10 14590
yading@10 14591 Specify the number of the start frame for starting to apply the fade
yading@10 14592 effect. Default is 0.
yading@10 14593
yading@10 14594
yading@10 14595 =item B<nb_frames, n>
yading@10 14596
yading@10 14597 The number of frames for which the fade effect has to last. At the end of the
yading@10 14598 fade-in effect the output video will have the same intensity as the input video,
yading@10 14599 at the end of the fade-out transition the output video will be completely black.
yading@10 14600 Default is 25.
yading@10 14601
yading@10 14602
yading@10 14603 =item B<alpha>
yading@10 14604
yading@10 14605 If set to 1, fade only alpha channel, if one exists on the input.
yading@10 14606 Default value is 0.
yading@10 14607
yading@10 14608 =back
yading@10 14609
yading@10 14610
yading@10 14611
yading@10 14612 =head3 Examples
yading@10 14613
yading@10 14614
yading@10 14615
yading@10 14616 =over 4
yading@10 14617
yading@10 14618
yading@10 14619 =item *
yading@10 14620
yading@10 14621 Fade in first 30 frames of video:
yading@10 14622
yading@10 14623 fade=in:0:30
yading@10 14624
yading@10 14625
yading@10 14626 The command above is equivalent to:
yading@10 14627
yading@10 14628 fade=t=in:s=0:n=30
yading@10 14629
yading@10 14630
yading@10 14631
yading@10 14632 =item *
yading@10 14633
yading@10 14634 Fade out last 45 frames of a 200-frame video:
yading@10 14635
yading@10 14636 fade=out:155:45
yading@10 14637 fade=type=out:start_frame=155:nb_frames=45
yading@10 14638
yading@10 14639
yading@10 14640
yading@10 14641 =item *
yading@10 14642
yading@10 14643 Fade in first 25 frames and fade out last 25 frames of a 1000-frame video:
yading@10 14644
yading@10 14645 fade=in:0:25, fade=out:975:25
yading@10 14646
yading@10 14647
yading@10 14648
yading@10 14649 =item *
yading@10 14650
yading@10 14651 Make first 5 frames black, then fade in from frame 5-24:
yading@10 14652
yading@10 14653 fade=in:5:20
yading@10 14654
yading@10 14655
yading@10 14656
yading@10 14657 =item *
yading@10 14658
yading@10 14659 Fade in alpha over first 25 frames of video:
yading@10 14660
yading@10 14661 fade=in:0:25:alpha=1
yading@10 14662
yading@10 14663
yading@10 14664 =back
yading@10 14665
yading@10 14666
yading@10 14667
yading@10 14668 =head2 field
yading@10 14669
yading@10 14670
yading@10 14671 Extract a single field from an interlaced image using stride
yading@10 14672 arithmetic to avoid wasting CPU time. The output frames are marked as
yading@10 14673 non-interlaced.
yading@10 14674
yading@10 14675 The filter accepts the following options:
yading@10 14676
yading@10 14677
yading@10 14678 =over 4
yading@10 14679
yading@10 14680
yading@10 14681 =item B<type>
yading@10 14682
yading@10 14683 Specify whether to extract the top (if the value is C<0> or
yading@10 14684 C<top>) or the bottom field (if the value is C<1> or
yading@10 14685 C<bottom>).
yading@10 14686
yading@10 14687 =back
yading@10 14688
yading@10 14689
yading@10 14690
yading@10 14691 =head2 fieldmatch
yading@10 14692
yading@10 14693
yading@10 14694 Field matching filter for inverse telecine. It is meant to reconstruct the
yading@10 14695 progressive frames from a telecined stream. The filter does not drop duplicated
yading@10 14696 frames, so to achieve a complete inverse telecine C<fieldmatch> needs to be
yading@10 14697 followed by a decimation filter such as decimate in the filtergraph.
yading@10 14698
yading@10 14699 The separation of the field matching and the decimation is notably motivated by
yading@10 14700 the possibility of inserting a de-interlacing filter fallback between the two.
yading@10 14701 If the source has mixed telecined and real interlaced content,
yading@10 14702 C<fieldmatch> will not be able to match fields for the interlaced parts.
yading@10 14703 But these remaining combed frames will be marked as interlaced, and thus can be
yading@10 14704 de-interlaced by a later filter such as yadif before decimation.
yading@10 14705
yading@10 14706 In addition to the various configuration options, C<fieldmatch> can take an
yading@10 14707 optional second stream, activated through the B<ppsrc> option. If
yading@10 14708 enabled, the frames reconstruction will be based on the fields and frames from
yading@10 14709 this second stream. This allows the first input to be pre-processed in order to
yading@10 14710 help the various algorithms of the filter, while keeping the output lossless
yading@10 14711 (assuming the fields are matched properly). Typically, a field-aware denoiser,
yading@10 14712 or brightness/contrast adjustments can help.
yading@10 14713
yading@10 14714 Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
yading@10 14715 and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
yading@10 14716 which C<fieldmatch> is based on. While the semantic and usage are very
yading@10 14717 close, some behaviour and options names can differ.
yading@10 14718
yading@10 14719 The filter accepts the following options:
yading@10 14720
yading@10 14721
yading@10 14722 =over 4
yading@10 14723
yading@10 14724
yading@10 14725 =item B<order>
yading@10 14726
yading@10 14727 Specify the assumed field order of the input stream. Available values are:
yading@10 14728
yading@10 14729
yading@10 14730 =over 4
yading@10 14731
yading@10 14732
yading@10 14733 =item B<auto>
yading@10 14734
yading@10 14735 Auto detect parity (use FFmpeg's internal parity value).
yading@10 14736
yading@10 14737 =item B<bff>
yading@10 14738
yading@10 14739 Assume bottom field first.
yading@10 14740
yading@10 14741 =item B<tff>
yading@10 14742
yading@10 14743 Assume top field first.
yading@10 14744
yading@10 14745 =back
yading@10 14746
yading@10 14747
yading@10 14748 Note that it is sometimes recommended not to trust the parity announced by the
yading@10 14749 stream.
yading@10 14750
yading@10 14751 Default value is I<auto>.
yading@10 14752
yading@10 14753
yading@10 14754 =item B<mode>
yading@10 14755
yading@10 14756 Set the matching mode or strategy to use. B<pc> mode is the safest in the
yading@10 14757 sense that it wont risk creating jerkiness due to duplicate frames when
yading@10 14758 possible, but if there are bad edits or blended fields it will end up
yading@10 14759 outputting combed frames when a good match might actually exist. On the other
yading@10 14760 hand, B<pcn_ub> mode is the most risky in terms of creating jerkiness,
yading@10 14761 but will almost always find a good frame if there is one. The other values are
yading@10 14762 all somewhere in between B<pc> and B<pcn_ub> in terms of risking
yading@10 14763 jerkiness and creating duplicate frames versus finding good matches in sections
yading@10 14764 with bad edits, orphaned fields, blended fields, etc.
yading@10 14765
yading@10 14766 More details about p/c/n/u/b are available in p/c/n/u/b meaning section.
yading@10 14767
yading@10 14768 Available values are:
yading@10 14769
yading@10 14770
yading@10 14771 =over 4
yading@10 14772
yading@10 14773
yading@10 14774 =item B<pc>
yading@10 14775
yading@10 14776 2-way matching (p/c)
yading@10 14777
yading@10 14778 =item B<pc_n>
yading@10 14779
yading@10 14780 2-way matching, and trying 3rd match if still combed (p/c + n)
yading@10 14781
yading@10 14782 =item B<pc_u>
yading@10 14783
yading@10 14784 2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
yading@10 14785
yading@10 14786 =item B<pc_n_ub>
yading@10 14787
yading@10 14788 2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
yading@10 14789 still combed (p/c + n + u/b)
yading@10 14790
yading@10 14791 =item B<pcn>
yading@10 14792
yading@10 14793 3-way matching (p/c/n)
yading@10 14794
yading@10 14795 =item B<pcn_ub>
yading@10 14796
yading@10 14797 3-way matching, and trying 4th/5th matches if all 3 of the original matches are
yading@10 14798 detected as combed (p/c/n + u/b)
yading@10 14799
yading@10 14800 =back
yading@10 14801
yading@10 14802
yading@10 14803 The parenthesis at the end indicate the matches that would be used for that
yading@10 14804 mode assuming B<order>=I<tff> (and B<field> on I<auto> or
yading@10 14805 I<top>).
yading@10 14806
yading@10 14807 In terms of speed B<pc> mode is by far the fastest and B<pcn_ub> is
yading@10 14808 the slowest.
yading@10 14809
yading@10 14810 Default value is I<pc_n>.
yading@10 14811
yading@10 14812
yading@10 14813 =item B<ppsrc>
yading@10 14814
yading@10 14815 Mark the main input stream as a pre-processed input, and enable the secondary
yading@10 14816 input stream as the clean source to pick the fields from. See the filter
yading@10 14817 introduction for more details. It is similar to the B<clip2> feature from
yading@10 14818 VFM/TFM.
yading@10 14819
yading@10 14820 Default value is C<0> (disabled).
yading@10 14821
yading@10 14822
yading@10 14823 =item B<field>
yading@10 14824
yading@10 14825 Set the field to match from. It is recommended to set this to the same value as
yading@10 14826 B<order> unless you experience matching failures with that setting. In
yading@10 14827 certain circumstances changing the field that is used to match from can have a
yading@10 14828 large impact on matching performance. Available values are:
yading@10 14829
yading@10 14830
yading@10 14831 =over 4
yading@10 14832
yading@10 14833
yading@10 14834 =item B<auto>
yading@10 14835
yading@10 14836 Automatic (same value as B<order>).
yading@10 14837
yading@10 14838 =item B<bottom>
yading@10 14839
yading@10 14840 Match from the bottom field.
yading@10 14841
yading@10 14842 =item B<top>
yading@10 14843
yading@10 14844 Match from the top field.
yading@10 14845
yading@10 14846 =back
yading@10 14847
yading@10 14848
yading@10 14849 Default value is I<auto>.
yading@10 14850
yading@10 14851
yading@10 14852 =item B<mchroma>
yading@10 14853
yading@10 14854 Set whether or not chroma is included during the match comparisons. In most
yading@10 14855 cases it is recommended to leave this enabled. You should set this to C<0>
yading@10 14856 only if your clip has bad chroma problems such as heavy rainbowing or other
yading@10 14857 artifacts. Setting this to C<0> could also be used to speed things up at
yading@10 14858 the cost of some accuracy.
yading@10 14859
yading@10 14860 Default value is C<1>.
yading@10 14861
yading@10 14862
yading@10 14863 =item B<y0>
yading@10 14864
yading@10 14865
yading@10 14866 =item B<y1>
yading@10 14867
yading@10 14868 These define an exclusion band which excludes the lines between B<y0> and
yading@10 14869 B<y1> from being included in the field matching decision. An exclusion
yading@10 14870 band can be used to ignore subtitles, a logo, or other things that may
yading@10 14871 interfere with the matching. B<y0> sets the starting scan line and
yading@10 14872 B<y1> sets the ending line; all lines in between B<y0> and
yading@10 14873 B<y1> (including B<y0> and B<y1>) will be ignored. Setting
yading@10 14874 B<y0> and B<y1> to the same value will disable the feature.
yading@10 14875 B<y0> and B<y1> defaults to C<0>.
yading@10 14876
yading@10 14877
yading@10 14878 =item B<scthresh>
yading@10 14879
yading@10 14880 Set the scene change detection threshold as a percentage of maximum change on
yading@10 14881 the luma plane. Good values are in the C<[8.0, 14.0]> range. Scene change
yading@10 14882 detection is only relevant in case B<combmatch>=I<sc>. The range for
yading@10 14883 B<scthresh> is C<[0.0, 100.0]>.
yading@10 14884
yading@10 14885 Default value is C<12.0>.
yading@10 14886
yading@10 14887
yading@10 14888 =item B<combmatch>
yading@10 14889
yading@10 14890 When B<combatch> is not I<none>, C<fieldmatch> will take into
yading@10 14891 account the combed scores of matches when deciding what match to use as the
yading@10 14892 final match. Available values are:
yading@10 14893
yading@10 14894
yading@10 14895 =over 4
yading@10 14896
yading@10 14897
yading@10 14898 =item B<none>
yading@10 14899
yading@10 14900 No final matching based on combed scores.
yading@10 14901
yading@10 14902 =item B<sc>
yading@10 14903
yading@10 14904 Combed scores are only used when a scene change is detected.
yading@10 14905
yading@10 14906 =item B<full>
yading@10 14907
yading@10 14908 Use combed scores all the time.
yading@10 14909
yading@10 14910 =back
yading@10 14911
yading@10 14912
yading@10 14913 Default is I<sc>.
yading@10 14914
yading@10 14915
yading@10 14916 =item B<combdbg>
yading@10 14917
yading@10 14918 Force C<fieldmatch> to calculate the combed metrics for certain matches and
yading@10 14919 print them. This setting is known as B<micout> in TFM/VFM vocabulary.
yading@10 14920 Available values are:
yading@10 14921
yading@10 14922
yading@10 14923 =over 4
yading@10 14924
yading@10 14925
yading@10 14926 =item B<none>
yading@10 14927
yading@10 14928 No forced calculation.
yading@10 14929
yading@10 14930 =item B<pcn>
yading@10 14931
yading@10 14932 Force p/c/n calculations.
yading@10 14933
yading@10 14934 =item B<pcnub>
yading@10 14935
yading@10 14936 Force p/c/n/u/b calculations.
yading@10 14937
yading@10 14938 =back
yading@10 14939
yading@10 14940
yading@10 14941 Default value is I<none>.
yading@10 14942
yading@10 14943
yading@10 14944 =item B<cthresh>
yading@10 14945
yading@10 14946 This is the area combing threshold used for combed frame detection. This
yading@10 14947 essentially controls how "strong" or "visible" combing must be to be detected.
yading@10 14948 Larger values mean combing must be more visible and smaller values mean combing
yading@10 14949 can be less visible or strong and still be detected. Valid settings are from
yading@10 14950 C<-1> (every pixel will be detected as combed) to C<255> (no pixel will
yading@10 14951 be detected as combed). This is basically a pixel difference value. A good
yading@10 14952 range is C<[8, 12]>.
yading@10 14953
yading@10 14954 Default value is C<9>.
yading@10 14955
yading@10 14956
yading@10 14957 =item B<chroma>
yading@10 14958
yading@10 14959 Sets whether or not chroma is considered in the combed frame decision. Only
yading@10 14960 disable this if your source has chroma problems (rainbowing, etc.) that are
yading@10 14961 causing problems for the combed frame detection with chroma enabled. Actually,
yading@10 14962 using B<chroma>=I<0> is usually more reliable, except for the case
yading@10 14963 where there is chroma only combing in the source.
yading@10 14964
yading@10 14965 Default value is C<0>.
yading@10 14966
yading@10 14967
yading@10 14968 =item B<blockx>
yading@10 14969
yading@10 14970
yading@10 14971 =item B<blocky>
yading@10 14972
yading@10 14973 Respectively set the x-axis and y-axis size of the window used during combed
yading@10 14974 frame detection. This has to do with the size of the area in which
yading@10 14975 B<combpel> pixels are required to be detected as combed for a frame to be
yading@10 14976 declared combed. See the B<combpel> parameter description for more info.
yading@10 14977 Possible values are any number that is a power of 2 starting at 4 and going up
yading@10 14978 to 512.
yading@10 14979
yading@10 14980 Default value is C<16>.
yading@10 14981
yading@10 14982
yading@10 14983 =item B<combpel>
yading@10 14984
yading@10 14985 The number of combed pixels inside any of the B<blocky> by
yading@10 14986 B<blockx> size blocks on the frame for the frame to be detected as
yading@10 14987 combed. While B<cthresh> controls how "visible" the combing must be, this
yading@10 14988 setting controls "how much" combing there must be in any localized area (a
yading@10 14989 window defined by the B<blockx> and B<blocky> settings) on the
yading@10 14990 frame. Minimum value is C<0> and maximum is C<blocky x blockx> (at
yading@10 14991 which point no frames will ever be detected as combed). This setting is known
yading@10 14992 as B<MI> in TFM/VFM vocabulary.
yading@10 14993
yading@10 14994 Default value is C<80>.
yading@10 14995
yading@10 14996 =back
yading@10 14997
yading@10 14998
yading@10 14999
yading@10 15000
yading@10 15001 =head3 p/c/n/u/b meaning
yading@10 15002
yading@10 15003
yading@10 15004
yading@10 15005 =head4 p/c/n
yading@10 15006
yading@10 15007
yading@10 15008 We assume the following telecined stream:
yading@10 15009
yading@10 15010
yading@10 15011 Top fields: 1 2 2 3 4
yading@10 15012 Bottom fields: 1 2 3 4 4
yading@10 15013
yading@10 15014
yading@10 15015 The numbers correspond to the progressive frame the fields relate to. Here, the
yading@10 15016 first two frames are progressive, the 3rd and 4th are combed, and so on.
yading@10 15017
yading@10 15018 When C<fieldmatch> is configured to run a matching from bottom
yading@10 15019 (B<field>=I<bottom>) this is how this input stream get transformed:
yading@10 15020
yading@10 15021
yading@10 15022 Input stream:
yading@10 15023 T 1 2 2 3 4
yading@10 15024 B 1 2 3 4 4 <-- matching reference
yading@10 15025
yading@10 15026 Matches: c c n n c
yading@10 15027
yading@10 15028 Output stream:
yading@10 15029 T 1 2 3 4 4
yading@10 15030 B 1 2 3 4 4
yading@10 15031
yading@10 15032
yading@10 15033 As a result of the field matching, we can see that some frames get duplicated.
yading@10 15034 To perform a complete inverse telecine, you need to rely on a decimation filter
yading@10 15035 after this operation. See for instance the decimate filter.
yading@10 15036
yading@10 15037 The same operation now matching from top fields (B<field>=I<top>)
yading@10 15038 looks like this:
yading@10 15039
yading@10 15040
yading@10 15041 Input stream:
yading@10 15042 T 1 2 2 3 4 <-- matching reference
yading@10 15043 B 1 2 3 4 4
yading@10 15044
yading@10 15045 Matches: c c p p c
yading@10 15046
yading@10 15047 Output stream:
yading@10 15048 T 1 2 2 3 4
yading@10 15049 B 1 2 2 3 4
yading@10 15050
yading@10 15051
yading@10 15052 In these examples, we can see what I<p>, I<c> and I<n> mean;
yading@10 15053 basically, they refer to the frame and field of the opposite parity:
yading@10 15054
yading@10 15055
yading@10 15056 =over 4
yading@10 15057
yading@10 15058
yading@10 15059 =item *<I<p> matches the field of the opposite parity in the previous frame>
yading@10 15060
yading@10 15061
yading@10 15062 =item *<I<c> matches the field of the opposite parity in the current frame>
yading@10 15063
yading@10 15064
yading@10 15065 =item *<I<n> matches the field of the opposite parity in the next frame>
yading@10 15066
yading@10 15067
yading@10 15068 =back
yading@10 15069
yading@10 15070
yading@10 15071
yading@10 15072 =head4 u/b
yading@10 15073
yading@10 15074
yading@10 15075 The I<u> and I<b> matching are a bit special in the sense that they match
yading@10 15076 from the opposite parity flag. In the following examples, we assume that we are
yading@10 15077 currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
yading@10 15078 'x' is placed above and below each matched fields.
yading@10 15079
yading@10 15080 With bottom matching (B<field>=I<bottom>):
yading@10 15081
yading@10 15082 Match: c p n b u
yading@10 15083
yading@10 15084 x x x x x
yading@10 15085 Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
yading@10 15086 Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
yading@10 15087 x x x x x
yading@10 15088
yading@10 15089 Output frames:
yading@10 15090 2 1 2 2 2
yading@10 15091 2 2 2 1 3
yading@10 15092
yading@10 15093
yading@10 15094 With top matching (B<field>=I<top>):
yading@10 15095
yading@10 15096 Match: c p n b u
yading@10 15097
yading@10 15098 x x x x x
yading@10 15099 Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
yading@10 15100 Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
yading@10 15101 x x x x x
yading@10 15102
yading@10 15103 Output frames:
yading@10 15104 2 2 2 1 2
yading@10 15105 2 1 3 2 2
yading@10 15106
yading@10 15107
yading@10 15108
yading@10 15109 =head3 Examples
yading@10 15110
yading@10 15111
yading@10 15112 Simple IVTC of a top field first telecined stream:
yading@10 15113
yading@10 15114 fieldmatch=order=tff:combmatch=none, decimate
yading@10 15115
yading@10 15116
yading@10 15117 Advanced IVTC, with fallback on yadif for still combed frames:
yading@10 15118
yading@10 15119 fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
yading@10 15120
yading@10 15121
yading@10 15122
yading@10 15123 =head2 fieldorder
yading@10 15124
yading@10 15125
yading@10 15126 Transform the field order of the input video.
yading@10 15127
yading@10 15128 This filter accepts the following options:
yading@10 15129
yading@10 15130
yading@10 15131 =over 4
yading@10 15132
yading@10 15133
yading@10 15134
yading@10 15135 =item B<order>
yading@10 15136
yading@10 15137 Output field order. Valid values are I<tff> for top field first or I<bff>
yading@10 15138 for bottom field first.
yading@10 15139
yading@10 15140 =back
yading@10 15141
yading@10 15142
yading@10 15143 Default value is B<tff>.
yading@10 15144
yading@10 15145 Transformation is achieved by shifting the picture content up or down
yading@10 15146 by one line, and filling the remaining line with appropriate picture content.
yading@10 15147 This method is consistent with most broadcast field order converters.
yading@10 15148
yading@10 15149 If the input video is not flagged as being interlaced, or it is already
yading@10 15150 flagged as being of the required output field order then this filter does
yading@10 15151 not alter the incoming video.
yading@10 15152
yading@10 15153 This filter is very useful when converting to or from PAL DV material,
yading@10 15154 which is bottom field first.
yading@10 15155
yading@10 15156 For example:
yading@10 15157
yading@10 15158 ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
yading@10 15159
yading@10 15160
yading@10 15161
yading@10 15162 =head2 fifo
yading@10 15163
yading@10 15164
yading@10 15165 Buffer input images and send them when they are requested.
yading@10 15166
yading@10 15167 This filter is mainly useful when auto-inserted by the libavfilter
yading@10 15168 framework.
yading@10 15169
yading@10 15170 The filter does not take parameters.
yading@10 15171
yading@10 15172
yading@10 15173
yading@10 15174 =head2 format
yading@10 15175
yading@10 15176
yading@10 15177 Convert the input video to one of the specified pixel formats.
yading@10 15178 Libavfilter will try to pick one that is supported for the input to
yading@10 15179 the next filter.
yading@10 15180
yading@10 15181 This filter accepts the following parameters:
yading@10 15182
yading@10 15183 =over 4
yading@10 15184
yading@10 15185
yading@10 15186
yading@10 15187 =item B<pix_fmts>
yading@10 15188
yading@10 15189 A '|'-separated list of pixel format names, for example
yading@10 15190 "pix_fmts=yuv420p|monow|rgb24".
yading@10 15191
yading@10 15192
yading@10 15193 =back
yading@10 15194
yading@10 15195
yading@10 15196
yading@10 15197 =head3 Examples
yading@10 15198
yading@10 15199
yading@10 15200
yading@10 15201 =over 4
yading@10 15202
yading@10 15203
yading@10 15204 =item *
yading@10 15205
yading@10 15206 Convert the input video to the format I<yuv420p>
yading@10 15207
yading@10 15208 format=pix_fmts=yuv420p
yading@10 15209
yading@10 15210
yading@10 15211 Convert the input video to any of the formats in the list
yading@10 15212
yading@10 15213 format=pix_fmts=yuv420p|yuv444p|yuv410p
yading@10 15214
yading@10 15215
yading@10 15216 =back
yading@10 15217
yading@10 15218
yading@10 15219
yading@10 15220 =head2 fps
yading@10 15221
yading@10 15222
yading@10 15223 Convert the video to specified constant frame rate by duplicating or dropping
yading@10 15224 frames as necessary.
yading@10 15225
yading@10 15226 This filter accepts the following named parameters:
yading@10 15227
yading@10 15228 =over 4
yading@10 15229
yading@10 15230
yading@10 15231
yading@10 15232 =item B<fps>
yading@10 15233
yading@10 15234 Desired output frame rate. The default is C<25>.
yading@10 15235
yading@10 15236
yading@10 15237 =item B<round>
yading@10 15238
yading@10 15239 Rounding method.
yading@10 15240
yading@10 15241 Possible values are:
yading@10 15242
yading@10 15243 =over 4
yading@10 15244
yading@10 15245
yading@10 15246 =item B<zero>
yading@10 15247
yading@10 15248 zero round towards 0
yading@10 15249
yading@10 15250 =item B<inf>
yading@10 15251
yading@10 15252 round away from 0
yading@10 15253
yading@10 15254 =item B<down>
yading@10 15255
yading@10 15256 round towards -infinity
yading@10 15257
yading@10 15258 =item B<up>
yading@10 15259
yading@10 15260 round towards +infinity
yading@10 15261
yading@10 15262 =item B<near>
yading@10 15263
yading@10 15264 round to nearest
yading@10 15265
yading@10 15266 =back
yading@10 15267
yading@10 15268 The default is C<near>.
yading@10 15269
yading@10 15270
yading@10 15271 =back
yading@10 15272
yading@10 15273
yading@10 15274 Alternatively, the options can be specified as a flat string:
yading@10 15275 I<fps>[:I<round>].
yading@10 15276
yading@10 15277 See also the setpts filter.
yading@10 15278
yading@10 15279
yading@10 15280 =head2 framestep
yading@10 15281
yading@10 15282
yading@10 15283 Select one frame every N-th frame.
yading@10 15284
yading@10 15285 This filter accepts the following option:
yading@10 15286
yading@10 15287 =over 4
yading@10 15288
yading@10 15289
yading@10 15290 =item B<step>
yading@10 15291
yading@10 15292 Select frame after every C<step> frames.
yading@10 15293 Allowed values are positive integers higher than 0. Default value is C<1>.
yading@10 15294
yading@10 15295 =back
yading@10 15296
yading@10 15297
yading@10 15298
yading@10 15299
yading@10 15300 =head2 frei0r
yading@10 15301
yading@10 15302
yading@10 15303 Apply a frei0r effect to the input video.
yading@10 15304
yading@10 15305 To enable compilation of this filter you need to install the frei0r
yading@10 15306 header and configure FFmpeg with C<--enable-frei0r>.
yading@10 15307
yading@10 15308 This filter accepts the following options:
yading@10 15309
yading@10 15310
yading@10 15311 =over 4
yading@10 15312
yading@10 15313
yading@10 15314
yading@10 15315 =item B<filter_name>
yading@10 15316
yading@10 15317 The name to the frei0r effect to load. If the environment variable
yading@10 15318 B<FREI0R_PATH> is defined, the frei0r effect is searched in each one of the
yading@10 15319 directories specified by the colon separated list in B<FREIOR_PATH>,
yading@10 15320 otherwise in the standard frei0r paths, which are in this order:
yading@10 15321 F<HOME/.frei0r-1/lib/>, F</usr/local/lib/frei0r-1/>,
yading@10 15322 F</usr/lib/frei0r-1/>.
yading@10 15323
yading@10 15324
yading@10 15325 =item B<filter_params>
yading@10 15326
yading@10 15327 A '|'-separated list of parameters to pass to the frei0r effect.
yading@10 15328
yading@10 15329
yading@10 15330 =back
yading@10 15331
yading@10 15332
yading@10 15333 A frei0r effect parameter can be a boolean (whose values are specified
yading@10 15334 with "y" and "n"), a double, a color (specified by the syntax
yading@10 15335 I<R>/I<G>/I<B>, I<R>, I<G>, and I<B> being float
yading@10 15336 numbers from 0.0 to 1.0) or by an C<av_parse_color()> color
yading@10 15337 description), a position (specified by the syntax I<X>/I<Y>,
yading@10 15338 I<X> and I<Y> being float numbers) and a string.
yading@10 15339
yading@10 15340 The number and kind of parameters depend on the loaded effect. If an
yading@10 15341 effect parameter is not specified the default value is set.
yading@10 15342
yading@10 15343
yading@10 15344 =head3 Examples
yading@10 15345
yading@10 15346
yading@10 15347
yading@10 15348 =over 4
yading@10 15349
yading@10 15350
yading@10 15351 =item *
yading@10 15352
yading@10 15353 Apply the distort0r effect, set the first two double parameters:
yading@10 15354
yading@10 15355 frei0r=filter_name=distort0r:filter_params=0.5|0.01
yading@10 15356
yading@10 15357
yading@10 15358
yading@10 15359 =item *
yading@10 15360
yading@10 15361 Apply the colordistance effect, take a color as first parameter:
yading@10 15362
yading@10 15363 frei0r=colordistance:0.2/0.3/0.4
yading@10 15364 frei0r=colordistance:violet
yading@10 15365 frei0r=colordistance:0x112233
yading@10 15366
yading@10 15367
yading@10 15368
yading@10 15369 =item *
yading@10 15370
yading@10 15371 Apply the perspective effect, specify the top left and top right image
yading@10 15372 positions:
yading@10 15373
yading@10 15374 frei0r=perspective:0.2/0.2|0.8/0.2
yading@10 15375
yading@10 15376
yading@10 15377 =back
yading@10 15378
yading@10 15379
yading@10 15380 For more information see:
yading@10 15381 E<lt>B<http://frei0r.dyne.org>E<gt>
yading@10 15382
yading@10 15383
yading@10 15384 =head2 geq
yading@10 15385
yading@10 15386
yading@10 15387 The filter accepts the following options:
yading@10 15388
yading@10 15389
yading@10 15390 =over 4
yading@10 15391
yading@10 15392
yading@10 15393 =item B<lum_expr>
yading@10 15394
yading@10 15395 the luminance expression
yading@10 15396
yading@10 15397 =item B<cb_expr>
yading@10 15398
yading@10 15399 the chrominance blue expression
yading@10 15400
yading@10 15401 =item B<cr_expr>
yading@10 15402
yading@10 15403 the chrominance red expression
yading@10 15404
yading@10 15405 =item B<alpha_expr>
yading@10 15406
yading@10 15407 the alpha expression
yading@10 15408
yading@10 15409 =back
yading@10 15410
yading@10 15411
yading@10 15412 If one of the chrominance expression is not defined, it falls back on the other
yading@10 15413 one. If no alpha expression is specified it will evaluate to opaque value.
yading@10 15414 If none of chrominance expressions are
yading@10 15415 specified, they will evaluate the luminance expression.
yading@10 15416
yading@10 15417 The expressions can use the following variables and functions:
yading@10 15418
yading@10 15419
yading@10 15420 =over 4
yading@10 15421
yading@10 15422
yading@10 15423 =item B<N>
yading@10 15424
yading@10 15425 The sequential number of the filtered frame, starting from C<0>.
yading@10 15426
yading@10 15427
yading@10 15428 =item B<X>
yading@10 15429
yading@10 15430
yading@10 15431 =item B<Y>
yading@10 15432
yading@10 15433 The coordinates of the current sample.
yading@10 15434
yading@10 15435
yading@10 15436 =item B<W>
yading@10 15437
yading@10 15438
yading@10 15439 =item B<H>
yading@10 15440
yading@10 15441 The width and height of the image.
yading@10 15442
yading@10 15443
yading@10 15444 =item B<SW>
yading@10 15445
yading@10 15446
yading@10 15447 =item B<SH>
yading@10 15448
yading@10 15449 Width and height scale depending on the currently filtered plane. It is the
yading@10 15450 ratio between the corresponding luma plane number of pixels and the current
yading@10 15451 plane ones. E.g. for YUV4:2:0 the values are C<1,1> for the luma plane, and
yading@10 15452 C<0.5,0.5> for chroma planes.
yading@10 15453
yading@10 15454
yading@10 15455 =item B<T>
yading@10 15456
yading@10 15457 Time of the current frame, expressed in seconds.
yading@10 15458
yading@10 15459
yading@10 15460 =item B<p(x, y)>
yading@10 15461
yading@10 15462 Return the value of the pixel at location (I<x>,I<y>) of the current
yading@10 15463 plane.
yading@10 15464
yading@10 15465
yading@10 15466 =item B<lum(x, y)>
yading@10 15467
yading@10 15468 Return the value of the pixel at location (I<x>,I<y>) of the luminance
yading@10 15469 plane.
yading@10 15470
yading@10 15471
yading@10 15472 =item B<cb(x, y)>
yading@10 15473
yading@10 15474 Return the value of the pixel at location (I<x>,I<y>) of the
yading@10 15475 blue-difference chroma plane. Returns 0 if there is no such plane.
yading@10 15476
yading@10 15477
yading@10 15478 =item B<cr(x, y)>
yading@10 15479
yading@10 15480 Return the value of the pixel at location (I<x>,I<y>) of the
yading@10 15481 red-difference chroma plane. Returns 0 if there is no such plane.
yading@10 15482
yading@10 15483
yading@10 15484 =item B<alpha(x, y)>
yading@10 15485
yading@10 15486 Return the value of the pixel at location (I<x>,I<y>) of the alpha
yading@10 15487 plane. Returns 0 if there is no such plane.
yading@10 15488
yading@10 15489 =back
yading@10 15490
yading@10 15491
yading@10 15492 For functions, if I<x> and I<y> are outside the area, the value will be
yading@10 15493 automatically clipped to the closer edge.
yading@10 15494
yading@10 15495
yading@10 15496 =head3 Examples
yading@10 15497
yading@10 15498
yading@10 15499
yading@10 15500 =over 4
yading@10 15501
yading@10 15502
yading@10 15503 =item *
yading@10 15504
yading@10 15505 Flip the image horizontally:
yading@10 15506
yading@10 15507 geq=p(W-X\,Y)
yading@10 15508
yading@10 15509
yading@10 15510
yading@10 15511 =item *
yading@10 15512
yading@10 15513 Generate a bidimensional sine wave, with angle C<PI/3> and a
yading@10 15514 wavelength of 100 pixels:
yading@10 15515
yading@10 15516 geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
yading@10 15517
yading@10 15518
yading@10 15519
yading@10 15520 =item *
yading@10 15521
yading@10 15522 Generate a fancy enigmatic moving light:
yading@10 15523
yading@10 15524 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 15525
yading@10 15526
yading@10 15527
yading@10 15528 =item *
yading@10 15529
yading@10 15530 Generate a quick emboss effect:
yading@10 15531
yading@10 15532 format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
yading@10 15533
yading@10 15534
yading@10 15535 =back
yading@10 15536
yading@10 15537
yading@10 15538
yading@10 15539 =head2 gradfun
yading@10 15540
yading@10 15541
yading@10 15542 Fix the banding artifacts that are sometimes introduced into nearly flat
yading@10 15543 regions by truncation to 8bit color depth.
yading@10 15544 Interpolate the gradients that should go where the bands are, and
yading@10 15545 dither them.
yading@10 15546
yading@10 15547 This filter is designed for playback only. Do not use it prior to
yading@10 15548 lossy compression, because compression tends to lose the dither and
yading@10 15549 bring back the bands.
yading@10 15550
yading@10 15551 This filter accepts the following options:
yading@10 15552
yading@10 15553
yading@10 15554 =over 4
yading@10 15555
yading@10 15556
yading@10 15557
yading@10 15558 =item B<strength>
yading@10 15559
yading@10 15560 The maximum amount by which the filter will change any one pixel. Also the
yading@10 15561 threshold for detecting nearly flat regions. Acceptable values range from .51 to
yading@10 15562 64, default value is 1.2, out-of-range values will be clipped to the valid
yading@10 15563 range.
yading@10 15564
yading@10 15565
yading@10 15566 =item B<radius>
yading@10 15567
yading@10 15568 The neighborhood to fit the gradient to. A larger radius makes for smoother
yading@10 15569 gradients, but also prevents the filter from modifying the pixels near detailed
yading@10 15570 regions. Acceptable values are 8-32, default value is 16, out-of-range values
yading@10 15571 will be clipped to the valid range.
yading@10 15572
yading@10 15573
yading@10 15574 =back
yading@10 15575
yading@10 15576
yading@10 15577 Alternatively, the options can be specified as a flat string:
yading@10 15578 I<strength>[:I<radius>]
yading@10 15579
yading@10 15580
yading@10 15581 =head3 Examples
yading@10 15582
yading@10 15583
yading@10 15584
yading@10 15585 =over 4
yading@10 15586
yading@10 15587
yading@10 15588 =item *
yading@10 15589
yading@10 15590 Apply the filter with a C<3.5> strength and radius of C<8>:
yading@10 15591
yading@10 15592 gradfun=3.5:8
yading@10 15593
yading@10 15594
yading@10 15595
yading@10 15596 =item *
yading@10 15597
yading@10 15598 Specify radius, omitting the strength (which will fall-back to the default
yading@10 15599 value):
yading@10 15600
yading@10 15601 gradfun=radius=8
yading@10 15602
yading@10 15603
yading@10 15604
yading@10 15605 =back
yading@10 15606
yading@10 15607
yading@10 15608
yading@10 15609 =head2 hflip
yading@10 15610
yading@10 15611
yading@10 15612 Flip the input video horizontally.
yading@10 15613
yading@10 15614 For example to horizontally flip the input video with B<ffmpeg>:
yading@10 15615
yading@10 15616 ffmpeg -i in.avi -vf "hflip" out.avi
yading@10 15617
yading@10 15618
yading@10 15619
yading@10 15620 =head2 histeq
yading@10 15621
yading@10 15622 This filter applies a global color histogram equalization on a
yading@10 15623 per-frame basis.
yading@10 15624
yading@10 15625 It can be used to correct video that has a compressed range of pixel
yading@10 15626 intensities. The filter redistributes the pixel intensities to
yading@10 15627 equalize their distribution across the intensity range. It may be
yading@10 15628 viewed as an "automatically adjusting contrast filter". This filter is
yading@10 15629 useful only for correcting degraded or poorly captured source
yading@10 15630 video.
yading@10 15631
yading@10 15632 The filter accepts the following options:
yading@10 15633
yading@10 15634
yading@10 15635 =over 4
yading@10 15636
yading@10 15637
yading@10 15638 =item B<strength>
yading@10 15639
yading@10 15640 Determine the amount of equalization to be applied. As the strength
yading@10 15641 is reduced, the distribution of pixel intensities more-and-more
yading@10 15642 approaches that of the input frame. The value must be a float number
yading@10 15643 in the range [0,1] and defaults to 0.200.
yading@10 15644
yading@10 15645
yading@10 15646 =item B<intensity>
yading@10 15647
yading@10 15648 Set the maximum intensity that can generated and scale the output
yading@10 15649 values appropriately. The strength should be set as desired and then
yading@10 15650 the intensity can be limited if needed to avoid washing-out. The value
yading@10 15651 must be a float number in the range [0,1] and defaults to 0.210.
yading@10 15652
yading@10 15653
yading@10 15654 =item B<antibanding>
yading@10 15655
yading@10 15656 Set the antibanding level. If enabled the filter will randomly vary
yading@10 15657 the luminance of output pixels by a small amount to avoid banding of
yading@10 15658 the histogram. Possible values are C<none>, C<weak> or
yading@10 15659 C<strong>. It defaults to C<none>.
yading@10 15660
yading@10 15661 =back
yading@10 15662
yading@10 15663
yading@10 15664
yading@10 15665 =head2 histogram
yading@10 15666
yading@10 15667
yading@10 15668 Compute and draw a color distribution histogram for the input video.
yading@10 15669
yading@10 15670 The computed histogram is a representation of distribution of color components
yading@10 15671 in an image.
yading@10 15672
yading@10 15673 The filter accepts the following options:
yading@10 15674
yading@10 15675
yading@10 15676 =over 4
yading@10 15677
yading@10 15678
yading@10 15679 =item B<mode>
yading@10 15680
yading@10 15681 Set histogram mode.
yading@10 15682
yading@10 15683 It accepts the following values:
yading@10 15684
yading@10 15685 =over 4
yading@10 15686
yading@10 15687
yading@10 15688 =item B<levels>
yading@10 15689
yading@10 15690 standard histogram that display color components distribution in an image.
yading@10 15691 Displays color graph for each color component. Shows distribution
yading@10 15692 of the Y, U, V, A or G, B, R components, depending on input format,
yading@10 15693 in current frame. Bellow each graph is color component scale meter.
yading@10 15694
yading@10 15695
yading@10 15696 =item B<color>
yading@10 15697
yading@10 15698 chroma values in vectorscope, if brighter more such chroma values are
yading@10 15699 distributed in an image.
yading@10 15700 Displays chroma values (U/V color placement) in two dimensional graph
yading@10 15701 (which is called a vectorscope). It can be used to read of the hue and
yading@10 15702 saturation of the current frame. At a same time it is a histogram.
yading@10 15703 The whiter a pixel in the vectorscope, the more pixels of the input frame
yading@10 15704 correspond to that pixel (that is the more pixels have this chroma value).
yading@10 15705 The V component is displayed on the horizontal (X) axis, with the leftmost
yading@10 15706 side being V = 0 and the rightmost side being V = 255.
yading@10 15707 The U component is displayed on the vertical (Y) axis, with the top
yading@10 15708 representing U = 0 and the bottom representing U = 255.
yading@10 15709
yading@10 15710 The position of a white pixel in the graph corresponds to the chroma value
yading@10 15711 of a pixel of the input clip. So the graph can be used to read of the
yading@10 15712 hue (color flavor) and the saturation (the dominance of the hue in the color).
yading@10 15713 As the hue of a color changes, it moves around the square. At the center of
yading@10 15714 the square, the saturation is zero, which means that the corresponding pixel
yading@10 15715 has no color. If you increase the amount of a specific color, while leaving
yading@10 15716 the other colors unchanged, the saturation increases, and you move towards
yading@10 15717 the edge of the square.
yading@10 15718
yading@10 15719
yading@10 15720 =item B<color2>
yading@10 15721
yading@10 15722 chroma values in vectorscope, similar as C<color> but actual chroma values
yading@10 15723 are displayed.
yading@10 15724
yading@10 15725
yading@10 15726 =item B<waveform>
yading@10 15727
yading@10 15728 per row/column color component graph. In row mode graph in the left side represents
yading@10 15729 color component value 0 and right side represents value = 255. In column mode top
yading@10 15730 side represents color component value = 0 and bottom side represents value = 255.
yading@10 15731
yading@10 15732 =back
yading@10 15733
yading@10 15734 Default value is C<levels>.
yading@10 15735
yading@10 15736
yading@10 15737 =item B<level_height>
yading@10 15738
yading@10 15739 Set height of level in C<levels>. Default value is C<200>.
yading@10 15740 Allowed range is [50, 2048].
yading@10 15741
yading@10 15742
yading@10 15743 =item B<scale_height>
yading@10 15744
yading@10 15745 Set height of color scale in C<levels>. Default value is C<12>.
yading@10 15746 Allowed range is [0, 40].
yading@10 15747
yading@10 15748
yading@10 15749 =item B<step>
yading@10 15750
yading@10 15751 Set step for C<waveform> mode. Smaller values are useful to find out how much
yading@10 15752 of same luminance values across input rows/columns are distributed.
yading@10 15753 Default value is C<10>. Allowed range is [1, 255].
yading@10 15754
yading@10 15755
yading@10 15756 =item B<waveform_mode>
yading@10 15757
yading@10 15758 Set mode for C<waveform>. Can be either C<row>, or C<column>.
yading@10 15759 Default is C<row>.
yading@10 15760
yading@10 15761
yading@10 15762 =item B<display_mode>
yading@10 15763
yading@10 15764 Set display mode for C<waveform> and C<levels>.
yading@10 15765 It accepts the following values:
yading@10 15766
yading@10 15767 =over 4
yading@10 15768
yading@10 15769
yading@10 15770 =item B<parade>
yading@10 15771
yading@10 15772 Display separate graph for the color components side by side in
yading@10 15773 C<row> waveform mode or one below other in C<column> waveform mode
yading@10 15774 for C<waveform> histogram mode. For C<levels> histogram mode
yading@10 15775 per color component graphs are placed one bellow other.
yading@10 15776
yading@10 15777 This display mode in C<waveform> histogram mode makes it easy to spot
yading@10 15778 color casts in the highlights and shadows of an image, by comparing the
yading@10 15779 contours of the top and the bottom of each waveform.
yading@10 15780 Since whites, grays, and blacks are characterized by
yading@10 15781 exactly equal amounts of red, green, and blue, neutral areas of the
yading@10 15782 picture should display three waveforms of roughly equal width/height.
yading@10 15783 If not, the correction is easy to make by making adjustments to level the
yading@10 15784 three waveforms.
yading@10 15785
yading@10 15786
yading@10 15787 =item B<overlay>
yading@10 15788
yading@10 15789 Presents information that's identical to that in the C<parade>, except
yading@10 15790 that the graphs representing color components are superimposed directly
yading@10 15791 over one another.
yading@10 15792
yading@10 15793 This display mode in C<waveform> histogram mode can make it easier to spot
yading@10 15794 the relative differences or similarities in overlapping areas of the color
yading@10 15795 components that are supposed to be identical, such as neutral whites, grays,
yading@10 15796 or blacks.
yading@10 15797
yading@10 15798 =back
yading@10 15799
yading@10 15800 Default is C<parade>.
yading@10 15801
yading@10 15802 =back
yading@10 15803
yading@10 15804
yading@10 15805
yading@10 15806 =head3 Examples
yading@10 15807
yading@10 15808
yading@10 15809
yading@10 15810 =over 4
yading@10 15811
yading@10 15812
yading@10 15813
yading@10 15814 =item *
yading@10 15815
yading@10 15816 Calculate and draw histogram:
yading@10 15817
yading@10 15818 ffplay -i input -vf histogram
yading@10 15819
yading@10 15820
yading@10 15821
yading@10 15822 =back
yading@10 15823
yading@10 15824
yading@10 15825
yading@10 15826 =head2 hqdn3d
yading@10 15827
yading@10 15828
yading@10 15829 High precision/quality 3d denoise filter. This filter aims to reduce
yading@10 15830 image noise producing smooth images and making still images really
yading@10 15831 still. It should enhance compressibility.
yading@10 15832
yading@10 15833 It accepts the following optional parameters:
yading@10 15834
yading@10 15835
yading@10 15836 =over 4
yading@10 15837
yading@10 15838
yading@10 15839 =item B<luma_spatial>
yading@10 15840
yading@10 15841 a non-negative float number which specifies spatial luma strength,
yading@10 15842 defaults to 4.0
yading@10 15843
yading@10 15844
yading@10 15845 =item B<chroma_spatial>
yading@10 15846
yading@10 15847 a non-negative float number which specifies spatial chroma strength,
yading@10 15848 defaults to 3.0*I<luma_spatial>/4.0
yading@10 15849
yading@10 15850
yading@10 15851 =item B<luma_tmp>
yading@10 15852
yading@10 15853 a float number which specifies luma temporal strength, defaults to
yading@10 15854 6.0*I<luma_spatial>/4.0
yading@10 15855
yading@10 15856
yading@10 15857 =item B<chroma_tmp>
yading@10 15858
yading@10 15859 a float number which specifies chroma temporal strength, defaults to
yading@10 15860 I<luma_tmp>*I<chroma_spatial>/I<luma_spatial>
yading@10 15861
yading@10 15862 =back
yading@10 15863
yading@10 15864
yading@10 15865
yading@10 15866 =head2 hue
yading@10 15867
yading@10 15868
yading@10 15869 Modify the hue and/or the saturation of the input.
yading@10 15870
yading@10 15871 This filter accepts the following options:
yading@10 15872
yading@10 15873
yading@10 15874 =over 4
yading@10 15875
yading@10 15876
yading@10 15877 =item B<h>
yading@10 15878
yading@10 15879 Specify the hue angle as a number of degrees. It accepts an expression,
yading@10 15880 and defaults to "0".
yading@10 15881
yading@10 15882
yading@10 15883 =item B<s>
yading@10 15884
yading@10 15885 Specify the saturation in the [-10,10] range. It accepts a float number and
yading@10 15886 defaults to "1".
yading@10 15887
yading@10 15888
yading@10 15889 =item B<H>
yading@10 15890
yading@10 15891 Specify the hue angle as a number of radians. It accepts a float
yading@10 15892 number or an expression, and defaults to "0".
yading@10 15893
yading@10 15894 =back
yading@10 15895
yading@10 15896
yading@10 15897 B<h> and B<H> are mutually exclusive, and can't be
yading@10 15898 specified at the same time.
yading@10 15899
yading@10 15900 The B<h>, B<H> and B<s> option values are
yading@10 15901 expressions containing the following constants:
yading@10 15902
yading@10 15903
yading@10 15904 =over 4
yading@10 15905
yading@10 15906
yading@10 15907 =item B<n>
yading@10 15908
yading@10 15909 frame count of the input frame starting from 0
yading@10 15910
yading@10 15911
yading@10 15912 =item B<pts>
yading@10 15913
yading@10 15914 presentation timestamp of the input frame expressed in time base units
yading@10 15915
yading@10 15916
yading@10 15917 =item B<r>
yading@10 15918
yading@10 15919 frame rate of the input video, NAN if the input frame rate is unknown
yading@10 15920
yading@10 15921
yading@10 15922 =item B<t>
yading@10 15923
yading@10 15924 timestamp expressed in seconds, NAN if the input timestamp is unknown
yading@10 15925
yading@10 15926
yading@10 15927 =item B<tb>
yading@10 15928
yading@10 15929 time base of the input video
yading@10 15930
yading@10 15931 =back
yading@10 15932
yading@10 15933
yading@10 15934
yading@10 15935 =head3 Examples
yading@10 15936
yading@10 15937
yading@10 15938
yading@10 15939 =over 4
yading@10 15940
yading@10 15941
yading@10 15942 =item *
yading@10 15943
yading@10 15944 Set the hue to 90 degrees and the saturation to 1.0:
yading@10 15945
yading@10 15946 hue=h=90:s=1
yading@10 15947
yading@10 15948
yading@10 15949
yading@10 15950 =item *
yading@10 15951
yading@10 15952 Same command but expressing the hue in radians:
yading@10 15953
yading@10 15954 hue=H=PI/2:s=1
yading@10 15955
yading@10 15956
yading@10 15957
yading@10 15958 =item *
yading@10 15959
yading@10 15960 Rotate hue and make the saturation swing between 0
yading@10 15961 and 2 over a period of 1 second:
yading@10 15962
yading@10 15963 hue="H=2*PI*t: s=sin(2*PI*t)+1"
yading@10 15964
yading@10 15965
yading@10 15966
yading@10 15967 =item *
yading@10 15968
yading@10 15969 Apply a 3 seconds saturation fade-in effect starting at 0:
yading@10 15970
yading@10 15971 hue="s=min(t/3\,1)"
yading@10 15972
yading@10 15973
yading@10 15974 The general fade-in expression can be written as:
yading@10 15975
yading@10 15976 hue="s=min(0\, max((t-START)/DURATION\, 1))"
yading@10 15977
yading@10 15978
yading@10 15979
yading@10 15980 =item *
yading@10 15981
yading@10 15982 Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
yading@10 15983
yading@10 15984 hue="s=max(0\, min(1\, (8-t)/3))"
yading@10 15985
yading@10 15986
yading@10 15987 The general fade-out expression can be written as:
yading@10 15988
yading@10 15989 hue="s=max(0\, min(1\, (START+DURATION-t)/DURATION))"
yading@10 15990
yading@10 15991
yading@10 15992
yading@10 15993 =back
yading@10 15994
yading@10 15995
yading@10 15996
yading@10 15997 =head3 Commands
yading@10 15998
yading@10 15999
yading@10 16000 This filter supports the following commands:
yading@10 16001
yading@10 16002 =over 4
yading@10 16003
yading@10 16004
yading@10 16005 =item B<s>
yading@10 16006
yading@10 16007
yading@10 16008 =item B<h>
yading@10 16009
yading@10 16010
yading@10 16011 =item B<H>
yading@10 16012
yading@10 16013 Modify the hue and/or the saturation of the input video.
yading@10 16014 The command accepts the same syntax of the corresponding option.
yading@10 16015
yading@10 16016 If the specified expression is not valid, it is kept at its current
yading@10 16017 value.
yading@10 16018
yading@10 16019 =back
yading@10 16020
yading@10 16021
yading@10 16022
yading@10 16023 =head2 idet
yading@10 16024
yading@10 16025
yading@10 16026 Detect video interlacing type.
yading@10 16027
yading@10 16028 This filter tries to detect if the input is interlaced or progressive,
yading@10 16029 top or bottom field first.
yading@10 16030
yading@10 16031 The filter accepts the following options:
yading@10 16032
yading@10 16033
yading@10 16034 =over 4
yading@10 16035
yading@10 16036
yading@10 16037 =item B<intl_thres>
yading@10 16038
yading@10 16039 Set interlacing threshold.
yading@10 16040
yading@10 16041 =item B<prog_thres>
yading@10 16042
yading@10 16043 Set progressive threshold.
yading@10 16044
yading@10 16045 =back
yading@10 16046
yading@10 16047
yading@10 16048
yading@10 16049 =head2 il
yading@10 16050
yading@10 16051
yading@10 16052 Deinterleave or interleave fields.
yading@10 16053
yading@10 16054 This filter allows to process interlaced images fields without
yading@10 16055 deinterlacing them. Deinterleaving splits the input frame into 2
yading@10 16056 fields (so called half pictures). Odd lines are moved to the top
yading@10 16057 half of the output image, even lines to the bottom half.
yading@10 16058 You can process (filter) them independently and then re-interleave them.
yading@10 16059
yading@10 16060 The filter accepts the following options:
yading@10 16061
yading@10 16062
yading@10 16063 =over 4
yading@10 16064
yading@10 16065
yading@10 16066 =item B<luma_mode, l>
yading@10 16067
yading@10 16068
yading@10 16069 =item B<chroma_mode, s>
yading@10 16070
yading@10 16071
yading@10 16072 =item B<alpha_mode, a>
yading@10 16073
yading@10 16074 Available values for I<luma_mode>, I<chroma_mode> and
yading@10 16075 I<alpha_mode> are:
yading@10 16076
yading@10 16077
yading@10 16078 =over 4
yading@10 16079
yading@10 16080
yading@10 16081 =item B<none>
yading@10 16082
yading@10 16083 Do nothing.
yading@10 16084
yading@10 16085
yading@10 16086 =item B<deinterleave, d>
yading@10 16087
yading@10 16088 Deinterleave fields, placing one above the other.
yading@10 16089
yading@10 16090
yading@10 16091 =item B<interleave, i>
yading@10 16092
yading@10 16093 Interleave fields. Reverse the effect of deinterleaving.
yading@10 16094
yading@10 16095 =back
yading@10 16096
yading@10 16097 Default value is C<none>.
yading@10 16098
yading@10 16099
yading@10 16100 =item B<luma_swap, ls>
yading@10 16101
yading@10 16102
yading@10 16103 =item B<chroma_swap, cs>
yading@10 16104
yading@10 16105
yading@10 16106 =item B<alpha_swap, as>
yading@10 16107
yading@10 16108 Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is C<0>.
yading@10 16109
yading@10 16110 =back
yading@10 16111
yading@10 16112
yading@10 16113
yading@10 16114 =head2 interlace
yading@10 16115
yading@10 16116
yading@10 16117 Simple interlacing filter from progressive contents. This interleaves upper (or
yading@10 16118 lower) lines from odd frames with lower (or upper) lines from even frames,
yading@10 16119 halving the frame rate and preserving image height.
yading@10 16120
yading@10 16121
yading@10 16122 Original Original New Frame
yading@10 16123 Frame 'j' Frame 'j+1' (tff)
yading@10 16124 ========== =========== ==================
yading@10 16125 Line 0 --------------------> Frame 'j' Line 0
yading@10 16126 Line 1 Line 1 ----> Frame 'j+1' Line 1
yading@10 16127 Line 2 ---------------------> Frame 'j' Line 2
yading@10 16128 Line 3 Line 3 ----> Frame 'j+1' Line 3
yading@10 16129 ... ... ...
yading@10 16130 New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
yading@10 16131
yading@10 16132
yading@10 16133 It accepts the following optional parameters:
yading@10 16134
yading@10 16135
yading@10 16136 =over 4
yading@10 16137
yading@10 16138
yading@10 16139 =item B<scan>
yading@10 16140
yading@10 16141 determines whether the interlaced frame is taken from the even (tff - default)
yading@10 16142 or odd (bff) lines of the progressive frame.
yading@10 16143
yading@10 16144
yading@10 16145 =item B<lowpass>
yading@10 16146
yading@10 16147 Enable (default) or disable the vertical lowpass filter to avoid twitter
yading@10 16148 interlacing and reduce moire patterns.
yading@10 16149
yading@10 16150 =back
yading@10 16151
yading@10 16152
yading@10 16153
yading@10 16154 =head2 kerndeint
yading@10 16155
yading@10 16156
yading@10 16157 Deinterlace input video by applying Donald Graft's adaptive kernel
yading@10 16158 deinterling. Work on interlaced parts of a video to produce
yading@10 16159 progressive frames.
yading@10 16160
yading@10 16161 The description of the accepted parameters follows.
yading@10 16162
yading@10 16163
yading@10 16164 =over 4
yading@10 16165
yading@10 16166
yading@10 16167 =item B<thresh>
yading@10 16168
yading@10 16169 Set the threshold which affects the filter's tolerance when
yading@10 16170 determining if a pixel line must be processed. It must be an integer
yading@10 16171 in the range [0,255] and defaults to 10. A value of 0 will result in
yading@10 16172 applying the process on every pixels.
yading@10 16173
yading@10 16174
yading@10 16175 =item B<map>
yading@10 16176
yading@10 16177 Paint pixels exceeding the threshold value to white if set to 1.
yading@10 16178 Default is 0.
yading@10 16179
yading@10 16180
yading@10 16181 =item B<order>
yading@10 16182
yading@10 16183 Set the fields order. Swap fields if set to 1, leave fields alone if
yading@10 16184 0. Default is 0.
yading@10 16185
yading@10 16186
yading@10 16187 =item B<sharp>
yading@10 16188
yading@10 16189 Enable additional sharpening if set to 1. Default is 0.
yading@10 16190
yading@10 16191
yading@10 16192 =item B<twoway>
yading@10 16193
yading@10 16194 Enable twoway sharpening if set to 1. Default is 0.
yading@10 16195
yading@10 16196 =back
yading@10 16197
yading@10 16198
yading@10 16199
yading@10 16200 =head3 Examples
yading@10 16201
yading@10 16202
yading@10 16203
yading@10 16204 =over 4
yading@10 16205
yading@10 16206
yading@10 16207 =item *
yading@10 16208
yading@10 16209 Apply default values:
yading@10 16210
yading@10 16211 kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
yading@10 16212
yading@10 16213
yading@10 16214
yading@10 16215 =item *
yading@10 16216
yading@10 16217 Enable additional sharpening:
yading@10 16218
yading@10 16219 kerndeint=sharp=1
yading@10 16220
yading@10 16221
yading@10 16222
yading@10 16223 =item *
yading@10 16224
yading@10 16225 Paint processed pixels in white:
yading@10 16226
yading@10 16227 kerndeint=map=1
yading@10 16228
yading@10 16229
yading@10 16230 =back
yading@10 16231
yading@10 16232
yading@10 16233
yading@10 16234 =head2 lut, lutrgb, lutyuv
yading@10 16235
yading@10 16236
yading@10 16237 Compute a look-up table for binding each pixel component input value
yading@10 16238 to an output value, and apply it to input video.
yading@10 16239
yading@10 16240 I<lutyuv> applies a lookup table to a YUV input video, I<lutrgb>
yading@10 16241 to an RGB input video.
yading@10 16242
yading@10 16243 These filters accept the following options:
yading@10 16244
yading@10 16245 =over 4
yading@10 16246
yading@10 16247
yading@10 16248 =item B<c0>
yading@10 16249
yading@10 16250 set first pixel component expression
yading@10 16251
yading@10 16252 =item B<c1>
yading@10 16253
yading@10 16254 set second pixel component expression
yading@10 16255
yading@10 16256 =item B<c2>
yading@10 16257
yading@10 16258 set third pixel component expression
yading@10 16259
yading@10 16260 =item B<c3>
yading@10 16261
yading@10 16262 set fourth pixel component expression, corresponds to the alpha component
yading@10 16263
yading@10 16264
yading@10 16265 =item B<r>
yading@10 16266
yading@10 16267 set red component expression
yading@10 16268
yading@10 16269 =item B<g>
yading@10 16270
yading@10 16271 set green component expression
yading@10 16272
yading@10 16273 =item B<b>
yading@10 16274
yading@10 16275 set blue component expression
yading@10 16276
yading@10 16277 =item B<a>
yading@10 16278
yading@10 16279 alpha component expression
yading@10 16280
yading@10 16281
yading@10 16282 =item B<y>
yading@10 16283
yading@10 16284 set Y/luminance component expression
yading@10 16285
yading@10 16286 =item B<u>
yading@10 16287
yading@10 16288 set U/Cb component expression
yading@10 16289
yading@10 16290 =item B<v>
yading@10 16291
yading@10 16292 set V/Cr component expression
yading@10 16293
yading@10 16294 =back
yading@10 16295
yading@10 16296
yading@10 16297 Each of them specifies the expression to use for computing the lookup table for
yading@10 16298 the corresponding pixel component values.
yading@10 16299
yading@10 16300 The exact component associated to each of the I<c*> options depends on the
yading@10 16301 format in input.
yading@10 16302
yading@10 16303 The I<lut> filter requires either YUV or RGB pixel formats in input,
yading@10 16304 I<lutrgb> requires RGB pixel formats in input, and I<lutyuv> requires YUV.
yading@10 16305
yading@10 16306 The expressions can contain the following constants and functions:
yading@10 16307
yading@10 16308
yading@10 16309 =over 4
yading@10 16310
yading@10 16311
yading@10 16312 =item B<w, h>
yading@10 16313
yading@10 16314 the input width and height
yading@10 16315
yading@10 16316
yading@10 16317 =item B<val>
yading@10 16318
yading@10 16319 input value for the pixel component
yading@10 16320
yading@10 16321
yading@10 16322 =item B<clipval>
yading@10 16323
yading@10 16324 the input value clipped in the I<minval>-I<maxval> range
yading@10 16325
yading@10 16326
yading@10 16327 =item B<maxval>
yading@10 16328
yading@10 16329 maximum value for the pixel component
yading@10 16330
yading@10 16331
yading@10 16332 =item B<minval>
yading@10 16333
yading@10 16334 minimum value for the pixel component
yading@10 16335
yading@10 16336
yading@10 16337 =item B<negval>
yading@10 16338
yading@10 16339 the negated value for the pixel component value clipped in the
yading@10 16340 I<minval>-I<maxval> range , it corresponds to the expression
yading@10 16341 "maxval-clipval+minval"
yading@10 16342
yading@10 16343
yading@10 16344 =item B<clip(val)>
yading@10 16345
yading@10 16346 the computed value in I<val> clipped in the
yading@10 16347 I<minval>-I<maxval> range
yading@10 16348
yading@10 16349
yading@10 16350 =item B<gammaval(gamma)>
yading@10 16351
yading@10 16352 the computed gamma correction value of the pixel component value
yading@10 16353 clipped in the I<minval>-I<maxval> range, corresponds to the
yading@10 16354 expression
yading@10 16355 "pow((clipval-minval)/(maxval-minval)\,I<gamma>)*(maxval-minval)+minval"
yading@10 16356
yading@10 16357
yading@10 16358 =back
yading@10 16359
yading@10 16360
yading@10 16361 All expressions default to "val".
yading@10 16362
yading@10 16363
yading@10 16364 =head3 Examples
yading@10 16365
yading@10 16366
yading@10 16367
yading@10 16368 =over 4
yading@10 16369
yading@10 16370
yading@10 16371 =item *
yading@10 16372
yading@10 16373 Negate input video:
yading@10 16374
yading@10 16375 lutrgb="r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val"
yading@10 16376 lutyuv="y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val"
yading@10 16377
yading@10 16378
yading@10 16379 The above is the same as:
yading@10 16380
yading@10 16381 lutrgb="r=negval:g=negval:b=negval"
yading@10 16382 lutyuv="y=negval:u=negval:v=negval"
yading@10 16383
yading@10 16384
yading@10 16385
yading@10 16386 =item *
yading@10 16387
yading@10 16388 Negate luminance:
yading@10 16389
yading@10 16390 lutyuv=y=negval
yading@10 16391
yading@10 16392
yading@10 16393
yading@10 16394 =item *
yading@10 16395
yading@10 16396 Remove chroma components, turns the video into a graytone image:
yading@10 16397
yading@10 16398 lutyuv="u=128:v=128"
yading@10 16399
yading@10 16400
yading@10 16401
yading@10 16402 =item *
yading@10 16403
yading@10 16404 Apply a luma burning effect:
yading@10 16405
yading@10 16406 lutyuv="y=2*val"
yading@10 16407
yading@10 16408
yading@10 16409
yading@10 16410 =item *
yading@10 16411
yading@10 16412 Remove green and blue components:
yading@10 16413
yading@10 16414 lutrgb="g=0:b=0"
yading@10 16415
yading@10 16416
yading@10 16417
yading@10 16418 =item *
yading@10 16419
yading@10 16420 Set a constant alpha channel value on input:
yading@10 16421
yading@10 16422 format=rgba,lutrgb=a="maxval-minval/2"
yading@10 16423
yading@10 16424
yading@10 16425
yading@10 16426 =item *
yading@10 16427
yading@10 16428 Correct luminance gamma by a 0.5 factor:
yading@10 16429
yading@10 16430 lutyuv=y=gammaval(0.5)
yading@10 16431
yading@10 16432
yading@10 16433
yading@10 16434 =item *
yading@10 16435
yading@10 16436 Discard least significant bits of luma:
yading@10 16437
yading@10 16438 lutyuv=y='bitand(val, 128+64+32)'
yading@10 16439
yading@10 16440
yading@10 16441 =back
yading@10 16442
yading@10 16443
yading@10 16444
yading@10 16445 =head2 mp
yading@10 16446
yading@10 16447
yading@10 16448 Apply an MPlayer filter to the input video.
yading@10 16449
yading@10 16450 This filter provides a wrapper around most of the filters of
yading@10 16451 MPlayer/MEncoder.
yading@10 16452
yading@10 16453 This wrapper is considered experimental. Some of the wrapped filters
yading@10 16454 may not work properly and we may drop support for them, as they will
yading@10 16455 be implemented natively into FFmpeg. Thus you should avoid
yading@10 16456 depending on them when writing portable scripts.
yading@10 16457
yading@10 16458 The filters accepts the parameters:
yading@10 16459 I<filter_name>[:=]I<filter_params>
yading@10 16460
yading@10 16461 I<filter_name> is the name of a supported MPlayer filter,
yading@10 16462 I<filter_params> is a string containing the parameters accepted by
yading@10 16463 the named filter.
yading@10 16464
yading@10 16465 The list of the currently supported filters follows:
yading@10 16466
yading@10 16467 =over 4
yading@10 16468
yading@10 16469
yading@10 16470 =item I<dint>
yading@10 16471
yading@10 16472
yading@10 16473 =item I<down3dright>
yading@10 16474
yading@10 16475
yading@10 16476 =item I<eq2>
yading@10 16477
yading@10 16478
yading@10 16479 =item I<eq>
yading@10 16480
yading@10 16481
yading@10 16482 =item I<fil>
yading@10 16483
yading@10 16484
yading@10 16485 =item I<fspp>
yading@10 16486
yading@10 16487
yading@10 16488 =item I<ilpack>
yading@10 16489
yading@10 16490
yading@10 16491 =item I<mcdeint>
yading@10 16492
yading@10 16493
yading@10 16494 =item I<ow>
yading@10 16495
yading@10 16496
yading@10 16497 =item I<perspective>
yading@10 16498
yading@10 16499
yading@10 16500 =item I<phase>
yading@10 16501
yading@10 16502
yading@10 16503 =item I<pp7>
yading@10 16504
yading@10 16505
yading@10 16506 =item I<pullup>
yading@10 16507
yading@10 16508
yading@10 16509 =item I<qp>
yading@10 16510
yading@10 16511
yading@10 16512 =item I<sab>
yading@10 16513
yading@10 16514
yading@10 16515 =item I<softpulldown>
yading@10 16516
yading@10 16517
yading@10 16518 =item I<spp>
yading@10 16519
yading@10 16520
yading@10 16521 =item I<tinterlace>
yading@10 16522
yading@10 16523
yading@10 16524 =item I<uspp>
yading@10 16525
yading@10 16526
yading@10 16527 =back
yading@10 16528
yading@10 16529
yading@10 16530 The parameter syntax and behavior for the listed filters are the same
yading@10 16531 of the corresponding MPlayer filters. For detailed instructions check
yading@10 16532 the "VIDEO FILTERS" section in the MPlayer manual.
yading@10 16533
yading@10 16534
yading@10 16535 =head3 Examples
yading@10 16536
yading@10 16537
yading@10 16538
yading@10 16539 =over 4
yading@10 16540
yading@10 16541
yading@10 16542 =item *
yading@10 16543
yading@10 16544 Adjust gamma, brightness, contrast:
yading@10 16545
yading@10 16546 mp=eq2=1.0:2:0.5
yading@10 16547
yading@10 16548
yading@10 16549 =back
yading@10 16550
yading@10 16551
yading@10 16552 See also mplayer(1), E<lt>B<http://www.mplayerhq.hu/>E<gt>.
yading@10 16553
yading@10 16554
yading@10 16555 =head2 mpdecimate
yading@10 16556
yading@10 16557
yading@10 16558 Drop frames that do not differ greatly from the previous frame in
yading@10 16559 order to reduce frame rate.
yading@10 16560
yading@10 16561 The main use of this filter is for very-low-bitrate encoding
yading@10 16562 (e.g. streaming over dialup modem), but it could in theory be used for
yading@10 16563 fixing movies that were inverse-telecined incorrectly.
yading@10 16564
yading@10 16565 A description of the accepted options follows.
yading@10 16566
yading@10 16567
yading@10 16568 =over 4
yading@10 16569
yading@10 16570
yading@10 16571 =item B<max>
yading@10 16572
yading@10 16573 Set the maximum number of consecutive frames which can be dropped (if
yading@10 16574 positive), or the minimum interval between dropped frames (if
yading@10 16575 negative). If the value is 0, the frame is dropped unregarding the
yading@10 16576 number of previous sequentially dropped frames.
yading@10 16577
yading@10 16578 Default value is 0.
yading@10 16579
yading@10 16580
yading@10 16581 =item B<hi>
yading@10 16582
yading@10 16583
yading@10 16584 =item B<lo>
yading@10 16585
yading@10 16586
yading@10 16587 =item B<frac>
yading@10 16588
yading@10 16589 Set the dropping threshold values.
yading@10 16590
yading@10 16591 Values for B<hi> and B<lo> are for 8x8 pixel blocks and
yading@10 16592 represent actual pixel value differences, so a threshold of 64
yading@10 16593 corresponds to 1 unit of difference for each pixel, or the same spread
yading@10 16594 out differently over the block.
yading@10 16595
yading@10 16596 A frame is a candidate for dropping if no 8x8 blocks differ by more
yading@10 16597 than a threshold of B<hi>, and if no more than B<frac> blocks (1
yading@10 16598 meaning the whole image) differ by more than a threshold of B<lo>.
yading@10 16599
yading@10 16600 Default value for B<hi> is 64*12, default value for B<lo> is
yading@10 16601 64*5, and default value for B<frac> is 0.33.
yading@10 16602
yading@10 16603 =back
yading@10 16604
yading@10 16605
yading@10 16606
yading@10 16607
yading@10 16608 =head2 negate
yading@10 16609
yading@10 16610
yading@10 16611 Negate input video.
yading@10 16612
yading@10 16613 This filter accepts an integer in input, if non-zero it negates the
yading@10 16614 alpha component (if available). The default value in input is 0.
yading@10 16615
yading@10 16616
yading@10 16617 =head2 noformat
yading@10 16618
yading@10 16619
yading@10 16620 Force libavfilter not to use any of the specified pixel formats for the
yading@10 16621 input to 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 Force libavfilter to use a format different from I<yuv420p> for the
yading@10 16649 input to the vflip filter:
yading@10 16650
yading@10 16651 noformat=pix_fmts=yuv420p,vflip
yading@10 16652
yading@10 16653
yading@10 16654
yading@10 16655 =item *
yading@10 16656
yading@10 16657 Convert the input video to any of the formats not contained in the list:
yading@10 16658
yading@10 16659 noformat=yuv420p|yuv444p|yuv410p
yading@10 16660
yading@10 16661
yading@10 16662 =back
yading@10 16663
yading@10 16664
yading@10 16665
yading@10 16666 =head2 noise
yading@10 16667
yading@10 16668
yading@10 16669 Add noise on video input frame.
yading@10 16670
yading@10 16671 The filter accepts the following options:
yading@10 16672
yading@10 16673
yading@10 16674 =over 4
yading@10 16675
yading@10 16676
yading@10 16677 =item B<all_seed>
yading@10 16678
yading@10 16679
yading@10 16680 =item B<c0_seed>
yading@10 16681
yading@10 16682
yading@10 16683 =item B<c1_seed>
yading@10 16684
yading@10 16685
yading@10 16686 =item B<c2_seed>
yading@10 16687
yading@10 16688
yading@10 16689 =item B<c3_seed>
yading@10 16690
yading@10 16691 Set noise seed for specific pixel component or all pixel components in case
yading@10 16692 of I<all_seed>. Default value is C<123457>.
yading@10 16693
yading@10 16694
yading@10 16695 =item B<all_strength, alls>
yading@10 16696
yading@10 16697
yading@10 16698 =item B<c0_strength, c0s>
yading@10 16699
yading@10 16700
yading@10 16701 =item B<c1_strength, c1s>
yading@10 16702
yading@10 16703
yading@10 16704 =item B<c2_strength, c2s>
yading@10 16705
yading@10 16706
yading@10 16707 =item B<c3_strength, c3s>
yading@10 16708
yading@10 16709 Set noise strength for specific pixel component or all pixel components in case
yading@10 16710 I<all_strength>. Default value is C<0>. Allowed range is [0, 100].
yading@10 16711
yading@10 16712
yading@10 16713 =item B<all_flags, allf>
yading@10 16714
yading@10 16715
yading@10 16716 =item B<c0_flags, c0f>
yading@10 16717
yading@10 16718
yading@10 16719 =item B<c1_flags, c1f>
yading@10 16720
yading@10 16721
yading@10 16722 =item B<c2_flags, c2f>
yading@10 16723
yading@10 16724
yading@10 16725 =item B<c3_flags, c3f>
yading@10 16726
yading@10 16727 Set pixel component flags or set flags for all components if I<all_flags>.
yading@10 16728 Available values for component flags are:
yading@10 16729
yading@10 16730 =over 4
yading@10 16731
yading@10 16732
yading@10 16733 =item B<a>
yading@10 16734
yading@10 16735 averaged temporal noise (smoother)
yading@10 16736
yading@10 16737 =item B<p>
yading@10 16738
yading@10 16739 mix random noise with a (semi)regular pattern
yading@10 16740
yading@10 16741 =item B<q>
yading@10 16742
yading@10 16743 higher quality (slightly better looking, slightly slower)
yading@10 16744
yading@10 16745 =item B<t>
yading@10 16746
yading@10 16747 temporal noise (noise pattern changes between frames)
yading@10 16748
yading@10 16749 =item B<u>
yading@10 16750
yading@10 16751 uniform noise (gaussian otherwise)
yading@10 16752
yading@10 16753 =back
yading@10 16754
yading@10 16755
yading@10 16756 =back
yading@10 16757
yading@10 16758
yading@10 16759
yading@10 16760 =head3 Examples
yading@10 16761
yading@10 16762
yading@10 16763 Add temporal and uniform noise to input video:
yading@10 16764
yading@10 16765 noise=alls=20:allf=t+u
yading@10 16766
yading@10 16767
yading@10 16768
yading@10 16769 =head2 null
yading@10 16770
yading@10 16771
yading@10 16772 Pass the video source unchanged to the output.
yading@10 16773
yading@10 16774
yading@10 16775 =head2 ocv
yading@10 16776
yading@10 16777
yading@10 16778 Apply video transform using libopencv.
yading@10 16779
yading@10 16780 To enable this filter install libopencv library and headers and
yading@10 16781 configure FFmpeg with C<--enable-libopencv>.
yading@10 16782
yading@10 16783 This filter accepts the following parameters:
yading@10 16784
yading@10 16785
yading@10 16786 =over 4
yading@10 16787
yading@10 16788
yading@10 16789
yading@10 16790 =item B<filter_name>
yading@10 16791
yading@10 16792 The name of the libopencv filter to apply.
yading@10 16793
yading@10 16794
yading@10 16795 =item B<filter_params>
yading@10 16796
yading@10 16797 The parameters to pass to the libopencv filter. If not specified the default
yading@10 16798 values are assumed.
yading@10 16799
yading@10 16800
yading@10 16801 =back
yading@10 16802
yading@10 16803
yading@10 16804 Refer to the official libopencv documentation for more precise
yading@10 16805 information:
yading@10 16806 E<lt>B<http://opencv.willowgarage.com/documentation/c/image_filtering.html>E<gt>
yading@10 16807
yading@10 16808 Follows the list of supported libopencv filters.
yading@10 16809
yading@10 16810
yading@10 16811
yading@10 16812 =head3 dilate
yading@10 16813
yading@10 16814
yading@10 16815 Dilate an image by using a specific structuring element.
yading@10 16816 This filter corresponds to the libopencv function C<cvDilate>.
yading@10 16817
yading@10 16818 It accepts the parameters: I<struct_el>|I<nb_iterations>.
yading@10 16819
yading@10 16820 I<struct_el> represents a structuring element, and has the syntax:
yading@10 16821 I<cols>xI<rows>+I<anchor_x>xI<anchor_y>/I<shape>
yading@10 16822
yading@10 16823 I<cols> and I<rows> represent the number of columns and rows of
yading@10 16824 the structuring element, I<anchor_x> and I<anchor_y> the anchor
yading@10 16825 point, and I<shape> the shape for the structuring element, and
yading@10 16826 can be one of the values "rect", "cross", "ellipse", "custom".
yading@10 16827
yading@10 16828 If the value for I<shape> is "custom", it must be followed by a
yading@10 16829 string of the form "=I<filename>". The file with name
yading@10 16830 I<filename> is assumed to represent a binary image, with each
yading@10 16831 printable character corresponding to a bright pixel. When a custom
yading@10 16832 I<shape> is used, I<cols> and I<rows> are ignored, the number
yading@10 16833 or columns and rows of the read file are assumed instead.
yading@10 16834
yading@10 16835 The default value for I<struct_el> is "3x3+0x0/rect".
yading@10 16836
yading@10 16837 I<nb_iterations> specifies the number of times the transform is
yading@10 16838 applied to the image, and defaults to 1.
yading@10 16839
yading@10 16840 Follow some example:
yading@10 16841
yading@10 16842 # use the default values
yading@10 16843 ocv=dilate
yading@10 16844
yading@10 16845 # dilate using a structuring element with a 5x5 cross, iterate two times
yading@10 16846 ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
yading@10 16847
yading@10 16848 # read the shape from the file diamond.shape, iterate two times
yading@10 16849 # the file diamond.shape may contain a pattern of characters like this:
yading@10 16850 # *
yading@10 16851 # ***
yading@10 16852 # *****
yading@10 16853 # ***
yading@10 16854 # *
yading@10 16855 # the specified cols and rows are ignored (but not the anchor point coordinates)
yading@10 16856 ocv=dilate:0x0+2x2/custom=diamond.shape|2
yading@10 16857
yading@10 16858
yading@10 16859
yading@10 16860 =head3 erode
yading@10 16861
yading@10 16862
yading@10 16863 Erode an image by using a specific structuring element.
yading@10 16864 This filter corresponds to the libopencv function C<cvErode>.
yading@10 16865
yading@10 16866 The filter accepts the parameters: I<struct_el>:I<nb_iterations>,
yading@10 16867 with the same syntax and semantics as the dilate filter.
yading@10 16868
yading@10 16869
yading@10 16870 =head3 smooth
yading@10 16871
yading@10 16872
yading@10 16873 Smooth the input video.
yading@10 16874
yading@10 16875 The filter takes the following parameters:
yading@10 16876 I<type>|I<param1>|I<param2>|I<param3>|I<param4>.
yading@10 16877
yading@10 16878 I<type> is the type of smooth filter to apply, and can be one of
yading@10 16879 the following values: "blur", "blur_no_scale", "median", "gaussian",
yading@10 16880 "bilateral". The default value is "gaussian".
yading@10 16881
yading@10 16882 I<param1>, I<param2>, I<param3>, and I<param4> are
yading@10 16883 parameters whose meanings depend on smooth type. I<param1> and
yading@10 16884 I<param2> accept integer positive values or 0, I<param3> and
yading@10 16885 I<param4> accept float values.
yading@10 16886
yading@10 16887 The default value for I<param1> is 3, the default value for the
yading@10 16888 other parameters is 0.
yading@10 16889
yading@10 16890 These parameters correspond to the parameters assigned to the
yading@10 16891 libopencv function C<cvSmooth>.
yading@10 16892
yading@10 16893
yading@10 16894
yading@10 16895 =head2 overlay
yading@10 16896
yading@10 16897
yading@10 16898 Overlay one video on top of another.
yading@10 16899
yading@10 16900 It takes two inputs and one output, the first input is the "main"
yading@10 16901 video on which the second input is overlayed.
yading@10 16902
yading@10 16903 This filter accepts the following parameters:
yading@10 16904
yading@10 16905 A description of the accepted options follows.
yading@10 16906
yading@10 16907
yading@10 16908 =over 4
yading@10 16909
yading@10 16910
yading@10 16911 =item B<x>
yading@10 16912
yading@10 16913
yading@10 16914 =item B<y>
yading@10 16915
yading@10 16916 Set the expression for the x and y coordinates of the overlayed video
yading@10 16917 on the main video. Default value is "0" for both expressions. In case
yading@10 16918 the expression is invalid, it is set to a huge value (meaning that the
yading@10 16919 overlay will not be displayed within the output visible area).
yading@10 16920
yading@10 16921
yading@10 16922 =item B<enable>
yading@10 16923
yading@10 16924 Set the expression which enables the overlay. If the evaluation is
yading@10 16925 different from 0, the overlay is displayed on top of the input
yading@10 16926 frame. By default it is "1".
yading@10 16927
yading@10 16928
yading@10 16929 =item B<eval>
yading@10 16930
yading@10 16931 Set when the expressions for B<x>, B<y>, and
yading@10 16932 B<enable> are evaluated.
yading@10 16933
yading@10 16934 It accepts the following values:
yading@10 16935
yading@10 16936 =over 4
yading@10 16937
yading@10 16938
yading@10 16939 =item B<init>
yading@10 16940
yading@10 16941 only evaluate expressions once during the filter initialization or
yading@10 16942 when a command is processed
yading@10 16943
yading@10 16944
yading@10 16945 =item B<frame>
yading@10 16946
yading@10 16947 evaluate expressions for each incoming frame
yading@10 16948
yading@10 16949 =back
yading@10 16950
yading@10 16951
yading@10 16952 Default value is B<frame>.
yading@10 16953
yading@10 16954
yading@10 16955 =item B<shortest>
yading@10 16956
yading@10 16957 If set to 1, force the output to terminate when the shortest input
yading@10 16958 terminates. Default value is 0.
yading@10 16959
yading@10 16960
yading@10 16961 =item B<format>
yading@10 16962
yading@10 16963 Set the format for the output video.
yading@10 16964
yading@10 16965 It accepts the following values:
yading@10 16966
yading@10 16967 =over 4
yading@10 16968
yading@10 16969
yading@10 16970 =item B<yuv420>
yading@10 16971
yading@10 16972 force YUV420 output
yading@10 16973
yading@10 16974
yading@10 16975 =item B<yuv444>
yading@10 16976
yading@10 16977 force YUV444 output
yading@10 16978
yading@10 16979
yading@10 16980 =item B<rgb>
yading@10 16981
yading@10 16982 force RGB output
yading@10 16983
yading@10 16984 =back
yading@10 16985
yading@10 16986
yading@10 16987 Default value is B<yuv420>.
yading@10 16988
yading@10 16989
yading@10 16990 =item B<rgb> I<(deprecated)>
yading@10 16991
yading@10 16992 If set to 1, force the filter to accept inputs in the RGB
yading@10 16993 color space. Default value is 0. This option is deprecated, use
yading@10 16994 B<format> instead.
yading@10 16995
yading@10 16996
yading@10 16997 =item B<repeatlast>
yading@10 16998
yading@10 16999 If set to 1, force the filter to draw the last overlay frame over the
yading@10 17000 main input until the end of the stream. A value of 0 disables this
yading@10 17001 behavior, which is enabled by default.
yading@10 17002
yading@10 17003 =back
yading@10 17004
yading@10 17005
yading@10 17006 The B<x>, B<y>, and B<enable> expressions can
yading@10 17007 contain the following parameters.
yading@10 17008
yading@10 17009
yading@10 17010 =over 4
yading@10 17011
yading@10 17012
yading@10 17013 =item B<main_w, W>
yading@10 17014
yading@10 17015
yading@10 17016 =item B<main_h, H>
yading@10 17017
yading@10 17018 main input width and height
yading@10 17019
yading@10 17020
yading@10 17021 =item B<overlay_w, w>
yading@10 17022
yading@10 17023
yading@10 17024 =item B<overlay_h, h>
yading@10 17025
yading@10 17026 overlay input width and height
yading@10 17027
yading@10 17028
yading@10 17029 =item B<x>
yading@10 17030
yading@10 17031
yading@10 17032 =item B<y>
yading@10 17033
yading@10 17034 the computed values for I<x> and I<y>. They are evaluated for
yading@10 17035 each new frame.
yading@10 17036
yading@10 17037
yading@10 17038 =item B<hsub>
yading@10 17039
yading@10 17040
yading@10 17041 =item B<vsub>
yading@10 17042
yading@10 17043 horizontal and vertical chroma subsample values of the output
yading@10 17044 format. For example for the pixel format "yuv422p" I<hsub> is 2 and
yading@10 17045 I<vsub> is 1.
yading@10 17046
yading@10 17047
yading@10 17048 =item B<n>
yading@10 17049
yading@10 17050 the number of input frame, starting from 0
yading@10 17051
yading@10 17052
yading@10 17053 =item B<pos>
yading@10 17054
yading@10 17055 the position in the file of the input frame, NAN if unknown
yading@10 17056
yading@10 17057
yading@10 17058 =item B<t>
yading@10 17059
yading@10 17060 timestamp expressed in seconds, NAN if the input timestamp is unknown
yading@10 17061
yading@10 17062 =back
yading@10 17063
yading@10 17064
yading@10 17065 Note that the I<n>, I<pos>, I<t> variables are available only
yading@10 17066 when evaluation is done I<per frame>, and will evaluate to NAN
yading@10 17067 when B<eval> is set to B<init>.
yading@10 17068
yading@10 17069 Be aware that frames are taken from each input video in timestamp
yading@10 17070 order, hence, if their initial timestamps differ, it is a a good idea
yading@10 17071 to pass the two inputs through a I<setpts=PTS-STARTPTS> filter to
yading@10 17072 have them begin in the same zero timestamp, as it does the example for
yading@10 17073 the I<movie> filter.
yading@10 17074
yading@10 17075 You can chain together more overlays but you should test the
yading@10 17076 efficiency of such approach.
yading@10 17077
yading@10 17078
yading@10 17079 =head3 Commands
yading@10 17080
yading@10 17081
yading@10 17082 This filter supports the following commands:
yading@10 17083
yading@10 17084 =over 4
yading@10 17085
yading@10 17086
yading@10 17087 =item B<x>
yading@10 17088
yading@10 17089
yading@10 17090 =item B<y>
yading@10 17091
yading@10 17092
yading@10 17093 =item B<enable>
yading@10 17094
yading@10 17095 Modify the x/y and enable overlay of the overlay input.
yading@10 17096 The command accepts the same syntax of the corresponding option.
yading@10 17097
yading@10 17098 If the specified expression is not valid, it is kept at its current
yading@10 17099 value.
yading@10 17100
yading@10 17101 =back
yading@10 17102
yading@10 17103
yading@10 17104
yading@10 17105 =head3 Examples
yading@10 17106
yading@10 17107
yading@10 17108
yading@10 17109 =over 4
yading@10 17110
yading@10 17111
yading@10 17112 =item *
yading@10 17113
yading@10 17114 Draw the overlay at 10 pixels from the bottom right corner of the main
yading@10 17115 video:
yading@10 17116
yading@10 17117 overlay=main_w-overlay_w-10:main_h-overlay_h-10
yading@10 17118
yading@10 17119
yading@10 17120 Using named options the example above becomes:
yading@10 17121
yading@10 17122 overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
yading@10 17123
yading@10 17124
yading@10 17125
yading@10 17126 =item *
yading@10 17127
yading@10 17128 Insert a transparent PNG logo in the bottom left corner of the input,
yading@10 17129 using the B<ffmpeg> tool with the C<-filter_complex> option:
yading@10 17130
yading@10 17131 ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
yading@10 17132
yading@10 17133
yading@10 17134
yading@10 17135 =item *
yading@10 17136
yading@10 17137 Insert 2 different transparent PNG logos (second logo on bottom
yading@10 17138 right corner) using the B<ffmpeg> tool:
yading@10 17139
yading@10 17140 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 17141
yading@10 17142
yading@10 17143
yading@10 17144 =item *
yading@10 17145
yading@10 17146 Add a transparent color layer on top of the main video, C<WxH>
yading@10 17147 must specify the size of the main input to the overlay filter:
yading@10 17148
yading@10 17149 color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
yading@10 17150
yading@10 17151
yading@10 17152
yading@10 17153 =item *
yading@10 17154
yading@10 17155 Play an original video and a filtered version (here with the deshake
yading@10 17156 filter) side by side using the B<ffplay> tool:
yading@10 17157
yading@10 17158 ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
yading@10 17159
yading@10 17160
yading@10 17161 The above command is the same as:
yading@10 17162
yading@10 17163 ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
yading@10 17164
yading@10 17165
yading@10 17166
yading@10 17167 =item *
yading@10 17168
yading@10 17169 Make a sliding overlay appearing from the left to the right top part of the
yading@10 17170 screen starting since time 2:
yading@10 17171
yading@10 17172 overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
yading@10 17173
yading@10 17174
yading@10 17175
yading@10 17176 =item *
yading@10 17177
yading@10 17178 Compose output by putting two input videos side to side:
yading@10 17179
yading@10 17180 ffmpeg -i left.avi -i right.avi -filter_complex "
yading@10 17181 nullsrc=size=200x100 [background];
yading@10 17182 [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
yading@10 17183 [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
yading@10 17184 [background][left] overlay=shortest=1 [background+left];
yading@10 17185 [background+left][right] overlay=shortest=1:x=100 [left+right]
yading@10 17186 "
yading@10 17187
yading@10 17188
yading@10 17189
yading@10 17190 =item *
yading@10 17191
yading@10 17192 Chain several overlays in cascade:
yading@10 17193
yading@10 17194 nullsrc=s=200x200 [bg];
yading@10 17195 testsrc=s=100x100, split=4 [in0][in1][in2][in3];
yading@10 17196 [in0] lutrgb=r=0, [bg] overlay=0:0 [mid0];
yading@10 17197 [in1] lutrgb=g=0, [mid0] overlay=100:0 [mid1];
yading@10 17198 [in2] lutrgb=b=0, [mid1] overlay=0:100 [mid2];
yading@10 17199 [in3] null, [mid2] overlay=100:100 [out0]
yading@10 17200
yading@10 17201
yading@10 17202
yading@10 17203 =back
yading@10 17204
yading@10 17205
yading@10 17206
yading@10 17207 =head2 pad
yading@10 17208
yading@10 17209
yading@10 17210 Add paddings to the input image, and place the original input at the
yading@10 17211 given coordinates I<x>, I<y>.
yading@10 17212
yading@10 17213 This filter accepts the following parameters:
yading@10 17214
yading@10 17215
yading@10 17216 =over 4
yading@10 17217
yading@10 17218
yading@10 17219 =item B<width, w>
yading@10 17220
yading@10 17221
yading@10 17222 =item B<height, h>
yading@10 17223
yading@10 17224 Specify an expression for the size of the output image with the
yading@10 17225 paddings added. If the value for I<width> or I<height> is 0, the
yading@10 17226 corresponding input size is used for the output.
yading@10 17227
yading@10 17228 The I<width> expression can reference the value set by the
yading@10 17229 I<height> expression, and vice versa.
yading@10 17230
yading@10 17231 The default value of I<width> and I<height> is 0.
yading@10 17232
yading@10 17233
yading@10 17234 =item B<x>
yading@10 17235
yading@10 17236
yading@10 17237 =item B<y>
yading@10 17238
yading@10 17239 Specify an expression for the offsets where to place the input image
yading@10 17240 in the padded area with respect to the top/left border of the output
yading@10 17241 image.
yading@10 17242
yading@10 17243 The I<x> expression can reference the value set by the I<y>
yading@10 17244 expression, and vice versa.
yading@10 17245
yading@10 17246 The default value of I<x> and I<y> is 0.
yading@10 17247
yading@10 17248
yading@10 17249 =item B<color>
yading@10 17250
yading@10 17251 Specify the color of the padded area, it can be the name of a color
yading@10 17252 (case insensitive match) or a 0xRRGGBB[AA] sequence.
yading@10 17253
yading@10 17254 The default value of I<color> is "black".
yading@10 17255
yading@10 17256 =back
yading@10 17257
yading@10 17258
yading@10 17259 The value for the I<width>, I<height>, I<x>, and I<y>
yading@10 17260 options are expressions containing the following constants:
yading@10 17261
yading@10 17262
yading@10 17263 =over 4
yading@10 17264
yading@10 17265
yading@10 17266 =item B<in_w, in_h>
yading@10 17267
yading@10 17268 the input video width and height
yading@10 17269
yading@10 17270
yading@10 17271 =item B<iw, ih>
yading@10 17272
yading@10 17273 same as I<in_w> and I<in_h>
yading@10 17274
yading@10 17275
yading@10 17276 =item B<out_w, out_h>
yading@10 17277
yading@10 17278 the output width and height, that is the size of the padded area as
yading@10 17279 specified by the I<width> and I<height> expressions
yading@10 17280
yading@10 17281
yading@10 17282 =item B<ow, oh>
yading@10 17283
yading@10 17284 same as I<out_w> and I<out_h>
yading@10 17285
yading@10 17286
yading@10 17287 =item B<x, y>
yading@10 17288
yading@10 17289 x and y offsets as specified by the I<x> and I<y>
yading@10 17290 expressions, or NAN if not yet specified
yading@10 17291
yading@10 17292
yading@10 17293 =item B<a>
yading@10 17294
yading@10 17295 same as I<iw> / I<ih>
yading@10 17296
yading@10 17297
yading@10 17298 =item B<sar>
yading@10 17299
yading@10 17300 input sample aspect ratio
yading@10 17301
yading@10 17302
yading@10 17303 =item B<dar>
yading@10 17304
yading@10 17305 input display aspect ratio, it is the same as (I<iw> / I<ih>) * I<sar>
yading@10 17306
yading@10 17307
yading@10 17308 =item B<hsub, vsub>
yading@10 17309
yading@10 17310 horizontal and vertical chroma subsample values. For example for the
yading@10 17311 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 17312
yading@10 17313 =back
yading@10 17314
yading@10 17315
yading@10 17316
yading@10 17317 =head3 Examples
yading@10 17318
yading@10 17319
yading@10 17320
yading@10 17321 =over 4
yading@10 17322
yading@10 17323
yading@10 17324 =item *
yading@10 17325
yading@10 17326 Add paddings with color "violet" to the input video. Output video
yading@10 17327 size is 640x480, the top-left corner of the input video is placed at
yading@10 17328 column 0, row 40:
yading@10 17329
yading@10 17330 pad=640:480:0:40:violet
yading@10 17331
yading@10 17332
yading@10 17333 The example above is equivalent to the following command:
yading@10 17334
yading@10 17335 pad=width=640:height=480:x=0:y=40:color=violet
yading@10 17336
yading@10 17337
yading@10 17338
yading@10 17339 =item *
yading@10 17340
yading@10 17341 Pad the input to get an output with dimensions increased by 3/2,
yading@10 17342 and put the input video at the center of the padded area:
yading@10 17343
yading@10 17344 pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
yading@10 17345
yading@10 17346
yading@10 17347
yading@10 17348 =item *
yading@10 17349
yading@10 17350 Pad the input to get a squared output with size equal to the maximum
yading@10 17351 value between the input width and height, and put the input video at
yading@10 17352 the center of the padded area:
yading@10 17353
yading@10 17354 pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
yading@10 17355
yading@10 17356
yading@10 17357
yading@10 17358 =item *
yading@10 17359
yading@10 17360 Pad the input to get a final w/h ratio of 16:9:
yading@10 17361
yading@10 17362 pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
yading@10 17363
yading@10 17364
yading@10 17365
yading@10 17366 =item *
yading@10 17367
yading@10 17368 In case of anamorphic video, in order to set the output display aspect
yading@10 17369 correctly, it is necessary to use I<sar> in the expression,
yading@10 17370 according to the relation:
yading@10 17371
yading@10 17372 (ih * X / ih) * sar = output_dar
yading@10 17373 X = output_dar / sar
yading@10 17374
yading@10 17375
yading@10 17376 Thus the previous example needs to be modified to:
yading@10 17377
yading@10 17378 pad="ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2"
yading@10 17379
yading@10 17380
yading@10 17381
yading@10 17382 =item *
yading@10 17383
yading@10 17384 Double output size and put the input video in the bottom-right
yading@10 17385 corner of the output padded area:
yading@10 17386
yading@10 17387 pad="2*iw:2*ih:ow-iw:oh-ih"
yading@10 17388
yading@10 17389
yading@10 17390 =back
yading@10 17391
yading@10 17392
yading@10 17393
yading@10 17394 =head2 pixdesctest
yading@10 17395
yading@10 17396
yading@10 17397 Pixel format descriptor test filter, mainly useful for internal
yading@10 17398 testing. The output video should be equal to the input video.
yading@10 17399
yading@10 17400 For example:
yading@10 17401
yading@10 17402 format=monow, pixdesctest
yading@10 17403
yading@10 17404
yading@10 17405 can be used to test the monowhite pixel format descriptor definition.
yading@10 17406
yading@10 17407
yading@10 17408 =head2 pp
yading@10 17409
yading@10 17410
yading@10 17411 Enable the specified chain of postprocessing subfilters using libpostproc. This
yading@10 17412 library should be automatically selected with a GPL build (C<--enable-gpl>).
yading@10 17413 Subfilters must be separated by '/' and can be disabled by prepending a '-'.
yading@10 17414 Each subfilter and some options have a short and a long name that can be used
yading@10 17415 interchangeably, i.e. dr/dering are the same.
yading@10 17416
yading@10 17417 The filters accept the following options:
yading@10 17418
yading@10 17419
yading@10 17420 =over 4
yading@10 17421
yading@10 17422
yading@10 17423 =item B<subfilters>
yading@10 17424
yading@10 17425 Set postprocessing subfilters string.
yading@10 17426
yading@10 17427 =back
yading@10 17428
yading@10 17429
yading@10 17430 All subfilters share common options to determine their scope:
yading@10 17431
yading@10 17432
yading@10 17433 =over 4
yading@10 17434
yading@10 17435
yading@10 17436 =item B<a/autoq>
yading@10 17437
yading@10 17438 Honor the quality commands for this subfilter.
yading@10 17439
yading@10 17440
yading@10 17441 =item B<c/chrom>
yading@10 17442
yading@10 17443 Do chrominance filtering, too (default).
yading@10 17444
yading@10 17445
yading@10 17446 =item B<y/nochrom>
yading@10 17447
yading@10 17448 Do luminance filtering only (no chrominance).
yading@10 17449
yading@10 17450
yading@10 17451 =item B<n/noluma>
yading@10 17452
yading@10 17453 Do chrominance filtering only (no luminance).
yading@10 17454
yading@10 17455 =back
yading@10 17456
yading@10 17457
yading@10 17458 These options can be appended after the subfilter name, separated by a '|'.
yading@10 17459
yading@10 17460 Available subfilters are:
yading@10 17461
yading@10 17462
yading@10 17463 =over 4
yading@10 17464
yading@10 17465
yading@10 17466 =item B<hb/hdeblock[|difference[|flatness]]>
yading@10 17467
yading@10 17468 Horizontal deblocking filter
yading@10 17469
yading@10 17470 =over 4
yading@10 17471
yading@10 17472
yading@10 17473 =item B<difference>
yading@10 17474
yading@10 17475 Difference factor where higher values mean more deblocking (default: C<32>).
yading@10 17476
yading@10 17477 =item B<flatness>
yading@10 17478
yading@10 17479 Flatness threshold where lower values mean more deblocking (default: C<39>).
yading@10 17480
yading@10 17481 =back
yading@10 17482
yading@10 17483
yading@10 17484
yading@10 17485 =item B<vb/vdeblock[|difference[|flatness]]>
yading@10 17486
yading@10 17487 Vertical deblocking filter
yading@10 17488
yading@10 17489 =over 4
yading@10 17490
yading@10 17491
yading@10 17492 =item B<difference>
yading@10 17493
yading@10 17494 Difference factor where higher values mean more deblocking (default: C<32>).
yading@10 17495
yading@10 17496 =item B<flatness>
yading@10 17497
yading@10 17498 Flatness threshold where lower values mean more deblocking (default: C<39>).
yading@10 17499
yading@10 17500 =back
yading@10 17501
yading@10 17502
yading@10 17503
yading@10 17504 =item B<ha/hadeblock[|difference[|flatness]]>
yading@10 17505
yading@10 17506 Accurate horizontal deblocking filter
yading@10 17507
yading@10 17508 =over 4
yading@10 17509
yading@10 17510
yading@10 17511 =item B<difference>
yading@10 17512
yading@10 17513 Difference factor where higher values mean more deblocking (default: C<32>).
yading@10 17514
yading@10 17515 =item B<flatness>
yading@10 17516
yading@10 17517 Flatness threshold where lower values mean more deblocking (default: C<39>).
yading@10 17518
yading@10 17519 =back
yading@10 17520
yading@10 17521
yading@10 17522
yading@10 17523 =item B<va/vadeblock[|difference[|flatness]]>
yading@10 17524
yading@10 17525 Accurate vertical deblocking filter
yading@10 17526
yading@10 17527 =over 4
yading@10 17528
yading@10 17529
yading@10 17530 =item B<difference>
yading@10 17531
yading@10 17532 Difference factor where higher values mean more deblocking (default: C<32>).
yading@10 17533
yading@10 17534 =item B<flatness>
yading@10 17535
yading@10 17536 Flatness threshold where lower values mean more deblocking (default: C<39>).
yading@10 17537
yading@10 17538 =back
yading@10 17539
yading@10 17540
yading@10 17541 =back
yading@10 17542
yading@10 17543
yading@10 17544 The horizontal and vertical deblocking filters share the difference and
yading@10 17545 flatness values so you cannot set different horizontal and vertical
yading@10 17546 thresholds.
yading@10 17547
yading@10 17548
yading@10 17549 =over 4
yading@10 17550
yading@10 17551
yading@10 17552 =item B<h1/x1hdeblock>
yading@10 17553
yading@10 17554 Experimental horizontal deblocking filter
yading@10 17555
yading@10 17556
yading@10 17557 =item B<v1/x1vdeblock>
yading@10 17558
yading@10 17559 Experimental vertical deblocking filter
yading@10 17560
yading@10 17561
yading@10 17562 =item B<dr/dering>
yading@10 17563
yading@10 17564 Deringing filter
yading@10 17565
yading@10 17566
yading@10 17567 =item B<tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer>
yading@10 17568
yading@10 17569
yading@10 17570 =over 4
yading@10 17571
yading@10 17572
yading@10 17573 =item B<threshold1>
yading@10 17574
yading@10 17575 larger -E<gt> stronger filtering
yading@10 17576
yading@10 17577 =item B<threshold2>
yading@10 17578
yading@10 17579 larger -E<gt> stronger filtering
yading@10 17580
yading@10 17581 =item B<threshold3>
yading@10 17582
yading@10 17583 larger -E<gt> stronger filtering
yading@10 17584
yading@10 17585 =back
yading@10 17586
yading@10 17587
yading@10 17588
yading@10 17589 =item B<al/autolevels[:f/fullyrange], automatic brightness / contrast correction>
yading@10 17590
yading@10 17591
yading@10 17592 =over 4
yading@10 17593
yading@10 17594
yading@10 17595 =item B<f/fullyrange>
yading@10 17596
yading@10 17597 Stretch luminance to C<0-255>.
yading@10 17598
yading@10 17599 =back
yading@10 17600
yading@10 17601
yading@10 17602
yading@10 17603 =item B<lb/linblenddeint>
yading@10 17604
yading@10 17605 Linear blend deinterlacing filter that deinterlaces the given block by
yading@10 17606 filtering all lines with a C<(1 2 1)> filter.
yading@10 17607
yading@10 17608
yading@10 17609 =item B<li/linipoldeint>
yading@10 17610
yading@10 17611 Linear interpolating deinterlacing filter that deinterlaces the given block by
yading@10 17612 linearly interpolating every second line.
yading@10 17613
yading@10 17614
yading@10 17615 =item B<ci/cubicipoldeint>
yading@10 17616
yading@10 17617 Cubic interpolating deinterlacing filter deinterlaces the given block by
yading@10 17618 cubically interpolating every second line.
yading@10 17619
yading@10 17620
yading@10 17621 =item B<md/mediandeint>
yading@10 17622
yading@10 17623 Median deinterlacing filter that deinterlaces the given block by applying a
yading@10 17624 median filter to every second line.
yading@10 17625
yading@10 17626
yading@10 17627 =item B<fd/ffmpegdeint>
yading@10 17628
yading@10 17629 FFmpeg deinterlacing filter that deinterlaces the given block by filtering every
yading@10 17630 second line with a C<(-1 4 2 4 -1)> filter.
yading@10 17631
yading@10 17632
yading@10 17633 =item B<l5/lowpass5>
yading@10 17634
yading@10 17635 Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given
yading@10 17636 block by filtering all lines with a C<(-1 2 6 2 -1)> filter.
yading@10 17637
yading@10 17638
yading@10 17639 =item B<fq/forceQuant[|quantizer]>
yading@10 17640
yading@10 17641 Overrides the quantizer table from the input with the constant quantizer you
yading@10 17642 specify.
yading@10 17643
yading@10 17644 =over 4
yading@10 17645
yading@10 17646
yading@10 17647 =item B<quantizer>
yading@10 17648
yading@10 17649 Quantizer to use
yading@10 17650
yading@10 17651 =back
yading@10 17652
yading@10 17653
yading@10 17654
yading@10 17655 =item B<de/default>
yading@10 17656
yading@10 17657 Default pp filter combination (C<hb|a,vb|a,dr|a>)
yading@10 17658
yading@10 17659
yading@10 17660 =item B<fa/fast>
yading@10 17661
yading@10 17662 Fast pp filter combination (C<h1|a,v1|a,dr|a>)
yading@10 17663
yading@10 17664
yading@10 17665 =item B<ac>
yading@10 17666
yading@10 17667 High quality pp filter combination (C<ha|a|128|7,va|a,dr|a>)
yading@10 17668
yading@10 17669 =back
yading@10 17670
yading@10 17671
yading@10 17672
yading@10 17673 =head3 Examples
yading@10 17674
yading@10 17675
yading@10 17676
yading@10 17677 =over 4
yading@10 17678
yading@10 17679
yading@10 17680 =item *
yading@10 17681
yading@10 17682 Apply horizontal and vertical deblocking, deringing and automatic
yading@10 17683 brightness/contrast:
yading@10 17684
yading@10 17685 pp=hb/vb/dr/al
yading@10 17686
yading@10 17687
yading@10 17688
yading@10 17689 =item *
yading@10 17690
yading@10 17691 Apply default filters without brightness/contrast correction:
yading@10 17692
yading@10 17693 pp=de/-al
yading@10 17694
yading@10 17695
yading@10 17696
yading@10 17697 =item *
yading@10 17698
yading@10 17699 Apply default filters and temporal denoiser:
yading@10 17700
yading@10 17701 pp=default/tmpnoise|1|2|3
yading@10 17702
yading@10 17703
yading@10 17704
yading@10 17705 =item *
yading@10 17706
yading@10 17707 Apply deblocking on luminance only, and switch vertical deblocking on or off
yading@10 17708 automatically depending on available CPU time:
yading@10 17709
yading@10 17710 pp=hb|y/vb|a
yading@10 17711
yading@10 17712
yading@10 17713 =back
yading@10 17714
yading@10 17715
yading@10 17716
yading@10 17717 =head2 removelogo
yading@10 17718
yading@10 17719
yading@10 17720 Suppress a TV station logo, using an image file to determine which
yading@10 17721 pixels comprise the logo. It works by filling in the pixels that
yading@10 17722 comprise the logo with neighboring pixels.
yading@10 17723
yading@10 17724 The filters accept the following options:
yading@10 17725
yading@10 17726
yading@10 17727 =over 4
yading@10 17728
yading@10 17729
yading@10 17730 =item B<filename, f>
yading@10 17731
yading@10 17732 Set the filter bitmap file, which can be any image format supported by
yading@10 17733 libavformat. The width and height of the image file must match those of the
yading@10 17734 video stream being processed.
yading@10 17735
yading@10 17736 =back
yading@10 17737
yading@10 17738
yading@10 17739 Pixels in the provided bitmap image with a value of zero are not
yading@10 17740 considered part of the logo, non-zero pixels are considered part of
yading@10 17741 the logo. If you use white (255) for the logo and black (0) for the
yading@10 17742 rest, you will be safe. For making the filter bitmap, it is
yading@10 17743 recommended to take a screen capture of a black frame with the logo
yading@10 17744 visible, and then using a threshold filter followed by the erode
yading@10 17745 filter once or twice.
yading@10 17746
yading@10 17747 If needed, little splotches can be fixed manually. Remember that if
yading@10 17748 logo pixels are not covered, the filter quality will be much
yading@10 17749 reduced. Marking too many pixels as part of the logo does not hurt as
yading@10 17750 much, but it will increase the amount of blurring needed to cover over
yading@10 17751 the image and will destroy more information than necessary, and extra
yading@10 17752 pixels will slow things down on a large logo.
yading@10 17753
yading@10 17754
yading@10 17755 =head2 scale
yading@10 17756
yading@10 17757
yading@10 17758 Scale (resize) the input video, using the libswscale library.
yading@10 17759
yading@10 17760 The scale filter forces the output display aspect ratio to be the same
yading@10 17761 of the input, by changing the output sample aspect ratio.
yading@10 17762
yading@10 17763 The filter accepts the following options:
yading@10 17764
yading@10 17765
yading@10 17766 =over 4
yading@10 17767
yading@10 17768
yading@10 17769 =item B<width, w>
yading@10 17770
yading@10 17771 Output video width.
yading@10 17772 default value is C<iw>. See below
yading@10 17773 for the list of accepted constants.
yading@10 17774
yading@10 17775
yading@10 17776 =item B<height, h>
yading@10 17777
yading@10 17778 Output video height.
yading@10 17779 default value is C<ih>.
yading@10 17780 See below for the list of accepted constants.
yading@10 17781
yading@10 17782
yading@10 17783 =item B<interl>
yading@10 17784
yading@10 17785 Set the interlacing. It accepts the following values:
yading@10 17786
yading@10 17787
yading@10 17788 =over 4
yading@10 17789
yading@10 17790
yading@10 17791 =item B<1>
yading@10 17792
yading@10 17793 force interlaced aware scaling
yading@10 17794
yading@10 17795
yading@10 17796 =item B<0>
yading@10 17797
yading@10 17798 do not apply interlaced scaling
yading@10 17799
yading@10 17800
yading@10 17801 =item B<-1>
yading@10 17802
yading@10 17803 select interlaced aware scaling depending on whether the source frames
yading@10 17804 are flagged as interlaced or not
yading@10 17805
yading@10 17806 =back
yading@10 17807
yading@10 17808
yading@10 17809 Default value is C<0>.
yading@10 17810
yading@10 17811
yading@10 17812 =item B<flags>
yading@10 17813
yading@10 17814 Set libswscale scaling flags. If not explictly specified the filter
yading@10 17815 applies a bilinear scaling algorithm.
yading@10 17816
yading@10 17817
yading@10 17818 =item B<size, s>
yading@10 17819
yading@10 17820 Set the video size, the value must be a valid abbreviation or in the
yading@10 17821 form I<width>xI<height>.
yading@10 17822
yading@10 17823 =back
yading@10 17824
yading@10 17825
yading@10 17826 The values of the I<w> and I<h> options are expressions
yading@10 17827 containing the following constants:
yading@10 17828
yading@10 17829
yading@10 17830 =over 4
yading@10 17831
yading@10 17832
yading@10 17833 =item B<in_w, in_h>
yading@10 17834
yading@10 17835 the input width and height
yading@10 17836
yading@10 17837
yading@10 17838 =item B<iw, ih>
yading@10 17839
yading@10 17840 same as I<in_w> and I<in_h>
yading@10 17841
yading@10 17842
yading@10 17843 =item B<out_w, out_h>
yading@10 17844
yading@10 17845 the output (cropped) width and height
yading@10 17846
yading@10 17847
yading@10 17848 =item B<ow, oh>
yading@10 17849
yading@10 17850 same as I<out_w> and I<out_h>
yading@10 17851
yading@10 17852
yading@10 17853 =item B<a>
yading@10 17854
yading@10 17855 same as I<iw> / I<ih>
yading@10 17856
yading@10 17857
yading@10 17858 =item B<sar>
yading@10 17859
yading@10 17860 input sample aspect ratio
yading@10 17861
yading@10 17862
yading@10 17863 =item B<dar>
yading@10 17864
yading@10 17865 input display aspect ratio, it is the same as (I<iw> / I<ih>) * I<sar>
yading@10 17866
yading@10 17867
yading@10 17868 =item B<hsub, vsub>
yading@10 17869
yading@10 17870 horizontal and vertical chroma subsample values. For example for the
yading@10 17871 pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1.
yading@10 17872
yading@10 17873 =back
yading@10 17874
yading@10 17875
yading@10 17876 If the input image format is different from the format requested by
yading@10 17877 the next filter, the scale filter will convert the input to the
yading@10 17878 requested format.
yading@10 17879
yading@10 17880 If the value for I<w> or I<h> is 0, the respective input
yading@10 17881 size is used for the output.
yading@10 17882
yading@10 17883 If the value for I<w> or I<h> is -1, the scale filter will use, for the
yading@10 17884 respective output size, a value that maintains the aspect ratio of the input
yading@10 17885 image.
yading@10 17886
yading@10 17887
yading@10 17888 =head3 Examples
yading@10 17889
yading@10 17890
yading@10 17891
yading@10 17892 =over 4
yading@10 17893
yading@10 17894
yading@10 17895 =item *
yading@10 17896
yading@10 17897 Scale the input video to a size of 200x100:
yading@10 17898
yading@10 17899 scale=w=200:h=100
yading@10 17900
yading@10 17901
yading@10 17902 This is equivalent to:
yading@10 17903
yading@10 17904 scale=w=200:h=100
yading@10 17905
yading@10 17906
yading@10 17907 or:
yading@10 17908
yading@10 17909 scale=200x100
yading@10 17910
yading@10 17911
yading@10 17912
yading@10 17913 =item *
yading@10 17914
yading@10 17915 Specify a size abbreviation for the output size:
yading@10 17916
yading@10 17917 scale=qcif
yading@10 17918
yading@10 17919
yading@10 17920 which can also be written as:
yading@10 17921
yading@10 17922 scale=size=qcif
yading@10 17923
yading@10 17924
yading@10 17925
yading@10 17926 =item *
yading@10 17927
yading@10 17928 Scale the input to 2x:
yading@10 17929
yading@10 17930 scale=w=2*iw:h=2*ih
yading@10 17931
yading@10 17932
yading@10 17933
yading@10 17934 =item *
yading@10 17935
yading@10 17936 The above is the same as:
yading@10 17937
yading@10 17938 scale=2*in_w:2*in_h
yading@10 17939
yading@10 17940
yading@10 17941
yading@10 17942 =item *
yading@10 17943
yading@10 17944 Scale the input to 2x with forced interlaced scaling:
yading@10 17945
yading@10 17946 scale=2*iw:2*ih:interl=1
yading@10 17947
yading@10 17948
yading@10 17949
yading@10 17950 =item *
yading@10 17951
yading@10 17952 Scale the input to half size:
yading@10 17953
yading@10 17954 scale=w=iw/2:h=ih/2
yading@10 17955
yading@10 17956
yading@10 17957
yading@10 17958 =item *
yading@10 17959
yading@10 17960 Increase the width, and set the height to the same size:
yading@10 17961
yading@10 17962 scale=3/2*iw:ow
yading@10 17963
yading@10 17964
yading@10 17965
yading@10 17966 =item *
yading@10 17967
yading@10 17968 Seek for Greek harmony:
yading@10 17969
yading@10 17970 scale=iw:1/PHI*iw
yading@10 17971 scale=ih*PHI:ih
yading@10 17972
yading@10 17973
yading@10 17974
yading@10 17975 =item *
yading@10 17976
yading@10 17977 Increase the height, and set the width to 3/2 of the height:
yading@10 17978
yading@10 17979 scale=w=3/2*oh:h=3/5*ih
yading@10 17980
yading@10 17981
yading@10 17982
yading@10 17983 =item *
yading@10 17984
yading@10 17985 Increase the size, but make the size a multiple of the chroma
yading@10 17986 subsample values:
yading@10 17987
yading@10 17988 scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
yading@10 17989
yading@10 17990
yading@10 17991
yading@10 17992 =item *
yading@10 17993
yading@10 17994 Increase the width to a maximum of 500 pixels, keep the same input
yading@10 17995 aspect ratio:
yading@10 17996
yading@10 17997 scale=w='min(500\, iw*3/2):h=-1'
yading@10 17998
yading@10 17999
yading@10 18000 =back
yading@10 18001
yading@10 18002
yading@10 18003
yading@10 18004 =head2 separatefields
yading@10 18005
yading@10 18006
yading@10 18007 The C<separatefields> takes a frame-based video input and splits
yading@10 18008 each frame into its components fields, producing a new half height clip
yading@10 18009 with twice the frame rate and twice the frame count.
yading@10 18010
yading@10 18011 This filter use field-dominance information in frame to decide which
yading@10 18012 of each pair of fields to place first in the output.
yading@10 18013 If it gets it wrong use setfield filter before C<separatefields> filter.
yading@10 18014
yading@10 18015
yading@10 18016 =head2 setdar, setsar
yading@10 18017
yading@10 18018
yading@10 18019 The C<setdar> filter sets the Display Aspect Ratio for the filter
yading@10 18020 output video.
yading@10 18021
yading@10 18022 This is done by changing the specified Sample (aka Pixel) Aspect
yading@10 18023 Ratio, according to the following equation:
yading@10 18024
yading@10 18025 <DAR> = <HORIZONTAL_RESOLUTION> / <VERTICAL_RESOLUTION> * <SAR>
yading@10 18026
yading@10 18027
yading@10 18028 Keep in mind that the C<setdar> filter does not modify the pixel
yading@10 18029 dimensions of the video frame. Also the display aspect ratio set by
yading@10 18030 this filter may be changed by later filters in the filterchain,
yading@10 18031 e.g. in case of scaling or if another "setdar" or a "setsar" filter is
yading@10 18032 applied.
yading@10 18033
yading@10 18034 The C<setsar> filter sets the Sample (aka Pixel) Aspect Ratio for
yading@10 18035 the filter output video.
yading@10 18036
yading@10 18037 Note that as a consequence of the application of this filter, the
yading@10 18038 output display aspect ratio will change according to the equation
yading@10 18039 above.
yading@10 18040
yading@10 18041 Keep in mind that the sample aspect ratio set by the C<setsar>
yading@10 18042 filter may be changed by later filters in the filterchain, e.g. if
yading@10 18043 another "setsar" or a "setdar" filter is applied.
yading@10 18044
yading@10 18045 The filters accept the following options:
yading@10 18046
yading@10 18047
yading@10 18048 =over 4
yading@10 18049
yading@10 18050
yading@10 18051 =item B<r, ratio, dar (C<setdar> only), sar (C<setsar> only)>
yading@10 18052
yading@10 18053 Set the aspect ratio used by the filter.
yading@10 18054
yading@10 18055 The parameter can be a floating point number string, an expression, or
yading@10 18056 a string of the form I<num>:I<den>, where I<num> and
yading@10 18057 I<den> are the numerator and denominator of the aspect ratio. If
yading@10 18058 the parameter is not specified, it is assumed the value "0".
yading@10 18059 In case the form "I<num>:I<den>" is used, the C<:> character
yading@10 18060 should be escaped.
yading@10 18061
yading@10 18062
yading@10 18063 =item B<max>
yading@10 18064
yading@10 18065 Set the maximum integer value to use for expressing numerator and
yading@10 18066 denominator when reducing the expressed aspect ratio to a rational.
yading@10 18067 Default value is C<100>.
yading@10 18068
yading@10 18069
yading@10 18070 =back
yading@10 18071
yading@10 18072
yading@10 18073
yading@10 18074 =head3 Examples
yading@10 18075
yading@10 18076
yading@10 18077
yading@10 18078 =over 4
yading@10 18079
yading@10 18080
yading@10 18081
yading@10 18082 =item *
yading@10 18083
yading@10 18084 To change the display aspect ratio to 16:9, specify one of the following:
yading@10 18085
yading@10 18086 setdar=dar=1.77777
yading@10 18087 setdar=dar=16/9
yading@10 18088 setdar=dar=1.77777
yading@10 18089
yading@10 18090
yading@10 18091
yading@10 18092 =item *
yading@10 18093
yading@10 18094 To change the sample aspect ratio to 10:11, specify:
yading@10 18095
yading@10 18096 setsar=sar=10/11
yading@10 18097
yading@10 18098
yading@10 18099
yading@10 18100 =item *
yading@10 18101
yading@10 18102 To set a display aspect ratio of 16:9, and specify a maximum integer value of
yading@10 18103 1000 in the aspect ratio reduction, use the command:
yading@10 18104
yading@10 18105 setdar=ratio=16/9:max=1000
yading@10 18106
yading@10 18107
yading@10 18108
yading@10 18109 =back
yading@10 18110
yading@10 18111
yading@10 18112
yading@10 18113
yading@10 18114 =head2 setfield
yading@10 18115
yading@10 18116
yading@10 18117 Force field for the output video frame.
yading@10 18118
yading@10 18119 The C<setfield> filter marks the interlace type field for the
yading@10 18120 output frames. It does not change the input frame, but only sets the
yading@10 18121 corresponding property, which affects how the frame is treated by
yading@10 18122 following filters (e.g. C<fieldorder> or C<yadif>).
yading@10 18123
yading@10 18124 The filter accepts the following options:
yading@10 18125
yading@10 18126
yading@10 18127 =over 4
yading@10 18128
yading@10 18129
yading@10 18130
yading@10 18131 =item B<mode>
yading@10 18132
yading@10 18133 Available values are:
yading@10 18134
yading@10 18135
yading@10 18136 =over 4
yading@10 18137
yading@10 18138
yading@10 18139 =item B<auto>
yading@10 18140
yading@10 18141 Keep the same field property.
yading@10 18142
yading@10 18143
yading@10 18144 =item B<bff>
yading@10 18145
yading@10 18146 Mark the frame as bottom-field-first.
yading@10 18147
yading@10 18148
yading@10 18149 =item B<tff>
yading@10 18150
yading@10 18151 Mark the frame as top-field-first.
yading@10 18152
yading@10 18153
yading@10 18154 =item B<prog>
yading@10 18155
yading@10 18156 Mark the frame as progressive.
yading@10 18157
yading@10 18158 =back
yading@10 18159
yading@10 18160
yading@10 18161 =back
yading@10 18162
yading@10 18163
yading@10 18164
yading@10 18165 =head2 showinfo
yading@10 18166
yading@10 18167
yading@10 18168 Show a line containing various information for each input video frame.
yading@10 18169 The input video is not modified.
yading@10 18170
yading@10 18171 The shown line contains a sequence of key/value pairs of the form
yading@10 18172 I<key>:I<value>.
yading@10 18173
yading@10 18174 A description of each shown parameter follows:
yading@10 18175
yading@10 18176
yading@10 18177 =over 4
yading@10 18178
yading@10 18179
yading@10 18180 =item B<n>
yading@10 18181
yading@10 18182 sequential number of the input frame, starting from 0
yading@10 18183
yading@10 18184
yading@10 18185 =item B<pts>
yading@10 18186
yading@10 18187 Presentation TimeStamp of the input frame, expressed as a number of
yading@10 18188 time base units. The time base unit depends on the filter input pad.
yading@10 18189
yading@10 18190
yading@10 18191 =item B<pts_time>
yading@10 18192
yading@10 18193 Presentation TimeStamp of the input frame, expressed as a number of
yading@10 18194 seconds
yading@10 18195
yading@10 18196
yading@10 18197 =item B<pos>
yading@10 18198
yading@10 18199 position of the frame in the input stream, -1 if this information in
yading@10 18200 unavailable and/or meaningless (for example in case of synthetic video)
yading@10 18201
yading@10 18202
yading@10 18203 =item B<fmt>
yading@10 18204
yading@10 18205 pixel format name
yading@10 18206
yading@10 18207
yading@10 18208 =item B<sar>
yading@10 18209
yading@10 18210 sample aspect ratio of the input frame, expressed in the form
yading@10 18211 I<num>/I<den>
yading@10 18212
yading@10 18213
yading@10 18214 =item B<s>
yading@10 18215
yading@10 18216 size of the input frame, expressed in the form
yading@10 18217 I<width>xI<height>
yading@10 18218
yading@10 18219
yading@10 18220 =item B<i>
yading@10 18221
yading@10 18222 interlaced mode ("P" for "progressive", "T" for top field first, "B"
yading@10 18223 for bottom field first)
yading@10 18224
yading@10 18225
yading@10 18226 =item B<iskey>
yading@10 18227
yading@10 18228 1 if the frame is a key frame, 0 otherwise
yading@10 18229
yading@10 18230
yading@10 18231 =item B<type>
yading@10 18232
yading@10 18233 picture type of the input frame ("I" for an I-frame, "P" for a
yading@10 18234 P-frame, "B" for a B-frame, "?" for unknown type).
yading@10 18235 Check also the documentation of the C<AVPictureType> enum and of
yading@10 18236 the C<av_get_picture_type_char> function defined in
yading@10 18237 F<libavutil/avutil.h>.
yading@10 18238
yading@10 18239
yading@10 18240 =item B<checksum>
yading@10 18241
yading@10 18242 Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame
yading@10 18243
yading@10 18244
yading@10 18245 =item B<plane_checksum>
yading@10 18246
yading@10 18247 Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
yading@10 18248 expressed in the form "[I<c0> I<c1> I<c2> I<c3>]"
yading@10 18249
yading@10 18250 =back
yading@10 18251
yading@10 18252
yading@10 18253
yading@10 18254 =head2 smartblur
yading@10 18255
yading@10 18256
yading@10 18257 Blur the input video without impacting the outlines.
yading@10 18258
yading@10 18259 The filter accepts the following options:
yading@10 18260
yading@10 18261
yading@10 18262 =over 4
yading@10 18263
yading@10 18264
yading@10 18265 =item B<luma_radius, lr>
yading@10 18266
yading@10 18267 Set the luma radius. The option value must be a float number in
yading@10 18268 the range [0.1,5.0] that specifies the variance of the gaussian filter
yading@10 18269 used to blur the image (slower if larger). Default value is 1.0.
yading@10 18270
yading@10 18271
yading@10 18272 =item B<luma_strength, ls>
yading@10 18273
yading@10 18274 Set the luma strength. The option value must be a float number
yading@10 18275 in the range [-1.0,1.0] that configures the blurring. A value included
yading@10 18276 in [0.0,1.0] will blur the image whereas a value included in
yading@10 18277 [-1.0,0.0] will sharpen the image. Default value is 1.0.
yading@10 18278
yading@10 18279
yading@10 18280 =item B<luma_threshold, lt>
yading@10 18281
yading@10 18282 Set the luma threshold used as a coefficient to determine
yading@10 18283 whether a pixel should be blurred or not. The option value must be an
yading@10 18284 integer in the range [-30,30]. A value of 0 will filter all the image,
yading@10 18285 a value included in [0,30] will filter flat areas and a value included
yading@10 18286 in [-30,0] will filter edges. Default value is 0.
yading@10 18287
yading@10 18288
yading@10 18289 =item B<chroma_radius, cr>
yading@10 18290
yading@10 18291 Set the chroma radius. The option value must be a float number in
yading@10 18292 the range [0.1,5.0] that specifies the variance of the gaussian filter
yading@10 18293 used to blur the image (slower if larger). Default value is 1.0.
yading@10 18294
yading@10 18295
yading@10 18296 =item B<chroma_strength, cs>
yading@10 18297
yading@10 18298 Set the chroma strength. The option value must be a float number
yading@10 18299 in the range [-1.0,1.0] that configures the blurring. A value included
yading@10 18300 in [0.0,1.0] will blur the image whereas a value included in
yading@10 18301 [-1.0,0.0] will sharpen the image. Default value is 1.0.
yading@10 18302
yading@10 18303
yading@10 18304 =item B<chroma_threshold, ct>
yading@10 18305
yading@10 18306 Set the chroma threshold used as a coefficient to determine
yading@10 18307 whether a pixel should be blurred or not. The option value must be an
yading@10 18308 integer in the range [-30,30]. A value of 0 will filter all the image,
yading@10 18309 a value included in [0,30] will filter flat areas and a value included
yading@10 18310 in [-30,0] will filter edges. Default value is 0.
yading@10 18311
yading@10 18312 =back
yading@10 18313
yading@10 18314
yading@10 18315 If a chroma option is not explicitly set, the corresponding luma value
yading@10 18316 is set.
yading@10 18317
yading@10 18318
yading@10 18319 =head2 stereo3d
yading@10 18320
yading@10 18321
yading@10 18322 Convert between different stereoscopic image formats.
yading@10 18323
yading@10 18324 The filters accept the following options:
yading@10 18325
yading@10 18326
yading@10 18327 =over 4
yading@10 18328
yading@10 18329
yading@10 18330 =item B<in>
yading@10 18331
yading@10 18332 Set stereoscopic image format of input.
yading@10 18333
yading@10 18334 Available values for input image formats are:
yading@10 18335
yading@10 18336 =over 4
yading@10 18337
yading@10 18338
yading@10 18339 =item B<sbsl>
yading@10 18340
yading@10 18341 side by side parallel (left eye left, right eye right)
yading@10 18342
yading@10 18343
yading@10 18344 =item B<sbsr>
yading@10 18345
yading@10 18346 side by side crosseye (right eye left, left eye right)
yading@10 18347
yading@10 18348
yading@10 18349 =item B<sbs2l>
yading@10 18350
yading@10 18351 side by side parallel with half width resolution
yading@10 18352 (left eye left, right eye right)
yading@10 18353
yading@10 18354
yading@10 18355 =item B<sbs2r>
yading@10 18356
yading@10 18357 side by side crosseye with half width resolution
yading@10 18358 (right eye left, left eye right)
yading@10 18359
yading@10 18360
yading@10 18361 =item B<abl>
yading@10 18362
yading@10 18363 above-below (left eye above, right eye below)
yading@10 18364
yading@10 18365
yading@10 18366 =item B<abr>
yading@10 18367
yading@10 18368 above-below (right eye above, left eye below)
yading@10 18369
yading@10 18370
yading@10 18371 =item B<ab2l>
yading@10 18372
yading@10 18373 above-below with half height resolution
yading@10 18374 (left eye above, right eye below)
yading@10 18375
yading@10 18376
yading@10 18377 =item B<ab2r>
yading@10 18378
yading@10 18379 above-below with half height resolution
yading@10 18380 (right eye above, left eye below)
yading@10 18381
yading@10 18382 Default value is B<sbsl>.
yading@10 18383
yading@10 18384 =back
yading@10 18385
yading@10 18386
yading@10 18387
yading@10 18388 =item B<out>
yading@10 18389
yading@10 18390 Set stereoscopic image format of output.
yading@10 18391
yading@10 18392 Available values for output image formats are all the input formats as well as:
yading@10 18393
yading@10 18394 =over 4
yading@10 18395
yading@10 18396
yading@10 18397 =item B<arbg>
yading@10 18398
yading@10 18399 anaglyph red/blue gray
yading@10 18400 (red filter on left eye, blue filter on right eye)
yading@10 18401
yading@10 18402
yading@10 18403 =item B<argg>
yading@10 18404
yading@10 18405 anaglyph red/green gray
yading@10 18406 (red filter on left eye, green filter on right eye)
yading@10 18407
yading@10 18408
yading@10 18409 =item B<arcg>
yading@10 18410
yading@10 18411 anaglyph red/cyan gray
yading@10 18412 (red filter on left eye, cyan filter on right eye)
yading@10 18413
yading@10 18414
yading@10 18415 =item B<arch>
yading@10 18416
yading@10 18417 anaglyph red/cyan half colored
yading@10 18418 (red filter on left eye, cyan filter on right eye)
yading@10 18419
yading@10 18420
yading@10 18421 =item B<arcc>
yading@10 18422
yading@10 18423 anaglyph red/cyan color
yading@10 18424 (red filter on left eye, cyan filter on right eye)
yading@10 18425
yading@10 18426
yading@10 18427 =item B<arcd>
yading@10 18428
yading@10 18429 anaglyph red/cyan color optimized with the least squares projection of dubois
yading@10 18430 (red filter on left eye, cyan filter on right eye)
yading@10 18431
yading@10 18432
yading@10 18433 =item B<agmg>
yading@10 18434
yading@10 18435 anaglyph green/magenta gray
yading@10 18436 (green filter on left eye, magenta filter on right eye)
yading@10 18437
yading@10 18438
yading@10 18439 =item B<agmh>
yading@10 18440
yading@10 18441 anaglyph green/magenta half colored
yading@10 18442 (green filter on left eye, magenta filter on right eye)
yading@10 18443
yading@10 18444
yading@10 18445 =item B<agmc>
yading@10 18446
yading@10 18447 anaglyph green/magenta colored
yading@10 18448 (green filter on left eye, magenta filter on right eye)
yading@10 18449
yading@10 18450
yading@10 18451 =item B<agmd>
yading@10 18452
yading@10 18453 anaglyph green/magenta color optimized with the least squares projection of dubois
yading@10 18454 (green filter on left eye, magenta filter on right eye)
yading@10 18455
yading@10 18456
yading@10 18457 =item B<aybg>
yading@10 18458
yading@10 18459 anaglyph yellow/blue gray
yading@10 18460 (yellow filter on left eye, blue filter on right eye)
yading@10 18461
yading@10 18462
yading@10 18463 =item B<aybh>
yading@10 18464
yading@10 18465 anaglyph yellow/blue half colored
yading@10 18466 (yellow filter on left eye, blue filter on right eye)
yading@10 18467
yading@10 18468
yading@10 18469 =item B<aybc>
yading@10 18470
yading@10 18471 anaglyph yellow/blue colored
yading@10 18472 (yellow filter on left eye, blue filter on right eye)
yading@10 18473
yading@10 18474
yading@10 18475 =item B<aybd>
yading@10 18476
yading@10 18477 anaglyph yellow/blue color optimized with the least squares projection of dubois
yading@10 18478 (yellow filter on left eye, blue filter on right eye)
yading@10 18479
yading@10 18480
yading@10 18481 =item B<irl>
yading@10 18482
yading@10 18483 interleaved rows (left eye has top row, right eye starts on next row)
yading@10 18484
yading@10 18485
yading@10 18486 =item B<irr>
yading@10 18487
yading@10 18488 interleaved rows (right eye has top row, left eye starts on next row)
yading@10 18489
yading@10 18490
yading@10 18491 =item B<ml>
yading@10 18492
yading@10 18493 mono output (left eye only)
yading@10 18494
yading@10 18495
yading@10 18496 =item B<mr>
yading@10 18497
yading@10 18498 mono output (right eye only)
yading@10 18499
yading@10 18500 =back
yading@10 18501
yading@10 18502
yading@10 18503 Default value is B<arcd>.
yading@10 18504
yading@10 18505 =back
yading@10 18506
yading@10 18507
yading@10 18508
yading@10 18509
yading@10 18510 =head2 subtitles
yading@10 18511
yading@10 18512
yading@10 18513 Draw subtitles on top of input video using the libass library.
yading@10 18514
yading@10 18515 To enable compilation of this filter you need to configure FFmpeg with
yading@10 18516 C<--enable-libass>. This filter also requires a build with libavcodec and
yading@10 18517 libavformat to convert the passed subtitles file to ASS (Advanced Substation
yading@10 18518 Alpha) subtitles format.
yading@10 18519
yading@10 18520 The filter accepts the following options:
yading@10 18521
yading@10 18522
yading@10 18523 =over 4
yading@10 18524
yading@10 18525
yading@10 18526 =item B<filename, f>
yading@10 18527
yading@10 18528 Set the filename of the subtitle file to read. It must be specified.
yading@10 18529
yading@10 18530
yading@10 18531 =item B<original_size>
yading@10 18532
yading@10 18533 Specify the size of the original video, the video for which the ASS file
yading@10 18534 was composed. Due to a misdesign in ASS aspect ratio arithmetic, this is
yading@10 18535 necessary to correctly scale the fonts if the aspect ratio has been changed.
yading@10 18536
yading@10 18537
yading@10 18538 =item B<charenc>
yading@10 18539
yading@10 18540 Set subtitles input character encoding. C<subtitles> filter only. Only
yading@10 18541 useful if not UTF-8.
yading@10 18542
yading@10 18543 =back
yading@10 18544
yading@10 18545
yading@10 18546 If the first key is not specified, it is assumed that the first value
yading@10 18547 specifies the B<filename>.
yading@10 18548
yading@10 18549 For example, to render the file F<sub.srt> on top of the input
yading@10 18550 video, use the command:
yading@10 18551
yading@10 18552 subtitles=sub.srt
yading@10 18553
yading@10 18554
yading@10 18555 which is equivalent to:
yading@10 18556
yading@10 18557 subtitles=filename=sub.srt
yading@10 18558
yading@10 18559
yading@10 18560
yading@10 18561 =head2 super2xsai
yading@10 18562
yading@10 18563
yading@10 18564 Scale the input by 2x and smooth using the Super2xSaI (Scale and
yading@10 18565 Interpolate) pixel art scaling algorithm.
yading@10 18566
yading@10 18567 Useful for enlarging pixel art images without reducing sharpness.
yading@10 18568
yading@10 18569
yading@10 18570 =head2 swapuv
yading@10 18571
yading@10 18572 Swap U & V plane.
yading@10 18573
yading@10 18574
yading@10 18575 =head2 telecine
yading@10 18576
yading@10 18577
yading@10 18578 Apply telecine process to the video.
yading@10 18579
yading@10 18580 This filter accepts the following options:
yading@10 18581
yading@10 18582
yading@10 18583 =over 4
yading@10 18584
yading@10 18585
yading@10 18586 =item B<first_field>
yading@10 18587
yading@10 18588
yading@10 18589 =over 4
yading@10 18590
yading@10 18591
yading@10 18592 =item B<top, t>
yading@10 18593
yading@10 18594 top field first
yading@10 18595
yading@10 18596 =item B<bottom, b>
yading@10 18597
yading@10 18598 bottom field first
yading@10 18599 The default value is C<top>.
yading@10 18600
yading@10 18601 =back
yading@10 18602
yading@10 18603
yading@10 18604
yading@10 18605 =item B<pattern>
yading@10 18606
yading@10 18607 A string of numbers representing the pulldown pattern you wish to apply.
yading@10 18608 The default value is C<23>.
yading@10 18609
yading@10 18610 =back
yading@10 18611
yading@10 18612
yading@10 18613
yading@10 18614 Some typical patterns:
yading@10 18615
yading@10 18616 NTSC output (30i):
yading@10 18617 27.5p: 32222
yading@10 18618 24p: 23 (classic)
yading@10 18619 24p: 2332 (preferred)
yading@10 18620 20p: 33
yading@10 18621 18p: 334
yading@10 18622 16p: 3444
yading@10 18623
yading@10 18624 PAL output (25i):
yading@10 18625 27.5p: 12222
yading@10 18626 24p: 222222222223 ("Euro pulldown")
yading@10 18627 16.67p: 33
yading@10 18628 16p: 33333334
yading@10 18629
yading@10 18630
yading@10 18631
yading@10 18632 =head2 thumbnail
yading@10 18633
yading@10 18634 Select the most representative frame in a given sequence of consecutive frames.
yading@10 18635
yading@10 18636 The filter accepts the following options:
yading@10 18637
yading@10 18638
yading@10 18639 =over 4
yading@10 18640
yading@10 18641
yading@10 18642 =item B<n>
yading@10 18643
yading@10 18644 Set the frames batch size to analyze; in a set of I<n> frames, the filter
yading@10 18645 will pick one of them, and then handle the next batch of I<n> frames until
yading@10 18646 the end. Default is C<100>.
yading@10 18647
yading@10 18648 =back
yading@10 18649
yading@10 18650
yading@10 18651 Since the filter keeps track of the whole frames sequence, a bigger I<n>
yading@10 18652 value will result in a higher memory usage, so a high value is not recommended.
yading@10 18653
yading@10 18654
yading@10 18655 =head3 Examples
yading@10 18656
yading@10 18657
yading@10 18658
yading@10 18659 =over 4
yading@10 18660
yading@10 18661
yading@10 18662 =item *
yading@10 18663
yading@10 18664 Extract one picture each 50 frames:
yading@10 18665
yading@10 18666 thumbnail=50
yading@10 18667
yading@10 18668
yading@10 18669
yading@10 18670 =item *
yading@10 18671
yading@10 18672 Complete example of a thumbnail creation with B<ffmpeg>:
yading@10 18673
yading@10 18674 ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
yading@10 18675
yading@10 18676
yading@10 18677 =back
yading@10 18678
yading@10 18679
yading@10 18680
yading@10 18681 =head2 tile
yading@10 18682
yading@10 18683
yading@10 18684 Tile several successive frames together.
yading@10 18685
yading@10 18686 The filter accepts the following options:
yading@10 18687
yading@10 18688
yading@10 18689 =over 4
yading@10 18690
yading@10 18691
yading@10 18692
yading@10 18693 =item B<layout>
yading@10 18694
yading@10 18695 Set the grid size (i.e. the number of lines and columns) in the form
yading@10 18696 "I<w>xI<h>".
yading@10 18697
yading@10 18698
yading@10 18699 =item B<nb_frames>
yading@10 18700
yading@10 18701 Set the maximum number of frames to render in the given area. It must be less
yading@10 18702 than or equal to I<w>xI<h>. The default value is C<0>, meaning all
yading@10 18703 the area will be used.
yading@10 18704
yading@10 18705
yading@10 18706 =item B<margin>
yading@10 18707
yading@10 18708 Set the outer border margin in pixels.
yading@10 18709
yading@10 18710
yading@10 18711 =item B<padding>
yading@10 18712
yading@10 18713 Set the inner border thickness (i.e. the number of pixels between frames). For
yading@10 18714 more advanced padding options (such as having different values for the edges),
yading@10 18715 refer to the pad video filter.
yading@10 18716
yading@10 18717
yading@10 18718 =back
yading@10 18719
yading@10 18720
yading@10 18721
yading@10 18722 =head3 Examples
yading@10 18723
yading@10 18724
yading@10 18725
yading@10 18726 =over 4
yading@10 18727
yading@10 18728
yading@10 18729 =item *
yading@10 18730
yading@10 18731 Produce 8x8 PNG tiles of all keyframes (B<-skip_frame nokey>) in a movie:
yading@10 18732
yading@10 18733 ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
yading@10 18734
yading@10 18735 The B<-vsync 0> is necessary to prevent B<ffmpeg> from
yading@10 18736 duplicating each output frame to accomodate the originally detected frame
yading@10 18737 rate.
yading@10 18738
yading@10 18739
yading@10 18740 =item *
yading@10 18741
yading@10 18742 Display C<5> pictures in an area of C<3x2> frames,
yading@10 18743 with C<7> pixels between them, and C<2> pixels of initial margin, using
yading@10 18744 mixed flat and named options:
yading@10 18745
yading@10 18746 tile=3x2:nb_frames=5:padding=7:margin=2
yading@10 18747
yading@10 18748
yading@10 18749 =back
yading@10 18750
yading@10 18751
yading@10 18752
yading@10 18753 =head2 tinterlace
yading@10 18754
yading@10 18755
yading@10 18756 Perform various types of temporal field interlacing.
yading@10 18757
yading@10 18758 Frames are counted starting from 1, so the first input frame is
yading@10 18759 considered odd.
yading@10 18760
yading@10 18761 The filter accepts the following options:
yading@10 18762
yading@10 18763
yading@10 18764 =over 4
yading@10 18765
yading@10 18766
yading@10 18767
yading@10 18768 =item B<mode>
yading@10 18769
yading@10 18770 Specify the mode of the interlacing. This option can also be specified
yading@10 18771 as a value alone. See below for a list of values for this option.
yading@10 18772
yading@10 18773 Available values are:
yading@10 18774
yading@10 18775
yading@10 18776 =over 4
yading@10 18777
yading@10 18778
yading@10 18779 =item B<merge, 0>
yading@10 18780
yading@10 18781 Move odd frames into the upper field, even into the lower field,
yading@10 18782 generating a double height frame at half frame rate.
yading@10 18783
yading@10 18784
yading@10 18785 =item B<drop_odd, 1>
yading@10 18786
yading@10 18787 Only output even frames, odd frames are dropped, generating a frame with
yading@10 18788 unchanged height at half frame rate.
yading@10 18789
yading@10 18790
yading@10 18791 =item B<drop_even, 2>
yading@10 18792
yading@10 18793 Only output odd frames, even frames are dropped, generating a frame with
yading@10 18794 unchanged height at half frame rate.
yading@10 18795
yading@10 18796
yading@10 18797 =item B<pad, 3>
yading@10 18798
yading@10 18799 Expand each frame to full height, but pad alternate lines with black,
yading@10 18800 generating a frame with double height at the same input frame rate.
yading@10 18801
yading@10 18802
yading@10 18803 =item B<interleave_top, 4>
yading@10 18804
yading@10 18805 Interleave the upper field from odd frames with the lower field from
yading@10 18806 even frames, generating a frame with unchanged height at half frame rate.
yading@10 18807
yading@10 18808
yading@10 18809 =item B<interleave_bottom, 5>
yading@10 18810
yading@10 18811 Interleave the lower field from odd frames with the upper field from
yading@10 18812 even frames, generating a frame with unchanged height at half frame rate.
yading@10 18813
yading@10 18814
yading@10 18815 =item B<interlacex2, 6>
yading@10 18816
yading@10 18817 Double frame rate with unchanged height. Frames are inserted each
yading@10 18818 containing the second temporal field from the previous input frame and
yading@10 18819 the first temporal field from the next input frame. This mode relies on
yading@10 18820 the top_field_first flag. Useful for interlaced video displays with no
yading@10 18821 field synchronisation.
yading@10 18822
yading@10 18823 =back
yading@10 18824
yading@10 18825
yading@10 18826 Numeric values are deprecated but are accepted for backward
yading@10 18827 compatibility reasons.
yading@10 18828
yading@10 18829 Default mode is C<merge>.
yading@10 18830
yading@10 18831
yading@10 18832 =item B<flags>
yading@10 18833
yading@10 18834 Specify flags influencing the filter process.
yading@10 18835
yading@10 18836 Available value for I<flags> is:
yading@10 18837
yading@10 18838
yading@10 18839 =over 4
yading@10 18840
yading@10 18841
yading@10 18842 =item B<low_pass_filter, vlfp>
yading@10 18843
yading@10 18844 Enable vertical low-pass filtering in the filter.
yading@10 18845 Vertical low-pass filtering is required when creating an interlaced
yading@10 18846 destination from a progressive source which contains high-frequency
yading@10 18847 vertical detail. Filtering will reduce interlace 'twitter' and Moire
yading@10 18848 patterning.
yading@10 18849
yading@10 18850 Vertical low-pass filtering can only be enabled for B<mode>
yading@10 18851 I<interleave_top> and I<interleave_bottom>.
yading@10 18852
yading@10 18853
yading@10 18854 =back
yading@10 18855
yading@10 18856
yading@10 18857 =back
yading@10 18858
yading@10 18859
yading@10 18860
yading@10 18861 =head2 transpose
yading@10 18862
yading@10 18863
yading@10 18864 Transpose rows with columns in the input video and optionally flip it.
yading@10 18865
yading@10 18866 This filter accepts the following options:
yading@10 18867
yading@10 18868
yading@10 18869 =over 4
yading@10 18870
yading@10 18871
yading@10 18872
yading@10 18873 =item B<dir>
yading@10 18874
yading@10 18875 The direction of the transpose.
yading@10 18876
yading@10 18877
yading@10 18878 =over 4
yading@10 18879
yading@10 18880
yading@10 18881 =item B<0, 4, cclock_flip>
yading@10 18882
yading@10 18883 Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
yading@10 18884
yading@10 18885 L.R L.l
yading@10 18886 . . -> . .
yading@10 18887 l.r R.r
yading@10 18888
yading@10 18889
yading@10 18890
yading@10 18891 =item B<1, 5, clock>
yading@10 18892
yading@10 18893 Rotate by 90 degrees clockwise, that is:
yading@10 18894
yading@10 18895 L.R l.L
yading@10 18896 . . -> . .
yading@10 18897 l.r r.R
yading@10 18898
yading@10 18899
yading@10 18900
yading@10 18901 =item B<2, 6, cclock>
yading@10 18902
yading@10 18903 Rotate by 90 degrees counterclockwise, that is:
yading@10 18904
yading@10 18905 L.R R.r
yading@10 18906 . . -> . .
yading@10 18907 l.r L.l
yading@10 18908
yading@10 18909
yading@10 18910
yading@10 18911 =item B<3, 7, clock_flip>
yading@10 18912
yading@10 18913 Rotate by 90 degrees clockwise and vertically flip, that is:
yading@10 18914
yading@10 18915 L.R r.R
yading@10 18916 . . -> . .
yading@10 18917 l.r l.L
yading@10 18918
yading@10 18919
yading@10 18920 =back
yading@10 18921
yading@10 18922
yading@10 18923 For values between 4-7, the transposition is only done if the input
yading@10 18924 video geometry is portrait and not landscape. These values are
yading@10 18925 deprecated, the C<passthrough> option should be used instead.
yading@10 18926
yading@10 18927
yading@10 18928 =item B<passthrough>
yading@10 18929
yading@10 18930 Do not apply the transposition if the input geometry matches the one
yading@10 18931 specified by the specified value. It accepts the following values:
yading@10 18932
yading@10 18933 =over 4
yading@10 18934
yading@10 18935
yading@10 18936 =item B<none>
yading@10 18937
yading@10 18938 Always apply transposition.
yading@10 18939
yading@10 18940 =item B<portrait>
yading@10 18941
yading@10 18942 Preserve portrait geometry (when I<height> E<gt>= I<width>).
yading@10 18943
yading@10 18944 =item B<landscape>
yading@10 18945
yading@10 18946 Preserve landscape geometry (when I<width> E<gt>= I<height>).
yading@10 18947
yading@10 18948 =back
yading@10 18949
yading@10 18950
yading@10 18951 Default value is C<none>.
yading@10 18952
yading@10 18953 =back
yading@10 18954
yading@10 18955
yading@10 18956 For example to rotate by 90 degrees clockwise and preserve portrait
yading@10 18957 layout:
yading@10 18958
yading@10 18959 transpose=dir=1:passthrough=portrait
yading@10 18960
yading@10 18961
yading@10 18962 The command above can also be specified as:
yading@10 18963
yading@10 18964 transpose=1:portrait
yading@10 18965
yading@10 18966
yading@10 18967
yading@10 18968 =head2 unsharp
yading@10 18969
yading@10 18970
yading@10 18971 Sharpen or blur the input video.
yading@10 18972
yading@10 18973 It accepts the following parameters:
yading@10 18974
yading@10 18975
yading@10 18976 =over 4
yading@10 18977
yading@10 18978
yading@10 18979 =item B<luma_msize_x, lx>
yading@10 18980
yading@10 18981
yading@10 18982 =item B<chroma_msize_x, cx>
yading@10 18983
yading@10 18984 Set the luma/chroma matrix horizontal size. It must be an odd integer
yading@10 18985 between 3 and 63, default value is 5.
yading@10 18986
yading@10 18987
yading@10 18988 =item B<luma_msize_y, ly>
yading@10 18989
yading@10 18990
yading@10 18991 =item B<chroma_msize_y, cy>
yading@10 18992
yading@10 18993 Set the luma/chroma matrix vertical size. It must be an odd integer
yading@10 18994 between 3 and 63, default value is 5.
yading@10 18995
yading@10 18996
yading@10 18997 =item B<luma_amount, la>
yading@10 18998
yading@10 18999
yading@10 19000 =item B<chroma_amount, ca>
yading@10 19001
yading@10 19002 Set the luma/chroma effect strength. It can be a float number,
yading@10 19003 reasonable values lay between -1.5 and 1.5.
yading@10 19004
yading@10 19005 Negative values will blur the input video, while positive values will
yading@10 19006 sharpen it, a value of zero will disable the effect.
yading@10 19007
yading@10 19008 Default value is 1.0 for B<luma_amount>, 0.0 for
yading@10 19009 B<chroma_amount>.
yading@10 19010
yading@10 19011 =back
yading@10 19012
yading@10 19013
yading@10 19014 All parameters are optional and default to the
yading@10 19015 equivalent of the string '5:5:1.0:5:5:0.0'.
yading@10 19016
yading@10 19017
yading@10 19018 =head3 Examples
yading@10 19019
yading@10 19020
yading@10 19021
yading@10 19022 =over 4
yading@10 19023
yading@10 19024
yading@10 19025 =item *
yading@10 19026
yading@10 19027 Apply strong luma sharpen effect:
yading@10 19028
yading@10 19029 unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
yading@10 19030
yading@10 19031
yading@10 19032
yading@10 19033 =item *
yading@10 19034
yading@10 19035 Apply strong blur of both luma and chroma parameters:
yading@10 19036
yading@10 19037 unsharp=7:7:-2:7:7:-2
yading@10 19038
yading@10 19039
yading@10 19040 =back
yading@10 19041
yading@10 19042
yading@10 19043
yading@10 19044 =head2 vflip
yading@10 19045
yading@10 19046
yading@10 19047 Flip the input video vertically.
yading@10 19048
yading@10 19049
yading@10 19050 ffmpeg -i in.avi -vf "vflip" out.avi
yading@10 19051
yading@10 19052
yading@10 19053
yading@10 19054
yading@10 19055 =head2 yadif
yading@10 19056
yading@10 19057
yading@10 19058 Deinterlace the input video ("yadif" means "yet another deinterlacing
yading@10 19059 filter").
yading@10 19060
yading@10 19061 This filter accepts the following options:
yading@10 19062
yading@10 19063
yading@10 19064
yading@10 19065 =over 4
yading@10 19066
yading@10 19067
yading@10 19068
yading@10 19069 =item B<mode>
yading@10 19070
yading@10 19071 The interlacing mode to adopt, accepts one of the following values:
yading@10 19072
yading@10 19073
yading@10 19074 =over 4
yading@10 19075
yading@10 19076
yading@10 19077 =item B<0, send_frame>
yading@10 19078
yading@10 19079 output 1 frame for each frame
yading@10 19080
yading@10 19081 =item B<1, send_field>
yading@10 19082
yading@10 19083 output 1 frame for each field
yading@10 19084
yading@10 19085 =item B<2, send_frame_nospatial>
yading@10 19086
yading@10 19087 like C<send_frame> but skip spatial interlacing check
yading@10 19088
yading@10 19089 =item B<3, send_field_nospatial>
yading@10 19090
yading@10 19091 like C<send_field> but skip spatial interlacing check
yading@10 19092
yading@10 19093 =back
yading@10 19094
yading@10 19095
yading@10 19096 Default value is C<send_frame>.
yading@10 19097
yading@10 19098
yading@10 19099 =item B<parity>
yading@10 19100
yading@10 19101 The picture field parity assumed for the input interlaced video, accepts one of
yading@10 19102 the following values:
yading@10 19103
yading@10 19104
yading@10 19105 =over 4
yading@10 19106
yading@10 19107
yading@10 19108 =item B<0, tff>
yading@10 19109
yading@10 19110 assume top field first
yading@10 19111
yading@10 19112 =item B<1, bff>
yading@10 19113
yading@10 19114 assume bottom field first
yading@10 19115
yading@10 19116 =item B<-1, auto>
yading@10 19117
yading@10 19118 enable automatic detection
yading@10 19119
yading@10 19120 =back
yading@10 19121
yading@10 19122
yading@10 19123 Default value is C<auto>.
yading@10 19124 If interlacing is unknown or decoder does not export this information,
yading@10 19125 top field first will be assumed.
yading@10 19126
yading@10 19127
yading@10 19128 =item B<deint>
yading@10 19129
yading@10 19130 Specify which frames to deinterlace. Accept one of the following
yading@10 19131 values:
yading@10 19132
yading@10 19133
yading@10 19134 =over 4
yading@10 19135
yading@10 19136
yading@10 19137 =item B<0, all>
yading@10 19138
yading@10 19139 deinterlace all frames
yading@10 19140
yading@10 19141 =item B<1, interlaced>
yading@10 19142
yading@10 19143 only deinterlace frames marked as interlaced
yading@10 19144
yading@10 19145 =back
yading@10 19146
yading@10 19147
yading@10 19148 Default value is C<all>.
yading@10 19149
yading@10 19150 =back
yading@10 19151
yading@10 19152
yading@10 19153
yading@10 19154
yading@10 19155 =head1 VIDEO SOURCES
yading@10 19156
yading@10 19157
yading@10 19158 Below is a description of the currently available video sources.
yading@10 19159
yading@10 19160
yading@10 19161 =head2 buffer
yading@10 19162
yading@10 19163
yading@10 19164 Buffer video frames, and make them available to the filter chain.
yading@10 19165
yading@10 19166 This source is mainly intended for a programmatic use, in particular
yading@10 19167 through the interface defined in F<libavfilter/vsrc_buffer.h>.
yading@10 19168
yading@10 19169 This source accepts the following options:
yading@10 19170
yading@10 19171
yading@10 19172 =over 4
yading@10 19173
yading@10 19174
yading@10 19175
yading@10 19176 =item B<video_size>
yading@10 19177
yading@10 19178 Specify the size (width and height) of the buffered video frames.
yading@10 19179
yading@10 19180
yading@10 19181 =item B<width>
yading@10 19182
yading@10 19183 Input video width.
yading@10 19184
yading@10 19185
yading@10 19186 =item B<height>
yading@10 19187
yading@10 19188 Input video height.
yading@10 19189
yading@10 19190
yading@10 19191 =item B<pix_fmt>
yading@10 19192
yading@10 19193 A string representing the pixel format of the buffered video frames.
yading@10 19194 It may be a number corresponding to a pixel format, or a pixel format
yading@10 19195 name.
yading@10 19196
yading@10 19197
yading@10 19198 =item B<time_base>
yading@10 19199
yading@10 19200 Specify the timebase assumed by the timestamps of the buffered frames.
yading@10 19201
yading@10 19202
yading@10 19203 =item B<frame_rate>
yading@10 19204
yading@10 19205 Specify the frame rate expected for the video stream.
yading@10 19206
yading@10 19207
yading@10 19208 =item B<pixel_aspect, sar>
yading@10 19209
yading@10 19210 Specify the sample aspect ratio assumed by the video frames.
yading@10 19211
yading@10 19212
yading@10 19213 =item B<sws_param>
yading@10 19214
yading@10 19215 Specify the optional parameters to be used for the scale filter which
yading@10 19216 is automatically inserted when an input change is detected in the
yading@10 19217 input size or format.
yading@10 19218
yading@10 19219 =back
yading@10 19220
yading@10 19221
yading@10 19222 For example:
yading@10 19223
yading@10 19224 buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
yading@10 19225
yading@10 19226
yading@10 19227 will instruct the source to accept video frames with size 320x240 and
yading@10 19228 with format "yuv410p", assuming 1/24 as the timestamps timebase and
yading@10 19229 square pixels (1:1 sample aspect ratio).
yading@10 19230 Since the pixel format with name "yuv410p" corresponds to the number 6
yading@10 19231 (check the enum AVPixelFormat definition in F<libavutil/pixfmt.h>),
yading@10 19232 this example corresponds to:
yading@10 19233
yading@10 19234 buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
yading@10 19235
yading@10 19236
yading@10 19237 Alternatively, the options can be specified as a flat string, but this
yading@10 19238 syntax is deprecated:
yading@10 19239
yading@10 19240 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 19241
yading@10 19242
yading@10 19243 =head2 cellauto
yading@10 19244
yading@10 19245
yading@10 19246 Create a pattern generated by an elementary cellular automaton.
yading@10 19247
yading@10 19248 The initial state of the cellular automaton can be defined through the
yading@10 19249 B<filename>, and B<pattern> options. If such options are
yading@10 19250 not specified an initial state is created randomly.
yading@10 19251
yading@10 19252 At each new frame a new row in the video is filled with the result of
yading@10 19253 the cellular automaton next generation. The behavior when the whole
yading@10 19254 frame is filled is defined by the B<scroll> option.
yading@10 19255
yading@10 19256 This source accepts the following options:
yading@10 19257
yading@10 19258
yading@10 19259 =over 4
yading@10 19260
yading@10 19261
yading@10 19262 =item B<filename, f>
yading@10 19263
yading@10 19264 Read the initial cellular automaton state, i.e. the starting row, from
yading@10 19265 the specified file.
yading@10 19266 In the file, each non-whitespace character is considered an alive
yading@10 19267 cell, a newline will terminate the row, and further characters in the
yading@10 19268 file will be ignored.
yading@10 19269
yading@10 19270
yading@10 19271 =item B<pattern, p>
yading@10 19272
yading@10 19273 Read the initial cellular automaton state, i.e. the starting row, from
yading@10 19274 the specified string.
yading@10 19275
yading@10 19276 Each non-whitespace character in the string is considered an alive
yading@10 19277 cell, a newline will terminate the row, and further characters in the
yading@10 19278 string will be ignored.
yading@10 19279
yading@10 19280
yading@10 19281 =item B<rate, r>
yading@10 19282
yading@10 19283 Set the video rate, that is the number of frames generated per second.
yading@10 19284 Default is 25.
yading@10 19285
yading@10 19286
yading@10 19287 =item B<random_fill_ratio, ratio>
yading@10 19288
yading@10 19289 Set the random fill ratio for the initial cellular automaton row. It
yading@10 19290 is a floating point number value ranging from 0 to 1, defaults to
yading@10 19291 1/PHI.
yading@10 19292
yading@10 19293 This option is ignored when a file or a pattern is specified.
yading@10 19294
yading@10 19295
yading@10 19296 =item B<random_seed, seed>
yading@10 19297
yading@10 19298 Set the seed for filling randomly the initial row, must be an integer
yading@10 19299 included between 0 and UINT32_MAX. If not specified, or if explicitly
yading@10 19300 set to -1, the filter will try to use a good random seed on a best
yading@10 19301 effort basis.
yading@10 19302
yading@10 19303
yading@10 19304 =item B<rule>
yading@10 19305
yading@10 19306 Set the cellular automaton rule, it is a number ranging from 0 to 255.
yading@10 19307 Default value is 110.
yading@10 19308
yading@10 19309
yading@10 19310 =item B<size, s>
yading@10 19311
yading@10 19312 Set the size of the output video.
yading@10 19313
yading@10 19314 If B<filename> or B<pattern> is specified, the size is set
yading@10 19315 by default to the width of the specified initial state row, and the
yading@10 19316 height is set to I<width> * PHI.
yading@10 19317
yading@10 19318 If B<size> is set, it must contain the width of the specified
yading@10 19319 pattern string, and the specified pattern will be centered in the
yading@10 19320 larger row.
yading@10 19321
yading@10 19322 If a filename or a pattern string is not specified, the size value
yading@10 19323 defaults to "320x518" (used for a randomly generated initial state).
yading@10 19324
yading@10 19325
yading@10 19326 =item B<scroll>
yading@10 19327
yading@10 19328 If set to 1, scroll the output upward when all the rows in the output
yading@10 19329 have been already filled. If set to 0, the new generated row will be
yading@10 19330 written over the top row just after the bottom row is filled.
yading@10 19331 Defaults to 1.
yading@10 19332
yading@10 19333
yading@10 19334 =item B<start_full, full>
yading@10 19335
yading@10 19336 If set to 1, completely fill the output with generated rows before
yading@10 19337 outputting the first frame.
yading@10 19338 This is the default behavior, for disabling set the value to 0.
yading@10 19339
yading@10 19340
yading@10 19341 =item B<stitch>
yading@10 19342
yading@10 19343 If set to 1, stitch the left and right row edges together.
yading@10 19344 This is the default behavior, for disabling set the value to 0.
yading@10 19345
yading@10 19346 =back
yading@10 19347
yading@10 19348
yading@10 19349
yading@10 19350 =head3 Examples
yading@10 19351
yading@10 19352
yading@10 19353
yading@10 19354 =over 4
yading@10 19355
yading@10 19356
yading@10 19357 =item *
yading@10 19358
yading@10 19359 Read the initial state from F<pattern>, and specify an output of
yading@10 19360 size 200x400.
yading@10 19361
yading@10 19362 cellauto=f=pattern:s=200x400
yading@10 19363
yading@10 19364
yading@10 19365
yading@10 19366 =item *
yading@10 19367
yading@10 19368 Generate a random initial row with a width of 200 cells, with a fill
yading@10 19369 ratio of 2/3:
yading@10 19370
yading@10 19371 cellauto=ratio=2/3:s=200x200
yading@10 19372
yading@10 19373
yading@10 19374
yading@10 19375 =item *
yading@10 19376
yading@10 19377 Create a pattern generated by rule 18 starting by a single alive cell
yading@10 19378 centered on an initial row with width 100:
yading@10 19379
yading@10 19380 cellauto=p=@s=100x400:full=0:rule=18
yading@10 19381
yading@10 19382
yading@10 19383
yading@10 19384 =item *
yading@10 19385
yading@10 19386 Specify a more elaborated initial pattern:
yading@10 19387
yading@10 19388 cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
yading@10 19389
yading@10 19390
yading@10 19391
yading@10 19392 =back
yading@10 19393
yading@10 19394
yading@10 19395
yading@10 19396 =head2 mandelbrot
yading@10 19397
yading@10 19398
yading@10 19399 Generate a Mandelbrot set fractal, and progressively zoom towards the
yading@10 19400 point specified with I<start_x> and I<start_y>.
yading@10 19401
yading@10 19402 This source accepts the following options:
yading@10 19403
yading@10 19404
yading@10 19405 =over 4
yading@10 19406
yading@10 19407
yading@10 19408
yading@10 19409 =item B<end_pts>
yading@10 19410
yading@10 19411 Set the terminal pts value. Default value is 400.
yading@10 19412
yading@10 19413
yading@10 19414 =item B<end_scale>
yading@10 19415
yading@10 19416 Set the terminal scale value.
yading@10 19417 Must be a floating point value. Default value is 0.3.
yading@10 19418
yading@10 19419
yading@10 19420 =item B<inner>
yading@10 19421
yading@10 19422 Set the inner coloring mode, that is the algorithm used to draw the
yading@10 19423 Mandelbrot fractal internal region.
yading@10 19424
yading@10 19425 It shall assume one of the following values:
yading@10 19426
yading@10 19427 =over 4
yading@10 19428
yading@10 19429
yading@10 19430 =item B<black>
yading@10 19431
yading@10 19432 Set black mode.
yading@10 19433
yading@10 19434 =item B<convergence>
yading@10 19435
yading@10 19436 Show time until convergence.
yading@10 19437
yading@10 19438 =item B<mincol>
yading@10 19439
yading@10 19440 Set color based on point closest to the origin of the iterations.
yading@10 19441
yading@10 19442 =item B<period>
yading@10 19443
yading@10 19444 Set period mode.
yading@10 19445
yading@10 19446 =back
yading@10 19447
yading@10 19448
yading@10 19449 Default value is I<mincol>.
yading@10 19450
yading@10 19451
yading@10 19452 =item B<bailout>
yading@10 19453
yading@10 19454 Set the bailout value. Default value is 10.0.
yading@10 19455
yading@10 19456
yading@10 19457 =item B<maxiter>
yading@10 19458
yading@10 19459 Set the maximum of iterations performed by the rendering
yading@10 19460 algorithm. Default value is 7189.
yading@10 19461
yading@10 19462
yading@10 19463 =item B<outer>
yading@10 19464
yading@10 19465 Set outer coloring mode.
yading@10 19466 It shall assume one of following values:
yading@10 19467
yading@10 19468 =over 4
yading@10 19469
yading@10 19470
yading@10 19471 =item B<iteration_count>
yading@10 19472
yading@10 19473 Set iteration cound mode.
yading@10 19474
yading@10 19475 =item B<normalized_iteration_count>
yading@10 19476
yading@10 19477 set normalized iteration count mode.
yading@10 19478
yading@10 19479 =back
yading@10 19480
yading@10 19481 Default value is I<normalized_iteration_count>.
yading@10 19482
yading@10 19483
yading@10 19484 =item B<rate, r>
yading@10 19485
yading@10 19486 Set frame rate, expressed as number of frames per second. Default
yading@10 19487 value is "25".
yading@10 19488
yading@10 19489
yading@10 19490 =item B<size, s>
yading@10 19491
yading@10 19492 Set frame size. Default value is "640x480".
yading@10 19493
yading@10 19494
yading@10 19495 =item B<start_scale>
yading@10 19496
yading@10 19497 Set the initial scale value. Default value is 3.0.
yading@10 19498
yading@10 19499
yading@10 19500 =item B<start_x>
yading@10 19501
yading@10 19502 Set the initial x position. Must be a floating point value between
yading@10 19503 -100 and 100. Default value is -0.743643887037158704752191506114774.
yading@10 19504
yading@10 19505
yading@10 19506 =item B<start_y>
yading@10 19507
yading@10 19508 Set the initial y position. Must be a floating point value between
yading@10 19509 -100 and 100. Default value is -0.131825904205311970493132056385139.
yading@10 19510
yading@10 19511 =back
yading@10 19512
yading@10 19513
yading@10 19514
yading@10 19515 =head2 mptestsrc
yading@10 19516
yading@10 19517
yading@10 19518 Generate various test patterns, as generated by the MPlayer test filter.
yading@10 19519
yading@10 19520 The size of the generated video is fixed, and is 256x256.
yading@10 19521 This source is useful in particular for testing encoding features.
yading@10 19522
yading@10 19523 This source accepts the following options:
yading@10 19524
yading@10 19525
yading@10 19526 =over 4
yading@10 19527
yading@10 19528
yading@10 19529
yading@10 19530 =item B<rate, r>
yading@10 19531
yading@10 19532 Specify the frame rate of the sourced video, as the number of frames
yading@10 19533 generated per second. It has to be a string in the format
yading@10 19534 I<frame_rate_num>/I<frame_rate_den>, an integer number, a float
yading@10 19535 number or a valid video frame rate abbreviation. The default value is
yading@10 19536 "25".
yading@10 19537
yading@10 19538
yading@10 19539 =item B<duration, d>
yading@10 19540
yading@10 19541 Set the video duration of the sourced video. The accepted syntax is:
yading@10 19542
yading@10 19543 [-]HH:MM:SS[.m...]
yading@10 19544 [-]S+[.m...]
yading@10 19545
yading@10 19546 See also the function C<av_parse_time()>.
yading@10 19547
yading@10 19548 If not specified, or the expressed duration is negative, the video is
yading@10 19549 supposed to be generated forever.
yading@10 19550
yading@10 19551
yading@10 19552 =item B<test, t>
yading@10 19553
yading@10 19554
yading@10 19555 Set the number or the name of the test to perform. Supported tests are:
yading@10 19556
yading@10 19557 =over 4
yading@10 19558
yading@10 19559
yading@10 19560 =item B<dc_luma>
yading@10 19561
yading@10 19562
yading@10 19563 =item B<dc_chroma>
yading@10 19564
yading@10 19565
yading@10 19566 =item B<freq_luma>
yading@10 19567
yading@10 19568
yading@10 19569 =item B<freq_chroma>
yading@10 19570
yading@10 19571
yading@10 19572 =item B<amp_luma>
yading@10 19573
yading@10 19574
yading@10 19575 =item B<amp_chroma>
yading@10 19576
yading@10 19577
yading@10 19578 =item B<cbp>
yading@10 19579
yading@10 19580
yading@10 19581 =item B<mv>
yading@10 19582
yading@10 19583
yading@10 19584 =item B<ring1>
yading@10 19585
yading@10 19586
yading@10 19587 =item B<ring2>
yading@10 19588
yading@10 19589
yading@10 19590 =item B<all>
yading@10 19591
yading@10 19592
yading@10 19593 =back
yading@10 19594
yading@10 19595
yading@10 19596 Default value is "all", which will cycle through the list of all tests.
yading@10 19597
yading@10 19598 =back
yading@10 19599
yading@10 19600
yading@10 19601 For example the following:
yading@10 19602
yading@10 19603 testsrc=t=dc_luma
yading@10 19604
yading@10 19605
yading@10 19606 will generate a "dc_luma" test pattern.
yading@10 19607
yading@10 19608
yading@10 19609 =head2 frei0r_src
yading@10 19610
yading@10 19611
yading@10 19612 Provide a frei0r source.
yading@10 19613
yading@10 19614 To enable compilation of this filter you need to install the frei0r
yading@10 19615 header and configure FFmpeg with C<--enable-frei0r>.
yading@10 19616
yading@10 19617 This source accepts the following options:
yading@10 19618
yading@10 19619
yading@10 19620 =over 4
yading@10 19621
yading@10 19622
yading@10 19623
yading@10 19624 =item B<size>
yading@10 19625
yading@10 19626 The size of the video to generate, may be a string of the form
yading@10 19627 I<width>xI<height> or a frame size abbreviation.
yading@10 19628
yading@10 19629
yading@10 19630 =item B<framerate>
yading@10 19631
yading@10 19632 Framerate of the generated video, may be a string of the form
yading@10 19633 I<num>/I<den> or a frame rate abbreviation.
yading@10 19634
yading@10 19635
yading@10 19636 =item B<filter_name>
yading@10 19637
yading@10 19638 The name to the frei0r source to load. For more information regarding frei0r and
yading@10 19639 how to set the parameters read the section frei0r in the description of
yading@10 19640 the video filters.
yading@10 19641
yading@10 19642
yading@10 19643 =item B<filter_params>
yading@10 19644
yading@10 19645 A '|'-separated list of parameters to pass to the frei0r source.
yading@10 19646
yading@10 19647
yading@10 19648 =back
yading@10 19649
yading@10 19650
yading@10 19651 For example, to generate a frei0r partik0l source with size 200x200
yading@10 19652 and frame rate 10 which is overlayed on the overlay filter main input:
yading@10 19653
yading@10 19654 frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
yading@10 19655
yading@10 19656
yading@10 19657
yading@10 19658 =head2 life
yading@10 19659
yading@10 19660
yading@10 19661 Generate a life pattern.
yading@10 19662
yading@10 19663 This source is based on a generalization of John Conway's life game.
yading@10 19664
yading@10 19665 The sourced input represents a life grid, each pixel represents a cell
yading@10 19666 which can be in one of two possible states, alive or dead. Every cell
yading@10 19667 interacts with its eight neighbours, which are the cells that are
yading@10 19668 horizontally, vertically, or diagonally adjacent.
yading@10 19669
yading@10 19670 At each interaction the grid evolves according to the adopted rule,
yading@10 19671 which specifies the number of neighbor alive cells which will make a
yading@10 19672 cell stay alive or born. The B<rule> option allows to specify
yading@10 19673 the rule to adopt.
yading@10 19674
yading@10 19675 This source accepts the following options:
yading@10 19676
yading@10 19677
yading@10 19678 =over 4
yading@10 19679
yading@10 19680
yading@10 19681 =item B<filename, f>
yading@10 19682
yading@10 19683 Set the file from which to read the initial grid state. In the file,
yading@10 19684 each non-whitespace character is considered an alive cell, and newline
yading@10 19685 is used to delimit the end of each row.
yading@10 19686
yading@10 19687 If this option is not specified, the initial grid is generated
yading@10 19688 randomly.
yading@10 19689
yading@10 19690
yading@10 19691 =item B<rate, r>
yading@10 19692
yading@10 19693 Set the video rate, that is the number of frames generated per second.
yading@10 19694 Default is 25.
yading@10 19695
yading@10 19696
yading@10 19697 =item B<random_fill_ratio, ratio>
yading@10 19698
yading@10 19699 Set the random fill ratio for the initial random grid. It is a
yading@10 19700 floating point number value ranging from 0 to 1, defaults to 1/PHI.
yading@10 19701 It is ignored when a file is specified.
yading@10 19702
yading@10 19703
yading@10 19704 =item B<random_seed, seed>
yading@10 19705
yading@10 19706 Set the seed for filling the initial random grid, must be an integer
yading@10 19707 included between 0 and UINT32_MAX. If not specified, or if explicitly
yading@10 19708 set to -1, the filter will try to use a good random seed on a best
yading@10 19709 effort basis.
yading@10 19710
yading@10 19711
yading@10 19712 =item B<rule>
yading@10 19713
yading@10 19714 Set the life rule.
yading@10 19715
yading@10 19716 A rule can be specified with a code of the kind "SI<NS>/BI<NB>",
yading@10 19717 where I<NS> and I<NB> are sequences of numbers in the range 0-8,
yading@10 19718 I<NS> specifies the number of alive neighbor cells which make a
yading@10 19719 live cell stay alive, and I<NB> the number of alive neighbor cells
yading@10 19720 which make a dead cell to become alive (i.e. to "born").
yading@10 19721 "s" and "b" can be used in place of "S" and "B", respectively.
yading@10 19722
yading@10 19723 Alternatively a rule can be specified by an 18-bits integer. The 9
yading@10 19724 high order bits are used to encode the next cell state if it is alive
yading@10 19725 for each number of neighbor alive cells, the low order bits specify
yading@10 19726 the rule for "borning" new cells. Higher order bits encode for an
yading@10 19727 higher number of neighbor cells.
yading@10 19728 For example the number 6153 = C<(12E<lt>E<lt>9)+9> specifies a stay alive
yading@10 19729 rule of 12 and a born rule of 9, which corresponds to "S23/B03".
yading@10 19730
yading@10 19731 Default value is "S23/B3", which is the original Conway's game of life
yading@10 19732 rule, and will keep a cell alive if it has 2 or 3 neighbor alive
yading@10 19733 cells, and will born a new cell if there are three alive cells around
yading@10 19734 a dead cell.
yading@10 19735
yading@10 19736
yading@10 19737 =item B<size, s>
yading@10 19738
yading@10 19739 Set the size of the output video.
yading@10 19740
yading@10 19741 If B<filename> is specified, the size is set by default to the
yading@10 19742 same size of the input file. If B<size> is set, it must contain
yading@10 19743 the size specified in the input file, and the initial grid defined in
yading@10 19744 that file is centered in the larger resulting area.
yading@10 19745
yading@10 19746 If a filename is not specified, the size value defaults to "320x240"
yading@10 19747 (used for a randomly generated initial grid).
yading@10 19748
yading@10 19749
yading@10 19750 =item B<stitch>
yading@10 19751
yading@10 19752 If set to 1, stitch the left and right grid edges together, and the
yading@10 19753 top and bottom edges also. Defaults to 1.
yading@10 19754
yading@10 19755
yading@10 19756 =item B<mold>
yading@10 19757
yading@10 19758 Set cell mold speed. If set, a dead cell will go from B<death_color> to
yading@10 19759 B<mold_color> with a step of B<mold>. B<mold> can have a
yading@10 19760 value from 0 to 255.
yading@10 19761
yading@10 19762
yading@10 19763 =item B<life_color>
yading@10 19764
yading@10 19765 Set the color of living (or new born) cells.
yading@10 19766
yading@10 19767
yading@10 19768 =item B<death_color>
yading@10 19769
yading@10 19770 Set the color of dead cells. If B<mold> is set, this is the first color
yading@10 19771 used to represent a dead cell.
yading@10 19772
yading@10 19773
yading@10 19774 =item B<mold_color>
yading@10 19775
yading@10 19776 Set mold color, for definitely dead and moldy cells.
yading@10 19777
yading@10 19778 =back
yading@10 19779
yading@10 19780
yading@10 19781
yading@10 19782 =head3 Examples
yading@10 19783
yading@10 19784
yading@10 19785
yading@10 19786 =over 4
yading@10 19787
yading@10 19788
yading@10 19789 =item *
yading@10 19790
yading@10 19791 Read a grid from F<pattern>, and center it on a grid of size
yading@10 19792 300x300 pixels:
yading@10 19793
yading@10 19794 life=f=pattern:s=300x300
yading@10 19795
yading@10 19796
yading@10 19797
yading@10 19798 =item *
yading@10 19799
yading@10 19800 Generate a random grid of size 200x200, with a fill ratio of 2/3:
yading@10 19801
yading@10 19802 life=ratio=2/3:s=200x200
yading@10 19803
yading@10 19804
yading@10 19805
yading@10 19806 =item *
yading@10 19807
yading@10 19808 Specify a custom rule for evolving a randomly generated grid:
yading@10 19809
yading@10 19810 life=rule=S14/B34
yading@10 19811
yading@10 19812
yading@10 19813
yading@10 19814 =item *
yading@10 19815
yading@10 19816 Full example with slow death effect (mold) using B<ffplay>:
yading@10 19817
yading@10 19818 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 19819
yading@10 19820
yading@10 19821 =back
yading@10 19822
yading@10 19823
yading@10 19824
yading@10 19825 =head2 color, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc
yading@10 19826
yading@10 19827
yading@10 19828 The C<color> source provides an uniformly colored input.
yading@10 19829
yading@10 19830 The C<nullsrc> source returns unprocessed video frames. It is
yading@10 19831 mainly useful to be employed in analysis / debugging tools, or as the
yading@10 19832 source for filters which ignore the input data.
yading@10 19833
yading@10 19834 The C<rgbtestsrc> source generates an RGB test pattern useful for
yading@10 19835 detecting RGB vs BGR issues. You should see a red, green and blue
yading@10 19836 stripe from top to bottom.
yading@10 19837
yading@10 19838 The C<smptebars> source generates a color bars pattern, based on
yading@10 19839 the SMPTE Engineering Guideline EG 1-1990.
yading@10 19840
yading@10 19841 The C<smptehdbars> source generates a color bars pattern, based on
yading@10 19842 the SMPTE RP 219-2002.
yading@10 19843
yading@10 19844 The C<testsrc> source generates a test video pattern, showing a
yading@10 19845 color pattern, a scrolling gradient and a timestamp. This is mainly
yading@10 19846 intended for testing purposes.
yading@10 19847
yading@10 19848 The sources accept the following options:
yading@10 19849
yading@10 19850
yading@10 19851 =over 4
yading@10 19852
yading@10 19853
yading@10 19854
yading@10 19855 =item B<color, c>
yading@10 19856
yading@10 19857 Specify the color of the source, only used in the C<color>
yading@10 19858 source. It can be the name of a color (case insensitive match) or a
yading@10 19859 0xRRGGBB[AA] sequence, possibly followed by an alpha specifier. The
yading@10 19860 default value is "black".
yading@10 19861
yading@10 19862
yading@10 19863 =item B<size, s>
yading@10 19864
yading@10 19865 Specify the size of the sourced video, it may be a string of the form
yading@10 19866 I<width>xI<height>, or the name of a size abbreviation. The
yading@10 19867 default value is "320x240".
yading@10 19868
yading@10 19869
yading@10 19870 =item B<rate, r>
yading@10 19871
yading@10 19872 Specify the frame rate of the sourced video, as the number of frames
yading@10 19873 generated per second. It has to be a string in the format
yading@10 19874 I<frame_rate_num>/I<frame_rate_den>, an integer number, a float
yading@10 19875 number or a valid video frame rate abbreviation. The default value is
yading@10 19876 "25".
yading@10 19877
yading@10 19878
yading@10 19879 =item B<sar>
yading@10 19880
yading@10 19881 Set the sample aspect ratio of the sourced video.
yading@10 19882
yading@10 19883
yading@10 19884 =item B<duration, d>
yading@10 19885
yading@10 19886 Set the video duration of the sourced video. The accepted syntax is:
yading@10 19887
yading@10 19888 [-]HH[:MM[:SS[.m...]]]
yading@10 19889 [-]S+[.m...]
yading@10 19890
yading@10 19891 See also the function C<av_parse_time()>.
yading@10 19892
yading@10 19893 If not specified, or the expressed duration is negative, the video is
yading@10 19894 supposed to be generated forever.
yading@10 19895
yading@10 19896
yading@10 19897 =item B<decimals, n>
yading@10 19898
yading@10 19899 Set the number of decimals to show in the timestamp, only used in the
yading@10 19900 C<testsrc> source.
yading@10 19901
yading@10 19902 The displayed timestamp value will correspond to the original
yading@10 19903 timestamp value multiplied by the power of 10 of the specified
yading@10 19904 value. Default value is 0.
yading@10 19905
yading@10 19906 =back
yading@10 19907
yading@10 19908
yading@10 19909 For example the following:
yading@10 19910
yading@10 19911 testsrc=duration=5.3:size=qcif:rate=10
yading@10 19912
yading@10 19913
yading@10 19914 will generate a video with a duration of 5.3 seconds, with size
yading@10 19915 176x144 and a frame rate of 10 frames per second.
yading@10 19916
yading@10 19917 The following graph description will generate a red source
yading@10 19918 with an opacity of 0.2, with size "qcif" and a frame rate of 10
yading@10 19919 frames per second.
yading@10 19920
yading@10 19921 color=c=red@0.2:s=qcif:r=10
yading@10 19922
yading@10 19923
yading@10 19924 If the input content is to be ignored, C<nullsrc> can be used. The
yading@10 19925 following command generates noise in the luminance plane by employing
yading@10 19926 the C<geq> filter:
yading@10 19927
yading@10 19928 nullsrc=s=256x256, geq=random(1)*255:128:128
yading@10 19929
yading@10 19930
yading@10 19931
yading@10 19932
yading@10 19933 =head1 VIDEO SINKS
yading@10 19934
yading@10 19935
yading@10 19936 Below is a description of the currently available video sinks.
yading@10 19937
yading@10 19938
yading@10 19939 =head2 buffersink
yading@10 19940
yading@10 19941
yading@10 19942 Buffer video frames, and make them available to the end of the filter
yading@10 19943 graph.
yading@10 19944
yading@10 19945 This sink is mainly intended for a programmatic use, in particular
yading@10 19946 through the interface defined in F<libavfilter/buffersink.h>
yading@10 19947 or the options system.
yading@10 19948
yading@10 19949 It accepts a pointer to an AVBufferSinkContext structure, which
yading@10 19950 defines the incoming buffers' formats, to be passed as the opaque
yading@10 19951 parameter to C<avfilter_init_filter> for initialization.
yading@10 19952
yading@10 19953
yading@10 19954 =head2 nullsink
yading@10 19955
yading@10 19956
yading@10 19957 Null video sink, do absolutely nothing with the input video. It is
yading@10 19958 mainly useful as a template and to be employed in analysis / debugging
yading@10 19959 tools.
yading@10 19960
yading@10 19961
yading@10 19962
yading@10 19963 =head1 MULTIMEDIA FILTERS
yading@10 19964
yading@10 19965
yading@10 19966 Below is a description of the currently available multimedia filters.
yading@10 19967
yading@10 19968
yading@10 19969 =head2 aperms, perms
yading@10 19970
yading@10 19971
yading@10 19972 Set read/write permissions for the output frames.
yading@10 19973
yading@10 19974 These filters are mainly aimed at developers to test direct path in the
yading@10 19975 following filter in the filtergraph.
yading@10 19976
yading@10 19977 The filters accept the following options:
yading@10 19978
yading@10 19979
yading@10 19980 =over 4
yading@10 19981
yading@10 19982
yading@10 19983 =item B<mode>
yading@10 19984
yading@10 19985 Select the permissions mode.
yading@10 19986
yading@10 19987 It accepts the following values:
yading@10 19988
yading@10 19989 =over 4
yading@10 19990
yading@10 19991
yading@10 19992 =item B<none>
yading@10 19993
yading@10 19994 Do nothing. This is the default.
yading@10 19995
yading@10 19996 =item B<ro>
yading@10 19997
yading@10 19998 Set all the output frames read-only.
yading@10 19999
yading@10 20000 =item B<rw>
yading@10 20001
yading@10 20002 Set all the output frames directly writable.
yading@10 20003
yading@10 20004 =item B<toggle>
yading@10 20005
yading@10 20006 Make the frame read-only if writable, and writable if read-only.
yading@10 20007
yading@10 20008 =item B<random>
yading@10 20009
yading@10 20010 Set each output frame read-only or writable randomly.
yading@10 20011
yading@10 20012 =back
yading@10 20013
yading@10 20014
yading@10 20015
yading@10 20016 =item B<seed>
yading@10 20017
yading@10 20018 Set the seed for the I<random> mode, must be an integer included between
yading@10 20019 C<0> and C<UINT32_MAX>. If not specified, or if explicitly set to
yading@10 20020 C<-1>, the filter will try to use a good random seed on a best effort
yading@10 20021 basis.
yading@10 20022
yading@10 20023 =back
yading@10 20024
yading@10 20025
yading@10 20026 Note: in case of auto-inserted filter between the permission filter and the
yading@10 20027 following one, the permission might not be received as expected in that
yading@10 20028 following filter. Inserting a format or aformat filter before the
yading@10 20029 perms/aperms filter can avoid this problem.
yading@10 20030
yading@10 20031
yading@10 20032 =head2 aselect, select
yading@10 20033
yading@10 20034 Select frames to pass in output.
yading@10 20035
yading@10 20036 This filter accepts the following options:
yading@10 20037
yading@10 20038
yading@10 20039 =over 4
yading@10 20040
yading@10 20041
yading@10 20042
yading@10 20043 =item B<expr, e>
yading@10 20044
yading@10 20045 Set expression, which is evaluated for each input frame.
yading@10 20046
yading@10 20047 If the expression is evaluated to zero, the frame is discarded.
yading@10 20048
yading@10 20049 If the evaluation result is negative or NaN, the frame is sent to the
yading@10 20050 first output; otherwise it is sent to the output with index
yading@10 20051 C<ceil(val)-1>, assuming that the input index starts from 0.
yading@10 20052
yading@10 20053 For example a value of C<1.2> corresponds to the output with index
yading@10 20054 C<ceil(1.2)-1 = 2-1 = 1>, that is the second output.
yading@10 20055
yading@10 20056
yading@10 20057 =item B<outputs, n>
yading@10 20058
yading@10 20059 Set the number of outputs. The output to which to send the selected
yading@10 20060 frame is based on the result of the evaluation. Default value is 1.
yading@10 20061
yading@10 20062 =back
yading@10 20063
yading@10 20064
yading@10 20065 The expression can contain the following constants:
yading@10 20066
yading@10 20067
yading@10 20068 =over 4
yading@10 20069
yading@10 20070
yading@10 20071 =item B<n>
yading@10 20072
yading@10 20073 the sequential number of the filtered frame, starting from 0
yading@10 20074
yading@10 20075
yading@10 20076 =item B<selected_n>
yading@10 20077
yading@10 20078 the sequential number of the selected frame, starting from 0
yading@10 20079
yading@10 20080
yading@10 20081 =item B<prev_selected_n>
yading@10 20082
yading@10 20083 the sequential number of the last selected frame, NAN if undefined
yading@10 20084
yading@10 20085
yading@10 20086 =item B<TB>
yading@10 20087
yading@10 20088 timebase of the input timestamps
yading@10 20089
yading@10 20090
yading@10 20091 =item B<pts>
yading@10 20092
yading@10 20093 the PTS (Presentation TimeStamp) of the filtered video frame,
yading@10 20094 expressed in I<TB> units, NAN if undefined
yading@10 20095
yading@10 20096
yading@10 20097 =item B<t>
yading@10 20098
yading@10 20099 the PTS (Presentation TimeStamp) of the filtered video frame,
yading@10 20100 expressed in seconds, NAN if undefined
yading@10 20101
yading@10 20102
yading@10 20103 =item B<prev_pts>
yading@10 20104
yading@10 20105 the PTS of the previously filtered video frame, NAN if undefined
yading@10 20106
yading@10 20107
yading@10 20108 =item B<prev_selected_pts>
yading@10 20109
yading@10 20110 the PTS of the last previously filtered video frame, NAN if undefined
yading@10 20111
yading@10 20112
yading@10 20113 =item B<prev_selected_t>
yading@10 20114
yading@10 20115 the PTS of the last previously selected video frame, NAN if undefined
yading@10 20116
yading@10 20117
yading@10 20118 =item B<start_pts>
yading@10 20119
yading@10 20120 the PTS of the first video frame in the video, NAN if undefined
yading@10 20121
yading@10 20122
yading@10 20123 =item B<start_t>
yading@10 20124
yading@10 20125 the time of the first video frame in the video, NAN if undefined
yading@10 20126
yading@10 20127
yading@10 20128 =item B<pict_type> I<(video only)>
yading@10 20129
yading@10 20130 the type of the filtered frame, can assume one of the following
yading@10 20131 values:
yading@10 20132
yading@10 20133 =over 4
yading@10 20134
yading@10 20135
yading@10 20136 =item B<I>
yading@10 20137
yading@10 20138
yading@10 20139 =item B<P>
yading@10 20140
yading@10 20141
yading@10 20142 =item B<B>
yading@10 20143
yading@10 20144
yading@10 20145 =item B<S>
yading@10 20146
yading@10 20147
yading@10 20148 =item B<SI>
yading@10 20149
yading@10 20150
yading@10 20151 =item B<SP>
yading@10 20152
yading@10 20153
yading@10 20154 =item B<BI>
yading@10 20155
yading@10 20156
yading@10 20157 =back
yading@10 20158
yading@10 20159
yading@10 20160
yading@10 20161 =item B<interlace_type> I<(video only)>
yading@10 20162
yading@10 20163 the frame interlace type, can assume one of the following values:
yading@10 20164
yading@10 20165 =over 4
yading@10 20166
yading@10 20167
yading@10 20168 =item B<PROGRESSIVE>
yading@10 20169
yading@10 20170 the frame is progressive (not interlaced)
yading@10 20171
yading@10 20172 =item B<TOPFIRST>
yading@10 20173
yading@10 20174 the frame is top-field-first
yading@10 20175
yading@10 20176 =item B<BOTTOMFIRST>
yading@10 20177
yading@10 20178 the frame is bottom-field-first
yading@10 20179
yading@10 20180 =back
yading@10 20181
yading@10 20182
yading@10 20183
yading@10 20184 =item B<consumed_sample_n> I<(audio only)>
yading@10 20185
yading@10 20186 the number of selected samples before the current frame
yading@10 20187
yading@10 20188
yading@10 20189 =item B<samples_n> I<(audio only)>
yading@10 20190
yading@10 20191 the number of samples in the current frame
yading@10 20192
yading@10 20193
yading@10 20194 =item B<sample_rate> I<(audio only)>
yading@10 20195
yading@10 20196 the input sample rate
yading@10 20197
yading@10 20198
yading@10 20199 =item B<key>
yading@10 20200
yading@10 20201 1 if the filtered frame is a key-frame, 0 otherwise
yading@10 20202
yading@10 20203
yading@10 20204 =item B<pos>
yading@10 20205
yading@10 20206 the position in the file of the filtered frame, -1 if the information
yading@10 20207 is not available (e.g. for synthetic video)
yading@10 20208
yading@10 20209
yading@10 20210 =item B<scene> I<(video only)>
yading@10 20211
yading@10 20212 value between 0 and 1 to indicate a new scene; a low value reflects a low
yading@10 20213 probability for the current frame to introduce a new scene, while a higher
yading@10 20214 value means the current frame is more likely to be one (see the example below)
yading@10 20215
yading@10 20216
yading@10 20217 =back
yading@10 20218
yading@10 20219
yading@10 20220 The default value of the select expression is "1".
yading@10 20221
yading@10 20222
yading@10 20223 =head3 Examples
yading@10 20224
yading@10 20225
yading@10 20226
yading@10 20227 =over 4
yading@10 20228
yading@10 20229
yading@10 20230 =item *
yading@10 20231
yading@10 20232 Select all frames in input:
yading@10 20233
yading@10 20234 select
yading@10 20235
yading@10 20236
yading@10 20237 The example above is the same as:
yading@10 20238
yading@10 20239 select=1
yading@10 20240
yading@10 20241
yading@10 20242
yading@10 20243 =item *
yading@10 20244
yading@10 20245 Skip all frames:
yading@10 20246
yading@10 20247 select=0
yading@10 20248
yading@10 20249
yading@10 20250
yading@10 20251 =item *
yading@10 20252
yading@10 20253 Select only I-frames:
yading@10 20254
yading@10 20255 select='eq(pict_type\,I)'
yading@10 20256
yading@10 20257
yading@10 20258
yading@10 20259 =item *
yading@10 20260
yading@10 20261 Select one frame every 100:
yading@10 20262
yading@10 20263 select='not(mod(n\,100))'
yading@10 20264
yading@10 20265
yading@10 20266
yading@10 20267 =item *
yading@10 20268
yading@10 20269 Select only frames contained in the 10-20 time interval:
yading@10 20270
yading@10 20271 select='gte(t\,10)*lte(t\,20)'
yading@10 20272
yading@10 20273
yading@10 20274
yading@10 20275 =item *
yading@10 20276
yading@10 20277 Select only I frames contained in the 10-20 time interval:
yading@10 20278
yading@10 20279 select='gte(t\,10)*lte(t\,20)*eq(pict_type\,I)'
yading@10 20280
yading@10 20281
yading@10 20282
yading@10 20283 =item *
yading@10 20284
yading@10 20285 Select frames with a minimum distance of 10 seconds:
yading@10 20286
yading@10 20287 select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
yading@10 20288
yading@10 20289
yading@10 20290
yading@10 20291 =item *
yading@10 20292
yading@10 20293 Use aselect to select only audio frames with samples number E<gt> 100:
yading@10 20294
yading@10 20295 aselect='gt(samples_n\,100)'
yading@10 20296
yading@10 20297
yading@10 20298
yading@10 20299 =item *
yading@10 20300
yading@10 20301 Create a mosaic of the first scenes:
yading@10 20302
yading@10 20303 ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
yading@10 20304
yading@10 20305
yading@10 20306 Comparing I<scene> against a value between 0.3 and 0.5 is generally a sane
yading@10 20307 choice.
yading@10 20308
yading@10 20309
yading@10 20310 =item *
yading@10 20311
yading@10 20312 Send even and odd frames to separate outputs, and compose them:
yading@10 20313
yading@10 20314 select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
yading@10 20315
yading@10 20316
yading@10 20317 =back
yading@10 20318
yading@10 20319
yading@10 20320
yading@10 20321 =head2 asendcmd, sendcmd
yading@10 20322
yading@10 20323
yading@10 20324 Send commands to filters in the filtergraph.
yading@10 20325
yading@10 20326 These filters read commands to be sent to other filters in the
yading@10 20327 filtergraph.
yading@10 20328
yading@10 20329 C<asendcmd> must be inserted between two audio filters,
yading@10 20330 C<sendcmd> must be inserted between two video filters, but apart
yading@10 20331 from that they act the same way.
yading@10 20332
yading@10 20333 The specification of commands can be provided in the filter arguments
yading@10 20334 with the I<commands> option, or in a file specified by the
yading@10 20335 I<filename> option.
yading@10 20336
yading@10 20337 These filters accept the following options:
yading@10 20338
yading@10 20339 =over 4
yading@10 20340
yading@10 20341
yading@10 20342 =item B<commands, c>
yading@10 20343
yading@10 20344 Set the commands to be read and sent to the other filters.
yading@10 20345
yading@10 20346 =item B<filename, f>
yading@10 20347
yading@10 20348 Set the filename of the commands to be read and sent to the other
yading@10 20349 filters.
yading@10 20350
yading@10 20351 =back
yading@10 20352
yading@10 20353
yading@10 20354
yading@10 20355 =head3 Commands syntax
yading@10 20356
yading@10 20357
yading@10 20358 A commands description consists of a sequence of interval
yading@10 20359 specifications, comprising a list of commands to be executed when a
yading@10 20360 particular event related to that interval occurs. The occurring event
yading@10 20361 is typically the current frame time entering or leaving a given time
yading@10 20362 interval.
yading@10 20363
yading@10 20364 An interval is specified by the following syntax:
yading@10 20365
yading@10 20366 <START>[-<END>] <COMMANDS>;
yading@10 20367
yading@10 20368
yading@10 20369 The time interval is specified by the I<START> and I<END> times.
yading@10 20370 I<END> is optional and defaults to the maximum time.
yading@10 20371
yading@10 20372 The current frame time is considered within the specified interval if
yading@10 20373 it is included in the interval [I<START>, I<END>), that is when
yading@10 20374 the time is greater or equal to I<START> and is lesser than
yading@10 20375 I<END>.
yading@10 20376
yading@10 20377 I<COMMANDS> consists of a sequence of one or more command
yading@10 20378 specifications, separated by ",", relating to that interval. The
yading@10 20379 syntax of a command specification is given by:
yading@10 20380
yading@10 20381 [<FLAGS>] <TARGET> <COMMAND> <ARG>
yading@10 20382
yading@10 20383
yading@10 20384 I<FLAGS> is optional and specifies the type of events relating to
yading@10 20385 the time interval which enable sending the specified command, and must
yading@10 20386 be a non-null sequence of identifier flags separated by "+" or "|" and
yading@10 20387 enclosed between "[" and "]".
yading@10 20388
yading@10 20389 The following flags are recognized:
yading@10 20390
yading@10 20391 =over 4
yading@10 20392
yading@10 20393
yading@10 20394 =item B<enter>
yading@10 20395
yading@10 20396 The command is sent when the current frame timestamp enters the
yading@10 20397 specified interval. In other words, the command is sent when the
yading@10 20398 previous frame timestamp was not in the given interval, and the
yading@10 20399 current is.
yading@10 20400
yading@10 20401
yading@10 20402 =item B<leave>
yading@10 20403
yading@10 20404 The command is sent when the current frame timestamp leaves the
yading@10 20405 specified interval. In other words, the command is sent when the
yading@10 20406 previous frame timestamp was in the given interval, and the
yading@10 20407 current is not.
yading@10 20408
yading@10 20409 =back
yading@10 20410
yading@10 20411
yading@10 20412 If I<FLAGS> is not specified, a default value of C<[enter]> is
yading@10 20413 assumed.
yading@10 20414
yading@10 20415 I<TARGET> specifies the target of the command, usually the name of
yading@10 20416 the filter class or a specific filter instance name.
yading@10 20417
yading@10 20418 I<COMMAND> specifies the name of the command for the target filter.
yading@10 20419
yading@10 20420 I<ARG> is optional and specifies the optional list of argument for
yading@10 20421 the given I<COMMAND>.
yading@10 20422
yading@10 20423 Between one interval specification and another, whitespaces, or
yading@10 20424 sequences of characters starting with C<#> until the end of line,
yading@10 20425 are ignored and can be used to annotate comments.
yading@10 20426
yading@10 20427 A simplified BNF description of the commands specification syntax
yading@10 20428 follows:
yading@10 20429
yading@10 20430 <COMMAND_FLAG> ::= "enter" | "leave"
yading@10 20431 <COMMAND_FLAGS> ::= <COMMAND_FLAG> [(+|"|")<COMMAND_FLAG>]
yading@10 20432 <COMMAND> ::= ["[" <COMMAND_FLAGS> "]"] <TARGET> <COMMAND> [<ARG>]
yading@10 20433 <COMMANDS> ::= <COMMAND> [,<COMMANDS>]
yading@10 20434 <INTERVAL> ::= <START>[-<END>] <COMMANDS>
yading@10 20435 <INTERVALS> ::= <INTERVAL>[;<INTERVALS>]
yading@10 20436
yading@10 20437
yading@10 20438
yading@10 20439 =head3 Examples
yading@10 20440
yading@10 20441
yading@10 20442
yading@10 20443 =over 4
yading@10 20444
yading@10 20445
yading@10 20446 =item *
yading@10 20447
yading@10 20448 Specify audio tempo change at second 4:
yading@10 20449
yading@10 20450 asendcmd=c='4.0 atempo tempo 1.5',atempo
yading@10 20451
yading@10 20452
yading@10 20453
yading@10 20454 =item *
yading@10 20455
yading@10 20456 Specify a list of drawtext and hue commands in a file.
yading@10 20457
yading@10 20458 # show text in the interval 5-10
yading@10 20459 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
yading@10 20460 [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
yading@10 20461
yading@10 20462 # desaturate the image in the interval 15-20
yading@10 20463 15.0-20.0 [enter] hue s 0,
yading@10 20464 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
yading@10 20465 [leave] hue s 1,
yading@10 20466 [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
yading@10 20467
yading@10 20468 # apply an exponential saturation fade-out effect, starting from time 25
yading@10 20469 25 [enter] hue s exp(25-t)
yading@10 20470
yading@10 20471
yading@10 20472 A filtergraph allowing to read and process the above command list
yading@10 20473 stored in a file F<test.cmd>, can be specified with:
yading@10 20474
yading@10 20475 sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
yading@10 20476
yading@10 20477
yading@10 20478 =back
yading@10 20479
yading@10 20480
yading@10 20481
yading@10 20482
yading@10 20483 =head2 asetpts, setpts
yading@10 20484
yading@10 20485
yading@10 20486 Change the PTS (presentation timestamp) of the input frames.
yading@10 20487
yading@10 20488 C<asetpts> works on audio frames, C<setpts> on video frames.
yading@10 20489
yading@10 20490 This filter accepts the following options:
yading@10 20491
yading@10 20492
yading@10 20493 =over 4
yading@10 20494
yading@10 20495
yading@10 20496
yading@10 20497 =item B<expr>
yading@10 20498
yading@10 20499 The expression which is evaluated for each frame to construct its timestamp.
yading@10 20500
yading@10 20501
yading@10 20502 =back
yading@10 20503
yading@10 20504
yading@10 20505 The expression is evaluated through the eval API and can contain the following
yading@10 20506 constants:
yading@10 20507
yading@10 20508
yading@10 20509 =over 4
yading@10 20510
yading@10 20511
yading@10 20512 =item B<FRAME_RATE>
yading@10 20513
yading@10 20514 frame rate, only defined for constant frame-rate video
yading@10 20515
yading@10 20516
yading@10 20517 =item B<PTS>
yading@10 20518
yading@10 20519 the presentation timestamp in input
yading@10 20520
yading@10 20521
yading@10 20522 =item B<N>
yading@10 20523
yading@10 20524 the count of the input frame, starting from 0.
yading@10 20525
yading@10 20526
yading@10 20527 =item B<NB_CONSUMED_SAMPLES>
yading@10 20528
yading@10 20529 the number of consumed samples, not including the current frame (only
yading@10 20530 audio)
yading@10 20531
yading@10 20532
yading@10 20533 =item B<NB_SAMPLES>
yading@10 20534
yading@10 20535 the number of samples in the current frame (only audio)
yading@10 20536
yading@10 20537
yading@10 20538 =item B<SAMPLE_RATE>
yading@10 20539
yading@10 20540 audio sample rate
yading@10 20541
yading@10 20542
yading@10 20543 =item B<STARTPTS>
yading@10 20544
yading@10 20545 the PTS of the first frame
yading@10 20546
yading@10 20547
yading@10 20548 =item B<STARTT>
yading@10 20549
yading@10 20550 the time in seconds of the first frame
yading@10 20551
yading@10 20552
yading@10 20553 =item B<INTERLACED>
yading@10 20554
yading@10 20555 tell if the current frame is interlaced
yading@10 20556
yading@10 20557
yading@10 20558 =item B<T>
yading@10 20559
yading@10 20560 the time in seconds of the current frame
yading@10 20561
yading@10 20562
yading@10 20563 =item B<TB>
yading@10 20564
yading@10 20565 the time base
yading@10 20566
yading@10 20567
yading@10 20568 =item B<POS>
yading@10 20569
yading@10 20570 original position in the file of the frame, or undefined if undefined
yading@10 20571 for the current frame
yading@10 20572
yading@10 20573
yading@10 20574 =item B<PREV_INPTS>
yading@10 20575
yading@10 20576 previous input PTS
yading@10 20577
yading@10 20578
yading@10 20579 =item B<PREV_INT>
yading@10 20580
yading@10 20581 previous input time in seconds
yading@10 20582
yading@10 20583
yading@10 20584 =item B<PREV_OUTPTS>
yading@10 20585
yading@10 20586 previous output PTS
yading@10 20587
yading@10 20588
yading@10 20589 =item B<PREV_OUTT>
yading@10 20590
yading@10 20591 previous output time in seconds
yading@10 20592
yading@10 20593
yading@10 20594 =item B<RTCTIME>
yading@10 20595
yading@10 20596 wallclock (RTC) time in microseconds. This is deprecated, use time(0)
yading@10 20597 instead.
yading@10 20598
yading@10 20599
yading@10 20600 =item B<RTCSTART>
yading@10 20601
yading@10 20602 wallclock (RTC) time at the start of the movie in microseconds
yading@10 20603
yading@10 20604 =back
yading@10 20605
yading@10 20606
yading@10 20607
yading@10 20608 =head3 Examples
yading@10 20609
yading@10 20610
yading@10 20611
yading@10 20612 =over 4
yading@10 20613
yading@10 20614
yading@10 20615 =item *
yading@10 20616
yading@10 20617 Start counting PTS from zero
yading@10 20618
yading@10 20619 setpts=PTS-STARTPTS
yading@10 20620
yading@10 20621
yading@10 20622
yading@10 20623 =item *
yading@10 20624
yading@10 20625 Apply fast motion effect:
yading@10 20626
yading@10 20627 setpts=0.5*PTS
yading@10 20628
yading@10 20629
yading@10 20630
yading@10 20631 =item *
yading@10 20632
yading@10 20633 Apply slow motion effect:
yading@10 20634
yading@10 20635 setpts=2.0*PTS
yading@10 20636
yading@10 20637
yading@10 20638
yading@10 20639 =item *
yading@10 20640
yading@10 20641 Set fixed rate of 25 frames per second:
yading@10 20642
yading@10 20643 setpts=N/(25*TB)
yading@10 20644
yading@10 20645
yading@10 20646
yading@10 20647 =item *
yading@10 20648
yading@10 20649 Set fixed rate 25 fps with some jitter:
yading@10 20650
yading@10 20651 setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
yading@10 20652
yading@10 20653
yading@10 20654
yading@10 20655 =item *
yading@10 20656
yading@10 20657 Apply an offset of 10 seconds to the input PTS:
yading@10 20658
yading@10 20659 setpts=PTS+10/TB
yading@10 20660
yading@10 20661
yading@10 20662
yading@10 20663 =item *
yading@10 20664
yading@10 20665 Generate timestamps from a "live source" and rebase onto the current timebase:
yading@10 20666
yading@10 20667 setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
yading@10 20668
yading@10 20669
yading@10 20670 =back
yading@10 20671
yading@10 20672
yading@10 20673
yading@10 20674 =head2 ebur128
yading@10 20675
yading@10 20676
yading@10 20677 EBU R128 scanner filter. This filter takes an audio stream as input and outputs
yading@10 20678 it unchanged. By default, it logs a message at a frequency of 10Hz with the
yading@10 20679 Momentary loudness (identified by C<M>), Short-term loudness (C<S>),
yading@10 20680 Integrated loudness (C<I>) and Loudness Range (C<LRA>).
yading@10 20681
yading@10 20682 The filter also has a video output (see the I<video> option) with a real
yading@10 20683 time graph to observe the loudness evolution. The graphic contains the logged
yading@10 20684 message mentioned above, so it is not printed anymore when this option is set,
yading@10 20685 unless the verbose logging is set. The main graphing area contains the
yading@10 20686 short-term loudness (3 seconds of analysis), and the gauge on the right is for
yading@10 20687 the momentary loudness (400 milliseconds).
yading@10 20688
yading@10 20689 More information about the Loudness Recommendation EBU R128 on
yading@10 20690 E<lt>B<http://tech.ebu.ch/loudness>E<gt>.
yading@10 20691
yading@10 20692 The filter accepts the following options:
yading@10 20693
yading@10 20694
yading@10 20695 =over 4
yading@10 20696
yading@10 20697
yading@10 20698
yading@10 20699 =item B<video>
yading@10 20700
yading@10 20701 Activate the video output. The audio stream is passed unchanged whether this
yading@10 20702 option is set or no. The video stream will be the first output stream if
yading@10 20703 activated. Default is C<0>.
yading@10 20704
yading@10 20705
yading@10 20706 =item B<size>
yading@10 20707
yading@10 20708 Set the video size. This option is for video only. Default and minimum
yading@10 20709 resolution is C<640x480>.
yading@10 20710
yading@10 20711
yading@10 20712 =item B<meter>
yading@10 20713
yading@10 20714 Set the EBU scale meter. Default is C<9>. Common values are C<9> and
yading@10 20715 C<18>, respectively for EBU scale meter +9 and EBU scale meter +18. Any
yading@10 20716 other integer value between this range is allowed.
yading@10 20717
yading@10 20718
yading@10 20719 =item B<metadata>
yading@10 20720
yading@10 20721 Set metadata injection. If set to C<1>, the audio input will be segmented
yading@10 20722 into 100ms output frames, each of them containing various loudness information
yading@10 20723 in metadata. All the metadata keys are prefixed with C<lavfi.r128.>.
yading@10 20724
yading@10 20725 Default is C<0>.
yading@10 20726
yading@10 20727
yading@10 20728 =item B<framelog>
yading@10 20729
yading@10 20730 Force the frame logging level.
yading@10 20731
yading@10 20732 Available values are:
yading@10 20733
yading@10 20734 =over 4
yading@10 20735
yading@10 20736
yading@10 20737 =item B<info>
yading@10 20738
yading@10 20739 information logging level
yading@10 20740
yading@10 20741 =item B<verbose>
yading@10 20742
yading@10 20743 verbose logging level
yading@10 20744
yading@10 20745 =back
yading@10 20746
yading@10 20747
yading@10 20748 By default, the logging level is set to I<info>. If the B<video> or
yading@10 20749 the B<metadata> options are set, it switches to I<verbose>.
yading@10 20750
yading@10 20751 =back
yading@10 20752
yading@10 20753
yading@10 20754
yading@10 20755 =head3 Examples
yading@10 20756
yading@10 20757
yading@10 20758
yading@10 20759 =over 4
yading@10 20760
yading@10 20761
yading@10 20762 =item *
yading@10 20763
yading@10 20764 Real-time graph using B<ffplay>, with a EBU scale meter +18:
yading@10 20765
yading@10 20766 ffplay -f lavfi -i "amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]"
yading@10 20767
yading@10 20768
yading@10 20769
yading@10 20770 =item *
yading@10 20771
yading@10 20772 Run an analysis with B<ffmpeg>:
yading@10 20773
yading@10 20774 ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
yading@10 20775
yading@10 20776
yading@10 20777 =back
yading@10 20778
yading@10 20779
yading@10 20780
yading@10 20781 =head2 settb, asettb
yading@10 20782
yading@10 20783
yading@10 20784 Set the timebase to use for the output frames timestamps.
yading@10 20785 It is mainly useful for testing timebase configuration.
yading@10 20786
yading@10 20787 This filter accepts the following options:
yading@10 20788
yading@10 20789
yading@10 20790 =over 4
yading@10 20791
yading@10 20792
yading@10 20793
yading@10 20794 =item B<expr, tb>
yading@10 20795
yading@10 20796 The expression which is evaluated into the output timebase.
yading@10 20797
yading@10 20798
yading@10 20799 =back
yading@10 20800
yading@10 20801
yading@10 20802 The value for B<tb> is an arithmetic expression representing a
yading@10 20803 rational. The expression can contain the constants "AVTB" (the default
yading@10 20804 timebase), "intb" (the input timebase) and "sr" (the sample rate,
yading@10 20805 audio only). Default value is "intb".
yading@10 20806
yading@10 20807
yading@10 20808 =head3 Examples
yading@10 20809
yading@10 20810
yading@10 20811
yading@10 20812 =over 4
yading@10 20813
yading@10 20814
yading@10 20815 =item *
yading@10 20816
yading@10 20817 Set the timebase to 1/25:
yading@10 20818
yading@10 20819 settb=expr=1/25
yading@10 20820
yading@10 20821
yading@10 20822
yading@10 20823 =item *
yading@10 20824
yading@10 20825 Set the timebase to 1/10:
yading@10 20826
yading@10 20827 settb=expr=0.1
yading@10 20828
yading@10 20829
yading@10 20830
yading@10 20831 =item *
yading@10 20832
yading@10 20833 Set the timebase to 1001/1000:
yading@10 20834
yading@10 20835 settb=1+0.001
yading@10 20836
yading@10 20837
yading@10 20838
yading@10 20839 =item *
yading@10 20840
yading@10 20841 Set the timebase to 2*intb:
yading@10 20842
yading@10 20843 settb=2*intb
yading@10 20844
yading@10 20845
yading@10 20846
yading@10 20847 =item *
yading@10 20848
yading@10 20849 Set the default timebase value:
yading@10 20850
yading@10 20851 settb=AVTB
yading@10 20852
yading@10 20853
yading@10 20854 =back
yading@10 20855
yading@10 20856
yading@10 20857
yading@10 20858 =head2 concat
yading@10 20859
yading@10 20860
yading@10 20861 Concatenate audio and video streams, joining them together one after the
yading@10 20862 other.
yading@10 20863
yading@10 20864 The filter works on segments of synchronized video and audio streams. All
yading@10 20865 segments must have the same number of streams of each type, and that will
yading@10 20866 also be the number of streams at output.
yading@10 20867
yading@10 20868 The filter accepts the following options:
yading@10 20869
yading@10 20870
yading@10 20871 =over 4
yading@10 20872
yading@10 20873
yading@10 20874
yading@10 20875 =item B<n>
yading@10 20876
yading@10 20877 Set the number of segments. Default is 2.
yading@10 20878
yading@10 20879
yading@10 20880 =item B<v>
yading@10 20881
yading@10 20882 Set the number of output video streams, that is also the number of video
yading@10 20883 streams in each segment. Default is 1.
yading@10 20884
yading@10 20885
yading@10 20886 =item B<a>
yading@10 20887
yading@10 20888 Set the number of output audio streams, that is also the number of video
yading@10 20889 streams in each segment. Default is 0.
yading@10 20890
yading@10 20891
yading@10 20892 =item B<unsafe>
yading@10 20893
yading@10 20894 Activate unsafe mode: do not fail if segments have a different format.
yading@10 20895
yading@10 20896
yading@10 20897 =back
yading@10 20898
yading@10 20899
yading@10 20900 The filter has I<v>+I<a> outputs: first I<v> video outputs, then
yading@10 20901 I<a> audio outputs.
yading@10 20902
yading@10 20903 There are I<n>x(I<v>+I<a>) inputs: first the inputs for the first
yading@10 20904 segment, in the same order as the outputs, then the inputs for the second
yading@10 20905 segment, etc.
yading@10 20906
yading@10 20907 Related streams do not always have exactly the same duration, for various
yading@10 20908 reasons including codec frame size or sloppy authoring. For that reason,
yading@10 20909 related synchronized streams (e.g. a video and its audio track) should be
yading@10 20910 concatenated at once. The concat filter will use the duration of the longest
yading@10 20911 stream in each segment (except the last one), and if necessary pad shorter
yading@10 20912 audio streams with silence.
yading@10 20913
yading@10 20914 For this filter to work correctly, all segments must start at timestamp 0.
yading@10 20915
yading@10 20916 All corresponding streams must have the same parameters in all segments; the
yading@10 20917 filtering system will automatically select a common pixel format for video
yading@10 20918 streams, and a common sample format, sample rate and channel layout for
yading@10 20919 audio streams, but other settings, such as resolution, must be converted
yading@10 20920 explicitly by the user.
yading@10 20921
yading@10 20922 Different frame rates are acceptable but will result in variable frame rate
yading@10 20923 at output; be sure to configure the output file to handle it.
yading@10 20924
yading@10 20925
yading@10 20926 =head3 Examples
yading@10 20927
yading@10 20928
yading@10 20929
yading@10 20930 =over 4
yading@10 20931
yading@10 20932
yading@10 20933 =item *
yading@10 20934
yading@10 20935 Concatenate an opening, an episode and an ending, all in bilingual version
yading@10 20936 (video in stream 0, audio in streams 1 and 2):
yading@10 20937
yading@10 20938 ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
yading@10 20939 '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
yading@10 20940 concat=n=3:v=1:a=2 [v] [a1] [a2]' \
yading@10 20941 -map '[v]' -map '[a1]' -map '[a2]' output.mkv
yading@10 20942
yading@10 20943
yading@10 20944
yading@10 20945 =item *
yading@10 20946
yading@10 20947 Concatenate two parts, handling audio and video separately, using the
yading@10 20948 (a)movie sources, and adjusting the resolution:
yading@10 20949
yading@10 20950 movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
yading@10 20951 movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
yading@10 20952 [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
yading@10 20953
yading@10 20954 Note that a desync will happen at the stitch if the audio and video streams
yading@10 20955 do not have exactly the same duration in the first file.
yading@10 20956
yading@10 20957
yading@10 20958 =back
yading@10 20959
yading@10 20960
yading@10 20961
yading@10 20962 =head2 showspectrum
yading@10 20963
yading@10 20964
yading@10 20965 Convert input audio to a video output, representing the audio frequency
yading@10 20966 spectrum.
yading@10 20967
yading@10 20968 The filter accepts the following options:
yading@10 20969
yading@10 20970
yading@10 20971 =over 4
yading@10 20972
yading@10 20973
yading@10 20974 =item B<size, s>
yading@10 20975
yading@10 20976 Specify the video size for the output. Default value is C<640x512>.
yading@10 20977
yading@10 20978
yading@10 20979 =item B<slide>
yading@10 20980
yading@10 20981 Specify if the spectrum should slide along the window. Default value is
yading@10 20982 C<0>.
yading@10 20983
yading@10 20984
yading@10 20985 =item B<mode>
yading@10 20986
yading@10 20987 Specify display mode.
yading@10 20988
yading@10 20989 It accepts the following values:
yading@10 20990
yading@10 20991 =over 4
yading@10 20992
yading@10 20993
yading@10 20994 =item B<combined>
yading@10 20995
yading@10 20996 all channels are displayed in the same row
yading@10 20997
yading@10 20998 =item B<separate>
yading@10 20999
yading@10 21000 all channels are displayed in separate rows
yading@10 21001
yading@10 21002 =back
yading@10 21003
yading@10 21004
yading@10 21005 Default value is B<combined>.
yading@10 21006
yading@10 21007
yading@10 21008 =item B<color>
yading@10 21009
yading@10 21010 Specify display color mode.
yading@10 21011
yading@10 21012 It accepts the following values:
yading@10 21013
yading@10 21014 =over 4
yading@10 21015
yading@10 21016
yading@10 21017 =item B<channel>
yading@10 21018
yading@10 21019 each channel is displayed in a separate color
yading@10 21020
yading@10 21021 =item B<intensity>
yading@10 21022
yading@10 21023 each channel is is displayed using the same color scheme
yading@10 21024
yading@10 21025 =back
yading@10 21026
yading@10 21027
yading@10 21028 Default value is B<channel>.
yading@10 21029
yading@10 21030
yading@10 21031 =item B<scale>
yading@10 21032
yading@10 21033 Specify scale used for calculating intensity color values.
yading@10 21034
yading@10 21035 It accepts the following values:
yading@10 21036
yading@10 21037 =over 4
yading@10 21038
yading@10 21039
yading@10 21040 =item B<lin>
yading@10 21041
yading@10 21042 linear
yading@10 21043
yading@10 21044 =item B<sqrt>
yading@10 21045
yading@10 21046 square root, default
yading@10 21047
yading@10 21048 =item B<cbrt>
yading@10 21049
yading@10 21050 cubic root
yading@10 21051
yading@10 21052 =item B<log>
yading@10 21053
yading@10 21054 logarithmic
yading@10 21055
yading@10 21056 =back
yading@10 21057
yading@10 21058
yading@10 21059 Default value is B<sqrt>.
yading@10 21060
yading@10 21061
yading@10 21062 =item B<saturation>
yading@10 21063
yading@10 21064 Set saturation modifier for displayed colors. Negative values provide
yading@10 21065 alternative color scheme. C<0> is no saturation at all.
yading@10 21066 Saturation must be in [-10.0, 10.0] range.
yading@10 21067 Default value is C<1>.
yading@10 21068
yading@10 21069 =back
yading@10 21070
yading@10 21071
yading@10 21072 The usage is very similar to the showwaves filter; see the examples in that
yading@10 21073 section.
yading@10 21074
yading@10 21075
yading@10 21076 =head3 Examples
yading@10 21077
yading@10 21078
yading@10 21079
yading@10 21080 =over 4
yading@10 21081
yading@10 21082
yading@10 21083 =item *
yading@10 21084
yading@10 21085 Large window with logarithmic color scaling:
yading@10 21086
yading@10 21087 showspectrum=s=1280x480:scale=log
yading@10 21088
yading@10 21089
yading@10 21090
yading@10 21091 =item *
yading@10 21092
yading@10 21093 Complete example for a colored and sliding spectrum per channel using B<ffplay>:
yading@10 21094
yading@10 21095 ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
yading@10 21096 [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
yading@10 21097
yading@10 21098
yading@10 21099 =back
yading@10 21100
yading@10 21101
yading@10 21102
yading@10 21103 =head2 showwaves
yading@10 21104
yading@10 21105
yading@10 21106 Convert input audio to a video output, representing the samples waves.
yading@10 21107
yading@10 21108 The filter accepts the following options:
yading@10 21109
yading@10 21110
yading@10 21111 =over 4
yading@10 21112
yading@10 21113
yading@10 21114 =item B<size, s>
yading@10 21115
yading@10 21116 Specify the video size for the output. Default value is "600x240".
yading@10 21117
yading@10 21118
yading@10 21119 =item B<mode>
yading@10 21120
yading@10 21121 Set display mode.
yading@10 21122
yading@10 21123 Available values are:
yading@10 21124
yading@10 21125 =over 4
yading@10 21126
yading@10 21127
yading@10 21128 =item B<point>
yading@10 21129
yading@10 21130 Draw a point for each sample.
yading@10 21131
yading@10 21132
yading@10 21133 =item B<line>
yading@10 21134
yading@10 21135 Draw a vertical line for each sample.
yading@10 21136
yading@10 21137 =back
yading@10 21138
yading@10 21139
yading@10 21140 Default value is C<point>.
yading@10 21141
yading@10 21142
yading@10 21143 =item B<n>
yading@10 21144
yading@10 21145 Set the number of samples which are printed on the same column. A
yading@10 21146 larger value will decrease the frame rate. Must be a positive
yading@10 21147 integer. This option can be set only if the value for I<rate>
yading@10 21148 is not explicitly specified.
yading@10 21149
yading@10 21150
yading@10 21151 =item B<rate, r>
yading@10 21152
yading@10 21153 Set the (approximate) output frame rate. This is done by setting the
yading@10 21154 option I<n>. Default value is "25".
yading@10 21155
yading@10 21156
yading@10 21157 =back
yading@10 21158
yading@10 21159
yading@10 21160
yading@10 21161 =head3 Examples
yading@10 21162
yading@10 21163
yading@10 21164
yading@10 21165 =over 4
yading@10 21166
yading@10 21167
yading@10 21168 =item *
yading@10 21169
yading@10 21170 Output the input file audio and the corresponding video representation
yading@10 21171 at the same time:
yading@10 21172
yading@10 21173 amovie=a.mp3,asplit[out0],showwaves[out1]
yading@10 21174
yading@10 21175
yading@10 21176
yading@10 21177 =item *
yading@10 21178
yading@10 21179 Create a synthetic signal and show it with showwaves, forcing a
yading@10 21180 frame rate of 30 frames per second:
yading@10 21181
yading@10 21182 aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
yading@10 21183
yading@10 21184
yading@10 21185 =back
yading@10 21186
yading@10 21187
yading@10 21188
yading@10 21189 =head2 split, asplit
yading@10 21190
yading@10 21191
yading@10 21192 Split input into several identical outputs.
yading@10 21193
yading@10 21194 C<asplit> works with audio input, C<split> with video.
yading@10 21195
yading@10 21196 The filter accepts a single parameter which specifies the number of outputs. If
yading@10 21197 unspecified, it defaults to 2.
yading@10 21198
yading@10 21199
yading@10 21200 =head3 Examples
yading@10 21201
yading@10 21202
yading@10 21203
yading@10 21204 =over 4
yading@10 21205
yading@10 21206
yading@10 21207 =item *
yading@10 21208
yading@10 21209 Create two separate outputs from the same input:
yading@10 21210
yading@10 21211 [in] split [out0][out1]
yading@10 21212
yading@10 21213
yading@10 21214
yading@10 21215 =item *
yading@10 21216
yading@10 21217 To create 3 or more outputs, you need to specify the number of
yading@10 21218 outputs, like in:
yading@10 21219
yading@10 21220 [in] asplit=3 [out0][out1][out2]
yading@10 21221
yading@10 21222
yading@10 21223
yading@10 21224 =item *
yading@10 21225
yading@10 21226 Create two separate outputs from the same input, one cropped and
yading@10 21227 one padded:
yading@10 21228
yading@10 21229 [in] split [splitout1][splitout2];
yading@10 21230 [splitout1] crop=100:100:0:0 [cropout];
yading@10 21231 [splitout2] pad=200:200:100:100 [padout];
yading@10 21232
yading@10 21233
yading@10 21234
yading@10 21235 =item *
yading@10 21236
yading@10 21237 Create 5 copies of the input audio with B<ffmpeg>:
yading@10 21238
yading@10 21239 ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
yading@10 21240
yading@10 21241
yading@10 21242 =back
yading@10 21243
yading@10 21244
yading@10 21245
yading@10 21246
yading@10 21247 =head1 MULTIMEDIA SOURCES
yading@10 21248
yading@10 21249
yading@10 21250 Below is a description of the currently available multimedia sources.
yading@10 21251
yading@10 21252
yading@10 21253 =head2 amovie
yading@10 21254
yading@10 21255
yading@10 21256 This is the same as movie source, except it selects an audio
yading@10 21257 stream by default.
yading@10 21258
yading@10 21259
yading@10 21260
yading@10 21261 =head2 movie
yading@10 21262
yading@10 21263
yading@10 21264 Read audio and/or video stream(s) from a movie container.
yading@10 21265
yading@10 21266 This filter accepts the following options:
yading@10 21267
yading@10 21268
yading@10 21269 =over 4
yading@10 21270
yading@10 21271
yading@10 21272 =item B<filename>
yading@10 21273
yading@10 21274 The name of the resource to read (not necessarily a file but also a device or a
yading@10 21275 stream accessed through some protocol).
yading@10 21276
yading@10 21277
yading@10 21278 =item B<format_name, f>
yading@10 21279
yading@10 21280 Specifies the format assumed for the movie to read, and can be either
yading@10 21281 the name of a container or an input device. If not specified the
yading@10 21282 format is guessed from I<movie_name> or by probing.
yading@10 21283
yading@10 21284
yading@10 21285 =item B<seek_point, sp>
yading@10 21286
yading@10 21287 Specifies the seek point in seconds, the frames will be output
yading@10 21288 starting from this seek point, the parameter is evaluated with
yading@10 21289 C<av_strtod> so the numerical value may be suffixed by an IS
yading@10 21290 postfix. Default value is "0".
yading@10 21291
yading@10 21292
yading@10 21293 =item B<streams, s>
yading@10 21294
yading@10 21295 Specifies the streams to read. Several streams can be specified,
yading@10 21296 separated by "+". The source will then have as many outputs, in the
yading@10 21297 same order. The syntax is explained in the ``Stream specifiers''
yading@10 21298 section in the ffmpeg manual. Two special names, "dv" and "da" specify
yading@10 21299 respectively the default (best suited) video and audio stream. Default
yading@10 21300 is "dv", or "da" if the filter is called as "amovie".
yading@10 21301
yading@10 21302
yading@10 21303 =item B<stream_index, si>
yading@10 21304
yading@10 21305 Specifies the index of the video stream to read. If the value is -1,
yading@10 21306 the best suited video stream will be automatically selected. Default
yading@10 21307 value is "-1". Deprecated. If the filter is called "amovie", it will select
yading@10 21308 audio instead of video.
yading@10 21309
yading@10 21310
yading@10 21311 =item B<loop>
yading@10 21312
yading@10 21313 Specifies how many times to read the stream in sequence.
yading@10 21314 If the value is less than 1, the stream will be read again and again.
yading@10 21315 Default value is "1".
yading@10 21316
yading@10 21317 Note that when the movie is looped the source timestamps are not
yading@10 21318 changed, so it will generate non monotonically increasing timestamps.
yading@10 21319
yading@10 21320 =back
yading@10 21321
yading@10 21322
yading@10 21323 This filter allows to overlay a second video on top of main input of
yading@10 21324 a filtergraph as shown in this graph:
yading@10 21325
yading@10 21326 input -----------> deltapts0 --> overlay --> output
yading@10 21327 ^
yading@10 21328 |
yading@10 21329 movie --> scale--> deltapts1 -------+
yading@10 21330
yading@10 21331
yading@10 21332
yading@10 21333 =head3 Examples
yading@10 21334
yading@10 21335
yading@10 21336
yading@10 21337 =over 4
yading@10 21338
yading@10 21339
yading@10 21340 =item *
yading@10 21341
yading@10 21342 Skip 3.2 seconds from the start of the avi file in.avi, and overlay it
yading@10 21343 on top of the input labelled as "in":
yading@10 21344
yading@10 21345 movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
yading@10 21346 [in] setpts=PTS-STARTPTS [main];
yading@10 21347 [main][over] overlay=16:16 [out]
yading@10 21348
yading@10 21349
yading@10 21350
yading@10 21351 =item *
yading@10 21352
yading@10 21353 Read from a video4linux2 device, and overlay it on top of the input
yading@10 21354 labelled as "in":
yading@10 21355
yading@10 21356 movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
yading@10 21357 [in] setpts=PTS-STARTPTS [main];
yading@10 21358 [main][over] overlay=16:16 [out]
yading@10 21359
yading@10 21360
yading@10 21361
yading@10 21362 =item *
yading@10 21363
yading@10 21364 Read the first video stream and the audio stream with id 0x81 from
yading@10 21365 dvd.vob; the video is connected to the pad named "video" and the audio is
yading@10 21366 connected to the pad named "audio":
yading@10 21367
yading@10 21368 movie=dvd.vob:s=v:0+#0x81 [video] [audio]
yading@10 21369
yading@10 21370
yading@10 21371 =back
yading@10 21372
yading@10 21373
yading@10 21374
yading@10 21375
yading@10 21376 =head1 SEE ALSO
yading@10 21377
yading@10 21378
yading@10 21379
yading@10 21380 ffserver(1),
yading@10 21381 the F<doc/ffserver.conf> example, ffmpeg(1), ffplay(1), ffprobe(1),
yading@10 21382 ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1),
yading@10 21383 ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1),
yading@10 21384 ffmpeg-devices(1), ffmpeg-protocols(1), ffmpeg-filters(1)
yading@10 21385
yading@10 21386
yading@10 21387 =head1 AUTHORS
yading@10 21388
yading@10 21389
yading@10 21390 The FFmpeg developers.
yading@10 21391
yading@10 21392 For details about the authorship, see the Git history of the project
yading@10 21393 (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
yading@10 21394 B<git log> in the FFmpeg source directory, or browsing the
yading@10 21395 online repository at E<lt>B<http://source.ffmpeg.org>E<gt>.
yading@10 21396
yading@10 21397 Maintainers for the specific components are listed in the file
yading@10 21398 F<MAINTAINERS> in the source code tree.
yading@10 21399
yading@10 21400
yading@10 21401