How to add a fade-in text with Claude

"Glow in 7 days" in white slowly brightens out of thin air above the bottle, stays for two seconds, then dims away until only the footage is left.

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 fade-in text to input.mp4
    Text: Glow in 7 days

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 fade-in 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.

SettingDefaultWhat it does
TEXTGlow in 7 daysThe headline.
START0.8Second the fade in starts.
FADE0.8Seconds each fade takes.
HOLD2.0Seconds the text stays fully visible.
Y0.12Text center, 0-1 down the frame.
COLOR(255, 255, 255)Text color.

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 fade-in text to input.mp4: "Glow in 7 days" in bold white (255, 255, 255), 70 pixels tall (13% of the frame width), centered horizontally 12% of the way down, with a soft dark plum (40, 20, 60) shadow 3 pixels below it blurred by 5 pixels. It's invisible until 0.8 seconds, fades in linearly to full opacity by 1.6 seconds, holds until 3.6 seconds, then fades out linearly to nothing by 4.4 seconds. Use Python with Pillow to draw 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 fade-in-text.py and run:

python3 fade-in-text.py input.mp4 output.mp4
Show the script
#!/usr/bin/env python3
"""Fade-in text: a white headline fades up from nothing, holds, then fades back out.

Usage: python3 fade-in-text.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, ImageFilter, ImageFont

TEXT = "Glow in 7 days"     # the headline
START = 0.8                 # second the fade in starts
FADE = 0.8                  # seconds each fade takes
HOLD = 2.0                  # seconds the text stays fully visible
Y = 0.12                    # text center, 0-1 down the frame
SIZE = 0.13                 # text height as a share of the frame width
COLOR = (255, 255, 255)     # text color
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 headline():
    """The text with a soft dark shadow behind it, on a transparent frame."""
    img = Image.new("RGBA", (w, h))
    font = ImageFont.truetype(FONT_FILE, round(w * SIZE))
    shadow = Image.new("RGBA", (w, h))
    ImageDraw.Draw(shadow).text((w / 2, h * Y + 3), TEXT, font=font, anchor="mm", fill=(40, 20, 60, 230))
    img.alpha_composite(shadow.filter(ImageFilter.GaussianBlur(5)))
    ImageDraw.Draw(img).text((w / 2, h * Y), TEXT, font=font, anchor="mm", fill=COLOR)
    return img


def opacity(t):
    """0 before START, up to 1 over FADE, 1 for HOLD, back down to 0 over FADE."""
    return min(max((t - START) / FADE, 0), 1, max((START + 2 * FADE + HOLD - t) / FADE, 0))


def overlay(t):
    a = opacity(t)
    if a <= 0:
        return blank
    img = text.copy()
    img.putalpha(text.getchannel("A").point(lambda v: round(v * a)))
    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)
text = headline()
blank = Image.new("RGBA", (w, h))
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