Skip to main content

renderVideoOnVercel()v4.0.425

Renders a video inside a Vercel Sandbox. Writes a render script to the sandbox, executes it, and returns the output file path.

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

Example

const {file} = await renderVideoOnVercel({
  sandbox,
  compositionId: 'MyComp',
  inputProps: {title: 'Hello World'},
  onProgress: (update) => {
    if (update.type === 'render-progress') {
      console.log(`Rendering: ${Math.round(update.progress * 100)}%`);
    }
  },
});

Arguments

An object with the following properties:

sandbox

A VercelSandbox instance.

compositionId

The ID of the Remotion composition to render.

inputProps

Props to pass to the composition.

codec?

The video codec to use. Default: "h264".

outputFile?

The output file path inside the sandbox. Default: "/tmp/video.mp4".

onProgress?

A callback that receives render progress updates.

type RenderOnVercelProgress = {type: 'opening-browser'} | {type: 'selecting-composition'} | {type: 'render-progress'; progress: number} | {type: 'uploading'} | {type: 'done'; url: string; size: number};

bundleDir?

The bundle directory name in the sandbox. Default: ".remotion".

Return value

An object containing:

file

The path to the rendered video inside the sandbox.

See also