How to add a comment reply overlay with Claude

A white card reading "Reply to @maya.glows's comment: How long did it take to see results?" pops up above the bottle, its tail pointing down, while the voiceover answers it.

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 comment reply overlay to input.mp4
    Username: maya.glows
    Comment: How long did it take to see results?

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 comment reply overlay 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
USERNAMEmaya.glowsWho left the comment.
COMMENTHow long did it take to see results?The comment the video answers.
START0.3Second the card pops in.
WIDTH0.80Card width as a share of the frame width.
TOP0.10Card top edge as a share of the frame height.
AVATAR(40, 160, 150)Avatar circle 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 comment reply card to input.mp4 (540x960). Draw a white (255, 255, 255) rounded rectangle 80% of the frame width across (432 px), centered horizontally with its top edge 10% down the frame, corner radius 5% of the card width, with a soft dark drop shadow and a small triangular tail at the bottom left pointing down. Inside, 5% padding: on the left a teal (40, 160, 150) circle 12% of the card width across with a white bold "M"; to its right a gray (120, 120, 128) line "Reply to @maya.glows's comment" in bold at 4% of the card width, and below it the comment "How long did it take to see results?" in near-black (20, 20, 24) bold at 6% of the card width, wrapped to fit. Nothing shows before 0.3 seconds; the card pops in from its center at 0.3 seconds over 0.35 seconds with a slight overshoot, then stays to the end. Leave the rest of the video untouched. Use Python with Pillow to draw the card 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 comment-reply-overlay.py and run:

python3 comment-reply-overlay.py input.mp4 output.mp4
Show the script
#!/usr/bin/env python3
"""Comment reply overlay: a viewer's comment pops up as a white reply card above the video that answers it.

Usage: python3 comment-reply-overlay.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

USERNAME = "maya.glows"                         # who left the comment
COMMENT = "How long did it take to see results?"  # the comment being answered
START = 0.3              # second the card pops in
POP = 0.35               # seconds the pop takes
WIDTH = 0.80             # card width as a share of the frame width
TOP = 0.10               # card top edge, as a share of the frame height (centered across)
AVATAR = (40, 160, 150)  # avatar circle 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 wrap(draw, text, font, width):
    lines = [""]
    for word in text.split():
        trial = f"{lines[-1]} {word}".strip()
        if draw.textlength(trial, font=font) <= width or not lines[-1]:
            lines[-1] = trial
        else:
            lines.append(word)
    return lines


def card():
    """The reply card: avatar, "Reply to @user's comment", the comment, and a tail at the bottom left."""
    cw = round(w * WIDTH)
    pad, av = round(cw * 0.05), round(cw * 0.12)
    small = ImageFont.truetype(FONT_FILE, round(cw * 0.04))
    big = ImageFont.truetype(FONT_FILE, round(cw * 0.06))
    text_x = pad + av + pad * 0.7
    lines = wrap(ImageDraw.Draw(Image.new("RGB", (1, 1))), COMMENT, big, cw - text_x - pad)
    line_h = round(big.size * 1.25)
    ch = pad + round(small.size * 1.6) + line_h * len(lines) + pad
    tail, shadow = round(cw * 0.06), round(cw * 0.04)

    img = Image.new("RGBA", (cw + 2 * shadow, ch + tail + 2 * shadow))
    shape = Image.new("L", img.size)
    s = ImageDraw.Draw(shape)
    s.rounded_rectangle([shadow, shadow, shadow + cw, shadow + ch], radius=round(cw * 0.05), fill=255)
    s.polygon([(shadow + pad * 2, shadow + ch - 1), (shadow + pad * 2 + tail * 1.4, shadow + ch - 1),
               (shadow + pad * 2, shadow + ch + tail)], fill=255)
    img.paste((0, 0, 0, 90), (0, round(shadow * 0.4)), shape.filter(ImageFilter.GaussianBlur(shadow / 2)))
    img.paste((255, 255, 255, 255), (0, 0), shape)

    draw = ImageDraw.Draw(img)
    x0, y0 = shadow + pad, shadow + pad
    draw.ellipse([x0, y0, x0 + av, y0 + av], fill=AVATAR)
    draw.text((x0 + av / 2, y0 + av / 2), USERNAME[0].upper(), font=big, anchor="mm", fill="white")
    draw.text((shadow + text_x, y0), f"Reply to @{USERNAME}'s comment", font=small, fill=(120, 120, 128))
    for i, line in enumerate(lines):
        draw.text((shadow + text_x, y0 + round(small.size * 1.6) + i * line_h), line, font=big, fill=(20, 20, 24))
    return img


def overlay(t):
    img = Image.new("RGBA", (w, h))
    scale = ease_out_back((t - START) / POP) if t >= START else 0
    if scale > 0.02:
        c = full.resize((max(1, round(full.width * scale)), max(1, round(full.height * scale))), Image.LANCZOS)
        # grow out of the card's center so the pop stays in place
        img.alpha_composite(c, (round(w / 2 - c.width / 2), round(h * TOP + full.height / 2 - c.height / 2)))
    return img


def ease_out_back(p):
    """0 -> 1 with a small overshoot past 1 before settling, which reads as a 'pop'."""
    p = min(max(p, 0), 1)
    return 1 + 2.70158 * (p - 1) ** 3 + 1.70158 * (p - 1) ** 2


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)
full = card()
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