Entry point
The entry point is the file where the Remotion CLI and @remotion/renderer
APIs will look for a Remotion project.
- By default in most templates, it is
src/index.ts
. - In older projects, it may have an
.tsx
extension instead of.ts
. - The entry point can be passed to the render command, for example:
npx remotion render src/index.ts
. - The entry point should call
registerRoot()
. - If you render a video using
npx remotion render
, the entry point is printed in grey. - You can customize the default entry point in the config file using
Config.setEntryPoint()
.
Which entry point is being used?
If you call npx remotion render
, the entry point and the reason why it was chosen will be printed. The algorithm is as follows:
1
If the entry point is directly passed, for example npx remotion render src/index.ts
, use that.2
Otherwise, if a path was specified in the Configuration file using Config.setEntryPoint()
, use that. 3
Go through the following common paths and if one exists, use that:src/index.ts
src/index.tsx
src/index.js
src/index.mjs
remotion/index.tsx
remotion/index.ts
remotion/index.js
remotion/index.mjs
In the Player
In the Remotion Player, there is no concept of an entry point.
You directly pass a React component and metadata to the <Player>
.