Skip to main content

npx remotion still

从 v2.3 版本开始可用。

基于入口点、组合 ID 渲染静帧,并将其保存到输出位置。

bash
npx remotion still <serve-url|entry-point>? [<composition-id>] [<output-location>]
bash
npx remotion still <serve-url|entry-point>? [<composition-id>] [<output-location>]

您可以将 Serve URL入口点 作为第一个参数传递,否则入口点将会被 确定

如果未传递 output-location,则静帧将被渲染到 out 文件夹中。
如果也未传递 composition-id,Remotion 将允许您选择一个组合。

标志

--props

传递给视频所选组合的输入属性。
必须是一个序列化的 JSON 字符串 (--props='{"hello": "world"}') 或一个指向 JSON 文件的路径 (./path/to/props.json)。
从根组件中,可以使用 getInputProps() 读取属性。
您可以使用 calculateMetadata() 转换输入属性。

note

在 Windows shell 上不支持内联 JSON 字符串,因为它会移除 " 字符,请改用文件名。

--image-format

jpegpngwebppdf。默认为 png

--config

指定 Remotion 配置文件的位置。

--env-file

指定 dotenv 文件的位置 - 默认为 .env了解 Remotion 中环境变量的工作原理。

--jpeg-quality v4.0.0

JPEG 渲染质量的取值范围为 0 到 100。设置 JPEG 渲染质量。在渲染 PNG 帧时不起作用。

--quality v1.4.0

在 v4.0.0 版本中更名为 --jpeg-quality

--output v4.0.0

设置输出文件路径,作为 output-location 位置参数的替代。

--overwrite

--browser-executable

浏览器可执行文件的路径。如果未指定,并且 Remotion 无法找到一个,它将在渲染过程中下载一个。

--scale

按照传入的因子缩放输出帧。 例如,一个 1280x720px 的帧将在缩放因子为 1.5 的情况下变为一个 1920x1080px 的帧。像字体和 HTML 标记这样的矢量元素将以更多细节进行渲染。scale 必须大于 0 且小于等于 16。默认值:1

--frame

应该渲染哪个帧。例如 --frame=10。默认值 0
从 v3.2.27 开始,允许使用负值,其中 -1 为最后一个帧。

--bundle-cache

启用或禁用 Webpack 缓存。此标志默认为启用,使用 --bundle-cache=false 来禁用缓存。

--log

设置日志级别。增加或减少输出量。可接受的值:errorwarninfo默认)、verbose

--port

设置用于提供 Webpack bundle 的自定义 HTTP 服务器端口。如果未定义,Remotion 将尝试找到一个空闲端口。

--public-dirv3.2.13

The path of the URL where the bundle is going to be hosted. By default it is /, meaning that the bundle is going to be hosted at the root of the domain (e.g. https://localhost:3000/). If you are deploying to a subdirectory (e.g. /sites/my-site/), you should set this to the subdirectory.

--timeout

定义单个帧在解析所有 delayRender() 调用之前可能花费的时间,以毫秒为单位。默认值:30000

info

不要与部署 Lambda 函数时的 --timeout 标志 混淆。

--ignore-certificate-errorsv2.6.5

导致 Chrome 忽略无效的 SSL 证书,如自签名证书。

--disable-web-securityv2.6.5

这将主要在 Chrome 中禁用 CORS 等安全功能。

--disable-headlessv2.6.5

--gl

在渲染期间打开一个实际的浏览器以观察渲染。

--user-agentv3.3.83

允许您设置一个自定义用户代理,供无头 Chrome 浏览器使用。

--offthreadvideo-cache-size-in-bytesv4.0.23

From v4.0, Remotion has a cache for <OffthreadVideo> frames. The default is null, corresponding to half of the system memory available when the render starts.
This option allows to override the size of the cache. The higher it is, the faster the render will be, but the more memory will be used.
The used value will be printed when running in verbose mode.
Default: null

--enable-multiprocess-on-linuxv4.0.42

Removes the --single-process flag that gets passed to Chromium on Linux by default. This will make the render faster because multiple processes can be used, but may cause issues with some Linux distributions or if window server libraries are missing.
Default: false until v4.0.136, then true from v4.0.137 on because newer Chrome versions don't allow rendering with the --single-process flag.
This flag will be removed in Remotion v5.0.

--binaries-directoryv4.0.120

The directory where the platform-specific binaries and libraries that Remotion needs are located. Those include an ffmpeg and ffprobe binary, a Rust binary for various tasks, and various shared libraries. If the value is set to null, which is the default, then the path of a platform-specific package located at node_modules/@remotion/compositor-* is selected.
This option is useful in environments where Remotion is not officially supported to run like bundled serverless functions or Electron.

--ffmpeg-executable

在 v4.0 中已移除

设置自定义 ffmpeg 可执行文件。如果未定义,将在 PATH 中搜索 ffmpeg 可执行文件。

--ffprobe-executable

在 v4.0 中已移除

设置自定义 ffprobe 可执行文件。如果未定义,将在 PATH 中搜索 ffprobe 可执行文件。