[Tutorial] Concatenate a List of `.flv` Files into a Single `.mp4` File
Concat A List of .flv
Files into a Single .mp4
File
ffmpeg -f concat -safe 0 -i <(for f in ./*.flv; do echo "file '$PWD/$f'"; done) -c copy output.mp4
Or Create a .txt
File to List the .flv
Files
for f in ./*.flv; do echo "file '$PWD/$f'" >> filelist.txt; done
ffmpeg -f concat -safe 0 -i filelist.txt -c copy -threads 0 output.mp4
If the Video and Audio Codecs are Different
If the Video and Audio Codecs are Different, Re-encode the Video Stream with libx264
Codec:
ffmpeg -f concat -safe 0 -i filelist.txt -c:v libx264 -threads 0 output.mp4