WAVE MP4
MP4 · to · MP4

Merge MP4 files

Merging (concatenating) two or more MP4 files into a single MP4 has two paths. The fast one requires all inputs to share codec, dimensions, and frame rate - just concatenates the compressed streams. The slower one re-encodes everything into one output. Here's the command for each.

Under the hood

What actually changes

MP4 + MP4 source VIDEO matching -> copied; different -> H.264 AUDIO matching -> copied; different -> AAC MP4 same streams VIDEO undefined AUDIO undefined REMUX* or re-encoded
Fast concat (demuxer) when inputs share codec, dimensions, and frame rate. Filter concat with re-encode when they don't. * Wave inspects the source and picks the fast path when it can.

Concatenating video files is only fast when the inputs are structurally identical: same codec (H.264 or HEVC), same dimensions, same frame rate, same audio codec. When those match, ffmpeg's concat demuxer just glues the compressed streams together - no decoding, no re-encoding (see Remux vs re-encode for why that's so much faster). Two clips exported from the same editing session, or two GoPro chapters from the same recording, satisfy this.

The fast-concat command uses a text file listing the inputs: create a file `inputs.txt` with `file input1.mp4` on line one and `file input2.mp4` on line two (and so on), then run `ffmpeg -f concat -safe 0 -i inputs.txt -c copy output.mp4`. Takes seconds regardless of total length. The -safe 0 flag lets ffmpeg accept file paths outside a specific directory; -c copy skips re-encoding.

When the inputs don't match structurally, a full re-encode is required. `ffmpeg -i input1.mp4 -i input2.mp4 -filter_complex "[0:v][0:a][1:v][1:a] concat=n=2:v=1:a=1 [outv] [outa]" -map "[outv]" -map "[outa]" -c:v libx264 -c:a aac output.mp4` uses the concat filter (different from the concat demuxer). This decodes all inputs, normalises them to a common format, and re-encodes to a single MP4. Runs at real-time or faster on modern hardware for 1080p; the total time is roughly equal to the total playtime of all inputs summed.

Wave's current build doesn't offer a merge UI. The conversion path is one input in, one output out. A dedicated merge mode with multi-file input is on the roadmap - it needs a materially different UX than the current drop-one-file flow. Until then, ffmpeg locally is the tool. HandBrake also doesn't merge (it's single-input only). For an interactive merge with preview, DaVinci Resolve (free) or iMovie handles it as a normal editing operation.

How to convert

Three steps.

  1. 01

    Step 1

    For structurally-identical inputs (same codec, size, fps): create inputs.txt with "file input1.mp4" per line, then ffmpeg -f concat -safe 0 -i inputs.txt -c copy output.mp4.

  2. 02

    Step 2

    For different inputs: ffmpeg -i input1.mp4 -i input2.mp4 -filter_complex "[0:v][0:a][1:v][1:a] concat=n=2:v=1:a=1 [outv] [outa]" -map "[outv]" -map "[outa]" -c:v libx264 -c:a aac output.mp4.

  3. 03

    Step 3

    The output is a single MP4 containing all inputs back-to-back.

FAQ

Answers, specifically.

Which concat method should I use?

Fast-concat (demuxer) when inputs match structurally. Re-encode (filter) when they don't. If in doubt, try fast-concat first - if the output plays back with sync issues, glitches, or a black frame at the boundary, the inputs weren't structurally identical and you need the re-encode path.

How to know if inputs match?

ffprobe input.mp4 shows the codec, resolution, and frame rate for each input. Compare across inputs: if codec, width, height, and framerate all match, fast-concat works. Bitrate can differ; sample rate for audio can differ (may cause a click at the boundary).

Does Wave merge videos?

Not currently. Wave processes one input per conversion. A merge UI is on the roadmap; it needs a multi-file drop zone which is materially different from the current single-file UX.

DaVinci Resolve or iMovie to merge?

Both work well and offer preview. iMovie: drag clips onto the timeline in order → Export → pick MP4. DaVinci Resolve free: import clips → drag onto timeline → Deliver tab → MP4 export. Preview lets you check boundaries interactively.

Merge audio from one, video from another?

Different operation - that's a track-swap, not a concat. Command: `ffmpeg -i video.mp4 -i audio.mp4 -c:v copy -c:a aac -map 0:v -map 1:a output.mp4` takes video from input 1 and audio from input 2. Also on the Wave roadmap.

Merged output has a glitch or audio pop at each boundary.

Usually means the audio sample rates or channel counts don't match across inputs. Re-encode with the filter method (concat filter normalises), or pre-normalise each input with `ffmpeg -i input.mp4 -ar 48000 -ac 2 normalised.mp4` before concatenating.

Can I merge different codecs (H.264 + HEVC + AV1)?

Only through the re-encode path (concat filter). The filter decodes each input regardless of codec and re-encodes to a single output codec. Slower than fast-concat but universally works.

Related

Other converters.