Browser FFmpeg recipe
Merge Videos Online with FFmpeg
Join two videos into one MP4 by re-encoding matching video and audio streams.
Command
Run this FFmpeg command
ffmpeg -i part1.mp4 -i part2.mp4 -filter_complex [0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1[v][a] -map [v] -map [a] merged.mp4When to use it
- joining clips
- simple two-part videos
- browser-side merging
How it works
- Upload both video files.
- Update the second filename if it is not part2.mp4.
- Run FFmpeg and download the merged MP4.
Option reference
| Option | What it does |
|---|---|
-i part2.mp4 | Adds the second video input. |
concat=n=2:v=1:a=1 | Concatenates two inputs with one video stream and one audio stream. |
-map [v] -map [a] | Writes the concatenated video and audio streams. |
Practical notes
- Both inputs should have compatible dimensions and audio layouts for the cleanest result.
- For many files, use the concat videos recipe with a files.txt list.
FAQ
Can I merge more than two videos?
Yes, but the filter needs more inputs and a larger concat count.
Why does this re-encode?
The filter creates new joined streams, so FFmpeg encodes a new output file.