commit 05a1677f634ba422a7a2b65b517a56363823dc8d
parent 4c5f8ad81146943c325e28bb01a2ee7fe892701e
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Thu, 12 Nov 2026 20:38:17 -0500
umtool take --preview --at/--dur: cut seconds of the take's own cut, the chrome at its state then, into the window's own file
Cause: previewTake handed {at, dur} to composeTake, which times a window over the PROJECT draft's
timeline (windowEntries(base.timeline, ...), the project's out/sourced/schedule.json, else the draft's
estimates) and renders windowManifest(...) -- only those entries, as a cut of their own -- then renamed
the result over takes/<t>/out/<slug>.preview.mp4. On rev9-a9 (its patch carries its own 67-entry
timeline; the project's schedule is stale) --at 440 --dur 170 picked k59..c47 by the draft's estimates:
the take's 240-330 s, with the deck starting from zero, over the full preview.
Fix: --preview with --at/--dur (takePreview windowPreview) composes the WHOLE take, times the window
over the take's own last measured schedule (out/preview/sourced or out/sourced schedule.json, the
newer; else the take's own lengths, said as estimates), refuses an --at past a measured end naming
the unit, and renders the whole take with build-video's new --cut-window <at> <dur>: every segment
built or reused by its key as a full build's, the deck rendered over the whole cut's schedule from
<at>, only the window laid and encoded (previewFromSegmentsArgs + the tier pass) to
out/<variant>/<slug>.window.mp4. The build lives in takes/<t>/out/window/ with its own record, and the
file is renamed to takes/<t>/out/<slug>.preview.<at>-<to>.mp4. The full preview and its record are
never touched. --preview alone, --full, and a take's stored window keep their old path.
Help text (TAKE_USAGE), build-video's usage, cli.md, knobs.md and report-video.md say so.
Test: lib/report/takePreviewWindow.test.mjs (plan, path, argv, refusal).
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
11 files changed, 280 insertions(+), 11 deletions(-)
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -109,6 +109,7 @@
- **The changelog page opens with its Cut and Amend forms, and pages its notes; the latest release can be amended.** `/changelog` rendered the whole of `editor/CHANGELOG.md` (760 KB of markdown, a 2.9 MB response) before the Cut release form at its bottom, so the form took 1 s to appear on an idle machine and 5-10 s on a busy one. The forms now come first (the Cut release button shows in about 0.35 s where it took 1 s) and the notes stream in after them a page at a time (`?page=N`: whole releases up to about 96 KB a page, `[Unreleased]` always on page 1, an index of every release under **All releases**); a link to an older release's anchor (`/changelog#2026-09-26`, or the new per-release `#v0.9.0`) goes to the page that holds it. **Amend the latest release** re-picks its bump (patch, minor or major, counted from the release before it), its date, folds the notes now under `[Unreleased]` into it, or moves it back under `[Unreleased]`; only the newest release, and a version change commits as that version's release (`Release editor 0.12.0`, the amend in the body). The same writer is `pnpm ops amend-release` and `archilyzer release amend`; `/sites` has the form for the export changelog.
- **Bad clip windows of one video can be evicted, and nothing else.** `evict-clips` only evicted by age, a channel at most, so the four windows cut from a corrupt saved video could not be removed without emptying the channel's cache. `pnpm ops evict-clips --json '{"slug": "<slug>", "id": "<video>"}'` now evicts every cached window of that one video; `"windows": ["<from>-<to>", …]` (the cache's own names) narrows it to those, and `"covering": [{"from": s, "to": s}, …]` to every window that overlaps a span, a wider window holding it included. A set-aside `.desynced` window of a targeted span goes with it, `"dryRun": true` only lists, and `"olderThanDays"` is optional here (still required for the by-age form). A video that does not exist is said in the run's summary, as is a named window that is not cached; an unknown shape is refused by name. umtool asks for it: `umtool fetch <project> --refetch <clipId>[,<clipId>…]` evicts the windows overlapping those clips' fetch spans, waits for that, then fetches as usual (`--refetch-video <slug>/<id>` for every window the project asks of a video; `--dry-run` evicts nothing), and records what went in `fetch-runs.json`. Needs a restart of the editor.
- **A saved alternate can be dropped once it has been checked.** A download over a copy already in the saved-video store keeps both and flags the other copy (`source-media.alt-<h>p-<stamp>.<ext>`, listed by `pnpm ops get saved-alternates`), but nothing could remove one alternate after the check: the only deleter took the whole video. `pnpm ops drop-saved-alternate --json '{"slug": "<slug>", "id": "<video>", "file": "<alternate>"}'` now deletes that one copy from the store and its entry from `saved-video.json`, leaving the rest of the pointer as it was (`alternates` goes when it empties); `"dryRun": true` says what it would free and changes nothing. The active copy, a name the pointer does not list and any path are refused, and so is a store being moved; an alternate already gone from disk is cleaned from the pointer. The video page's Source video card now lists a saved video's alternates, each with **Drop this alternate** (and a confirm). No undo. Needs a restart of the editor.
+- **umtool: a take's windowed preview shows the seconds you asked for, with its chrome, in its own file.** `umtool take <p> --id <t> --preview --at 440 --dur 170` timed the window over the project's draft rather than the take, so on a take with its own timeline it rendered a different stretch (92 s of early clips), its timeline and counters started from zero, and it was written over the take's full preview. `--at`/`--dur` with `--preview` are now seconds of the take's own cut, timed by its last preview's or render's schedule (or, with neither, its entries' own lengths, said as estimates); an `--at` past the end is refused. The whole take is built, reusing its segments, and only the window is laid and encoded, with the deck at its state at that second (build-video's new `--cut-window <at> <dur>`). The file is `takes/<t>/out/<slug>.preview.<at>-<to>.mp4`, built in `out/window/`; the full preview is never touched. `--preview` without `--at`, and a take's own window, render as before.
## [0.12.0] - 2026-10-28
- **An X post's screenshot is of the post, not of a page in the middle of laying itself out.** On 2026-10-27 a forced capture of TheQuartering's post 2114859155022389342 came out shifted about 100 px: its left edge cut off, X's menu laid over its words and the gap beside the column showing; another post once came out as a strip of the post above it. The shot was a full-page capture, which resizes the page for the moment of the capture — in the X session profile the page saw its window go to 1×1 — and X laid itself out again for that size while it was being captured, so the shot was cut from a different layout than the one measured. A post is now shot from the window as it stands: scrolled into it, the window made taller first when the post is taller than it, so nothing is resized under the shot; and the post is measured again after the shot and shot again if it moved. An X Article's shot is taken the same way. Posts taller than the tallest window (16,384 px) are still shot from a full-page capture. Needs a restart of the editor.
diff --git a/umtool/docs/cli.md b/umtool/docs/cli.md
@@ -75,7 +75,7 @@ Inbox cannot disagree about what is wrong with one.
| `take <project> --id <id> --label L [--patch F \| …] --draft` (`--no-render`) · `take <project> --id <id> [--full \| --at S --dur S]` · `take <project> --id <id> --rebuild [--full \| --at S --dur S]` · `take <project> --id <id> --promote [--anyway] [--json]` | a **draft** take: recorded with nothing rendered, to be walked first; a draft named with no patch flags is rendered from its stored (walked) patch, and `--rebuild` takes a window flag; **make it the cut**: the take's patch applied to the manifest now, one undo point (`revisions/…-auto-before-promote-take`), refused (exit 1) when its timeline would replace a cut that changed since, until `--anyway` ([report-video.md](report-video.md#walking-a-take-drafts-edits-into-the-take-and-making-it-the-cut)) |
| `take <project> --id <id> … --uncensored` · build-video `--uncensored` | the **uncensored cut** ([knobs.md](knobs.md#the-slur-filter-slurs-masked-in-what-is-published-off-for-the-uncensored-cut)): the same cut with the post items' slur filter off -- `render.posts.slurs.on: false` in the take's patch (a `--rebuild` keeps it; a censored take is not rebuilt uncensored, **exit 2**: make a take of its own), its label gains "(uncensored)", take.json's `slurs` records `censored` or `uncensored`. The redaction of private words and censored attachments stay on |
| `take <project> --id <id> --draft --from <take> [--label L] [--patch F \| --patch-json J \| --set p=v …]` | a **draft made from another take**: that take's style and patch (a `--patch` merged over it), its label "<that label> (from <take>)" unless `--label`, nothing rendered; its timeline is its own from then on, and its render's `--from` (segments reused) is a separate flag of the render ([take-scoped edits](#edit-a-take-not-the-project-items-from-other-projects-and-take-scoped-edits)) |
-| `take <project> --id <id> --preview [--from <take>] [--at S --dur S \| --full] [--priority] [--json]` | the take's **preview**: the take as stored (a draft too, from its walked patch) composed exactly as its render is -- the same 1920×1080 layout, segments, chrome frames and sound -- with only its final picture encoded smaller and faster (`render.preview`: 1280×720, x264 veryfast, crf 26) into `takes/<id>/out/<slug>.preview.mp4`; its build, schedule and record (`render.json`, `render.log`) in `takes/<id>/out/preview/`. The full render (`preview.mp4`, `out/<slug>.mp4`, `out/sourced/`, `take.json`, `render.json`) is never touched. Reuses this take's own full render, and `--from`'s full render and preview ([report-video.md](report-video.md#fast-feedback-preview-and-changes-renders), [knobs.md](knobs.md#fast-feedback-a-preview-and-a-reel-of-the-changes)) |
+| `take <project> --id <id> --preview [--from <take>] [--at S --dur S \| --full] [--priority] [--json]` | the take's **preview**: the take as stored (a draft too, from its walked patch) composed exactly as its render is -- the same 1920×1080 layout, segments, chrome frames and sound -- with only its final picture encoded smaller and faster (`render.preview`: 1280×720, x264 veryfast, crf 26) into `takes/<id>/out/<slug>.preview.mp4`; its build, schedule and record (`render.json`, `render.log`) in `takes/<id>/out/preview/`. The full render (`preview.mp4`, `out/<slug>.mp4`, `out/sourced/`, `take.json`, `render.json`) is never touched. `--at S --dur S`: cut seconds of the take's own cut (its schedule), the chrome at its state then, into its own `takes/<id>/out/<slug>.preview.<S>-<S+dur>.mp4` (build in `out/window/`), never over the full preview. Reuses this take's own full render, and `--from`'s full render and preview ([report-video.md](report-video.md#fast-feedback-preview-and-changes-renders), [knobs.md](knobs.md#fast-feedback-a-preview-and-a-reel-of-the-changes)) |
| `take <project> --id <id> --changes [--from <take>] [--pad 3] [--no-preview] [--priority] [--json]` | the take's **changes reel**: only what changed against `--from` (default: the take's own `from`, or the take a draft was made from) -- each added, re-read, re-picked, re-voiced, trimmed, held, fx'd, … item with a neighbour either side, rendered in one build (`takes/<id>/out/changes/`), cut to the item ± `--pad` s, a label burned in (`21:19 · p-2116831815466193102 · re-voiced`: its time in the FULL cut), joined into `takes/<id>/out/<slug>.changes.mp4`; a removed item shows as the join it leaves. `takes/<id>/changes.json` lists the pieces with their full-cut times and how exact they are (`times.basis`: `measured` -- the base's measured schedule plus the changed items' measured lengths -- or `estimate`). Preview quality unless `--no-preview`. Nothing changed: no reel, and the list says so |
| `take <project> --id <id> --import-item <project>:<item>[,<item>…] [--import-item …] [--after <entry> \| --before <entry>] [--as <id>] [--dry-run] [--json]` | **items of another project into a take** -- deprecated, saying so in one line on stderr: edits land in the draft, so open the take there and use `timeline <p> import-item` (`takeImport.mjs`): each entry CLONED from the source's manifest as it is now (its card, context, knobs, narration with its takes and its pick) into the take's timeline -- one write, an undo point of the take's (`timeline <p> --take <id> undo`); the files it names (narration takes and their `take-<n>.*` sidecars, the parts' cache files, attachments, a context post's media, the picture of each author it draws that the take lacks, added to the take's `postAvatars`) **hard-linked** into this project's dir at the same path, so the render and the lint find them (copied across filesystems; the same file already there is left; ANOTHER file at the path: linked under `imports/<source>/<path>` and the clone names that). The source project and this project's manifest are only read. **Placed** `--after`/`--before` an entry of the take (several items in the order named, one after another), else by the post's date when the take's posts are in date order, else at the end. **Again**: updated in place from the source (moved only with `--after`/`--before`), `unchanged` with no write when nothing differs. `--as`: one item under another id (a second copy). `--dry-run`: the plan and the placement, nothing linked or written. `--json`: `items[] {id, action added\|updated\|unchanged\|moved, at {index, after, before}, narration {takes, pick, file}, files[], avatars[]}`, `revision`. Refused while the take renders. **Exit 0 · 1 refused (no such item, take or entry; a link out of the project) · 2 usage** |
| `take … --priority` · `takes make … --priority` · `render-mode on [--for 90m] [--note T] [--json \| --print-token]` · `render-mode on [--for 90m] [--note T] [--print-token] -- <cmd …>` · `render-mode off [--force] [--json]` · `render-mode status [--json]` | **render mode**: a render the operator waits for gets the machine. `--priority` turns it on for the take's (or the batch's) lifetime — on at the start, off at the end, on a failure and on a signal; the Takes page's **Give renders the machine** is the same flag. While it is on, every other heavy job (e2e suites, `next build`s, the publish stages, other renders) waits at the heavy slot's door (`queue-lock: held for a render (…) — waiting`), the render runs on the floor 4000 MB and the cap 10240 MB, and the editor's transcription, download and Speakers lanes are held through its ops (`lane`; only the ones not already held, and only those are released at off). `render-mode on` is a window (default 2h) for a chain of renders: every `umtool take` started in it renders in it, another command joins with the `RENDER_PRIORITY_TOKEN` it prints (`--print-token`: the token alone on stdout, the rest on stderr). **`on … -- <cmd …>` is the form for a script**: the command is spawned with the token in its environment, the hold is the command's pid, and it is released when the command exits — done, failed, or umtool signalled (the signal is passed on); umtool exits with the command's code, and inside a manual window the command joins it. A bare `on` in a script leaves the window behind (the chain trap). `off` ends it (a running take's hold only with `--force`, else it ends with the take); `status` says what holds it and releases a stale hold's lanes. A hold whose process is gone or whose window is over is no hold. Needs WORKER_TOKEN and the editor at ARCHILYZER_EDITOR_URL for the lanes; without them it still holds the door. **Exit 1** when it is already on, or a lane could not be released ([report-video.md](report-video.md#render-mode-giving-a-render-the-machine); WORKTREES.md, "Render mode") |
diff --git a/umtool/docs/knobs.md b/umtool/docs/knobs.md
@@ -2040,6 +2040,7 @@ labelled with its time in the full cut). Neither touches the take's full render
| | From a terminal | In umtool | Route |
|---|---|---|---|
| a preview of the whole take | `umtool take <p> --id <t> --preview [--from <t0>]` → `takes/<t>/out/<slug>.preview.mp4` | the take card's **Preview render**; Play's **Fast render** | `POST /api/report/takes/fast {project, take, kind: "preview"}` (a queue step) |
+| a preview of a window of the take | `umtool take <p> --id <t> --preview --at S --dur S` → `takes/<t>/out/<slug>.preview.<S>-<S+dur>.mp4` (its own file; the full preview untouched). S and dur are **cut seconds of the take's own cut** (its last preview's or render's schedule, else its entries' lengths as estimates; past its end refused); the whole take is built, only the window laid and encoded, its chrome at its state then | — | — |
| a reel of what changed | `umtool take <p> --id <t> --changes [--from <t0>] [--pad 3] [--no-preview]` → `takes/<t>/out/<slug>.changes.mp4`, `takes/<t>/changes.json` | **Render changes** (against the take's own base) | `… kind: "changes"` |
| queued, then polled | `umtool queue add -- take <p> --id <t> --preview` · `umtool take status <p> --id <t> [--json]` (`preview`, `changes`) | the state inline, the local path with **Copy**, **Play** of the file | `GET /api/report/takes/fast?project&take` (`&file=preview\|changes`: the mp4) |
diff --git a/umtool/docs/report-video.md b/umtool/docs/report-video.md
@@ -2387,6 +2387,9 @@ matches main's).
```
takes/<t>/out/<slug>.preview.mp4 the preview
+takes/<t>/out/<slug>.preview.<S>-<S+dur>.mp4
+ a window's preview (--preview --at S --dur S): cut seconds of the take's
+ own cut, never written over the full preview; its build in out/window/
takes/<t>/out/preview/ its build's own out/: sourced/schedule.json, segments, chunks …,
render.json and render.log (its record; the take's render.json is the
full render's)
@@ -2397,6 +2400,15 @@ takes/<t>/changes.json the reel's pieces: id, kinds, label, `at`/`e
out), `render` (what changed outside the timeline)
```
+**A window's preview** (`--preview --at S --dur S`) is cut seconds S..S+dur of the TAKE's own cut -- timed
+by the take's last measured schedule (its preview's or its render's `schedule.json`), else by its entries'
+own lengths, said as estimates; an S past a measured end is refused. Not the project draft's seconds: a
+take whose patch carries its own timeline does not share the draft's (rev9-a9, 12 Nov: `--at 440 --dur 170`
+timed over the draft rendered 92 s of the cut's early clips). The whole take goes to the build with the
+window (build-video `--cut-window <at> <dur>`): every segment is built or reused by its key as a full
+build's, the deck is rendered over the whole cut's schedule from S, and only the window is laid and
+encoded -- so its timeline, counters and trail are at their state at S, not a cut that starts there.
+
**What it shares, and what it never feeds.** A clip or post segment, a chrome frame and the cut's sound
are the same bytes whichever tier they end up in, and are keyed by what makes them, so a preview links
this take's own full render's, the `--from` take's full render's and its previews' (`takeFrom.mjs`
diff --git a/umtool/lib/cli/groups.mjs b/umtool/lib/cli/groups.mjs
@@ -590,7 +590,7 @@ export const GROUPS = [
["`take <project> --id <id> --draft --from <take> [--label L] [--patch F \\| --patch-json J \\| --set p=v …]`",
"a **draft made from another take**: that take's style and patch (a `--patch` merged over it), its label \"<that label> (from <take>)\" unless `--label`, nothing rendered; its timeline is its own from then on, and its render's `--from` (segments reused) is a separate flag of the render ([take-scoped edits](#edit-a-take-not-the-project-items-from-other-projects-and-take-scoped-edits))"],
["`take <project> --id <id> --preview [--from <take>] [--at S --dur S \\| --full] [--priority] [--json]`",
- "the take's **preview**: the take as stored (a draft too, from its walked patch) composed exactly as its render is -- the same 1920×1080 layout, segments, chrome frames and sound -- with only its final picture encoded smaller and faster (`render.preview`: 1280×720, x264 veryfast, crf 26) into `takes/<id>/out/<slug>.preview.mp4`; its build, schedule and record (`render.json`, `render.log`) in `takes/<id>/out/preview/`. The full render (`preview.mp4`, `out/<slug>.mp4`, `out/sourced/`, `take.json`, `render.json`) is never touched. Reuses this take's own full render, and `--from`'s full render and preview ([report-video.md](report-video.md#fast-feedback-preview-and-changes-renders), [knobs.md](knobs.md#fast-feedback-a-preview-and-a-reel-of-the-changes))"],
+ "the take's **preview**: the take as stored (a draft too, from its walked patch) composed exactly as its render is -- the same 1920×1080 layout, segments, chrome frames and sound -- with only its final picture encoded smaller and faster (`render.preview`: 1280×720, x264 veryfast, crf 26) into `takes/<id>/out/<slug>.preview.mp4`; its build, schedule and record (`render.json`, `render.log`) in `takes/<id>/out/preview/`. The full render (`preview.mp4`, `out/<slug>.mp4`, `out/sourced/`, `take.json`, `render.json`) is never touched. `--at S --dur S`: cut seconds of the take's own cut (its schedule), the chrome at its state then, into its own `takes/<id>/out/<slug>.preview.<S>-<S+dur>.mp4` (build in `out/window/`), never over the full preview. Reuses this take's own full render, and `--from`'s full render and preview ([report-video.md](report-video.md#fast-feedback-preview-and-changes-renders), [knobs.md](knobs.md#fast-feedback-a-preview-and-a-reel-of-the-changes))"],
["`take <project> --id <id> --changes [--from <take>] [--pad 3] [--no-preview] [--priority] [--json]`",
"the take's **changes reel**: only what changed against `--from` (default: the take's own `from`, or the take a draft was made from) -- each added, re-read, re-picked, re-voiced, trimmed, held, fx'd, … item with a neighbour either side, rendered in one build (`takes/<id>/out/changes/`), cut to the item ± `--pad` s, a label burned in (`21:19 · p-2116831815466193102 · re-voiced`: its time in the FULL cut), joined into `takes/<id>/out/<slug>.changes.mp4`; a removed item shows as the join it leaves. `takes/<id>/changes.json` lists the pieces with their full-cut times and how exact they are (`times.basis`: `measured` -- the base's measured schedule plus the changed items' measured lengths -- or `estimate`). Preview quality unless `--no-preview`. Nothing changed: no reel, and the list says so"],
["`take <project> --id <id> --import-item <project>:<item>[,<item>…] [--import-item …] [--after <entry> \\| --before <entry>] [--as <id>] [--dry-run] [--json]`",
diff --git a/umtool/lib/report/takeCli.mjs b/umtool/lib/report/takeCli.mjs
@@ -48,7 +48,12 @@ export const TAKE_USAGE = [
" umtool take <project> --id <id> --preview [--from TAKE] [--at S --dur S | --full] [--priority] [--json]",
" the take as stored (a draft too) at the PREVIEW tier (render.preview: 1280x720, veryfast,",
" crf 26; the same layout, segments, chrome and sound): takes/<id>/out/<slug>.preview.mp4,",
- " its build and record in out/preview/; the take's full render untouched",
+ " its build and record in out/preview/; the take's full render untouched. --at S --dur S: CUT",
+ " SECONDS of the take's own cut (its last preview's or render's schedule; else its entries' own",
+ " lengths, said as estimates; past its end refused): the whole take built (segments reused by key),",
+ " only S..S+dur laid and encoded, its chrome (timeline, counters) at its state then, into its OWN",
+ " file takes/<id>/out/<slug>.preview.<S>-<S+dur>.mp4 (build and record in out/window/); the full",
+ " preview never touched",
" umtool take <project> --id <id> --changes [--from TAKE] [--pad 3] [--no-preview] [--priority] [--json]",
" a reel of only what changed against TAKE (default: the take's own from): each changed item",
" ± pad s, labelled with its time in the full cut: takes/<id>/out/<slug>.changes.mp4 and",
diff --git a/umtool/lib/report/takeMaker.mjs b/umtool/lib/report/takeMaker.mjs
@@ -447,7 +447,7 @@ export function normalizeWindow(w) {
*
* @typedef {{
* manifestPath: string, outDir: string, slug: string, full: boolean, xfade: boolean,
- * keepFrames?: boolean, estimateMb?: number | null,
+ * keepFrames?: boolean, estimateMb?: number | null, cutWindow?: { at: number, dur: number } | null,
* emit: (ev: Record<string, unknown>) => void, log: (line: string) => void,
* signal?: AbortSignal,
* }} RenderJob
diff --git a/umtool/lib/report/takePreview.mjs b/umtool/lib/report/takePreview.mjs
@@ -12,6 +12,16 @@
// The take's full render -- preview.mp4, out/<slug>.mp4, out/sourced/, take.json, render.json -- is
// never touched. A draft is previewed from its stored patch, as its render would be.
//
+// umtool take <p> --id <t> --preview --at S --dur S
+// CUT SECONDS [S, S + dur] of the take's own cut (its schedule: the last preview's or render's, else its
+// entries' own lengths, said as estimates) -- not the project's draft, whose timeline a take may not
+// share (rev9-a9, 12 Nov: `--at 440 --dur 170` timed over the draft rendered 92 s of early clips). The
+// whole take is handed to the build with the window (build-video --cut-window): every segment built or
+// reused by its key, only the window's seconds laid and encoded, the deck drawn over the whole cut's
+// schedule from S -- its timeline, counters and trail at their state then, never reset. Into
+// takes/<t>/out/<slug>.preview.<S>-<S+dur>.mp4 the window's own file, never over the full preview's
+// takes/<t>/out/window/ its build and record
+//
// umtool take <p> --id <t> --changes [--from <t0>] [--pad 3] [--no-preview]
// a REEL of only what changed against <t0> (default: the take's own `from`): each changed item -- added,
// re-read, re-picked, re-voiced, fx, a trim, a hold, a panel, … -- with one neighbour each side
@@ -37,7 +47,7 @@ import { mkdir, readFile, rename, rm, stat, writeFile } from "node:fs/promises";
import path from "node:path";
import { promisify } from "node:util";
import { applyMontageRulings, readMontageRulings } from "umtool-report-to-video/montage-rulings";
-import { composeTake, checkSpec, estimatedSeconds, getPath, linkSharedOut, MANIFEST, mergePatch, QUICK_RENDER, sourcedEntries, windowManifest } from "./takeMaker.mjs";
+import { composeTake, checkSpec, estimatedSeconds, getPath, linkSharedOut, MANIFEST, mergePatch, QUICK_RENDER, sourcedEntries, windowEntries, windowManifest } from "./takeMaker.mjs";
import { takesDirOf, TAKE_FILE } from "./takes.mjs";
import { tmpPathFor } from "yt-dlp-transcript-common/lib/atomicFile.mjs";
@@ -50,6 +60,8 @@ export const PREVIEW_DEFAULTS = Object.freeze({ width: 1280, height: 720, preset
/** The build dirs under takes/<t>/out/. */
export const PREVIEW_DIR = "preview";
export const CHANGES_DIR = "changes";
+/** A windowed preview's build dir (`--preview --at S --dur S`). */
+export const WINDOW_DIR = "window";
/** The changes reel's list, beside take.json. */
export const CHANGES_FILE = "changes.json";
/** Seconds of context either side of a changed item in the reel. */
@@ -122,6 +134,33 @@ export function previewPaths(takeDir, slug) {
};
}
+/** Seconds in a file name: 440, 612.5. Pure. */
+const secondsName = (v) => String(Math.round(Number(v) * 1000) / 1000);
+
+/** A windowed preview's file, beside the full preview and never over it: <slug>.preview.<at>-<to>.mp4. Pure. */
+export function windowPreviewMp4(takeDir, slug, win) {
+ return path.join(takeDir, "out", `${slug}.preview.${secondsName(win.at)}-${secondsName(win.at + win.dur)}.mp4`);
+}
+
+/**
+ * Which entries of the TAKE's own cut a window of cut seconds covers: timed by `schedule` (the take's last
+ * measured one) when it names every entry, else by the entries' own lengths (estimates). A window that starts
+ * at or past the end of a measured cut is refused, naming the unit. Pure.
+ *
+ * @param {Array<Record<string, any>>} timeline the take's render timeline (its rulings applied)
+ * @param {{ at: number, dur: number }} win
+ * @param {{ segments?: Array<{ id: string, start: number, duration: number }>, estimated?: boolean } | null} schedule
+ * @returns {{ ids: string[], basis: "schedule" | "estimate", total: number }}
+ */
+export function previewWindowPlan(timeline, win, schedule) {
+ const measured = schedule && schedule.estimated !== true ? schedule : null;
+ const w = windowEntries(timeline, win, measured);
+ if (w.basis === "schedule" && !(win.at < w.total)) {
+ throw new Error(`--at ${win.at} is past the end of the take's cut (${Math.round(w.total * 10) / 10} s of cut time, by its schedule): --at and --dur are seconds of the take's cut`);
+ }
+ return { ids: w.ids, basis: w.basis, total: w.total };
+}
+
// ---------------------------------------------------------------------------
// What changed: one take's timeline against another's.
// ---------------------------------------------------------------------------
@@ -500,7 +539,7 @@ async function linkSources(projectDir, id, from, dst, { tierDir }) {
* One build of a render manifest into `outDir` (the take's preview or changes dir): through renderTake,
* the heavy slot and all, recorded in outDir/render.json and render.log. Resolves to the build's mp4.
*/
-async function buildInto(projectDir, { id, label, kind, renderDoc, outDir, from, xfade, opts }) {
+async function buildInto(projectDir, { id, label, kind, renderDoc, outDir, from, xfade, opts, cutWindow = null }) {
const recordMod = await import("./renderRecord.mjs");
await mkdir(outDir, { recursive: true });
const rec = await recordMod
@@ -523,7 +562,7 @@ async function buildInto(projectDir, { id, label, kind, renderDoc, outDir, from,
await writeFile(renderPath, JSON.stringify(renderDoc, null, 2) + "\n", "utf8");
const render = opts.render ?? (await import("./takeRender.mjs")).renderTake;
const t0 = Date.now();
- const { file } = await render({ manifestPath: renderPath, outDir, slug: String(renderDoc.slug ?? ""), full: false, xfade: xfade === true, keepFrames: false, emit, log, ...(opts.signal ? { signal: opts.signal } : {}) });
+ const { file } = await render({ manifestPath: renderPath, outDir, slug: String(renderDoc.slug ?? ""), full: false, xfade: xfade === true, keepFrames: false, emit, log, ...(cutWindow ? { cutWindow } : {}), ...(opts.signal ? { signal: opts.signal } : {}) });
const made = await stat(file).catch(() => null);
if (!made?.isFile() || made.size === 0) throw new Error(`${id}: the ${kind} render wrote no mp4 (${file})`);
return { file, rec, log, renderSeconds: Math.round((Date.now() - t0) / 100) / 10 };
@@ -557,6 +596,8 @@ export async function probeSize(file) {
* render?: Function, projectId?: string, argv?: string[], signal?: AbortSignal }} [opts]
*/
export async function previewTake(projectDir, id, opts = {}) {
+ // --at/--dur said: seconds of the take's own cut, to the window's own file (windowPreview).
+ if (opts.window && opts.window !== "full") return windowPreview(projectDir, id, opts.window, opts);
const { take, spec } = await storedSpec(projectDir, id);
const from = opts.from ?? null;
if (from) await checkFrom(projectDir, id, from);
@@ -583,6 +624,64 @@ export async function previewTake(projectDir, id, opts = {}) {
return { id, mp4: p.previewMp4, seconds, renderSeconds: b.renderSeconds, tier: t };
}
+/** The take's last measured schedule: its preview's build, else its full render's -- the newer that names its entries. */
+async function takeScheduleOf(takeDir) {
+ const got = [];
+ for (const d of [path.join(takeDir, "out", PREVIEW_DIR, "sourced"), path.join(takeDir, "out", "sourced")]) {
+ const file = path.join(d, "schedule.json");
+ const [doc, st] = await Promise.all([readJson(file), stat(file).catch(() => null)]);
+ if (doc && st && doc.estimated !== true && Array.isArray(doc.segments)) got.push({ doc, mtime: st.mtimeMs, file });
+ }
+ got.sort((a, b) => b.mtime - a.mtime);
+ return got[0] ?? null;
+}
+
+/**
+ * `umtool take <p> --id <t> --preview --at S --dur S`: cut seconds [S, S + dur] of the take's own cut at the
+ * preview tier -- the whole take built (segments reused by their keys), only the window laid and encoded, its
+ * chrome at its state then (build-video --cut-window). To <slug>.preview.<S>-<S+dur>.mp4; the full preview,
+ * and the take's render, untouched.
+ *
+ * @param {string} projectDir
+ * @param {string} id
+ * @param {{ at: number, dur: number }} win
+ * @param {Parameters<typeof previewTake>[2]} [opts]
+ */
+async function windowPreview(projectDir, id, win, opts = {}) {
+ const { take, spec } = await storedSpec(projectDir, id);
+ const from = opts.from ?? null;
+ if (from) await checkFrom(projectDir, id, from);
+ const log = opts.log ?? (() => {});
+ const c = await composeTake(projectDir, { ...spec, window: "full" }, { log });
+ const renderDoc = atPreviewTier(spec.quick ? /** @type {Record<string, any>} */ (mergePatch(c.renderDoc, QUICK_RENDER)) : c.renderDoc);
+ const takeDir = path.join(takesDirOf(projectDir), id);
+ const slug = String(c.manifest.slug ?? "");
+ const sched = await takeScheduleOf(takeDir);
+ const plan = previewWindowPlan(renderDoc.timeline, win, sched?.doc ?? null);
+ const mp4 = windowPreviewMp4(takeDir, slug, win);
+ const span = `cut seconds ${secondsName(win.at)}–${secondsName(win.at + win.dur)}`;
+ const t = renderDoc.render.tier;
+ log(
+ `${id}: a preview of ${span} of the take's cut — ${plan.ids.length} entr${plan.ids.length === 1 ? "y" : "ies"} (${plan.ids.join(", ")}), ` +
+ (plan.basis === "schedule" ? `timed by ${path.relative(takeDir, sched?.file ?? "")}` : "timed by their own lengths (estimates: the take has no measured schedule yet)") +
+ `; ${t.width}x${t.height}, ${t.preset}, crf ${t.crf}; the whole cut's segments built or reused, its chrome at its state then; to ${path.relative(takeDir, mp4)}` +
+ `${from ? `; reusing ${from}'s` : ""}${take.draft ? " (a draft: its stored patch)" : ""}`,
+ );
+ const outDir = path.join(takeDir, "out", WINDOW_DIR);
+ const b = await buildInto(projectDir, { id, label: `${spec.label} ${span}`, kind: WINDOW_DIR, renderDoc, outDir, from, xfade: takeXfade(c), opts, cutWindow: win });
+ try {
+ await rename(b.file, mp4);
+ } catch (e) {
+ await b.rec?.fail(e);
+ throw e;
+ }
+ const seconds = await probeSeconds(mp4);
+ const doc = await b.rec?.done({ mp4, seconds });
+ if (doc && doc.state !== "done") throw new Error(doc.error ?? `${id}: the window's preview left no mp4`);
+ b.log(`${id}: preview of ${span} ${path.relative(takeDir, mp4)} — ${seconds ?? "?"} s, rendered in ${b.renderSeconds} s`);
+ return { id, mp4, seconds, renderSeconds: b.renderSeconds, tier: t, window: win, covers: plan.ids, basis: plan.basis };
+}
+
async function checkFrom(projectDir, id, from) {
if (from === id) throw new Error(`--from ${from}: that is this take — name another take`);
const dir = path.join(takesDirOf(projectDir), from);
diff --git a/umtool/lib/report/takePreviewWindow.test.mjs b/umtool/lib/report/takePreviewWindow.test.mjs
@@ -0,0 +1,99 @@
+// `umtool take <p> --id <t> --preview --at S --dur S` (12 Nov 2026, rev9-a9: `--at 440 --dur 170` rendered 92 s of
+// the cut's early clips with the chrome reset, over the full preview's file). --at/--dur are seconds of the TAKE's
+// own cut: the take's measured schedule says which entries they cover; the whole cut is handed to the render with
+// the window (build-video --cut-window), so the deck draws its state at that second; the file is the window's own.
+import { test } from "node:test";
+import assert from "node:assert/strict";
+import { mkdtempSync, rmSync } from "node:fs";
+import { mkdir, readFile, writeFile } from "node:fs/promises";
+import { tmpdir } from "node:os";
+import path from "node:path";
+import { previewTake, previewWindowPlan, windowPreviewMp4 } from "./takePreview.mjs";
+import { renderArgv } from "./takeRender.mjs";
+import { cutWindowFile, cutWindowFlag, cutWindowSpan } from "umtool-report-to-video/build-video";
+
+const clip = (id, len) => ({ type: "clip", id, video: "v", cutStart: 0, cutEnd: len });
+
+/** A project whose draft holds a–f (100 s each) and a take whose own cut opens with x (300 s), measured. */
+async function fixture() {
+ const dir = mkdtempSync(path.join(tmpdir(), "take-window-"));
+ const base = { slug: "s", title: "T", render: { width: 1920, height: 1080, fps: 30 }, timeline: ["a", "b", "c", "d", "e", "f"].map((id) => clip(id, 100)) };
+ await writeFile(path.join(dir, "video.manifest.json"), JSON.stringify(base));
+ const takeDir = path.join(dir, "takes", "t1");
+ const timeline = [clip("x", 300), ...base.timeline];
+ await mkdir(path.join(takeDir, "out", "preview", "sourced"), { recursive: true });
+ await writeFile(path.join(takeDir, "take.json"), JSON.stringify({ id: "t1", label: "T1", draft: true, window: "full", patch: { timeline } }));
+ await writeFile(path.join(takeDir, "out", "s.preview.mp4"), "FULL");
+ let t = 0;
+ const segments = timeline.map((e) => {
+ const s = { id: e.id, start: t, duration: e.cutEnd };
+ t += e.cutEnd;
+ return s;
+ });
+ await writeFile(path.join(takeDir, "out", "preview", "sourced", "schedule.json"), JSON.stringify({ estimated: false, total: t, segments }));
+ return { dir, takeDir };
+}
+
+test("previewWindowPlan: --at/--dur are seconds of the take's own cut, timed by its measured schedule", () => {
+ const timeline = [clip("x", 300), clip("a", 100), clip("b", 100), clip("c", 100), clip("d", 100)];
+ const schedule = { segments: timeline.map((e, i) => ({ id: e.id, start: i === 0 ? 0 : 300 + (i - 1) * 100, duration: e.cutEnd })) };
+ const p = previewWindowPlan(timeline, { at: 440, dur: 170 }, schedule);
+ assert.deepEqual(p.ids, ["b", "c", "d"]);
+ assert.equal(p.basis, "schedule");
+ // Past the take's end: refused, naming the unit and the cut's length.
+ assert.throws(() => previewWindowPlan(timeline, { at: 900, dur: 10 }, schedule), /--at 900 is past the end of the take's cut \(700 s of cut time/);
+ // No schedule: the take's own lengths, said to be estimates.
+ const e = previewWindowPlan(timeline, { at: 0, dur: 10 }, null);
+ assert.equal(e.basis, "estimate");
+ assert.deepEqual(e.ids, ["x"]);
+});
+
+test("take --preview --at 440 --dur 170: the whole take's cut with the window, to its own file; the full preview untouched", async () => {
+ const { dir, takeDir } = await fixture();
+ try {
+ /** @type {any[]} */
+ const jobs = [];
+ const lines = [];
+ const render = async (job) => {
+ const doc = JSON.parse(await readFile(job.manifestPath, "utf8"));
+ jobs.push({ ...job, doc });
+ const file = cutWindowFile(job.outDir, job.slug, "sourced");
+ await mkdir(path.dirname(file), { recursive: true });
+ await writeFile(file, "WINDOW");
+ return { file };
+ };
+ const r = await previewTake(dir, "t1", { window: { at: 440, dur: 170 }, render, log: (l) => lines.push(l) });
+ assert.equal(jobs.length, 1);
+ // The window is the render's to lay: every entry of the take's cut is in its manifest (the chrome's state at 440 s).
+ assert.deepEqual(jobs[0].doc.timeline.map((e) => e.id), ["x", "a", "b", "c", "d", "e", "f"]);
+ assert.deepEqual(jobs[0].cutWindow, { at: 440, dur: 170 });
+ assert.equal(jobs[0].doc.render.tier?.name, "preview");
+ // Its own build dir, never the full preview's.
+ assert.equal(jobs[0].outDir, path.join(takeDir, "out", "window"));
+ // The entries the take's schedule puts in 440–610: b (400–500), c (500–600), d (600–700).
+ assert.deepEqual(r.covers, ["b", "c", "d"]);
+ assert.ok(lines.some((l) => /cut seconds 440–610/.test(l) && /b, c, d/.test(l)), lines.join("\n"));
+ assert.equal(r.mp4, path.join(takeDir, "out", "s.preview.440-610.mp4"));
+ assert.equal(r.mp4, windowPreviewMp4(takeDir, "s", { at: 440, dur: 170 }));
+ assert.equal(await readFile(r.mp4, "utf8"), "WINDOW");
+ assert.equal(await readFile(path.join(takeDir, "out", "s.preview.mp4"), "utf8"), "FULL");
+ // Past the take's end: refused before anything renders.
+ await assert.rejects(previewTake(dir, "t1", { window: { at: 2000, dur: 10 }, render }), /--at 2000 is past the end/);
+ assert.equal(jobs.length, 1);
+ } finally {
+ rmSync(dir, { recursive: true, force: true });
+ }
+});
+
+test("--cut-window: build-video's flag, its span against the cut, and the take render's argv", () => {
+ assert.equal(cutWindowFlag(["m.json"]), null);
+ assert.deepEqual(cutWindowFlag(["m.json", "--cut-window", "440", "170"]), { at: 440, dur: 170 });
+ assert.throws(() => cutWindowFlag(["m.json", "--cut-window", "7:20", "170"]), /seconds of the cut/);
+ assert.throws(() => cutWindowFlag(["m.json", "--cut-window", "4", "5", "--chrome-only"]), /not with --chrome-only/);
+ assert.deepEqual(cutWindowSpan({ at: 600, dur: 170 }, 668.3), { at: 600, dur: 668.3 - 600 });
+ assert.throws(() => cutWindowSpan({ at: 700, dur: 10 }, 668.3), /past the cut's end \(668\.3 s/);
+ const argv = renderArgv({ manifestPath: "m.json", outDir: "/o", full: false, xfade: false, queueLock: null, cutWindow: { at: 440, dur: 170 } });
+ assert.deepEqual(argv.slice(argv.indexOf("--cut-window"), argv.indexOf("--cut-window") + 3), ["--cut-window", "440", "170"]);
+ assert.ok(!renderArgv({ manifestPath: "m.json", outDir: "/o", full: false, xfade: false, queueLock: null }).includes("--cut-window"));
+ assert.equal(cutWindowFile("/o", "s", "sourced"), "/o/sourced/s.window.mp4");
+});
diff --git a/umtool/lib/report/takeRender.mjs b/umtool/lib/report/takeRender.mjs
@@ -30,7 +30,7 @@ import { existsSync } from "node:fs";
import path from "node:path";
import { promisify } from "node:util";
import { readFile } from "node:fs/promises";
-import { DEFAULT_VARIANT, variantPaths, xfadeBatchSize } from "umtool-report-to-video/build-video";
+import { cutWindowFile, DEFAULT_VARIANT, variantPaths, xfadeBatchSize } from "umtool-report-to-video/build-video";
import { manifestEstimateMb, renderEstimateMb } from "umtool-report-to-video/render-estimate";
import { PIPELINE_DIR, UMTOOL_DIR } from "./driver.mjs";
@@ -48,9 +48,10 @@ export function queueLockScript() {
/**
* The argv of a take's render, pure.
* `estimateMb`: what the render declares to the heavy slot (null: nothing).
- * @param {{ manifestPath: string, outDir: string, full: boolean, xfade: boolean, keepFrames?: boolean, queueLock?: string | null, estimateMb?: number | null }} job
+ * `cutWindow`: only those cut seconds laid and encoded, the whole cut's segments built (build-video --cut-window).
+ * @param {{ manifestPath: string, outDir: string, full: boolean, xfade: boolean, keepFrames?: boolean, queueLock?: string | null, estimateMb?: number | null, cutWindow?: { at: number, dur: number } | null }} job
*/
-export function renderArgv({ manifestPath, outDir, full, xfade, keepFrames = false, queueLock = queueLockScript(), estimateMb = renderEstimateMb("render") }) {
+export function renderArgv({ manifestPath, outDir, full, xfade, keepFrames = false, queueLock = queueLockScript(), estimateMb = renderEstimateMb("render"), cutWindow = null }) {
const build = [
process.execPath,
path.join(/* turbopackIgnore: true */ PIPELINE_DIR, "build-video.mjs"),
@@ -64,6 +65,7 @@ export function renderArgv({ manifestPath, outDir, full, xfade, keepFrames = fal
...(xfade ? [] : ["--no-xfade"]),
...(full ? [] : ["--no-chapters"]),
...(keepFrames ? ["--keep-frames"] : []),
+ ...(cutWindow ? ["--cut-window", String(cutWindow.at), String(cutWindow.dur)] : []),
];
if (!queueLock) return build;
const estimate = Number(estimateMb) > 0 ? ["--estimate", String(Math.round(Number(estimateMb)))] : [];
@@ -183,7 +185,7 @@ export async function renderTake(job) {
return;
}
if (code === 0 && !failed.length) {
- resolve({ file: variantPaths(job.outDir, job.slug, DEFAULT_VARIANT).final });
+ resolve({ file: job.cutWindow ? cutWindowFile(job.outDir, job.slug, DEFAULT_VARIANT) : variantPaths(job.outDir, job.slug, DEFAULT_VARIANT).final });
return;
}
reject(
diff --git a/umtool/report-to-video/build-video.mjs b/umtool/report-to-video/build-video.mjs
@@ -122,6 +122,9 @@
// --chrome-preview <at> <dur> Render only that window of the deck and write
// out/<variant>/<slug>.preview.mp4 of it, from the cached
// concat when there is one, else from the segments it touches
+// --cut-window <at> <dur> A full build's segments, then only cut seconds
+// [at, at + dur] laid and encoded, the deck at its state then,
+// to out/<variant>/<slug>.window.mp4 (umtool take --preview --at)
//
// Requires: yt-dlp, ffmpeg/ffprobe, ImageMagick with Pango.
@@ -7506,6 +7509,23 @@ export async function buildVideo({ manifestPath, opts = {}, out, only, fetchOnly
// on their inputs; null without any, which leaves every concat as it was.
const joins = await cutJoins({ schedule: deck ? schedule : null, entries, segments, render });
+ // `--cut-window <at> <dur>` (umtool take … --preview --at S --dur S): the WHOLE cut's segments, built or
+ // reused by their keys as above, then only cut seconds [at, at + dur] laid and encoded -- the deck rendered
+ // over the whole cut's schedule from `at`, so its timeline, counters and trail show their state at that
+ // second, never a cut that starts there. To out/<variant>/<slug>.window.mp4 (cutWindowFile).
+ if (opts.cutWindow) {
+ const { starts, durs, total } = await cutOffsets(segments, D, render.fps, joins);
+ const end = deck ? schedule.total : total;
+ const { at, dur } = cutWindowSpan(opts.cutWindow, end);
+ const plan = deck && !opts.noChrome ? await renderDeck({ manifestPath, render, outDir, variant, schedule, from: at, duration: dur }) : { regions: [] };
+ const out = path.join(outDir, `${manifest.slug}.window.mp4`);
+ EMIT("note", { message: `--cut-window: cut seconds ${at}–${Math.round((at + dur) * 1000) / 1000} of ${Math.round(end * 10) / 10}` });
+ await execFileP(FFMPEG, previewFromSegmentsArgs({ segments, durs, starts, D, at, dur, render, chromePlan: plan, outPath: out, joins }), { maxBuffer: 1 << 26 });
+ await tierFinalPass(out, render);
+ EMIT("done", { out, failures: [] });
+ return { out, failures: [] };
+ }
+
const railPlan = opts.noRail ? null : await buildRailPlan(manifest, render, entries, segments, D, outDir);
// A hard-cut deck build's sound needs only the segments and the joins: it
// is begun now, beside the deck's capture, and the chunked encode awaits it.
@@ -7722,6 +7742,34 @@ export function chromeFlags(argv) {
}
/**
+ * `--cut-window <at> <dur>`, read off argv: seconds of the CUT (its schedule), or null. Pure; throws a
+ * sentence on a malformed one, or beside a run that does not build the cut.
+ */
+export function cutWindowFlag(argv) {
+ const i = argv.indexOf("--cut-window");
+ if (i < 0) return null;
+ const at = Number(argv[i + 1]);
+ const dur = Number(argv[i + 2]);
+ if (argv[i + 1] === undefined || argv[i + 2] === undefined || !Number.isFinite(at) || !Number.isFinite(dur) || at < 0 || dur <= 0) {
+ throw new Error("--cut-window takes <at> <dur> in seconds of the cut (at ≥ 0, dur > 0)");
+ }
+ for (const f of ["--chrome-only", "--chrome-preview", "--rail-only", "--preview", "--only"]) {
+ if (argv.includes(f)) throw new Error(`--cut-window builds the cut and lays a window of it: not with ${f}`);
+ }
+ return { at, dur };
+}
+
+/** A cut window against the cut's length: `at` inside the cut, `dur` to its end at most; refused past it. Pure. */
+export function cutWindowSpan(win, total) {
+ const at = Number(win.at);
+ if (!(at < total)) throw new Error(`--cut-window: ${at} s is past the cut's end (${Math.round(total * 10) / 10} s of cut time)`);
+ return { at, dur: Math.min(Number(win.dur), total - at) };
+}
+
+/** Where `--cut-window` writes its file: out/<variant>/<slug>.window.mp4. Pure. */
+export const cutWindowFile = (outRoot, slug, variant) => path.join(variantPaths(outRoot, slug, variant).dir, `${slug}.window.mp4`);
+
+/**
* Does this run take the machine's heavy slot (heavy-gate.mjs)? Every run that
* renders the cut does -- a full build, --chrome-only, --chrome-preview,
* --rail-only, a --no-chrome build, one clip's --clip-preview. A fetch, one `--only` segment, the
@@ -7809,6 +7857,7 @@ async function main() {
" [--progress ndjson] [--continue-on-error] [--no-reuse] [--no-segment-cache]\n" +
" [--no-rail] [--rail-only] [--preview <start> <dur>]\n" +
" [--chrome-only] [--no-chrome] [--chrome-preview <at> <dur>] [--keep-frames] (render.chrome, the deck)\n" +
+ " [--cut-window <at> <dur>] (the whole cut's segments, then only those cut seconds laid and encoded)\n" +
" [--clip-preview <id>] (one clip's segment with its deck: out/<variant>/clip-preview/<id>.mp4)\n" +
" [--lint] [--no-lint] (lint the manifest and stop / build without the lint)\n" +
" [--no-rulings] (build as if there were no montage-rulings.json beside the manifest)\n" +
@@ -7868,6 +7917,7 @@ async function main() {
};
try {
Object.assign(opts, chromeFlags(argv));
+ opts.cutWindow = cutWindowFlag(argv);
} catch (err) {
console.error(err.message);
process.exit(2);