Live timeline editing: cut/split/trim (WIP)#16
Draft
RichardBray wants to merge 7 commits into
Draft
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Draft until the live ops are verified against Camtasia.