Concatenate files with FFmpeg

Continuing the discussion from Join Files not working on MP4 videos:

In 2017 we had to live with the above mentioned hack when we wanted to join a few media files :disappointed_face: ... Luckily, things look brighter these days :slight_smile:

All it takes is a one-liner:

@nodeselect
@firstfileonly

ffmpeg.exe -f concat -safe 0 -i {allfilepath|regex=(.*)|to=file '\1'|filem|utf8|nobom} -codec copy {filepath|..}{date|yyyyMMdd}-{time|HHmmss}{file|ext}

pause

The nifty part is the allfilepath code that generates the temp file for FFmpeg. It will also take care of this issue.

@firstfileonly is needed because we use the original file's extension for the output file and don't want to create multiple joined files.

I just want to mention mp4_merge (GitHub - gyroflow/mp4-merge: A tool and library to losslessly join multiple .mp4 files shot with same camera and settings Β· GitHub) here, because it can actually concat mp4 files from dashcams, keeping the GPS data. Something I don't know how to do with ffmpeg.