Get this effect
Switch to Code in your Claude Desktop App
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/skillsAsk for the effect
Add a stutter on beat to input.mp4 Length of the repeated slice as a fraction of a beat: 0.25 How many times the slice plays on each beat: 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 stutter on beat 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 script.
| Setting | Default | What it does |
|---|---|---|
SLICE | 0.25 | Length of the repeated slice as a fraction of a beat. 0.25 is a sixteenth note, 4 frames at 120 BPM. |
REPEATS | 3 | How many times the slice plays on each beat. |
BASS_HZ | 150 | Beats are found in the sound below this frequency, where the kick drum sits. |
RATE | 22050 | Audio sample rate the beat tracking uses. |
HOP | 256 | Audio samples per analysis step. Smaller gives more exact beat times. |
Without the skill
Don’t want to install the skill? Paste this prompt into Claude Code and Claude writes the script itself.
Show the prompt
Add a stutter on the beat to input.mp4. Find the kick drum beats with librosa: take the onset strength of the audio (mono, 22050 Hz) with hop_length 256, fmax 150 Hz and n_mels 8, run librosa.beat.beat_track on that envelope, move each beat back to where its hit starts with librosa.onset.onset_backtrack, convert to seconds and round each to the nearest video frame. The slice is a quarter of a beat: the median gap between beats times 0.25, rounded to whole frames (4 frames at 30fps for this 120 BPM loop). On each beat, the frames from the beat onward play the slice three times in a row (output frame beat+i shows source frame beat + i mod 4, for i from 0 to 11), then the video carries on from its own frame (frame beat+12 shows source frame beat+12), so it stays in time with the music. Frames outside a stutter are untouched. Keep the original audio unchanged. No text is needed; if you add any, draw it with Pillow, not ffmpeg's drawtext. Keep the size (540x960) and 30fps, encode H.264 yuv420p, and save it as output.mp4.Run it without Claude
This is the exact script we tested. Save it as stutter-on-beat.py and run:
python3 stutter-on-beat.py input.mp4 output.mp4Show the script
#!/usr/bin/env python3
"""Stutter on beat: on every kick drum a quarter-beat slice of the picture plays three times in a row, then the clip carries on in time.
Usage: python3 stutter-on-beat.py input.mp4 output.mp4 (the input needs a music track with a beat)
Needs ffmpeg, librosa and numpy (pip install librosa numpy).
"""
import json
import subprocess
import sys
import librosa
import numpy as np
SLICE = 0.25 # length of the repeated slice, as a fraction of a beat (0.25 = a sixteenth note)
REPEATS = 3 # times the slice plays on each beat
BASS_HZ = 150 # beats are found in the sound below this frequency (the kick drum)
RATE = 22050 # audio sample rate the beat tracking uses
HOP = 256 # audio samples per analysis step (smaller = more exact beat times)
def probe(path):
info = json.loads(subprocess.check_output(["ffprobe", "-v", "error", "-select_streams", "v:0", "-show_entries",
"stream=width,height,r_frame_rate", "-of", "json", path]))
s = info["streams"][0]
num, den = s["r_frame_rate"].split("/")
return s["width"], s["height"], s["r_frame_rate"], float(num) / float(den)
def beat_times(src):
"""Kick drum beats in seconds: track the beat in the bass, then move each one back to where its hit starts."""
pcm = subprocess.check_output(["ffmpeg", "-v", "error", "-i", src, "-ac", "1", "-ar", str(RATE), "-f", "f32le", "-"])
audio = np.frombuffer(pcm, np.float32)
bass = librosa.onset.onset_strength(y=audio, sr=RATE, hop_length=HOP, fmax=BASS_HZ, n_mels=8)
_, beats = librosa.beat.beat_track(onset_envelope=bass, sr=RATE, hop_length=HOP)
beats = librosa.onset.onset_backtrack(beats, bass)
return librosa.frames_to_time(beats, sr=RATE, hop_length=HOP)
src, out = sys.argv[1], sys.argv[2]
w, h, rate, fps = probe(src)
beats = np.round(beat_times(src) * fps).astype(int) # beats as video frame numbers
slice_len = max(1, round(np.median(np.diff(beats)) * SLICE)) # slice length in frames
frames = []
reader = subprocess.Popen(["ffmpeg", "-v", "error", "-i", src, "-f", "rawvideo", "-pix_fmt", "rgb24", "-"],
stdout=subprocess.PIPE)
while True:
raw = reader.stdout.read(w * h * 3)
if len(raw) < w * h * 3:
break
frames.append(raw)
reader.wait()
# Each output frame shows its own source frame, except for the REPEATS slices after a beat, which loop back to
# the slice that starts on the beat. After the stutter the picture jumps ahead so it stays in time with the music.
source = list(range(len(frames)))
for b in beats:
for i in range(b, min(b + slice_len * REPEATS, len(frames))):
source[i] = b + (i - b) % slice_len
writer = subprocess.Popen(["ffmpeg", "-v", "error", "-y", "-f", "rawvideo", "-pix_fmt", "rgb24", "-s", f"{w}x{h}",
"-r", rate, "-i", "-", "-i", src, "-map", "0:v", "-map", "1:a?", "-c:v", "libx264",
"-crf", "18", "-pix_fmt", "yuv420p", "-c:a", "copy", "-shortest", out], stdin=subprocess.PIPE)
for n in source:
writer.stdin.write(frames[n])
writer.stdin.close()
sys.exit(writer.wait())





