Concat files with ffmpeg

This is how you concat files with ffmpeg, but I prefer a simple bash script for it.

I use this quite often.

Mostly for video-files that are split into several parts; sometimes audio-files too.

This bash script makes the whole process so much easier.

ffmpeg-concat.bash

#!/bin/bash

get_all_files() {
        local argc=$#
        local argv=($@)
        for (( j=0; j<argc-1; j++ )); do
                echo file $PWD/${argv[j]}
        done
}

main() {
        local argc=$#
        local argv=($@)
        ffmpeg -f concat -safe 0 -i <(get_all_files "$@") -c copy "${argv[$argc-1]}"
}

main "$@"