| | 42 | }}} |
| | 43 | |
| | 44 | === multiple input overlay in 4x4 grid === |
| | 45 | 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 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 | {{{ |
| | 49 | 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 |