
Using this template you can create high quality AI videos for TikTok or Instagram.
It includes a CLI that will generate a story script, images and voiceover using OpenAI and ElevenLabs.
Set up the demo story:
Install Dependencies
npm installStart Preview
npm run devRender video
npx remotion renderOr check out the Remotion docs. There are lots of ways to render.
You can easily create your own videos using provided CLI.
It will generate a script, images, voiceover and timeline based on your story title and topic. Topics that work well: history, ELI5, fun facts, science.
Configure environment variables
Create .env file with following env vars (you can also find them in .env.example):
OPENAI_API_KEY=
ELEVENLABS_API_KEY=
If you don't create an env file, you will be prompted for these variables when using CLI.
Select voice
In generateVoice() replace the voice id from ElevenLabs with the one you like. You can use their API for this. Alternatively, you can open any voice on their website and extract the Voice ID from the url (id comes after voiceId=).
https://elevenlabs.io/app/voice-library?voiceId=aTxZrSrp47xsP6Ot4KgdGenerate story timeline
npm run genYou will be prompted to enter story title and topic.
Title can be a vague one or long and detailed. Short title on the first slide will be generated based on it.
Topic can be e.g. History, Interesting facts, ELI5 etc.
After you enter title and topic, CLI will generate text, images and audio with timestamps, and combine all those into a timeline that van be used by this template to render a video.
Remotion is rendering videos based on Timeline (timeline.json in project folder). The timeline is generated by CLI.
It consists of three blocks - Elements, Text and Audio.
Elements define slide backgrounds and include enter/exit transitions (e.g. blur) and animations that are applied while slide is active (e.g. scale, rotate).
Text and audio are self explanatory. The only special thing about them is that they are synced.
You can customize the generation of the timeline in createTimeLineFromStoryWithDetails() function.
Current project needs light modification if you want to deploy it as a remote service.
Remotion renderer with template bundle should be deployed as per usual.
Then you have to update Root.tsx to use timeline url that you will pass as a prop (instead of project name).
The last thing - you have to upload generated resources (images and audio) to server and use urls to them instead of file names when generating a timeline.
Found an issue with Remotion? Upgrade Remotion to receive fixes:
npx remotion upgrade
Didn't help? File an issue here.
The source of this template is in the Remotion Monorepo.
Don't send pull requests here, this is only a mirror.
Note that for some entities a company license is needed. Read the terms here.