Vectojs video exporter
Agent skills for building, optimizing, embedding, and exporting VectoJS projects with Codex, Claude Code, Cursor, and GitHub Copilot.
npx -y skills add vectojs/vectojs-skills --skill vectojs-video-exporterAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use when exporting VectoJS scenes to H.264 MP4 with @vectojs/video-exporter, CLI/API capture, fixed-step scene contracts, Chromium, FFmpeg, cancellation, cleanup, or deterministic animation rendering.
SKILL.md
2.8 KB, as published. Nobody here has run it
VectoJS Video Exporter
Use this skill to export VectoJS canvas scenes to deterministic MP4 files through Chromium and FFmpeg.
Export workflow
- Confirm
ffmpegwithlibx264is onPATH. - Confirm Chromium resolution:
PUPPETEER_EXECUTABLE_PATH, system Chromium, or Puppeteer’s browser. - Ensure the rendered page exposes
window.vectoScenewith callablestop()andstep(dt). - Keep animations deterministic: use
Scene.step(dt), seeded randomness, and no wall-clock/network dependence. - Choose local module or hosted URL input.
- Use cancellation with
AbortControllerfor API calls or signals for CLI jobs. - Verify the output frame count and existing-file preservation on failure when release quality matters.
Read references/export-recipes.md for CLI/API snippets.
Current 0.2 contract
- CLI binary:
vecto-export. - API:
exportVideo(options). - First page
<canvas>is resized and captured. - Output is H.264 MP4 with
yuv420p. - Frame count is
Math.ceil(fps * duration). - Failed or aborted exports preserve an existing destination and remove incomplete staged files.
- SIGINT/SIGTERM clean up Chromium, Vite, FFmpeg, progress output, and staged files.
- Capture runs at
deviceScaleFactor: 1— output resolution equalswidth×heightexactly, independent of the host machine's DPR. - The exporter calls
scene.stop()itself, then drivesstep(dt)per frame; the page only needs to expose the scene, not manage the loop.step()uses the Scene's main renderer, so particle simulations advance deterministically.
Sandbox policy
Keep Chromium sandboxing enabled for normal users. It is disabled only when running as root or when VECTO_CHROMIUM_NO_SANDBOX=1 is explicitly set. Prefer a non-root export process.
Common mistakes
| Mistake | Correction |
|---|---|
Forgetting window.vectoScene | Expose the Scene after adding entities and before starting export. |
| Using wall-clock animation | Drive state from step(dt) time or seeded simulation state. |
| Publishing helper HTML into source dirs | Use local module input; exporter serves it through in-memory Vite HTML. |
| Killing the process without cleanup | Use AbortController or process signals and wait for cleanup. |
| Assuming browser export works on CI | Install FFmpeg and Chromium; set PUPPETEER_EXECUTABLE_PATH when needed. |