Last active
April 4, 2018 21:33
-
-
Save vherolf/f14d9267453377e0660004fe0cdad107 to your computer and use it in GitHub Desktop.
put videos side by side with ffmpeg with filter_complex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################## | |
## vertical 2 way sidebyside merge | |
################################## | |
ffmpeg -i 1.mp4 -i 2.mp4 -filter_complex "[0:0]pad=iw*1:ih*2[out1];[out1][1:0]overlay=x=0:y=h" -c:a copy -c:v libx264 output.mp4 | |
#################################### | |
## horizontal 2 way sidebyside merge | |
#################################### | |
ffmpeg -i 1.mp4 -i 2.mp4 -filter_complex "[0:0]pad=iw*2:ih*1[out1];[out1][1:0]overlay=x=w:y=0" -c:a copy -c:v libx264 output.mp4 | |
############################## | |
## quadlayout sidebyside merge | |
############################## | |
ffmpeg -i 1.mp4 -i 2.mp4 -i 3.mp4 -i 4.mp4 -filter_complex "[0:0]pad=iw*2:ih*2[out1];[out1][1:0]overlay=x=w:y=0[out2];[out2][2:0]overlay=x=0:y=h[out3];[out3][3:0]overlay=x=w:y=h" -c:a copy -c:v libx264 output.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment