Last active
March 31, 2022 18:29
-
-
Save alexarje/9a267cf10839a95fed74a47f4f1e778e to your computer and use it in GitHub Desktop.
Merge and compress a collection of video files. This works particularly well for video recordings that have been split across multiple files due to file size limitations.
This file contains hidden or 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 | |
## Make list of video files | |
TMPFILE=$(mktemp -p .) || exit 1 | |
for file in *.{mp4,MP4} | |
do | |
echo file \'$file\' >> $TMPFILE | |
done | |
## Concatenate files | |
ffmpeg -f concat -safe 0 -i $TMPFILE -c copy video-merged.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment