Changes between Version 55 and Version 56 of FilteringGuide


Ignore:
Timestamp:
Jan 27, 2023, 12:21:57 PM (4 years ago)
Author:
Djamana
Comment:

Added white spaces for better readability

Legend:

Unmodified
Added
Removed
Modified
  • FilteringGuide

    v55 v56  
    8484
    8585Here 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.
     86(Encoded video is 5 seconds and uses the 'ffv1' video codec.)
    8687
    8788Within the filtergraph the first input is unchanged, 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]. The [https://ffmpeg.org/ffmpeg-filters.html#hstack hstack] and [https://ffmpeg.org/ffmpeg-filters.html#vstack vstack] filters are then used to stack each video into the desired location.
    8889
    8990{{{
    90 ffmpeg -f lavfi -i testsrc -f lavfi -i testsrc -f lavfi -i testsrc -f lavfi -i testsrc -filter_complex \
    91 "[1:v]negate[a]; \
    92  [2:v]hflip[b]; \
    93  [3:v]edgedetect[c]; \
    94  [0:v][a]hstack=inputs=2[top]; \
    95  [b][c]hstack=inputs=2[bottom]; \
    96  [top][bottom]vstack=inputs=2[out]" -map "[out]" -c:v ffv1 -t 5 multiple_input_grid.avi
     91ffmpeg \
     92  -f lavfi -i testsrc   -f lavfi -i testsrc \
     93  -f lavfi -i testsrc   -f lavfi -i testsrc \
     94  -filter_complex \
     95"[1:v] negate     [a]; \
     96 [2:v] hflip      [b]; \
     97 [3:v] edgedetect [c]; \
     98 [0:v] [a]      hstack=inputs=2 [top]; \
     99 [b]   [c]      hstack=inputs=2 [bottom]; \
     100 [top] [bottom] vstack=inputs=2 [out]" \
     101  -map "[out]" \
     102  -c:v ffv1   -t 5   multiple_input_grid.avi
    97103}}}
    98104
     
    100106
    101107{{{
    102 ffmpeg -f lavfi -i testsrc -f lavfi -i testsrc -f lavfi -i testsrc -f lavfi -i testsrc -filter_complex \
    103 "[0:v]pad=iw*2:ih*2[a]; \
    104  [1:v]negate[b]; \
    105  [2:v]hflip[c]; \
    106  [3:v]edgedetect[d]; \
    107  [a][b]overlay=w[x]; \
    108  [x][c]overlay=0:h[y]; \
    109  [y][d]overlay=w:h[out]" -map "[out]" -c:v ffv1 -t 5 multiple_input_grid.avi
     108ffmpeg \
     109  -f lavfi -i testsrc   -f lavfi -i testsrc \
     110  -f lavfi -i testsrc   -f lavfi -i testsrc \
     111  -filter_complex \
     112filter_complex \
     113"[0:v]  pad=iw*2:ih*2 [a]; \
     114 [1:v]  negate        [b]; \
     115 [2:v]  hflip         [c]; \
     116 [3:v]  edgedetect    [d]; \
     117 [a] [b] overlay=w   [x]; \
     118 [x] [c] overlay=0:h [y]; \
     119 [y] [d] overlay=w:h [out]" \
     120  -map "[out]" \
     121  -c:v ffv1   -t 5   multiple_input_grid.avi
    110122}}}
    111123