Last active
September 13, 2017 10:31
-
-
Save elalemanyo/5d7d607b5d4d8b966d5f to your computer and use it in GitHub Desktop.
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
// Video mosaic | |
ffmpeg | |
-i 1.mp4 -i 2.mp4 -i 3.mp4 -i 4.mp4 | |
-filter_complex " | |
nullsrc=size=1280x720 [base]; | |
[0:v] setpts=PTS-STARTPTS, scale=640x360 [upperleft]; | |
[1:v] setpts=PTS-STARTPTS, scale=640x360 [upperright]; | |
[2:v] setpts=PTS-STARTPTS, scale=640x360 [lowerleft]; | |
[3:v] setpts=PTS-STARTPTS, scale=640x360 [lowerright]; | |
[base][upperleft] overlay=shortest=1 [tmp1]; | |
[tmp1][upperright] overlay=shortest=1:x=640 [tmp2]; | |
[tmp2][lowerleft] overlay=shortest=1:y=360 [tmp3]; | |
[tmp3][lowerright] overlay=shortest=1:x=640:y=360 | |
" | |
-c:v libx264 output.mp4 | |
// Video mute audio | |
ffmpeg -i output.mp4 -vcodec copy -an output_mute.mp4 | |
// Get merge audio | |
ffmpeg -i 1.mp4 -i 2.mp4 -i 3.mp4 -i 4.mp4 -filter_complex amix=inputs=4:duration=first:dropout_transition=4 output_sound.mp3 | |
// Merge audio with video | |
ffmpeg -i output_mute.mp4 -i output_sound.mp3 -vcodec copy -shortest output_complete.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment