Skip to content

Instantly share code, notes, and snippets.

@jcmaslan
Created November 19, 2018 15:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcmaslan/1fb5aa87a2edace204d4bfd9c0ff2deb to your computer and use it in GitHub Desktop.
Save jcmaslan/1fb5aa87a2edace204d4bfd9c0ff2deb to your computer and use it in GitHub Desktop.
#!/bin/sh
# concatenate all the mp4 files in the argument directory.
# Examples:
# ./ffconcat.sh /Users/Carter/Downloads/video
#
#
IN_DIR="$1";
if [ "$IN_DIR" = '' ] ; then
IN_DIR="."
fi
for f in ${IN_DIR}/*.mp4; do echo "file '$f'" >> concat-list.txt; done
ffmpeg -noautorotate -safe 0 -f concat -i concat-list.txt -c copy output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment