Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Codex Image and Video Production: From AI Image Generation to Remotion Auto-Editing

Codex Image and Video Production: From AI Image Generation to Remotion Auto-Editing

In the past, producing a product promo video required designing images first, then using editing software to add animations, subtitles, and background music, and finally exporting the video.

Now you can let Codex tie all these tasks together:Generate image assets, write animation code, arrange storyboards, add subtitles, and finally render an MP4 video locally.

This chapter uses a complete case study, combining Codex's image generation capability with Remotion, to produce a 15-second product intro video for the fictional product 'RUNOOB Orange Travel Tumbler'.

The entire process requires no manual React coding and no traditional video editing software. We provide requirements and confirm the results, while Codex handles the technical implementation.

Besides Remotion, there is also a video plugin called HyperFrames you can refer to: Codex Video Production: From AI Image Generation to HyperFrames Auto-Editing。


I. How Codex Creates Images and Videos

Codex can directly participate in image and video production, but the two are implemented differently.

Production Task Using tools Main Function
Image generation Codex + ImageGen Generate product images, backgrounds, illustrations, etc. from prompts
Image Editing Codex + ImageGen Change backgrounds, adjust composition, generate different aspect ratios
Video Production Codex + Remotion Create animations, subtitles, and transitions via React code
Video Export Remotion Render and generate an MP4 video locally

Simply put:ImageGen handles drawing, Remotion brings the images to life, and Codex manages the entire production workflow.

What Is Remotion

Remotion It is a framework for writing videos with React.

Traditional editing software edits video via a timeline, while Remotion controls the visuals through code. When an image appears, when subtitles enter, and how long an animation lasts can all be precisely configured.

For example, a 15-second, 30fps video contains 450 frames in total. Remotion generates frames one by one according to the code, then encodes them into an MP4 file.

It is well suited for producing:

Note that Remotion itself is not an AI video generation model. It can animate static images with panning, zooming, rotating, etc., but it does not automatically generate realistic walking people, complex object motion, and similar scenes.

How Does It Differ from AI Video Generation Models?

Comparison Item Remotion AI Video Generation Models
Implementation Control visuals and animations with code Generate moving images via a model
Visual Effects Image motion, graphic animations, subtitles, transitions Realistic motion, human actions, complex scenes
Controllability Text, duration, and position can be precisely controlled Depends on model generation; results are random
How to Modify Modify the code and re-render Adjust the prompt or regenerate the shot
Cost Local rendering incurs no per-second model fees Usually requires model generation credits or API fees
Applicable scenarios Promo cards, product demos, course videos Realistic shots, human performances, dynamic scenes

The two approaches can also be combined. For example, first generate realistic shots with an AI video model, then use Remotion to add subtitles, brand elements, and an outro.

This tutorial only uses Codex image generation and Remotion local rendering; no video generation model is called.


II. Hands-on Goal: Produce a 15-Second Product Video

Suppose we want to produce a promo video for a fictional product, the 'RUNOOB Orange Travel Tumbler'.

We only have the product name and two selling points:Lightweight and suitable for commuting.

We want Codex to help generate product images, then turn them into a video with animations, subtitles, and transitions.

Projects Requirement
Product Name RUNOOB Orange Travel Tumbler
Video Length 15 seconds
Video Aspect Ratio 16:9 landscape
Video Resolution 1920 × 1080
Video Frame Rate 30fps
Image Style Clean, bright, modern product ad
Production Method AI images + Remotion animation
Output formats MP4

The entire production workflow is as follows:

Codex Image Generation and Remotion Video Production Workflow

Codex handles project initialization, image generation, animation coding, previewing, and final rendering. We mainly confirm the storyboards, product appearance, and final result.


III. Preparing Codex and Remotion

1. Create the project directory

First, launch Codex, create a new empty folder, e.g. video-maker, and set it as the current project directory.

Creating a Video Production Project with Codex

All subsequently generated images, video code, and MP4 files are saved in this directory for easy modification and reuse.

2. Install Remotion Skills

Remotion officially provides Skills for AI coding tools such as Codex, including best practices for project creation, animation, asset usage, and video rendering.

Search in a Codex interface that supports Skill installation for remotion, find the corresponding skill, and install it.

Installing the Remotion Skill in Codex

You can also use the installation command provided by Remotion:

Install Remotion Skills

npx skills add remotion-dev

/

skills

If Node.js is not installed, you can first have Codex check the development environment. Remotion requires Node.js and related dependencies to run locally.

After installation, you can tell Codex:

Check the project environment

Check whether the current environment can run Remotion.

Confirm whether Node.js, npm, and Remotion Skills are available.

If any dependencies are missing, tell me why and help complete the installation.

Once ready, initialize a Remotion project.

Remotion official docs:https://www.remotion.dev/docs/


IV. Step 1: Have Codex Plan the Video Storyboard

Don't ask Codex to generate the video right away.

First tell it the product information, video length, and visual style, and let it plan the entire video's content.

Example: Video Director Prompt

You are a product ad director, responsible for using

Codex, ImageGen, and Remotion to complete the video production.

For the fictional product 'RUNOOB Orange Travel Tumbler',

design a 15-second product introduction video.

Product information:

Product: Orange travel tumbler

Appearance: Orange cylindrical body with a flip lid

Selling points: Lightweight, suitable for commuting

Style: Clean, modern, bright

Video requirements:

16:9 landscape

1920×1080

30fps

Total duration 15 seconds

Chinese subtitles

Simple, natural animated transitions

Please complete the following tasks first:

Plan the overall creative concept of the video.

Design the storyboard in chronological order.

Describe the image assets needed for each shot.

Provide subtitle and animation suggestions.

Design a consistent product visual style.

Do not generate images or write code yet.

First give me the storyboard plan for confirmation.

Codex creates a storyboard plan based on the requirements, for example:

Time Scene content Animation effect
0–3 s The orange tumbler enters from the right side of the frame Smooth movement, fade-in
3–6 s Show the tumbler's overall appearance Slight zoom-in, product close-up
6–10 s Show a commuting usage scenario Scene change, subtitles enter
10–13 s Highlight 'lightweight and suitable for commuting' Text appears sequentially
13–15 s Product freeze-frame and ending screen Fade out, closing

After confirming the storyboard, have Codex start generating image assets.


V. Step 2: Use Codex to Generate Product Images

This is a relatively important step in the whole case.

Codex can generate and edit images through the $imagegen skill. We only need to tell it the product appearance, visual style, and composition requirements.

But note one issue:If the same product is regenerated in different scenes, its appearance may change.

For example, the first image shows a cylindrical tumbler, the second may turn square, and the third may even have a different lid.

Therefore, a better approach is to first generate a standard product image, confirm its appearance, then use it as a reference to generate other scenes.

1. Generate a Standard Product Image

Example: Generate the Main Product Image

Please use $imagegen to generate a standard product image.

Product description:

An unbranded, orange, cylindrical travel tumbler,

with a flip lid, a clean body, and a modern appearance.

Image requirements:

1:1 square

Product centered

Fully show the body and lid

Clean light-gray background

Soft commercial photography lighting

Clear product structure

Do not add any text, logo, or watermark.

Do not add unnecessary decorations.

Please save as:

assets/images/cup-master.png

Generate this one first; wait for me to confirm the product appearance.

After generation, check the product's color, lid, proportions, and appearance. Proceed to the next step only after confirming everything is correct.

2. Generate the Scene Images Needed for the Video

Next, using the confirmed main product image as a reference, have Codex generate assets with different compositions.

Example: Generate Video Assets in Bulk

Please use $imagegen to continue generating video assets.

Use assets/images/cup-master.png

as the product appearance reference.

The product's color, body shape, and lid structure must remain consistent.

Generate the following images:

cup-hero.png

16:9 landscape image, tumbler on the right, large blank space on the left.

Suitable for the video opening.

cup-detail.png

16:9 landscape image, tumbler centered, highlighting the overall appearance.

Suitable for the product showcase shot.

cup-lifestyle.png

16:9 landscape image, tumbler in a clean commuting scene.

It may include elements like a backpack or desk, but the tumbler is the main subject.

cup-ending.png

16:9 landscape image, tumbler in the center of the frame.

Clean background, suitable for the ending screen.

General requirements:

Maintain product consistency

Modern commercial advertising style

Bright and clean

No text, logo, or watermark

Do not change the product design on your own

Save images to the assets/images directory

If the reference image cannot ensure consistent product details,

please prioritize keeping the original product image,

and use cropping, compositing, and background replacement to create the scenes.

List all asset files after generation.

It is recommended not to generate subtitles directly into the images. Let Remotion handle the subtitles; this makes later modifications much easier.

3. Check the Image Assets

After the assets are generated, check whether the images are complete.

Video and image assets generated by Codex

Focus on checking product appearance consistency, correct aspect ratios, and whether space is reserved for subtitles.


VI. Step 3: Have Codex Create the Video with Remotion

Once the images are ready, you can start producing the video.

This step requires no manual opening of editing software. Just have Codex read the previously confirmed storyboard and image assets, and write the video code with Remotion.

Example: Start Producing the Remotion Video

Now start producing the video.

Please use the installed Remotion Skills,

following the storyboard and image assets we confirmed,

to complete a 15-second product introduction video.

Technical requirements:

React + Remotion

1920×1080

30fps

450 frames

16:9 landscape

Output MP4

Production requirements:

Use the confirmed assets in assets/images.

Arrange each shot's timing according to the storyboard.

Add smooth zoom, movement, and fade-in/fade-out animations.

Create subtitles using React text components.

Use only confirmed product information for the subtitles.

Ensure product images are not stretched or distorted.

Keep transitions simple and natural; do not overuse effects.

If no usable background music is provided,

   first produce a version without music; do not download music on your own.

Please automatically complete project initialization, dependency installation, and code writing.

When done, start Remotion Studio,

and let me check the timeline and preview.

Do not render the final video yet.

Codex creates the Remotion project and writes the corresponding React components, animations, and timeline configuration.

For example, image zoom, subtitle fade-in, and shot changes can all be controlled through code.

Preview the Video

After the code is complete, you can preview the video in the browser via Remotion Studio.

If the project is already configured with Remotion, you can also start it with the following command:

Start Remotion Studio

npx remotion studio

In the preview interface, you can drag the timeline to check image changes, animation pacing, and subtitle positions.

If a shot feels too fast, just tell Codex:

Example: Adjust the Video Pacing

The 2nd shot changes too quickly.

Please appropriately extend the duration of the product close-up,

and reduce unnecessary zoom animations.

Keep the overall video at 15 seconds,

and leave the other confirmed visuals as unchanged as possible.

After Codex modifies the corresponding timeline and animation code, you can preview again without regenerating all the images.


VII. Step 4: Render and Export the MP4 Video

After confirming the preview, have Codex render the final video locally.

A two-stage approach is recommended: first output a low-resolution preview, then export the 1080p final version after confirming everything is correct.

Example: Export the Final Video

The preview has been confirmed, and official rendering can begin.

Please check:

Is the total duration 15 seconds?

Is the frame rate 30fps?

Is the resolution 1920×1080?

Are images and subtitles displayed properly?

Are there any black screens or blank frames?

After confirming everything is correct:

Render locally using Remotion.

Output an H.264-encoded MP4 file.

Save the video to the out directory.

The filename is RUNOOB-orange-cup-v01.mp4.

Do not overwrite existing versions.

When finished, tell me the actual file path.

Remotion also supports command-line export, for example:

Remotion render command

npx remotion render CupVideo out

/

RUNOOB-orange-cup-v01.mp4

where CupVideo is an example Composition ID; in actual use it must match the video component ID in the project.

After rendering is complete, you can open the MP4 file directly with a local player.


8. Complete Demonstration: From Prompt to Finished Video

The production process was broken into several steps earlier. If you are already familiar with Codex, you can also provide a complete task description directly and have it complete the steps in order as required.

Example: Complete Prompt for Codex Image and Video Production

You are my AI video production assistant,

serving also as director, visual designer, and Remotion engineer.

Please use Codex's image generation capability and Remotion,

for the virtual product "RUNOOB Orange Travel Cup"

produce a 15-second promotional short video.

I. Product Information

Product name: RUNOOB Orange Travel Cup

Appearance: Orange cylindrical body with a flip lid

Selling points: Lightweight, suitable for commuting

Do not fabricate information such as insulation duration, material certification, or sales figures.

II. Video Parameters

Aspect ratio: 16:9

Resolution: 1920×1080

Frame rate: 30fps

Duration: 15 seconds

Format: MP4

Style: Clean, modern, bright

III. Production Steps

Phase 1: Planning

Develop video creative ideas based on the product information.

Design the shot-by-shot storyboard.

List the image asset inventory.

Plan subtitles, animations, and transitions.

Submit to me for confirmation first; do not start work directly.

Phase 2: Image Generation

Use $imagegen to generate the standard product image.

Let me confirm the product appearance.

Generate other scenes based on the confirmed product image.

Keep the cup color, body, and lid consistent.

Store all assets uniformly in assets/images.

Do not add subtitles to generated images.

Phase 3: Video Production

Check Node.js and npm.

Check and install Remotion Skills.

Initialize the Remotion project.

Write the React video components.

Implement animations, subtitles, and transitions according to the confirmed storyboard.

Launch Remotion Studio.

Provide a preview and make revisions based on feedback.

Phase 4: Video Export

First output a low-resolution preview version.

Export the official version after my confirmation.

The official video is 1920×1080, 30fps.

Output the MP4 file to the out directory.

Use the RUNOOB prefix and a version number for the filename.

New versions must not overwrite old versions.

IV. Work Rules

Prioritize reusing already confirmed assets.

Do not modify unauthorized project files.

Do not purchase services or call paid APIs without authorization.

When dependencies are missing, explain first and propose solutions.

When image generation fails, explain the reason and provide alternatives.

Do not fabricate product selling points.

After each phase is completed, briefly explain the result.

You are responsible for all code and terminal operations.

Now first check the environment and provide a video storyboard plan.

After sending the prompt to Codex, it will first check the environment and organize the requirements.

Codex confirms video production requirements

After confirming the information, follow the prompts to have Codex begin execution.

Codex Starts Generating Images and Videos

Final Video Effect

Below is a demonstration of the product video created with Codex and Remotion:

Final Output of Codex Remotion Video Production

Unlike directly using video generation models, this approach produces videos that retain the complete project files.

Later, to modify subtitles, replace an image, or adjust animation timing, you only need to have Codex modify the relevant code and render again.


9. Common Problems and Solutions

Problem Solution
Codex cannot generate images Check whether the current environment supports ImageGen, confirm the skill and usage quota; use existing assets when necessary
Product inconsistency across different images Fix the standard product image as a reference, and prioritize creating other frames through cropping and compositing
Remotion fails to start Have Codex check Node.js, project dependencies, and terminal error messages
Images in the video do not display Check whether assets are stored in the correct directory and whether paths match
Animation is not smooth Check frame rate, keyframes, animation curves, and transition timing
Typos in subtitles Have Codex check word by word against the original product information
Slow video rendering First lower the preview resolution, then render 1080p for final delivery
Incorrect output video duration Check whether Composition is set to 450 frames, 30fps

How to make revisions when unsatisfied

If you are unsatisfied with the first version of the video, you do not need to remake the entire project.

For example, to make the opening more natural, you can directly enter:

Example: Partially Modifying the Video

Please optimize the previous version of the video:

Make the cup enter a bit slower in the opening.

Move the subtitle position in the third shot upward.

Make the transition less flashy; change it to fade in and fade out.

Let the product linger a bit longer in the final shot.

Keep the total duration at 15 seconds.

Only modify the relevant animation and timeline code,

Do not regenerate already confirmed images.

Provide a new preview when finished,

Keep the previous version of the video.

This repeatably modifiable workflow is also an important difference between Remotion and ordinary AI video generation tools.


10. Hands-On Exercises

After completing the 15-second product video above, you can try the following exercises.

Exercise 1: Generate Product Images in Different Aspect Ratios

Have Codex generate three images for different uses based on the same orange travel cup:

Require the product appearance to remain consistent; do not add unconfirmed brand logos or product features.

Exercise 2: Create a 10-Second Subtitle Short Video

Turn the previous video into a 10-second subtitle short video.

Keep the main product image, create three dynamic text cards that sequentially present the product name, portability, and suitability for commuting.

Require clear subtitles and natural animations, and export a standalone MP4 file.

Exercise 3: Convert the Video to a Portrait Version

Have Codex convert the original 16:9 video to 9:16, with a resolution of 1080×1920.

Note that you cannot simply stretch the original image; you need to rearrange the product position, subtitles, and shot composition, and generate new background assets suitable for portrait orientation when necessary.