Skip to content

Instantly share code, notes, and snippets.

@francoism90
Last active July 9, 2018 16:31
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 francoism90/f53e3779d26d50de7b6f9c48251af1ae to your computer and use it in GitHub Desktop.
Save francoism90/f53e3779d26d50de7b6f9c48251af1ae to your computer and use it in GitHub Desktop.
Concat compatible video files using ffmpeg (in this case mp4)
#!/bin/sh
rm -rf .list.txt
for file in *; do
filename=$(basename -- "$file")
basename="${filename%.*}"
extension="${filename##*.}"
echo "file '$file'" >> .list.txt;
done
cat .list.txt && ffmpeg \
-f concat \
-safe 0 \
-i .list.txt \
-threads 0 \
-c:v copy \
-c:a copy \
-scodec copy \
"${basename}-concat.${extension}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment