These examples based on FFmpeg wiki page: How to concatenate (join, merge) media files
brew install ffmpeg
brew upgrade ffmpeg
This example only works for files that are the same type AND that are MPG and MPEG transport streams:
ffmpeg -i "concat:input1.mpg|input2.mpg|input3.mpg" -c copy output.mpg
This example for files that are of the same type but is much more flexible as far as what filetype that is:
ffmpeg -f concat -i <(for f in ~/Documents/ffmpegTests/src/*.mov; do echo "file '$f'"; done) -c copy output.mov
- Demuxer pointing to a list of files.
- Create file named 'mylist.txt'
- All files to be concatenated:
file 'input1.mov'
file 'input2.mov'
file 'input3.mov'
note: can be relative path or absolute paths.
then run:
ffmpeg -f concat -i mylist.txt -c copy output
notes on concatenation in general
- you cannot concatenate a file built from concatenation (with standard settings)