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

Claude Code with remotion-best-practices for Video Production

Claude Code with remotion-best-practices for Video Production

This section introduces how to build and generate a Remotion promotional video project from scratch locally using Claude Code together with the remotion-best-practices skill.


Prerequisites

Before starting, ensure your local environment meets the following requirements.

Dependencies Version requirements Purpose
Node.js >= 18.0 Run Remotion and npm scripts
npm / pnpm Latest stable version Dependency package management
Claude Code Latest version AI-assisted code generation and project setup
remotion-best-practices Installed as a skill Provides Remotion project specifications and templates

Install Claude Code

Official one-click install scripts are provided; choose the corresponding command for your system to execute.

macOS、Linux、WSL:



curl -fsSL https://claude.ai/install.sh | bash

Windows PowerShell:



irm https://claude.ai/install.ps1 | iex

Windows CMD:



curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

After installation, verify that it succeeded:



$ claude --version

2.1.142 (Claude Code)

First run requires logging into an Anthropic account and authorizing; if you don't have an official account, you can check Claude Code API configuration


Install remotion-best-practices Skill

A Skill is an extension capability package for Claude Code; remotion-best-practices encapsulates best practices and code templates for Remotion projects.

What is a Skill

A Skill is essentially a structured prompt document (SKILL.md); after Claude Code reads it, it gains professional knowledge and specification constraints for the corresponding domain.

The remotion-best-practices skill contains the following:

Content module Description
Project directory specification Defines the standard layered structure of compositions, components, assets
Animation API usage Standard usage of interpolate, spring, useCurrentFrame
Performance best practices Specifications for avoiding repeated rendering, preloading static assets, etc.
Render configuration template Recommended parameter combinations for codec, fps, resolution, etc.

Installation method

In the terminal, enter your project directory and execute the install command:

npx skills add https://github.com/remotion-dev/skills --skill remotion-best-practices

After successful installation, verify the skill is recognized:



claude skills list

You can see columns like the following:



Installed skills:

  - remotion-best-practices  (active)

remotion-best-practices source address:https://github.com/remotion-dev/skills


Create Remotion project

After all preparations are complete, start Claude Code in an empty directory and use a Prompt to have it automatically set up the project.

Start Claude Code and pass in the Prompt

We can create the directory video-marker and then enter it:



mkdir video-marker

cd video-marker

Run in the project directory:



claude

After entering the interactive interface, paste the following Prompt:



先读取 remotion-best-practices skill,然后创建一个 Remotion 项目。



目标:6 秒钟的「Hello Runoob」好莱坞风格片头视频,1920x1080,30fps。



Effect requirements:

- 纯黑背景

- "HELLO RUNOOB" 文字以冲击力方式砸入画面,伴随冲击波扭曲效果

- 撞击瞬间爆发金色粒子

- 强烈的色差闪光(chromatic aberration)

- 文字落定后,绿色(#67c23a)轮廓光晕脉冲

- 顶部和底部黑色宽幅遮幅条像电影一样滑入



只需一个 Composition,不用拆分场景。整体质感对标好莱坞大片片头字幕。

Then just wait for generation~

When done, it will tell you how to generate the mp4 file:

Browser preview:

cd hello-runoob

npm run dev

Preview:

Generate mp4:

cd hello-runoob

npx remotion render HelloRunoob out/hello-runoob.mp4

Export information:

The video is in the out directory:

The Prompt explicitly requires Claude Code to read the skill first, so the generated code strictly follows remotion-best-practices specifications rather than relying on the model's default habits.

What Claude Code will do

After Claude Code reads the skill, it automatically completes the following steps:

Step Operation Generated content
1 Initialize a project package.json、tsconfig.json、remotion.config.ts
2 Create directory structure src/compositions、src/components、src/assets
3 Generate Scene components Intro.tsx、FeaturesScene.tsx、StatsScene.tsx、Outro.tsx
4 Generate common components TechCard.tsx、AnimatedCounter.tsx、CodeSnippet.tsx
5 Register Composition Complete all scene assembly in Root.tsx

More examples

Example 1: Number growth animation



帮我用 Remotion 创建一个 8 秒的视频。背景是深色,画面中央显示一个数字,从 0 逐渐增长到 1,000,000,数字有弹跳动画效果,最后定格时出现"突破百万!"的字样。字体要大,颜色用金黄色。

What Claude Code will do after receiving this instruction:

We can directly have AI export the video for us in Claud:

Generated video:

Example 2: Product launch countdown



用 Remotion 做一个 15 秒的产品发布倒计时视频。从 10 倒数到 0,每个数字出现时有缩放+透明度的过渡动画,背景用黑色,数字用白色大字体,右上角有"NEW"红色徽章。倒计时结束时全屏出现产品名称"CLAUDE PRO",字体要震撼。

Generated video:

Key points:The more specific the Prompt, the better. Clearly describe time, colors, effects, and text content, and Claude Code will get it right in one go without repeated adjustments.


Understand the generated project structure

After project setup is complete, the directory structure is as follows:



hello-runoob/

├── package.json

├── tsconfig.json

├── remotion.config.ts

└── src/

    ├── index.ts              ← 入口,注册所有 Composition

    ├── Root.tsx              ← 主 Composition,拼接所有场景

    ├── compositions/

    │   ├── Intro.tsx         ← 开场 Logo 动画

    │   ├── ProblemScene.tsx  ← 问题引入场景

    │   ├── FeaturesScene.tsx ← 技术卡片展示

    │   ├── StatsScene.tsx    ← 数据统计场景

    │   └── Outro.tsx         ← 结尾 CTA

    ├── components/

    │   ├── TechCard.tsx      ← 单个技术卡片

    │   ├── AnimatedCounter.tsx ← 数字滚动

    │   └── CodeSnippet.tsx   ← 代码块动画

    └── assets/

        ├── colors.ts         ← 品牌色常量

        └── logo.svg

Core file interpretation

Root.tsx is the entry point of the entire video; all scenes are assembled here in timeline order:

Root.tsx structure diagram

import

"./index.css"

;

import

{

Composition

}

from

"remotion"

;

import

{

HelloRunoob

}

from

"./Composition"

;

export

const

RemotionRoot

:

React.

FC

=

(

)

=>

{

 

return

(

   

<>

     

<

Composition

id

=

"HelloRunoob"

component

=

{

HelloRunoob

}

durationInFrames

=

{

180

}

fps

=

{

30

}

width

=

{

1920

}

height

=

{

1080

}

/>

)

;

}

;

Main video component, using Series to assemble scenes in order:

const MainVideo = () => {

  return (

    

         {/* 3秒 */}

        

      

        {/* 7秒 */}

        

      

        {/* 15秒 */}

        

      

        {/* 10秒 */}

        

      

    

  );

};


Install dependencies and preview

After Claude Code generates the code, install dependencies according to its prompts:



npm install

Start Remotion Studio to preview video effects:



npx remotion studio



> runoob-promo@1.0.0 studio

> remotion studio



Remotion Studio running at http://localhost:3000

The browser will automatically open http://localhost:3000; you can drag the timeline to preview each frame in real time.

If during preview a scene animation looks too fast or too slow, directly tell Claude Code: "The card entrance animation of scene 2 is too fast, make the delay longer", and it will locate the corresponding code and modify it.


Iterative adjustment with Claude Code

During Remotion Studio preview, if you find issues you can describe them in natural language directly in Claude Code without manually changing code.

Common adjustment scenarios

Description How to tell Claude Code
Card animation too fast Lower the spring stiffness of cards in FeaturesScene to 80
Background color incorrect Change the background color of all scenes to #0d1117
Number counter not smooth Use easeOutCubic easing for AnimatedCounter in StatsScene
Want to add a scene Add a scene after StatsScene showing online instance functionality, 10 seconds
Text font too small Change the main title font in Intro.tsx to 96px

Directly describe the problem in the Claude Code terminal; it will find the corresponding file and modify it, and once modified Remotion Studio will automatically hot-update.


Render and output the final video

When satisfied with the effect, render into an MP4 file:

Render command

npx remotion render \

  src

/

index.ts \          

Entry file

  RunoobPromo \            

Composition ID, consistent with Root.tsx

  out

/

runoob-promo.mp4 \  

Output path

 

--codec

=h264 \          

Encoding format, best compatibility

 

--width

=

1920

\          

Output width

 

--height

=

1080

           

Output height



Rendering RunoobPromo (1800 frames)

Progress: ████████████████████ 100%

Rendered in 2m 34s → out/runoob-promo.mp4


Remotion best practices: Let AI help you do better

Render speed depends on scene complexity and machine performance. If the video is long with many effects, you can add the --concurrency=4 parameter to enable multi-threaded parallel rendering, increasing speed by 3~4 times.

In actual use there are some techniques that can greatly improve your video quality. Adding these instructions to your Prompt will make a noticeable difference:

🎬 Frame rate and size

🎞 Animation rhythm

🎨 Visual texture

⚡ Render efficiency


Common questions

Claude Code did not read the skill

If the generated code does not comply with remotion-best-practices specifications, it means the skill was not read correctly.

Explicitly add this sentence at the beginning of the Prompt:

Force reading the skill

Before writing any code,

read

the remotion-best-practices

skill

file

completely.

Remotion Studio startup error

A common cause is an outdated Node.js version. Check and upgrade:

Upgrade Node.js

Use nvm to switch to Node.js 20

nvm

install

20

nvm use

20

spring() animation only shows the first frame

This is because spring returns 0 when the value of frame - delay is negative.

Add clamp protection:

Fix negative frame issue

const

scale

=

spring

(

{

  frame

:

Math

.

max

(

0

,

frame

delay

)

,

 

// Ensure the passed-in value is not negative

  fps

,

  config

:

{

damping

:

12

,

stiffness

:

180

}

,

}

)

;