---
title: "How to add a video grid with Claude (tested prompt and ffmpeg command)"
description: "Four different clips fade in one after another into a 2x2 grid of tall tiles with thin dark borders, then all play at once. Install one skill and ask Claude Code, or run the ffmpeg command we tested yourself."
url: https://www.recharm.com/effects/video-grid
---

# How to add a video grid with Claude

Four different clips fade in one after another into a 2x2 grid of tall tiles with thin dark borders, then all play at once.

Made by the command on this page, from our own test clips.

## Get this effect

1. ### Switch to Code in your [Claude Desktop App](https://claude.com/download)

2. ### Install the skill (once)

   ```
   Install the Recharm video effects skill: download https://recharm-growth-staging.s3.us-east-2.amazonaws.com/website/downloads/recharm-video-effects.zip and unzip it into ~/.claude/skills
   ```

3. ### Ask for the effect

   ```
   Make a video grid from a.mp4 and b.mp4 and c.mp4 and d.mp4
   Pixels of border around and between the tiles: 12
   Seconds between one tile fading in and the next: 0.25
   ```

## Several videos, several effects, one ask

Put your clips in the folder, mention them with @, and ask for everything at once. Claude runs one tested script after another on each clip, then joins them.

Add a video grid to **@clip1.mp4**, put a sale badge on **@clip2.mp4**, give **@clip3.mp4** a VHS look, then join all three with crossfades.

## Settings you can change

Ask Claude to change any of these, or edit them at the top of the command.

| Setting   | Default    | What it does                                     |
| --------- | ---------- | ------------------------------------------------ |
| `GAP`     | `12`       | Pixels of border around and between the tiles.   |
| `STAGGER` | `0.25`     | Seconds between one tile fading in and the next. |
| `FADE`    | `0.2`      | Seconds each tile takes to fade in.              |
| `BOARD`   | `0x141414` | Color behind the tiles.                          |

## Without the skill

Don’t want to install the skill? Paste this prompt into Claude Code and Claude writes the command itself.

```
Make a 2x2 video grid from four clips: a.mp4 top-left, b.mp4 top-right, c.mp4 bottom-left, d.mp4 bottom-right. The output is 540x960, 30fps and 6 seconds long, on a #141414 near-black background. Each tile is 252x462 pixels, with a 12-pixel border around the outside and 12 pixels between tiles: tiles at x=12 and x=276, y=12 and y=486. Scale each clip to fill its tile and crop the overflow equally from both sides (centered), never stretch it. Each tile fades in from the background over 0.2 seconds: top-left starting at 0s, top-right at 0.25s, bottom-left at 0.5s, bottom-right at 0.75s; until its fade starts a slot shows only the background. All four clips play from their own start at the same time and keep playing to the end. Keep a.mp4's audio. Use ffmpeg and save it as output.mp4.
```

## Run it without Claude

This is the exact command we tested. Save it as `video-grid.sh` and run:

```
sh video-grid.sh a.mp4 b.mp4 c.mp4 d.mp4 output.mp4
```

```
#!/bin/sh
# Video grid: four clips play at once in a 2x2 grid on a dark board, each tile fading in a beat after the last.
# Usage: sh video-grid.sh top-left.mp4 top-right.mp4 bottom-left.mp4 bottom-right.mp4 output.mp4
# Needs ffmpeg. The output takes the first clip's size, length and sound; each clip fills its tile, cropped from the center.
set -e
A="$1"; B="$2"; C="$3"; D="$4"; OUT="$5"
GAP=12          # dark border round and between the tiles, in pixels
STAGGER=0.25    # seconds between one tile fading in and the next (top-left, top-right, bottom-left, bottom-right)
FADE=0.2        # seconds each tile takes to fade in
BOARD=0x141414  # color behind the tiles (near-black)

SIZE=$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 "$A")
W=${SIZE%x*}; H=${SIZE#*x}
TW=$(( (W - 3 * GAP) / 2 / 2 * 2 )); TH=$(( (H - 3 * GAP) / 2 / 2 * 2 )) # tile size, rounded down to even
X2=$((2 * GAP + TW)); Y2=$((2 * GAP + TH))
tile() {  # input index -> tile scaled to fill, cropped, fading in at its turn
  echo "[$1:v]fps=30,scale=$TW:$TH:force_original_aspect_ratio=increase,crop=$TW:$TH,setsar=1,format=rgba,\
fade=in:st=$(awk "BEGIN { print $1 * $STAGGER }"):d=$FADE:alpha=1[t$1];"
}
ffmpeg -y -i "$A" -i "$B" -i "$C" -i "$D" -filter_complex "\
color=$BOARD:s=${W}x${H}:r=30[board];$(tile 0)$(tile 1)$(tile 2)$(tile 3)\
[board][t0]overlay=$GAP:$GAP:shortest=1[g0];[g0][t1]overlay=$X2:$GAP[g1];\
[g1][t2]overlay=$GAP:$Y2[g2];[g2][t3]overlay=$X2:$Y2,format=yuv420p[v]" \
  -map "[v]" -map "0:a" -c:v libx264 -crf 18 -c:a aac "$OUT"
```

## More layouts and reframing

- [Background replacement **Background replacement**](https://www.recharm.com/effects/background-replacement)
- [Binocular view **Binocular view**](https://www.recharm.com/effects/binocular-view)
- [Blur region **Blur region**](https://www.recharm.com/effects/blur-region)
- [Cinematic bars **Cinematic bars**](https://www.recharm.com/effects/cinematic-bars)
- [Comic panel layout **Comic panel layout**](https://www.recharm.com/effects/comic-panel-layout)

## Find 3x _winning ads_

Recharm cuts your ad footage into tagged, searchable clips: hooks, testimonials, product shots. Find the shots that win, add the effect with Claude, and ship 3x more ad edits.

[Start 14-day free trial](https://www.recharm.com/get-started)
