Skip to content

Keyframe easing byte-identical to CapCut UI + ken-burns preset #41

Description

@renezander030

What

Make keyframe easing byte-identical to CapCut's UI, and add a ken-burns convenience preset built on the corrected easing.

Why it matters

keyframe exists, but the easing curve the CLI writes doesn't match what CapCut produces from its own UI. A Cubic-Out keyframe authored by the CLI animates differently than the same move made in the app, so drafts don't round-trip faithfully. Animation params and timing are under-specified across the whole domain, which makes this hard to get right by guessing:

  • Hommy-master/capcut-mate#50in_/out_/loop_animation_duration (microseconds) undocumented.
  • GuanYixuan/pyJianYingDraft#176 — per-word/animation extraction fails on newer encrypted templates.

Getting the curve exactly right is what makes CLI-authored motion indistinguishable from hand-authored motion.

Where in the code

  • The keyframe command handler in src/index.ts (keyframe verb) and its spec in src/command-specs.ts.
  • Wherever keyframe values/interpolation are computed (search for the keyframe write path).

Proposed approach

  1. Capture an oracle: make the same move in CapCut's UI, export, and record the exact keyframe values it writes for Cubic Out.
  2. Fix the CLI's easing math so it reproduces those values (the fork found it should be ratio x delta, not a fixed offset).
  3. Lock it with a byte-identity test against the UI oracle fixture.
  4. Add a ken-burns preset (slow zoom/pan) that composes the corrected easing so users don't hand-build keyframes.

Acceptance criteria

  • CLI-authored Cubic-Out keyframes are byte-identical to CapCut UI output for the same move (fixture-locked).
  • ken-burns preset produces a smooth zoom/pan using the corrected easing.
  • Test fails (RED) against the old math and passes with the fix.
  • docs/command-reference.md documents the animation-duration units (microseconds) surfaced by capcut-mate#50.

Prior art

The Davidb-2107/capcut-cli fork already landed the Cubic-Out delta-scaling fix plus a byte-identity oracle test and a ken-burns preset. Well-suited to a contributor who enjoys precise, test-anchored work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions