Changes between Version 26 and Version 27 of FilteringGuide


Ignore:
Timestamp:
Oct 18, 2012, 6:31:32 AM (4 years ago)
Author:
dericed
Comment:

added example of using the overlay filter to present multiple inputs in a grid

Legend:

Unmodified
Added
Removed
Modified
  • FilteringGuide

    v26 v27  
    4040ffmpeg -i input -vf [in]yadif=0:0:0,scale=iw/2:-1[out] output                 # 1 chain form, with 2 filters in the chain, linking implied 
    4141ffmpeg -i input -vf yadif=0:0:0,scale=iw/2:-1  output                         # the input and output are implied without ambiguity 
     42}}} 
     43 
     44=== multiple input overlay in 4x4 grid === 
     45Here 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 hflip, negate, and edgedetect. The overlay 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. 
     46 
     47[[Image(multiple_input_overlay.jpg)]] 
     48{{{ 
     49ffmpeg -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 
    4250}}} 
    4351