Back to Remotion

renderStillOnVercel()

packages/docs/docs/vercel/render-still-on-vercel.mdx

4.0.4742.8 KB
Original Source

renderStillOnVercel()<AvailableFrom v="4.0.426" />

:::warning Experimental package: We reserve the right to make breaking changes in order to correct bad design decisions until this notice is gone. :::

Renders a still image inside a Vercel Sandbox.

The rendered file stays inside the sandbox. Use uploadToVercelBlob() to upload it to Vercel Blob.

Example

ts
// @module: es2022
// @target: es2022
import {renderStillOnVercel, addBundleToSandbox, createSandbox} from '@remotion/vercel';
const sandbox = await createSandbox();
// ---cut---
const {sandboxFilePath} = await renderStillOnVercel({
  sandbox,
  compositionId: 'MyComp',
  inputProps: {title: 'Hello World'},
  imageFormat: 'png',
});

Arguments

An object with the following properties:

sandbox

A Sandbox instance.

compositionId

The ID of the Remotion composition to render.

inputProps

Props to pass to the composition.

imageFormat?

<Options id="still-image-format" />

outputFile?

The output file path inside the sandbox. Default: "/tmp/still.png".

frame?

<Options id="frame" />

jpegQuality?

<Options id="jpeg-quality" />

envVariables?

An object containing key-value pairs of environment variables which will be injected into your Remotion project and which can be accessed by reading the global process.env object. Default: {}.

chromiumOptions?

Allows you to set certain Chromium / Google Chrome flags. See: Chromium flags.

scale?

<Options id="scale" />

logLevel?

<Options id="log" />

timeoutInMilliseconds?

<Options id="timeout" />

offthreadVideoCacheSizeInBytes?

<Options id="offthreadvideo-cache-size-in-bytes" />

mediaCacheSizeInBytes?

<Options id="media-cache-size-in-bytes" />

offthreadVideoThreads?

<Options id="offthreadvideo-video-threads" />

licenseKey?

<Options id="license-key" />

onProgress?

function <TsType type="RenderStillOnVercelProgress" source="@remotion/vercel" href="/docs/vercel/types#renderstillonvercelprogress" />

A callback that receives render progress updates. Every variant includes overallProgress (0–1).

Return value

An object containing:

sandboxFilePath

The path to the rendered still image inside the sandbox.

contentType

The MIME type of the rendered output (e.g. "image/png", "image/jpeg", "image/webp").

See also