Merge Video Clips

Published Updated

Join MP4, MOV and WebM clips in the order you set. The first clip fixes the frame size, later clips are fitted inside it with black bars, and the join is recorded in real time.

The first clip sets the frame for everything

Whatever sits at the top of the list decides the output size. If it is 1920 x 1080, the merged video is 1920 x 1080 throughout, and every later clip is scaled to the largest size that fits inside that frame. Leftover space is filled with black.

This is a re-recording, not a lossless join: each clip plays once in a hidden player, its frames are painted onto a canvas, and the canvas is recorded with the sound at no more than 30 fps. That is why clips with different sizes, frame rates and codecs can be mixed, and why it takes real time.

How a clip that does not match is drawn

Worked out with the tool's fit rule (the smaller of output width / clip width and output height / clip height):

First clipLater clipDrawn as
1920 x 10801080 x 1920 (upright phone video)About 608 x 1080, black bars left and right
1080 x 19201920 x 10801080 x about 608, black bars above and below
1280 x 7203840 x 2160Scaled down to 1280 x 720; the 4K detail is gone

So start with the clip whose shape you want to keep, or cut the others to 9:16 first with Crop Video.

Merging, one step at a time

  1. Step 1

    Add two or more clips

    MP4, MOV or WebM. Each row shows the length and pixel size once your browser has read it; a clip it cannot play is marked and skipped.

  2. Step 2

    Drag them into order

    Top to bottom is the playing order. The top clip also sets the width and height of the whole video.

  3. Step 3

    Merge with the tab in front

    Every clip plays through once while it is recorded, so a 6-minute total takes about 6 minutes. The file is merged-video.mp4 or .webm.

Expected file size

The tool sets no bitrate, and MDN's MediaRecorder reference gives the browser default as 2.5 or 10 Mbps for video. Video alone then comes to:

Total lengthAt 2.5 MbpsAt 10 Mbps
30 secondsAbout 9 MBAbout 38 MB
2 minutesAbout 38 MBAbout 150 MB
10 minutesAbout 190 MBAbout 750 MB

Sound adds a little. The two-clip merge measured further down came to 0.85 to 1.05 MB for 6.96 seconds at 640 x 360, about 1 to 1.2 Mbps with sound, under the 2.5 Mbps of the table. To shrink the result, use Video Compressor; to shorten parts first, Trim Video.

Sound, memory and the open tab

Once a player feeds the Web Audio API, its sound is routed into the audio graph, and this tool's graph ends in the recording, not the speakers, so the merge runs silently.

Frames are painted with requestAnimationFrame, which most browsers pause in background tabs, so switching away freezes the picture while the sound runs on. There is no clip limit, but the recording stays in memory until you download it. If dragging rows fails on a touch screen, clear the list and add clips in playing order.

Two clips of different shapes: what we measured

We ran the tool's merge loop (copied from the component, with the site's audio code) in Google Chrome 156.0.8078.80 (headless), Chromium 153.0.8010.12 (the build that ships with Playwright, headless, not Google Chrome) and Firefox 155.0, joining a generated landscape clip of 640 x 360 and 3.97 seconds with a generated portrait clip of 360 x 640 and 2.99 seconds. Both had a 440 Hz tone and moving markers.

EngineOutputSizeLength read backTime to merge
Chrome 156MP4, 640 x 3601,023,025 bytes7.00 s7.0 s
Chromium 153MP4, 640 x 3601,046,998 bytes7.03 s7.1 s
Firefox 155WebM, 640 x 360850,708 bytes7.07 s7.0 s

The output takes the size of the first clip. The two clips add up to 6.96 seconds and the files read back 0.04 to 0.11 seconds longer. The merge runs in real time, so it takes about as long as the finished video. In Playwright's WebKit build the merge did not start: the browser refused to play the clips with sound (NotAllowedError) in our script, also after a click on a button in our test page, so we have no WebKit result and cannot say what Safari does.

What the second clip looks like on the first clip's canvas

In the frame taken at 5 seconds, when the portrait clip was playing, the red marker of the portrait clip was at (233, 13) in Chrome 156 and Chromium 153 and at (232, 13) in Firefox 155, and the left edge of the frame was black (brightness 0). The portrait clip was scaled down to fit the 360-pixel height of the canvas, which makes it about 203 pixels wide, and centred, and the left edge was black. In the frame at 1 second, the landscape clip's markers were at their normal places (25, 25) and (613, 333).

So a portrait clip joined after a landscape clip is not cropped: it is shrunk to a strip with black bars. If you want clips of one shape, rotate or crop them first, or put the clip you want to set the shape first in the list. The sound of both clips was in the output in all three engines; we checked for an audio track in each file.

Joining clips: common questions

Can I merge clips with different sizes or orientations?

Yes. Each later clip is scaled to fit inside the first clip's frame, centered, with black bars around it. Nothing is cropped or stretched, so an upright phone clip after a 1920 x 1080 clip shows as a 608 x 1080 strip in the middle.

Why does merging take as long as the video itself?

The tool does not copy compressed data between files. It plays each clip, paints every frame onto a canvas and records that with the sound, so three 2-minute clips need about 6 minutes.

Is the merged video the same quality as my clips?

No, it is a new encoding. Recording tops out at 30 frames per second, so a 60 fps clip loses at least every other frame, and the browser chooses the bitrate. Clips larger than the first one are scaled down to its size.

Is the sound of each clip kept?

In Chrome, Chromium and Firefox, yes: audio goes through the browser's Web Audio system into the recording and switches with the picture, so you hear nothing while it runs. In our runs a clip with no sound track added silence.

Why is one of my clips marked Couldn't read this video file?

Your browser cannot decode it. One possible cause is an iPhone video in High Efficiency (HEVC) on a computer without HEVC playback. Apple's Most Compatible camera setting records H.264 instead.

Will I get an MP4 or a WebM file?

MP4 when your browser's recorder supports MP4 with H.264 video, otherwise WebM. The result card names the format, pixel size and file size before you download.

What size is the merged video when the clips differ?

The size of the first clip. In our test a 640 x 360 clip followed by a 360 x 640 clip gave a 640 x 360 video in three engines.

What happens to a portrait clip after a landscape one?

It is scaled to fit and centred with black bars, not cropped. Our test clip became a strip about 203 pixels wide on the 640 x 360 canvas.

How long does merging take?

About as long as the finished video. 6.96 seconds of clips took 7.0 to 7.1 seconds in three engines.

Does merging work in every browser?

Chrome 156, Chromium 153 and Firefox 155 merged our test clips. An earlier test script got no WebKit result because the browser refused to play the clips with sound; in later runs started with a real click on the tool's own button, the WebKit build merged clips.

Related guide

Trim, crop and caption a video in the browser. The guide joins a 640 × 360 clip and a 360 × 640 clip into a 640 × 360 file with black bars, and times the merge at about 7 seconds in two engines.

Related Tools