New: Earn 20% as an AgentAlley affiliate. Share your link and earn on every sale you refer. Join now New: Earn 20% as an affiliate. Join now

Reverse Engineer a Video

Reverse engineer a video

by dotslashsimran · MIT license · ★ 546 on GitHub

Reverse engineer a video cover

Break down a reference or viral video clip so it can be remade. Finds every cut and dissolve, times each shot, measures pacing, works out the camera move in each shot (static, pan, tilt, zoom or push in, roll, handheld shake, with…

---
name: reverse-engineer-video
description: Break down a reference or viral video clip so it can be remade. Finds every cut and dissolve, times each shot, measures pacing, works out the camera move in each shot (static, pan, tilt, zoom or push in, roll, handheld shake, with speed), finds beats and loudness jumps and checks whether the cuts land on them, and reads on-screen text and speech when the tools are installed. Makes a contact sheet, a timeline strip, breakdown.md with a beat map and a remake plan, and breakdown.json. Also makes side-by-side or stacked comparison videos of a remake against the reference. Use when the user says "break down this video", "reverse engineer this clip", "how was this edited", "shot list from this video", "why does this go viral", "recreate/remake this video", "what camera moves are in this", "do the cuts hit the beat", or "compare my remake with the original".
---

# Reverse engineer a video

Scripts live in `scripts/`. They run on `python3` with numpy. For better tracking of very fast moves, run `sh setup.sh` once and use `.venv/bin/python` instead (it adds OpenCV; `sh setup.sh --whisper` also adds speech-to-text). On-screen text needs `tesseract` on the PATH. Every optional part is skipped cleanly when its tool is missing, and the report says so.

## Steps

1. **Analyse.** Write the output somewhere other than the video's own folder:
   ```
   python3 scripts/analyze.py <clip> -o <out_dir>
   ```
   It writes `breakdown.md`, `breakdown.json`, `contact_sheet.jpg`, `shots_detail.jpg` and `timeline.png`.

2. **Check the cuts before trusting anything else.** Open `timeline.png` and `contact_sheet.jpg`. If two shots in the sheet look like the same shot, a cut was false: run again with `--sensitivity 0.7`. If a sheet frame shows two shots blended or a shot changes inside one tile, a cut was missed: use `--sensitivity 1.4`. Fast flashes shorter than `--min-shot` (0.1 s) are listed as flash frames, not shots.

Overview

Scripts live in scripts/. They run on python3 with numpy. For better tracking of very fast moves, run sh setup.sh once and use .venv/bin/python instead (it adds OpenCV; sh setup.sh --whisper also adds speech-to-text). On-screen text needs tesseract on the PATH. Every optional part is skipped cleanly when its tool is missing, and the report says so.

Manual install (npx, ZIP)
Claude Codenpx skills add dotslashsimran/simcraft --skill reverse-engineer-video -g -a claude-code
Claude Code (degit)npx degit dotslashsimran/simcraft/skills/video/reverse-engineer-video#main ~/.claude/skills/reverse-engineer-video
Claude.ai / desktopZip the folder and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md5.8 KB
Read SKILL.md here
dotslashsimran/main1 file shown
SKILL.md
Show the full text61 lines

Reverse engineer a video

Scripts live in scripts/. They run on python3 with numpy. For better tracking of very fast moves, run sh setup.sh once and use .venv/bin/python instead (it adds OpenCV; sh setup.sh --whisper also adds speech-to-text). On-screen text needs tesseract on the PATH. Every optional part is skipped cleanly when its tool is missing, and the report says so.

Steps

  1. Analyse. Write the output somewhere other than the video's own folder:

    python3 scripts/analyze.py <clip> -o <out_dir>
    

    It writes breakdown.md, breakdown.json, contact_sheet.jpg, shots_detail.jpg and timeline.png.

  2. Check the cuts before trusting anything else. Open timeline.png and contact_sheet.jpg. If two shots in the sheet look like the same shot, a cut was false: run again with --sensitivity 0.7. If a sheet frame shows two shots blended or a shot changes inside one tile, a cut was missed: use --sensitivity 1.4. Fast flashes shorter than --min-shot (0.1 s) are listed as flash frames, not shots.

  3. Look, then fill in the gaps. Read shots_detail.jpg (start, middle and end frame of each shot, with the measured numbers). Then edit breakdown.md:

    • fill the "what happens" column of the beat map, one short line per shot,
    • write the hook read (see below),
    • write the remake plan. Use the measured times and camera numbers; do not round them into guesses.
  4. Remake, then compare at the same timestamps. You cannot watch video, so compare stills first:

    python3 scripts/compare.py <ref> <remake> --stills compare.jpg --breakdown <out_dir>/breakdown.json
    

    Fix the biggest difference, repeat. When it is close, make a video for the user:

    python3 scripts/compare.py <ref> <remake> -o compare.mp4 --mode side     # or stack for vertical posts
    python3 scripts/compare.py <ref> <remake> -o overlay.mp4 --mode blend    # lines up horizons and edges
    

    Use --ref-start / --remake-start if one clip has a lead-in. A shorter remake holds its last frame, or repeats with --loop-remake. Output is always re-encoded.

Reading the hook (first 2 seconds)

The "Hook" section lists measured facts: when the first cut comes, how many cuts fall in the first 2 s, whether sound starts at frame one, the first words and text, and how busy the opening is compared to the rest (motion first 2s vs rest, above 1 means busier). Use them to answer three questions in plain words:

  • What is the promise in frame one? A strong first frame shows the payoff or a clear question (a finished result, something odd, a face mid-sentence). An establishing wide shot or a logo is a weak start.
  • What changes before 0.5 s? A cut, a move starting, a sound hit or text appearing. If nothing changes, say so: viewers decide in this window.
  • Why stay to 2 s? Usually an open loop: text or speech that asks a question, or a move that has not finished.

Camera numbers, and rebuilding a shot in 3D

Each shot gets a label (static, pan, truck/arc, tilt, zoom in/out, push in/pull out, roll, handheld). Long shots with several moves are split into phases, such as push in > tilt up. Each label comes with numbers: pan speed in % of frame width per second, tilt in % of frame height per second, total zoom factor, shake in % of frame width, and parallax. Directions describe the camera, not the picture. "Zoom" means the picture scaled with no parallax (a lens zoom, a digital scale, or a very far scene). "Push in" means there was parallax, so the camera really moved. breakdown.json has a camera path per shot (pan, tilt and zoom over time) to use as keyframes.

To rebuild a scene in three.js or a 3D tool, measure the geometry on a sharp frame from shots_detail.jpg:

  • Horizon height (where the vanishing points sit) tells you camera pitch: a horizon on the frame's centre line means a level camera; above centre means it tilts down.
  • Lens: take two vanishing points of lines that are at right angles in the real world. The focal length in pixels is sqrt(-(v1 - c)·(v2 - c)), where c is the frame centre. Vertical field of view is 2·atan(H / 2f).
  • Camera height: if the horizon crosses a person standing on the same floor at their eye line, the camera is at eye height (about 1.6 m). Where it crosses them gives the ratio. The full method, with worked numbers, is in reference.md.

Rules

  • Never write into the reference video's folder, and never change the reference file.
  • Trust measured times over what you think you see. Quote cut times from breakdown.json.
  • Say clearly which parts were skipped (no transcript, no text reading) instead of guessing them.
  • In the beat map, "on beat" means within the tolerance shown (default 1.5 frames, at least 50 ms). Always quote the chance rate next to the hit rate: 60% of cuts on onsets means little if random cuts would score 50%.

How each measurement works, the limits, the test results and all options: reference.md.

1---
2name: reverse-engineer-video
3description: Break down a reference or viral video clip so it can be remade. Finds every cut and dissolve, times each shot, measures pacing, works out the camera move in each shot (static, pan, tilt, zoom or push in, roll, handheld shake, with speed), finds beats and loudness jumps and checks whether the cuts land on them, and reads on-screen text and speech when the tools are installed. Makes a contact sheet, a timeline strip, breakdown.md with a beat map and a remake plan, and breakdown.json. Also makes side-by-side or stacked comparison videos of a remake against the reference. Use when the user says "break down this video", "reverse engineer this clip", "how was this edited", "shot list from this video", "why does this go viral", "recreate/remake this video", "what camera moves are in this", "do the cuts hit the beat", or "compare my remake with the original".
4---
5 
6# Reverse engineer a video
7 
8Scripts live in `scripts/`. They run on `python3` with numpy. For better tracking of very fast moves, run `sh setup.sh` once and use `.venv/bin/python` instead (it adds OpenCV; `sh setup.sh --whisper` also adds speech-to-text). On-screen text needs `tesseract` on the PATH. Every optional part is skipped cleanly when its tool is missing, and the report says so.
9 
10## Steps
11 
121. **Analyse.** Write the output somewhere other than the video's own folder:
13 ```
14 python3 scripts/analyze.py <clip> -o <out_dir>
15 ```
16 It writes `breakdown.md`, `breakdown.json`, `contact_sheet.jpg`, `shots_detail.jpg` and `timeline.png`.
17 
182. **Check the cuts before trusting anything else.** Open `timeline.png` and `contact_sheet.jpg`. If two shots in the sheet look like the same shot, a cut was false: run again with `--sensitivity 0.7`. If a sheet frame shows two shots blended or a shot changes inside one tile, a cut was missed: use `--sensitivity 1.4`. Fast flashes shorter than `--min-shot` (0.1 s) are listed as flash frames, not shots.
19 
203. **Look, then fill in the gaps.** Read `shots_detail.jpg` (start, middle and end frame of each shot, with the measured numbers). Then edit `breakdown.md`:
21 - fill the "what happens" column of the beat map, one short line per shot,
22 - write the hook read (see below),
23 - write the remake plan. Use the measured times and camera numbers; do not round them into guesses.
24 
254. **Remake, then compare at the same timestamps.** You cannot watch video, so compare stills first:
26 ```
27 python3 scripts/compare.py <ref> <remake> --stills compare.jpg --breakdown <out_dir>/breakdown.json
28 ```
29 Fix the biggest difference, repeat. When it is close, make a video for the user:
30 ```
31 python3 scripts/compare.py <ref> <remake> -o compare.mp4 --mode side # or stack for vertical posts
32 python3 scripts/compare.py <ref> <remake> -o overlay.mp4 --mode blend # lines up horizons and edges
33 ```
34 Use `--ref-start` / `--remake-start` if one clip has a lead-in. A shorter remake holds its last frame, or repeats with `--loop-remake`. Output is always re-encoded.
35 
36## Reading the hook (first 2 seconds)
37 
38The "Hook" section lists measured facts: when the first cut comes, how many cuts fall in the first 2 s, whether sound starts at frame one, the first words and text, and how busy the opening is compared to the rest (`motion first 2s vs rest`, above 1 means busier). Use them to answer three questions in plain words:
39- **What is the promise in frame one?** A strong first frame shows the payoff or a clear question (a finished result, something odd, a face mid-sentence). An establishing wide shot or a logo is a weak start.
40- **What changes before 0.5 s?** A cut, a move starting, a sound hit or text appearing. If nothing changes, say so: viewers decide in this window.
41- **Why stay to 2 s?** Usually an open loop: text or speech that asks a question, or a move that has not finished.
42 
43## Camera numbers, and rebuilding a shot in 3D
44 
45Each shot gets a label (static, pan, truck/arc, tilt, zoom in/out, push in/pull out, roll, handheld). Long shots with several moves are split into phases, such as `push in > tilt up`. Each label comes with numbers: pan speed in % of frame width per second, tilt in % of frame height per second, total zoom factor, shake in % of frame width, and parallax. Directions describe the camera, not the picture. "Zoom" means the picture scaled with no parallax (a lens zoom, a digital scale, or a very far scene). "Push in" means there was parallax, so the camera really moved. `breakdown.json` has a camera path per shot (pan, tilt and zoom over time) to use as keyframes.
46 
47To rebuild a scene in three.js or a 3D tool, measure the geometry on a sharp frame from `shots_detail.jpg`:
48- **Horizon height** (where the vanishing points sit) tells you camera pitch: a horizon on the frame's centre line means a level camera; above centre means it tilts down.
49- **Lens**: take two vanishing points of lines that are at right angles in the real world. The focal length in pixels is `sqrt(-(v1 - c)·(v2 - c))`, where c is the frame centre. Vertical field of view is `2·atan(H / 2f)`.
50- **Camera height**: if the horizon crosses a person standing on the same floor at their eye line, the camera is at eye height (about 1.6 m). Where it crosses them gives the ratio.
51The full method, with worked numbers, is in [reference.md](reference.md).
52 
53## Rules
54 
55- Never write into the reference video's folder, and never change the reference file.
56- Trust measured times over what you think you see. Quote cut times from `breakdown.json`.
57- Say clearly which parts were skipped (no transcript, no text reading) instead of guessing them.
58- In the beat map, "on beat" means within the tolerance shown (default 1.5 frames, at least 50 ms). Always quote the chance rate next to the hit rate: 60% of cuts on onsets means little if random cuts would score 50%.
59 
60How each measurement works, the limits, the test results and all options: [reference.md](reference.md).
61 
View all files on GitHub →

Details

License
MIT
Stars on the repo
★ 546
Checked
Source
dotslashsimran/simcraft ↗
Creator
dotslashsimran · 9 listings
View creator

Similar skills

See all →

More from dotslashsimran

Clean Audiodotslashsimran/simcraft · by dotslashsimranClean up voice audio in a video: rumble, electrical hum, background noise and hiss, muddy or harsh tone, sharp S sounds, uneven volume, and loudness for YouTube/Instagram/TikTok. Measures the audio first, picks the strongest cleanup that doesn't make the words less clear, and keeps lip sync exact. Use when the user says "clean up the audio", "fix the sound", "remove background noise", "remove hum", "my audio is too quiet/loud", "make it sound better", or after a rough cut.★ 546 GitHub starsFrom Scratchdotslashsimran/simcraft · by dotslashsimranLearn how something really works by building the smallest working version of it from scratch, Karpathy style, one small step at a time, with the user predicting what each step will do before running it. Works for ML and AI ideas (attention, tokenizers, backprop, RAG, agents), systems (a database, an HTTP server, git, a shell) and anything else that can be coded. Use when the user says "teach me how X works", "build X from scratch", "I want to really understand X", "explain X from first principles", or "implement X without the library".★ 546 GitHub starsImage Gendotslashsimran/simcraft · by dotslashsimranGenerate images with the user's own API keys (Google Gemini "Nano Banana" or OpenAI gpt-image). Use when asked to generate, create or make an image, illustration, icon, cut-out, sticker, thumbnail, texture, mockup or visual asset, to edit an image, or to make several images that stay consistent (same character or object). Also used by the vox-explainer skill for collage cut-outs.★ 546 GitHub starsPerspective Illusiondotslashsimran/simcraft · by dotslashsimranMake a looping illustrated 3D video in the Japanese perspective-illusion style (e.g. @garments__) of any place, such as a street, crossing, station, shop aisle, room, park or rooftop. A clean line-art scene squashed flat by a telephoto lens opens into deep perspective with dolly zooms, swings round to corner views that first read flat and then turn 3D, and objects quietly swap depth while the view is flat. Use when asked for a perspective or optical-illusion video, a "dolly zoom" or "flat to 3D" loop, an isometric-looking illustrated scene that turns out to be 3D, or to recreate one of these clips.★ 546 GitHub starsRepo Timelapsedotslashsimran/simcraft · by dotslashsimranTurn a git repo's history into a video of the project growing. Files appear as a living treemap coloured by language that grows with the code, glows when touched and fades on delete, with a date, a lines-of-code counter, commit messages typing in as captions and an activity sparkline. 16:9 or 9:16, dark or light. Use when the user says "timelapse of my repo", "visualise git history", "build in public video", "show how the project grew", "animate my commits", or wants a video of a codebase evolving.★ 546 GitHub starsRough Cut: Trim the Fatdotslashsimran/simcraft · by dotslashsimranTrim the fat from raw talking footage. Turns raw video into a tight first cut by removing dead air, ums and uhs, stutters, false starts and bad takes (keeping the last good take), then checks the result by listening to it again. Use when the user says "rough cut", "first cut", "trim the fat", "cut the pauses", "remove the ums", "cut my retakes", "make it snappy", or hands over raw footage to edit.★ 546 GitHub stars