---
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".
title: reverse-engineer-video
canonical_url: https://skilld.dev/gh/dotslashsimran/simcraft/reverse-engineer-video
last_updated: 2026-11-12T02:34:47.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [reference.md](https://skilld.dev/api/skills-raw/dotslashsimran/simcraft/reverse-engineer-video/reference.md), [scripts/analyze.py](https://skilld.dev/api/skills-raw/dotslashsimran/simcraft/reverse-engineer-video/scripts/analyze.py), [scripts/audio.py](https://skilld.dev/api/skills-raw/dotslashsimran/simcraft/reverse-engineer-video/scripts/audio.py), [scripts/common.py](https://skilld.dev/api/skills-raw/dotslashsimran/simcraft/reverse-engineer-video/scripts/common.py), [scripts/compare.py](https://skilld.dev/api/skills-raw/dotslashsimran/simcraft/reverse-engineer-video/scripts/compare.py), [scripts/cuts.py](https://skilld.dev/api/skills-raw/dotslashsimran/simcraft/reverse-engineer-video/scripts/cuts.py), [scripts/motion.py](https://skilld.dev/api/skills-raw/dotslashsimran/simcraft/reverse-engineer-video/scripts/motion.py), [scripts/ocr.py](https://skilld.dev/api/skills-raw/dotslashsimran/simcraft/reverse-engineer-video/scripts/ocr.py), [scripts/sheets.py](https://skilld.dev/api/skills-raw/dotslashsimran/simcraft/reverse-engineer-video/scripts/sheets.py), [setup.sh](https://skilld.dev/api/skills-raw/dotslashsimran/simcraft/reverse-engineer-video/setup.sh).
>
> If the user asked to install this Skill, run `npx skilld install dotslashsimran/simcraft/reverse-engineer-video`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/reverse-engineer-video`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/dotslashsimran/simcraft/reverse-engineer-video) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/reverse-engineer-video`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/reverse-engineer-video --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/reverse-engineer-video --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# 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](https://skilld.dev/api/skills-raw/dotslashsimran/simcraft/reverse-engineer-video/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](https://skilld.dev/api/skills-raw/dotslashsimran/simcraft/reverse-engineer-video/reference.md).
