Merged
Conversation
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>
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.
Summary
speedmetadata setting scaled the frame-sampling index (frame * speed) but left each sequence'sdurationInFramesunscaled, so atspeed: 2the index ran past the pre-renderedframesarray halfway through each typing sequence, returningundefinedand rendering blank frames.getCompositionData, scale each non-transition sequence'sdurationInFramesby1/speedso 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).frames.length - 1in the renderer as a safety net for rounding and for the un-scaled transition sequences.Fixes #26.
Test plan
npm run lint— no new warningstsc --noEmit— cleanspeed: 2— video duration halves, full typing animation plays end-to-end, no blank second halfspeed: 0.5— duration doubles, typing held longer per content frame, smoothspeed: 1— unchanged baseline🤖 Generated with Claude Code