1FFMPEG-FILTERS(1) FFMPEG-FILTERS(1)
2
3
4
6 ffmpeg-filters - FFmpeg filters
7
9 This document describes filters, sources, and sinks provided by the
10 libavfilter library.
11
13 Filtering in FFmpeg is enabled through the libavfilter library.
14
15 In libavfilter, a filter can have multiple inputs and multiple outputs.
16 To illustrate the sorts of things that are possible, we consider the
17 following filtergraph.
18
19 [main]
20 input --> split ---------------------> overlay --> output
21 | ^
22 |[tmp] [flip]|
23 +-----> crop --> vflip -------+
24
25 This filtergraph splits the input stream in two streams, then sends one
26 stream through the crop filter and the vflip filter, before merging it
27 back with the other stream by overlaying it on top. You can use the
28 following command to achieve this:
29
30 ffmpeg -i INPUT -vf "split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2" OUTPUT
31
32 The result will be that the top half of the video is mirrored onto the
33 bottom half of the output video.
34
35 Filters in the same linear chain are separated by commas, and distinct
36 linear chains of filters are separated by semicolons. In our example,
37 crop,vflip are in one linear chain, split and overlay are separately in
38 another. The points where the linear chains join are labelled by names
39 enclosed in square brackets. In the example, the split filter generates
40 two outputs that are associated to the labels [main] and [tmp].
41
42 The stream sent to the second output of split, labelled as [tmp], is
43 processed through the crop filter, which crops away the lower half part
44 of the video, and then vertically flipped. The overlay filter takes in
45 input the first unchanged output of the split filter (which was
46 labelled as [main]), and overlay on its lower half the output generated
47 by the crop,vflip filterchain.
48
49 Some filters take in input a list of parameters: they are specified
50 after the filter name and an equal sign, and are separated from each
51 other by a colon.
52
53 There exist so-called source filters that do not have an audio/video
54 input, and sink filters that will not have audio/video output.
55
57 The graph2dot program included in the FFmpeg tools directory can be
58 used to parse a filtergraph description and issue a corresponding
59 textual representation in the dot language.
60
61 Invoke the command:
62
63 graph2dot -h
64
65 to see how to use graph2dot.
66
67 You can then pass the dot description to the dot program (from the
68 graphviz suite of programs) and obtain a graphical representation of
69 the filtergraph.
70
71 For example the sequence of commands:
72
73 echo <GRAPH_DESCRIPTION> | \
74 tools/graph2dot -o graph.tmp && \
75 dot -Tpng graph.tmp -o graph.png && \
76 display graph.png
77
78 can be used to create and display an image representing the graph
79 described by the GRAPH_DESCRIPTION string. Note that this string must
80 be a complete self-contained graph, with its inputs and outputs
81 explicitly defined. For example if your command line is of the form:
82
83 ffmpeg -i infile -vf scale=640:360 outfile
84
85 your GRAPH_DESCRIPTION string will need to be of the form:
86
87 nullsrc,scale=640:360,nullsink
88
89 you may also need to set the nullsrc parameters and add a format filter
90 in order to simulate a specific input file.
91
93 A filtergraph is a directed graph of connected filters. It can contain
94 cycles, and there can be multiple links between a pair of filters. Each
95 link has one input pad on one side connecting it to one filter from
96 which it takes its input, and one output pad on the other side
97 connecting it to one filter accepting its output.
98
99 Each filter in a filtergraph is an instance of a filter class
100 registered in the application, which defines the features and the
101 number of input and output pads of the filter.
102
103 A filter with no input pads is called a "source", and a filter with no
104 output pads is called a "sink".
105
106 Filtergraph syntax
107 A filtergraph has a textual representation, which is recognized by the
108 -filter/-vf/-af and -filter_complex options in ffmpeg and -vf/-af in
109 ffplay, and by the avfilter_graph_parse_ptr() function defined in
110 libavfilter/avfilter.h.
111
112 A filterchain consists of a sequence of connected filters, each one
113 connected to the previous one in the sequence. A filterchain is
114 represented by a list of ","-separated filter descriptions.
115
116 A filtergraph consists of a sequence of filterchains. A sequence of
117 filterchains is represented by a list of ";"-separated filterchain
118 descriptions.
119
120 A filter is represented by a string of the form:
121 [in_link_1]...[in_link_N]filter_name@id=arguments[out_link_1]...[out_link_M]
122
123 filter_name is the name of the filter class of which the described
124 filter is an instance of, and has to be the name of one of the filter
125 classes registered in the program optionally followed by "@id". The
126 name of the filter class is optionally followed by a string
127 "=arguments".
128
129 arguments is a string which contains the parameters used to initialize
130 the filter instance. It may have one of two forms:
131
132 • A ':'-separated list of key=value pairs.
133
134 • A ':'-separated list of value. In this case, the keys are assumed
135 to be the option names in the order they are declared. E.g. the
136 "fade" filter declares three options in this order -- type,
137 start_frame and nb_frames. Then the parameter list in:0:30 means
138 that the value in is assigned to the option type, 0 to start_frame
139 and 30 to nb_frames.
140
141 • A ':'-separated list of mixed direct value and long key=value
142 pairs. The direct value must precede the key=value pairs, and
143 follow the same constraints order of the previous point. The
144 following key=value pairs can be set in any preferred order.
145
146 If the option value itself is a list of items (e.g. the "format" filter
147 takes a list of pixel formats), the items in the list are usually
148 separated by |.
149
150 The list of arguments can be quoted using the character ' as initial
151 and ending mark, and the character \ for escaping the characters within
152 the quoted text; otherwise the argument string is considered terminated
153 when the next special character (belonging to the set []=;,) is
154 encountered.
155
156 A special syntax implemented in the ffmpeg CLI tool allows loading
157 option values from files. This is done be prepending a slash '/' to the
158 option name, then the supplied value is interpreted as a path from
159 which the actual value is loaded. E.g.
160
161 ffmpeg -i <INPUT> -vf drawtext=/text=/tmp/some_text <OUTPUT>
162
163 will load the text to be drawn from /tmp/some_text. API users wishing
164 to implement a similar feature should use the
165 "avfilter_graph_segment_*()" functions together with custom IO code.
166
167 The name and arguments of the filter are optionally preceded and
168 followed by a list of link labels. A link label allows one to name a
169 link and associate it to a filter output or input pad. The preceding
170 labels in_link_1 ... in_link_N, are associated to the filter input
171 pads, the following labels out_link_1 ... out_link_M, are associated to
172 the output pads.
173
174 When two link labels with the same name are found in the filtergraph, a
175 link between the corresponding input and output pad is created.
176
177 If an output pad is not labelled, it is linked by default to the first
178 unlabelled input pad of the next filter in the filterchain. For
179 example in the filterchain
180
181 nullsrc, split[L1], [L2]overlay, nullsink
182
183 the split filter instance has two output pads, and the overlay filter
184 instance two input pads. The first output pad of split is labelled
185 "L1", the first input pad of overlay is labelled "L2", and the second
186 output pad of split is linked to the second input pad of overlay, which
187 are both unlabelled.
188
189 In a filter description, if the input label of the first filter is not
190 specified, "in" is assumed; if the output label of the last filter is
191 not specified, "out" is assumed.
192
193 In a complete filterchain all the unlabelled filter input and output
194 pads must be connected. A filtergraph is considered valid if all the
195 filter input and output pads of all the filterchains are connected.
196
197 Libavfilter will automatically insert scale filters where format
198 conversion is required. It is possible to specify swscale flags for
199 those automatically inserted scalers by prepending "sws_flags=flags;"
200 to the filtergraph description.
201
202 Here is a BNF description of the filtergraph syntax:
203
204 <NAME> ::= sequence of alphanumeric characters and '_'
205 <FILTER_NAME> ::= <NAME>["@"<NAME>]
206 <LINKLABEL> ::= "[" <NAME> "]"
207 <LINKLABELS> ::= <LINKLABEL> [<LINKLABELS>]
208 <FILTER_ARGUMENTS> ::= sequence of chars (possibly quoted)
209 <FILTER> ::= [<LINKLABELS>] <FILTER_NAME> ["=" <FILTER_ARGUMENTS>] [<LINKLABELS>]
210 <FILTERCHAIN> ::= <FILTER> [,<FILTERCHAIN>]
211 <FILTERGRAPH> ::= [sws_flags=<flags>;] <FILTERCHAIN> [;<FILTERGRAPH>]
212
213 Notes on filtergraph escaping
214 Filtergraph description composition entails several levels of escaping.
215 See the "Quoting and escaping" section in the ffmpeg-utils(1) manual
216 for more information about the employed escaping procedure.
217
218 A first level escaping affects the content of each filter option value,
219 which may contain the special character ":" used to separate values, or
220 one of the escaping characters "\'".
221
222 A second level escaping affects the whole filter description, which may
223 contain the escaping characters "\'" or the special characters "[],;"
224 used by the filtergraph description.
225
226 Finally, when you specify a filtergraph on a shell commandline, you
227 need to perform a third level escaping for the shell special characters
228 contained within it.
229
230 For example, consider the following string to be embedded in the
231 drawtext filter description text value:
232
233 this is a 'string': may contain one, or more, special characters
234
235 This string contains the "'" special escaping character, and the ":"
236 special character, so it needs to be escaped in this way:
237
238 text=this is a \'string\'\: may contain one, or more, special characters
239
240 A second level of escaping is required when embedding the filter
241 description in a filtergraph description, in order to escape all the
242 filtergraph special characters. Thus the example above becomes:
243
244 drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
245
246 (note that in addition to the "\'" escaping special characters, also
247 "," needs to be escaped).
248
249 Finally an additional level of escaping is needed when writing the
250 filtergraph description in a shell command, which depends on the
251 escaping rules of the adopted shell. For example, assuming that "\" is
252 special and needs to be escaped with another "\", the previous string
253 will finally result in:
254
255 -vf "drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters"
256
258 Some filters support a generic enable option. For the filters
259 supporting timeline editing, this option can be set to an expression
260 which is evaluated before sending a frame to the filter. If the
261 evaluation is non-zero, the filter will be enabled, otherwise the frame
262 will be sent unchanged to the next filter in the filtergraph.
263
264 The expression accepts the following values:
265
266 t timestamp expressed in seconds, NAN if the input timestamp is
267 unknown
268
269 n sequential number of the input frame, starting from 0
270
271 pos the position in the file of the input frame, NAN if unknown
272
273 w
274 h width and height of the input frame if video
275
276 Additionally, these filters support an enable command that can be used
277 to re-define the expression.
278
279 Like any other filtering option, the enable option follows the same
280 rules.
281
282 For example, to enable a blur filter (smartblur) from 10 seconds to 3
283 minutes, and a curves filter starting at 3 seconds:
284
285 smartblur = enable='between(t,10,3*60)',
286 curves = enable='gte(t,3)' : preset=cross_process
287
288 See "ffmpeg -filters" to view which filters have timeline support.
289
291 Some options can be changed during the operation of the filter using a
292 command. These options are marked 'T' on the output of ffmpeg -h
293 filter=<name of filter>. The name of the command is the name of the
294 option and the argument is the new value.
295
297 Some filters with several inputs support a common set of options.
298 These options can only be set by name, not with the short notation.
299
300 eof_action
301 The action to take when EOF is encountered on the secondary input;
302 it accepts one of the following values:
303
304 repeat
305 Repeat the last frame (the default).
306
307 endall
308 End both streams.
309
310 pass
311 Pass the main input through.
312
313 shortest
314 If set to 1, force the output to terminate when the shortest input
315 terminates. Default value is 0.
316
317 repeatlast
318 If set to 1, force the filter to extend the last frame of secondary
319 streams until the end of the primary stream. A value of 0 disables
320 this behavior. Default value is 1.
321
322 ts_sync_mode
323 How strictly to sync streams based on secondary input timestamps;
324 it accepts one of the following values:
325
326 default
327 Frame from secondary input with the nearest lower or equal
328 timestamp to the primary input frame.
329
330 nearest
331 Frame from secondary input with the absolute nearest timestamp
332 to the primary input frame.
333
335 When you configure your FFmpeg build, you can disable any of the
336 existing filters using "--disable-filters". The configure output will
337 show the audio filters included in your build.
338
339 Below is a description of the currently available audio filters.
340
341 acompressor
342 A compressor is mainly used to reduce the dynamic range of a signal.
343 Especially modern music is mostly compressed at a high ratio to improve
344 the overall loudness. It's done to get the highest attention of a
345 listener, "fatten" the sound and bring more "power" to the track. If a
346 signal is compressed too much it may sound dull or "dead" afterwards or
347 it may start to "pump" (which could be a powerful effect but can also
348 destroy a track completely). The right compression is the key to reach
349 a professional sound and is the high art of mixing and mastering.
350 Because of its complex settings it may take a long time to get the
351 right feeling for this kind of effect.
352
353 Compression is done by detecting the volume above a chosen level
354 "threshold" and dividing it by the factor set with "ratio". So if you
355 set the threshold to -12dB and your signal reaches -6dB a ratio of 2:1
356 will result in a signal at -9dB. Because an exact manipulation of the
357 signal would cause distortion of the waveform the reduction can be
358 levelled over the time. This is done by setting "Attack" and "Release".
359 "attack" determines how long the signal has to rise above the threshold
360 before any reduction will occur and "release" sets the time the signal
361 has to fall below the threshold to reduce the reduction again. Shorter
362 signals than the chosen attack time will be left untouched. The
363 overall reduction of the signal can be made up afterwards with the
364 "makeup" setting. So compressing the peaks of a signal about 6dB and
365 raising the makeup to this level results in a signal twice as loud than
366 the source. To gain a softer entry in the compression the "knee"
367 flattens the hard edge at the threshold in the range of the chosen
368 decibels.
369
370 The filter accepts the following options:
371
372 level_in
373 Set input gain. Default is 1. Range is between 0.015625 and 64.
374
375 mode
376 Set mode of compressor operation. Can be "upward" or "downward".
377 Default is "downward".
378
379 threshold
380 If a signal of stream rises above this level it will affect the
381 gain reduction. By default it is 0.125. Range is between
382 0.00097563 and 1.
383
384 ratio
385 Set a ratio by which the signal is reduced. 1:2 means that if the
386 level rose 4dB above the threshold, it will be only 2dB above after
387 the reduction. Default is 2. Range is between 1 and 20.
388
389 attack
390 Amount of milliseconds the signal has to rise above the threshold
391 before gain reduction starts. Default is 20. Range is between 0.01
392 and 2000.
393
394 release
395 Amount of milliseconds the signal has to fall below the threshold
396 before reduction is decreased again. Default is 250. Range is
397 between 0.01 and 9000.
398
399 makeup
400 Set the amount by how much signal will be amplified after
401 processing. Default is 1. Range is from 1 to 64.
402
403 knee
404 Curve the sharp knee around the threshold to enter gain reduction
405 more softly. Default is 2.82843. Range is between 1 and 8.
406
407 link
408 Choose if the "average" level between all channels of input stream
409 or the louder("maximum") channel of input stream affects the
410 reduction. Default is "average".
411
412 detection
413 Should the exact signal be taken in case of "peak" or an RMS one in
414 case of "rms". Default is "rms" which is mostly smoother.
415
416 mix How much to use compressed signal in output. Default is 1. Range
417 is between 0 and 1.
418
419 Commands
420
421 This filter supports the all above options as commands.
422
423 acontrast
424 Simple audio dynamic range compression/expansion filter.
425
426 The filter accepts the following options:
427
428 contrast
429 Set contrast. Default is 33. Allowed range is between 0 and 100.
430
431 acopy
432 Copy the input audio source unchanged to the output. This is mainly
433 useful for testing purposes.
434
435 acrossfade
436 Apply cross fade from one input audio stream to another input audio
437 stream. The cross fade is applied for specified duration near the end
438 of first stream.
439
440 The filter accepts the following options:
441
442 nb_samples, ns
443 Specify the number of samples for which the cross fade effect has
444 to last. At the end of the cross fade effect the first input audio
445 will be completely silent. Default is 44100.
446
447 duration, d
448 Specify the duration of the cross fade effect. See the Time
449 duration section in the ffmpeg-utils(1) manual for the accepted
450 syntax. By default the duration is determined by nb_samples. If
451 set this option is used instead of nb_samples.
452
453 overlap, o
454 Should first stream end overlap with second stream start. Default
455 is enabled.
456
457 curve1
458 Set curve for cross fade transition for first stream.
459
460 curve2
461 Set curve for cross fade transition for second stream.
462
463 For description of available curve types see afade filter
464 description.
465
466 Examples
467
468 • Cross fade from one input to another:
469
470 ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
471
472 • Cross fade from one input to another but without overlapping:
473
474 ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
475
476 acrossover
477 Split audio stream into several bands.
478
479 This filter splits audio stream into two or more frequency ranges.
480 Summing all streams back will give flat output.
481
482 The filter accepts the following options:
483
484 split
485 Set split frequencies. Those must be positive and increasing.
486
487 order
488 Set filter order for each band split. This controls filter roll-off
489 or steepness of filter transfer function. Available values are:
490
491 2nd 12 dB per octave.
492
493 4th 24 dB per octave.
494
495 6th 36 dB per octave.
496
497 8th 48 dB per octave.
498
499 10th
500 60 dB per octave.
501
502 12th
503 72 dB per octave.
504
505 14th
506 84 dB per octave.
507
508 16th
509 96 dB per octave.
510
511 18th
512 108 dB per octave.
513
514 20th
515 120 dB per octave.
516
517 Default is 4th.
518
519 level
520 Set input gain level. Allowed range is from 0 to 1. Default value
521 is 1.
522
523 gains
524 Set output gain for each band. Default value is 1 for all bands.
525
526 precision
527 Set which precision to use when processing samples.
528
529 auto
530 Auto pick internal sample format depending on other filters.
531
532 float
533 Always use single-floating point precision sample format.
534
535 double
536 Always use double-floating point precision sample format.
537
538 Default value is "auto".
539
540 Examples
541
542 • Split input audio stream into two bands (low and high) with split
543 frequency of 1500 Hz, each band will be in separate stream:
544
545 ffmpeg -i in.flac -filter_complex 'acrossover=split=1500[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
546
547 • Same as above, but with higher filter order:
548
549 ffmpeg -i in.flac -filter_complex 'acrossover=split=1500:order=8th[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
550
551 • Same as above, but also with additional middle band (frequencies
552 between 1500 and 8000):
553
554 ffmpeg -i in.flac -filter_complex 'acrossover=split=1500 8000:order=8th[LOW][MID][HIGH]' -map '[LOW]' low.wav -map '[MID]' mid.wav -map '[HIGH]' high.wav
555
556 acrusher
557 Reduce audio bit resolution.
558
559 This filter is bit crusher with enhanced functionality. A bit crusher
560 is used to audibly reduce number of bits an audio signal is sampled
561 with. This doesn't change the bit depth at all, it just produces the
562 effect. Material reduced in bit depth sounds more harsh and "digital".
563 This filter is able to even round to continuous values instead of
564 discrete bit depths. Additionally it has a D/C offset which results in
565 different crushing of the lower and the upper half of the signal. An
566 Anti-Aliasing setting is able to produce "softer" crushing sounds.
567
568 Another feature of this filter is the logarithmic mode. This setting
569 switches from linear distances between bits to logarithmic ones. The
570 result is a much more "natural" sounding crusher which doesn't gate low
571 signals for example. The human ear has a logarithmic perception, so
572 this kind of crushing is much more pleasant. Logarithmic crushing is
573 also able to get anti-aliased.
574
575 The filter accepts the following options:
576
577 level_in
578 Set level in.
579
580 level_out
581 Set level out.
582
583 bits
584 Set bit reduction.
585
586 mix Set mixing amount.
587
588 mode
589 Can be linear: "lin" or logarithmic: "log".
590
591 dc Set DC.
592
593 aa Set anti-aliasing.
594
595 samples
596 Set sample reduction.
597
598 lfo Enable LFO. By default disabled.
599
600 lforange
601 Set LFO range.
602
603 lforate
604 Set LFO rate.
605
606 Commands
607
608 This filter supports the all above options as commands.
609
610 acue
611 Delay audio filtering until a given wallclock timestamp. See the cue
612 filter.
613
614 adeclick
615 Remove impulsive noise from input audio.
616
617 Samples detected as impulsive noise are replaced by interpolated
618 samples using autoregressive modelling.
619
620 window, w
621 Set window size, in milliseconds. Allowed range is from 10 to 100.
622 Default value is 55 milliseconds. This sets size of window which
623 will be processed at once.
624
625 overlap, o
626 Set window overlap, in percentage of window size. Allowed range is
627 from 50 to 95. Default value is 75 percent. Setting this to a very
628 high value increases impulsive noise removal but makes whole
629 process much slower.
630
631 arorder, a
632 Set autoregression order, in percentage of window size. Allowed
633 range is from 0 to 25. Default value is 2 percent. This option also
634 controls quality of interpolated samples using neighbour good
635 samples.
636
637 threshold, t
638 Set threshold value. Allowed range is from 1 to 100. Default value
639 is 2. This controls the strength of impulsive noise which is going
640 to be removed. The lower value, the more samples will be detected
641 as impulsive noise.
642
643 burst, b
644 Set burst fusion, in percentage of window size. Allowed range is 0
645 to 10. Default value is 2. If any two samples detected as noise
646 are spaced less than this value then any sample between those two
647 samples will be also detected as noise.
648
649 method, m
650 Set overlap method.
651
652 It accepts the following values:
653
654 add, a
655 Select overlap-add method. Even not interpolated samples are
656 slightly changed with this method.
657
658 save, s
659 Select overlap-save method. Not interpolated samples remain
660 unchanged.
661
662 Default value is "a".
663
664 adeclip
665 Remove clipped samples from input audio.
666
667 Samples detected as clipped are replaced by interpolated samples using
668 autoregressive modelling.
669
670 window, w
671 Set window size, in milliseconds. Allowed range is from 10 to 100.
672 Default value is 55 milliseconds. This sets size of window which
673 will be processed at once.
674
675 overlap, o
676 Set window overlap, in percentage of window size. Allowed range is
677 from 50 to 95. Default value is 75 percent.
678
679 arorder, a
680 Set autoregression order, in percentage of window size. Allowed
681 range is from 0 to 25. Default value is 8 percent. This option also
682 controls quality of interpolated samples using neighbour good
683 samples.
684
685 threshold, t
686 Set threshold value. Allowed range is from 1 to 100. Default value
687 is 10. Higher values make clip detection less aggressive.
688
689 hsize, n
690 Set size of histogram used to detect clips. Allowed range is from
691 100 to 9999. Default value is 1000. Higher values make clip
692 detection less aggressive.
693
694 method, m
695 Set overlap method.
696
697 It accepts the following values:
698
699 add, a
700 Select overlap-add method. Even not interpolated samples are
701 slightly changed with this method.
702
703 save, s
704 Select overlap-save method. Not interpolated samples remain
705 unchanged.
706
707 Default value is "a".
708
709 adecorrelate
710 Apply decorrelation to input audio stream.
711
712 The filter accepts the following options:
713
714 stages
715 Set decorrelation stages of filtering. Allowed range is from 1 to
716 16. Default value is 6.
717
718 seed
719 Set random seed used for setting delay in samples across channels.
720
721 adelay
722 Delay one or more audio channels.
723
724 Samples in delayed channel are filled with silence.
725
726 The filter accepts the following option:
727
728 delays
729 Set list of delays in milliseconds for each channel separated by
730 '|'. Unused delays will be silently ignored. If number of given
731 delays is smaller than number of channels all remaining channels
732 will not be delayed. If you want to delay exact number of samples,
733 append 'S' to number. If you want instead to delay in seconds,
734 append 's' to number.
735
736 all Use last set delay for all remaining channels. By default is
737 disabled. This option if enabled changes how option "delays" is
738 interpreted.
739
740 Examples
741
742 • Delay first channel by 1.5 seconds, the third channel by 0.5
743 seconds and leave the second channel (and any other channels that
744 may be present) unchanged.
745
746 adelay=1500|0|500
747
748 • Delay second channel by 500 samples, the third channel by 700
749 samples and leave the first channel (and any other channels that
750 may be present) unchanged.
751
752 adelay=0|500S|700S
753
754 • Delay all channels by same number of samples:
755
756 adelay=delays=64S:all=1
757
758 adenorm
759 Remedy denormals in audio by adding extremely low-level noise.
760
761 This filter shall be placed before any filter that can produce
762 denormals.
763
764 A description of the accepted parameters follows.
765
766 level
767 Set level of added noise in dB. Default is -351. Allowed range is
768 from -451 to -90.
769
770 type
771 Set type of added noise.
772
773 dc Add DC signal.
774
775 ac Add AC signal.
776
777 square
778 Add square signal.
779
780 pulse
781 Add pulse signal.
782
783 Default is "dc".
784
785 Commands
786
787 This filter supports the all above options as commands.
788
789 aderivative, aintegral
790 Compute derivative/integral of audio stream.
791
792 Applying both filters one after another produces original audio.
793
794 adrc
795 Apply spectral dynamic range controller filter to input audio stream.
796
797 A description of the accepted options follows.
798
799 transfer
800 Set the transfer expression.
801
802 The expression can contain the following constants:
803
804 ch current channel number
805
806 sn current sample number
807
808 nb_channels
809 number of channels
810
811 t timestamp expressed in seconds
812
813 sr sample rate
814
815 p current frequency power value, in dB
816
817 f current frequency in Hz
818
819 Default value is "p".
820
821 attack
822 Set the attack in milliseconds. Default is 50 milliseconds.
823 Allowed range is from 1 to 1000 milliseconds.
824
825 release
826 Set the release in milliseconds. Default is 100 milliseconds.
827 Allowed range is from 5 to 2000 milliseconds.
828
829 channels
830 Set which channels to filter, by default "all" channels in audio
831 stream are filtered.
832
833 Commands
834
835 This filter supports the all above options as commands.
836
837 Examples
838
839 • Apply spectral compression to all frequencies with threshold of -50
840 dB and 1:6 ratio:
841
842 adrc=transfer='if(gt(p,-50),-50+(p-(-50))/6,p)':attack=50:release=100
843
844 • Similar to above but with 1:2 ratio and filtering only front center
845 channel:
846
847 adrc=transfer='if(gt(p,-50),-50+(p-(-50))/2,p)':attack=50:release=100:channels=FC
848
849 • Apply spectral noise gate to all frequencies with threshold of -85
850 dB and with short attack time and short release time:
851
852 adrc=transfer='if(lte(p,-85),p-800,p)':attack=1:release=5
853
854 • Apply spectral expansion to all frequencies with threshold of -10
855 dB and 1:2 ratio:
856
857 adrc=transfer='if(lt(p,-10),-10+(p-(-10))*2,p)':attack=50:release=100
858
859 • Apply limiter to max -60 dB to all frequencies, with attack of 2 ms
860 and release of 10 ms:
861
862 adrc=transfer='min(p,-60)':attack=2:release=10
863
864 adynamicequalizer
865 Apply dynamic equalization to input audio stream.
866
867 A description of the accepted options follows.
868
869 threshold
870 Set the detection threshold used to trigger equalization.
871 Threshold detection is using bandpass filter. Default value is 0.
872 Allowed range is from 0 to 100.
873
874 dfrequency
875 Set the detection frequency in Hz used for bandpass filter used to
876 trigger equalization. Default value is 1000 Hz. Allowed range is
877 between 2 and 1000000 Hz.
878
879 dqfactor
880 Set the detection resonance factor for bandpass filter used to
881 trigger equalization. Default value is 1. Allowed range is from
882 0.001 to 1000.
883
884 tfrequency
885 Set the target frequency of equalization filter. Default value is
886 1000 Hz. Allowed range is between 2 and 1000000 Hz.
887
888 tqfactor
889 Set the target resonance factor for target equalization filter.
890 Default value is 1. Allowed range is from 0.001 to 1000.
891
892 attack
893 Set the amount of milliseconds the signal from detection has to
894 rise above the detection threshold before equalization starts.
895 Default is 20. Allowed range is between 1 and 2000.
896
897 release
898 Set the amount of milliseconds the signal from detection has to
899 fall below the detection threshold before equalization ends.
900 Default is 200. Allowed range is between 1 and 2000.
901
902 ratio
903 Set the ratio by which the equalization gain is raised. Default is
904 1. Allowed range is between 0 and 30.
905
906 makeup
907 Set the makeup offset by which the equalization gain is raised.
908 Default is 0. Allowed range is between 0 and 100.
909
910 range
911 Set the max allowed cut/boost amount. Default is 50. Allowed range
912 is from 1 to 200.
913
914 mode
915 Set the mode of filter operation, can be one of the following:
916
917 listen
918 Output only isolated bandpass signal.
919
920 cut Cut frequencies above detection threshold.
921
922 boost
923 Boost frequencies bellow detection threshold.
924
925 Default mode is cut.
926
927 tftype
928 Set the type of target filter, can be one of the following:
929
930 bell
931 lowshelf
932 highshelf
933
934 Default type is bell.
935
936 direction
937 Set processing direction relative to threshold.
938
939 downward
940 Boost/Cut if threshold is higher/lower than detected volume.
941
942 upward
943 Boost/Cut if threshold is lower/higher than detected volume.
944
945 Default direction is downward.
946
947 auto
948 Automatically gather threshold from detection filter. By default is
949 disabled. This option is useful to detect threshold in certain
950 time frame of input audio stream, in such case option value is
951 changed at runtime.
952
953 Available values are:
954
955 disabled
956 Disable using automatically gathered threshold value.
957
958 off Stop picking threshold value.
959
960 on Start picking threshold value.
961
962 Commands
963
964 This filter supports the all above options as commands.
965
966 adynamicsmooth
967 Apply dynamic smoothing to input audio stream.
968
969 A description of the accepted options follows.
970
971 sensitivity
972 Set an amount of sensitivity to frequency fluctations. Default is
973 2. Allowed range is from 0 to 1e+06.
974
975 basefreq
976 Set a base frequency for smoothing. Default value is 22050.
977 Allowed range is from 2 to 1e+06.
978
979 Commands
980
981 This filter supports the all above options as commands.
982
983 aecho
984 Apply echoing to the input audio.
985
986 Echoes are reflected sound and can occur naturally amongst mountains
987 (and sometimes large buildings) when talking or shouting; digital echo
988 effects emulate this behaviour and are often used to help fill out the
989 sound of a single instrument or vocal. The time difference between the
990 original signal and the reflection is the "delay", and the loudness of
991 the reflected signal is the "decay". Multiple echoes can have
992 different delays and decays.
993
994 A description of the accepted parameters follows.
995
996 in_gain
997 Set input gain of reflected signal. Default is 0.6.
998
999 out_gain
1000 Set output gain of reflected signal. Default is 0.3.
1001
1002 delays
1003 Set list of time intervals in milliseconds between original signal
1004 and reflections separated by '|'. Allowed range for each "delay" is
1005 "(0 - 90000.0]". Default is 1000.
1006
1007 decays
1008 Set list of loudness of reflected signals separated by '|'.
1009 Allowed range for each "decay" is "(0 - 1.0]". Default is 0.5.
1010
1011 Examples
1012
1013 • Make it sound as if there are twice as many instruments as are
1014 actually playing:
1015
1016 aecho=0.8:0.88:60:0.4
1017
1018 • If delay is very short, then it sounds like a (metallic) robot
1019 playing music:
1020
1021 aecho=0.8:0.88:6:0.4
1022
1023 • A longer delay will sound like an open air concert in the
1024 mountains:
1025
1026 aecho=0.8:0.9:1000:0.3
1027
1028 • Same as above but with one more mountain:
1029
1030 aecho=0.8:0.9:1000|1800:0.3|0.25
1031
1032 aemphasis
1033 Audio emphasis filter creates or restores material directly taken from
1034 LPs or emphased CDs with different filter curves. E.g. to store music
1035 on vinyl the signal has to be altered by a filter first to even out the
1036 disadvantages of this recording medium. Once the material is played
1037 back the inverse filter has to be applied to restore the distortion of
1038 the frequency response.
1039
1040 The filter accepts the following options:
1041
1042 level_in
1043 Set input gain.
1044
1045 level_out
1046 Set output gain.
1047
1048 mode
1049 Set filter mode. For restoring material use "reproduction" mode,
1050 otherwise use "production" mode. Default is "reproduction" mode.
1051
1052 type
1053 Set filter type. Selects medium. Can be one of the following:
1054
1055 col select Columbia.
1056
1057 emi select EMI.
1058
1059 bsi select BSI (78RPM).
1060
1061 riaa
1062 select RIAA.
1063
1064 cd select Compact Disc (CD).
1065
1066 50fm
1067 select 50µs (FM).
1068
1069 75fm
1070 select 75µs (FM).
1071
1072 50kf
1073 select 50µs (FM-KF).
1074
1075 75kf
1076 select 75µs (FM-KF).
1077
1078 Commands
1079
1080 This filter supports the all above options as commands.
1081
1082 aeval
1083 Modify an audio signal according to the specified expressions.
1084
1085 This filter accepts one or more expressions (one for each channel),
1086 which are evaluated and used to modify a corresponding audio signal.
1087
1088 It accepts the following parameters:
1089
1090 exprs
1091 Set the '|'-separated expressions list for each separate channel.
1092 If the number of input channels is greater than the number of
1093 expressions, the last specified expression is used for the
1094 remaining output channels.
1095
1096 channel_layout, c
1097 Set output channel layout. If not specified, the channel layout is
1098 specified by the number of expressions. If set to same, it will use
1099 by default the same input channel layout.
1100
1101 Each expression in exprs can contain the following constants and
1102 functions:
1103
1104 ch channel number of the current expression
1105
1106 n number of the evaluated sample, starting from 0
1107
1108 s sample rate
1109
1110 t time of the evaluated sample expressed in seconds
1111
1112 nb_in_channels
1113 nb_out_channels
1114 input and output number of channels
1115
1116 val(CH)
1117 the value of input channel with number CH
1118
1119 Note: this filter is slow. For faster processing you should use a
1120 dedicated filter.
1121
1122 Examples
1123
1124 • Half volume:
1125
1126 aeval=val(ch)/2:c=same
1127
1128 • Invert phase of the second channel:
1129
1130 aeval=val(0)|-val(1)
1131
1132 aexciter
1133 An exciter is used to produce high sound that is not present in the
1134 original signal. This is done by creating harmonic distortions of the
1135 signal which are restricted in range and added to the original signal.
1136 An Exciter raises the upper end of an audio signal without simply
1137 raising the higher frequencies like an equalizer would do to create a
1138 more "crisp" or "brilliant" sound.
1139
1140 The filter accepts the following options:
1141
1142 level_in
1143 Set input level prior processing of signal. Allowed range is from
1144 0 to 64. Default value is 1.
1145
1146 level_out
1147 Set output level after processing of signal. Allowed range is from
1148 0 to 64. Default value is 1.
1149
1150 amount
1151 Set the amount of harmonics added to original signal. Allowed
1152 range is from 0 to 64. Default value is 1.
1153
1154 drive
1155 Set the amount of newly created harmonics. Allowed range is from
1156 0.1 to 10. Default value is 8.5.
1157
1158 blend
1159 Set the octave of newly created harmonics. Allowed range is from
1160 -10 to 10. Default value is 0.
1161
1162 freq
1163 Set the lower frequency limit of producing harmonics in Hz.
1164 Allowed range is from 2000 to 12000 Hz. Default is 7500 Hz.
1165
1166 ceil
1167 Set the upper frequency limit of producing harmonics. Allowed
1168 range is from 9999 to 20000 Hz. If value is lower than 10000 Hz no
1169 limit is applied.
1170
1171 listen
1172 Mute the original signal and output only added harmonics. By
1173 default is disabled.
1174
1175 Commands
1176
1177 This filter supports the all above options as commands.
1178
1179 afade
1180 Apply fade-in/out effect to input audio.
1181
1182 A description of the accepted parameters follows.
1183
1184 type, t
1185 Specify the effect type, can be either "in" for fade-in, or "out"
1186 for a fade-out effect. Default is "in".
1187
1188 start_sample, ss
1189 Specify the number of the start sample for starting to apply the
1190 fade effect. Default is 0.
1191
1192 nb_samples, ns
1193 Specify the number of samples for which the fade effect has to
1194 last. At the end of the fade-in effect the output audio will have
1195 the same volume as the input audio, at the end of the fade-out
1196 transition the output audio will be silence. Default is 44100.
1197
1198 start_time, st
1199 Specify the start time of the fade effect. Default is 0. The value
1200 must be specified as a time duration; see the Time duration section
1201 in the ffmpeg-utils(1) manual for the accepted syntax. If set this
1202 option is used instead of start_sample.
1203
1204 duration, d
1205 Specify the duration of the fade effect. See the Time duration
1206 section in the ffmpeg-utils(1) manual for the accepted syntax. At
1207 the end of the fade-in effect the output audio will have the same
1208 volume as the input audio, at the end of the fade-out transition
1209 the output audio will be silence. By default the duration is
1210 determined by nb_samples. If set this option is used instead of
1211 nb_samples.
1212
1213 curve
1214 Set curve for fade transition.
1215
1216 It accepts the following values:
1217
1218 tri select triangular, linear slope (default)
1219
1220 qsin
1221 select quarter of sine wave
1222
1223 hsin
1224 select half of sine wave
1225
1226 esin
1227 select exponential sine wave
1228
1229 log select logarithmic
1230
1231 ipar
1232 select inverted parabola
1233
1234 qua select quadratic
1235
1236 cub select cubic
1237
1238 squ select square root
1239
1240 cbr select cubic root
1241
1242 par select parabola
1243
1244 exp select exponential
1245
1246 iqsin
1247 select inverted quarter of sine wave
1248
1249 ihsin
1250 select inverted half of sine wave
1251
1252 dese
1253 select double-exponential seat
1254
1255 desi
1256 select double-exponential sigmoid
1257
1258 losi
1259 select logistic sigmoid
1260
1261 sinc
1262 select sine cardinal function
1263
1264 isinc
1265 select inverted sine cardinal function
1266
1267 nofade
1268 no fade applied
1269
1270 silence
1271 Set the initial gain for fade-in or final gain for fade-out.
1272 Default value is 0.0.
1273
1274 unity
1275 Set the initial gain for fade-out or final gain for fade-in.
1276 Default value is 1.0.
1277
1278 Commands
1279
1280 This filter supports the all above options as commands.
1281
1282 Examples
1283
1284 • Fade in first 15 seconds of audio:
1285
1286 afade=t=in:ss=0:d=15
1287
1288 • Fade out last 25 seconds of a 900 seconds audio:
1289
1290 afade=t=out:st=875:d=25
1291
1292 afftdn
1293 Denoise audio samples with FFT.
1294
1295 A description of the accepted parameters follows.
1296
1297 noise_reduction, nr
1298 Set the noise reduction in dB, allowed range is 0.01 to 97.
1299 Default value is 12 dB.
1300
1301 noise_floor, nf
1302 Set the noise floor in dB, allowed range is -80 to -20. Default
1303 value is -50 dB.
1304
1305 noise_type, nt
1306 Set the noise type.
1307
1308 It accepts the following values:
1309
1310 white, w
1311 Select white noise.
1312
1313 vinyl, v
1314 Select vinyl noise.
1315
1316 shellac, s
1317 Select shellac noise.
1318
1319 custom, c
1320 Select custom noise, defined in "bn" option.
1321
1322 Default value is white noise.
1323
1324 band_noise, bn
1325 Set custom band noise profile for every one of 15 bands. Bands are
1326 separated by ' ' or '|'.
1327
1328 residual_floor, rf
1329 Set the residual floor in dB, allowed range is -80 to -20. Default
1330 value is -38 dB.
1331
1332 track_noise, tn
1333 Enable noise floor tracking. By default is disabled. With this
1334 enabled, noise floor is automatically adjusted.
1335
1336 track_residual, tr
1337 Enable residual tracking. By default is disabled.
1338
1339 output_mode, om
1340 Set the output mode.
1341
1342 It accepts the following values:
1343
1344 input, i
1345 Pass input unchanged.
1346
1347 output, o
1348 Pass noise filtered out.
1349
1350 noise, n
1351 Pass only noise.
1352
1353 Default value is output.
1354
1355 adaptivity, ad
1356 Set the adaptivity factor, used how fast to adapt gains adjustments
1357 per each frequency bin. Value 0 enables instant adaptation, while
1358 higher values react much slower. Allowed range is from 0 to 1.
1359 Default value is 0.5.
1360
1361 floor_offset, fo
1362 Set the noise floor offset factor. This option is used to adjust
1363 offset applied to measured noise floor. It is only effective when
1364 noise floor tracking is enabled. Allowed range is from -2.0 to
1365 2.0. Default value is 1.0.
1366
1367 noise_link, nl
1368 Set the noise link used for multichannel audio.
1369
1370 It accepts the following values:
1371
1372 none
1373 Use unchanged channel's noise floor.
1374
1375 min Use measured min noise floor of all channels.
1376
1377 max Use measured max noise floor of all channels.
1378
1379 average
1380 Use measured average noise floor of all channels.
1381
1382 Default value is min.
1383
1384 band_multiplier, bm
1385 Set the band multiplier factor, used how much to spread bands
1386 across frequency bins. Allowed range is from 0.2 to 5. Default
1387 value is 1.25.
1388
1389 sample_noise, sn
1390 Toggle capturing and measurement of noise profile from input audio.
1391
1392 It accepts the following values:
1393
1394 start, begin
1395 Start sample noise capture.
1396
1397 stop, end
1398 Stop sample noise capture and measure new noise band profile.
1399
1400 Default value is "none".
1401
1402 gain_smooth, gs
1403 Set gain smooth spatial radius, used to smooth gains applied to
1404 each frequency bin. Useful to reduce random music noise artefacts.
1405 Higher values increases smoothing of gains. Allowed range is from
1406 0 to 50. Default value is 0.
1407
1408 Commands
1409
1410 This filter supports the some above mentioned options as commands.
1411
1412 Examples
1413
1414 • Reduce white noise by 10dB, and use previously measured noise floor
1415 of -40dB:
1416
1417 afftdn=nr=10:nf=-40
1418
1419 • Reduce white noise by 10dB, also set initial noise floor to -80dB
1420 and enable automatic tracking of noise floor so noise floor will
1421 gradually change during processing:
1422
1423 afftdn=nr=10:nf=-80:tn=1
1424
1425 • Reduce noise by 20dB, using noise floor of -40dB and using commands
1426 to take noise profile of first 0.4 seconds of input audio:
1427
1428 asendcmd=0.0 afftdn sn start,asendcmd=0.4 afftdn sn stop,afftdn=nr=20:nf=-40
1429
1430 afftfilt
1431 Apply arbitrary expressions to samples in frequency domain.
1432
1433 real
1434 Set frequency domain real expression for each separate channel
1435 separated by '|'. Default is "re". If the number of input channels
1436 is greater than the number of expressions, the last specified
1437 expression is used for the remaining output channels.
1438
1439 imag
1440 Set frequency domain imaginary expression for each separate channel
1441 separated by '|'. Default is "im".
1442
1443 Each expression in real and imag can contain the following
1444 constants and functions:
1445
1446 sr sample rate
1447
1448 b current frequency bin number
1449
1450 nb number of available bins
1451
1452 ch channel number of the current expression
1453
1454 chs number of channels
1455
1456 pts current frame pts
1457
1458 re current real part of frequency bin of current channel
1459
1460 im current imaginary part of frequency bin of current channel
1461
1462 real(b, ch)
1463 Return the value of real part of frequency bin at location
1464 (bin,channel)
1465
1466 imag(b, ch)
1467 Return the value of imaginary part of frequency bin at location
1468 (bin,channel)
1469
1470 win_size
1471 Set window size. Allowed range is from 16 to 131072. Default is
1472 4096
1473
1474 win_func
1475 Set window function.
1476
1477 It accepts the following values:
1478
1479 rect
1480 bartlett
1481 hann, hanning
1482 hamming
1483 blackman
1484 welch
1485 flattop
1486 bharris
1487 bnuttall
1488 bhann
1489 sine
1490 nuttall
1491 lanczos
1492 gauss
1493 tukey
1494 dolph
1495 cauchy
1496 parzen
1497 poisson
1498 bohman
1499 kaiser
1500
1501 Default is "hann".
1502
1503 overlap
1504 Set window overlap. If set to 1, the recommended overlap for
1505 selected window function will be picked. Default is 0.75.
1506
1507 Examples
1508
1509 • Leave almost only low frequencies in audio:
1510
1511 afftfilt="'real=re * (1-clip((b/nb)*b,0,1))':imag='im * (1-clip((b/nb)*b,0,1))'"
1512
1513 • Apply robotize effect:
1514
1515 afftfilt="real='hypot(re,im)*sin(0)':imag='hypot(re,im)*cos(0)':win_size=512:overlap=0.75"
1516
1517 • Apply whisper effect:
1518
1519 afftfilt="real='hypot(re,im)*cos((random(0)*2-1)*2*3.14)':imag='hypot(re,im)*sin((random(1)*2-1)*2*3.14)':win_size=128:overlap=0.8"
1520
1521 • Apply phase shift:
1522
1523 afftfilt="real=re*cos(1)-im*sin(1):imag=re*sin(1)+im*cos(1)"
1524
1525 afir
1526 Apply an arbitrary Finite Impulse Response filter.
1527
1528 This filter is designed for applying long FIR filters, up to 60 seconds
1529 long.
1530
1531 It can be used as component for digital crossover filters, room
1532 equalization, cross talk cancellation, wavefield synthesis,
1533 auralization, ambiophonics, ambisonics and spatialization.
1534
1535 This filter uses the streams higher than first one as FIR coefficients.
1536 If the non-first stream holds a single channel, it will be used for all
1537 input channels in the first stream, otherwise the number of channels in
1538 the non-first stream must be same as the number of channels in the
1539 first stream.
1540
1541 It accepts the following parameters:
1542
1543 dry Set dry gain. This sets input gain.
1544
1545 wet Set wet gain. This sets final output gain.
1546
1547 length
1548 Set Impulse Response filter length. Default is 1, which means whole
1549 IR is processed.
1550
1551 gtype
1552 Enable applying gain measured from power of IR.
1553
1554 Set which approach to use for auto gain measurement.
1555
1556 none
1557 Do not apply any gain.
1558
1559 peak
1560 select peak gain, very conservative approach. This is default
1561 value.
1562
1563 dc select DC gain, limited application.
1564
1565 gn select gain to noise approach, this is most popular one.
1566
1567 ac select AC gain.
1568
1569 rms select RMS gain.
1570
1571 irgain
1572 Set gain to be applied to IR coefficients before filtering.
1573 Allowed range is 0 to 1. This gain is applied after any gain
1574 applied with gtype option.
1575
1576 irfmt
1577 Set format of IR stream. Can be "mono" or "input". Default is
1578 "input".
1579
1580 maxir
1581 Set max allowed Impulse Response filter duration in seconds.
1582 Default is 30 seconds. Allowed range is 0.1 to 60 seconds.
1583
1584 response
1585 Show IR frequency response, magnitude(magenta), phase(green) and
1586 group delay(yellow) in additional video stream. By default it is
1587 disabled.
1588
1589 channel
1590 Set for which IR channel to display frequency response. By default
1591 is first channel displayed. This option is used only when response
1592 is enabled.
1593
1594 size
1595 Set video stream size. This option is used only when response is
1596 enabled.
1597
1598 rate
1599 Set video stream frame rate. This option is used only when response
1600 is enabled.
1601
1602 minp
1603 Set minimal partition size used for convolution. Default is 8192.
1604 Allowed range is from 1 to 65536. Lower values decreases latency
1605 at cost of higher CPU usage.
1606
1607 maxp
1608 Set maximal partition size used for convolution. Default is 8192.
1609 Allowed range is from 8 to 65536. Lower values may increase CPU
1610 usage.
1611
1612 nbirs
1613 Set number of input impulse responses streams which will be
1614 switchable at runtime. Allowed range is from 1 to 32. Default is
1615 1.
1616
1617 ir Set IR stream which will be used for convolution, starting from 0,
1618 should always be lower than supplied value by "nbirs" option.
1619 Default is 0. This option can be changed at runtime via commands.
1620
1621 precision
1622 Set which precision to use when processing samples.
1623
1624 auto
1625 Auto pick internal sample format depending on other filters.
1626
1627 float
1628 Always use single-floating point precision sample format.
1629
1630 double
1631 Always use double-floating point precision sample format.
1632
1633 Default value is auto.
1634
1635 Examples
1636
1637 • Apply reverb to stream using mono IR file as second input, complete
1638 command using ffmpeg:
1639
1640 ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav
1641
1642 • Apply true stereo processing given input stereo stream, and two
1643 stereo impulse responses for left and right channel, the impulse
1644 response files are files with names l_ir.wav and r_ir.wav:
1645
1646 "pan=4C|c0=FL|c1=FL|c2=FR|c3=FR[a];amovie=l_ir.wav[LIR];amovie=r_ir.wav[RIR];[LIR][RIR]amerge[ir];[a][ir]afir=irfmt=input:gtype=gn:irgain=-5dB,pan=stereo|FL<c0+c2|FR<c1+c3"
1647
1648 aformat
1649 Set output format constraints for the input audio. The framework will
1650 negotiate the most appropriate format to minimize conversions.
1651
1652 It accepts the following parameters:
1653
1654 sample_fmts, f
1655 A '|'-separated list of requested sample formats.
1656
1657 sample_rates, r
1658 A '|'-separated list of requested sample rates.
1659
1660 channel_layouts, cl
1661 A '|'-separated list of requested channel layouts.
1662
1663 See the Channel Layout section in the ffmpeg-utils(1) manual for
1664 the required syntax.
1665
1666 If a parameter is omitted, all values are allowed.
1667
1668 Force the output to either unsigned 8-bit or signed 16-bit stereo
1669
1670 aformat=sample_fmts=u8|s16:channel_layouts=stereo
1671
1672 afreqshift
1673 Apply frequency shift to input audio samples.
1674
1675 The filter accepts the following options:
1676
1677 shift
1678 Specify frequency shift. Allowed range is -INT_MAX to INT_MAX.
1679 Default value is 0.0.
1680
1681 level
1682 Set output gain applied to final output. Allowed range is from 0.0
1683 to 1.0. Default value is 1.0.
1684
1685 order
1686 Set filter order used for filtering. Allowed range is from 1 to 16.
1687 Default value is 8.
1688
1689 Commands
1690
1691 This filter supports the all above options as commands.
1692
1693 afwtdn
1694 Reduce broadband noise from input samples using Wavelets.
1695
1696 A description of the accepted options follows.
1697
1698 sigma
1699 Set the noise sigma, allowed range is from 0 to 1. Default value
1700 is 0. This option controls strength of denoising applied to input
1701 samples. Most useful way to set this option is via decibels, eg.
1702 -45dB.
1703
1704 levels
1705 Set the number of wavelet levels of decomposition. Allowed range
1706 is from 1 to 12. Default value is 10. Setting this too low make
1707 denoising performance very poor.
1708
1709 wavet
1710 Set wavelet type for decomposition of input frame. They are sorted
1711 by number of coefficients, from lowest to highest. More
1712 coefficients means worse filtering speed, but overall better
1713 quality. Available wavelets are:
1714
1715 sym2
1716 sym4
1717 rbior68
1718 deb10
1719 sym10
1720 coif5
1721 bl3
1722 percent
1723 Set percent of full denoising. Allowed range is from 0 to 100
1724 percent. Default value is 85 percent or partial denoising.
1725
1726 profile
1727 If enabled, first input frame will be used as noise profile. If
1728 first frame samples contain non-noise performance will be very
1729 poor.
1730
1731 adaptive
1732 If enabled, input frames are analyzed for presence of noise. If
1733 noise is detected with high possibility then input frame profile
1734 will be used for processing following frames, until new noise frame
1735 is detected.
1736
1737 samples
1738 Set size of single frame in number of samples. Allowed range is
1739 from 512 to 65536. Default frame size is 8192 samples.
1740
1741 softness
1742 Set softness applied inside thresholding function. Allowed range is
1743 from 0 to 10. Default softness is 1.
1744
1745 Commands
1746
1747 This filter supports the all above options as commands.
1748
1749 agate
1750 A gate is mainly used to reduce lower parts of a signal. This kind of
1751 signal processing reduces disturbing noise between useful signals.
1752
1753 Gating is done by detecting the volume below a chosen level threshold
1754 and dividing it by the factor set with ratio. The bottom of the noise
1755 floor is set via range. Because an exact manipulation of the signal
1756 would cause distortion of the waveform the reduction can be levelled
1757 over time. This is done by setting attack and release.
1758
1759 attack determines how long the signal has to fall below the threshold
1760 before any reduction will occur and release sets the time the signal
1761 has to rise above the threshold to reduce the reduction again. Shorter
1762 signals than the chosen attack time will be left untouched.
1763
1764 level_in
1765 Set input level before filtering. Default is 1. Allowed range is
1766 from 0.015625 to 64.
1767
1768 mode
1769 Set the mode of operation. Can be "upward" or "downward". Default
1770 is "downward". If set to "upward" mode, higher parts of signal will
1771 be amplified, expanding dynamic range in upward direction.
1772 Otherwise, in case of "downward" lower parts of signal will be
1773 reduced.
1774
1775 range
1776 Set the level of gain reduction when the signal is below the
1777 threshold. Default is 0.06125. Allowed range is from 0 to 1.
1778 Setting this to 0 disables reduction and then filter behaves like
1779 expander.
1780
1781 threshold
1782 If a signal rises above this level the gain reduction is released.
1783 Default is 0.125. Allowed range is from 0 to 1.
1784
1785 ratio
1786 Set a ratio by which the signal is reduced. Default is 2. Allowed
1787 range is from 1 to 9000.
1788
1789 attack
1790 Amount of milliseconds the signal has to rise above the threshold
1791 before gain reduction stops. Default is 20 milliseconds. Allowed
1792 range is from 0.01 to 9000.
1793
1794 release
1795 Amount of milliseconds the signal has to fall below the threshold
1796 before the reduction is increased again. Default is 250
1797 milliseconds. Allowed range is from 0.01 to 9000.
1798
1799 makeup
1800 Set amount of amplification of signal after processing. Default is
1801 1. Allowed range is from 1 to 64.
1802
1803 knee
1804 Curve the sharp knee around the threshold to enter gain reduction
1805 more softly. Default is 2.828427125. Allowed range is from 1 to 8.
1806
1807 detection
1808 Choose if exact signal should be taken for detection or an RMS like
1809 one. Default is "rms". Can be "peak" or "rms".
1810
1811 link
1812 Choose if the average level between all channels or the louder
1813 channel affects the reduction. Default is "average". Can be
1814 "average" or "maximum".
1815
1816 Commands
1817
1818 This filter supports the all above options as commands.
1819
1820 aiir
1821 Apply an arbitrary Infinite Impulse Response filter.
1822
1823 It accepts the following parameters:
1824
1825 zeros, z
1826 Set B/numerator/zeros/reflection coefficients.
1827
1828 poles, p
1829 Set A/denominator/poles/ladder coefficients.
1830
1831 gains, k
1832 Set channels gains.
1833
1834 dry_gain
1835 Set input gain.
1836
1837 wet_gain
1838 Set output gain.
1839
1840 format, f
1841 Set coefficients format.
1842
1843 ll lattice-ladder function
1844
1845 sf analog transfer function
1846
1847 tf digital transfer function
1848
1849 zp Z-plane zeros/poles, cartesian (default)
1850
1851 pr Z-plane zeros/poles, polar radians
1852
1853 pd Z-plane zeros/poles, polar degrees
1854
1855 sp S-plane zeros/poles
1856
1857 process, r
1858 Set type of processing.
1859
1860 d direct processing
1861
1862 s serial processing
1863
1864 p parallel processing
1865
1866 precision, e
1867 Set filtering precision.
1868
1869 dbl double-precision floating-point (default)
1870
1871 flt single-precision floating-point
1872
1873 i32 32-bit integers
1874
1875 i16 16-bit integers
1876
1877 normalize, n
1878 Normalize filter coefficients, by default is enabled. Enabling it
1879 will normalize magnitude response at DC to 0dB.
1880
1881 mix How much to use filtered signal in output. Default is 1. Range is
1882 between 0 and 1.
1883
1884 response
1885 Show IR frequency response, magnitude(magenta), phase(green) and
1886 group delay(yellow) in additional video stream. By default it is
1887 disabled.
1888
1889 channel
1890 Set for which IR channel to display frequency response. By default
1891 is first channel displayed. This option is used only when response
1892 is enabled.
1893
1894 size
1895 Set video stream size. This option is used only when response is
1896 enabled.
1897
1898 Coefficients in "tf" and "sf" format are separated by spaces and are in
1899 ascending order.
1900
1901 Coefficients in "zp" format are separated by spaces and order of
1902 coefficients doesn't matter. Coefficients in "zp" format are complex
1903 numbers with i imaginary unit.
1904
1905 Different coefficients and gains can be provided for every channel, in
1906 such case use '|' to separate coefficients or gains. Last provided
1907 coefficients will be used for all remaining channels.
1908
1909 Examples
1910
1911 • Apply 2 pole elliptic notch at around 5000Hz for 48000 Hz sample
1912 rate:
1913
1914 aiir=k=1:z=7.957584807809675810E-1 -2.575128568908332300 3.674839853930788710 -2.57512875289799137 7.957586296317130880E-1:p=1 -2.86950072432325953 3.63022088054647218 -2.28075678147272232 6.361362326477423500E-1:f=tf:r=d
1915
1916 • Same as above but in "zp" format:
1917
1918 aiir=k=0.79575848078096756:z=0.80918701+0.58773007i 0.80918701-0.58773007i 0.80884700+0.58784055i 0.80884700-0.58784055i:p=0.63892345+0.59951235i 0.63892345-0.59951235i 0.79582691+0.44198673i 0.79582691-0.44198673i:f=zp:r=s
1919
1920 • Apply 3-rd order analog normalized Butterworth low-pass filter,
1921 using analog transfer function format:
1922
1923 aiir=z=1.3057 0 0 0:p=1.3057 2.3892 2.1860 1:f=sf:r=d
1924
1925 alimiter
1926 The limiter prevents an input signal from rising over a desired
1927 threshold. This limiter uses lookahead technology to prevent your
1928 signal from distorting. It means that there is a small delay after the
1929 signal is processed. Keep in mind that the delay it produces is the
1930 attack time you set.
1931
1932 The filter accepts the following options:
1933
1934 level_in
1935 Set input gain. Default is 1.
1936
1937 level_out
1938 Set output gain. Default is 1.
1939
1940 limit
1941 Don't let signals above this level pass the limiter. Default is 1.
1942
1943 attack
1944 The limiter will reach its attenuation level in this amount of time
1945 in milliseconds. Default is 5 milliseconds.
1946
1947 release
1948 Come back from limiting to attenuation 1.0 in this amount of
1949 milliseconds. Default is 50 milliseconds.
1950
1951 asc When gain reduction is always needed ASC takes care of releasing to
1952 an average reduction level rather than reaching a reduction of 0 in
1953 the release time.
1954
1955 asc_level
1956 Select how much the release time is affected by ASC, 0 means nearly
1957 no changes in release time while 1 produces higher release times.
1958
1959 level
1960 Auto level output signal. Default is enabled. This normalizes
1961 audio back to 0dB if enabled.
1962
1963 latency
1964 Compensate the delay introduced by using the lookahead buffer set
1965 with attack parameter. Also flush the valid audio data in the
1966 lookahead buffer when the stream hits EOF.
1967
1968 Depending on picked setting it is recommended to upsample input 2x or
1969 4x times with aresample before applying this filter.
1970
1971 allpass
1972 Apply a two-pole all-pass filter with central frequency (in Hz)
1973 frequency, and filter-width width. An all-pass filter changes the
1974 audio's frequency to phase relationship without changing its frequency
1975 to amplitude relationship.
1976
1977 The filter accepts the following options:
1978
1979 frequency, f
1980 Set frequency in Hz.
1981
1982 width_type, t
1983 Set method to specify band-width of filter.
1984
1985 h Hz
1986
1987 q Q-Factor
1988
1989 o octave
1990
1991 s slope
1992
1993 k kHz
1994
1995 width, w
1996 Specify the band-width of a filter in width_type units.
1997
1998 mix, m
1999 How much to use filtered signal in output. Default is 1. Range is
2000 between 0 and 1.
2001
2002 channels, c
2003 Specify which channels to filter, by default all available are
2004 filtered.
2005
2006 normalize, n
2007 Normalize biquad coefficients, by default is disabled. Enabling it
2008 will normalize magnitude response at DC to 0dB.
2009
2010 order, o
2011 Set the filter order, can be 1 or 2. Default is 2.
2012
2013 transform, a
2014 Set transform type of IIR filter.
2015
2016 di
2017 dii
2018 tdi
2019 tdii
2020 latt
2021 svf
2022 zdf
2023 precision, r
2024 Set precison of filtering.
2025
2026 auto
2027 Pick automatic sample format depending on surround filters.
2028
2029 s16 Always use signed 16-bit.
2030
2031 s32 Always use signed 32-bit.
2032
2033 f32 Always use float 32-bit.
2034
2035 f64 Always use float 64-bit.
2036
2037 Commands
2038
2039 This filter supports the following commands:
2040
2041 frequency, f
2042 Change allpass frequency. Syntax for the command is : "frequency"
2043
2044 width_type, t
2045 Change allpass width_type. Syntax for the command is :
2046 "width_type"
2047
2048 width, w
2049 Change allpass width. Syntax for the command is : "width"
2050
2051 mix, m
2052 Change allpass mix. Syntax for the command is : "mix"
2053
2054 aloop
2055 Loop audio samples.
2056
2057 The filter accepts the following options:
2058
2059 loop
2060 Set the number of loops. Setting this value to -1 will result in
2061 infinite loops. Default is 0.
2062
2063 size
2064 Set maximal number of samples. Default is 0.
2065
2066 start
2067 Set first sample of loop. Default is 0.
2068
2069 amerge
2070 Merge two or more audio streams into a single multi-channel stream.
2071
2072 The filter accepts the following options:
2073
2074 inputs
2075 Set the number of inputs. Default is 2.
2076
2077 If the channel layouts of the inputs are disjoint, and therefore
2078 compatible, the channel layout of the output will be set accordingly
2079 and the channels will be reordered as necessary. If the channel layouts
2080 of the inputs are not disjoint, the output will have all the channels
2081 of the first input then all the channels of the second input, in that
2082 order, and the channel layout of the output will be the default value
2083 corresponding to the total number of channels.
2084
2085 For example, if the first input is in 2.1 (FL+FR+LF) and the second
2086 input is FC+BL+BR, then the output will be in 5.1, with the channels in
2087 the following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of
2088 the first input, b1 is the first channel of the second input).
2089
2090 On the other hand, if both input are in stereo, the output channels
2091 will be in the default order: a1, a2, b1, b2, and the channel layout
2092 will be arbitrarily set to 4.0, which may or may not be the expected
2093 value.
2094
2095 All inputs must have the same sample rate, and format.
2096
2097 If inputs do not have the same duration, the output will stop with the
2098 shortest.
2099
2100 Examples
2101
2102 • Merge two mono files into a stereo stream:
2103
2104 amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
2105
2106 • Multiple merges assuming 1 video stream and 6 audio streams in
2107 input.mkv:
2108
2109 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
2110
2111 amix
2112 Mixes multiple audio inputs into a single output.
2113
2114 Note that this filter only supports float samples (the amerge and pan
2115 audio filters support many formats). If the amix input has integer
2116 samples then aresample will be automatically inserted to perform the
2117 conversion to float samples.
2118
2119 It accepts the following parameters:
2120
2121 inputs
2122 The number of inputs. If unspecified, it defaults to 2.
2123
2124 duration
2125 How to determine the end-of-stream.
2126
2127 longest
2128 The duration of the longest input. (default)
2129
2130 shortest
2131 The duration of the shortest input.
2132
2133 first
2134 The duration of the first input.
2135
2136 dropout_transition
2137 The transition time, in seconds, for volume renormalization when an
2138 input stream ends. The default value is 2 seconds.
2139
2140 weights
2141 Specify weight of each input audio stream as a sequence of numbers
2142 separated by a space. If fewer weights are specified compared to
2143 number of inputs, the last weight is assigned to the remaining
2144 inputs. Default weight for each input is 1.
2145
2146 normalize
2147 Always scale inputs instead of only doing summation of samples.
2148 Beware of heavy clipping if inputs are not normalized prior or
2149 after filtering by this filter if this option is disabled. By
2150 default is enabled.
2151
2152 Examples
2153
2154 • This will mix 3 input audio streams to a single output with the
2155 same duration as the first input and a dropout transition time of 3
2156 seconds:
2157
2158 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
2159
2160 • This will mix one vocal and one music input audio stream to a
2161 single output with the same duration as the longest input. The
2162 music will have quarter the weight as the vocals, and the inputs
2163 are not normalized:
2164
2165 ffmpeg -i VOCALS -i MUSIC -filter_complex amix=inputs=2:duration=longest:dropout_transition=0:weights="1 0.25":normalize=0 OUTPUT
2166
2167 Commands
2168
2169 This filter supports the following commands:
2170
2171 weights
2172 normalize
2173 Syntax is same as option with same name.
2174
2175 amultiply
2176 Multiply first audio stream with second audio stream and store result
2177 in output audio stream. Multiplication is done by multiplying each
2178 sample from first stream with sample at same position from second
2179 stream.
2180
2181 With this element-wise multiplication one can create amplitude fades
2182 and amplitude modulations.
2183
2184 anequalizer
2185 High-order parametric multiband equalizer for each channel.
2186
2187 It accepts the following parameters:
2188
2189 params
2190 This option string is in format: "cchn f=cf w=w g=g t=f | ..."
2191 Each equalizer band is separated by '|'.
2192
2193 chn Set channel number to which equalization will be applied. If
2194 input doesn't have that channel the entry is ignored.
2195
2196 f Set central frequency for band. If input doesn't have that
2197 frequency the entry is ignored.
2198
2199 w Set band width in Hertz.
2200
2201 g Set band gain in dB.
2202
2203 t Set filter type for band, optional, can be:
2204
2205 0 Butterworth, this is default.
2206
2207 1 Chebyshev type 1.
2208
2209 2 Chebyshev type 2.
2210
2211 curves
2212 With this option activated frequency response of anequalizer is
2213 displayed in video stream.
2214
2215 size
2216 Set video stream size. Only useful if curves option is activated.
2217
2218 mgain
2219 Set max gain that will be displayed. Only useful if curves option
2220 is activated. Setting this to a reasonable value makes it possible
2221 to display gain which is derived from neighbour bands which are too
2222 close to each other and thus produce higher gain when both are
2223 activated.
2224
2225 fscale
2226 Set frequency scale used to draw frequency response in video
2227 output. Can be linear or logarithmic. Default is logarithmic.
2228
2229 colors
2230 Set color for each channel curve which is going to be displayed in
2231 video stream. This is list of color names separated by space or by
2232 '|'. Unrecognised or missing colors will be replaced by white
2233 color.
2234
2235 Examples
2236
2237 • Lower gain by 10 of central frequency 200Hz and width 100 Hz for
2238 first 2 channels using Chebyshev type 1 filter:
2239
2240 anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
2241
2242 Commands
2243
2244 This filter supports the following commands:
2245
2246 change
2247 Alter existing filter parameters. Syntax for the commands is :
2248 "fN|f=freq|w=width|g=gain"
2249
2250 fN is existing filter number, starting from 0, if no such filter is
2251 available error is returned. freq set new frequency parameter.
2252 width set new width parameter in Hertz. gain set new gain
2253 parameter in dB.
2254
2255 Full filter invocation with asendcmd may look like this:
2256 asendcmd=c='4.0 anequalizer change
2257 0|f=200|w=50|g=1',anequalizer=...
2258
2259 anlmdn
2260 Reduce broadband noise in audio samples using Non-Local Means
2261 algorithm.
2262
2263 Each sample is adjusted by looking for other samples with similar
2264 contexts. This context similarity is defined by comparing their
2265 surrounding patches of size p. Patches are searched in an area of r
2266 around the sample.
2267
2268 The filter accepts the following options:
2269
2270 strength, s
2271 Set denoising strength. Allowed range is from 0.00001 to 10000.
2272 Default value is 0.00001.
2273
2274 patch, p
2275 Set patch radius duration. Allowed range is from 1 to 100
2276 milliseconds. Default value is 2 milliseconds.
2277
2278 research, r
2279 Set research radius duration. Allowed range is from 2 to 300
2280 milliseconds. Default value is 6 milliseconds.
2281
2282 output, o
2283 Set the output mode.
2284
2285 It accepts the following values:
2286
2287 i Pass input unchanged.
2288
2289 o Pass noise filtered out.
2290
2291 n Pass only noise.
2292
2293 Default value is o.
2294
2295 smooth, m
2296 Set smooth factor. Default value is 11. Allowed range is from 1 to
2297 1000.
2298
2299 Commands
2300
2301 This filter supports the all above options as commands.
2302
2303 anlmf, anlms
2304 Apply Normalized Least-Mean-(Squares|Fourth) algorithm to the first
2305 audio stream using the second audio stream.
2306
2307 This adaptive filter is used to mimic a desired filter by finding the
2308 filter coefficients that relate to producing the least mean square of
2309 the error signal (difference between the desired, 2nd input audio
2310 stream and the actual signal, the 1st input audio stream).
2311
2312 A description of the accepted options follows.
2313
2314 order
2315 Set filter order.
2316
2317 mu Set filter mu.
2318
2319 eps Set the filter eps.
2320
2321 leakage
2322 Set the filter leakage.
2323
2324 out_mode
2325 It accepts the following values:
2326
2327 i Pass the 1st input.
2328
2329 d Pass the 2nd input.
2330
2331 o Pass filtered samples.
2332
2333 n Pass difference between desired and filtered samples.
2334
2335 Default value is o.
2336
2337 Examples
2338
2339 • One of many usages of this filter is noise reduction, input audio
2340 is filtered with same samples that are delayed by fixed amount, one
2341 such example for stereo audio is:
2342
2343 asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o
2344
2345 Commands
2346
2347 This filter supports the same commands as options, excluding option
2348 "order".
2349
2350 anull
2351 Pass the audio source unchanged to the output.
2352
2353 apad
2354 Pad the end of an audio stream with silence.
2355
2356 This can be used together with ffmpeg -shortest to extend audio streams
2357 to the same length as the video stream.
2358
2359 A description of the accepted options follows.
2360
2361 packet_size
2362 Set silence packet size. Default value is 4096.
2363
2364 pad_len
2365 Set the number of samples of silence to add to the end. After the
2366 value is reached, the stream is terminated. This option is mutually
2367 exclusive with whole_len.
2368
2369 whole_len
2370 Set the minimum total number of samples in the output audio stream.
2371 If the value is longer than the input audio length, silence is
2372 added to the end, until the value is reached. This option is
2373 mutually exclusive with pad_len.
2374
2375 pad_dur
2376 Specify the duration of samples of silence to add. See the Time
2377 duration section in the ffmpeg-utils(1) manual for the accepted
2378 syntax. Used only if set to non-negative value.
2379
2380 whole_dur
2381 Specify the minimum total duration in the output audio stream. See
2382 the Time duration section in the ffmpeg-utils(1) manual for the
2383 accepted syntax. Used only if set to non-negative value. If the
2384 value is longer than the input audio length, silence is added to
2385 the end, until the value is reached. This option is mutually
2386 exclusive with pad_dur
2387
2388 If neither the pad_len nor the whole_len nor pad_dur nor whole_dur
2389 option is set, the filter will add silence to the end of the input
2390 stream indefinitely.
2391
2392 Note that for ffmpeg 4.4 and earlier a zero pad_dur or whole_dur also
2393 caused the filter to add silence indefinitely.
2394
2395 Examples
2396
2397 • Add 1024 samples of silence to the end of the input:
2398
2399 apad=pad_len=1024
2400
2401 • Make sure the audio output will contain at least 10000 samples, pad
2402 the input with silence if required:
2403
2404 apad=whole_len=10000
2405
2406 • Use ffmpeg to pad the audio input with silence, so that the video
2407 stream will always result the shortest and will be converted until
2408 the end in the output file when using the shortest option:
2409
2410 ffmpeg -i VIDEO -i AUDIO -filter_complex "[1:0]apad" -shortest OUTPUT
2411
2412 aphaser
2413 Add a phasing effect to the input audio.
2414
2415 A phaser filter creates series of peaks and troughs in the frequency
2416 spectrum. The position of the peaks and troughs are modulated so that
2417 they vary over time, creating a sweeping effect.
2418
2419 A description of the accepted parameters follows.
2420
2421 in_gain
2422 Set input gain. Default is 0.4.
2423
2424 out_gain
2425 Set output gain. Default is 0.74
2426
2427 delay
2428 Set delay in milliseconds. Default is 3.0.
2429
2430 decay
2431 Set decay. Default is 0.4.
2432
2433 speed
2434 Set modulation speed in Hz. Default is 0.5.
2435
2436 type
2437 Set modulation type. Default is triangular.
2438
2439 It accepts the following values:
2440
2441 triangular, t
2442 sinusoidal, s
2443
2444 aphaseshift
2445 Apply phase shift to input audio samples.
2446
2447 The filter accepts the following options:
2448
2449 shift
2450 Specify phase shift. Allowed range is from -1.0 to 1.0. Default
2451 value is 0.0.
2452
2453 level
2454 Set output gain applied to final output. Allowed range is from 0.0
2455 to 1.0. Default value is 1.0.
2456
2457 order
2458 Set filter order used for filtering. Allowed range is from 1 to 16.
2459 Default value is 8.
2460
2461 Commands
2462
2463 This filter supports the all above options as commands.
2464
2465 apsyclip
2466 Apply Psychoacoustic clipper to input audio stream.
2467
2468 The filter accepts the following options:
2469
2470 level_in
2471 Set input gain. By default it is 1. Range is [0.015625 - 64].
2472
2473 level_out
2474 Set output gain. By default it is 1. Range is [0.015625 - 64].
2475
2476 clip
2477 Set the clipping start value. Default value is 0dBFS or 1.
2478
2479 diff
2480 Output only difference samples, useful to hear introduced
2481 distortions. By default is disabled.
2482
2483 adaptive
2484 Set strength of adaptive distortion applied. Default value is 0.5.
2485 Allowed range is from 0 to 1.
2486
2487 iterations
2488 Set number of iterations of psychoacoustic clipper. Allowed range
2489 is from 1 to 20. Default value is 10.
2490
2491 level
2492 Auto level output signal. Default is disabled. This normalizes
2493 audio back to 0dBFS if enabled.
2494
2495 Commands
2496
2497 This filter supports the all above options as commands.
2498
2499 apulsator
2500 Audio pulsator is something between an autopanner and a tremolo. But
2501 it can produce funny stereo effects as well. Pulsator changes the
2502 volume of the left and right channel based on a LFO (low frequency
2503 oscillator) with different waveforms and shifted phases. This filter
2504 have the ability to define an offset between left and right channel. An
2505 offset of 0 means that both LFO shapes match each other. The left and
2506 right channel are altered equally - a conventional tremolo. An offset
2507 of 50% means that the shape of the right channel is exactly shifted in
2508 phase (or moved backwards about half of the frequency) - pulsator acts
2509 as an autopanner. At 1 both curves match again. Every setting in
2510 between moves the phase shift gapless between all stages and produces
2511 some "bypassing" sounds with sine and triangle waveforms. The more you
2512 set the offset near 1 (starting from the 0.5) the faster the signal
2513 passes from the left to the right speaker.
2514
2515 The filter accepts the following options:
2516
2517 level_in
2518 Set input gain. By default it is 1. Range is [0.015625 - 64].
2519
2520 level_out
2521 Set output gain. By default it is 1. Range is [0.015625 - 64].
2522
2523 mode
2524 Set waveform shape the LFO will use. Can be one of: sine, triangle,
2525 square, sawup or sawdown. Default is sine.
2526
2527 amount
2528 Set modulation. Define how much of original signal is affected by
2529 the LFO.
2530
2531 offset_l
2532 Set left channel offset. Default is 0. Allowed range is [0 - 1].
2533
2534 offset_r
2535 Set right channel offset. Default is 0.5. Allowed range is [0 - 1].
2536
2537 width
2538 Set pulse width. Default is 1. Allowed range is [0 - 2].
2539
2540 timing
2541 Set possible timing mode. Can be one of: bpm, ms or hz. Default is
2542 hz.
2543
2544 bpm Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if
2545 timing is set to bpm.
2546
2547 ms Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if
2548 timing is set to ms.
2549
2550 hz Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100].
2551 Only used if timing is set to hz.
2552
2553 aresample
2554 Resample the input audio to the specified parameters, using the
2555 libswresample library. If none are specified then the filter will
2556 automatically convert between its input and output.
2557
2558 This filter is also able to stretch/squeeze the audio data to make it
2559 match the timestamps or to inject silence / cut out audio to make it
2560 match the timestamps, do a combination of both or do neither.
2561
2562 The filter accepts the syntax [sample_rate:]resampler_options, where
2563 sample_rate expresses a sample rate and resampler_options is a list of
2564 key=value pairs, separated by ":". See the "Resampler Options" section
2565 in the ffmpeg-resampler(1) manual for the complete list of supported
2566 options.
2567
2568 Examples
2569
2570 • Resample the input audio to 44100Hz:
2571
2572 aresample=44100
2573
2574 • Stretch/squeeze samples to the given timestamps, with a maximum of
2575 1000 samples per second compensation:
2576
2577 aresample=async=1000
2578
2579 areverse
2580 Reverse an audio clip.
2581
2582 Warning: This filter requires memory to buffer the entire clip, so
2583 trimming is suggested.
2584
2585 Examples
2586
2587 • Take the first 5 seconds of a clip, and reverse it.
2588
2589 atrim=end=5,areverse
2590
2591 arnndn
2592 Reduce noise from speech using Recurrent Neural Networks.
2593
2594 This filter accepts the following options:
2595
2596 model, m
2597 Set train model file to load. This option is always required.
2598
2599 mix Set how much to mix filtered samples into final output. Allowed
2600 range is from -1 to 1. Default value is 1. Negative values are
2601 special, they set how much to keep filtered noise in the final
2602 filter output. Set this option to -1 to hear actual noise removed
2603 from input signal.
2604
2605 Commands
2606
2607 This filter supports the all above options as commands.
2608
2609 asdr
2610 Measure Audio Signal-to-Distortion Ratio.
2611
2612 This filter takes two audio streams for input, and outputs first audio
2613 stream. Results are in dB per channel at end of either input.
2614
2615 asetnsamples
2616 Set the number of samples per each output audio frame.
2617
2618 The last output packet may contain a different number of samples, as
2619 the filter will flush all the remaining samples when the input audio
2620 signals its end.
2621
2622 The filter accepts the following options:
2623
2624 nb_out_samples, n
2625 Set the number of frames per each output audio frame. The number is
2626 intended as the number of samples per each channel. Default value
2627 is 1024.
2628
2629 pad, p
2630 If set to 1, the filter will pad the last audio frame with zeroes,
2631 so that the last frame will contain the same number of samples as
2632 the previous ones. Default value is 1.
2633
2634 For example, to set the number of per-frame samples to 1234 and disable
2635 padding for the last frame, use:
2636
2637 asetnsamples=n=1234:p=0
2638
2639 asetrate
2640 Set the sample rate without altering the PCM data. This will result in
2641 a change of speed and pitch.
2642
2643 The filter accepts the following options:
2644
2645 sample_rate, r
2646 Set the output sample rate. Default is 44100 Hz.
2647
2648 ashowinfo
2649 Show a line containing various information for each input audio frame.
2650 The input audio is not modified.
2651
2652 The shown line contains a sequence of key/value pairs of the form
2653 key:value.
2654
2655 The following values are shown in the output:
2656
2657 n The (sequential) number of the input frame, starting from 0.
2658
2659 pts The presentation timestamp of the input frame, in time base units;
2660 the time base depends on the filter input pad, and is usually
2661 1/sample_rate.
2662
2663 pts_time
2664 The presentation timestamp of the input frame in seconds.
2665
2666 pos position of the frame in the input stream, -1 if this information
2667 in unavailable and/or meaningless (for example in case of synthetic
2668 audio)
2669
2670 fmt The sample format.
2671
2672 chlayout
2673 The channel layout.
2674
2675 rate
2676 The sample rate for the audio frame.
2677
2678 nb_samples
2679 The number of samples (per channel) in the frame.
2680
2681 checksum
2682 The Adler-32 checksum (printed in hexadecimal) of the audio data.
2683 For planar audio, the data is treated as if all the planes were
2684 concatenated.
2685
2686 plane_checksums
2687 A list of Adler-32 checksums for each data plane.
2688
2689 asoftclip
2690 Apply audio soft clipping.
2691
2692 Soft clipping is a type of distortion effect where the amplitude of a
2693 signal is saturated along a smooth curve, rather than the abrupt shape
2694 of hard-clipping.
2695
2696 This filter accepts the following options:
2697
2698 type
2699 Set type of soft-clipping.
2700
2701 It accepts the following values:
2702
2703 hard
2704 tanh
2705 atan
2706 cubic
2707 exp
2708 alg
2709 quintic
2710 sin
2711 erf
2712 threshold
2713 Set threshold from where to start clipping. Default value is 0dB or
2714 1.
2715
2716 output
2717 Set gain applied to output. Default value is 0dB or 1.
2718
2719 param
2720 Set additional parameter which controls sigmoid function.
2721
2722 oversample
2723 Set oversampling factor.
2724
2725 Commands
2726
2727 This filter supports the all above options as commands.
2728
2729 aspectralstats
2730 Display frequency domain statistical information about the audio
2731 channels. Statistics are calculated and stored as metadata for each
2732 audio channel and for each audio frame.
2733
2734 It accepts the following option:
2735
2736 win_size
2737 Set the window length in samples. Default value is 2048. Allowed
2738 range is from 32 to 65536.
2739
2740 win_func
2741 Set window function.
2742
2743 It accepts the following values:
2744
2745 rect
2746 bartlett
2747 hann, hanning
2748 hamming
2749 blackman
2750 welch
2751 flattop
2752 bharris
2753 bnuttall
2754 bhann
2755 sine
2756 nuttall
2757 lanczos
2758 gauss
2759 tukey
2760 dolph
2761 cauchy
2762 parzen
2763 poisson
2764 bohman
2765 kaiser
2766
2767 Default is "hann".
2768
2769 overlap
2770 Set window overlap. Allowed range is from 0 to 1. Default value is
2771 0.5.
2772
2773 measure
2774 Select the parameters which are measured. The metadata keys can be
2775 used as flags, default is all which measures everything. none
2776 disables all measurement.
2777
2778 A list of each metadata key follows:
2779
2780 mean
2781 variance
2782 centroid
2783 spread
2784 skewness
2785 kurtosis
2786 entropy
2787 flatness
2788 crest
2789 flux
2790 slope
2791 decrease
2792 rolloff
2793
2794 asr
2795 Automatic Speech Recognition
2796
2797 This filter uses PocketSphinx for speech recognition. To enable
2798 compilation of this filter, you need to configure FFmpeg with
2799 "--enable-pocketsphinx".
2800
2801 It accepts the following options:
2802
2803 rate
2804 Set sampling rate of input audio. Defaults is 16000. This need to
2805 match speech models, otherwise one will get poor results.
2806
2807 hmm Set dictionary containing acoustic model files.
2808
2809 dict
2810 Set pronunciation dictionary.
2811
2812 lm Set language model file.
2813
2814 lmctl
2815 Set language model set.
2816
2817 lmname
2818 Set which language model to use.
2819
2820 logfn
2821 Set output for log messages.
2822
2823 The filter exports recognized speech as the frame metadata
2824 "lavfi.asr.text".
2825
2826 astats
2827 Display time domain statistical information about the audio channels.
2828 Statistics are calculated and displayed for each audio channel and,
2829 where applicable, an overall figure is also given.
2830
2831 It accepts the following option:
2832
2833 length
2834 Short window length in seconds, used for peak and trough RMS
2835 measurement. Default is 0.05 (50 milliseconds). Allowed range is
2836 "[0 - 10]".
2837
2838 metadata
2839 Set metadata injection. All the metadata keys are prefixed with
2840 "lavfi.astats.X", where "X" is channel number starting from 1 or
2841 string "Overall". Default is disabled.
2842
2843 Available keys for each channel are: Bit_depth Crest_factor
2844 DC_offset Dynamic_range Entropy Flat_factor Max_difference
2845 Max_level Mean_difference Min_difference Min_level Noise_floor
2846 Noise_floor_count Number_of_Infs Number_of_NaNs Number_of_denormals
2847 Peak_count Peak_level RMS_difference RMS_peak RMS_trough
2848 Zero_crossings Zero_crossings_rate
2849
2850 and for "Overall": Bit_depth DC_offset Entropy Flat_factor
2851 Max_difference Max_level Mean_difference Min_difference Min_level
2852 Noise_floor Noise_floor_count Number_of_Infs Number_of_NaNs
2853 Number_of_denormals Number_of_samples Peak_count Peak_level
2854 RMS_difference RMS_level RMS_peak RMS_trough
2855
2856 For example, a full key looks like "lavfi.astats.1.DC_offset" or
2857 "lavfi.astats.Overall.Peak_count".
2858
2859 Read below for the description of the keys.
2860
2861 reset
2862 Set the number of frames over which cumulative stats are calculated
2863 before being reset. Default is disabled.
2864
2865 measure_perchannel
2866 Select the parameters which are measured per channel. The metadata
2867 keys can be used as flags, default is all which measures
2868 everything. none disables all per channel measurement.
2869
2870 measure_overall
2871 Select the parameters which are measured overall. The metadata keys
2872 can be used as flags, default is all which measures everything.
2873 none disables all overall measurement.
2874
2875 A description of the measure keys follow:
2876
2877 none
2878 no measures
2879
2880 all all measures
2881
2882 Bit_depth
2883 overall bit depth of audio, i.e. number of bits used for each
2884 sample
2885
2886 Crest_factor
2887 standard ratio of peak to RMS level (note: not in dB)
2888
2889 DC_offset
2890 mean amplitude displacement from zero
2891
2892 Dynamic_range
2893 measured dynamic range of audio in dB
2894
2895 Entropy
2896 entropy measured across whole audio, entropy of value near 1.0 is
2897 typically measured for white noise
2898
2899 Flat_factor
2900 flatness (i.e. consecutive samples with the same value) of the
2901 signal at its peak levels (i.e. either Min_level or Max_level)
2902
2903 Max_difference
2904 maximal difference between two consecutive samples
2905
2906 Max_level
2907 maximal sample level
2908
2909 Mean_difference
2910 mean difference between two consecutive samples, i.e. the average
2911 of each difference between two consecutive samples
2912
2913 Min_difference
2914 minimal difference between two consecutive samples
2915
2916 Min_level
2917 minimal sample level
2918
2919 Noise_floor
2920 minimum local peak measured in dBFS over a short window
2921
2922 Noise_floor_count
2923 number of occasions (not the number of samples) that the signal
2924 attained Noise floor
2925
2926 Number_of_Infs
2927 number of samples with an infinite value
2928
2929 Number_of_NaNs
2930 number of samples with a NaN (not a number) value
2931
2932 Number_of_denormals
2933 number of samples with a subnormal value
2934
2935 Number_of_samples
2936 number of samples
2937
2938 Peak_count
2939 number of occasions (not the number of samples) that the signal
2940 attained either Min_level or Max_level
2941
2942 Peak_level
2943 standard peak level measured in dBFS
2944
2945 RMS_difference
2946 Root Mean Square difference between two consecutive samples
2947
2948 RMS_level
2949 standard RMS level measured in dBFS
2950
2951 RMS_peak
2952 RMS_trough
2953 peak and trough values for RMS level measured over a short window,
2954 measured in dBFS.
2955
2956 Zero crossings
2957 number of points where the waveform crosses the zero level axis
2958
2959 Zero crossings rate
2960 rate of Zero crossings and number of audio samples
2961
2962 asubboost
2963 Boost subwoofer frequencies.
2964
2965 The filter accepts the following options:
2966
2967 dry Set dry gain, how much of original signal is kept. Allowed range is
2968 from 0 to 1. Default value is 1.0.
2969
2970 wet Set wet gain, how much of filtered signal is kept. Allowed range is
2971 from 0 to 1. Default value is 1.0.
2972
2973 boost
2974 Set max boost factor. Allowed range is from 1 to 12. Default value
2975 is 2.
2976
2977 decay
2978 Set delay line decay gain value. Allowed range is from 0 to 1.
2979 Default value is 0.0.
2980
2981 feedback
2982 Set delay line feedback gain value. Allowed range is from 0 to 1.
2983 Default value is 0.9.
2984
2985 cutoff
2986 Set cutoff frequency in Hertz. Allowed range is 50 to 900. Default
2987 value is 100.
2988
2989 slope
2990 Set slope amount for cutoff frequency. Allowed range is 0.0001 to
2991 1. Default value is 0.5.
2992
2993 delay
2994 Set delay. Allowed range is from 1 to 100. Default value is 20.
2995
2996 channels
2997 Set the channels to process. Default value is all available.
2998
2999 Commands
3000
3001 This filter supports the all above options as commands.
3002
3003 asubcut
3004 Cut subwoofer frequencies.
3005
3006 This filter allows to set custom, steeper roll off than highpass
3007 filter, and thus is able to more attenuate frequency content in stop-
3008 band.
3009
3010 The filter accepts the following options:
3011
3012 cutoff
3013 Set cutoff frequency in Hertz. Allowed range is 2 to 200. Default
3014 value is 20.
3015
3016 order
3017 Set filter order. Available values are from 3 to 20. Default value
3018 is 10.
3019
3020 level
3021 Set input gain level. Allowed range is from 0 to 1. Default value
3022 is 1.
3023
3024 Commands
3025
3026 This filter supports the all above options as commands.
3027
3028 asupercut
3029 Cut super frequencies.
3030
3031 The filter accepts the following options:
3032
3033 cutoff
3034 Set cutoff frequency in Hertz. Allowed range is 20000 to 192000.
3035 Default value is 20000.
3036
3037 order
3038 Set filter order. Available values are from 3 to 20. Default value
3039 is 10.
3040
3041 level
3042 Set input gain level. Allowed range is from 0 to 1. Default value
3043 is 1.
3044
3045 Commands
3046
3047 This filter supports the all above options as commands.
3048
3049 asuperpass
3050 Apply high order Butterworth band-pass filter.
3051
3052 The filter accepts the following options:
3053
3054 centerf
3055 Set center frequency in Hertz. Allowed range is 2 to 999999.
3056 Default value is 1000.
3057
3058 order
3059 Set filter order. Available values are from 4 to 20. Default value
3060 is 4.
3061
3062 qfactor
3063 Set Q-factor. Allowed range is from 0.01 to 100. Default value is
3064 1.
3065
3066 level
3067 Set input gain level. Allowed range is from 0 to 2. Default value
3068 is 1.
3069
3070 Commands
3071
3072 This filter supports the all above options as commands.
3073
3074 asuperstop
3075 Apply high order Butterworth band-stop filter.
3076
3077 The filter accepts the following options:
3078
3079 centerf
3080 Set center frequency in Hertz. Allowed range is 2 to 999999.
3081 Default value is 1000.
3082
3083 order
3084 Set filter order. Available values are from 4 to 20. Default value
3085 is 4.
3086
3087 qfactor
3088 Set Q-factor. Allowed range is from 0.01 to 100. Default value is
3089 1.
3090
3091 level
3092 Set input gain level. Allowed range is from 0 to 2. Default value
3093 is 1.
3094
3095 Commands
3096
3097 This filter supports the all above options as commands.
3098
3099 atempo
3100 Adjust audio tempo.
3101
3102 The filter accepts exactly one parameter, the audio tempo. If not
3103 specified then the filter will assume nominal 1.0 tempo. Tempo must be
3104 in the [0.5, 100.0] range.
3105
3106 Note that tempo greater than 2 will skip some samples rather than blend
3107 them in. If for any reason this is a concern it is always possible to
3108 daisy-chain several instances of atempo to achieve the desired product
3109 tempo.
3110
3111 Examples
3112
3113 • Slow down audio to 80% tempo:
3114
3115 atempo=0.8
3116
3117 • To speed up audio to 300% tempo:
3118
3119 atempo=3
3120
3121 • To speed up audio to 300% tempo by daisy-chaining two atempo
3122 instances:
3123
3124 atempo=sqrt(3),atempo=sqrt(3)
3125
3126 Commands
3127
3128 This filter supports the following commands:
3129
3130 tempo
3131 Change filter tempo scale factor. Syntax for the command is :
3132 "tempo"
3133
3134 atilt
3135 Apply spectral tilt filter to audio stream.
3136
3137 This filter apply any spectral roll-off slope over any specified
3138 frequency band.
3139
3140 The filter accepts the following options:
3141
3142 freq
3143 Set central frequency of tilt in Hz. Default is 10000 Hz.
3144
3145 slope
3146 Set slope direction of tilt. Default is 0. Allowed range is from -1
3147 to 1.
3148
3149 width
3150 Set width of tilt. Default is 1000. Allowed range is from 100 to
3151 10000.
3152
3153 order
3154 Set order of tilt filter.
3155
3156 level
3157 Set input volume level. Allowed range is from 0 to 4. Defalt is 1.
3158
3159 Commands
3160
3161 This filter supports the all above options as commands.
3162
3163 atrim
3164 Trim the input so that the output contains one continuous subpart of
3165 the input.
3166
3167 It accepts the following parameters:
3168
3169 start
3170 Timestamp (in seconds) of the start of the section to keep. I.e.
3171 the audio sample with the timestamp start will be the first sample
3172 in the output.
3173
3174 end Specify time of the first audio sample that will be dropped, i.e.
3175 the audio sample immediately preceding the one with the timestamp
3176 end will be the last sample in the output.
3177
3178 start_pts
3179 Same as start, except this option sets the start timestamp in
3180 samples instead of seconds.
3181
3182 end_pts
3183 Same as end, except this option sets the end timestamp in samples
3184 instead of seconds.
3185
3186 duration
3187 The maximum duration of the output in seconds.
3188
3189 start_sample
3190 The number of the first sample that should be output.
3191
3192 end_sample
3193 The number of the first sample that should be dropped.
3194
3195 start, end, and duration are expressed as time duration specifications;
3196 see the Time duration section in the ffmpeg-utils(1) manual.
3197
3198 Note that the first two sets of the start/end options and the duration
3199 option look at the frame timestamp, while the _sample options simply
3200 count the samples that pass through the filter. So start/end_pts and
3201 start/end_sample will give different results when the timestamps are
3202 wrong, inexact or do not start at zero. Also note that this filter does
3203 not modify the timestamps. If you wish to have the output timestamps
3204 start at zero, insert the asetpts filter after the atrim filter.
3205
3206 If multiple start or end options are set, this filter tries to be
3207 greedy and keep all samples that match at least one of the specified
3208 constraints. To keep only the part that matches all the constraints at
3209 once, chain multiple atrim filters.
3210
3211 The defaults are such that all the input is kept. So it is possible to
3212 set e.g. just the end values to keep everything before the specified
3213 time.
3214
3215 Examples:
3216
3217 • Drop everything except the second minute of input:
3218
3219 ffmpeg -i INPUT -af atrim=60:120
3220
3221 • Keep only the first 1000 samples:
3222
3223 ffmpeg -i INPUT -af atrim=end_sample=1000
3224
3225 axcorrelate
3226 Calculate normalized windowed cross-correlation between two input audio
3227 streams.
3228
3229 Resulted samples are always between -1 and 1 inclusive. If result is 1
3230 it means two input samples are highly correlated in that selected
3231 segment. Result 0 means they are not correlated at all. If result is
3232 -1 it means two input samples are out of phase, which means they cancel
3233 each other.
3234
3235 The filter accepts the following options:
3236
3237 size
3238 Set size of segment over which cross-correlation is calculated.
3239 Default is 256. Allowed range is from 2 to 131072.
3240
3241 algo
3242 Set algorithm for cross-correlation. Can be "slow" or "fast".
3243 Default is "slow". Fast algorithm assumes mean values over any
3244 given segment are always zero and thus need much less calculations
3245 to make. This is generally not true, but is valid for typical
3246 audio streams.
3247
3248 Examples
3249
3250 • Calculate correlation between channels in stereo audio stream:
3251
3252 ffmpeg -i stereo.wav -af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav
3253
3254 bandpass
3255 Apply a two-pole Butterworth band-pass filter with central frequency
3256 frequency, and (3dB-point) band-width width. The csg option selects a
3257 constant skirt gain (peak gain = Q) instead of the default: constant
3258 0dB peak gain. The filter roll off at 6dB per octave (20dB per
3259 decade).
3260
3261 The filter accepts the following options:
3262
3263 frequency, f
3264 Set the filter's central frequency. Default is 3000.
3265
3266 csg Constant skirt gain if set to 1. Defaults to 0.
3267
3268 width_type, t
3269 Set method to specify band-width of filter.
3270
3271 h Hz
3272
3273 q Q-Factor
3274
3275 o octave
3276
3277 s slope
3278
3279 k kHz
3280
3281 width, w
3282 Specify the band-width of a filter in width_type units.
3283
3284 mix, m
3285 How much to use filtered signal in output. Default is 1. Range is
3286 between 0 and 1.
3287
3288 channels, c
3289 Specify which channels to filter, by default all available are
3290 filtered.
3291
3292 normalize, n
3293 Normalize biquad coefficients, by default is disabled. Enabling it
3294 will normalize magnitude response at DC to 0dB.
3295
3296 transform, a
3297 Set transform type of IIR filter.
3298
3299 di
3300 dii
3301 tdi
3302 tdii
3303 latt
3304 svf
3305 zdf
3306 precision, r
3307 Set precison of filtering.
3308
3309 auto
3310 Pick automatic sample format depending on surround filters.
3311
3312 s16 Always use signed 16-bit.
3313
3314 s32 Always use signed 32-bit.
3315
3316 f32 Always use float 32-bit.
3317
3318 f64 Always use float 64-bit.
3319
3320 block_size, b
3321 Set block size used for reverse IIR processing. If this value is
3322 set to high enough value (higher than impulse response length
3323 truncated when reaches near zero values) filtering will become
3324 linear phase otherwise if not big enough it will just produce nasty
3325 artifacts.
3326
3327 Note that filter delay will be exactly this many samples when set
3328 to non-zero value.
3329
3330 Commands
3331
3332 This filter supports the following commands:
3333
3334 frequency, f
3335 Change bandpass frequency. Syntax for the command is : "frequency"
3336
3337 width_type, t
3338 Change bandpass width_type. Syntax for the command is :
3339 "width_type"
3340
3341 width, w
3342 Change bandpass width. Syntax for the command is : "width"
3343
3344 mix, m
3345 Change bandpass mix. Syntax for the command is : "mix"
3346
3347 bandreject
3348 Apply a two-pole Butterworth band-reject filter with central frequency
3349 frequency, and (3dB-point) band-width width. The filter roll off at
3350 6dB per octave (20dB per decade).
3351
3352 The filter accepts the following options:
3353
3354 frequency, f
3355 Set the filter's central frequency. Default is 3000.
3356
3357 width_type, t
3358 Set method to specify band-width of filter.
3359
3360 h Hz
3361
3362 q Q-Factor
3363
3364 o octave
3365
3366 s slope
3367
3368 k kHz
3369
3370 width, w
3371 Specify the band-width of a filter in width_type units.
3372
3373 mix, m
3374 How much to use filtered signal in output. Default is 1. Range is
3375 between 0 and 1.
3376
3377 channels, c
3378 Specify which channels to filter, by default all available are
3379 filtered.
3380
3381 normalize, n
3382 Normalize biquad coefficients, by default is disabled. Enabling it
3383 will normalize magnitude response at DC to 0dB.
3384
3385 transform, a
3386 Set transform type of IIR filter.
3387
3388 di
3389 dii
3390 tdi
3391 tdii
3392 latt
3393 svf
3394 zdf
3395 precision, r
3396 Set precison of filtering.
3397
3398 auto
3399 Pick automatic sample format depending on surround filters.
3400
3401 s16 Always use signed 16-bit.
3402
3403 s32 Always use signed 32-bit.
3404
3405 f32 Always use float 32-bit.
3406
3407 f64 Always use float 64-bit.
3408
3409 block_size, b
3410 Set block size used for reverse IIR processing. If this value is
3411 set to high enough value (higher than impulse response length
3412 truncated when reaches near zero values) filtering will become
3413 linear phase otherwise if not big enough it will just produce nasty
3414 artifacts.
3415
3416 Note that filter delay will be exactly this many samples when set
3417 to non-zero value.
3418
3419 Commands
3420
3421 This filter supports the following commands:
3422
3423 frequency, f
3424 Change bandreject frequency. Syntax for the command is :
3425 "frequency"
3426
3427 width_type, t
3428 Change bandreject width_type. Syntax for the command is :
3429 "width_type"
3430
3431 width, w
3432 Change bandreject width. Syntax for the command is : "width"
3433
3434 mix, m
3435 Change bandreject mix. Syntax for the command is : "mix"
3436
3437 bass, lowshelf
3438 Boost or cut the bass (lower) frequencies of the audio using a two-pole
3439 shelving filter with a response similar to that of a standard hi-fi's
3440 tone-controls. This is also known as shelving equalisation (EQ).
3441
3442 The filter accepts the following options:
3443
3444 gain, g
3445 Give the gain at 0 Hz. Its useful range is about -20 (for a large
3446 cut) to +20 (for a large boost). Beware of clipping when using a
3447 positive gain.
3448
3449 frequency, f
3450 Set the filter's central frequency and so can be used to extend or
3451 reduce the frequency range to be boosted or cut. The default value
3452 is 100 Hz.
3453
3454 width_type, t
3455 Set method to specify band-width of filter.
3456
3457 h Hz
3458
3459 q Q-Factor
3460
3461 o octave
3462
3463 s slope
3464
3465 k kHz
3466
3467 width, w
3468 Determine how steep is the filter's shelf transition.
3469
3470 poles, p
3471 Set number of poles. Default is 2.
3472
3473 mix, m
3474 How much to use filtered signal in output. Default is 1. Range is
3475 between 0 and 1.
3476
3477 channels, c
3478 Specify which channels to filter, by default all available are
3479 filtered.
3480
3481 normalize, n
3482 Normalize biquad coefficients, by default is disabled. Enabling it
3483 will normalize magnitude response at DC to 0dB.
3484
3485 transform, a
3486 Set transform type of IIR filter.
3487
3488 di
3489 dii
3490 tdi
3491 tdii
3492 latt
3493 svf
3494 zdf
3495 precision, r
3496 Set precison of filtering.
3497
3498 auto
3499 Pick automatic sample format depending on surround filters.
3500
3501 s16 Always use signed 16-bit.
3502
3503 s32 Always use signed 32-bit.
3504
3505 f32 Always use float 32-bit.
3506
3507 f64 Always use float 64-bit.
3508
3509 block_size, b
3510 Set block size used for reverse IIR processing. If this value is
3511 set to high enough value (higher than impulse response length
3512 truncated when reaches near zero values) filtering will become
3513 linear phase otherwise if not big enough it will just produce nasty
3514 artifacts.
3515
3516 Note that filter delay will be exactly this many samples when set
3517 to non-zero value.
3518
3519 Commands
3520
3521 This filter supports the following commands:
3522
3523 frequency, f
3524 Change bass frequency. Syntax for the command is : "frequency"
3525
3526 width_type, t
3527 Change bass width_type. Syntax for the command is : "width_type"
3528
3529 width, w
3530 Change bass width. Syntax for the command is : "width"
3531
3532 gain, g
3533 Change bass gain. Syntax for the command is : "gain"
3534
3535 mix, m
3536 Change bass mix. Syntax for the command is : "mix"
3537
3538 biquad
3539 Apply a biquad IIR filter with the given coefficients. Where b0, b1,
3540 b2 and a0, a1, a2 are the numerator and denominator coefficients
3541 respectively. and channels, c specify which channels to filter, by
3542 default all available are filtered.
3543
3544 Commands
3545
3546 This filter supports the following commands:
3547
3548 a0
3549 a1
3550 a2
3551 b0
3552 b1
3553 b2 Change biquad parameter. Syntax for the command is : "value"
3554
3555 mix, m
3556 How much to use filtered signal in output. Default is 1. Range is
3557 between 0 and 1.
3558
3559 channels, c
3560 Specify which channels to filter, by default all available are
3561 filtered.
3562
3563 normalize, n
3564 Normalize biquad coefficients, by default is disabled. Enabling it
3565 will normalize magnitude response at DC to 0dB.
3566
3567 transform, a
3568 Set transform type of IIR filter.
3569
3570 di
3571 dii
3572 tdi
3573 tdii
3574 latt
3575 svf
3576 zdf
3577 precision, r
3578 Set precison of filtering.
3579
3580 auto
3581 Pick automatic sample format depending on surround filters.
3582
3583 s16 Always use signed 16-bit.
3584
3585 s32 Always use signed 32-bit.
3586
3587 f32 Always use float 32-bit.
3588
3589 f64 Always use float 64-bit.
3590
3591 block_size, b
3592 Set block size used for reverse IIR processing. If this value is
3593 set to high enough value (higher than impulse response length
3594 truncated when reaches near zero values) filtering will become
3595 linear phase otherwise if not big enough it will just produce nasty
3596 artifacts.
3597
3598 Note that filter delay will be exactly this many samples when set
3599 to non-zero value.
3600
3601 bs2b
3602 Bauer stereo to binaural transformation, which improves headphone
3603 listening of stereo audio records.
3604
3605 To enable compilation of this filter you need to configure FFmpeg with
3606 "--enable-libbs2b".
3607
3608 It accepts the following parameters:
3609
3610 profile
3611 Pre-defined crossfeed level.
3612
3613 default
3614 Default level (fcut=700, feed=50).
3615
3616 cmoy
3617 Chu Moy circuit (fcut=700, feed=60).
3618
3619 jmeier
3620 Jan Meier circuit (fcut=650, feed=95).
3621
3622 fcut
3623 Cut frequency (in Hz).
3624
3625 feed
3626 Feed level (in Hz).
3627
3628 channelmap
3629 Remap input channels to new locations.
3630
3631 It accepts the following parameters:
3632
3633 map Map channels from input to output. The argument is a '|'-separated
3634 list of mappings, each in the "in_channel-out_channel" or
3635 in_channel form. in_channel can be either the name of the input
3636 channel (e.g. FL for front left) or its index in the input channel
3637 layout. out_channel is the name of the output channel or its index
3638 in the output channel layout. If out_channel is not given then it
3639 is implicitly an index, starting with zero and increasing by one
3640 for each mapping.
3641
3642 channel_layout
3643 The channel layout of the output stream.
3644
3645 If no mapping is present, the filter will implicitly map input channels
3646 to output channels, preserving indices.
3647
3648 Examples
3649
3650 • For example, assuming a 5.1+downmix input MOV file,
3651
3652 ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
3653
3654 will create an output WAV file tagged as stereo from the downmix
3655 channels of the input.
3656
3657 • To fix a 5.1 WAV improperly encoded in AAC's native channel order
3658
3659 ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
3660
3661 channelsplit
3662 Split each channel from an input audio stream into a separate output
3663 stream.
3664
3665 It accepts the following parameters:
3666
3667 channel_layout
3668 The channel layout of the input stream. The default is "stereo".
3669
3670 channels
3671 A channel layout describing the channels to be extracted as
3672 separate output streams or "all" to extract each input channel as a
3673 separate stream. The default is "all".
3674
3675 Choosing channels not present in channel layout in the input will
3676 result in an error.
3677
3678 Examples
3679
3680 • For example, assuming a stereo input MP3 file,
3681
3682 ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
3683
3684 will create an output Matroska file with two audio streams, one
3685 containing only the left channel and the other the right channel.
3686
3687 • Split a 5.1 WAV file into per-channel files:
3688
3689 ffmpeg -i in.wav -filter_complex
3690 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
3691 -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
3692 front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
3693 side_right.wav
3694
3695 • Extract only LFE from a 5.1 WAV file:
3696
3697 ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1:channels=LFE[LFE]'
3698 -map '[LFE]' lfe.wav
3699
3700 chorus
3701 Add a chorus effect to the audio.
3702
3703 Can make a single vocal sound like a chorus, but can also be applied to
3704 instrumentation.
3705
3706 Chorus resembles an echo effect with a short delay, but whereas with
3707 echo the delay is constant, with chorus, it is varied using using
3708 sinusoidal or triangular modulation. The modulation depth defines the
3709 range the modulated delay is played before or after the delay. Hence
3710 the delayed sound will sound slower or faster, that is the delayed
3711 sound tuned around the original one, like in a chorus where some vocals
3712 are slightly off key.
3713
3714 It accepts the following parameters:
3715
3716 in_gain
3717 Set input gain. Default is 0.4.
3718
3719 out_gain
3720 Set output gain. Default is 0.4.
3721
3722 delays
3723 Set delays. A typical delay is around 40ms to 60ms.
3724
3725 decays
3726 Set decays.
3727
3728 speeds
3729 Set speeds.
3730
3731 depths
3732 Set depths.
3733
3734 Examples
3735
3736 • A single delay:
3737
3738 chorus=0.7:0.9:55:0.4:0.25:2
3739
3740 • Two delays:
3741
3742 chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
3743
3744 • Fuller sounding chorus with three delays:
3745
3746 chorus=0.5:0.9:50|60|40:0.4|0.32|0.3:0.25|0.4|0.3:2|2.3|1.3
3747
3748 compand
3749 Compress or expand the audio's dynamic range.
3750
3751 It accepts the following parameters:
3752
3753 attacks
3754 decays
3755 A list of times in seconds for each channel over which the
3756 instantaneous level of the input signal is averaged to determine
3757 its volume. attacks refers to increase of volume and decays refers
3758 to decrease of volume. For most situations, the attack time
3759 (response to the audio getting louder) should be shorter than the
3760 decay time, because the human ear is more sensitive to sudden loud
3761 audio than sudden soft audio. A typical value for attack is 0.3
3762 seconds and a typical value for decay is 0.8 seconds. If specified
3763 number of attacks & decays is lower than number of channels, the
3764 last set attack/decay will be used for all remaining channels.
3765
3766 points
3767 A list of points for the transfer function, specified in dB
3768 relative to the maximum possible signal amplitude. Each key points
3769 list must be defined using the following syntax:
3770 "x0/y0|x1/y1|x2/y2|...." or "x0/y0 x1/y1 x2/y2 ...."
3771
3772 The input values must be in strictly increasing order but the
3773 transfer function does not have to be monotonically rising. The
3774 point "0/0" is assumed but may be overridden (by "0/out-dBn").
3775 Typical values for the transfer function are "-70/-70|-60/-20|1/0".
3776
3777 soft-knee
3778 Set the curve radius in dB for all joints. It defaults to 0.01.
3779
3780 gain
3781 Set the additional gain in dB to be applied at all points on the
3782 transfer function. This allows for easy adjustment of the overall
3783 gain. It defaults to 0.
3784
3785 volume
3786 Set an initial volume, in dB, to be assumed for each channel when
3787 filtering starts. This permits the user to supply a nominal level
3788 initially, so that, for example, a very large gain is not applied
3789 to initial signal levels before the companding has begun to
3790 operate. A typical value for audio which is initially quiet is -90
3791 dB. It defaults to 0.
3792
3793 delay
3794 Set a delay, in seconds. The input audio is analyzed immediately,
3795 but audio is delayed before being fed to the volume adjuster.
3796 Specifying a delay approximately equal to the attack/decay times
3797 allows the filter to effectively operate in predictive rather than
3798 reactive mode. It defaults to 0.
3799
3800 Examples
3801
3802 • Make music with both quiet and loud passages suitable for listening
3803 to in a noisy environment:
3804
3805 compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
3806
3807 Another example for audio with whisper and explosion parts:
3808
3809 compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
3810
3811 • A noise gate for when the noise is at a lower level than the
3812 signal:
3813
3814 compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
3815
3816 • Here is another noise gate, this time for when the noise is at a
3817 higher level than the signal (making it, in some ways, similar to
3818 squelch):
3819
3820 compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
3821
3822 • 2:1 compression starting at -6dB:
3823
3824 compand=points=-80/-80|-6/-6|0/-3.8|20/3.5
3825
3826 • 2:1 compression starting at -9dB:
3827
3828 compand=points=-80/-80|-9/-9|0/-5.3|20/2.9
3829
3830 • 2:1 compression starting at -12dB:
3831
3832 compand=points=-80/-80|-12/-12|0/-6.8|20/1.9
3833
3834 • 2:1 compression starting at -18dB:
3835
3836 compand=points=-80/-80|-18/-18|0/-9.8|20/0.7
3837
3838 • 3:1 compression starting at -15dB:
3839
3840 compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2
3841
3842 • Compressor/Gate:
3843
3844 compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
3845
3846 • Expander:
3847
3848 compand=attacks=0:points=-80/-169|-54/-80|-49.5/-64.6|-41.1/-41.1|-25.8/-15|-10.8/-4.5|0/0|20/8.3
3849
3850 • Hard limiter at -6dB:
3851
3852 compand=attacks=0:points=-80/-80|-6/-6|20/-6
3853
3854 • Hard limiter at -12dB:
3855
3856 compand=attacks=0:points=-80/-80|-12/-12|20/-12
3857
3858 • Hard noise gate at -35 dB:
3859
3860 compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20
3861
3862 • Soft limiter:
3863
3864 compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
3865
3866 compensationdelay
3867 Compensation Delay Line is a metric based delay to compensate differing
3868 positions of microphones or speakers.
3869
3870 For example, you have recorded guitar with two microphones placed in
3871 different locations. Because the front of sound wave has fixed speed in
3872 normal conditions, the phasing of microphones can vary and depends on
3873 their location and interposition. The best sound mix can be achieved
3874 when these microphones are in phase (synchronized). Note that a
3875 distance of ~30 cm between microphones makes one microphone capture the
3876 signal in antiphase to the other microphone. That makes the final mix
3877 sound moody. This filter helps to solve phasing problems by adding
3878 different delays to each microphone track and make them synchronized.
3879
3880 The best result can be reached when you take one track as base and
3881 synchronize other tracks one by one with it. Remember that
3882 synchronization/delay tolerance depends on sample rate, too. Higher
3883 sample rates will give more tolerance.
3884
3885 The filter accepts the following parameters:
3886
3887 mm Set millimeters distance. This is compensation distance for fine
3888 tuning. Default is 0.
3889
3890 cm Set cm distance. This is compensation distance for tightening
3891 distance setup. Default is 0.
3892
3893 m Set meters distance. This is compensation distance for hard
3894 distance setup. Default is 0.
3895
3896 dry Set dry amount. Amount of unprocessed (dry) signal. Default is 0.
3897
3898 wet Set wet amount. Amount of processed (wet) signal. Default is 1.
3899
3900 temp
3901 Set temperature in degrees Celsius. This is the temperature of the
3902 environment. Default is 20.
3903
3904 Commands
3905
3906 This filter supports the all above options as commands.
3907
3908 crossfeed
3909 Apply headphone crossfeed filter.
3910
3911 Crossfeed is the process of blending the left and right channels of
3912 stereo audio recording. It is mainly used to reduce extreme stereo
3913 separation of low frequencies.
3914
3915 The intent is to produce more speaker like sound to the listener.
3916
3917 The filter accepts the following options:
3918
3919 strength
3920 Set strength of crossfeed. Default is 0.2. Allowed range is from 0
3921 to 1. This sets gain of low shelf filter for side part of stereo
3922 image. Default is -6dB. Max allowed is -30db when strength is set
3923 to 1.
3924
3925 range
3926 Set soundstage wideness. Default is 0.5. Allowed range is from 0 to
3927 1. This sets cut off frequency of low shelf filter. Default is cut
3928 off near 1550 Hz. With range set to 1 cut off frequency is set to
3929 2100 Hz.
3930
3931 slope
3932 Set curve slope of low shelf filter. Default is 0.5. Allowed range
3933 is from 0.01 to 1.
3934
3935 level_in
3936 Set input gain. Default is 0.9.
3937
3938 level_out
3939 Set output gain. Default is 1.
3940
3941 block_size
3942 Set block size used for reverse IIR processing. If this value is
3943 set to high enough value (higher than impulse response length
3944 truncated when reaches near zero values) filtering will become
3945 linear phase otherwise if not big enough it will just produce nasty
3946 artifacts.
3947
3948 Note that filter delay will be exactly this many samples when set
3949 to non-zero value.
3950
3951 Commands
3952
3953 This filter supports the all above options as commands.
3954
3955 crystalizer
3956 Simple algorithm for audio noise sharpening.
3957
3958 This filter linearly increases differences betweeen each audio sample.
3959
3960 The filter accepts the following options:
3961
3962 i Sets the intensity of effect (default: 2.0). Must be in range
3963 between -10.0 to 0 (unchanged sound) to 10.0 (maximum effect). To
3964 inverse filtering use negative value.
3965
3966 c Enable clipping. By default is enabled.
3967
3968 Commands
3969
3970 This filter supports the all above options as commands.
3971
3972 dcshift
3973 Apply a DC shift to the audio.
3974
3975 This can be useful to remove a DC offset (caused perhaps by a hardware
3976 problem in the recording chain) from the audio. The effect of a DC
3977 offset is reduced headroom and hence volume. The astats filter can be
3978 used to determine if a signal has a DC offset.
3979
3980 shift
3981 Set the DC shift, allowed range is [-1, 1]. It indicates the amount
3982 to shift the audio.
3983
3984 limitergain
3985 Optional. It should have a value much less than 1 (e.g. 0.05 or
3986 0.02) and is used to prevent clipping.
3987
3988 deesser
3989 Apply de-essing to the audio samples.
3990
3991 i Set intensity for triggering de-essing. Allowed range is from 0 to
3992 1. Default is 0.
3993
3994 m Set amount of ducking on treble part of sound. Allowed range is
3995 from 0 to 1. Default is 0.5.
3996
3997 f How much of original frequency content to keep when de-essing.
3998 Allowed range is from 0 to 1. Default is 0.5.
3999
4000 s Set the output mode.
4001
4002 It accepts the following values:
4003
4004 i Pass input unchanged.
4005
4006 o Pass ess filtered out.
4007
4008 e Pass only ess.
4009
4010 Default value is o.
4011
4012 dialoguenhance
4013 Enhance dialogue in stereo audio.
4014
4015 This filter accepts stereo input and produce surround (3.0) channels
4016 output. The newly produced front center channel have enhanced speech
4017 dialogue originally available in both stereo channels. This filter
4018 outputs front left and front right channels same as available in stereo
4019 input.
4020
4021 The filter accepts the following options:
4022
4023 original
4024 Set the original center factor to keep in front center channel
4025 output. Allowed range is from 0 to 1. Default value is 1.
4026
4027 enhance
4028 Set the dialogue enhance factor to put in front center channel
4029 output. Allowed range is from 0 to 3. Default value is 1.
4030
4031 voice
4032 Set the voice detection factor. Allowed range is from 2 to 32.
4033 Default value is 2.
4034
4035 Commands
4036
4037 This filter supports the all above options as commands.
4038
4039 drmeter
4040 Measure audio dynamic range.
4041
4042 DR values of 14 and higher is found in very dynamic material. DR of 8
4043 to 13 is found in transition material. And anything less that 8 have
4044 very poor dynamics and is very compressed.
4045
4046 The filter accepts the following options:
4047
4048 length
4049 Set window length in seconds used to split audio into segments of
4050 equal length. Default is 3 seconds.
4051
4052 dynaudnorm
4053 Dynamic Audio Normalizer.
4054
4055 This filter applies a certain amount of gain to the input audio in
4056 order to bring its peak magnitude to a target level (e.g. 0 dBFS).
4057 However, in contrast to more "simple" normalization algorithms, the
4058 Dynamic Audio Normalizer *dynamically* re-adjusts the gain factor to
4059 the input audio. This allows for applying extra gain to the "quiet"
4060 sections of the audio while avoiding distortions or clipping the "loud"
4061 sections. In other words: The Dynamic Audio Normalizer will "even out"
4062 the volume of quiet and loud sections, in the sense that the volume of
4063 each section is brought to the same target level. Note, however, that
4064 the Dynamic Audio Normalizer achieves this goal *without* applying
4065 "dynamic range compressing". It will retain 100% of the dynamic range
4066 *within* each section of the audio file.
4067
4068 framelen, f
4069 Set the frame length in milliseconds. In range from 10 to 8000
4070 milliseconds. Default is 500 milliseconds. The Dynamic Audio
4071 Normalizer processes the input audio in small chunks, referred to
4072 as frames. This is required, because a peak magnitude has no
4073 meaning for just a single sample value. Instead, we need to
4074 determine the peak magnitude for a contiguous sequence of sample
4075 values. While a "standard" normalizer would simply use the peak
4076 magnitude of the complete file, the Dynamic Audio Normalizer
4077 determines the peak magnitude individually for each frame. The
4078 length of a frame is specified in milliseconds. By default, the
4079 Dynamic Audio Normalizer uses a frame length of 500 milliseconds,
4080 which has been found to give good results with most files. Note
4081 that the exact frame length, in number of samples, will be
4082 determined automatically, based on the sampling rate of the
4083 individual input audio file.
4084
4085 gausssize, g
4086 Set the Gaussian filter window size. In range from 3 to 301, must
4087 be odd number. Default is 31. Probably the most important
4088 parameter of the Dynamic Audio Normalizer is the "window size" of
4089 the Gaussian smoothing filter. The filter's window size is
4090 specified in frames, centered around the current frame. For the
4091 sake of simplicity, this must be an odd number. Consequently, the
4092 default value of 31 takes into account the current frame, as well
4093 as the 15 preceding frames and the 15 subsequent frames. Using a
4094 larger window results in a stronger smoothing effect and thus in
4095 less gain variation, i.e. slower gain adaptation. Conversely, using
4096 a smaller window results in a weaker smoothing effect and thus in
4097 more gain variation, i.e. faster gain adaptation. In other words,
4098 the more you increase this value, the more the Dynamic Audio
4099 Normalizer will behave like a "traditional" normalization filter.
4100 On the contrary, the more you decrease this value, the more the
4101 Dynamic Audio Normalizer will behave like a dynamic range
4102 compressor.
4103
4104 peak, p
4105 Set the target peak value. This specifies the highest permissible
4106 magnitude level for the normalized audio input. This filter will
4107 try to approach the target peak magnitude as closely as possible,
4108 but at the same time it also makes sure that the normalized signal
4109 will never exceed the peak magnitude. A frame's maximum local gain
4110 factor is imposed directly by the target peak magnitude. The
4111 default value is 0.95 and thus leaves a headroom of 5%*. It is not
4112 recommended to go above this value.
4113
4114 maxgain, m
4115 Set the maximum gain factor. In range from 1.0 to 100.0. Default is
4116 10.0. The Dynamic Audio Normalizer determines the maximum possible
4117 (local) gain factor for each input frame, i.e. the maximum gain
4118 factor that does not result in clipping or distortion. The maximum
4119 gain factor is determined by the frame's highest magnitude sample.
4120 However, the Dynamic Audio Normalizer additionally bounds the
4121 frame's maximum gain factor by a predetermined (global) maximum
4122 gain factor. This is done in order to avoid excessive gain factors
4123 in "silent" or almost silent frames. By default, the maximum gain
4124 factor is 10.0, For most inputs the default value should be
4125 sufficient and it usually is not recommended to increase this
4126 value. Though, for input with an extremely low overall volume
4127 level, it may be necessary to allow even higher gain factors. Note,
4128 however, that the Dynamic Audio Normalizer does not simply apply a
4129 "hard" threshold (i.e. cut off values above the threshold).
4130 Instead, a "sigmoid" threshold function will be applied. This way,
4131 the gain factors will smoothly approach the threshold value, but
4132 never exceed that value.
4133
4134 targetrms, r
4135 Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 -
4136 disabled. By default, the Dynamic Audio Normalizer performs "peak"
4137 normalization. This means that the maximum local gain factor for
4138 each frame is defined (only) by the frame's highest magnitude
4139 sample. This way, the samples can be amplified as much as possible
4140 without exceeding the maximum signal level, i.e. without clipping.
4141 Optionally, however, the Dynamic Audio Normalizer can also take
4142 into account the frame's root mean square, abbreviated RMS. In
4143 electrical engineering, the RMS is commonly used to determine the
4144 power of a time-varying signal. It is therefore considered that the
4145 RMS is a better approximation of the "perceived loudness" than just
4146 looking at the signal's peak magnitude. Consequently, by adjusting
4147 all frames to a constant RMS value, a uniform "perceived loudness"
4148 can be established. If a target RMS value has been specified, a
4149 frame's local gain factor is defined as the factor that would
4150 result in exactly that RMS value. Note, however, that the maximum
4151 local gain factor is still restricted by the frame's highest
4152 magnitude sample, in order to prevent clipping.
4153
4154 coupling, n
4155 Enable channels coupling. By default is enabled. By default, the
4156 Dynamic Audio Normalizer will amplify all channels by the same
4157 amount. This means the same gain factor will be applied to all
4158 channels, i.e. the maximum possible gain factor is determined by
4159 the "loudest" channel. However, in some recordings, it may happen
4160 that the volume of the different channels is uneven, e.g. one
4161 channel may be "quieter" than the other one(s). In this case, this
4162 option can be used to disable the channel coupling. This way, the
4163 gain factor will be determined independently for each channel,
4164 depending only on the individual channel's highest magnitude
4165 sample. This allows for harmonizing the volume of the different
4166 channels.
4167
4168 correctdc, c
4169 Enable DC bias correction. By default is disabled. An audio signal
4170 (in the time domain) is a sequence of sample values. In the
4171 Dynamic Audio Normalizer these sample values are represented in the
4172 -1.0 to 1.0 range, regardless of the original input format.
4173 Normally, the audio signal, or "waveform", should be centered
4174 around the zero point. That means if we calculate the mean value
4175 of all samples in a file, or in a single frame, then the result
4176 should be 0.0 or at least very close to that value. If, however,
4177 there is a significant deviation of the mean value from 0.0, in
4178 either positive or negative direction, this is referred to as a DC
4179 bias or DC offset. Since a DC bias is clearly undesirable, the
4180 Dynamic Audio Normalizer provides optional DC bias correction.
4181 With DC bias correction enabled, the Dynamic Audio Normalizer will
4182 determine the mean value, or "DC correction" offset, of each input
4183 frame and subtract that value from all of the frame's sample values
4184 which ensures those samples are centered around 0.0 again. Also, in
4185 order to avoid "gaps" at the frame boundaries, the DC correction
4186 offset values will be interpolated smoothly between neighbouring
4187 frames.
4188
4189 altboundary, b
4190 Enable alternative boundary mode. By default is disabled. The
4191 Dynamic Audio Normalizer takes into account a certain neighbourhood
4192 around each frame. This includes the preceding frames as well as
4193 the subsequent frames. However, for the "boundary" frames, located
4194 at the very beginning and at the very end of the audio file, not
4195 all neighbouring frames are available. In particular, for the first
4196 few frames in the audio file, the preceding frames are not known.
4197 And, similarly, for the last few frames in the audio file, the
4198 subsequent frames are not known. Thus, the question arises which
4199 gain factors should be assumed for the missing frames in the
4200 "boundary" region. The Dynamic Audio Normalizer implements two
4201 modes to deal with this situation. The default boundary mode
4202 assumes a gain factor of exactly 1.0 for the missing frames,
4203 resulting in a smooth "fade in" and "fade out" at the beginning and
4204 at the end of the input, respectively.
4205
4206 compress, s
4207 Set the compress factor. In range from 0.0 to 30.0. Default is 0.0.
4208 By default, the Dynamic Audio Normalizer does not apply
4209 "traditional" compression. This means that signal peaks will not be
4210 pruned and thus the full dynamic range will be retained within each
4211 local neighbourhood. However, in some cases it may be desirable to
4212 combine the Dynamic Audio Normalizer's normalization algorithm with
4213 a more "traditional" compression. For this purpose, the Dynamic
4214 Audio Normalizer provides an optional compression (thresholding)
4215 function. If (and only if) the compression feature is enabled, all
4216 input frames will be processed by a soft knee thresholding function
4217 prior to the actual normalization process. Put simply, the
4218 thresholding function is going to prune all samples whose magnitude
4219 exceeds a certain threshold value. However, the Dynamic Audio
4220 Normalizer does not simply apply a fixed threshold value. Instead,
4221 the threshold value will be adjusted for each individual frame. In
4222 general, smaller parameters result in stronger compression, and
4223 vice versa. Values below 3.0 are not recommended, because audible
4224 distortion may appear.
4225
4226 threshold, t
4227 Set the target threshold value. This specifies the lowest
4228 permissible magnitude level for the audio input which will be
4229 normalized. If input frame volume is above this value frame will
4230 be normalized. Otherwise frame may not be normalized at all. The
4231 default value is set to 0, which means all input frames will be
4232 normalized. This option is mostly useful if digital noise is not
4233 wanted to be amplified.
4234
4235 channels, h
4236 Specify which channels to filter, by default all available channels
4237 are filtered.
4238
4239 overlap, o
4240 Specify overlap for frames. If set to 0 (default) no frame
4241 overlapping is done. Using >0 and <1 values will make less
4242 conservative gain adjustments, like when framelen option is set to
4243 smaller value, if framelen option value is compensated for non-zero
4244 overlap then gain adjustments will be smoother across time compared
4245 to zero overlap case.
4246
4247 curve, v
4248 Specify the peak mapping curve expression which is going to be used
4249 when calculating gain applied to frames. The max output frame gain
4250 will still be limited by other options mentioned previously for
4251 this filter.
4252
4253 The expression can contain the following constants:
4254
4255 ch current channel number
4256
4257 sn current sample number
4258
4259 nb_channels
4260 number of channels
4261
4262 t timestamp expressed in seconds
4263
4264 sr sample rate
4265
4266 p current frame peak value
4267
4268 Commands
4269
4270 This filter supports the all above options as commands.
4271
4272 earwax
4273 Make audio easier to listen to on headphones.
4274
4275 This filter adds `cues' to 44.1kHz stereo (i.e. audio CD format) audio
4276 so that when listened to on headphones the stereo image is moved from
4277 inside your head (standard for headphones) to outside and in front of
4278 the listener (standard for speakers).
4279
4280 Ported from SoX.
4281
4282 equalizer
4283 Apply a two-pole peaking equalisation (EQ) filter. With this filter,
4284 the signal-level at and around a selected frequency can be increased or
4285 decreased, whilst (unlike bandpass and bandreject filters) that at all
4286 other frequencies is unchanged.
4287
4288 In order to produce complex equalisation curves, this filter can be
4289 given several times, each with a different central frequency.
4290
4291 The filter accepts the following options:
4292
4293 frequency, f
4294 Set the filter's central frequency in Hz.
4295
4296 width_type, t
4297 Set method to specify band-width of filter.
4298
4299 h Hz
4300
4301 q Q-Factor
4302
4303 o octave
4304
4305 s slope
4306
4307 k kHz
4308
4309 width, w
4310 Specify the band-width of a filter in width_type units.
4311
4312 gain, g
4313 Set the required gain or attenuation in dB. Beware of clipping
4314 when using a positive gain.
4315
4316 mix, m
4317 How much to use filtered signal in output. Default is 1. Range is
4318 between 0 and 1.
4319
4320 channels, c
4321 Specify which channels to filter, by default all available are
4322 filtered.
4323
4324 normalize, n
4325 Normalize biquad coefficients, by default is disabled. Enabling it
4326 will normalize magnitude response at DC to 0dB.
4327
4328 transform, a
4329 Set transform type of IIR filter.
4330
4331 di
4332 dii
4333 tdi
4334 tdii
4335 latt
4336 svf
4337 zdf
4338 precision, r
4339 Set precison of filtering.
4340
4341 auto
4342 Pick automatic sample format depending on surround filters.
4343
4344 s16 Always use signed 16-bit.
4345
4346 s32 Always use signed 32-bit.
4347
4348 f32 Always use float 32-bit.
4349
4350 f64 Always use float 64-bit.
4351
4352 block_size, b
4353 Set block size used for reverse IIR processing. If this value is
4354 set to high enough value (higher than impulse response length
4355 truncated when reaches near zero values) filtering will become
4356 linear phase otherwise if not big enough it will just produce nasty
4357 artifacts.
4358
4359 Note that filter delay will be exactly this many samples when set
4360 to non-zero value.
4361
4362 Examples
4363
4364 • Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
4365
4366 equalizer=f=1000:t=h:width=200:g=-10
4367
4368 • Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz
4369 with Q 2:
4370
4371 equalizer=f=1000:t=q:w=1:g=2,equalizer=f=100:t=q:w=2:g=-5
4372
4373 Commands
4374
4375 This filter supports the following commands:
4376
4377 frequency, f
4378 Change equalizer frequency. Syntax for the command is :
4379 "frequency"
4380
4381 width_type, t
4382 Change equalizer width_type. Syntax for the command is :
4383 "width_type"
4384
4385 width, w
4386 Change equalizer width. Syntax for the command is : "width"
4387
4388 gain, g
4389 Change equalizer gain. Syntax for the command is : "gain"
4390
4391 mix, m
4392 Change equalizer mix. Syntax for the command is : "mix"
4393
4394 extrastereo
4395 Linearly increases the difference between left and right channels which
4396 adds some sort of "live" effect to playback.
4397
4398 The filter accepts the following options:
4399
4400 m Sets the difference coefficient (default: 2.5). 0.0 means mono
4401 sound (average of both channels), with 1.0 sound will be unchanged,
4402 with -1.0 left and right channels will be swapped.
4403
4404 c Enable clipping. By default is enabled.
4405
4406 Commands
4407
4408 This filter supports the all above options as commands.
4409
4410 firequalizer
4411 Apply FIR Equalization using arbitrary frequency response.
4412
4413 The filter accepts the following option:
4414
4415 gain
4416 Set gain curve equation (in dB). The expression can contain
4417 variables:
4418
4419 f the evaluated frequency
4420
4421 sr sample rate
4422
4423 ch channel number, set to 0 when multichannels evaluation is
4424 disabled
4425
4426 chid
4427 channel id, see libavutil/channel_layout.h, set to the first
4428 channel id when multichannels evaluation is disabled
4429
4430 chs number of channels
4431
4432 chlayout
4433 channel_layout, see libavutil/channel_layout.h
4434
4435 and functions:
4436
4437 gain_interpolate(f)
4438 interpolate gain on frequency f based on gain_entry
4439
4440 cubic_interpolate(f)
4441 same as gain_interpolate, but smoother
4442
4443 This option is also available as command. Default is
4444 gain_interpolate(f).
4445
4446 gain_entry
4447 Set gain entry for gain_interpolate function. The expression can
4448 contain functions:
4449
4450 entry(f, g)
4451 store gain entry at frequency f with value g
4452
4453 This option is also available as command.
4454
4455 delay
4456 Set filter delay in seconds. Higher value means more accurate.
4457 Default is 0.01.
4458
4459 accuracy
4460 Set filter accuracy in Hz. Lower value means more accurate.
4461 Default is 5.
4462
4463 wfunc
4464 Set window function. Acceptable values are:
4465
4466 rectangular
4467 rectangular window, useful when gain curve is already smooth
4468
4469 hann
4470 hann window (default)
4471
4472 hamming
4473 hamming window
4474
4475 blackman
4476 blackman window
4477
4478 nuttall3
4479 3-terms continuous 1st derivative nuttall window
4480
4481 mnuttall3
4482 minimum 3-terms discontinuous nuttall window
4483
4484 nuttall
4485 4-terms continuous 1st derivative nuttall window
4486
4487 bnuttall
4488 minimum 4-terms discontinuous nuttall (blackman-nuttall) window
4489
4490 bharris
4491 blackman-harris window
4492
4493 tukey
4494 tukey window
4495
4496 fixed
4497 If enabled, use fixed number of audio samples. This improves speed
4498 when filtering with large delay. Default is disabled.
4499
4500 multi
4501 Enable multichannels evaluation on gain. Default is disabled.
4502
4503 zero_phase
4504 Enable zero phase mode by subtracting timestamp to compensate
4505 delay. Default is disabled.
4506
4507 scale
4508 Set scale used by gain. Acceptable values are:
4509
4510 linlin
4511 linear frequency, linear gain
4512
4513 linlog
4514 linear frequency, logarithmic (in dB) gain (default)
4515
4516 loglin
4517 logarithmic (in octave scale where 20 Hz is 0) frequency,
4518 linear gain
4519
4520 loglog
4521 logarithmic frequency, logarithmic gain
4522
4523 dumpfile
4524 Set file for dumping, suitable for gnuplot.
4525
4526 dumpscale
4527 Set scale for dumpfile. Acceptable values are same with scale
4528 option. Default is linlog.
4529
4530 fft2
4531 Enable 2-channel convolution using complex FFT. This improves speed
4532 significantly. Default is disabled.
4533
4534 min_phase
4535 Enable minimum phase impulse response. Default is disabled.
4536
4537 Examples
4538
4539 • lowpass at 1000 Hz:
4540
4541 firequalizer=gain='if(lt(f,1000), 0, -INF)'
4542
4543 • lowpass at 1000 Hz with gain_entry:
4544
4545 firequalizer=gain_entry='entry(1000,0); entry(1001, -INF)'
4546
4547 • custom equalization:
4548
4549 firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)'
4550
4551 • higher delay with zero phase to compensate delay:
4552
4553 firequalizer=delay=0.1:fixed=on:zero_phase=on
4554
4555 • lowpass on left channel, highpass on right channel:
4556
4557 firequalizer=gain='if(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))'
4558 :gain_entry='entry(1000, 0); entry(1001,-INF); entry(1e6+1000,0)':multi=on
4559
4560 flanger
4561 Apply a flanging effect to the audio.
4562
4563 The filter accepts the following options:
4564
4565 delay
4566 Set base delay in milliseconds. Range from 0 to 30. Default value
4567 is 0.
4568
4569 depth
4570 Set added sweep delay in milliseconds. Range from 0 to 10. Default
4571 value is 2.
4572
4573 regen
4574 Set percentage regeneration (delayed signal feedback). Range from
4575 -95 to 95. Default value is 0.
4576
4577 width
4578 Set percentage of delayed signal mixed with original. Range from 0
4579 to 100. Default value is 71.
4580
4581 speed
4582 Set sweeps per second (Hz). Range from 0.1 to 10. Default value is
4583 0.5.
4584
4585 shape
4586 Set swept wave shape, can be triangular or sinusoidal. Default
4587 value is sinusoidal.
4588
4589 phase
4590 Set swept wave percentage-shift for multi channel. Range from 0 to
4591 100. Default value is 25.
4592
4593 interp
4594 Set delay-line interpolation, linear or quadratic. Default is
4595 linear.
4596
4597 haas
4598 Apply Haas effect to audio.
4599
4600 Note that this makes most sense to apply on mono signals. With this
4601 filter applied to mono signals it give some directionality and
4602 stretches its stereo image.
4603
4604 The filter accepts the following options:
4605
4606 level_in
4607 Set input level. By default is 1, or 0dB
4608
4609 level_out
4610 Set output level. By default is 1, or 0dB.
4611
4612 side_gain
4613 Set gain applied to side part of signal. By default is 1.
4614
4615 middle_source
4616 Set kind of middle source. Can be one of the following:
4617
4618 left
4619 Pick left channel.
4620
4621 right
4622 Pick right channel.
4623
4624 mid Pick middle part signal of stereo image.
4625
4626 side
4627 Pick side part signal of stereo image.
4628
4629 middle_phase
4630 Change middle phase. By default is disabled.
4631
4632 left_delay
4633 Set left channel delay. By default is 2.05 milliseconds.
4634
4635 left_balance
4636 Set left channel balance. By default is -1.
4637
4638 left_gain
4639 Set left channel gain. By default is 1.
4640
4641 left_phase
4642 Change left phase. By default is disabled.
4643
4644 right_delay
4645 Set right channel delay. By defaults is 2.12 milliseconds.
4646
4647 right_balance
4648 Set right channel balance. By default is 1.
4649
4650 right_gain
4651 Set right channel gain. By default is 1.
4652
4653 right_phase
4654 Change right phase. By default is enabled.
4655
4656 hdcd
4657 Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM
4658 stream with embedded HDCD codes is expanded into a 20-bit PCM stream.
4659
4660 The filter supports the Peak Extend and Low-level Gain Adjustment
4661 features of HDCD, and detects the Transient Filter flag.
4662
4663 ffmpeg -i HDCD16.flac -af hdcd OUT24.flac
4664
4665 When using the filter with wav, note the default encoding for wav is
4666 16-bit, so the resulting 20-bit stream will be truncated back to
4667 16-bit. Use something like -acodec pcm_s24le after the filter to get
4668 24-bit PCM output.
4669
4670 ffmpeg -i HDCD16.wav -af hdcd OUT16.wav
4671 ffmpeg -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav
4672
4673 The filter accepts the following options:
4674
4675 disable_autoconvert
4676 Disable any automatic format conversion or resampling in the filter
4677 graph.
4678
4679 process_stereo
4680 Process the stereo channels together. If target_gain does not match
4681 between channels, consider it invalid and use the last valid
4682 target_gain.
4683
4684 cdt_ms
4685 Set the code detect timer period in ms.
4686
4687 force_pe
4688 Always extend peaks above -3dBFS even if PE isn't signaled.
4689
4690 analyze_mode
4691 Replace audio with a solid tone and adjust the amplitude to signal
4692 some specific aspect of the decoding process. The output file can
4693 be loaded in an audio editor alongside the original to aid
4694 analysis.
4695
4696 "analyze_mode=pe:force_pe=true" can be used to see all samples
4697 above the PE level.
4698
4699 Modes are:
4700
4701 0, off
4702 Disabled
4703
4704 1, lle
4705 Gain adjustment level at each sample
4706
4707 2, pe
4708 Samples where peak extend occurs
4709
4710 3, cdt
4711 Samples where the code detect timer is active
4712
4713 4, tgm
4714 Samples where the target gain does not match between channels
4715
4716 headphone
4717 Apply head-related transfer functions (HRTFs) to create virtual
4718 loudspeakers around the user for binaural listening via headphones.
4719 The HRIRs are provided via additional streams, for each channel one
4720 stereo input stream is needed.
4721
4722 The filter accepts the following options:
4723
4724 map Set mapping of input streams for convolution. The argument is a
4725 '|'-separated list of channel names in order as they are given as
4726 additional stream inputs for filter. This also specify number of
4727 input streams. Number of input streams must be not less than number
4728 of channels in first stream plus one.
4729
4730 gain
4731 Set gain applied to audio. Value is in dB. Default is 0.
4732
4733 type
4734 Set processing type. Can be time or freq. time is processing audio
4735 in time domain which is slow. freq is processing audio in
4736 frequency domain which is fast. Default is freq.
4737
4738 lfe Set custom gain for LFE channels. Value is in dB. Default is 0.
4739
4740 size
4741 Set size of frame in number of samples which will be processed at
4742 once. Default value is 1024. Allowed range is from 1024 to 96000.
4743
4744 hrir
4745 Set format of hrir stream. Default value is stereo. Alternative
4746 value is multich. If value is set to stereo, number of additional
4747 streams should be greater or equal to number of input channels in
4748 first input stream. Also each additional stream should have stereo
4749 number of channels. If value is set to multich, number of
4750 additional streams should be exactly one. Also number of input
4751 channels of additional stream should be equal or greater than twice
4752 number of channels of first input stream.
4753
4754 Examples
4755
4756 • Full example using wav files as coefficients with amovie filters
4757 for 7.1 downmix, each amovie filter use stereo file with IR
4758 coefficients as input. The files give coefficients for each
4759 position of virtual loudspeaker:
4760
4761 ffmpeg -i input.wav
4762 -filter_complex "amovie=azi_270_ele_0_DFC.wav[sr];amovie=azi_90_ele_0_DFC.wav[sl];amovie=azi_225_ele_0_DFC.wav[br];amovie=azi_135_ele_0_DFC.wav[bl];amovie=azi_0_ele_0_DFC.wav,asplit[fc][lfe];amovie=azi_35_ele_0_DFC.wav[fl];amovie=azi_325_ele_0_DFC.wav[fr];[0:a][fl][fr][fc][lfe][bl][br][sl][sr]headphone=FL|FR|FC|LFE|BL|BR|SL|SR"
4763 output.wav
4764
4765 • Full example using wav files as coefficients with amovie filters
4766 for 7.1 downmix, but now in multich hrir format.
4767
4768 ffmpeg -i input.wav -filter_complex "amovie=minp.wav[hrirs];[0:a][hrirs]headphone=map=FL|FR|FC|LFE|BL|BR|SL|SR:hrir=multich"
4769 output.wav
4770
4771 highpass
4772 Apply a high-pass filter with 3dB point frequency. The filter can be
4773 either single-pole, or double-pole (the default). The filter roll off
4774 at 6dB per pole per octave (20dB per pole per decade).
4775
4776 The filter accepts the following options:
4777
4778 frequency, f
4779 Set frequency in Hz. Default is 3000.
4780
4781 poles, p
4782 Set number of poles. Default is 2.
4783
4784 width_type, t
4785 Set method to specify band-width of filter.
4786
4787 h Hz
4788
4789 q Q-Factor
4790
4791 o octave
4792
4793 s slope
4794
4795 k kHz
4796
4797 width, w
4798 Specify the band-width of a filter in width_type units. Applies
4799 only to double-pole filter. The default is 0.707q and gives a
4800 Butterworth response.
4801
4802 mix, m
4803 How much to use filtered signal in output. Default is 1. Range is
4804 between 0 and 1.
4805
4806 channels, c
4807 Specify which channels to filter, by default all available are
4808 filtered.
4809
4810 normalize, n
4811 Normalize biquad coefficients, by default is disabled. Enabling it
4812 will normalize magnitude response at DC to 0dB.
4813
4814 transform, a
4815 Set transform type of IIR filter.
4816
4817 di
4818 dii
4819 tdi
4820 tdii
4821 latt
4822 svf
4823 zdf
4824 precision, r
4825 Set precison of filtering.
4826
4827 auto
4828 Pick automatic sample format depending on surround filters.
4829
4830 s16 Always use signed 16-bit.
4831
4832 s32 Always use signed 32-bit.
4833
4834 f32 Always use float 32-bit.
4835
4836 f64 Always use float 64-bit.
4837
4838 block_size, b
4839 Set block size used for reverse IIR processing. If this value is
4840 set to high enough value (higher than impulse response length
4841 truncated when reaches near zero values) filtering will become
4842 linear phase otherwise if not big enough it will just produce nasty
4843 artifacts.
4844
4845 Note that filter delay will be exactly this many samples when set
4846 to non-zero value.
4847
4848 Commands
4849
4850 This filter supports the following commands:
4851
4852 frequency, f
4853 Change highpass frequency. Syntax for the command is : "frequency"
4854
4855 width_type, t
4856 Change highpass width_type. Syntax for the command is :
4857 "width_type"
4858
4859 width, w
4860 Change highpass width. Syntax for the command is : "width"
4861
4862 mix, m
4863 Change highpass mix. Syntax for the command is : "mix"
4864
4865 join
4866 Join multiple input streams into one multi-channel stream.
4867
4868 It accepts the following parameters:
4869
4870 inputs
4871 The number of input streams. It defaults to 2.
4872
4873 channel_layout
4874 The desired output channel layout. It defaults to stereo.
4875
4876 map Map channels from inputs to output. The argument is a '|'-separated
4877 list of mappings, each in the "input_idx.in_channel-out_channel"
4878 form. input_idx is the 0-based index of the input stream.
4879 in_channel can be either the name of the input channel (e.g. FL for
4880 front left) or its index in the specified input stream. out_channel
4881 is the name of the output channel.
4882
4883 The filter will attempt to guess the mappings when they are not
4884 specified explicitly. It does so by first trying to find an unused
4885 matching input channel and if that fails it picks the first unused
4886 input channel.
4887
4888 Join 3 inputs (with properly set channel layouts):
4889
4890 ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
4891
4892 Build a 5.1 output from 6 single-channel streams:
4893
4894 ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
4895 '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'
4896 out
4897
4898 ladspa
4899 Load a LADSPA (Linux Audio Developer's Simple Plugin API) plugin.
4900
4901 To enable compilation of this filter you need to configure FFmpeg with
4902 "--enable-ladspa".
4903
4904 file, f
4905 Specifies the name of LADSPA plugin library to load. If the
4906 environment variable LADSPA_PATH is defined, the LADSPA plugin is
4907 searched in each one of the directories specified by the colon
4908 separated list in LADSPA_PATH, otherwise in the standard LADSPA
4909 paths, which are in this order: HOME/.ladspa/lib/,
4910 /usr/local/lib/ladspa/, /usr/lib/ladspa/.
4911
4912 plugin, p
4913 Specifies the plugin within the library. Some libraries contain
4914 only one plugin, but others contain many of them. If this is not
4915 set filter will list all available plugins within the specified
4916 library.
4917
4918 controls, c
4919 Set the '|' separated list of controls which are zero or more
4920 floating point values that determine the behavior of the loaded
4921 plugin (for example delay, threshold or gain). Controls need to be
4922 defined using the following syntax:
4923 c0=value0|c1=value1|c2=value2|..., where valuei is the value set on
4924 the i-th control. Alternatively they can be also defined using the
4925 following syntax: value0|value1|value2|..., where valuei is the
4926 value set on the i-th control. If controls is set to "help", all
4927 available controls and their valid ranges are printed.
4928
4929 sample_rate, s
4930 Specify the sample rate, default to 44100. Only used if plugin have
4931 zero inputs.
4932
4933 nb_samples, n
4934 Set the number of samples per channel per each output frame,
4935 default is 1024. Only used if plugin have zero inputs.
4936
4937 duration, d
4938 Set the minimum duration of the sourced audio. See the Time
4939 duration section in the ffmpeg-utils(1) manual for the accepted
4940 syntax. Note that the resulting duration may be greater than the
4941 specified duration, as the generated audio is always cut at the end
4942 of a complete frame. If not specified, or the expressed duration
4943 is negative, the audio is supposed to be generated forever. Only
4944 used if plugin have zero inputs.
4945
4946 latency, l
4947 Enable latency compensation, by default is disabled. Only used if
4948 plugin have inputs.
4949
4950 Examples
4951
4952 • List all available plugins within amp (LADSPA example plugin)
4953 library:
4954
4955 ladspa=file=amp
4956
4957 • List all available controls and their valid ranges for "vcf_notch"
4958 plugin from "VCF" library:
4959
4960 ladspa=f=vcf:p=vcf_notch:c=help
4961
4962 • Simulate low quality audio equipment using "Computer Music Toolkit"
4963 (CMT) plugin library:
4964
4965 ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
4966
4967 • Add reverberation to the audio using TAP-plugins (Tom's Audio
4968 Processing plugins):
4969
4970 ladspa=file=tap_reverb:tap_reverb
4971
4972 • Generate white noise, with 0.2 amplitude:
4973
4974 ladspa=file=cmt:noise_source_white:c=c0=.2
4975
4976 • Generate 20 bpm clicks using plugin "C* Click - Metronome" from the
4977 "C* Audio Plugin Suite" (CAPS) library:
4978
4979 ladspa=file=caps:Click:c=c1=20'
4980
4981 • Apply "C* Eq10X2 - Stereo 10-band equaliser" effect:
4982
4983 ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
4984
4985 • Increase volume by 20dB using fast lookahead limiter from Steve
4986 Harris "SWH Plugins" collection:
4987
4988 ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
4989
4990 • Attenuate low frequencies using Multiband EQ from Steve Harris "SWH
4991 Plugins" collection:
4992
4993 ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
4994
4995 • Reduce stereo image using "Narrower" from the "C* Audio Plugin
4996 Suite" (CAPS) library:
4997
4998 ladspa=caps:Narrower
4999
5000 • Another white noise, now using "C* Audio Plugin Suite" (CAPS)
5001 library:
5002
5003 ladspa=caps:White:.2
5004
5005 • Some fractal noise, using "C* Audio Plugin Suite" (CAPS) library:
5006
5007 ladspa=caps:Fractal:c=c1=1
5008
5009 • Dynamic volume normalization using "VLevel" plugin:
5010
5011 ladspa=vlevel-ladspa:vlevel_mono
5012
5013 Commands
5014
5015 This filter supports the following commands:
5016
5017 cN Modify the N-th control value.
5018
5019 If the specified value is not valid, it is ignored and prior one is
5020 kept.
5021
5022 loudnorm
5023 EBU R128 loudness normalization. Includes both dynamic and linear
5024 normalization modes. Support for both single pass (livestreams, files)
5025 and double pass (files) modes. This algorithm can target IL, LRA, and
5026 maximum true peak. In dynamic mode, to accurately detect true peaks,
5027 the audio stream will be upsampled to 192 kHz. Use the "-ar" option or
5028 "aresample" filter to explicitly set an output sample rate.
5029
5030 The filter accepts the following options:
5031
5032 I, i
5033 Set integrated loudness target. Range is -70.0 - -5.0. Default
5034 value is -24.0.
5035
5036 LRA, lra
5037 Set loudness range target. Range is 1.0 - 50.0. Default value is
5038 7.0.
5039
5040 TP, tp
5041 Set maximum true peak. Range is -9.0 - +0.0. Default value is
5042 -2.0.
5043
5044 measured_I, measured_i
5045 Measured IL of input file. Range is -99.0 - +0.0.
5046
5047 measured_LRA, measured_lra
5048 Measured LRA of input file. Range is 0.0 - 99.0.
5049
5050 measured_TP, measured_tp
5051 Measured true peak of input file. Range is -99.0 - +99.0.
5052
5053 measured_thresh
5054 Measured threshold of input file. Range is -99.0 - +0.0.
5055
5056 offset
5057 Set offset gain. Gain is applied before the true-peak limiter.
5058 Range is -99.0 - +99.0. Default is +0.0.
5059
5060 linear
5061 Normalize by linearly scaling the source audio. "measured_I",
5062 "measured_LRA", "measured_TP", and "measured_thresh" must all be
5063 specified. Target LRA shouldn't be lower than source LRA and the
5064 change in integrated loudness shouldn't result in a true peak which
5065 exceeds the target TP. If any of these conditions aren't met,
5066 normalization mode will revert to dynamic. Options are "true" or
5067 "false". Default is "true".
5068
5069 dual_mono
5070 Treat mono input files as "dual-mono". If a mono file is intended
5071 for playback on a stereo system, its EBU R128 measurement will be
5072 perceptually incorrect. If set to "true", this option will
5073 compensate for this effect. Multi-channel input files are not
5074 affected by this option. Options are true or false. Default is
5075 false.
5076
5077 print_format
5078 Set print format for stats. Options are summary, json, or none.
5079 Default value is none.
5080
5081 lowpass
5082 Apply a low-pass filter with 3dB point frequency. The filter can be
5083 either single-pole or double-pole (the default). The filter roll off
5084 at 6dB per pole per octave (20dB per pole per decade).
5085
5086 The filter accepts the following options:
5087
5088 frequency, f
5089 Set frequency in Hz. Default is 500.
5090
5091 poles, p
5092 Set number of poles. Default is 2.
5093
5094 width_type, t
5095 Set method to specify band-width of filter.
5096
5097 h Hz
5098
5099 q Q-Factor
5100
5101 o octave
5102
5103 s slope
5104
5105 k kHz
5106
5107 width, w
5108 Specify the band-width of a filter in width_type units. Applies
5109 only to double-pole filter. The default is 0.707q and gives a
5110 Butterworth response.
5111
5112 mix, m
5113 How much to use filtered signal in output. Default is 1. Range is
5114 between 0 and 1.
5115
5116 channels, c
5117 Specify which channels to filter, by default all available are
5118 filtered.
5119
5120 normalize, n
5121 Normalize biquad coefficients, by default is disabled. Enabling it
5122 will normalize magnitude response at DC to 0dB.
5123
5124 transform, a
5125 Set transform type of IIR filter.
5126
5127 di
5128 dii
5129 tdi
5130 tdii
5131 latt
5132 svf
5133 zdf
5134 precision, r
5135 Set precison of filtering.
5136
5137 auto
5138 Pick automatic sample format depending on surround filters.
5139
5140 s16 Always use signed 16-bit.
5141
5142 s32 Always use signed 32-bit.
5143
5144 f32 Always use float 32-bit.
5145
5146 f64 Always use float 64-bit.
5147
5148 block_size, b
5149 Set block size used for reverse IIR processing. If this value is
5150 set to high enough value (higher than impulse response length
5151 truncated when reaches near zero values) filtering will become
5152 linear phase otherwise if not big enough it will just produce nasty
5153 artifacts.
5154
5155 Note that filter delay will be exactly this many samples when set
5156 to non-zero value.
5157
5158 Examples
5159
5160 • Lowpass only LFE channel, it LFE is not present it does nothing:
5161
5162 lowpass=c=LFE
5163
5164 Commands
5165
5166 This filter supports the following commands:
5167
5168 frequency, f
5169 Change lowpass frequency. Syntax for the command is : "frequency"
5170
5171 width_type, t
5172 Change lowpass width_type. Syntax for the command is :
5173 "width_type"
5174
5175 width, w
5176 Change lowpass width. Syntax for the command is : "width"
5177
5178 mix, m
5179 Change lowpass mix. Syntax for the command is : "mix"
5180
5181 lv2
5182 Load a LV2 (LADSPA Version 2) plugin.
5183
5184 To enable compilation of this filter you need to configure FFmpeg with
5185 "--enable-lv2".
5186
5187 plugin, p
5188 Specifies the plugin URI. You may need to escape ':'.
5189
5190 controls, c
5191 Set the '|' separated list of controls which are zero or more
5192 floating point values that determine the behavior of the loaded
5193 plugin (for example delay, threshold or gain). If controls is set
5194 to "help", all available controls and their valid ranges are
5195 printed.
5196
5197 sample_rate, s
5198 Specify the sample rate, default to 44100. Only used if plugin have
5199 zero inputs.
5200
5201 nb_samples, n
5202 Set the number of samples per channel per each output frame,
5203 default is 1024. Only used if plugin have zero inputs.
5204
5205 duration, d
5206 Set the minimum duration of the sourced audio. See the Time
5207 duration section in the ffmpeg-utils(1) manual for the accepted
5208 syntax. Note that the resulting duration may be greater than the
5209 specified duration, as the generated audio is always cut at the end
5210 of a complete frame. If not specified, or the expressed duration
5211 is negative, the audio is supposed to be generated forever. Only
5212 used if plugin have zero inputs.
5213
5214 Examples
5215
5216 • Apply bass enhancer plugin from Calf:
5217
5218 lv2=p=http\\\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=2
5219
5220 • Apply vinyl plugin from Calf:
5221
5222 lv2=p=http\\\\://calf.sourceforge.net/plugins/Vinyl:c=drone=0.2|aging=0.5
5223
5224 • Apply bit crusher plugin from ArtyFX:
5225
5226 lv2=p=http\\\\://www.openavproductions.com/artyfx#bitta:c=crush=0.3
5227
5228 Commands
5229
5230 This filter supports all options that are exported by plugin as
5231 commands.
5232
5233 mcompand
5234 Multiband Compress or expand the audio's dynamic range.
5235
5236 The input audio is divided into bands using 4th order Linkwitz-Riley
5237 IIRs. This is akin to the crossover of a loudspeaker, and results in
5238 flat frequency response when absent compander action.
5239
5240 It accepts the following parameters:
5241
5242 args
5243 This option syntax is: attack,decay,[attack,decay..] soft-knee
5244 points crossover_frequency [delay [initial_volume [gain]]] |
5245 attack,decay ... For explanation of each item refer to compand
5246 filter documentation.
5247
5248 pan
5249 Mix channels with specific gain levels. The filter accepts the output
5250 channel layout followed by a set of channels definitions.
5251
5252 This filter is also designed to efficiently remap the channels of an
5253 audio stream.
5254
5255 The filter accepts parameters of the form: "l|outdef|outdef|..."
5256
5257 l output channel layout or number of channels
5258
5259 outdef
5260 output channel specification, of the form:
5261 "out_name=[gain*]in_name[(+-)[gain*]in_name...]"
5262
5263 out_name
5264 output channel to define, either a channel name (FL, FR, etc.) or a
5265 channel number (c0, c1, etc.)
5266
5267 gain
5268 multiplicative coefficient for the channel, 1 leaving the volume
5269 unchanged
5270
5271 in_name
5272 input channel to use, see out_name for details; it is not possible
5273 to mix named and numbered input channels
5274
5275 If the `=' in a channel specification is replaced by `<', then the
5276 gains for that specification will be renormalized so that the total is
5277 1, thus avoiding clipping noise.
5278
5279 Mixing examples
5280
5281 For example, if you want to down-mix from stereo to mono, but with a
5282 bigger factor for the left channel:
5283
5284 pan=1c|c0=0.9*c0+0.1*c1
5285
5286 A customized down-mix to stereo that works automatically for 3-, 4-, 5-
5287 and 7-channels surround:
5288
5289 pan=stereo| FL < FL + 0.5*FC + 0.6*BL + 0.6*SL | FR < FR + 0.5*FC + 0.6*BR + 0.6*SR
5290
5291 Note that ffmpeg integrates a default down-mix (and up-mix) system that
5292 should be preferred (see "-ac" option) unless you have very specific
5293 needs.
5294
5295 Remapping examples
5296
5297 The channel remapping will be effective if, and only if:
5298
5299 *<gain coefficients are zeroes or ones,>
5300 *<only one input per channel output,>
5301
5302 If all these conditions are satisfied, the filter will notify the user
5303 ("Pure channel mapping detected"), and use an optimized and lossless
5304 method to do the remapping.
5305
5306 For example, if you have a 5.1 source and want a stereo audio stream by
5307 dropping the extra channels:
5308
5309 pan="stereo| c0=FL | c1=FR"
5310
5311 Given the same source, you can also switch front left and front right
5312 channels and keep the input channel layout:
5313
5314 pan="5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5"
5315
5316 If the input is a stereo audio stream, you can mute the front left
5317 channel (and still keep the stereo channel layout) with:
5318
5319 pan="stereo|c1=c1"
5320
5321 Still with a stereo audio stream input, you can copy the right channel
5322 in both front left and right:
5323
5324 pan="stereo| c0=FR | c1=FR"
5325
5326 replaygain
5327 ReplayGain scanner filter. This filter takes an audio stream as an
5328 input and outputs it unchanged. At end of filtering it displays
5329 "track_gain" and "track_peak".
5330
5331 resample
5332 Convert the audio sample format, sample rate and channel layout. It is
5333 not meant to be used directly.
5334
5335 rubberband
5336 Apply time-stretching and pitch-shifting with librubberband.
5337
5338 To enable compilation of this filter, you need to configure FFmpeg with
5339 "--enable-librubberband".
5340
5341 The filter accepts the following options:
5342
5343 tempo
5344 Set tempo scale factor.
5345
5346 pitch
5347 Set pitch scale factor.
5348
5349 transients
5350 Set transients detector. Possible values are:
5351
5352 crisp
5353 mixed
5354 smooth
5355 detector
5356 Set detector. Possible values are:
5357
5358 compound
5359 percussive
5360 soft
5361 phase
5362 Set phase. Possible values are:
5363
5364 laminar
5365 independent
5366 window
5367 Set processing window size. Possible values are:
5368
5369 standard
5370 short
5371 long
5372 smoothing
5373 Set smoothing. Possible values are:
5374
5375 off
5376 on
5377 formant
5378 Enable formant preservation when shift pitching. Possible values
5379 are:
5380
5381 shifted
5382 preserved
5383 pitchq
5384 Set pitch quality. Possible values are:
5385
5386 quality
5387 speed
5388 consistency
5389 channels
5390 Set channels. Possible values are:
5391
5392 apart
5393 together
5394
5395 Commands
5396
5397 This filter supports the following commands:
5398
5399 tempo
5400 Change filter tempo scale factor. Syntax for the command is :
5401 "tempo"
5402
5403 pitch
5404 Change filter pitch scale factor. Syntax for the command is :
5405 "pitch"
5406
5407 sidechaincompress
5408 This filter acts like normal compressor but has the ability to compress
5409 detected signal using second input signal. It needs two input streams
5410 and returns one output stream. First input stream will be processed
5411 depending on second stream signal. The filtered signal then can be
5412 filtered with other filters in later stages of processing. See pan and
5413 amerge filter.
5414
5415 The filter accepts the following options:
5416
5417 level_in
5418 Set input gain. Default is 1. Range is between 0.015625 and 64.
5419
5420 mode
5421 Set mode of compressor operation. Can be "upward" or "downward".
5422 Default is "downward".
5423
5424 threshold
5425 If a signal of second stream raises above this level it will affect
5426 the gain reduction of first stream. By default is 0.125. Range is
5427 between 0.00097563 and 1.
5428
5429 ratio
5430 Set a ratio about which the signal is reduced. 1:2 means that if
5431 the level raised 4dB above the threshold, it will be only 2dB above
5432 after the reduction. Default is 2. Range is between 1 and 20.
5433
5434 attack
5435 Amount of milliseconds the signal has to rise above the threshold
5436 before gain reduction starts. Default is 20. Range is between 0.01
5437 and 2000.
5438
5439 release
5440 Amount of milliseconds the signal has to fall below the threshold
5441 before reduction is decreased again. Default is 250. Range is
5442 between 0.01 and 9000.
5443
5444 makeup
5445 Set the amount by how much signal will be amplified after
5446 processing. Default is 1. Range is from 1 to 64.
5447
5448 knee
5449 Curve the sharp knee around the threshold to enter gain reduction
5450 more softly. Default is 2.82843. Range is between 1 and 8.
5451
5452 link
5453 Choose if the "average" level between all channels of side-chain
5454 stream or the louder("maximum") channel of side-chain stream
5455 affects the reduction. Default is "average".
5456
5457 detection
5458 Should the exact signal be taken in case of "peak" or an RMS one in
5459 case of "rms". Default is "rms" which is mainly smoother.
5460
5461 level_sc
5462 Set sidechain gain. Default is 1. Range is between 0.015625 and 64.
5463
5464 mix How much to use compressed signal in output. Default is 1. Range
5465 is between 0 and 1.
5466
5467 Commands
5468
5469 This filter supports the all above options as commands.
5470
5471 Examples
5472
5473 • Full ffmpeg example taking 2 audio inputs, 1st input to be
5474 compressed depending on the signal of 2nd input and later
5475 compressed signal to be merged with 2nd input:
5476
5477 ffmpeg -i main.flac -i sidechain.flac -filter_complex "[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress[compr];[compr][mix]amerge"
5478
5479 sidechaingate
5480 A sidechain gate acts like a normal (wideband) gate but has the ability
5481 to filter the detected signal before sending it to the gain reduction
5482 stage. Normally a gate uses the full range signal to detect a level
5483 above the threshold. For example: If you cut all lower frequencies
5484 from your sidechain signal the gate will decrease the volume of your
5485 track only if not enough highs appear. With this technique you are able
5486 to reduce the resonation of a natural drum or remove "rumbling" of
5487 muted strokes from a heavily distorted guitar. It needs two input
5488 streams and returns one output stream. First input stream will be
5489 processed depending on second stream signal.
5490
5491 The filter accepts the following options:
5492
5493 level_in
5494 Set input level before filtering. Default is 1. Allowed range is
5495 from 0.015625 to 64.
5496
5497 mode
5498 Set the mode of operation. Can be "upward" or "downward". Default
5499 is "downward". If set to "upward" mode, higher parts of signal will
5500 be amplified, expanding dynamic range in upward direction.
5501 Otherwise, in case of "downward" lower parts of signal will be
5502 reduced.
5503
5504 range
5505 Set the level of gain reduction when the signal is below the
5506 threshold. Default is 0.06125. Allowed range is from 0 to 1.
5507 Setting this to 0 disables reduction and then filter behaves like
5508 expander.
5509
5510 threshold
5511 If a signal rises above this level the gain reduction is released.
5512 Default is 0.125. Allowed range is from 0 to 1.
5513
5514 ratio
5515 Set a ratio about which the signal is reduced. Default is 2.
5516 Allowed range is from 1 to 9000.
5517
5518 attack
5519 Amount of milliseconds the signal has to rise above the threshold
5520 before gain reduction stops. Default is 20 milliseconds. Allowed
5521 range is from 0.01 to 9000.
5522
5523 release
5524 Amount of milliseconds the signal has to fall below the threshold
5525 before the reduction is increased again. Default is 250
5526 milliseconds. Allowed range is from 0.01 to 9000.
5527
5528 makeup
5529 Set amount of amplification of signal after processing. Default is
5530 1. Allowed range is from 1 to 64.
5531
5532 knee
5533 Curve the sharp knee around the threshold to enter gain reduction
5534 more softly. Default is 2.828427125. Allowed range is from 1 to 8.
5535
5536 detection
5537 Choose if exact signal should be taken for detection or an RMS like
5538 one. Default is rms. Can be peak or rms.
5539
5540 link
5541 Choose if the average level between all channels or the louder
5542 channel affects the reduction. Default is average. Can be average
5543 or maximum.
5544
5545 level_sc
5546 Set sidechain gain. Default is 1. Range is from 0.015625 to 64.
5547
5548 Commands
5549
5550 This filter supports the all above options as commands.
5551
5552 silencedetect
5553 Detect silence in an audio stream.
5554
5555 This filter logs a message when it detects that the input audio volume
5556 is less or equal to a noise tolerance value for a duration greater or
5557 equal to the minimum detected noise duration.
5558
5559 The printed times and duration are expressed in seconds. The
5560 "lavfi.silence_start" or "lavfi.silence_start.X" metadata key is set on
5561 the first frame whose timestamp equals or exceeds the detection
5562 duration and it contains the timestamp of the first frame of the
5563 silence.
5564
5565 The "lavfi.silence_duration" or "lavfi.silence_duration.X" and
5566 "lavfi.silence_end" or "lavfi.silence_end.X" metadata keys are set on
5567 the first frame after the silence. If mono is enabled, and each channel
5568 is evaluated separately, the ".X" suffixed keys are used, and "X"
5569 corresponds to the channel number.
5570
5571 The filter accepts the following options:
5572
5573 noise, n
5574 Set noise tolerance. Can be specified in dB (in case "dB" is
5575 appended to the specified value) or amplitude ratio. Default is
5576 -60dB, or 0.001.
5577
5578 duration, d
5579 Set silence duration until notification (default is 2 seconds). See
5580 the Time duration section in the ffmpeg-utils(1) manual for the
5581 accepted syntax.
5582
5583 mono, m
5584 Process each channel separately, instead of combined. By default is
5585 disabled.
5586
5587 Examples
5588
5589 • Detect 5 seconds of silence with -50dB noise tolerance:
5590
5591 silencedetect=n=-50dB:d=5
5592
5593 • Complete example with ffmpeg to detect silence with 0.0001 noise
5594 tolerance in silence.mp3:
5595
5596 ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
5597
5598 silenceremove
5599 Remove silence from the beginning, middle or end of the audio.
5600
5601 The filter accepts the following options:
5602
5603 start_periods
5604 This value is used to indicate if audio should be trimmed at
5605 beginning of the audio. A value of zero indicates no silence should
5606 be trimmed from the beginning. When specifying a non-zero value, it
5607 trims audio up until it finds non-silence. Normally, when trimming
5608 silence from beginning of audio the start_periods will be 1 but it
5609 can be increased to higher values to trim all audio up to specific
5610 count of non-silence periods. Default value is 0.
5611
5612 start_duration
5613 Specify the amount of time that non-silence must be detected before
5614 it stops trimming audio. By increasing the duration, bursts of
5615 noises can be treated as silence and trimmed off. Default value is
5616 0.
5617
5618 start_threshold
5619 This indicates what sample value should be treated as silence. For
5620 digital audio, a value of 0 may be fine but for audio recorded from
5621 analog, you may wish to increase the value to account for
5622 background noise. Can be specified in dB (in case "dB" is appended
5623 to the specified value) or amplitude ratio. Default value is 0.
5624
5625 start_silence
5626 Specify max duration of silence at beginning that will be kept
5627 after trimming. Default is 0, which is equal to trimming all
5628 samples detected as silence.
5629
5630 start_mode
5631 Specify mode of detection of silence end in start of multi-channel
5632 audio. Can be any or all. Default is any. With any, any sample
5633 that is detected as non-silence will cause stopped trimming of
5634 silence. With all, only if all channels are detected as non-
5635 silence will cause stopped trimming of silence.
5636
5637 stop_periods
5638 Set the count for trimming silence from the end of audio. To
5639 remove silence from the middle of a file, specify a stop_periods
5640 that is negative. This value is then treated as a positive value
5641 and is used to indicate the effect should restart processing as
5642 specified by start_periods, making it suitable for removing periods
5643 of silence in the middle of the audio. Default value is 0.
5644
5645 stop_duration
5646 Specify a duration of silence that must exist before audio is not
5647 copied any more. By specifying a higher duration, silence that is
5648 wanted can be left in the audio. Default value is 0.
5649
5650 stop_threshold
5651 This is the same as start_threshold but for trimming silence from
5652 the end of audio. Can be specified in dB (in case "dB" is appended
5653 to the specified value) or amplitude ratio. Default value is 0.
5654
5655 stop_silence
5656 Specify max duration of silence at end that will be kept after
5657 trimming. Default is 0, which is equal to trimming all samples
5658 detected as silence.
5659
5660 stop_mode
5661 Specify mode of detection of silence start in end of multi-channel
5662 audio. Can be any or all. Default is any. With any, any sample
5663 that is detected as non-silence will cause stopped trimming of
5664 silence. With all, only if all channels are detected as non-
5665 silence will cause stopped trimming of silence.
5666
5667 detection
5668 Set how is silence detected. Can be "rms" or "peak". Second is
5669 faster and works better with digital silence which is exactly 0.
5670 Default value is "rms".
5671
5672 window
5673 Set duration in number of seconds used to calculate size of window
5674 in number of samples for detecting silence. Default value is 0.02.
5675 Allowed range is from 0 to 10.
5676
5677 Examples
5678
5679 • The following example shows how this filter can be used to start a
5680 recording that does not contain the delay at the start which
5681 usually occurs between pressing the record button and the start of
5682 the performance:
5683
5684 silenceremove=start_periods=1:start_duration=5:start_threshold=0.02
5685
5686 • Trim all silence encountered from beginning to end where there is
5687 more than 1 second of silence in audio:
5688
5689 silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB
5690
5691 • Trim all digital silence samples, using peak detection, from
5692 beginning to end where there is more than 0 samples of digital
5693 silence in audio and digital silence is detected in all channels at
5694 same positions in stream:
5695
5696 silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0
5697
5698 sofalizer
5699 SOFAlizer uses head-related transfer functions (HRTFs) to create
5700 virtual loudspeakers around the user for binaural listening via
5701 headphones (audio formats up to 9 channels supported). The HRTFs are
5702 stored in SOFA files (see <http://www.sofacoustics.org/> for a
5703 database). SOFAlizer is developed at the Acoustics Research Institute
5704 (ARI) of the Austrian Academy of Sciences.
5705
5706 To enable compilation of this filter you need to configure FFmpeg with
5707 "--enable-libmysofa".
5708
5709 The filter accepts the following options:
5710
5711 sofa
5712 Set the SOFA file used for rendering.
5713
5714 gain
5715 Set gain applied to audio. Value is in dB. Default is 0.
5716
5717 rotation
5718 Set rotation of virtual loudspeakers in deg. Default is 0.
5719
5720 elevation
5721 Set elevation of virtual speakers in deg. Default is 0.
5722
5723 radius
5724 Set distance in meters between loudspeakers and the listener with
5725 near-field HRTFs. Default is 1.
5726
5727 type
5728 Set processing type. Can be time or freq. time is processing audio
5729 in time domain which is slow. freq is processing audio in
5730 frequency domain which is fast. Default is freq.
5731
5732 speakers
5733 Set custom positions of virtual loudspeakers. Syntax for this
5734 option is: <CH> <AZIM> <ELEV>[|<CH> <AZIM> <ELEV>|...]. Each
5735 virtual loudspeaker is described with short channel name following
5736 with azimuth and elevation in degrees. Each virtual loudspeaker
5737 description is separated by '|'. For example to override front
5738 left and front right channel positions use: 'speakers=FL 45 15|FR
5739 345 15'. Descriptions with unrecognised channel names are ignored.
5740
5741 lfegain
5742 Set custom gain for LFE channels. Value is in dB. Default is 0.
5743
5744 framesize
5745 Set custom frame size in number of samples. Default is 1024.
5746 Allowed range is from 1024 to 96000. Only used if option type is
5747 set to freq.
5748
5749 normalize
5750 Should all IRs be normalized upon importing SOFA file. By default
5751 is enabled.
5752
5753 interpolate
5754 Should nearest IRs be interpolated with neighbor IRs if exact
5755 position does not match. By default is disabled.
5756
5757 minphase
5758 Minphase all IRs upon loading of SOFA file. By default is disabled.
5759
5760 anglestep
5761 Set neighbor search angle step. Only used if option interpolate is
5762 enabled.
5763
5764 radstep
5765 Set neighbor search radius step. Only used if option interpolate is
5766 enabled.
5767
5768 Examples
5769
5770 • Using ClubFritz6 sofa file:
5771
5772 sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
5773
5774 • Using ClubFritz12 sofa file and bigger radius with small rotation:
5775
5776 sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
5777
5778 • Similar as above but with custom speaker positions for front left,
5779 front right, back left and back right and also with custom gain:
5780
5781 "sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=2:speakers=FL 45|FR 315|BL 135|BR 225:gain=28"
5782
5783 speechnorm
5784 Speech Normalizer.
5785
5786 This filter expands or compresses each half-cycle of audio samples
5787 (local set of samples all above or all below zero and between two
5788 nearest zero crossings) depending on threshold value, so audio reaches
5789 target peak value under conditions controlled by below options.
5790
5791 The filter accepts the following options:
5792
5793 peak, p
5794 Set the expansion target peak value. This specifies the highest
5795 allowed absolute amplitude level for the normalized audio input.
5796 Default value is 0.95. Allowed range is from 0.0 to 1.0.
5797
5798 expansion, e
5799 Set the maximum expansion factor. Allowed range is from 1.0 to
5800 50.0. Default value is 2.0. This option controls maximum local
5801 half-cycle of samples expansion. The maximum expansion would be
5802 such that local peak value reaches target peak value but never to
5803 surpass it and that ratio between new and previous peak value does
5804 not surpass this option value.
5805
5806 compression, c
5807 Set the maximum compression factor. Allowed range is from 1.0 to
5808 50.0. Default value is 2.0. This option controls maximum local
5809 half-cycle of samples compression. This option is used only if
5810 threshold option is set to value greater than 0.0, then in such
5811 cases when local peak is lower or same as value set by threshold
5812 all samples belonging to that peak's half-cycle will be compressed
5813 by current compression factor.
5814
5815 threshold, t
5816 Set the threshold value. Default value is 0.0. Allowed range is
5817 from 0.0 to 1.0. This option specifies which half-cycles of
5818 samples will be compressed and which will be expanded. Any half-
5819 cycle samples with their local peak value below or same as this
5820 option value will be compressed by current compression factor,
5821 otherwise, if greater than threshold value they will be expanded
5822 with expansion factor so that it could reach peak target value but
5823 never surpass it.
5824
5825 raise, r
5826 Set the expansion raising amount per each half-cycle of samples.
5827 Default value is 0.001. Allowed range is from 0.0 to 1.0. This
5828 controls how fast expansion factor is raised per each new half-
5829 cycle until it reaches expansion value. Setting this options too
5830 high may lead to distortions.
5831
5832 fall, f
5833 Set the compression raising amount per each half-cycle of samples.
5834 Default value is 0.001. Allowed range is from 0.0 to 1.0. This
5835 controls how fast compression factor is raised per each new half-
5836 cycle until it reaches compression value.
5837
5838 channels, h
5839 Specify which channels to filter, by default all available channels
5840 are filtered.
5841
5842 invert, i
5843 Enable inverted filtering, by default is disabled. This inverts
5844 interpretation of threshold option. When enabled any half-cycle of
5845 samples with their local peak value below or same as threshold
5846 option will be expanded otherwise it will be compressed.
5847
5848 link, l
5849 Link channels when calculating gain applied to each filtered
5850 channel sample, by default is disabled. When disabled each
5851 filtered channel gain calculation is independent, otherwise when
5852 this option is enabled the minimum of all possible gains for each
5853 filtered channel is used.
5854
5855 rms, m
5856 Set the expansion target RMS value. This specifies the highest
5857 allowed RMS level for the normalized audio input. Default value is
5858 0.0, thus disabled. Allowed range is from 0.0 to 1.0.
5859
5860 Commands
5861
5862 This filter supports the all above options as commands.
5863
5864 Examples
5865
5866 • Weak and slow amplification:
5867
5868 speechnorm=e=3:r=0.00001:l=1
5869
5870 • Moderate and slow amplification:
5871
5872 speechnorm=e=6.25:r=0.00001:l=1
5873
5874 • Strong and fast amplification:
5875
5876 speechnorm=e=12.5:r=0.0001:l=1
5877
5878 • Very strong and fast amplification:
5879
5880 speechnorm=e=25:r=0.0001:l=1
5881
5882 • Extreme and fast amplification:
5883
5884 speechnorm=e=50:r=0.0001:l=1
5885
5886 stereotools
5887 This filter has some handy utilities to manage stereo signals, for
5888 converting M/S stereo recordings to L/R signal while having control
5889 over the parameters or spreading the stereo image of master track.
5890
5891 The filter accepts the following options:
5892
5893 level_in
5894 Set input level before filtering for both channels. Defaults is 1.
5895 Allowed range is from 0.015625 to 64.
5896
5897 level_out
5898 Set output level after filtering for both channels. Defaults is 1.
5899 Allowed range is from 0.015625 to 64.
5900
5901 balance_in
5902 Set input balance between both channels. Default is 0. Allowed
5903 range is from -1 to 1.
5904
5905 balance_out
5906 Set output balance between both channels. Default is 0. Allowed
5907 range is from -1 to 1.
5908
5909 softclip
5910 Enable softclipping. Results in analog distortion instead of harsh
5911 digital 0dB clipping. Disabled by default.
5912
5913 mutel
5914 Mute the left channel. Disabled by default.
5915
5916 muter
5917 Mute the right channel. Disabled by default.
5918
5919 phasel
5920 Change the phase of the left channel. Disabled by default.
5921
5922 phaser
5923 Change the phase of the right channel. Disabled by default.
5924
5925 mode
5926 Set stereo mode. Available values are:
5927
5928 lr>lr
5929 Left/Right to Left/Right, this is default.
5930
5931 lr>ms
5932 Left/Right to Mid/Side.
5933
5934 ms>lr
5935 Mid/Side to Left/Right.
5936
5937 lr>ll
5938 Left/Right to Left/Left.
5939
5940 lr>rr
5941 Left/Right to Right/Right.
5942
5943 lr>l+r
5944 Left/Right to Left + Right.
5945
5946 lr>rl
5947 Left/Right to Right/Left.
5948
5949 ms>ll
5950 Mid/Side to Left/Left.
5951
5952 ms>rr
5953 Mid/Side to Right/Right.
5954
5955 ms>rl
5956 Mid/Side to Right/Left.
5957
5958 lr>l-r
5959 Left/Right to Left - Right.
5960
5961 slev
5962 Set level of side signal. Default is 1. Allowed range is from
5963 0.015625 to 64.
5964
5965 sbal
5966 Set balance of side signal. Default is 0. Allowed range is from -1
5967 to 1.
5968
5969 mlev
5970 Set level of the middle signal. Default is 1. Allowed range is
5971 from 0.015625 to 64.
5972
5973 mpan
5974 Set middle signal pan. Default is 0. Allowed range is from -1 to 1.
5975
5976 base
5977 Set stereo base between mono and inversed channels. Default is 0.
5978 Allowed range is from -1 to 1.
5979
5980 delay
5981 Set delay in milliseconds how much to delay left from right channel
5982 and vice versa. Default is 0. Allowed range is from -20 to 20.
5983
5984 sclevel
5985 Set S/C level. Default is 1. Allowed range is from 1 to 100.
5986
5987 phase
5988 Set the stereo phase in degrees. Default is 0. Allowed range is
5989 from 0 to 360.
5990
5991 bmode_in, bmode_out
5992 Set balance mode for balance_in/balance_out option.
5993
5994 Can be one of the following:
5995
5996 balance
5997 Classic balance mode. Attenuate one channel at time. Gain is
5998 raised up to 1.
5999
6000 amplitude
6001 Similar as classic mode above but gain is raised up to 2.
6002
6003 power
6004 Equal power distribution, from -6dB to +6dB range.
6005
6006 Commands
6007
6008 This filter supports the all above options as commands.
6009
6010 Examples
6011
6012 • Apply karaoke like effect:
6013
6014 stereotools=mlev=0.015625
6015
6016 • Convert M/S signal to L/R:
6017
6018 "stereotools=mode=ms>lr"
6019
6020 stereowiden
6021 This filter enhance the stereo effect by suppressing signal common to
6022 both channels and by delaying the signal of left into right and vice
6023 versa, thereby widening the stereo effect.
6024
6025 The filter accepts the following options:
6026
6027 delay
6028 Time in milliseconds of the delay of left signal into right and
6029 vice versa. Default is 20 milliseconds.
6030
6031 feedback
6032 Amount of gain in delayed signal into right and vice versa. Gives a
6033 delay effect of left signal in right output and vice versa which
6034 gives widening effect. Default is 0.3.
6035
6036 crossfeed
6037 Cross feed of left into right with inverted phase. This helps in
6038 suppressing the mono. If the value is 1 it will cancel all the
6039 signal common to both channels. Default is 0.3.
6040
6041 drymix
6042 Set level of input signal of original channel. Default is 0.8.
6043
6044 Commands
6045
6046 This filter supports the all above options except "delay" as commands.
6047
6048 superequalizer
6049 Apply 18 band equalizer.
6050
6051 The filter accepts the following options:
6052
6053 1b Set 65Hz band gain.
6054
6055 2b Set 92Hz band gain.
6056
6057 3b Set 131Hz band gain.
6058
6059 4b Set 185Hz band gain.
6060
6061 5b Set 262Hz band gain.
6062
6063 6b Set 370Hz band gain.
6064
6065 7b Set 523Hz band gain.
6066
6067 8b Set 740Hz band gain.
6068
6069 9b Set 1047Hz band gain.
6070
6071 10b Set 1480Hz band gain.
6072
6073 11b Set 2093Hz band gain.
6074
6075 12b Set 2960Hz band gain.
6076
6077 13b Set 4186Hz band gain.
6078
6079 14b Set 5920Hz band gain.
6080
6081 15b Set 8372Hz band gain.
6082
6083 16b Set 11840Hz band gain.
6084
6085 17b Set 16744Hz band gain.
6086
6087 18b Set 20000Hz band gain.
6088
6089 surround
6090 Apply audio surround upmix filter.
6091
6092 This filter allows to produce multichannel output from audio stream.
6093
6094 The filter accepts the following options:
6095
6096 chl_out
6097 Set output channel layout. By default, this is 5.1.
6098
6099 See the Channel Layout section in the ffmpeg-utils(1) manual for
6100 the required syntax.
6101
6102 chl_in
6103 Set input channel layout. By default, this is stereo.
6104
6105 See the Channel Layout section in the ffmpeg-utils(1) manual for
6106 the required syntax.
6107
6108 level_in
6109 Set input volume level. By default, this is 1.
6110
6111 level_out
6112 Set output volume level. By default, this is 1.
6113
6114 lfe Enable LFE channel output if output channel layout has it. By
6115 default, this is enabled.
6116
6117 lfe_low
6118 Set LFE low cut off frequency. By default, this is 128 Hz.
6119
6120 lfe_high
6121 Set LFE high cut off frequency. By default, this is 256 Hz.
6122
6123 lfe_mode
6124 Set LFE mode, can be add or sub. Default is add. In add mode, LFE
6125 channel is created from input audio and added to output. In sub
6126 mode, LFE channel is created from input audio and added to output
6127 but also all non-LFE output channels are subtracted with output LFE
6128 channel.
6129
6130 smooth
6131 Set temporal smoothness strength, used to gradually change factors
6132 when transforming stereo sound in time. Allowed range is from 0.0
6133 to 1.0. Useful to improve output quality with focus option values
6134 greater than 0.0. Default is 0.0. Only values inside this range
6135 and without edges are effective.
6136
6137 angle
6138 Set angle of stereo surround transform, Allowed range is from 0 to
6139 360. Default is 90.
6140
6141 focus
6142 Set focus of stereo surround transform, Allowed range is from -1 to
6143 1. Default is 0.
6144
6145 fc_in
6146 Set front center input volume. By default, this is 1.
6147
6148 fc_out
6149 Set front center output volume. By default, this is 1.
6150
6151 fl_in
6152 Set front left input volume. By default, this is 1.
6153
6154 fl_out
6155 Set front left output volume. By default, this is 1.
6156
6157 fr_in
6158 Set front right input volume. By default, this is 1.
6159
6160 fr_out
6161 Set front right output volume. By default, this is 1.
6162
6163 sl_in
6164 Set side left input volume. By default, this is 1.
6165
6166 sl_out
6167 Set side left output volume. By default, this is 1.
6168
6169 sr_in
6170 Set side right input volume. By default, this is 1.
6171
6172 sr_out
6173 Set side right output volume. By default, this is 1.
6174
6175 bl_in
6176 Set back left input volume. By default, this is 1.
6177
6178 bl_out
6179 Set back left output volume. By default, this is 1.
6180
6181 br_in
6182 Set back right input volume. By default, this is 1.
6183
6184 br_out
6185 Set back right output volume. By default, this is 1.
6186
6187 bc_in
6188 Set back center input volume. By default, this is 1.
6189
6190 bc_out
6191 Set back center output volume. By default, this is 1.
6192
6193 lfe_in
6194 Set LFE input volume. By default, this is 1.
6195
6196 lfe_out
6197 Set LFE output volume. By default, this is 1.
6198
6199 allx
6200 Set spread usage of stereo image across X axis for all channels.
6201 Allowed range is from -1 to 15. By default this value is negative
6202 -1, and thus unused.
6203
6204 ally
6205 Set spread usage of stereo image across Y axis for all channels.
6206 Allowed range is from -1 to 15. By default this value is negative
6207 -1, and thus unused.
6208
6209 fcx, flx, frx, blx, brx, slx, srx, bcx
6210 Set spread usage of stereo image across X axis for each channel.
6211 Allowed range is from 0.06 to 15. By default this value is 0.5.
6212
6213 fcy, fly, fry, bly, bry, sly, sry, bcy
6214 Set spread usage of stereo image across Y axis for each channel.
6215 Allowed range is from 0.06 to 15. By default this value is 0.5.
6216
6217 win_size
6218 Set window size. Allowed range is from 1024 to 65536. Default size
6219 is 4096.
6220
6221 win_func
6222 Set window function.
6223
6224 It accepts the following values:
6225
6226 rect
6227 bartlett
6228 hann, hanning
6229 hamming
6230 blackman
6231 welch
6232 flattop
6233 bharris
6234 bnuttall
6235 bhann
6236 sine
6237 nuttall
6238 lanczos
6239 gauss
6240 tukey
6241 dolph
6242 cauchy
6243 parzen
6244 poisson
6245 bohman
6246 kaiser
6247
6248 Default is "hann".
6249
6250 overlap
6251 Set window overlap. If set to 1, the recommended overlap for
6252 selected window function will be picked. Default is 0.5.
6253
6254 tiltshelf
6255 Boost or cut the lower frequencies and cut or boost higher frequencies
6256 of the audio using a two-pole shelving filter with a response similar
6257 to that of a standard hi-fi's tone-controls. This is also known as
6258 shelving equalisation (EQ).
6259
6260 The filter accepts the following options:
6261
6262 gain, g
6263 Give the gain at 0 Hz. Its useful range is about -20 (for a large
6264 cut) to +20 (for a large boost). Beware of clipping when using a
6265 positive gain.
6266
6267 frequency, f
6268 Set the filter's central frequency and so can be used to extend or
6269 reduce the frequency range to be boosted or cut. The default value
6270 is 3000 Hz.
6271
6272 width_type, t
6273 Set method to specify band-width of filter.
6274
6275 h Hz
6276
6277 q Q-Factor
6278
6279 o octave
6280
6281 s slope
6282
6283 k kHz
6284
6285 width, w
6286 Determine how steep is the filter's shelf transition.
6287
6288 poles, p
6289 Set number of poles. Default is 2.
6290
6291 mix, m
6292 How much to use filtered signal in output. Default is 1. Range is
6293 between 0 and 1.
6294
6295 channels, c
6296 Specify which channels to filter, by default all available are
6297 filtered.
6298
6299 normalize, n
6300 Normalize biquad coefficients, by default is disabled. Enabling it
6301 will normalize magnitude response at DC to 0dB.
6302
6303 transform, a
6304 Set transform type of IIR filter.
6305
6306 di
6307 dii
6308 tdi
6309 tdii
6310 latt
6311 svf
6312 zdf
6313 precision, r
6314 Set precison of filtering.
6315
6316 auto
6317 Pick automatic sample format depending on surround filters.
6318
6319 s16 Always use signed 16-bit.
6320
6321 s32 Always use signed 32-bit.
6322
6323 f32 Always use float 32-bit.
6324
6325 f64 Always use float 64-bit.
6326
6327 block_size, b
6328 Set block size used for reverse IIR processing. If this value is
6329 set to high enough value (higher than impulse response length
6330 truncated when reaches near zero values) filtering will become
6331 linear phase otherwise if not big enough it will just produce nasty
6332 artifacts.
6333
6334 Note that filter delay will be exactly this many samples when set
6335 to non-zero value.
6336
6337 Commands
6338
6339 This filter supports some options as commands.
6340
6341 treble, highshelf
6342 Boost or cut treble (upper) frequencies of the audio using a two-pole
6343 shelving filter with a response similar to that of a standard hi-fi's
6344 tone-controls. This is also known as shelving equalisation (EQ).
6345
6346 The filter accepts the following options:
6347
6348 gain, g
6349 Give the gain at whichever is the lower of ~22 kHz and the Nyquist
6350 frequency. Its useful range is about -20 (for a large cut) to +20
6351 (for a large boost). Beware of clipping when using a positive gain.
6352
6353 frequency, f
6354 Set the filter's central frequency and so can be used to extend or
6355 reduce the frequency range to be boosted or cut. The default value
6356 is 3000 Hz.
6357
6358 width_type, t
6359 Set method to specify band-width of filter.
6360
6361 h Hz
6362
6363 q Q-Factor
6364
6365 o octave
6366
6367 s slope
6368
6369 k kHz
6370
6371 width, w
6372 Determine how steep is the filter's shelf transition.
6373
6374 poles, p
6375 Set number of poles. Default is 2.
6376
6377 mix, m
6378 How much to use filtered signal in output. Default is 1. Range is
6379 between 0 and 1.
6380
6381 channels, c
6382 Specify which channels to filter, by default all available are
6383 filtered.
6384
6385 normalize, n
6386 Normalize biquad coefficients, by default is disabled. Enabling it
6387 will normalize magnitude response at DC to 0dB.
6388
6389 transform, a
6390 Set transform type of IIR filter.
6391
6392 di
6393 dii
6394 tdi
6395 tdii
6396 latt
6397 svf
6398 zdf
6399 precision, r
6400 Set precison of filtering.
6401
6402 auto
6403 Pick automatic sample format depending on surround filters.
6404
6405 s16 Always use signed 16-bit.
6406
6407 s32 Always use signed 32-bit.
6408
6409 f32 Always use float 32-bit.
6410
6411 f64 Always use float 64-bit.
6412
6413 block_size, b
6414 Set block size used for reverse IIR processing. If this value is
6415 set to high enough value (higher than impulse response length
6416 truncated when reaches near zero values) filtering will become
6417 linear phase otherwise if not big enough it will just produce nasty
6418 artifacts.
6419
6420 Note that filter delay will be exactly this many samples when set
6421 to non-zero value.
6422
6423 Commands
6424
6425 This filter supports the following commands:
6426
6427 frequency, f
6428 Change treble frequency. Syntax for the command is : "frequency"
6429
6430 width_type, t
6431 Change treble width_type. Syntax for the command is : "width_type"
6432
6433 width, w
6434 Change treble width. Syntax for the command is : "width"
6435
6436 gain, g
6437 Change treble gain. Syntax for the command is : "gain"
6438
6439 mix, m
6440 Change treble mix. Syntax for the command is : "mix"
6441
6442 tremolo
6443 Sinusoidal amplitude modulation.
6444
6445 The filter accepts the following options:
6446
6447 f Modulation frequency in Hertz. Modulation frequencies in the
6448 subharmonic range (20 Hz or lower) will result in a tremolo effect.
6449 This filter may also be used as a ring modulator by specifying a
6450 modulation frequency higher than 20 Hz. Range is 0.1 - 20000.0.
6451 Default value is 5.0 Hz.
6452
6453 d Depth of modulation as a percentage. Range is 0.0 - 1.0. Default
6454 value is 0.5.
6455
6456 vibrato
6457 Sinusoidal phase modulation.
6458
6459 The filter accepts the following options:
6460
6461 f Modulation frequency in Hertz. Range is 0.1 - 20000.0. Default
6462 value is 5.0 Hz.
6463
6464 d Depth of modulation as a percentage. Range is 0.0 - 1.0. Default
6465 value is 0.5.
6466
6467 virtualbass
6468 Apply audio Virtual Bass filter.
6469
6470 This filter accepts stereo input and produce stereo with LFE (2.1)
6471 channels output. The newly produced LFE channel have enhanced virtual
6472 bass originally obtained from both stereo channels. This filter
6473 outputs front left and front right channels unchanged as available in
6474 stereo input.
6475
6476 The filter accepts the following options:
6477
6478 cutoff
6479 Set the virtual bass cutoff frequency. Default value is 250 Hz.
6480 Allowed range is from 100 to 500 Hz.
6481
6482 strength
6483 Set the virtual bass strength. Allowed range is from 0.5 to 3.
6484 Default value is 3.
6485
6486 volume
6487 Adjust the input audio volume.
6488
6489 It accepts the following parameters:
6490
6491 volume
6492 Set audio volume expression.
6493
6494 Output values are clipped to the maximum value.
6495
6496 The output audio volume is given by the relation:
6497
6498 <output_volume> = <volume> * <input_volume>
6499
6500 The default value for volume is "1.0".
6501
6502 precision
6503 This parameter represents the mathematical precision.
6504
6505 It determines which input sample formats will be allowed, which
6506 affects the precision of the volume scaling.
6507
6508 fixed
6509 8-bit fixed-point; this limits input sample format to U8, S16,
6510 and S32.
6511
6512 float
6513 32-bit floating-point; this limits input sample format to FLT.
6514 (default)
6515
6516 double
6517 64-bit floating-point; this limits input sample format to DBL.
6518
6519 replaygain
6520 Choose the behaviour on encountering ReplayGain side data in input
6521 frames.
6522
6523 drop
6524 Remove ReplayGain side data, ignoring its contents (the
6525 default).
6526
6527 ignore
6528 Ignore ReplayGain side data, but leave it in the frame.
6529
6530 track
6531 Prefer the track gain, if present.
6532
6533 album
6534 Prefer the album gain, if present.
6535
6536 replaygain_preamp
6537 Pre-amplification gain in dB to apply to the selected replaygain
6538 gain.
6539
6540 Default value for replaygain_preamp is 0.0.
6541
6542 replaygain_noclip
6543 Prevent clipping by limiting the gain applied.
6544
6545 Default value for replaygain_noclip is 1.
6546
6547 eval
6548 Set when the volume expression is evaluated.
6549
6550 It accepts the following values:
6551
6552 once
6553 only evaluate expression once during the filter initialization,
6554 or when the volume command is sent
6555
6556 frame
6557 evaluate expression for each incoming frame
6558
6559 Default value is once.
6560
6561 The volume expression can contain the following parameters.
6562
6563 n frame number (starting at zero)
6564
6565 nb_channels
6566 number of channels
6567
6568 nb_consumed_samples
6569 number of samples consumed by the filter
6570
6571 nb_samples
6572 number of samples in the current frame
6573
6574 pos original frame position in the file
6575
6576 pts frame PTS
6577
6578 sample_rate
6579 sample rate
6580
6581 startpts
6582 PTS at start of stream
6583
6584 startt
6585 time at start of stream
6586
6587 t frame time
6588
6589 tb timestamp timebase
6590
6591 volume
6592 last set volume value
6593
6594 Note that when eval is set to once only the sample_rate and tb
6595 variables are available, all other variables will evaluate to NAN.
6596
6597 Commands
6598
6599 This filter supports the following commands:
6600
6601 volume
6602 Modify the volume expression. The command accepts the same syntax
6603 of the corresponding option.
6604
6605 If the specified expression is not valid, it is kept at its current
6606 value.
6607
6608 Examples
6609
6610 • Halve the input audio volume:
6611
6612 volume=volume=0.5
6613 volume=volume=1/2
6614 volume=volume=-6.0206dB
6615
6616 In all the above example the named key for volume can be omitted,
6617 for example like in:
6618
6619 volume=0.5
6620
6621 • Increase input audio power by 6 decibels using fixed-point
6622 precision:
6623
6624 volume=volume=6dB:precision=fixed
6625
6626 • Fade volume after time 10 with an annihilation period of 5 seconds:
6627
6628 volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
6629
6630 volumedetect
6631 Detect the volume of the input video.
6632
6633 The filter has no parameters. It supports only 16-bit signed integer
6634 samples, so the input will be converted when needed. Statistics about
6635 the volume will be printed in the log when the input stream end is
6636 reached.
6637
6638 In particular it will show the mean volume (root mean square), maximum
6639 volume (on a per-sample basis), and the beginning of a histogram of the
6640 registered volume values (from the maximum value to a cumulated 1/1000
6641 of the samples).
6642
6643 All volumes are in decibels relative to the maximum PCM value.
6644
6645 Examples
6646
6647 Here is an excerpt of the output:
6648
6649 [Parsed_volumedetect_0 0xa23120] mean_volume: -27 dB
6650 [Parsed_volumedetect_0 0xa23120] max_volume: -4 dB
6651 [Parsed_volumedetect_0 0xa23120] histogram_4db: 6
6652 [Parsed_volumedetect_0 0xa23120] histogram_5db: 62
6653 [Parsed_volumedetect_0 0xa23120] histogram_6db: 286
6654 [Parsed_volumedetect_0 0xa23120] histogram_7db: 1042
6655 [Parsed_volumedetect_0 0xa23120] histogram_8db: 2551
6656 [Parsed_volumedetect_0 0xa23120] histogram_9db: 4609
6657 [Parsed_volumedetect_0 0xa23120] histogram_10db: 8409
6658
6659 It means that:
6660
6661 • The mean square energy is approximately -27 dB, or 10^-2.7.
6662
6663 • The largest sample is at -4 dB, or more precisely between -4 dB and
6664 -5 dB.
6665
6666 • There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
6667
6668 In other words, raising the volume by +4 dB does not cause any
6669 clipping, raising it by +5 dB causes clipping for 6 samples, etc.
6670
6672 Below is a description of the currently available audio sources.
6673
6674 abuffer
6675 Buffer audio frames, and make them available to the filter chain.
6676
6677 This source is mainly intended for a programmatic use, in particular
6678 through the interface defined in libavfilter/buffersrc.h.
6679
6680 It accepts the following parameters:
6681
6682 time_base
6683 The timebase which will be used for timestamps of submitted frames.
6684 It must be either a floating-point number or in
6685 numerator/denominator form.
6686
6687 sample_rate
6688 The sample rate of the incoming audio buffers.
6689
6690 sample_fmt
6691 The sample format of the incoming audio buffers. Either a sample
6692 format name or its corresponding integer representation from the
6693 enum AVSampleFormat in libavutil/samplefmt.h
6694
6695 channel_layout
6696 The channel layout of the incoming audio buffers. Either a channel
6697 layout name from channel_layout_map in libavutil/channel_layout.c
6698 or its corresponding integer representation from the AV_CH_LAYOUT_*
6699 macros in libavutil/channel_layout.h
6700
6701 channels
6702 The number of channels of the incoming audio buffers. If both
6703 channels and channel_layout are specified, then they must be
6704 consistent.
6705
6706 Examples
6707
6708 abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
6709
6710 will instruct the source to accept planar 16bit signed stereo at
6711 44100Hz. Since the sample format with name "s16p" corresponds to the
6712 number 6 and the "stereo" channel layout corresponds to the value 0x3,
6713 this is equivalent to:
6714
6715 abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
6716
6717 aevalsrc
6718 Generate an audio signal specified by an expression.
6719
6720 This source accepts in input one or more expressions (one for each
6721 channel), which are evaluated and used to generate a corresponding
6722 audio signal.
6723
6724 This source accepts the following options:
6725
6726 exprs
6727 Set the '|'-separated expressions list for each separate channel.
6728 In case the channel_layout option is not specified, the selected
6729 channel layout depends on the number of provided expressions.
6730 Otherwise the last specified expression is applied to the remaining
6731 output channels.
6732
6733 channel_layout, c
6734 Set the channel layout. The number of channels in the specified
6735 layout must be equal to the number of specified expressions.
6736
6737 duration, d
6738 Set the minimum duration of the sourced audio. See the Time
6739 duration section in the ffmpeg-utils(1) manual for the accepted
6740 syntax. Note that the resulting duration may be greater than the
6741 specified duration, as the generated audio is always cut at the end
6742 of a complete frame.
6743
6744 If not specified, or the expressed duration is negative, the audio
6745 is supposed to be generated forever.
6746
6747 nb_samples, n
6748 Set the number of samples per channel per each output frame,
6749 default to 1024.
6750
6751 sample_rate, s
6752 Specify the sample rate, default to 44100.
6753
6754 Each expression in exprs can contain the following constants:
6755
6756 n number of the evaluated sample, starting from 0
6757
6758 t time of the evaluated sample expressed in seconds, starting from 0
6759
6760 s sample rate
6761
6762 Examples
6763
6764 • Generate silence:
6765
6766 aevalsrc=0
6767
6768 • Generate a sin signal with frequency of 440 Hz, set sample rate to
6769 8000 Hz:
6770
6771 aevalsrc="sin(440*2*PI*t):s=8000"
6772
6773 • Generate a two channels signal, specify the channel layout (Front
6774 Center + Back Center) explicitly:
6775
6776 aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC"
6777
6778 • Generate white noise:
6779
6780 aevalsrc="-2+random(0)"
6781
6782 • Generate an amplitude modulated signal:
6783
6784 aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)"
6785
6786 • Generate 2.5 Hz binaural beats on a 360 Hz carrier:
6787
6788 aevalsrc="0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)"
6789
6790 afdelaysrc
6791 Generate a fractional delay FIR coefficients.
6792
6793 The resulting stream can be used with afir filter for filtering the
6794 audio signal.
6795
6796 The filter accepts the following options:
6797
6798 delay, d
6799 Set the fractional delay. Default is 0.
6800
6801 sample_rate, r
6802 Set the sample rate, default is 44100.
6803
6804 nb_samples, n
6805 Set the number of samples per each frame. Default is 1024.
6806
6807 taps, t
6808 Set the number of filter coefficents in output audio stream.
6809 Default value is 0.
6810
6811 channel_layout, c
6812 Specifies the channel layout, and can be a string representing a
6813 channel layout. The default value of channel_layout is "stereo".
6814
6815 afirsrc
6816 Generate a FIR coefficients using frequency sampling method.
6817
6818 The resulting stream can be used with afir filter for filtering the
6819 audio signal.
6820
6821 The filter accepts the following options:
6822
6823 taps, t
6824 Set number of filter coefficents in output audio stream. Default
6825 value is 1025.
6826
6827 frequency, f
6828 Set frequency points from where magnitude and phase are set. This
6829 must be in non decreasing order, and first element must be 0, while
6830 last element must be 1. Elements are separated by white spaces.
6831
6832 magnitude, m
6833 Set magnitude value for every frequency point set by frequency.
6834 Number of values must be same as number of frequency points.
6835 Values are separated by white spaces.
6836
6837 phase, p
6838 Set phase value for every frequency point set by frequency. Number
6839 of values must be same as number of frequency points. Values are
6840 separated by white spaces.
6841
6842 sample_rate, r
6843 Set sample rate, default is 44100.
6844
6845 nb_samples, n
6846 Set number of samples per each frame. Default is 1024.
6847
6848 win_func, w
6849 Set window function. Default is blackman.
6850
6851 anullsrc
6852 The null audio source, return unprocessed audio frames. It is mainly
6853 useful as a template and to be employed in analysis / debugging tools,
6854 or as the source for filters which ignore the input data (for example
6855 the sox synth filter).
6856
6857 This source accepts the following options:
6858
6859 channel_layout, cl
6860 Specifies the channel layout, and can be either an integer or a
6861 string representing a channel layout. The default value of
6862 channel_layout is "stereo".
6863
6864 Check the channel_layout_map definition in
6865 libavutil/channel_layout.c for the mapping between strings and
6866 channel layout values.
6867
6868 sample_rate, r
6869 Specifies the sample rate, and defaults to 44100.
6870
6871 nb_samples, n
6872 Set the number of samples per requested frames.
6873
6874 duration, d
6875 Set the duration of the sourced audio. See the Time duration
6876 section in the ffmpeg-utils(1) manual for the accepted syntax.
6877
6878 If not specified, or the expressed duration is negative, the audio
6879 is supposed to be generated forever.
6880
6881 Examples
6882
6883 • Set the sample rate to 48000 Hz and the channel layout to
6884 AV_CH_LAYOUT_MONO.
6885
6886 anullsrc=r=48000:cl=4
6887
6888 • Do the same operation with a more obvious syntax:
6889
6890 anullsrc=r=48000:cl=mono
6891
6892 All the parameters need to be explicitly defined.
6893
6894 flite
6895 Synthesize a voice utterance using the libflite library.
6896
6897 To enable compilation of this filter you need to configure FFmpeg with
6898 "--enable-libflite".
6899
6900 Note that versions of the flite library prior to 2.0 are not thread-
6901 safe.
6902
6903 The filter accepts the following options:
6904
6905 list_voices
6906 If set to 1, list the names of the available voices and exit
6907 immediately. Default value is 0.
6908
6909 nb_samples, n
6910 Set the maximum number of samples per frame. Default value is 512.
6911
6912 textfile
6913 Set the filename containing the text to speak.
6914
6915 text
6916 Set the text to speak.
6917
6918 voice, v
6919 Set the voice to use for the speech synthesis. Default value is
6920 "kal". See also the list_voices option.
6921
6922 Examples
6923
6924 • Read from file speech.txt, and synthesize the text using the
6925 standard flite voice:
6926
6927 flite=textfile=speech.txt
6928
6929 • Read the specified text selecting the "slt" voice:
6930
6931 flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
6932
6933 • Input text to ffmpeg:
6934
6935 ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
6936
6937 • Make ffplay speak the specified text, using "flite" and the "lavfi"
6938 device:
6939
6940 ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
6941
6942 For more information about libflite, check:
6943 <http://www.festvox.org/flite/>
6944
6945 anoisesrc
6946 Generate a noise audio signal.
6947
6948 The filter accepts the following options:
6949
6950 sample_rate, r
6951 Specify the sample rate. Default value is 48000 Hz.
6952
6953 amplitude, a
6954 Specify the amplitude (0.0 - 1.0) of the generated audio stream.
6955 Default value is 1.0.
6956
6957 duration, d
6958 Specify the duration of the generated audio stream. Not specifying
6959 this option results in noise with an infinite length.
6960
6961 color, colour, c
6962 Specify the color of noise. Available noise colors are white, pink,
6963 brown, blue, violet and velvet. Default color is white.
6964
6965 seed, s
6966 Specify a value used to seed the PRNG.
6967
6968 nb_samples, n
6969 Set the number of samples per each output frame, default is 1024.
6970
6971 Examples
6972
6973 • Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate
6974 and an amplitude of 0.5:
6975
6976 anoisesrc=d=60:c=pink:r=44100:a=0.5
6977
6978 hilbert
6979 Generate odd-tap Hilbert transform FIR coefficients.
6980
6981 The resulting stream can be used with afir filter for phase-shifting
6982 the signal by 90 degrees.
6983
6984 This is used in many matrix coding schemes and for analytic signal
6985 generation. The process is often written as a multiplication by i (or
6986 j), the imaginary unit.
6987
6988 The filter accepts the following options:
6989
6990 sample_rate, s
6991 Set sample rate, default is 44100.
6992
6993 taps, t
6994 Set length of FIR filter, default is 22051.
6995
6996 nb_samples, n
6997 Set number of samples per each frame.
6998
6999 win_func, w
7000 Set window function to be used when generating FIR coefficients.
7001
7002 sinc
7003 Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or
7004 band-reject FIR coefficients.
7005
7006 The resulting stream can be used with afir filter for filtering the
7007 audio signal.
7008
7009 The filter accepts the following options:
7010
7011 sample_rate, r
7012 Set sample rate, default is 44100.
7013
7014 nb_samples, n
7015 Set number of samples per each frame. Default is 1024.
7016
7017 hp Set high-pass frequency. Default is 0.
7018
7019 lp Set low-pass frequency. Default is 0. If high-pass frequency is
7020 lower than low-pass frequency and low-pass frequency is higher than
7021 0 then filter will create band-pass filter coefficients, otherwise
7022 band-reject filter coefficients.
7023
7024 phase
7025 Set filter phase response. Default is 50. Allowed range is from 0
7026 to 100.
7027
7028 beta
7029 Set Kaiser window beta.
7030
7031 att Set stop-band attenuation. Default is 120dB, allowed range is from
7032 40 to 180 dB.
7033
7034 round
7035 Enable rounding, by default is disabled.
7036
7037 hptaps
7038 Set number of taps for high-pass filter.
7039
7040 lptaps
7041 Set number of taps for low-pass filter.
7042
7043 sine
7044 Generate an audio signal made of a sine wave with amplitude 1/8.
7045
7046 The audio signal is bit-exact.
7047
7048 The filter accepts the following options:
7049
7050 frequency, f
7051 Set the carrier frequency. Default is 440 Hz.
7052
7053 beep_factor, b
7054 Enable a periodic beep every second with frequency beep_factor
7055 times the carrier frequency. Default is 0, meaning the beep is
7056 disabled.
7057
7058 sample_rate, r
7059 Specify the sample rate, default is 44100.
7060
7061 duration, d
7062 Specify the duration of the generated audio stream.
7063
7064 samples_per_frame
7065 Set the number of samples per output frame.
7066
7067 The expression can contain the following constants:
7068
7069 n The (sequential) number of the output audio frame, starting
7070 from 0.
7071
7072 pts The PTS (Presentation TimeStamp) of the output audio frame,
7073 expressed in TB units.
7074
7075 t The PTS of the output audio frame, expressed in seconds.
7076
7077 TB The timebase of the output audio frames.
7078
7079 Default is 1024.
7080
7081 Examples
7082
7083 • Generate a simple 440 Hz sine wave:
7084
7085 sine
7086
7087 • Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5
7088 seconds:
7089
7090 sine=220:4:d=5
7091 sine=f=220:b=4:d=5
7092 sine=frequency=220:beep_factor=4:duration=5
7093
7094 • Generate a 1 kHz sine wave following "1602,1601,1602,1601,1602"
7095 NTSC pattern:
7096
7097 sine=1000:samples_per_frame='st(0,mod(n,5)); 1602-not(not(eq(ld(0),1)+eq(ld(0),3)))'
7098
7100 Below is a description of the currently available audio sinks.
7101
7102 abuffersink
7103 Buffer audio frames, and make them available to the end of filter
7104 chain.
7105
7106 This sink is mainly intended for programmatic use, in particular
7107 through the interface defined in libavfilter/buffersink.h or the
7108 options system.
7109
7110 It accepts a pointer to an AVABufferSinkContext structure, which
7111 defines the incoming buffers' formats, to be passed as the opaque
7112 parameter to "avfilter_init_filter" for initialization.
7113
7114 anullsink
7115 Null audio sink; do absolutely nothing with the input audio. It is
7116 mainly useful as a template and for use in analysis / debugging tools.
7117
7119 When you configure your FFmpeg build, you can disable any of the
7120 existing filters using "--disable-filters". The configure output will
7121 show the video filters included in your build.
7122
7123 Below is a description of the currently available video filters.
7124
7125 addroi
7126 Mark a region of interest in a video frame.
7127
7128 The frame data is passed through unchanged, but metadata is attached to
7129 the frame indicating regions of interest which can affect the behaviour
7130 of later encoding. Multiple regions can be marked by applying the
7131 filter multiple times.
7132
7133 x Region distance in pixels from the left edge of the frame.
7134
7135 y Region distance in pixels from the top edge of the frame.
7136
7137 w Region width in pixels.
7138
7139 h Region height in pixels.
7140
7141 The parameters x, y, w and h are expressions, and may contain the
7142 following variables:
7143
7144 iw Width of the input frame.
7145
7146 ih Height of the input frame.
7147
7148 qoffset
7149 Quantisation offset to apply within the region.
7150
7151 This must be a real value in the range -1 to +1. A value of zero
7152 indicates no quality change. A negative value asks for better
7153 quality (less quantisation), while a positive value asks for worse
7154 quality (greater quantisation).
7155
7156 The range is calibrated so that the extreme values indicate the
7157 largest possible offset - if the rest of the frame is encoded with
7158 the worst possible quality, an offset of -1 indicates that this
7159 region should be encoded with the best possible quality anyway.
7160 Intermediate values are then interpolated in some codec-dependent
7161 way.
7162
7163 For example, in 10-bit H.264 the quantisation parameter varies
7164 between -12 and 51. A typical qoffset value of -1/10 therefore
7165 indicates that this region should be encoded with a QP around one-
7166 tenth of the full range better than the rest of the frame. So, if
7167 most of the frame were to be encoded with a QP of around 30, this
7168 region would get a QP of around 24 (an offset of approximately
7169 -1/10 * (51 - -12) = -6.3). An extreme value of -1 would indicate
7170 that this region should be encoded with the best possible quality
7171 regardless of the treatment of the rest of the frame - that is,
7172 should be encoded at a QP of -12.
7173
7174 clear
7175 If set to true, remove any existing regions of interest marked on
7176 the frame before adding the new one.
7177
7178 Examples
7179
7180 • Mark the centre quarter of the frame as interesting.
7181
7182 addroi=iw/4:ih/4:iw/2:ih/2:-1/10
7183
7184 • Mark the 100-pixel-wide region on the left edge of the frame as
7185 very uninteresting (to be encoded at much lower quality than the
7186 rest of the frame).
7187
7188 addroi=0:0:100:ih:+1/5
7189
7190 alphaextract
7191 Extract the alpha component from the input as a grayscale video. This
7192 is especially useful with the alphamerge filter.
7193
7194 alphamerge
7195 Add or replace the alpha component of the primary input with the
7196 grayscale value of a second input. This is intended for use with
7197 alphaextract to allow the transmission or storage of frame sequences
7198 that have alpha in a format that doesn't support an alpha channel.
7199
7200 For example, to reconstruct full frames from a normal YUV-encoded video
7201 and a separate video created with alphaextract, you might use:
7202
7203 movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
7204
7205 amplify
7206 Amplify differences between current pixel and pixels of adjacent frames
7207 in same pixel location.
7208
7209 This filter accepts the following options:
7210
7211 radius
7212 Set frame radius. Default is 2. Allowed range is from 1 to 63. For
7213 example radius of 3 will instruct filter to calculate average of 7
7214 frames.
7215
7216 factor
7217 Set factor to amplify difference. Default is 2. Allowed range is
7218 from 0 to 65535.
7219
7220 threshold
7221 Set threshold for difference amplification. Any difference greater
7222 or equal to this value will not alter source pixel. Default is 10.
7223 Allowed range is from 0 to 65535.
7224
7225 tolerance
7226 Set tolerance for difference amplification. Any difference lower to
7227 this value will not alter source pixel. Default is 0. Allowed
7228 range is from 0 to 65535.
7229
7230 low Set lower limit for changing source pixel. Default is 65535.
7231 Allowed range is from 0 to 65535. This option controls maximum
7232 possible value that will decrease source pixel value.
7233
7234 high
7235 Set high limit for changing source pixel. Default is 65535. Allowed
7236 range is from 0 to 65535. This option controls maximum possible
7237 value that will increase source pixel value.
7238
7239 planes
7240 Set which planes to filter. Default is all. Allowed range is from 0
7241 to 15.
7242
7243 Commands
7244
7245 This filter supports the following commands that corresponds to option
7246 of same name:
7247
7248 factor
7249 threshold
7250 tolerance
7251 low
7252 high
7253 planes
7254
7255 ass
7256 Same as the subtitles filter, except that it doesn't require libavcodec
7257 and libavformat to work. On the other hand, it is limited to ASS
7258 (Advanced Substation Alpha) subtitles files.
7259
7260 This filter accepts the following option in addition to the common
7261 options from the subtitles filter:
7262
7263 shaping
7264 Set the shaping engine
7265
7266 Available values are:
7267
7268 auto
7269 The default libass shaping engine, which is the best available.
7270
7271 simple
7272 Fast, font-agnostic shaper that can do only substitutions
7273
7274 complex
7275 Slower shaper using OpenType for substitutions and positioning
7276
7277 The default is "auto".
7278
7279 atadenoise
7280 Apply an Adaptive Temporal Averaging Denoiser to the video input.
7281
7282 The filter accepts the following options:
7283
7284 0a Set threshold A for 1st plane. Default is 0.02. Valid range is 0
7285 to 0.3.
7286
7287 0b Set threshold B for 1st plane. Default is 0.04. Valid range is 0
7288 to 5.
7289
7290 1a Set threshold A for 2nd plane. Default is 0.02. Valid range is 0
7291 to 0.3.
7292
7293 1b Set threshold B for 2nd plane. Default is 0.04. Valid range is 0
7294 to 5.
7295
7296 2a Set threshold A for 3rd plane. Default is 0.02. Valid range is 0
7297 to 0.3.
7298
7299 2b Set threshold B for 3rd plane. Default is 0.04. Valid range is 0
7300 to 5.
7301
7302 Threshold A is designed to react on abrupt changes in the input
7303 signal and threshold B is designed to react on continuous changes
7304 in the input signal.
7305
7306 s Set number of frames filter will use for averaging. Default is 9.
7307 Must be odd number in range [5, 129].
7308
7309 p Set what planes of frame filter will use for averaging. Default is
7310 all.
7311
7312 a Set what variant of algorithm filter will use for averaging.
7313 Default is "p" parallel. Alternatively can be set to "s" serial.
7314
7315 Parallel can be faster then serial, while other way around is never
7316 true. Parallel will abort early on first change being greater then
7317 thresholds, while serial will continue processing other side of
7318 frames if they are equal or below thresholds.
7319
7320 0s
7321 1s
7322 2s Set sigma for 1st plane, 2nd plane or 3rd plane. Default is 32767.
7323 Valid range is from 0 to 32767. This options controls weight for
7324 each pixel in radius defined by size. Default value means every
7325 pixel have same weight. Setting this option to 0 effectively
7326 disables filtering.
7327
7328 Commands
7329
7330 This filter supports same commands as options except option "s". The
7331 command accepts the same syntax of the corresponding option.
7332
7333 avgblur
7334 Apply average blur filter.
7335
7336 The filter accepts the following options:
7337
7338 sizeX
7339 Set horizontal radius size.
7340
7341 planes
7342 Set which planes to filter. By default all planes are filtered.
7343
7344 sizeY
7345 Set vertical radius size, if zero it will be same as "sizeX".
7346 Default is 0.
7347
7348 Commands
7349
7350 This filter supports same commands as options. The command accepts the
7351 same syntax of the corresponding option.
7352
7353 If the specified expression is not valid, it is kept at its current
7354 value.
7355
7356 backgroundkey
7357 Turns a static background into transparency.
7358
7359 The filter accepts the following option:
7360
7361 threshold
7362 Threshold for scene change detection.
7363
7364 similarity
7365 Similarity percentage with the background.
7366
7367 blend
7368 Set the blend amount for pixels that are not similar.
7369
7370 Commands
7371
7372 This filter supports the all above options as commands.
7373
7374 bbox
7375 Compute the bounding box for the non-black pixels in the input frame
7376 luminance plane.
7377
7378 This filter computes the bounding box containing all the pixels with a
7379 luminance value greater than the minimum allowed value. The parameters
7380 describing the bounding box are printed on the filter log.
7381
7382 The filter accepts the following option:
7383
7384 min_val
7385 Set the minimal luminance value. Default is 16.
7386
7387 Commands
7388
7389 This filter supports the all above options as commands.
7390
7391 bilateral
7392 Apply bilateral filter, spatial smoothing while preserving edges.
7393
7394 The filter accepts the following options:
7395
7396 sigmaS
7397 Set sigma of gaussian function to calculate spatial weight.
7398 Allowed range is 0 to 512. Default is 0.1.
7399
7400 sigmaR
7401 Set sigma of gaussian function to calculate range weight. Allowed
7402 range is 0 to 1. Default is 0.1.
7403
7404 planes
7405 Set planes to filter. Default is first only.
7406
7407 Commands
7408
7409 This filter supports the all above options as commands.
7410
7411 bilateral_cuda
7412 CUDA accelerated bilateral filter, an edge preserving filter. This
7413 filter is mathematically accurate thanks to the use of GPU
7414 acceleration. For best output quality, use one to one chroma
7415 subsampling, i.e. yuv444p format.
7416
7417 The filter accepts the following options:
7418
7419 sigmaS
7420 Set sigma of gaussian function to calculate spatial weight, also
7421 called sigma space. Allowed range is 0.1 to 512. Default is 0.1.
7422
7423 sigmaR
7424 Set sigma of gaussian function to calculate color range weight,
7425 also called sigma color. Allowed range is 0.1 to 512. Default is
7426 0.1.
7427
7428 window_size
7429 Set window size of the bilateral function to determine the number
7430 of neighbours to loop on. If the number entered is even, one will
7431 be added automatically. Allowed range is 1 to 255. Default is 1.
7432
7433 Examples
7434
7435 • Apply the bilateral filter on a video.
7436
7437 ./ffmpeg -v verbose \
7438 -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 \
7439 -init_hw_device cuda \
7440 -filter_complex \
7441 " \
7442 [0:v]scale_cuda=format=yuv444p[scaled_video];
7443 [scaled_video]bilateral_cuda=window_size=9:sigmaS=3.0:sigmaR=50.0" \
7444 -an -sn -c:v h264_nvenc -cq 20 out.mp4
7445
7446 bitplanenoise
7447 Show and measure bit plane noise.
7448
7449 The filter accepts the following options:
7450
7451 bitplane
7452 Set which plane to analyze. Default is 1.
7453
7454 filter
7455 Filter out noisy pixels from "bitplane" set above. Default is
7456 disabled.
7457
7458 blackdetect
7459 Detect video intervals that are (almost) completely black. Can be
7460 useful to detect chapter transitions, commercials, or invalid
7461 recordings.
7462
7463 The filter outputs its detection analysis to both the log as well as
7464 frame metadata. If a black segment of at least the specified minimum
7465 duration is found, a line with the start and end timestamps as well as
7466 duration is printed to the log with level "info". In addition, a log
7467 line with level "debug" is printed per frame showing the black amount
7468 detected for that frame.
7469
7470 The filter also attaches metadata to the first frame of a black segment
7471 with key "lavfi.black_start" and to the first frame after the black
7472 segment ends with key "lavfi.black_end". The value is the frame's
7473 timestamp. This metadata is added regardless of the minimum duration
7474 specified.
7475
7476 The filter accepts the following options:
7477
7478 black_min_duration, d
7479 Set the minimum detected black duration expressed in seconds. It
7480 must be a non-negative floating point number.
7481
7482 Default value is 2.0.
7483
7484 picture_black_ratio_th, pic_th
7485 Set the threshold for considering a picture "black". Express the
7486 minimum value for the ratio:
7487
7488 <nb_black_pixels> / <nb_pixels>
7489
7490 for which a picture is considered black. Default value is 0.98.
7491
7492 pixel_black_th, pix_th
7493 Set the threshold for considering a pixel "black".
7494
7495 The threshold expresses the maximum pixel luminance value for which
7496 a pixel is considered "black". The provided value is scaled
7497 according to the following equation:
7498
7499 <absolute_threshold> = <luminance_minimum_value> + <pixel_black_th> * <luminance_range_size>
7500
7501 luminance_range_size and luminance_minimum_value depend on the
7502 input video format, the range is [0-255] for YUV full-range formats
7503 and [16-235] for YUV non full-range formats.
7504
7505 Default value is 0.10.
7506
7507 The following example sets the maximum pixel threshold to the minimum
7508 value, and detects only black intervals of 2 or more seconds:
7509
7510 blackdetect=d=2:pix_th=0.00
7511
7512 blackframe
7513 Detect frames that are (almost) completely black. Can be useful to
7514 detect chapter transitions or commercials. Output lines consist of the
7515 frame number of the detected frame, the percentage of blackness, the
7516 position in the file if known or -1 and the timestamp in seconds.
7517
7518 In order to display the output lines, you need to set the loglevel at
7519 least to the AV_LOG_INFO value.
7520
7521 This filter exports frame metadata "lavfi.blackframe.pblack". The
7522 value represents the percentage of pixels in the picture that are below
7523 the threshold value.
7524
7525 It accepts the following parameters:
7526
7527 amount
7528 The percentage of the pixels that have to be below the threshold;
7529 it defaults to 98.
7530
7531 threshold, thresh
7532 The threshold below which a pixel value is considered black; it
7533 defaults to 32.
7534
7535 blend
7536 Blend two video frames into each other.
7537
7538 The "blend" filter takes two input streams and outputs one stream, the
7539 first input is the "top" layer and second input is "bottom" layer. By
7540 default, the output terminates when the longest input terminates.
7541
7542 The "tblend" (time blend) filter takes two consecutive frames from one
7543 single stream, and outputs the result obtained by blending the new
7544 frame on top of the old frame.
7545
7546 A description of the accepted options follows.
7547
7548 c0_mode
7549 c1_mode
7550 c2_mode
7551 c3_mode
7552 all_mode
7553 Set blend mode for specific pixel component or all pixel components
7554 in case of all_mode. Default value is "normal".
7555
7556 Available values for component modes are:
7557
7558 addition
7559 and
7560 average
7561 bleach
7562 burn
7563 darken
7564 difference
7565 divide
7566 dodge
7567 exclusion
7568 extremity
7569 freeze
7570 geometric
7571 glow
7572 grainextract
7573 grainmerge
7574 hardlight
7575 hardmix
7576 hardoverlay
7577 harmonic
7578 heat
7579 interpolate
7580 lighten
7581 linearlight
7582 multiply
7583 multiply128
7584 negation
7585 normal
7586 or
7587 overlay
7588 phoenix
7589 pinlight
7590 reflect
7591 screen
7592 softdifference
7593 softlight
7594 stain
7595 subtract
7596 vividlight
7597 xor
7598 c0_opacity
7599 c1_opacity
7600 c2_opacity
7601 c3_opacity
7602 all_opacity
7603 Set blend opacity for specific pixel component or all pixel
7604 components in case of all_opacity. Only used in combination with
7605 pixel component blend modes.
7606
7607 c0_expr
7608 c1_expr
7609 c2_expr
7610 c3_expr
7611 all_expr
7612 Set blend expression for specific pixel component or all pixel
7613 components in case of all_expr. Note that related mode options will
7614 be ignored if those are set.
7615
7616 The expressions can use the following variables:
7617
7618 N The sequential number of the filtered frame, starting from 0.
7619
7620 X
7621 Y the coordinates of the current sample
7622
7623 W
7624 H the width and height of currently filtered plane
7625
7626 SW
7627 SH Width and height scale for the plane being filtered. It is the
7628 ratio between the dimensions of the current plane to the luma
7629 plane, e.g. for a "yuv420p" frame, the values are "1,1" for the
7630 luma plane and "0.5,0.5" for the chroma planes.
7631
7632 T Time of the current frame, expressed in seconds.
7633
7634 TOP, A
7635 Value of pixel component at current location for first video
7636 frame (top layer).
7637
7638 BOTTOM, B
7639 Value of pixel component at current location for second video
7640 frame (bottom layer).
7641
7642 The "blend" filter also supports the framesync options.
7643
7644 Examples
7645
7646 • Apply transition from bottom layer to top layer in first 10
7647 seconds:
7648
7649 blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
7650
7651 • Apply linear horizontal transition from top layer to bottom layer:
7652
7653 blend=all_expr='A*(X/W)+B*(1-X/W)'
7654
7655 • Apply 1x1 checkerboard effect:
7656
7657 blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
7658
7659 • Apply uncover left effect:
7660
7661 blend=all_expr='if(gte(N*SW+X,W),A,B)'
7662
7663 • Apply uncover down effect:
7664
7665 blend=all_expr='if(gte(Y-N*SH,0),A,B)'
7666
7667 • Apply uncover up-left effect:
7668
7669 blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
7670
7671 • Split diagonally video and shows top and bottom layer on each side:
7672
7673 blend=all_expr='if(gt(X,Y*(W/H)),A,B)'
7674
7675 • Display differences between the current and the previous frame:
7676
7677 tblend=all_mode=grainextract
7678
7679 Commands
7680
7681 This filter supports same commands as options.
7682
7683 blockdetect
7684 Determines blockiness of frames without altering the input frames.
7685
7686 Based on Remco Muijs and Ihor Kirenko: "A no-reference blocking
7687 artifact measure for adaptive video processing." 2005 13th European
7688 signal processing conference.
7689
7690 The filter accepts the following options:
7691
7692 period_min
7693 period_max
7694 Set minimum and maximum values for determining pixel grids
7695 (periods). Default values are [3,24].
7696
7697 planes
7698 Set planes to filter. Default is first only.
7699
7700 Examples
7701
7702 • Determine blockiness for the first plane and search for periods
7703 within [8,32]:
7704
7705 blockdetect=period_min=8:period_max=32:planes=1
7706
7707 blurdetect
7708 Determines blurriness of frames without altering the input frames.
7709
7710 Based on Marziliano, Pina, et al. "A no-reference perceptual blur
7711 metric." Allows for a block-based abbreviation.
7712
7713 The filter accepts the following options:
7714
7715 low
7716 high
7717 Set low and high threshold values used by the Canny thresholding
7718 algorithm.
7719
7720 The high threshold selects the "strong" edge pixels, which are then
7721 connected through 8-connectivity with the "weak" edge pixels
7722 selected by the low threshold.
7723
7724 low and high threshold values must be chosen in the range [0,1],
7725 and low should be lesser or equal to high.
7726
7727 Default value for low is "20/255", and default value for high is
7728 "50/255".
7729
7730 radius
7731 Define the radius to search around an edge pixel for local maxima.
7732
7733 block_pct
7734 Determine blurriness only for the most significant blocks, given in
7735 percentage.
7736
7737 block_width
7738 Determine blurriness for blocks of width block_width. If set to any
7739 value smaller 1, no blocks are used and the whole image is
7740 processed as one no matter of block_height.
7741
7742 block_height
7743 Determine blurriness for blocks of height block_height. If set to
7744 any value smaller 1, no blocks are used and the whole image is
7745 processed as one no matter of block_width.
7746
7747 planes
7748 Set planes to filter. Default is first only.
7749
7750 Examples
7751
7752 • Determine blur for 80% of most significant 32x32 blocks:
7753
7754 blurdetect=block_width=32:block_height=32:block_pct=80
7755
7756 bm3d
7757 Denoise frames using Block-Matching 3D algorithm.
7758
7759 The filter accepts the following options.
7760
7761 sigma
7762 Set denoising strength. Default value is 1. Allowed range is from
7763 0 to 999.9. The denoising algorithm is very sensitive to sigma, so
7764 adjust it according to the source.
7765
7766 block
7767 Set local patch size. This sets dimensions in 2D.
7768
7769 bstep
7770 Set sliding step for processing blocks. Default value is 4.
7771 Allowed range is from 1 to 64. Smaller values allows processing
7772 more reference blocks and is slower.
7773
7774 group
7775 Set maximal number of similar blocks for 3rd dimension. Default
7776 value is 1. When set to 1, no block matching is done. Larger
7777 values allows more blocks in single group. Allowed range is from 1
7778 to 256.
7779
7780 range
7781 Set radius for search block matching. Default is 9. Allowed range
7782 is from 1 to INT32_MAX.
7783
7784 mstep
7785 Set step between two search locations for block matching. Default
7786 is 1. Allowed range is from 1 to 64. Smaller is slower.
7787
7788 thmse
7789 Set threshold of mean square error for block matching. Valid range
7790 is 0 to INT32_MAX.
7791
7792 hdthr
7793 Set thresholding parameter for hard thresholding in 3D transformed
7794 domain. Larger values results in stronger hard-thresholding
7795 filtering in frequency domain.
7796
7797 estim
7798 Set filtering estimation mode. Can be "basic" or "final". Default
7799 is "basic".
7800
7801 ref If enabled, filter will use 2nd stream for block matching. Default
7802 is disabled for "basic" value of estim option, and always enabled
7803 if value of estim is "final".
7804
7805 planes
7806 Set planes to filter. Default is all available except alpha.
7807
7808 Examples
7809
7810 • Basic filtering with bm3d:
7811
7812 bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic
7813
7814 • Same as above, but filtering only luma:
7815
7816 bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic:planes=1
7817
7818 • Same as above, but with both estimation modes:
7819
7820 split[a][b],[a]bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1
7821
7822 • Same as above, but prefilter with nlmeans filter instead:
7823
7824 split[a][b],[a]nlmeans=s=3:r=7:p=3[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1
7825
7826 boxblur
7827 Apply a boxblur algorithm to the input video.
7828
7829 It accepts the following parameters:
7830
7831 luma_radius, lr
7832 luma_power, lp
7833 chroma_radius, cr
7834 chroma_power, cp
7835 alpha_radius, ar
7836 alpha_power, ap
7837
7838 A description of the accepted options follows.
7839
7840 luma_radius, lr
7841 chroma_radius, cr
7842 alpha_radius, ar
7843 Set an expression for the box radius in pixels used for blurring
7844 the corresponding input plane.
7845
7846 The radius value must be a non-negative number, and must not be
7847 greater than the value of the expression "min(w,h)/2" for the luma
7848 and alpha planes, and of "min(cw,ch)/2" for the chroma planes.
7849
7850 Default value for luma_radius is "2". If not specified,
7851 chroma_radius and alpha_radius default to the corresponding value
7852 set for luma_radius.
7853
7854 The expressions can contain the following constants:
7855
7856 w
7857 h The input width and height in pixels.
7858
7859 cw
7860 ch The input chroma image width and height in pixels.
7861
7862 hsub
7863 vsub
7864 The horizontal and vertical chroma subsample values. For
7865 example, for the pixel format "yuv422p", hsub is 2 and vsub is
7866 1.
7867
7868 luma_power, lp
7869 chroma_power, cp
7870 alpha_power, ap
7871 Specify how many times the boxblur filter is applied to the
7872 corresponding plane.
7873
7874 Default value for luma_power is 2. If not specified, chroma_power
7875 and alpha_power default to the corresponding value set for
7876 luma_power.
7877
7878 A value of 0 will disable the effect.
7879
7880 Examples
7881
7882 • Apply a boxblur filter with the luma, chroma, and alpha radii set
7883 to 2:
7884
7885 boxblur=luma_radius=2:luma_power=1
7886 boxblur=2:1
7887
7888 • Set the luma radius to 2, and alpha and chroma radius to 0:
7889
7890 boxblur=2:1:cr=0:ar=0
7891
7892 • Set the luma and chroma radii to a fraction of the video dimension:
7893
7894 boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
7895
7896 bwdif
7897 Deinterlace the input video ("bwdif" stands for "Bob Weaver
7898 Deinterlacing Filter").
7899
7900 Motion adaptive deinterlacing based on yadif with the use of w3fdif and
7901 cubic interpolation algorithms. It accepts the following parameters:
7902
7903 mode
7904 The interlacing mode to adopt. It accepts one of the following
7905 values:
7906
7907 0, send_frame
7908 Output one frame for each frame.
7909
7910 1, send_field
7911 Output one frame for each field.
7912
7913 The default value is "send_field".
7914
7915 parity
7916 The picture field parity assumed for the input interlaced video. It
7917 accepts one of the following values:
7918
7919 0, tff
7920 Assume the top field is first.
7921
7922 1, bff
7923 Assume the bottom field is first.
7924
7925 -1, auto
7926 Enable automatic detection of field parity.
7927
7928 The default value is "auto". If the interlacing is unknown or the
7929 decoder does not export this information, top field first will be
7930 assumed.
7931
7932 deint
7933 Specify which frames to deinterlace. Accepts one of the following
7934 values:
7935
7936 0, all
7937 Deinterlace all frames.
7938
7939 1, interlaced
7940 Only deinterlace frames marked as interlaced.
7941
7942 The default value is "all".
7943
7944 cas
7945 Apply Contrast Adaptive Sharpen filter to video stream.
7946
7947 The filter accepts the following options:
7948
7949 strength
7950 Set the sharpening strength. Default value is 0.
7951
7952 planes
7953 Set planes to filter. Default value is to filter all planes except
7954 alpha plane.
7955
7956 Commands
7957
7958 This filter supports same commands as options.
7959
7960 chromahold
7961 Remove all color information for all colors except for certain one.
7962
7963 The filter accepts the following options:
7964
7965 color
7966 The color which will not be replaced with neutral chroma.
7967
7968 similarity
7969 Similarity percentage with the above color. 0.01 matches only the
7970 exact key color, while 1.0 matches everything.
7971
7972 blend
7973 Blend percentage. 0.0 makes pixels either fully gray, or not gray
7974 at all. Higher values result in more preserved color.
7975
7976 yuv Signals that the color passed is already in YUV instead of RGB.
7977
7978 Literal colors like "green" or "red" don't make sense with this
7979 enabled anymore. This can be used to pass exact YUV values as
7980 hexadecimal numbers.
7981
7982 Commands
7983
7984 This filter supports same commands as options. The command accepts the
7985 same syntax of the corresponding option.
7986
7987 If the specified expression is not valid, it is kept at its current
7988 value.
7989
7990 chromakey
7991 YUV colorspace color/chroma keying.
7992
7993 The filter accepts the following options:
7994
7995 color
7996 The color which will be replaced with transparency.
7997
7998 similarity
7999 Similarity percentage with the key color.
8000
8001 0.01 matches only the exact key color, while 1.0 matches
8002 everything.
8003
8004 blend
8005 Blend percentage.
8006
8007 0.0 makes pixels either fully transparent, or not transparent at
8008 all.
8009
8010 Higher values result in semi-transparent pixels, with a higher
8011 transparency the more similar the pixels color is to the key color.
8012
8013 yuv Signals that the color passed is already in YUV instead of RGB.
8014
8015 Literal colors like "green" or "red" don't make sense with this
8016 enabled anymore. This can be used to pass exact YUV values as
8017 hexadecimal numbers.
8018
8019 Commands
8020
8021 This filter supports same commands as options. The command accepts the
8022 same syntax of the corresponding option.
8023
8024 If the specified expression is not valid, it is kept at its current
8025 value.
8026
8027 Examples
8028
8029 • Make every green pixel in the input image transparent:
8030
8031 ffmpeg -i input.png -vf chromakey=green out.png
8032
8033 • Overlay a greenscreen-video on top of a static black background.
8034
8035 ffmpeg -f lavfi -i color=c=black:s=1280x720 -i video.mp4 -shortest -filter_complex "[1:v]chromakey=0x70de77:0.1:0.2[ckout];[0:v][ckout]overlay[out]" -map "[out]" output.mkv
8036
8037 chromakey_cuda
8038 CUDA accelerated YUV colorspace color/chroma keying.
8039
8040 This filter works like normal chromakey filter but operates on CUDA
8041 frames. for more details and parameters see chromakey.
8042
8043 Examples
8044
8045 • Make all the green pixels in the input video transparent and use it
8046 as an overlay for another video:
8047
8048 ./ffmpeg \
8049 -hwaccel cuda -hwaccel_output_format cuda -i input_green.mp4 \
8050 -hwaccel cuda -hwaccel_output_format cuda -i base_video.mp4 \
8051 -init_hw_device cuda \
8052 -filter_complex \
8053 " \
8054 [0:v]chromakey_cuda=0x25302D:0.1:0.12:1[overlay_video]; \
8055 [1:v]scale_cuda=format=yuv420p[base]; \
8056 [base][overlay_video]overlay_cuda" \
8057 -an -sn -c:v h264_nvenc -cq 20 output.mp4
8058
8059 • Process two software sources, explicitly uploading the frames:
8060
8061 ./ffmpeg -init_hw_device cuda=cuda -filter_hw_device cuda \
8062 -f lavfi -i color=size=800x600:color=white,format=yuv420p \
8063 -f lavfi -i yuvtestsrc=size=200x200,format=yuv420p \
8064 -filter_complex \
8065 " \
8066 [0]hwupload[under]; \
8067 [1]hwupload,chromakey_cuda=green:0.1:0.12[over]; \
8068 [under][over]overlay_cuda" \
8069 -c:v hevc_nvenc -cq 18 -preset slow output.mp4
8070
8071 chromanr
8072 Reduce chrominance noise.
8073
8074 The filter accepts the following options:
8075
8076 thres
8077 Set threshold for averaging chrominance values. Sum of absolute
8078 difference of Y, U and V pixel components of current pixel and
8079 neighbour pixels lower than this threshold will be used in
8080 averaging. Luma component is left unchanged and is copied to
8081 output. Default value is 30. Allowed range is from 1 to 200.
8082
8083 sizew
8084 Set horizontal radius of rectangle used for averaging. Allowed
8085 range is from 1 to 100. Default value is 5.
8086
8087 sizeh
8088 Set vertical radius of rectangle used for averaging. Allowed range
8089 is from 1 to 100. Default value is 5.
8090
8091 stepw
8092 Set horizontal step when averaging. Default value is 1. Allowed
8093 range is from 1 to 50. Mostly useful to speed-up filtering.
8094
8095 steph
8096 Set vertical step when averaging. Default value is 1. Allowed
8097 range is from 1 to 50. Mostly useful to speed-up filtering.
8098
8099 threy
8100 Set Y threshold for averaging chrominance values. Set finer
8101 control for max allowed difference between Y components of current
8102 pixel and neigbour pixels. Default value is 200. Allowed range is
8103 from 1 to 200.
8104
8105 threu
8106 Set U threshold for averaging chrominance values. Set finer
8107 control for max allowed difference between U components of current
8108 pixel and neigbour pixels. Default value is 200. Allowed range is
8109 from 1 to 200.
8110
8111 threv
8112 Set V threshold for averaging chrominance values. Set finer
8113 control for max allowed difference between V components of current
8114 pixel and neigbour pixels. Default value is 200. Allowed range is
8115 from 1 to 200.
8116
8117 distance
8118 Set distance type used in calculations.
8119
8120 manhattan
8121 Absolute difference.
8122
8123 euclidean
8124 Difference squared.
8125
8126 Default distance type is manhattan.
8127
8128 Commands
8129
8130 This filter supports same commands as options. The command accepts the
8131 same syntax of the corresponding option.
8132
8133 chromashift
8134 Shift chroma pixels horizontally and/or vertically.
8135
8136 The filter accepts the following options:
8137
8138 cbh Set amount to shift chroma-blue horizontally.
8139
8140 cbv Set amount to shift chroma-blue vertically.
8141
8142 crh Set amount to shift chroma-red horizontally.
8143
8144 crv Set amount to shift chroma-red vertically.
8145
8146 edge
8147 Set edge mode, can be smear, default, or warp.
8148
8149 Commands
8150
8151 This filter supports the all above options as commands.
8152
8153 ciescope
8154 Display CIE color diagram with pixels overlaid onto it.
8155
8156 The filter accepts the following options:
8157
8158 system
8159 Set color system.
8160
8161 ntsc, 470m
8162 ebu, 470bg
8163 smpte
8164 240m
8165 apple
8166 widergb
8167 cie1931
8168 rec709, hdtv
8169 uhdtv, rec2020
8170 dcip3
8171 cie Set CIE system.
8172
8173 xyy
8174 ucs
8175 luv
8176 gamuts
8177 Set what gamuts to draw.
8178
8179 See "system" option for available values.
8180
8181 size, s
8182 Set ciescope size, by default set to 512.
8183
8184 intensity, i
8185 Set intensity used to map input pixel values to CIE diagram.
8186
8187 contrast
8188 Set contrast used to draw tongue colors that are out of active
8189 color system gamut.
8190
8191 corrgamma
8192 Correct gamma displayed on scope, by default enabled.
8193
8194 showwhite
8195 Show white point on CIE diagram, by default disabled.
8196
8197 gamma
8198 Set input gamma. Used only with XYZ input color space.
8199
8200 fill
8201 Fill with CIE colors. By default is enabled.
8202
8203 codecview
8204 Visualize information exported by some codecs.
8205
8206 Some codecs can export information through frames using side-data or
8207 other means. For example, some MPEG based codecs export motion vectors
8208 through the export_mvs flag in the codec flags2 option.
8209
8210 The filter accepts the following option:
8211
8212 block
8213 Display block partition structure using the luma plane.
8214
8215 mv Set motion vectors to visualize.
8216
8217 Available flags for mv are:
8218
8219 pf forward predicted MVs of P-frames
8220
8221 bf forward predicted MVs of B-frames
8222
8223 bb backward predicted MVs of B-frames
8224
8225 qp Display quantization parameters using the chroma planes.
8226
8227 mv_type, mvt
8228 Set motion vectors type to visualize. Includes MVs from all frames
8229 unless specified by frame_type option.
8230
8231 Available flags for mv_type are:
8232
8233 fp forward predicted MVs
8234
8235 bp backward predicted MVs
8236
8237 frame_type, ft
8238 Set frame type to visualize motion vectors of.
8239
8240 Available flags for frame_type are:
8241
8242 if intra-coded frames (I-frames)
8243
8244 pf predicted frames (P-frames)
8245
8246 bf bi-directionally predicted frames (B-frames)
8247
8248 Examples
8249
8250 • Visualize forward predicted MVs of all frames using ffplay:
8251
8252 ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv_type=fp
8253
8254 • Visualize multi-directionals MVs of P and B-Frames using ffplay:
8255
8256 ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb
8257
8258 colorbalance
8259 Modify intensity of primary colors (red, green and blue) of input
8260 frames.
8261
8262 The filter allows an input frame to be adjusted in the shadows,
8263 midtones or highlights regions for the red-cyan, green-magenta or blue-
8264 yellow balance.
8265
8266 A positive adjustment value shifts the balance towards the primary
8267 color, a negative value towards the complementary color.
8268
8269 The filter accepts the following options:
8270
8271 rs
8272 gs
8273 bs Adjust red, green and blue shadows (darkest pixels).
8274
8275 rm
8276 gm
8277 bm Adjust red, green and blue midtones (medium pixels).
8278
8279 rh
8280 gh
8281 bh Adjust red, green and blue highlights (brightest pixels).
8282
8283 Allowed ranges for options are "[-1.0, 1.0]". Defaults are 0.
8284
8285 pl Preserve lightness when changing color balance. Default is
8286 disabled.
8287
8288 Examples
8289
8290 • Add red color cast to shadows:
8291
8292 colorbalance=rs=.3
8293
8294 Commands
8295
8296 This filter supports the all above options as commands.
8297
8298 colorcontrast
8299 Adjust color contrast between RGB components.
8300
8301 The filter accepts the following options:
8302
8303 rc Set the red-cyan contrast. Defaults is 0.0. Allowed range is from
8304 -1.0 to 1.0.
8305
8306 gm Set the green-magenta contrast. Defaults is 0.0. Allowed range is
8307 from -1.0 to 1.0.
8308
8309 by Set the blue-yellow contrast. Defaults is 0.0. Allowed range is
8310 from -1.0 to 1.0.
8311
8312 rcw
8313 gmw
8314 byw Set the weight of each "rc", "gm", "by" option value. Default value
8315 is 0.0. Allowed range is from 0.0 to 1.0. If all weights are 0.0
8316 filtering is disabled.
8317
8318 pl Set the amount of preserving lightness. Default value is 0.0.
8319 Allowed range is from 0.0 to 1.0.
8320
8321 Commands
8322
8323 This filter supports the all above options as commands.
8324
8325 colorcorrect
8326 Adjust color white balance selectively for blacks and whites. This
8327 filter operates in YUV colorspace.
8328
8329 The filter accepts the following options:
8330
8331 rl Set the red shadow spot. Allowed range is from -1.0 to 1.0.
8332 Default value is 0.
8333
8334 bl Set the blue shadow spot. Allowed range is from -1.0 to 1.0.
8335 Default value is 0.
8336
8337 rh Set the red highlight spot. Allowed range is from -1.0 to 1.0.
8338 Default value is 0.
8339
8340 bh Set the red highlight spot. Allowed range is from -1.0 to 1.0.
8341 Default value is 0.
8342
8343 saturation
8344 Set the amount of saturation. Allowed range is from -3.0 to 3.0.
8345 Default value is 1.
8346
8347 analyze
8348 If set to anything other than "manual" it will analyze every frame
8349 and use derived parameters for filtering output frame.
8350
8351 Possible values are:
8352
8353 manual
8354 average
8355 minmax
8356 median
8357
8358 Default value is "manual".
8359
8360 Commands
8361
8362 This filter supports the all above options as commands.
8363
8364 colorchannelmixer
8365 Adjust video input frames by re-mixing color channels.
8366
8367 This filter modifies a color channel by adding the values associated to
8368 the other channels of the same pixels. For example if the value to
8369 modify is red, the output value will be:
8370
8371 <red>=<red>*<rr> + <blue>*<rb> + <green>*<rg> + <alpha>*<ra>
8372
8373 The filter accepts the following options:
8374
8375 rr
8376 rg
8377 rb
8378 ra Adjust contribution of input red, green, blue and alpha channels
8379 for output red channel. Default is 1 for rr, and 0 for rg, rb and
8380 ra.
8381
8382 gr
8383 gg
8384 gb
8385 ga Adjust contribution of input red, green, blue and alpha channels
8386 for output green channel. Default is 1 for gg, and 0 for gr, gb
8387 and ga.
8388
8389 br
8390 bg
8391 bb
8392 ba Adjust contribution of input red, green, blue and alpha channels
8393 for output blue channel. Default is 1 for bb, and 0 for br, bg and
8394 ba.
8395
8396 ar
8397 ag
8398 ab
8399 aa Adjust contribution of input red, green, blue and alpha channels
8400 for output alpha channel. Default is 1 for aa, and 0 for ar, ag
8401 and ab.
8402
8403 Allowed ranges for options are "[-2.0, 2.0]".
8404
8405 pc Set preserve color mode. The accepted values are:
8406
8407 none
8408 Disable color preserving, this is default.
8409
8410 lum Preserve luminance.
8411
8412 max Preserve max value of RGB triplet.
8413
8414 avg Preserve average value of RGB triplet.
8415
8416 sum Preserve sum value of RGB triplet.
8417
8418 nrm Preserve normalized value of RGB triplet.
8419
8420 pwr Preserve power value of RGB triplet.
8421
8422 pa Set the preserve color amount when changing colors. Allowed range
8423 is from "[0.0, 1.0]". Default is 0.0, thus disabled.
8424
8425 Examples
8426
8427 • Convert source to grayscale:
8428
8429 colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
8430
8431 • Simulate sepia tones:
8432
8433 colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
8434
8435 Commands
8436
8437 This filter supports the all above options as commands.
8438
8439 colorize
8440 Overlay a solid color on the video stream.
8441
8442 The filter accepts the following options:
8443
8444 hue Set the color hue. Allowed range is from 0 to 360. Default value
8445 is 0.
8446
8447 saturation
8448 Set the color saturation. Allowed range is from 0 to 1. Default
8449 value is 0.5.
8450
8451 lightness
8452 Set the color lightness. Allowed range is from 0 to 1. Default
8453 value is 0.5.
8454
8455 mix Set the mix of source lightness. By default is set to 1.0. Allowed
8456 range is from 0.0 to 1.0.
8457
8458 Commands
8459
8460 This filter supports the all above options as commands.
8461
8462 colorkey
8463 RGB colorspace color keying. This filter operates on 8-bit RGB format
8464 frames by setting the alpha component of each pixel which falls within
8465 the similarity radius of the key color to 0. The alpha value for pixels
8466 outside the similarity radius depends on the value of the blend option.
8467
8468 The filter accepts the following options:
8469
8470 color
8471 Set the color for which alpha will be set to 0 (full transparency).
8472 See "Color" section in the ffmpeg-utils manual. Default is
8473 "black".
8474
8475 similarity
8476 Set the radius from the key color within which other colors also
8477 have full transparency. The computed distance is related to the
8478 unit fractional distance in 3D space between the RGB values of the
8479 key color and the pixel's color. Range is 0.01 to 1.0. 0.01 matches
8480 within a very small radius around the exact key color, while 1.0
8481 matches everything. Default is 0.01.
8482
8483 blend
8484 Set how the alpha value for pixels that fall outside the similarity
8485 radius is computed. 0.0 makes pixels either fully transparent or
8486 fully opaque. Higher values result in semi-transparent pixels,
8487 with greater transparency the more similar the pixel color is to
8488 the key color. Range is 0.0 to 1.0. Default is 0.0.
8489
8490 Examples
8491
8492 • Make every green pixel in the input image transparent:
8493
8494 ffmpeg -i input.png -vf colorkey=green out.png
8495
8496 • Overlay a greenscreen-video on top of a static background image.
8497
8498 ffmpeg -i background.png -i video.mp4 -filter_complex "[1:v]colorkey=0x3BBD1E:0.3:0.2[ckout];[0:v][ckout]overlay[out]" -map "[out]" output.flv
8499
8500 Commands
8501
8502 This filter supports same commands as options. The command accepts the
8503 same syntax of the corresponding option.
8504
8505 If the specified expression is not valid, it is kept at its current
8506 value.
8507
8508 colorhold
8509 Remove all color information for all RGB colors except for certain one.
8510
8511 The filter accepts the following options:
8512
8513 color
8514 The color which will not be replaced with neutral gray.
8515
8516 similarity
8517 Similarity percentage with the above color. 0.01 matches only the
8518 exact key color, while 1.0 matches everything.
8519
8520 blend
8521 Blend percentage. 0.0 makes pixels fully gray. Higher values
8522 result in more preserved color.
8523
8524 Commands
8525
8526 This filter supports same commands as options. The command accepts the
8527 same syntax of the corresponding option.
8528
8529 If the specified expression is not valid, it is kept at its current
8530 value.
8531
8532 colorlevels
8533 Adjust video input frames using levels.
8534
8535 The filter accepts the following options:
8536
8537 rimin
8538 gimin
8539 bimin
8540 aimin
8541 Adjust red, green, blue and alpha input black point. Allowed
8542 ranges for options are "[-1.0, 1.0]". Defaults are 0.
8543
8544 rimax
8545 gimax
8546 bimax
8547 aimax
8548 Adjust red, green, blue and alpha input white point. Allowed
8549 ranges for options are "[-1.0, 1.0]". Defaults are 1.
8550
8551 Input levels are used to lighten highlights (bright tones), darken
8552 shadows (dark tones), change the balance of bright and dark tones.
8553
8554 romin
8555 gomin
8556 bomin
8557 aomin
8558 Adjust red, green, blue and alpha output black point. Allowed
8559 ranges for options are "[0, 1.0]". Defaults are 0.
8560
8561 romax
8562 gomax
8563 bomax
8564 aomax
8565 Adjust red, green, blue and alpha output white point. Allowed
8566 ranges for options are "[0, 1.0]". Defaults are 1.
8567
8568 Output levels allows manual selection of a constrained output level
8569 range.
8570
8571 preserve
8572 Set preserve color mode. The accepted values are:
8573
8574 none
8575 Disable color preserving, this is default.
8576
8577 lum Preserve luminance.
8578
8579 max Preserve max value of RGB triplet.
8580
8581 avg Preserve average value of RGB triplet.
8582
8583 sum Preserve sum value of RGB triplet.
8584
8585 nrm Preserve normalized value of RGB triplet.
8586
8587 pwr Preserve power value of RGB triplet.
8588
8589 Examples
8590
8591 • Make video output darker:
8592
8593 colorlevels=rimin=0.058:gimin=0.058:bimin=0.058
8594
8595 • Increase contrast:
8596
8597 colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96
8598
8599 • Make video output lighter:
8600
8601 colorlevels=rimax=0.902:gimax=0.902:bimax=0.902
8602
8603 • Increase brightness:
8604
8605 colorlevels=romin=0.5:gomin=0.5:bomin=0.5
8606
8607 Commands
8608
8609 This filter supports the all above options as commands.
8610
8611 colormap
8612 Apply custom color maps to video stream.
8613
8614 This filter needs three input video streams. First stream is video
8615 stream that is going to be filtered out. Second and third video stream
8616 specify color patches for source color to target color mapping.
8617
8618 The filter accepts the following options:
8619
8620 patch_size
8621 Set the source and target video stream patch size in pixels.
8622
8623 nb_patches
8624 Set the max number of used patches from source and target video
8625 stream. Default value is number of patches available in additional
8626 video streams. Max allowed number of patches is 64.
8627
8628 type
8629 Set the adjustments used for target colors. Can be "relative" or
8630 "absolute". Defaults is "absolute".
8631
8632 kernel
8633 Set the kernel used to measure color differences between mapped
8634 colors.
8635
8636 The accepted values are:
8637
8638 euclidean
8639 weuclidean
8640
8641 Default is "euclidean".
8642
8643 colormatrix
8644 Convert color matrix.
8645
8646 The filter accepts the following options:
8647
8648 src
8649 dst Specify the source and destination color matrix. Both values must
8650 be specified.
8651
8652 The accepted values are:
8653
8654 bt709
8655 BT.709
8656
8657 fcc FCC
8658
8659 bt601
8660 BT.601
8661
8662 bt470
8663 BT.470
8664
8665 bt470bg
8666 BT.470BG
8667
8668 smpte170m
8669 SMPTE-170M
8670
8671 smpte240m
8672 SMPTE-240M
8673
8674 bt2020
8675 BT.2020
8676
8677 For example to convert from BT.601 to SMPTE-240M, use the command:
8678
8679 colormatrix=bt601:smpte240m
8680
8681 colorspace
8682 Convert colorspace, transfer characteristics or color primaries. Input
8683 video needs to have an even size.
8684
8685 The filter accepts the following options:
8686
8687 all Specify all color properties at once.
8688
8689 The accepted values are:
8690
8691 bt470m
8692 BT.470M
8693
8694 bt470bg
8695 BT.470BG
8696
8697 bt601-6-525
8698 BT.601-6 525
8699
8700 bt601-6-625
8701 BT.601-6 625
8702
8703 bt709
8704 BT.709
8705
8706 smpte170m
8707 SMPTE-170M
8708
8709 smpte240m
8710 SMPTE-240M
8711
8712 bt2020
8713 BT.2020
8714
8715 space
8716 Specify output colorspace.
8717
8718 The accepted values are:
8719
8720 bt709
8721 BT.709
8722
8723 fcc FCC
8724
8725 bt470bg
8726 BT.470BG or BT.601-6 625
8727
8728 smpte170m
8729 SMPTE-170M or BT.601-6 525
8730
8731 smpte240m
8732 SMPTE-240M
8733
8734 ycgco
8735 YCgCo
8736
8737 bt2020ncl
8738 BT.2020 with non-constant luminance
8739
8740 trc Specify output transfer characteristics.
8741
8742 The accepted values are:
8743
8744 bt709
8745 BT.709
8746
8747 bt470m
8748 BT.470M
8749
8750 bt470bg
8751 BT.470BG
8752
8753 gamma22
8754 Constant gamma of 2.2
8755
8756 gamma28
8757 Constant gamma of 2.8
8758
8759 smpte170m
8760 SMPTE-170M, BT.601-6 625 or BT.601-6 525
8761
8762 smpte240m
8763 SMPTE-240M
8764
8765 srgb
8766 SRGB
8767
8768 iec61966-2-1
8769 iec61966-2-1
8770
8771 iec61966-2-4
8772 iec61966-2-4
8773
8774 xvycc
8775 xvycc
8776
8777 bt2020-10
8778 BT.2020 for 10-bits content
8779
8780 bt2020-12
8781 BT.2020 for 12-bits content
8782
8783 primaries
8784 Specify output color primaries.
8785
8786 The accepted values are:
8787
8788 bt709
8789 BT.709
8790
8791 bt470m
8792 BT.470M
8793
8794 bt470bg
8795 BT.470BG or BT.601-6 625
8796
8797 smpte170m
8798 SMPTE-170M or BT.601-6 525
8799
8800 smpte240m
8801 SMPTE-240M
8802
8803 film
8804 film
8805
8806 smpte431
8807 SMPTE-431
8808
8809 smpte432
8810 SMPTE-432
8811
8812 bt2020
8813 BT.2020
8814
8815 jedec-p22
8816 JEDEC P22 phosphors
8817
8818 range
8819 Specify output color range.
8820
8821 The accepted values are:
8822
8823 tv TV (restricted) range
8824
8825 mpeg
8826 MPEG (restricted) range
8827
8828 pc PC (full) range
8829
8830 jpeg
8831 JPEG (full) range
8832
8833 format
8834 Specify output color format.
8835
8836 The accepted values are:
8837
8838 yuv420p
8839 YUV 4:2:0 planar 8-bits
8840
8841 yuv420p10
8842 YUV 4:2:0 planar 10-bits
8843
8844 yuv420p12
8845 YUV 4:2:0 planar 12-bits
8846
8847 yuv422p
8848 YUV 4:2:2 planar 8-bits
8849
8850 yuv422p10
8851 YUV 4:2:2 planar 10-bits
8852
8853 yuv422p12
8854 YUV 4:2:2 planar 12-bits
8855
8856 yuv444p
8857 YUV 4:4:4 planar 8-bits
8858
8859 yuv444p10
8860 YUV 4:4:4 planar 10-bits
8861
8862 yuv444p12
8863 YUV 4:4:4 planar 12-bits
8864
8865 fast
8866 Do a fast conversion, which skips gamma/primary correction. This
8867 will take significantly less CPU, but will be mathematically
8868 incorrect. To get output compatible with that produced by the
8869 colormatrix filter, use fast=1.
8870
8871 dither
8872 Specify dithering mode.
8873
8874 The accepted values are:
8875
8876 none
8877 No dithering
8878
8879 fsb Floyd-Steinberg dithering
8880
8881 wpadapt
8882 Whitepoint adaptation mode.
8883
8884 The accepted values are:
8885
8886 bradford
8887 Bradford whitepoint adaptation
8888
8889 vonkries
8890 von Kries whitepoint adaptation
8891
8892 identity
8893 identity whitepoint adaptation (i.e. no whitepoint adaptation)
8894
8895 iall
8896 Override all input properties at once. Same accepted values as all.
8897
8898 ispace
8899 Override input colorspace. Same accepted values as space.
8900
8901 iprimaries
8902 Override input color primaries. Same accepted values as primaries.
8903
8904 itrc
8905 Override input transfer characteristics. Same accepted values as
8906 trc.
8907
8908 irange
8909 Override input color range. Same accepted values as range.
8910
8911 The filter converts the transfer characteristics, color space and color
8912 primaries to the specified user values. The output value, if not
8913 specified, is set to a default value based on the "all" property. If
8914 that property is also not specified, the filter will log an error. The
8915 output color range and format default to the same value as the input
8916 color range and format. The input transfer characteristics, color
8917 space, color primaries and color range should be set on the input data.
8918 If any of these are missing, the filter will log an error and no
8919 conversion will take place.
8920
8921 For example to convert the input to SMPTE-240M, use the command:
8922
8923 colorspace=smpte240m
8924
8925 colorspace_cuda
8926 CUDA accelerated implementation of the colorspace filter.
8927
8928 It is by no means feature complete compared to the software colorspace
8929 filter, and at the current time only supports color range conversion
8930 between jpeg/full and mpeg/limited range.
8931
8932 The filter accepts the following options:
8933
8934 range
8935 Specify output color range.
8936
8937 The accepted values are:
8938
8939 tv TV (restricted) range
8940
8941 mpeg
8942 MPEG (restricted) range
8943
8944 pc PC (full) range
8945
8946 jpeg
8947 JPEG (full) range
8948
8949 colortemperature
8950 Adjust color temperature in video to simulate variations in ambient
8951 color temperature.
8952
8953 The filter accepts the following options:
8954
8955 temperature
8956 Set the temperature in Kelvin. Allowed range is from 1000 to 40000.
8957 Default value is 6500 K.
8958
8959 mix Set mixing with filtered output. Allowed range is from 0 to 1.
8960 Default value is 1.
8961
8962 pl Set the amount of preserving lightness. Allowed range is from 0 to
8963 1. Default value is 0.
8964
8965 Commands
8966
8967 This filter supports same commands as options.
8968
8969 convolution
8970 Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49
8971 elements.
8972
8973 The filter accepts the following options:
8974
8975 0m
8976 1m
8977 2m
8978 3m Set matrix for each plane. Matrix is sequence of 9, 25 or 49
8979 signed integers in square mode, and from 1 to 49 odd number of
8980 signed integers in row mode.
8981
8982 0rdiv
8983 1rdiv
8984 2rdiv
8985 3rdiv
8986 Set multiplier for calculated value for each plane. If unset or 0,
8987 it will be sum of all matrix elements.
8988
8989 0bias
8990 1bias
8991 2bias
8992 3bias
8993 Set bias for each plane. This value is added to the result of the
8994 multiplication. Useful for making the overall image brighter or
8995 darker. Default is 0.0.
8996
8997 0mode
8998 1mode
8999 2mode
9000 3mode
9001 Set matrix mode for each plane. Can be square, row or column.
9002 Default is square.
9003
9004 Commands
9005
9006 This filter supports the all above options as commands.
9007
9008 Examples
9009
9010 • Apply sharpen:
9011
9012 convolution="0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0"
9013
9014 • Apply blur:
9015
9016 convolution="1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9"
9017
9018 • Apply edge enhance:
9019
9020 convolution="0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128"
9021
9022 • Apply edge detect:
9023
9024 convolution="0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128"
9025
9026 • Apply laplacian edge detector which includes diagonals:
9027
9028 convolution="1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0"
9029
9030 • Apply emboss:
9031
9032 convolution="-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2"
9033
9034 convolve
9035 Apply 2D convolution of video stream in frequency domain using second
9036 stream as impulse.
9037
9038 The filter accepts the following options:
9039
9040 planes
9041 Set which planes to process.
9042
9043 impulse
9044 Set which impulse video frames will be processed, can be first or
9045 all. Default is all.
9046
9047 The "convolve" filter also supports the framesync options.
9048
9049 copy
9050 Copy the input video source unchanged to the output. This is mainly
9051 useful for testing purposes.
9052
9053 coreimage
9054 Video filtering on GPU using Apple's CoreImage API on OSX.
9055
9056 Hardware acceleration is based on an OpenGL context. Usually, this
9057 means it is processed by video hardware. However, software-based OpenGL
9058 implementations exist which means there is no guarantee for hardware
9059 processing. It depends on the respective OSX.
9060
9061 There are many filters and image generators provided by Apple that come
9062 with a large variety of options. The filter has to be referenced by its
9063 name along with its options.
9064
9065 The coreimage filter accepts the following options:
9066
9067 list_filters
9068 List all available filters and generators along with all their
9069 respective options as well as possible minimum and maximum values
9070 along with the default values.
9071
9072 list_filters=true
9073
9074 filter
9075 Specify all filters by their respective name and options. Use
9076 list_filters to determine all valid filter names and options.
9077 Numerical options are specified by a float value and are
9078 automatically clamped to their respective value range. Vector and
9079 color options have to be specified by a list of space separated
9080 float values. Character escaping has to be done. A special option
9081 name "default" is available to use default options for a filter.
9082
9083 It is required to specify either "default" or at least one of the
9084 filter options. All omitted options are used with their default
9085 values. The syntax of the filter string is as follows:
9086
9087 filter=<NAME>@<OPTION>=<VALUE>[@<OPTION>=<VALUE>][@...][#<NAME>@<OPTION>=<VALUE>[@<OPTION>=<VALUE>][@...]][#...]
9088
9089 output_rect
9090 Specify a rectangle where the output of the filter chain is copied
9091 into the input image. It is given by a list of space separated
9092 float values:
9093
9094 output_rect=x\ y\ width\ height
9095
9096 If not given, the output rectangle equals the dimensions of the
9097 input image. The output rectangle is automatically cropped at the
9098 borders of the input image. Negative values are valid for each
9099 component.
9100
9101 output_rect=25\ 25\ 100\ 100
9102
9103 Several filters can be chained for successive processing without GPU-
9104 HOST transfers allowing for fast processing of complex filter chains.
9105 Currently, only filters with zero (generators) or exactly one (filters)
9106 input image and one output image are supported. Also, transition
9107 filters are not yet usable as intended.
9108
9109 Some filters generate output images with additional padding depending
9110 on the respective filter kernel. The padding is automatically removed
9111 to ensure the filter output has the same size as the input image.
9112
9113 For image generators, the size of the output image is determined by the
9114 previous output image of the filter chain or the input image of the
9115 whole filterchain, respectively. The generators do not use the pixel
9116 information of this image to generate their output. However, the
9117 generated output is blended onto this image, resulting in partial or
9118 complete coverage of the output image.
9119
9120 The coreimagesrc video source can be used for generating input images
9121 which are directly fed into the filter chain. By using it, providing
9122 input images by another video source or an input video is not required.
9123
9124 Examples
9125
9126 • List all filters available:
9127
9128 coreimage=list_filters=true
9129
9130 • Use the CIBoxBlur filter with default options to blur an image:
9131
9132 coreimage=filter=CIBoxBlur@default
9133
9134 • Use a filter chain with CISepiaTone at default values and
9135 CIVignetteEffect with its center at 100x100 and a radius of 50
9136 pixels:
9137
9138 coreimage=filter=CIBoxBlur@default#CIVignetteEffect@inputCenter=100\ 100@inputRadius=50
9139
9140 • Use nullsrc and CIQRCodeGenerator to create a QR code for the
9141 FFmpeg homepage, given as complete and escaped command-line for
9142 Apple's standard bash shell:
9143
9144 ffmpeg -f lavfi -i nullsrc=s=100x100,coreimage=filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
9145
9146 corr
9147 Obtain the correlation between two input videos.
9148
9149 This filter takes two input videos.
9150
9151 Both input videos must have the same resolution and pixel format for
9152 this filter to work correctly. Also it assumes that both inputs have
9153 the same number of frames, which are compared one by one.
9154
9155 The obtained per component, average, min and max correlation is printed
9156 through the logging system.
9157
9158 The filter stores the calculated correlation of each frame in frame
9159 metadata.
9160
9161 This filter also supports the framesync options.
9162
9163 In the below example the input file main.mpg being processed is
9164 compared with the reference file ref.mpg.
9165
9166 ffmpeg -i main.mpg -i ref.mpg -lavfi corr -f null -
9167
9168 cover_rect
9169 Cover a rectangular object
9170
9171 It accepts the following options:
9172
9173 cover
9174 Filepath of the optional cover image, needs to be in yuv420.
9175
9176 mode
9177 Set covering mode.
9178
9179 It accepts the following values:
9180
9181 cover
9182 cover it by the supplied image
9183
9184 blur
9185 cover it by interpolating the surrounding pixels
9186
9187 Default value is blur.
9188
9189 Examples
9190
9191 • Cover a rectangular object by the supplied image of a given video
9192 using ffmpeg:
9193
9194 ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
9195
9196 crop
9197 Crop the input video to given dimensions.
9198
9199 It accepts the following parameters:
9200
9201 w, out_w
9202 The width of the output video. It defaults to "iw". This
9203 expression is evaluated only once during the filter configuration,
9204 or when the w or out_w command is sent.
9205
9206 h, out_h
9207 The height of the output video. It defaults to "ih". This
9208 expression is evaluated only once during the filter configuration,
9209 or when the h or out_h command is sent.
9210
9211 x The horizontal position, in the input video, of the left edge of
9212 the output video. It defaults to "(in_w-out_w)/2". This expression
9213 is evaluated per-frame.
9214
9215 y The vertical position, in the input video, of the top edge of the
9216 output video. It defaults to "(in_h-out_h)/2". This expression is
9217 evaluated per-frame.
9218
9219 keep_aspect
9220 If set to 1 will force the output display aspect ratio to be the
9221 same of the input, by changing the output sample aspect ratio. It
9222 defaults to 0.
9223
9224 exact
9225 Enable exact cropping. If enabled, subsampled videos will be
9226 cropped at exact width/height/x/y as specified and will not be
9227 rounded to nearest smaller value. It defaults to 0.
9228
9229 The out_w, out_h, x, y parameters are expressions containing the
9230 following constants:
9231
9232 x
9233 y The computed values for x and y. They are evaluated for each new
9234 frame.
9235
9236 in_w
9237 in_h
9238 The input width and height.
9239
9240 iw
9241 ih These are the same as in_w and in_h.
9242
9243 out_w
9244 out_h
9245 The output (cropped) width and height.
9246
9247 ow
9248 oh These are the same as out_w and out_h.
9249
9250 a same as iw / ih
9251
9252 sar input sample aspect ratio
9253
9254 dar input display aspect ratio, it is the same as (iw / ih) * sar
9255
9256 hsub
9257 vsub
9258 horizontal and vertical chroma subsample values. For example for
9259 the pixel format "yuv422p" hsub is 2 and vsub is 1.
9260
9261 n The number of the input frame, starting from 0.
9262
9263 pos the position in the file of the input frame, NAN if unknown
9264
9265 t The timestamp expressed in seconds. It's NAN if the input timestamp
9266 is unknown.
9267
9268 The expression for out_w may depend on the value of out_h, and the
9269 expression for out_h may depend on out_w, but they cannot depend on x
9270 and y, as x and y are evaluated after out_w and out_h.
9271
9272 The x and y parameters specify the expressions for the position of the
9273 top-left corner of the output (non-cropped) area. They are evaluated
9274 for each frame. If the evaluated value is not valid, it is approximated
9275 to the nearest valid value.
9276
9277 The expression for x may depend on y, and the expression for y may
9278 depend on x.
9279
9280 Examples
9281
9282 • Crop area with size 100x100 at position (12,34).
9283
9284 crop=100:100:12:34
9285
9286 Using named options, the example above becomes:
9287
9288 crop=w=100:h=100:x=12:y=34
9289
9290 • Crop the central input area with size 100x100:
9291
9292 crop=100:100
9293
9294 • Crop the central input area with size 2/3 of the input video:
9295
9296 crop=2/3*in_w:2/3*in_h
9297
9298 • Crop the input video central square:
9299
9300 crop=out_w=in_h
9301 crop=in_h
9302
9303 • Delimit the rectangle with the top-left corner placed at position
9304 100:100 and the right-bottom corner corresponding to the right-
9305 bottom corner of the input image.
9306
9307 crop=in_w-100:in_h-100:100:100
9308
9309 • Crop 10 pixels from the left and right borders, and 20 pixels from
9310 the top and bottom borders
9311
9312 crop=in_w-2*10:in_h-2*20
9313
9314 • Keep only the bottom right quarter of the input image:
9315
9316 crop=in_w/2:in_h/2:in_w/2:in_h/2
9317
9318 • Crop height for getting Greek harmony:
9319
9320 crop=in_w:1/PHI*in_w
9321
9322 • Apply trembling effect:
9323
9324 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)
9325
9326 • Apply erratic camera effect depending on timestamp:
9327
9328 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)"
9329
9330 • Set x depending on the value of y:
9331
9332 crop=in_w/2:in_h/2:y:10+10*sin(n/10)
9333
9334 Commands
9335
9336 This filter supports the following commands:
9337
9338 w, out_w
9339 h, out_h
9340 x
9341 y Set width/height of the output video and the horizontal/vertical
9342 position in the input video. The command accepts the same syntax
9343 of the corresponding option.
9344
9345 If the specified expression is not valid, it is kept at its current
9346 value.
9347
9348 cropdetect
9349 Auto-detect the crop size.
9350
9351 It calculates the necessary cropping parameters and prints the
9352 recommended parameters via the logging system. The detected dimensions
9353 correspond to the non-black or video area of the input video according
9354 to mode.
9355
9356 It accepts the following parameters:
9357
9358 mode
9359 Depending on mode crop detection is based on either the mere black
9360 value of surrounding pixels or a combination of motion vectors and
9361 edge pixels.
9362
9363 black
9364 Detect black pixels surrounding the playing video. For fine
9365 control use option limit.
9366
9367 mvedges
9368 Detect the playing video by the motion vectors inside the video
9369 and scanning for edge pixels typically forming the border of a
9370 playing video.
9371
9372 limit
9373 Set higher black value threshold, which can be optionally specified
9374 from nothing (0) to everything (255 for 8-bit based formats). An
9375 intensity value greater to the set value is considered non-black.
9376 It defaults to 24. You can also specify a value between 0.0 and
9377 1.0 which will be scaled depending on the bitdepth of the pixel
9378 format.
9379
9380 round
9381 The value which the width/height should be divisible by. It
9382 defaults to 16. The offset is automatically adjusted to center the
9383 video. Use 2 to get only even dimensions (needed for 4:2:2 video).
9384 16 is best when encoding to most video codecs.
9385
9386 skip
9387 Set the number of initial frames for which evaluation is skipped.
9388 Default is 2. Range is 0 to INT_MAX.
9389
9390 reset_count, reset
9391 Set the counter that determines after how many frames cropdetect
9392 will reset the previously detected largest video area and start
9393 over to detect the current optimal crop area. Default value is 0.
9394
9395 This can be useful when channel logos distort the video area. 0
9396 indicates 'never reset', and returns the largest area encountered
9397 during playback.
9398
9399 mv_threshold
9400 Set motion in pixel units as threshold for motion detection. It
9401 defaults to 8.
9402
9403 low
9404 high
9405 Set low and high threshold values used by the Canny thresholding
9406 algorithm.
9407
9408 The high threshold selects the "strong" edge pixels, which are then
9409 connected through 8-connectivity with the "weak" edge pixels
9410 selected by the low threshold.
9411
9412 low and high threshold values must be chosen in the range [0,1],
9413 and low should be lesser or equal to high.
9414
9415 Default value for low is "5/255", and default value for high is
9416 "15/255".
9417
9418 Examples
9419
9420 • Find video area surrounded by black borders:
9421
9422 ffmpeg -i file.mp4 -vf cropdetect,metadata=mode=print -f null -
9423
9424 • Find an embedded video area, generate motion vectors beforehand:
9425
9426 ffmpeg -i file.mp4 -vf mestimate,cropdetect=mode=mvedges,metadata=mode=print -f null -
9427
9428 • Find an embedded video area, use motion vectors from decoder:
9429
9430 ffmpeg -flags2 +export_mvs -i file.mp4 -vf cropdetect=mode=mvedges,metadata=mode=print -f null -
9431
9432 Commands
9433
9434 This filter supports the following commands:
9435
9436 limit
9437 The command accepts the same syntax of the corresponding option.
9438 If the specified expression is not valid, it is kept at its current
9439 value.
9440
9441 cue
9442 Delay video filtering until a given wallclock timestamp. The filter
9443 first passes on preroll amount of frames, then it buffers at most
9444 buffer amount of frames and waits for the cue. After reaching the cue
9445 it forwards the buffered frames and also any subsequent frames coming
9446 in its input.
9447
9448 The filter can be used synchronize the output of multiple ffmpeg
9449 processes for realtime output devices like decklink. By putting the
9450 delay in the filtering chain and pre-buffering frames the process can
9451 pass on data to output almost immediately after the target wallclock
9452 timestamp is reached.
9453
9454 Perfect frame accuracy cannot be guaranteed, but the result is good
9455 enough for some use cases.
9456
9457 cue The cue timestamp expressed in a UNIX timestamp in microseconds.
9458 Default is 0.
9459
9460 preroll
9461 The duration of content to pass on as preroll expressed in seconds.
9462 Default is 0.
9463
9464 buffer
9465 The maximum duration of content to buffer before waiting for the
9466 cue expressed in seconds. Default is 0.
9467
9468 curves
9469 Apply color adjustments using curves.
9470
9471 This filter is similar to the Adobe Photoshop and GIMP curves tools.
9472 Each component (red, green and blue) has its values defined by N key
9473 points tied from each other using a smooth curve. The x-axis represents
9474 the pixel values from the input frame, and the y-axis the new pixel
9475 values to be set for the output frame.
9476
9477 By default, a component curve is defined by the two points (0;0) and
9478 (1;1). This creates a straight line where each original pixel value is
9479 "adjusted" to its own value, which means no change to the image.
9480
9481 The filter allows you to redefine these two points and add some more. A
9482 new curve will be define to pass smoothly through all these new
9483 coordinates. The new defined points needs to be strictly increasing
9484 over the x-axis, and their x and y values must be in the [0;1]
9485 interval. The curve is formed by using a natural or monotonic cubic
9486 spline interpolation, depending on the interp option (default:
9487 "natural"). The "natural" spline produces a smoother curve in general
9488 while the monotonic ("pchip") spline guarantees the transitions between
9489 the specified points to be monotonic. If the computed curves happened
9490 to go outside the vector spaces, the values will be clipped
9491 accordingly.
9492
9493 The filter accepts the following options:
9494
9495 preset
9496 Select one of the available color presets. This option can be used
9497 in addition to the r, g, b parameters; in this case, the later
9498 options takes priority on the preset values. Available presets
9499 are:
9500
9501 none
9502 color_negative
9503 cross_process
9504 darker
9505 increase_contrast
9506 lighter
9507 linear_contrast
9508 medium_contrast
9509 negative
9510 strong_contrast
9511 vintage
9512
9513 Default is "none".
9514
9515 master, m
9516 Set the master key points. These points will define a second pass
9517 mapping. It is sometimes called a "luminance" or "value" mapping.
9518 It can be used with r, g, b or all since it acts like a post-
9519 processing LUT.
9520
9521 red, r
9522 Set the key points for the red component.
9523
9524 green, g
9525 Set the key points for the green component.
9526
9527 blue, b
9528 Set the key points for the blue component.
9529
9530 all Set the key points for all components (not including master). Can
9531 be used in addition to the other key points component options. In
9532 this case, the unset component(s) will fallback on this all
9533 setting.
9534
9535 psfile
9536 Specify a Photoshop curves file (".acv") to import the settings
9537 from.
9538
9539 plot
9540 Save Gnuplot script of the curves in specified file.
9541
9542 interp
9543 Specify the kind of interpolation. Available algorithms are:
9544
9545 natural
9546 Natural cubic spline using a piece-wise cubic polynomial that
9547 is twice continuously differentiable.
9548
9549 pchip
9550 Monotonic cubic spline using a piecewise cubic Hermite
9551 interpolating polynomial (PCHIP).
9552
9553 To avoid some filtergraph syntax conflicts, each key points list need
9554 to be defined using the following syntax: "x0/y0 x1/y1 x2/y2 ...".
9555
9556 Commands
9557
9558 This filter supports same commands as options.
9559
9560 Examples
9561
9562 • Increase slightly the middle level of blue:
9563
9564 curves=blue='0/0 0.5/0.58 1/1'
9565
9566 • Vintage effect:
9567
9568 curves=r='0/0.11 .42/.51 1/0.95':g='0/0 0.50/0.48 1/1':b='0/0.22 .49/.44 1/0.8'
9569
9570 Here we obtain the following coordinates for each components:
9571
9572 red "(0;0.11) (0.42;0.51) (1;0.95)"
9573
9574 green
9575 "(0;0) (0.50;0.48) (1;1)"
9576
9577 blue
9578 "(0;0.22) (0.49;0.44) (1;0.80)"
9579
9580 • The previous example can also be achieved with the associated
9581 built-in preset:
9582
9583 curves=preset=vintage
9584
9585 • Or simply:
9586
9587 curves=vintage
9588
9589 • Use a Photoshop preset and redefine the points of the green
9590 component:
9591
9592 curves=psfile='MyCurvesPresets/purple.acv':green='0/0 0.45/0.53 1/1'
9593
9594 • Check out the curves of the "cross_process" profile using ffmpeg
9595 and gnuplot:
9596
9597 ffmpeg -f lavfi -i color -vf curves=cross_process:plot=/tmp/curves.plt -frames:v 1 -f null -
9598 gnuplot -p /tmp/curves.plt
9599
9600 datascope
9601 Video data analysis filter.
9602
9603 This filter shows hexadecimal pixel values of part of video.
9604
9605 The filter accepts the following options:
9606
9607 size, s
9608 Set output video size.
9609
9610 x Set x offset from where to pick pixels.
9611
9612 y Set y offset from where to pick pixels.
9613
9614 mode
9615 Set scope mode, can be one of the following:
9616
9617 mono
9618 Draw hexadecimal pixel values with white color on black
9619 background.
9620
9621 color
9622 Draw hexadecimal pixel values with input video pixel color on
9623 black background.
9624
9625 color2
9626 Draw hexadecimal pixel values on color background picked from
9627 input video, the text color is picked in such way so its always
9628 visible.
9629
9630 axis
9631 Draw rows and columns numbers on left and top of video.
9632
9633 opacity
9634 Set background opacity.
9635
9636 format
9637 Set display number format. Can be "hex", or "dec". Default is
9638 "hex".
9639
9640 components
9641 Set pixel components to display. By default all pixel components
9642 are displayed.
9643
9644 Commands
9645
9646 This filter supports same commands as options excluding "size" option.
9647
9648 dblur
9649 Apply Directional blur filter.
9650
9651 The filter accepts the following options:
9652
9653 angle
9654 Set angle of directional blur. Default is 45.
9655
9656 radius
9657 Set radius of directional blur. Default is 5.
9658
9659 planes
9660 Set which planes to filter. By default all planes are filtered.
9661
9662 Commands
9663
9664 This filter supports same commands as options. The command accepts the
9665 same syntax of the corresponding option.
9666
9667 If the specified expression is not valid, it is kept at its current
9668 value.
9669
9670 dctdnoiz
9671 Denoise frames using 2D DCT (frequency domain filtering).
9672
9673 This filter is not designed for real time.
9674
9675 The filter accepts the following options:
9676
9677 sigma, s
9678 Set the noise sigma constant.
9679
9680 This sigma defines a hard threshold of "3 * sigma"; every DCT
9681 coefficient (absolute value) below this threshold with be dropped.
9682
9683 If you need a more advanced filtering, see expr.
9684
9685 Default is 0.
9686
9687 overlap
9688 Set number overlapping pixels for each block. Since the filter can
9689 be slow, you may want to reduce this value, at the cost of a less
9690 effective filter and the risk of various artefacts.
9691
9692 If the overlapping value doesn't permit processing the whole input
9693 width or height, a warning will be displayed and according borders
9694 won't be denoised.
9695
9696 Default value is blocksize-1, which is the best possible setting.
9697
9698 expr, e
9699 Set the coefficient factor expression.
9700
9701 For each coefficient of a DCT block, this expression will be
9702 evaluated as a multiplier value for the coefficient.
9703
9704 If this is option is set, the sigma option will be ignored.
9705
9706 The absolute value of the coefficient can be accessed through the c
9707 variable.
9708
9709 n Set the blocksize using the number of bits. "1<<n" defines the
9710 blocksize, which is the width and height of the processed blocks.
9711
9712 The default value is 3 (8x8) and can be raised to 4 for a blocksize
9713 of 16x16. Note that changing this setting has huge consequences on
9714 the speed processing. Also, a larger block size does not
9715 necessarily means a better de-noising.
9716
9717 Examples
9718
9719 Apply a denoise with a sigma of 4.5:
9720
9721 dctdnoiz=4.5
9722
9723 The same operation can be achieved using the expression system:
9724
9725 dctdnoiz=e='gte(c, 4.5*3)'
9726
9727 Violent denoise using a block size of "16x16":
9728
9729 dctdnoiz=15:n=4
9730
9731 deband
9732 Remove banding artifacts from input video. It works by replacing
9733 banded pixels with average value of referenced pixels.
9734
9735 The filter accepts the following options:
9736
9737 1thr
9738 2thr
9739 3thr
9740 4thr
9741 Set banding detection threshold for each plane. Default is 0.02.
9742 Valid range is 0.00003 to 0.5. If difference between current pixel
9743 and reference pixel is less than threshold, it will be considered
9744 as banded.
9745
9746 range, r
9747 Banding detection range in pixels. Default is 16. If positive,
9748 random number in range 0 to set value will be used. If negative,
9749 exact absolute value will be used. The range defines square of
9750 four pixels around current pixel.
9751
9752 direction, d
9753 Set direction in radians from which four pixel will be compared. If
9754 positive, random direction from 0 to set direction will be picked.
9755 If negative, exact of absolute value will be picked. For example
9756 direction 0, -PI or -2*PI radians will pick only pixels on same row
9757 and -PI/2 will pick only pixels on same column.
9758
9759 blur, b
9760 If enabled, current pixel is compared with average value of all
9761 four surrounding pixels. The default is enabled. If disabled
9762 current pixel is compared with all four surrounding pixels. The
9763 pixel is considered banded if only all four differences with
9764 surrounding pixels are less than threshold.
9765
9766 coupling, c
9767 If enabled, current pixel is changed if and only if all pixel
9768 components are banded, e.g. banding detection threshold is
9769 triggered for all color components. The default is disabled.
9770
9771 Commands
9772
9773 This filter supports the all above options as commands.
9774
9775 deblock
9776 Remove blocking artifacts from input video.
9777
9778 The filter accepts the following options:
9779
9780 filter
9781 Set filter type, can be weak or strong. Default is strong. This
9782 controls what kind of deblocking is applied.
9783
9784 block
9785 Set size of block, allowed range is from 4 to 512. Default is 8.
9786
9787 alpha
9788 beta
9789 gamma
9790 delta
9791 Set blocking detection thresholds. Allowed range is 0 to 1.
9792 Defaults are: 0.098 for alpha and 0.05 for the rest. Using higher
9793 threshold gives more deblocking strength. Setting alpha controls
9794 threshold detection at exact edge of block. Remaining options
9795 controls threshold detection near the edge. Each one for
9796 below/above or left/right. Setting any of those to 0 disables
9797 deblocking.
9798
9799 planes
9800 Set planes to filter. Default is to filter all available planes.
9801
9802 Examples
9803
9804 • Deblock using weak filter and block size of 4 pixels.
9805
9806 deblock=filter=weak:block=4
9807
9808 • Deblock using strong filter, block size of 4 pixels and custom
9809 thresholds for deblocking more edges.
9810
9811 deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05
9812
9813 • Similar as above, but filter only first plane.
9814
9815 deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=1
9816
9817 • Similar as above, but filter only second and third plane.
9818
9819 deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=6
9820
9821 Commands
9822
9823 This filter supports the all above options as commands.
9824
9825 decimate
9826 Drop duplicated frames at regular intervals.
9827
9828 The filter accepts the following options:
9829
9830 cycle
9831 Set the number of frames from which one will be dropped. Setting
9832 this to N means one frame in every batch of N frames will be
9833 dropped. Default is 5.
9834
9835 dupthresh
9836 Set the threshold for duplicate detection. If the difference metric
9837 for a frame is less than or equal to this value, then it is
9838 declared as duplicate. Default is 1.1
9839
9840 scthresh
9841 Set scene change threshold. Default is 15.
9842
9843 blockx
9844 blocky
9845 Set the size of the x and y-axis blocks used during metric
9846 calculations. Larger blocks give better noise suppression, but
9847 also give worse detection of small movements. Must be a power of
9848 two. Default is 32.
9849
9850 ppsrc
9851 Mark main input as a pre-processed input and activate clean source
9852 input stream. This allows the input to be pre-processed with
9853 various filters to help the metrics calculation while keeping the
9854 frame selection lossless. When set to 1, the first stream is for
9855 the pre-processed input, and the second stream is the clean source
9856 from where the kept frames are chosen. Default is 0.
9857
9858 chroma
9859 Set whether or not chroma is considered in the metric calculations.
9860 Default is 1.
9861
9862 mixed
9863 Set whether or not the input only partially contains content to be
9864 decimated. Default is "false". If enabled video output stream
9865 will be in variable frame rate.
9866
9867 deconvolve
9868 Apply 2D deconvolution of video stream in frequency domain using second
9869 stream as impulse.
9870
9871 The filter accepts the following options:
9872
9873 planes
9874 Set which planes to process.
9875
9876 impulse
9877 Set which impulse video frames will be processed, can be first or
9878 all. Default is all.
9879
9880 noise
9881 Set noise when doing divisions. Default is 0.0000001. Useful when
9882 width and height are not same and not power of 2 or if stream prior
9883 to convolving had noise.
9884
9885 The "deconvolve" filter also supports the framesync options.
9886
9887 dedot
9888 Reduce cross-luminance (dot-crawl) and cross-color (rainbows) from
9889 video.
9890
9891 It accepts the following options:
9892
9893 m Set mode of operation. Can be combination of dotcrawl for cross-
9894 luminance reduction and/or rainbows for cross-color reduction.
9895
9896 lt Set spatial luma threshold. Lower values increases reduction of
9897 cross-luminance.
9898
9899 tl Set tolerance for temporal luma. Higher values increases reduction
9900 of cross-luminance.
9901
9902 tc Set tolerance for chroma temporal variation. Higher values
9903 increases reduction of cross-color.
9904
9905 ct Set temporal chroma threshold. Lower values increases reduction of
9906 cross-color.
9907
9908 deflate
9909 Apply deflate effect to the video.
9910
9911 This filter replaces the pixel by the local(3x3) average by taking into
9912 account only values lower than the pixel.
9913
9914 It accepts the following options:
9915
9916 threshold0
9917 threshold1
9918 threshold2
9919 threshold3
9920 Limit the maximum change for each plane, default is 65535. If 0,
9921 plane will remain unchanged.
9922
9923 Commands
9924
9925 This filter supports the all above options as commands.
9926
9927 deflicker
9928 Remove temporal frame luminance variations.
9929
9930 It accepts the following options:
9931
9932 size, s
9933 Set moving-average filter size in frames. Default is 5. Allowed
9934 range is 2 - 129.
9935
9936 mode, m
9937 Set averaging mode to smooth temporal luminance variations.
9938
9939 Available values are:
9940
9941 am Arithmetic mean
9942
9943 gm Geometric mean
9944
9945 hm Harmonic mean
9946
9947 qm Quadratic mean
9948
9949 cm Cubic mean
9950
9951 pm Power mean
9952
9953 median
9954 Median
9955
9956 bypass
9957 Do not actually modify frame. Useful when one only wants metadata.
9958
9959 dejudder
9960 Remove judder produced by partially interlaced telecined content.
9961
9962 Judder can be introduced, for instance, by pullup filter. If the
9963 original source was partially telecined content then the output of
9964 "pullup,dejudder" will have a variable frame rate. May change the
9965 recorded frame rate of the container. Aside from that change, this
9966 filter will not affect constant frame rate video.
9967
9968 The option available in this filter is:
9969
9970 cycle
9971 Specify the length of the window over which the judder repeats.
9972
9973 Accepts any integer greater than 1. Useful values are:
9974
9975 4 If the original was telecined from 24 to 30 fps (Film to NTSC).
9976
9977 5 If the original was telecined from 25 to 30 fps (PAL to NTSC).
9978
9979 20 If a mixture of the two.
9980
9981 The default is 4.
9982
9983 delogo
9984 Suppress a TV station logo by a simple interpolation of the surrounding
9985 pixels. Just set a rectangle covering the logo and watch it disappear
9986 (and sometimes something even uglier appear - your mileage may vary).
9987
9988 It accepts the following parameters:
9989
9990 x
9991 y Specify the top left corner coordinates of the logo. They must be
9992 specified.
9993
9994 w
9995 h Specify the width and height of the logo to clear. They must be
9996 specified.
9997
9998 show
9999 When set to 1, a green rectangle is drawn on the screen to simplify
10000 finding the right x, y, w, and h parameters. The default value is
10001 0.
10002
10003 The rectangle is drawn on the outermost pixels which will be
10004 (partly) replaced with interpolated values. The values of the next
10005 pixels immediately outside this rectangle in each direction will be
10006 used to compute the interpolated pixel values inside the rectangle.
10007
10008 Examples
10009
10010 • Set a rectangle covering the area with top left corner coordinates
10011 0,0 and size 100x77:
10012
10013 delogo=x=0:y=0:w=100:h=77
10014
10015 derain
10016 Remove the rain in the input image/video by applying the derain methods
10017 based on convolutional neural networks. Supported models:
10018
10019 • Recurrent Squeeze-and-Excitation Context Aggregation Net (RESCAN).
10020 See
10021 <http://openaccess.thecvf.com/content_ECCV_2018/papers/Xia_Li_Recurrent_Squeeze-and-Excitation_Context_ECCV_2018_paper.pdf>.
10022
10023 Training as well as model generation scripts are provided in the
10024 repository at <https://github.com/XueweiMeng/derain_filter.git>.
10025
10026 Native model files (.model) can be generated from TensorFlow model
10027 files (.pb) by using tools/python/convert.py
10028
10029 The filter accepts the following options:
10030
10031 filter_type
10032 Specify which filter to use. This option accepts the following
10033 values:
10034
10035 derain
10036 Derain filter. To conduct derain filter, you need to use a
10037 derain model.
10038
10039 dehaze
10040 Dehaze filter. To conduct dehaze filter, you need to use a
10041 dehaze model.
10042
10043 Default value is derain.
10044
10045 dnn_backend
10046 Specify which DNN backend to use for model loading and execution.
10047 This option accepts the following values:
10048
10049 native
10050 Native implementation of DNN loading and execution.
10051
10052 tensorflow
10053 TensorFlow backend. To enable this backend you need to install
10054 the TensorFlow for C library (see
10055 <https://www.tensorflow.org/install/lang_c>) and configure
10056 FFmpeg with "--enable-libtensorflow"
10057
10058 Default value is native.
10059
10060 model
10061 Set path to model file specifying network architecture and its
10062 parameters. Note that different backends use different file
10063 formats. TensorFlow and native backend can load files for only its
10064 format.
10065
10066 To get full functionality (such as async execution), please use the
10067 dnn_processing filter.
10068
10069 deshake
10070 Attempt to fix small changes in horizontal and/or vertical shift. This
10071 filter helps remove camera shake from hand-holding a camera, bumping a
10072 tripod, moving on a vehicle, etc.
10073
10074 The filter accepts the following options:
10075
10076 x
10077 y
10078 w
10079 h Specify a rectangular area where to limit the search for motion
10080 vectors. If desired the search for motion vectors can be limited
10081 to a rectangular area of the frame defined by its top left corner,
10082 width and height. These parameters have the same meaning as the
10083 drawbox filter which can be used to visualise the position of the
10084 bounding box.
10085
10086 This is useful when simultaneous movement of subjects within the
10087 frame might be confused for camera motion by the motion vector
10088 search.
10089
10090 If any or all of x, y, w and h are set to -1 then the full frame is
10091 used. This allows later options to be set without specifying the
10092 bounding box for the motion vector search.
10093
10094 Default - search the whole frame.
10095
10096 rx
10097 ry Specify the maximum extent of movement in x and y directions in the
10098 range 0-64 pixels. Default 16.
10099
10100 edge
10101 Specify how to generate pixels to fill blanks at the edge of the
10102 frame. Available values are:
10103
10104 blank, 0
10105 Fill zeroes at blank locations
10106
10107 original, 1
10108 Original image at blank locations
10109
10110 clamp, 2
10111 Extruded edge value at blank locations
10112
10113 mirror, 3
10114 Mirrored edge at blank locations
10115
10116 Default value is mirror.
10117
10118 blocksize
10119 Specify the blocksize to use for motion search. Range 4-128 pixels,
10120 default 8.
10121
10122 contrast
10123 Specify the contrast threshold for blocks. Only blocks with more
10124 than the specified contrast (difference between darkest and
10125 lightest pixels) will be considered. Range 1-255, default 125.
10126
10127 search
10128 Specify the search strategy. Available values are:
10129
10130 exhaustive, 0
10131 Set exhaustive search
10132
10133 less, 1
10134 Set less exhaustive search.
10135
10136 Default value is exhaustive.
10137
10138 filename
10139 If set then a detailed log of the motion search is written to the
10140 specified file.
10141
10142 despill
10143 Remove unwanted contamination of foreground colors, caused by reflected
10144 color of greenscreen or bluescreen.
10145
10146 This filter accepts the following options:
10147
10148 type
10149 Set what type of despill to use.
10150
10151 mix Set how spillmap will be generated.
10152
10153 expand
10154 Set how much to get rid of still remaining spill.
10155
10156 red Controls amount of red in spill area.
10157
10158 green
10159 Controls amount of green in spill area. Should be -1 for
10160 greenscreen.
10161
10162 blue
10163 Controls amount of blue in spill area. Should be -1 for
10164 bluescreen.
10165
10166 brightness
10167 Controls brightness of spill area, preserving colors.
10168
10169 alpha
10170 Modify alpha from generated spillmap.
10171
10172 Commands
10173
10174 This filter supports the all above options as commands.
10175
10176 detelecine
10177 Apply an exact inverse of the telecine operation. It requires a
10178 predefined pattern specified using the pattern option which must be the
10179 same as that passed to the telecine filter.
10180
10181 This filter accepts the following options:
10182
10183 first_field
10184 top, t
10185 top field first
10186
10187 bottom, b
10188 bottom field first The default value is "top".
10189
10190 pattern
10191 A string of numbers representing the pulldown pattern you wish to
10192 apply. The default value is 23.
10193
10194 start_frame
10195 A number representing position of the first frame with respect to
10196 the telecine pattern. This is to be used if the stream is cut. The
10197 default value is 0.
10198
10199 dilation
10200 Apply dilation effect to the video.
10201
10202 This filter replaces the pixel by the local(3x3) maximum.
10203
10204 It accepts the following options:
10205
10206 threshold0
10207 threshold1
10208 threshold2
10209 threshold3
10210 Limit the maximum change for each plane, default is 65535. If 0,
10211 plane will remain unchanged.
10212
10213 coordinates
10214 Flag which specifies the pixel to refer to. Default is 255 i.e. all
10215 eight pixels are used.
10216
10217 Flags to local 3x3 coordinates maps like this:
10218
10219 1 2 3
10220 4 5
10221 6 7 8
10222
10223 Commands
10224
10225 This filter supports the all above options as commands.
10226
10227 displace
10228 Displace pixels as indicated by second and third input stream.
10229
10230 It takes three input streams and outputs one stream, the first input is
10231 the source, and second and third input are displacement maps.
10232
10233 The second input specifies how much to displace pixels along the
10234 x-axis, while the third input specifies how much to displace pixels
10235 along the y-axis. If one of displacement map streams terminates, last
10236 frame from that displacement map will be used.
10237
10238 Note that once generated, displacements maps can be reused over and
10239 over again.
10240
10241 A description of the accepted options follows.
10242
10243 edge
10244 Set displace behavior for pixels that are out of range.
10245
10246 Available values are:
10247
10248 blank
10249 Missing pixels are replaced by black pixels.
10250
10251 smear
10252 Adjacent pixels will spread out to replace missing pixels.
10253
10254 wrap
10255 Out of range pixels are wrapped so they point to pixels of
10256 other side.
10257
10258 mirror
10259 Out of range pixels will be replaced with mirrored pixels.
10260
10261 Default is smear.
10262
10263 Examples
10264
10265 • Add ripple effect to rgb input of video size hd720:
10266
10267 ffmpeg -i INPUT -f lavfi -i nullsrc=s=hd720,lutrgb=128:128:128 -f lavfi -i nullsrc=s=hd720,geq='r=128+30*sin(2*PI*X/400+T):g=128+30*sin(2*PI*X/400+T):b=128+30*sin(2*PI*X/400+T)' -lavfi '[0][1][2]displace' OUTPUT
10268
10269 • Add wave effect to rgb input of video size hd720:
10270
10271 ffmpeg -i INPUT -f lavfi -i nullsrc=hd720,geq='r=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):g=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):b=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T))' -lavfi '[1]split[x][y],[0][x][y]displace' OUTPUT
10272
10273 dnn_classify
10274 Do classification with deep neural networks based on bounding boxes.
10275
10276 The filter accepts the following options:
10277
10278 dnn_backend
10279 Specify which DNN backend to use for model loading and execution.
10280 This option accepts only openvino now, tensorflow backends will be
10281 added.
10282
10283 model
10284 Set path to model file specifying network architecture and its
10285 parameters. Note that different backends use different file
10286 formats.
10287
10288 input
10289 Set the input name of the dnn network.
10290
10291 output
10292 Set the output name of the dnn network.
10293
10294 confidence
10295 Set the confidence threshold (default: 0.5).
10296
10297 labels
10298 Set path to label file specifying the mapping between label id and
10299 name. Each label name is written in one line, tailing spaces and
10300 empty lines are skipped. The first line is the name of label id 0,
10301 and the second line is the name of label id 1, etc. The label id
10302 is considered as name if the label file is not provided.
10303
10304 backend_configs
10305 Set the configs to be passed into backend
10306
10307 For tensorflow backend, you can set its configs with sess_config
10308 options, please use tools/python/tf_sess_config.py to get the
10309 configs for your system.
10310
10311 dnn_detect
10312 Do object detection with deep neural networks.
10313
10314 The filter accepts the following options:
10315
10316 dnn_backend
10317 Specify which DNN backend to use for model loading and execution.
10318 This option accepts only openvino now, tensorflow backends will be
10319 added.
10320
10321 model
10322 Set path to model file specifying network architecture and its
10323 parameters. Note that different backends use different file
10324 formats.
10325
10326 input
10327 Set the input name of the dnn network.
10328
10329 output
10330 Set the output name of the dnn network.
10331
10332 confidence
10333 Set the confidence threshold (default: 0.5).
10334
10335 labels
10336 Set path to label file specifying the mapping between label id and
10337 name. Each label name is written in one line, tailing spaces and
10338 empty lines are skipped. The first line is the name of label id 0
10339 (usually it is 'background'), and the second line is the name of
10340 label id 1, etc. The label id is considered as name if the label
10341 file is not provided.
10342
10343 backend_configs
10344 Set the configs to be passed into backend. To use async execution,
10345 set async (default: set). Roll back to sync execution if the
10346 backend does not support async.
10347
10348 dnn_processing
10349 Do image processing with deep neural networks. It works together with
10350 another filter which converts the pixel format of the Frame to what the
10351 dnn network requires.
10352
10353 The filter accepts the following options:
10354
10355 dnn_backend
10356 Specify which DNN backend to use for model loading and execution.
10357 This option accepts the following values:
10358
10359 native
10360 Native implementation of DNN loading and execution.
10361
10362 tensorflow
10363 TensorFlow backend. To enable this backend you need to install
10364 the TensorFlow for C library (see
10365 <https://www.tensorflow.org/install/lang_c>) and configure
10366 FFmpeg with "--enable-libtensorflow"
10367
10368 openvino
10369 OpenVINO backend. To enable this backend you need to build and
10370 install the OpenVINO for C library (see
10371 <https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md>)
10372 and configure FFmpeg with "--enable-libopenvino"
10373 (--extra-cflags=-I... --extra-ldflags=-L... might be needed if
10374 the header files and libraries are not installed into system
10375 path)
10376
10377 Default value is native.
10378
10379 model
10380 Set path to model file specifying network architecture and its
10381 parameters. Note that different backends use different file
10382 formats. TensorFlow, OpenVINO and native backend can load files for
10383 only its format.
10384
10385 Native model file (.model) can be generated from TensorFlow model
10386 file (.pb) by using tools/python/convert.py
10387
10388 input
10389 Set the input name of the dnn network.
10390
10391 output
10392 Set the output name of the dnn network.
10393
10394 backend_configs
10395 Set the configs to be passed into backend. To use async execution,
10396 set async (default: set). Roll back to sync execution if the
10397 backend does not support async.
10398
10399 For tensorflow backend, you can set its configs with sess_config
10400 options, please use tools/python/tf_sess_config.py to get the
10401 configs of TensorFlow backend for your system.
10402
10403 Examples
10404
10405 • Remove rain in rgb24 frame with can.pb (see derain filter):
10406
10407 ./ffmpeg -i rain.jpg -vf format=rgb24,dnn_processing=dnn_backend=tensorflow:model=can.pb:input=x:output=y derain.jpg
10408
10409 • Halve the pixel value of the frame with format gray32f:
10410
10411 ffmpeg -i input.jpg -vf format=grayf32,dnn_processing=model=halve_gray_float.model:input=dnn_in:output=dnn_out:dnn_backend=native -y out.native.png
10412
10413 • Handle the Y channel with srcnn.pb (see sr filter) for frame with
10414 yuv420p (planar YUV formats supported):
10415
10416 ./ffmpeg -i 480p.jpg -vf format=yuv420p,scale=w=iw*2:h=ih*2,dnn_processing=dnn_backend=tensorflow:model=srcnn.pb:input=x:output=y -y srcnn.jpg
10417
10418 • Handle the Y channel with espcn.pb (see sr filter), which changes
10419 frame size, for format yuv420p (planar YUV formats supported),
10420 please use tools/python/tf_sess_config.py to get the configs of
10421 TensorFlow backend for your system.
10422
10423 ./ffmpeg -i 480p.jpg -vf format=yuv420p,dnn_processing=dnn_backend=tensorflow:model=espcn.pb:input=x:output=y:backend_configs=sess_config=0x10022805320e09cdccccccccccec3f20012a01303801 -y tmp.espcn.jpg
10424
10425 drawbox
10426 Draw a colored box on the input image.
10427
10428 It accepts the following parameters:
10429
10430 x
10431 y The expressions which specify the top left corner coordinates of
10432 the box. It defaults to 0.
10433
10434 width, w
10435 height, h
10436 The expressions which specify the width and height of the box; if 0
10437 they are interpreted as the input width and height. It defaults to
10438 0.
10439
10440 color, c
10441 Specify the color of the box to write. For the general syntax of
10442 this option, check the "Color" section in the ffmpeg-utils manual.
10443 If the special value "invert" is used, the box edge color is the
10444 same as the video with inverted luma.
10445
10446 thickness, t
10447 The expression which sets the thickness of the box edge. A value
10448 of "fill" will create a filled box. Default value is 3.
10449
10450 See below for the list of accepted constants.
10451
10452 replace
10453 Applicable if the input has alpha. With value 1, the pixels of the
10454 painted box will overwrite the video's color and alpha pixels.
10455 Default is 0, which composites the box onto the input, leaving the
10456 video's alpha intact.
10457
10458 The parameters for x, y, w and h and t are expressions containing the
10459 following constants:
10460
10461 dar The input display aspect ratio, it is the same as (w / h) * sar.
10462
10463 hsub
10464 vsub
10465 horizontal and vertical chroma subsample values. For example for
10466 the pixel format "yuv422p" hsub is 2 and vsub is 1.
10467
10468 in_h, ih
10469 in_w, iw
10470 The input width and height.
10471
10472 sar The input sample aspect ratio.
10473
10474 x
10475 y The x and y offset coordinates where the box is drawn.
10476
10477 w
10478 h The width and height of the drawn box.
10479
10480 box_source
10481 Box source can be set as side_data_detection_bboxes if you want to
10482 use box data in detection bboxes of side data.
10483
10484 If box_source is set, the x, y, width and height will be ignored
10485 and still use box data in detection bboxes of side data. So please
10486 do not use this parameter if you were not sure about the box
10487 source.
10488
10489 t The thickness of the drawn box.
10490
10491 These constants allow the x, y, w, h and t expressions to refer to
10492 each other, so you may for example specify "y=x/dar" or "h=w/dar".
10493
10494 Examples
10495
10496 • Draw a black box around the edge of the input image:
10497
10498 drawbox
10499
10500 • Draw a box with color red and an opacity of 50%:
10501
10502 drawbox=10:20:200:60:red@0.5
10503
10504 The previous example can be specified as:
10505
10506 drawbox=x=10:y=20:w=200:h=60:color=red@0.5
10507
10508 • Fill the box with pink color:
10509
10510 drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill
10511
10512 • Draw a 2-pixel red 2.40:1 mask:
10513
10514 drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
10515
10516 Commands
10517
10518 This filter supports same commands as options. The command accepts the
10519 same syntax of the corresponding option.
10520
10521 If the specified expression is not valid, it is kept at its current
10522 value.
10523
10524 drawgraph
10525 Draw a graph using input video metadata.
10526
10527 It accepts the following parameters:
10528
10529 m1 Set 1st frame metadata key from which metadata values will be used
10530 to draw a graph.
10531
10532 fg1 Set 1st foreground color expression.
10533
10534 m2 Set 2nd frame metadata key from which metadata values will be used
10535 to draw a graph.
10536
10537 fg2 Set 2nd foreground color expression.
10538
10539 m3 Set 3rd frame metadata key from which metadata values will be used
10540 to draw a graph.
10541
10542 fg3 Set 3rd foreground color expression.
10543
10544 m4 Set 4th frame metadata key from which metadata values will be used
10545 to draw a graph.
10546
10547 fg4 Set 4th foreground color expression.
10548
10549 min Set minimal value of metadata value.
10550
10551 max Set maximal value of metadata value.
10552
10553 bg Set graph background color. Default is white.
10554
10555 mode
10556 Set graph mode.
10557
10558 Available values for mode is:
10559
10560 bar
10561 dot
10562 line
10563
10564 Default is "line".
10565
10566 slide
10567 Set slide mode.
10568
10569 Available values for slide is:
10570
10571 frame
10572 Draw new frame when right border is reached.
10573
10574 replace
10575 Replace old columns with new ones.
10576
10577 scroll
10578 Scroll from right to left.
10579
10580 rscroll
10581 Scroll from left to right.
10582
10583 picture
10584 Draw single picture.
10585
10586 Default is "frame".
10587
10588 size
10589 Set size of graph video. For the syntax of this option, check the
10590 "Video size" section in the ffmpeg-utils manual. The default value
10591 is "900x256".
10592
10593 rate, r
10594 Set the output frame rate. Default value is 25.
10595
10596 The foreground color expressions can use the following variables:
10597
10598 MIN Minimal value of metadata value.
10599
10600 MAX Maximal value of metadata value.
10601
10602 VAL Current metadata key value.
10603
10604 The color is defined as 0xAABBGGRR.
10605
10606 Example using metadata from signalstats filter:
10607
10608 signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
10609
10610 Example using metadata from ebur128 filter:
10611
10612 ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5
10613
10614 drawgrid
10615 Draw a grid on the input image.
10616
10617 It accepts the following parameters:
10618
10619 x
10620 y The expressions which specify the coordinates of some point of grid
10621 intersection (meant to configure offset). Both default to 0.
10622
10623 width, w
10624 height, h
10625 The expressions which specify the width and height of the grid
10626 cell, if 0 they are interpreted as the input width and height,
10627 respectively, minus "thickness", so image gets framed. Default to
10628 0.
10629
10630 color, c
10631 Specify the color of the grid. For the general syntax of this
10632 option, check the "Color" section in the ffmpeg-utils manual. If
10633 the special value "invert" is used, the grid color is the same as
10634 the video with inverted luma.
10635
10636 thickness, t
10637 The expression which sets the thickness of the grid line. Default
10638 value is 1.
10639
10640 See below for the list of accepted constants.
10641
10642 replace
10643 Applicable if the input has alpha. With 1 the pixels of the painted
10644 grid will overwrite the video's color and alpha pixels. Default is
10645 0, which composites the grid onto the input, leaving the video's
10646 alpha intact.
10647
10648 The parameters for x, y, w and h and t are expressions containing the
10649 following constants:
10650
10651 dar The input display aspect ratio, it is the same as (w / h) * sar.
10652
10653 hsub
10654 vsub
10655 horizontal and vertical chroma subsample values. For example for
10656 the pixel format "yuv422p" hsub is 2 and vsub is 1.
10657
10658 in_h, ih
10659 in_w, iw
10660 The input grid cell width and height.
10661
10662 sar The input sample aspect ratio.
10663
10664 x
10665 y The x and y coordinates of some point of grid intersection (meant
10666 to configure offset).
10667
10668 w
10669 h The width and height of the drawn cell.
10670
10671 t The thickness of the drawn cell.
10672
10673 These constants allow the x, y, w, h and t expressions to refer to
10674 each other, so you may for example specify "y=x/dar" or "h=w/dar".
10675
10676 Examples
10677
10678 • Draw a grid with cell 100x100 pixels, thickness 2 pixels, with
10679 color red and an opacity of 50%:
10680
10681 drawgrid=width=100:height=100:thickness=2:color=red@0.5
10682
10683 • Draw a white 3x3 grid with an opacity of 50%:
10684
10685 drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
10686
10687 Commands
10688
10689 This filter supports same commands as options. The command accepts the
10690 same syntax of the corresponding option.
10691
10692 If the specified expression is not valid, it is kept at its current
10693 value.
10694
10695 drawtext
10696 Draw a text string or text from a specified file on top of a video,
10697 using the libfreetype library.
10698
10699 To enable compilation of this filter, you need to configure FFmpeg with
10700 "--enable-libfreetype". To enable default font fallback and the font
10701 option you need to configure FFmpeg with "--enable-libfontconfig". To
10702 enable the text_shaping option, you need to configure FFmpeg with
10703 "--enable-libfribidi".
10704
10705 Syntax
10706
10707 It accepts the following parameters:
10708
10709 box Used to draw a box around text using the background color. The
10710 value must be either 1 (enable) or 0 (disable). The default value
10711 of box is 0.
10712
10713 boxborderw
10714 Set the width of the border to be drawn around the box using
10715 boxcolor. The default value of boxborderw is 0.
10716
10717 boxcolor
10718 The color to be used for drawing box around text. For the syntax of
10719 this option, check the "Color" section in the ffmpeg-utils manual.
10720
10721 The default value of boxcolor is "white".
10722
10723 line_spacing
10724 Set the line spacing in pixels of the border to be drawn around the
10725 box using box. The default value of line_spacing is 0.
10726
10727 borderw
10728 Set the width of the border to be drawn around the text using
10729 bordercolor. The default value of borderw is 0.
10730
10731 bordercolor
10732 Set the color to be used for drawing border around text. For the
10733 syntax of this option, check the "Color" section in the ffmpeg-
10734 utils manual.
10735
10736 The default value of bordercolor is "black".
10737
10738 expansion
10739 Select how the text is expanded. Can be either "none", "strftime"
10740 (deprecated) or "normal" (default). See the drawtext_expansion,
10741 Text expansion section below for details.
10742
10743 basetime
10744 Set a start time for the count. Value is in microseconds. Only
10745 applied in the deprecated strftime expansion mode. To emulate in
10746 normal expansion mode use the "pts" function, supplying the start
10747 time (in seconds) as the second argument.
10748
10749 fix_bounds
10750 If true, check and fix text coords to avoid clipping.
10751
10752 fontcolor
10753 The color to be used for drawing fonts. For the syntax of this
10754 option, check the "Color" section in the ffmpeg-utils manual.
10755
10756 The default value of fontcolor is "black".
10757
10758 fontcolor_expr
10759 String which is expanded the same way as text to obtain dynamic
10760 fontcolor value. By default this option has empty value and is not
10761 processed. When this option is set, it overrides fontcolor option.
10762
10763 font
10764 The font family to be used for drawing text. By default Sans.
10765
10766 fontfile
10767 The font file to be used for drawing text. The path must be
10768 included. This parameter is mandatory if the fontconfig support is
10769 disabled.
10770
10771 alpha
10772 Draw the text applying alpha blending. The value can be a number
10773 between 0.0 and 1.0. The expression accepts the same variables x,
10774 y as well. The default value is 1. Please see fontcolor_expr.
10775
10776 fontsize
10777 The font size to be used for drawing text. The default value of
10778 fontsize is 16.
10779
10780 text_shaping
10781 If set to 1, attempt to shape the text (for example, reverse the
10782 order of right-to-left text and join Arabic characters) before
10783 drawing it. Otherwise, just draw the text exactly as given. By
10784 default 1 (if supported).
10785
10786 ft_load_flags
10787 The flags to be used for loading the fonts.
10788
10789 The flags map the corresponding flags supported by libfreetype, and
10790 are a combination of the following values:
10791
10792 default
10793 no_scale
10794 no_hinting
10795 render
10796 no_bitmap
10797 vertical_layout
10798 force_autohint
10799 crop_bitmap
10800 pedantic
10801 ignore_global_advance_width
10802 no_recurse
10803 ignore_transform
10804 monochrome
10805 linear_design
10806 no_autohint
10807
10808 Default value is "default".
10809
10810 For more information consult the documentation for the FT_LOAD_*
10811 libfreetype flags.
10812
10813 shadowcolor
10814 The color to be used for drawing a shadow behind the drawn text.
10815 For the syntax of this option, check the "Color" section in the
10816 ffmpeg-utils manual.
10817
10818 The default value of shadowcolor is "black".
10819
10820 shadowx
10821 shadowy
10822 The x and y offsets for the text shadow position with respect to
10823 the position of the text. They can be either positive or negative
10824 values. The default value for both is "0".
10825
10826 start_number
10827 The starting frame number for the n/frame_num variable. The default
10828 value is "0".
10829
10830 tabsize
10831 The size in number of spaces to use for rendering the tab. Default
10832 value is 4.
10833
10834 timecode
10835 Set the initial timecode representation in "hh:mm:ss[:;.]ff"
10836 format. It can be used with or without text parameter.
10837 timecode_rate option must be specified.
10838
10839 timecode_rate, rate, r
10840 Set the timecode frame rate (timecode only). Value will be rounded
10841 to nearest integer. Minimum value is "1". Drop-frame timecode is
10842 supported for frame rates 30 & 60.
10843
10844 tc24hmax
10845 If set to 1, the output of the timecode option will wrap around at
10846 24 hours. Default is 0 (disabled).
10847
10848 text
10849 The text string to be drawn. The text must be a sequence of UTF-8
10850 encoded characters. This parameter is mandatory if no file is
10851 specified with the parameter textfile.
10852
10853 textfile
10854 A text file containing text to be drawn. The text must be a
10855 sequence of UTF-8 encoded characters.
10856
10857 This parameter is mandatory if no text string is specified with the
10858 parameter text.
10859
10860 If both text and textfile are specified, an error is thrown.
10861
10862 text_source
10863 Text source should be set as side_data_detection_bboxes if you want
10864 to use text data in detection bboxes of side data.
10865
10866 If text source is set, text and textfile will be ignored and still
10867 use text data in detection bboxes of side data. So please do not
10868 use this parameter if you are not sure about the text source.
10869
10870 reload
10871 The textfile will be reloaded at specified frame interval. Be sure
10872 to update textfile atomically, or it may be read partially, or even
10873 fail. Range is 0 to INT_MAX. Default is 0.
10874
10875 x
10876 y The expressions which specify the offsets where text will be drawn
10877 within the video frame. They are relative to the top/left border of
10878 the output image.
10879
10880 The default value of x and y is "0".
10881
10882 See below for the list of accepted constants and functions.
10883
10884 The parameters for x and y are expressions containing the following
10885 constants and functions:
10886
10887 dar input display aspect ratio, it is the same as (w / h) * sar
10888
10889 hsub
10890 vsub
10891 horizontal and vertical chroma subsample values. For example for
10892 the pixel format "yuv422p" hsub is 2 and vsub is 1.
10893
10894 line_h, lh
10895 the height of each text line
10896
10897 main_h, h, H
10898 the input height
10899
10900 main_w, w, W
10901 the input width
10902
10903 max_glyph_a, ascent
10904 the maximum distance from the baseline to the highest/upper grid
10905 coordinate used to place a glyph outline point, for all the
10906 rendered glyphs. It is a positive value, due to the grid's
10907 orientation with the Y axis upwards.
10908
10909 max_glyph_d, descent
10910 the maximum distance from the baseline to the lowest grid
10911 coordinate used to place a glyph outline point, for all the
10912 rendered glyphs. This is a negative value, due to the grid's
10913 orientation, with the Y axis upwards.
10914
10915 max_glyph_h
10916 maximum glyph height, that is the maximum height for all the glyphs
10917 contained in the rendered text, it is equivalent to ascent -
10918 descent.
10919
10920 max_glyph_w
10921 maximum glyph width, that is the maximum width for all the glyphs
10922 contained in the rendered text
10923
10924 n the number of input frame, starting from 0
10925
10926 rand(min, max)
10927 return a random number included between min and max
10928
10929 sar The input sample aspect ratio.
10930
10931 t timestamp expressed in seconds, NAN if the input timestamp is
10932 unknown
10933
10934 text_h, th
10935 the height of the rendered text
10936
10937 text_w, tw
10938 the width of the rendered text
10939
10940 x
10941 y the x and y offset coordinates where the text is drawn.
10942
10943 These parameters allow the x and y expressions to refer to each
10944 other, so you can for example specify "y=x/dar".
10945
10946 pict_type
10947 A one character description of the current frame's picture type.
10948
10949 pkt_pos
10950 The current packet's position in the input file or stream (in
10951 bytes, from the start of the input). A value of -1 indicates this
10952 info is not available.
10953
10954 duration
10955 The current packet's duration, in seconds.
10956
10957 pkt_size
10958 The current packet's size (in bytes).
10959
10960 Text expansion
10961
10962 If expansion is set to "strftime", the filter recognizes strftime()
10963 sequences in the provided text and expands them accordingly. Check the
10964 documentation of strftime(). This feature is deprecated.
10965
10966 If expansion is set to "none", the text is printed verbatim.
10967
10968 If expansion is set to "normal" (which is the default), the following
10969 expansion mechanism is used.
10970
10971 The backslash character \, followed by any character, always expands to
10972 the second character.
10973
10974 Sequences of the form "%{...}" are expanded. The text between the
10975 braces is a function name, possibly followed by arguments separated by
10976 ':'. If the arguments contain special characters or delimiters (':' or
10977 '}'), they should be escaped.
10978
10979 Note that they probably must also be escaped as the value for the text
10980 option in the filter argument string and as the filter argument in the
10981 filtergraph description, and possibly also for the shell, that makes up
10982 to four levels of escaping; using a text file avoids these problems.
10983
10984 The following functions are available:
10985
10986 expr, e
10987 The expression evaluation result.
10988
10989 It must take one argument specifying the expression to be
10990 evaluated, which accepts the same constants and functions as the x
10991 and y values. Note that not all constants should be used, for
10992 example the text size is not known when evaluating the expression,
10993 so the constants text_w and text_h will have an undefined value.
10994
10995 expr_int_format, eif
10996 Evaluate the expression's value and output as formatted integer.
10997
10998 The first argument is the expression to be evaluated, just as for
10999 the expr function. The second argument specifies the output
11000 format. Allowed values are x, X, d and u. They are treated exactly
11001 as in the "printf" function. The third parameter is optional and
11002 sets the number of positions taken by the output. It can be used
11003 to add padding with zeros from the left.
11004
11005 gmtime
11006 The time at which the filter is running, expressed in UTC. It can
11007 accept an argument: a strftime() format string. The format string
11008 is extended to support the variable %[1-6]N which prints fractions
11009 of the second with optionally specified number of digits.
11010
11011 localtime
11012 The time at which the filter is running, expressed in the local
11013 time zone. It can accept an argument: a strftime() format string.
11014 The format string is extended to support the variable %[1-6]N which
11015 prints fractions of the second with optionally specified number of
11016 digits.
11017
11018 metadata
11019 Frame metadata. Takes one or two arguments.
11020
11021 The first argument is mandatory and specifies the metadata key.
11022
11023 The second argument is optional and specifies a default value, used
11024 when the metadata key is not found or empty.
11025
11026 Available metadata can be identified by inspecting entries starting
11027 with TAG included within each frame section printed by running
11028 "ffprobe -show_frames".
11029
11030 String metadata generated in filters leading to the drawtext filter
11031 are also available.
11032
11033 n, frame_num
11034 The frame number, starting from 0.
11035
11036 pict_type
11037 A one character description of the current picture type.
11038
11039 pts The timestamp of the current frame. It can take up to three
11040 arguments.
11041
11042 The first argument is the format of the timestamp; it defaults to
11043 "flt" for seconds as a decimal number with microsecond accuracy;
11044 "hms" stands for a formatted [-]HH:MM:SS.mmm timestamp with
11045 millisecond accuracy. "gmtime" stands for the timestamp of the
11046 frame formatted as UTC time; "localtime" stands for the timestamp
11047 of the frame formatted as local time zone time.
11048
11049 The second argument is an offset added to the timestamp.
11050
11051 If the format is set to "hms", a third argument "24HH" may be
11052 supplied to present the hour part of the formatted timestamp in 24h
11053 format (00-23).
11054
11055 If the format is set to "localtime" or "gmtime", a third argument
11056 may be supplied: a strftime() format string. By default, YYYY-MM-
11057 DD HH:MM:SS format will be used.
11058
11059 Commands
11060
11061 This filter supports altering parameters via commands:
11062
11063 reinit
11064 Alter existing filter parameters.
11065
11066 Syntax for the argument is the same as for filter invocation, e.g.
11067
11068 fontsize=56:fontcolor=green:text='Hello World'
11069
11070 Full filter invocation with sendcmd would look like this:
11071
11072 sendcmd=c='56.0 drawtext reinit fontsize=56\:fontcolor=green\:text=Hello\\ World'
11073
11074 If the entire argument can't be parsed or applied as valid values then
11075 the filter will continue with its existing parameters.
11076
11077 Examples
11078
11079 • Draw "Test Text" with font FreeSerif, using the default values for
11080 the optional parameters.
11081
11082 drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
11083
11084 • Draw 'Test Text' with font FreeSerif of size 24 at position x=100
11085 and y=50 (counting from the top-left corner of the screen), text is
11086 yellow with a red box around it. Both the text and the box have an
11087 opacity of 20%.
11088
11089 drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
11090 x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2"
11091
11092 Note that the double quotes are not necessary if spaces are not
11093 used within the parameter list.
11094
11095 • Show the text at the center of the video frame:
11096
11097 drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2"
11098
11099 • Show the text at a random position, switching to a new position
11100 every 30 seconds:
11101
11102 drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=if(eq(mod(t\,30)\,0)\,rand(0\,(w-text_w))\,x):y=if(eq(mod(t\,30)\,0)\,rand(0\,(h-text_h))\,y)"
11103
11104 • Show a text line sliding from right to left in the last row of the
11105 video frame. The file LONG_LINE is assumed to contain a single line
11106 with no newlines.
11107
11108 drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t"
11109
11110 • Show the content of file CREDITS off the bottom of the frame and
11111 scroll up.
11112
11113 drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t"
11114
11115 • Draw a single green letter "g", at the center of the input video.
11116 The glyph baseline is placed at half screen height.
11117
11118 drawtext="fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent"
11119
11120 • Show text for 1 second every 3 seconds:
11121
11122 drawtext="fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:enable=lt(mod(t\,3)\,1):text='blink'"
11123
11124 • Use fontconfig to set the font. Note that the colons need to be
11125 escaped.
11126
11127 drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
11128
11129 • Draw "Test Text" with font size dependent on height of the video.
11130
11131 drawtext="text='Test Text': fontsize=h/30: x=(w-text_w)/2: y=(h-text_h*2)"
11132
11133 • Print the date of a real-time encoding (see strftime(3)):
11134
11135 drawtext='fontfile=FreeSans.ttf:text=%{localtime\:%a %b %d %Y}'
11136
11137 • Show text fading in and out (appearing/disappearing):
11138
11139 #!/bin/sh
11140 DS=1.0 # display start
11141 DE=10.0 # display end
11142 FID=1.5 # fade in duration
11143 FOD=5 # fade out duration
11144 ffplay -f lavfi "color,drawtext=text=TEST:fontsize=50:fontfile=FreeSerif.ttf:fontcolor_expr=ff0000%{eif\\\\: clip(255*(1*between(t\\, $DS + $FID\\, $DE - $FOD) + ((t - $DS)/$FID)*between(t\\, $DS\\, $DS + $FID) + (-(t - $DE)/$FOD)*between(t\\, $DE - $FOD\\, $DE) )\\, 0\\, 255) \\\\: x\\\\: 2 }"
11145
11146 • Horizontally align multiple separate texts. Note that max_glyph_a
11147 and the fontsize value are included in the y offset.
11148
11149 drawtext=fontfile=FreeSans.ttf:text=DOG:fontsize=24:x=10:y=20+24-max_glyph_a,
11150 drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a
11151
11152 • Plot special lavf.image2dec.source_basename metadata onto each
11153 frame if such metadata exists. Otherwise, plot the string "NA".
11154 Note that image2 demuxer must have option -export_path_metadata 1
11155 for the special metadata fields to be available for filters.
11156
11157 drawtext="fontsize=20:fontcolor=white:fontfile=FreeSans.ttf:text='%{metadata\:lavf.image2dec.source_basename\:NA}':x=10:y=10"
11158
11159 For more information about libfreetype, check:
11160 <http://www.freetype.org/>.
11161
11162 For more information about fontconfig, check:
11163 <http://freedesktop.org/software/fontconfig/fontconfig-user.html>.
11164
11165 For more information about libfribidi, check: <http://fribidi.org/>.
11166
11167 edgedetect
11168 Detect and draw edges. The filter uses the Canny Edge Detection
11169 algorithm.
11170
11171 The filter accepts the following options:
11172
11173 low
11174 high
11175 Set low and high threshold values used by the Canny thresholding
11176 algorithm.
11177
11178 The high threshold selects the "strong" edge pixels, which are then
11179 connected through 8-connectivity with the "weak" edge pixels
11180 selected by the low threshold.
11181
11182 low and high threshold values must be chosen in the range [0,1],
11183 and low should be lesser or equal to high.
11184
11185 Default value for low is "20/255", and default value for high is
11186 "50/255".
11187
11188 mode
11189 Define the drawing mode.
11190
11191 wires
11192 Draw white/gray wires on black background.
11193
11194 colormix
11195 Mix the colors to create a paint/cartoon effect.
11196
11197 canny
11198 Apply Canny edge detector on all selected planes.
11199
11200 Default value is wires.
11201
11202 planes
11203 Select planes for filtering. By default all available planes are
11204 filtered.
11205
11206 Examples
11207
11208 • Standard edge detection with custom values for the hysteresis
11209 thresholding:
11210
11211 edgedetect=low=0.1:high=0.4
11212
11213 • Painting effect without thresholding:
11214
11215 edgedetect=mode=colormix:high=0
11216
11217 elbg
11218 Apply a posterize effect using the ELBG (Enhanced LBG) algorithm.
11219
11220 For each input image, the filter will compute the optimal mapping from
11221 the input to the output given the codebook length, that is the number
11222 of distinct output colors.
11223
11224 This filter accepts the following options.
11225
11226 codebook_length, l
11227 Set codebook length. The value must be a positive integer, and
11228 represents the number of distinct output colors. Default value is
11229 256.
11230
11231 nb_steps, n
11232 Set the maximum number of iterations to apply for computing the
11233 optimal mapping. The higher the value the better the result and the
11234 higher the computation time. Default value is 1.
11235
11236 seed, s
11237 Set a random seed, must be an integer included between 0 and
11238 UINT32_MAX. If not specified, or if explicitly set to -1, the
11239 filter will try to use a good random seed on a best effort basis.
11240
11241 pal8
11242 Set pal8 output pixel format. This option does not work with
11243 codebook length greater than 256. Default is disabled.
11244
11245 use_alpha
11246 Include alpha values in the quantization calculation. Allows
11247 creating palettized output images (e.g. PNG8) with multiple alpha
11248 smooth blending.
11249
11250 entropy
11251 Measure graylevel entropy in histogram of color channels of video
11252 frames.
11253
11254 It accepts the following parameters:
11255
11256 mode
11257 Can be either normal or diff. Default is normal.
11258
11259 diff mode measures entropy of histogram delta values, absolute
11260 differences between neighbour histogram values.
11261
11262 epx
11263 Apply the EPX magnification filter which is designed for pixel art.
11264
11265 It accepts the following option:
11266
11267 n Set the scaling dimension: 2 for "2xEPX", 3 for "3xEPX". Default
11268 is 3.
11269
11270 eq
11271 Set brightness, contrast, saturation and approximate gamma adjustment.
11272
11273 The filter accepts the following options:
11274
11275 contrast
11276 Set the contrast expression. The value must be a float value in
11277 range -1000.0 to 1000.0. The default value is "1".
11278
11279 brightness
11280 Set the brightness expression. The value must be a float value in
11281 range -1.0 to 1.0. The default value is "0".
11282
11283 saturation
11284 Set the saturation expression. The value must be a float in range
11285 0.0 to 3.0. The default value is "1".
11286
11287 gamma
11288 Set the gamma expression. The value must be a float in range 0.1 to
11289 10.0. The default value is "1".
11290
11291 gamma_r
11292 Set the gamma expression for red. The value must be a float in
11293 range 0.1 to 10.0. The default value is "1".
11294
11295 gamma_g
11296 Set the gamma expression for green. The value must be a float in
11297 range 0.1 to 10.0. The default value is "1".
11298
11299 gamma_b
11300 Set the gamma expression for blue. The value must be a float in
11301 range 0.1 to 10.0. The default value is "1".
11302
11303 gamma_weight
11304 Set the gamma weight expression. It can be used to reduce the
11305 effect of a high gamma value on bright image areas, e.g. keep them
11306 from getting overamplified and just plain white. The value must be
11307 a float in range 0.0 to 1.0. A value of 0.0 turns the gamma
11308 correction all the way down while 1.0 leaves it at its full
11309 strength. Default is "1".
11310
11311 eval
11312 Set when the expressions for brightness, contrast, saturation and
11313 gamma expressions are evaluated.
11314
11315 It accepts the following values:
11316
11317 init
11318 only evaluate expressions once during the filter initialization
11319 or when a command is processed
11320
11321 frame
11322 evaluate expressions for each incoming frame
11323
11324 Default value is init.
11325
11326 The expressions accept the following parameters:
11327
11328 n frame count of the input frame starting from 0
11329
11330 pos byte position of the corresponding packet in the input file, NAN if
11331 unspecified
11332
11333 r frame rate of the input video, NAN if the input frame rate is
11334 unknown
11335
11336 t timestamp expressed in seconds, NAN if the input timestamp is
11337 unknown
11338
11339 Commands
11340
11341 The filter supports the following commands:
11342
11343 contrast
11344 Set the contrast expression.
11345
11346 brightness
11347 Set the brightness expression.
11348
11349 saturation
11350 Set the saturation expression.
11351
11352 gamma
11353 Set the gamma expression.
11354
11355 gamma_r
11356 Set the gamma_r expression.
11357
11358 gamma_g
11359 Set gamma_g expression.
11360
11361 gamma_b
11362 Set gamma_b expression.
11363
11364 gamma_weight
11365 Set gamma_weight expression.
11366
11367 The command accepts the same syntax of the corresponding option.
11368
11369 If the specified expression is not valid, it is kept at its current
11370 value.
11371
11372 erosion
11373 Apply erosion effect to the video.
11374
11375 This filter replaces the pixel by the local(3x3) minimum.
11376
11377 It accepts the following options:
11378
11379 threshold0
11380 threshold1
11381 threshold2
11382 threshold3
11383 Limit the maximum change for each plane, default is 65535. If 0,
11384 plane will remain unchanged.
11385
11386 coordinates
11387 Flag which specifies the pixel to refer to. Default is 255 i.e. all
11388 eight pixels are used.
11389
11390 Flags to local 3x3 coordinates maps like this:
11391
11392 1 2 3
11393 4 5
11394 6 7 8
11395
11396 Commands
11397
11398 This filter supports the all above options as commands.
11399
11400 estdif
11401 Deinterlace the input video ("estdif" stands for "Edge Slope Tracing
11402 Deinterlacing Filter").
11403
11404 Spatial only filter that uses edge slope tracing algorithm to
11405 interpolate missing lines. It accepts the following parameters:
11406
11407 mode
11408 The interlacing mode to adopt. It accepts one of the following
11409 values:
11410
11411 frame
11412 Output one frame for each frame.
11413
11414 field
11415 Output one frame for each field.
11416
11417 The default value is "field".
11418
11419 parity
11420 The picture field parity assumed for the input interlaced video. It
11421 accepts one of the following values:
11422
11423 tff Assume the top field is first.
11424
11425 bff Assume the bottom field is first.
11426
11427 auto
11428 Enable automatic detection of field parity.
11429
11430 The default value is "auto". If the interlacing is unknown or the
11431 decoder does not export this information, top field first will be
11432 assumed.
11433
11434 deint
11435 Specify which frames to deinterlace. Accepts one of the following
11436 values:
11437
11438 all Deinterlace all frames.
11439
11440 interlaced
11441 Only deinterlace frames marked as interlaced.
11442
11443 The default value is "all".
11444
11445 rslope
11446 Specify the search radius for edge slope tracing. Default value is
11447 1. Allowed range is from 1 to 15.
11448
11449 redge
11450 Specify the search radius for best edge matching. Default value is
11451 2. Allowed range is from 0 to 15.
11452
11453 ecost
11454 Specify the edge cost for edge matching. Default value is 1.0.
11455 Allowed range is from 0 to 9.
11456
11457 mcost
11458 Specify the middle cost for edge matching. Default value is 0.5.
11459 Allowed range is from 0 to 1.
11460
11461 dcost
11462 Specify the distance cost for edge matching. Default value is 0.5.
11463 Allowed range is from 0 to 1.
11464
11465 interp
11466 Specify the interpolation used. Default is 4-point interpolation.
11467 It accepts one of the following values:
11468
11469 2p Two-point interpolation.
11470
11471 4p Four-point interpolation.
11472
11473 6p Six-point interpolation.
11474
11475 Commands
11476
11477 This filter supports same commands as options.
11478
11479 exposure
11480 Adjust exposure of the video stream.
11481
11482 The filter accepts the following options:
11483
11484 exposure
11485 Set the exposure correction in EV. Allowed range is from -3.0 to
11486 3.0 EV Default value is 0 EV.
11487
11488 black
11489 Set the black level correction. Allowed range is from -1.0 to 1.0.
11490 Default value is 0.
11491
11492 Commands
11493
11494 This filter supports same commands as options.
11495
11496 extractplanes
11497 Extract color channel components from input video stream into separate
11498 grayscale video streams.
11499
11500 The filter accepts the following option:
11501
11502 planes
11503 Set plane(s) to extract.
11504
11505 Available values for planes are:
11506
11507 y
11508 u
11509 v
11510 a
11511 r
11512 g
11513 b
11514
11515 Choosing planes not available in the input will result in an error.
11516 That means you cannot select "r", "g", "b" planes with "y", "u",
11517 "v" planes at same time.
11518
11519 Examples
11520
11521 • Extract luma, u and v color channel component from input video
11522 frame into 3 grayscale outputs:
11523
11524 ffmpeg -i video.avi -filter_complex 'extractplanes=y+u+v[y][u][v]' -map '[y]' y.avi -map '[u]' u.avi -map '[v]' v.avi
11525
11526 fade
11527 Apply a fade-in/out effect to the input video.
11528
11529 It accepts the following parameters:
11530
11531 type, t
11532 The effect type can be either "in" for a fade-in, or "out" for a
11533 fade-out effect. Default is "in".
11534
11535 start_frame, s
11536 Specify the number of the frame to start applying the fade effect
11537 at. Default is 0.
11538
11539 nb_frames, n
11540 The number of frames that the fade effect lasts. At the end of the
11541 fade-in effect, the output video will have the same intensity as
11542 the input video. At the end of the fade-out transition, the output
11543 video will be filled with the selected color. Default is 25.
11544
11545 alpha
11546 If set to 1, fade only alpha channel, if one exists on the input.
11547 Default value is 0.
11548
11549 start_time, st
11550 Specify the timestamp (in seconds) of the frame to start to apply
11551 the fade effect. If both start_frame and start_time are specified,
11552 the fade will start at whichever comes last. Default is 0.
11553
11554 duration, d
11555 The number of seconds for which the fade effect has to last. At the
11556 end of the fade-in effect the output video will have the same
11557 intensity as the input video, at the end of the fade-out transition
11558 the output video will be filled with the selected color. If both
11559 duration and nb_frames are specified, duration is used. Default is
11560 0 (nb_frames is used by default).
11561
11562 color, c
11563 Specify the color of the fade. Default is "black".
11564
11565 Examples
11566
11567 • Fade in the first 30 frames of video:
11568
11569 fade=in:0:30
11570
11571 The command above is equivalent to:
11572
11573 fade=t=in:s=0:n=30
11574
11575 • Fade out the last 45 frames of a 200-frame video:
11576
11577 fade=out:155:45
11578 fade=type=out:start_frame=155:nb_frames=45
11579
11580 • Fade in the first 25 frames and fade out the last 25 frames of a
11581 1000-frame video:
11582
11583 fade=in:0:25, fade=out:975:25
11584
11585 • Make the first 5 frames yellow, then fade in from frame 5-24:
11586
11587 fade=in:5:20:color=yellow
11588
11589 • Fade in alpha over first 25 frames of video:
11590
11591 fade=in:0:25:alpha=1
11592
11593 • Make the first 5.5 seconds black, then fade in for 0.5 seconds:
11594
11595 fade=t=in:st=5.5:d=0.5
11596
11597 feedback
11598 Apply feedback video filter.
11599
11600 This filter pass cropped input frames to 2nd output. From there it can
11601 be filtered with other video filters. After filter receives frame from
11602 2nd input, that frame is combined on top of original frame from 1st
11603 input and passed to 1st output.
11604
11605 The typical usage is filter only part of frame.
11606
11607 The filter accepts the following options:
11608
11609 x
11610 y Set the top left crop position.
11611
11612 w
11613 h Set the crop size.
11614
11615 Examples
11616
11617 • Blur only top left rectangular part of video frame size 100x100
11618 with gblur filter.
11619
11620 [in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]gblur=8[blurin]
11621
11622 • Draw black box on top left part of video frame of size 100x100 with
11623 drawbox filter.
11624
11625 [in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]drawbox=x=0:y=0:w=100:h=100:t=100[blurin]
11626
11627 fftdnoiz
11628 Denoise frames using 3D FFT (frequency domain filtering).
11629
11630 The filter accepts the following options:
11631
11632 sigma
11633 Set the noise sigma constant. This sets denoising strength.
11634 Default value is 1. Allowed range is from 0 to 30. Using very high
11635 sigma with low overlap may give blocking artifacts.
11636
11637 amount
11638 Set amount of denoising. By default all detected noise is reduced.
11639 Default value is 1. Allowed range is from 0 to 1.
11640
11641 block
11642 Set size of block in pixels, Default is 32, can be 8 to 256.
11643
11644 overlap
11645 Set block overlap. Default is 0.5. Allowed range is from 0.2 to
11646 0.8.
11647
11648 method
11649 Set denoising method. Default is "wiener", can also be "hard".
11650
11651 prev
11652 Set number of previous frames to use for denoising. By default is
11653 set to 0.
11654
11655 next
11656 Set number of next frames to to use for denoising. By default is
11657 set to 0.
11658
11659 planes
11660 Set planes which will be filtered, by default are all available
11661 filtered except alpha.
11662
11663 fftfilt
11664 Apply arbitrary expressions to samples in frequency domain
11665
11666 dc_Y
11667 Adjust the dc value (gain) of the luma plane of the image. The
11668 filter accepts an integer value in range 0 to 1000. The default
11669 value is set to 0.
11670
11671 dc_U
11672 Adjust the dc value (gain) of the 1st chroma plane of the image.
11673 The filter accepts an integer value in range 0 to 1000. The default
11674 value is set to 0.
11675
11676 dc_V
11677 Adjust the dc value (gain) of the 2nd chroma plane of the image.
11678 The filter accepts an integer value in range 0 to 1000. The default
11679 value is set to 0.
11680
11681 weight_Y
11682 Set the frequency domain weight expression for the luma plane.
11683
11684 weight_U
11685 Set the frequency domain weight expression for the 1st chroma
11686 plane.
11687
11688 weight_V
11689 Set the frequency domain weight expression for the 2nd chroma
11690 plane.
11691
11692 eval
11693 Set when the expressions are evaluated.
11694
11695 It accepts the following values:
11696
11697 init
11698 Only evaluate expressions once during the filter
11699 initialization.
11700
11701 frame
11702 Evaluate expressions for each incoming frame.
11703
11704 Default value is init.
11705
11706 The filter accepts the following variables:
11707
11708 X
11709 Y The coordinates of the current sample.
11710
11711 W
11712 H The width and height of the image.
11713
11714 N The number of input frame, starting from 0.
11715
11716 WS
11717 HS The size of FFT array for horizontal and vertical processing.
11718
11719 Examples
11720
11721 • High-pass:
11722
11723 fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)'
11724
11725 • Low-pass:
11726
11727 fftfilt=dc_Y=0:weight_Y='squish((Y+X)/100-1)'
11728
11729 • Sharpen:
11730
11731 fftfilt=dc_Y=0:weight_Y='1+squish(1-(Y+X)/100)'
11732
11733 • Blur:
11734
11735 fftfilt=dc_Y=0:weight_Y='exp(-4 * ((Y+X)/(W+H)))'
11736
11737 field
11738 Extract a single field from an interlaced image using stride arithmetic
11739 to avoid wasting CPU time. The output frames are marked as non-
11740 interlaced.
11741
11742 The filter accepts the following options:
11743
11744 type
11745 Specify whether to extract the top (if the value is 0 or "top") or
11746 the bottom field (if the value is 1 or "bottom").
11747
11748 fieldhint
11749 Create new frames by copying the top and bottom fields from surrounding
11750 frames supplied as numbers by the hint file.
11751
11752 hint
11753 Set file containing hints: absolute/relative frame numbers.
11754
11755 There must be one line for each frame in a clip. Each line must
11756 contain two numbers separated by the comma, optionally followed by
11757 "-" or "+". Numbers supplied on each line of file can not be out
11758 of [N-1,N+1] where N is current frame number for "absolute" mode or
11759 out of [-1, 1] range for "relative" mode. First number tells from
11760 which frame to pick up top field and second number tells from which
11761 frame to pick up bottom field.
11762
11763 If optionally followed by "+" output frame will be marked as
11764 interlaced, else if followed by "-" output frame will be marked as
11765 progressive, else it will be marked same as input frame. If
11766 optionally followed by "t" output frame will use only top field, or
11767 in case of "b" it will use only bottom field. If line starts with
11768 "#" or ";" that line is skipped.
11769
11770 mode
11771 Can be item "absolute" or "relative" or "pattern". Default is
11772 "absolute". The "pattern" mode is same as "relative" mode, except
11773 at last entry of file if there are more frames to process than
11774 "hint" file is seek back to start.
11775
11776 Example of first several lines of "hint" file for "relative" mode:
11777
11778 0,0 - # first frame
11779 1,0 - # second frame, use third's frame top field and second's frame bottom field
11780 1,0 - # third frame, use fourth's frame top field and third's frame bottom field
11781 1,0 -
11782 0,0 -
11783 0,0 -
11784 1,0 -
11785 1,0 -
11786 1,0 -
11787 0,0 -
11788 0,0 -
11789 1,0 -
11790 1,0 -
11791 1,0 -
11792 0,0 -
11793
11794 fieldmatch
11795 Field matching filter for inverse telecine. It is meant to reconstruct
11796 the progressive frames from a telecined stream. The filter does not
11797 drop duplicated frames, so to achieve a complete inverse telecine
11798 "fieldmatch" needs to be followed by a decimation filter such as
11799 decimate in the filtergraph.
11800
11801 The separation of the field matching and the decimation is notably
11802 motivated by the possibility of inserting a de-interlacing filter
11803 fallback between the two. If the source has mixed telecined and real
11804 interlaced content, "fieldmatch" will not be able to match fields for
11805 the interlaced parts. But these remaining combed frames will be marked
11806 as interlaced, and thus can be de-interlaced by a later filter such as
11807 yadif before decimation.
11808
11809 In addition to the various configuration options, "fieldmatch" can take
11810 an optional second stream, activated through the ppsrc option. If
11811 enabled, the frames reconstruction will be based on the fields and
11812 frames from this second stream. This allows the first input to be pre-
11813 processed in order to help the various algorithms of the filter, while
11814 keeping the output lossless (assuming the fields are matched properly).
11815 Typically, a field-aware denoiser, or brightness/contrast adjustments
11816 can help.
11817
11818 Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth
11819 project) and VIVTC/VFM (VapourSynth project). The later is a light
11820 clone of TFM from which "fieldmatch" is based on. While the semantic
11821 and usage are very close, some behaviour and options names can differ.
11822
11823 The decimate filter currently only works for constant frame rate input.
11824 If your input has mixed telecined (30fps) and progressive content with
11825 a lower framerate like 24fps use the following filterchain to produce
11826 the necessary cfr stream:
11827 "dejudder,fps=30000/1001,fieldmatch,decimate".
11828
11829 The filter accepts the following options:
11830
11831 order
11832 Specify the assumed field order of the input stream. Available
11833 values are:
11834
11835 auto
11836 Auto detect parity (use FFmpeg's internal parity value).
11837
11838 bff Assume bottom field first.
11839
11840 tff Assume top field first.
11841
11842 Note that it is sometimes recommended not to trust the parity
11843 announced by the stream.
11844
11845 Default value is auto.
11846
11847 mode
11848 Set the matching mode or strategy to use. pc mode is the safest in
11849 the sense that it won't risk creating jerkiness due to duplicate
11850 frames when possible, but if there are bad edits or blended fields
11851 it will end up outputting combed frames when a good match might
11852 actually exist. On the other hand, pcn_ub mode is the most risky in
11853 terms of creating jerkiness, but will almost always find a good
11854 frame if there is one. The other values are all somewhere in
11855 between pc and pcn_ub in terms of risking jerkiness and creating
11856 duplicate frames versus finding good matches in sections with bad
11857 edits, orphaned fields, blended fields, etc.
11858
11859 More details about p/c/n/u/b are available in p/c/n/u/b meaning
11860 section.
11861
11862 Available values are:
11863
11864 pc 2-way matching (p/c)
11865
11866 pc_n
11867 2-way matching, and trying 3rd match if still combed (p/c + n)
11868
11869 pc_u
11870 2-way matching, and trying 3rd match (same order) if still
11871 combed (p/c + u)
11872
11873 pc_n_ub
11874 2-way matching, trying 3rd match if still combed, and trying
11875 4th/5th matches if still combed (p/c + n + u/b)
11876
11877 pcn 3-way matching (p/c/n)
11878
11879 pcn_ub
11880 3-way matching, and trying 4th/5th matches if all 3 of the
11881 original matches are detected as combed (p/c/n + u/b)
11882
11883 The parenthesis at the end indicate the matches that would be used
11884 for that mode assuming order=tff (and field on auto or top).
11885
11886 In terms of speed pc mode is by far the fastest and pcn_ub is the
11887 slowest.
11888
11889 Default value is pc_n.
11890
11891 ppsrc
11892 Mark the main input stream as a pre-processed input, and enable the
11893 secondary input stream as the clean source to pick the fields from.
11894 See the filter introduction for more details. It is similar to the
11895 clip2 feature from VFM/TFM.
11896
11897 Default value is 0 (disabled).
11898
11899 field
11900 Set the field to match from. It is recommended to set this to the
11901 same value as order unless you experience matching failures with
11902 that setting. In certain circumstances changing the field that is
11903 used to match from can have a large impact on matching performance.
11904 Available values are:
11905
11906 auto
11907 Automatic (same value as order).
11908
11909 bottom
11910 Match from the bottom field.
11911
11912 top Match from the top field.
11913
11914 Default value is auto.
11915
11916 mchroma
11917 Set whether or not chroma is included during the match comparisons.
11918 In most cases it is recommended to leave this enabled. You should
11919 set this to 0 only if your clip has bad chroma problems such as
11920 heavy rainbowing or other artifacts. Setting this to 0 could also
11921 be used to speed things up at the cost of some accuracy.
11922
11923 Default value is 1.
11924
11925 y0
11926 y1 These define an exclusion band which excludes the lines between y0
11927 and y1 from being included in the field matching decision. An
11928 exclusion band can be used to ignore subtitles, a logo, or other
11929 things that may interfere with the matching. y0 sets the starting
11930 scan line and y1 sets the ending line; all lines in between y0 and
11931 y1 (including y0 and y1) will be ignored. Setting y0 and y1 to the
11932 same value will disable the feature. y0 and y1 defaults to 0.
11933
11934 scthresh
11935 Set the scene change detection threshold as a percentage of maximum
11936 change on the luma plane. Good values are in the "[8.0, 14.0]"
11937 range. Scene change detection is only relevant in case
11938 combmatch=sc. The range for scthresh is "[0.0, 100.0]".
11939
11940 Default value is 12.0.
11941
11942 combmatch
11943 When combatch is not none, "fieldmatch" will take into account the
11944 combed scores of matches when deciding what match to use as the
11945 final match. Available values are:
11946
11947 none
11948 No final matching based on combed scores.
11949
11950 sc Combed scores are only used when a scene change is detected.
11951
11952 full
11953 Use combed scores all the time.
11954
11955 Default is sc.
11956
11957 combdbg
11958 Force "fieldmatch" to calculate the combed metrics for certain
11959 matches and print them. This setting is known as micout in TFM/VFM
11960 vocabulary. Available values are:
11961
11962 none
11963 No forced calculation.
11964
11965 pcn Force p/c/n calculations.
11966
11967 pcnub
11968 Force p/c/n/u/b calculations.
11969
11970 Default value is none.
11971
11972 cthresh
11973 This is the area combing threshold used for combed frame detection.
11974 This essentially controls how "strong" or "visible" combing must be
11975 to be detected. Larger values mean combing must be more visible
11976 and smaller values mean combing can be less visible or strong and
11977 still be detected. Valid settings are from -1 (every pixel will be
11978 detected as combed) to 255 (no pixel will be detected as combed).
11979 This is basically a pixel difference value. A good range is "[8,
11980 12]".
11981
11982 Default value is 9.
11983
11984 chroma
11985 Sets whether or not chroma is considered in the combed frame
11986 decision. Only disable this if your source has chroma problems
11987 (rainbowing, etc.) that are causing problems for the combed frame
11988 detection with chroma enabled. Actually, using chroma=0 is usually
11989 more reliable, except for the case where there is chroma only
11990 combing in the source.
11991
11992 Default value is 0.
11993
11994 blockx
11995 blocky
11996 Respectively set the x-axis and y-axis size of the window used
11997 during combed frame detection. This has to do with the size of the
11998 area in which combpel pixels are required to be detected as combed
11999 for a frame to be declared combed. See the combpel parameter
12000 description for more info. Possible values are any number that is
12001 a power of 2 starting at 4 and going up to 512.
12002
12003 Default value is 16.
12004
12005 combpel
12006 The number of combed pixels inside any of the blocky by blockx size
12007 blocks on the frame for the frame to be detected as combed. While
12008 cthresh controls how "visible" the combing must be, this setting
12009 controls "how much" combing there must be in any localized area (a
12010 window defined by the blockx and blocky settings) on the frame.
12011 Minimum value is 0 and maximum is "blocky x blockx" (at which point
12012 no frames will ever be detected as combed). This setting is known
12013 as MI in TFM/VFM vocabulary.
12014
12015 Default value is 80.
12016
12017 p/c/n/u/b meaning
12018
12019 p/c/n
12020
12021 We assume the following telecined stream:
12022
12023 Top fields: 1 2 2 3 4
12024 Bottom fields: 1 2 3 4 4
12025
12026 The numbers correspond to the progressive frame the fields relate to.
12027 Here, the first two frames are progressive, the 3rd and 4th are combed,
12028 and so on.
12029
12030 When "fieldmatch" is configured to run a matching from bottom
12031 (field=bottom) this is how this input stream get transformed:
12032
12033 Input stream:
12034 T 1 2 2 3 4
12035 B 1 2 3 4 4 <-- matching reference
12036
12037 Matches: c c n n c
12038
12039 Output stream:
12040 T 1 2 3 4 4
12041 B 1 2 3 4 4
12042
12043 As a result of the field matching, we can see that some frames get
12044 duplicated. To perform a complete inverse telecine, you need to rely
12045 on a decimation filter after this operation. See for instance the
12046 decimate filter.
12047
12048 The same operation now matching from top fields (field=top) looks like
12049 this:
12050
12051 Input stream:
12052 T 1 2 2 3 4 <-- matching reference
12053 B 1 2 3 4 4
12054
12055 Matches: c c p p c
12056
12057 Output stream:
12058 T 1 2 2 3 4
12059 B 1 2 2 3 4
12060
12061 In these examples, we can see what p, c and n mean; basically, they
12062 refer to the frame and field of the opposite parity:
12063
12064 *<p matches the field of the opposite parity in the previous frame>
12065 *<c matches the field of the opposite parity in the current frame>
12066 *<n matches the field of the opposite parity in the next frame>
12067
12068 u/b
12069
12070 The u and b matching are a bit special in the sense that they match
12071 from the opposite parity flag. In the following examples, we assume
12072 that we are currently matching the 2nd frame (Top:2, bottom:2).
12073 According to the match, a 'x' is placed above and below each matched
12074 fields.
12075
12076 With bottom matching (field=bottom):
12077
12078 Match: c p n b u
12079
12080 x x x x x
12081 Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
12082 Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
12083 x x x x x
12084
12085 Output frames:
12086 2 1 2 2 2
12087 2 2 2 1 3
12088
12089 With top matching (field=top):
12090
12091 Match: c p n b u
12092
12093 x x x x x
12094 Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
12095 Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
12096 x x x x x
12097
12098 Output frames:
12099 2 2 2 1 2
12100 2 1 3 2 2
12101
12102 Examples
12103
12104 Simple IVTC of a top field first telecined stream:
12105
12106 fieldmatch=order=tff:combmatch=none, decimate
12107
12108 Advanced IVTC, with fallback on yadif for still combed frames:
12109
12110 fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
12111
12112 fieldorder
12113 Transform the field order of the input video.
12114
12115 It accepts the following parameters:
12116
12117 order
12118 The output field order. Valid values are tff for top field first or
12119 bff for bottom field first.
12120
12121 The default value is tff.
12122
12123 The transformation is done by shifting the picture content up or down
12124 by one line, and filling the remaining line with appropriate picture
12125 content. This method is consistent with most broadcast field order
12126 converters.
12127
12128 If the input video is not flagged as being interlaced, or it is already
12129 flagged as being of the required output field order, then this filter
12130 does not alter the incoming video.
12131
12132 It is very useful when converting to or from PAL DV material, which is
12133 bottom field first.
12134
12135 For example:
12136
12137 ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
12138
12139 fifo, afifo
12140 Buffer input images and send them when they are requested.
12141
12142 It is mainly useful when auto-inserted by the libavfilter framework.
12143
12144 It does not take parameters.
12145
12146 fillborders
12147 Fill borders of the input video, without changing video stream
12148 dimensions. Sometimes video can have garbage at the four edges and you
12149 may not want to crop video input to keep size multiple of some number.
12150
12151 This filter accepts the following options:
12152
12153 left
12154 Number of pixels to fill from left border.
12155
12156 right
12157 Number of pixels to fill from right border.
12158
12159 top Number of pixels to fill from top border.
12160
12161 bottom
12162 Number of pixels to fill from bottom border.
12163
12164 mode
12165 Set fill mode.
12166
12167 It accepts the following values:
12168
12169 smear
12170 fill pixels using outermost pixels
12171
12172 mirror
12173 fill pixels using mirroring (half sample symmetric)
12174
12175 fixed
12176 fill pixels with constant value
12177
12178 reflect
12179 fill pixels using reflecting (whole sample symmetric)
12180
12181 wrap
12182 fill pixels using wrapping
12183
12184 fade
12185 fade pixels to constant value
12186
12187 margins
12188 fill pixels at top and bottom with weighted averages pixels
12189 near borders
12190
12191 Default is smear.
12192
12193 color
12194 Set color for pixels in fixed or fade mode. Default is black.
12195
12196 Commands
12197
12198 This filter supports same commands as options. The command accepts the
12199 same syntax of the corresponding option.
12200
12201 If the specified expression is not valid, it is kept at its current
12202 value.
12203
12204 find_rect
12205 Find a rectangular object
12206
12207 It accepts the following options:
12208
12209 object
12210 Filepath of the object image, needs to be in gray8.
12211
12212 threshold
12213 Detection threshold, default is 0.5.
12214
12215 mipmaps
12216 Number of mipmaps, default is 3.
12217
12218 xmin, ymin, xmax, ymax
12219 Specifies the rectangle in which to search.
12220
12221 discard
12222 Discard frames where object is not detected. Default is disabled.
12223
12224 Examples
12225
12226 • Cover a rectangular object by the supplied image of a given video
12227 using ffmpeg:
12228
12229 ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
12230
12231 floodfill
12232 Flood area with values of same pixel components with another values.
12233
12234 It accepts the following options:
12235
12236 x Set pixel x coordinate.
12237
12238 y Set pixel y coordinate.
12239
12240 s0 Set source #0 component value.
12241
12242 s1 Set source #1 component value.
12243
12244 s2 Set source #2 component value.
12245
12246 s3 Set source #3 component value.
12247
12248 d0 Set destination #0 component value.
12249
12250 d1 Set destination #1 component value.
12251
12252 d2 Set destination #2 component value.
12253
12254 d3 Set destination #3 component value.
12255
12256 format
12257 Convert the input video to one of the specified pixel formats.
12258 Libavfilter will try to pick one that is suitable as input to the next
12259 filter.
12260
12261 It accepts the following parameters:
12262
12263 pix_fmts
12264 A '|'-separated list of pixel format names, such as
12265 "pix_fmts=yuv420p|monow|rgb24".
12266
12267 Examples
12268
12269 • Convert the input video to the yuv420p format
12270
12271 format=pix_fmts=yuv420p
12272
12273 Convert the input video to any of the formats in the list
12274
12275 format=pix_fmts=yuv420p|yuv444p|yuv410p
12276
12277 fps
12278 Convert the video to specified constant frame rate by duplicating or
12279 dropping frames as necessary.
12280
12281 It accepts the following parameters:
12282
12283 fps The desired output frame rate. It accepts expressions containing
12284 the following constants:
12285
12286 source_fps
12287 The input's frame rate
12288
12289 ntsc
12290 NTSC frame rate of "30000/1001"
12291
12292 pal PAL frame rate of 25.0
12293
12294 film
12295 Film frame rate of 24.0
12296
12297 ntsc_film
12298 NTSC-film frame rate of "24000/1001"
12299
12300 The default is 25.
12301
12302 start_time
12303 Assume the first PTS should be the given value, in seconds. This
12304 allows for padding/trimming at the start of stream. By default, no
12305 assumption is made about the first frame's expected PTS, so no
12306 padding or trimming is done. For example, this could be set to 0
12307 to pad the beginning with duplicates of the first frame if a video
12308 stream starts after the audio stream or to trim any frames with a
12309 negative PTS.
12310
12311 round
12312 Timestamp (PTS) rounding method.
12313
12314 Possible values are:
12315
12316 zero
12317 round towards 0
12318
12319 inf round away from 0
12320
12321 down
12322 round towards -infinity
12323
12324 up round towards +infinity
12325
12326 near
12327 round to nearest
12328
12329 The default is "near".
12330
12331 eof_action
12332 Action performed when reading the last frame.
12333
12334 Possible values are:
12335
12336 round
12337 Use same timestamp rounding method as used for other frames.
12338
12339 pass
12340 Pass through last frame if input duration has not been reached
12341 yet.
12342
12343 The default is "round".
12344
12345 Alternatively, the options can be specified as a flat string:
12346 fps[:start_time[:round]].
12347
12348 See also the setpts filter.
12349
12350 Examples
12351
12352 • A typical usage in order to set the fps to 25:
12353
12354 fps=fps=25
12355
12356 • Sets the fps to 24, using abbreviation and rounding method to round
12357 to nearest:
12358
12359 fps=fps=film:round=near
12360
12361 framepack
12362 Pack two different video streams into a stereoscopic video, setting
12363 proper metadata on supported codecs. The two views should have the same
12364 size and framerate and processing will stop when the shorter video
12365 ends. Please note that you may conveniently adjust view properties with
12366 the scale and fps filters.
12367
12368 It accepts the following parameters:
12369
12370 format
12371 The desired packing format. Supported values are:
12372
12373 sbs The views are next to each other (default).
12374
12375 tab The views are on top of each other.
12376
12377 lines
12378 The views are packed by line.
12379
12380 columns
12381 The views are packed by column.
12382
12383 frameseq
12384 The views are temporally interleaved.
12385
12386 Some examples:
12387
12388 # Convert left and right views into a frame-sequential video
12389 ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
12390
12391 # Convert views into a side-by-side video with the same output resolution as the input
12392 ffmpeg -i LEFT -i RIGHT -filter_complex [0:v]scale=w=iw/2[left],[1:v]scale=w=iw/2[right],[left][right]framepack=sbs OUTPUT
12393
12394 framerate
12395 Change the frame rate by interpolating new video output frames from the
12396 source frames.
12397
12398 This filter is not designed to function correctly with interlaced
12399 media. If you wish to change the frame rate of interlaced media then
12400 you are required to deinterlace before this filter and re-interlace
12401 after this filter.
12402
12403 A description of the accepted options follows.
12404
12405 fps Specify the output frames per second. This option can also be
12406 specified as a value alone. The default is 50.
12407
12408 interp_start
12409 Specify the start of a range where the output frame will be created
12410 as a linear interpolation of two frames. The range is [0-255], the
12411 default is 15.
12412
12413 interp_end
12414 Specify the end of a range where the output frame will be created
12415 as a linear interpolation of two frames. The range is [0-255], the
12416 default is 240.
12417
12418 scene
12419 Specify the level at which a scene change is detected as a value
12420 between 0 and 100 to indicate a new scene; a low value reflects a
12421 low probability for the current frame to introduce a new scene,
12422 while a higher value means the current frame is more likely to be
12423 one. The default is 8.2.
12424
12425 flags
12426 Specify flags influencing the filter process.
12427
12428 Available value for flags is:
12429
12430 scene_change_detect, scd
12431 Enable scene change detection using the value of the option
12432 scene. This flag is enabled by default.
12433
12434 framestep
12435 Select one frame every N-th frame.
12436
12437 This filter accepts the following option:
12438
12439 step
12440 Select frame after every "step" frames. Allowed values are
12441 positive integers higher than 0. Default value is 1.
12442
12443 freezedetect
12444 Detect frozen video.
12445
12446 This filter logs a message and sets frame metadata when it detects that
12447 the input video has no significant change in content during a specified
12448 duration. Video freeze detection calculates the mean average absolute
12449 difference of all the components of video frames and compares it to a
12450 noise floor.
12451
12452 The printed times and duration are expressed in seconds. The
12453 "lavfi.freezedetect.freeze_start" metadata key is set on the first
12454 frame whose timestamp equals or exceeds the detection duration and it
12455 contains the timestamp of the first frame of the freeze. The
12456 "lavfi.freezedetect.freeze_duration" and
12457 "lavfi.freezedetect.freeze_end" metadata keys are set on the first
12458 frame after the freeze.
12459
12460 The filter accepts the following options:
12461
12462 noise, n
12463 Set noise tolerance. Can be specified in dB (in case "dB" is
12464 appended to the specified value) or as a difference ratio between 0
12465 and 1. Default is -60dB, or 0.001.
12466
12467 duration, d
12468 Set freeze duration until notification (default is 2 seconds).
12469
12470 freezeframes
12471 Freeze video frames.
12472
12473 This filter freezes video frames using frame from 2nd input.
12474
12475 The filter accepts the following options:
12476
12477 first
12478 Set number of first frame from which to start freeze.
12479
12480 last
12481 Set number of last frame from which to end freeze.
12482
12483 replace
12484 Set number of frame from 2nd input which will be used instead of
12485 replaced frames.
12486
12487 frei0r
12488 Apply a frei0r effect to the input video.
12489
12490 To enable the compilation of this filter, you need to install the
12491 frei0r header and configure FFmpeg with "--enable-frei0r".
12492
12493 It accepts the following parameters:
12494
12495 filter_name
12496 The name of the frei0r effect to load. If the environment variable
12497 FREI0R_PATH is defined, the frei0r effect is searched for in each
12498 of the directories specified by the colon-separated list in
12499 FREI0R_PATH. Otherwise, the standard frei0r paths are searched, in
12500 this order: HOME/.frei0r-1/lib/, /usr/local/lib/frei0r-1/,
12501 /usr/lib/frei0r-1/.
12502
12503 filter_params
12504 A '|'-separated list of parameters to pass to the frei0r effect.
12505
12506 A frei0r effect parameter can be a boolean (its value is either "y" or
12507 "n"), a double, a color (specified as R/G/B, where R, G, and B are
12508 floating point numbers between 0.0 and 1.0, inclusive) or a color
12509 description as specified in the "Color" section in the ffmpeg-utils
12510 manual, a position (specified as X/Y, where X and Y are floating point
12511 numbers) and/or a string.
12512
12513 The number and types of parameters depend on the loaded effect. If an
12514 effect parameter is not specified, the default value is set.
12515
12516 Examples
12517
12518 • Apply the distort0r effect, setting the first two double
12519 parameters:
12520
12521 frei0r=filter_name=distort0r:filter_params=0.5|0.01
12522
12523 • Apply the colordistance effect, taking a color as the first
12524 parameter:
12525
12526 frei0r=colordistance:0.2/0.3/0.4
12527 frei0r=colordistance:violet
12528 frei0r=colordistance:0x112233
12529
12530 • Apply the perspective effect, specifying the top left and top right
12531 image positions:
12532
12533 frei0r=perspective:0.2/0.2|0.8/0.2
12534
12535 For more information, see <http://frei0r.dyne.org>
12536
12537 Commands
12538
12539 This filter supports the filter_params option as commands.
12540
12541 fspp
12542 Apply fast and simple postprocessing. It is a faster version of spp.
12543
12544 It splits (I)DCT into horizontal/vertical passes. Unlike the simple
12545 post- processing filter, one of them is performed once per block, not
12546 per pixel. This allows for much higher speed.
12547
12548 The filter accepts the following options:
12549
12550 quality
12551 Set quality. This option defines the number of levels for
12552 averaging. It accepts an integer in the range 4-5. Default value is
12553 4.
12554
12555 qp Force a constant quantization parameter. It accepts an integer in
12556 range 0-63. If not set, the filter will use the QP from the video
12557 stream (if available).
12558
12559 strength
12560 Set filter strength. It accepts an integer in range -15 to 32.
12561 Lower values mean more details but also more artifacts, while
12562 higher values make the image smoother but also blurrier. Default
12563 value is 0 − PSNR optimal.
12564
12565 use_bframe_qp
12566 Enable the use of the QP from the B-Frames if set to 1. Using this
12567 option may cause flicker since the B-Frames have often larger QP.
12568 Default is 0 (not enabled).
12569
12570 gblur
12571 Apply Gaussian blur filter.
12572
12573 The filter accepts the following options:
12574
12575 sigma
12576 Set horizontal sigma, standard deviation of Gaussian blur. Default
12577 is 0.5.
12578
12579 steps
12580 Set number of steps for Gaussian approximation. Default is 1.
12581
12582 planes
12583 Set which planes to filter. By default all planes are filtered.
12584
12585 sigmaV
12586 Set vertical sigma, if negative it will be same as "sigma".
12587 Default is -1.
12588
12589 Commands
12590
12591 This filter supports same commands as options. The command accepts the
12592 same syntax of the corresponding option.
12593
12594 If the specified expression is not valid, it is kept at its current
12595 value.
12596
12597 geq
12598 Apply generic equation to each pixel.
12599
12600 The filter accepts the following options:
12601
12602 lum_expr, lum
12603 Set the luminance expression.
12604
12605 cb_expr, cb
12606 Set the chrominance blue expression.
12607
12608 cr_expr, cr
12609 Set the chrominance red expression.
12610
12611 alpha_expr, a
12612 Set the alpha expression.
12613
12614 red_expr, r
12615 Set the red expression.
12616
12617 green_expr, g
12618 Set the green expression.
12619
12620 blue_expr, b
12621 Set the blue expression.
12622
12623 The colorspace is selected according to the specified options. If one
12624 of the lum_expr, cb_expr, or cr_expr options is specified, the filter
12625 will automatically select a YCbCr colorspace. If one of the red_expr,
12626 green_expr, or blue_expr options is specified, it will select an RGB
12627 colorspace.
12628
12629 If one of the chrominance expression is not defined, it falls back on
12630 the other one. If no alpha expression is specified it will evaluate to
12631 opaque value. If none of chrominance expressions are specified, they
12632 will evaluate to the luminance expression.
12633
12634 The expressions can use the following variables and functions:
12635
12636 N The sequential number of the filtered frame, starting from 0.
12637
12638 X
12639 Y The coordinates of the current sample.
12640
12641 W
12642 H The width and height of the image.
12643
12644 SW
12645 SH Width and height scale depending on the currently filtered plane.
12646 It is the ratio between the corresponding luma plane number of
12647 pixels and the current plane ones. E.g. for YUV4:2:0 the values are
12648 "1,1" for the luma plane, and "0.5,0.5" for chroma planes.
12649
12650 T Time of the current frame, expressed in seconds.
12651
12652 p(x, y)
12653 Return the value of the pixel at location (x,y) of the current
12654 plane.
12655
12656 lum(x, y)
12657 Return the value of the pixel at location (x,y) of the luminance
12658 plane.
12659
12660 cb(x, y)
12661 Return the value of the pixel at location (x,y) of the blue-
12662 difference chroma plane. Return 0 if there is no such plane.
12663
12664 cr(x, y)
12665 Return the value of the pixel at location (x,y) of the red-
12666 difference chroma plane. Return 0 if there is no such plane.
12667
12668 r(x, y)
12669 g(x, y)
12670 b(x, y)
12671 Return the value of the pixel at location (x,y) of the
12672 red/green/blue component. Return 0 if there is no such component.
12673
12674 alpha(x, y)
12675 Return the value of the pixel at location (x,y) of the alpha plane.
12676 Return 0 if there is no such plane.
12677
12678 psum(x,y), lumsum(x, y), cbsum(x,y), crsum(x,y), rsum(x,y), gsum(x,y),
12679 bsum(x,y), alphasum(x,y)
12680 Sum of sample values in the rectangle from (0,0) to (x,y), this
12681 allows obtaining sums of samples within a rectangle. See the
12682 functions without the sum postfix.
12683
12684 interpolation
12685 Set one of interpolation methods:
12686
12687 nearest, n
12688 bilinear, b
12689
12690 Default is bilinear.
12691
12692 For functions, if x and y are outside the area, the value will be
12693 automatically clipped to the closer edge.
12694
12695 Please note that this filter can use multiple threads in which case
12696 each slice will have its own expression state. If you want to use only
12697 a single expression state because your expressions depend on previous
12698 state then you should limit the number of filter threads to 1.
12699
12700 Examples
12701
12702 • Flip the image horizontally:
12703
12704 geq=p(W-X\,Y)
12705
12706 • Generate a bidimensional sine wave, with angle "PI/3" and a
12707 wavelength of 100 pixels:
12708
12709 geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
12710
12711 • Generate a fancy enigmatic moving light:
12712
12713 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
12714
12715 • Generate a quick emboss effect:
12716
12717 format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
12718
12719 • Modify RGB components depending on pixel position:
12720
12721 geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'
12722
12723 • Create a radial gradient that is the same size as the input (also
12724 see the vignette filter):
12725
12726 geq=lum=255*gauss((X/W-0.5)*3)*gauss((Y/H-0.5)*3)/gauss(0)/gauss(0),format=gray
12727
12728 gradfun
12729 Fix the banding artifacts that are sometimes introduced into nearly
12730 flat regions by truncation to 8-bit color depth. Interpolate the
12731 gradients that should go where the bands are, and dither them.
12732
12733 It is designed for playback only. Do not use it prior to lossy
12734 compression, because compression tends to lose the dither and bring
12735 back the bands.
12736
12737 It accepts the following parameters:
12738
12739 strength
12740 The maximum amount by which the filter will change any one pixel.
12741 This is also the threshold for detecting nearly flat regions.
12742 Acceptable values range from .51 to 64; the default value is 1.2.
12743 Out-of-range values will be clipped to the valid range.
12744
12745 radius
12746 The neighborhood to fit the gradient to. A larger radius makes for
12747 smoother gradients, but also prevents the filter from modifying the
12748 pixels near detailed regions. Acceptable values are 8-32; the
12749 default value is 16. Out-of-range values will be clipped to the
12750 valid range.
12751
12752 Alternatively, the options can be specified as a flat string:
12753 strength[:radius]
12754
12755 Examples
12756
12757 • Apply the filter with a 3.5 strength and radius of 8:
12758
12759 gradfun=3.5:8
12760
12761 • Specify radius, omitting the strength (which will fall-back to the
12762 default value):
12763
12764 gradfun=radius=8
12765
12766 graphmonitor
12767 Show various filtergraph stats.
12768
12769 With this filter one can debug complete filtergraph. Especially issues
12770 with links filling with queued frames.
12771
12772 The filter accepts the following options:
12773
12774 size, s
12775 Set video output size. Default is hd720.
12776
12777 opacity, o
12778 Set video opacity. Default is 0.9. Allowed range is from 0 to 1.
12779
12780 mode, m
12781 Set output mode, can be fulll or compact. In compact mode only
12782 filters with some queued frames have displayed stats.
12783
12784 flags, f
12785 Set flags which enable which stats are shown in video.
12786
12787 Available values for flags are:
12788
12789 queue
12790 Display number of queued frames in each link.
12791
12792 frame_count_in
12793 Display number of frames taken from filter.
12794
12795 frame_count_out
12796 Display number of frames given out from filter.
12797
12798 frame_count_delta
12799 Display delta number of frames between above two values.
12800
12801 pts Display current filtered frame pts.
12802
12803 pts_delta
12804 Display pts delta between current and previous frame.
12805
12806 time
12807 Display current filtered frame time.
12808
12809 time_delta
12810 Display time delta between current and previous frame.
12811
12812 timebase
12813 Display time base for filter link.
12814
12815 format
12816 Display used format for filter link.
12817
12818 size
12819 Display video size or number of audio channels in case of audio
12820 used by filter link.
12821
12822 rate
12823 Display video frame rate or sample rate in case of audio used
12824 by filter link.
12825
12826 eof Display link output status.
12827
12828 sample_count_in
12829 Display number of samples taken from filter.
12830
12831 sample_count_out
12832 Display number of samples given out from filter.
12833
12834 sample_count_delta
12835 Display delta number of samples between above two values.
12836
12837 rate, r
12838 Set upper limit for video rate of output stream, Default value is
12839 25. This guarantee that output video frame rate will not be higher
12840 than this value.
12841
12842 grayworld
12843 A color constancy filter that applies color correction based on the
12844 grayworld assumption
12845
12846 See:
12847 <https://www.researchgate.net/publication/275213614_A_New_Color_Correction_Method_for_Underwater_Imaging>
12848
12849 The algorithm uses linear light, so input data should be linearized
12850 beforehand (and possibly correctly tagged).
12851
12852 ffmpeg -i INPUT -vf zscale=transfer=linear,grayworld,zscale=transfer=bt709,format=yuv420p OUTPUT
12853
12854 greyedge
12855 A color constancy variation filter which estimates scene illumination
12856 via grey edge algorithm and corrects the scene colors accordingly.
12857
12858 See: <https://staff.science.uva.nl/th.gevers/pub/GeversTIP07.pdf>
12859
12860 The filter accepts the following options:
12861
12862 difford
12863 The order of differentiation to be applied on the scene. Must be
12864 chosen in the range [0,2] and default value is 1.
12865
12866 minknorm
12867 The Minkowski parameter to be used for calculating the Minkowski
12868 distance. Must be chosen in the range [0,20] and default value is
12869 1. Set to 0 for getting max value instead of calculating Minkowski
12870 distance.
12871
12872 sigma
12873 The standard deviation of Gaussian blur to be applied on the scene.
12874 Must be chosen in the range [0,1024.0] and default value = 1.
12875 floor( sigma * break_off_sigma(3) ) can't be equal to 0 if difford
12876 is greater than 0.
12877
12878 Examples
12879
12880 • Grey Edge:
12881
12882 greyedge=difford=1:minknorm=5:sigma=2
12883
12884 • Max Edge:
12885
12886 greyedge=difford=1:minknorm=0:sigma=2
12887
12888 guided
12889 Apply guided filter for edge-preserving smoothing, dehazing and so on.
12890
12891 The filter accepts the following options:
12892
12893 radius
12894 Set the box radius in pixels. Allowed range is 1 to 20. Default is
12895 3.
12896
12897 eps Set regularization parameter (with square). Allowed range is 0 to
12898 1. Default is 0.01.
12899
12900 mode
12901 Set filter mode. Can be "basic" or "fast". Default is "basic".
12902
12903 sub Set subsampling ratio for "fast" mode. Range is 2 to 64. Default
12904 is 4. No subsampling occurs in "basic" mode.
12905
12906 guidance
12907 Set guidance mode. Can be "off" or "on". Default is "off". If
12908 "off", single input is required. If "on", two inputs of the same
12909 resolution and pixel format are required. The second input serves
12910 as the guidance.
12911
12912 planes
12913 Set planes to filter. Default is first only.
12914
12915 Commands
12916
12917 This filter supports the all above options as commands.
12918
12919 Examples
12920
12921 • Edge-preserving smoothing with guided filter:
12922
12923 ffmpeg -i in.png -vf guided out.png
12924
12925 • Dehazing, structure-transferring filtering, detail enhancement with
12926 guided filter. For the generation of guidance image, refer to
12927 paper "Guided Image Filtering". See:
12928 <http://kaiminghe.com/publications/pami12guidedfilter.pdf>.
12929
12930 ffmpeg -i in.png -i guidance.png -filter_complex guided=guidance=on out.png
12931
12932 haldclut
12933 Apply a Hald CLUT to a video stream.
12934
12935 First input is the video stream to process, and second one is the Hald
12936 CLUT. The Hald CLUT input can be a simple picture or a complete video
12937 stream.
12938
12939 The filter accepts the following options:
12940
12941 clut
12942 Set which CLUT video frames will be processed from second input
12943 stream, can be first or all. Default is all.
12944
12945 shortest
12946 Force termination when the shortest input terminates. Default is 0.
12947
12948 repeatlast
12949 Continue applying the last CLUT after the end of the stream. A
12950 value of 0 disable the filter after the last frame of the CLUT is
12951 reached. Default is 1.
12952
12953 "haldclut" also has the same interpolation options as lut3d (both
12954 filters share the same internals).
12955
12956 This filter also supports the framesync options.
12957
12958 More information about the Hald CLUT can be found on Eskil Steenberg's
12959 website (Hald CLUT author) at
12960 <http://www.quelsolaar.com/technology/clut.html>.
12961
12962 Commands
12963
12964 This filter supports the "interp" option as commands.
12965
12966 Workflow examples
12967
12968 Hald CLUT video stream
12969
12970 Generate an identity Hald CLUT stream altered with various effects:
12971
12972 ffmpeg -f lavfi -i B<haldclutsrc>=8 -vf "hue=H=2*PI*t:s=sin(2*PI*t)+1, curves=cross_process" -t 10 -c:v ffv1 clut.nut
12973
12974 Note: make sure you use a lossless codec.
12975
12976 Then use it with "haldclut" to apply it on some random stream:
12977
12978 ffmpeg -f lavfi -i mandelbrot -i clut.nut -filter_complex '[0][1] haldclut' -t 20 mandelclut.mkv
12979
12980 The Hald CLUT will be applied to the 10 first seconds (duration of
12981 clut.nut), then the latest picture of that CLUT stream will be applied
12982 to the remaining frames of the "mandelbrot" stream.
12983
12984 Hald CLUT with preview
12985
12986 A Hald CLUT is supposed to be a squared image of "Level*Level*Level" by
12987 "Level*Level*Level" pixels. For a given Hald CLUT, FFmpeg will select
12988 the biggest possible square starting at the top left of the picture.
12989 The remaining padding pixels (bottom or right) will be ignored. This
12990 area can be used to add a preview of the Hald CLUT.
12991
12992 Typically, the following generated Hald CLUT will be supported by the
12993 "haldclut" filter:
12994
12995 ffmpeg -f lavfi -i B<haldclutsrc>=8 -vf "
12996 pad=iw+320 [padded_clut];
12997 smptebars=s=320x256, split [a][b];
12998 [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
12999 [main][b] overlay=W-320" -frames:v 1 clut.png
13000
13001 It contains the original and a preview of the effect of the CLUT: SMPTE
13002 color bars are displayed on the right-top, and below the same color
13003 bars processed by the color changes.
13004
13005 Then, the effect of this Hald CLUT can be visualized with:
13006
13007 ffplay input.mkv -vf "movie=clut.png, [in] haldclut"
13008
13009 hflip
13010 Flip the input video horizontally.
13011
13012 For example, to horizontally flip the input video with ffmpeg:
13013
13014 ffmpeg -i in.avi -vf "hflip" out.avi
13015
13016 histeq
13017 This filter applies a global color histogram equalization on a per-
13018 frame basis.
13019
13020 It can be used to correct video that has a compressed range of pixel
13021 intensities. The filter redistributes the pixel intensities to
13022 equalize their distribution across the intensity range. It may be
13023 viewed as an "automatically adjusting contrast filter". This filter is
13024 useful only for correcting degraded or poorly captured source video.
13025
13026 The filter accepts the following options:
13027
13028 strength
13029 Determine the amount of equalization to be applied. As the
13030 strength is reduced, the distribution of pixel intensities more-
13031 and-more approaches that of the input frame. The value must be a
13032 float number in the range [0,1] and defaults to 0.200.
13033
13034 intensity
13035 Set the maximum intensity that can generated and scale the output
13036 values appropriately. The strength should be set as desired and
13037 then the intensity can be limited if needed to avoid washing-out.
13038 The value must be a float number in the range [0,1] and defaults to
13039 0.210.
13040
13041 antibanding
13042 Set the antibanding level. If enabled the filter will randomly vary
13043 the luminance of output pixels by a small amount to avoid banding
13044 of the histogram. Possible values are "none", "weak" or "strong".
13045 It defaults to "none".
13046
13047 histogram
13048 Compute and draw a color distribution histogram for the input video.
13049
13050 The computed histogram is a representation of the color component
13051 distribution in an image.
13052
13053 Standard histogram displays the color components distribution in an
13054 image. Displays color graph for each color component. Shows
13055 distribution of the Y, U, V, A or R, G, B components, depending on
13056 input format, in the current frame. Below each graph a color component
13057 scale meter is shown.
13058
13059 The filter accepts the following options:
13060
13061 level_height
13062 Set height of level. Default value is 200. Allowed range is [50,
13063 2048].
13064
13065 scale_height
13066 Set height of color scale. Default value is 12. Allowed range is
13067 [0, 40].
13068
13069 display_mode
13070 Set display mode. It accepts the following values:
13071
13072 stack
13073 Per color component graphs are placed below each other.
13074
13075 parade
13076 Per color component graphs are placed side by side.
13077
13078 overlay
13079 Presents information identical to that in the "parade", except
13080 that the graphs representing color components are superimposed
13081 directly over one another.
13082
13083 Default is "stack".
13084
13085 levels_mode
13086 Set mode. Can be either "linear", or "logarithmic". Default is
13087 "linear".
13088
13089 components
13090 Set what color components to display. Default is 7.
13091
13092 fgopacity
13093 Set foreground opacity. Default is 0.7.
13094
13095 bgopacity
13096 Set background opacity. Default is 0.5.
13097
13098 colors_mode
13099 Set colors mode. It accepts the following values:
13100
13101 whiteonblack
13102 blackonwhite
13103 whiteongray
13104 blackongray
13105 coloronblack
13106 coloronwhite
13107 colorongray
13108 blackoncolor
13109 whiteoncolor
13110 grayoncolor
13111
13112 Default is "whiteonblack".
13113
13114 Examples
13115
13116 • Calculate and draw histogram:
13117
13118 ffplay -i input -vf histogram
13119
13120 hqdn3d
13121 This is a high precision/quality 3d denoise filter. It aims to reduce
13122 image noise, producing smooth images and making still images really
13123 still. It should enhance compressibility.
13124
13125 It accepts the following optional parameters:
13126
13127 luma_spatial
13128 A non-negative floating point number which specifies spatial luma
13129 strength. It defaults to 4.0.
13130
13131 chroma_spatial
13132 A non-negative floating point number which specifies spatial chroma
13133 strength. It defaults to 3.0*luma_spatial/4.0.
13134
13135 luma_tmp
13136 A floating point number which specifies luma temporal strength. It
13137 defaults to 6.0*luma_spatial/4.0.
13138
13139 chroma_tmp
13140 A floating point number which specifies chroma temporal strength.
13141 It defaults to luma_tmp*chroma_spatial/luma_spatial.
13142
13143 Commands
13144
13145 This filter supports same commands as options. The command accepts the
13146 same syntax of the corresponding option.
13147
13148 If the specified expression is not valid, it is kept at its current
13149 value.
13150
13151 hwdownload
13152 Download hardware frames to system memory.
13153
13154 The input must be in hardware frames, and the output a non-hardware
13155 format. Not all formats will be supported on the output - it may be
13156 necessary to insert an additional format filter immediately following
13157 in the graph to get the output in a supported format.
13158
13159 hwmap
13160 Map hardware frames to system memory or to another device.
13161
13162 This filter has several different modes of operation; which one is used
13163 depends on the input and output formats:
13164
13165 • Hardware frame input, normal frame output
13166
13167 Map the input frames to system memory and pass them to the output.
13168 If the original hardware frame is later required (for example,
13169 after overlaying something else on part of it), the hwmap filter
13170 can be used again in the next mode to retrieve it.
13171
13172 • Normal frame input, hardware frame output
13173
13174 If the input is actually a software-mapped hardware frame, then
13175 unmap it - that is, return the original hardware frame.
13176
13177 Otherwise, a device must be provided. Create new hardware surfaces
13178 on that device for the output, then map them back to the software
13179 format at the input and give those frames to the preceding filter.
13180 This will then act like the hwupload filter, but may be able to
13181 avoid an additional copy when the input is already in a compatible
13182 format.
13183
13184 • Hardware frame input and output
13185
13186 A device must be supplied for the output, either directly or with
13187 the derive_device option. The input and output devices must be of
13188 different types and compatible - the exact meaning of this is
13189 system-dependent, but typically it means that they must refer to
13190 the same underlying hardware context (for example, refer to the
13191 same graphics card).
13192
13193 If the input frames were originally created on the output device,
13194 then unmap to retrieve the original frames.
13195
13196 Otherwise, map the frames to the output device - create new
13197 hardware frames on the output corresponding to the frames on the
13198 input.
13199
13200 The following additional parameters are accepted:
13201
13202 mode
13203 Set the frame mapping mode. Some combination of:
13204
13205 read
13206 The mapped frame should be readable.
13207
13208 write
13209 The mapped frame should be writeable.
13210
13211 overwrite
13212 The mapping will always overwrite the entire frame.
13213
13214 This may improve performance in some cases, as the original
13215 contents of the frame need not be loaded.
13216
13217 direct
13218 The mapping must not involve any copying.
13219
13220 Indirect mappings to copies of frames are created in some cases
13221 where either direct mapping is not possible or it would have
13222 unexpected properties. Setting this flag ensures that the
13223 mapping is direct and will fail if that is not possible.
13224
13225 Defaults to read+write if not specified.
13226
13227 derive_device type
13228 Rather than using the device supplied at initialisation, instead
13229 derive a new device of type type from the device the input frames
13230 exist on.
13231
13232 reverse
13233 In a hardware to hardware mapping, map in reverse - create frames
13234 in the sink and map them back to the source. This may be necessary
13235 in some cases where a mapping in one direction is required but only
13236 the opposite direction is supported by the devices being used.
13237
13238 This option is dangerous - it may break the preceding filter in
13239 undefined ways if there are any additional constraints on that
13240 filter's output. Do not use it without fully understanding the
13241 implications of its use.
13242
13243 hwupload
13244 Upload system memory frames to hardware surfaces.
13245
13246 The device to upload to must be supplied when the filter is
13247 initialised. If using ffmpeg, select the appropriate device with the
13248 -filter_hw_device option or with the derive_device option. The input
13249 and output devices must be of different types and compatible - the
13250 exact meaning of this is system-dependent, but typically it means that
13251 they must refer to the same underlying hardware context (for example,
13252 refer to the same graphics card).
13253
13254 The following additional parameters are accepted:
13255
13256 derive_device type
13257 Rather than using the device supplied at initialisation, instead
13258 derive a new device of type type from the device the input frames
13259 exist on.
13260
13261 hwupload_cuda
13262 Upload system memory frames to a CUDA device.
13263
13264 It accepts the following optional parameters:
13265
13266 device
13267 The number of the CUDA device to use
13268
13269 hqx
13270 Apply a high-quality magnification filter designed for pixel art. This
13271 filter was originally created by Maxim Stepin.
13272
13273 It accepts the following option:
13274
13275 n Set the scaling dimension: 2 for "hq2x", 3 for "hq3x" and 4 for
13276 "hq4x". Default is 3.
13277
13278 hstack
13279 Stack input videos horizontally.
13280
13281 All streams must be of same pixel format and of same height.
13282
13283 Note that this filter is faster than using overlay and pad filter to
13284 create same output.
13285
13286 The filter accepts the following option:
13287
13288 inputs
13289 Set number of input streams. Default is 2.
13290
13291 shortest
13292 If set to 1, force the output to terminate when the shortest input
13293 terminates. Default value is 0.
13294
13295 hsvhold
13296 Turns a certain HSV range into gray values.
13297
13298 This filter measures color difference between set HSV color in options
13299 and ones measured in video stream. Depending on options, output colors
13300 can be changed to be gray or not.
13301
13302 The filter accepts the following options:
13303
13304 hue Set the hue value which will be used in color difference
13305 calculation. Allowed range is from -360 to 360. Default value is
13306 0.
13307
13308 sat Set the saturation value which will be used in color difference
13309 calculation. Allowed range is from -1 to 1. Default value is 0.
13310
13311 val Set the value which will be used in color difference calculation.
13312 Allowed range is from -1 to 1. Default value is 0.
13313
13314 similarity
13315 Set similarity percentage with the key color. Allowed range is
13316 from 0 to 1. Default value is 0.01.
13317
13318 0.00001 matches only the exact key color, while 1.0 matches
13319 everything.
13320
13321 blend
13322 Blend percentage. Allowed range is from 0 to 1. Default value is
13323 0.
13324
13325 0.0 makes pixels either fully gray, or not gray at all.
13326
13327 Higher values result in more gray pixels, with a higher gray pixel
13328 the more similar the pixels color is to the key color.
13329
13330 hsvkey
13331 Turns a certain HSV range into transparency.
13332
13333 This filter measures color difference between set HSV color in options
13334 and ones measured in video stream. Depending on options, output colors
13335 can be changed to transparent by adding alpha channel.
13336
13337 The filter accepts the following options:
13338
13339 hue Set the hue value which will be used in color difference
13340 calculation. Allowed range is from -360 to 360. Default value is
13341 0.
13342
13343 sat Set the saturation value which will be used in color difference
13344 calculation. Allowed range is from -1 to 1. Default value is 0.
13345
13346 val Set the value which will be used in color difference calculation.
13347 Allowed range is from -1 to 1. Default value is 0.
13348
13349 similarity
13350 Set similarity percentage with the key color. Allowed range is
13351 from 0 to 1. Default value is 0.01.
13352
13353 0.00001 matches only the exact key color, while 1.0 matches
13354 everything.
13355
13356 blend
13357 Blend percentage. Allowed range is from 0 to 1. Default value is
13358 0.
13359
13360 0.0 makes pixels either fully transparent, or not transparent at
13361 all.
13362
13363 Higher values result in semi-transparent pixels, with a higher
13364 transparency the more similar the pixels color is to the key color.
13365
13366 hue
13367 Modify the hue and/or the saturation of the input.
13368
13369 It accepts the following parameters:
13370
13371 h Specify the hue angle as a number of degrees. It accepts an
13372 expression, and defaults to "0".
13373
13374 s Specify the saturation in the [-10,10] range. It accepts an
13375 expression and defaults to "1".
13376
13377 H Specify the hue angle as a number of radians. It accepts an
13378 expression, and defaults to "0".
13379
13380 b Specify the brightness in the [-10,10] range. It accepts an
13381 expression and defaults to "0".
13382
13383 h and H are mutually exclusive, and can't be specified at the same
13384 time.
13385
13386 The b, h, H and s option values are expressions containing the
13387 following constants:
13388
13389 n frame count of the input frame starting from 0
13390
13391 pts presentation timestamp of the input frame expressed in time base
13392 units
13393
13394 r frame rate of the input video, NAN if the input frame rate is
13395 unknown
13396
13397 t timestamp expressed in seconds, NAN if the input timestamp is
13398 unknown
13399
13400 tb time base of the input video
13401
13402 Examples
13403
13404 • Set the hue to 90 degrees and the saturation to 1.0:
13405
13406 hue=h=90:s=1
13407
13408 • Same command but expressing the hue in radians:
13409
13410 hue=H=PI/2:s=1
13411
13412 • Rotate hue and make the saturation swing between 0 and 2 over a
13413 period of 1 second:
13414
13415 hue="H=2*PI*t: s=sin(2*PI*t)+1"
13416
13417 • Apply a 3 seconds saturation fade-in effect starting at 0:
13418
13419 hue="s=min(t/3\,1)"
13420
13421 The general fade-in expression can be written as:
13422
13423 hue="s=min(0\, max((t-START)/DURATION\, 1))"
13424
13425 • Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
13426
13427 hue="s=max(0\, min(1\, (8-t)/3))"
13428
13429 The general fade-out expression can be written as:
13430
13431 hue="s=max(0\, min(1\, (START+DURATION-t)/DURATION))"
13432
13433 Commands
13434
13435 This filter supports the following commands:
13436
13437 b
13438 s
13439 h
13440 H Modify the hue and/or the saturation and/or brightness of the input
13441 video. The command accepts the same syntax of the corresponding
13442 option.
13443
13444 If the specified expression is not valid, it is kept at its current
13445 value.
13446
13447 huesaturation
13448 Apply hue-saturation-intensity adjustments to input video stream.
13449
13450 This filter operates in RGB colorspace.
13451
13452 This filter accepts the following options:
13453
13454 hue Set the hue shift in degrees to apply. Default is 0. Allowed range
13455 is from -180 to 180.
13456
13457 saturation
13458 Set the saturation shift. Default is 0. Allowed range is from -1
13459 to 1.
13460
13461 intensity
13462 Set the intensity shift. Default is 0. Allowed range is from -1 to
13463 1.
13464
13465 colors
13466 Set which primary and complementary colors are going to be
13467 adjusted. This options is set by providing one or multiple values.
13468 This can select multiple colors at once. By default all colors are
13469 selected.
13470
13471 r Adjust reds.
13472
13473 y Adjust yellows.
13474
13475 g Adjust greens.
13476
13477 c Adjust cyans.
13478
13479 b Adjust blues.
13480
13481 m Adjust magentas.
13482
13483 a Adjust all colors.
13484
13485 strength
13486 Set strength of filtering. Allowed range is from 0 to 100. Default
13487 value is 1.
13488
13489 rw, gw, bw
13490 Set weight for each RGB component. Allowed range is from 0 to 1.
13491 By default is set to 0.333, 0.334, 0.333. Those options are used
13492 in saturation and lightess processing.
13493
13494 lightness
13495 Set preserving lightness, by default is disabled. Adjusting hues
13496 can change lightness from original RGB triplet, with this option
13497 enabled lightness is kept at same value.
13498
13499 hysteresis
13500 Grow first stream into second stream by connecting components. This
13501 makes it possible to build more robust edge masks.
13502
13503 This filter accepts the following options:
13504
13505 planes
13506 Set which planes will be processed as bitmap, unprocessed planes
13507 will be copied from first stream. By default value 0xf, all planes
13508 will be processed.
13509
13510 threshold
13511 Set threshold which is used in filtering. If pixel component value
13512 is higher than this value filter algorithm for connecting
13513 components is activated. By default value is 0.
13514
13515 The "hysteresis" filter also supports the framesync options.
13516
13517 iccdetect
13518 Detect the colorspace from an embedded ICC profile (if present), and
13519 update the frame's tags accordingly.
13520
13521 This filter accepts the following options:
13522
13523 force
13524 If true, the frame's existing colorspace tags will always be
13525 overridden by values detected from an ICC profile. Otherwise, they
13526 will only be assigned if they contain "unknown". Enabled by
13527 default.
13528
13529 iccgen
13530 Generate ICC profiles and attach them to frames.
13531
13532 This filter accepts the following options:
13533
13534 color_primaries
13535 color_trc
13536 Configure the colorspace that the ICC profile will be generated
13537 for. The default value of "auto" infers the value from the input
13538 frame's metadata, defaulting to BT.709/sRGB as appropriate.
13539
13540 See the setparams filter for a list of possible values, but note
13541 that "unknown" are not valid values for this filter.
13542
13543 force
13544 If true, an ICC profile will be generated even if it would
13545 overwrite an already existing ICC profile. Disabled by default.
13546
13547 identity
13548 Obtain the identity score between two input videos.
13549
13550 This filter takes two input videos.
13551
13552 Both input videos must have the same resolution and pixel format for
13553 this filter to work correctly. Also it assumes that both inputs have
13554 the same number of frames, which are compared one by one.
13555
13556 The obtained per component, average, min and max identity score is
13557 printed through the logging system.
13558
13559 The filter stores the calculated identity scores of each frame in frame
13560 metadata.
13561
13562 This filter also supports the framesync options.
13563
13564 In the below example the input file main.mpg being processed is
13565 compared with the reference file ref.mpg.
13566
13567 ffmpeg -i main.mpg -i ref.mpg -lavfi identity -f null -
13568
13569 idet
13570 Detect video interlacing type.
13571
13572 This filter tries to detect if the input frames are interlaced,
13573 progressive, top or bottom field first. It will also try to detect
13574 fields that are repeated between adjacent frames (a sign of telecine).
13575
13576 Single frame detection considers only immediately adjacent frames when
13577 classifying each frame. Multiple frame detection incorporates the
13578 classification history of previous frames.
13579
13580 The filter will log these metadata values:
13581
13582 single.current_frame
13583 Detected type of current frame using single-frame detection. One
13584 of: ``tff'' (top field first), ``bff'' (bottom field first),
13585 ``progressive'', or ``undetermined''
13586
13587 single.tff
13588 Cumulative number of frames detected as top field first using
13589 single-frame detection.
13590
13591 multiple.tff
13592 Cumulative number of frames detected as top field first using
13593 multiple-frame detection.
13594
13595 single.bff
13596 Cumulative number of frames detected as bottom field first using
13597 single-frame detection.
13598
13599 multiple.current_frame
13600 Detected type of current frame using multiple-frame detection. One
13601 of: ``tff'' (top field first), ``bff'' (bottom field first),
13602 ``progressive'', or ``undetermined''
13603
13604 multiple.bff
13605 Cumulative number of frames detected as bottom field first using
13606 multiple-frame detection.
13607
13608 single.progressive
13609 Cumulative number of frames detected as progressive using single-
13610 frame detection.
13611
13612 multiple.progressive
13613 Cumulative number of frames detected as progressive using multiple-
13614 frame detection.
13615
13616 single.undetermined
13617 Cumulative number of frames that could not be classified using
13618 single-frame detection.
13619
13620 multiple.undetermined
13621 Cumulative number of frames that could not be classified using
13622 multiple-frame detection.
13623
13624 repeated.current_frame
13625 Which field in the current frame is repeated from the last. One of
13626 ``neither'', ``top'', or ``bottom''.
13627
13628 repeated.neither
13629 Cumulative number of frames with no repeated field.
13630
13631 repeated.top
13632 Cumulative number of frames with the top field repeated from the
13633 previous frame's top field.
13634
13635 repeated.bottom
13636 Cumulative number of frames with the bottom field repeated from the
13637 previous frame's bottom field.
13638
13639 The filter accepts the following options:
13640
13641 intl_thres
13642 Set interlacing threshold.
13643
13644 prog_thres
13645 Set progressive threshold.
13646
13647 rep_thres
13648 Threshold for repeated field detection.
13649
13650 half_life
13651 Number of frames after which a given frame's contribution to the
13652 statistics is halved (i.e., it contributes only 0.5 to its
13653 classification). The default of 0 means that all frames seen are
13654 given full weight of 1.0 forever.
13655
13656 analyze_interlaced_flag
13657 When this is not 0 then idet will use the specified number of
13658 frames to determine if the interlaced flag is accurate, it will not
13659 count undetermined frames. If the flag is found to be accurate it
13660 will be used without any further computations, if it is found to be
13661 inaccurate it will be cleared without any further computations.
13662 This allows inserting the idet filter as a low computational method
13663 to clean up the interlaced flag
13664
13665 il
13666 Deinterleave or interleave fields.
13667
13668 This filter allows one to process interlaced images fields without
13669 deinterlacing them. Deinterleaving splits the input frame into 2 fields
13670 (so called half pictures). Odd lines are moved to the top half of the
13671 output image, even lines to the bottom half. You can process (filter)
13672 them independently and then re-interleave them.
13673
13674 The filter accepts the following options:
13675
13676 luma_mode, l
13677 chroma_mode, c
13678 alpha_mode, a
13679 Available values for luma_mode, chroma_mode and alpha_mode are:
13680
13681 none
13682 Do nothing.
13683
13684 deinterleave, d
13685 Deinterleave fields, placing one above the other.
13686
13687 interleave, i
13688 Interleave fields. Reverse the effect of deinterleaving.
13689
13690 Default value is "none".
13691
13692 luma_swap, ls
13693 chroma_swap, cs
13694 alpha_swap, as
13695 Swap luma/chroma/alpha fields. Exchange even & odd lines. Default
13696 value is 0.
13697
13698 Commands
13699
13700 This filter supports the all above options as commands.
13701
13702 inflate
13703 Apply inflate effect to the video.
13704
13705 This filter replaces the pixel by the local(3x3) average by taking into
13706 account only values higher than the pixel.
13707
13708 It accepts the following options:
13709
13710 threshold0
13711 threshold1
13712 threshold2
13713 threshold3
13714 Limit the maximum change for each plane, default is 65535. If 0,
13715 plane will remain unchanged.
13716
13717 Commands
13718
13719 This filter supports the all above options as commands.
13720
13721 interlace
13722 Simple interlacing filter from progressive contents. This interleaves
13723 upper (or lower) lines from odd frames with lower (or upper) lines from
13724 even frames, halving the frame rate and preserving image height.
13725
13726 Original Original New Frame
13727 Frame 'j' Frame 'j+1' (tff)
13728 ========== =========== ==================
13729 Line 0 --------------------> Frame 'j' Line 0
13730 Line 1 Line 1 ----> Frame 'j+1' Line 1
13731 Line 2 ---------------------> Frame 'j' Line 2
13732 Line 3 Line 3 ----> Frame 'j+1' Line 3
13733 ... ... ...
13734 New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
13735
13736 It accepts the following optional parameters:
13737
13738 scan
13739 This determines whether the interlaced frame is taken from the even
13740 (tff - default) or odd (bff) lines of the progressive frame.
13741
13742 lowpass
13743 Vertical lowpass filter to avoid twitter interlacing and reduce
13744 moire patterns.
13745
13746 0, off
13747 Disable vertical lowpass filter
13748
13749 1, linear
13750 Enable linear filter (default)
13751
13752 2, complex
13753 Enable complex filter. This will slightly less reduce twitter
13754 and moire but better retain detail and subjective sharpness
13755 impression.
13756
13757 kerndeint
13758 Deinterlace input video by applying Donald Graft's adaptive kernel
13759 deinterling. Work on interlaced parts of a video to produce progressive
13760 frames.
13761
13762 The description of the accepted parameters follows.
13763
13764 thresh
13765 Set the threshold which affects the filter's tolerance when
13766 determining if a pixel line must be processed. It must be an
13767 integer in the range [0,255] and defaults to 10. A value of 0 will
13768 result in applying the process on every pixels.
13769
13770 map Paint pixels exceeding the threshold value to white if set to 1.
13771 Default is 0.
13772
13773 order
13774 Set the fields order. Swap fields if set to 1, leave fields alone
13775 if 0. Default is 0.
13776
13777 sharp
13778 Enable additional sharpening if set to 1. Default is 0.
13779
13780 twoway
13781 Enable twoway sharpening if set to 1. Default is 0.
13782
13783 Examples
13784
13785 • Apply default values:
13786
13787 kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
13788
13789 • Enable additional sharpening:
13790
13791 kerndeint=sharp=1
13792
13793 • Paint processed pixels in white:
13794
13795 kerndeint=map=1
13796
13797 kirsch
13798 Apply kirsch operator to input video stream.
13799
13800 The filter accepts the following option:
13801
13802 planes
13803 Set which planes will be processed, unprocessed planes will be
13804 copied. By default value 0xf, all planes will be processed.
13805
13806 scale
13807 Set value which will be multiplied with filtered result.
13808
13809 delta
13810 Set value which will be added to filtered result.
13811
13812 Commands
13813
13814 This filter supports the all above options as commands.
13815
13816 lagfun
13817 Slowly update darker pixels.
13818
13819 This filter makes short flashes of light appear longer. This filter
13820 accepts the following options:
13821
13822 decay
13823 Set factor for decaying. Default is .95. Allowed range is from 0 to
13824 1.
13825
13826 planes
13827 Set which planes to filter. Default is all. Allowed range is from 0
13828 to 15.
13829
13830 Commands
13831
13832 This filter supports the all above options as commands.
13833
13834 lenscorrection
13835 Correct radial lens distortion
13836
13837 This filter can be used to correct for radial distortion as can result
13838 from the use of wide angle lenses, and thereby re-rectify the image. To
13839 find the right parameters one can use tools available for example as
13840 part of opencv or simply trial-and-error. To use opencv use the
13841 calibration sample (under samples/cpp) from the opencv sources and
13842 extract the k1 and k2 coefficients from the resulting matrix.
13843
13844 Note that effectively the same filter is available in the open-source
13845 tools Krita and Digikam from the KDE project.
13846
13847 In contrast to the vignette filter, which can also be used to
13848 compensate lens errors, this filter corrects the distortion of the
13849 image, whereas vignette corrects the brightness distribution, so you
13850 may want to use both filters together in certain cases, though you will
13851 have to take care of ordering, i.e. whether vignetting should be
13852 applied before or after lens correction.
13853
13854 Options
13855
13856 The filter accepts the following options:
13857
13858 cx Relative x-coordinate of the focal point of the image, and thereby
13859 the center of the distortion. This value has a range [0,1] and is
13860 expressed as fractions of the image width. Default is 0.5.
13861
13862 cy Relative y-coordinate of the focal point of the image, and thereby
13863 the center of the distortion. This value has a range [0,1] and is
13864 expressed as fractions of the image height. Default is 0.5.
13865
13866 k1 Coefficient of the quadratic correction term. This value has a
13867 range [-1,1]. 0 means no correction. Default is 0.
13868
13869 k2 Coefficient of the double quadratic correction term. This value has
13870 a range [-1,1]. 0 means no correction. Default is 0.
13871
13872 i Set interpolation type. Can be "nearest" or "bilinear". Default is
13873 "nearest".
13874
13875 fc Specify the color of the unmapped pixels. For the syntax of this
13876 option, check the "Color" section in the ffmpeg-utils manual.
13877 Default color is "black@0".
13878
13879 The formula that generates the correction is:
13880
13881 r_src = r_tgt * (1 + k1 * (r_tgt / r_0)^2 + k2 * (r_tgt / r_0)^4)
13882
13883 where r_0 is halve of the image diagonal and r_src and r_tgt are the
13884 distances from the focal point in the source and target images,
13885 respectively.
13886
13887 Commands
13888
13889 This filter supports the all above options as commands.
13890
13891 lensfun
13892 Apply lens correction via the lensfun library
13893 (<http://lensfun.sourceforge.net/>).
13894
13895 The "lensfun" filter requires the camera make, camera model, and lens
13896 model to apply the lens correction. The filter will load the lensfun
13897 database and query it to find the corresponding camera and lens entries
13898 in the database. As long as these entries can be found with the given
13899 options, the filter can perform corrections on frames. Note that
13900 incomplete strings will result in the filter choosing the best match
13901 with the given options, and the filter will output the chosen camera
13902 and lens models (logged with level "info"). You must provide the make,
13903 camera model, and lens model as they are required.
13904
13905 To obtain a list of available makes and models, leave out one or both
13906 of "make" and "model" options. The filter will send the full list to
13907 the log with level "INFO". The first column is the make and the second
13908 column is the model. To obtain a list of available lenses, set any
13909 values for make and model and leave out the "lens_model" option. The
13910 filter will send the full list of lenses in the log with level "INFO".
13911 The ffmpeg tool will exit after the list is printed.
13912
13913 The filter accepts the following options:
13914
13915 make
13916 The make of the camera (for example, "Canon"). This option is
13917 required.
13918
13919 model
13920 The model of the camera (for example, "Canon EOS 100D"). This
13921 option is required.
13922
13923 lens_model
13924 The model of the lens (for example, "Canon EF-S 18-55mm f/3.5-5.6
13925 IS STM"). This option is required.
13926
13927 db_path
13928 The full path to the lens database folder. If not set, the filter
13929 will attempt to load the database from the install path when the
13930 library was built. Default is unset.
13931
13932 mode
13933 The type of correction to apply. The following values are valid
13934 options:
13935
13936 vignetting
13937 Enables fixing lens vignetting.
13938
13939 geometry
13940 Enables fixing lens geometry. This is the default.
13941
13942 subpixel
13943 Enables fixing chromatic aberrations.
13944
13945 vig_geo
13946 Enables fixing lens vignetting and lens geometry.
13947
13948 vig_subpixel
13949 Enables fixing lens vignetting and chromatic aberrations.
13950
13951 distortion
13952 Enables fixing both lens geometry and chromatic aberrations.
13953
13954 all Enables all possible corrections.
13955
13956 focal_length
13957 The focal length of the image/video (zoom; expected constant for
13958 video). For example, a 18--55mm lens has focal length range of
13959 [18--55], so a value in that range should be chosen when using that
13960 lens. Default 18.
13961
13962 aperture
13963 The aperture of the image/video (expected constant for video). Note
13964 that aperture is only used for vignetting correction. Default 3.5.
13965
13966 focus_distance
13967 The focus distance of the image/video (expected constant for
13968 video). Note that focus distance is only used for vignetting and
13969 only slightly affects the vignetting correction process. If
13970 unknown, leave it at the default value (which is 1000).
13971
13972 scale
13973 The scale factor which is applied after transformation. After
13974 correction the video is no longer necessarily rectangular. This
13975 parameter controls how much of the resulting image is visible. The
13976 value 0 means that a value will be chosen automatically such that
13977 there is little or no unmapped area in the output image. 1.0 means
13978 that no additional scaling is done. Lower values may result in more
13979 of the corrected image being visible, while higher values may avoid
13980 unmapped areas in the output.
13981
13982 target_geometry
13983 The target geometry of the output image/video. The following values
13984 are valid options:
13985
13986 rectilinear (default)
13987 fisheye
13988 panoramic
13989 equirectangular
13990 fisheye_orthographic
13991 fisheye_stereographic
13992 fisheye_equisolid
13993 fisheye_thoby
13994 reverse
13995 Apply the reverse of image correction (instead of correcting
13996 distortion, apply it).
13997
13998 interpolation
13999 The type of interpolation used when correcting distortion. The
14000 following values are valid options:
14001
14002 nearest
14003 linear (default)
14004 lanczos
14005
14006 Examples
14007
14008 • Apply lens correction with make "Canon", camera model "Canon EOS
14009 100D", and lens model "Canon EF-S 18-55mm f/3.5-5.6 IS STM" with
14010 focal length of "18" and aperture of "8.0".
14011
14012 ffmpeg -i input.mov -vf lensfun=make=Canon:model="Canon EOS 100D":lens_model="Canon EF-S 18-55mm f/3.5-5.6 IS STM":focal_length=18:aperture=8 -c:v h264 -b:v 8000k output.mov
14013
14014 • Apply the same as before, but only for the first 5 seconds of
14015 video.
14016
14017 ffmpeg -i input.mov -vf lensfun=make=Canon:model="Canon EOS 100D":lens_model="Canon EF-S 18-55mm f/3.5-5.6 IS STM":focal_length=18:aperture=8:enable='lte(t\,5)' -c:v h264 -b:v 8000k output.mov
14018
14019 libplacebo
14020 Flexible GPU-accelerated processing filter based on libplacebo
14021 (<https://code.videolan.org/videolan/libplacebo>). Note that this
14022 filter currently only accepts Vulkan input frames.
14023
14024 Options
14025
14026 The options for this filter are divided into the following sections:
14027
14028 Output mode
14029
14030 These options control the overall output mode. By default, libplacebo
14031 will try to preserve the source colorimetry and size as best as it can,
14032 but it will apply any embedded film grain, dolby vision metadata or
14033 anamorphic SAR present in source frames.
14034
14035 w
14036 h Set the output video dimension expression. Default value is the
14037 input dimension.
14038
14039 Allows for the same expressions as the scale filter.
14040
14041 format
14042 Set the output format override. If unset (the default), frames will
14043 be output in the same format as the respective input frames.
14044 Otherwise, format conversion will be performed.
14045
14046 force_original_aspect_ratio
14047 force_divisible_by
14048 Work the same as the identical scale filter options.
14049
14050 normalize_sar
14051 If enabled, output frames will always have a pixel aspect ratio of
14052 1:1. This will introduce padding/cropping as necessary. If disabled
14053 (the default), any aspect ratio mismatches, including those from
14054 e.g. anamorphic video sources, are forwarded to the output pixel
14055 aspect ratio.
14056
14057 pad_crop_ratio
14058 Specifies a ratio (between 0.0 and 1.0) between padding and
14059 cropping when the input aspect ratio does not match the output
14060 aspect ratio and normalize_sar is in effect. The default of 0.0
14061 always pads the content with black borders, while a value of 1.0
14062 always crops off parts of the content. Intermediate values are
14063 possible, leading to a mix of the two approaches.
14064
14065 colorspace
14066 color_primaries
14067 color_trc
14068 range
14069 Configure the colorspace that output frames will be delivered in.
14070 The default value of "auto" outputs frames in the same format as
14071 the input frames, leading to no change. For any other value,
14072 conversion will be performed.
14073
14074 See the setparams filter for a list of possible values.
14075
14076 apply_filmgrain
14077 Apply film grain (e.g. AV1 or H.274) if present in source frames,
14078 and strip it from the output. Enabled by default.
14079
14080 apply_dolbyvision
14081 Apply Dolby Vision RPU metadata if present in source frames, and
14082 strip it from the output. Enabled by default. Note that Dolby
14083 Vision will always output BT.2020+PQ, overriding the usual input
14084 frame metadata. These will also be picked as the values of "auto"
14085 for the respective frame output options.
14086
14087 Scaling
14088
14089 The options in this section control how libplacebo performs upscaling
14090 and (if necessary) downscaling. Note that libplacebo will always
14091 internally operate on 4:4:4 content, so any sub-sampled chroma formats
14092 such as "yuv420p" will necessarily be upsampled and downsampled as part
14093 of the rendering process. That means scaling might be in effect even if
14094 the source and destination resolution are the same.
14095
14096 upscaler
14097 downscaler
14098 Configure the filter kernel used for upscaling and downscaling. The
14099 respective defaults are "spline36" and "mitchell". For a full list
14100 of possible values, pass "help" to these options. The most
14101 important values are:
14102
14103 none
14104 Forces the use of built-in GPU texture sampling (typically
14105 bilinear). Extremely fast but poor quality, especially when
14106 downscaling.
14107
14108 bilinear
14109 Bilinear interpolation. Can generally be done for free on GPUs,
14110 except when doing so would lead to aliasing. Fast and low
14111 quality.
14112
14113 nearest
14114 Nearest-neighbour interpolation. Sharp but highly aliasing.
14115
14116 oversample
14117 Algorithm that looks visually similar to nearest-neighbour
14118 interpolation but tries to preserve pixel aspect ratio. Good
14119 for pixel art, since it results in minimal distortion of the
14120 artistic appearance.
14121
14122 lanczos
14123 Standard sinc-sinc interpolation kernel.
14124
14125 spline36
14126 Cubic spline approximation of lanczos. No difference in
14127 performance, but has very slightly less ringing.
14128
14129 ewa_lanczos
14130 Elliptically weighted average version of lanczos, based on a
14131 jinc-sinc kernel. This is also popularly referred to as just
14132 "Jinc scaling". Slow but very high quality.
14133
14134 gaussian
14135 Gaussian kernel. Has certain ideal mathematical properties, but
14136 subjectively very blurry.
14137
14138 mitchell
14139 Cubic BC spline with parameters recommended by Mitchell and
14140 Netravali. Very little ringing.
14141
14142 lut_entries
14143 Configures the size of scaler LUTs, ranging from 1 to 256. The
14144 default of 0 will pick libplacebo's internal default, typically 64.
14145
14146 antiringing
14147 Enables anti-ringing (for non-EWA filters). The value (between 0.0
14148 and 1.0) configures the strength of the anti-ringing algorithm. May
14149 increase aliasing if set too high. Disabled by default.
14150
14151 sigmoid
14152 Enable sigmoidal compression during upscaling. Reduces ringing
14153 slightly. Enabled by default.
14154
14155 Debanding
14156
14157 Libplacebo comes with a built-in debanding filter that is good at
14158 counteracting many common sources of banding and blocking. Turning this
14159 on is highly recommended whenever quality is desired.
14160
14161 deband
14162 Enable (fast) debanding algorithm. Disabled by default.
14163
14164 deband_iterations
14165 Number of deband iterations of the debanding algorithm. Each
14166 iteration is performed with progressively increased radius (and
14167 diminished threshold). Recommended values are in the range 1 to 4.
14168 Defaults to 1.
14169
14170 deband_threshold
14171 Debanding filter strength. Higher numbers lead to more aggressive
14172 debanding. Defaults to 4.0.
14173
14174 deband_radius
14175 Debanding filter radius. A higher radius is better for slow
14176 gradients, while a lower radius is better for steep gradients.
14177 Defaults to 16.0.
14178
14179 deband_grain
14180 Amount of extra output grain to add. Helps hide imperfections.
14181 Defaults to 6.0.
14182
14183 Color adjustment
14184
14185 A collection of subjective color controls. Not very rigorous, so the
14186 exact effect will vary somewhat depending on the input primaries and
14187 colorspace.
14188
14189 brightness
14190 Brightness boost, between -1.0 and 1.0. Defaults to 0.0.
14191
14192 contrast
14193 Contrast gain, between 0.0 and 16.0. Defaults to 1.0.
14194
14195 saturation
14196 Saturation gain, between 0.0 and 16.0. Defaults to 1.0.
14197
14198 hue Hue shift in radians, between -3.14 and 3.14. Defaults to 0.0. This
14199 will rotate the UV subvector, defaulting to BT.709 coefficients for
14200 RGB inputs.
14201
14202 gamma
14203 Gamma adjustment, between 0.0 and 16.0. Defaults to 1.0.
14204
14205 cones
14206 Cone model to use for color blindness simulation. Accepts any
14207 combination of "l", "m" and "s". Here are some examples:
14208
14209 m Deuteranomaly / deuteranopia (affecting 3%-4% of the
14210 population)
14211
14212 l Protanomaly / protanopia (affecting 1%-2% of the population)
14213
14214 l+m Monochromacy (very rare)
14215
14216 l+m+s
14217 Achromatopsy (complete loss of daytime vision, extremely rare)
14218
14219 cone-strength
14220 Gain factor for the cones specified by "cones", between 0.0 and
14221 10.0. A value of 1.0 results in no change to color vision. A value
14222 of 0.0 (the default) simulates complete loss of those cones. Values
14223 above 1.0 result in exaggerating the differences between cones,
14224 which may help compensate for reduced color vision.
14225
14226 Peak detection
14227
14228 To help deal with sources that only have static HDR10 metadata (or no
14229 tagging whatsoever), libplacebo uses its own internal frame analysis
14230 compute shader to analyze source frames and adapt the tone mapping
14231 function in realtime. If this is too slow, or if exactly reproducible
14232 frame-perfect results are needed, it's recommended to turn this feature
14233 off.
14234
14235 peak_detect
14236 Enable HDR peak detection. Ignores static MaxCLL/MaxFALL values in
14237 favor of dynamic detection from the input. Note that the detected
14238 values do not get written back to the output frames, they merely
14239 guide the internal tone mapping process. Enabled by default.
14240
14241 smoothing_period
14242 Peak detection smoothing period, between 0.0 and 1000.0. Higher
14243 values result in peak detection becoming less responsive to changes
14244 in the input. Defaults to 100.0.
14245
14246 minimum_peak
14247 Lower bound on the detected peak (relative to SDR white), between
14248 0.0 and 100.0. Defaults to 1.0.
14249
14250 scene_threshold_low
14251 scene_threshold_high
14252 Lower and upper thresholds for scene change detection. Expressed in
14253 a logarithmic scale between 0.0 and 100.0. Default to 5.5 and 10.0,
14254 respectively. Setting either to a negative value disables this
14255 functionality.
14256
14257 overshoot
14258 Peak smoothing overshoot margin, between 0.0 and 1.0. Provides a
14259 safety margin to prevent clipping as a result of peak smoothing.
14260 Defaults to 0.05, corresponding to a margin of 5%.
14261
14262 Tone mapping
14263
14264 The options in this section control how libplacebo performs tone-
14265 mapping and gamut-mapping when dealing with mismatches between wide-
14266 gamut or HDR content. In general, libplacebo relies on accurate source
14267 tagging and mastering display gamut information to produce the best
14268 results.
14269
14270 intent
14271 Rendering intent to use when adapting between different primary
14272 color gamuts (after tone-mapping).
14273
14274 perceptual
14275 Perceptual gamut mapping. Currently equivalent to relative
14276 colorimetric.
14277
14278 relative
14279 Relative colorimetric. This is the default.
14280
14281 absolute
14282 Absolute colorimetric.
14283
14284 saturation
14285 Saturation mapping. Forcibly stretches the source gamut to the
14286 target gamut.
14287
14288 gamut_mode
14289 How to handle out-of-gamut colors that can occur as a result of
14290 colorimetric gamut mapping.
14291
14292 clip
14293 Do nothing, simply clip out-of-range colors to the RGB volume.
14294 This is the default.
14295
14296 warn
14297 Highlight out-of-gamut pixels (by coloring them pink).
14298
14299 darken
14300 Linearly reduces content brightness to preserves saturated
14301 details, followed by clipping the remaining out-of-gamut
14302 colors. As the name implies, this makes everything darker, but
14303 provides a good balance between preserving details and colors.
14304
14305 desaturate
14306 Hard-desaturates out-of-gamut colors towards white, while
14307 preserving the luminance. Has a tendency to shift colors.
14308
14309 tonemapping
14310 Tone-mapping algorithm to use. Available values are:
14311
14312 auto
14313 Automatic selection based on internal heuristics. This is the
14314 default.
14315
14316 clip
14317 Performs no tone-mapping, just clips out-of-range colors.
14318 Retains perfect color accuracy for in-range colors but
14319 completely destroys out-of-range information. Does not perform
14320 any black point adaptation. Not configurable.
14321
14322 st2094-40
14323 EETF from SMPTE ST 2094-40 Annex B, which applies the Bezier
14324 curves from HDR10+ dynamic metadata based on Bezier curves to
14325 perform tone-mapping. The OOTF used is adjusted based on the
14326 ratio between the targeted and actual display peak luminances.
14327
14328 st2094-10
14329 EETF from SMPTE ST 2094-10 Annex B.2, which takes into account
14330 the input signal average luminance in addition to the
14331 maximum/minimum. The configurable contrast parameter influences
14332 the slope of the linear output segment, defaulting to 1.0 for
14333 no increase/decrease in contrast. Note that this does not
14334 currently include the subjective gain/offset/gamma controls
14335 defined in Annex B.3.
14336
14337 bt.2390
14338 EETF from the ITU-R Report BT.2390, a hermite spline roll-off
14339 with linear segment. The knee point offset is configurable.
14340 Note that this parameter defaults to 1.0, rather than the value
14341 of 0.5 from the ITU-R spec.
14342
14343 bt.2446a
14344 EETF from ITU-R Report BT.2446, method A. Designed for well-
14345 mastered HDR sources. Can be used for both forward and inverse
14346 tone mapping. Not configurable.
14347
14348 spline
14349 Simple spline consisting of two polynomials, joined by a single
14350 pivot point. The parameter gives the pivot point (in PQ
14351 space), defaulting to 0.30. Can be used for both forward and
14352 inverse tone mapping.
14353
14354 reinhard
14355 Simple non-linear, global tone mapping algorithm. The parameter
14356 specifies the local contrast coefficient at the display peak.
14357 Essentially, a parameter of 0.5 implies that the reference
14358 white will be about half as bright as when clipping. Defaults
14359 to 0.5, which results in the simplest formulation of this
14360 function.
14361
14362 mobius
14363 Generalization of the reinhard tone mapping algorithm to
14364 support an additional linear slope near black. The tone mapping
14365 parameter indicates the trade-off between the linear section
14366 and the non-linear section. Essentially, for a given parameter
14367 x, every color value below x will be mapped linearly, while
14368 higher values get non-linearly tone-mapped. Values near 1.0
14369 make this curve behave like "clip", while values near 0.0 make
14370 this curve behave like "reinhard". The default value is 0.3,
14371 which provides a good balance between colorimetric accuracy and
14372 preserving out-of-gamut details.
14373
14374 hable
14375 Piece-wise, filmic tone-mapping algorithm developed by John
14376 Hable for use in Uncharted 2, inspired by a similar tone-
14377 mapping algorithm used by Kodak. Popularized by its use in
14378 video games with HDR rendering. Preserves both dark and bright
14379 details very well, but comes with the drawback of changing the
14380 average brightness quite significantly. This is sort of similar
14381 to "reinhard" with parameter 0.24.
14382
14383 gamma
14384 Fits a gamma (power) function to transfer between the source
14385 and target color spaces, effectively resulting in a perceptual
14386 hard-knee joining two roughly linear sections. This preserves
14387 details at all scales fairly accurately, but can result in an
14388 image with a muted or dull appearance. The parameter is used as
14389 the cutoff point, defaulting to 0.5.
14390
14391 linear
14392 Linearly stretches the input range to the output range, in PQ
14393 space. This will preserve all details accurately, but results
14394 in a significantly different average brightness. Can be used
14395 for inverse tone-mapping in addition to regular tone-mapping.
14396 The parameter can be used as an additional linear gain
14397 coefficient (defaulting to 1.0).
14398
14399 tonemapping_param
14400 For tunable tone mapping functions, this parameter can be used to
14401 fine-tune the curve behavior. Refer to the documentation of
14402 "tonemapping". The default value of 0.0 is replaced by the curve's
14403 preferred default setting.
14404
14405 tonemapping_mode
14406 This option determines how the tone mapping function specified by
14407 "tonemapping" is applied to the colors in a scene. Possible values
14408 are:
14409
14410 auto
14411 Automatic selection based on internal heuristics. This is the
14412 default.
14413
14414 rgb Apply the function per-channel in the RGB colorspace. Per-
14415 channel tone-mapping in RGB. Guarantees no clipping and heavily
14416 desaturates the output, but distorts the colors quite
14417 significantly. Very similar to the "Hollywood" look and feel.
14418
14419 max Tone-mapping is performed on the brightest component found in
14420 the signal. Good at preserving details in highlights, but has a
14421 tendency to crush blacks.
14422
14423 hybrid
14424 Tone-map per-channel for highlights and linearly (luma-based)
14425 for midtones/shadows, based on a fixed gamma 2.4 coefficient
14426 curve.
14427
14428 luma
14429 Tone-map linearly on the luma component (CIE Y), and adjust
14430 (desaturate) the chromaticities to compensate using a simple
14431 constant factor. This is essentially the mode used in ITU-R
14432 BT.2446 method A.
14433
14434 inverse_tonemapping
14435 If enabled, this filter will also attempt stretching SDR signals to
14436 fill HDR output color volumes. Disabled by default.
14437
14438 tonemapping_crosstalk
14439 Extra tone-mapping crosstalk factor, between 0.0 and 0.3. This can
14440 help reduce issues tone-mapping certain bright spectral colors.
14441 Defaults to 0.04.
14442
14443 tonemapping_lut_size
14444 Size of the tone-mapping LUT, between 2 and 1024. Defaults to 256.
14445 Note that this figure is squared when combined with "peak_detect".
14446
14447 Dithering
14448
14449 By default, libplacebo will dither whenever necessary, which includes
14450 rendering to any integer format below 16-bit precision. It's
14451 recommended to always leave this on, since not doing so may result in
14452 visible banding in the output, even if the "debanding" filter is
14453 enabled. If maximum performance is needed, use "ordered_fixed" instead
14454 of disabling dithering.
14455
14456 dithering
14457 Dithering method to use. Accepts the following values:
14458
14459 none
14460 Disables dithering completely. May result in visible banding.
14461
14462 blue
14463 Dither with pseudo-blue noise. This is the default.
14464
14465 ordered
14466 Tunable ordered dither pattern.
14467
14468 ordered_fixed
14469 Faster ordered dither with a fixed size of 6. Texture-less.
14470
14471 white
14472 Dither with white noise. Texture-less.
14473
14474 dither_lut_size
14475 Dither LUT size, as log base2 between 1 and 8. Defaults to 6,
14476 corresponding to a LUT size of "64x64".
14477
14478 dither_temporal
14479 Enables temporal dithering. Disabled by default.
14480
14481 Custom shaders
14482
14483 libplacebo supports a number of custom shaders based on the mpv .hook
14484 GLSL syntax. A collection of such shaders can be found here:
14485 <https://github.com/mpv-player/mpv/wiki/User-Scripts#user-shaders>
14486
14487 A full description of the mpv shader format is beyond the scope of this
14488 section, but a summary can be found here:
14489 <https://mpv.io/manual/master/#options-glsl-shader>
14490
14491 custom_shader_path
14492 Specifies a path to a custom shader file to load at runtime.
14493
14494 custom_shader_bin
14495 Specifies a complete custom shader as a raw string.
14496
14497 Debugging / performance
14498
14499 All of the options in this section default off. They may be of
14500 assistance when attempting to squeeze the maximum performance at the
14501 cost of quality.
14502
14503 skip_aa
14504 Disable anti-aliasing when downscaling.
14505
14506 polar_cutoff
14507 Truncate polar (EWA) scaler kernels below this absolute magnitude,
14508 between 0.0 and 1.0.
14509
14510 disable_linear
14511 Disable linear light scaling.
14512
14513 disable_builtin
14514 Disable built-in GPU sampling (forces LUT).
14515
14516 disable_fbos
14517 Forcibly disable FBOs, resulting in loss of almost all
14518 functionality, but offering the maximum possible speed.
14519
14520 Commands
14521
14522 This filter supports almost all of the above options as commands.
14523
14524 Examples
14525
14526 • Complete example for how to initialize the Vulkan device, upload
14527 frames to the GPU, perform filter conversion to yuv420p, and
14528 download frames back to the CPU for output. Note that in specific
14529 cases you can get around the need to perform format conversion by
14530 specifying the correct "format" filter option corresponding to the
14531 input frames.
14532
14533 ffmpeg -i $INPUT -init_hw_device vulkan -vf hwupload,libplacebo=format=yuv420p,hwdownload,format=yuv420p $OUTPUT
14534
14535 • Tone-map input to standard gamut BT.709 output:
14536
14537 libplacebo=colorspace=bt709:color_primaries=bt709:color_trc=bt709:range=tv
14538
14539 • Rescale input to fit into standard 1080p, with high quality
14540 scaling:
14541
14542 libplacebo=w=1920:h=1080:force_original_aspect_ratio=decrease:normalize_sar=true:upscaler=ewa_lanczos:downscaler=ewa_lanczos
14543
14544 • Convert input to standard sRGB JPEG:
14545
14546 libplacebo=format=yuv420p:colorspace=bt470bg:color_primaries=bt709:color_trc=iec61966-2-1:range=pc
14547
14548 • Use higher quality debanding settings:
14549
14550 libplacebo=deband=true:deband_iterations=3:deband_radius=8:deband_threshold=6
14551
14552 • Run this filter on the CPU, on systems with Mesa installed (and
14553 with the most expensive options disabled):
14554
14555 ffmpeg ... -init_hw_device vulkan:llvmpipe ... -vf libplacebo=upscaler=none:downscaler=none:peak_detect=false
14556
14557 • Suppress CPU-based AV1/H.274 film grain application in the decoder,
14558 in favor of doing it with this filter. Note that this is only a
14559 gain if the frames are either already on the GPU, or if you're
14560 using libplacebo for other purposes, since otherwise the VRAM
14561 roundtrip will more than offset any expected speedup.
14562
14563 ffmpeg -export_side_data +film_grain ... -vf libplacebo=apply_filmgrain=true
14564
14565 libvmaf
14566 Calulate the VMAF (Video Multi-Method Assessment Fusion) score for a
14567 reference/distorted pair of input videos.
14568
14569 The first input is the distorted video, and the second input is the
14570 reference video.
14571
14572 The obtained VMAF score is printed through the logging system.
14573
14574 It requires Netflix's vmaf library (libvmaf) as a pre-requisite. After
14575 installing the library it can be enabled using: "./configure
14576 --enable-libvmaf".
14577
14578 The filter has following options:
14579
14580 model
14581 A `|` delimited list of vmaf models. Each model can be configured
14582 with a number of parameters. Default value: "version=vmaf_v0.6.1"
14583
14584 model_path
14585 Deprecated, use model='path=...'.
14586
14587 enable_transform
14588 Deprecated, use model='enable_transform=true'.
14589
14590 phone_model
14591 Deprecated, use model='enable_transform=true'.
14592
14593 enable_conf_interval
14594 Deprecated, use model='enable_conf_interval=true'.
14595
14596 feature
14597 A `|` delimited list of features. Each feature can be configured
14598 with a number of parameters.
14599
14600 psnr
14601 Deprecated, use feature='name=psnr'.
14602
14603 ssim
14604 Deprecated, use feature='name=ssim'.
14605
14606 ms_ssim
14607 Deprecated, use feature='name=ms_ssim'.
14608
14609 log_path
14610 Set the file path to be used to store log files.
14611
14612 log_fmt
14613 Set the format of the log file (xml, json, csv, or sub).
14614
14615 n_threads
14616 Set number of threads to be used when initializing libvmaf.
14617 Default value: 0, no threads.
14618
14619 n_subsample
14620 Set frame subsampling interval to be used.
14621
14622 This filter also supports the framesync options.
14623
14624 Examples
14625
14626 • In the examples below, a distorted video distorted.mpg is compared
14627 with a reference file reference.mpg.
14628
14629 • Basic usage:
14630
14631 ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf=log_path=output.xml -f null -
14632
14633 • Example with multiple models:
14634
14635 ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf='model=version=vmaf_v0.6.1\\:name=vmaf|version=vmaf_v0.6.1neg\\:name=vmaf_neg' -f null -
14636
14637 • Example with multiple addtional features:
14638
14639 ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf='feature=name=psnr|name=ciede' -f null -
14640
14641 • Example with options and different containers:
14642
14643 ffmpeg -i distorted.mpg -i reference.mkv -lavfi "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]libvmaf=log_fmt=json:log_path=output.json" -f null -
14644
14645 limitdiff
14646 Apply limited difference filter using second and optionally third video
14647 stream.
14648
14649 The filter accepts the following options:
14650
14651 threshold
14652 Set the threshold to use when allowing certain differences between
14653 video streams. Any absolute difference value lower or exact than
14654 this threshold will pick pixel components from first video stream.
14655
14656 elasticity
14657 Set the elasticity of soft thresholding when processing video
14658 streams. This value multiplied with first one sets second
14659 threshold. Any absolute difference value greater or exact than
14660 second threshold will pick pixel components from second video
14661 stream. For values between those two threshold linear interpolation
14662 between first and second video stream will be used.
14663
14664 reference
14665 Enable the reference (third) video stream processing. By default is
14666 disabled. If set, this video stream will be used for calculating
14667 absolute difference with first video stream.
14668
14669 planes
14670 Specify which planes will be processed. Defaults to all available.
14671
14672 Commands
14673
14674 This filter supports the all above options as commands except option
14675 reference.
14676
14677 limiter
14678 Limits the pixel components values to the specified range [min, max].
14679
14680 The filter accepts the following options:
14681
14682 min Lower bound. Defaults to the lowest allowed value for the input.
14683
14684 max Upper bound. Defaults to the highest allowed value for the input.
14685
14686 planes
14687 Specify which planes will be processed. Defaults to all available.
14688
14689 Commands
14690
14691 This filter supports the all above options as commands.
14692
14693 loop
14694 Loop video frames.
14695
14696 The filter accepts the following options:
14697
14698 loop
14699 Set the number of loops. Setting this value to -1 will result in
14700 infinite loops. Default is 0.
14701
14702 size
14703 Set maximal size in number of frames. Default is 0.
14704
14705 start
14706 Set first frame of loop. Default is 0.
14707
14708 Examples
14709
14710 • Loop single first frame infinitely:
14711
14712 loop=loop=-1:size=1:start=0
14713
14714 • Loop single first frame 10 times:
14715
14716 loop=loop=10:size=1:start=0
14717
14718 • Loop 10 first frames 5 times:
14719
14720 loop=loop=5:size=10:start=0
14721
14722 lut1d
14723 Apply a 1D LUT to an input video.
14724
14725 The filter accepts the following options:
14726
14727 file
14728 Set the 1D LUT file name.
14729
14730 Currently supported formats:
14731
14732 cube
14733 Iridas
14734
14735 csp cineSpace
14736
14737 interp
14738 Select interpolation mode.
14739
14740 Available values are:
14741
14742 nearest
14743 Use values from the nearest defined point.
14744
14745 linear
14746 Interpolate values using the linear interpolation.
14747
14748 cosine
14749 Interpolate values using the cosine interpolation.
14750
14751 cubic
14752 Interpolate values using the cubic interpolation.
14753
14754 spline
14755 Interpolate values using the spline interpolation.
14756
14757 Commands
14758
14759 This filter supports the all above options as commands.
14760
14761 lut3d
14762 Apply a 3D LUT to an input video.
14763
14764 The filter accepts the following options:
14765
14766 file
14767 Set the 3D LUT file name.
14768
14769 Currently supported formats:
14770
14771 3dl AfterEffects
14772
14773 cube
14774 Iridas
14775
14776 dat DaVinci
14777
14778 m3d Pandora
14779
14780 csp cineSpace
14781
14782 interp
14783 Select interpolation mode.
14784
14785 Available values are:
14786
14787 nearest
14788 Use values from the nearest defined point.
14789
14790 trilinear
14791 Interpolate values using the 8 points defining a cube.
14792
14793 tetrahedral
14794 Interpolate values using a tetrahedron.
14795
14796 pyramid
14797 Interpolate values using a pyramid.
14798
14799 prism
14800 Interpolate values using a prism.
14801
14802 Commands
14803
14804 This filter supports the "interp" option as commands.
14805
14806 lumakey
14807 Turn certain luma values into transparency.
14808
14809 The filter accepts the following options:
14810
14811 threshold
14812 Set the luma which will be used as base for transparency. Default
14813 value is 0.
14814
14815 tolerance
14816 Set the range of luma values to be keyed out. Default value is
14817 0.01.
14818
14819 softness
14820 Set the range of softness. Default value is 0. Use this to control
14821 gradual transition from zero to full transparency.
14822
14823 Commands
14824
14825 This filter supports same commands as options. The command accepts the
14826 same syntax of the corresponding option.
14827
14828 If the specified expression is not valid, it is kept at its current
14829 value.
14830
14831 lut, lutrgb, lutyuv
14832 Compute a look-up table for binding each pixel component input value to
14833 an output value, and apply it to the input video.
14834
14835 lutyuv applies a lookup table to a YUV input video, lutrgb to an RGB
14836 input video.
14837
14838 These filters accept the following parameters:
14839
14840 c0 set first pixel component expression
14841
14842 c1 set second pixel component expression
14843
14844 c2 set third pixel component expression
14845
14846 c3 set fourth pixel component expression, corresponds to the alpha
14847 component
14848
14849 r set red component expression
14850
14851 g set green component expression
14852
14853 b set blue component expression
14854
14855 a alpha component expression
14856
14857 y set Y/luminance component expression
14858
14859 u set U/Cb component expression
14860
14861 v set V/Cr component expression
14862
14863 Each of them specifies the expression to use for computing the lookup
14864 table for the corresponding pixel component values.
14865
14866 The exact component associated to each of the c* options depends on the
14867 format in input.
14868
14869 The lut filter requires either YUV or RGB pixel formats in input,
14870 lutrgb requires RGB pixel formats in input, and lutyuv requires YUV.
14871
14872 The expressions can contain the following constants and functions:
14873
14874 w
14875 h The input width and height.
14876
14877 val The input value for the pixel component.
14878
14879 clipval
14880 The input value, clipped to the minval-maxval range.
14881
14882 maxval
14883 The maximum value for the pixel component.
14884
14885 minval
14886 The minimum value for the pixel component.
14887
14888 negval
14889 The negated value for the pixel component value, clipped to the
14890 minval-maxval range; it corresponds to the expression
14891 "maxval-clipval+minval".
14892
14893 clip(val)
14894 The computed value in val, clipped to the minval-maxval range.
14895
14896 gammaval(gamma)
14897 The computed gamma correction value of the pixel component value,
14898 clipped to the minval-maxval range. It corresponds to the
14899 expression
14900 "pow((clipval-minval)/(maxval-minval)\,gamma)*(maxval-minval)+minval"
14901
14902 All expressions default to "clipval".
14903
14904 Commands
14905
14906 This filter supports same commands as options.
14907
14908 Examples
14909
14910 • Negate input video:
14911
14912 lutrgb="r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val"
14913 lutyuv="y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val"
14914
14915 The above is the same as:
14916
14917 lutrgb="r=negval:g=negval:b=negval"
14918 lutyuv="y=negval:u=negval:v=negval"
14919
14920 • Negate luminance:
14921
14922 lutyuv=y=negval
14923
14924 • Remove chroma components, turning the video into a graytone image:
14925
14926 lutyuv="u=128:v=128"
14927
14928 • Apply a luma burning effect:
14929
14930 lutyuv="y=2*val"
14931
14932 • Remove green and blue components:
14933
14934 lutrgb="g=0:b=0"
14935
14936 • Set a constant alpha channel value on input:
14937
14938 format=rgba,lutrgb=a="maxval-minval/2"
14939
14940 • Correct luminance gamma by a factor of 0.5:
14941
14942 lutyuv=y=gammaval(0.5)
14943
14944 • Discard least significant bits of luma:
14945
14946 lutyuv=y='bitand(val, 128+64+32)'
14947
14948 • Technicolor like effect:
14949
14950 lutyuv=u='(val-maxval/2)*2+maxval/2':v='(val-maxval/2)*2+maxval/2'
14951
14952 lut2, tlut2
14953 The "lut2" filter takes two input streams and outputs one stream.
14954
14955 The "tlut2" (time lut2) filter takes two consecutive frames from one
14956 single stream.
14957
14958 This filter accepts the following parameters:
14959
14960 c0 set first pixel component expression
14961
14962 c1 set second pixel component expression
14963
14964 c2 set third pixel component expression
14965
14966 c3 set fourth pixel component expression, corresponds to the alpha
14967 component
14968
14969 d set output bit depth, only available for "lut2" filter. By default
14970 is 0, which means bit depth is automatically picked from first
14971 input format.
14972
14973 The "lut2" filter also supports the framesync options.
14974
14975 Each of them specifies the expression to use for computing the lookup
14976 table for the corresponding pixel component values.
14977
14978 The exact component associated to each of the c* options depends on the
14979 format in inputs.
14980
14981 The expressions can contain the following constants:
14982
14983 w
14984 h The input width and height.
14985
14986 x The first input value for the pixel component.
14987
14988 y The second input value for the pixel component.
14989
14990 bdx The first input video bit depth.
14991
14992 bdy The second input video bit depth.
14993
14994 All expressions default to "x".
14995
14996 Commands
14997
14998 This filter supports the all above options as commands except option
14999 "d".
15000
15001 Examples
15002
15003 • Highlight differences between two RGB video streams:
15004
15005 lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1)'
15006
15007 • Highlight differences between two YUV video streams:
15008
15009 lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1)'
15010
15011 • Show max difference between two video streams:
15012
15013 lut2='if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1)))'
15014
15015 maskedclamp
15016 Clamp the first input stream with the second input and third input
15017 stream.
15018
15019 Returns the value of first stream to be between second input stream -
15020 "undershoot" and third input stream + "overshoot".
15021
15022 This filter accepts the following options:
15023
15024 undershoot
15025 Default value is 0.
15026
15027 overshoot
15028 Default value is 0.
15029
15030 planes
15031 Set which planes will be processed as bitmap, unprocessed planes
15032 will be copied from first stream. By default value 0xf, all planes
15033 will be processed.
15034
15035 Commands
15036
15037 This filter supports the all above options as commands.
15038
15039 maskedmax
15040 Merge the second and third input stream into output stream using
15041 absolute differences between second input stream and first input stream
15042 and absolute difference between third input stream and first input
15043 stream. The picked value will be from second input stream if second
15044 absolute difference is greater than first one or from third input
15045 stream otherwise.
15046
15047 This filter accepts the following options:
15048
15049 planes
15050 Set which planes will be processed as bitmap, unprocessed planes
15051 will be copied from first stream. By default value 0xf, all planes
15052 will be processed.
15053
15054 Commands
15055
15056 This filter supports the all above options as commands.
15057
15058 maskedmerge
15059 Merge the first input stream with the second input stream using per
15060 pixel weights in the third input stream.
15061
15062 A value of 0 in the third stream pixel component means that pixel
15063 component from first stream is returned unchanged, while maximum value
15064 (eg. 255 for 8-bit videos) means that pixel component from second
15065 stream is returned unchanged. Intermediate values define the amount of
15066 merging between both input stream's pixel components.
15067
15068 This filter accepts the following options:
15069
15070 planes
15071 Set which planes will be processed as bitmap, unprocessed planes
15072 will be copied from first stream. By default value 0xf, all planes
15073 will be processed.
15074
15075 Commands
15076
15077 This filter supports the all above options as commands.
15078
15079 maskedmin
15080 Merge the second and third input stream into output stream using
15081 absolute differences between second input stream and first input stream
15082 and absolute difference between third input stream and first input
15083 stream. The picked value will be from second input stream if second
15084 absolute difference is less than first one or from third input stream
15085 otherwise.
15086
15087 This filter accepts the following options:
15088
15089 planes
15090 Set which planes will be processed as bitmap, unprocessed planes
15091 will be copied from first stream. By default value 0xf, all planes
15092 will be processed.
15093
15094 Commands
15095
15096 This filter supports the all above options as commands.
15097
15098 maskedthreshold
15099 Pick pixels comparing absolute difference of two video streams with
15100 fixed threshold.
15101
15102 If absolute difference between pixel component of first and second
15103 video stream is equal or lower than user supplied threshold than pixel
15104 component from first video stream is picked, otherwise pixel component
15105 from second video stream is picked.
15106
15107 This filter accepts the following options:
15108
15109 threshold
15110 Set threshold used when picking pixels from absolute difference
15111 from two input video streams.
15112
15113 planes
15114 Set which planes will be processed as bitmap, unprocessed planes
15115 will be copied from second stream. By default value 0xf, all
15116 planes will be processed.
15117
15118 mode
15119 Set mode of filter operation. Can be "abs" or "diff". Default is
15120 "abs".
15121
15122 Commands
15123
15124 This filter supports the all above options as commands.
15125
15126 maskfun
15127 Create mask from input video.
15128
15129 For example it is useful to create motion masks after "tblend" filter.
15130
15131 This filter accepts the following options:
15132
15133 low Set low threshold. Any pixel component lower or exact than this
15134 value will be set to 0.
15135
15136 high
15137 Set high threshold. Any pixel component higher than this value will
15138 be set to max value allowed for current pixel format.
15139
15140 planes
15141 Set planes to filter, by default all available planes are filtered.
15142
15143 fill
15144 Fill all frame pixels with this value.
15145
15146 sum Set max average pixel value for frame. If sum of all pixel
15147 components is higher that this average, output frame will be
15148 completely filled with value set by fill option. Typically useful
15149 for scene changes when used in combination with "tblend" filter.
15150
15151 Commands
15152
15153 This filter supports the all above options as commands.
15154
15155 mcdeint
15156 Apply motion-compensation deinterlacing.
15157
15158 It needs one field per frame as input and must thus be used together
15159 with yadif=1/3 or equivalent.
15160
15161 This filter is only available in ffmpeg version 4.4 or earlier.
15162
15163 This filter accepts the following options:
15164
15165 mode
15166 Set the deinterlacing mode.
15167
15168 It accepts one of the following values:
15169
15170 fast
15171 medium
15172 slow
15173 use iterative motion estimation
15174
15175 extra_slow
15176 like slow, but use multiple reference frames.
15177
15178 Default value is fast.
15179
15180 parity
15181 Set the picture field parity assumed for the input video. It must
15182 be one of the following values:
15183
15184 0, tff
15185 assume top field first
15186
15187 1, bff
15188 assume bottom field first
15189
15190 Default value is bff.
15191
15192 qp Set per-block quantization parameter (QP) used by the internal
15193 encoder.
15194
15195 Higher values should result in a smoother motion vector field but
15196 less optimal individual vectors. Default value is 1.
15197
15198 median
15199 Pick median pixel from certain rectangle defined by radius.
15200
15201 This filter accepts the following options:
15202
15203 radius
15204 Set horizontal radius size. Default value is 1. Allowed range is
15205 integer from 1 to 127.
15206
15207 planes
15208 Set which planes to process. Default is 15, which is all available
15209 planes.
15210
15211 radiusV
15212 Set vertical radius size. Default value is 0. Allowed range is
15213 integer from 0 to 127. If it is 0, value will be picked from
15214 horizontal "radius" option.
15215
15216 percentile
15217 Set median percentile. Default value is 0.5. Default value of 0.5
15218 will pick always median values, while 0 will pick minimum values,
15219 and 1 maximum values.
15220
15221 Commands
15222
15223 This filter supports same commands as options. The command accepts the
15224 same syntax of the corresponding option.
15225
15226 If the specified expression is not valid, it is kept at its current
15227 value.
15228
15229 mergeplanes
15230 Merge color channel components from several video streams.
15231
15232 The filter accepts up to 4 input streams, and merge selected input
15233 planes to the output video.
15234
15235 This filter accepts the following options:
15236
15237 mapping
15238 Set input to output plane mapping. Default is 0.
15239
15240 The mappings is specified as a bitmap. It should be specified as a
15241 hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. 'Aa' describes the
15242 mapping for the first plane of the output stream. 'A' sets the
15243 number of the input stream to use (from 0 to 3), and 'a' the plane
15244 number of the corresponding input to use (from 0 to 3). The rest of
15245 the mappings is similar, 'Bb' describes the mapping for the output
15246 stream second plane, 'Cc' describes the mapping for the output
15247 stream third plane and 'Dd' describes the mapping for the output
15248 stream fourth plane.
15249
15250 format
15251 Set output pixel format. Default is "yuva444p".
15252
15253 map0s
15254 map1s
15255 map2s
15256 map3s
15257 Set input to output stream mapping for output Nth plane. Default is
15258 0.
15259
15260 map0p
15261 map1p
15262 map2p
15263 map3p
15264 Set input to output plane mapping for output Nth plane. Default is
15265 0.
15266
15267 Examples
15268
15269 • Merge three gray video streams of same width and height into single
15270 video stream:
15271
15272 [a0][a1][a2]mergeplanes=0x001020:yuv444p
15273
15274 • Merge 1st yuv444p stream and 2nd gray video stream into yuva444p
15275 video stream:
15276
15277 [a0][a1]mergeplanes=0x00010210:yuva444p
15278
15279 • Swap Y and A plane in yuva444p stream:
15280
15281 format=yuva444p,mergeplanes=0x03010200:yuva444p
15282
15283 • Swap U and V plane in yuv420p stream:
15284
15285 format=yuv420p,mergeplanes=0x000201:yuv420p
15286
15287 • Cast a rgb24 clip to yuv444p:
15288
15289 format=rgb24,mergeplanes=0x000102:yuv444p
15290
15291 mestimate
15292 Estimate and export motion vectors using block matching algorithms.
15293 Motion vectors are stored in frame side data to be used by other
15294 filters.
15295
15296 This filter accepts the following options:
15297
15298 method
15299 Specify the motion estimation method. Accepts one of the following
15300 values:
15301
15302 esa Exhaustive search algorithm.
15303
15304 tss Three step search algorithm.
15305
15306 tdls
15307 Two dimensional logarithmic search algorithm.
15308
15309 ntss
15310 New three step search algorithm.
15311
15312 fss Four step search algorithm.
15313
15314 ds Diamond search algorithm.
15315
15316 hexbs
15317 Hexagon-based search algorithm.
15318
15319 epzs
15320 Enhanced predictive zonal search algorithm.
15321
15322 umh Uneven multi-hexagon search algorithm.
15323
15324 Default value is esa.
15325
15326 mb_size
15327 Macroblock size. Default 16.
15328
15329 search_param
15330 Search parameter. Default 7.
15331
15332 midequalizer
15333 Apply Midway Image Equalization effect using two video streams.
15334
15335 Midway Image Equalization adjusts a pair of images to have the same
15336 histogram, while maintaining their dynamics as much as possible. It's
15337 useful for e.g. matching exposures from a pair of stereo cameras.
15338
15339 This filter has two inputs and one output, which must be of same pixel
15340 format, but may be of different sizes. The output of filter is first
15341 input adjusted with midway histogram of both inputs.
15342
15343 This filter accepts the following option:
15344
15345 planes
15346 Set which planes to process. Default is 15, which is all available
15347 planes.
15348
15349 minterpolate
15350 Convert the video to specified frame rate using motion interpolation.
15351
15352 This filter accepts the following options:
15353
15354 fps Specify the output frame rate. This can be rational e.g.
15355 "60000/1001". Frames are dropped if fps is lower than source fps.
15356 Default 60.
15357
15358 mi_mode
15359 Motion interpolation mode. Following values are accepted:
15360
15361 dup Duplicate previous or next frame for interpolating new ones.
15362
15363 blend
15364 Blend source frames. Interpolated frame is mean of previous and
15365 next frames.
15366
15367 mci Motion compensated interpolation. Following options are
15368 effective when this mode is selected:
15369
15370 mc_mode
15371 Motion compensation mode. Following values are accepted:
15372
15373 obmc
15374 Overlapped block motion compensation.
15375
15376 aobmc
15377 Adaptive overlapped block motion compensation. Window
15378 weighting coefficients are controlled adaptively
15379 according to the reliabilities of the neighboring
15380 motion vectors to reduce oversmoothing.
15381
15382 Default mode is obmc.
15383
15384 me_mode
15385 Motion estimation mode. Following values are accepted:
15386
15387 bidir
15388 Bidirectional motion estimation. Motion vectors are
15389 estimated for each source frame in both forward and
15390 backward directions.
15391
15392 bilat
15393 Bilateral motion estimation. Motion vectors are
15394 estimated directly for interpolated frame.
15395
15396 Default mode is bilat.
15397
15398 me The algorithm to be used for motion estimation. Following
15399 values are accepted:
15400
15401 esa Exhaustive search algorithm.
15402
15403 tss Three step search algorithm.
15404
15405 tdls
15406 Two dimensional logarithmic search algorithm.
15407
15408 ntss
15409 New three step search algorithm.
15410
15411 fss Four step search algorithm.
15412
15413 ds Diamond search algorithm.
15414
15415 hexbs
15416 Hexagon-based search algorithm.
15417
15418 epzs
15419 Enhanced predictive zonal search algorithm.
15420
15421 umh Uneven multi-hexagon search algorithm.
15422
15423 Default algorithm is epzs.
15424
15425 mb_size
15426 Macroblock size. Default 16.
15427
15428 search_param
15429 Motion estimation search parameter. Default 32.
15430
15431 vsbmc
15432 Enable variable-size block motion compensation. Motion
15433 estimation is applied with smaller block sizes at object
15434 boundaries in order to make the them less blur. Default is
15435 0 (disabled).
15436
15437 scd Scene change detection method. Scene change leads motion vectors to
15438 be in random direction. Scene change detection replace interpolated
15439 frames by duplicate ones. May not be needed for other modes.
15440 Following values are accepted:
15441
15442 none
15443 Disable scene change detection.
15444
15445 fdiff
15446 Frame difference. Corresponding pixel values are compared and
15447 if it satisfies scd_threshold scene change is detected.
15448
15449 Default method is fdiff.
15450
15451 scd_threshold
15452 Scene change detection threshold. Default is 10..
15453
15454 mix
15455 Mix several video input streams into one video stream.
15456
15457 A description of the accepted options follows.
15458
15459 inputs
15460 The number of inputs. If unspecified, it defaults to 2.
15461
15462 weights
15463 Specify weight of each input video stream as sequence. Each weight
15464 is separated by space. If number of weights is smaller than number
15465 of frames last specified weight will be used for all remaining
15466 unset weights.
15467
15468 scale
15469 Specify scale, if it is set it will be multiplied with sum of each
15470 weight multiplied with pixel values to give final destination pixel
15471 value. By default scale is auto scaled to sum of weights.
15472
15473 planes
15474 Set which planes to filter. Default is all. Allowed range is from 0
15475 to 15.
15476
15477 duration
15478 Specify how end of stream is determined.
15479
15480 longest
15481 The duration of the longest input. (default)
15482
15483 shortest
15484 The duration of the shortest input.
15485
15486 first
15487 The duration of the first input.
15488
15489 Commands
15490
15491 This filter supports the following commands:
15492
15493 weights
15494 scale
15495 planes
15496 Syntax is same as option with same name.
15497
15498 monochrome
15499 Convert video to gray using custom color filter.
15500
15501 A description of the accepted options follows.
15502
15503 cb Set the chroma blue spot. Allowed range is from -1 to 1. Default
15504 value is 0.
15505
15506 cr Set the chroma red spot. Allowed range is from -1 to 1. Default
15507 value is 0.
15508
15509 size
15510 Set the color filter size. Allowed range is from .1 to 10. Default
15511 value is 1.
15512
15513 high
15514 Set the highlights strength. Allowed range is from 0 to 1. Default
15515 value is 0.
15516
15517 Commands
15518
15519 This filter supports the all above options as commands.
15520
15521 morpho
15522 This filter allows to apply main morphological grayscale transforms,
15523 erode and dilate with arbitrary structures set in second input stream.
15524
15525 Unlike naive implementation and much slower performance in erosion and
15526 dilation filters, when speed is critical "morpho" filter should be used
15527 instead.
15528
15529 A description of accepted options follows,
15530
15531 mode
15532 Set morphological transform to apply, can be:
15533
15534 erode
15535 dilate
15536 open
15537 close
15538 gradient
15539 tophat
15540 blackhat
15541
15542 Default is "erode".
15543
15544 planes
15545 Set planes to filter, by default all planes except alpha are
15546 filtered.
15547
15548 structure
15549 Set which structure video frames will be processed from second
15550 input stream, can be first or all. Default is all.
15551
15552 The "morpho" filter also supports the framesync options.
15553
15554 Commands
15555
15556 This filter supports same commands as options.
15557
15558 mpdecimate
15559 Drop frames that do not differ greatly from the previous frame in order
15560 to reduce frame rate.
15561
15562 The main use of this filter is for very-low-bitrate encoding (e.g.
15563 streaming over dialup modem), but it could in theory be used for fixing
15564 movies that were inverse-telecined incorrectly.
15565
15566 A description of the accepted options follows.
15567
15568 max Set the maximum number of consecutive frames which can be dropped
15569 (if positive), or the minimum interval between dropped frames (if
15570 negative). If the value is 0, the frame is dropped disregarding the
15571 number of previous sequentially dropped frames.
15572
15573 Default value is 0.
15574
15575 hi
15576 lo
15577 frac
15578 Set the dropping threshold values.
15579
15580 Values for hi and lo are for 8x8 pixel blocks and represent actual
15581 pixel value differences, so a threshold of 64 corresponds to 1 unit
15582 of difference for each pixel, or the same spread out differently
15583 over the block.
15584
15585 A frame is a candidate for dropping if no 8x8 blocks differ by more
15586 than a threshold of hi, and if no more than frac blocks (1 meaning
15587 the whole image) differ by more than a threshold of lo.
15588
15589 Default value for hi is 64*12, default value for lo is 64*5, and
15590 default value for frac is 0.33.
15591
15592 msad
15593 Obtain the MSAD (Mean Sum of Absolute Differences) between two input
15594 videos.
15595
15596 This filter takes two input videos.
15597
15598 Both input videos must have the same resolution and pixel format for
15599 this filter to work correctly. Also it assumes that both inputs have
15600 the same number of frames, which are compared one by one.
15601
15602 The obtained per component, average, min and max MSAD is printed
15603 through the logging system.
15604
15605 The filter stores the calculated MSAD of each frame in frame metadata.
15606
15607 This filter also supports the framesync options.
15608
15609 In the below example the input file main.mpg being processed is
15610 compared with the reference file ref.mpg.
15611
15612 ffmpeg -i main.mpg -i ref.mpg -lavfi msad -f null -
15613
15614 multiply
15615 Multiply first video stream pixels values with second video stream
15616 pixels values.
15617
15618 The filter accepts the following options:
15619
15620 scale
15621 Set the scale applied to second video stream. By default is 1.
15622 Allowed range is from 0 to 9.
15623
15624 offset
15625 Set the offset applied to second video stream. By default is 0.5.
15626 Allowed range is from -1 to 1.
15627
15628 planes
15629 Specify planes from input video stream that will be processed. By
15630 default all planes are processed.
15631
15632 Commands
15633
15634 This filter supports same commands as options.
15635
15636 negate
15637 Negate (invert) the input video.
15638
15639 It accepts the following option:
15640
15641 components
15642 Set components to negate.
15643
15644 Available values for components are:
15645
15646 y
15647 u
15648 v
15649 a
15650 r
15651 g
15652 b
15653 negate_alpha
15654 With value 1, it negates the alpha component, if present. Default
15655 value is 0.
15656
15657 Commands
15658
15659 This filter supports same commands as options.
15660
15661 nlmeans
15662 Denoise frames using Non-Local Means algorithm.
15663
15664 Each pixel is adjusted by looking for other pixels with similar
15665 contexts. This context similarity is defined by comparing their
15666 surrounding patches of size pxp. Patches are searched in an area of rxr
15667 around the pixel.
15668
15669 Note that the research area defines centers for patches, which means
15670 some patches will be made of pixels outside that research area.
15671
15672 The filter accepts the following options.
15673
15674 s Set denoising strength. Default is 1.0. Must be in range [1.0,
15675 30.0].
15676
15677 p Set patch size. Default is 7. Must be odd number in range [0, 99].
15678
15679 pc Same as p but for chroma planes.
15680
15681 The default value is 0 and means automatic.
15682
15683 r Set research size. Default is 15. Must be odd number in range [0,
15684 99].
15685
15686 rc Same as r but for chroma planes.
15687
15688 The default value is 0 and means automatic.
15689
15690 nnedi
15691 Deinterlace video using neural network edge directed interpolation.
15692
15693 This filter accepts the following options:
15694
15695 weights
15696 Mandatory option, without binary file filter can not work.
15697 Currently file can be found here:
15698 https://github.com/dubhater/vapoursynth-nnedi3/blob/master/src/nnedi3_weights.bin
15699
15700 deint
15701 Set which frames to deinterlace, by default it is "all". Can be
15702 "all" or "interlaced".
15703
15704 field
15705 Set mode of operation.
15706
15707 Can be one of the following:
15708
15709 af Use frame flags, both fields.
15710
15711 a Use frame flags, single field.
15712
15713 t Use top field only.
15714
15715 b Use bottom field only.
15716
15717 tf Use both fields, top first.
15718
15719 bf Use both fields, bottom first.
15720
15721 planes
15722 Set which planes to process, by default filter process all frames.
15723
15724 nsize
15725 Set size of local neighborhood around each pixel, used by the
15726 predictor neural network.
15727
15728 Can be one of the following:
15729
15730 s8x6
15731 s16x6
15732 s32x6
15733 s48x6
15734 s8x4
15735 s16x4
15736 s32x4
15737 nns Set the number of neurons in predictor neural network. Can be one
15738 of the following:
15739
15740 n16
15741 n32
15742 n64
15743 n128
15744 n256
15745 qual
15746 Controls the number of different neural network predictions that
15747 are blended together to compute the final output value. Can be
15748 "fast", default or "slow".
15749
15750 etype
15751 Set which set of weights to use in the predictor. Can be one of
15752 the following:
15753
15754 a, abs
15755 weights trained to minimize absolute error
15756
15757 s, mse
15758 weights trained to minimize squared error
15759
15760 pscrn
15761 Controls whether or not the prescreener neural network is used to
15762 decide which pixels should be processed by the predictor neural
15763 network and which can be handled by simple cubic interpolation.
15764 The prescreener is trained to know whether cubic interpolation will
15765 be sufficient for a pixel or whether it should be predicted by the
15766 predictor nn. The computational complexity of the prescreener nn
15767 is much less than that of the predictor nn. Since most pixels can
15768 be handled by cubic interpolation, using the prescreener generally
15769 results in much faster processing. The prescreener is pretty
15770 accurate, so the difference between using it and not using it is
15771 almost always unnoticeable.
15772
15773 Can be one of the following:
15774
15775 none
15776 original
15777 new
15778 new2
15779 new3
15780
15781 Default is "new".
15782
15783 Commands
15784
15785 This filter supports same commands as options, excluding weights
15786 option.
15787
15788 noformat
15789 Force libavfilter not to use any of the specified pixel formats for the
15790 input to the next filter.
15791
15792 It accepts the following parameters:
15793
15794 pix_fmts
15795 A '|'-separated list of pixel format names, such as
15796 pix_fmts=yuv420p|monow|rgb24".
15797
15798 Examples
15799
15800 • Force libavfilter to use a format different from yuv420p for the
15801 input to the vflip filter:
15802
15803 noformat=pix_fmts=yuv420p,vflip
15804
15805 • Convert the input video to any of the formats not contained in the
15806 list:
15807
15808 noformat=yuv420p|yuv444p|yuv410p
15809
15810 noise
15811 Add noise on video input frame.
15812
15813 The filter accepts the following options:
15814
15815 all_seed
15816 c0_seed
15817 c1_seed
15818 c2_seed
15819 c3_seed
15820 Set noise seed for specific pixel component or all pixel components
15821 in case of all_seed. Default value is 123457.
15822
15823 all_strength, alls
15824 c0_strength, c0s
15825 c1_strength, c1s
15826 c2_strength, c2s
15827 c3_strength, c3s
15828 Set noise strength for specific pixel component or all pixel
15829 components in case all_strength. Default value is 0. Allowed range
15830 is [0, 100].
15831
15832 all_flags, allf
15833 c0_flags, c0f
15834 c1_flags, c1f
15835 c2_flags, c2f
15836 c3_flags, c3f
15837 Set pixel component flags or set flags for all components if
15838 all_flags. Available values for component flags are:
15839
15840 a averaged temporal noise (smoother)
15841
15842 p mix random noise with a (semi)regular pattern
15843
15844 t temporal noise (noise pattern changes between frames)
15845
15846 u uniform noise (gaussian otherwise)
15847
15848 Examples
15849
15850 Add temporal and uniform noise to input video:
15851
15852 noise=alls=20:allf=t+u
15853
15854 normalize
15855 Normalize RGB video (aka histogram stretching, contrast stretching).
15856 See: https://en.wikipedia.org/wiki/Normalization_(image_processing)
15857
15858 For each channel of each frame, the filter computes the input range and
15859 maps it linearly to the user-specified output range. The output range
15860 defaults to the full dynamic range from pure black to pure white.
15861
15862 Temporal smoothing can be used on the input range to reduce flickering
15863 (rapid changes in brightness) caused when small dark or bright objects
15864 enter or leave the scene. This is similar to the auto-exposure
15865 (automatic gain control) on a video camera, and, like a video camera,
15866 it may cause a period of over- or under-exposure of the video.
15867
15868 The R,G,B channels can be normalized independently, which may cause
15869 some color shifting, or linked together as a single channel, which
15870 prevents color shifting. Linked normalization preserves hue.
15871 Independent normalization does not, so it can be used to remove some
15872 color casts. Independent and linked normalization can be combined in
15873 any ratio.
15874
15875 The normalize filter accepts the following options:
15876
15877 blackpt
15878 whitept
15879 Colors which define the output range. The minimum input value is
15880 mapped to the blackpt. The maximum input value is mapped to the
15881 whitept. The defaults are black and white respectively. Specifying
15882 white for blackpt and black for whitept will give color-inverted,
15883 normalized video. Shades of grey can be used to reduce the dynamic
15884 range (contrast). Specifying saturated colors here can create some
15885 interesting effects.
15886
15887 smoothing
15888 The number of previous frames to use for temporal smoothing. The
15889 input range of each channel is smoothed using a rolling average
15890 over the current frame and the smoothing previous frames. The
15891 default is 0 (no temporal smoothing).
15892
15893 independence
15894 Controls the ratio of independent (color shifting) channel
15895 normalization to linked (color preserving) normalization. 0.0 is
15896 fully linked, 1.0 is fully independent. Defaults to 1.0 (fully
15897 independent).
15898
15899 strength
15900 Overall strength of the filter. 1.0 is full strength. 0.0 is a
15901 rather expensive no-op. Defaults to 1.0 (full strength).
15902
15903 Commands
15904
15905 This filter supports same commands as options, excluding smoothing
15906 option. The command accepts the same syntax of the corresponding
15907 option.
15908
15909 If the specified expression is not valid, it is kept at its current
15910 value.
15911
15912 Examples
15913
15914 Stretch video contrast to use the full dynamic range, with no temporal
15915 smoothing; may flicker depending on the source content:
15916
15917 normalize=blackpt=black:whitept=white:smoothing=0
15918
15919 As above, but with 50 frames of temporal smoothing; flicker should be
15920 reduced, depending on the source content:
15921
15922 normalize=blackpt=black:whitept=white:smoothing=50
15923
15924 As above, but with hue-preserving linked channel normalization:
15925
15926 normalize=blackpt=black:whitept=white:smoothing=50:independence=0
15927
15928 As above, but with half strength:
15929
15930 normalize=blackpt=black:whitept=white:smoothing=50:independence=0:strength=0.5
15931
15932 Map the darkest input color to red, the brightest input color to cyan:
15933
15934 normalize=blackpt=red:whitept=cyan
15935
15936 null
15937 Pass the video source unchanged to the output.
15938
15939 ocr
15940 Optical Character Recognition
15941
15942 This filter uses Tesseract for optical character recognition. To enable
15943 compilation of this filter, you need to configure FFmpeg with
15944 "--enable-libtesseract".
15945
15946 It accepts the following options:
15947
15948 datapath
15949 Set datapath to tesseract data. Default is to use whatever was set
15950 at installation.
15951
15952 language
15953 Set language, default is "eng".
15954
15955 whitelist
15956 Set character whitelist.
15957
15958 blacklist
15959 Set character blacklist.
15960
15961 The filter exports recognized text as the frame metadata
15962 "lavfi.ocr.text". The filter exports confidence of recognized words as
15963 the frame metadata "lavfi.ocr.confidence".
15964
15965 ocv
15966 Apply a video transform using libopencv.
15967
15968 To enable this filter, install the libopencv library and headers and
15969 configure FFmpeg with "--enable-libopencv".
15970
15971 It accepts the following parameters:
15972
15973 filter_name
15974 The name of the libopencv filter to apply.
15975
15976 filter_params
15977 The parameters to pass to the libopencv filter. If not specified,
15978 the default values are assumed.
15979
15980 Refer to the official libopencv documentation for more precise
15981 information:
15982 <http://docs.opencv.org/master/modules/imgproc/doc/filtering.html>
15983
15984 Several libopencv filters are supported; see the following subsections.
15985
15986 dilate
15987
15988 Dilate an image by using a specific structuring element. It
15989 corresponds to the libopencv function "cvDilate".
15990
15991 It accepts the parameters: struct_el|nb_iterations.
15992
15993 struct_el represents a structuring element, and has the syntax:
15994 colsxrows+anchor_xxanchor_y/shape
15995
15996 cols and rows represent the number of columns and rows of the
15997 structuring element, anchor_x and anchor_y the anchor point, and shape
15998 the shape for the structuring element. shape must be "rect", "cross",
15999 "ellipse", or "custom".
16000
16001 If the value for shape is "custom", it must be followed by a string of
16002 the form "=filename". The file with name filename is assumed to
16003 represent a binary image, with each printable character corresponding
16004 to a bright pixel. When a custom shape is used, cols and rows are
16005 ignored, the number or columns and rows of the read file are assumed
16006 instead.
16007
16008 The default value for struct_el is "3x3+0x0/rect".
16009
16010 nb_iterations specifies the number of times the transform is applied to
16011 the image, and defaults to 1.
16012
16013 Some examples:
16014
16015 # Use the default values
16016 ocv=dilate
16017
16018 # Dilate using a structuring element with a 5x5 cross, iterating two times
16019 ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
16020
16021 # Read the shape from the file diamond.shape, iterating two times.
16022 # The file diamond.shape may contain a pattern of characters like this
16023 # *
16024 # ***
16025 # *****
16026 # ***
16027 # *
16028 # The specified columns and rows are ignored
16029 # but the anchor point coordinates are not
16030 ocv=dilate:0x0+2x2/custom=diamond.shape|2
16031
16032 erode
16033
16034 Erode an image by using a specific structuring element. It corresponds
16035 to the libopencv function "cvErode".
16036
16037 It accepts the parameters: struct_el:nb_iterations, with the same
16038 syntax and semantics as the dilate filter.
16039
16040 smooth
16041
16042 Smooth the input video.
16043
16044 The filter takes the following parameters:
16045 type|param1|param2|param3|param4.
16046
16047 type is the type of smooth filter to apply, and must be one of the
16048 following values: "blur", "blur_no_scale", "median", "gaussian", or
16049 "bilateral". The default value is "gaussian".
16050
16051 The meaning of param1, param2, param3, and param4 depends on the smooth
16052 type. param1 and param2 accept integer positive values or 0. param3 and
16053 param4 accept floating point values.
16054
16055 The default value for param1 is 3. The default value for the other
16056 parameters is 0.
16057
16058 These parameters correspond to the parameters assigned to the libopencv
16059 function "cvSmooth".
16060
16061 oscilloscope
16062 2D Video Oscilloscope.
16063
16064 Useful to measure spatial impulse, step responses, chroma delays, etc.
16065
16066 It accepts the following parameters:
16067
16068 x Set scope center x position.
16069
16070 y Set scope center y position.
16071
16072 s Set scope size, relative to frame diagonal.
16073
16074 t Set scope tilt/rotation.
16075
16076 o Set trace opacity.
16077
16078 tx Set trace center x position.
16079
16080 ty Set trace center y position.
16081
16082 tw Set trace width, relative to width of frame.
16083
16084 th Set trace height, relative to height of frame.
16085
16086 c Set which components to trace. By default it traces first three
16087 components.
16088
16089 g Draw trace grid. By default is enabled.
16090
16091 st Draw some statistics. By default is enabled.
16092
16093 sc Draw scope. By default is enabled.
16094
16095 Commands
16096
16097 This filter supports same commands as options. The command accepts the
16098 same syntax of the corresponding option.
16099
16100 If the specified expression is not valid, it is kept at its current
16101 value.
16102
16103 Examples
16104
16105 • Inspect full first row of video frame.
16106
16107 oscilloscope=x=0.5:y=0:s=1
16108
16109 • Inspect full last row of video frame.
16110
16111 oscilloscope=x=0.5:y=1:s=1
16112
16113 • Inspect full 5th line of video frame of height 1080.
16114
16115 oscilloscope=x=0.5:y=5/1080:s=1
16116
16117 • Inspect full last column of video frame.
16118
16119 oscilloscope=x=1:y=0.5:s=1:t=1
16120
16121 overlay
16122 Overlay one video on top of another.
16123
16124 It takes two inputs and has one output. The first input is the "main"
16125 video on which the second input is overlaid.
16126
16127 It accepts the following parameters:
16128
16129 A description of the accepted options follows.
16130
16131 x
16132 y Set the expression for the x and y coordinates of the overlaid
16133 video on the main video. Default value is "0" for both expressions.
16134 In case the expression is invalid, it is set to a huge value
16135 (meaning that the overlay will not be displayed within the output
16136 visible area).
16137
16138 eof_action
16139 See framesync.
16140
16141 eval
16142 Set when the expressions for x, and y are evaluated.
16143
16144 It accepts the following values:
16145
16146 init
16147 only evaluate expressions once during the filter initialization
16148 or when a command is processed
16149
16150 frame
16151 evaluate expressions for each incoming frame
16152
16153 Default value is frame.
16154
16155 shortest
16156 See framesync.
16157
16158 format
16159 Set the format for the output video.
16160
16161 It accepts the following values:
16162
16163 yuv420
16164 force YUV420 output
16165
16166 yuv420p10
16167 force YUV420p10 output
16168
16169 yuv422
16170 force YUV422 output
16171
16172 yuv422p10
16173 force YUV422p10 output
16174
16175 yuv444
16176 force YUV444 output
16177
16178 rgb force packed RGB output
16179
16180 gbrp
16181 force planar RGB output
16182
16183 auto
16184 automatically pick format
16185
16186 Default value is yuv420.
16187
16188 repeatlast
16189 See framesync.
16190
16191 alpha
16192 Set format of alpha of the overlaid video, it can be straight or
16193 premultiplied. Default is straight.
16194
16195 The x, and y expressions can contain the following parameters.
16196
16197 main_w, W
16198 main_h, H
16199 The main input width and height.
16200
16201 overlay_w, w
16202 overlay_h, h
16203 The overlay input width and height.
16204
16205 x
16206 y The computed values for x and y. They are evaluated for each new
16207 frame.
16208
16209 hsub
16210 vsub
16211 horizontal and vertical chroma subsample values of the output
16212 format. For example for the pixel format "yuv422p" hsub is 2 and
16213 vsub is 1.
16214
16215 n the number of input frame, starting from 0
16216
16217 pos the position in the file of the input frame, NAN if unknown
16218
16219 t The timestamp, expressed in seconds. It's NAN if the input
16220 timestamp is unknown.
16221
16222 This filter also supports the framesync options.
16223
16224 Note that the n, pos, t variables are available only when evaluation is
16225 done per frame, and will evaluate to NAN when eval is set to init.
16226
16227 Be aware that frames are taken from each input video in timestamp
16228 order, hence, if their initial timestamps differ, it is a good idea to
16229 pass the two inputs through a setpts=PTS-STARTPTS filter to have them
16230 begin in the same zero timestamp, as the example for the movie filter
16231 does.
16232
16233 You can chain together more overlays but you should test the efficiency
16234 of such approach.
16235
16236 Commands
16237
16238 This filter supports the following commands:
16239
16240 x
16241 y Modify the x and y of the overlay input. The command accepts the
16242 same syntax of the corresponding option.
16243
16244 If the specified expression is not valid, it is kept at its current
16245 value.
16246
16247 Examples
16248
16249 • Draw the overlay at 10 pixels from the bottom right corner of the
16250 main video:
16251
16252 overlay=main_w-overlay_w-10:main_h-overlay_h-10
16253
16254 Using named options the example above becomes:
16255
16256 overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
16257
16258 • Insert a transparent PNG logo in the bottom left corner of the
16259 input, using the ffmpeg tool with the "-filter_complex" option:
16260
16261 ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
16262
16263 • Insert 2 different transparent PNG logos (second logo on bottom
16264 right corner) using the ffmpeg tool:
16265
16266 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
16267
16268 • Add a transparent color layer on top of the main video; "WxH" must
16269 specify the size of the main input to the overlay filter:
16270
16271 color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
16272
16273 • Play an original video and a filtered version (here with the
16274 deshake filter) side by side using the ffplay tool:
16275
16276 ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
16277
16278 The above command is the same as:
16279
16280 ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
16281
16282 • Make a sliding overlay appearing from the left to the right top
16283 part of the screen starting since time 2:
16284
16285 overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
16286
16287 • Compose output by putting two input videos side to side:
16288
16289 ffmpeg -i left.avi -i right.avi -filter_complex "
16290 nullsrc=size=200x100 [background];
16291 [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
16292 [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
16293 [background][left] overlay=shortest=1 [background+left];
16294 [background+left][right] overlay=shortest=1:x=100 [left+right]
16295 "
16296
16297 • Mask 10-20 seconds of a video by applying the delogo filter to a
16298 section
16299
16300 ffmpeg -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
16301 -vf '[in]split[split_main][split_delogo];[split_delogo]trim=start=360:end=371,delogo=0:0:640:480[delogoed];[split_main][delogoed]overlay=eof_action=pass[out]'
16302 masked.avi
16303
16304 • Chain several overlays in cascade:
16305
16306 nullsrc=s=200x200 [bg];
16307 testsrc=s=100x100, split=4 [in0][in1][in2][in3];
16308 [in0] lutrgb=r=0, [bg] overlay=0:0 [mid0];
16309 [in1] lutrgb=g=0, [mid0] overlay=100:0 [mid1];
16310 [in2] lutrgb=b=0, [mid1] overlay=0:100 [mid2];
16311 [in3] null, [mid2] overlay=100:100 [out0]
16312
16313 overlay_cuda
16314 Overlay one video on top of another.
16315
16316 This is the CUDA variant of the overlay filter. It only accepts CUDA
16317 frames. The underlying input pixel formats have to match.
16318
16319 It takes two inputs and has one output. The first input is the "main"
16320 video on which the second input is overlaid.
16321
16322 It accepts the following parameters:
16323
16324 x
16325 y Set expressions for the x and y coordinates of the overlaid video
16326 on the main video.
16327
16328 They can contain the following parameters:
16329
16330 main_w, W
16331 main_h, H
16332 The main input width and height.
16333
16334 overlay_w, w
16335 overlay_h, h
16336 The overlay input width and height.
16337
16338 x
16339 y The computed values for x and y. They are evaluated for each
16340 new frame.
16341
16342 n The ordinal index of the main input frame, starting from 0.
16343
16344 pos The byte offset position in the file of the main input frame,
16345 NAN if unknown.
16346
16347 t The timestamp of the main input frame, expressed in seconds,
16348 NAN if unknown.
16349
16350 Default value is "0" for both expressions.
16351
16352 eval
16353 Set when the expressions for x and y are evaluated.
16354
16355 It accepts the following values:
16356
16357 init
16358 Evaluate expressions once during filter initialization or when
16359 a command is processed.
16360
16361 frame
16362 Evaluate expressions for each incoming frame
16363
16364 Default value is frame.
16365
16366 eof_action
16367 See framesync.
16368
16369 shortest
16370 See framesync.
16371
16372 repeatlast
16373 See framesync.
16374
16375 This filter also supports the framesync options.
16376
16377 owdenoise
16378 Apply Overcomplete Wavelet denoiser.
16379
16380 The filter accepts the following options:
16381
16382 depth
16383 Set depth.
16384
16385 Larger depth values will denoise lower frequency components more,
16386 but slow down filtering.
16387
16388 Must be an int in the range 8-16, default is 8.
16389
16390 luma_strength, ls
16391 Set luma strength.
16392
16393 Must be a double value in the range 0-1000, default is 1.0.
16394
16395 chroma_strength, cs
16396 Set chroma strength.
16397
16398 Must be a double value in the range 0-1000, default is 1.0.
16399
16400 pad
16401 Add paddings to the input image, and place the original input at the
16402 provided x, y coordinates.
16403
16404 It accepts the following parameters:
16405
16406 width, w
16407 height, h
16408 Specify an expression for the size of the output image with the
16409 paddings added. If the value for width or height is 0, the
16410 corresponding input size is used for the output.
16411
16412 The width expression can reference the value set by the height
16413 expression, and vice versa.
16414
16415 The default value of width and height is 0.
16416
16417 x
16418 y Specify the offsets to place the input image at within the padded
16419 area, with respect to the top/left border of the output image.
16420
16421 The x expression can reference the value set by the y expression,
16422 and vice versa.
16423
16424 The default value of x and y is 0.
16425
16426 If x or y evaluate to a negative number, they'll be changed so the
16427 input image is centered on the padded area.
16428
16429 color
16430 Specify the color of the padded area. For the syntax of this
16431 option, check the "Color" section in the ffmpeg-utils manual.
16432
16433 The default value of color is "black".
16434
16435 eval
16436 Specify when to evaluate width, height, x and y expression.
16437
16438 It accepts the following values:
16439
16440 init
16441 Only evaluate expressions once during the filter initialization
16442 or when a command is processed.
16443
16444 frame
16445 Evaluate expressions for each incoming frame.
16446
16447 Default value is init.
16448
16449 aspect
16450 Pad to aspect instead to a resolution.
16451
16452 The value for the width, height, x, and y options are expressions
16453 containing the following constants:
16454
16455 in_w
16456 in_h
16457 The input video width and height.
16458
16459 iw
16460 ih These are the same as in_w and in_h.
16461
16462 out_w
16463 out_h
16464 The output width and height (the size of the padded area), as
16465 specified by the width and height expressions.
16466
16467 ow
16468 oh These are the same as out_w and out_h.
16469
16470 x
16471 y The x and y offsets as specified by the x and y expressions, or NAN
16472 if not yet specified.
16473
16474 a same as iw / ih
16475
16476 sar input sample aspect ratio
16477
16478 dar input display aspect ratio, it is the same as (iw / ih) * sar
16479
16480 hsub
16481 vsub
16482 The horizontal and vertical chroma subsample values. For example
16483 for the pixel format "yuv422p" hsub is 2 and vsub is 1.
16484
16485 Examples
16486
16487 • Add paddings with the color "violet" to the input video. The output
16488 video size is 640x480, and the top-left corner of the input video
16489 is placed at column 0, row 40
16490
16491 pad=640:480:0:40:violet
16492
16493 The example above is equivalent to the following command:
16494
16495 pad=width=640:height=480:x=0:y=40:color=violet
16496
16497 • Pad the input to get an output with dimensions increased by 3/2,
16498 and put the input video at the center of the padded area:
16499
16500 pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
16501
16502 • Pad the input to get a squared output with size equal to the
16503 maximum value between the input width and height, and put the input
16504 video at the center of the padded area:
16505
16506 pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
16507
16508 • Pad the input to get a final w/h ratio of 16:9:
16509
16510 pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
16511
16512 • In case of anamorphic video, in order to set the output display
16513 aspect correctly, it is necessary to use sar in the expression,
16514 according to the relation:
16515
16516 (ih * X / ih) * sar = output_dar
16517 X = output_dar / sar
16518
16519 Thus the previous example needs to be modified to:
16520
16521 pad="ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2"
16522
16523 • Double the output size and put the input video in the bottom-right
16524 corner of the output padded area:
16525
16526 pad="2*iw:2*ih:ow-iw:oh-ih"
16527
16528 palettegen
16529 Generate one palette for a whole video stream.
16530
16531 It accepts the following options:
16532
16533 max_colors
16534 Set the maximum number of colors to quantize in the palette. Note:
16535 the palette will still contain 256 colors; the unused palette
16536 entries will be black.
16537
16538 reserve_transparent
16539 Create a palette of 255 colors maximum and reserve the last one for
16540 transparency. Reserving the transparency color is useful for GIF
16541 optimization. If not set, the maximum of colors in the palette
16542 will be 256. You probably want to disable this option for a
16543 standalone image. Set by default.
16544
16545 transparency_color
16546 Set the color that will be used as background for transparency.
16547
16548 stats_mode
16549 Set statistics mode.
16550
16551 It accepts the following values:
16552
16553 full
16554 Compute full frame histograms.
16555
16556 diff
16557 Compute histograms only for the part that differs from previous
16558 frame. This might be relevant to give more importance to the
16559 moving part of your input if the background is static.
16560
16561 single
16562 Compute new histogram for each frame.
16563
16564 Default value is full.
16565
16566 The filter also exports the frame metadata "lavfi.color_quant_ratio"
16567 ("nb_color_in / nb_color_out") which you can use to evaluate the degree
16568 of color quantization of the palette. This information is also visible
16569 at info logging level.
16570
16571 Examples
16572
16573 • Generate a representative palette of a given video using ffmpeg:
16574
16575 ffmpeg -i input.mkv -vf palettegen palette.png
16576
16577 paletteuse
16578 Use a palette to downsample an input video stream.
16579
16580 The filter takes two inputs: one video stream and a palette. The
16581 palette must be a 256 pixels image.
16582
16583 It accepts the following options:
16584
16585 dither
16586 Select dithering mode. Available algorithms are:
16587
16588 bayer
16589 Ordered 8x8 bayer dithering (deterministic)
16590
16591 heckbert
16592 Dithering as defined by Paul Heckbert in 1982 (simple error
16593 diffusion). Note: this dithering is sometimes considered
16594 "wrong" and is included as a reference.
16595
16596 floyd_steinberg
16597 Floyd and Steingberg dithering (error diffusion)
16598
16599 sierra2
16600 Frankie Sierra dithering v2 (error diffusion)
16601
16602 sierra2_4a
16603 Frankie Sierra dithering v2 "Lite" (error diffusion)
16604
16605 sierra3
16606 Frankie Sierra dithering v3 (error diffusion)
16607
16608 burkes
16609 Burkes dithering (error diffusion)
16610
16611 atkinson
16612 Atkinson dithering by Bill Atkinson at Apple Computer (error
16613 diffusion)
16614
16615 Default is sierra2_4a.
16616
16617 bayer_scale
16618 When bayer dithering is selected, this option defines the scale of
16619 the pattern (how much the crosshatch pattern is visible). A low
16620 value means more visible pattern for less banding, and higher value
16621 means less visible pattern at the cost of more banding.
16622
16623 The option must be an integer value in the range [0,5]. Default is
16624 2.
16625
16626 diff_mode
16627 If set, define the zone to process
16628
16629 rectangle
16630 Only the changing rectangle will be reprocessed. This is
16631 similar to GIF cropping/offsetting compression mechanism. This
16632 option can be useful for speed if only a part of the image is
16633 changing, and has use cases such as limiting the scope of the
16634 error diffusal dither to the rectangle that bounds the moving
16635 scene (it leads to more deterministic output if the scene
16636 doesn't change much, and as a result less moving noise and
16637 better GIF compression).
16638
16639 Default is none.
16640
16641 new Take new palette for each output frame.
16642
16643 alpha_threshold
16644 Sets the alpha threshold for transparency. Alpha values above this
16645 threshold will be treated as completely opaque, and values below
16646 this threshold will be treated as completely transparent.
16647
16648 The option must be an integer value in the range [0,255]. Default
16649 is 128.
16650
16651 Examples
16652
16653 • Use a palette (generated for example with palettegen) to encode a
16654 GIF using ffmpeg:
16655
16656 ffmpeg -i input.mkv -i palette.png -lavfi paletteuse output.gif
16657
16658 perspective
16659 Correct perspective of video not recorded perpendicular to the screen.
16660
16661 A description of the accepted parameters follows.
16662
16663 x0
16664 y0
16665 x1
16666 y1
16667 x2
16668 y2
16669 x3
16670 y3 Set coordinates expression for top left, top right, bottom left and
16671 bottom right corners. Default values are "0:0:W:0:0:H:W:H" with
16672 which perspective will remain unchanged. If the "sense" option is
16673 set to "source", then the specified points will be sent to the
16674 corners of the destination. If the "sense" option is set to
16675 "destination", then the corners of the source will be sent to the
16676 specified coordinates.
16677
16678 The expressions can use the following variables:
16679
16680 W
16681 H the width and height of video frame.
16682
16683 in Input frame count.
16684
16685 on Output frame count.
16686
16687 interpolation
16688 Set interpolation for perspective correction.
16689
16690 It accepts the following values:
16691
16692 linear
16693 cubic
16694
16695 Default value is linear.
16696
16697 sense
16698 Set interpretation of coordinate options.
16699
16700 It accepts the following values:
16701
16702 0, source
16703 Send point in the source specified by the given coordinates to
16704 the corners of the destination.
16705
16706 1, destination
16707 Send the corners of the source to the point in the destination
16708 specified by the given coordinates.
16709
16710 Default value is source.
16711
16712 eval
16713 Set when the expressions for coordinates x0,y0,...x3,y3 are
16714 evaluated.
16715
16716 It accepts the following values:
16717
16718 init
16719 only evaluate expressions once during the filter initialization
16720 or when a command is processed
16721
16722 frame
16723 evaluate expressions for each incoming frame
16724
16725 Default value is init.
16726
16727 phase
16728 Delay interlaced video by one field time so that the field order
16729 changes.
16730
16731 The intended use is to fix PAL movies that have been captured with the
16732 opposite field order to the film-to-video transfer.
16733
16734 A description of the accepted parameters follows.
16735
16736 mode
16737 Set phase mode.
16738
16739 It accepts the following values:
16740
16741 t Capture field order top-first, transfer bottom-first. Filter
16742 will delay the bottom field.
16743
16744 b Capture field order bottom-first, transfer top-first. Filter
16745 will delay the top field.
16746
16747 p Capture and transfer with the same field order. This mode only
16748 exists for the documentation of the other options to refer to,
16749 but if you actually select it, the filter will faithfully do
16750 nothing.
16751
16752 a Capture field order determined automatically by field flags,
16753 transfer opposite. Filter selects among t and b modes on a
16754 frame by frame basis using field flags. If no field information
16755 is available, then this works just like u.
16756
16757 u Capture unknown or varying, transfer opposite. Filter selects
16758 among t and b on a frame by frame basis by analyzing the images
16759 and selecting the alternative that produces best match between
16760 the fields.
16761
16762 T Capture top-first, transfer unknown or varying. Filter selects
16763 among t and p using image analysis.
16764
16765 B Capture bottom-first, transfer unknown or varying. Filter
16766 selects among b and p using image analysis.
16767
16768 A Capture determined by field flags, transfer unknown or varying.
16769 Filter selects among t, b and p using field flags and image
16770 analysis. If no field information is available, then this works
16771 just like U. This is the default mode.
16772
16773 U Both capture and transfer unknown or varying. Filter selects
16774 among t, b and p using image analysis only.
16775
16776 Commands
16777
16778 This filter supports the all above options as commands.
16779
16780 photosensitivity
16781 Reduce various flashes in video, so to help users with epilepsy.
16782
16783 It accepts the following options:
16784
16785 frames, f
16786 Set how many frames to use when filtering. Default is 30.
16787
16788 threshold, t
16789 Set detection threshold factor. Default is 1. Lower is stricter.
16790
16791 skip
16792 Set how many pixels to skip when sampling frames. Default is 1.
16793 Allowed range is from 1 to 1024.
16794
16795 bypass
16796 Leave frames unchanged. Default is disabled.
16797
16798 pixdesctest
16799 Pixel format descriptor test filter, mainly useful for internal
16800 testing. The output video should be equal to the input video.
16801
16802 For example:
16803
16804 format=monow, pixdesctest
16805
16806 can be used to test the monowhite pixel format descriptor definition.
16807
16808 pixelize
16809 Apply pixelization to video stream.
16810
16811 The filter accepts the following options:
16812
16813 width, w
16814 height, h
16815 Set block dimensions that will be used for pixelization. Default
16816 value is 16.
16817
16818 mode, m
16819 Set the mode of pixelization used.
16820
16821 Possible values are:
16822
16823 avg
16824 min
16825 max
16826
16827 Default value is "avg".
16828
16829 planes, p
16830 Set what planes to filter. Default is to filter all planes.
16831
16832 Commands
16833
16834 This filter supports all options as commands.
16835
16836 pixscope
16837 Display sample values of color channels. Mainly useful for checking
16838 color and levels. Minimum supported resolution is 640x480.
16839
16840 The filters accept the following options:
16841
16842 x Set scope X position, relative offset on X axis.
16843
16844 y Set scope Y position, relative offset on Y axis.
16845
16846 w Set scope width.
16847
16848 h Set scope height.
16849
16850 o Set window opacity. This window also holds statistics about pixel
16851 area.
16852
16853 wx Set window X position, relative offset on X axis.
16854
16855 wy Set window Y position, relative offset on Y axis.
16856
16857 Commands
16858
16859 This filter supports same commands as options.
16860
16861 pp
16862 Enable the specified chain of postprocessing subfilters using
16863 libpostproc. This library should be automatically selected with a GPL
16864 build ("--enable-gpl"). Subfilters must be separated by '/' and can be
16865 disabled by prepending a '-'. Each subfilter and some options have a
16866 short and a long name that can be used interchangeably, i.e. dr/dering
16867 are the same.
16868
16869 The filters accept the following options:
16870
16871 subfilters
16872 Set postprocessing subfilters string.
16873
16874 All subfilters share common options to determine their scope:
16875
16876 a/autoq
16877 Honor the quality commands for this subfilter.
16878
16879 c/chrom
16880 Do chrominance filtering, too (default).
16881
16882 y/nochrom
16883 Do luminance filtering only (no chrominance).
16884
16885 n/noluma
16886 Do chrominance filtering only (no luminance).
16887
16888 These options can be appended after the subfilter name, separated by a
16889 '|'.
16890
16891 Available subfilters are:
16892
16893 hb/hdeblock[|difference[|flatness]]
16894 Horizontal deblocking filter
16895
16896 difference
16897 Difference factor where higher values mean more deblocking
16898 (default: 32).
16899
16900 flatness
16901 Flatness threshold where lower values mean more deblocking
16902 (default: 39).
16903
16904 vb/vdeblock[|difference[|flatness]]
16905 Vertical deblocking filter
16906
16907 difference
16908 Difference factor where higher values mean more deblocking
16909 (default: 32).
16910
16911 flatness
16912 Flatness threshold where lower values mean more deblocking
16913 (default: 39).
16914
16915 ha/hadeblock[|difference[|flatness]]
16916 Accurate horizontal deblocking filter
16917
16918 difference
16919 Difference factor where higher values mean more deblocking
16920 (default: 32).
16921
16922 flatness
16923 Flatness threshold where lower values mean more deblocking
16924 (default: 39).
16925
16926 va/vadeblock[|difference[|flatness]]
16927 Accurate vertical deblocking filter
16928
16929 difference
16930 Difference factor where higher values mean more deblocking
16931 (default: 32).
16932
16933 flatness
16934 Flatness threshold where lower values mean more deblocking
16935 (default: 39).
16936
16937 The horizontal and vertical deblocking filters share the difference and
16938 flatness values so you cannot set different horizontal and vertical
16939 thresholds.
16940
16941 h1/x1hdeblock
16942 Experimental horizontal deblocking filter
16943
16944 v1/x1vdeblock
16945 Experimental vertical deblocking filter
16946
16947 dr/dering
16948 Deringing filter
16949
16950 tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise
16951 reducer
16952 threshold1
16953 larger -> stronger filtering
16954
16955 threshold2
16956 larger -> stronger filtering
16957
16958 threshold3
16959 larger -> stronger filtering
16960
16961 al/autolevels[:f/fullyrange], automatic brightness / contrast
16962 correction
16963 f/fullyrange
16964 Stretch luminance to "0-255".
16965
16966 lb/linblenddeint
16967 Linear blend deinterlacing filter that deinterlaces the given block
16968 by filtering all lines with a "(1 2 1)" filter.
16969
16970 li/linipoldeint
16971 Linear interpolating deinterlacing filter that deinterlaces the
16972 given block by linearly interpolating every second line.
16973
16974 ci/cubicipoldeint
16975 Cubic interpolating deinterlacing filter deinterlaces the given
16976 block by cubically interpolating every second line.
16977
16978 md/mediandeint
16979 Median deinterlacing filter that deinterlaces the given block by
16980 applying a median filter to every second line.
16981
16982 fd/ffmpegdeint
16983 FFmpeg deinterlacing filter that deinterlaces the given block by
16984 filtering every second line with a "(-1 4 2 4 -1)" filter.
16985
16986 l5/lowpass5
16987 Vertically applied FIR lowpass deinterlacing filter that
16988 deinterlaces the given block by filtering all lines with a "(-1 2 6
16989 2 -1)" filter.
16990
16991 fq/forceQuant[|quantizer]
16992 Overrides the quantizer table from the input with the constant
16993 quantizer you specify.
16994
16995 quantizer
16996 Quantizer to use
16997
16998 de/default
16999 Default pp filter combination ("hb|a,vb|a,dr|a")
17000
17001 fa/fast
17002 Fast pp filter combination ("h1|a,v1|a,dr|a")
17003
17004 ac High quality pp filter combination ("ha|a|128|7,va|a,dr|a")
17005
17006 Examples
17007
17008 • Apply horizontal and vertical deblocking, deringing and automatic
17009 brightness/contrast:
17010
17011 pp=hb/vb/dr/al
17012
17013 • Apply default filters without brightness/contrast correction:
17014
17015 pp=de/-al
17016
17017 • Apply default filters and temporal denoiser:
17018
17019 pp=default/tmpnoise|1|2|3
17020
17021 • Apply deblocking on luminance only, and switch vertical deblocking
17022 on or off automatically depending on available CPU time:
17023
17024 pp=hb|y/vb|a
17025
17026 pp7
17027 Apply Postprocessing filter 7. It is variant of the spp filter, similar
17028 to spp = 6 with 7 point DCT, where only the center sample is used after
17029 IDCT.
17030
17031 The filter accepts the following options:
17032
17033 qp Force a constant quantization parameter. It accepts an integer in
17034 range 0 to 63. If not set, the filter will use the QP from the
17035 video stream (if available).
17036
17037 mode
17038 Set thresholding mode. Available modes are:
17039
17040 hard
17041 Set hard thresholding.
17042
17043 soft
17044 Set soft thresholding (better de-ringing effect, but likely
17045 blurrier).
17046
17047 medium
17048 Set medium thresholding (good results, default).
17049
17050 premultiply
17051 Apply alpha premultiply effect to input video stream using first plane
17052 of second stream as alpha.
17053
17054 Both streams must have same dimensions and same pixel format.
17055
17056 The filter accepts the following option:
17057
17058 planes
17059 Set which planes will be processed, unprocessed planes will be
17060 copied. By default value 0xf, all planes will be processed.
17061
17062 inplace
17063 Do not require 2nd input for processing, instead use alpha plane
17064 from input stream.
17065
17066 prewitt
17067 Apply prewitt operator to input video stream.
17068
17069 The filter accepts the following option:
17070
17071 planes
17072 Set which planes will be processed, unprocessed planes will be
17073 copied. By default value 0xf, all planes will be processed.
17074
17075 scale
17076 Set value which will be multiplied with filtered result.
17077
17078 delta
17079 Set value which will be added to filtered result.
17080
17081 Commands
17082
17083 This filter supports the all above options as commands.
17084
17085 pseudocolor
17086 Alter frame colors in video with pseudocolors.
17087
17088 This filter accepts the following options:
17089
17090 c0 set pixel first component expression
17091
17092 c1 set pixel second component expression
17093
17094 c2 set pixel third component expression
17095
17096 c3 set pixel fourth component expression, corresponds to the alpha
17097 component
17098
17099 index, i
17100 set component to use as base for altering colors
17101
17102 preset, p
17103 Pick one of built-in LUTs. By default is set to none.
17104
17105 Available LUTs:
17106
17107 magma
17108 inferno
17109 plasma
17110 viridis
17111 turbo
17112 cividis
17113 range1
17114 range2
17115 shadows
17116 highlights
17117 solar
17118 nominal
17119 preferred
17120 total
17121 spectral
17122 opacity
17123 Set opacity of output colors. Allowed range is from 0 to 1.
17124 Default value is set to 1.
17125
17126 Each of the expression options specifies the expression to use for
17127 computing the lookup table for the corresponding pixel component
17128 values.
17129
17130 The expressions can contain the following constants and functions:
17131
17132 w
17133 h The input width and height.
17134
17135 val The input value for the pixel component.
17136
17137 ymin, umin, vmin, amin
17138 The minimum allowed component value.
17139
17140 ymax, umax, vmax, amax
17141 The maximum allowed component value.
17142
17143 All expressions default to "val".
17144
17145 Commands
17146
17147 This filter supports the all above options as commands.
17148
17149 Examples
17150
17151 • Change too high luma values to gradient:
17152
17153 pseudocolor="'if(between(val,ymax,amax),lerp(ymin,ymax,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(umax,umin,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(vmin,vmax,(val-ymax)/(amax-ymax)),-1):-1'"
17154
17155 psnr
17156 Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
17157 Ratio) between two input videos.
17158
17159 This filter takes in input two input videos, the first input is
17160 considered the "main" source and is passed unchanged to the output. The
17161 second input is used as a "reference" video for computing the PSNR.
17162
17163 Both video inputs must have the same resolution and pixel format for
17164 this filter to work correctly. Also it assumes that both inputs have
17165 the same number of frames, which are compared one by one.
17166
17167 The obtained average PSNR is printed through the logging system.
17168
17169 The filter stores the accumulated MSE (mean squared error) of each
17170 frame, and at the end of the processing it is averaged across all
17171 frames equally, and the following formula is applied to obtain the
17172 PSNR:
17173
17174 PSNR = 10*log10(MAX^2/MSE)
17175
17176 Where MAX is the average of the maximum values of each component of the
17177 image.
17178
17179 The description of the accepted parameters follows.
17180
17181 stats_file, f
17182 If specified the filter will use the named file to save the PSNR of
17183 each individual frame. When filename equals "-" the data is sent to
17184 standard output.
17185
17186 stats_version
17187 Specifies which version of the stats file format to use. Details of
17188 each format are written below. Default value is 1.
17189
17190 stats_add_max
17191 Determines whether the max value is output to the stats log.
17192 Default value is 0. Requires stats_version >= 2. If this is set
17193 and stats_version < 2, the filter will return an error.
17194
17195 This filter also supports the framesync options.
17196
17197 The file printed if stats_file is selected, contains a sequence of
17198 key/value pairs of the form key:value for each compared couple of
17199 frames.
17200
17201 If a stats_version greater than 1 is specified, a header line precedes
17202 the list of per-frame-pair stats, with key value pairs following the
17203 frame format with the following parameters:
17204
17205 psnr_log_version
17206 The version of the log file format. Will match stats_version.
17207
17208 fields
17209 A comma separated list of the per-frame-pair parameters included in
17210 the log.
17211
17212 A description of each shown per-frame-pair parameter follows:
17213
17214 n sequential number of the input frame, starting from 1
17215
17216 mse_avg
17217 Mean Square Error pixel-by-pixel average difference of the compared
17218 frames, averaged over all the image components.
17219
17220 mse_y, mse_u, mse_v, mse_r, mse_g, mse_b, mse_a
17221 Mean Square Error pixel-by-pixel average difference of the compared
17222 frames for the component specified by the suffix.
17223
17224 psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a
17225 Peak Signal to Noise ratio of the compared frames for the component
17226 specified by the suffix.
17227
17228 max_avg, max_y, max_u, max_v
17229 Maximum allowed value for each channel, and average over all
17230 channels.
17231
17232 Examples
17233
17234 • For example:
17235
17236 movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
17237 [main][ref] psnr="stats_file=stats.log" [out]
17238
17239 On this example the input file being processed is compared with the
17240 reference file ref_movie.mpg. The PSNR of each individual frame is
17241 stored in stats.log.
17242
17243 • Another example with different containers:
17244
17245 ffmpeg -i main.mpg -i ref.mkv -lavfi "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]psnr" -f null -
17246
17247 pullup
17248 Pulldown reversal (inverse telecine) filter, capable of handling mixed
17249 hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps
17250 progressive content.
17251
17252 The pullup filter is designed to take advantage of future context in
17253 making its decisions. This filter is stateless in the sense that it
17254 does not lock onto a pattern to follow, but it instead looks forward to
17255 the following fields in order to identify matches and rebuild
17256 progressive frames.
17257
17258 To produce content with an even framerate, insert the fps filter after
17259 pullup, use "fps=24000/1001" if the input frame rate is 29.97fps,
17260 "fps=24" for 30fps and the (rare) telecined 25fps input.
17261
17262 The filter accepts the following options:
17263
17264 jl
17265 jr
17266 jt
17267 jb These options set the amount of "junk" to ignore at the left,
17268 right, top, and bottom of the image, respectively. Left and right
17269 are in units of 8 pixels, while top and bottom are in units of 2
17270 lines. The default is 8 pixels on each side.
17271
17272 sb Set the strict breaks. Setting this option to 1 will reduce the
17273 chances of filter generating an occasional mismatched frame, but it
17274 may also cause an excessive number of frames to be dropped during
17275 high motion sequences. Conversely, setting it to -1 will make
17276 filter match fields more easily. This may help processing of video
17277 where there is slight blurring between the fields, but may also
17278 cause there to be interlaced frames in the output. Default value
17279 is 0.
17280
17281 mp Set the metric plane to use. It accepts the following values:
17282
17283 l Use luma plane.
17284
17285 u Use chroma blue plane.
17286
17287 v Use chroma red plane.
17288
17289 This option may be set to use chroma plane instead of the default
17290 luma plane for doing filter's computations. This may improve
17291 accuracy on very clean source material, but more likely will
17292 decrease accuracy, especially if there is chroma noise (rainbow
17293 effect) or any grayscale video. The main purpose of setting mp to
17294 a chroma plane is to reduce CPU load and make pullup usable in
17295 realtime on slow machines.
17296
17297 For best results (without duplicated frames in the output file) it is
17298 necessary to change the output frame rate. For example, to inverse
17299 telecine NTSC input:
17300
17301 ffmpeg -i input -vf pullup -r 24000/1001 ...
17302
17303 qp
17304 Change video quantization parameters (QP).
17305
17306 The filter accepts the following option:
17307
17308 qp Set expression for quantization parameter.
17309
17310 The expression is evaluated through the eval API and can contain, among
17311 others, the following constants:
17312
17313 known
17314 1 if index is not 129, 0 otherwise.
17315
17316 qp Sequential index starting from -129 to 128.
17317
17318 Examples
17319
17320 • Some equation like:
17321
17322 qp=2+2*sin(PI*qp)
17323
17324 random
17325 Flush video frames from internal cache of frames into a random order.
17326 No frame is discarded. Inspired by frei0r nervous filter.
17327
17328 frames
17329 Set size in number of frames of internal cache, in range from 2 to
17330 512. Default is 30.
17331
17332 seed
17333 Set seed for random number generator, must be an integer included
17334 between 0 and "UINT32_MAX". If not specified, or if explicitly set
17335 to less than 0, the filter will try to use a good random seed on a
17336 best effort basis.
17337
17338 readeia608
17339 Read closed captioning (EIA-608) information from the top lines of a
17340 video frame.
17341
17342 This filter adds frame metadata for "lavfi.readeia608.X.cc" and
17343 "lavfi.readeia608.X.line", where "X" is the number of the identified
17344 line with EIA-608 data (starting from 0). A description of each
17345 metadata value follows:
17346
17347 lavfi.readeia608.X.cc
17348 The two bytes stored as EIA-608 data (printed in hexadecimal).
17349
17350 lavfi.readeia608.X.line
17351 The number of the line on which the EIA-608 data was identified and
17352 read.
17353
17354 This filter accepts the following options:
17355
17356 scan_min
17357 Set the line to start scanning for EIA-608 data. Default is 0.
17358
17359 scan_max
17360 Set the line to end scanning for EIA-608 data. Default is 29.
17361
17362 spw Set the ratio of width reserved for sync code detection. Default
17363 is 0.27. Allowed range is "[0.1 - 0.7]".
17364
17365 chp Enable checking the parity bit. In the event of a parity error, the
17366 filter will output 0x00 for that character. Default is false.
17367
17368 lp Lowpass lines prior to further processing. Default is enabled.
17369
17370 Commands
17371
17372 This filter supports the all above options as commands.
17373
17374 Examples
17375
17376 • Output a csv with presentation time and the first two lines of
17377 identified EIA-608 captioning data.
17378
17379 ffprobe -f lavfi -i movie=captioned_video.mov,readeia608 -show_entries frame=pts_time:frame_tags=lavfi.readeia608.0.cc,lavfi.readeia608.1.cc -of csv
17380
17381 readvitc
17382 Read vertical interval timecode (VITC) information from the top lines
17383 of a video frame.
17384
17385 The filter adds frame metadata key "lavfi.readvitc.tc_str" with the
17386 timecode value, if a valid timecode has been detected. Further metadata
17387 key "lavfi.readvitc.found" is set to 0/1 depending on whether timecode
17388 data has been found or not.
17389
17390 This filter accepts the following options:
17391
17392 scan_max
17393 Set the maximum number of lines to scan for VITC data. If the value
17394 is set to -1 the full video frame is scanned. Default is 45.
17395
17396 thr_b
17397 Set the luma threshold for black. Accepts float numbers in the
17398 range [0.0,1.0], default value is 0.2. The value must be equal or
17399 less than "thr_w".
17400
17401 thr_w
17402 Set the luma threshold for white. Accepts float numbers in the
17403 range [0.0,1.0], default value is 0.6. The value must be equal or
17404 greater than "thr_b".
17405
17406 Examples
17407
17408 • Detect and draw VITC data onto the video frame; if no valid VITC is
17409 detected, draw "--:--:--:--" as a placeholder:
17410
17411 ffmpeg -i input.avi -filter:v 'readvitc,drawtext=fontfile=FreeMono.ttf:text=%{metadata\\:lavfi.readvitc.tc_str\\:--\\\\\\:--\\\\\\:--\\\\\\:--}:x=(w-tw)/2:y=400-ascent'
17412
17413 remap
17414 Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
17415
17416 Destination pixel at position (X, Y) will be picked from source (x, y)
17417 position where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are
17418 out of range, zero value for pixel will be used for destination pixel.
17419
17420 Xmap and Ymap input video streams must be of same dimensions. Output
17421 video stream will have Xmap/Ymap video stream dimensions. Xmap and
17422 Ymap input video streams are 16bit depth, single channel.
17423
17424 format
17425 Specify pixel format of output from this filter. Can be "color" or
17426 "gray". Default is "color".
17427
17428 fill
17429 Specify the color of the unmapped pixels. For the syntax of this
17430 option, check the "Color" section in the ffmpeg-utils manual.
17431 Default color is "black".
17432
17433 removegrain
17434 The removegrain filter is a spatial denoiser for progressive video.
17435
17436 m0 Set mode for the first plane.
17437
17438 m1 Set mode for the second plane.
17439
17440 m2 Set mode for the third plane.
17441
17442 m3 Set mode for the fourth plane.
17443
17444 Range of mode is from 0 to 24. Description of each mode follows:
17445
17446 0 Leave input plane unchanged. Default.
17447
17448 1 Clips the pixel with the minimum and maximum of the 8 neighbour
17449 pixels.
17450
17451 2 Clips the pixel with the second minimum and maximum of the 8
17452 neighbour pixels.
17453
17454 3 Clips the pixel with the third minimum and maximum of the 8
17455 neighbour pixels.
17456
17457 4 Clips the pixel with the fourth minimum and maximum of the 8
17458 neighbour pixels. This is equivalent to a median filter.
17459
17460 5 Line-sensitive clipping giving the minimal change.
17461
17462 6 Line-sensitive clipping, intermediate.
17463
17464 7 Line-sensitive clipping, intermediate.
17465
17466 8 Line-sensitive clipping, intermediate.
17467
17468 9 Line-sensitive clipping on a line where the neighbours pixels are
17469 the closest.
17470
17471 10 Replaces the target pixel with the closest neighbour.
17472
17473 11 [1 2 1] horizontal and vertical kernel blur.
17474
17475 12 Same as mode 11.
17476
17477 13 Bob mode, interpolates top field from the line where the neighbours
17478 pixels are the closest.
17479
17480 14 Bob mode, interpolates bottom field from the line where the
17481 neighbours pixels are the closest.
17482
17483 15 Bob mode, interpolates top field. Same as 13 but with a more
17484 complicated interpolation formula.
17485
17486 16 Bob mode, interpolates bottom field. Same as 14 but with a more
17487 complicated interpolation formula.
17488
17489 17 Clips the pixel with the minimum and maximum of respectively the
17490 maximum and minimum of each pair of opposite neighbour pixels.
17491
17492 18 Line-sensitive clipping using opposite neighbours whose greatest
17493 distance from the current pixel is minimal.
17494
17495 19 Replaces the pixel with the average of its 8 neighbours.
17496
17497 20 Averages the 9 pixels ([1 1 1] horizontal and vertical blur).
17498
17499 21 Clips pixels using the averages of opposite neighbour.
17500
17501 22 Same as mode 21 but simpler and faster.
17502
17503 23 Small edge and halo removal, but reputed useless.
17504
17505 24 Similar as 23.
17506
17507 removelogo
17508 Suppress a TV station logo, using an image file to determine which
17509 pixels comprise the logo. It works by filling in the pixels that
17510 comprise the logo with neighboring pixels.
17511
17512 The filter accepts the following options:
17513
17514 filename, f
17515 Set the filter bitmap file, which can be any image format supported
17516 by libavformat. The width and height of the image file must match
17517 those of the video stream being processed.
17518
17519 Pixels in the provided bitmap image with a value of zero are not
17520 considered part of the logo, non-zero pixels are considered part of the
17521 logo. If you use white (255) for the logo and black (0) for the rest,
17522 you will be safe. For making the filter bitmap, it is recommended to
17523 take a screen capture of a black frame with the logo visible, and then
17524 using a threshold filter followed by the erode filter once or twice.
17525
17526 If needed, little splotches can be fixed manually. Remember that if
17527 logo pixels are not covered, the filter quality will be much reduced.
17528 Marking too many pixels as part of the logo does not hurt as much, but
17529 it will increase the amount of blurring needed to cover over the image
17530 and will destroy more information than necessary, and extra pixels will
17531 slow things down on a large logo.
17532
17533 repeatfields
17534 This filter uses the repeat_field flag from the Video ES headers and
17535 hard repeats fields based on its value.
17536
17537 reverse
17538 Reverse a video clip.
17539
17540 Warning: This filter requires memory to buffer the entire clip, so
17541 trimming is suggested.
17542
17543 Examples
17544
17545 • Take the first 5 seconds of a clip, and reverse it.
17546
17547 trim=end=5,reverse
17548
17549 rgbashift
17550 Shift R/G/B/A pixels horizontally and/or vertically.
17551
17552 The filter accepts the following options:
17553
17554 rh Set amount to shift red horizontally.
17555
17556 rv Set amount to shift red vertically.
17557
17558 gh Set amount to shift green horizontally.
17559
17560 gv Set amount to shift green vertically.
17561
17562 bh Set amount to shift blue horizontally.
17563
17564 bv Set amount to shift blue vertically.
17565
17566 ah Set amount to shift alpha horizontally.
17567
17568 av Set amount to shift alpha vertically.
17569
17570 edge
17571 Set edge mode, can be smear, default, or warp.
17572
17573 Commands
17574
17575 This filter supports the all above options as commands.
17576
17577 roberts
17578 Apply roberts cross operator to input video stream.
17579
17580 The filter accepts the following option:
17581
17582 planes
17583 Set which planes will be processed, unprocessed planes will be
17584 copied. By default value 0xf, all planes will be processed.
17585
17586 scale
17587 Set value which will be multiplied with filtered result.
17588
17589 delta
17590 Set value which will be added to filtered result.
17591
17592 Commands
17593
17594 This filter supports the all above options as commands.
17595
17596 rotate
17597 Rotate video by an arbitrary angle expressed in radians.
17598
17599 The filter accepts the following options:
17600
17601 A description of the optional parameters follows.
17602
17603 angle, a
17604 Set an expression for the angle by which to rotate the input video
17605 clockwise, expressed as a number of radians. A negative value will
17606 result in a counter-clockwise rotation. By default it is set to
17607 "0".
17608
17609 This expression is evaluated for each frame.
17610
17611 out_w, ow
17612 Set the output width expression, default value is "iw". This
17613 expression is evaluated just once during configuration.
17614
17615 out_h, oh
17616 Set the output height expression, default value is "ih". This
17617 expression is evaluated just once during configuration.
17618
17619 bilinear
17620 Enable bilinear interpolation if set to 1, a value of 0 disables
17621 it. Default value is 1.
17622
17623 fillcolor, c
17624 Set the color used to fill the output area not covered by the
17625 rotated image. For the general syntax of this option, check the
17626 "Color" section in the ffmpeg-utils manual. If the special value
17627 "none" is selected then no background is printed (useful for
17628 example if the background is never shown).
17629
17630 Default value is "black".
17631
17632 The expressions for the angle and the output size can contain the
17633 following constants and functions:
17634
17635 n sequential number of the input frame, starting from 0. It is always
17636 NAN before the first frame is filtered.
17637
17638 t time in seconds of the input frame, it is set to 0 when the filter
17639 is configured. It is always NAN before the first frame is filtered.
17640
17641 hsub
17642 vsub
17643 horizontal and vertical chroma subsample values. For example for
17644 the pixel format "yuv422p" hsub is 2 and vsub is 1.
17645
17646 in_w, iw
17647 in_h, ih
17648 the input video width and height
17649
17650 out_w, ow
17651 out_h, oh
17652 the output width and height, that is the size of the padded area as
17653 specified by the width and height expressions
17654
17655 rotw(a)
17656 roth(a)
17657 the minimal width/height required for completely containing the
17658 input video rotated by a radians.
17659
17660 These are only available when computing the out_w and out_h
17661 expressions.
17662
17663 Examples
17664
17665 • Rotate the input by PI/6 radians clockwise:
17666
17667 rotate=PI/6
17668
17669 • Rotate the input by PI/6 radians counter-clockwise:
17670
17671 rotate=-PI/6
17672
17673 • Rotate the input by 45 degrees clockwise:
17674
17675 rotate=45*PI/180
17676
17677 • Apply a constant rotation with period T, starting from an angle of
17678 PI/3:
17679
17680 rotate=PI/3+2*PI*t/T
17681
17682 • Make the input video rotation oscillating with a period of T
17683 seconds and an amplitude of A radians:
17684
17685 rotate=A*sin(2*PI/T*t)
17686
17687 • Rotate the video, output size is chosen so that the whole rotating
17688 input video is always completely contained in the output:
17689
17690 rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
17691
17692 • Rotate the video, reduce the output size so that no background is
17693 ever shown:
17694
17695 rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
17696
17697 Commands
17698
17699 The filter supports the following commands:
17700
17701 a, angle
17702 Set the angle expression. The command accepts the same syntax of
17703 the corresponding option.
17704
17705 If the specified expression is not valid, it is kept at its current
17706 value.
17707
17708 sab
17709 Apply Shape Adaptive Blur.
17710
17711 The filter accepts the following options:
17712
17713 luma_radius, lr
17714 Set luma blur filter strength, must be a value in range 0.1-4.0,
17715 default value is 1.0. A greater value will result in a more blurred
17716 image, and in slower processing.
17717
17718 luma_pre_filter_radius, lpfr
17719 Set luma pre-filter radius, must be a value in the 0.1-2.0 range,
17720 default value is 1.0.
17721
17722 luma_strength, ls
17723 Set luma maximum difference between pixels to still be considered,
17724 must be a value in the 0.1-100.0 range, default value is 1.0.
17725
17726 chroma_radius, cr
17727 Set chroma blur filter strength, must be a value in range -0.9-4.0.
17728 A greater value will result in a more blurred image, and in slower
17729 processing.
17730
17731 chroma_pre_filter_radius, cpfr
17732 Set chroma pre-filter radius, must be a value in the -0.9-2.0
17733 range.
17734
17735 chroma_strength, cs
17736 Set chroma maximum difference between pixels to still be
17737 considered, must be a value in the -0.9-100.0 range.
17738
17739 Each chroma option value, if not explicitly specified, is set to the
17740 corresponding luma option value.
17741
17742 scale
17743 Scale (resize) the input video, using the libswscale library.
17744
17745 The scale filter forces the output display aspect ratio to be the same
17746 of the input, by changing the output sample aspect ratio.
17747
17748 If the input image format is different from the format requested by the
17749 next filter, the scale filter will convert the input to the requested
17750 format.
17751
17752 Options
17753
17754 The filter accepts the following options, or any of the options
17755 supported by the libswscale scaler.
17756
17757 See the ffmpeg-scaler manual for the complete list of scaler options.
17758
17759 width, w
17760 height, h
17761 Set the output video dimension expression. Default value is the
17762 input dimension.
17763
17764 If the width or w value is 0, the input width is used for the
17765 output. If the height or h value is 0, the input height is used for
17766 the output.
17767
17768 If one and only one of the values is -n with n >= 1, the scale
17769 filter will use a value that maintains the aspect ratio of the
17770 input image, calculated from the other specified dimension. After
17771 that it will, however, make sure that the calculated dimension is
17772 divisible by n and adjust the value if necessary.
17773
17774 If both values are -n with n >= 1, the behavior will be identical
17775 to both values being set to 0 as previously detailed.
17776
17777 See below for the list of accepted constants for use in the
17778 dimension expression.
17779
17780 eval
17781 Specify when to evaluate width and height expression. It accepts
17782 the following values:
17783
17784 init
17785 Only evaluate expressions once during the filter initialization
17786 or when a command is processed.
17787
17788 frame
17789 Evaluate expressions for each incoming frame.
17790
17791 Default value is init.
17792
17793 interl
17794 Set the interlacing mode. It accepts the following values:
17795
17796 1 Force interlaced aware scaling.
17797
17798 0 Do not apply interlaced scaling.
17799
17800 -1 Select interlaced aware scaling depending on whether the source
17801 frames are flagged as interlaced or not.
17802
17803 Default value is 0.
17804
17805 flags
17806 Set libswscale scaling flags. See the ffmpeg-scaler manual for the
17807 complete list of values. If not explicitly specified the filter
17808 applies the default flags.
17809
17810 param0, param1
17811 Set libswscale input parameters for scaling algorithms that need
17812 them. See the ffmpeg-scaler manual for the complete documentation.
17813 If not explicitly specified the filter applies empty parameters.
17814
17815 size, s
17816 Set the video size. For the syntax of this option, check the "Video
17817 size" section in the ffmpeg-utils manual.
17818
17819 in_color_matrix
17820 out_color_matrix
17821 Set in/output YCbCr color space type.
17822
17823 This allows the autodetected value to be overridden as well as
17824 allows forcing a specific value used for the output and encoder.
17825
17826 If not specified, the color space type depends on the pixel format.
17827
17828 Possible values:
17829
17830 auto
17831 Choose automatically.
17832
17833 bt709
17834 Format conforming to International Telecommunication Union
17835 (ITU) Recommendation BT.709.
17836
17837 fcc Set color space conforming to the United States Federal
17838 Communications Commission (FCC) Code of Federal Regulations
17839 (CFR) Title 47 (2003) 73.682 (a).
17840
17841 bt601
17842 bt470
17843 smpte170m
17844 Set color space conforming to:
17845
17846 • ITU Radiocommunication Sector (ITU-R) Recommendation BT.601
17847
17848 • ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G
17849
17850 • Society of Motion Picture and Television Engineers (SMPTE)
17851 ST 170:2004
17852
17853 smpte240m
17854 Set color space conforming to SMPTE ST 240:1999.
17855
17856 bt2020
17857 Set color space conforming to ITU-R BT.2020 non-constant
17858 luminance system.
17859
17860 in_range
17861 out_range
17862 Set in/output YCbCr sample range.
17863
17864 This allows the autodetected value to be overridden as well as
17865 allows forcing a specific value used for the output and encoder. If
17866 not specified, the range depends on the pixel format. Possible
17867 values:
17868
17869 auto/unknown
17870 Choose automatically.
17871
17872 jpeg/full/pc
17873 Set full range (0-255 in case of 8-bit luma).
17874
17875 mpeg/limited/tv
17876 Set "MPEG" range (16-235 in case of 8-bit luma).
17877
17878 force_original_aspect_ratio
17879 Enable decreasing or increasing output video width or height if
17880 necessary to keep the original aspect ratio. Possible values:
17881
17882 disable
17883 Scale the video as specified and disable this feature.
17884
17885 decrease
17886 The output video dimensions will automatically be decreased if
17887 needed.
17888
17889 increase
17890 The output video dimensions will automatically be increased if
17891 needed.
17892
17893 One useful instance of this option is that when you know a specific
17894 device's maximum allowed resolution, you can use this to limit the
17895 output video to that, while retaining the aspect ratio. For
17896 example, device A allows 1280x720 playback, and your video is
17897 1920x800. Using this option (set it to decrease) and specifying
17898 1280x720 to the command line makes the output 1280x533.
17899
17900 Please note that this is a different thing than specifying -1 for w
17901 or h, you still need to specify the output resolution for this
17902 option to work.
17903
17904 force_divisible_by
17905 Ensures that both the output dimensions, width and height, are
17906 divisible by the given integer when used together with
17907 force_original_aspect_ratio. This works similar to using "-n" in
17908 the w and h options.
17909
17910 This option respects the value set for force_original_aspect_ratio,
17911 increasing or decreasing the resolution accordingly. The video's
17912 aspect ratio may be slightly modified.
17913
17914 This option can be handy if you need to have a video fit within or
17915 exceed a defined resolution using force_original_aspect_ratio but
17916 also have encoder restrictions on width or height divisibility.
17917
17918 The values of the w and h options are expressions containing the
17919 following constants:
17920
17921 in_w
17922 in_h
17923 The input width and height
17924
17925 iw
17926 ih These are the same as in_w and in_h.
17927
17928 out_w
17929 out_h
17930 The output (scaled) width and height
17931
17932 ow
17933 oh These are the same as out_w and out_h
17934
17935 a The same as iw / ih
17936
17937 sar input sample aspect ratio
17938
17939 dar The input display aspect ratio. Calculated from "(iw / ih) * sar".
17940
17941 hsub
17942 vsub
17943 horizontal and vertical input chroma subsample values. For example
17944 for the pixel format "yuv422p" hsub is 2 and vsub is 1.
17945
17946 ohsub
17947 ovsub
17948 horizontal and vertical output chroma subsample values. For example
17949 for the pixel format "yuv422p" hsub is 2 and vsub is 1.
17950
17951 n The (sequential) number of the input frame, starting from 0. Only
17952 available with "eval=frame".
17953
17954 t The presentation timestamp of the input frame, expressed as a
17955 number of seconds. Only available with "eval=frame".
17956
17957 pos The position (byte offset) of the frame in the input stream, or NaN
17958 if this information is unavailable and/or meaningless (for example
17959 in case of synthetic video). Only available with "eval=frame".
17960
17961 Examples
17962
17963 • Scale the input video to a size of 200x100
17964
17965 scale=w=200:h=100
17966
17967 This is equivalent to:
17968
17969 scale=200:100
17970
17971 or:
17972
17973 scale=200x100
17974
17975 • Specify a size abbreviation for the output size:
17976
17977 scale=qcif
17978
17979 which can also be written as:
17980
17981 scale=size=qcif
17982
17983 • Scale the input to 2x:
17984
17985 scale=w=2*iw:h=2*ih
17986
17987 • The above is the same as:
17988
17989 scale=2*in_w:2*in_h
17990
17991 • Scale the input to 2x with forced interlaced scaling:
17992
17993 scale=2*iw:2*ih:interl=1
17994
17995 • Scale the input to half size:
17996
17997 scale=w=iw/2:h=ih/2
17998
17999 • Increase the width, and set the height to the same size:
18000
18001 scale=3/2*iw:ow
18002
18003 • Seek Greek harmony:
18004
18005 scale=iw:1/PHI*iw
18006 scale=ih*PHI:ih
18007
18008 • Increase the height, and set the width to 3/2 of the height:
18009
18010 scale=w=3/2*oh:h=3/5*ih
18011
18012 • Increase the size, making the size a multiple of the chroma
18013 subsample values:
18014
18015 scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
18016
18017 • Increase the width to a maximum of 500 pixels, keeping the same
18018 aspect ratio as the input:
18019
18020 scale=w='min(500\, iw*3/2):h=-1'
18021
18022 • Make pixels square by combining scale and setsar:
18023
18024 scale='trunc(ih*dar):ih',setsar=1/1
18025
18026 • Make pixels square by combining scale and setsar, making sure the
18027 resulting resolution is even (required by some codecs):
18028
18029 scale='trunc(ih*dar/2)*2:trunc(ih/2)*2',setsar=1/1
18030
18031 Commands
18032
18033 This filter supports the following commands:
18034
18035 width, w
18036 height, h
18037 Set the output video dimension expression. The command accepts the
18038 same syntax of the corresponding option.
18039
18040 If the specified expression is not valid, it is kept at its current
18041 value.
18042
18043 scale_cuda
18044 Scale (resize) and convert (pixel format) the input video, using
18045 accelerated CUDA kernels. Setting the output width and height works in
18046 the same way as for the scale filter.
18047
18048 The filter accepts the following options:
18049
18050 w
18051 h Set the output video dimension expression. Default value is the
18052 input dimension.
18053
18054 Allows for the same expressions as the scale filter.
18055
18056 interp_algo
18057 Sets the algorithm used for scaling:
18058
18059 nearest
18060 Nearest neighbour
18061
18062 Used by default if input parameters match the desired output.
18063
18064 bilinear
18065 Bilinear
18066
18067 bicubic
18068 Bicubic
18069
18070 This is the default.
18071
18072 lanczos
18073 Lanczos
18074
18075 format
18076 Controls the output pixel format. By default, or if none is
18077 specified, the input pixel format is used.
18078
18079 The filter does not support converting between YUV and RGB pixel
18080 formats.
18081
18082 passthrough
18083 If set to 0, every frame is processed, even if no conversion is
18084 neccesary. This mode can be useful to use the filter as a buffer
18085 for a downstream frame-consumer that exhausts the limited decoder
18086 frame pool.
18087
18088 If set to 1, frames are passed through as-is if they match the
18089 desired output parameters. This is the default behaviour.
18090
18091 param
18092 Algorithm-Specific parameter.
18093
18094 Affects the curves of the bicubic algorithm.
18095
18096 force_original_aspect_ratio
18097 force_divisible_by
18098 Work the same as the identical scale filter options.
18099
18100 Examples
18101
18102 • Scale input to 720p, keeping aspect ratio and ensuring the output
18103 is yuv420p.
18104
18105 scale_cuda=-2:720:format=yuv420p
18106
18107 • Upscale to 4K using nearest neighbour algorithm.
18108
18109 scale_cuda=4096:2160:interp_algo=nearest
18110
18111 • Don't do any conversion or scaling, but copy all input frames into
18112 newly allocated ones. This can be useful to deal with a filter and
18113 encode chain that otherwise exhausts the decoders frame pool.
18114
18115 scale_cuda=passthrough=0
18116
18117 scale_npp
18118 Use the NVIDIA Performance Primitives (libnpp) to perform scaling
18119 and/or pixel format conversion on CUDA video frames. Setting the output
18120 width and height works in the same way as for the scale filter.
18121
18122 The following additional options are accepted:
18123
18124 format
18125 The pixel format of the output CUDA frames. If set to the string
18126 "same" (the default), the input format will be kept. Note that
18127 automatic format negotiation and conversion is not yet supported
18128 for hardware frames
18129
18130 interp_algo
18131 The interpolation algorithm used for resizing. One of the
18132 following:
18133
18134 nn Nearest neighbour.
18135
18136 linear
18137 cubic
18138 cubic2p_bspline
18139 2-parameter cubic (B=1, C=0)
18140
18141 cubic2p_catmullrom
18142 2-parameter cubic (B=0, C=1/2)
18143
18144 cubic2p_b05c03
18145 2-parameter cubic (B=1/2, C=3/10)
18146
18147 super
18148 Supersampling
18149
18150 lanczos
18151 force_original_aspect_ratio
18152 Enable decreasing or increasing output video width or height if
18153 necessary to keep the original aspect ratio. Possible values:
18154
18155 disable
18156 Scale the video as specified and disable this feature.
18157
18158 decrease
18159 The output video dimensions will automatically be decreased if
18160 needed.
18161
18162 increase
18163 The output video dimensions will automatically be increased if
18164 needed.
18165
18166 One useful instance of this option is that when you know a specific
18167 device's maximum allowed resolution, you can use this to limit the
18168 output video to that, while retaining the aspect ratio. For
18169 example, device A allows 1280x720 playback, and your video is
18170 1920x800. Using this option (set it to decrease) and specifying
18171 1280x720 to the command line makes the output 1280x533.
18172
18173 Please note that this is a different thing than specifying -1 for w
18174 or h, you still need to specify the output resolution for this
18175 option to work.
18176
18177 force_divisible_by
18178 Ensures that both the output dimensions, width and height, are
18179 divisible by the given integer when used together with
18180 force_original_aspect_ratio. This works similar to using "-n" in
18181 the w and h options.
18182
18183 This option respects the value set for force_original_aspect_ratio,
18184 increasing or decreasing the resolution accordingly. The video's
18185 aspect ratio may be slightly modified.
18186
18187 This option can be handy if you need to have a video fit within or
18188 exceed a defined resolution using force_original_aspect_ratio but
18189 also have encoder restrictions on width or height divisibility.
18190
18191 eval
18192 Specify when to evaluate width and height expression. It accepts
18193 the following values:
18194
18195 init
18196 Only evaluate expressions once during the filter initialization
18197 or when a command is processed.
18198
18199 frame
18200 Evaluate expressions for each incoming frame.
18201
18202 The values of the w and h options are expressions containing the
18203 following constants:
18204
18205 in_w
18206 in_h
18207 The input width and height
18208
18209 iw
18210 ih These are the same as in_w and in_h.
18211
18212 out_w
18213 out_h
18214 The output (scaled) width and height
18215
18216 ow
18217 oh These are the same as out_w and out_h
18218
18219 a The same as iw / ih
18220
18221 sar input sample aspect ratio
18222
18223 dar The input display aspect ratio. Calculated from "(iw / ih) * sar".
18224
18225 n The (sequential) number of the input frame, starting from 0. Only
18226 available with "eval=frame".
18227
18228 t The presentation timestamp of the input frame, expressed as a
18229 number of seconds. Only available with "eval=frame".
18230
18231 pos The position (byte offset) of the frame in the input stream, or NaN
18232 if this information is unavailable and/or meaningless (for example
18233 in case of synthetic video). Only available with "eval=frame".
18234
18235 scale2ref
18236 Scale (resize) the input video, based on a reference video.
18237
18238 See the scale filter for available options, scale2ref supports the same
18239 but uses the reference video instead of the main input as basis.
18240 scale2ref also supports the following additional constants for the w
18241 and h options:
18242
18243 main_w
18244 main_h
18245 The main input video's width and height
18246
18247 main_a
18248 The same as main_w / main_h
18249
18250 main_sar
18251 The main input video's sample aspect ratio
18252
18253 main_dar, mdar
18254 The main input video's display aspect ratio. Calculated from
18255 "(main_w / main_h) * main_sar".
18256
18257 main_hsub
18258 main_vsub
18259 The main input video's horizontal and vertical chroma subsample
18260 values. For example for the pixel format "yuv422p" hsub is 2 and
18261 vsub is 1.
18262
18263 main_n
18264 The (sequential) number of the main input frame, starting from 0.
18265 Only available with "eval=frame".
18266
18267 main_t
18268 The presentation timestamp of the main input frame, expressed as a
18269 number of seconds. Only available with "eval=frame".
18270
18271 main_pos
18272 The position (byte offset) of the frame in the main input stream,
18273 or NaN if this information is unavailable and/or meaningless (for
18274 example in case of synthetic video). Only available with
18275 "eval=frame".
18276
18277 Examples
18278
18279 • Scale a subtitle stream (b) to match the main video (a) in size
18280 before overlaying
18281
18282 'scale2ref[b][a];[a][b]overlay'
18283
18284 • Scale a logo to 1/10th the height of a video, while preserving its
18285 display aspect ratio.
18286
18287 [logo-in][video-in]scale2ref=w=oh*mdar:h=ih/10[logo-out][video-out]
18288
18289 Commands
18290
18291 This filter supports the following commands:
18292
18293 width, w
18294 height, h
18295 Set the output video dimension expression. The command accepts the
18296 same syntax of the corresponding option.
18297
18298 If the specified expression is not valid, it is kept at its current
18299 value.
18300
18301 scale2ref_npp
18302 Use the NVIDIA Performance Primitives (libnpp) to scale (resize) the
18303 input video, based on a reference video.
18304
18305 See the scale_npp filter for available options, scale2ref_npp supports
18306 the same but uses the reference video instead of the main input as
18307 basis. scale2ref_npp also supports the following additional constants
18308 for the w and h options:
18309
18310 main_w
18311 main_h
18312 The main input video's width and height
18313
18314 main_a
18315 The same as main_w / main_h
18316
18317 main_sar
18318 The main input video's sample aspect ratio
18319
18320 main_dar, mdar
18321 The main input video's display aspect ratio. Calculated from
18322 "(main_w / main_h) * main_sar".
18323
18324 main_n
18325 The (sequential) number of the main input frame, starting from 0.
18326 Only available with "eval=frame".
18327
18328 main_t
18329 The presentation timestamp of the main input frame, expressed as a
18330 number of seconds. Only available with "eval=frame".
18331
18332 main_pos
18333 The position (byte offset) of the frame in the main input stream,
18334 or NaN if this information is unavailable and/or meaningless (for
18335 example in case of synthetic video). Only available with
18336 "eval=frame".
18337
18338 Examples
18339
18340 • Scale a subtitle stream (b) to match the main video (a) in size
18341 before overlaying
18342
18343 'scale2ref_npp[b][a];[a][b]overlay_cuda'
18344
18345 • Scale a logo to 1/10th the height of a video, while preserving its
18346 display aspect ratio.
18347
18348 [logo-in][video-in]scale2ref_npp=w=oh*mdar:h=ih/10[logo-out][video-out]
18349
18350 scharr
18351 Apply scharr operator to input video stream.
18352
18353 The filter accepts the following option:
18354
18355 planes
18356 Set which planes will be processed, unprocessed planes will be
18357 copied. By default value 0xf, all planes will be processed.
18358
18359 scale
18360 Set value which will be multiplied with filtered result.
18361
18362 delta
18363 Set value which will be added to filtered result.
18364
18365 Commands
18366
18367 This filter supports the all above options as commands.
18368
18369 scroll
18370 Scroll input video horizontally and/or vertically by constant speed.
18371
18372 The filter accepts the following options:
18373
18374 horizontal, h
18375 Set the horizontal scrolling speed. Default is 0. Allowed range is
18376 from -1 to 1. Negative values changes scrolling direction.
18377
18378 vertical, v
18379 Set the vertical scrolling speed. Default is 0. Allowed range is
18380 from -1 to 1. Negative values changes scrolling direction.
18381
18382 hpos
18383 Set the initial horizontal scrolling position. Default is 0.
18384 Allowed range is from 0 to 1.
18385
18386 vpos
18387 Set the initial vertical scrolling position. Default is 0. Allowed
18388 range is from 0 to 1.
18389
18390 Commands
18391
18392 This filter supports the following commands:
18393
18394 horizontal, h
18395 Set the horizontal scrolling speed.
18396
18397 vertical, v
18398 Set the vertical scrolling speed.
18399
18400 scdet
18401 Detect video scene change.
18402
18403 This filter sets frame metadata with mafd between frame, the scene
18404 score, and forward the frame to the next filter, so they can use these
18405 metadata to detect scene change or others.
18406
18407 In addition, this filter logs a message and sets frame metadata when it
18408 detects a scene change by threshold.
18409
18410 "lavfi.scd.mafd" metadata keys are set with mafd for every frame.
18411
18412 "lavfi.scd.score" metadata keys are set with scene change score for
18413 every frame to detect scene change.
18414
18415 "lavfi.scd.time" metadata keys are set with current filtered frame time
18416 which detect scene change with threshold.
18417
18418 The filter accepts the following options:
18419
18420 threshold, t
18421 Set the scene change detection threshold as a percentage of maximum
18422 change. Good values are in the "[8.0, 14.0]" range. The range for
18423 threshold is "[0., 100.]".
18424
18425 Default value is 10..
18426
18427 sc_pass, s
18428 Set the flag to pass scene change frames to the next filter.
18429 Default value is 0 You can enable it if you want to get snapshot of
18430 scene change frames only.
18431
18432 selectivecolor
18433 Adjust cyan, magenta, yellow and black (CMYK) to certain ranges of
18434 colors (such as "reds", "yellows", "greens", "cyans", ...). The
18435 adjustment range is defined by the "purity" of the color (that is, how
18436 saturated it already is).
18437
18438 This filter is similar to the Adobe Photoshop Selective Color tool.
18439
18440 The filter accepts the following options:
18441
18442 correction_method
18443 Select color correction method.
18444
18445 Available values are:
18446
18447 absolute
18448 Specified adjustments are applied "as-is" (added/subtracted to
18449 original pixel component value).
18450
18451 relative
18452 Specified adjustments are relative to the original component
18453 value.
18454
18455 Default is "absolute".
18456
18457 reds
18458 Adjustments for red pixels (pixels where the red component is the
18459 maximum)
18460
18461 yellows
18462 Adjustments for yellow pixels (pixels where the blue component is
18463 the minimum)
18464
18465 greens
18466 Adjustments for green pixels (pixels where the green component is
18467 the maximum)
18468
18469 cyans
18470 Adjustments for cyan pixels (pixels where the red component is the
18471 minimum)
18472
18473 blues
18474 Adjustments for blue pixels (pixels where the blue component is the
18475 maximum)
18476
18477 magentas
18478 Adjustments for magenta pixels (pixels where the green component is
18479 the minimum)
18480
18481 whites
18482 Adjustments for white pixels (pixels where all components are
18483 greater than 128)
18484
18485 neutrals
18486 Adjustments for all pixels except pure black and pure white
18487
18488 blacks
18489 Adjustments for black pixels (pixels where all components are
18490 lesser than 128)
18491
18492 psfile
18493 Specify a Photoshop selective color file (".asv") to import the
18494 settings from.
18495
18496 All the adjustment settings (reds, yellows, ...) accept up to 4 space
18497 separated floating point adjustment values in the [-1,1] range,
18498 respectively to adjust the amount of cyan, magenta, yellow and black
18499 for the pixels of its range.
18500
18501 Examples
18502
18503 • Increase cyan by 50% and reduce yellow by 33% in every green areas,
18504 and increase magenta by 27% in blue areas:
18505
18506 selectivecolor=greens=.5 0 -.33 0:blues=0 .27
18507
18508 • Use a Photoshop selective color preset:
18509
18510 selectivecolor=psfile=MySelectiveColorPresets/Misty.asv
18511
18512 separatefields
18513 The "separatefields" takes a frame-based video input and splits each
18514 frame into its components fields, producing a new half height clip with
18515 twice the frame rate and twice the frame count.
18516
18517 This filter use field-dominance information in frame to decide which of
18518 each pair of fields to place first in the output. If it gets it wrong
18519 use setfield filter before "separatefields" filter.
18520
18521 setdar, setsar
18522 The "setdar" filter sets the Display Aspect Ratio for the filter output
18523 video.
18524
18525 This is done by changing the specified Sample (aka Pixel) Aspect Ratio,
18526 according to the following equation:
18527
18528 <DAR> = <HORIZONTAL_RESOLUTION> / <VERTICAL_RESOLUTION> * <SAR>
18529
18530 Keep in mind that the "setdar" filter does not modify the pixel
18531 dimensions of the video frame. Also, the display aspect ratio set by
18532 this filter may be changed by later filters in the filterchain, e.g. in
18533 case of scaling or if another "setdar" or a "setsar" filter is applied.
18534
18535 The "setsar" filter sets the Sample (aka Pixel) Aspect Ratio for the
18536 filter output video.
18537
18538 Note that as a consequence of the application of this filter, the
18539 output display aspect ratio will change according to the equation
18540 above.
18541
18542 Keep in mind that the sample aspect ratio set by the "setsar" filter
18543 may be changed by later filters in the filterchain, e.g. if another
18544 "setsar" or a "setdar" filter is applied.
18545
18546 It accepts the following parameters:
18547
18548 r, ratio, dar ("setdar" only), sar ("setsar" only)
18549 Set the aspect ratio used by the filter.
18550
18551 The parameter can be a floating point number string, an expression,
18552 or a string of the form num:den, where num and den are the
18553 numerator and denominator of the aspect ratio. If the parameter is
18554 not specified, it is assumed the value "0". In case the form
18555 "num:den" is used, the ":" character should be escaped.
18556
18557 max Set the maximum integer value to use for expressing numerator and
18558 denominator when reducing the expressed aspect ratio to a rational.
18559 Default value is 100.
18560
18561 The parameter sar is an expression containing the following constants:
18562
18563 E, PI, PHI
18564 These are approximated values for the mathematical constants e
18565 (Euler's number), pi (Greek pi), and phi (the golden ratio).
18566
18567 w, h
18568 The input width and height.
18569
18570 a These are the same as w / h.
18571
18572 sar The input sample aspect ratio.
18573
18574 dar The input display aspect ratio. It is the same as (w / h) * sar.
18575
18576 hsub, vsub
18577 Horizontal and vertical chroma subsample values. For example, for
18578 the pixel format "yuv422p" hsub is 2 and vsub is 1.
18579
18580 Examples
18581
18582 • To change the display aspect ratio to 16:9, specify one of the
18583 following:
18584
18585 setdar=dar=1.77777
18586 setdar=dar=16/9
18587
18588 • To change the sample aspect ratio to 10:11, specify:
18589
18590 setsar=sar=10/11
18591
18592 • To set a display aspect ratio of 16:9, and specify a maximum
18593 integer value of 1000 in the aspect ratio reduction, use the
18594 command:
18595
18596 setdar=ratio=16/9:max=1000
18597
18598 setfield
18599 Force field for the output video frame.
18600
18601 The "setfield" filter marks the interlace type field for the output
18602 frames. It does not change the input frame, but only sets the
18603 corresponding property, which affects how the frame is treated by
18604 following filters (e.g. "fieldorder" or "yadif").
18605
18606 The filter accepts the following options:
18607
18608 mode
18609 Available values are:
18610
18611 auto
18612 Keep the same field property.
18613
18614 bff Mark the frame as bottom-field-first.
18615
18616 tff Mark the frame as top-field-first.
18617
18618 prog
18619 Mark the frame as progressive.
18620
18621 setparams
18622 Force frame parameter for the output video frame.
18623
18624 The "setparams" filter marks interlace and color range for the output
18625 frames. It does not change the input frame, but only sets the
18626 corresponding property, which affects how the frame is treated by
18627 filters/encoders.
18628
18629 field_mode
18630 Available values are:
18631
18632 auto
18633 Keep the same field property (default).
18634
18635 bff Mark the frame as bottom-field-first.
18636
18637 tff Mark the frame as top-field-first.
18638
18639 prog
18640 Mark the frame as progressive.
18641
18642 range
18643 Available values are:
18644
18645 auto
18646 Keep the same color range property (default).
18647
18648 unspecified, unknown
18649 Mark the frame as unspecified color range.
18650
18651 limited, tv, mpeg
18652 Mark the frame as limited range.
18653
18654 full, pc, jpeg
18655 Mark the frame as full range.
18656
18657 color_primaries
18658 Set the color primaries. Available values are:
18659
18660 auto
18661 Keep the same color primaries property (default).
18662
18663 bt709
18664 unknown
18665 bt470m
18666 bt470bg
18667 smpte170m
18668 smpte240m
18669 film
18670 bt2020
18671 smpte428
18672 smpte431
18673 smpte432
18674 jedec-p22
18675 color_trc
18676 Set the color transfer. Available values are:
18677
18678 auto
18679 Keep the same color trc property (default).
18680
18681 bt709
18682 unknown
18683 bt470m
18684 bt470bg
18685 smpte170m
18686 smpte240m
18687 linear
18688 log100
18689 log316
18690 iec61966-2-4
18691 bt1361e
18692 iec61966-2-1
18693 bt2020-10
18694 bt2020-12
18695 smpte2084
18696 smpte428
18697 arib-std-b67
18698 colorspace
18699 Set the colorspace. Available values are:
18700
18701 auto
18702 Keep the same colorspace property (default).
18703
18704 gbr
18705 bt709
18706 unknown
18707 fcc
18708 bt470bg
18709 smpte170m
18710 smpte240m
18711 ycgco
18712 bt2020nc
18713 bt2020c
18714 smpte2085
18715 chroma-derived-nc
18716 chroma-derived-c
18717 ictcp
18718
18719 sharpen_npp
18720 Use the NVIDIA Performance Primitives (libnpp) to perform image
18721 sharpening with border control.
18722
18723 The following additional options are accepted:
18724
18725 border_type
18726 Type of sampling to be used ad frame borders. One of the following:
18727
18728 replicate
18729 Replicate pixel values.
18730
18731 shear
18732 Apply shear transform to input video.
18733
18734 This filter supports the following options:
18735
18736 shx Shear factor in X-direction. Default value is 0. Allowed range is
18737 from -2 to 2.
18738
18739 shy Shear factor in Y-direction. Default value is 0. Allowed range is
18740 from -2 to 2.
18741
18742 fillcolor, c
18743 Set the color used to fill the output area not covered by the
18744 transformed video. For the general syntax of this option, check the
18745 "Color" section in the ffmpeg-utils manual. If the special value
18746 "none" is selected then no background is printed (useful for
18747 example if the background is never shown).
18748
18749 Default value is "black".
18750
18751 interp
18752 Set interpolation type. Can be "bilinear" or "nearest". Default is
18753 "bilinear".
18754
18755 Commands
18756
18757 This filter supports the all above options as commands.
18758
18759 showinfo
18760 Show a line containing various information for each input video frame.
18761 The input video is not modified.
18762
18763 This filter supports the following options:
18764
18765 checksum
18766 Calculate checksums of each plane. By default enabled.
18767
18768 The shown line contains a sequence of key/value pairs of the form
18769 key:value.
18770
18771 The following values are shown in the output:
18772
18773 n The (sequential) number of the input frame, starting from 0.
18774
18775 pts The Presentation TimeStamp of the input frame, expressed as a
18776 number of time base units. The time base unit depends on the filter
18777 input pad.
18778
18779 pts_time
18780 The Presentation TimeStamp of the input frame, expressed as a
18781 number of seconds.
18782
18783 pos The position of the frame in the input stream, or -1 if this
18784 information is unavailable and/or meaningless (for example in case
18785 of synthetic video).
18786
18787 fmt The pixel format name.
18788
18789 sar The sample aspect ratio of the input frame, expressed in the form
18790 num/den.
18791
18792 s The size of the input frame. For the syntax of this option, check
18793 the "Video size" section in the ffmpeg-utils manual.
18794
18795 i The type of interlaced mode ("P" for "progressive", "T" for top
18796 field first, "B" for bottom field first).
18797
18798 iskey
18799 This is 1 if the frame is a key frame, 0 otherwise.
18800
18801 type
18802 The picture type of the input frame ("I" for an I-frame, "P" for a
18803 P-frame, "B" for a B-frame, or "?" for an unknown type). Also
18804 refer to the documentation of the "AVPictureType" enum and of the
18805 "av_get_picture_type_char" function defined in libavutil/avutil.h.
18806
18807 checksum
18808 The Adler-32 checksum (printed in hexadecimal) of all the planes of
18809 the input frame.
18810
18811 plane_checksum
18812 The Adler-32 checksum (printed in hexadecimal) of each plane of the
18813 input frame, expressed in the form "[c0 c1 c2 c3]".
18814
18815 mean
18816 The mean value of pixels in each plane of the input frame,
18817 expressed in the form "[mean0 mean1 mean2 mean3]".
18818
18819 stdev
18820 The standard deviation of pixel values in each plane of the input
18821 frame, expressed in the form "[stdev0 stdev1 stdev2 stdev3]".
18822
18823 showpalette
18824 Displays the 256 colors palette of each frame. This filter is only
18825 relevant for pal8 pixel format frames.
18826
18827 It accepts the following option:
18828
18829 s Set the size of the box used to represent one palette color entry.
18830 Default is 30 (for a "30x30" pixel box).
18831
18832 shuffleframes
18833 Reorder and/or duplicate and/or drop video frames.
18834
18835 It accepts the following parameters:
18836
18837 mapping
18838 Set the destination indexes of input frames. This is space or '|'
18839 separated list of indexes that maps input frames to output frames.
18840 Number of indexes also sets maximal value that each index may have.
18841 '-1' index have special meaning and that is to drop frame.
18842
18843 The first frame has the index 0. The default is to keep the input
18844 unchanged.
18845
18846 Examples
18847
18848 • Swap second and third frame of every three frames of the input:
18849
18850 ffmpeg -i INPUT -vf "shuffleframes=0 2 1" OUTPUT
18851
18852 • Swap 10th and 1st frame of every ten frames of the input:
18853
18854 ffmpeg -i INPUT -vf "shuffleframes=9 1 2 3 4 5 6 7 8 0" OUTPUT
18855
18856 shufflepixels
18857 Reorder pixels in video frames.
18858
18859 This filter accepts the following options:
18860
18861 direction, d
18862 Set shuffle direction. Can be forward or inverse direction.
18863 Default direction is forward.
18864
18865 mode, m
18866 Set shuffle mode. Can be horizontal, vertical or block mode.
18867
18868 width, w
18869 height, h
18870 Set shuffle block_size. In case of horizontal shuffle mode only
18871 width part of size is used, and in case of vertical shuffle mode
18872 only height part of size is used.
18873
18874 seed, s
18875 Set random seed used with shuffling pixels. Mainly useful to set to
18876 be able to reverse filtering process to get original input. For
18877 example, to reverse forward shuffle you need to use same parameters
18878 and exact same seed and to set direction to inverse.
18879
18880 shuffleplanes
18881 Reorder and/or duplicate video planes.
18882
18883 It accepts the following parameters:
18884
18885 map0
18886 The index of the input plane to be used as the first output plane.
18887
18888 map1
18889 The index of the input plane to be used as the second output plane.
18890
18891 map2
18892 The index of the input plane to be used as the third output plane.
18893
18894 map3
18895 The index of the input plane to be used as the fourth output plane.
18896
18897 The first plane has the index 0. The default is to keep the input
18898 unchanged.
18899
18900 Examples
18901
18902 • Swap the second and third planes of the input:
18903
18904 ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
18905
18906 signalstats
18907 Evaluate various visual metrics that assist in determining issues
18908 associated with the digitization of analog video media.
18909
18910 By default the filter will log these metadata values:
18911
18912 YMIN
18913 Display the minimal Y value contained within the input frame.
18914 Expressed in range of [0-255].
18915
18916 YLOW
18917 Display the Y value at the 10% percentile within the input frame.
18918 Expressed in range of [0-255].
18919
18920 YAVG
18921 Display the average Y value within the input frame. Expressed in
18922 range of [0-255].
18923
18924 YHIGH
18925 Display the Y value at the 90% percentile within the input frame.
18926 Expressed in range of [0-255].
18927
18928 YMAX
18929 Display the maximum Y value contained within the input frame.
18930 Expressed in range of [0-255].
18931
18932 UMIN
18933 Display the minimal U value contained within the input frame.
18934 Expressed in range of [0-255].
18935
18936 ULOW
18937 Display the U value at the 10% percentile within the input frame.
18938 Expressed in range of [0-255].
18939
18940 UAVG
18941 Display the average U value within the input frame. Expressed in
18942 range of [0-255].
18943
18944 UHIGH
18945 Display the U value at the 90% percentile within the input frame.
18946 Expressed in range of [0-255].
18947
18948 UMAX
18949 Display the maximum U value contained within the input frame.
18950 Expressed in range of [0-255].
18951
18952 VMIN
18953 Display the minimal V value contained within the input frame.
18954 Expressed in range of [0-255].
18955
18956 VLOW
18957 Display the V value at the 10% percentile within the input frame.
18958 Expressed in range of [0-255].
18959
18960 VAVG
18961 Display the average V value within the input frame. Expressed in
18962 range of [0-255].
18963
18964 VHIGH
18965 Display the V value at the 90% percentile within the input frame.
18966 Expressed in range of [0-255].
18967
18968 VMAX
18969 Display the maximum V value contained within the input frame.
18970 Expressed in range of [0-255].
18971
18972 SATMIN
18973 Display the minimal saturation value contained within the input
18974 frame. Expressed in range of [0-~181.02].
18975
18976 SATLOW
18977 Display the saturation value at the 10% percentile within the input
18978 frame. Expressed in range of [0-~181.02].
18979
18980 SATAVG
18981 Display the average saturation value within the input frame.
18982 Expressed in range of [0-~181.02].
18983
18984 SATHIGH
18985 Display the saturation value at the 90% percentile within the input
18986 frame. Expressed in range of [0-~181.02].
18987
18988 SATMAX
18989 Display the maximum saturation value contained within the input
18990 frame. Expressed in range of [0-~181.02].
18991
18992 HUEMED
18993 Display the median value for hue within the input frame. Expressed
18994 in range of [0-360].
18995
18996 HUEAVG
18997 Display the average value for hue within the input frame. Expressed
18998 in range of [0-360].
18999
19000 YDIF
19001 Display the average of sample value difference between all values
19002 of the Y plane in the current frame and corresponding values of the
19003 previous input frame. Expressed in range of [0-255].
19004
19005 UDIF
19006 Display the average of sample value difference between all values
19007 of the U plane in the current frame and corresponding values of the
19008 previous input frame. Expressed in range of [0-255].
19009
19010 VDIF
19011 Display the average of sample value difference between all values
19012 of the V plane in the current frame and corresponding values of the
19013 previous input frame. Expressed in range of [0-255].
19014
19015 YBITDEPTH
19016 Display bit depth of Y plane in current frame. Expressed in range
19017 of [0-16].
19018
19019 UBITDEPTH
19020 Display bit depth of U plane in current frame. Expressed in range
19021 of [0-16].
19022
19023 VBITDEPTH
19024 Display bit depth of V plane in current frame. Expressed in range
19025 of [0-16].
19026
19027 The filter accepts the following options:
19028
19029 stat
19030 out stat specify an additional form of image analysis. out output
19031 video with the specified type of pixel highlighted.
19032
19033 Both options accept the following values:
19034
19035 tout
19036 Identify temporal outliers pixels. A temporal outlier is a
19037 pixel unlike the neighboring pixels of the same field. Examples
19038 of temporal outliers include the results of video dropouts,
19039 head clogs, or tape tracking issues.
19040
19041 vrep
19042 Identify vertical line repetition. Vertical line repetition
19043 includes similar rows of pixels within a frame. In born-digital
19044 video vertical line repetition is common, but this pattern is
19045 uncommon in video digitized from an analog source. When it
19046 occurs in video that results from the digitization of an analog
19047 source it can indicate concealment from a dropout compensator.
19048
19049 brng
19050 Identify pixels that fall outside of legal broadcast range.
19051
19052 color, c
19053 Set the highlight color for the out option. The default color is
19054 yellow.
19055
19056 Examples
19057
19058 • Output data of various video metrics:
19059
19060 ffprobe -f lavfi movie=example.mov,signalstats="stat=tout+vrep+brng" -show_frames
19061
19062 • Output specific data about the minimum and maximum values of the Y
19063 plane per frame:
19064
19065 ffprobe -f lavfi movie=example.mov,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
19066
19067 • Playback video while highlighting pixels that are outside of
19068 broadcast range in red.
19069
19070 ffplay example.mov -vf signalstats="out=brng:color=red"
19071
19072 • Playback video with signalstats metadata drawn over the frame.
19073
19074 ffplay example.mov -vf signalstats=stat=brng+vrep+tout,drawtext=fontfile=FreeSerif.ttf:textfile=signalstat_drawtext.txt
19075
19076 The contents of signalstat_drawtext.txt used in the command are:
19077
19078 time %{pts:hms}
19079 Y (%{metadata:lavfi.signalstats.YMIN}-%{metadata:lavfi.signalstats.YMAX})
19080 U (%{metadata:lavfi.signalstats.UMIN}-%{metadata:lavfi.signalstats.UMAX})
19081 V (%{metadata:lavfi.signalstats.VMIN}-%{metadata:lavfi.signalstats.VMAX})
19082 saturation maximum: %{metadata:lavfi.signalstats.SATMAX}
19083
19084 signature
19085 Calculates the MPEG-7 Video Signature. The filter can handle more than
19086 one input. In this case the matching between the inputs can be
19087 calculated additionally. The filter always passes through the first
19088 input. The signature of each stream can be written into a file.
19089
19090 It accepts the following options:
19091
19092 detectmode
19093 Enable or disable the matching process.
19094
19095 Available values are:
19096
19097 off Disable the calculation of a matching (default).
19098
19099 full
19100 Calculate the matching for the whole video and output whether
19101 the whole video matches or only parts.
19102
19103 fast
19104 Calculate only until a matching is found or the video ends.
19105 Should be faster in some cases.
19106
19107 nb_inputs
19108 Set the number of inputs. The option value must be a non negative
19109 integer. Default value is 1.
19110
19111 filename
19112 Set the path to which the output is written. If there is more than
19113 one input, the path must be a prototype, i.e. must contain %d or
19114 %0nd (where n is a positive integer), that will be replaced with
19115 the input number. If no filename is specified, no output will be
19116 written. This is the default.
19117
19118 format
19119 Choose the output format.
19120
19121 Available values are:
19122
19123 binary
19124 Use the specified binary representation (default).
19125
19126 xml Use the specified xml representation.
19127
19128 th_d
19129 Set threshold to detect one word as similar. The option value must
19130 be an integer greater than zero. The default value is 9000.
19131
19132 th_dc
19133 Set threshold to detect all words as similar. The option value must
19134 be an integer greater than zero. The default value is 60000.
19135
19136 th_xh
19137 Set threshold to detect frames as similar. The option value must be
19138 an integer greater than zero. The default value is 116.
19139
19140 th_di
19141 Set the minimum length of a sequence in frames to recognize it as
19142 matching sequence. The option value must be a non negative integer
19143 value. The default value is 0.
19144
19145 th_it
19146 Set the minimum relation, that matching frames to all frames must
19147 have. The option value must be a double value between 0 and 1. The
19148 default value is 0.5.
19149
19150 Examples
19151
19152 • To calculate the signature of an input video and store it in
19153 signature.bin:
19154
19155 ffmpeg -i input.mkv -vf signature=filename=signature.bin -map 0:v -f null -
19156
19157 • To detect whether two videos match and store the signatures in XML
19158 format in signature0.xml and signature1.xml:
19159
19160 ffmpeg -i input1.mkv -i input2.mkv -filter_complex "[0:v][1:v] signature=nb_inputs=2:detectmode=full:format=xml:filename=signature%d.xml" -map :v -f null -
19161
19162 siti
19163 Calculate Spatial Info (SI) and Temporal Info (TI) scores for a video,
19164 as defined in ITU-T P.910: Subjective video quality assessment methods
19165 for multimedia applications. Available PDF at
19166 <https://www.itu.int/rec/T-REC-P.910-199909-S/en >.
19167
19168 It accepts the following option:
19169
19170 print_summary
19171 If set to 1, Summary statistics will be printed to the console.
19172 Default 0.
19173
19174 Examples
19175
19176 • To calculate SI/TI metrics and print summary:
19177
19178 ffmpeg -i input.mp4 -vf siti=print_summary=1 -f null -
19179
19180 smartblur
19181 Blur the input video without impacting the outlines.
19182
19183 It accepts the following options:
19184
19185 luma_radius, lr
19186 Set the luma radius. The option value must be a float number in the
19187 range [0.1,5.0] that specifies the variance of the gaussian filter
19188 used to blur the image (slower if larger). Default value is 1.0.
19189
19190 luma_strength, ls
19191 Set the luma strength. The option value must be a float number in
19192 the range [-1.0,1.0] that configures the blurring. A value included
19193 in [0.0,1.0] will blur the image whereas a value included in
19194 [-1.0,0.0] will sharpen the image. Default value is 1.0.
19195
19196 luma_threshold, lt
19197 Set the luma threshold used as a coefficient to determine whether a
19198 pixel should be blurred or not. The option value must be an integer
19199 in the range [-30,30]. A value of 0 will filter all the image, a
19200 value included in [0,30] will filter flat areas and a value
19201 included in [-30,0] will filter edges. Default value is 0.
19202
19203 chroma_radius, cr
19204 Set the chroma radius. The option value must be a float number in
19205 the range [0.1,5.0] that specifies the variance of the gaussian
19206 filter used to blur the image (slower if larger). Default value is
19207 luma_radius.
19208
19209 chroma_strength, cs
19210 Set the chroma strength. The option value must be a float number in
19211 the range [-1.0,1.0] that configures the blurring. A value included
19212 in [0.0,1.0] will blur the image whereas a value included in
19213 [-1.0,0.0] will sharpen the image. Default value is luma_strength.
19214
19215 chroma_threshold, ct
19216 Set the chroma threshold used as a coefficient to determine whether
19217 a pixel should be blurred or not. The option value must be an
19218 integer in the range [-30,30]. A value of 0 will filter all the
19219 image, a value included in [0,30] will filter flat areas and a
19220 value included in [-30,0] will filter edges. Default value is
19221 luma_threshold.
19222
19223 If a chroma option is not explicitly set, the corresponding luma value
19224 is set.
19225
19226 sobel
19227 Apply sobel operator to input video stream.
19228
19229 The filter accepts the following option:
19230
19231 planes
19232 Set which planes will be processed, unprocessed planes will be
19233 copied. By default value 0xf, all planes will be processed.
19234
19235 scale
19236 Set value which will be multiplied with filtered result.
19237
19238 delta
19239 Set value which will be added to filtered result.
19240
19241 Commands
19242
19243 This filter supports the all above options as commands.
19244
19245 spp
19246 Apply a simple postprocessing filter that compresses and decompresses
19247 the image at several (or - in the case of quality level 6 - all) shifts
19248 and average the results.
19249
19250 The filter accepts the following options:
19251
19252 quality
19253 Set quality. This option defines the number of levels for
19254 averaging. It accepts an integer in the range 0-6. If set to 0, the
19255 filter will have no effect. A value of 6 means the higher quality.
19256 For each increment of that value the speed drops by a factor of
19257 approximately 2. Default value is 3.
19258
19259 qp Force a constant quantization parameter. If not set, the filter
19260 will use the QP from the video stream (if available).
19261
19262 mode
19263 Set thresholding mode. Available modes are:
19264
19265 hard
19266 Set hard thresholding (default).
19267
19268 soft
19269 Set soft thresholding (better de-ringing effect, but likely
19270 blurrier).
19271
19272 use_bframe_qp
19273 Enable the use of the QP from the B-Frames if set to 1. Using this
19274 option may cause flicker since the B-Frames have often larger QP.
19275 Default is 0 (not enabled).
19276
19277 Commands
19278
19279 This filter supports the following commands:
19280
19281 quality, level
19282 Set quality level. The value "max" can be used to set the maximum
19283 level, currently 6.
19284
19285 sr
19286 Scale the input by applying one of the super-resolution methods based
19287 on convolutional neural networks. Supported models:
19288
19289 • Super-Resolution Convolutional Neural Network model (SRCNN). See
19290 <https://arxiv.org/abs/1501.00092>.
19291
19292 • Efficient Sub-Pixel Convolutional Neural Network model (ESPCN).
19293 See <https://arxiv.org/abs/1609.05158>.
19294
19295 Training scripts as well as scripts for model file (.pb) saving can be
19296 found at <https://github.com/XueweiMeng/sr/tree/sr_dnn_native>.
19297 Original repository is at
19298 <https://github.com/HighVoltageRocknRoll/sr.git>.
19299
19300 Native model files (.model) can be generated from TensorFlow model
19301 files (.pb) by using tools/python/convert.py
19302
19303 The filter accepts the following options:
19304
19305 dnn_backend
19306 Specify which DNN backend to use for model loading and execution.
19307 This option accepts the following values:
19308
19309 native
19310 Native implementation of DNN loading and execution.
19311
19312 tensorflow
19313 TensorFlow backend. To enable this backend you need to install
19314 the TensorFlow for C library (see
19315 <https://www.tensorflow.org/install/lang_c>) and configure
19316 FFmpeg with "--enable-libtensorflow"
19317
19318 Default value is native.
19319
19320 model
19321 Set path to model file specifying network architecture and its
19322 parameters. Note that different backends use different file
19323 formats. TensorFlow backend can load files for both formats, while
19324 native backend can load files for only its format.
19325
19326 scale_factor
19327 Set scale factor for SRCNN model. Allowed values are 2, 3 and 4.
19328 Default value is 2. Scale factor is necessary for SRCNN model,
19329 because it accepts input upscaled using bicubic upscaling with
19330 proper scale factor.
19331
19332 To get full functionality (such as async execution), please use the
19333 dnn_processing filter.
19334
19335 ssim
19336 Obtain the SSIM (Structural SImilarity Metric) between two input
19337 videos.
19338
19339 This filter takes in input two input videos, the first input is
19340 considered the "main" source and is passed unchanged to the output. The
19341 second input is used as a "reference" video for computing the SSIM.
19342
19343 Both video inputs must have the same resolution and pixel format for
19344 this filter to work correctly. Also it assumes that both inputs have
19345 the same number of frames, which are compared one by one.
19346
19347 The filter stores the calculated SSIM of each frame.
19348
19349 The description of the accepted parameters follows.
19350
19351 stats_file, f
19352 If specified the filter will use the named file to save the SSIM of
19353 each individual frame. When filename equals "-" the data is sent to
19354 standard output.
19355
19356 The file printed if stats_file is selected, contains a sequence of
19357 key/value pairs of the form key:value for each compared couple of
19358 frames.
19359
19360 A description of each shown parameter follows:
19361
19362 n sequential number of the input frame, starting from 1
19363
19364 Y, U, V, R, G, B
19365 SSIM of the compared frames for the component specified by the
19366 suffix.
19367
19368 All SSIM of the compared frames for the whole frame.
19369
19370 dB Same as above but in dB representation.
19371
19372 This filter also supports the framesync options.
19373
19374 Examples
19375
19376 • For example:
19377
19378 movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
19379 [main][ref] ssim="stats_file=stats.log" [out]
19380
19381 On this example the input file being processed is compared with the
19382 reference file ref_movie.mpg. The SSIM of each individual frame is
19383 stored in stats.log.
19384
19385 • Another example with both psnr and ssim at same time:
19386
19387 ffmpeg -i main.mpg -i ref.mpg -lavfi "ssim;[0:v][1:v]psnr" -f null -
19388
19389 • Another example with different containers:
19390
19391 ffmpeg -i main.mpg -i ref.mkv -lavfi "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]ssim" -f null -
19392
19393 stereo3d
19394 Convert between different stereoscopic image formats.
19395
19396 The filters accept the following options:
19397
19398 in Set stereoscopic image format of input.
19399
19400 Available values for input image formats are:
19401
19402 sbsl
19403 side by side parallel (left eye left, right eye right)
19404
19405 sbsr
19406 side by side crosseye (right eye left, left eye right)
19407
19408 sbs2l
19409 side by side parallel with half width resolution (left eye
19410 left, right eye right)
19411
19412 sbs2r
19413 side by side crosseye with half width resolution (right eye
19414 left, left eye right)
19415
19416 abl
19417 tbl above-below (left eye above, right eye below)
19418
19419 abr
19420 tbr above-below (right eye above, left eye below)
19421
19422 ab2l
19423 tb2l
19424 above-below with half height resolution (left eye above, right
19425 eye below)
19426
19427 ab2r
19428 tb2r
19429 above-below with half height resolution (right eye above, left
19430 eye below)
19431
19432 al alternating frames (left eye first, right eye second)
19433
19434 ar alternating frames (right eye first, left eye second)
19435
19436 irl interleaved rows (left eye has top row, right eye starts on
19437 next row)
19438
19439 irr interleaved rows (right eye has top row, left eye starts on
19440 next row)
19441
19442 icl interleaved columns, left eye first
19443
19444 icr interleaved columns, right eye first
19445
19446 Default value is sbsl.
19447
19448 out Set stereoscopic image format of output.
19449
19450 sbsl
19451 side by side parallel (left eye left, right eye right)
19452
19453 sbsr
19454 side by side crosseye (right eye left, left eye right)
19455
19456 sbs2l
19457 side by side parallel with half width resolution (left eye
19458 left, right eye right)
19459
19460 sbs2r
19461 side by side crosseye with half width resolution (right eye
19462 left, left eye right)
19463
19464 abl
19465 tbl above-below (left eye above, right eye below)
19466
19467 abr
19468 tbr above-below (right eye above, left eye below)
19469
19470 ab2l
19471 tb2l
19472 above-below with half height resolution (left eye above, right
19473 eye below)
19474
19475 ab2r
19476 tb2r
19477 above-below with half height resolution (right eye above, left
19478 eye below)
19479
19480 al alternating frames (left eye first, right eye second)
19481
19482 ar alternating frames (right eye first, left eye second)
19483
19484 irl interleaved rows (left eye has top row, right eye starts on
19485 next row)
19486
19487 irr interleaved rows (right eye has top row, left eye starts on
19488 next row)
19489
19490 arbg
19491 anaglyph red/blue gray (red filter on left eye, blue filter on
19492 right eye)
19493
19494 argg
19495 anaglyph red/green gray (red filter on left eye, green filter
19496 on right eye)
19497
19498 arcg
19499 anaglyph red/cyan gray (red filter on left eye, cyan filter on
19500 right eye)
19501
19502 arch
19503 anaglyph red/cyan half colored (red filter on left eye, cyan
19504 filter on right eye)
19505
19506 arcc
19507 anaglyph red/cyan color (red filter on left eye, cyan filter on
19508 right eye)
19509
19510 arcd
19511 anaglyph red/cyan color optimized with the least squares
19512 projection of dubois (red filter on left eye, cyan filter on
19513 right eye)
19514
19515 agmg
19516 anaglyph green/magenta gray (green filter on left eye, magenta
19517 filter on right eye)
19518
19519 agmh
19520 anaglyph green/magenta half colored (green filter on left eye,
19521 magenta filter on right eye)
19522
19523 agmc
19524 anaglyph green/magenta colored (green filter on left eye,
19525 magenta filter on right eye)
19526
19527 agmd
19528 anaglyph green/magenta color optimized with the least squares
19529 projection of dubois (green filter on left eye, magenta filter
19530 on right eye)
19531
19532 aybg
19533 anaglyph yellow/blue gray (yellow filter on left eye, blue
19534 filter on right eye)
19535
19536 aybh
19537 anaglyph yellow/blue half colored (yellow filter on left eye,
19538 blue filter on right eye)
19539
19540 aybc
19541 anaglyph yellow/blue colored (yellow filter on left eye, blue
19542 filter on right eye)
19543
19544 aybd
19545 anaglyph yellow/blue color optimized with the least squares
19546 projection of dubois (yellow filter on left eye, blue filter on
19547 right eye)
19548
19549 ml mono output (left eye only)
19550
19551 mr mono output (right eye only)
19552
19553 chl checkerboard, left eye first
19554
19555 chr checkerboard, right eye first
19556
19557 icl interleaved columns, left eye first
19558
19559 icr interleaved columns, right eye first
19560
19561 hdmi
19562 HDMI frame pack
19563
19564 Default value is arcd.
19565
19566 Examples
19567
19568 • Convert input video from side by side parallel to anaglyph
19569 yellow/blue dubois:
19570
19571 stereo3d=sbsl:aybd
19572
19573 • Convert input video from above below (left eye above, right eye
19574 below) to side by side crosseye.
19575
19576 stereo3d=abl:sbsr
19577
19578 streamselect, astreamselect
19579 Select video or audio streams.
19580
19581 The filter accepts the following options:
19582
19583 inputs
19584 Set number of inputs. Default is 2.
19585
19586 map Set input indexes to remap to outputs.
19587
19588 Commands
19589
19590 The "streamselect" and "astreamselect" filter supports the following
19591 commands:
19592
19593 map Set input indexes to remap to outputs.
19594
19595 Examples
19596
19597 • Select first 5 seconds 1st stream and rest of time 2nd stream:
19598
19599 sendcmd='5.0 streamselect map 1',streamselect=inputs=2:map=0
19600
19601 • Same as above, but for audio:
19602
19603 asendcmd='5.0 astreamselect map 1',astreamselect=inputs=2:map=0
19604
19605 subtitles
19606 Draw subtitles on top of input video using the libass library.
19607
19608 To enable compilation of this filter you need to configure FFmpeg with
19609 "--enable-libass". This filter also requires a build with libavcodec
19610 and libavformat to convert the passed subtitles file to ASS (Advanced
19611 Substation Alpha) subtitles format.
19612
19613 The filter accepts the following options:
19614
19615 filename, f
19616 Set the filename of the subtitle file to read. It must be
19617 specified.
19618
19619 original_size
19620 Specify the size of the original video, the video for which the ASS
19621 file was composed. For the syntax of this option, check the "Video
19622 size" section in the ffmpeg-utils manual. Due to a misdesign in
19623 ASS aspect ratio arithmetic, this is necessary to correctly scale
19624 the fonts if the aspect ratio has been changed.
19625
19626 fontsdir
19627 Set a directory path containing fonts that can be used by the
19628 filter. These fonts will be used in addition to whatever the font
19629 provider uses.
19630
19631 alpha
19632 Process alpha channel, by default alpha channel is untouched.
19633
19634 charenc
19635 Set subtitles input character encoding. "subtitles" filter only.
19636 Only useful if not UTF-8.
19637
19638 stream_index, si
19639 Set subtitles stream index. "subtitles" filter only.
19640
19641 force_style
19642 Override default style or script info parameters of the subtitles.
19643 It accepts a string containing ASS style format "KEY=VALUE" couples
19644 separated by ",".
19645
19646 If the first key is not specified, it is assumed that the first value
19647 specifies the filename.
19648
19649 For example, to render the file sub.srt on top of the input video, use
19650 the command:
19651
19652 subtitles=sub.srt
19653
19654 which is equivalent to:
19655
19656 subtitles=filename=sub.srt
19657
19658 To render the default subtitles stream from file video.mkv, use:
19659
19660 subtitles=video.mkv
19661
19662 To render the second subtitles stream from that file, use:
19663
19664 subtitles=video.mkv:si=1
19665
19666 To make the subtitles stream from sub.srt appear in 80% transparent
19667 blue "DejaVu Serif", use:
19668
19669 subtitles=sub.srt:force_style='Fontname=DejaVu Serif,PrimaryColour=&HCCFF0000'
19670
19671 super2xsai
19672 Scale the input by 2x and smooth using the Super2xSaI (Scale and
19673 Interpolate) pixel art scaling algorithm.
19674
19675 Useful for enlarging pixel art images without reducing sharpness.
19676
19677 swaprect
19678 Swap two rectangular objects in video.
19679
19680 This filter accepts the following options:
19681
19682 w Set object width.
19683
19684 h Set object height.
19685
19686 x1 Set 1st rect x coordinate.
19687
19688 y1 Set 1st rect y coordinate.
19689
19690 x2 Set 2nd rect x coordinate.
19691
19692 y2 Set 2nd rect y coordinate.
19693
19694 All expressions are evaluated once for each frame.
19695
19696 The all options are expressions containing the following constants:
19697
19698 w
19699 h The input width and height.
19700
19701 a same as w / h
19702
19703 sar input sample aspect ratio
19704
19705 dar input display aspect ratio, it is the same as (w / h) * sar
19706
19707 n The number of the input frame, starting from 0.
19708
19709 t The timestamp expressed in seconds. It's NAN if the input timestamp
19710 is unknown.
19711
19712 pos the position in the file of the input frame, NAN if unknown
19713
19714 Commands
19715
19716 This filter supports the all above options as commands.
19717
19718 swapuv
19719 Swap U & V plane.
19720
19721 tblend
19722 Blend successive video frames.
19723
19724 See blend
19725
19726 telecine
19727 Apply telecine process to the video.
19728
19729 This filter accepts the following options:
19730
19731 first_field
19732 top, t
19733 top field first
19734
19735 bottom, b
19736 bottom field first The default value is "top".
19737
19738 pattern
19739 A string of numbers representing the pulldown pattern you wish to
19740 apply. The default value is 23.
19741
19742 Some typical patterns:
19743
19744 NTSC output (30i):
19745 27.5p: 32222
19746 24p: 23 (classic)
19747 24p: 2332 (preferred)
19748 20p: 33
19749 18p: 334
19750 16p: 3444
19751
19752 PAL output (25i):
19753 27.5p: 12222
19754 24p: 222222222223 ("Euro pulldown")
19755 16.67p: 33
19756 16p: 33333334
19757
19758 thistogram
19759 Compute and draw a color distribution histogram for the input video
19760 across time.
19761
19762 Unlike histogram video filter which only shows histogram of single
19763 input frame at certain time, this filter shows also past histograms of
19764 number of frames defined by "width" option.
19765
19766 The computed histogram is a representation of the color component
19767 distribution in an image.
19768
19769 The filter accepts the following options:
19770
19771 width, w
19772 Set width of single color component output. Default value is 0.
19773 Value of 0 means width will be picked from input video. This also
19774 set number of passed histograms to keep. Allowed range is [0,
19775 8192].
19776
19777 display_mode, d
19778 Set display mode. It accepts the following values:
19779
19780 stack
19781 Per color component graphs are placed below each other.
19782
19783 parade
19784 Per color component graphs are placed side by side.
19785
19786 overlay
19787 Presents information identical to that in the "parade", except
19788 that the graphs representing color components are superimposed
19789 directly over one another.
19790
19791 Default is "stack".
19792
19793 levels_mode, m
19794 Set mode. Can be either "linear", or "logarithmic". Default is
19795 "linear".
19796
19797 components, c
19798 Set what color components to display. Default is 7.
19799
19800 bgopacity, b
19801 Set background opacity. Default is 0.9.
19802
19803 envelope, e
19804 Show envelope. Default is disabled.
19805
19806 ecolor, ec
19807 Set envelope color. Default is "gold".
19808
19809 slide
19810 Set slide mode.
19811
19812 Available values for slide is:
19813
19814 frame
19815 Draw new frame when right border is reached.
19816
19817 replace
19818 Replace old columns with new ones.
19819
19820 scroll
19821 Scroll from right to left.
19822
19823 rscroll
19824 Scroll from left to right.
19825
19826 picture
19827 Draw single picture.
19828
19829 Default is "replace".
19830
19831 threshold
19832 Apply threshold effect to video stream.
19833
19834 This filter needs four video streams to perform thresholding. First
19835 stream is stream we are filtering. Second stream is holding threshold
19836 values, third stream is holding min values, and last, fourth stream is
19837 holding max values.
19838
19839 The filter accepts the following option:
19840
19841 planes
19842 Set which planes will be processed, unprocessed planes will be
19843 copied. By default value 0xf, all planes will be processed.
19844
19845 For example if first stream pixel's component value is less then
19846 threshold value of pixel component from 2nd threshold stream, third
19847 stream value will picked, otherwise fourth stream pixel component value
19848 will be picked.
19849
19850 Using color source filter one can perform various types of
19851 thresholding:
19852
19853 Commands
19854
19855 This filter supports the all options as commands.
19856
19857 Examples
19858
19859 • Binary threshold, using gray color as threshold:
19860
19861 ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=black -f lavfi -i color=white -lavfi threshold output.avi
19862
19863 • Inverted binary threshold, using gray color as threshold:
19864
19865 ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -f lavfi -i color=black -lavfi threshold output.avi
19866
19867 • Truncate binary threshold, using gray color as threshold:
19868
19869 ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=gray -lavfi threshold output.avi
19870
19871 • Threshold to zero, using gray color as threshold:
19872
19873 ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -i 320x240.avi -lavfi threshold output.avi
19874
19875 • Inverted threshold to zero, using gray color as threshold:
19876
19877 ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=white -lavfi threshold output.avi
19878
19879 thumbnail
19880 Select the most representative frame in a given sequence of consecutive
19881 frames.
19882
19883 The filter accepts the following options:
19884
19885 n Set the frames batch size to analyze; in a set of n frames, the
19886 filter will pick one of them, and then handle the next batch of n
19887 frames until the end. Default is 100.
19888
19889 log Set the log level to display picked frame stats. Default is
19890 "info".
19891
19892 Since the filter keeps track of the whole frames sequence, a bigger n
19893 value will result in a higher memory usage, so a high value is not
19894 recommended.
19895
19896 Examples
19897
19898 • Extract one picture each 50 frames:
19899
19900 thumbnail=50
19901
19902 • Complete example of a thumbnail creation with ffmpeg:
19903
19904 ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
19905
19906 tile
19907 Tile several successive frames together.
19908
19909 The untile filter can do the reverse.
19910
19911 The filter accepts the following options:
19912
19913 layout
19914 Set the grid size in the form "COLUMNSxROWS". Range is upto
19915 UINT_MAX cells. Default is "6x5".
19916
19917 nb_frames
19918 Set the maximum number of frames to render in the given area. It
19919 must be less than or equal to wxh. The default value is 0, meaning
19920 all the area will be used.
19921
19922 margin
19923 Set the outer border margin in pixels. Range is 0 to 1024. Default
19924 is 0.
19925
19926 padding
19927 Set the inner border thickness (i.e. the number of pixels between
19928 frames). For more advanced padding options (such as having
19929 different values for the edges), refer to the pad video filter.
19930 Range is 0 to 1024. Default is 0.
19931
19932 color
19933 Specify the color of the unused area. For the syntax of this
19934 option, check the "Color" section in the ffmpeg-utils manual. The
19935 default value of color is "black".
19936
19937 overlap
19938 Set the number of frames to overlap when tiling several successive
19939 frames together. The value must be between 0 and nb_frames - 1.
19940 Default is 0.
19941
19942 init_padding
19943 Set the number of frames to initially be empty before displaying
19944 first output frame. This controls how soon will one get first
19945 output frame. The value must be between 0 and nb_frames - 1.
19946 Default is 0.
19947
19948 Examples
19949
19950 • Produce 8x8 PNG tiles of all keyframes (-skip_frame nokey) in a
19951 movie:
19952
19953 ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
19954
19955 The -vsync 0 is necessary to prevent ffmpeg from duplicating each
19956 output frame to accommodate the originally detected frame rate.
19957
19958 • Display 5 pictures in an area of "3x2" frames, with 7 pixels
19959 between them, and 2 pixels of initial margin, using mixed flat and
19960 named options:
19961
19962 tile=3x2:nb_frames=5:padding=7:margin=2
19963
19964 tinterlace
19965 Perform various types of temporal field interlacing.
19966
19967 Frames are counted starting from 1, so the first input frame is
19968 considered odd.
19969
19970 The filter accepts the following options:
19971
19972 mode
19973 Specify the mode of the interlacing. This option can also be
19974 specified as a value alone. See below for a list of values for this
19975 option.
19976
19977 Available values are:
19978
19979 merge, 0
19980 Move odd frames into the upper field, even into the lower
19981 field, generating a double height frame at half frame rate.
19982
19983 ------> time
19984 Input:
19985 Frame 1 Frame 2 Frame 3 Frame 4
19986
19987 11111 22222 33333 44444
19988 11111 22222 33333 44444
19989 11111 22222 33333 44444
19990 11111 22222 33333 44444
19991
19992 Output:
19993 11111 33333
19994 22222 44444
19995 11111 33333
19996 22222 44444
19997 11111 33333
19998 22222 44444
19999 11111 33333
20000 22222 44444
20001
20002 drop_even, 1
20003 Only output odd frames, even frames are dropped, generating a
20004 frame with unchanged height at half frame rate.
20005
20006 ------> time
20007 Input:
20008 Frame 1 Frame 2 Frame 3 Frame 4
20009
20010 11111 22222 33333 44444
20011 11111 22222 33333 44444
20012 11111 22222 33333 44444
20013 11111 22222 33333 44444
20014
20015 Output:
20016 11111 33333
20017 11111 33333
20018 11111 33333
20019 11111 33333
20020
20021 drop_odd, 2
20022 Only output even frames, odd frames are dropped, generating a
20023 frame with unchanged height at half frame rate.
20024
20025 ------> time
20026 Input:
20027 Frame 1 Frame 2 Frame 3 Frame 4
20028
20029 11111 22222 33333 44444
20030 11111 22222 33333 44444
20031 11111 22222 33333 44444
20032 11111 22222 33333 44444
20033
20034 Output:
20035 22222 44444
20036 22222 44444
20037 22222 44444
20038 22222 44444
20039
20040 pad, 3
20041 Expand each frame to full height, but pad alternate lines with
20042 black, generating a frame with double height at the same input
20043 frame rate.
20044
20045 ------> time
20046 Input:
20047 Frame 1 Frame 2 Frame 3 Frame 4
20048
20049 11111 22222 33333 44444
20050 11111 22222 33333 44444
20051 11111 22222 33333 44444
20052 11111 22222 33333 44444
20053
20054 Output:
20055 11111 ..... 33333 .....
20056 ..... 22222 ..... 44444
20057 11111 ..... 33333 .....
20058 ..... 22222 ..... 44444
20059 11111 ..... 33333 .....
20060 ..... 22222 ..... 44444
20061 11111 ..... 33333 .....
20062 ..... 22222 ..... 44444
20063
20064 interleave_top, 4
20065 Interleave the upper field from odd frames with the lower field
20066 from even frames, generating a frame with unchanged height at
20067 half frame rate.
20068
20069 ------> time
20070 Input:
20071 Frame 1 Frame 2 Frame 3 Frame 4
20072
20073 11111<- 22222 33333<- 44444
20074 11111 22222<- 33333 44444<-
20075 11111<- 22222 33333<- 44444
20076 11111 22222<- 33333 44444<-
20077
20078 Output:
20079 11111 33333
20080 22222 44444
20081 11111 33333
20082 22222 44444
20083
20084 interleave_bottom, 5
20085 Interleave the lower field from odd frames with the upper field
20086 from even frames, generating a frame with unchanged height at
20087 half frame rate.
20088
20089 ------> time
20090 Input:
20091 Frame 1 Frame 2 Frame 3 Frame 4
20092
20093 11111 22222<- 33333 44444<-
20094 11111<- 22222 33333<- 44444
20095 11111 22222<- 33333 44444<-
20096 11111<- 22222 33333<- 44444
20097
20098 Output:
20099 22222 44444
20100 11111 33333
20101 22222 44444
20102 11111 33333
20103
20104 interlacex2, 6
20105 Double frame rate with unchanged height. Frames are inserted
20106 each containing the second temporal field from the previous
20107 input frame and the first temporal field from the next input
20108 frame. This mode relies on the top_field_first flag. Useful for
20109 interlaced video displays with no field synchronisation.
20110
20111 ------> time
20112 Input:
20113 Frame 1 Frame 2 Frame 3 Frame 4
20114
20115 11111 22222 33333 44444
20116 11111 22222 33333 44444
20117 11111 22222 33333 44444
20118 11111 22222 33333 44444
20119
20120 Output:
20121 11111 22222 22222 33333 33333 44444 44444
20122 11111 11111 22222 22222 33333 33333 44444
20123 11111 22222 22222 33333 33333 44444 44444
20124 11111 11111 22222 22222 33333 33333 44444
20125
20126 mergex2, 7
20127 Move odd frames into the upper field, even into the lower
20128 field, generating a double height frame at same frame rate.
20129
20130 ------> time
20131 Input:
20132 Frame 1 Frame 2 Frame 3 Frame 4
20133
20134 11111 22222 33333 44444
20135 11111 22222 33333 44444
20136 11111 22222 33333 44444
20137 11111 22222 33333 44444
20138
20139 Output:
20140 11111 33333 33333 55555
20141 22222 22222 44444 44444
20142 11111 33333 33333 55555
20143 22222 22222 44444 44444
20144 11111 33333 33333 55555
20145 22222 22222 44444 44444
20146 11111 33333 33333 55555
20147 22222 22222 44444 44444
20148
20149 Numeric values are deprecated but are accepted for backward
20150 compatibility reasons.
20151
20152 Default mode is "merge".
20153
20154 flags
20155 Specify flags influencing the filter process.
20156
20157 Available value for flags is:
20158
20159 low_pass_filter, vlpf
20160 Enable linear vertical low-pass filtering in the filter.
20161 Vertical low-pass filtering is required when creating an
20162 interlaced destination from a progressive source which contains
20163 high-frequency vertical detail. Filtering will reduce interlace
20164 'twitter' and Moire patterning.
20165
20166 complex_filter, cvlpf
20167 Enable complex vertical low-pass filtering. This will slightly
20168 less reduce interlace 'twitter' and Moire patterning but better
20169 retain detail and subjective sharpness impression.
20170
20171 bypass_il
20172 Bypass already interlaced frames, only adjust the frame rate.
20173
20174 Vertical low-pass filtering and bypassing already interlaced frames
20175 can only be enabled for mode interleave_top and interleave_bottom.
20176
20177 tmedian
20178 Pick median pixels from several successive input video frames.
20179
20180 The filter accepts the following options:
20181
20182 radius
20183 Set radius of median filter. Default is 1. Allowed range is from 1
20184 to 127.
20185
20186 planes
20187 Set which planes to filter. Default value is 15, by which all
20188 planes are processed.
20189
20190 percentile
20191 Set median percentile. Default value is 0.5. Default value of 0.5
20192 will pick always median values, while 0 will pick minimum values,
20193 and 1 maximum values.
20194
20195 Commands
20196
20197 This filter supports all above options as commands, excluding option
20198 "radius".
20199
20200 tmidequalizer
20201 Apply Temporal Midway Video Equalization effect.
20202
20203 Midway Video Equalization adjusts a sequence of video frames to have
20204 the same histograms, while maintaining their dynamics as much as
20205 possible. It's useful for e.g. matching exposures from a video frames
20206 sequence.
20207
20208 This filter accepts the following option:
20209
20210 radius
20211 Set filtering radius. Default is 5. Allowed range is from 1 to 127.
20212
20213 sigma
20214 Set filtering sigma. Default is 0.5. This controls strength of
20215 filtering. Setting this option to 0 effectively does nothing.
20216
20217 planes
20218 Set which planes to process. Default is 15, which is all available
20219 planes.
20220
20221 tmix
20222 Mix successive video frames.
20223
20224 A description of the accepted options follows.
20225
20226 frames
20227 The number of successive frames to mix. If unspecified, it defaults
20228 to 3.
20229
20230 weights
20231 Specify weight of each input video frame. Each weight is separated
20232 by space. If number of weights is smaller than number of frames
20233 last specified weight will be used for all remaining unset weights.
20234
20235 scale
20236 Specify scale, if it is set it will be multiplied with sum of each
20237 weight multiplied with pixel values to give final destination pixel
20238 value. By default scale is auto scaled to sum of weights.
20239
20240 planes
20241 Set which planes to filter. Default is all. Allowed range is from 0
20242 to 15.
20243
20244 Examples
20245
20246 • Average 7 successive frames:
20247
20248 tmix=frames=7:weights="1 1 1 1 1 1 1"
20249
20250 • Apply simple temporal convolution:
20251
20252 tmix=frames=3:weights="-1 3 -1"
20253
20254 • Similar as above but only showing temporal differences:
20255
20256 tmix=frames=3:weights="-1 2 -1":scale=1
20257
20258 Commands
20259
20260 This filter supports the following commands:
20261
20262 weights
20263 scale
20264 planes
20265 Syntax is same as option with same name.
20266
20267 tonemap
20268 Tone map colors from different dynamic ranges.
20269
20270 This filter expects data in single precision floating point, as it
20271 needs to operate on (and can output) out-of-range values. Another
20272 filter, such as zscale, is needed to convert the resulting frame to a
20273 usable format.
20274
20275 The tonemapping algorithms implemented only work on linear light, so
20276 input data should be linearized beforehand (and possibly correctly
20277 tagged).
20278
20279 ffmpeg -i INPUT -vf zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p OUTPUT
20280
20281 Options
20282
20283 The filter accepts the following options.
20284
20285 tonemap
20286 Set the tone map algorithm to use.
20287
20288 Possible values are:
20289
20290 none
20291 Do not apply any tone map, only desaturate overbright pixels.
20292
20293 clip
20294 Hard-clip any out-of-range values. Use it for perfect color
20295 accuracy for in-range values, while distorting out-of-range
20296 values.
20297
20298 linear
20299 Stretch the entire reference gamut to a linear multiple of the
20300 display.
20301
20302 gamma
20303 Fit a logarithmic transfer between the tone curves.
20304
20305 reinhard
20306 Preserve overall image brightness with a simple curve, using
20307 nonlinear contrast, which results in flattening details and
20308 degrading color accuracy.
20309
20310 hable
20311 Preserve both dark and bright details better than reinhard, at
20312 the cost of slightly darkening everything. Use it when detail
20313 preservation is more important than color and brightness
20314 accuracy.
20315
20316 mobius
20317 Smoothly map out-of-range values, while retaining contrast and
20318 colors for in-range material as much as possible. Use it when
20319 color accuracy is more important than detail preservation.
20320
20321 Default is none.
20322
20323 param
20324 Tune the tone mapping algorithm.
20325
20326 This affects the following algorithms:
20327
20328 none
20329 Ignored.
20330
20331 linear
20332 Specifies the scale factor to use while stretching. Default to
20333 1.0.
20334
20335 gamma
20336 Specifies the exponent of the function. Default to 1.8.
20337
20338 clip
20339 Specify an extra linear coefficient to multiply into the signal
20340 before clipping. Default to 1.0.
20341
20342 reinhard
20343 Specify the local contrast coefficient at the display peak.
20344 Default to 0.5, which means that in-gamut values will be about
20345 half as bright as when clipping.
20346
20347 hable
20348 Ignored.
20349
20350 mobius
20351 Specify the transition point from linear to mobius transform.
20352 Every value below this point is guaranteed to be mapped 1:1.
20353 The higher the value, the more accurate the result will be, at
20354 the cost of losing bright details. Default to 0.3, which due
20355 to the steep initial slope still preserves in-range colors
20356 fairly accurately.
20357
20358 desat
20359 Apply desaturation for highlights that exceed this level of
20360 brightness. The higher the parameter, the more color information
20361 will be preserved. This setting helps prevent unnaturally blown-out
20362 colors for super-highlights, by (smoothly) turning into white
20363 instead. This makes images feel more natural, at the cost of
20364 reducing information about out-of-range colors.
20365
20366 The default of 2.0 is somewhat conservative and will mostly just
20367 apply to skies or directly sunlit surfaces. A setting of 0.0
20368 disables this option.
20369
20370 This option works only if the input frame has a supported color
20371 tag.
20372
20373 peak
20374 Override signal/nominal/reference peak with this value. Useful when
20375 the embedded peak information in display metadata is not reliable
20376 or when tone mapping from a lower range to a higher range.
20377
20378 tpad
20379 Temporarily pad video frames.
20380
20381 The filter accepts the following options:
20382
20383 start
20384 Specify number of delay frames before input video stream. Default
20385 is 0.
20386
20387 stop
20388 Specify number of padding frames after input video stream. Set to
20389 -1 to pad indefinitely. Default is 0.
20390
20391 start_mode
20392 Set kind of frames added to beginning of stream. Can be either add
20393 or clone. With add frames of solid-color are added. With clone
20394 frames are clones of first frame. Default is add.
20395
20396 stop_mode
20397 Set kind of frames added to end of stream. Can be either add or
20398 clone. With add frames of solid-color are added. With clone
20399 frames are clones of last frame. Default is add.
20400
20401 start_duration, stop_duration
20402 Specify the duration of the start/stop delay. See the Time duration
20403 section in the ffmpeg-utils(1) manual for the accepted syntax.
20404 These options override start and stop. Default is 0.
20405
20406 color
20407 Specify the color of the padded area. For the syntax of this
20408 option, check the "Color" section in the ffmpeg-utils manual.
20409
20410 The default value of color is "black".
20411
20412 transpose
20413 Transpose rows with columns in the input video and optionally flip it.
20414
20415 It accepts the following parameters:
20416
20417 dir Specify the transposition direction.
20418
20419 Can assume the following values:
20420
20421 0, 4, cclock_flip
20422 Rotate by 90 degrees counterclockwise and vertically flip
20423 (default), that is:
20424
20425 L.R L.l
20426 . . -> . .
20427 l.r R.r
20428
20429 1, 5, clock
20430 Rotate by 90 degrees clockwise, that is:
20431
20432 L.R l.L
20433 . . -> . .
20434 l.r r.R
20435
20436 2, 6, cclock
20437 Rotate by 90 degrees counterclockwise, that is:
20438
20439 L.R R.r
20440 . . -> . .
20441 l.r L.l
20442
20443 3, 7, clock_flip
20444 Rotate by 90 degrees clockwise and vertically flip, that is:
20445
20446 L.R r.R
20447 . . -> . .
20448 l.r l.L
20449
20450 For values between 4-7, the transposition is only done if the input
20451 video geometry is portrait and not landscape. These values are
20452 deprecated, the "passthrough" option should be used instead.
20453
20454 Numerical values are deprecated, and should be dropped in favor of
20455 symbolic constants.
20456
20457 passthrough
20458 Do not apply the transposition if the input geometry matches the
20459 one specified by the specified value. It accepts the following
20460 values:
20461
20462 none
20463 Always apply transposition.
20464
20465 portrait
20466 Preserve portrait geometry (when height >= width).
20467
20468 landscape
20469 Preserve landscape geometry (when width >= height).
20470
20471 Default value is "none".
20472
20473 For example to rotate by 90 degrees clockwise and preserve portrait
20474 layout:
20475
20476 transpose=dir=1:passthrough=portrait
20477
20478 The command above can also be specified as:
20479
20480 transpose=1:portrait
20481
20482 transpose_npp
20483 Transpose rows with columns in the input video and optionally flip it.
20484 For more in depth examples see the transpose video filter, which shares
20485 mostly the same options.
20486
20487 It accepts the following parameters:
20488
20489 dir Specify the transposition direction.
20490
20491 Can assume the following values:
20492
20493 cclock_flip
20494 Rotate by 90 degrees counterclockwise and vertically flip.
20495 (default)
20496
20497 clock
20498 Rotate by 90 degrees clockwise.
20499
20500 cclock
20501 Rotate by 90 degrees counterclockwise.
20502
20503 clock_flip
20504 Rotate by 90 degrees clockwise and vertically flip.
20505
20506 passthrough
20507 Do not apply the transposition if the input geometry matches the
20508 one specified by the specified value. It accepts the following
20509 values:
20510
20511 none
20512 Always apply transposition. (default)
20513
20514 portrait
20515 Preserve portrait geometry (when height >= width).
20516
20517 landscape
20518 Preserve landscape geometry (when width >= height).
20519
20520 trim
20521 Trim the input so that the output contains one continuous subpart of
20522 the input.
20523
20524 It accepts the following parameters:
20525
20526 start
20527 Specify the time of the start of the kept section, i.e. the frame
20528 with the timestamp start will be the first frame in the output.
20529
20530 end Specify the time of the first frame that will be dropped, i.e. the
20531 frame immediately preceding the one with the timestamp end will be
20532 the last frame in the output.
20533
20534 start_pts
20535 This is the same as start, except this option sets the start
20536 timestamp in timebase units instead of seconds.
20537
20538 end_pts
20539 This is the same as end, except this option sets the end timestamp
20540 in timebase units instead of seconds.
20541
20542 duration
20543 The maximum duration of the output in seconds.
20544
20545 start_frame
20546 The number of the first frame that should be passed to the output.
20547
20548 end_frame
20549 The number of the first frame that should be dropped.
20550
20551 start, end, and duration are expressed as time duration specifications;
20552 see the Time duration section in the ffmpeg-utils(1) manual for the
20553 accepted syntax.
20554
20555 Note that the first two sets of the start/end options and the duration
20556 option look at the frame timestamp, while the _frame variants simply
20557 count the frames that pass through the filter. Also note that this
20558 filter does not modify the timestamps. If you wish for the output
20559 timestamps to start at zero, insert a setpts filter after the trim
20560 filter.
20561
20562 If multiple start or end options are set, this filter tries to be
20563 greedy and keep all the frames that match at least one of the specified
20564 constraints. To keep only the part that matches all the constraints at
20565 once, chain multiple trim filters.
20566
20567 The defaults are such that all the input is kept. So it is possible to
20568 set e.g. just the end values to keep everything before the specified
20569 time.
20570
20571 Examples:
20572
20573 • Drop everything except the second minute of input:
20574
20575 ffmpeg -i INPUT -vf trim=60:120
20576
20577 • Keep only the first second:
20578
20579 ffmpeg -i INPUT -vf trim=duration=1
20580
20581 unpremultiply
20582 Apply alpha unpremultiply effect to input video stream using first
20583 plane of second stream as alpha.
20584
20585 Both streams must have same dimensions and same pixel format.
20586
20587 The filter accepts the following option:
20588
20589 planes
20590 Set which planes will be processed, unprocessed planes will be
20591 copied. By default value 0xf, all planes will be processed.
20592
20593 If the format has 1 or 2 components, then luma is bit 0. If the
20594 format has 3 or 4 components: for RGB formats bit 0 is green, bit 1
20595 is blue and bit 2 is red; for YUV formats bit 0 is luma, bit 1 is
20596 chroma-U and bit 2 is chroma-V. If present, the alpha channel is
20597 always the last bit.
20598
20599 inplace
20600 Do not require 2nd input for processing, instead use alpha plane
20601 from input stream.
20602
20603 unsharp
20604 Sharpen or blur the input video.
20605
20606 It accepts the following parameters:
20607
20608 luma_msize_x, lx
20609 Set the luma matrix horizontal size. It must be an odd integer
20610 between 3 and 23. The default value is 5.
20611
20612 luma_msize_y, ly
20613 Set the luma matrix vertical size. It must be an odd integer
20614 between 3 and 23. The default value is 5.
20615
20616 luma_amount, la
20617 Set the luma effect strength. It must be a floating point number,
20618 reasonable values lay between -1.5 and 1.5.
20619
20620 Negative values will blur the input video, while positive values
20621 will sharpen it, a value of zero will disable the effect.
20622
20623 Default value is 1.0.
20624
20625 chroma_msize_x, cx
20626 Set the chroma matrix horizontal size. It must be an odd integer
20627 between 3 and 23. The default value is 5.
20628
20629 chroma_msize_y, cy
20630 Set the chroma matrix vertical size. It must be an odd integer
20631 between 3 and 23. The default value is 5.
20632
20633 chroma_amount, ca
20634 Set the chroma effect strength. It must be a floating point number,
20635 reasonable values lay between -1.5 and 1.5.
20636
20637 Negative values will blur the input video, while positive values
20638 will sharpen it, a value of zero will disable the effect.
20639
20640 Default value is 0.0.
20641
20642 alpha_msize_x, ax
20643 Set the alpha matrix horizontal size. It must be an odd integer
20644 between 3 and 23. The default value is 5.
20645
20646 alpha_msize_y, ay
20647 Set the alpha matrix vertical size. It must be an odd integer
20648 between 3 and 23. The default value is 5.
20649
20650 alpha_amount, aa
20651 Set the alpha effect strength. It must be a floating point number,
20652 reasonable values lay between -1.5 and 1.5.
20653
20654 Negative values will blur the input video, while positive values
20655 will sharpen it, a value of zero will disable the effect.
20656
20657 Default value is 0.0.
20658
20659 All parameters are optional and default to the equivalent of the string
20660 '5:5:1.0:5:5:0.0'.
20661
20662 Examples
20663
20664 • Apply strong luma sharpen effect:
20665
20666 unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
20667
20668 • Apply a strong blur of both luma and chroma parameters:
20669
20670 unsharp=7:7:-2:7:7:-2
20671
20672 untile
20673 Decompose a video made of tiled images into the individual images.
20674
20675 The frame rate of the output video is the frame rate of the input video
20676 multiplied by the number of tiles.
20677
20678 This filter does the reverse of tile.
20679
20680 The filter accepts the following options:
20681
20682 layout
20683 Set the grid size (i.e. the number of lines and columns). For the
20684 syntax of this option, check the "Video size" section in the
20685 ffmpeg-utils manual.
20686
20687 Examples
20688
20689 • Produce a 1-second video from a still image file made of 25 frames
20690 stacked vertically, like an analogic film reel:
20691
20692 ffmpeg -r 1 -i image.jpg -vf untile=1x25 movie.mkv
20693
20694 uspp
20695 Apply ultra slow/simple postprocessing filter that compresses and
20696 decompresses the image at several (or - in the case of quality level 8
20697 - all) shifts and average the results.
20698
20699 The way this differs from the behavior of spp is that uspp actually
20700 encodes & decodes each case with libavcodec Snow, whereas spp uses a
20701 simplified intra only 8x8 DCT similar to MJPEG.
20702
20703 This filter is only available in ffmpeg version 4.4 or earlier.
20704
20705 The filter accepts the following options:
20706
20707 quality
20708 Set quality. This option defines the number of levels for
20709 averaging. It accepts an integer in the range 0-8. If set to 0, the
20710 filter will have no effect. A value of 8 means the higher quality.
20711 For each increment of that value the speed drops by a factor of
20712 approximately 2. Default value is 3.
20713
20714 qp Force a constant quantization parameter. If not set, the filter
20715 will use the QP from the video stream (if available).
20716
20717 v360
20718 Convert 360 videos between various formats.
20719
20720 The filter accepts the following options:
20721
20722 input
20723 output
20724 Set format of the input/output video.
20725
20726 Available formats:
20727
20728 e
20729 equirect
20730 Equirectangular projection.
20731
20732 c3x2
20733 c6x1
20734 c1x6
20735 Cubemap with 3x2/6x1/1x6 layout.
20736
20737 Format specific options:
20738
20739 in_pad
20740 out_pad
20741 Set padding proportion for the input/output cubemap. Values
20742 in decimals.
20743
20744 Example values:
20745
20746 0 No padding.
20747
20748 0.01
20749 1% of face is padding. For example, with 1920x1280
20750 resolution face size would be 640x640 and padding would
20751 be 3 pixels from each side. (640 * 0.01 = 6 pixels)
20752
20753 Default value is @samp{0}. Maximum value is @samp{0.1}.
20754
20755 fin_pad
20756 fout_pad
20757 Set fixed padding for the input/output cubemap. Values in
20758 pixels.
20759
20760 Default value is @samp{0}. If greater than zero it
20761 overrides other padding options.
20762
20763 in_forder
20764 out_forder
20765 Set order of faces for the input/output cubemap. Choose one
20766 direction for each position.
20767
20768 Designation of directions:
20769
20770 r right
20771
20772 l left
20773
20774 u up
20775
20776 d down
20777
20778 f forward
20779
20780 b back
20781
20782 Default value is @samp{rludfb}.
20783
20784 in_frot
20785 out_frot
20786 Set rotation of faces for the input/output cubemap. Choose
20787 one angle for each position.
20788
20789 Designation of angles:
20790
20791 0 0 degrees clockwise
20792
20793 1 90 degrees clockwise
20794
20795 2 180 degrees clockwise
20796
20797 3 270 degrees clockwise
20798
20799 Default value is @samp{000000}.
20800
20801 eac Equi-Angular Cubemap.
20802
20803 flat
20804 gnomonic
20805 rectilinear
20806 Regular video.
20807
20808 Format specific options:
20809
20810 h_fov
20811 v_fov
20812 d_fov
20813 Set output horizontal/vertical/diagonal field of view.
20814 Values in degrees.
20815
20816 If diagonal field of view is set it overrides horizontal
20817 and vertical field of view.
20818
20819 ih_fov
20820 iv_fov
20821 id_fov
20822 Set input horizontal/vertical/diagonal field of view.
20823 Values in degrees.
20824
20825 If diagonal field of view is set it overrides horizontal
20826 and vertical field of view.
20827
20828 dfisheye
20829 Dual fisheye.
20830
20831 Format specific options:
20832
20833 h_fov
20834 v_fov
20835 d_fov
20836 Set output horizontal/vertical/diagonal field of view.
20837 Values in degrees.
20838
20839 If diagonal field of view is set it overrides horizontal
20840 and vertical field of view.
20841
20842 ih_fov
20843 iv_fov
20844 id_fov
20845 Set input horizontal/vertical/diagonal field of view.
20846 Values in degrees.
20847
20848 If diagonal field of view is set it overrides horizontal
20849 and vertical field of view.
20850
20851 barrel
20852 fb
20853 barrelsplit
20854 Facebook's 360 formats.
20855
20856 sg Stereographic format.
20857
20858 Format specific options:
20859
20860 h_fov
20861 v_fov
20862 d_fov
20863 Set output horizontal/vertical/diagonal field of view.
20864 Values in degrees.
20865
20866 If diagonal field of view is set it overrides horizontal
20867 and vertical field of view.
20868
20869 ih_fov
20870 iv_fov
20871 id_fov
20872 Set input horizontal/vertical/diagonal field of view.
20873 Values in degrees.
20874
20875 If diagonal field of view is set it overrides horizontal
20876 and vertical field of view.
20877
20878 mercator
20879 Mercator format.
20880
20881 ball
20882 Ball format, gives significant distortion toward the back.
20883
20884 hammer
20885 Hammer-Aitoff map projection format.
20886
20887 sinusoidal
20888 Sinusoidal map projection format.
20889
20890 fisheye
20891 Fisheye projection.
20892
20893 Format specific options:
20894
20895 h_fov
20896 v_fov
20897 d_fov
20898 Set output horizontal/vertical/diagonal field of view.
20899 Values in degrees.
20900
20901 If diagonal field of view is set it overrides horizontal
20902 and vertical field of view.
20903
20904 ih_fov
20905 iv_fov
20906 id_fov
20907 Set input horizontal/vertical/diagonal field of view.
20908 Values in degrees.
20909
20910 If diagonal field of view is set it overrides horizontal
20911 and vertical field of view.
20912
20913 pannini
20914 Pannini projection.
20915
20916 Format specific options:
20917
20918 h_fov
20919 Set output pannini parameter.
20920
20921 ih_fov
20922 Set input pannini parameter.
20923
20924 cylindrical
20925 Cylindrical projection.
20926
20927 Format specific options:
20928
20929 h_fov
20930 v_fov
20931 d_fov
20932 Set output horizontal/vertical/diagonal field of view.
20933 Values in degrees.
20934
20935 If diagonal field of view is set it overrides horizontal
20936 and vertical field of view.
20937
20938 ih_fov
20939 iv_fov
20940 id_fov
20941 Set input horizontal/vertical/diagonal field of view.
20942 Values in degrees.
20943
20944 If diagonal field of view is set it overrides horizontal
20945 and vertical field of view.
20946
20947 perspective
20948 Perspective projection. (output only)
20949
20950 Format specific options:
20951
20952 v_fov
20953 Set perspective parameter.
20954
20955 tetrahedron
20956 Tetrahedron projection.
20957
20958 tsp Truncated square pyramid projection.
20959
20960 he
20961 hequirect
20962 Half equirectangular projection.
20963
20964 equisolid
20965 Equisolid format.
20966
20967 Format specific options:
20968
20969 h_fov
20970 v_fov
20971 d_fov
20972 Set output horizontal/vertical/diagonal field of view.
20973 Values in degrees.
20974
20975 If diagonal field of view is set it overrides horizontal
20976 and vertical field of view.
20977
20978 ih_fov
20979 iv_fov
20980 id_fov
20981 Set input horizontal/vertical/diagonal field of view.
20982 Values in degrees.
20983
20984 If diagonal field of view is set it overrides horizontal
20985 and vertical field of view.
20986
20987 og Orthographic format.
20988
20989 Format specific options:
20990
20991 h_fov
20992 v_fov
20993 d_fov
20994 Set output horizontal/vertical/diagonal field of view.
20995 Values in degrees.
20996
20997 If diagonal field of view is set it overrides horizontal
20998 and vertical field of view.
20999
21000 ih_fov
21001 iv_fov
21002 id_fov
21003 Set input horizontal/vertical/diagonal field of view.
21004 Values in degrees.
21005
21006 If diagonal field of view is set it overrides horizontal
21007 and vertical field of view.
21008
21009 octahedron
21010 Octahedron projection.
21011
21012 cylindricalea
21013 Cylindrical Equal Area projection.
21014
21015 interp
21016 Set interpolation method.Note: more complex interpolation methods
21017 require much more memory to run.
21018
21019 Available methods:
21020
21021 near
21022 nearest
21023 Nearest neighbour.
21024
21025 line
21026 linear
21027 Bilinear interpolation.
21028
21029 lagrange9
21030 Lagrange9 interpolation.
21031
21032 cube
21033 cubic
21034 Bicubic interpolation.
21035
21036 lanc
21037 lanczos
21038 Lanczos interpolation.
21039
21040 sp16
21041 spline16
21042 Spline16 interpolation.
21043
21044 gauss
21045 gaussian
21046 Gaussian interpolation.
21047
21048 mitchell
21049 Mitchell interpolation.
21050
21051 Default value is @samp{line}.
21052
21053 w
21054 h Set the output video resolution.
21055
21056 Default resolution depends on formats.
21057
21058 in_stereo
21059 out_stereo
21060 Set the input/output stereo format.
21061
21062 2d 2D mono
21063
21064 sbs Side by side
21065
21066 tb Top bottom
21067
21068 Default value is @samp{2d} for input and output format.
21069
21070 yaw
21071 pitch
21072 roll
21073 Set rotation for the output video. Values in degrees.
21074
21075 rorder
21076 Set rotation order for the output video. Choose one item for each
21077 position.
21078
21079 y, Y
21080 yaw
21081
21082 p, P
21083 pitch
21084
21085 r, R
21086 roll
21087
21088 Default value is @samp{ypr}.
21089
21090 h_flip
21091 v_flip
21092 d_flip
21093 Flip the output video horizontally(swaps
21094 left-right)/vertically(swaps up-down)/in-depth(swaps back-forward).
21095 Boolean values.
21096
21097 ih_flip
21098 iv_flip
21099 Set if input video is flipped horizontally/vertically. Boolean
21100 values.
21101
21102 in_trans
21103 Set if input video is transposed. Boolean value, by default
21104 disabled.
21105
21106 out_trans
21107 Set if output video needs to be transposed. Boolean value, by
21108 default disabled.
21109
21110 h_offset
21111 v_offset
21112 Set output horizontal/vertical off-axis offset. Default is set to
21113 0. Allowed range is from -1 to 1.
21114
21115 alpha_mask
21116 Build mask in alpha plane for all unmapped pixels by marking them
21117 fully transparent. Boolean value, by default disabled.
21118
21119 reset_rot
21120 Reset rotation of output video. Boolean value, by default disabled.
21121
21122 Examples
21123
21124 • Convert equirectangular video to cubemap with 3x2 layout and 1%
21125 padding using bicubic interpolation:
21126
21127 ffmpeg -i input.mkv -vf v360=e:c3x2:cubic:out_pad=0.01 output.mkv
21128
21129 • Extract back view of Equi-Angular Cubemap:
21130
21131 ffmpeg -i input.mkv -vf v360=eac:flat:yaw=180 output.mkv
21132
21133 • Convert transposed and horizontally flipped Equi-Angular Cubemap in
21134 side-by-side stereo format to equirectangular top-bottom stereo
21135 format:
21136
21137 v360=eac:equirect:in_stereo=sbs:in_trans=1:ih_flip=1:out_stereo=tb
21138
21139 Commands
21140
21141 This filter supports subset of above options as commands.
21142
21143 vaguedenoiser
21144 Apply a wavelet based denoiser.
21145
21146 It transforms each frame from the video input into the wavelet domain,
21147 using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to
21148 the obtained coefficients. It does an inverse wavelet transform after.
21149 Due to wavelet properties, it should give a nice smoothed result, and
21150 reduced noise, without blurring picture features.
21151
21152 This filter accepts the following options:
21153
21154 threshold
21155 The filtering strength. The higher, the more filtered the video
21156 will be. Hard thresholding can use a higher threshold than soft
21157 thresholding before the video looks overfiltered. Default value is
21158 2.
21159
21160 method
21161 The filtering method the filter will use.
21162
21163 It accepts the following values:
21164
21165 hard
21166 All values under the threshold will be zeroed.
21167
21168 soft
21169 All values under the threshold will be zeroed. All values above
21170 will be reduced by the threshold.
21171
21172 garrote
21173 Scales or nullifies coefficients - intermediary between (more)
21174 soft and (less) hard thresholding.
21175
21176 Default is garrote.
21177
21178 nsteps
21179 Number of times, the wavelet will decompose the picture. Picture
21180 can't be decomposed beyond a particular point (typically, 8 for a
21181 640x480 frame - as 2^9 = 512 > 480). Valid values are integers
21182 between 1 and 32. Default value is 6.
21183
21184 percent
21185 Partial of full denoising (limited coefficients shrinking), from 0
21186 to 100. Default value is 85.
21187
21188 planes
21189 A list of the planes to process. By default all planes are
21190 processed.
21191
21192 type
21193 The threshold type the filter will use.
21194
21195 It accepts the following values:
21196
21197 universal
21198 Threshold used is same for all decompositions.
21199
21200 bayes
21201 Threshold used depends also on each decomposition coefficients.
21202
21203 Default is universal.
21204
21205 varblur
21206 Apply variable blur filter by using 2nd video stream to set blur
21207 radius. The 2nd stream must have the same dimensions.
21208
21209 This filter accepts the following options:
21210
21211 min_r
21212 Set min allowed radius. Allowed range is from 0 to 254. Default is
21213 0.
21214
21215 max_r
21216 Set max allowed radius. Allowed range is from 1 to 255. Default is
21217 8.
21218
21219 planes
21220 Set which planes to process. By default, all are used.
21221
21222 The "varblur" filter also supports the framesync options.
21223
21224 Commands
21225
21226 This filter supports all the above options as commands.
21227
21228 vectorscope
21229 Display 2 color component values in the two dimensional graph (which is
21230 called a vectorscope).
21231
21232 This filter accepts the following options:
21233
21234 mode, m
21235 Set vectorscope mode.
21236
21237 It accepts the following values:
21238
21239 gray
21240 tint
21241 Gray values are displayed on graph, higher brightness means
21242 more pixels have same component color value on location in
21243 graph. This is the default mode.
21244
21245 color
21246 Gray values are displayed on graph. Surrounding pixels values
21247 which are not present in video frame are drawn in gradient of 2
21248 color components which are set by option "x" and "y". The 3rd
21249 color component is static.
21250
21251 color2
21252 Actual color components values present in video frame are
21253 displayed on graph.
21254
21255 color3
21256 Similar as color2 but higher frequency of same values "x" and
21257 "y" on graph increases value of another color component, which
21258 is luminance by default values of "x" and "y".
21259
21260 color4
21261 Actual colors present in video frame are displayed on graph. If
21262 two different colors map to same position on graph then color
21263 with higher value of component not present in graph is picked.
21264
21265 color5
21266 Gray values are displayed on graph. Similar to "color" but with
21267 3rd color component picked from radial gradient.
21268
21269 x Set which color component will be represented on X-axis. Default is
21270 1.
21271
21272 y Set which color component will be represented on Y-axis. Default is
21273 2.
21274
21275 intensity, i
21276 Set intensity, used by modes: gray, color, color3 and color5 for
21277 increasing brightness of color component which represents frequency
21278 of (X, Y) location in graph.
21279
21280 envelope, e
21281 none
21282 No envelope, this is default.
21283
21284 instant
21285 Instant envelope, even darkest single pixel will be clearly
21286 highlighted.
21287
21288 peak
21289 Hold maximum and minimum values presented in graph over time.
21290 This way you can still spot out of range values without
21291 constantly looking at vectorscope.
21292
21293 peak+instant
21294 Peak and instant envelope combined together.
21295
21296 graticule, g
21297 Set what kind of graticule to draw.
21298
21299 none
21300 green
21301 color
21302 invert
21303 opacity, o
21304 Set graticule opacity.
21305
21306 flags, f
21307 Set graticule flags.
21308
21309 white
21310 Draw graticule for white point.
21311
21312 black
21313 Draw graticule for black point.
21314
21315 name
21316 Draw color points short names.
21317
21318 bgopacity, b
21319 Set background opacity.
21320
21321 lthreshold, l
21322 Set low threshold for color component not represented on X or Y
21323 axis. Values lower than this value will be ignored. Default is 0.
21324 Note this value is multiplied with actual max possible value one
21325 pixel component can have. So for 8-bit input and low threshold
21326 value of 0.1 actual threshold is 0.1 * 255 = 25.
21327
21328 hthreshold, h
21329 Set high threshold for color component not represented on X or Y
21330 axis. Values higher than this value will be ignored. Default is 1.
21331 Note this value is multiplied with actual max possible value one
21332 pixel component can have. So for 8-bit input and high threshold
21333 value of 0.9 actual threshold is 0.9 * 255 = 230.
21334
21335 colorspace, c
21336 Set what kind of colorspace to use when drawing graticule.
21337
21338 auto
21339 601
21340 709
21341
21342 Default is auto.
21343
21344 tint0, t0
21345 tint1, t1
21346 Set color tint for gray/tint vectorscope mode. By default both
21347 options are zero. This means no tint, and output will remain gray.
21348
21349 vidstabdetect
21350 Analyze video stabilization/deshaking. Perform pass 1 of 2, see
21351 vidstabtransform for pass 2.
21352
21353 This filter generates a file with relative translation and rotation
21354 transform information about subsequent frames, which is then used by
21355 the vidstabtransform filter.
21356
21357 To enable compilation of this filter you need to configure FFmpeg with
21358 "--enable-libvidstab".
21359
21360 This filter accepts the following options:
21361
21362 result
21363 Set the path to the file used to write the transforms information.
21364 Default value is transforms.trf.
21365
21366 shakiness
21367 Set how shaky the video is and how quick the camera is. It accepts
21368 an integer in the range 1-10, a value of 1 means little shakiness,
21369 a value of 10 means strong shakiness. Default value is 5.
21370
21371 accuracy
21372 Set the accuracy of the detection process. It must be a value in
21373 the range 1-15. A value of 1 means low accuracy, a value of 15
21374 means high accuracy. Default value is 15.
21375
21376 stepsize
21377 Set stepsize of the search process. The region around minimum is
21378 scanned with 1 pixel resolution. Default value is 6.
21379
21380 mincontrast
21381 Set minimum contrast. Below this value a local measurement field is
21382 discarded. Must be a floating point value in the range 0-1. Default
21383 value is 0.3.
21384
21385 tripod
21386 Set reference frame number for tripod mode.
21387
21388 If enabled, the motion of the frames is compared to a reference
21389 frame in the filtered stream, identified by the specified number.
21390 The idea is to compensate all movements in a more-or-less static
21391 scene and keep the camera view absolutely still.
21392
21393 If set to 0, it is disabled. The frames are counted starting from
21394 1.
21395
21396 show
21397 Show fields and transforms in the resulting frames. It accepts an
21398 integer in the range 0-2. Default value is 0, which disables any
21399 visualization.
21400
21401 Examples
21402
21403 • Use default values:
21404
21405 vidstabdetect
21406
21407 • Analyze strongly shaky movie and put the results in file
21408 mytransforms.trf:
21409
21410 vidstabdetect=shakiness=10:accuracy=15:result="mytransforms.trf"
21411
21412 • Visualize the result of internal transformations in the resulting
21413 video:
21414
21415 vidstabdetect=show=1
21416
21417 • Analyze a video with medium shakiness using ffmpeg:
21418
21419 ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
21420
21421 vidstabtransform
21422 Video stabilization/deshaking: pass 2 of 2, see vidstabdetect for pass
21423 1.
21424
21425 Read a file with transform information for each frame and
21426 apply/compensate them. Together with the vidstabdetect filter this can
21427 be used to deshake videos. See also
21428 <http://public.hronopik.de/vid.stab>. It is important to also use the
21429 unsharp filter, see below.
21430
21431 To enable compilation of this filter you need to configure FFmpeg with
21432 "--enable-libvidstab".
21433
21434 Options
21435
21436 input
21437 Set path to the file used to read the transforms. Default value is
21438 transforms.trf.
21439
21440 smoothing
21441 Set the number of frames (value*2 + 1) used for lowpass filtering
21442 the camera movements. Default value is 10.
21443
21444 For example a number of 10 means that 21 frames are used (10 in the
21445 past and 10 in the future) to smoothen the motion in the video. A
21446 larger value leads to a smoother video, but limits the acceleration
21447 of the camera (pan/tilt movements). 0 is a special case where a
21448 static camera is simulated.
21449
21450 optalgo
21451 Set the camera path optimization algorithm.
21452
21453 Accepted values are:
21454
21455 gauss
21456 gaussian kernel low-pass filter on camera motion (default)
21457
21458 avg averaging on transformations
21459
21460 maxshift
21461 Set maximal number of pixels to translate frames. Default value is
21462 -1, meaning no limit.
21463
21464 maxangle
21465 Set maximal angle in radians (degree*PI/180) to rotate frames.
21466 Default value is -1, meaning no limit.
21467
21468 crop
21469 Specify how to deal with borders that may be visible due to
21470 movement compensation.
21471
21472 Available values are:
21473
21474 keep
21475 keep image information from previous frame (default)
21476
21477 black
21478 fill the border black
21479
21480 invert
21481 Invert transforms if set to 1. Default value is 0.
21482
21483 relative
21484 Consider transforms as relative to previous frame if set to 1,
21485 absolute if set to 0. Default value is 0.
21486
21487 zoom
21488 Set percentage to zoom. A positive value will result in a zoom-in
21489 effect, a negative value in a zoom-out effect. Default value is 0
21490 (no zoom).
21491
21492 optzoom
21493 Set optimal zooming to avoid borders.
21494
21495 Accepted values are:
21496
21497 0 disabled
21498
21499 1 optimal static zoom value is determined (only very strong
21500 movements will lead to visible borders) (default)
21501
21502 2 optimal adaptive zoom value is determined (no borders will be
21503 visible), see zoomspeed
21504
21505 Note that the value given at zoom is added to the one calculated
21506 here.
21507
21508 zoomspeed
21509 Set percent to zoom maximally each frame (enabled when optzoom is
21510 set to 2). Range is from 0 to 5, default value is 0.25.
21511
21512 interpol
21513 Specify type of interpolation.
21514
21515 Available values are:
21516
21517 no no interpolation
21518
21519 linear
21520 linear only horizontal
21521
21522 bilinear
21523 linear in both directions (default)
21524
21525 bicubic
21526 cubic in both directions (slow)
21527
21528 tripod
21529 Enable virtual tripod mode if set to 1, which is equivalent to
21530 "relative=0:smoothing=0". Default value is 0.
21531
21532 Use also "tripod" option of vidstabdetect.
21533
21534 debug
21535 Increase log verbosity if set to 1. Also the detected global
21536 motions are written to the temporary file global_motions.trf.
21537 Default value is 0.
21538
21539 Examples
21540
21541 • Use ffmpeg for a typical stabilization with default values:
21542
21543 ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
21544
21545 Note the use of the unsharp filter which is always recommended.
21546
21547 • Zoom in a bit more and load transform data from a given file:
21548
21549 vidstabtransform=zoom=5:input="mytransforms.trf"
21550
21551 • Smoothen the video even more:
21552
21553 vidstabtransform=smoothing=30
21554
21555 vflip
21556 Flip the input video vertically.
21557
21558 For example, to vertically flip a video with ffmpeg:
21559
21560 ffmpeg -i in.avi -vf "vflip" out.avi
21561
21562 vfrdet
21563 Detect variable frame rate video.
21564
21565 This filter tries to detect if the input is variable or constant frame
21566 rate.
21567
21568 At end it will output number of frames detected as having variable
21569 delta pts, and ones with constant delta pts. If there was frames with
21570 variable delta, than it will also show min, max and average delta
21571 encountered.
21572
21573 vibrance
21574 Boost or alter saturation.
21575
21576 The filter accepts the following options:
21577
21578 intensity
21579 Set strength of boost if positive value or strength of alter if
21580 negative value. Default is 0. Allowed range is from -2 to 2.
21581
21582 rbal
21583 Set the red balance. Default is 1. Allowed range is from -10 to 10.
21584
21585 gbal
21586 Set the green balance. Default is 1. Allowed range is from -10 to
21587 10.
21588
21589 bbal
21590 Set the blue balance. Default is 1. Allowed range is from -10 to
21591 10.
21592
21593 rlum
21594 Set the red luma coefficient.
21595
21596 glum
21597 Set the green luma coefficient.
21598
21599 blum
21600 Set the blue luma coefficient.
21601
21602 alternate
21603 If "intensity" is negative and this is set to 1, colors will
21604 change, otherwise colors will be less saturated, more towards gray.
21605
21606 Commands
21607
21608 This filter supports the all above options as commands.
21609
21610 vif
21611 Obtain the average VIF (Visual Information Fidelity) between two input
21612 videos.
21613
21614 This filter takes two input videos.
21615
21616 Both input videos must have the same resolution and pixel format for
21617 this filter to work correctly. Also it assumes that both inputs have
21618 the same number of frames, which are compared one by one.
21619
21620 The obtained average VIF score is printed through the logging system.
21621
21622 The filter stores the calculated VIF score of each frame.
21623
21624 This filter also supports the framesync options.
21625
21626 In the below example the input file main.mpg being processed is
21627 compared with the reference file ref.mpg.
21628
21629 ffmpeg -i main.mpg -i ref.mpg -lavfi vif -f null -
21630
21631 vignette
21632 Make or reverse a natural vignetting effect.
21633
21634 The filter accepts the following options:
21635
21636 angle, a
21637 Set lens angle expression as a number of radians.
21638
21639 The value is clipped in the "[0,PI/2]" range.
21640
21641 Default value: "PI/5"
21642
21643 x0
21644 y0 Set center coordinates expressions. Respectively "w/2" and "h/2" by
21645 default.
21646
21647 mode
21648 Set forward/backward mode.
21649
21650 Available modes are:
21651
21652 forward
21653 The larger the distance from the central point, the darker the
21654 image becomes.
21655
21656 backward
21657 The larger the distance from the central point, the brighter
21658 the image becomes. This can be used to reverse a vignette
21659 effect, though there is no automatic detection to extract the
21660 lens angle and other settings (yet). It can also be used to
21661 create a burning effect.
21662
21663 Default value is forward.
21664
21665 eval
21666 Set evaluation mode for the expressions (angle, x0, y0).
21667
21668 It accepts the following values:
21669
21670 init
21671 Evaluate expressions only once during the filter
21672 initialization.
21673
21674 frame
21675 Evaluate expressions for each incoming frame. This is way
21676 slower than the init mode since it requires all the scalers to
21677 be re-computed, but it allows advanced dynamic expressions.
21678
21679 Default value is init.
21680
21681 dither
21682 Set dithering to reduce the circular banding effects. Default is 1
21683 (enabled).
21684
21685 aspect
21686 Set vignette aspect. This setting allows one to adjust the shape of
21687 the vignette. Setting this value to the SAR of the input will make
21688 a rectangular vignetting following the dimensions of the video.
21689
21690 Default is "1/1".
21691
21692 Expressions
21693
21694 The alpha, x0 and y0 expressions can contain the following parameters.
21695
21696 w
21697 h input width and height
21698
21699 n the number of input frame, starting from 0
21700
21701 pts the PTS (Presentation TimeStamp) time of the filtered video frame,
21702 expressed in TB units, NAN if undefined
21703
21704 r frame rate of the input video, NAN if the input frame rate is
21705 unknown
21706
21707 t the PTS (Presentation TimeStamp) of the filtered video frame,
21708 expressed in seconds, NAN if undefined
21709
21710 tb time base of the input video
21711
21712 Examples
21713
21714 • Apply simple strong vignetting effect:
21715
21716 vignette=PI/4
21717
21718 • Make a flickering vignetting:
21719
21720 vignette='PI/4+random(1)*PI/50':eval=frame
21721
21722 vmafmotion
21723 Obtain the average VMAF motion score of a video. It is one of the
21724 component metrics of VMAF.
21725
21726 The obtained average motion score is printed through the logging
21727 system.
21728
21729 The filter accepts the following options:
21730
21731 stats_file
21732 If specified, the filter will use the named file to save the motion
21733 score of each frame with respect to the previous frame. When
21734 filename equals "-" the data is sent to standard output.
21735
21736 Example:
21737
21738 ffmpeg -i ref.mpg -vf vmafmotion -f null -
21739
21740 vstack
21741 Stack input videos vertically.
21742
21743 All streams must be of same pixel format and of same width.
21744
21745 Note that this filter is faster than using overlay and pad filter to
21746 create same output.
21747
21748 The filter accepts the following options:
21749
21750 inputs
21751 Set number of input streams. Default is 2.
21752
21753 shortest
21754 If set to 1, force the output to terminate when the shortest input
21755 terminates. Default value is 0.
21756
21757 w3fdif
21758 Deinterlace the input video ("w3fdif" stands for "Weston 3 Field
21759 Deinterlacing Filter").
21760
21761 Based on the process described by Martin Weston for BBC R&D, and
21762 implemented based on the de-interlace algorithm written by Jim
21763 Easterbrook for BBC R&D, the Weston 3 field deinterlacing filter uses
21764 filter coefficients calculated by BBC R&D.
21765
21766 This filter uses field-dominance information in frame to decide which
21767 of each pair of fields to place first in the output. If it gets it
21768 wrong use setfield filter before "w3fdif" filter.
21769
21770 There are two sets of filter coefficients, so called "simple" and
21771 "complex". Which set of filter coefficients is used can be set by
21772 passing an optional parameter:
21773
21774 filter
21775 Set the interlacing filter coefficients. Accepts one of the
21776 following values:
21777
21778 simple
21779 Simple filter coefficient set.
21780
21781 complex
21782 More-complex filter coefficient set.
21783
21784 Default value is complex.
21785
21786 mode
21787 The interlacing mode to adopt. It accepts one of the following
21788 values:
21789
21790 frame
21791 Output one frame for each frame.
21792
21793 field
21794 Output one frame for each field.
21795
21796 The default value is "field".
21797
21798 parity
21799 The picture field parity assumed for the input interlaced video. It
21800 accepts one of the following values:
21801
21802 tff Assume the top field is first.
21803
21804 bff Assume the bottom field is first.
21805
21806 auto
21807 Enable automatic detection of field parity.
21808
21809 The default value is "auto". If the interlacing is unknown or the
21810 decoder does not export this information, top field first will be
21811 assumed.
21812
21813 deint
21814 Specify which frames to deinterlace. Accepts one of the following
21815 values:
21816
21817 all Deinterlace all frames,
21818
21819 interlaced
21820 Only deinterlace frames marked as interlaced.
21821
21822 Default value is all.
21823
21824 Commands
21825
21826 This filter supports same commands as options.
21827
21828 waveform
21829 Video waveform monitor.
21830
21831 The waveform monitor plots color component intensity. By default
21832 luminance only. Each column of the waveform corresponds to a column of
21833 pixels in the source video.
21834
21835 It accepts the following options:
21836
21837 mode, m
21838 Can be either "row", or "column". Default is "column". In row
21839 mode, the graph on the left side represents color component value 0
21840 and the right side represents value = 255. In column mode, the top
21841 side represents color component value = 0 and bottom side
21842 represents value = 255.
21843
21844 intensity, i
21845 Set intensity. Smaller values are useful to find out how many
21846 values of the same luminance are distributed across input
21847 rows/columns. Default value is 0.04. Allowed range is [0, 1].
21848
21849 mirror, r
21850 Set mirroring mode. 0 means unmirrored, 1 means mirrored. In
21851 mirrored mode, higher values will be represented on the left side
21852 for "row" mode and at the top for "column" mode. Default is 1
21853 (mirrored).
21854
21855 display, d
21856 Set display mode. It accepts the following values:
21857
21858 overlay
21859 Presents information identical to that in the "parade", except
21860 that the graphs representing color components are superimposed
21861 directly over one another.
21862
21863 This display mode makes it easier to spot relative differences
21864 or similarities in overlapping areas of the color components
21865 that are supposed to be identical, such as neutral whites,
21866 grays, or blacks.
21867
21868 stack
21869 Display separate graph for the color components side by side in
21870 "row" mode or one below the other in "column" mode.
21871
21872 parade
21873 Display separate graph for the color components side by side in
21874 "column" mode or one below the other in "row" mode.
21875
21876 Using this display mode makes it easy to spot color casts in
21877 the highlights and shadows of an image, by comparing the
21878 contours of the top and the bottom graphs of each waveform.
21879 Since whites, grays, and blacks are characterized by exactly
21880 equal amounts of red, green, and blue, neutral areas of the
21881 picture should display three waveforms of roughly equal
21882 width/height. If not, the correction is easy to perform by
21883 making level adjustments the three waveforms.
21884
21885 Default is "stack".
21886
21887 components, c
21888 Set which color components to display. Default is 1, which means
21889 only luminance or red color component if input is in RGB
21890 colorspace. If is set for example to 7 it will display all 3 (if)
21891 available color components.
21892
21893 envelope, e
21894 none
21895 No envelope, this is default.
21896
21897 instant
21898 Instant envelope, minimum and maximum values presented in graph
21899 will be easily visible even with small "step" value.
21900
21901 peak
21902 Hold minimum and maximum values presented in graph across time.
21903 This way you can still spot out of range values without
21904 constantly looking at waveforms.
21905
21906 peak+instant
21907 Peak and instant envelope combined together.
21908
21909 filter, f
21910 lowpass
21911 No filtering, this is default.
21912
21913 flat
21914 Luma and chroma combined together.
21915
21916 aflat
21917 Similar as above, but shows difference between blue and red
21918 chroma.
21919
21920 xflat
21921 Similar as above, but use different colors.
21922
21923 yflat
21924 Similar as above, but again with different colors.
21925
21926 chroma
21927 Displays only chroma.
21928
21929 color
21930 Displays actual color value on waveform.
21931
21932 acolor
21933 Similar as above, but with luma showing frequency of chroma
21934 values.
21935
21936 graticule, g
21937 Set which graticule to display.
21938
21939 none
21940 Do not display graticule.
21941
21942 green
21943 Display green graticule showing legal broadcast ranges.
21944
21945 orange
21946 Display orange graticule showing legal broadcast ranges.
21947
21948 invert
21949 Display invert graticule showing legal broadcast ranges.
21950
21951 opacity, o
21952 Set graticule opacity.
21953
21954 flags, fl
21955 Set graticule flags.
21956
21957 numbers
21958 Draw numbers above lines. By default enabled.
21959
21960 dots
21961 Draw dots instead of lines.
21962
21963 scale, s
21964 Set scale used for displaying graticule.
21965
21966 digital
21967 millivolts
21968 ire
21969
21970 Default is digital.
21971
21972 bgopacity, b
21973 Set background opacity.
21974
21975 tint0, t0
21976 tint1, t1
21977 Set tint for output. Only used with lowpass filter and when
21978 display is not overlay and input pixel formats are not RGB.
21979
21980 fitmode, fm
21981 Set sample aspect ratio of video output frames. Can be used to
21982 configure waveform so it is not streched too much in one of
21983 directions.
21984
21985 none
21986 Set sample aspect ration to 1/1.
21987
21988 size
21989 Set sample aspect ratio to match input size of video
21990
21991 Default is none.
21992
21993 weave, doubleweave
21994 The "weave" takes a field-based video input and join each two
21995 sequential fields into single frame, producing a new double height clip
21996 with half the frame rate and half the frame count.
21997
21998 The "doubleweave" works same as "weave" but without halving frame rate
21999 and frame count.
22000
22001 It accepts the following option:
22002
22003 first_field
22004 Set first field. Available values are:
22005
22006 top, t
22007 Set the frame as top-field-first.
22008
22009 bottom, b
22010 Set the frame as bottom-field-first.
22011
22012 Examples
22013
22014 • Interlace video using select and separatefields filter:
22015
22016 separatefields,select=eq(mod(n,4),0)+eq(mod(n,4),3),weave
22017
22018 xbr
22019 Apply the xBR high-quality magnification filter which is designed for
22020 pixel art. It follows a set of edge-detection rules, see
22021 <https://forums.libretro.com/t/xbr-algorithm-tutorial/123>.
22022
22023 It accepts the following option:
22024
22025 n Set the scaling dimension: 2 for "2xBR", 3 for "3xBR" and 4 for
22026 "4xBR". Default is 3.
22027
22028 xcorrelate
22029 Apply normalized cross-correlation between first and second input video
22030 stream.
22031
22032 Second input video stream dimensions must be lower than first input
22033 video stream.
22034
22035 The filter accepts the following options:
22036
22037 planes
22038 Set which planes to process.
22039
22040 secondary
22041 Set which secondary video frames will be processed from second
22042 input video stream, can be first or all. Default is all.
22043
22044 The "xcorrelate" filter also supports the framesync options.
22045
22046 xfade
22047 Apply cross fade from one input video stream to another input video
22048 stream. The cross fade is applied for specified duration.
22049
22050 Both inputs must be constant frame-rate and have the same resolution,
22051 pixel format, frame rate and timebase.
22052
22053 The filter accepts the following options:
22054
22055 transition
22056 Set one of available transition effects:
22057
22058 custom
22059 fade
22060 wipeleft
22061 wiperight
22062 wipeup
22063 wipedown
22064 slideleft
22065 slideright
22066 slideup
22067 slidedown
22068 circlecrop
22069 rectcrop
22070 distance
22071 fadeblack
22072 fadewhite
22073 radial
22074 smoothleft
22075 smoothright
22076 smoothup
22077 smoothdown
22078 circleopen
22079 circleclose
22080 vertopen
22081 vertclose
22082 horzopen
22083 horzclose
22084 dissolve
22085 pixelize
22086 diagtl
22087 diagtr
22088 diagbl
22089 diagbr
22090 hlslice
22091 hrslice
22092 vuslice
22093 vdslice
22094 hblur
22095 fadegrays
22096 wipetl
22097 wipetr
22098 wipebl
22099 wipebr
22100 squeezeh
22101 squeezev
22102 zoomin
22103 fadefast
22104 fadeslow
22105
22106 Default transition effect is fade.
22107
22108 duration
22109 Set cross fade duration in seconds. Range is 0 to 60 seconds.
22110 Default duration is 1 second.
22111
22112 offset
22113 Set cross fade start relative to first input stream in seconds.
22114 Default offset is 0.
22115
22116 expr
22117 Set expression for custom transition effect.
22118
22119 The expressions can use the following variables and functions:
22120
22121 X
22122 Y The coordinates of the current sample.
22123
22124 W
22125 H The width and height of the image.
22126
22127 P Progress of transition effect.
22128
22129 PLANE
22130 Currently processed plane.
22131
22132 A Return value of first input at current location and plane.
22133
22134 B Return value of second input at current location and plane.
22135
22136 a0(x, y)
22137 a1(x, y)
22138 a2(x, y)
22139 a3(x, y)
22140 Return the value of the pixel at location (x,y) of the
22141 first/second/third/fourth component of first input.
22142
22143 b0(x, y)
22144 b1(x, y)
22145 b2(x, y)
22146 b3(x, y)
22147 Return the value of the pixel at location (x,y) of the
22148 first/second/third/fourth component of second input.
22149
22150 Examples
22151
22152 • Cross fade from one input video to another input video, with fade
22153 transition and duration of transition of 2 seconds starting at
22154 offset of 5 seconds:
22155
22156 ffmpeg -i first.mp4 -i second.mp4 -filter_complex xfade=transition=fade:duration=2:offset=5 output.mp4
22157
22158 xmedian
22159 Pick median pixels from several input videos.
22160
22161 The filter accepts the following options:
22162
22163 inputs
22164 Set number of inputs. Default is 3. Allowed range is from 3 to
22165 255. If number of inputs is even number, than result will be mean
22166 value between two median values.
22167
22168 planes
22169 Set which planes to filter. Default value is 15, by which all
22170 planes are processed.
22171
22172 percentile
22173 Set median percentile. Default value is 0.5. Default value of 0.5
22174 will pick always median values, while 0 will pick minimum values,
22175 and 1 maximum values.
22176
22177 Commands
22178
22179 This filter supports all above options as commands, excluding option
22180 "inputs".
22181
22182 xstack
22183 Stack video inputs into custom layout.
22184
22185 All streams must be of same pixel format.
22186
22187 The filter accepts the following options:
22188
22189 inputs
22190 Set number of input streams. Default is 2.
22191
22192 layout
22193 Specify layout of inputs. This option requires the desired layout
22194 configuration to be explicitly set by the user. This sets position
22195 of each video input in output. Each input is separated by '|'. The
22196 first number represents the column, and the second number
22197 represents the row. Numbers start at 0 and are separated by '_'.
22198 Optionally one can use wX and hX, where X is video input from which
22199 to take width or height. Multiple values can be used when
22200 separated by '+'. In such case values are summed together.
22201
22202 Note that if inputs are of different sizes gaps may appear, as not
22203 all of the output video frame will be filled. Similarly, videos can
22204 overlap each other if their position doesn't leave enough space for
22205 the full frame of adjoining videos.
22206
22207 For 2 inputs, a default layout of "0_0|w0_0" (equivalent to
22208 "grid=2x1") is set. In all other cases, a layout or a grid must be
22209 set by the user. Either "grid" or "layout" can be specified at a
22210 time. Specifying both will result in an error.
22211
22212 grid
22213 Specify a fixed size grid of inputs. This option is used to create
22214 a fixed size grid of the input streams. Set the grid size in the
22215 form "COLUMNSxROWS". There must be "ROWS * COLUMNS" input streams
22216 and they will be arranged as a grid with "ROWS" rows and "COLUMNS"
22217 columns. When using this option, each input stream within a row
22218 must have the same height and all the rows must have the same
22219 width.
22220
22221 If "grid" is set, then "inputs" option is ignored and is implicitly
22222 set to "ROWS * COLUMNS".
22223
22224 For 2 inputs, a default grid of "2x1" (equivalent to
22225 "layout=0_0|w0_0") is set. In all other cases, a layout or a grid
22226 must be set by the user. Either "grid" or "layout" can be specified
22227 at a time. Specifying both will result in an error.
22228
22229 shortest
22230 If set to 1, force the output to terminate when the shortest input
22231 terminates. Default value is 0.
22232
22233 fill
22234 If set to valid color, all unused pixels will be filled with that
22235 color. By default fill is set to none, so it is disabled.
22236
22237 Examples
22238
22239 • Display 4 inputs into 2x2 grid.
22240
22241 Layout:
22242
22243 input1(0, 0) | input3(w0, 0)
22244 input2(0, h0) | input4(w0, h0)
22245
22246
22247
22248 xstack=inputs=4:layout=0_0|0_h0|w0_0|w0_h0
22249
22250 Note that if inputs are of different sizes, gaps or overlaps may
22251 occur.
22252
22253 • Display 4 inputs into 1x4 grid.
22254
22255 Layout:
22256
22257 input1(0, 0)
22258 input2(0, h0)
22259 input3(0, h0+h1)
22260 input4(0, h0+h1+h2)
22261
22262
22263
22264 xstack=inputs=4:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2
22265
22266 Note that if inputs are of different widths, unused space will
22267 appear.
22268
22269 • Display 9 inputs into 3x3 grid.
22270
22271 Layout:
22272
22273 input1(0, 0) | input4(w0, 0) | input7(w0+w3, 0)
22274 input2(0, h0) | input5(w0, h0) | input8(w0+w3, h0)
22275 input3(0, h0+h1) | input6(w0, h0+h1) | input9(w0+w3, h0+h1)
22276
22277
22278
22279 xstack=inputs=9:layout=0_0|0_h0|0_h0+h1|w0_0|w0_h0|w0_h0+h1|w0+w3_0|w0+w3_h0|w0+w3_h0+h1
22280
22281 Note that if inputs are of different sizes, gaps or overlaps may
22282 occur.
22283
22284 • Display 16 inputs into 4x4 grid.
22285
22286 Layout:
22287
22288 input1(0, 0) | input5(w0, 0) | input9 (w0+w4, 0) | input13(w0+w4+w8, 0)
22289 input2(0, h0) | input6(w0, h0) | input10(w0+w4, h0) | input14(w0+w4+w8, h0)
22290 input3(0, h0+h1) | input7(w0, h0+h1) | input11(w0+w4, h0+h1) | input15(w0+w4+w8, h0+h1)
22291 input4(0, h0+h1+h2)| input8(w0, h0+h1+h2)| input12(w0+w4, h0+h1+h2)| input16(w0+w4+w8, h0+h1+h2)
22292
22293
22294
22295 xstack=inputs=16:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2|w0_0|w0_h0|w0_h0+h1|w0_h0+h1+h2|w0+w4_0|
22296 w0+w4_h0|w0+w4_h0+h1|w0+w4_h0+h1+h2|w0+w4+w8_0|w0+w4+w8_h0|w0+w4+w8_h0+h1|w0+w4+w8_h0+h1+h2
22297
22298 Note that if inputs are of different sizes, gaps or overlaps may
22299 occur.
22300
22301 yadif
22302 Deinterlace the input video ("yadif" means "yet another deinterlacing
22303 filter").
22304
22305 It accepts the following parameters:
22306
22307 mode
22308 The interlacing mode to adopt. It accepts one of the following
22309 values:
22310
22311 0, send_frame
22312 Output one frame for each frame.
22313
22314 1, send_field
22315 Output one frame for each field.
22316
22317 2, send_frame_nospatial
22318 Like "send_frame", but it skips the spatial interlacing check.
22319
22320 3, send_field_nospatial
22321 Like "send_field", but it skips the spatial interlacing check.
22322
22323 The default value is "send_frame".
22324
22325 parity
22326 The picture field parity assumed for the input interlaced video. It
22327 accepts one of the following values:
22328
22329 0, tff
22330 Assume the top field is first.
22331
22332 1, bff
22333 Assume the bottom field is first.
22334
22335 -1, auto
22336 Enable automatic detection of field parity.
22337
22338 The default value is "auto". If the interlacing is unknown or the
22339 decoder does not export this information, top field first will be
22340 assumed.
22341
22342 deint
22343 Specify which frames to deinterlace. Accepts one of the following
22344 values:
22345
22346 0, all
22347 Deinterlace all frames.
22348
22349 1, interlaced
22350 Only deinterlace frames marked as interlaced.
22351
22352 The default value is "all".
22353
22354 yadif_cuda
22355 Deinterlace the input video using the yadif algorithm, but implemented
22356 in CUDA so that it can work as part of a GPU accelerated pipeline with
22357 nvdec and/or nvenc.
22358
22359 It accepts the following parameters:
22360
22361 mode
22362 The interlacing mode to adopt. It accepts one of the following
22363 values:
22364
22365 0, send_frame
22366 Output one frame for each frame.
22367
22368 1, send_field
22369 Output one frame for each field.
22370
22371 2, send_frame_nospatial
22372 Like "send_frame", but it skips the spatial interlacing check.
22373
22374 3, send_field_nospatial
22375 Like "send_field", but it skips the spatial interlacing check.
22376
22377 The default value is "send_frame".
22378
22379 parity
22380 The picture field parity assumed for the input interlaced video. It
22381 accepts one of the following values:
22382
22383 0, tff
22384 Assume the top field is first.
22385
22386 1, bff
22387 Assume the bottom field is first.
22388
22389 -1, auto
22390 Enable automatic detection of field parity.
22391
22392 The default value is "auto". If the interlacing is unknown or the
22393 decoder does not export this information, top field first will be
22394 assumed.
22395
22396 deint
22397 Specify which frames to deinterlace. Accepts one of the following
22398 values:
22399
22400 0, all
22401 Deinterlace all frames.
22402
22403 1, interlaced
22404 Only deinterlace frames marked as interlaced.
22405
22406 The default value is "all".
22407
22408 yaepblur
22409 Apply blur filter while preserving edges ("yaepblur" means "yet another
22410 edge preserving blur filter"). The algorithm is described in "J. S.
22411 Lee, Digital image enhancement and noise filtering by use of local
22412 statistics, IEEE Trans. Pattern Anal. Mach. Intell. PAMI-2, 1980."
22413
22414 It accepts the following parameters:
22415
22416 radius, r
22417 Set the window radius. Default value is 3.
22418
22419 planes, p
22420 Set which planes to filter. Default is only the first plane.
22421
22422 sigma, s
22423 Set blur strength. Default value is 128.
22424
22425 Commands
22426
22427 This filter supports same commands as options.
22428
22429 zoompan
22430 Apply Zoom & Pan effect.
22431
22432 This filter accepts the following options:
22433
22434 zoom, z
22435 Set the zoom expression. Range is 1-10. Default is 1.
22436
22437 x
22438 y Set the x and y expression. Default is 0.
22439
22440 d Set the duration expression in number of frames. This sets for how
22441 many number of frames effect will last for single input image.
22442 Default is 90.
22443
22444 s Set the output image size, default is 'hd720'.
22445
22446 fps Set the output frame rate, default is '25'.
22447
22448 Each expression can contain the following constants:
22449
22450 in_w, iw
22451 Input width.
22452
22453 in_h, ih
22454 Input height.
22455
22456 out_w, ow
22457 Output width.
22458
22459 out_h, oh
22460 Output height.
22461
22462 in Input frame count.
22463
22464 on Output frame count.
22465
22466 in_time, it
22467 The input timestamp expressed in seconds. It's NAN if the input
22468 timestamp is unknown.
22469
22470 out_time, time, ot
22471 The output timestamp expressed in seconds.
22472
22473 x
22474 y Last calculated 'x' and 'y' position from 'x' and 'y' expression
22475 for current input frame.
22476
22477 px
22478 py 'x' and 'y' of last output frame of previous input frame or 0 when
22479 there was not yet such frame (first input frame).
22480
22481 zoom
22482 Last calculated zoom from 'z' expression for current input frame.
22483
22484 pzoom
22485 Last calculated zoom of last output frame of previous input frame.
22486
22487 duration
22488 Number of output frames for current input frame. Calculated from
22489 'd' expression for each input frame.
22490
22491 pduration
22492 number of output frames created for previous input frame
22493
22494 a Rational number: input width / input height
22495
22496 sar sample aspect ratio
22497
22498 dar display aspect ratio
22499
22500 Examples
22501
22502 • Zoom in up to 1.5x and pan at same time to some spot near center of
22503 picture:
22504
22505 zoompan=z='min(zoom+0.0015,1.5)':d=700:x='if(gte(zoom,1.5),x,x+1/a)':y='if(gte(zoom,1.5),y,y+1)':s=640x360
22506
22507 • Zoom in up to 1.5x and pan always at center of picture:
22508
22509 zoompan=z='min(zoom+0.0015,1.5)':d=700:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
22510
22511 • Same as above but without pausing:
22512
22513 zoompan=z='min(max(zoom,pzoom)+0.0015,1.5)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
22514
22515 • Zoom in 2x into center of picture only for the first second of the
22516 input video:
22517
22518 zoompan=z='if(between(in_time,0,1),2,1)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
22519
22520 zscale
22521 Scale (resize) the input video, using the z.lib library:
22522 <https://github.com/sekrit-twc/zimg>. To enable compilation of this
22523 filter, you need to configure FFmpeg with "--enable-libzimg".
22524
22525 The zscale filter forces the output display aspect ratio to be the same
22526 as the input, by changing the output sample aspect ratio.
22527
22528 If the input image format is different from the format requested by the
22529 next filter, the zscale filter will convert the input to the requested
22530 format.
22531
22532 Options
22533
22534 The filter accepts the following options.
22535
22536 width, w
22537 height, h
22538 Set the output video dimension expression. Default value is the
22539 input dimension.
22540
22541 If the width or w value is 0, the input width is used for the
22542 output. If the height or h value is 0, the input height is used for
22543 the output.
22544
22545 If one and only one of the values is -n with n >= 1, the zscale
22546 filter will use a value that maintains the aspect ratio of the
22547 input image, calculated from the other specified dimension. After
22548 that it will, however, make sure that the calculated dimension is
22549 divisible by n and adjust the value if necessary.
22550
22551 If both values are -n with n >= 1, the behavior will be identical
22552 to both values being set to 0 as previously detailed.
22553
22554 See below for the list of accepted constants for use in the
22555 dimension expression.
22556
22557 size, s
22558 Set the video size. For the syntax of this option, check the "Video
22559 size" section in the ffmpeg-utils manual.
22560
22561 dither, d
22562 Set the dither type.
22563
22564 Possible values are:
22565
22566 none
22567 ordered
22568 random
22569 error_diffusion
22570
22571 Default is none.
22572
22573 filter, f
22574 Set the resize filter type.
22575
22576 Possible values are:
22577
22578 point
22579 bilinear
22580 bicubic
22581 spline16
22582 spline36
22583 lanczos
22584
22585 Default is bilinear.
22586
22587 range, r
22588 Set the color range.
22589
22590 Possible values are:
22591
22592 input
22593 limited
22594 full
22595
22596 Default is same as input.
22597
22598 primaries, p
22599 Set the color primaries.
22600
22601 Possible values are:
22602
22603 input
22604 709
22605 unspecified
22606 170m
22607 240m
22608 2020
22609
22610 Default is same as input.
22611
22612 transfer, t
22613 Set the transfer characteristics.
22614
22615 Possible values are:
22616
22617 input
22618 709
22619 unspecified
22620 601
22621 linear
22622 2020_10
22623 2020_12
22624 smpte2084
22625 iec61966-2-1
22626 arib-std-b67
22627
22628 Default is same as input.
22629
22630 matrix, m
22631 Set the colorspace matrix.
22632
22633 Possible value are:
22634
22635 input
22636 709
22637 unspecified
22638 470bg
22639 170m
22640 2020_ncl
22641 2020_cl
22642
22643 Default is same as input.
22644
22645 rangein, rin
22646 Set the input color range.
22647
22648 Possible values are:
22649
22650 input
22651 limited
22652 full
22653
22654 Default is same as input.
22655
22656 primariesin, pin
22657 Set the input color primaries.
22658
22659 Possible values are:
22660
22661 input
22662 709
22663 unspecified
22664 170m
22665 240m
22666 2020
22667
22668 Default is same as input.
22669
22670 transferin, tin
22671 Set the input transfer characteristics.
22672
22673 Possible values are:
22674
22675 input
22676 709
22677 unspecified
22678 601
22679 linear
22680 2020_10
22681 2020_12
22682
22683 Default is same as input.
22684
22685 matrixin, min
22686 Set the input colorspace matrix.
22687
22688 Possible value are:
22689
22690 input
22691 709
22692 unspecified
22693 470bg
22694 170m
22695 2020_ncl
22696 2020_cl
22697 chromal, c
22698 Set the output chroma location.
22699
22700 Possible values are:
22701
22702 input
22703 left
22704 center
22705 topleft
22706 top
22707 bottomleft
22708 bottom
22709 chromalin, cin
22710 Set the input chroma location.
22711
22712 Possible values are:
22713
22714 input
22715 left
22716 center
22717 topleft
22718 top
22719 bottomleft
22720 bottom
22721 npl Set the nominal peak luminance.
22722
22723 param_a
22724 Parameter A for scaling filters. Parameter "b" for bicubic, and the
22725 number of filter taps for lanczos.
22726
22727 param_b
22728 Parameter B for scaling filters. Parameter "c" for bicubic.
22729
22730 The values of the w and h options are expressions containing the
22731 following constants:
22732
22733 in_w
22734 in_h
22735 The input width and height
22736
22737 iw
22738 ih These are the same as in_w and in_h.
22739
22740 out_w
22741 out_h
22742 The output (scaled) width and height
22743
22744 ow
22745 oh These are the same as out_w and out_h
22746
22747 a The same as iw / ih
22748
22749 sar input sample aspect ratio
22750
22751 dar The input display aspect ratio. Calculated from "(iw / ih) * sar".
22752
22753 hsub
22754 vsub
22755 horizontal and vertical input chroma subsample values. For example
22756 for the pixel format "yuv422p" hsub is 2 and vsub is 1.
22757
22758 ohsub
22759 ovsub
22760 horizontal and vertical output chroma subsample values. For example
22761 for the pixel format "yuv422p" hsub is 2 and vsub is 1.
22762
22763 Commands
22764
22765 This filter supports the following commands:
22766
22767 width, w
22768 height, h
22769 Set the output video dimension expression. The command accepts the
22770 same syntax of the corresponding option.
22771
22772 If the specified expression is not valid, it is kept at its current
22773 value.
22774
22776 Below is a description of the currently available OpenCL video filters.
22777
22778 To enable compilation of these filters you need to configure FFmpeg
22779 with "--enable-opencl".
22780
22781 Running OpenCL filters requires you to initialize a hardware device and
22782 to pass that device to all filters in any filter graph.
22783
22784 -init_hw_device opencl[=name][:device[,key=value...]]
22785 Initialise a new hardware device of type opencl called name, using
22786 the given device parameters.
22787
22788 -filter_hw_device name
22789 Pass the hardware device called name to all filters in any filter
22790 graph.
22791
22792 For more detailed information see
22793 <https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options>
22794
22795 • Example of choosing the first device on the second platform and
22796 running avgblur_opencl filter with default parameters on it.
22797
22798 -init_hw_device opencl=gpu:1.0 -filter_hw_device gpu -i INPUT -vf "hwupload, avgblur_opencl, hwdownload" OUTPUT
22799
22800 Since OpenCL filters are not able to access frame data in normal
22801 memory, all frame data needs to be uploaded(hwupload) to hardware
22802 surfaces connected to the appropriate device before being used and then
22803 downloaded(hwdownload) back to normal memory. Note that hwupload will
22804 upload to a surface with the same layout as the software frame, so it
22805 may be necessary to add a format filter immediately before to get the
22806 input into the right format and hwdownload does not support all formats
22807 on the output - it may be necessary to insert an additional format
22808 filter immediately following in the graph to get the output in a
22809 supported format.
22810
22811 avgblur_opencl
22812 Apply average blur filter.
22813
22814 The filter accepts the following options:
22815
22816 sizeX
22817 Set horizontal radius size. Range is "[1, 1024]" and default value
22818 is 1.
22819
22820 planes
22821 Set which planes to filter. Default value is 0xf, by which all
22822 planes are processed.
22823
22824 sizeY
22825 Set vertical radius size. Range is "[1, 1024]" and default value is
22826 0. If zero, "sizeX" value will be used.
22827
22828 Example
22829
22830 • Apply average blur filter with horizontal and vertical size of 3,
22831 setting each pixel of the output to the average value of the 7x7
22832 region centered on it in the input. For pixels on the edges of the
22833 image, the region does not extend beyond the image boundaries, and
22834 so out-of-range coordinates are not used in the calculations.
22835
22836 -i INPUT -vf "hwupload, avgblur_opencl=3, hwdownload" OUTPUT
22837
22838 boxblur_opencl
22839 Apply a boxblur algorithm to the input video.
22840
22841 It accepts the following parameters:
22842
22843 luma_radius, lr
22844 luma_power, lp
22845 chroma_radius, cr
22846 chroma_power, cp
22847 alpha_radius, ar
22848 alpha_power, ap
22849
22850 A description of the accepted options follows.
22851
22852 luma_radius, lr
22853 chroma_radius, cr
22854 alpha_radius, ar
22855 Set an expression for the box radius in pixels used for blurring
22856 the corresponding input plane.
22857
22858 The radius value must be a non-negative number, and must not be
22859 greater than the value of the expression "min(w,h)/2" for the luma
22860 and alpha planes, and of "min(cw,ch)/2" for the chroma planes.
22861
22862 Default value for luma_radius is "2". If not specified,
22863 chroma_radius and alpha_radius default to the corresponding value
22864 set for luma_radius.
22865
22866 The expressions can contain the following constants:
22867
22868 w
22869 h The input width and height in pixels.
22870
22871 cw
22872 ch The input chroma image width and height in pixels.
22873
22874 hsub
22875 vsub
22876 The horizontal and vertical chroma subsample values. For
22877 example, for the pixel format "yuv422p", hsub is 2 and vsub is
22878 1.
22879
22880 luma_power, lp
22881 chroma_power, cp
22882 alpha_power, ap
22883 Specify how many times the boxblur filter is applied to the
22884 corresponding plane.
22885
22886 Default value for luma_power is 2. If not specified, chroma_power
22887 and alpha_power default to the corresponding value set for
22888 luma_power.
22889
22890 A value of 0 will disable the effect.
22891
22892 Examples
22893
22894 Apply boxblur filter, setting each pixel of the output to the average
22895 value of box-radiuses luma_radius, chroma_radius, alpha_radius for each
22896 plane respectively. The filter will apply luma_power, chroma_power,
22897 alpha_power times onto the corresponding plane. For pixels on the edges
22898 of the image, the radius does not extend beyond the image boundaries,
22899 and so out-of-range coordinates are not used in the calculations.
22900
22901 • Apply a boxblur filter with the luma, chroma, and alpha radius set
22902 to 2 and luma, chroma, and alpha power set to 3. The filter will
22903 run 3 times with box-radius set to 2 for every plane of the image.
22904
22905 -i INPUT -vf "hwupload, boxblur_opencl=luma_radius=2:luma_power=3, hwdownload" OUTPUT
22906 -i INPUT -vf "hwupload, boxblur_opencl=2:3, hwdownload" OUTPUT
22907
22908 • Apply a boxblur filter with luma radius set to 2, luma_power to 1,
22909 chroma_radius to 4, chroma_power to 5, alpha_radius to 3 and
22910 alpha_power to 7.
22911
22912 For the luma plane, a 2x2 box radius will be run once.
22913
22914 For the chroma plane, a 4x4 box radius will be run 5 times.
22915
22916 For the alpha plane, a 3x3 box radius will be run 7 times.
22917
22918 -i INPUT -vf "hwupload, boxblur_opencl=2:1:4:5:3:7, hwdownload" OUTPUT
22919
22920 colorkey_opencl
22921 RGB colorspace color keying.
22922
22923 The filter accepts the following options:
22924
22925 color
22926 The color which will be replaced with transparency.
22927
22928 similarity
22929 Similarity percentage with the key color.
22930
22931 0.01 matches only the exact key color, while 1.0 matches
22932 everything.
22933
22934 blend
22935 Blend percentage.
22936
22937 0.0 makes pixels either fully transparent, or not transparent at
22938 all.
22939
22940 Higher values result in semi-transparent pixels, with a higher
22941 transparency the more similar the pixels color is to the key color.
22942
22943 Examples
22944
22945 • Make every semi-green pixel in the input transparent with some
22946 slight blending:
22947
22948 -i INPUT -vf "hwupload, colorkey_opencl=green:0.3:0.1, hwdownload" OUTPUT
22949
22950 convolution_opencl
22951 Apply convolution of 3x3, 5x5, 7x7 matrix.
22952
22953 The filter accepts the following options:
22954
22955 0m
22956 1m
22957 2m
22958 3m Set matrix for each plane. Matrix is sequence of 9, 25 or 49
22959 signed numbers. Default value for each plane is "0 0 0 0 1 0 0 0
22960 0".
22961
22962 0rdiv
22963 1rdiv
22964 2rdiv
22965 3rdiv
22966 Set multiplier for calculated value for each plane. If unset or 0,
22967 it will be sum of all matrix elements. The option value must be a
22968 float number greater or equal to 0.0. Default value is 1.0.
22969
22970 0bias
22971 1bias
22972 2bias
22973 3bias
22974 Set bias for each plane. This value is added to the result of the
22975 multiplication. Useful for making the overall image brighter or
22976 darker. The option value must be a float number greater or equal
22977 to 0.0. Default value is 0.0.
22978
22979 Examples
22980
22981 • Apply sharpen:
22982
22983 -i INPUT -vf "hwupload, convolution_opencl=0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0, hwdownload" OUTPUT
22984
22985 • Apply blur:
22986
22987 -i INPUT -vf "hwupload, convolution_opencl=1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9, hwdownload" OUTPUT
22988
22989 • Apply edge enhance:
22990
22991 -i INPUT -vf "hwupload, convolution_opencl=0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128, hwdownload" OUTPUT
22992
22993 • Apply edge detect:
22994
22995 -i INPUT -vf "hwupload, convolution_opencl=0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128, hwdownload" OUTPUT
22996
22997 • Apply laplacian edge detector which includes diagonals:
22998
22999 -i INPUT -vf "hwupload, convolution_opencl=1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0, hwdownload" OUTPUT
23000
23001 • Apply emboss:
23002
23003 -i INPUT -vf "hwupload, convolution_opencl=-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2, hwdownload" OUTPUT
23004
23005 erosion_opencl
23006 Apply erosion effect to the video.
23007
23008 This filter replaces the pixel by the local(3x3) minimum.
23009
23010 It accepts the following options:
23011
23012 threshold0
23013 threshold1
23014 threshold2
23015 threshold3
23016 Limit the maximum change for each plane. Range is "[0, 65535]" and
23017 default value is 65535. If 0, plane will remain unchanged.
23018
23019 coordinates
23020 Flag which specifies the pixel to refer to. Range is "[0, 255]"
23021 and default value is 255, i.e. all eight pixels are used.
23022
23023 Flags to local 3x3 coordinates region centered on "x":
23024
23025 1 2 3
23026
23027 4 x 5
23028
23029 6 7 8
23030
23031 Example
23032
23033 • Apply erosion filter with threshold0 set to 30, threshold1 set 40,
23034 threshold2 set to 50 and coordinates set to 231, setting each pixel
23035 of the output to the local minimum between pixels: 1, 2, 3, 6, 7, 8
23036 of the 3x3 region centered on it in the input. If the difference
23037 between input pixel and local minimum is more then threshold of the
23038 corresponding plane, output pixel will be set to input pixel -
23039 threshold of corresponding plane.
23040
23041 -i INPUT -vf "hwupload, erosion_opencl=30:40:50:coordinates=231, hwdownload" OUTPUT
23042
23043 deshake_opencl
23044 Feature-point based video stabilization filter.
23045
23046 The filter accepts the following options:
23047
23048 tripod
23049 Simulates a tripod by preventing any camera movement whatsoever
23050 from the original frame. Defaults to 0.
23051
23052 debug
23053 Whether or not additional debug info should be displayed, both in
23054 the processed output and in the console.
23055
23056 Note that in order to see console debug output you will also need
23057 to pass "-v verbose" to ffmpeg.
23058
23059 Viewing point matches in the output video is only supported for RGB
23060 input.
23061
23062 Defaults to 0.
23063
23064 adaptive_crop
23065 Whether or not to do a tiny bit of cropping at the borders to cut
23066 down on the amount of mirrored pixels.
23067
23068 Defaults to 1.
23069
23070 refine_features
23071 Whether or not feature points should be refined at a sub-pixel
23072 level.
23073
23074 This can be turned off for a slight performance gain at the cost of
23075 precision.
23076
23077 Defaults to 1.
23078
23079 smooth_strength
23080 The strength of the smoothing applied to the camera path from 0.0
23081 to 1.0.
23082
23083 1.0 is the maximum smoothing strength while values less than that
23084 result in less smoothing.
23085
23086 0.0 causes the filter to adaptively choose a smoothing strength on
23087 a per-frame basis.
23088
23089 Defaults to 0.0.
23090
23091 smooth_window_multiplier
23092 Controls the size of the smoothing window (the number of frames
23093 buffered to determine motion information from).
23094
23095 The size of the smoothing window is determined by multiplying the
23096 framerate of the video by this number.
23097
23098 Acceptable values range from 0.1 to 10.0.
23099
23100 Larger values increase the amount of motion data available for
23101 determining how to smooth the camera path, potentially improving
23102 smoothness, but also increase latency and memory usage.
23103
23104 Defaults to 2.0.
23105
23106 Examples
23107
23108 • Stabilize a video with a fixed, medium smoothing strength:
23109
23110 -i INPUT -vf "hwupload, deshake_opencl=smooth_strength=0.5, hwdownload" OUTPUT
23111
23112 • Stabilize a video with debugging (both in console and in rendered
23113 video):
23114
23115 -i INPUT -filter_complex "[0:v]format=rgba, hwupload, deshake_opencl=debug=1, hwdownload, format=rgba, format=yuv420p" -v verbose OUTPUT
23116
23117 dilation_opencl
23118 Apply dilation effect to the video.
23119
23120 This filter replaces the pixel by the local(3x3) maximum.
23121
23122 It accepts the following options:
23123
23124 threshold0
23125 threshold1
23126 threshold2
23127 threshold3
23128 Limit the maximum change for each plane. Range is "[0, 65535]" and
23129 default value is 65535. If 0, plane will remain unchanged.
23130
23131 coordinates
23132 Flag which specifies the pixel to refer to. Range is "[0, 255]"
23133 and default value is 255, i.e. all eight pixels are used.
23134
23135 Flags to local 3x3 coordinates region centered on "x":
23136
23137 1 2 3
23138
23139 4 x 5
23140
23141 6 7 8
23142
23143 Example
23144
23145 • Apply dilation filter with threshold0 set to 30, threshold1 set 40,
23146 threshold2 set to 50 and coordinates set to 231, setting each pixel
23147 of the output to the local maximum between pixels: 1, 2, 3, 6, 7, 8
23148 of the 3x3 region centered on it in the input. If the difference
23149 between input pixel and local maximum is more then threshold of the
23150 corresponding plane, output pixel will be set to input pixel +
23151 threshold of corresponding plane.
23152
23153 -i INPUT -vf "hwupload, dilation_opencl=30:40:50:coordinates=231, hwdownload" OUTPUT
23154
23155 nlmeans_opencl
23156 Non-local Means denoise filter through OpenCL, this filter accepts same
23157 options as nlmeans.
23158
23159 overlay_opencl
23160 Overlay one video on top of another.
23161
23162 It takes two inputs and has one output. The first input is the "main"
23163 video on which the second input is overlaid. This filter requires same
23164 memory layout for all the inputs. So, format conversion may be needed.
23165
23166 The filter accepts the following options:
23167
23168 x Set the x coordinate of the overlaid video on the main video.
23169 Default value is 0.
23170
23171 y Set the y coordinate of the overlaid video on the main video.
23172 Default value is 0.
23173
23174 Examples
23175
23176 • Overlay an image LOGO at the top-left corner of the INPUT video.
23177 Both inputs are yuv420p format.
23178
23179 -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuv420p, hwupload[b], [a][b]overlay_opencl, hwdownload" OUTPUT
23180
23181 • The inputs have same memory layout for color channels , the overlay
23182 has additional alpha plane, like INPUT is yuv420p, and the LOGO is
23183 yuva420p.
23184
23185 -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuva420p, hwupload[b], [a][b]overlay_opencl, hwdownload" OUTPUT
23186
23187 pad_opencl
23188 Add paddings to the input image, and place the original input at the
23189 provided x, y coordinates.
23190
23191 It accepts the following options:
23192
23193 width, w
23194 height, h
23195 Specify an expression for the size of the output image with the
23196 paddings added. If the value for width or height is 0, the
23197 corresponding input size is used for the output.
23198
23199 The width expression can reference the value set by the height
23200 expression, and vice versa.
23201
23202 The default value of width and height is 0.
23203
23204 x
23205 y Specify the offsets to place the input image at within the padded
23206 area, with respect to the top/left border of the output image.
23207
23208 The x expression can reference the value set by the y expression,
23209 and vice versa.
23210
23211 The default value of x and y is 0.
23212
23213 If x or y evaluate to a negative number, they'll be changed so the
23214 input image is centered on the padded area.
23215
23216 color
23217 Specify the color of the padded area. For the syntax of this
23218 option, check the "Color" section in the ffmpeg-utils manual.
23219
23220 aspect
23221 Pad to an aspect instead to a resolution.
23222
23223 The value for the width, height, x, and y options are expressions
23224 containing the following constants:
23225
23226 in_w
23227 in_h
23228 The input video width and height.
23229
23230 iw
23231 ih These are the same as in_w and in_h.
23232
23233 out_w
23234 out_h
23235 The output width and height (the size of the padded area), as
23236 specified by the width and height expressions.
23237
23238 ow
23239 oh These are the same as out_w and out_h.
23240
23241 x
23242 y The x and y offsets as specified by the x and y expressions, or NAN
23243 if not yet specified.
23244
23245 a same as iw / ih
23246
23247 sar input sample aspect ratio
23248
23249 dar input display aspect ratio, it is the same as (iw / ih) * sar
23250
23251 prewitt_opencl
23252 Apply the Prewitt operator
23253 (<https://en.wikipedia.org/wiki/Prewitt_operator>) to input video
23254 stream.
23255
23256 The filter accepts the following option:
23257
23258 planes
23259 Set which planes to filter. Default value is 0xf, by which all
23260 planes are processed.
23261
23262 scale
23263 Set value which will be multiplied with filtered result. Range is
23264 "[0.0, 65535]" and default value is 1.0.
23265
23266 delta
23267 Set value which will be added to filtered result. Range is
23268 "[-65535, 65535]" and default value is 0.0.
23269
23270 Example
23271
23272 • Apply the Prewitt operator with scale set to 2 and delta set to 10.
23273
23274 -i INPUT -vf "hwupload, prewitt_opencl=scale=2:delta=10, hwdownload" OUTPUT
23275
23276 program_opencl
23277 Filter video using an OpenCL program.
23278
23279 source
23280 OpenCL program source file.
23281
23282 kernel
23283 Kernel name in program.
23284
23285 inputs
23286 Number of inputs to the filter. Defaults to 1.
23287
23288 size, s
23289 Size of output frames. Defaults to the same as the first input.
23290
23291 The "program_opencl" filter also supports the framesync options.
23292
23293 The program source file must contain a kernel function with the given
23294 name, which will be run once for each plane of the output. Each run on
23295 a plane gets enqueued as a separate 2D global NDRange with one work-
23296 item for each pixel to be generated. The global ID offset for each
23297 work-item is therefore the coordinates of a pixel in the destination
23298 image.
23299
23300 The kernel function needs to take the following arguments:
23301
23302 • Destination image, __write_only image2d_t.
23303
23304 This image will become the output; the kernel should write all of
23305 it.
23306
23307 • Frame index, unsigned int.
23308
23309 This is a counter starting from zero and increasing by one for each
23310 frame.
23311
23312 • Source images, __read_only image2d_t.
23313
23314 These are the most recent images on each input. The kernel may
23315 read from them to generate the output, but they can't be written
23316 to.
23317
23318 Example programs:
23319
23320 • Copy the input to the output (output must be the same size as the
23321 input).
23322
23323 __kernel void copy(__write_only image2d_t destination,
23324 unsigned int index,
23325 __read_only image2d_t source)
23326 {
23327 const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE;
23328
23329 int2 location = (int2)(get_global_id(0), get_global_id(1));
23330
23331 float4 value = read_imagef(source, sampler, location);
23332
23333 write_imagef(destination, location, value);
23334 }
23335
23336 • Apply a simple transformation, rotating the input by an amount
23337 increasing with the index counter. Pixel values are linearly
23338 interpolated by the sampler, and the output need not have the same
23339 dimensions as the input.
23340
23341 __kernel void rotate_image(__write_only image2d_t dst,
23342 unsigned int index,
23343 __read_only image2d_t src)
23344 {
23345 const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
23346 CLK_FILTER_LINEAR);
23347
23348 float angle = (float)index / 100.0f;
23349
23350 float2 dst_dim = convert_float2(get_image_dim(dst));
23351 float2 src_dim = convert_float2(get_image_dim(src));
23352
23353 float2 dst_cen = dst_dim / 2.0f;
23354 float2 src_cen = src_dim / 2.0f;
23355
23356 int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
23357
23358 float2 dst_pos = convert_float2(dst_loc) - dst_cen;
23359 float2 src_pos = {
23360 cos(angle) * dst_pos.x - sin(angle) * dst_pos.y,
23361 sin(angle) * dst_pos.x + cos(angle) * dst_pos.y
23362 };
23363 src_pos = src_pos * src_dim / dst_dim;
23364
23365 float2 src_loc = src_pos + src_cen;
23366
23367 if (src_loc.x < 0.0f || src_loc.y < 0.0f ||
23368 src_loc.x > src_dim.x || src_loc.y > src_dim.y)
23369 write_imagef(dst, dst_loc, 0.5f);
23370 else
23371 write_imagef(dst, dst_loc, read_imagef(src, sampler, src_loc));
23372 }
23373
23374 • Blend two inputs together, with the amount of each input used
23375 varying with the index counter.
23376
23377 __kernel void blend_images(__write_only image2d_t dst,
23378 unsigned int index,
23379 __read_only image2d_t src1,
23380 __read_only image2d_t src2)
23381 {
23382 const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
23383 CLK_FILTER_LINEAR);
23384
23385 float blend = (cos((float)index / 50.0f) + 1.0f) / 2.0f;
23386
23387 int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
23388 int2 src1_loc = dst_loc * get_image_dim(src1) / get_image_dim(dst);
23389 int2 src2_loc = dst_loc * get_image_dim(src2) / get_image_dim(dst);
23390
23391 float4 val1 = read_imagef(src1, sampler, src1_loc);
23392 float4 val2 = read_imagef(src2, sampler, src2_loc);
23393
23394 write_imagef(dst, dst_loc, val1 * blend + val2 * (1.0f - blend));
23395 }
23396
23397 remap_opencl
23398 Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
23399
23400 Destination pixel at position (X, Y) will be picked from source (x, y)
23401 position where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are
23402 out of range, zero value for pixel will be used for destination pixel.
23403
23404 Xmap and Ymap input video streams must be of same dimensions. Output
23405 video stream will have Xmap/Ymap video stream dimensions. Xmap and
23406 Ymap input video streams are 32bit float pixel format, single channel.
23407
23408 interp
23409 Specify interpolation used for remapping of pixels. Allowed values
23410 are "near" and "linear". Default value is "linear".
23411
23412 fill
23413 Specify the color of the unmapped pixels. For the syntax of this
23414 option, check the "Color" section in the ffmpeg-utils manual.
23415 Default color is "black".
23416
23417 roberts_opencl
23418 Apply the Roberts cross operator
23419 (<https://en.wikipedia.org/wiki/Roberts_cross>) to input video stream.
23420
23421 The filter accepts the following option:
23422
23423 planes
23424 Set which planes to filter. Default value is 0xf, by which all
23425 planes are processed.
23426
23427 scale
23428 Set value which will be multiplied with filtered result. Range is
23429 "[0.0, 65535]" and default value is 1.0.
23430
23431 delta
23432 Set value which will be added to filtered result. Range is
23433 "[-65535, 65535]" and default value is 0.0.
23434
23435 Example
23436
23437 • Apply the Roberts cross operator with scale set to 2 and delta set
23438 to 10
23439
23440 -i INPUT -vf "hwupload, roberts_opencl=scale=2:delta=10, hwdownload" OUTPUT
23441
23442 sobel_opencl
23443 Apply the Sobel operator
23444 (<https://en.wikipedia.org/wiki/Sobel_operator>) to input video stream.
23445
23446 The filter accepts the following option:
23447
23448 planes
23449 Set which planes to filter. Default value is 0xf, by which all
23450 planes are processed.
23451
23452 scale
23453 Set value which will be multiplied with filtered result. Range is
23454 "[0.0, 65535]" and default value is 1.0.
23455
23456 delta
23457 Set value which will be added to filtered result. Range is
23458 "[-65535, 65535]" and default value is 0.0.
23459
23460 Example
23461
23462 • Apply sobel operator with scale set to 2 and delta set to 10
23463
23464 -i INPUT -vf "hwupload, sobel_opencl=scale=2:delta=10, hwdownload" OUTPUT
23465
23466 tonemap_opencl
23467 Perform HDR(PQ/HLG) to SDR conversion with tone-mapping.
23468
23469 It accepts the following parameters:
23470
23471 tonemap
23472 Specify the tone-mapping operator to be used. Same as tonemap
23473 option in tonemap.
23474
23475 param
23476 Tune the tone mapping algorithm. same as param option in tonemap.
23477
23478 desat
23479 Apply desaturation for highlights that exceed this level of
23480 brightness. The higher the parameter, the more color information
23481 will be preserved. This setting helps prevent unnaturally blown-out
23482 colors for super-highlights, by (smoothly) turning into white
23483 instead. This makes images feel more natural, at the cost of
23484 reducing information about out-of-range colors.
23485
23486 The default value is 0.5, and the algorithm here is a little
23487 different from the cpu version tonemap currently. A setting of 0.0
23488 disables this option.
23489
23490 threshold
23491 The tonemapping algorithm parameters is fine-tuned per each scene.
23492 And a threshold is used to detect whether the scene has changed or
23493 not. If the distance between the current frame average brightness
23494 and the current running average exceeds a threshold value, we would
23495 re-calculate scene average and peak brightness. The default value
23496 is 0.2.
23497
23498 format
23499 Specify the output pixel format.
23500
23501 Currently supported formats are:
23502
23503 p010
23504 nv12
23505 range, r
23506 Set the output color range.
23507
23508 Possible values are:
23509
23510 tv/mpeg
23511 pc/jpeg
23512
23513 Default is same as input.
23514
23515 primaries, p
23516 Set the output color primaries.
23517
23518 Possible values are:
23519
23520 bt709
23521 bt2020
23522
23523 Default is same as input.
23524
23525 transfer, t
23526 Set the output transfer characteristics.
23527
23528 Possible values are:
23529
23530 bt709
23531 bt2020
23532
23533 Default is bt709.
23534
23535 matrix, m
23536 Set the output colorspace matrix.
23537
23538 Possible value are:
23539
23540 bt709
23541 bt2020
23542
23543 Default is same as input.
23544
23545 Example
23546
23547 • Convert HDR(PQ/HLG) video to bt2020-transfer-characteristic p010
23548 format using linear operator.
23549
23550 -i INPUT -vf "format=p010,hwupload,tonemap_opencl=t=bt2020:tonemap=linear:format=p010,hwdownload,format=p010" OUTPUT
23551
23552 unsharp_opencl
23553 Sharpen or blur the input video.
23554
23555 It accepts the following parameters:
23556
23557 luma_msize_x, lx
23558 Set the luma matrix horizontal size. Range is "[1, 23]" and
23559 default value is 5.
23560
23561 luma_msize_y, ly
23562 Set the luma matrix vertical size. Range is "[1, 23]" and default
23563 value is 5.
23564
23565 luma_amount, la
23566 Set the luma effect strength. Range is "[-10, 10]" and default
23567 value is 1.0.
23568
23569 Negative values will blur the input video, while positive values
23570 will sharpen it, a value of zero will disable the effect.
23571
23572 chroma_msize_x, cx
23573 Set the chroma matrix horizontal size. Range is "[1, 23]" and
23574 default value is 5.
23575
23576 chroma_msize_y, cy
23577 Set the chroma matrix vertical size. Range is "[1, 23]" and
23578 default value is 5.
23579
23580 chroma_amount, ca
23581 Set the chroma effect strength. Range is "[-10, 10]" and default
23582 value is 0.0.
23583
23584 Negative values will blur the input video, while positive values
23585 will sharpen it, a value of zero will disable the effect.
23586
23587 All parameters are optional and default to the equivalent of the string
23588 '5:5:1.0:5:5:0.0'.
23589
23590 Examples
23591
23592 • Apply strong luma sharpen effect:
23593
23594 -i INPUT -vf "hwupload, unsharp_opencl=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5, hwdownload" OUTPUT
23595
23596 • Apply a strong blur of both luma and chroma parameters:
23597
23598 -i INPUT -vf "hwupload, unsharp_opencl=7:7:-2:7:7:-2, hwdownload" OUTPUT
23599
23600 xfade_opencl
23601 Cross fade two videos with custom transition effect by using OpenCL.
23602
23603 It accepts the following options:
23604
23605 transition
23606 Set one of possible transition effects.
23607
23608 custom
23609 Select custom transition effect, the actual transition
23610 description will be picked from source and kernel options.
23611
23612 fade
23613 wipeleft
23614 wiperight
23615 wipeup
23616 wipedown
23617 slideleft
23618 slideright
23619 slideup
23620 slidedown
23621 Default transition is fade.
23622
23623 source
23624 OpenCL program source file for custom transition.
23625
23626 kernel
23627 Set name of kernel to use for custom transition from program source
23628 file.
23629
23630 duration
23631 Set duration of video transition.
23632
23633 offset
23634 Set time of start of transition relative to first video.
23635
23636 The program source file must contain a kernel function with the given
23637 name, which will be run once for each plane of the output. Each run on
23638 a plane gets enqueued as a separate 2D global NDRange with one work-
23639 item for each pixel to be generated. The global ID offset for each
23640 work-item is therefore the coordinates of a pixel in the destination
23641 image.
23642
23643 The kernel function needs to take the following arguments:
23644
23645 • Destination image, __write_only image2d_t.
23646
23647 This image will become the output; the kernel should write all of
23648 it.
23649
23650 • First Source image, __read_only image2d_t. Second Source image,
23651 __read_only image2d_t.
23652
23653 These are the most recent images on each input. The kernel may
23654 read from them to generate the output, but they can't be written
23655 to.
23656
23657 • Transition progress, float. This value is always between 0 and 1
23658 inclusive.
23659
23660 Example programs:
23661
23662 • Apply dots curtain transition effect:
23663
23664 __kernel void blend_images(__write_only image2d_t dst,
23665 __read_only image2d_t src1,
23666 __read_only image2d_t src2,
23667 float progress)
23668 {
23669 const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
23670 CLK_FILTER_LINEAR);
23671 int2 p = (int2)(get_global_id(0), get_global_id(1));
23672 float2 rp = (float2)(get_global_id(0), get_global_id(1));
23673 float2 dim = (float2)(get_image_dim(src1).x, get_image_dim(src1).y);
23674 rp = rp / dim;
23675
23676 float2 dots = (float2)(20.0, 20.0);
23677 float2 center = (float2)(0,0);
23678 float2 unused;
23679
23680 float4 val1 = read_imagef(src1, sampler, p);
23681 float4 val2 = read_imagef(src2, sampler, p);
23682 bool next = distance(fract(rp * dots, &unused), (float2)(0.5, 0.5)) < (progress / distance(rp, center));
23683
23684 write_imagef(dst, p, next ? val1 : val2);
23685 }
23686
23688 VAAPI Video filters are usually used with VAAPI decoder and VAAPI
23689 encoder. Below is a description of VAAPI video filters.
23690
23691 To enable compilation of these filters you need to configure FFmpeg
23692 with "--enable-vaapi".
23693
23694 To use vaapi filters, you need to setup the vaapi device correctly. For
23695 more information, please read
23696 <https://trac.ffmpeg.org/wiki/Hardware/VAAPI>
23697
23698 overlay_vaapi
23699 Overlay one video on the top of another.
23700
23701 It takes two inputs and has one output. The first input is the "main"
23702 video on which the second input is overlaid.
23703
23704 The filter accepts the following options:
23705
23706 x
23707 y Set expressions for the x and y coordinates of the overlaid video
23708 on the main video.
23709
23710 Default value is "0" for both expressions.
23711
23712 w
23713 h Set expressions for the width and height the overlaid video on the
23714 main video.
23715
23716 Default values are 'overlay_iw' for 'w' and
23717 'overlay_ih*w/overlay_iw' for 'h'.
23718
23719 The expressions can contain the following parameters:
23720
23721 main_w, W
23722 main_h, H
23723 The main input width and height.
23724
23725 overlay_iw
23726 overlay_ih
23727 The overlay input width and height.
23728
23729 overlay_w, w
23730 overlay_h, h
23731 The overlay output width and height.
23732
23733 overlay_x, x
23734 overlay_y, y
23735 Position of the overlay layer inside of main
23736
23737 alpha
23738 Set transparency of overlaid video. Allowed range is 0.0 to 1.0.
23739 Higher value means lower transparency. Default value is 1.0.
23740
23741 eof_action
23742 See framesync.
23743
23744 shortest
23745 See framesync.
23746
23747 repeatlast
23748 See framesync.
23749
23750 This filter also supports the framesync options.
23751
23752 Examples
23753
23754 • Overlay an image LOGO at the top-left corner of the INPUT video.
23755 Both inputs for this filter are yuv420p format.
23756
23757 -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuv420p, hwupload[b], [a][b]overlay_vaapi" OUTPUT
23758
23759 • Overlay an image LOGO at the offset (200, 100) from the top-left
23760 corner of the INPUT video. The inputs have same memory layout for
23761 color channels, the overlay has additional alpha plane, like INPUT
23762 is yuv420p, and the LOGO is yuva420p.
23763
23764 -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuva420p, hwupload[b], [a][b]overlay_vaapi=x=200:y=100:w=400:h=300:alpha=1.0, hwdownload, format=nv12" OUTPUT
23765
23766 tonemap_vaapi
23767 Perform HDR(High Dynamic Range) to SDR(Standard Dynamic Range)
23768 conversion with tone-mapping. It maps the dynamic range of HDR10
23769 content to the SDR content. It currently only accepts HDR10 as input.
23770
23771 It accepts the following parameters:
23772
23773 format
23774 Specify the output pixel format.
23775
23776 Currently supported formats are:
23777
23778 p010
23779 nv12
23780
23781 Default is nv12.
23782
23783 primaries, p
23784 Set the output color primaries.
23785
23786 Default is same as input.
23787
23788 transfer, t
23789 Set the output transfer characteristics.
23790
23791 Default is bt709.
23792
23793 matrix, m
23794 Set the output colorspace matrix.
23795
23796 Default is same as input.
23797
23798 Example
23799
23800 • Convert HDR(HDR10) video to bt2020-transfer-characteristic p010
23801 format
23802
23803 tonemap_vaapi=format=p010:t=bt2020-10
23804
23805 hstack_vaapi
23806 Stack input videos horizontally.
23807
23808 This is the VA-API variant of the hstack filter, each input stream may
23809 have different height, this filter will scale down/up each input stream
23810 while keeping the orignal aspect.
23811
23812 It accepts the following options:
23813
23814 inputs
23815 See hstack.
23816
23817 shortest
23818 See hstack.
23819
23820 height
23821 Set height of output. If set to 0, this filter will set height of
23822 output to height of the first input stream. Default value is 0.
23823
23824 vstack_vaapi
23825 Stack input videos vertically.
23826
23827 This is the VA-API variant of the vstack filter, each input stream may
23828 have different width, this filter will scale down/up each input stream
23829 while keeping the orignal aspect.
23830
23831 It accepts the following options:
23832
23833 inputs
23834 See vstack.
23835
23836 shortest
23837 See vstack.
23838
23839 width
23840 Set width of output. If set to 0, this filter will set width of
23841 output to width of the first input stream. Default value is 0.
23842
23843 xstack_vaapi
23844 Stack video inputs into custom layout.
23845
23846 This is the VA-API variant of the xstack filter, each input stream may
23847 have different size, this filter will scale down/up each input stream
23848 to the given output size, or the size of the first input stream.
23849
23850 It accepts the following options:
23851
23852 inputs
23853 See xstack.
23854
23855 shortest
23856 See xstack.
23857
23858 layout
23859 See xstack. Moreover, this permits the user to supply output size
23860 for each input stream.
23861
23862 xstack_vaapi=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
23863
23864 grid
23865 See xstack.
23866
23867 grid_tile_size
23868 Set output size for each input stream when grid is set. If this
23869 option is not set, this filter will set output size by default to
23870 the size of the first input stream. For the syntax of this option,
23871 check the "Video size" section in the ffmpeg-utils manual.
23872
23873 fill
23874 See xstack.
23875
23877 Below is a description of the currently available QSV video filters.
23878
23879 To enable compilation of these filters you need to configure FFmpeg
23880 with "--enable-libmfx" or "--enable-libvpl".
23881
23882 To use QSV filters, you need to setup the QSV device correctly. For
23883 more information, please read
23884 <https://trac.ffmpeg.org/wiki/Hardware/QuickSync>
23885
23886 hstack_qsv
23887 Stack input videos horizontally.
23888
23889 This is the QSV variant of the hstack filter, each input stream may
23890 have different height, this filter will scale down/up each input stream
23891 while keeping the orignal aspect.
23892
23893 It accepts the following options:
23894
23895 inputs
23896 See hstack.
23897
23898 shortest
23899 See hstack.
23900
23901 height
23902 Set height of output. If set to 0, this filter will set height of
23903 output to height of the first input stream. Default value is 0.
23904
23905 vstack_qsv
23906 Stack input videos vertically.
23907
23908 This is the QSV variant of the vstack filter, each input stream may
23909 have different width, this filter will scale down/up each input stream
23910 while keeping the orignal aspect.
23911
23912 It accepts the following options:
23913
23914 inputs
23915 See vstack.
23916
23917 shortest
23918 See vstack.
23919
23920 width
23921 Set width of output. If set to 0, this filter will set width of
23922 output to width of the first input stream. Default value is 0.
23923
23924 xstack_qsv
23925 Stack video inputs into custom layout.
23926
23927 This is the QSV variant of the xstack filter.
23928
23929 It accepts the following options:
23930
23931 inputs
23932 See xstack.
23933
23934 shortest
23935 See xstack.
23936
23937 layout
23938 See xstack. Moreover, this permits the user to supply output size
23939 for each input stream.
23940
23941 xstack_qsv=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
23942
23943 grid
23944 See xstack.
23945
23946 grid_tile_size
23947 Set output size for each input stream when grid is set. If this
23948 option is not set, this filter will set output size by default to
23949 the size of the first input stream. For the syntax of this option,
23950 check the "Video size" section in the ffmpeg-utils manual.
23951
23952 fill
23953 See xstack.
23954
23956 Below is a description of the currently available video sources.
23957
23958 buffer
23959 Buffer video frames, and make them available to the filter chain.
23960
23961 This source is mainly intended for a programmatic use, in particular
23962 through the interface defined in libavfilter/buffersrc.h.
23963
23964 It accepts the following parameters:
23965
23966 video_size
23967 Specify the size (width and height) of the buffered video frames.
23968 For the syntax of this option, check the "Video size" section in
23969 the ffmpeg-utils manual.
23970
23971 width
23972 The input video width.
23973
23974 height
23975 The input video height.
23976
23977 pix_fmt
23978 A string representing the pixel format of the buffered video
23979 frames. It may be a number corresponding to a pixel format, or a
23980 pixel format name.
23981
23982 time_base
23983 Specify the timebase assumed by the timestamps of the buffered
23984 frames.
23985
23986 frame_rate
23987 Specify the frame rate expected for the video stream.
23988
23989 pixel_aspect, sar
23990 The sample (pixel) aspect ratio of the input video.
23991
23992 hw_frames_ctx
23993 When using a hardware pixel format, this should be a reference to
23994 an AVHWFramesContext describing input frames.
23995
23996 For example:
23997
23998 buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
23999
24000 will instruct the source to accept video frames with size 320x240 and
24001 with format "yuv410p", assuming 1/24 as the timestamps timebase and
24002 square pixels (1:1 sample aspect ratio). Since the pixel format with
24003 name "yuv410p" corresponds to the number 6 (check the enum
24004 AVPixelFormat definition in libavutil/pixfmt.h), this example
24005 corresponds to:
24006
24007 buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
24008
24009 Alternatively, the options can be specified as a flat string, but this
24010 syntax is deprecated:
24011
24012 width:height:pix_fmt:time_base.num:time_base.den:pixel_aspect.num:pixel_aspect.den
24013
24014 cellauto
24015 Create a pattern generated by an elementary cellular automaton.
24016
24017 The initial state of the cellular automaton can be defined through the
24018 filename and pattern options. If such options are not specified an
24019 initial state is created randomly.
24020
24021 At each new frame a new row in the video is filled with the result of
24022 the cellular automaton next generation. The behavior when the whole
24023 frame is filled is defined by the scroll option.
24024
24025 This source accepts the following options:
24026
24027 filename, f
24028 Read the initial cellular automaton state, i.e. the starting row,
24029 from the specified file. In the file, each non-whitespace
24030 character is considered an alive cell, a newline will terminate the
24031 row, and further characters in the file will be ignored.
24032
24033 pattern, p
24034 Read the initial cellular automaton state, i.e. the starting row,
24035 from the specified string.
24036
24037 Each non-whitespace character in the string is considered an alive
24038 cell, a newline will terminate the row, and further characters in
24039 the string will be ignored.
24040
24041 rate, r
24042 Set the video rate, that is the number of frames generated per
24043 second. Default is 25.
24044
24045 random_fill_ratio, ratio
24046 Set the random fill ratio for the initial cellular automaton row.
24047 It is a floating point number value ranging from 0 to 1, defaults
24048 to 1/PHI.
24049
24050 This option is ignored when a file or a pattern is specified.
24051
24052 random_seed, seed
24053 Set the seed for filling randomly the initial row, must be an
24054 integer included between 0 and UINT32_MAX. If not specified, or if
24055 explicitly set to -1, the filter will try to use a good random seed
24056 on a best effort basis.
24057
24058 rule
24059 Set the cellular automaton rule, it is a number ranging from 0 to
24060 255. Default value is 110.
24061
24062 size, s
24063 Set the size of the output video. For the syntax of this option,
24064 check the "Video size" section in the ffmpeg-utils manual.
24065
24066 If filename or pattern is specified, the size is set by default to
24067 the width of the specified initial state row, and the height is set
24068 to width * PHI.
24069
24070 If size is set, it must contain the width of the specified pattern
24071 string, and the specified pattern will be centered in the larger
24072 row.
24073
24074 If a filename or a pattern string is not specified, the size value
24075 defaults to "320x518" (used for a randomly generated initial
24076 state).
24077
24078 scroll
24079 If set to 1, scroll the output upward when all the rows in the
24080 output have been already filled. If set to 0, the new generated row
24081 will be written over the top row just after the bottom row is
24082 filled. Defaults to 1.
24083
24084 start_full, full
24085 If set to 1, completely fill the output with generated rows before
24086 outputting the first frame. This is the default behavior, for
24087 disabling set the value to 0.
24088
24089 stitch
24090 If set to 1, stitch the left and right row edges together. This is
24091 the default behavior, for disabling set the value to 0.
24092
24093 Examples
24094
24095 • Read the initial state from pattern, and specify an output of size
24096 200x400.
24097
24098 cellauto=f=pattern:s=200x400
24099
24100 • Generate a random initial row with a width of 200 cells, with a
24101 fill ratio of 2/3:
24102
24103 cellauto=ratio=2/3:s=200x200
24104
24105 • Create a pattern generated by rule 18 starting by a single alive
24106 cell centered on an initial row with width 100:
24107
24108 cellauto=p=@s=100x400:full=0:rule=18
24109
24110 • Specify a more elaborated initial pattern:
24111
24112 cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
24113
24114 coreimagesrc
24115 Video source generated on GPU using Apple's CoreImage API on OSX.
24116
24117 This video source is a specialized version of the coreimage video
24118 filter. Use a core image generator at the beginning of the applied
24119 filterchain to generate the content.
24120
24121 The coreimagesrc video source accepts the following options:
24122
24123 list_generators
24124 List all available generators along with all their respective
24125 options as well as possible minimum and maximum values along with
24126 the default values.
24127
24128 list_generators=true
24129
24130 size, s
24131 Specify the size of the sourced video. For the syntax of this
24132 option, check the "Video size" section in the ffmpeg-utils manual.
24133 The default value is "320x240".
24134
24135 rate, r
24136 Specify the frame rate of the sourced video, as the number of
24137 frames generated per second. It has to be a string in the format
24138 frame_rate_num/frame_rate_den, an integer number, a floating point
24139 number or a valid video frame rate abbreviation. The default value
24140 is "25".
24141
24142 sar Set the sample aspect ratio of the sourced video.
24143
24144 duration, d
24145 Set the duration of the sourced video. See the Time duration
24146 section in the ffmpeg-utils(1) manual for the accepted syntax.
24147
24148 If not specified, or the expressed duration is negative, the video
24149 is supposed to be generated forever.
24150
24151 Additionally, all options of the coreimage video filter are accepted.
24152 A complete filterchain can be used for further processing of the
24153 generated input without CPU-HOST transfer. See coreimage documentation
24154 and examples for details.
24155
24156 Examples
24157
24158 • Use CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
24159 given as complete and escaped command-line for Apple's standard
24160 bash shell:
24161
24162 ffmpeg -f lavfi -i coreimagesrc=s=100x100:filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
24163
24164 This example is equivalent to the QRCode example of coreimage
24165 without the need for a nullsrc video source.
24166
24167 ddagrab
24168 Captures the Windows Desktop via Desktop Duplication API.
24169
24170 The filter exclusively returns D3D11 Hardware Frames, for on-gpu
24171 encoding or processing. So an explicit hwdownload is needed for any
24172 kind of software processing.
24173
24174 It accepts the following options:
24175
24176 output_idx
24177 DXGI Output Index to capture.
24178
24179 Usually corresponds to the index Windows has given the screen minus
24180 one, so it's starting at 0.
24181
24182 Defaults to output 0.
24183
24184 draw_mouse
24185 Whether to draw the mouse cursor.
24186
24187 Defaults to true.
24188
24189 Only affects hardware cursors. If a game or application renders its
24190 own cursor, it'll always be captured.
24191
24192 framerate
24193 Framerate at which the desktop will be captured.
24194
24195 Defaults to 30 FPS.
24196
24197 video_size
24198 Specify the size of the captured video.
24199
24200 Defaults to the full size of the screen.
24201
24202 Cropped from the bottom/right if smaller than screen size.
24203
24204 offset_x
24205 Horizontal offset of the captured video.
24206
24207 offset_y
24208 Vertical offset of the captured video.
24209
24210 output_fmt
24211 Desired filter output format. Defaults to 8 Bit BGRA.
24212
24213 It accepts the following values:
24214
24215 auto
24216 Passes all supported output formats to DDA and returns what DDA
24217 decides to use.
24218
24219 8bit
24220 bgra
24221 8 Bit formats always work, and DDA will convert to them if
24222 neccesary.
24223
24224 10bit
24225 x2bgr10
24226 Filter initialization will fail if 10 bit format is requested
24227 but unavailable.
24228
24229 Examples
24230
24231 Capture primary screen and encode using nvenc:
24232
24233 ffmpeg -f lavfi -i ddagrab -c:v h264_nvenc -cq 18 output.mp4
24234
24235 You can also skip the lavfi device and directly use the filter. Also
24236 demonstrates downloading the frame and encoding with libx264. Explicit
24237 output format specification is required in this case:
24238
24239 ffmpeg -filter_complex ddagrab=output_idx=1:framerate=60,hwdownload,format=bgra -c:v libx264 -crf 18 output.mp4
24240
24241 If you want to capture only a subsection of the desktop, this can be
24242 achieved by specifying a smaller size and its offsets into the screen:
24243
24244 ddagrab=video_size=800x600:offset_x=100:offset_y=100
24245
24246 gradients
24247 Generate several gradients.
24248
24249 size, s
24250 Set frame size. For the syntax of this option, check the "Video
24251 size" section in the ffmpeg-utils manual. Default value is
24252 "640x480".
24253
24254 rate, r
24255 Set frame rate, expressed as number of frames per second. Default
24256 value is "25".
24257
24258 c0, c1, c2, c3, c4, c5, c6, c7
24259 Set 8 colors. Default values for colors is to pick random one.
24260
24261 x0, y0, y0, y1
24262 Set gradient line source and destination points. If negative or out
24263 of range, random ones are picked.
24264
24265 nb_colors, n
24266 Set number of colors to use at once. Allowed range is from 2 to 8.
24267 Default value is 2.
24268
24269 seed
24270 Set seed for picking gradient line points.
24271
24272 duration, d
24273 Set the duration of the sourced video. See the Time duration
24274 section in the ffmpeg-utils(1) manual for the accepted syntax.
24275
24276 If not specified, or the expressed duration is negative, the video
24277 is supposed to be generated forever.
24278
24279 speed
24280 Set speed of gradients rotation.
24281
24282 type, t
24283 Set type of gradients, can be "linear" or "radial" or "circular" or
24284 "spiral".
24285
24286 mandelbrot
24287 Generate a Mandelbrot set fractal, and progressively zoom towards the
24288 point specified with start_x and start_y.
24289
24290 This source accepts the following options:
24291
24292 end_pts
24293 Set the terminal pts value. Default value is 400.
24294
24295 end_scale
24296 Set the terminal scale value. Must be a floating point value.
24297 Default value is 0.3.
24298
24299 inner
24300 Set the inner coloring mode, that is the algorithm used to draw the
24301 Mandelbrot fractal internal region.
24302
24303 It shall assume one of the following values:
24304
24305 black
24306 Set black mode.
24307
24308 convergence
24309 Show time until convergence.
24310
24311 mincol
24312 Set color based on point closest to the origin of the
24313 iterations.
24314
24315 period
24316 Set period mode.
24317
24318 Default value is mincol.
24319
24320 bailout
24321 Set the bailout value. Default value is 10.0.
24322
24323 maxiter
24324 Set the maximum of iterations performed by the rendering algorithm.
24325 Default value is 7189.
24326
24327 outer
24328 Set outer coloring mode. It shall assume one of following values:
24329
24330 iteration_count
24331 Set iteration count mode.
24332
24333 normalized_iteration_count
24334 set normalized iteration count mode.
24335
24336 Default value is normalized_iteration_count.
24337
24338 rate, r
24339 Set frame rate, expressed as number of frames per second. Default
24340 value is "25".
24341
24342 size, s
24343 Set frame size. For the syntax of this option, check the "Video
24344 size" section in the ffmpeg-utils manual. Default value is
24345 "640x480".
24346
24347 start_scale
24348 Set the initial scale value. Default value is 3.0.
24349
24350 start_x
24351 Set the initial x position. Must be a floating point value between
24352 -100 and 100. Default value is
24353 -0.743643887037158704752191506114774.
24354
24355 start_y
24356 Set the initial y position. Must be a floating point value between
24357 -100 and 100. Default value is
24358 -0.131825904205311970493132056385139.
24359
24360 mptestsrc
24361 Generate various test patterns, as generated by the MPlayer test
24362 filter.
24363
24364 The size of the generated video is fixed, and is 256x256. This source
24365 is useful in particular for testing encoding features.
24366
24367 This source accepts the following options:
24368
24369 rate, r
24370 Specify the frame rate of the sourced video, as the number of
24371 frames generated per second. It has to be a string in the format
24372 frame_rate_num/frame_rate_den, an integer number, a floating point
24373 number or a valid video frame rate abbreviation. The default value
24374 is "25".
24375
24376 duration, d
24377 Set the duration of the sourced video. See the Time duration
24378 section in the ffmpeg-utils(1) manual for the accepted syntax.
24379
24380 If not specified, or the expressed duration is negative, the video
24381 is supposed to be generated forever.
24382
24383 test, t
24384 Set the number or the name of the test to perform. Supported tests
24385 are:
24386
24387 dc_luma
24388 dc_chroma
24389 freq_luma
24390 freq_chroma
24391 amp_luma
24392 amp_chroma
24393 cbp
24394 mv
24395 ring1
24396 ring2
24397 all
24398 max_frames, m
24399 Set the maximum number of frames generated for each test,
24400 default value is 30.
24401
24402 Default value is "all", which will cycle through the list of all
24403 tests.
24404
24405 Some examples:
24406
24407 mptestsrc=t=dc_luma
24408
24409 will generate a "dc_luma" test pattern.
24410
24411 frei0r_src
24412 Provide a frei0r source.
24413
24414 To enable compilation of this filter you need to install the frei0r
24415 header and configure FFmpeg with "--enable-frei0r".
24416
24417 This source accepts the following parameters:
24418
24419 size
24420 The size of the video to generate. For the syntax of this option,
24421 check the "Video size" section in the ffmpeg-utils manual.
24422
24423 framerate
24424 The framerate of the generated video. It may be a string of the
24425 form num/den or a frame rate abbreviation.
24426
24427 filter_name
24428 The name to the frei0r source to load. For more information
24429 regarding frei0r and how to set the parameters, read the frei0r
24430 section in the video filters documentation.
24431
24432 filter_params
24433 A '|'-separated list of parameters to pass to the frei0r source.
24434
24435 For example, to generate a frei0r partik0l source with size 200x200 and
24436 frame rate 10 which is overlaid on the overlay filter main input:
24437
24438 frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
24439
24440 life
24441 Generate a life pattern.
24442
24443 This source is based on a generalization of John Conway's life game.
24444
24445 The sourced input represents a life grid, each pixel represents a cell
24446 which can be in one of two possible states, alive or dead. Every cell
24447 interacts with its eight neighbours, which are the cells that are
24448 horizontally, vertically, or diagonally adjacent.
24449
24450 At each interaction the grid evolves according to the adopted rule,
24451 which specifies the number of neighbor alive cells which will make a
24452 cell stay alive or born. The rule option allows one to specify the rule
24453 to adopt.
24454
24455 This source accepts the following options:
24456
24457 filename, f
24458 Set the file from which to read the initial grid state. In the
24459 file, each non-whitespace character is considered an alive cell,
24460 and newline is used to delimit the end of each row.
24461
24462 If this option is not specified, the initial grid is generated
24463 randomly.
24464
24465 rate, r
24466 Set the video rate, that is the number of frames generated per
24467 second. Default is 25.
24468
24469 random_fill_ratio, ratio
24470 Set the random fill ratio for the initial random grid. It is a
24471 floating point number value ranging from 0 to 1, defaults to 1/PHI.
24472 It is ignored when a file is specified.
24473
24474 random_seed, seed
24475 Set the seed for filling the initial random grid, must be an
24476 integer included between 0 and UINT32_MAX. If not specified, or if
24477 explicitly set to -1, the filter will try to use a good random seed
24478 on a best effort basis.
24479
24480 rule
24481 Set the life rule.
24482
24483 A rule can be specified with a code of the kind "SNS/BNB", where NS
24484 and NB are sequences of numbers in the range 0-8, NS specifies the
24485 number of alive neighbor cells which make a live cell stay alive,
24486 and NB the number of alive neighbor cells which make a dead cell to
24487 become alive (i.e. to "born"). "s" and "b" can be used in place of
24488 "S" and "B", respectively.
24489
24490 Alternatively a rule can be specified by an 18-bits integer. The 9
24491 high order bits are used to encode the next cell state if it is
24492 alive for each number of neighbor alive cells, the low order bits
24493 specify the rule for "borning" new cells. Higher order bits encode
24494 for an higher number of neighbor cells. For example the number
24495 6153 = "(12<<9)+9" specifies a stay alive rule of 12 and a born
24496 rule of 9, which corresponds to "S23/B03".
24497
24498 Default value is "S23/B3", which is the original Conway's game of
24499 life rule, and will keep a cell alive if it has 2 or 3 neighbor
24500 alive cells, and will born a new cell if there are three alive
24501 cells around a dead cell.
24502
24503 size, s
24504 Set the size of the output video. For the syntax of this option,
24505 check the "Video size" section in the ffmpeg-utils manual.
24506
24507 If filename is specified, the size is set by default to the same
24508 size of the input file. If size is set, it must contain the size
24509 specified in the input file, and the initial grid defined in that
24510 file is centered in the larger resulting area.
24511
24512 If a filename is not specified, the size value defaults to
24513 "320x240" (used for a randomly generated initial grid).
24514
24515 stitch
24516 If set to 1, stitch the left and right grid edges together, and the
24517 top and bottom edges also. Defaults to 1.
24518
24519 mold
24520 Set cell mold speed. If set, a dead cell will go from death_color
24521 to mold_color with a step of mold. mold can have a value from 0 to
24522 255.
24523
24524 life_color
24525 Set the color of living (or new born) cells.
24526
24527 death_color
24528 Set the color of dead cells. If mold is set, this is the first
24529 color used to represent a dead cell.
24530
24531 mold_color
24532 Set mold color, for definitely dead and moldy cells.
24533
24534 For the syntax of these 3 color options, check the "Color" section
24535 in the ffmpeg-utils manual.
24536
24537 Examples
24538
24539 • Read a grid from pattern, and center it on a grid of size 300x300
24540 pixels:
24541
24542 life=f=pattern:s=300x300
24543
24544 • Generate a random grid of size 200x200, with a fill ratio of 2/3:
24545
24546 life=ratio=2/3:s=200x200
24547
24548 • Specify a custom rule for evolving a randomly generated grid:
24549
24550 life=rule=S14/B34
24551
24552 • Full example with slow death effect (mold) using ffplay:
24553
24554 ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16
24555
24556 allrgb, allyuv, color, colorchart, colorspectrum, haldclutsrc, nullsrc,
24557 pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc,
24558 testsrc2, yuvtestsrc
24559 The "allrgb" source returns frames of size 4096x4096 of all rgb colors.
24560
24561 The "allyuv" source returns frames of size 4096x4096 of all yuv colors.
24562
24563 The "color" source provides an uniformly colored input.
24564
24565 The "colorchart" source provides a colors checker chart.
24566
24567 The "colorspectrum" source provides a color spectrum input.
24568
24569 The "haldclutsrc" source provides an identity Hald CLUT. See also
24570 haldclut filter.
24571
24572 The "nullsrc" source returns unprocessed video frames. It is mainly
24573 useful to be employed in analysis / debugging tools, or as the source
24574 for filters which ignore the input data.
24575
24576 The "pal75bars" source generates a color bars pattern, based on EBU PAL
24577 recommendations with 75% color levels.
24578
24579 The "pal100bars" source generates a color bars pattern, based on EBU
24580 PAL recommendations with 100% color levels.
24581
24582 The "rgbtestsrc" source generates an RGB test pattern useful for
24583 detecting RGB vs BGR issues. You should see a red, green and blue
24584 stripe from top to bottom.
24585
24586 The "smptebars" source generates a color bars pattern, based on the
24587 SMPTE Engineering Guideline EG 1-1990.
24588
24589 The "smptehdbars" source generates a color bars pattern, based on the
24590 SMPTE RP 219-2002.
24591
24592 The "testsrc" source generates a test video pattern, showing a color
24593 pattern, a scrolling gradient and a timestamp. This is mainly intended
24594 for testing purposes.
24595
24596 The "testsrc2" source is similar to testsrc, but supports more pixel
24597 formats instead of just "rgb24". This allows using it as an input for
24598 other tests without requiring a format conversion.
24599
24600 The "yuvtestsrc" source generates an YUV test pattern. You should see a
24601 y, cb and cr stripe from top to bottom.
24602
24603 The sources accept the following parameters:
24604
24605 level
24606 Specify the level of the Hald CLUT, only available in the
24607 "haldclutsrc" source. A level of "N" generates a picture of "N*N*N"
24608 by "N*N*N" pixels to be used as identity matrix for 3D lookup
24609 tables. Each component is coded on a "1/(N*N)" scale.
24610
24611 color, c
24612 Specify the color of the source, only available in the "color"
24613 source. For the syntax of this option, check the "Color" section in
24614 the ffmpeg-utils manual.
24615
24616 size, s
24617 Specify the size of the sourced video. For the syntax of this
24618 option, check the "Video size" section in the ffmpeg-utils manual.
24619 The default value is "320x240".
24620
24621 This option is not available with the "allrgb", "allyuv", and
24622 "haldclutsrc" filters.
24623
24624 rate, r
24625 Specify the frame rate of the sourced video, as the number of
24626 frames generated per second. It has to be a string in the format
24627 frame_rate_num/frame_rate_den, an integer number, a floating point
24628 number or a valid video frame rate abbreviation. The default value
24629 is "25".
24630
24631 duration, d
24632 Set the duration of the sourced video. See the Time duration
24633 section in the ffmpeg-utils(1) manual for the accepted syntax.
24634
24635 If not specified, or the expressed duration is negative, the video
24636 is supposed to be generated forever.
24637
24638 Since the frame rate is used as time base, all frames including the
24639 last one will have their full duration. If the specified duration
24640 is not a multiple of the frame duration, it will be rounded up.
24641
24642 sar Set the sample aspect ratio of the sourced video.
24643
24644 alpha
24645 Specify the alpha (opacity) of the background, only available in
24646 the "testsrc2" source. The value must be between 0 (fully
24647 transparent) and 255 (fully opaque, the default).
24648
24649 decimals, n
24650 Set the number of decimals to show in the timestamp, only available
24651 in the "testsrc" source.
24652
24653 The displayed timestamp value will correspond to the original
24654 timestamp value multiplied by the power of 10 of the specified
24655 value. Default value is 0.
24656
24657 type
24658 Set the type of the color spectrum, only available in the
24659 "colorspectrum" source. Can be one of the following:
24660
24661 black
24662 white
24663 all
24664 patch_size
24665 Set patch size of single color patch, only available in the
24666 "colorchart" source. Default is "64x64".
24667
24668 preset
24669 Set colorchecker colors preset, only available in the "colorchart"
24670 source.
24671
24672 Available values are:
24673
24674 reference
24675 skintones
24676
24677 Default value is "reference".
24678
24679 Examples
24680
24681 • Generate a video with a duration of 5.3 seconds, with size 176x144
24682 and a frame rate of 10 frames per second:
24683
24684 testsrc=duration=5.3:size=qcif:rate=10
24685
24686 • The following graph description will generate a red source with an
24687 opacity of 0.2, with size "qcif" and a frame rate of 10 frames per
24688 second:
24689
24690 color=c=red@0.2:s=qcif:r=10
24691
24692 • If the input content is to be ignored, "nullsrc" can be used. The
24693 following command generates noise in the luminance plane by
24694 employing the "geq" filter:
24695
24696 nullsrc=s=256x256, geq=random(1)*255:128:128
24697
24698 Commands
24699
24700 The "color" source supports the following commands:
24701
24702 c, color
24703 Set the color of the created image. Accepts the same syntax of the
24704 corresponding color option.
24705
24706 openclsrc
24707 Generate video using an OpenCL program.
24708
24709 source
24710 OpenCL program source file.
24711
24712 kernel
24713 Kernel name in program.
24714
24715 size, s
24716 Size of frames to generate. This must be set.
24717
24718 format
24719 Pixel format to use for the generated frames. This must be set.
24720
24721 rate, r
24722 Number of frames generated every second. Default value is '25'.
24723
24724 For details of how the program loading works, see the program_opencl
24725 filter.
24726
24727 Example programs:
24728
24729 • Generate a colour ramp by setting pixel values from the position of
24730 the pixel in the output image. (Note that this will work with all
24731 pixel formats, but the generated output will not be the same.)
24732
24733 __kernel void ramp(__write_only image2d_t dst,
24734 unsigned int index)
24735 {
24736 int2 loc = (int2)(get_global_id(0), get_global_id(1));
24737
24738 float4 val;
24739 val.xy = val.zw = convert_float2(loc) / convert_float2(get_image_dim(dst));
24740
24741 write_imagef(dst, loc, val);
24742 }
24743
24744 • Generate a Sierpinski carpet pattern, panning by a single pixel
24745 each frame.
24746
24747 __kernel void sierpinski_carpet(__write_only image2d_t dst,
24748 unsigned int index)
24749 {
24750 int2 loc = (int2)(get_global_id(0), get_global_id(1));
24751
24752 float4 value = 0.0f;
24753 int x = loc.x + index;
24754 int y = loc.y + index;
24755 while (x > 0 || y > 0) {
24756 if (x % 3 == 1 && y % 3 == 1) {
24757 value = 1.0f;
24758 break;
24759 }
24760 x /= 3;
24761 y /= 3;
24762 }
24763
24764 write_imagef(dst, loc, value);
24765 }
24766
24767 sierpinski
24768 Generate a Sierpinski carpet/triangle fractal, and randomly pan around.
24769
24770 This source accepts the following options:
24771
24772 size, s
24773 Set frame size. For the syntax of this option, check the "Video
24774 size" section in the ffmpeg-utils manual. Default value is
24775 "640x480".
24776
24777 rate, r
24778 Set frame rate, expressed as number of frames per second. Default
24779 value is "25".
24780
24781 seed
24782 Set seed which is used for random panning.
24783
24784 jump
24785 Set max jump for single pan destination. Allowed range is from 1 to
24786 10000.
24787
24788 type
24789 Set fractal type, can be default "carpet" or "triangle".
24790
24792 Below is a description of the currently available video sinks.
24793
24794 buffersink
24795 Buffer video frames, and make them available to the end of the filter
24796 graph.
24797
24798 This sink is mainly intended for programmatic use, in particular
24799 through the interface defined in libavfilter/buffersink.h or the
24800 options system.
24801
24802 It accepts a pointer to an AVBufferSinkContext structure, which defines
24803 the incoming buffers' formats, to be passed as the opaque parameter to
24804 "avfilter_init_filter" for initialization.
24805
24806 nullsink
24807 Null video sink: do absolutely nothing with the input video. It is
24808 mainly useful as a template and for use in analysis / debugging tools.
24809
24811 Below is a description of the currently available multimedia filters.
24812
24813 a3dscope
24814 Convert input audio to 3d scope video output.
24815
24816 The filter accepts the following options:
24817
24818 rate, r
24819 Set frame rate, expressed as number of frames per second. Default
24820 value is "25".
24821
24822 size, s
24823 Specify the video size for the output. For the syntax of this
24824 option, check the "Video size" section in the ffmpeg-utils manual.
24825 Default value is "hd720".
24826
24827 fov Set the camera field of view. Default is 90 degrees. Allowed range
24828 is from 40 to 150.
24829
24830 roll
24831 Set the camera roll.
24832
24833 pitch
24834 Set the camera pitch.
24835
24836 yaw Set the camera yaw.
24837
24838 xzoom
24839 Set the camera zoom on X-axis.
24840
24841 yzoom
24842 Set the camera zoom on Y-axis.
24843
24844 zzoom
24845 Set the camera zoom on Z-axis.
24846
24847 xpos
24848 Set the camera position on X-axis.
24849
24850 ypos
24851 Set the camera position on Y-axis.
24852
24853 zpos
24854 Set the camera position on Z-axis.
24855
24856 length
24857 Set the length of displayed audio waves in number of frames.
24858
24859 Commands
24860
24861 Filter supports the some above options as commands.
24862
24863 abitscope
24864 Convert input audio to a video output, displaying the audio bit scope.
24865
24866 The filter accepts the following options:
24867
24868 rate, r
24869 Set frame rate, expressed as number of frames per second. Default
24870 value is "25".
24871
24872 size, s
24873 Specify the video size for the output. For the syntax of this
24874 option, check the "Video size" section in the ffmpeg-utils manual.
24875 Default value is "1024x256".
24876
24877 colors
24878 Specify list of colors separated by space or by '|' which will be
24879 used to draw channels. Unrecognized or missing colors will be
24880 replaced by white color.
24881
24882 mode, m
24883 Set output mode. Can be "bars" or "trace". Default is "bars".
24884
24885 adrawgraph
24886 Draw a graph using input audio metadata.
24887
24888 See drawgraph
24889
24890 agraphmonitor
24891 See graphmonitor.
24892
24893 ahistogram
24894 Convert input audio to a video output, displaying the volume histogram.
24895
24896 The filter accepts the following options:
24897
24898 dmode
24899 Specify how histogram is calculated.
24900
24901 It accepts the following values:
24902
24903 single
24904 Use single histogram for all channels.
24905
24906 separate
24907 Use separate histogram for each channel.
24908
24909 Default is "single".
24910
24911 rate, r
24912 Set frame rate, expressed as number of frames per second. Default
24913 value is "25".
24914
24915 size, s
24916 Specify the video size for the output. For the syntax of this
24917 option, check the "Video size" section in the ffmpeg-utils manual.
24918 Default value is "hd720".
24919
24920 scale
24921 Set display scale.
24922
24923 It accepts the following values:
24924
24925 log logarithmic
24926
24927 sqrt
24928 square root
24929
24930 cbrt
24931 cubic root
24932
24933 lin linear
24934
24935 rlog
24936 reverse logarithmic
24937
24938 Default is "log".
24939
24940 ascale
24941 Set amplitude scale.
24942
24943 It accepts the following values:
24944
24945 log logarithmic
24946
24947 lin linear
24948
24949 Default is "log".
24950
24951 acount
24952 Set how much frames to accumulate in histogram. Default is 1.
24953 Setting this to -1 accumulates all frames.
24954
24955 rheight
24956 Set histogram ratio of window height.
24957
24958 slide
24959 Set sonogram sliding.
24960
24961 It accepts the following values:
24962
24963 replace
24964 replace old rows with new ones.
24965
24966 scroll
24967 scroll from top to bottom.
24968
24969 Default is "replace".
24970
24971 hmode
24972 Set histogram mode.
24973
24974 It accepts the following values:
24975
24976 abs Use absolute values of samples.
24977
24978 sign
24979 Use untouched values of samples.
24980
24981 Default is "abs".
24982
24983 aphasemeter
24984 Measures phase of input audio, which is exported as metadata
24985 "lavfi.aphasemeter.phase", representing mean phase of current audio
24986 frame. A video output can also be produced and is enabled by default.
24987 The audio is passed through as first output.
24988
24989 Audio will be rematrixed to stereo if it has a different channel
24990 layout. Phase value is in range "[-1, 1]" where -1 means left and right
24991 channels are completely out of phase and 1 means channels are in phase.
24992
24993 The filter accepts the following options, all related to its video
24994 output:
24995
24996 rate, r
24997 Set the output frame rate. Default value is 25.
24998
24999 size, s
25000 Set the video size for the output. For the syntax of this option,
25001 check the "Video size" section in the ffmpeg-utils manual. Default
25002 value is "800x400".
25003
25004 rc
25005 gc
25006 bc Specify the red, green, blue contrast. Default values are 2, 7 and
25007 1. Allowed range is "[0, 255]".
25008
25009 mpc Set color which will be used for drawing median phase. If color is
25010 "none" which is default, no median phase value will be drawn.
25011
25012 video
25013 Enable video output. Default is enabled.
25014
25015 phasing detection
25016
25017 The filter also detects out of phase and mono sequences in stereo
25018 streams. It logs the sequence start, end and duration when it lasts
25019 longer or as long as the minimum set.
25020
25021 The filter accepts the following options for this detection:
25022
25023 phasing
25024 Enable mono and out of phase detection. Default is disabled.
25025
25026 tolerance, t
25027 Set phase tolerance for mono detection, in amplitude ratio. Default
25028 is 0. Allowed range is "[0, 1]".
25029
25030 angle, a
25031 Set angle threshold for out of phase detection, in degree. Default
25032 is 170. Allowed range is "[90, 180]".
25033
25034 duration, d
25035 Set mono or out of phase duration until notification, expressed in
25036 seconds. Default is 2.
25037
25038 Examples
25039
25040 • Complete example with ffmpeg to detect 1 second of mono with 0.001
25041 phase tolerance:
25042
25043 ffmpeg -i stereo.wav -af aphasemeter=video=0:phasing=1:duration=1:tolerance=0.001 -f null -
25044
25045 avectorscope
25046 Convert input audio to a video output, representing the audio vector
25047 scope.
25048
25049 The filter is used to measure the difference between channels of stereo
25050 audio stream. A monaural signal, consisting of identical left and right
25051 signal, results in straight vertical line. Any stereo separation is
25052 visible as a deviation from this line, creating a Lissajous figure. If
25053 the straight (or deviation from it) but horizontal line appears this
25054 indicates that the left and right channels are out of phase.
25055
25056 The filter accepts the following options:
25057
25058 mode, m
25059 Set the vectorscope mode.
25060
25061 Available values are:
25062
25063 lissajous
25064 Lissajous rotated by 45 degrees.
25065
25066 lissajous_xy
25067 Same as above but not rotated.
25068
25069 polar
25070 Shape resembling half of circle.
25071
25072 Default value is lissajous.
25073
25074 size, s
25075 Set the video size for the output. For the syntax of this option,
25076 check the "Video size" section in the ffmpeg-utils manual. Default
25077 value is "400x400".
25078
25079 rate, r
25080 Set the output frame rate. Default value is 25.
25081
25082 rc
25083 gc
25084 bc
25085 ac Specify the red, green, blue and alpha contrast. Default values are
25086 40, 160, 80 and 255. Allowed range is "[0, 255]".
25087
25088 rf
25089 gf
25090 bf
25091 af Specify the red, green, blue and alpha fade. Default values are 15,
25092 10, 5 and 5. Allowed range is "[0, 255]".
25093
25094 zoom
25095 Set the zoom factor. Default value is 1. Allowed range is "[0,
25096 10]". Values lower than 1 will auto adjust zoom factor to maximal
25097 possible value.
25098
25099 draw
25100 Set the vectorscope drawing mode.
25101
25102 Available values are:
25103
25104 dot Draw dot for each sample.
25105
25106 line
25107 Draw line between previous and current sample.
25108
25109 aaline
25110 Draw anti-aliased line between previous and current sample.
25111
25112 Default value is dot.
25113
25114 scale
25115 Specify amplitude scale of audio samples.
25116
25117 Available values are:
25118
25119 lin Linear.
25120
25121 sqrt
25122 Square root.
25123
25124 cbrt
25125 Cubic root.
25126
25127 log Logarithmic.
25128
25129 swap
25130 Swap left channel axis with right channel axis.
25131
25132 mirror
25133 Mirror axis.
25134
25135 none
25136 No mirror.
25137
25138 x Mirror only x axis.
25139
25140 y Mirror only y axis.
25141
25142 xy Mirror both axis.
25143
25144 Examples
25145
25146 • Complete example using ffplay:
25147
25148 ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
25149 [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
25150
25151 Commands
25152
25153 This filter supports the all above options as commands except options
25154 "size" and "rate".
25155
25156 bench, abench
25157 Benchmark part of a filtergraph.
25158
25159 The filter accepts the following options:
25160
25161 action
25162 Start or stop a timer.
25163
25164 Available values are:
25165
25166 start
25167 Get the current time, set it as frame metadata (using the key
25168 "lavfi.bench.start_time"), and forward the frame to the next
25169 filter.
25170
25171 stop
25172 Get the current time and fetch the "lavfi.bench.start_time"
25173 metadata from the input frame metadata to get the time
25174 difference. Time difference, average, maximum and minimum time
25175 (respectively "t", "avg", "max" and "min") are then printed.
25176 The timestamps are expressed in seconds.
25177
25178 Examples
25179
25180 • Benchmark selectivecolor filter:
25181
25182 bench=start,selectivecolor=reds=-.2 .12 -.49,bench=stop
25183
25184 concat
25185 Concatenate audio and video streams, joining them together one after
25186 the other.
25187
25188 The filter works on segments of synchronized video and audio streams.
25189 All segments must have the same number of streams of each type, and
25190 that will also be the number of streams at output.
25191
25192 The filter accepts the following options:
25193
25194 n Set the number of segments. Default is 2.
25195
25196 v Set the number of output video streams, that is also the number of
25197 video streams in each segment. Default is 1.
25198
25199 a Set the number of output audio streams, that is also the number of
25200 audio streams in each segment. Default is 0.
25201
25202 unsafe
25203 Activate unsafe mode: do not fail if segments have a different
25204 format.
25205
25206 The filter has v+a outputs: first v video outputs, then a audio
25207 outputs.
25208
25209 There are nx(v+a) inputs: first the inputs for the first segment, in
25210 the same order as the outputs, then the inputs for the second segment,
25211 etc.
25212
25213 Related streams do not always have exactly the same duration, for
25214 various reasons including codec frame size or sloppy authoring. For
25215 that reason, related synchronized streams (e.g. a video and its audio
25216 track) should be concatenated at once. The concat filter will use the
25217 duration of the longest stream in each segment (except the last one),
25218 and if necessary pad shorter audio streams with silence.
25219
25220 For this filter to work correctly, all segments must start at timestamp
25221 0.
25222
25223 All corresponding streams must have the same parameters in all
25224 segments; the filtering system will automatically select a common pixel
25225 format for video streams, and a common sample format, sample rate and
25226 channel layout for audio streams, but other settings, such as
25227 resolution, must be converted explicitly by the user.
25228
25229 Different frame rates are acceptable but will result in variable frame
25230 rate at output; be sure to configure the output file to handle it.
25231
25232 Examples
25233
25234 • Concatenate an opening, an episode and an ending, all in bilingual
25235 version (video in stream 0, audio in streams 1 and 2):
25236
25237 ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
25238 '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
25239 concat=n=3:v=1:a=2 [v] [a1] [a2]' \
25240 -map '[v]' -map '[a1]' -map '[a2]' output.mkv
25241
25242 • Concatenate two parts, handling audio and video separately, using
25243 the (a)movie sources, and adjusting the resolution:
25244
25245 movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
25246 movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
25247 [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
25248
25249 Note that a desync will happen at the stitch if the audio and video
25250 streams do not have exactly the same duration in the first file.
25251
25252 Commands
25253
25254 This filter supports the following commands:
25255
25256 next
25257 Close the current segment and step to the next one
25258
25259 ebur128
25260 EBU R128 scanner filter. This filter takes an audio stream and analyzes
25261 its loudness level. By default, it logs a message at a frequency of
25262 10Hz with the Momentary loudness (identified by "M"), Short-term
25263 loudness ("S"), Integrated loudness ("I") and Loudness Range ("LRA").
25264
25265 The filter can only analyze streams which have sample format is double-
25266 precision floating point. The input stream will be converted to this
25267 specification, if needed. Users may need to insert aformat and/or
25268 aresample filters after this filter to obtain the original parameters.
25269
25270 The filter also has a video output (see the video option) with a real
25271 time graph to observe the loudness evolution. The graphic contains the
25272 logged message mentioned above, so it is not printed anymore when this
25273 option is set, unless the verbose logging is set. The main graphing
25274 area contains the short-term loudness (3 seconds of analysis), and the
25275 gauge on the right is for the momentary loudness (400 milliseconds),
25276 but can optionally be configured to instead display short-term loudness
25277 (see gauge).
25278
25279 The green area marks a +/- 1LU target range around the target loudness
25280 (-23LUFS by default, unless modified through target).
25281
25282 More information about the Loudness Recommendation EBU R128 on
25283 <http://tech.ebu.ch/loudness>.
25284
25285 The filter accepts the following options:
25286
25287 video
25288 Activate the video output. The audio stream is passed unchanged
25289 whether this option is set or no. The video stream will be the
25290 first output stream if activated. Default is 0.
25291
25292 size
25293 Set the video size. This option is for video only. For the syntax
25294 of this option, check the "Video size" section in the ffmpeg-utils
25295 manual. Default and minimum resolution is "640x480".
25296
25297 meter
25298 Set the EBU scale meter. Default is 9. Common values are 9 and 18,
25299 respectively for EBU scale meter +9 and EBU scale meter +18. Any
25300 other integer value between this range is allowed.
25301
25302 metadata
25303 Set metadata injection. If set to 1, the audio input will be
25304 segmented into 100ms output frames, each of them containing various
25305 loudness information in metadata. All the metadata keys are
25306 prefixed with "lavfi.r128.".
25307
25308 Default is 0.
25309
25310 framelog
25311 Force the frame logging level.
25312
25313 Available values are:
25314
25315 quiet
25316 logging disabled
25317
25318 info
25319 information logging level
25320
25321 verbose
25322 verbose logging level
25323
25324 By default, the logging level is set to info. If the video or the
25325 metadata options are set, it switches to verbose.
25326
25327 peak
25328 Set peak mode(s).
25329
25330 Available modes can be cumulated (the option is a "flag" type).
25331 Possible values are:
25332
25333 none
25334 Disable any peak mode (default).
25335
25336 sample
25337 Enable sample-peak mode.
25338
25339 Simple peak mode looking for the higher sample value. It logs a
25340 message for sample-peak (identified by "SPK").
25341
25342 true
25343 Enable true-peak mode.
25344
25345 If enabled, the peak lookup is done on an over-sampled version
25346 of the input stream for better peak accuracy. It logs a message
25347 for true-peak. (identified by "TPK") and true-peak per frame
25348 (identified by "FTPK"). This mode requires a build with
25349 "libswresample".
25350
25351 dualmono
25352 Treat mono input files as "dual mono". If a mono file is intended
25353 for playback on a stereo system, its EBU R128 measurement will be
25354 perceptually incorrect. If set to "true", this option will
25355 compensate for this effect. Multi-channel input files are not
25356 affected by this option.
25357
25358 panlaw
25359 Set a specific pan law to be used for the measurement of dual mono
25360 files. This parameter is optional, and has a default value of
25361 -3.01dB.
25362
25363 target
25364 Set a specific target level (in LUFS) used as relative zero in the
25365 visualization. This parameter is optional and has a default value
25366 of -23LUFS as specified by EBU R128. However, material published
25367 online may prefer a level of -16LUFS (e.g. for use with podcasts or
25368 video platforms).
25369
25370 gauge
25371 Set the value displayed by the gauge. Valid values are "momentary"
25372 and s "shortterm". By default the momentary value will be used, but
25373 in certain scenarios it may be more useful to observe the short
25374 term value instead (e.g. live mixing).
25375
25376 scale
25377 Sets the display scale for the loudness. Valid parameters are
25378 "absolute" (in LUFS) or "relative" (LU) relative to the target.
25379 This only affects the video output, not the summary or continuous
25380 log output.
25381
25382 Examples
25383
25384 • Real-time graph using ffplay, with a EBU scale meter +18:
25385
25386 ffplay -f lavfi -i "amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]"
25387
25388 • Run an analysis with ffmpeg:
25389
25390 ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
25391
25392 interleave, ainterleave
25393 Temporally interleave frames from several inputs.
25394
25395 "interleave" works with video inputs, "ainterleave" with audio.
25396
25397 These filters read frames from several inputs and send the oldest
25398 queued frame to the output.
25399
25400 Input streams must have well defined, monotonically increasing frame
25401 timestamp values.
25402
25403 In order to submit one frame to output, these filters need to enqueue
25404 at least one frame for each input, so they cannot work in case one
25405 input is not yet terminated and will not receive incoming frames.
25406
25407 For example consider the case when one input is a "select" filter which
25408 always drops input frames. The "interleave" filter will keep reading
25409 from that input, but it will never be able to send new frames to output
25410 until the input sends an end-of-stream signal.
25411
25412 Also, depending on inputs synchronization, the filters will drop frames
25413 in case one input receives more frames than the other ones, and the
25414 queue is already filled.
25415
25416 These filters accept the following options:
25417
25418 nb_inputs, n
25419 Set the number of different inputs, it is 2 by default.
25420
25421 duration
25422 How to determine the end-of-stream.
25423
25424 longest
25425 The duration of the longest input. (default)
25426
25427 shortest
25428 The duration of the shortest input.
25429
25430 first
25431 The duration of the first input.
25432
25433 Examples
25434
25435 • Interleave frames belonging to different streams using ffmpeg:
25436
25437 ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex "[0:v][1:v] interleave" out.avi
25438
25439 • Add flickering blur effect:
25440
25441 select='if(gt(random(0), 0.2), 1, 2)':n=2 [tmp], boxblur=2:2, [tmp] interleave
25442
25443 latency, alatency
25444 Measure filtering latency.
25445
25446 Report previous filter filtering latency, delay in number of audio
25447 samples for audio filters or number of video frames for video filters.
25448
25449 On end of input stream, filter will report min and max measured latency
25450 for previous running filter in filtergraph.
25451
25452 metadata, ametadata
25453 Manipulate frame metadata.
25454
25455 This filter accepts the following options:
25456
25457 mode
25458 Set mode of operation of the filter.
25459
25460 Can be one of the following:
25461
25462 select
25463 If both "value" and "key" is set, select frames which have such
25464 metadata. If only "key" is set, select every frame that has
25465 such key in metadata.
25466
25467 add Add new metadata "key" and "value". If key is already available
25468 do nothing.
25469
25470 modify
25471 Modify value of already present key.
25472
25473 delete
25474 If "value" is set, delete only keys that have such value.
25475 Otherwise, delete key. If "key" is not set, delete all metadata
25476 values in the frame.
25477
25478 print
25479 Print key and its value if metadata was found. If "key" is not
25480 set print all metadata values available in frame.
25481
25482 key Set key used with all modes. Must be set for all modes except
25483 "print" and "delete".
25484
25485 value
25486 Set metadata value which will be used. This option is mandatory for
25487 "modify" and "add" mode.
25488
25489 function
25490 Which function to use when comparing metadata value and "value".
25491
25492 Can be one of following:
25493
25494 same_str
25495 Values are interpreted as strings, returns true if metadata
25496 value is same as "value".
25497
25498 starts_with
25499 Values are interpreted as strings, returns true if metadata
25500 value starts with the "value" option string.
25501
25502 less
25503 Values are interpreted as floats, returns true if metadata
25504 value is less than "value".
25505
25506 equal
25507 Values are interpreted as floats, returns true if "value" is
25508 equal with metadata value.
25509
25510 greater
25511 Values are interpreted as floats, returns true if metadata
25512 value is greater than "value".
25513
25514 expr
25515 Values are interpreted as floats, returns true if expression
25516 from option "expr" evaluates to true.
25517
25518 ends_with
25519 Values are interpreted as strings, returns true if metadata
25520 value ends with the "value" option string.
25521
25522 expr
25523 Set expression which is used when "function" is set to "expr". The
25524 expression is evaluated through the eval API and can contain the
25525 following constants:
25526
25527 VALUE1, FRAMEVAL
25528 Float representation of "value" from metadata key.
25529
25530 VALUE2, USERVAL
25531 Float representation of "value" as supplied by user in "value"
25532 option.
25533
25534 file
25535 If specified in "print" mode, output is written to the named file.
25536 Instead of plain filename any writable url can be specified.
25537 Filename ``-'' is a shorthand for standard output. If "file" option
25538 is not set, output is written to the log with AV_LOG_INFO loglevel.
25539
25540 direct
25541 Reduces buffering in print mode when output is written to a URL set
25542 using file.
25543
25544 Examples
25545
25546 • Print all metadata values for frames with key
25547 "lavfi.signalstats.YDIF" with values between 0 and 1.
25548
25549 signalstats,metadata=print:key=lavfi.signalstats.YDIF:value=0:function=expr:expr='between(VALUE1,0,1)'
25550
25551 • Print silencedetect output to file metadata.txt.
25552
25553 silencedetect,ametadata=mode=print:file=metadata.txt
25554
25555 • Direct all metadata to a pipe with file descriptor 4.
25556
25557 metadata=mode=print:file='pipe\:4'
25558
25559 perms, aperms
25560 Set read/write permissions for the output frames.
25561
25562 These filters are mainly aimed at developers to test direct path in the
25563 following filter in the filtergraph.
25564
25565 The filters accept the following options:
25566
25567 mode
25568 Select the permissions mode.
25569
25570 It accepts the following values:
25571
25572 none
25573 Do nothing. This is the default.
25574
25575 ro Set all the output frames read-only.
25576
25577 rw Set all the output frames directly writable.
25578
25579 toggle
25580 Make the frame read-only if writable, and writable if read-
25581 only.
25582
25583 random
25584 Set each output frame read-only or writable randomly.
25585
25586 seed
25587 Set the seed for the random mode, must be an integer included
25588 between 0 and "UINT32_MAX". If not specified, or if explicitly set
25589 to -1, the filter will try to use a good random seed on a best
25590 effort basis.
25591
25592 Note: in case of auto-inserted filter between the permission filter and
25593 the following one, the permission might not be received as expected in
25594 that following filter. Inserting a format or aformat filter before the
25595 perms/aperms filter can avoid this problem.
25596
25597 realtime, arealtime
25598 Slow down filtering to match real time approximately.
25599
25600 These filters will pause the filtering for a variable amount of time to
25601 match the output rate with the input timestamps. They are similar to
25602 the re option to "ffmpeg".
25603
25604 They accept the following options:
25605
25606 limit
25607 Time limit for the pauses. Any pause longer than that will be
25608 considered a timestamp discontinuity and reset the timer. Default
25609 is 2 seconds.
25610
25611 speed
25612 Speed factor for processing. The value must be a float larger than
25613 zero. Values larger than 1.0 will result in faster than realtime
25614 processing, smaller will slow processing down. The limit is
25615 automatically adapted accordingly. Default is 1.0.
25616
25617 A processing speed faster than what is possible without these
25618 filters cannot be achieved.
25619
25620 Commands
25621
25622 Both filters supports the all above options as commands.
25623
25624 segment, asegment
25625 Split single input stream into multiple streams.
25626
25627 This filter does opposite of concat filters.
25628
25629 "segment" works on video frames, "asegment" on audio samples.
25630
25631 This filter accepts the following options:
25632
25633 timestamps
25634 Timestamps of output segments separated by '|'. The first segment
25635 will run from the beginning of the input stream. The last segment
25636 will run until the end of the input stream
25637
25638 frames, samples
25639 Exact frame/sample count to split the segments.
25640
25641 In all cases, prefixing an each segment with '+' will make it relative
25642 to the previous segment.
25643
25644 Examples
25645
25646 • Split input audio stream into three output audio streams, starting
25647 at start of input audio stream and storing that in 1st output audio
25648 stream, then following at 60th second and storing than in 2nd
25649 output audio stream, and last after 150th second of input audio
25650 stream store in 3rd output audio stream:
25651
25652 asegment=timestamps="60|150"
25653
25654 select, aselect
25655 Select frames to pass in output.
25656
25657 This filter accepts the following options:
25658
25659 expr, e
25660 Set expression, which is evaluated for each input frame.
25661
25662 If the expression is evaluated to zero, the frame is discarded.
25663
25664 If the evaluation result is negative or NaN, the frame is sent to
25665 the first output; otherwise it is sent to the output with index
25666 "ceil(val)-1", assuming that the input index starts from 0.
25667
25668 For example a value of 1.2 corresponds to the output with index
25669 "ceil(1.2)-1 = 2-1 = 1", that is the second output.
25670
25671 outputs, n
25672 Set the number of outputs. The output to which to send the selected
25673 frame is based on the result of the evaluation. Default value is 1.
25674
25675 The expression can contain the following constants:
25676
25677 n The (sequential) number of the filtered frame, starting from 0.
25678
25679 selected_n
25680 The (sequential) number of the selected frame, starting from 0.
25681
25682 prev_selected_n
25683 The sequential number of the last selected frame. It's NAN if
25684 undefined.
25685
25686 TB The timebase of the input timestamps.
25687
25688 pts The PTS (Presentation TimeStamp) of the filtered frame, expressed
25689 in TB units. It's NAN if undefined.
25690
25691 t The PTS of the filtered frame, expressed in seconds. It's NAN if
25692 undefined.
25693
25694 prev_pts
25695 The PTS of the previously filtered frame. It's NAN if undefined.
25696
25697 prev_selected_pts
25698 The PTS of the last previously filtered frame. It's NAN if
25699 undefined.
25700
25701 prev_selected_t
25702 The PTS of the last previously selected frame, expressed in
25703 seconds. It's NAN if undefined.
25704
25705 start_pts
25706 The first PTS in the stream which is not NAN. It remains NAN if not
25707 found.
25708
25709 start_t
25710 The first PTS, in seconds, in the stream which is not NAN. It
25711 remains NAN if not found.
25712
25713 pict_type (video only)
25714 The type of the filtered frame. It can assume one of the following
25715 values:
25716
25717 I
25718 P
25719 B
25720 S
25721 SI
25722 SP
25723 BI
25724 interlace_type (video only)
25725 The frame interlace type. It can assume one of the following
25726 values:
25727
25728 PROGRESSIVE
25729 The frame is progressive (not interlaced).
25730
25731 TOPFIRST
25732 The frame is top-field-first.
25733
25734 BOTTOMFIRST
25735 The frame is bottom-field-first.
25736
25737 consumed_sample_n (audio only)
25738 the number of selected samples before the current frame
25739
25740 samples_n (audio only)
25741 the number of samples in the current frame
25742
25743 sample_rate (audio only)
25744 the input sample rate
25745
25746 key This is 1 if the filtered frame is a key-frame, 0 otherwise.
25747
25748 pos the position in the file of the filtered frame, -1 if the
25749 information is not available (e.g. for synthetic video)
25750
25751 scene (video only)
25752 value between 0 and 1 to indicate a new scene; a low value reflects
25753 a low probability for the current frame to introduce a new scene,
25754 while a higher value means the current frame is more likely to be
25755 one (see the example below)
25756
25757 concatdec_select
25758 The concat demuxer can select only part of a concat input file by
25759 setting an inpoint and an outpoint, but the output packets may not
25760 be entirely contained in the selected interval. By using this
25761 variable, it is possible to skip frames generated by the concat
25762 demuxer which are not exactly contained in the selected interval.
25763
25764 This works by comparing the frame pts against the
25765 lavf.concat.start_time and the lavf.concat.duration packet metadata
25766 values which are also present in the decoded frames.
25767
25768 The concatdec_select variable is -1 if the frame pts is at least
25769 start_time and either the duration metadata is missing or the frame
25770 pts is less than start_time + duration, 0 otherwise, and NaN if the
25771 start_time metadata is missing.
25772
25773 That basically means that an input frame is selected if its pts is
25774 within the interval set by the concat demuxer.
25775
25776 The default value of the select expression is "1".
25777
25778 Examples
25779
25780 • Select all frames in input:
25781
25782 select
25783
25784 The example above is the same as:
25785
25786 select=1
25787
25788 • Skip all frames:
25789
25790 select=0
25791
25792 • Select only I-frames:
25793
25794 select='eq(pict_type\,I)'
25795
25796 • Select one frame every 100:
25797
25798 select='not(mod(n\,100))'
25799
25800 • Select only frames contained in the 10-20 time interval:
25801
25802 select=between(t\,10\,20)
25803
25804 • Select only I-frames contained in the 10-20 time interval:
25805
25806 select=between(t\,10\,20)*eq(pict_type\,I)
25807
25808 • Select frames with a minimum distance of 10 seconds:
25809
25810 select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
25811
25812 • Use aselect to select only audio frames with samples number > 100:
25813
25814 aselect='gt(samples_n\,100)'
25815
25816 • Create a mosaic of the first scenes:
25817
25818 ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
25819
25820 Comparing scene against a value between 0.3 and 0.5 is generally a
25821 sane choice.
25822
25823 • Send even and odd frames to separate outputs, and compose them:
25824
25825 select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
25826
25827 • Select useful frames from an ffconcat file which is using inpoints
25828 and outpoints but where the source files are not intra frame only.
25829
25830 ffmpeg -copyts -vsync 0 -segment_time_metadata 1 -i input.ffconcat -vf select=concatdec_select -af aselect=concatdec_select output.avi
25831
25832 sendcmd, asendcmd
25833 Send commands to filters in the filtergraph.
25834
25835 These filters read commands to be sent to other filters in the
25836 filtergraph.
25837
25838 "sendcmd" must be inserted between two video filters, "asendcmd" must
25839 be inserted between two audio filters, but apart from that they act the
25840 same way.
25841
25842 The specification of commands can be provided in the filter arguments
25843 with the commands option, or in a file specified by the filename
25844 option.
25845
25846 These filters accept the following options:
25847
25848 commands, c
25849 Set the commands to be read and sent to the other filters.
25850
25851 filename, f
25852 Set the filename of the commands to be read and sent to the other
25853 filters.
25854
25855 Commands syntax
25856
25857 A commands description consists of a sequence of interval
25858 specifications, comprising a list of commands to be executed when a
25859 particular event related to that interval occurs. The occurring event
25860 is typically the current frame time entering or leaving a given time
25861 interval.
25862
25863 An interval is specified by the following syntax:
25864
25865 <START>[-<END>] <COMMANDS>;
25866
25867 The time interval is specified by the START and END times. END is
25868 optional and defaults to the maximum time.
25869
25870 The current frame time is considered within the specified interval if
25871 it is included in the interval [START, END), that is when the time is
25872 greater or equal to START and is lesser than END.
25873
25874 COMMANDS consists of a sequence of one or more command specifications,
25875 separated by ",", relating to that interval. The syntax of a command
25876 specification is given by:
25877
25878 [<FLAGS>] <TARGET> <COMMAND> <ARG>
25879
25880 FLAGS is optional and specifies the type of events relating to the time
25881 interval which enable sending the specified command, and must be a non-
25882 null sequence of identifier flags separated by "+" or "|" and enclosed
25883 between "[" and "]".
25884
25885 The following flags are recognized:
25886
25887 enter
25888 The command is sent when the current frame timestamp enters the
25889 specified interval. In other words, the command is sent when the
25890 previous frame timestamp was not in the given interval, and the
25891 current is.
25892
25893 leave
25894 The command is sent when the current frame timestamp leaves the
25895 specified interval. In other words, the command is sent when the
25896 previous frame timestamp was in the given interval, and the current
25897 is not.
25898
25899 expr
25900 The command ARG is interpreted as expression and result of
25901 expression is passed as ARG.
25902
25903 The expression is evaluated through the eval API and can contain
25904 the following constants:
25905
25906 POS Original position in the file of the frame, or undefined if
25907 undefined for the current frame.
25908
25909 PTS The presentation timestamp in input.
25910
25911 N The count of the input frame for video or audio, starting from
25912 0.
25913
25914 T The time in seconds of the current frame.
25915
25916 TS The start time in seconds of the current command interval.
25917
25918 TE The end time in seconds of the current command interval.
25919
25920 TI The interpolated time of the current command interval, TI = (T
25921 - TS) / (TE - TS).
25922
25923 W The video frame width.
25924
25925 H The video frame height.
25926
25927 If FLAGS is not specified, a default value of "[enter]" is assumed.
25928
25929 TARGET specifies the target of the command, usually the name of the
25930 filter class or a specific filter instance name.
25931
25932 COMMAND specifies the name of the command for the target filter.
25933
25934 ARG is optional and specifies the optional list of argument for the
25935 given COMMAND.
25936
25937 Between one interval specification and another, whitespaces, or
25938 sequences of characters starting with "#" until the end of line, are
25939 ignored and can be used to annotate comments.
25940
25941 A simplified BNF description of the commands specification syntax
25942 follows:
25943
25944 <COMMAND_FLAG> ::= "enter" | "leave"
25945 <COMMAND_FLAGS> ::= <COMMAND_FLAG> [(+|"|")<COMMAND_FLAG>]
25946 <COMMAND> ::= ["[" <COMMAND_FLAGS> "]"] <TARGET> <COMMAND> [<ARG>]
25947 <COMMANDS> ::= <COMMAND> [,<COMMANDS>]
25948 <INTERVAL> ::= <START>[-<END>] <COMMANDS>
25949 <INTERVALS> ::= <INTERVAL>[;<INTERVALS>]
25950
25951 Examples
25952
25953 • Specify audio tempo change at second 4:
25954
25955 asendcmd=c='4.0 atempo tempo 1.5',atempo
25956
25957 • Target a specific filter instance:
25958
25959 asendcmd=c='4.0 atempo@my tempo 1.5',atempo@my
25960
25961 • Specify a list of drawtext and hue commands in a file.
25962
25963 # show text in the interval 5-10
25964 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
25965 [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
25966
25967 # desaturate the image in the interval 15-20
25968 15.0-20.0 [enter] hue s 0,
25969 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
25970 [leave] hue s 1,
25971 [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
25972
25973 # apply an exponential saturation fade-out effect, starting from time 25
25974 25 [enter] hue s exp(25-t)
25975
25976 A filtergraph allowing to read and process the above command list
25977 stored in a file test.cmd, can be specified with:
25978
25979 sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
25980
25981 setpts, asetpts
25982 Change the PTS (presentation timestamp) of the input frames.
25983
25984 "setpts" works on video frames, "asetpts" on audio frames.
25985
25986 This filter accepts the following options:
25987
25988 expr
25989 The expression which is evaluated for each frame to construct its
25990 timestamp.
25991
25992 The expression is evaluated through the eval API and can contain the
25993 following constants:
25994
25995 FRAME_RATE, FR
25996 frame rate, only defined for constant frame-rate video
25997
25998 PTS The presentation timestamp in input
25999
26000 N The count of the input frame for video or the number of consumed
26001 samples, not including the current frame for audio, starting from
26002 0.
26003
26004 NB_CONSUMED_SAMPLES
26005 The number of consumed samples, not including the current frame
26006 (only audio)
26007
26008 NB_SAMPLES, S
26009 The number of samples in the current frame (only audio)
26010
26011 SAMPLE_RATE, SR
26012 The audio sample rate.
26013
26014 STARTPTS
26015 The PTS of the first frame.
26016
26017 STARTT
26018 the time in seconds of the first frame
26019
26020 INTERLACED
26021 State whether the current frame is interlaced.
26022
26023 T the time in seconds of the current frame
26024
26025 POS original position in the file of the frame, or undefined if
26026 undefined for the current frame
26027
26028 PREV_INPTS
26029 The previous input PTS.
26030
26031 PREV_INT
26032 previous input time in seconds
26033
26034 PREV_OUTPTS
26035 The previous output PTS.
26036
26037 PREV_OUTT
26038 previous output time in seconds
26039
26040 RTCTIME
26041 The wallclock (RTC) time in microseconds. This is deprecated, use
26042 time(0) instead.
26043
26044 RTCSTART
26045 The wallclock (RTC) time at the start of the movie in microseconds.
26046
26047 TB The timebase of the input timestamps.
26048
26049 Examples
26050
26051 • Start counting PTS from zero
26052
26053 setpts=PTS-STARTPTS
26054
26055 • Apply fast motion effect:
26056
26057 setpts=0.5*PTS
26058
26059 • Apply slow motion effect:
26060
26061 setpts=2.0*PTS
26062
26063 • Set fixed rate of 25 frames per second:
26064
26065 setpts=N/(25*TB)
26066
26067 • Set fixed rate 25 fps with some jitter:
26068
26069 setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
26070
26071 • Apply an offset of 10 seconds to the input PTS:
26072
26073 setpts=PTS+10/TB
26074
26075 • Generate timestamps from a "live source" and rebase onto the
26076 current timebase:
26077
26078 setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
26079
26080 • Generate timestamps by counting samples:
26081
26082 asetpts=N/SR/TB
26083
26084 setrange
26085 Force color range for the output video frame.
26086
26087 The "setrange" filter marks the color range property for the output
26088 frames. It does not change the input frame, but only sets the
26089 corresponding property, which affects how the frame is treated by
26090 following filters.
26091
26092 The filter accepts the following options:
26093
26094 range
26095 Available values are:
26096
26097 auto
26098 Keep the same color range property.
26099
26100 unspecified, unknown
26101 Set the color range as unspecified.
26102
26103 limited, tv, mpeg
26104 Set the color range as limited.
26105
26106 full, pc, jpeg
26107 Set the color range as full.
26108
26109 settb, asettb
26110 Set the timebase to use for the output frames timestamps. It is mainly
26111 useful for testing timebase configuration.
26112
26113 It accepts the following parameters:
26114
26115 expr, tb
26116 The expression which is evaluated into the output timebase.
26117
26118 The value for tb is an arithmetic expression representing a rational.
26119 The expression can contain the constants "AVTB" (the default timebase),
26120 "intb" (the input timebase) and "sr" (the sample rate, audio only).
26121 Default value is "intb".
26122
26123 Examples
26124
26125 • Set the timebase to 1/25:
26126
26127 settb=expr=1/25
26128
26129 • Set the timebase to 1/10:
26130
26131 settb=expr=0.1
26132
26133 • Set the timebase to 1001/1000:
26134
26135 settb=1+0.001
26136
26137 • Set the timebase to 2*intb:
26138
26139 settb=2*intb
26140
26141 • Set the default timebase value:
26142
26143 settb=AVTB
26144
26145 showcqt
26146 Convert input audio to a video output representing frequency spectrum
26147 logarithmically using Brown-Puckette constant Q transform algorithm
26148 with direct frequency domain coefficient calculation (but the transform
26149 itself is not really constant Q, instead the Q factor is actually
26150 variable/clamped), with musical tone scale, from E0 to D#10.
26151
26152 The filter accepts the following options:
26153
26154 size, s
26155 Specify the video size for the output. It must be even. For the
26156 syntax of this option, check the "Video size" section in the
26157 ffmpeg-utils manual. Default value is "1920x1080".
26158
26159 fps, rate, r
26160 Set the output frame rate. Default value is 25.
26161
26162 bar_h
26163 Set the bargraph height. It must be even. Default value is -1 which
26164 computes the bargraph height automatically.
26165
26166 axis_h
26167 Set the axis height. It must be even. Default value is -1 which
26168 computes the axis height automatically.
26169
26170 sono_h
26171 Set the sonogram height. It must be even. Default value is -1 which
26172 computes the sonogram height automatically.
26173
26174 fullhd
26175 Set the fullhd resolution. This option is deprecated, use size, s
26176 instead. Default value is 1.
26177
26178 sono_v, volume
26179 Specify the sonogram volume expression. It can contain variables:
26180
26181 bar_v
26182 the bar_v evaluated expression
26183
26184 frequency, freq, f
26185 the frequency where it is evaluated
26186
26187 timeclamp, tc
26188 the value of timeclamp option
26189
26190 and functions:
26191
26192 a_weighting(f)
26193 A-weighting of equal loudness
26194
26195 b_weighting(f)
26196 B-weighting of equal loudness
26197
26198 c_weighting(f)
26199 C-weighting of equal loudness.
26200
26201 Default value is 16.
26202
26203 bar_v, volume2
26204 Specify the bargraph volume expression. It can contain variables:
26205
26206 sono_v
26207 the sono_v evaluated expression
26208
26209 frequency, freq, f
26210 the frequency where it is evaluated
26211
26212 timeclamp, tc
26213 the value of timeclamp option
26214
26215 and functions:
26216
26217 a_weighting(f)
26218 A-weighting of equal loudness
26219
26220 b_weighting(f)
26221 B-weighting of equal loudness
26222
26223 c_weighting(f)
26224 C-weighting of equal loudness.
26225
26226 Default value is "sono_v".
26227
26228 sono_g, gamma
26229 Specify the sonogram gamma. Lower gamma makes the spectrum more
26230 contrast, higher gamma makes the spectrum having more range.
26231 Default value is 3. Acceptable range is "[1, 7]".
26232
26233 bar_g, gamma2
26234 Specify the bargraph gamma. Default value is 1. Acceptable range is
26235 "[1, 7]".
26236
26237 bar_t
26238 Specify the bargraph transparency level. Lower value makes the
26239 bargraph sharper. Default value is 1. Acceptable range is "[0,
26240 1]".
26241
26242 timeclamp, tc
26243 Specify the transform timeclamp. At low frequency, there is trade-
26244 off between accuracy in time domain and frequency domain. If
26245 timeclamp is lower, event in time domain is represented more
26246 accurately (such as fast bass drum), otherwise event in frequency
26247 domain is represented more accurately (such as bass guitar).
26248 Acceptable range is "[0.002, 1]". Default value is 0.17.
26249
26250 attack
26251 Set attack time in seconds. The default is 0 (disabled). Otherwise,
26252 it limits future samples by applying asymmetric windowing in time
26253 domain, useful when low latency is required. Accepted range is "[0,
26254 1]".
26255
26256 basefreq
26257 Specify the transform base frequency. Default value is
26258 20.01523126408007475, which is frequency 50 cents below E0.
26259 Acceptable range is "[10, 100000]".
26260
26261 endfreq
26262 Specify the transform end frequency. Default value is
26263 20495.59681441799654, which is frequency 50 cents above D#10.
26264 Acceptable range is "[10, 100000]".
26265
26266 coeffclamp
26267 This option is deprecated and ignored.
26268
26269 tlength
26270 Specify the transform length in time domain. Use this option to
26271 control accuracy trade-off between time domain and frequency domain
26272 at every frequency sample. It can contain variables:
26273
26274 frequency, freq, f
26275 the frequency where it is evaluated
26276
26277 timeclamp, tc
26278 the value of timeclamp option.
26279
26280 Default value is "384*tc/(384+tc*f)".
26281
26282 count
26283 Specify the transform count for every video frame. Default value is
26284 6. Acceptable range is "[1, 30]".
26285
26286 fcount
26287 Specify the transform count for every single pixel. Default value
26288 is 0, which makes it computed automatically. Acceptable range is
26289 "[0, 10]".
26290
26291 fontfile
26292 Specify font file for use with freetype to draw the axis. If not
26293 specified, use embedded font. Note that drawing with font file or
26294 embedded font is not implemented with custom basefreq and endfreq,
26295 use axisfile option instead.
26296
26297 font
26298 Specify fontconfig pattern. This has lower priority than fontfile.
26299 The ":" in the pattern may be replaced by "|" to avoid unnecessary
26300 escaping.
26301
26302 fontcolor
26303 Specify font color expression. This is arithmetic expression that
26304 should return integer value 0xRRGGBB. It can contain variables:
26305
26306 frequency, freq, f
26307 the frequency where it is evaluated
26308
26309 timeclamp, tc
26310 the value of timeclamp option
26311
26312 and functions:
26313
26314 midi(f)
26315 midi number of frequency f, some midi numbers: E0(16), C1(24),
26316 C2(36), A4(69)
26317
26318 r(x), g(x), b(x)
26319 red, green, and blue value of intensity x.
26320
26321 Default value is "st(0, (midi(f)-59.5)/12); st(1,
26322 if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0)); r(1-ld(1)) +
26323 b(ld(1))".
26324
26325 axisfile
26326 Specify image file to draw the axis. This option override fontfile
26327 and fontcolor option.
26328
26329 axis, text
26330 Enable/disable drawing text to the axis. If it is set to 0, drawing
26331 to the axis is disabled, ignoring fontfile and axisfile option.
26332 Default value is 1.
26333
26334 csp Set colorspace. The accepted values are:
26335
26336 unspecified
26337 Unspecified (default)
26338
26339 bt709
26340 BT.709
26341
26342 fcc FCC
26343
26344 bt470bg
26345 BT.470BG or BT.601-6 625
26346
26347 smpte170m
26348 SMPTE-170M or BT.601-6 525
26349
26350 smpte240m
26351 SMPTE-240M
26352
26353 bt2020ncl
26354 BT.2020 with non-constant luminance
26355
26356 cscheme
26357 Set spectrogram color scheme. This is list of floating point values
26358 with format "left_r|left_g|left_b|right_r|right_g|right_b". The
26359 default is "1|0.5|0|0|0.5|1".
26360
26361 Examples
26362
26363 • Playing audio while showing the spectrum:
26364
26365 ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt [out0]'
26366
26367 • Same as above, but with frame rate 30 fps:
26368
26369 ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=fps=30:count=5 [out0]'
26370
26371 • Playing at 1280x720:
26372
26373 ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=s=1280x720:count=4 [out0]'
26374
26375 • Disable sonogram display:
26376
26377 sono_h=0
26378
26379 • A1 and its harmonics: A1, A2, (near)E3, A3:
26380
26381 ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
26382 asplit[a][out1]; [a] showcqt [out0]'
26383
26384 • Same as above, but with more accuracy in frequency domain:
26385
26386 ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
26387 asplit[a][out1]; [a] showcqt=timeclamp=0.5 [out0]'
26388
26389 • Custom volume:
26390
26391 bar_v=10:sono_v=bar_v*a_weighting(f)
26392
26393 • Custom gamma, now spectrum is linear to the amplitude.
26394
26395 bar_g=2:sono_g=2
26396
26397 • Custom tlength equation:
26398
26399 tc=0.33:tlength='st(0,0.17); 384*tc / (384 / ld(0) + tc*f /(1-ld(0))) + 384*tc / (tc*f / ld(0) + 384 /(1-ld(0)))'
26400
26401 • Custom fontcolor and fontfile, C-note is colored green, others are
26402 colored blue:
26403
26404 fontcolor='if(mod(floor(midi(f)+0.5),12), 0x0000FF, g(1))':fontfile=myfont.ttf
26405
26406 • Custom font using fontconfig:
26407
26408 font='Courier New,Monospace,mono|bold'
26409
26410 • Custom frequency range with custom axis using image file:
26411
26412 axisfile=myaxis.png:basefreq=40:endfreq=10000
26413
26414 showcwt
26415 Convert input audio to video output representing frequency spectrum
26416 using Continuous Wavelet Transform and Morlet wavelet.
26417
26418 The filter accepts the following options:
26419
26420 size, s
26421 Specify the video size for the output. For the syntax of this
26422 option, check the "Video size" section in the ffmpeg-utils manual.
26423 Default value is "640x512".
26424
26425 rate, r
26426 Set the output frame rate. Default value is 25.
26427
26428 scale
26429 Set the frequency scale used. Allowed values are:
26430
26431 linear
26432 log2
26433 bark
26434 mel
26435 erbs
26436
26437 Default value is "linear".
26438
26439 min Set the minimum frequency that will be used in output. Default is
26440 20 Hz.
26441
26442 max Set the maximum frequency that will be used in output. Default is
26443 20000 Hz. The real frequency upper limit depends on input audio's
26444 sample rate and such will be enforced on this value when it is set
26445 to value greater than Nyquist frequency.
26446
26447 logb
26448 Set the logarithmic basis for brightness strength when mapping
26449 calculated magnitude values to pixel values. Allowed range is from
26450 0 to 1. Default value is 0.0001.
26451
26452 deviation
26453 Set the frequency deviation. Lower values than 1 are more
26454 frequency oriented, while higher values than 1 are more time
26455 oriented. Allowed range is from 0 to 10. Default value is 1.
26456
26457 pps Set the number of pixel output per each second in one row. Allowed
26458 range is from 1 to 1024. Default value is 64.
26459
26460 mode
26461 Set the output visual mode. Allowed values are:
26462
26463 magnitude
26464 Show magnitude.
26465
26466 phase
26467 Show only phase.
26468
26469 magphase
26470 Show combination of magnitude and phase. Magnitude is mapped
26471 to brightness and phase to color.
26472
26473 channel
26474 Show unique color per channel magnitude.
26475
26476 stereo
26477 Show unique color per stereo difference.
26478
26479 Default value is "magnitude".
26480
26481 slide
26482 Set the output slide method. Allowed values are:
26483
26484 replace
26485 scroll
26486 frame
26487 direction
26488 Set the direction method for output slide method. Allowed values
26489 are:
26490
26491 lr Direction from left to right.
26492
26493 rl Direction from right to left.
26494
26495 ud Direction from up to down.
26496
26497 du Direction from down to up.
26498
26499 showfreqs
26500 Convert input audio to video output representing the audio power
26501 spectrum. Audio amplitude is on Y-axis while frequency is on X-axis.
26502
26503 The filter accepts the following options:
26504
26505 size, s
26506 Specify size of video. For the syntax of this option, check the
26507 "Video size" section in the ffmpeg-utils manual. Default is
26508 "1024x512".
26509
26510 rate, r
26511 Set video rate. Default is 25.
26512
26513 mode
26514 Set display mode. This set how each frequency bin will be
26515 represented.
26516
26517 It accepts the following values:
26518
26519 line
26520 bar
26521 dot
26522
26523 Default is "bar".
26524
26525 ascale
26526 Set amplitude scale.
26527
26528 It accepts the following values:
26529
26530 lin Linear scale.
26531
26532 sqrt
26533 Square root scale.
26534
26535 cbrt
26536 Cubic root scale.
26537
26538 log Logarithmic scale.
26539
26540 Default is "log".
26541
26542 fscale
26543 Set frequency scale.
26544
26545 It accepts the following values:
26546
26547 lin Linear scale.
26548
26549 log Logarithmic scale.
26550
26551 rlog
26552 Reverse logarithmic scale.
26553
26554 Default is "lin".
26555
26556 win_size
26557 Set window size. Allowed range is from 16 to 65536.
26558
26559 Default is 2048
26560
26561 win_func
26562 Set windowing function.
26563
26564 It accepts the following values:
26565
26566 rect
26567 bartlett
26568 hanning
26569 hamming
26570 blackman
26571 welch
26572 flattop
26573 bharris
26574 bnuttall
26575 bhann
26576 sine
26577 nuttall
26578 lanczos
26579 gauss
26580 tukey
26581 dolph
26582 cauchy
26583 parzen
26584 poisson
26585 bohman
26586 kaiser
26587
26588 Default is "hanning".
26589
26590 overlap
26591 Set window overlap. In range "[0, 1]". Default is 1, which means
26592 optimal overlap for selected window function will be picked.
26593
26594 averaging
26595 Set time averaging. Setting this to 0 will display current maximal
26596 peaks. Default is 1, which means time averaging is disabled.
26597
26598 colors
26599 Specify list of colors separated by space or by '|' which will be
26600 used to draw channel frequencies. Unrecognized or missing colors
26601 will be replaced by white color.
26602
26603 cmode
26604 Set channel display mode.
26605
26606 It accepts the following values:
26607
26608 combined
26609 separate
26610
26611 Default is "combined".
26612
26613 minamp
26614 Set minimum amplitude used in "log" amplitude scaler.
26615
26616 data
26617 Set data display mode.
26618
26619 It accepts the following values:
26620
26621 magnitude
26622 phase
26623 delay
26624
26625 Default is "magnitude".
26626
26627 channels
26628 Set channels to use when processing audio. By default all are
26629 processed.
26630
26631 showspatial
26632 Convert stereo input audio to a video output, representing the spatial
26633 relationship between two channels.
26634
26635 The filter accepts the following options:
26636
26637 size, s
26638 Specify the video size for the output. For the syntax of this
26639 option, check the "Video size" section in the ffmpeg-utils manual.
26640 Default value is "512x512".
26641
26642 win_size
26643 Set window size. Allowed range is from 1024 to 65536. Default size
26644 is 4096.
26645
26646 win_func
26647 Set window function.
26648
26649 It accepts the following values:
26650
26651 rect
26652 bartlett
26653 hann
26654 hanning
26655 hamming
26656 blackman
26657 welch
26658 flattop
26659 bharris
26660 bnuttall
26661 bhann
26662 sine
26663 nuttall
26664 lanczos
26665 gauss
26666 tukey
26667 dolph
26668 cauchy
26669 parzen
26670 poisson
26671 bohman
26672 kaiser
26673
26674 Default value is "hann".
26675
26676 rate, r
26677 Set output framerate.
26678
26679 showspectrum
26680 Convert input audio to a video output, representing the audio frequency
26681 spectrum.
26682
26683 The filter accepts the following options:
26684
26685 size, s
26686 Specify the video size for the output. For the syntax of this
26687 option, check the "Video size" section in the ffmpeg-utils manual.
26688 Default value is "640x512".
26689
26690 slide
26691 Specify how the spectrum should slide along the window.
26692
26693 It accepts the following values:
26694
26695 replace
26696 the samples start again on the left when they reach the right
26697
26698 scroll
26699 the samples scroll from right to left
26700
26701 fullframe
26702 frames are only produced when the samples reach the right
26703
26704 rscroll
26705 the samples scroll from left to right
26706
26707 lreplace
26708 the samples start again on the right when they reach the left
26709
26710 Default value is "replace".
26711
26712 mode
26713 Specify display mode.
26714
26715 It accepts the following values:
26716
26717 combined
26718 all channels are displayed in the same row
26719
26720 separate
26721 all channels are displayed in separate rows
26722
26723 Default value is combined.
26724
26725 color
26726 Specify display color mode.
26727
26728 It accepts the following values:
26729
26730 channel
26731 each channel is displayed in a separate color
26732
26733 intensity
26734 each channel is displayed using the same color scheme
26735
26736 rainbow
26737 each channel is displayed using the rainbow color scheme
26738
26739 moreland
26740 each channel is displayed using the moreland color scheme
26741
26742 nebulae
26743 each channel is displayed using the nebulae color scheme
26744
26745 fire
26746 each channel is displayed using the fire color scheme
26747
26748 fiery
26749 each channel is displayed using the fiery color scheme
26750
26751 fruit
26752 each channel is displayed using the fruit color scheme
26753
26754 cool
26755 each channel is displayed using the cool color scheme
26756
26757 magma
26758 each channel is displayed using the magma color scheme
26759
26760 green
26761 each channel is displayed using the green color scheme
26762
26763 viridis
26764 each channel is displayed using the viridis color scheme
26765
26766 plasma
26767 each channel is displayed using the plasma color scheme
26768
26769 cividis
26770 each channel is displayed using the cividis color scheme
26771
26772 terrain
26773 each channel is displayed using the terrain color scheme
26774
26775 Default value is channel.
26776
26777 scale
26778 Specify scale used for calculating intensity color values.
26779
26780 It accepts the following values:
26781
26782 lin linear
26783
26784 sqrt
26785 square root, default
26786
26787 cbrt
26788 cubic root
26789
26790 log logarithmic
26791
26792 4thrt
26793 4th root
26794
26795 5thrt
26796 5th root
26797
26798 Default value is sqrt.
26799
26800 fscale
26801 Specify frequency scale.
26802
26803 It accepts the following values:
26804
26805 lin linear
26806
26807 log logarithmic
26808
26809 Default value is lin.
26810
26811 saturation
26812 Set saturation modifier for displayed colors. Negative values
26813 provide alternative color scheme. 0 is no saturation at all.
26814 Saturation must be in [-10.0, 10.0] range. Default value is 1.
26815
26816 win_func
26817 Set window function.
26818
26819 It accepts the following values:
26820
26821 rect
26822 bartlett
26823 hann
26824 hanning
26825 hamming
26826 blackman
26827 welch
26828 flattop
26829 bharris
26830 bnuttall
26831 bhann
26832 sine
26833 nuttall
26834 lanczos
26835 gauss
26836 tukey
26837 dolph
26838 cauchy
26839 parzen
26840 poisson
26841 bohman
26842 kaiser
26843
26844 Default value is "hann".
26845
26846 orientation
26847 Set orientation of time vs frequency axis. Can be "vertical" or
26848 "horizontal". Default is "vertical".
26849
26850 overlap
26851 Set ratio of overlap window. Default value is 0. When value is 1
26852 overlap is set to recommended size for specific window function
26853 currently used.
26854
26855 gain
26856 Set scale gain for calculating intensity color values. Default
26857 value is 1.
26858
26859 data
26860 Set which data to display. Can be "magnitude", default or "phase",
26861 or unwrapped phase: "uphase".
26862
26863 rotation
26864 Set color rotation, must be in [-1.0, 1.0] range. Default value is
26865 0.
26866
26867 start
26868 Set start frequency from which to display spectrogram. Default is
26869 0.
26870
26871 stop
26872 Set stop frequency to which to display spectrogram. Default is 0.
26873
26874 fps Set upper frame rate limit. Default is "auto", unlimited.
26875
26876 legend
26877 Draw time and frequency axes and legends. Default is disabled.
26878
26879 drange
26880 Set dynamic range used to calculate intensity color values. Default
26881 is 120 dBFS. Allowed range is from 10 to 200.
26882
26883 limit
26884 Set upper limit of input audio samples volume in dBFS. Default is 0
26885 dBFS. Allowed range is from -100 to 100.
26886
26887 opacity
26888 Set opacity strength when using pixel format output with alpha
26889 component.
26890
26891 The usage is very similar to the showwaves filter; see the examples in
26892 that section.
26893
26894 Examples
26895
26896 • Large window with logarithmic color scaling:
26897
26898 showspectrum=s=1280x480:scale=log
26899
26900 • Complete example for a colored and sliding spectrum per channel
26901 using ffplay:
26902
26903 ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
26904 [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
26905
26906 showspectrumpic
26907 Convert input audio to a single video frame, representing the audio
26908 frequency spectrum.
26909
26910 The filter accepts the following options:
26911
26912 size, s
26913 Specify the video size for the output. For the syntax of this
26914 option, check the "Video size" section in the ffmpeg-utils manual.
26915 Default value is "4096x2048".
26916
26917 mode
26918 Specify display mode.
26919
26920 It accepts the following values:
26921
26922 combined
26923 all channels are displayed in the same row
26924
26925 separate
26926 all channels are displayed in separate rows
26927
26928 Default value is combined.
26929
26930 color
26931 Specify display color mode.
26932
26933 It accepts the following values:
26934
26935 channel
26936 each channel is displayed in a separate color
26937
26938 intensity
26939 each channel is displayed using the same color scheme
26940
26941 rainbow
26942 each channel is displayed using the rainbow color scheme
26943
26944 moreland
26945 each channel is displayed using the moreland color scheme
26946
26947 nebulae
26948 each channel is displayed using the nebulae color scheme
26949
26950 fire
26951 each channel is displayed using the fire color scheme
26952
26953 fiery
26954 each channel is displayed using the fiery color scheme
26955
26956 fruit
26957 each channel is displayed using the fruit color scheme
26958
26959 cool
26960 each channel is displayed using the cool color scheme
26961
26962 magma
26963 each channel is displayed using the magma color scheme
26964
26965 green
26966 each channel is displayed using the green color scheme
26967
26968 viridis
26969 each channel is displayed using the viridis color scheme
26970
26971 plasma
26972 each channel is displayed using the plasma color scheme
26973
26974 cividis
26975 each channel is displayed using the cividis color scheme
26976
26977 terrain
26978 each channel is displayed using the terrain color scheme
26979
26980 Default value is intensity.
26981
26982 scale
26983 Specify scale used for calculating intensity color values.
26984
26985 It accepts the following values:
26986
26987 lin linear
26988
26989 sqrt
26990 square root, default
26991
26992 cbrt
26993 cubic root
26994
26995 log logarithmic
26996
26997 4thrt
26998 4th root
26999
27000 5thrt
27001 5th root
27002
27003 Default value is log.
27004
27005 fscale
27006 Specify frequency scale.
27007
27008 It accepts the following values:
27009
27010 lin linear
27011
27012 log logarithmic
27013
27014 Default value is lin.
27015
27016 saturation
27017 Set saturation modifier for displayed colors. Negative values
27018 provide alternative color scheme. 0 is no saturation at all.
27019 Saturation must be in [-10.0, 10.0] range. Default value is 1.
27020
27021 win_func
27022 Set window function.
27023
27024 It accepts the following values:
27025
27026 rect
27027 bartlett
27028 hann
27029 hanning
27030 hamming
27031 blackman
27032 welch
27033 flattop
27034 bharris
27035 bnuttall
27036 bhann
27037 sine
27038 nuttall
27039 lanczos
27040 gauss
27041 tukey
27042 dolph
27043 cauchy
27044 parzen
27045 poisson
27046 bohman
27047 kaiser
27048
27049 Default value is "hann".
27050
27051 orientation
27052 Set orientation of time vs frequency axis. Can be "vertical" or
27053 "horizontal". Default is "vertical".
27054
27055 gain
27056 Set scale gain for calculating intensity color values. Default
27057 value is 1.
27058
27059 legend
27060 Draw time and frequency axes and legends. Default is enabled.
27061
27062 rotation
27063 Set color rotation, must be in [-1.0, 1.0] range. Default value is
27064 0.
27065
27066 start
27067 Set start frequency from which to display spectrogram. Default is
27068 0.
27069
27070 stop
27071 Set stop frequency to which to display spectrogram. Default is 0.
27072
27073 drange
27074 Set dynamic range used to calculate intensity color values. Default
27075 is 120 dBFS. Allowed range is from 10 to 200.
27076
27077 limit
27078 Set upper limit of input audio samples volume in dBFS. Default is 0
27079 dBFS. Allowed range is from -100 to 100.
27080
27081 opacity
27082 Set opacity strength when using pixel format output with alpha
27083 component.
27084
27085 Examples
27086
27087 • Extract an audio spectrogram of a whole audio track in a 1024x1024
27088 picture using ffmpeg:
27089
27090 ffmpeg -i audio.flac -lavfi showspectrumpic=s=1024x1024 spectrogram.png
27091
27092 showvolume
27093 Convert input audio volume to a video output.
27094
27095 The filter accepts the following options:
27096
27097 rate, r
27098 Set video rate.
27099
27100 b Set border width, allowed range is [0, 5]. Default is 1.
27101
27102 w Set channel width, allowed range is [80, 8192]. Default is 400.
27103
27104 h Set channel height, allowed range is [1, 900]. Default is 20.
27105
27106 f Set fade, allowed range is [0, 1]. Default is 0.95.
27107
27108 c Set volume color expression.
27109
27110 The expression can use the following variables:
27111
27112 VOLUME
27113 Current max volume of channel in dB.
27114
27115 PEAK
27116 Current peak.
27117
27118 CHANNEL
27119 Current channel number, starting from 0.
27120
27121 t If set, displays channel names. Default is enabled.
27122
27123 v If set, displays volume values. Default is enabled.
27124
27125 o Set orientation, can be horizontal: "h" or vertical: "v", default
27126 is "h".
27127
27128 s Set step size, allowed range is [0, 5]. Default is 0, which means
27129 step is disabled.
27130
27131 p Set background opacity, allowed range is [0, 1]. Default is 0.
27132
27133 m Set metering mode, can be peak: "p" or rms: "r", default is "p".
27134
27135 ds Set display scale, can be linear: "lin" or log: "log", default is
27136 "lin".
27137
27138 dm In second. If set to > 0., display a line for the max level in the
27139 previous seconds. default is disabled: 0.
27140
27141 dmc The color of the max line. Use when "dm" option is set to > 0.
27142 default is: "orange"
27143
27144 showwaves
27145 Convert input audio to a video output, representing the samples waves.
27146
27147 The filter accepts the following options:
27148
27149 size, s
27150 Specify the video size for the output. For the syntax of this
27151 option, check the "Video size" section in the ffmpeg-utils manual.
27152 Default value is "600x240".
27153
27154 mode
27155 Set display mode.
27156
27157 Available values are:
27158
27159 point
27160 Draw a point for each sample.
27161
27162 line
27163 Draw a vertical line for each sample.
27164
27165 p2p Draw a point for each sample and a line between them.
27166
27167 cline
27168 Draw a centered vertical line for each sample.
27169
27170 Default value is "point".
27171
27172 n Set the number of samples which are printed on the same column. A
27173 larger value will decrease the frame rate. Must be a positive
27174 integer. This option can be set only if the value for rate is not
27175 explicitly specified.
27176
27177 rate, r
27178 Set the (approximate) output frame rate. This is done by setting
27179 the option n. Default value is "25".
27180
27181 split_channels
27182 Set if channels should be drawn separately or overlap. Default
27183 value is 0.
27184
27185 colors
27186 Set colors separated by '|' which are going to be used for drawing
27187 of each channel.
27188
27189 scale
27190 Set amplitude scale.
27191
27192 Available values are:
27193
27194 lin Linear.
27195
27196 log Logarithmic.
27197
27198 sqrt
27199 Square root.
27200
27201 cbrt
27202 Cubic root.
27203
27204 Default is linear.
27205
27206 draw
27207 Set the draw mode. This is mostly useful to set for high n.
27208
27209 Available values are:
27210
27211 scale
27212 Scale pixel values for each drawn sample.
27213
27214 full
27215 Draw every sample directly.
27216
27217 Default value is "scale".
27218
27219 Examples
27220
27221 • Output the input file audio and the corresponding video
27222 representation at the same time:
27223
27224 amovie=a.mp3,asplit[out0],showwaves[out1]
27225
27226 • Create a synthetic signal and show it with showwaves, forcing a
27227 frame rate of 30 frames per second:
27228
27229 aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
27230
27231 showwavespic
27232 Convert input audio to a single video frame, representing the samples
27233 waves.
27234
27235 The filter accepts the following options:
27236
27237 size, s
27238 Specify the video size for the output. For the syntax of this
27239 option, check the "Video size" section in the ffmpeg-utils manual.
27240 Default value is "600x240".
27241
27242 split_channels
27243 Set if channels should be drawn separately or overlap. Default
27244 value is 0.
27245
27246 colors
27247 Set colors separated by '|' which are going to be used for drawing
27248 of each channel.
27249
27250 scale
27251 Set amplitude scale.
27252
27253 Available values are:
27254
27255 lin Linear.
27256
27257 log Logarithmic.
27258
27259 sqrt
27260 Square root.
27261
27262 cbrt
27263 Cubic root.
27264
27265 Default is linear.
27266
27267 draw
27268 Set the draw mode.
27269
27270 Available values are:
27271
27272 scale
27273 Scale pixel values for each drawn sample.
27274
27275 full
27276 Draw every sample directly.
27277
27278 Default value is "scale".
27279
27280 filter
27281 Set the filter mode.
27282
27283 Available values are:
27284
27285 average
27286 Use average samples values for each drawn sample.
27287
27288 peak
27289 Use peak samples values for each drawn sample.
27290
27291 Default value is "average".
27292
27293 Examples
27294
27295 • Extract a channel split representation of the wave form of a whole
27296 audio track in a 1024x800 picture using ffmpeg:
27297
27298 ffmpeg -i audio.flac -lavfi showwavespic=split_channels=1:s=1024x800 waveform.png
27299
27300 sidedata, asidedata
27301 Delete frame side data, or select frames based on it.
27302
27303 This filter accepts the following options:
27304
27305 mode
27306 Set mode of operation of the filter.
27307
27308 Can be one of the following:
27309
27310 select
27311 Select every frame with side data of "type".
27312
27313 delete
27314 Delete side data of "type". If "type" is not set, delete all
27315 side data in the frame.
27316
27317 type
27318 Set side data type used with all modes. Must be set for "select"
27319 mode. For the list of frame side data types, refer to the
27320 "AVFrameSideDataType" enum in libavutil/frame.h. For example, to
27321 choose "AV_FRAME_DATA_PANSCAN" side data, you must specify
27322 "PANSCAN".
27323
27324 spectrumsynth
27325 Synthesize audio from 2 input video spectrums, first input stream
27326 represents magnitude across time and second represents phase across
27327 time. The filter will transform from frequency domain as displayed in
27328 videos back to time domain as presented in audio output.
27329
27330 This filter is primarily created for reversing processed showspectrum
27331 filter outputs, but can synthesize sound from other spectrograms too.
27332 But in such case results are going to be poor if the phase data is not
27333 available, because in such cases phase data need to be recreated,
27334 usually it's just recreated from random noise. For best results use
27335 gray only output ("channel" color mode in showspectrum filter) and
27336 "log" scale for magnitude video and "lin" scale for phase video. To
27337 produce phase, for 2nd video, use "data" option. Inputs videos should
27338 generally use "fullframe" slide mode as that saves resources needed for
27339 decoding video.
27340
27341 The filter accepts the following options:
27342
27343 sample_rate
27344 Specify sample rate of output audio, the sample rate of audio from
27345 which spectrum was generated may differ.
27346
27347 channels
27348 Set number of channels represented in input video spectrums.
27349
27350 scale
27351 Set scale which was used when generating magnitude input spectrum.
27352 Can be "lin" or "log". Default is "log".
27353
27354 slide
27355 Set slide which was used when generating inputs spectrums. Can be
27356 "replace", "scroll", "fullframe" or "rscroll". Default is
27357 "fullframe".
27358
27359 win_func
27360 Set window function used for resynthesis.
27361
27362 overlap
27363 Set window overlap. In range "[0, 1]". Default is 1, which means
27364 optimal overlap for selected window function will be picked.
27365
27366 orientation
27367 Set orientation of input videos. Can be "vertical" or "horizontal".
27368 Default is "vertical".
27369
27370 Examples
27371
27372 • First create magnitude and phase videos from audio, assuming audio
27373 is stereo with 44100 sample rate, then resynthesize videos back to
27374 audio with spectrumsynth:
27375
27376 ffmpeg -i input.flac -lavfi showspectrum=mode=separate:scale=log:overlap=0.875:color=channel:slide=fullframe:data=magnitude -an -c:v rawvideo magnitude.nut
27377 ffmpeg -i input.flac -lavfi showspectrum=mode=separate:scale=lin:overlap=0.875:color=channel:slide=fullframe:data=phase -an -c:v rawvideo phase.nut
27378 ffmpeg -i magnitude.nut -i phase.nut -lavfi spectrumsynth=channels=2:sample_rate=44100:win_func=hann:overlap=0.875:slide=fullframe output.flac
27379
27380 split, asplit
27381 Split input into several identical outputs.
27382
27383 "asplit" works with audio input, "split" with video.
27384
27385 The filter accepts a single parameter which specifies the number of
27386 outputs. If unspecified, it defaults to 2.
27387
27388 Examples
27389
27390 • Create two separate outputs from the same input:
27391
27392 [in] split [out0][out1]
27393
27394 • To create 3 or more outputs, you need to specify the number of
27395 outputs, like in:
27396
27397 [in] asplit=3 [out0][out1][out2]
27398
27399 • Create two separate outputs from the same input, one cropped and
27400 one padded:
27401
27402 [in] split [splitout1][splitout2];
27403 [splitout1] crop=100:100:0:0 [cropout];
27404 [splitout2] pad=200:200:100:100 [padout];
27405
27406 • Create 5 copies of the input audio with ffmpeg:
27407
27408 ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
27409
27410 zmq, azmq
27411 Receive commands sent through a libzmq client, and forward them to
27412 filters in the filtergraph.
27413
27414 "zmq" and "azmq" work as a pass-through filters. "zmq" must be inserted
27415 between two video filters, "azmq" between two audio filters. Both are
27416 capable to send messages to any filter type.
27417
27418 To enable these filters you need to install the libzmq library and
27419 headers and configure FFmpeg with "--enable-libzmq".
27420
27421 For more information about libzmq see: <http://www.zeromq.org/>
27422
27423 The "zmq" and "azmq" filters work as a libzmq server, which receives
27424 messages sent through a network interface defined by the bind_address
27425 (or the abbreviation "b") option. Default value of this option is
27426 tcp://localhost:5555. You may want to alter this value to your needs,
27427 but do not forget to escape any ':' signs (see filtergraph escaping).
27428
27429 The received message must be in the form:
27430
27431 <TARGET> <COMMAND> [<ARG>]
27432
27433 TARGET specifies the target of the command, usually the name of the
27434 filter class or a specific filter instance name. The default filter
27435 instance name uses the pattern Parsed_<filter_name>_<index>, but you
27436 can override this by using the filter_name@id syntax (see Filtergraph
27437 syntax).
27438
27439 COMMAND specifies the name of the command for the target filter.
27440
27441 ARG is optional and specifies the optional argument list for the given
27442 COMMAND.
27443
27444 Upon reception, the message is processed and the corresponding command
27445 is injected into the filtergraph. Depending on the result, the filter
27446 will send a reply to the client, adopting the format:
27447
27448 <ERROR_CODE> <ERROR_REASON>
27449 <MESSAGE>
27450
27451 MESSAGE is optional.
27452
27453 Examples
27454
27455 Look at tools/zmqsend for an example of a zmq client which can be used
27456 to send commands processed by these filters.
27457
27458 Consider the following filtergraph generated by ffplay. In this
27459 example the last overlay filter has an instance name. All other filters
27460 will have default instance names.
27461
27462 ffplay -dumpgraph 1 -f lavfi "
27463 color=s=100x100:c=red [l];
27464 color=s=100x100:c=blue [r];
27465 nullsrc=s=200x100, zmq [bg];
27466 [bg][l] overlay [bg+l];
27467 [bg+l][r] overlay@my=x=100 "
27468
27469 To change the color of the left side of the video, the following
27470 command can be used:
27471
27472 echo Parsed_color_0 c yellow | tools/zmqsend
27473
27474 To change the right side:
27475
27476 echo Parsed_color_1 c pink | tools/zmqsend
27477
27478 To change the position of the right side:
27479
27480 echo overlay@my x 150 | tools/zmqsend
27481
27483 Below is a description of the currently available multimedia sources.
27484
27485 amovie
27486 This is the same as movie source, except it selects an audio stream by
27487 default.
27488
27489 avsynctest
27490 Generate an Audio/Video Sync Test.
27491
27492 Generated stream periodically shows flash video frame and emits beep in
27493 audio. Useful to inspect A/V sync issues.
27494
27495 It accepts the following options:
27496
27497 size, s
27498 Set output video size. Default value is "hd720".
27499
27500 framerate, fr
27501 Set output video frame rate. Default value is 30.
27502
27503 samplerate, sr
27504 Set output audio sample rate. Default value is 44100.
27505
27506 amplitude, a
27507 Set output audio beep amplitude. Default value is 0.7.
27508
27509 period, p
27510 Set output audio beep period in seconds. Default value is 3.
27511
27512 delay, dl
27513 Set output video flash delay in number of frames. Default value is
27514 0.
27515
27516 cycle, c
27517 Enable cycling of video delays, by default is disabled.
27518
27519 duration, d
27520 Set stream output duration. By default duration is unlimited.
27521
27522 fg, bg, ag
27523 Set foreground/background/additional color.
27524
27525 movie
27526 Read audio and/or video stream(s) from a movie container.
27527
27528 It accepts the following parameters:
27529
27530 filename
27531 The name of the resource to read (not necessarily a file; it can
27532 also be a device or a stream accessed through some protocol).
27533
27534 format_name, f
27535 Specifies the format assumed for the movie to read, and can be
27536 either the name of a container or an input device. If not
27537 specified, the format is guessed from movie_name or by probing.
27538
27539 seek_point, sp
27540 Specifies the seek point in seconds. The frames will be output
27541 starting from this seek point. The parameter is evaluated with
27542 "av_strtod", so the numerical value may be suffixed by an IS
27543 postfix. The default value is "0".
27544
27545 streams, s
27546 Specifies the streams to read. Several streams can be specified,
27547 separated by "+". The source will then have as many outputs, in the
27548 same order. The syntax is explained in the "Stream specifiers"
27549 section in the ffmpeg manual. Two special names, "dv" and "da"
27550 specify respectively the default (best suited) video and audio
27551 stream. Default is "dv", or "da" if the filter is called as
27552 "amovie".
27553
27554 stream_index, si
27555 Specifies the index of the video stream to read. If the value is
27556 -1, the most suitable video stream will be automatically selected.
27557 The default value is "-1". Deprecated. If the filter is called
27558 "amovie", it will select audio instead of video.
27559
27560 loop
27561 Specifies how many times to read the stream in sequence. If the
27562 value is 0, the stream will be looped infinitely. Default value is
27563 "1".
27564
27565 Note that when the movie is looped the source timestamps are not
27566 changed, so it will generate non monotonically increasing
27567 timestamps.
27568
27569 discontinuity
27570 Specifies the time difference between frames above which the point
27571 is considered a timestamp discontinuity which is removed by
27572 adjusting the later timestamps.
27573
27574 dec_threads
27575 Specifies the number of threads for decoding
27576
27577 format_opts
27578 Specify format options for the opened file. Format options can be
27579 specified as a list of key=value pairs separated by ':'. The
27580 following example shows how to add protocol_whitelist and
27581 protocol_blacklist options:
27582
27583 ffplay -f lavfi
27584 "movie=filename='1.sdp':format_opts='protocol_whitelist=file,rtp,udp\:protocol_blacklist=http'"
27585
27586 It allows overlaying a second video on top of the main input of a
27587 filtergraph, as shown in this graph:
27588
27589 input -----------> deltapts0 --> overlay --> output
27590 ^
27591 |
27592 movie --> scale--> deltapts1 -------+
27593
27594 Examples
27595
27596 • Skip 3.2 seconds from the start of the AVI file in.avi, and overlay
27597 it on top of the input labelled "in":
27598
27599 movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
27600 [in] setpts=PTS-STARTPTS [main];
27601 [main][over] overlay=16:16 [out]
27602
27603 • Read from a video4linux2 device, and overlay it on top of the input
27604 labelled "in":
27605
27606 movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
27607 [in] setpts=PTS-STARTPTS [main];
27608 [main][over] overlay=16:16 [out]
27609
27610 • Read the first video stream and the audio stream with id 0x81 from
27611 dvd.vob; the video is connected to the pad named "video" and the
27612 audio is connected to the pad named "audio":
27613
27614 movie=dvd.vob:s=v:0+#0x81 [video] [audio]
27615
27616 Commands
27617
27618 Both movie and amovie support the following commands:
27619
27620 seek
27621 Perform seek using "av_seek_frame". The syntax is: seek
27622 stream_index|timestamp|flags
27623
27624 • stream_index: If stream_index is -1, a default stream is
27625 selected, and timestamp is automatically converted from
27626 AV_TIME_BASE units to the stream specific time_base.
27627
27628 • timestamp: Timestamp in AVStream.time_base units or, if no
27629 stream is specified, in AV_TIME_BASE units.
27630
27631 • flags: Flags which select direction and seeking mode.
27632
27633 get_duration
27634 Get movie duration in AV_TIME_BASE units.
27635
27637 ffmpeg(1), ffplay(1), ffprobe(1), libavfilter(3)
27638
27640 The FFmpeg developers.
27641
27642 For details about the authorship, see the Git history of the project
27643 (https://git.ffmpeg.org/ffmpeg), e.g. by typing the command git log in
27644 the FFmpeg source directory, or browsing the online repository at
27645 <https://git.ffmpeg.org/ffmpeg>.
27646
27647 Maintainers for the specific components are listed in the file
27648 MAINTAINERS in the source code tree.
27649
27650
27651
27652 FFMPEG-FILTERS(1)