-
-
Save AdeptSEO/5c86b412401f4dca64b9c343c2d0c8f1 to your computer and use it in GitHub Desktop.
Short shell script for concatenating video files with ffmpeg's "concat" demuxer, using command line arguments.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: | |
# ./ffmpegconcat.sh input1.mp4 input2.mp4 input3.mp4 output.mp4 | |
# See: https://trac.ffmpeg.org/wiki/Concatenate | |
for input in "${@:1:$#-1}"; do echo "file '$input'"; done > filelist.txt | |
ffmpeg -f concat -safe 0 -i filelist.txt -c copy "${@: -1}" | |
echo "Concatenated:" && cat filelist.txt && rm -f filelist.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment