כלים

Lightweight Swap

מחליף קבצי וידאו כבדים בגרסאות קלות בזמן האנימציה, ומחזיר אותם בסוף.

אב-⁠טיפוס עובד בחלקו, עם פערים ידועים. אפשר להוריד אותו, ולמטה יש הדגמה בדפדפן.

הבעיה

קבצי מאסטר והקלטות מסך כבדים מאטים פרויקט מושן. להחליף אותם ביד זה סיכון לקישורים שבורים ולתזמון שזז.

מה בניתי

כלי שורת פקודה מכין גרסאות קלות באותו גודל, באותו קצב פריימים ובאותו אורך, וסקריפט ל-⁠After Effects מחליף אותן הלוך וחזור.

  • אותו גודל, קצב פריימים ואורך
  • קבצי המקור לא משתנים
  • רשימה שמחזירה הכל למקום

הורדה ל-⁠After Effectsלנסות את הדמו בדפדפן

יכולות ומגבלות

נבנה ונבדק

  • 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.

מגבלות

  • 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.

מתוכנן

Undo manifest, batch report, reconnect original footage and media checks.

איך משתמשים
  • 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.
איך זה עובד
  • 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.
הורדה
גרסאות שנבדקו ומגבלות
  • עבר Package: placeholders match size, frame rate, frame count and audio; 20x+ smaller; originals unchanged (SHA-256) Linux, Python 3.13, ffmpeg 7
  • עבר Package: odd frame size and 23.976 fps Linux, Python 3.13, ffmpeg 7
  • עבר Package: dry run writes nothing; never overwrites; output inside a source refused Linux, Python 3.13, ffmpeg 7
  • עבר Package: verify passes, then catches a mismatched placeholder Linux, Python 3.13, ffmpeg 7
  • עבר Package: clear error without ffmpeg Linux, Python 3.13
  • עבר Release 1.1.0: package tests (including the host script checks) re-run from the unzipped archive, public scan clean Linux
  • עבר Unit: in-place swap keeps items, links, timing, keyframes, effects; reconnect is exact Node 22, Linux
  • עבר Host script: compiles; Replace Footage only; no removal (static) Node 22, Linux
  • עבר Browser: swap and reconnect in the demo, real run shown, download offered Chromium (Playwright), 1280px
  • עבר Host: swap and reconnect inside After Effects After Effects 26.5.0, macOS 27.0.1
  • עבר 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
  • עוד לא נבדק Package on Windows Not run

נבדק לאחרונה: 2026-10-31.

יוצר הקבצים החלופיים וסקריפט ההחלפה שנבדק זמינים להורדה (1.1.0) (נבדקו ב-⁠Linux, וב-⁠macOS, שם הם יצרו את הקבצים החלופיים לבדיקה ב-⁠After Effects). סקריפט ההחלפה רץ ב-⁠After Effects 26.5.0 על macOS 27.0.1: בהרצה הראשונה התגלה ש-⁠Replace Footage משנה את שם הפריט לשם הקובץ החלופי, ולכן הסקריפט שומר עכשיו את השם; בהרצה השנייה שם הפריט, השכבות, התזמון, הקיפריימים והאפקטים נשארו זהים לאורך ההחלפה והחיבור מחדש. תיעוד: labs/host-tests/results/2026-10-31-mac.

פרטים
קלט
AE project with selected video footage
פלט
Compact placeholder footage and replacement report
רץ ב
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).
מקור
מקורי, נבנה מחדש מאפס
  • After Effects
  • סקריפט
  • אוטומציה
  • ניסיוני
  • להורדה
  • אב-⁠טיפוס
  • אינטראקטיבי