#!/bin/bash # This script can be used to combine multiple FFMPEG files into one without re-encoding # It lists all the *mp4 files in current directory and then builds a file list, passing it to FFMPEG # FFMPEG does concatenation and then we remove the file list # Requirements: FFMPEG, Linux, Bash # Save to ffmpeg-combine-noreencoding.sh, do `chmod +x ffmpeg*sh`, then run like `./ffmpeg-combine-noreencoding.sh` # * Please run only in folder with the FFMPEG files you want to combine # * Files will be combined in alphabetical way # * Process takes some time, output filename is normally always output.mp4 for item in $(ls *mp4); do echo "file '$PWD/$item'" >> filelist.md done ffmpeg -f concat -safe 0 -i filelist.md -c copy output.mp4 rm filelist.md