---
title: "How to add a whip pan with Claude (tested prompt and ffmpeg command)"
description: "The camera flicks sideways off the first shot in a streak of motion blur and lands on the second, sharp again within 0.4 seconds. Install one skill and ask Claude Code, or run the ffmpeg command we tested yourself."
url: https://www.recharm.com/effects/whip-pan
---

# How to add a whip pan with Claude

The camera flicks sideways off the first shot in a streak of motion blur and lands on the second, sharp again within 0.4 seconds.

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 whip pan
   Length of the whip in seconds: 0.4
   Output frame rate: 30
   ```

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

## 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.4`   | Length of the whip in seconds.                                                   |
| `FPS`   | `30`    | Output frame rate.                                                               |
| `STEPS` | `32`    | Positions averaged into each frame of the whip; more gives smoother motion blur. |

## 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.4 second whip pan. Over the last 0.4s of A and the first 0.4s of B, put the two clips side by side (A on the left, B on the right) and slide a 540x960 window from A to B, easing in and out with a cubic curve (slow, fast in the middle, slow), so the picture moves to the left. Add horizontal motion blur by rendering that slide at 960fps and averaging every 32 frames into one 30fps frame. Before and after the whip, A and B play untouched and sharp. Crossfade the audio over the same 0.4 seconds. The result is 11.6 seconds long, 540x960, 30fps, H.264 yuv420p. 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 `whip-pan.sh` and run:

```
sh whip-pan.sh clipA.mp4 clipB.mp4 output.mp4
```

```
#!/bin/sh
# Whip pan: the camera flicks sideways off clip A and lands on clip B in 0.4s, smeared by motion blur. The sound crossfades underneath.
# Usage: sh whip-pan.sh clipA.mp4 clipB.mp4 output.mp4  (both clips need an audio track)
set -e
A="$1"; B="$2"; OUT="$3"
D=0.4      # length of the whip in seconds
FPS=30     # output frame rate
STEPS=32   # positions blended into each frame of the whip (more = smoother motion blur)

LEN=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$A")
CUT=$(echo "$LEN - $D" | bc)
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}
# A's last D seconds sit beside B's first D seconds and a W-wide window slides across them, slow-fast-slow
# (cubic ease in and out). It moves at FPS*STEPS frames a second and every STEPS of them average into one
# output frame, which smears the picture the way a fast camera move does.
P="(t/$D)"
X="$W*if(lt($P,0.5),4*pow($P,3),1-pow(2-2*$P,3)/2)"
ffmpeg -y -i "$A" -i "$B" -filter_complex "\
[0:v]fps=$FPS,format=yuv420p,setsar=1,split[a1][a2];\
[1:v]scale=$W:$H:force_original_aspect_ratio=increase,crop=$W:$H,fps=$FPS,format=yuv420p,setsar=1,split[b1][b2];\
[a1]trim=0:$CUT,setpts=PTS-STARTPTS[ahead];\
[a2]trim=$CUT,setpts=PTS-STARTPTS[atail];\
[b1]trim=0:$D,setpts=PTS-STARTPTS[bhead];\
[b2]trim=$D,setpts=PTS-STARTPTS[btail];\
[atail][bhead]hstack,fps=$((FPS * STEPS)),crop=$W:$H:x='min($W,$X)':y=0,tmix=frames=$STEPS,fps=$FPS[whip];\
[ahead][whip][btail]concat=n=3:v=1:a=0[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)
- [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)

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