Skip to content

Fix blank frames when speed > 1 (#26)#39

Merged
scastiel merged 1 commit intomainfrom
claude/distracted-chandrasekhar
Apr 15, 2026
Merged

Fix blank frames when speed > 1 (#26)#39
scastiel merged 1 commit intomainfrom
claude/distracted-chandrasekhar

Conversation

@scastiel
Copy link
Copy Markdown
Owner

Summary

  • The speed metadata setting scaled the frame-sampling index (frame * speed) but left each sequence's durationInFrames unscaled, so at speed: 2 the index ran past the pre-rendered frames array halfway through each typing sequence, returning undefined and rendering blank frames.
  • Fix: in getCompositionData, scale each non-transition sequence's durationInFrames by 1/speed so the real timeline matches the content timeline. Transition sequences keep their fixed 20-frame slide timing (speed is a typing-animation concept, not a transition one).
  • Clamp the sample index to frames.length - 1 in the renderer as a safety net for rounding and for the un-scaled transition sequences.

Fixes #26.

Test plan

  • npm run lint — no new warnings
  • tsc --noEmit — clean
  • Manual preview at speed: 2 — video duration halves, full typing animation plays end-to-end, no blank second half
  • Manual preview at speed: 0.5 — duration doubles, typing held longer per content frame, smooth
  • Manual preview at speed: 1 — unchanged baseline

🤖 Generated with Claude Code

The speed setting scaled the frame-sampling index (frame * speed) but left
each sequence's durationInFrames unscaled, so at speed=2 the index ran
past the pre-rendered frames array halfway through each typing sequence,
rendering undefined (blank). Scale durationInFrames by 1/speed for
non-transition sequences so the real timeline matches the content
timeline, and clamp the sample index as a safety net. Transition
sequences keep their fixed 20-frame slide timing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@scastiel scastiel merged commit 8dca94c into main Apr 15, 2026
2 checks passed
@scastiel scastiel deleted the claude/distracted-chandrasekhar branch April 15, 2026 17:10
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.

Fix speed

1 participant