Lightweight Swap
Swap heavy footage for light stand-ins while you animate, then swap back.
Prototype Works in parts, with known gaps. Available to download, with a browser demo below.
The problem
Heavy master files and screen captures make a motion project crawl. Swapping them by hand risks broken links and shifted timing.
What I built
A command line tool makes light stand-ins with exactly the same size, frame rate and length, and an After Effects script swaps them in and back.
- Same size, frame rate and length
- Originals are never touched
- A list to swap everything back
Download for After EffectsTry the browser demo
Features and limits
Built and tested
- Makes a placeholder for every video over a size threshold: same width, height, frame rate, frame count and duration, and a silent audio track if the original has audio.
- Works for odd frame sizes and fractional frame rates such as 23.976 and 29.97.
- Originals are never modified, moved or deleted, and nothing is overwritten. Dry run by default.
- Writes swap_manifest.json with every original and its placeholder; verify checks each placeholder still matches.
- Skips render caches and proxy folders; refuses an output folder inside a source.
- The browser demo shows the in-place swap: the project item keeps its id and name, so layers, timing, keyframes and effects stay put, and reconnecting restores the project exactly.
Limits
- Works in parts. The command line tool and the After Effects swap script are in the download. The script passed in After Effects 26.5.0 on macOS 27.0.1; Windows is not tested yet, so the whole item stays a prototype.
- Placeholders with an alpha channel come out opaque.
- Tested on Linux and macOS; Windows is not yet tested.
- Image sequences are not handled.
Planned
Undo manifest, batch report, reconnect original footage and media checks.
How to use
- Download and unzip. Run a dry run: python3 lightweight_swap.py make "Project folder" --out "Placeholders".
- Add --apply to write the placeholders and the manifest. Use --min-mb to change the threshold (default 100).
- In After Effects, select a heavy item, File, Replace Footage, File, and pick its placeholder. Every layer stays connected.
- Before rendering, replace each item with the original path from the manifest. Run verify any time to check the placeholders.
How it works
- ffprobe reads exact stream facts: frame rate as a fraction, counted frames, audio sample rate and channels.
- ffmpeg draws a dark grid frame at that geometry and timing and encodes it small (H.264, 4:4:4 for odd sizes).
- The color source rounds odd sizes down, so the tool draws one pixel larger and crops to the exact size; a test caught this.
- In After Effects, Replace Footage changes the item's file, not the layers, which is why links and keyframes survive. It also renames the item after the new file; the first test in After Effects caught this, and the script now puts the name back.
Tested versions & limits
- Pass Package: placeholders match size, frame rate, frame count and audio; 20x+ smaller; originals unchanged (SHA-256) Linux, Python 3.13, ffmpeg 7
- Pass Package: odd frame size and 23.976 fps Linux, Python 3.13, ffmpeg 7
- Pass Package: dry run writes nothing; never overwrites; output inside a source refused Linux, Python 3.13, ffmpeg 7
- Pass Package: verify passes, then catches a mismatched placeholder Linux, Python 3.13, ffmpeg 7
- Pass Package: clear error without ffmpeg Linux, Python 3.13
- Pass Release 1.1.0: package tests (including the host script checks) re-run from the unzipped archive, public scan clean Linux
- Pass Unit: in-place swap keeps items, links, timing, keyframes, effects; reconnect is exact Node 22, Linux
- Pass Host script: compiles; Replace Footage only; no removal (static) Node 22, Linux
- Pass Browser: swap and reconnect in the demo, real run shown, download offered Chromium (Playwright), 1280px
- Pass Host: swap and reconnect inside After Effects After Effects 26.5.0, macOS 27.0.1
- Pass Package on macOS: makes placeholders that After Effects accepts in place of the originals macOS 27.0.1, Python 3.9.6, ffmpeg 9.0.2
- Not tested yet Package on Windows Not run
Last verified 2026-10-31.
The placeholder maker and the tested swap script are downloadable (1.1.0) (tested on Linux, and on macOS where it made the placeholders used in the After Effects test). The swap script ran in After Effects 26.5.0 on macOS 27.0.1: run 1 found that Replace Footage renamed the item after the placeholder file, so the script now keeps the name; run 2 kept the item name, layers, timing, keyframes and effects identical through swap and reconnect. Evidence: labs/host-tests/results/2026-10-31-mac.
Details
- Input
- AE project with selected video footage
- Output
- Compact placeholder footage and replacement report
- Runs in
- Command line tool for macOS, Linux or Windows with Python 3.9+ and ffmpeg (tested on Linux and macOS), and an After Effects script in the same download that swaps from the manifest (tested in After Effects 26.5.0 on macOS 27.0.1).
- Source
- Original, rebuilt from scratch