NIG integration: one-call road (film.mjs), auto-discovery of ffmpeg/ffprobe/browser, setup mode

This commit is contained in:
NIG
2026-11-10 17:18:58 +03:30
parent 5d8f1c6efe
commit 331304fd5c
5 changed files with 310 additions and 5 deletions
+24
View File
@@ -15,7 +15,14 @@ One picture in, one object out: built from code, opened part by part, filmed. Th
cd "$SKILL_DIR" && npm install && npx playwright install chromium
```
Or let one call install whatever is missing (deps, a browser, ffmpeg):
```
node "$SKILL_DIR/film.mjs" --setup
```
The pages need nothing else. The video needs `ffmpeg` on PATH and the score needs Python 3 (standard library only). Set `FFMPEG`, `PYTHON` or `CHROMIUM` to point at other binaries.
`paths.mjs` resolves both tools on its own when they are off PATH (PATH, winget's Links dir, `C:\ffmpeg\bin`, `<skill>/bin`), and if the downloaded Chromium is missing it captures in the installed Edge or Chrome (same WebGL; the captures run on the discrete GPU either way).
## The 3 examples
@@ -104,6 +111,23 @@ runSim(DEFAULTS, async ({cfg, canvas, capture}) => {
- A short version may run its scene faster than the film: `{"duration": 11.3, "film": 10.0}` plays 11.3 s of scene in 10 s.
- Frame 0 is the thumbnail. It must already show the object big, front 3/4, moving.
## The road in one call
`film.mjs` runs the whole road for one entry and leaves the review artifacts behind:
```
node "$SKILL_DIR/film.mjs" piranha-film # build -> score -> capture -> mux -> beat sheet -> waveform
node "$SKILL_DIR/film.mjs" wasp-film --gif # + a palette gif for the docs
node "$SKILL_DIR/film.mjs" ./my-object --score my/score.py --size 1080x1350 --dpr 1
node "$SKILL_DIR/film.mjs" piranha-film --quick # draft: 720p, dpr 1, crf 20 (fast iteration)
```
It prints the GPU it captured on, the score's LUFS/true peak, and the path of every artifact:
`cutaway-out/<name>.mp4` (final, with the score), `<name>-sheet.png` (one tile per beat — read it before
reporting done), `<name>_wave.png` (every hit on a beat line), `<name>-score.wav`, `<name>.gif` with `--gif`.
Flags: `--size --dpr --fps --crf --from --to --cols --out-dir --name --score --no-score --no-sheet --no-wave --no-mux`.
A demo whose scene runs faster than its film (`{"film": T}` in the timeline) gets its score stretched to the film clock.
## Commands
```