commit 78369fc3a3e2209983e34de1b57b5f8ec219b291
parent f4505c97e201e6ff4ea2b8751cb3dce151b6cab5
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Tue, 27 Oct 2026 12:43:58 -0400
live pre-clip: OPERATING.md, the changelog, the plan's measured cut
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
3 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/OPERATING.md b/OPERATING.md
@@ -470,6 +470,47 @@ pnpm ops keep-videos --json '{"slug":"example-rumble","ids":["v1abcde"],"note":
`channels/<slug>/pending-keep.json`; it is marked when its record is first written — a download, an import, a
recording. The channel's Cleanup stage → **Keep videos by id** lists the pending ids.
+### Pre-clip a stream while it records
+
+```sh
+pnpm ops record-live --json '{"slug":"example-youtube","url":"https://www.youtube.com/watch?v=abcdefghijk","preclip":true}'
+pnpm ops live-preclip --json '{"slug":"example-rumble","id":"v1abcde","everyMinutes":5}' # on a recording already running
+pnpm ops live-preclip --json '{"slug":"example-rumble","id":"v1abcde","action":"status"}'
+pnpm ops live-clip --json '{"slug":"example-rumble","id":"v1abcde","start":3605,"end":3660}' --wait
+pnpm ops live-preclip --json '{"slug":"example-rumble","id":"v1abcde","action":"stop"}' # the recording goes on
+pnpm ops live-preclip --json '{"slug":"example-rumble","id":"v1abcde","action":"finalize"}' # by hand, once the final transcript is here
+```
+
+- `"preclip"` on record-live (or `live-preclip` on a recording already running; the video page's **Live
+ pre-clip** panel) runs a `live-preclip` job beside the recorder. Every `everyMinutes` (10; `settings.livePreclip`)
+ a tick reads ONLY the new span of the growing file — by time, `ffmpeg -ss <from> -i <the part>`, the MPEG-TS a
+ muxed recorder writes or the audio stream of YouTube's separate pair — transcribes it on a worker lease (with
+ word timings, at most `maxChunkMinutes` a tick, `overlapSeconds` re-read so a word the boundary cut is heard
+ whole) and splices it into `data/<id>/live-transcript.json`, PROVISIONAL, on the clock the landed video will
+ have. Its laugh scan runs on the same audio. Then umtool's clip finder grows the project `<id>-live`: open it in
+ umtool's clip editor and walk the windows while the stream goes on (the live words are its captions; one
+ speaker until the landing; the strip, the trim and the rulings work as on any project; no model is needed —
+ without the CED model the laughs come from the transcript and the sound's energy).
+- Nothing is copied and the recorder is never touched: the bytes it wrote do not change. The tick's WAV is in
+ `.<id>.preclip/` beside the parts on the store's disk (never /tmp), gone after the tick. No network request.
+- Its log says each tick and each skip: under 30 s new ("no new data"), MemAvailable under the heavy slot's floor
+ (`HEAVY_MIN_FREE_MB`, 6000 — re-checked every minute), the store's disk under 2 GB. One transcription is in
+ flight at a time: a busy worker means the next tick takes everything since (coalesced, never queued up), and a
+ tick far behind is followed by the next at once. `"action": "status"` prints live-preclip.json and the
+ transcript's last cues; `"stop"` cancels the job only.
+- A recorder restart or the Rumble fallback writes a new part: when its audio at 60–90 s matches the fingerprint
+ taken live, the transcript goes on; else it starts again on the new part and the project's windows are flagged.
+- When the stream lands: the clock check (the landed part is the one followed → nothing to check; else the
+ landed video's audio against the fingerprint), then — once the final transcript is there (the landing handed the
+ audio to the transcription lane) — the live transcript is marked superseded and the project reads the corpus:
+ its windows stay where they are by source second, flagged in the clip editor when the check did not match. Find
+ clips on the landed video later re-analyzes the same project with the speakers and the sound.
+- A shareable clip while it is still live: `live-clip` (`start`/`end` in stream seconds, or `"clip"`: a clip id of
+ the project), the panel's **Share this clip**, or the clip editor's **Share now (live)** — the window is cut from
+ what is recorded at that moment (`/api/media/live-window`; from the saved video once landed) into the clip cache,
+ and the clip's short is made with the live captions, offline. At most 2:20 and 512 MiB (X); past the live edge
+ it says how many seconds to wait.
+
## Find clips in a recording
```sh
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -1,6 +1,7 @@
# Changelog
## [Unreleased]
+- **A live stream can be transcribed and clipped while it is still recording.** Until now a recording was transcribed only once the stream ended and the file landed, so on a long stream nothing could be found or shared until hours later. `pnpm ops record-live` takes `"preclip": true` (or `{"everyMinutes": 10, "maxChunkMinutes": 20, "overlapSeconds": 15, "scan": true, "mine": true, "project": "<slug>"}`, defaults in `settings.livePreclip`). `pnpm ops live-preclip {"slug", "id"}` starts the same thing on a recording already running, and the video page's **Live pre-clip** panel has a Start button. Every few minutes a tick transcribes only what was recorded since the last one. It reads the growing file in place and never copies it or touches the recorder, whatever the recording is: one MPEG-TS, YouTube's separate video and audio, or Kick's polled VOD. The new span is transcribed on the transcription worker, with word timings, and added to `data/<id>/live-transcript.json`, marked provisional, on the clock the landed video will have. The clip finder then grows a umtool project for the stream (`<id>-live`), so its windows can be walked in the clip editor while the stream goes on. A busy worker never piles ticks up: the next tick takes everything since, and a tick that is far behind is followed by the next one at once. A tick is skipped, and the log says why, when there is under 30 s new, when the machine is under the 6 GB memory floor (checked again every minute), or when the store's disk has under 2 GB free. A recorder that restarts or falls back (Rumble) is followed. If its audio matches, the transcript goes on; if not, it starts again on the new recording and the project's windows are flagged. When the stream lands, the landed video is checked against what was transcribed live, and the windows stay where they are when it matches (flagged when it does not). Once the final transcript is there it replaces the live one, and the project reads the corpus from then on. `"action": "stop"`, `"status"` and `"finalize"` stop it (the recording goes on), print its state, and finish that hand-over by hand. **A clip of a stream still live can be shared at once:** `pnpm ops live-clip {"slug", "id", "start", "end"}`, the panel's **Share this clip**, or the clip editor's **Share now (live)** cuts the window from what is recorded so far and makes the clip's short with the live captions. A share is at most 2:20 and 512 MiB, for X, and nothing is fetched from the network. Needs a restart of the editor and umtool.
- **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.
- **Use with AI is the homepage's.** A published site's header and slide-out menu no longer carry it (nor the hub's header); a site still reaches the homepage's AI and MCP doc from its footer and from Ask AI, and its corpus.json and llms.txt still name it. Rebuild a site to see it.
- **The site-swap intro no longer shifts vertically on the chime.** With the URLs under MEDIA the drawing used to rise to stay centred; the lockup is now centred as the plain intro centres it and the URLs hang below it, so on the chime it only moves sideways. Intros without a site swap are unchanged.
diff --git a/plans/live-preclip.md b/plans/live-preclip.md
@@ -148,3 +148,8 @@ project): umtool `POST /api/report/live-share {project, clip | start, end}`:
- Chat during the stream: the replay is fetched after (fetch-chat), not live.
- MPEG-TS PTS wrap (26.5 h) and a discontinuity inside one part are not handled: a part that resets its clock is
read as ffmpeg reads it.
+- The phrase finder reads the corpus's transcript.cues.json, so during the stream it does not see the live
+ transcript; the clip editor's strip (the project's shadow cues and words) and the video page's live transcript
+ (click a time to share from it) are the manual paths until the landing.
+- Not tried on a real stream yet (no stream was live while it was built, and the heavy gates were held for the
+ operator's renders): the tests write synthetic TS and fMP4 recordings in increments.