Skip to content

Instantly share code, notes, and snippets.

@roommini
Forked from Domin8-IPTV/make247.sh
Created August 9, 2020 20:41
Show Gist options
  • Select an option

  • Save roommini/eaa9ccd25dfb7943b623f50cf9b46395 to your computer and use it in GitHub Desktop.

Select an option

Save roommini/eaa9ccd25dfb7943b623f50cf9b46395 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