Communitygithub.com

Remotion — React コンポーネントによるプログラム動画作成

React コンポーネントを使って動画をプログラムで作成できます。コード駆動型動画制作のための最も成熟したフレームワークです。

Remotion — React コンポーネントによるプログラム動画作成 とは?

Remotion は、React を使用してプログラム的にビデオを生成できるオープンソースの TypeScript フレームワークです。主に remotion-dev/remotion リポジトリ(21K 以上のスター)で開発されており、個人および年間収入 100 万ドル未満の企業向けに無料で利用できます。インストールは `npm install remotion @remotion/cli @remotion/transitions` で行い、`<Composition>` コンポーネントで解像度、フレームレート、長さを定義します。`useCurrentFrame()` や `interpolate()`、`spring()` などのアニメーションプリミティブを提供し、`<Sequence>` / `<Series>` による時間制御や、`@remotion/transitions` によるシーン遷移(フェード、スライド、ワイプなど)をサポートします。プロジェクトは `npx create-video@latest` で簡単に開始でき、`npx remotion studio` でブラウザプレビュー、`npx remotion render` で MP4/GIF/静止画を出力可能。ベストプラクティスとして、補間のクランプ、スプリングアニメーション、コンポーネント分割、明示的な durationInFrames 設定、GPU 高速化のための CSS トランスフォームの使用などが推奨されています。また、`@remotion/three`、`@remotion/lottie`、`@remotion/gif` などの拡張パッケージを npm からインストールすることで、3D シーンや Lottie アニメーション、GIF の埋め込みも可能です。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ever-just/agentskills/tree/HEAD/skills/remotion

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Remotion — React コンポーネントによるプログラム動画作成 は何をしますか?

React コンポーネントを使って動画をプログラムで作成します。コード駆動型動画制作のための最も成熟したフレームワークです。

概要

  • リポジトリ: github.com/remotion-dev/remotion (21K+ スター)
  • 言語: TypeScript / React
  • ライセンス: 年間収入 100 万ドル未満の個人・企業向け無料
  • インストール: npm install remotion @remotion/cli @remotion/transitions
  • ドキュメント: remotion.dev/docs

基本概念

Composition

<Composition> は動画のサイズ、フレームレート、長さを定義します。

import { Composition } from "remotion";

export const RemotionRoot: React.FC = () => {
  return (
    <Composition
      id="MyVideo"
      component={MyVideo}
      durationInFrames={300}  // 30fps で 10 秒
      fps={30}
      width={1920}
      height={1080}
    />
  );
};

アニメーションプリミティブ

useCurrentFrame() — 現在のフレーム番号(0 から始まる)を返します。

const frame = useCurrentFrame();

interpolate() — フレーム範囲を出力値にマッピングします。

import { interpolate, useCurrentFrame } from "remotion";

const opacity = interpolate(frame, [0, 30], [0, 1], {
  extrapolateRight: "clamp",
});

spring() — 物理ベースのスプリングアニメーションです。

import { spring, useCurrentFrame, useVideoConfig } from "remotion";

const { fps } = useVideoConfig();
const scale = spring({ frame, fps, config: { damping: 200 } });

時系列制御

— コンテンツを時間的にオフセットします。

<Sequence from={30} durationInFrames={60}>
  <MyScene />
</Sequence>

— 子要素を順に並べます。

import { Series } from "remotion";

<Series>
  <Series.Sequence durationInFrames={90}>
    <IntroScene />
  </Series.Sequence>
  <Series.Sequence durationInFrames={150}>
    <MainScene />
  </Series.Sequence>
  <Series.Sequence durationInFrames={60}>
    <OutroScene />
  </Series.Sequence>
</Series>

— フルフレームの位置指定コンテナです。

<AbsoluteFill style={{ backgroundColor: "#0a0a0a" }}>
  <h1>Hello World</h1>
</AbsoluteFill>

トランジション

import { linearTiming, TransitionSeries } from "@remotion/transitions";
import { fade } from "@remotion/transitions/fade";
import { slide } from "@remotion/transitions/slide";

<TransitionSeries>
  <TransitionSeries.Sequence durationInFrames={90}>
    <Scene1 />
  </TransitionSeries.Sequence>
  <TransitionSeries.Transition
    presentation={fade()}
    timing={linearTiming({ durationInFrames: 15 })}
  />
  <TransitionSeries.Sequence durationInFrames={90}>
    <Scene2 />
  </TransitionSeries.Sequence>
</TransitionSeries>

利用可能なトランジション: fade, slide, wipe, flip, clockWipe, none

メディア

import { Video, Audio, Img, staticFile } from "remotion";

// 静的ファイルは /public に配置
<Video src={staticFile("demo.mp4")} />
<Audio src={staticFile("music.mp3")} volume={0.5} />
<Img src={staticFile("logo.png")} />

プロジェクトのセットアップ

# 新規プロジェクト作成
npx create-video@latest my-video

# 手動で行う場合:
mkdir my-video && cd my-video
npm init -y
npm install remotion @remotion/cli @remotion/transitions react react-dom
npm install -D typescript @types/react

必要なファイル

src/index.ts(エントリポイント):

import { registerRoot } from "remotion";
import { RemotionRoot } from "./Root";
registerRoot(RemotionRoot);

remotion.config.ts:

import { Config } from "@remotion/cli/config";
Config.setVideoImageFormat("jpeg");
Config.setOverwriteOutput(true);

コマンド

# ブラウザでプレビュー(Remotion Studio)
npx remotion studio

# MP4 にレンダリング
npx remotion render MyVideo out/video.mp4

# 特定のフレームをレンダリング
npx remotion render MyVideo out/video.mp4 --frames=0-90

# GIF としてレンダリング
npx remotion render MyVideo out/video.gif --image-format=png

# 静止画像としてレンダリング
npx remotion still MyVideo out/thumbnail.png --frame=45

ベストプラクティス

  1. 常に補間をクランプする: extrapolateRight: "clamp" を使用して値のオーバーシュートを防ぐ
  2. 自然な動きには spring() を使用する: スプリングは線形補間よりも有機的な動きを生む
  3. シーンは個別のコンポーネントとして維持する: 各シーンは独自の React コンポーネントにする
  4. 連続シーンには を使用する: 手動でオフセットを計算するより簡単
  5. 明示的な durationInFrames を設定する: すべての Sequence で durationInFrames を設定する
  6. AbsoluteFill を使用する: フルフレームの背景や重ね合わせレイヤーに便利
  7. 静的アセットは /public に配置する: staticFile() で参照する
  8. 異なるフレームでテストする: Remotion Studio のスクラバーでアニメーションを確認する
  9. CSS トランスフォームを優先する: transform: scale() や translateX() は GPU 高速化される
  10. 重い再レンダリングを避ける: 高コストな計算には useMemo を使用する

一般的なパターン

フェードイン表示のテキスト:

const frame = useCurrentFrame();
const opacity = interpolate(frame, [0, 20], [0, 1], { extrapolateRight: "clamp" });
const y = interpolate(frame, [0, 20], [20, 0], { extrapolateRight: "clamp" });

<div style={{ opacity, transform: `translateY(${y}px)` }}>
  Hello World
</div>

段階的に表示されるリスト項目:

{items.map((item, i) => {
  const delay = i * 8;
  const opacity = interpolate(frame, [delay, delay + 15], [0, 1], {
    extrapolateLeft: "clamp",
    extrapolateRight: "clamp",
  });
  return <div key={i} style={{ opacity }}>{item}</div>;
})}

タイプライター風エフェクト:

const charsShown = interpolate(frame, [0, text.length * 2], [0, text.length], {
  extrapolateRight: "clamp",
});
<span>{text.slice(0, Math.floor(charsShown))}</span>

拡張機能(すべてオープンソース、npm install)

  • @remotion/transitions — シーン遷移(フェード、スライド、ワイプ)
  • @remotion/three — React Three Fiber を使った動画内 3D シーン
  • @remotion/lottie — Lottie アニメーションを埋め込む
  • @remotion/gif — GIF ファイルを埋め込む
  • @remotion/media-utils — オーディオ/ビデオメタデータユーティリティ
  • @remotion/noise — 自然なエフェクトのための Perlin ノイズ
  • @remotion/paths — SVG パスアニメーションユーティリティ

上流スキルソース

  • 公式スキル: github.com/remotion-dev/skills
  • テンプレート: github.com/reactvideoeditor/remotion-templates
  • Superpowers パイプライン: github.com/dojocodinglabs/remotion-superpowers

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

ever-just/agentskills

> Declarative animations for React. Springs, gestures, layout animations, and page transitions. GPU-accelerated, production-ready.

ever-just/agentskills

> Create animated logos, icons, and micro-interactions as lightweight Lottie JSON files. No After Effects needed — build animations entirely in code.

ever-just/agentskills

> A TypeScript library using generators to program animations with a real-time editor. Ideal for explainer videos, code walkthroughs, and educational content.

ever-just/agentskills

> Add animated subtitles and captions to Remotion videos from .SRT files. TikTok-style word-by-word highlights, karaoke effects, and more.

ever-just/agentskills

> Copy-paste video components for Remotion. Intros, text effects, transitions, and full scene templates. Like shadcn/ui but for video.

ever-just/agentskills

Extract actionable intelligence from video content across YouTube, Vimeo, and company websites. Video reveals what text sources cannot: facility scale, team composition, product demonstrations, signage, event attendance, and operational reality.

ever-just/agentskills

Optimize and embed an existing video as a fast, crisp, autoplaying hero/background/loop on a website. Use when adding or replacing a video on a marketing site and it is too heavy, will not autoplay (especially on mobile/Safari), shows a codec error, or looks soft — to transcode it to web-safe H.264 with the right pixel format, faststart, retina-aware sizing, and a poster frame, then embed and verify it actually plays. This is optimization + embedding of footage you already have, not creating/animating a video (for that use remotion/moviepy/motion-canvas). Use when the user says "add this video to the site", "the hero video is too big / won't play / isn't crisp", "replace the homepage video", or "make this loop on the landing page".

ever-just/agentskills

Full conversion audit for any homepage or landing page. Use when someone asks to "review my homepage," "audit my landing page," "why isn't my page converting," "check my website," or wants feedback on their marketing page. Requires URL or screenshot before proceeding.

ever-just/agentskills

Automatically fetch YouTube video transcripts, generate structured summaries, and send full transcripts to messaging platforms. Detects YouTube URLs and provides metadata, key insights, and downloadable transcripts.

関連スキル