Use a Take frame as a Keyframe (#60) #115
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
needs-info
needs-triage
question
ready-for-agent
ready-for-human
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crowmaki/ai-studio!115
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-60-take-frame-keyframe"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #60. Part of #24 (User Stories 91 and 92).
What changes
A filmmaker can continue across a cut by turning a Take's first or last frame into a Keyframe of any Shot.
Dailies. The Take details panel has a new row: Use as Keyframe: First frame… / Last frame…. Each opens Use first / last frame as Keyframe for…. This dialog:
The defaults follow the cut. A last frame goes to the start of the next Shot, and a first frame goes to the end of the previous Shot. At either end of the Project the default is the Take's own Shot.
Core.
keyframe_from_take(rendition, frame, shot, anchor)reads the frame from the Rendition's video in the media folder with the ffmpeg sidecar:Ffmpeg::last_frame, which decodes the final second backwardsThe frame keeps its pixels and goes in as one undoable edit ("Use take frame as keyframe"), replacing the Keyframe at that anchor like import does. It refuses a Rendition that is not rendered or whose files are purged, an unknown Shot, and a time that is not inside the Shot.
Provenance. A new Keyframe origin,
take_frame, records the source Take, the Rendition, which frame (first or last) and the frame time in ms. The last frame's time is(frames − 1) / 24 sof the Take.frame_fromlink. When a Take that sends such a Keyframe is queued, it getstake_link (take, source_take, 'frame_from')in the same transaction. "Rebuild with current inputs" writes the link again from the new inputs.TakeDto.frameFromTakeIdsexposes it.Board. The Keyframe strip labels a take-frame Keyframe with its source, for example
1A-2 last. Hovering shows "Last frame of 1A-2 (5.833 s)".Schema. V31 rebuilds
keyframeto allow origintake_frameand addssource_take_id,source_rendition_id,source_frameandsource_frame_ms. A CHECK makes all four required for a take frame and absent otherwise.Decision to confirm
take_linkgoes from one Take to another, and a Keyframe is not a Take. So theframe_fromlink is written when a Take that uses the frame Keyframe is queued, not when the Keyframe is made. The Keyframe holds its own provenance from the moment it is made. Queuing is append-only, so the link stays out of the undoable Keyframe edit.Screenshots
Take details with the new Use as Keyframe row.
Use last frame as Keyframe for… on 1A-2. The defaults are the next Shot (1B) and its start.
Opened again after use, the dialog warns that it would replace 1B's start Keyframe. The status bar shows the undo entry.
1B's Board. The start Keyframe is the last frame of 1A-2, and its badge names the source.
The clips come from a stand-in ComfyUI that serves ffmpeg test clips.
Tests
crates/studio-core/tests/take_frame_keyframes.rs(new, against a fake ComfyUI and a brightening test clip):frame_fromto the source Take, and rebuilding after the Keyframe is removed drops the linkcrates/studio-core/tests/migrations.rs: Keyframes from before V31 survive the rebuild (anchors, prompts, hidden rows), the new CHECK holds, and the partial anchor index is backsrc/lib/dailies/frameKeyframe.test.ts: the Shot choices, the default target and anchor, and the labelscargo test --workspace --all-features,bun test srcandbun run checkall pass, exceptffmpeg::tests::a_proxy_*. Those two tests fail on this machine before and after this change, because the local ffmpeg has nolibopenh264.