Skip to content

Instantly share code, notes, and snippets.

@gorillamoe
Created December 21, 2017 19:13
Show Gist options
  • Save gorillamoe/c197e50be5e11b93b3aafcc4076e8744 to your computer and use it in GitHub Desktop.
Save gorillamoe/c197e50be5e11b93b3aafcc4076e8744 to your computer and use it in GitHub Desktop.
Concat (media) files with ffmpeg
#!/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 "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment