How to recover a YAML from an already-rendered video

For when you have a flat, already-rendered video (a .mp4, no edit metadata) and the source assets that probably went into it, but no project file at all - not even a .kdenlive. video-as-code reconstruct recovers an approximate YAML by comparing pixel/audio content, not by parsing structure (there's no structure to parse).

If you do have a .kdenlive project file, use video-as-code import instead (see README.md) - it's exact, since it's reading real edit data rather than guessing from pixels.

1. Install the reconstruct extra

pip install -e ".[dev,reconstruct]"

Needs numpy/Pillow on top of the base install, plus ffmpeg/ ffprobe on PATH.

2. Gather the candidate source assets

Put every file that might appear in the render into one folder - photos, clips, audio tracks. Extra, unused files in there are fine (they're just candidates); the matcher figures out which ones actually appear.

3. Run it

video-as-code reconstruct rendered.mp4 assets/ -o output.yaml

This is a real, multi-minute pipeline on non-trivial footage (several full-video decodes) - it prints progress per stage as it runs (probing, scanning the asset bank, extracting signatures, matching each detected segment) so it doesn't look hung.

4. Read the output

5. Review and fix up by hand

Treat output.yaml as a rough first draft, not a finished project:

6. Verify

video-as-code render output.yaml -o check.mp4

Build and render the recovered YAML, then compare check.mp4 against the original rendered.mp4 - confirms the YAML actually reproduces what you think it does before you rely on it. From here on it's a normal YAML project - see docs/making-a-video.md.