---
title: "How to add a barn door transition with Claude (tested prompt and ffmpeg command)"
description: "Clip A splits down the center and its two halves slide apart to the left and right like doors, uncovering clip B behind them. Install one skill and ask Claude Code, or run the ffmpeg command we tested yourself."
url: https://www.recharm.com/effects/barn-door
---

# How to add a barn door transition with Claude

Clip A splits down the center and its two halves slide apart to the left and right like doors, uncovering clip B behind them.

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 barn door transition
   How long the doors take to open, in seconds: 0.6
   ```

## 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 barn door transition.

## 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`     | `0.6`   | How long the doors take to open, in seconds. |

## 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 0.6 second barn door transition. The transition starts 0.6 seconds before A ends: from then on clip B plays full frame underneath, while A's left half (x 0 to half the width) slides left and A's right half slides right until both are fully off-screen, with smoothstep easing (progress p from 0 to 1, moved by p*p*(3-2p) of a half-width). Each half keeps showing A's own picture as it moves; there is no seam, border or fade. Crossfade the audio over the same 0.6 seconds. Fit B to A's size and frame rate first. The output is 11.4 seconds at 30fps. Use ffmpeg, keep the audio and save it as output.mp4.
```

## Run it without Claude

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

```
sh barn-door.sh clipA.mp4 clipB.mp4 output.mp4
```

```
#!/bin/sh
# Barn door: clip A splits down the middle and its two halves slide out to the sides over 0.6s, opening onto clip B. The sound crossfades underneath.
# Usage: sh barn-door.sh clipA.mp4 clipB.mp4 output.mp4  (both clips need an audio track)
set -e
A="$1"; B="$2"; OUT="$3"
D=0.6   # how long the doors take to open, in seconds

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}
# 0 -> 1 over the transition, eased in and out (smoothstep)
EASE="st(0,clip((t-$OFFSET)/$D,0,1));ld(0)*ld(0)*(3-2*ld(0))"
# B is fitted to A and starts at OFFSET; A's left and right halves are laid on top and pushed off-screen
ffmpeg -y -i "$A" -i "$B" -filter_complex "\
[0:v]fps=$FPS,format=yuv420p,setsar=1,split[a1][a2];\
[a1]crop=iw/2:ih:0:0[left];\
[a2]crop=iw/2:ih:iw/2:0[right];\
[1:v]scale=$W:$H:force_original_aspect_ratio=increase,crop=$W:$H,fps=$FPS,format=yuv420p,setsar=1,tpad=start_duration=$OFFSET[b];\
[b][left]overlay=x='-w*($EASE)':y=0:eof_action=pass[bl];\
[bl][right]overlay=x='w+w*($EASE)':y=0:eof_action=pass[v];\
[0:a][1:a]acrossfade=d=$D[au]" \
  -map "[v]" -map "[au]" -r "$FPS" -c:v libx264 -crf 18 -pix_fmt yuv420p -c:a aac "$OUT"
```

## More transitions

- [Blinds transition **Blinds transition**](https://www.recharm.com/effects/blinds-transition)
- [Block dissolve **Block dissolve**](https://www.recharm.com/effects/block-dissolve)
- [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)
