Skip to content

Sequence: useVideoConfig().durationInFrames is the Sequence's length, as in Remotion (#126) - #128

Closed
Ragulsundaram wants to merge 1 commit into
shinyobjectz:mainfrom
Ragulsundaram:fix-sequence-video-config
Closed

Ragulsundaram wants to merge 1 commit into
shinyobjectz:mainfrom
Ragulsundaram:fix-sequence-video-config

Conversation

@Ragulsundaram

Copy link
Copy Markdown
Contributor

Fixes #126.

Inside a <Sequence>, useVideoConfig().durationInFrames now gives the Sequence's length instead of the composition's, as Remotion's public docs for useVideoConfig describe ("the end of the sequence in its local frame space"). Components that scale an animation to their scene, like interpolate(frame, [0, durationInFrames], ...), then run over the scene, as they do in Remotion.

  • Spec first: sdk/raea/spec/motion.feature ("A composition is a component rendered once per frame") now says a Sequence reports its length: its own durationInFrames, cut short where its parent's ends (unbounded means what's left of the parent's); a Loop's children get one pass; a Freeze keeps its parent's.
  • Code: LocalTime carries a duration (the composition's at the root); Sequence, Loop and Freeze set it; useVideoConfig reads it as it already reads width and height. The kept-object checks include it, so a Sequence's time is still the same object frame to frame.
  • Test: sdk/raea/conformance/timeline.test.tsx "inside a Sequence, durationInFrames is the Sequence's" (own length, unbounded, cut by the composition's end, nested, Loop, Freeze). It fails without the change and passes with it. The rest of bun test conformance is unchanged (the same 5 failures as on main, in material, mesh2d, hair, items and routes), and tsc -p raea/tsconfig.check.json has no new errors.

On the clean-room process: before writing this I had looked at how Remotion computes the value to confirm the behaviour. The change follows the public docs and the spec text above, but if that matters for how raea is built, please treat this PR as a proposal and re-implement it from the spec line.

…hinyobjectz#126)

Inside a Sequence, durationInFrames now reports the Sequence's own length, cut short where its parent's ends (unbounded: what's left of the parent's), as Remotion's docs describe; a Loop's children get one pass, a Freeze keeps its parent's. Spec line first (motion.feature), then LocalTime carries a duration that Sequence, Loop and Freeze set and useVideoConfig reads. Conformance: timeline.test.tsx covers own, unbounded, cut, nested, Loop and Freeze.
shinyobjectz pushed a commit that referenced this pull request Nov 13, 2026
…uence's length (its own, cut short where its parent's ends; a Loop's children get one pass), as Remotion's public docs for useVideoConfig say, and its conformance test (#126, from #128)
shinyobjectz added a commit that referenced this pull request Nov 13, 2026
…s length (#126): a subtree's LocalTime carries its length, the composition's at the root, a Sequence's own cut where its parent's ends (unbounded, what's left of its parent's), a Loop's one pass, and a Freeze keeps its parent's; useVideoConfig reports it as it reports a Sequence's width and height, and a Sequence's time is still the same object frame to frame. Written from the spec line and its conformance test (#128): conformance 615 pass, the same five failing as on main
@shinyobjectz

Copy link
Copy Markdown
Owner

Thank you, this was a real gap, and the repro made it easy to see. As you suggested, it's in via #132: your spec line and conformance test went in as written, under your name (e3dfcb9), and the code was written from the spec alone, because raea's SDK is built from the spec and the conformance suite only. Inside a Sequence, useVideoConfig().durationInFrames is now the Sequence's length (its own, cut where its parent's ends; a Loop's one pass; a Freeze keeps its parent's). It ships in 0.1.3.

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.

useVideoConfig().durationInFrames inside a <Sequence> is the composition's length; Remotion gives the Sequence's

2 participants