用途:使用 Remotion 框架,以 React 组件以编程方式定义并渲染视频内容,适用于程序化视频、批量生成、数据驱动视频、音乐可视化、自动字幕、3D 视频和教程讲解视频等场景。
主要能力:核心概念包括 Composition(定义尺寸、帧率、时长)、useCurrentFrame()(获取当前帧号驱动动画)、interpolate()(将帧号映射到位置、透明度等值)、spring()(物理动画)、Sequence(时间轴上排列组件)。支持添加视频、音频、图片(Video、Audio、Img、staticFile),参数化视频(zod schema + defaultProps),字幕(@remotion/captions、Whisper 转写),嵌入 Web 应用的 Player(@remotion/player),AWS Lambda 渲染(@remotion/lambda),以及通过 @remotion/three 结合 React Three Fiber 制作 3D 视频。
使用方式:用 npx create-video@latest 创建项目,npm run dev 启动 Remotion Studio 预览,npx remotion render MyVideo out/video.mp4 渲染输出,可选 --codec、--crf、--props、--scale、--concurrency 等参数;还支持 npx remotion still 输出单帧图片、--sequence 输出图片序列。3D 模板可用 npx create-video@latest --template three。音频解说提供两种方案:MiniMax TTS(云端,环境变量 MINIMAX_API_KEY、MINIMAX_VOICE_ID,脚本 scripts/generate_audio_minimax.py)和 Edge TTS(pip install edge-tts,脚本 scripts/generate_audio_edge.py),并用 audioConfig.ts 作为音画同步数据源,实现音频驱动场景切换。
适用场景与限制:适合教程讲解、数据可视化、3D 产品展示、Logo 动画、批量/数据驱动视频。需注意 WebGL 上下文溢出(可用 gl: "angle" 或懒加载缓解)、3D 相机不要用累积插值避免抖动、Sequence 内 useCurrentFrame() 返回相对帧号。资料宣称的 MiniMax 价格与音色等以官方为准;部分内容在原始资料中被截断,完整细节请查阅项目页面。