---
title: "How to add a spinning text with Claude (tested prompt and script)"
description: "A yellow \"GLOW UP\" title above the bottle whirls around a vertical axis like a rotating sign, flashing its mirrored back and going edge-on, then slows and settles facing front. Install one skill and ask Claude Code, or run the Python script we tested yourself."
url: https://www.recharm.com/effects/spinning-text
---

# How to add a spinning text with Claude

A yellow "GLOW UP" title above the bottle whirls around a vertical axis like a rotating sign, flashing its mirrored back and going edge-on, then slows and settles facing front.

Made by the script on this page, from our own test clip.

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

   ```
   Add a spinning text to input.mp4
   Title: GLOW UP
   ```

## 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 spinning text 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                                                       |
| ------- | --------------- | ------------------------------------------------------------------ |
| `TITLE` | `GLOW UP`       | The words that spin.                                               |
| `START` | `0.5`           | Second the title appears, already spinning.                        |
| `SPIN`  | `1.6`           | Seconds the spin takes to slow down and settle.                    |
| `TURNS` | `2`             | Full turns before it settles facing front.                         |
| `COLOR` | `(255, 214, 0)` | Text color.                                                        |
| `DEPTH` | `2.5`           | Camera distance in title widths; lower means stronger perspective. |

## Without the skill

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

```
Add spinning text to input.mp4: the title "GLOW UP" in bold yellow (255, 214, 0) letters with a black outline 1% of the frame width thick, text height 16% of the frame width, centered across and 12% of the way down. At 0.5 seconds it appears already spinning around a vertical axis through its center, like a rotating sign: it turns two full turns (720 degrees) with a cubic ease-out over 1.6 seconds, so it starts fast and settles facing front at 2.1 seconds, then stays still. Draw it in 3D: the edge turning toward the camera gets taller (perspective with the camera 2.5 title widths away), the back shows the text mirrored, it is a thin line when edge-on (at 1.3 seconds), and its brightness drops to 55% as it turns side-on. Use Python with Pillow to draw the text, OpenCV to warp it and ffmpeg to put it on the video (don't rely on ffmpeg's drawtext filter), keep the audio, and save it as output.mp4.
```

## Run it without Claude

This is the exact script we tested. Save it as `spinning-text.py` and run:

```
python3 spinning-text.py input.mp4 output.mp4
```

```
#!/usr/bin/env python3
"""Spinning text: a yellow title turns around a vertical axis like a rotating sign, slows down and settles facing front.

Usage: python3 spinning-text.py input.mp4 output.mp4
Needs ffmpeg, Pillow, numpy and OpenCV (pip install pillow numpy opencv-python-headless).
"""
import json
import math
import subprocess
import sys
from pathlib import Path

import cv2
import numpy as np
from PIL import Image, ImageDraw, ImageFont

TITLE = "GLOW UP"        # the words that spin
START = 0.5              # second the title appears, already spinning
SPIN = 1.6               # seconds the spin takes to slow down and settle
TURNS = 2                # full turns before it settles facing front
SIZE = 0.16              # text height as a share of the frame width
Y = 0.12                 # center of the title (0 = top, 1 = bottom)
COLOR = (255, 214, 0)    # text color
DEPTH = 2.5              # camera distance in title widths: lower means stronger perspective
FONTS = ["/System/Library/Fonts/Supplemental/Arial Bold.ttf",     # macOS
         "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf",  # Linux
         "C:/Windows/Fonts/arialbd.ttf"]                          # Windows
FONT_FILE = next((f for f in FONTS if Path(f).exists()), None) or sys.exit("No bold font found: add one to FONTS")

def title_card():
    """The flat title, front face, with a black outline and a little padding."""
    font = ImageFont.truetype(FONT_FILE, round(w * SIZE))
    stroke = round(w * 0.01)
    x0, y0, x1, y1 = font.getbbox(TITLE, stroke_width=stroke)
    pad = stroke * 2
    img = Image.new("RGBA", (x1 - x0 + 2 * pad, y1 - y0 + 2 * pad))
    ImageDraw.Draw(img).text((pad - x0, pad - y0), TITLE, font=font, fill=COLOR, stroke_width=stroke, stroke_fill="black")
    return np.array(img)

def angle(t):
    """Degrees still to turn: TURNS full turns at START, easing out to 0 (facing front) at START + SPIN."""
    p = min(max((t - START) / SPIN, 0), 1)
    return TURNS * 360 * (1 - p) ** 3

def overlay(t):
    if t < START:
        return blank
    a = math.radians(angle(t))
    th, tw = card.shape[:2]
    d = DEPTH * tw
    corners = []
    for x, y in [(-tw / 2, -th / 2), (tw / 2, -th / 2), (tw / 2, th / 2), (-tw / 2, th / 2)]:
        k = d / (d + x * math.sin(a))      # the edge turning toward the camera gets bigger
        corners.append((w / 2 + x * math.cos(a) * k, h * Y + y * k))
    src = np.float32([(0, 0), (tw, 0), (tw, th), (0, th)])
    warp = cv2.getPerspectiveTransform(src, np.float32(corners))
    img = cv2.warpPerspective(card, warp, (w, h), flags=cv2.INTER_LINEAR)
    shade = 0.55 + 0.45 * abs(math.cos(a))  # darker as it turns away from the light
    img[..., :3] = (img[..., :3] * shade).astype(np.uint8)
    return img.tobytes()

def probe(path):
    info = json.loads(subprocess.check_output(["ffprobe", "-v", "error", "-select_streams", "v:0", "-show_entries",
                                               "stream=width,height,r_frame_rate:format=duration", "-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), float(info["format"]["duration"])

def render(src, out):
    """Draw overlay(t) on every frame of src and save to out, keeping the audio."""
    ff = subprocess.Popen(["ffmpeg", "-y", "-v", "error", "-i", src,
                           "-f", "rawvideo", "-pix_fmt", "rgba", "-s", f"{w}x{h}", "-r", rate, "-i", "-",
                           "-filter_complex", "[0:v][1:v]overlay=shortest=1,format=yuv420p[v]",
                           "-map", "[v]", "-map", "0:a?", "-c:v", "libx264", "-crf", "18", "-c:a", "copy", out],
                          stdin=subprocess.PIPE)
    for i in range(math.ceil(duration * fps)):
        ff.stdin.write(overlay(i / fps))
    ff.stdin.close()
    if ff.wait():
        sys.exit("ffmpeg failed")

src, out = sys.argv[1:3]
w, h, rate, fps, duration = probe(src)
card = title_card()
blank = bytes(w * h * 4)
render(src, out)
```

## More captions and text

- [AI chat reply animation **AI chat reply animation**](https://www.recharm.com/effects/ai-chat-typing)
- [Animated bar chart **Animated bar chart**](https://www.recharm.com/effects/animated-bar-chart)
- [Animated checklist **Animated checklist**](https://www.recharm.com/effects/animated-checklist)
- [Animated line graph **Animated line graph**](https://www.recharm.com/effects/animated-line-graph)
- [Animated pie chart **Animated pie chart**](https://www.recharm.com/effects/animated-pie-chart)

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