Last active
July 17, 2023 10:41
-
-
Save ryanfb/12ed696675db85dba40fc85eaed47f13 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