Turn a <Player> into a Remotion project
If you have a React app that uses the <Player> component, you can turn it also into a Remotion project without having to create a new repository. This will enable you to:
2
Render videos locally2
Create a
Remotion Bundle
that allows rendering in the cloud
Instructions
Ensure that you don't already have a Studio installed - in the following templates, the Studio is already installed and can be started using the commandnpx remotion studio
:- Next.js (App dir)
- Next.js (App dir, no TailwindCSS)
- Next.js (Pages dir)
- Next.js (App dir, Rendering in Vercel Sandbox)
- React Router 7 (Remix)
- npm
- bun
- pnpm
- yarn
This assumes you are currently using v4.0.425 of Remotion.npm i --save-exact @remotion/cli@4.0.425
Also update
remotion and all `@remotion/*` packages to the same version.Remove all
^ character in front of the version numbers of it as it can lead to a version conflict.This assumes you are currently using v4.0.425 of Remotion.pnpm i @remotion/cli@4.0.425
Also update
remotion and all `@remotion/*` packages to the same version.Remove all
^ character in front of the version numbers of it as it can lead to a version conflict.This assumes you are currently using v4.0.425 of Remotion.bun i @remotion/cli@4.0.425
Also update
remotion and all `@remotion/*` packages to the same version.Remove all
^ character in front of the version numbers of it as it can lead to a version conflict.This assumes you are currently using v4.0.425 of Remotion.yarn --exact add @remotion/cli@4.0.425
Also update
remotion and all `@remotion/*` packages to the same version.Remove all
^ character in front of the version numbers of it as it can lead to a version conflict.Make a new folder
remotion and add these two files in
it:
import React from 'react';
import {Composition } from 'remotion';
import {MyComposition } from './Composition';
export const RemotionRoot : React .FC = () => {
return (
<>
<Composition
id ="Empty"
// Import the component and add the properties you had in the `<Player>` before
component ={MyComposition }
durationInFrames ={60}
fps ={30}
width ={1280}
height ={720}
/>
</>
);
};import { registerRoot } from "remotion";
import { RemotionRoot } from "./Root";
registerRoot (RemotionRoot );Add the component you previously registered in the <Player> also to the <Composition>.
If necessary, move the components into the remotion directory.
The file that calls registerRoot() is now your Remotion entry point.
Start the Remotion Studio:
npx remotion studioRender a video
Render our a video using
npx remotion render remotion/index.tsSet up server-side rendering
See server-side rendering for more information.
How do I download a video from the Remotion Player?
The video first needs to get rendered - this can only be done on the server. See ways to render and server-side rendering for more information.