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
- Understand api when working with selectComposition().
- Understand serveurl when working with selectComposition().
- Understand id when working with selectComposition().
- Understand inputprops when working with selectComposition().
- 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.