Changes between Version 36 and Version 37 of FilteringGuide


Ignore:
Timestamp:
Jun 15, 2014, 12:59:20 AM (5 years ago)
Author:
llogan
Comment:

remove filter list maintence burden; make multiple overlay example easier to read

Legend:

Unmodified
Added
Removed
Modified
  • FilteringGuide

    v36 v37  
    4242
    4343=== multiple input overlay in 2x2 grid ===
    44 Here four inputs are filtered together using the `-filter_complex` option. In this case all of the inputs are `-f lavfi -i testsrc` but could be other inputs. Within the filtergraph the first input is padded to the right and bottom by double its height and the other three inputs are individually filtered using [http://ffmpeg.org/ffmpeg-filters.html#hflip hflip], [http://ffmpeg.org/ffmpeg-filters.html#negate negate], and [http://ffmpeg.org/ffmpeg-filters.html#edgedetect edgedetect]. The [http://ffmpeg.org/ffmpeg-filters.html#overlay-1 overlay] video filter is then used multiple times to arrange of latter three inputs on top of the first one. The offsets used in the overlay filter arrange the inputs into a grid shape.
     44Here four inputs are filtered together using the `-filter_complex` option. In this case all of the inputs are the `-f lavfi -i testsrc` (the [https://ffmpeg.org/ffmpeg-filters.html#color_002c-haldclutsrc_002c-nullsrc_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc testsrc source filter]) but could be other inputs.
     45
     46Within the filtergraph the first input is padded to the right and bottom by double its height, and the other three inputs are individually filtered using [https://ffmpeg.org/ffmpeg-filters.html#hflip hflip], [https://ffmpeg.org/ffmpeg-filters.html#negate negate], and [https://ffmpeg.org/ffmpeg-filters.html#edgedetect edgedetect].
     47
     48The [https://ffmpeg.org/ffmpeg-filters.html#overlay-1 overlay] video filter is then used multiple times for placement of each input. The offsets used in the overlay filter arrange the inputs into a grid shape.
    4549
    4650[[Image(multiple_input_overlay.jpg)]]
    4751{{{
    48 ffmpeg -f lavfi -i testsrc -f lavfi -i testsrc -f lavfi -i testsrc -f lavfi -i testsrc -filter_complex "[0:0]pad=iw*2:ih*2[a];[1:0]negate[b];[2:0]hflip[c];[3:0]edgedetect[d];[a][b]overlay=w[x];[x][c]overlay=0:h[y];[y][d]overlay=w:h" -y -c:v ffv1 -t 5 multiple_input_grid.avi
     52ffmpeg -f lavfi -i testsrc -f lavfi -i testsrc -f lavfi -i testsrc -f lavfi -i testsrc -filter_complex \
     53"[0:v]pad=iw*2:ih*2[a]; \
     54 [1:v]negate[b]; \
     55 [2:v]hflip[c]; \
     56 [3:v]edgedetect[d]; \
     57 [a][b]overlay=w[x]; \
     58 [x][c]overlay=0:h[y]; \
     59 [y][d]overlay=w:h[out]" -map "[out]" -c:v ffv1 -t 5 multiple_input_grid.avi
    4960}}}
     61
     62Be aware that frames are taken from each input video in timestamp order, so it is a good idea to pass all overlay inputs through a `setpts=PTS-STARTPTS` filter to have them begin in the same zero timestamp, such as `[0:v]hflip,setpts=PTS-STARTPTS[a];[1:v]setpts=PTS-STARTPTS[b];[a][b]overlay`.
    5063
    5164=== Escaping characters ===
     
    130143}}}
    131144
    132 
    133 === List of Filters ===
    134 
    135 Filters bundled with libavfilter as of 4.3.100 (as configured with `--enable-gpl`). Filters relying on external libraries, such as frei0r, are not listed here. See [http://ffmpeg.org/ffmpeg-filters.html FFmpeg filters documentation] for more information and examples for each filter.
    136 
    137 {{{
    138 Filters:
    139   T.. = Timeline support
    140   .S. = Slice threading
    141   ..C = Commmand support
    142   A = Audio input/output
    143   V = Video input/output
    144   N = Dynamic number and/or type of input/output
    145   | = Source or sink filter
    146  ... aconvert         A->A       Convert the input audio to sample_fmt:channel_layout.
    147  T.. adelay           A->A       Delay one or more audio channels.
    148  ... aecho            A->A       Add echoing to the audio.
    149  ... aeval            A->A       Filter audio signal according to a specified expression.
    150  T.. afade            A->A       Fade in/out input audio.
    151  ... aformat          A->A       Convert the input audio to one of the specified formats.
    152  ... ainterleave      N->A       Temporally interleave audio inputs.
    153  ... allpass          A->A       Apply a two-pole all-pass filter.
    154  ... amerge           N->A       Merge two or more audio streams into a single multi-channel stream.
    155  ... amix             N->A       Audio mixing.
    156  ... anull            A->A       Pass the source unchanged to the output.
    157  T.. apad             A->A       Pad audio with silence.
    158  ... aperms           A->A       Set permissions for the output audio frame.
    159  ... aphaser          A->A       Add a phasing effect to the audio.
    160  ... aresample        A->A       Resample audio data.
    161  ... aselect          A->N       Select audio frames to pass in output.
    162  ... asendcmd         A->A       Send commands to filters.
    163  ... asetnsamples     A->A       Set the number of samples for each output audio frames.
    164  ... asetpts          A->A       Set PTS for the output audio frame.
    165  ... asetrate         A->A       Change the sample rate without altering the data.
    166  ... asettb           A->A       Set timebase for the audio output link.
    167  ... ashowinfo        A->A       Show textual information for each audio frame.
    168  ... asplit           A->N       Pass on the audio input to N audio outputs.
    169  ... astats           A->A       Show time domain statistics about audio frames.
    170  ... astreamsync      AA->AA     Copy two streams of audio data in a configurable order.
    171  ..C atempo           A->A       Adjust audio tempo.
    172  ... atrim            A->A       Pick one continuous section from the input, drop the rest.
    173  ... bandpass         A->A       Apply a two-pole Butterworth band-pass filter.
    174  ... bandreject       A->A       Apply a two-pole Butterworth band-reject filter.
    175  ... bass             A->A       Boost or cut lower frequencies.
    176  ... biquad           A->A       Apply a biquad IIR filter with the given coefficients.
    177  ... channelmap       A->A       Remap audio channels.
    178  ... channelsplit     A->N       Split audio into per-channel streams.
    179  ... compand          A->A       Compress or expand audio dynamic range.
    180  ... earwax           A->A       Widen the stereo image.
    181  ... ebur128          A->N       EBU R128 scanner.
    182  ... equalizer        A->A       Apply two-pole peaking equalization (EQ) filter.
    183  ... highpass         A->A       Apply a high-pass filter with 3dB point frequency.
    184  ... join             N->A       Join multiple audio streams into multi-channel output.
    185  ... lowpass          A->A       Apply a low-pass filter with 3dB point frequency.
    186  ... pan              A->A       Remix channels with coefficients (panning).
    187  ... replaygain       A->A       ReplayGain scanner.
    188  ... silencedetect    A->A       Detect silence.
    189  ... treble           A->A       Boost or cut upper frequencies.
    190  T.C volume           A->A       Change input volume.
    191  ... volumedetect     A->A       Detect audio volume.
    192  ... aevalsrc         |->A       Generate an audio signal generated by an expression.
    193  ... anullsrc         |->A       Null audio source, return empty audio frames.
    194  ... sine             |->A       Generate sine wave audio signal.
    195  ... anullsink        A->|       Do absolutely nothing with the input audio.
    196  ... alphaextract     V->N       Extract an alpha channel as a grayscale image component.
    197  ... alphamerge       VV->V      Copy the luma value of the second input into the alpha channel of the first input.
    198  T.. bbox             V->V       Compute bounding box for each frame.
    199  ... blackdetect      V->V       Detect video intervals that are (almost) black.
    200  ... blackframe       V->V       Detect frames that are (almost) black.
    201  TS. blend            VV->V      Blend two video frames into each other.
    202  T.. boxblur          V->V       Blur the input.
    203  T.. colorbalance     V->V       Adjust the color balance.
    204  T.. colorchannelmixer V->V       Adjust colors by mixing color channels.
    205  T.. colormatrix      V->V       Convert color matrix.
    206  ... copy             V->V       Copy the input video unchanged to the output.
    207  ... crop             V->V       Crop the input video.
    208  T.. cropdetect       V->V       Auto-detect crop size.
    209  TS. curves           V->V       Adjust components curves.
    210  T.. dctdnoiz         V->V       Denoise frames using 2D DCT.
    211  ... decimate         N->V       Decimate frames (post field matching filter).
    212  ... dejudder         V->V       Remove judder produced by pullup.
    213  T.. delogo           V->V       Remove logo from input video.
    214  ... deshake          V->V       Stabilize shaky video.
    215  T.. drawbox          V->V       Draw a colored box on the input video.
    216  T.. drawgrid         V->V       Draw a colored grid on the input video.
    217  T.. edgedetect       V->V       Detect and draw edge.
    218  ... elbg             V->V       Apply posterize effect, using the ELBG algorithm.
    219  ... extractplanes    V->N       Extract planes as grayscale frames.
    220  .S. fade             V->V       Fade in/out input video.
    221  ... field            V->V       Extract a field from the input video.
    222  ... fieldmatch       N->V       Field matching for inverse telecine.
    223  T.. fieldorder       V->V       Set the field order.
    224  ... format           V->V       Convert the input video to one of the specified pixel formats.
    225  ... fps              V->V       Force constant framerate.
    226  ... framepack        VV->V      Generate a frame packed stereoscopic video.
    227  T.. framestep        V->V       Select one frame every N frames.
    228  T.. geq              V->V       Apply generic equation to each pixel.
    229  T.. gradfun          V->V       Debands video quickly using gradients.
    230  TS. haldclut         VV->V      Adjust colors using a Hald CLUT.
    231  .S. hflip            V->V       Horizontally flip the input video.
    232  T.. histeq           V->V       Apply global color histogram equalization.
    233  ... histogram        V->V       Compute and draw a histogram.
    234  T.. hqdn3d           V->V       Apply a High Quality 3D Denoiser.
    235  T.C hue              V->V       Adjust the hue and saturation of the input video.
    236  ... idet             V->V       Interlace detect Filter.
    237  T.. il               V->V       Deinterleave or interleave fields.
    238  ... interlace        V->V       Convert progressive video into interlaced.
    239  ... interleave       N->V       Temporally interleave video inputs.
    240  ... kerndeint        V->V       Apply kernel deinterlacing to the input.
    241  TS. lut3d            V->V       Adjust colors using a 3D LUT.
    242  T.. lut              V->V       Compute and apply a lookup table to the RGB/YUV input video.
    243  T.. lutrgb           V->V       Compute and apply a lookup table to the RGB input video.
    244  T.. lutyuv           V->V       Compute and apply a lookup table to the YUV input video.
    245  ... mcdeint          V->V       Apply motion compensating deinterlacing.
    246  ... mergeplanes      N->V       Merge planes.
    247  ... mp               V->V       Apply a libmpcodecs filter to the input video.
    248  ... mpdecimate       V->V       Remove near-duplicate frames.
    249  T.. negate           V->V       Negate input video.
    250  ... noformat         V->V       Force libavfilter not to use any of the specified pixel formats for the input to the next filter.
    251  TS. noise            V->V       Add noise.
    252  ... null             V->V       Pass the source unchanged to the output.
    253  T.C overlay          VV->V      Overlay a video source on top of the input.
    254  T.. owdenoise        V->V       Denoise using wavelets.
    255  ... pad              V->V       Pad the input video.
    256  ... perms            V->V       Set permissions for the output video frame.
    257  T.. perspective      V->V       Correct the perspective of video.
    258  ... phase            V->V       Phase shift fields.
    259  ... pixdesctest      V->V       Test pixel format definitions.
    260  T.C pp               V->V       Filter video using libpostproc.
    261  ... psnr             VV->V      Calculate the PSNR between two video streams.
    262  ... pullup           V->V       Pullup from field sequence to frames.
    263  T.. removelogo       V->V       Remove a TV logo based on a mask image.
    264  TSC rotate           V->V       Rotate the input image.
    265  T.. sab              V->V       Apply shape adaptive blur.
    266  ... scale            V->V       Scale the input video size and/or convert the image format.
    267  ... select           V->N       Select video frames to pass in output.
    268  ... sendcmd          V->V       Send commands to filters.
    269  ... separatefields   V->V       Split input video frames into fields.
    270  ... setdar           V->V       Set the frame display aspect ratio.
    271  ... setfield         V->V       Force field for the output video frame.
    272  ... setpts           V->V       Set PTS for the output video frame.
    273  ... setsar           V->V       Set the pixel sample aspect ratio.
    274  ... settb            V->V       Set timebase for the video output link.
    275  ... showinfo         V->V       Show textual information for each video frame.
    276  ... shuffleplanes    V->V       Shuffle video planes
    277  T.. smartblur        V->V       Blur the input video without impacting the outlines.
    278  ... split            V->N       Pass on the input to N video outputs.
    279  T.C spp              V->V       Apply a simple post processing filter.
    280  ... stereo3d         V->V       Convert video stereoscopic 3D view.
    281  ... super2xsai       V->V       Scale the input by 2x using the Super2xSaI pixel art algorithm.
    282  ... swapuv           V->V       Swap U and V components.
    283  ... telecine         V->V       Apply a telecine pattern.
    284  ... thumbnail        V->V       Select the most representative frame in a given sequence of consecutive frames.
    285  ... tile             V->V       Tile several successive frames together.
    286  ... tinterlace       V->V       Perform temporal field interlacing.
    287  .S. transpose        V->V       Transpose input video.
    288  ... trim             V->V       Pick one continuous section from the input, drop the rest.
    289  T.. unsharp          V->V       Sharpen or blur the input video.
    290  ... vflip            V->V       Flip the input video vertically.
    291  T.. vignette         V->V       Make or reverse a vignette effect.
    292  T.. w3fdif           V->V       Apply Martin Weston three field deinterlace.
    293  TS. yadif            V->V       Deinterlace the input image.
    294  ... cellauto         |->V       Create pattern generated by an elementary cellular automaton.
    295  ..C color            |->V       Provide an uniformly colored input.
    296  ... haldclutsrc      |->V       Provide an identity Hald CLUT.
    297  ... life             |->V       Create life.
    298  ... mandelbrot       |->V       Render a Mandelbrot fractal.
    299  ... mptestsrc        |->V       Generate various test pattern.
    300  ... nullsrc          |->V       Null video source, return unprocessed video frames.
    301  ... rgbtestsrc       |->V       Generate RGB test pattern.
    302  ... smptebars        |->V       Generate SMPTE color bars.
    303  ... smptehdbars      |->V       Generate SMPTE HD color bars.
    304  ... testsrc          |->V       Generate test pattern.
    305  ... nullsink         V->|       Do absolutely nothing with the input video.
    306  ... avectorscope     A->V       Convert input audio to vectorscope video output.
    307  ... concat           N->N       Concatenate audio and video streams.
    308  ... showspectrum     A->V       Convert input audio to a spectrum video output.
    309  ... showwaves        A->V       Convert input audio to a video output.
    310  ... amovie           |->N       Read audio from a movie source.
    311  ... movie            |->N       Read from a movie source.
    312  ... ffbuffersink     V->|       Buffer video frames, and make them available to the end of the filter graph.
    313  ... ffabuffersink    A->|       Buffer audio frames, and make them available to the end of the filter graph.
    314  ... abuffer          |->A       Buffer audio frames, and make them accessible to the filterchain.
    315  ... buffer           |->V       Buffer video frames, and make them accessible to the filterchain.
    316  ... abuffersink      A->|       Buffer audio frames, and make them available to the end of the filter graph.
    317  ... buffersink       V->|       Buffer video frames, and make them available to the end of the filter graph.
    318  ... afifo            A->A       Buffer input frames and send them when they are requested.
    319  ... fifo             V->V       Buffer input images and send them when they are requested.
    320 }}}
    321 
    322145=== Other Filter Examples ===
    323146