How to add a text on a path with Claude

"GLOW ALL DAY" and "NEW FORMULA" curve around the bottle in a ring of bold yellow letters split by two pink stars, and the whole ring keeps spinning clockwise.

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

    Add a text on a path to input.mp4
    Phrases: GLOW ALL DAY, NEW FORMULA

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 text on a path 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.

SettingDefaultWhat it does
PHRASESGLOW ALL DAY, NEW FORMULAThe phrases on the top and bottom halves of the ring.
START0.5Second the ring appears.
FADE0.3Seconds the ring takes to fade in.
X, Y0.5, 0.49Ring center (0-1 across and down the frame).
RADIUS0.44Ring radius, to the middle of the letters, as a share of the frame width.
SPEED45Spin in degrees per second, clockwise.
FONT_SIZE0.09Letter size as a share of the frame width.
COLOR(255, 214, 0)Letter color.
OUTLINE, OUTLINE_COLOR0.008, (40, 12, 60)Outline thickness as a share of the frame width, and its color.
STAR_COLOR(255, 70, 150)Color of the two stars between the phrases.
STAR_GAP26Degrees of the ring each star takes up.

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 circular text on a path to input.mp4: a ring of letters around the product, centered 50% across and 49% down, with the middle of the letters on a circle whose radius is 44% of the frame width. The ring holds two phrases, "GLOW ALL DAY" and "NEW FORMULA", in a heavy bold font (Arial Black) 9% of the frame width in size, yellow (255, 214, 0) with a dark purple (40, 12, 60) outline 0.8% of the frame width thick. Each letter sits on the circle with its top facing outward, both phrases reading clockwise. Measuring angles clockwise from the top, two pink (255, 70, 150) five-pointed stars with the same dark outline, 1.3 times the letter size across, sit at 90 and 270 degrees, and each phrase is spread evenly over the 154 degrees between them: "GLOW ALL DAY" centered on 0 degrees (the top), "NEW FORMULA" centered on 180 degrees (the bottom). Nothing shows before 0.5 seconds; the ring fades in from 0.5 seconds over 0.3 seconds and stays to the end, spinning clockwise at 45 degrees per second from 0.5 seconds (so at 2.5 seconds the stars are at the top and bottom). The video inside and outside the ring stays untouched. Draw the text with Python and Pillow (don't rely on ffmpeg's drawtext filter), keep the size and audio, and save it as output.mp4.

Run it without Claude

This is the exact script we tested. Save it as text-on-a-path.py and run:

python3 text-on-a-path.py input.mp4 output.mp4
Show the script
#!/usr/bin/env python3
"""Text on a path: two phrases wrap round the product in a ring of letters that spins clockwise.

Usage: python3 text-on-a-path.py input.mp4 output.mp4
Needs ffmpeg and Pillow (pip install pillow).
"""
import json
import math
import subprocess
import sys
from pathlib import Path

from PIL import Image, ImageDraw, ImageFont

PHRASES = ("GLOW ALL DAY", "NEW FORMULA")  # the top and bottom halves of the ring
START = 0.5                     # second the ring appears
FADE = 0.3                      # seconds the ring takes to fade in
X, Y = 0.5, 0.49                # ring center (0-1 across and down the frame)
RADIUS = 0.44                   # ring radius (to the middle of the letters) as a share of the frame width
SPEED = 45                      # spin in degrees per second, clockwise
FONT_SIZE = 0.09                # letter size as a share of the frame width
COLOR = (255, 214, 0)           # letter color
OUTLINE = 0.008                 # dark outline thickness as a share of the frame width
OUTLINE_COLOR = (40, 12, 60)    # outline color
STAR_COLOR = (255, 70, 150)     # the two stars that separate the phrases
STAR_GAP = 26                   # degrees of the ring each star takes up
FONTS = ["/System/Library/Fonts/Supplemental/Arial Black.ttf",    # macOS
         "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf",  # Linux
         "C:/Windows/Fonts/ariblk.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 place(ring, pic, angle):
    """Paste pic on the ring at `angle` degrees clockwise from the top, turned so its top faces outward."""
    pic = pic.rotate(-angle, resample=Image.BICUBIC, expand=True)
    a = math.radians(angle)
    c = ring.width / 2
    ring.alpha_composite(pic, (round(c + r * math.sin(a) - pic.width / 2), round(c - r * math.cos(a) - pic.height / 2)))


def letter(ch, font, stroke):
    pad = stroke + font.size // 4
    img = Image.new("RGBA", (round(font.getlength(ch)) + 2 * pad, font.size + 2 * pad))
    ImageDraw.Draw(img).text((img.width / 2, img.height / 2), ch, font=font, anchor="mm",
                             fill=COLOR, stroke_width=stroke, stroke_fill=OUTLINE_COLOR)
    return img


def star(size, stroke):
    img = Image.new("RGBA", (size, size))
    points = [(size / 2 + (size / 2 - stroke) * (1 if i % 2 == 0 else 0.45) * math.sin(math.pi * i / 5),
               size / 2 - (size / 2 - stroke) * (1 if i % 2 == 0 else 0.45) * math.cos(math.pi * i / 5))
              for i in range(10)]
    ImageDraw.Draw(img).polygon(points, fill=STAR_COLOR, outline=OUTLINE_COLOR, width=stroke)
    return img


def make_ring():
    """The whole ring, drawn once letter by letter: each phrase is spread evenly over its half of the
    circle between the stars, the top one centered at the top and the bottom one at the bottom."""
    font = ImageFont.truetype(FONT_FILE, round(w * FONT_SIZE))
    stroke = round(w * OUTLINE)
    ring = Image.new("RGBA", (2 * (r + font.size), 2 * (r + font.size)))
    span = 180 - STAR_GAP
    for half, phrase in enumerate(PHRASES):
        advances = [font.getlength(ch) for ch in phrase]
        per_px = span / sum(advances)  # degrees per pixel of text, so the phrase fills its half exactly
        angle = half * 180 - span / 2
        for ch, adv in zip(phrase, advances):
            if ch != " ":
                place(ring, letter(ch, font, stroke), angle + adv * per_px / 2)
            angle += adv * per_px
    for angle in (90, 270):
        place(ring, star(round(font.size * 1.3), stroke), angle)
    return ring


def overlay(t):
    img = Image.new("RGBA", (w, h))
    if t < START:
        return img
    spun = ring.rotate(-SPEED * (t - START), resample=Image.BICUBIC)
    alpha = min((t - START) / FADE, 1)
    if alpha < 1:
        spun.putalpha(spun.getchannel("A").point(lambda a: round(a * alpha)))
    img.alpha_composite(spun, (round(w * X - spun.width / 2), round(h * Y - spun.height / 2)))
    return img


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).tobytes())
    ff.stdin.close()
    if ff.wait():
        sys.exit("ffmpeg failed")


src, out = sys.argv[1:3]
w, h, rate, fps, duration = probe(src)
r = round(w * RADIUS)
ring = make_ring()
render(src, 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