AI(Codex) Remotion video generation
AI(Codex) Remotion video generation
In this chapter, we will create a 15-second introduction video for the virtual product RUNOOB orange travel mug, but we do not want to pay per second for video generation.
This chapter will use Codex to generate images and use Remotion to render them into a video locally.
What is Remotion
Remotion is a framework for writing videos with React code: every frame of the video is a webpage screen, and it is rendered by taking screenshots frame by frame and composing them into an MP4 file.
Animations, transitions, subtitles, and background music are all written in code; changing the text means changing the code, and rendering does not incur any API fees.
It is suitable for content composed of static images with animations, such as card animations, product showcases, and title sequences, but it is not suitable for realistic human motion shots.
How to choose between Seedance and generation
The cost structures of the two paths are completely different, just choose by shot type.
| Comparison items | Remotion code rendering | Seedance model generation |
|---|---|---|
| Fees | Free, only consumes Codex conversation quota and local rendering time | Billed per second, the reference price for 720p is about 0.5~1.5 RMB/second |
| Screen source | Static images generated by Codex plus code animations | Model directly generates dynamic footage |
| Controllability | Frame-by-frame precise text control, only code needs to be changed for revisions | Dynamic realism, but details have randomness |
| Suitable content | Title cards, charts, product image displays, opening and closing credits | Realistic camera movements, character actions, and environmental atmosphere |
A complete promotional video often mixes two approaches: using Seedance for realistic shots and Remotion for title cards and transitions.
Work scenario: What problem needs to be solved
I want to create a 15-second introductory short video for the virtual product "RUNOOB Orange Travel Mug," with a limited budget, and I hope the video is produced entirely locally.
Preparation work
Recommended tools: Codex + Remotion, without calling any video generation interfaces throughout the process.
Practice material: The virtual product is an orange travel mug, and the goal is a 15-second, 16:9, 30fps introductory short video.
In the Codex plugin menu, select skills, search for remotion, and install it:

Prepare a computer with Node.js. Codex will automatically check the version after starting and inform you if anything is missing.
Create an empty project folder named video-marker and set it as the project directory for Codex. All outputs will be placed here.

Who does what
Project initialization, image generation, video code writing, previewing, and rendering are all completed by Codex in the terminal.
You only do four things: confirm the storyboard, confirm the art style, approve the rendering, and accept frame by frame.
Quick start: complete the tasks step by step
First, send the "Director's Opening Prompt" below to Codex; it will take over all subsequent technical steps.
Have Codex generate the storyboard and material list
15 seconds at 30 frames per second equals 450 frames, and Codex will break the entire film down into shot-by-shot sequences.
You only need to check if each shot has a clear task; if you don't understand it, ask it to revise.
Confirm the art style and images.
Codex will first generate a sample image for you to confirm the art style, and then produce all the materials using its built-in image generation capability.
Materials for the same shot must maintain the same art style and tone; if you notice a style jump, ask it to redraw.
Scene production and preview.
The video code is written by Codex; you don't need to look at the code, only at the low-resolution preview it provides.
If you are not satisfied with the pacing, subtitles, or transitions, describe the problem in text and ask it to modify.
Approve rendering into final video
After preview confirmation, tell Codex to render the final video, and it will output a 1920×1080 MP4 file.
Frame-by-frame acceptance
The advantage of code videos is that the text and duration are completely controllable, and the acceptance focus is on these points.
| Check items | Pass standard |
|---|---|
| Text accuracy | Subtitles match the script word-for-word, with no typos |
| Precise duration | 15 seconds equals 450 frames, no missing frames at the beginning or end |
| Correct aspect ratio | 1920×1080, 16:9 ratio |
| Rhythm alignment | Subtitles and music beat synchronization, smooth transitions |
| Consistent source material | Unified art style for the same shot, no jumps |
Complete example: Directly copy the task instructions
Copy the content below into Codex as the opening prompt for this lesson.
Example: Remotion video director opening prompt
You are the director and engineer of this video, responsible for the entire process; I will only communicate with you.
Before starting, do two things:
Ask me: the video's purpose, duration, aspect ratio, and whether subtitles and background music are needed.
Check the Node.js and network environment; tell me what's missing and teach me how to install it.
Product background (sole source of truth):
Virtual product "RUNOOB Orange Travel Mug," selling points are only portability and suitability for commuting.
Do not fabricate insulation duration, material certifications, or sales data.
Division of labor:
You: Initialize the Remotion project, create the storyboard and asset list, generate all images using the built-in image generation tool,
write the video code to complete animations, transitions, and subtitles, and render and export the MP4 on your local machine after preview and confirmation.
You will execute all terminal commands and code; I will only review the results.
Me: Confirm the storyboard and art style, approve rendering, and perform frame-by-frame acceptance.
Rules:
I will not generate images or write code before confirming the storyboard list.
Before rendering the final footage, please provide me with a low-resolution preview first.
The final footage will be 1920×1080, 30fps, and saved in the out directory with the RUNOOB prefix in the filename.
New versions will save as new files and will not overwrite old versions.
Subtitles will only use the selling points I have confirmed.
After completing each step, tell me in one sentence what you did and what the next step is.
If there are prompts, input the information:

After confirming the information, just input to start generation:

Expected results and examples
After generation, you can see the materials:

The mp4 effect is as follows:
How to accept the results
Acceptance focuses on four points: text accuracy, precise duration and aspect ratio, alignment of rhythm and music, and unified material style.
| Check items | Acceptance method |
|---|---|
| Factual accuracy | Compare against the original input item by item, do not accept arbitrarily added data |
| Format is complete | Check if it can be delivered, copied, downloaded, or actually run |
| Scope of changes | When involving files and code, ensure no unauthorized modifications are made |
| Reproducible | Save prompts, original materials, operation steps, and necessary version information |
FAQ and corrections
If you encounter an issue, you don't need to debug the code yourself; describe the phenomenon to Codex and let it locate and fix it.
| Problem phenomenon | Common causes | How to talk to Codex |
|---|---|---|
| Image does not display | Material path or filename is incorrect | "The image position in the final cut is empty, please check the material path and fix it" |
| Rendering is too slow | Long duration, high resolution | "First, give me a low-resolution preview version of less than 10 seconds" |
| Animation and music are not aligned | The rhythm was not calculated by seconds | "The subtitle timing is half a beat behind the music, realign the timeline by seconds" |
| There are typos in the subtitles | The source of the copy is inconsistent | "Verify the product brief word-for-word against the subtitles and output a subtitle list for my confirmation" |
Supplement another round of optimization instructions
If the first version does not meet the requirements, have Codex make local modifications to the confirmed results instead of rewriting the entire section.
Example: Second round of optimization instructions
Please retain all confirmed facts from the previous version and only modify the parts that do not meet the acceptance criteria.
Please first list: existing problems, suggested modifications, and potentially affected content.
Do not overwrite the original file or supplement unverified data without my confirmation.
Hands-on practice
Change the finished video into a 10-second text card video: a slideshow of three selling point text cards with quick transitions.
After completing the practice, keep three sets of materials: the prompt, the original materials, and the final result, for comparison and reuse.