ffmpeg Tools Français

Merge several videos into one

To join several clips (for example, the pieces of a video split by your phone or a dash cam), ffmpeg can put them end to end without re-encoding them: it's instant and lossless. The script builds a list of the files in the folder, in alphabetical order, then joins them.

Updated on

  

How to use it

  1. Install ffmpeg if you haven't already.
  2. Put all the videos to join, and only those, in a single folder. Name them in the order you want.
  3. Open a terminal in that folder, paste the script and press Enter.
  4. Open the resulting video-merged file to check the joins.

How the joining works

The script first writes a liste.txt file containing one line "file 'name.mp4'" per video. ffmpeg then reads that list with the concat module and copies the videos one after another. Without re-encoding, the operation takes only a few seconds.

Stuttering or out-of-sync audio at the joins

If the videos have slightly different settings (frame rate, audio sample rate), copying can produce stuttering or out-of-sync audio at the joins. The "With re-encoding" mode rebuilds a clean stream, at the cost of longer processing.

Frequently asked questions

In what order are the videos joined?

In alphabetical order of the file names. Rename them if needed (01.mp4, 02.mp4…) to force the order. On Linux and macOS, the video-merged output file is excluded from the list.

Can I join videos with different sizes or formats?

Not with this script: it assumes all the videos have the same codec, the same resolution and the same frame rate. For different sources, first convert them all with the same settings (for example with the folder conversion script), then join them.

A file name contains an apostrophe and the script fails

The file list uses apostrophes around the names. Rename the affected files to remove the apostrophe, then run the script again.

More tools