---
title: "How to add a number counter with Claude (tested prompt and script)"
description: "A big yellow number races up from 0 and slows as it lands on \"50,000+\" above \"happy customers\". Install one skill and ask Claude Code, or run the Python script we tested yourself."
url: https://www.recharm.com/effects/number-counter
---

# How to add a number counter with Claude

A big yellow number races up from 0 and slows as it lands on "50,000+" above "happy customers".

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 number counter to input.mp4
   Label: HAPPY CUSTOMERS
   ```

## 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 number counter 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                          |
| -------- | ----------------- | ------------------------------------- |
| `TARGET` | `50000`           | The number it lands on.               |
| `SUFFIX` | `+`               | Added after the number once it lands. |
| `LABEL`  | `HAPPY CUSTOMERS` | The line under the number.            |
| `START`  | `0.5`             | Second the counter appears at 0.      |
| `COUNT`  | `2.0`             | Seconds the count takes.              |
| `COLOR`  | `(255, 214, 0)`   | Number color.                         |

## Without the skill

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

```
Add a number counter to input.mp4: from 0.5 seconds, a black box at 69% opacity with rounded corners, 85% of the frame width wide and centered across, with its center about 70% down the frame. In it, a yellow (255, 214, 0) bold number 20% of the frame width tall counts up from 0 to 50,000 with comma separators over 2 seconds, easing out (value = 50000 * (1 - (1 - p)^3), p going 0 to 1), and gains a "+" ("50,000+") once it lands at 2.5 seconds; under it "HAPPY CUSTOMERS" in white, 6.5% of the frame width tall. Nothing shows before 0.5 seconds, and the counter stays until the end. 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 `number-counter.py` and run:

```
python3 number-counter.py input.mp4 output.mp4
```

```
#!/usr/bin/env python3
"""Number counter: a big yellow number counts up from 0, slowing as it lands on "50,000+" above "HAPPY CUSTOMERS".

Usage: python3 number-counter.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

TARGET = 50000             # the number it lands on
SUFFIX = "+"               # added after the number once it lands
LABEL = "HAPPY CUSTOMERS"  # the line under the number
START = 0.5                # second the counter appears and starts at 0
COUNT = 2.0                # seconds the count takes
Y = 0.70                   # where the counter's center sits (0 = top, 1 = bottom)
COLOR = (255, 214, 0)      # number 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 value(t):
    """The number shown at t: fast at first, easing out (cubic) as it reaches TARGET."""
    p = min(max((t - START) / COUNT, 0), 1)
    shown = f"{round(TARGET * (1 - (1 - p) ** 3)):,}"
    return shown + SUFFIX if p == 1 else shown

def overlay(t):
    img = Image.new("RGBA", (w, h))
    if t < START:
        return img
    draw = ImageDraw.Draw(img)
    number_y, label_y = h * Y - label.size * 0.6, h * Y + digits.size * 0.5
    x0, _, x1, _ = draw.textbbox((w / 2, number_y), f"{TARGET:,}{SUFFIX}", font=digits, anchor="mm")
    pad = w * 0.06
    draw.rounded_rectangle([x0 - pad, number_y - digits.size * 0.75, x1 + pad, label_y + label.size * 1.1],
                           radius=pad, fill=(0, 0, 0, 175))
    draw.text((w / 2, number_y), value(t), font=digits, anchor="mm", fill=COLOR)
    draw.text((w / 2, label_y), LABEL, font=label, anchor="mm", fill="white")
    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)
digits = ImageFont.truetype(FONT_FILE, round(w * 0.20))
label = ImageFont.truetype(FONT_FILE, round(w * 0.065))
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)
