Skip to content

Two doc bugs in remotion trim rules: frames-vs-seconds label; non-destructured useVideoConfig yields NaN #19

Description

@alexey-pelykh

Two small documentation bugs in the remotion skill rules, both on current main, each with a one-line fix.

1. skills/remotion/rules/videos.mdtrimBefore/trimAfter are frames, not seconds

The prose states:

Use trimBefore and trimAfter to remove portions of the video. Values are in seconds.

But the example just below uses frames, converting seconds via * fps:

trimBefore={2 * fps}   // Skip the first 2 seconds
trimAfter={10 * fps}   // End at the 10 second mark

trimBefore/trimAfter take frames — the * fps conversion is only necessary because the props are frame-based. As written, a reader who trusts "Values are in seconds" and passes trimBefore={2} gets 2 frames (~0.07 s at 30 fps), not 2 seconds.

Fix: "Values are in seconds." → "Values are in frames."

2. skills/remotion/rules/trimming.mduseVideoConfig() not destructured → NaN

const fps = useVideoConfig();

useVideoConfig() returns an object ({ fps, width, height, durationInFrames, … }), so fps here is the whole object. The subsequent arithmetic evaluates to NaN:

<Sequence from={-0.5 * fps}>              // -0.5 * {object} === NaN → from={NaN}
<Sequence durationInFrames={1.5 * fps}>   // also NaN

Fix: destructure — const { fps } = useVideoConfig();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions