---
title: "How to add a block dissolve with Claude (tested prompt and ffmpeg command)"
description: "Clip A breaks into a grid of hard-edged squares that flip to clip B one at a time in random order, until the last square is gone 1.2 seconds later. Install one skill and ask Claude Code, or run the ffmpeg command we tested yourself."
url: https://www.recharm.com/effects/block-dissolve
---

# How to add a block dissolve with Claude

Clip A breaks into a grid of hard-edged squares that flip to clip B one at a time in random order, until the last square is gone 1.2 seconds later.

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

   ```
   Join clipA.mp4 and clipB.mp4 with a block dissolve
   Length of the dissolve in seconds: 1.2
   Squares across the frame; more makes smaller squares: 12
   ```

## 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.

Put a sale badge on **@clip1.mp4**, give **@clip2.mp4** a VHS look, then join them with a block dissolve.

## 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                                          |
| ------- | ------- | ----------------------------------------------------- |
| `D`     | `1.2`   | Length of the dissolve in seconds.                    |
| `N`     | `12`    | Squares across the frame; more makes smaller squares. |
| `SEED`  | `7`     | Changes the random order the squares switch in.       |

## Without the skill

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

```
Join clipA.mp4 and clipB.mp4 with a 1.2 second block dissolve that starts 1.2 seconds before clip A ends, so the clips overlap. Cut the frame into a grid of 45x45 pixel squares (12 across a 540 px wide frame) and give each square a fixed random switch time between 0 and 1.2 seconds; at its time the square changes from clip A to clip B with a hard cut, no fading or blurring. About half the squares should show B at 0.6 seconds into the transition, and every square shows B by the end. Crossfade the audio over the same 1.2 seconds. Match B's size and frame rate to A. Use ffmpeg (xfade with a custom expression works) and save it as output.mp4.
```

## Run it without Claude

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

```
sh block-dissolve.sh clipA.mp4 clipB.mp4 output.mp4
```

```
#!/bin/sh
# Block dissolve: clip A breaks into a grid of 45 px squares that switch to clip B one by one in random order over 1.2s. The sound crossfades underneath.
# Usage: sh block-dissolve.sh clipA.mp4 clipB.mp4 output.mp4  (both clips need an audio track)
set -e
A="$1"; B="$2"; OUT="$3"
D=1.2    # transition length in seconds
N=12     # squares across the frame (540 px wide gives 45 px squares)
SEED=7   # change it for a different order of squares

LEN=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$A")
OFFSET=$(echo "$LEN - $D" | bc)
SIZE=$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 "$A")
FPS=$(ffprobe -v error -select_streams v:0 -show_entries stream=r_frame_rate -of csv=p=0 "$A")
W=${SIZE%x*}; H=${SIZE#*x}
# Each pixel finds its square: column c = floor(X*N/W), row r = floor(Y*N/W). A hash of (c, r) gives the
# square a random switch time between 0 and 1. xfade's P runs from 1 to 0, so 1-P is how far through the
# transition we are, and the square shows B once that passes its switch time.
C="floor(X*$N/W)"; R="floor(Y*$N/W)"
HASH="sin($C*12.9898+$R*78.233+$SEED)*43758.5453"
BLOCKS="if(gt(1-P,$HASH-floor($HASH)),B,A)"
# xfade needs both clips at the same size and frame rate, so B is fitted to A first
ffmpeg -y -i "$A" -i "$B" -filter_complex "\
[0:v]fps=$FPS,format=yuv420p,setsar=1[a];\
[1:v]scale=$W:$H:force_original_aspect_ratio=increase,crop=$W:$H,fps=$FPS,format=yuv420p,setsar=1[b];\
[a][b]xfade=transition=custom:expr='$BLOCKS':duration=$D:offset=$OFFSET[v];\
[0:a][1:a]acrossfade=d=$D[au]" \
  -map "[v]" -map "[au]" -c:v libx264 -crf 18 -pix_fmt yuv420p -c:a aac "$OUT"
```

## More transitions

- [Barn door transition **Barn door transition**](https://www.recharm.com/effects/barn-door)
- [Blinds transition **Blinds transition**](https://www.recharm.com/effects/blinds-transition)
- [Blur transition **Blur transition**](https://www.recharm.com/effects/blur-transition)
- [Bounce transition **Bounce transition**](https://www.recharm.com/effects/bounce-transition)
- [Brush stroke transition **Brush stroke transition**](https://www.recharm.com/effects/brush-stroke-transition)

## 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)
