Skip to content

Instantly share code, notes, and snippets.

@alexarje
Last active March 31, 2022 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexarje/9a267cf10839a95fed74a47f4f1e778e to your computer and use it in GitHub Desktop.
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.
#!/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