Skip to main content

npx remotion lambda still

使用 npx remotion lambda still 命令,你可以在云端渲染静态帧。

🌐 Using the npx remotion lambda still command, you can render a still frame in the cloud.

该命令具有以下结构:

🌐 The command has the following structure:

npx remotion lambda still <serve-url>? [<composition-id>] [<output-location>]
  • 使用 sites create 命令或通过调用 deploySite() 获取 Serve URL
  • 【作品 ID】(/docs/terminology/composition#composition-id)。如果未指定,将会获取作品列表,你可以选择一个作品。
  • output-location 参数是可选的。如果你不指定它,仍然会将其存储在你的 S3 存储桶中。如果你指定了位置,它会在额外的步骤中下载到你的设备上。

示例命令

🌐 Example commands

渲染一帧画面:

🌐 Rendering a still:

npx remotion lambda still https://remotionlambda-abcdef.s3.eu-central-1.amazonaws.com/sites/testbed/index.html my-comp

使用服务 URL 简写进行渲染:

🌐 Rendering using the serve URL shorthand:

npx remotion lambda still testbed my-comp
info

如果你使用简化的 serve URL,你必须传递一个 composition ID。只有在传递完整的 serve URL 时,才能获取可用的 compositions。

渲染合成的第10帧:

🌐 Rendering the 10th frame of a composition:

npx remotion lambda still --frame=10 testbed my-comp

将结果下载到 out.png 文件:

🌐 Downloading the result to a out.png file:

npx remotion lambda still testbed my-comp out.png

标志

🌐 Flags

--frame

Which frame should be rendered when rendering a still. Default 0. From v3.2.27, negative values are allowed, with -1 being the last frame.

--region

要选择的 AWS 区域。项目和函数都应在此区域内。

🌐 The AWS region to select. Both project and function should be in this region.

--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 字符串,因为它会移除 " 字符,请改用文件名。

--scale

按你传入的因子缩放输出帧。 例如,一个 1280x720 像素的帧在缩放因子为 1.5 时将变为 1920x1080 像素。矢量元素如字体和 HTML 标记将以更多细节呈现。

--log

在 Lambda 函数内部使用的日志级别。此外,如果你将其设置为 verbose,将会打印一个指向 CloudWatch 的链接,你可以在其中查看日志。

🌐 Log level to be used inside the Lambda function. Also, if you set it to verbose, a link to CloudWatch will be printed where you can inspect logs.

--privacy

定义输出媒体是否对所有人可访问。可以是 publicprivate,默认 public

🌐 Defines if the output media is accessible for everyone or not. Either public or private, default public.

--max-retries

如果单个块渲染失败,将重试多少次。默认 1

🌐 How many times a single chunk is being retried if it fails to render. Default 1.

--out-name

存储在 S3 桶中的媒体输出文件名。默认情况下,它是 out 加上相应的文件扩展名,例如:out.png。必须与 /([0-9a-zA-Z-!_.*'()/]+)/g 匹配。

🌐 The file name of the media output as stored in the S3 bucket. By default, it is out plus the appropriate file extension, for example: out.png. Must match /([0-9a-zA-Z-!_.*'()/]+)/g.

--image-format

The image format to use when rendering a still. Must be one of "png", "jpeg", "pdf", "webp". Default: "png".

--jpeg-quality

JPEG 渲染质量的值,范围在 0 到 100 之间。在渲染非 JPEG 图片格式时不起作用。

--quality

v4.0.0 中重命名为 jpegQuality

🌐 Renamed to jpegQuality in v4.0.0.

--ignore-certificate-errors

导致 Chrome 中的无效 SSL 证书(例如自签名证书)被忽略。

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

--disable-web-security

这将最显著地禁用 Chrome 中的 CORS 以及其他安全功能。

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

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

--user-agentv3.3.83

允许你设置 headless Chrome 浏览器使用的自定义用户代理。

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

--delete-afterv4.0.32

Automatically delete the render after a certain period. Accepted values are 1-day, 3-days, 7-days and 30-days.
For this to work, your bucket needs to have lifecycles enabled.

--force-path-stylev4.0.202

forcePathStyle 传递给 AWS S3 客户端。如果你不知道这是什么,你很可能用不到它。

🌐 Passes forcePathStyle to the AWS S3 client. If you don't know what this is, you probably don't need it.

--storage-classv4.0.305

用于渲染媒体的 S3 存储类的 标识符。默认值:undefined(即 STANDARD)。

🌐 An identifier for the S3 storage class of the rendered media. Default: undefined (which is STANDARD).

--license-keyv4.0.409

License key for sending a usage event using @remotion/licensing.

--api-keyv4.0.253

在 v4.0.409 中已弃用

🌐 deprecated in v4.0.409

API key for sending a usage event using @remotion/licensing.