Skip to content

Render capped-plan clips from full-quality windows of the source - #295

Merged
dillonstreator merged 3 commits into
mainfrom
claude/cogs-conversion-optimization-2b9072
Nov 18, 2026
Merged

dillonstreator merged 3 commits into
mainfrom
claude/cogs-conversion-optimization-2b9072

Conversation

@dillonstreator

Copy link
Copy Markdown
Member

What this does

Preview sources with full-quality clips. A plan can now set the resolution a link is downloaded at (sourceHeight). On a capped plan, the project keeps a small preview of the video with its full audio, which transcription, analysis and the editor use. Each clip renders from a full-quality window of the video, fetched for it with --download-sections. Rendered clips look the same as before. The difference is that the whole video no longer has to be downloaded at full resolution.

  • Windows are placed on the source's clock by matching their audio to the preview, so captions, cuts and framing line up exactly.
  • Windows are stored and reused by every re-render that fits inside them.
  • One project fetches one window at a time (a session lock on its own small pool), so parallel renders reuse each other's download.
  • The first fetch covers nearby clips too, chaining any within 15 s, up to 10 minutes.
  • A clip edited past its window fetches only the missing stretch, joined to the stored part locally. A joined window replaces the windows it contains.
  • Window copies on disk are evicted by the scratch sweep like other store caches, and source retention removes them.
  • If a window can't be fetched for good (the video was removed, or the proxy pool has no HTTP exit), the clip renders from the preview and the activity log says why.
  • The project page and the clip editor mark a preview source and name the plan that downloads at full quality. get_project reports sourcePreviewHeight.

Manual clip limit. New per-account limit MAX_MANUAL_CLIPS_PER_USER (0 = unlimited, the default; the hosted Free plan sets 1). Past it, create_clip, the editor and reelsaw create-clip explain the limit and offer the plan that lifts it.

Quota refusals. A refusal now carries its sentence separately from the offer link. The web shows the sentence next to the upgrade button, and MCP and the CLI keep the link in the text.

reelsaw scenario. Sets up a project in a known state in a few seconds, for screenshots and UI review, with no download or model run. Local instances only (docs/UI.md).

Operator notes

  • Migration 0058_source_sections adds the window table.
  • Window downloads are fetched by ffmpeg, which supports HTTP proxies only. The pool skips SOCKS candidates for them; docs/TROUBLESHOOTING.md shows how to add an HTTP exit next to a SOCKS one.
  • Self-hosted instances without a plan cap behave exactly as before: full download, no windows.

Testing

  • Unit tests cover window planning (merging, gap fill, stitch order and arguments), audio alignment, the sweep's handling of window files, the refusal sentence, the plan caps and the scenario guard.
  • Checked against a real video: a 240p preview with full audio lines up with a 1080p window at the requested start. A gap-filled window joined to a stored one matches the source within 3 ms across the seam.
  • A local stack with billing enabled was walked through every scenario: the preview badge and upgrade offer on the project page and in the editor, the manual-clip refusal, the window events in the activity log, and a paid account's full-quality source.
  • Not yet exercised: a full Free render end to end through a proxy pool, and the database and stack test suites, which run in CI.

A plan can now set the resolution a link is downloaded at (sourceHeight).
On a capped plan the project keeps a small preview with the full audio for
transcription, analysis and the editor, and each clip renders from a
full-quality window of the video fetched with --download-sections.

Windows are placed on the source clock by matching their audio to the
preview, stored, and reused by every re-render that fits. One project
fetches one window at a time (a session lock on its own pool), nearby
clips share a window, and a clip edited past its window fetches only the
missing stretch, joined to the stored part locally. The scratch sweep
evicts window copies like other store caches, and source retention drops
them. A window that cannot be fetched for good, or a pool with no HTTP
exit, renders from the preview and says so in the activity log.

Also:
- MAX_MANUAL_CLIPS_PER_USER limits clips added from an account's own time
  ranges; create_clip, the editor and the CLI refuse with the upgrade offer.
- Refusals carry their sentence apart from the offer link, so the web shows
  the sentence next to the button and MCP/CLI keep the link in the text.
- The project page and clip editor mark a preview source and name the plan
  that downloads at full quality.
- `reelsaw scenario` seeds projects in known states for screenshots and UI
  review, on local instances only.

Signed-off-by: dillonstreator <dillonstreator@gmail.com>
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
reelsaw-website Ready Ready Preview Nov 18, 2026 4:54pm UTC

Request Review

The word-list guard reads a 20-word string literal as a hand-typed vocabulary. The seeded transcript is sample speech, so it is now a few short sentences joined at run time.

Signed-off-by: dillonstreator <dillonstreator@gmail.com>
Web and shared are versioned with the server and ignored by changesets, so a changeset may not list them.

Signed-off-by: dillonstreator <dillonstreator@gmail.com>
@dillonstreator
dillonstreator merged commit 74c0193 into main Nov 18, 2026
15 checks passed
@dillonstreator dillonstreator mentioned this pull request Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant