How can I merge all the videos in a folder to make a single video file using FFMPEG

This is what I’ve ended up using…

find *.mp4 | sed 's:\ :\\\ :g'| sed 's/^/file /' > fl.txt; ffmpeg -f concat -i fl.txt -c copy output.mp4; rm fl.txt

It’s ugliness pains me but it seems to work ok and it handles spaces in the file names. Also, not sure why OP was asking about python – no need to use something lovely like python when some dirty old bash/sed will do the trick! 😉

ps: I know this is an old post but if googling “ffmpeg concat” brought me here it will probably bring other poor souls here too. Note the above will probably only work if all your files have the same settings/codecs.

pps: @Stackdave says he managed to delete his video folder with this back in the day! I’ve really no idea how that could have happened and I’ve had no complaints since but as always when copying and pasting randomish snippets of bash you found on the internet Caveat Emptor!

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)