remotion
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRemotion
Remotion
Overview
概述
Remotion enables programmatic video creation using React components. Compositions define renderable videos with explicit width, height, fps, and duration. All animations must be driven by -- CSS animations and Tailwind animation classes are forbidden as they cause rendering artifacts. Use this skill for Remotion compositions, animations, audio, captions, transitions, media handling, or rendering. Not intended for general React UI development.
useCurrentFrame()Remotion允许使用React组件进行程序化视频创作。Composition用于定义可渲染的视频,包含明确的宽度、高度、帧率(fps)和时长。所有动画必须由驱动——禁止使用CSS动画和Tailwind动画类,因为它们会导致渲染异常。本指南适用于Remotion合成、动画、音频、字幕、转场、媒体处理或渲染场景,不适用于通用React UI开发。
useCurrentFrame()Quick Reference
快速参考
| Pattern | API / Approach | Key Points |
|---|---|---|
| Basic animation | | Always clamp with |
| Spring animation | | |
| Composition | | Always set explicit dimensions |
| Dynamic metadata | | Set duration, dimensions, props before render |
| Sequencing | | |
| Series | | Sequential playback; negative offset for overlaps |
| Transitions | | Total duration = sum of scenes minus transition durations |
| Audio/Video | | Use |
| Captions | | Token-level word highlighting via |
| Images | | Never use native |
| GIFs | | Synced with timeline; |
| Fonts | | Call |
| 3D content | | Must set |
| Text measurement | | Load fonts first; match properties for measurement and render |
| Parameters | Zod schema on | Top-level must be |
| Transparent video | | WebM for browser; ProRes 4444 for editing software |
| Maps | Mapbox with | Set |
| 模式 | API/实现方式 | 关键要点 |
|---|---|---|
| 基础动画 | | 始终使用 |
| 弹簧动画 | | 使用 |
| 合成组件 | | 始终设置明确的尺寸参数 |
| 动态元数据 | 在 | 渲染前设置时长、尺寸和属性 |
| 序列编排 | | |
| 系列播放 | | 顺序播放;使用负偏移实现重叠播放 |
| 转场效果 | | 总时长 = 所有场景时长之和减去转场时长 |
| 音频/视频 | 来自 | 使用 |
| 字幕 | | 通过 |
| 图片 | 来自 | 切勿使用原生 |
| GIF动图 | 来自 | 与时间轴同步;通过 |
| 字体 | | 在顶层调用 |
| 3D内容 | 来自 | 必须设置 |
| 文本测量 | 来自 | 先加载字体;测量与渲染时的属性需保持一致 |
| 参数配置 | 在 | 顶层必须为 |
| 透明视频 | | 浏览器使用WebM格式;编辑软件使用ProRes 4444格式 |
| 地图 | 搭配 | 设置 |
Common Mistakes
常见错误
| Mistake | Correct Pattern |
|---|---|
Using CSS animations or | Use |
Using native | Use |
| Hardcoding video duration | Use |
| Not specifying width/height on compositions | Always define explicit dimensions to avoid rendering issues |
Using | Use |
Forgetting | Always premount sequences to preload components before playback |
Not clamping | Set |
Placing | Set |
| 错误内容 | 正确做法 |
|---|---|
使用CSS动画或 | 使用 |
使用原生 | 使用Remotion提供的 |
| 硬编码视频时长 | 使用 |
| 未为合成组件指定宽高 | 始终定义明确的尺寸参数以避免渲染问题 |
使用React Three Fiber的 | 在 |
序列组件未设置 | 始终预挂载序列组件,确保播放前完成组件预加载 |
未限制 | 设置 |
在 | 在 |
Delegation
任务分工
- Discover available Remotion components and their props: Use agent to search the codebase for composition definitions and asset usage
Explore - Build a multi-scene video with transitions and audio: Use agent to compose sequences, transitions, and audio tracks step by step
Task - Plan a video generation pipeline with dynamic data: Use agent to design the architecture for parametrized compositions and rendering workflow
Plan
- 查找可用的Remotion组件及其属性:使用工具搜索代码库中的合成定义和资源使用情况
Explore - 构建包含转场和音频的多场景视频:使用工具逐步编排序列、转场和音轨
Task - 规划基于动态数据的视频生成流程:使用工具设计参数化合成和渲染工作流的架构
Plan
References
参考资料
- Animations and Timing -- Interpolation, springs, easing, and frame-driven animation patterns
- Compositions and Sequencing -- Defining compositions, stills, folders, sequences, series, and trimming
- Media and Assets -- Audio, video, images, GIFs, fonts, and static file handling
- Captions and Text -- Transcription, SRT import, TikTok-style captions, and text animations
- Transitions -- Scene transitions with fade, slide, wipe, flip, and duration calculation
- Advanced Features -- 3D content, charts, maps, parameters, transparent video, and DOM measurement
- 动画与时序 —— 插值、弹簧动画、缓动效果以及基于帧的动画模式
- 合成与序列编排 —— 合成定义、静态帧、文件夹、序列、系列播放和剪辑操作
- 媒体与资源 —— 音频、视频、图片、GIF、字体和静态文件处理
- 字幕与文本 —— 转录、SRT导入、TikTok风格字幕和文本动画
- 转场效果 —— 淡入淡出、滑动、擦除、翻转等场景转场及时长计算
- 高级功能 —— 3D内容、图表、地图、参数配置、透明视频和DOM测量