Capítulo 149 de 988

Chapter 149: selectComposition()

Core Idea

Evaluates the list of compositions from a Remotion Bundle by evaluating the Remotion Root and evaluating calculateMetadata() on the specified composition.

Key Concepts

  • API
  • serveUrl
  • id
  • inputProps
  • logLevel?
  • port?
  • chromiumOptions?
  • timeoutInMilliseconds?

Code Examples

const bundled = await bundle({entryPoint: require.resolve('./src/index.ts')});
const composition = await selectComposition({
  serveUrl: bundled,
  id: 'MyComposition',
  inputProps: {},
});

console.log(composition.id); // "MyComposition"
console.log(composition.width, composition.height);
console.log(composition.fps, composition.durationInFrames);
  • What it demonstrates: Usage pattern for selectComposition() from the official docs.

Key Takeaways

  1. Understand api when working with selectComposition().
  2. Understand serveurl when working with selectComposition().
  3. Understand id when working with selectComposition().
  4. Understand inputprops when working with selectComposition().
  5. Understand loglevel? when working with selectComposition().

Connects To

  • Chromium Flags: related page in the Rendering & SSR section.
  • Compare ssr: related page in the Rendering & SSR section.
  • Dataset Render: related page in the Rendering & SSR section.