跳到正文
子在川上曰
返回

Remotion 静帧渲染指南:生成缩略图与单帧图

编辑此页

Remotion 不只做视频,也很适合生成视频缩略图或动态单帧图片。想快速上手可以直接用官方的 Still 模板。

本文翻译并整理自 Remotion 官方文档的 Still images,按官方文档核对(更新至 2026 年 11 月)。

目录

展开目录

一、定义静帧

用 <Still /> 组件替代 <Composition /> 来定义一张静帧。时间轴会消失,你也不用再指定时长和 FPS。

二、浏览器里预览

用 @remotion/player 的 <Thumbnail> 组件,就能在普通 React 应用(Next.js、Vite、Create React App 等)里预览静帧图片。适合想在 Web 应用里先展示、再渲染的场景。

三、CLI 渲染

用 npx remotion still 命令渲染静帧。示例:

npx remotion still --props='{"custom": "data"}' my-comp out.png
  • 用 --image-format 指定输出格式,默认 png,其它可选 jpeg、webp、pdf。
  • 默认渲染第 0 帧,用 --frame 控制渲染哪一帧。

四、Node.js 渲染

用 renderStill() Node.js API 编程式渲染静帧。

五、浏览器渲染

用 renderStillOnWeb() 浏览器 API 编程式渲染静帧。

六、Remotion Lambda 渲染

用 Remotion Lambda 渲染静帧:

七、Cloud Run 渲染

用 Cloud Run 渲染静帧:

八、渲染方式速览

方式入口说明
本地 CLInpx remotion still单命令渲染,最直接
Node.jsrenderStill()服务端编程式渲染
浏览器renderStillOnWeb()浏览器端编程式渲染
LambdarenderStillOnLambda() / npx remotion lambda stillAWS 云端渲染
Cloud RunrenderStillOnCloudRun() / npx remotion cloudrun stillGCP Cloud Run 渲染

九、几点提醒

  • 定义用 <Still />:比 <Composition /> 少一堆视频参数(duration/fps),语义也更清晰。
  • 默认输出 png:要 webp(体积更小)或 pdf(矢量)就加 --image-format。
  • 指定帧:默认渲染第 0 帧,要别的帧用 --frame。
  • 缩略图场景:<Thumbnail> 组件可以在正式渲染前先在网页里预览。

参考资料


编辑此页