Skip to content

Live timeline editing: cut/split/trim (WIP)#16

Draft
RichardBray wants to merge 7 commits into
mainfrom
live-timeline-editing
Draft

Live timeline editing: cut/split/trim (WIP)#16
RichardBray wants to merge 7 commits into
mainfrom
live-timeline-editing

Conversation

@RichardBray

Copy link
Copy Markdown
Member

Live timeline-editing for camkit: drive an open Camtasia project to ripple-cut, split, and trim without the close/edit-JSON/reopen cycle. macOS-only, via Accessibility menu commands. See `HANDOFF-live-cut.md` for the verified recipe and design.

Tasks

  • T0 - branch hygiene + 6ms rough-cut boundary pad + handoff doc
  • T1 - rebuild `new`/`add` live commands
  • T2 - Accessibility plumbing (raise window, permission detection, menu assert)
  • T3 - `split --at S`
  • T4 - `cut --from --to` (ripple) + `--lift`
  • T5 - `trim --start/--end`
  • T6 - polish: README, unit tests, delete handoff

Draft until the live ops are verified against Camtasia.

Whisper word/silence timestamps land slightly inside the actual audio,
so cutting exactly on them clips word attacks and tails. Document a
~6ms outward pad on every kept range boundary as a safety margin on top
of the existing breath guidance.

Also add HANDOFF-live-cut.md: the design doc and T0-T6 task breakdown
for the live timeline-editing feature (cut/split/trim via Accessibility)
that this branch will implement.
Captured a real empty project.tscproj produced by Camtasia 2026.1.3
(File > New, saved via Accessibility-driven Cmd+S). camkit new will copy
this template rather than generate the schema from scratch - a hand-built
skeleton crashed Camtasia on open because, among other things, an empty
project omits the sourceBin key entirely rather than using an empty array.

See HANDOFF-live-cut.md re-probe results for why the AppleScript suite
cannot create/save projects on this build.
createProject copies an embedded canonical empty project.tscproj (saved
by Camtasia 2026.1.3, thumbnail stripped), patches title/width/height,
recreates the bundle sidecar dirs, and writes it. camkit new resolves the
path, generates the bundle, and opens it in Camtasia unless --no-open.

The template is imported as JSON so it survives bun build --compile; the
AppleScript suite cannot create or save projects on this build. Verified
E2E: generated 1280x720 project opens in Camtasia without crashing.

new/add was the lost work from the prior session; this restores new.
…capabilities

Records the rule to drive the Camtasia GUI via Accessibility before asking
a human, plus the verified-working/broken AppleScript table for 2026.1.3,
so agents don't wrongly assume a task needs a human or re-probe the suite.
Implements camkit add: probeMedia (ffprobe) + addMediaToProject pure
builder + cmdAdd (copy media into bundle, close/write/reopen). Pure-shape
unit tests pass, BUT generated projects crash Camtasia on open - the live
schema is incomplete.

Committed as WIP to preserve the work. See HANDOFF-live-cut.md T1 STATUS:
next step is ground-truth capture (drive File > Import, diff the real
sourceBin/timeline), and the known gap that an mp4-with-audio must split
into VMFile + AMFile rather than a single VMFile.

camkit new in the prior commit is done and verified; only add is broken.
The previous add builder crashed Camtasia on open. Captured the real
schema by driving File > Import on an mp4 (video+audio) and an m4a
(audio-only), saving, and reading back project.tscproj.

Corrections vs the broken builder:
- sourceBin sourceTracks use editRate 1000 (ms ranges), not 44100 —
  this was the crash root.
- Timeline shape now matches Camtasia: video+audio lands as a
  UnifiedMedia wrapper (video VMFile + audio AMFile children); audio
  only lands as a bare AMFile. Was emitting a single VMFile.
- geometryCropN params are {type,defaultValue,interp} objects, not
  bare doubles; clip metadata matches (audiateLinkedSession,
  clipSpeedAttribute, colorAttribute, etc).
- probeMedia no longer throws on audio-only media.

Verified E2E: a generated project (new + add mp4 + add m4a) opens in
Camtasia 2026.1.3 with no crash and shows both clips on the timeline.
Unit tests cover video+audio, audio-only, and video-only shapes.
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