remotion について
@json-render/remotion は、JSON のタイムライン仕様を Remotion の動画コンポジションに変換します。構造化されたタイムラインから動画を作る開発者向けで、標準・カスタムコンポーネント、トランジション、エフェクト定義を利用できます。
主な機能
- 01タイムライン仕様をコンポジションに変換
- 02標準のシーン・オーバーレイコンポーネント
- 03カスタムコンポーネントの追加
- 04トランジションとエフェクトの定義
- 05トランジションアニメーションフック
活用シーン
- 01タイムライン JSON から動画コンポジションを作成
- 02タイトルカードや画像スライドでシーンを構成
- 03ローワーサードなどのオーバーレイを追加
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ vercel-labs/ json-render --skill remotionインストール後、Claude Code で/remotionを入力して読み込まれたか確認します。
詳細
@json-render/remotion
JSON タイムライン仕様を動画コンポジションに変換する Remotion レンダラーです。
クイックスタート
import { Player } from "@remotion/player";
import { Renderer, type TimelineSpec } from "@json-render/remotion";
function VideoPlayer({ spec }: { spec: TimelineSpec }) {
return (
<Player
component={Renderer}
inputProps={{ spec }}
durationInFrames={spec.composition.durationInFrames}
fps={spec.composition.fps}
compositionWidth={spec.composition.width}
compositionHeight={spec.composition.height}
controls
/>
);
}
標準コンポーネントの使用
import { defineCatalog } from "@json-render/core";
import {
schema,
standardComponentDefinitions,
standardTransitionDefinitions,
standardEffectDefinitions,
} from "@json-render/remotion";
export const videoCatalog = defineCatalog(schema, {
components: standardComponentDefinitions,
transitions: standardTransitionDefinitions,
effects: standardEffectDefinitions,
});
カスタムコンポーネントの追加
import { z } from "zod";
const catalog = defineCatalog(schema, {
components: {
...standardComponentDefinitions,
MyCustomClip: {
props: z.object({ text: z.string() }),
type: "scene",
defaultDuration: 90,
description: "My custom video clip",
},
},
});
// Pass custom component to Renderer
<Player
component={Renderer}
inputProps={{
spec,
components: { MyCustomClip: MyCustomComponent },
}}
/>
タイムライン仕様の構造
{
"composition": { "id": "video", "fps": 30, "width": 1920, "height": 1080, "durationInFrames": 300 },
"tracks": [{ "id": "main", "name": "Main", "type": "video", "enabled": true }],
"clips": [
{ "id": "clip-1", "trackId": "main", "component": "TitleCard", "props": { "title": "Hello" }, "from": 0, "durationInFrames": 90 }
],
"audio": { "tracks": [] }
}
標準コンポーネント
| コンポーネント | 種類 | 説明 |
|---|---|---|
TitleCard | scene | サブタイトル付きの全画面タイトル |
TypingText | scene | ターミナル風のタイピングアニメーション |
ImageSlide | image | 全画面の画像表示 |
SplitScreen | scene | 2 パネルの比較 |
QuoteCard | scene | 引用と出典 |
StatCard | scene | アニメーション付きの統計表示 |
TextOverlay | overlay | テキストオーバーレイ |
LowerThird | overlay | 名前/タイトルのオーバーレイ |
主なエクスポート
| エクスポート | 目的 |
|---|---|
Renderer | 仕様を Remotion コンポジションにレンダリングします |
schema | タイムラインスキーマ |
standardComponents | 事前構築済みコンポーネントレジストリ |
standardComponentDefinitions | カタログ定義 |
useTransition | トランジションアニメーションフック |
ClipWrapper | トランジション付きでクリップをラップします |
コメント
Markdown 対応