Skip to content

feat: render (ffmpeg proxy preview) + compile (declarative spec → draft)#29

Merged
renezander030 merged 1 commit into
masterfrom
feat/render-and-compile
Jun 8, 2026
Merged

feat: render (ffmpeg proxy preview) + compile (declarative spec → draft)#29
renezander030 merged 1 commit into
masterfrom
feat/render-and-compile

Conversation

@renezander030

Copy link
Copy Markdown
Owner

Adds the two highest-utility next commands on top of v0.9, both validated end-to-end before merge.

render — watch an edit without opening CapCut

A low-res ffmpeg proxy of the timeline: flattens the main video track (per-segment source trim + speed), mixes every audio-track segment, and with --burn-captions draws the text segments in. Explicitly a preview, not CapCut's final render (no multi-track compositing/effects). Read-only — never mutates the draft.

  • The ffmpeg invocation is built by a pure, deterministic buildRenderPlan that is unit-tested without invoking ffmpeg.
  • --dry-run prints that plan and needs no ffmpeg at all.
  • ffmpeg is an opt-in shell-out, only when actually rendering — same pattern caption uses for whisper. Still zero npm-dep.
capcut render ./my-short --burn-captions       # -> ./my-short/preview.mp4
capcut render ./my-short --dry-run             # print the ffmpeg plan, run nothing

compile — build a whole draft from a declarative JSON spec

The inverse of describe: instead of chaining 30 mutating add-* commands (each a place to drift), an agent emits one spec and compile constructs the draft atomically via the same factory functions the imperative commands use.

  • Times in seconds (converted to CapCut microseconds); media paths resolve relative to the spec file.
  • Validates the full spec and checks every media file exists before writing anything — a bad spec fails clean.
  • Mirrors the result to both draft_content.json and draft_info.json so every downstream command reads the same data.
capcut compile ./short.json --out ./my-short

Verification

  • 171 tests pass, 0 fail (12 new: 6 compile, 6 render incl. a real ffmpeg render gated on host availability + a pure-plan suite).
  • compile output passes capcut lint (cross-tool validity check).
  • Pre-commit gate (biome + full npm test) green.
  • Two real bugs found and fixed during verification: compile was writing to draftsDir/spec.name instead of --out (dir name vs draft display-name conflation), and the dual draft_content.json/draft_info.json template files are now kept consistent.

Bumps to v0.10.0; CHANGELOG + README updated.

🤖 Generated with Claude Code

…aft)

Two commands that close the biggest gaps in a headless CapCut workflow:
seeing the result of an edit, and authoring a whole draft in one shot.

- `render` — low-res ffmpeg proxy of the timeline (main video track trim +
  per-segment speed, audio mix, optional --burn-captions) so you can watch
  an edit without opening CapCut. A preview, not CapCut's final render. The
  ffmpeg command is built by a pure, deterministic buildRenderPlan that is
  unit-tested without invoking ffmpeg; --dry-run prints the plan. Read-only.
- `compile` — builds a whole draft from a declarative JSON spec (the inverse
  of `describe`) via the same factory functions the imperative add-* commands
  use. Times in seconds; media paths relative to the spec. Validates the full
  spec and checks every media file exists before writing anything; mirrors the
  result to both draft_content.json and draft_info.json.

ffmpeg is an opt-in shell-out (only when actually rendering), mirroring how
`caption` shells to whisper. Still zero npm-dep, JSON-by-default.

12 new tests (171 total, all passing). Bumps to v0.10.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@renezander030 renezander030 merged commit d18fab8 into master Jun 8, 2026
4 checks passed
@renezander030 renezander030 deleted the feat/render-and-compile branch June 8, 2026 07:30
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