Skip to content

Instantly share code, notes, and snippets.

@Bioblaze
Forked from Domin8-IPTV/make247.sh
Created June 26, 2020 05:23
Show Gist options
  • Save Bioblaze/62e5391ca2f4d1fcbcbe43851a855ddc to your computer and use it in GitHub Desktop.
Save Bioblaze/62e5391ca2f4d1fcbcbe43851a855ddc 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