---
title: "How to add a time warp scan with Claude (tested prompt and script)"
description: "A glowing cyan line slides down the frame and freezes each row as it passes, so the bottle the camera pushes in on ends up narrow at the cap and flared wide at the base. Install one skill and ask Claude Code, or run the Python script we tested yourself."
url: https://www.recharm.com/effects/time-warp-scan
---

# How to add a time warp scan with Claude

A glowing cyan line slides down the frame and freezes each row as it passes, so the bottle the camera pushes in on ends up narrow at the cap and flared wide at the base.

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 time warp scan to input.mp4
   Second the line leaves the top edge: 1.0
   Seconds the line takes to reach the bottom: 3.5
   ```

## 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 time warp scan 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                                                    |
| ------------- | ---------------- | --------------------------------------------------------------- |
| `START`       | `1.0`            | Second the line leaves the top edge.                            |
| `SCAN`        | `3.5`            | Seconds the line takes to reach the bottom.                     |
| `COLOR`       | `(60, 230, 255)` | Line color.                                                     |
| `THICK, GLOW` | `4, 14`          | Solid core of the line and how far its glow spreads, in pixels. |

## Without the skill

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

```
Add a time warp scan to input.mp4: a horizontal cyan (60, 230, 255) line runs across the full width, starting at the top edge at 1 second and moving down at a steady speed to reach the bottom edge at 4.5 seconds. Every row of pixels the line has passed freezes on the frame from the moment the line crossed it; rows below the line keep playing. Draw the line with a 4-pixel solid core and a soft glow fading out over about 14 pixels above and below it. Once the line reaches the bottom it disappears and the finished frozen picture holds to the end. Nothing changes before 1 second. Use Python with numpy to build the frames and ffmpeg to encode them (no ffmpeg drawtext), keep the size, 30fps, 6-second length and audio, and save it as output.mp4.
```

## Run it without Claude

This is the exact script we tested. Save it as `time-warp-scan.py` and run:

```
python3 time-warp-scan.py input.mp4 output.mp4
```

```
#!/usr/bin/env python3
"""Time warp scan: a glowing cyan line sweeps down the frame, and every row it passes freezes on that moment, so a moving shot ends up stretched out of shape.

Usage: python3 time-warp-scan.py input.mp4 output.mp4
Needs ffmpeg and numpy (pip install numpy).
"""
import json
import subprocess
import sys

import numpy as np

START = 1.0                # second the line leaves the top edge
SCAN = 3.5                 # seconds it takes to reach the bottom (the frame stays frozen after)
FPS = 30                   # output frame rate
COLOR = (60, 230, 255)     # line color
THICK = 4                  # solid core of the line, in pixels
GLOW = 14                  # how far the soft glow spreads either side of the line, in pixels

def probe(path):
    info = json.loads(subprocess.check_output(["ffprobe", "-v", "error", "-select_streams", "v:0", "-show_entries",
                                               "stream=width,height", "-of", "json", path]))
    return info["streams"][0]["width"], info["streams"][0]["height"]

def frames(path):
    """Decode a clip as RGB frames at FPS."""
    ff = subprocess.Popen(["ffmpeg", "-v", "error", "-i", path, "-vf", f"fps={FPS}",
                           "-f", "rawvideo", "-pix_fmt", "rgb24", "-"], stdout=subprocess.PIPE)
    while True:
        data = ff.stdout.read(w * h * 3)
        if len(data) < w * h * 3:
            return
        yield np.frombuffer(data, np.uint8).reshape(h, w, 3)

def draw_line(img, y):
    """Blend a glowing horizontal line into img at row y."""
    dy = np.abs(np.arange(h) - y)[:, None, None]
    alpha = np.where(dy <= THICK / 2, 1.0, 0.7 * np.exp(-((dy - THICK / 2) / (GLOW / 2)) ** 2))
    return (img * (1 - alpha) + np.array(COLOR, np.float32) * alpha).astype(np.uint8)

src, out = sys.argv[1:3]
w, h = probe(src)
frozen = np.zeros((h, w, 3), np.uint8)   # rows above the line keep the frame from when the line crossed them
line = 0                                 # rows above this are frozen

enc = subprocess.Popen(["ffmpeg", "-y", "-v", "error", "-f", "rawvideo", "-pix_fmt", "rgb24", "-s", f"{w}x{h}",
                        "-r", str(FPS), "-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)
for i, frame in enumerate(frames(src)):
    t = i / FPS
    frozen[line:] = frame[line:]     # rows the line crosses now freeze on this frame; rows below it stay live
    line = round(min(max((t - START) / SCAN, 0), 1) * h)
    picture = draw_line(frozen, line) if 0 < line < h else frozen
    enc.stdin.write(picture.tobytes())
enc.stdin.close()
if enc.wait():
    sys.exit("ffmpeg failed")
```

## More distortion and glitch

- [Anaglyph 3D **Anaglyph 3D**](https://www.recharm.com/effects/anaglyph-3d)
- [Black hole **Black hole**](https://www.recharm.com/effects/black-hole)
- [Bulge and pinch **Bulge and pinch**](https://www.recharm.com/effects/bulge-pinch)
- [Datamosh **Datamosh**](https://www.recharm.com/effects/datamosh)
- [Disintegration **Disintegration**](https://www.recharm.com/effects/disintegration)

## 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)
