Wednesday, June 21, 2023

Merge dashcam video file segments into a large MP4 file

As most dashcams save videos in 2-5 minute segments, sometimes you need to stich them together to create a full-length video - e.g. road trip footage. 

To do this, the best solution is to use FFmpeg's concat function.

Step 1: Create a file containing the list of segment file names (in Windows Command Prompt)

(for %i in (*.mp4) do @echo file '%i') > mylist.txt

Step 2: Run ffmpeg to create the output file

ffmpeg -f concat -i mylist.txt -c copy output.mp4