npx remotion render
根据入口点、合成 ID 渲染视频或音频,并将其保存到输出位置。
bash
npx remotion render <entry-point|serve-url>? <composition-id> <output-location>
bash
npx remotion render <entry-point|serve-url>? <composition-id> <output-location>
您可以将 Serve URL 或 入口点 作为第一个参数传递,否则入口点将会被 确定。
如果未传递 composition-id
,Remotion 将要求您选择一个合成。
如果未传递 output-location
,媒体将被渲染到 out
文件夹中。
标志
除了使用命令行参数选择视频和输出位置外,还支持以下标志:
--props
传递给视频所选合成的输入属性。
必须是一个序列化的 JSON 字符串 (--props='{"hello": "world"}'
) 或一个指向 JSON 文件的路径 (./path/to/props.json
)。
从根组件中,可以使用 getInputProps()
读取属性。
您可以使用 calculateMetadata()
转换输入属性。
在 Windows shell 上不支持内联 JSON 字符串,因为它会移除 "
字符,请改用文件名。
--height
v3.2.40
--width
v3.2.40
--concurrency
使用多少 CPU 线程。 最小为 1。最大值为您拥有的线程数量(在 Node.JS 中为 os.cpus().length
)。您还可以提供一个百分比值(例如 50%)。
--pixel-format
--image-format
v1.4.0
jpeg
或 png
- JPEG 更快,但不支持透明度。 默认图像格式自 v1.1 起为 jpeg
。
--config
v1.2.0
指定 Remotion 配置文件的位置。
--env-file
v2.2.0
指定 dotenv 文件的位置。默认为 .env
。
--jpeg-quality
v4.0.0
JPEG 渲染质量介于 0 和 100 之间。在渲染 PNG 帧时不起作用。
--quality
v1.4.0
--quality
在 v4.0.0 中更名为 --jpeg-quality
。
--output
v4.0.0
设置输出文件路径,作为 output-location
位置参数的替代。
--overwrite
即使文件已存在也写入输出。 默认情况下启用此标志,使用 --overwrite=false
来禁用它。
--sequence
v1.4.0
--codec
v1.4.0
h264
或 h265
或 png
或 vp8
或 vp9
或 mp3
或 aac
或 wav
或 prores
或 h264-mkv
。如果不提供 --codec
,将使用 H.264 编码器。
--audio-codec
v3.3.42
Set the format of the audio that is embedded in the video. Not all codec and audio codec combinations are supported and certain combinations require a certain file extension and container format. See the table in the docs to see possible combinations.
--audio-bitrate
v3.2.32
Specify the target bitrate for the generated video. The syntax for FFmpeg's -b:a
parameter should be used. FFmpeg may encode the video in a way that will not result in the exact audio bitrate specified. Example values: 512K
for 512 kbps, 1M
for 1 Mbps. Default: 320k
--video-bitrate
v3.2.32
Specify the target bitrate for the generated video. The syntax for FFmpeg's-b:v
parameter should be used. FFmpeg may encode the video in a way that will not result in the exact video bitrate specified. Example values: 512K
for 512 kbps, 1M
for 1 Mbps.
--buffer-size
v4.0.78
The value for the -bufsize
flag of FFmpeg. Should be used in conjunction with the encoding max rate flag.
--max-rate
v4.0.78
The value for the -maxrate
flag of FFmpeg. Should be used in conjunction with the encoding buffer size flag.
--prores-profile
v2.1.6
设置 ProRes 档案。仅当 codec
设置为 prores
时才有效。可能的值:4444-xq
、4444
、hq
、standard
、light
、proxy
。有关可能值的解释,请参见此处。默认值:hq
。
--x264-preset
v4.2.2
Sets a x264 preset profile. Only applies to videos rendered with h264
codec.Possible values:
superfast
, veryfast
, faster
, fast
, medium
, slow
, slower
, veryslow
, placebo
.Default:
medium
--crf
v1.4.0
设置输出的 Constant Rate Factor (CRF)。最小为 0。如果希望保持最佳质量并较少关心文件大小,请使用此速率控制模式。如果设置了 --video-bitrate
,则无法设置此选项。
--browser-executable
v1.5.0
Chrome可执行文件的路径。如果未指定并且Remotion找不到可执行文件,则在渲染过程中将下载一个。
--scale
按照传入的因子缩放输出帧。 例如,一个 1280x720px 的帧将以 1.5
的缩放因子变为 1920x1080px 的帧。像字体和 HTML 标记这样的矢量元素将以更多细节呈现。scale
必须大于 0 且小于等于 16。默认值:1
。
--frames
v2.0.0
渲染视频的子集。例如:--frames=0-9
选择前 10 帧。要渲染静帧,请使用 still
命令。
--every-nth-frame
v3.1.0
仅渲染每第 n 帧。 此选项仅在渲染 GIF 时可设置。这允许您降低 GIF 的帧速率。
例如,仅每隔一帧、每隔三帧等。仅适用于渲染 GIF。更多详情请参见此处。
--muted
v3.2.1
禁用音频输出。 此选项仅在渲染视频时可用。
--enforce-audio-track
v3.2.1
--number-of-gif-loops
v3.1.0
Allows you to set the number of loops as follows:null
(or omitting in the CLI) plays the GIF indefinitely.0
disables looping1
loops the GIF once (plays twice in total)2
loops the GIF twice (plays three times in total) and so on.
--bundle-cache
v2.0.0
启用或禁用 Webpack 缓存。此标志默认启用,使用 --bundle-cache=false
禁用缓存。
--log
设置日志级别。增加或减少输出量。可接受的值:error
、warn
、info
(默认)、verbose
--port
设置用于托管 Webpack bundle 的自定义 HTTP 服务器端口。如果未定义,Remotion 将尝试找到一个空闲端口。
--public-dir
v3.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
。
不要与部署 Lambda 函数时的 --timeout
标志 混淆。
--ignore-certificate-errors
v2.6.5
导致 Chrome 忽略无效的 SSL 证书,如自签名证书。
--disable-web-security
v2.6.5
这将主要在 Chrome 中禁用 CORS 和其他安全功能。
--disable-headless
v2.6.5
在渲染过程中打开一个实际 的浏览器以观察渲染。
--gl
Changelog
- From Remotion v2.6.7 until v3.0.7, the default for Remotion Lambda was
swiftshader
, but from v3.0.8 the default isswangle
(Swiftshader on Angle) since Chrome 101 added support for it. - From Remotion v2.4.3 until v2.6.6, the default was
angle
, however it turns out to have a small memory leak that could crash long Remotion renders.
Select the OpenGL renderer backend for Chromium.
Accepted values:
"angle"
"egl"
"swiftshader"
"swangle"
"vulkan"
(from Remotion v4.0.41)"angle-egl"
(from Remotion v4.0.51)
The default is null
, letting Chrome decide, except on Lambda where the default is "swangle"
--user-agent
v3.3.83
允许您设置 headless Chrome 浏览器所假定的自定义用户代理。
--offthreadvideo-cache-size-in-bytes
v4.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
--color-space
v4.0.28
Color space to use for the video. Acceptable values: "default"
(default since 5.0), "bt709"
(since v4.0.28), "bt2020-ncl"
(since v4.0.88), "bt2020-cl"
(since v4.0.88), .For best color accuracy, it is recommended to also use
"png"
as the image format to have accurate color transformations throughout.Only since v4.0.83, colorspace conversion is actually performed, previously it would only tag the metadata of the video.
--enable-multiprocess-on-linux
v4.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.
--repro
v4.0.88
Create a ZIP that you can submit to Remotion if asked for a reproduction.
--binaries-directory
v4.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.
--for-seamless-aac-concatenation
v4.0.123
If enabled, the audio is trimmed to the nearest AAC frame, which is required for seamless concatenation of AAC files. This is a requirement if you later want to combine multiple video snippets seamlessly.This option is used internally. There is currently no documentation yet for to concatenate the audio chunks.
--separate-audio-to
v4.0.123
If set, the audio will not be included in the main output but rendered as a separate file at the location you pass. It is recommended to use an absolute path. If a relative path is passed, it is relative to the Remotion Root.
--ffmpeg-executable
--ffmpeg-executable
在 v4.0 中已移除
设置自定义 ffmpeg
可执行文件。如果未定义,将在 PATH
中搜索 ffmpeg
可执行文件。
--ffprobe-executable
v3.0.17
--ffprobe-executable
在 v4.0 中已移除
设置自定义 ffprobe
可执行文件。如果未定义,将在 PATH
中搜索 ffprobe
可执行文件。
I'm ready to translate the Markdown content into Chinese. Please go ahead and paste the content for translation.