Skills2026年3月29日·1 分钟阅读

Remotion Rule: Timing

Remotion skill rule: Interpolation curves in Remotion - linear, easing, spring animations. Part of the official Remotion Agent Skill for programmatic video in React.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Remotion Rule: Timing
直接安装命令
npx -y tokrepo@latest install ee8f13ea-5f67-4a08-ae1d-3366b53e593f --target codex

先 dry-run 确认安装计划,再运行此命令。

TL;DR
Master Remotion timing with interpolation, easing curves, and spring animations.
§01

What it is

This Remotion skill rule covers interpolation and timing in Remotion videos. Remotion renders video frame-by-frame in React, and animations are driven by the current frame number rather than CSS transitions or requestAnimationFrame. You use the interpolate() function to map frame numbers to property values, with configurable easing curves and spring physics.

This rule is part of the official Remotion Agent Skill set. It provides the correct patterns for creating smooth motion, fade effects, and spring-based animations in programmatic video compositions.

§02

Why it saves time or tokens

Getting animation timing right in Remotion requires understanding how interpolate() maps frame ranges to output ranges. Without this skill rule, developers (and AI agents) often produce jerky animations because they use linear interpolation where easing is needed, or miscalculate frame boundaries. This rule provides the correct formulas and patterns upfront, reducing trial-and-error iterations.

§03

How to use

  1. Import interpolate and useCurrentFrame from the remotion package
  2. Map frame ranges to output values using interpolate(frame, inputRange, outputRange)
  3. Apply easing curves or spring physics for natural-feeling motion
§04

Example

import { useCurrentFrame, interpolate, spring, useVideoConfig } from 'remotion';
import { Easing } from 'remotion';

const MyAnimation = () => {
  const frame = useCurrentFrame();
  const { fps } = useVideoConfig();

  // Linear fade in over 30 frames
  const opacity = interpolate(frame, [0, 30], [0, 1], {
    extrapolateRight: 'clamp'
  });

  // Eased slide from left
  const translateX = interpolate(frame, [0, 45], [-100, 0], {
    easing: Easing.out(Easing.cubic),
    extrapolateRight: 'clamp'
  });

  // Spring animation
  const scale = spring({ frame, fps, config: { damping: 12 } });

  return (
    <div style={{ opacity, transform: `translateX(${translateX}px) scale(${scale})` }}>
      Animated content
    </div>
  );
};
FunctionUse Case
interpolateMap frames to any numeric value
springPhysics-based natural motion
Easing.inSlow start, fast end
Easing.outFast start, slow end
Easing.inOutSlow start and end
§05

Related on TokRepo

§06

Common pitfalls

  • Forgetting extrapolateRight: 'clamp' causes values to keep increasing past the intended range, producing unexpected animation behavior
  • Using interpolate without easing produces robotic linear motion; add Easing.out(Easing.cubic) for natural deceleration
  • Spring animations do not have a fixed duration; use measureSpring() to calculate how many frames a spring animation takes for accurate composition timing

常见问题

What is the difference between interpolate and spring?+

interpolate maps frame numbers to output values using mathematical easing curves. You define exact start and end frames. spring simulates physics-based motion with damping and stiffness parameters. Spring animations feel more natural but do not have a fixed end frame. Use interpolate for precise timing and spring for organic motion.

How do I clamp interpolation values?+

By default, interpolate extrapolates beyond the input range. Set extrapolateLeft and extrapolateRight to 'clamp' to prevent values from going outside the output range. For example, an opacity interpolation should always clamp to prevent values below 0 or above 1.

Can I chain multiple animations in sequence?+

Yes. Use different input ranges for each phase. For example, fade in on frames 0-30 and slide on frames 30-60. The Sequence component also helps by offsetting child component start frames, letting you compose animations declaratively.

How do I calculate spring animation duration?+

Use the measureSpring() function from Remotion. Pass the same spring config (damping, stiffness, mass) and fps, and it returns the number of frames the spring takes to settle. Use this value to set your Sequence or composition duration accurately.

What easing curves are available in Remotion?+

Remotion provides Easing.linear, Easing.ease, Easing.quad, Easing.cubic, Easing.sin, Easing.exp, Easing.circle, Easing.back, Easing.elastic, and Easing.bounce. Each can be wrapped with Easing.in, Easing.out, or Easing.inOut to control the acceleration pattern.

引用来源 (3)
🙏

来源与感谢

Created by Remotion. Licensed under MIT. remotion-dev/skills — Rule: timing

Part of the Remotion AI Skill collection on TokRepo.

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产