How to add a before/after slider with Claude

A white line swings across the frame, with the dull before shot on its left and the after shot on its right.

Get this effect

  1. Switch to Code in your Claude Desktop App

  2. Install the skill (once)

    Show the prompt
    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 before/after slider from before.mp4 and after.mp4
    How fast the divider swings: 1.3
    Half the divider's width, in pixels: 3

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 before/after slider 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.

SettingDefaultWhat it does
SPEED1.3How fast the divider swings.
LINE3Half the divider's width, in pixels.

Without the skill

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

Show the prompt
Make a before/after slider from before.mp4 and after.mp4: a 6-pixel white vertical divider swings back and forth between 10% and 90% of the width (position 0.5+0.4*cos(1.3*t)), with before.mp4 shown left of the divider and after.mp4 right of it. Use after.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 before-after-slider.sh and run:

sh before-after-slider.sh before.mp4 after.mp4 output.mp4
Show the command
#!/bin/sh
# Before/after slider: a white divider sweeps across the frame, with "before" on its left and "after" on its right.
# Usage: sh before-after-slider.sh before.mp4 after.mp4 output.mp4  (both clips the same size)
set -e
BEFORE="$1"; AFTER="$2"; OUT="$3"
SPEED=1.3   # how fast the divider swings back and forth
LINE=3      # half the divider's width, in pixels

# P is the divider's position (0 = left edge, 1 = right edge); it swings between 0.1 and 0.9
P="(0.5+0.4*cos(T*$SPEED))"
ffmpeg -y -i "$BEFORE" -i "$AFTER" -filter_complex "\
[0:v]format=gbrp[b];[1:v]format=gbrp[a];\
[b][a]blend=all_expr='if(lt(abs(X-W*$P),$LINE),255,if(lt(X,W*$P),A,B))',format=yuv420p[v]" \
  -map "[v]" -map "1:a?" -c:v libx264 -crf 18 -c:a copy "$OUT"

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