How to add an end card with Claude

At 4 seconds a cream card slides up over the shot, with the bottle still playing in a rounded window above a "NOVA" logo, a purple "20% off your first order" line and a black "Shop now" button.

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 an end card to input.mp4
    Brand, offer, button: NOVA, 20% OFF YOUR FIRST ORDER, SHOP NOW

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 an end card 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
BRAND, OFFER, BUTTONNOVA, 20% OFF YOUR FIRST ORDER, SHOP NOWThe wordmark, offer line and button label.
START4.0Second the card starts sliding up.
SLIDE0.45Seconds the slide takes.
PRODUCT_BOX(0.15, 0.17, 0.85, 0.81)Part of the frame shown in the product window.
CARD(250, 246, 240)Card color.
ACCENT(110, 60, 190)Logo mark and offer 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 a 2 second end card to input.mp4 (540x960, 6 seconds). At 4.0 seconds a full-frame cream (250, 246, 240) card slides up from the bottom edge over 0.45 seconds, easing out (1 - (1 - p)^3), and stays to the end. On the card, centered across: a window 56% of the frame width wide, its top 8% down the frame, with corners rounded to 5% of the frame width and a soft black shadow (alpha 70, blurred by 2% of the frame width, shifted 1.5% of the width down), showing the live video's region from 15% to 85% across and 17% to 81% down, scaled to fit (302x491 pixels). 4% of the frame height below the window, the logo: a purple (110, 60, 190) circle 7.5% of the frame width across with a cream hole 40% of its width, then "NOVA" in dark (30, 26, 40) Arial Bold at 12% of the frame width, the pair centered with a 3% gap. Below that, centered at about 76% down, "20% OFF YOUR FIRST ORDER" in purple (110, 60, 190) Arial Bold at 5.5% of the frame width. Below that, a dark (30, 26, 40) pill button 60% of the frame width wide and 7.5% of the frame height tall, from 82% to 89% down, with "SHOP NOW" in cream Arial Bold at 5.5% of the frame width. Once the card is up (4.45 s), the logo, offer and button fade in one after another 0.15 seconds apart, each over 0.3 seconds while rising 2% of the frame height into place. Nothing of the card shows before 4.0 seconds. Use Python with Pillow to draw the card and text (not ffmpeg's drawtext filter) and ffmpeg to read and write the video, keep the audio, the size and 30fps, and save it as output.mp4.

Run it without Claude

This is the exact script we tested. Save it as end-card.py and run:

python3 end-card.py input.mp4 output.mp4
Show the script
#!/usr/bin/env python3
"""End card: for the last 2 seconds a cream card slides up with the product playing in a window, the logo, the offer and a Shop now button.

Usage: python3 end-card.py input.mp4 output.mp4
Needs ffmpeg, Pillow and numpy (pip install pillow numpy).
"""
import json
import subprocess
import sys
from pathlib import Path

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

BRAND = "NOVA"                        # wordmark under the product
OFFER = "20% OFF YOUR FIRST ORDER"    # offer line
BUTTON = "SHOP NOW"                   # button label
START = 4.0                           # second the card starts sliding up
SLIDE = 0.45                          # seconds the slide takes
STAGGER = 0.15                        # gap between the logo, offer and button fading in
FADE = 0.3                            # seconds each of them takes to fade in
PRODUCT_BOX = (0.15, 0.17, 0.85, 0.81) # part of the frame shown in the window (0-1 across and down)
WINDOW_W = 0.56                       # window width as a share of the frame width, centered
WINDOW_TOP = 0.08                     # window top, as a share of the frame height
CARD = (250, 246, 240)                # card color
INK = (30, 26, 40)                    # wordmark and button color
ACCENT = (110, 60, 190)               # logo mark and offer 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 ease_out(p):
    p = min(max(p, 0), 1)
    return 1 - (1 - p) ** 3


def layout():
    """Window position and size, and the card's three text layers (logo, offer, button) as (image, top) pairs."""
    x0, y0, x1, y1 = PRODUCT_BOX
    ww = round(w * WINDOW_W)
    wh = round(ww * (y1 - y0) * h / ((x1 - x0) * w))
    window = (round((w - ww) / 2), round(h * WINDOW_TOP), ww, wh)
    y = window[1] + wh + round(h * 0.04)

    logo_font = ImageFont.truetype(FONT_FILE, round(w * 0.12))
    mark = round(w * 0.075)
    text_w = logo_font.getlength(BRAND)
    logo = Image.new("RGBA", (w, round(w * 0.16)))
    draw = ImageDraw.Draw(logo)
    left = (w - mark - w * 0.03 - text_w) / 2
    cy = logo.height / 2
    draw.ellipse([left, cy - mark / 2, left + mark, cy + mark / 2], fill=ACCENT)
    draw.ellipse([left + mark * 0.3, cy - mark * 0.2, left + mark * 0.7, cy + mark * 0.2], fill=CARD)
    draw.text((left + mark + w * 0.03, cy), BRAND, font=logo_font, anchor="lm", fill=INK)
    layers = [(logo, y)]
    y += logo.height + round(h * 0.01)

    offer = Image.new("RGBA", (w, round(w * 0.09)))
    ImageDraw.Draw(offer).text((w / 2, offer.height / 2), OFFER, font=ImageFont.truetype(FONT_FILE, round(w * 0.055)),
                               anchor="mm", fill=ACCENT)
    layers.append((offer, y))
    y += offer.height + round(h * 0.035)

    button = Image.new("RGBA", (w, round(h * 0.075)))
    bw = round(w * 0.6)
    ImageDraw.Draw(button).rounded_rectangle([(w - bw) / 2, 0, (w + bw) / 2, button.height - 1],
                                             radius=button.height // 2, fill=INK)
    ImageDraw.Draw(button).text((w / 2, button.height / 2), BUTTON, font=ImageFont.truetype(FONT_FILE, round(w * 0.055)),
                                anchor="mm", fill=CARD)
    layers.append((button, y))
    return window, layers


def card_frame(video, t):
    """The cream card at time t: a rounded window of the live video, then the logo, offer and button fading in."""
    x0, y0, x1, y1 = PRODUCT_BOX
    wx, wy, ww, wh = window
    card = Image.new("RGBA", (w, h), CARD + (255,))
    card.alpha_composite(shadow, (wx - pad, wy - pad + round(w * 0.015)))
    product = video.crop((round(x0 * w), round(y0 * h), round(x1 * w), round(y1 * h))).resize((ww, wh), Image.LANCZOS)
    card.paste(product, (wx, wy), mask)
    for i, (layer, top) in enumerate(layers):
        p = ease_out((t - START - SLIDE - i * STAGGER) / FADE)
        if p > 0:
            faded = layer.copy()
            faded.putalpha(faded.getchannel("A").point(lambda a: round(a * p)))
            card.alpha_composite(faded, (0, top + round((1 - p) * h * 0.02)))
    return card


def compose(video, t):
    """The frame at time t: the video, with the card sliding up over it from START."""
    if t < START:
        return video
    rise = ease_out((t - START) / SLIDE)
    frame = video.convert("RGBA")
    frame.alpha_composite(card_frame(video, t), (0, round((1 - rise) * h)))
    return frame.convert("RGB")


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 render(src, out):
    """Read src frame by frame, draw compose() on each and save to out, keeping the audio."""
    reader = subprocess.Popen(["ffmpeg", "-v", "error", "-i", src, "-f", "rawvideo", "-pix_fmt", "rgb24", "-"],
                              stdout=subprocess.PIPE)
    writer = subprocess.Popen(["ffmpeg", "-y", "-v", "error", "-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)
    i = 0
    while raw := reader.stdout.read(w * h * 3):
        video = Image.fromarray(np.frombuffer(raw, np.uint8).reshape(h, w, 3))
        writer.stdin.write(compose(video, i / fps).tobytes())
        i += 1
    writer.stdin.close()
    if reader.wait() or writer.wait():
        sys.exit("ffmpeg failed")


src, out = sys.argv[1:3]
w, h, rate, fps = probe(src)
window, layers = layout()
radius = round(w * 0.05)
mask = Image.new("L", window[2:])
ImageDraw.Draw(mask).rounded_rectangle([0, 0, window[2] - 1, window[3] - 1], radius=radius, fill=255)
pad = round(w * 0.05)
shadow = Image.new("RGBA", (window[2] + 2 * pad, window[3] + 2 * pad))
ImageDraw.Draw(shadow).rounded_rectangle([pad, pad, pad + window[2], pad + window[3]], radius=radius, fill=(0, 0, 0, 70))
shadow = shadow.filter(ImageFilter.GaussianBlur(w * 0.02))
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