Skip to content

Instantly share code, notes, and snippets.

@Domin8-IPTV
Created May 23, 2019 17:11
Show Gist options
  • Save Domin8-IPTV/70e6fe102d06645027efcad71ce752f0 to your computer and use it in GitHub Desktop.
Save Domin8-IPTV/70e6fe102d06645027efcad71ce752f0 to your computer and use it in GitHub Desktop.
ffmpeg concatenate all media files in the current directory with .mp4 extension
#!/bin/sh
# use ffmpeg to concatenate all the mp4 files in the media directory
# make file executable and run like this
# ./make247.sh /path/to/media/folder
#
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