Loading...
Loading...
Compare original and translation side by side
| File | Purpose |
|---|---|
| useCurrentFrame, useVideoConfig, interpolate, spring, core hooks |
| Easing, spring config, interpolateColors, timing patterns |
| Composition, registerRoot, Folder, calculateMetadata |
| Img, Video, OffthreadVideo, Audio, staticFile, async loading |
| Google Fonts, local fonts, text measurement, typography |
| TailwindCSS integration, utility-first styling in Remotion |
| Audio component, volume curves, trimming, frame-synced audio |
| Caption system, SRT/VTT parsing, word-level timing |
| @remotion/three, ThreeCanvas, React Three Fiber integration |
| Bar, pie, line chart animation patterns |
| CLI render, renderMedia API, quality presets |
| Dataset rendering, batch generation, parametric compositions |
| Parametric tech explainer template |
| Product showcase template |
| Animated chart composition template |
| Bootstrap a new Remotion project with TailwindCSS |
| Render wrapper with quality presets and format options |
| 文件路径 | 用途 |
|---|---|
| useCurrentFrame、useVideoConfig、interpolate、spring等核心钩子函数 |
| 缓动效果、弹簧配置、颜色插值、时序模式 |
| Composition、registerRoot、Folder、calculateMetadata相关用法 |
| Img、Video、OffthreadVideo、Audio、staticFile、异步加载 |
| Google Fonts、本地字体、文本测量、排版 |
| TailwindCSS集成、Remotion中的实用优先样式设计 |
| Audio组件、音量曲线、音频裁剪、帧同步音频 |
| 字幕系统、SRT/VTT解析、逐词时序控制 |
| @remotion/three、ThreeCanvas、React Three Fiber集成 |
| 柱状图、饼图、折线图的动画实现模式 |
| CLI渲染、renderMedia API、画质预设 |
| 数据集渲染、批量生成、参数化合成 |
| 参数化技术解说视频模板 |
| 产品展示视频模板 |
| 动画图表合成模板 |
| 快速搭建集成TailwindCSS的Remotion项目 |
| 带画质预设和格式选项的渲染包装脚本 |
spring().tsxspring().tsxScaffold → Compose → Preview → Iterate → Rendernpm run devscripts/render.sh项目搭建 → 组件合成 → 预览 → 迭代优化 → 渲染输出npm run devscripts/render.shnode --version # Must be >= 18.0.0
npm --versionnode --version # 版本需 >= 18.0.0
npm --versionscripts/scaffold_project.shbash scripts/scaffold_project.sh my-video-project
cd my-video-project
npm run dev # Opens Remotion Studio at localhost:3000scripts/scaffold_project.shbash scripts/scaffold_project.sh my-video-project
cd my-video-project
npm run dev # 在localhost:3000打开Remotion Studio| Content type | Rule file | Template |
|---|---|---|
| Explainer / educational | fundamentals.md | explainer.tsx |
| Product demo / marketing | animations.md | product-demo.tsx |
| Data visualization / animated chart | charts.md | data-viz.tsx |
| Video with voiceover / narration | audio.md + subtitles.md | explainer.tsx |
| Social media clip (short, looping) | animations.md | product-demo.tsx |
| 3D scene / abstract motion graphics | three-d.md | (custom) |
| Personalized / batch generation | data-driven.md | any |
| Video with embedded media | media.md | any |
| 内容类型 | 规则文件 | 模板文件 |
|---|---|---|
| 解说/教育类视频 | fundamentals.md | explainer.tsx |
| 产品演示/营销视频 | animations.md | product-demo.tsx |
| 数据可视化/动画图表 | charts.md | data-viz.tsx |
| 带旁白/配音的视频 | audio.md + subtitles.md | explainer.tsx |
| 社交媒体短视频(短时长、循环播放) | animations.md | product-demo.tsx |
| 3D场景/抽象动态图形 | three-d.md | (自定义) |
| 个性化/批量生成视频 | data-driven.md | 任意模板 |
| 嵌入媒体的视频 | media.md | 任意模板 |
registerRoot<Sequence from={30} durationInFrames={60}><AbsoluteFill>useCurrentFrame()Date.now()setTimeoutspring({ frame, fps })registerRoot<Sequence from={30} durationInFrames={60}><AbsoluteFill>useCurrentFrame()Date.now()setTimeoutspring({ frame, fps })import {
useCurrentFrame,
useVideoConfig,
interpolate,
spring,
AbsoluteFill,
Sequence,
} from "remotion";
type MySceneProps = {
title: string;
accentColor: string;
};
export const MyScene: React.FC<MySceneProps> = ({ title, accentColor }) => {
const frame = useCurrentFrame();
const { fps, durationInFrames } = useVideoConfig();
const opacity = interpolate(frame, [0, 30], [0, 1], {
extrapolateRight: "clamp",
});
const scale = spring({ frame, fps, config: { damping: 12, stiffness: 100 } });
return (
<AbsoluteFill style={{ backgroundColor: "#0a0a0a" }}>
<div
style={{ opacity, transform: `scale(${scale})`, color: accentColor }}
>
{title}
</div>
</AbsoluteFill>
);
};import {
useCurrentFrame,
useVideoConfig,
interpolate,
spring,
AbsoluteFill,
Sequence,
} from "remotion";
type MySceneProps = {
title: string;
accentColor: string;
};
export const MyScene: React.FC<MySceneProps> = ({ title, accentColor }) => {
const frame = useCurrentFrame();
const { fps, durationInFrames } = useVideoConfig();
const opacity = interpolate(frame, [0, 30], [0, 1], {
extrapolateRight: "clamp",
});
const scale = spring({ frame, fps, config: { damping: 12, stiffness: 100 } });
return (
<AbsoluteFill style={{ backgroundColor: "#0a0a0a" }}>
<div
style={{ opacity, transform: `scale(${scale})`, color: accentColor }}
>
{title}
</div>
</AbsoluteFill>
);
};npm run devhttp://localhost:3000<Still>npm run devhttp://localhost:3000<Still>| Request | Action |
|---|---|
| "Slower/faster" | Adjust |
| "Different color" | Update props passed to composition |
| "Add a section" | Add new |
| "Change font" | Load via |
| "Add background music" | Add |
| "Make it loop" | Set |
| "Add captions" | See subtitles.md for SRT parsing and word-level timing |
| 用户需求 | 操作方案 |
|---|---|
| "变慢/变快" | 调整 |
| "更换颜色" | 更新传递给合成组件的Props |
| "添加一个章节" | 新增 |
| "更换字体" | 通过 |
| "添加背景音乐" | 在根合成组件中添加 |
| "设置循环播放" | 设置 |
| "添加字幕" | 参考subtitles.md中的SRT解析和逐词时序控制方法 |
scripts/render.shbash scripts/render.sh --composition MyComposition --quality final --format mp4scripts/render.shbash scripts/render.sh --composition MyComposition --quality final --format mp4| Preset | Resolution | FPS | Use case |
|---|---|---|---|
| 480p | 15 | Fast layout check |
| 720p | 30 | Client draft review |
| 1080p | 30 | Standard delivery |
| 2160p | 60 | Presentation / cinema |
| 预设值 | 分辨率 | 帧率 | 适用场景 |
|---|---|---|---|
| 480p | 15 | 快速布局检查 |
| 720p | 30 | 客户初稿审核 |
| 1080p | 30 | 标准交付版本 |
| 2160p | 60 | 演示/影院级交付 |
| Format | Use case |
|---|---|
| Standard delivery (H.264) |
| Web-optimized |
| Embeddable in docs, social media |
| 格式 | 适用场景 |
|---|---|
| 标准交付格式(H.264编码) |
| 网页优化格式 |
| 可嵌入文档、社交媒体的动图格式 |
| Error | Cause | Resolution |
|---|---|---|
| Node.js not installed | Install Node.js 18+ from nodejs.org |
| Dependencies not installed | Run |
| Wrong composition ID | Check |
| Async asset load > 30s | Increase timeout via |
| Video codec not supported | Convert to H.264 MP4 with ffmpeg first |
| Out of memory on large compositions | Reduce |
| Another dev server running | Kill existing process or set |
| Spring animation goes past 1.0 | Missing | Add extrapolation clamp to |
| Fonts not loading in render | Font not loaded before render starts | Use |
| 错误信息 | 原因 | 解决方案 |
|---|---|---|
| 未安装Node.js | 从nodejs.org安装Node.js 18+版本 |
| 未安装依赖包 | 在项目目录中运行 |
| 合成组件ID错误 | 检查 |
| 异步资源加载超时(超过30秒) | 通过 |
| 视频编码不支持 | 先用ffmpeg转换为H.264编码的MP4格式 |
| 大型合成组件导致内存不足 | 降低 |
| 已有开发服务器在运行 | 终止现有进程或设置 |
| Spring animation goes past 1.0 | 缺少 | 在 |
| Fonts not loading in render | 渲染前未加载字体 | 使用 |
npx remotion render@remotion/lambdanpx remotion render@remotion/lambda<Sequence>spring()interpolatez.infer<typeof schema><Sequence>spring()interpolatez.infer<typeof schema>concept-to-videoconcept-to-video