Communitygithub.com

motioncopy

Reconstruct editable text animation from a supplied reference video through frame-by-frame analysis, measured motion and visual comparison, or apply one of seven bundled saved text effects to new text.

What is motioncopy?

motioncopy is an AI agent skill that reconstructs editable text animations by analyzing a reference video frame by frame, measuring motion curves, and comparing visual output. It works in two modes: a **new reference** mode where the user supplies a video, and the agent runs a full workflow—extracting frames with `scripts/extract_frames.py`, measuring per-unit motion parameters (position, scale, opacity, stagger, etc.), and building editable, scriptable motion that adapts to different text lengths and layouts; and a **saved effect** mode where the user names one of seven bundled effects (e.g., Line Flip, Letter Drop, Sequential Reveal) and the agent applies its pre-measured `motion-curves.json` and sampler script directly. The skill supports platforms where the agent can edit or render text animations, such as video editors or web animation tools, and requires Node 18+ for samplers and Python 3 with FFmpeg for frame extraction. It emphasizes fidelity to the reference's mechanism, explicit parameter fitting, and verification against actual composed frames, ensuring the reconstruction preserves overshoot, rebound, secondary motion, and exit trajectories without silently truncating or accelerating timing.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YuriAILab/motioncopy/tree/HEAD

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

What does motioncopy do?

Reconstruct the motion shown in the supplied video with the user's text. This is a reference-analysis workflow, not a particular effect. Infer the mechanism from each new reference; never default to a previous flip, drop or fly-in.

Two modes

  1. Saved effect — the user names one of the bundled effects below (by English or Chinese name) and supplies text, with no new reference video. Read that effect's EFFECT.md and references/integration.md, then use its measured motion-curves.json and scripts/motion.mjs sampler. Skip steps 1–2; follow step 3's text, layout and duration rules and step 4's verification.
  2. New reference — the user supplies a reference video. Run the full workflow below. Do not substitute a saved effect because it looks similar; if one matches closely, mention it and let the user choose.
Effect中文Folder
Line Flip逐行翻转effects/line-flip
Letter Drop逐字掉落effects/letter-drop
Sequential Reveal依次出现effects/sequential-reveal
Split Slide切开effects/split-slide
Left Bounce左边弹入effects/left-bounce
White Strip Reveal白底effects/white-strip-reveal
White Label Pop白底弹出effects/white-label-pop

Samplers need Node 18+ (or any modern JavaScript runtime); they output per-unit transforms and do not render video. Line Flip and Letter Drop also include optional React adapters. If the request names an effect ambiguously (e.g. "白底" vs "白底弹出"), ask which one.

Inputs and scope

  • Locate the reference in the supplied folder. If several clips/effects exist, use the named file/time range or context; ask only if the choice remains ambiguous.
  • Resolve replacement text and target placement from the request or existing editable item. Preserve spelling, language and intentional line breaks. Ask for missing text or an ambiguous replacement rather than inventing copy.
  • Use approved fonts, colors and layout. Otherwise inherit the target's style, or the reference's style for a standalone recreation. Do not copy incidental watermarks, footage or decorations.
  • Inspect the current project before editing. Replace only the identified overlay; preserve unrelated video, audio, captions and timing. A standalone request does not authorize timeline edits.

1. Read the reference

Probe dimensions, timestamps, FPS, duration and rotation. Locate the complete effect: initial absence, entrance, overshoot, settling, hold, exit anticipation, departure and final absence. Do not infer an unseen exit from the entrance.

Use scripts/extract_frames.py for exact decoded frames and a timestamp manifest. Requires Python 3, FFmpeg and FFprobe; no Python packages. For an effect within a longer recording, supply its interval in seconds:

python3 scripts/extract_frames.py /path/reference.mp4 --out /path/analysis --start 0 --end 4

Paths are examples, not fixed inputs. Read manifest.json. Start with an overview, then inspect every changing frame in entry, rebound and exit using consecutive contact sheets or equivalent frame inspection. Detect changes across the hold too, including looping drift. Sparse screenshots alone cannot establish fidelity. The helper extracts frames; it does not analyze or render motion.

2. Measure the mechanism

Read reconstruction.md before fitting. Identify:

  • Moving units: title, lines, words, graphemes, glyph fragments or nested groups.
  • Per-unit position, scale, rotation/perspective, opacity, masks, pivots and layer order.
  • Stagger direction/delays, overshoot peaks, rebound crossings, settling, blur and deformation.
  • Separate entry and exit trajectories: exit may use different anticipation or ordering.

Record observations with source frame indices/timestamps. Fit only parameters evidenced by pixels. Preserve secondary motion. Use a generic easing or spring only when comparisons support it. Mark uncertain or invisible parameters rather than claiming exact recovery.

3. Build editable motion

Use available editor/renderer code tools. Keep motion data separate from text and styling. Expose text, font, weight, size, color, spacing and duration where supported. Animate newly rendered text; do not replay the reference as a flat video.

Normalize coordinates around actual glyph bounds and pivots. Sample curves in seconds using reference timestamps and target FPS. Never assume both clips run at 30 FPS.

For different line/character counts, adapt grouping, stagger and layout explicitly while preserving the mechanism. Do not reuse a fixed unit count. Preserve Unicode graphemes, shaping, ligatures and reading direction. Measure actual rendered text; proportional English is not a row of equal-width boxes.

Keep measured entry/exit speed and complete secondary motion. Fit the target duration by adjusting the static hold first. If motion cannot fit, state the conflict and resolve timing within the user's scope; do not silently truncate the bounce, accelerate everything or overlap adjacent clips.

Use a local asset box large enough for the motion envelope and shadows. Apply masks only where observed. Verify fonts in the actual renderer and disclose substitutions. Follow the current editor tool schemas and source-update mechanism. Preserve existing instance overrides unless this edit changes them.

4. Compare and finish

Compare the reconstruction and reference at matched phase times. Check motion and masks, not just settled appearance. With different copy, compare normalized geometry, timing and opacity rather than raw text pixels. Correct mismatches and recheck affected phases.

For timeline edits, inspect actual composed frames: first appearance, maximum overshoot, recovery, settled text, exit anticipation, departure, last visible frame and following shot. Check collisions, facial obstruction and residual letters. Verify displayed boundaries: nominal duration and fractional FPS can disagree with rendering.

Keep the reference untouched. Save analysis, measured curves and a short record of placement, checks and limitations in the working project. Report completion only after actual rendering is inspected; distinguish timeline edits from exported files.

Do not add a new saved effect under effects/, modify this workflow or publish the library merely because a recreation succeeded; do that when requested. No model or agent product is required. Available tools determine the implementation.

Related Skills