Skip to main content

npx remotion 组合

v2.6.12

根据入口点的路径打印组成 ID 列表。

🌐 Print list of composition IDs based on a path of an entry point.

npx remotion compositions <serve-url|entry-file>?

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

🌐 You may pass a Serve URL or an entry point as the first argument, otherwise the entry point will be determined.

标志

🌐 Flags

--props

Input Props to pass to the selected composition of your video. Must be a serialized JSON string (--props='{"hello": "world"}') or a path to a JSON file (./path/to/props.json).
note

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

--config

Specify a location for the Remotion config file.

--env-filev2.2.0

Specify a location for a dotenv file. Default .env.

--bundle-cache

Enable or disable Webpack caching. This flag is enabled by default, use --bundle-cache=false to disable caching.

--log

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

info

如果你不想每次都传递命令行标志,可以考虑创建一个 remotion.config.ts 配置文件

--port

Set a custom HTTP server port for the Studio or the render process. If not defined, Remotion will try to find a free port.

--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

🌐 Define how long it may take to resolve all delayRender() calls before the composition fetching times out in milliseconds. Default: 30000.

info

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

--ignore-certificate-errors

Results in invalid SSL certificates in Chrome, such as self-signed ones, being ignored.

--disable-web-security

This will most notably disable CORS in Chrome among other security features.

--disable-headless

Deprecated - will be removed in 5.0.0. With the migration to Chrome Headless Shell, this option is not functional anymore.

If disabled, the render will open an actual Chrome window where you can see the render happen. The default is headless mode.

--dark-modev4.0.381

Whether Chromium should pretend to be in dark mode by emulating the media feature 'prefers-color-scheme: dark'. Default is false.

--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.

--user-agentv3.3.83

Lets you set a custom user agent that the headless Chrome browser assumes.

--media-cache-size-in-bytesv4.0.352

Specify the maximum size of the cache that <Video> and <Audio> from @remotion/media may use combined, in bytes.
The default is half of the available system memory when the render starts.

--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

--offthreadvideo-video-threadsv4.0.261

The number of threads that<OffthreadVideo> can start to extract frames. The default is 2. Increase carefully, as too many threads may cause instability.

--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.

--chrome-modev4.0.248

One of headless-shell, chrome-for-testing. Default headless-shell. Use chrome-for-testing to take advantage of GPU drivers on Linux.

--quiet, --q

仅打印组成 ID,用空格分隔。

🌐 Only prints the composition IDs, separated by a space.

--ffmpeg-executable

在 v4.0 中移除

🌐 removed in v4.0

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

--ffprobe-executable

在 v4.0 中移除

🌐 removed in v4.0

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

另请参阅

🌐 See also