Communitygithub.com

ericrisco/rsc-harness

Remotion を使用して実際の動画ファイル(MP4/MOV)をレンダリングするスキル。React コンポジション、シーケンス/トランジション、キャプションの焼き込み、無音除去、Bロールオーバーレイ、ヘッドレス CI レンダリングを担当します。

rsc-harness とは?

このスキルは、Remotion フレームワークを使った動画エンコードとレンダリングに特化しています。録画、ナレーション、Bロール、トランスクリプト(文字起こし)などのアセットと React コードを入力として受け取り、`out/video.mp4` のような実際の動画ファイルを出力します。`<Composition>`、`<Sequence>`、`<TransitionSeries>` によるコンポジショングラフの構築、Whisper.cpp による音声認識と `toCaptions()` および `createTikTokStyleCaptions()` を使ったアニメーション付きキャプションの焼き込み、`auto-editor` によるソース動画の無音除去、`<OffthreadVideo>` を使った B ロールオーバーレイ、そして `npx remotion render` による最終出力までを一貫して行います。フレーム単位の決定論的レンダリングが中核であり、`useCurrentFrame()` を使ったアニメーション、`--frames=0-45` による短時間テストレンダリングの推奨、`fps` と解像度の固定など、再現性を保証するための厳格なルールを守ります。対応プラットフォームは Remotion v4 以降で、CLI および Claude Code などの AI エージェントから利用できます。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ericrisco/rsc-harness/tree/HEAD/skills/remotion-video

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

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

ドキュメント

Remotion 動画 — 実際のフレームをエンコードする

あなたはエンコーダー兼レンダラーです。 録画、ナレーション、Bロール、トランスクリプトなどのアセットと React コードを受け取り、実際のファイル out/video.mp4 を出力します。他のスキルは文章や計画を書きますが、あなたはピクセルを生成する唯一のスキルです。ここでの厳格さは 再現可能なフレーム、つまり同じ入力から同じ決定論的な出力を、ffprobe で読み取れるレンダリングによって検証することです。

あなたは、Remotion プロジェクトのスキャフォールド、<Composition> / <Sequence> / <TransitionSeries> グラフ、キャプションパイプライン(Whisper.cpp → toCaptions → createTikTokStyleCaptions)、無音除去パス、そしてコーデックと同時実行フラグを指定した npx remotion render の呼び出しを担当します。

唯一の判断基準: フレームか文章か

要求がファイルの生成であれば、ここは正しい場所です。要求がテキストや計画の生成であれば、.tsx を1行も書く前にルーティングしてください。

要求の種類送り先理由
MP4/MOV の生成、トランジション、キャプションの焼き込み、レンダリングこここれらはピクセルとフレームである
スクリプト、フック、ビート、画面上のキャプションテキスト、編集決定シートの作成../video-shorts/SKILL.mdそれらは文章であり、カットの決定事項であって、カットの実行ではない
音声を LUFS ターゲットにマスタリング、チャプターと RSS <item> の生成../podcast/SKILL.md音声マスタリングとフィードであり、動画エンコードではない
レッスン/動画のナラティブアークと流れの構築../course-storytelling/SKILL.mdナラティブアーキテクチャであり、レンダリングではない
サムネイル画像のデザイン../youtube-thumbnails/SKILL.md静止画像であり、動画ではない

境界を一言で: video-shorts がカットを決定しキャプションテキストを書き、あなたはコードでカットを実行しキャプションをフレームに焼き込む。

プロジェクトのスキャフォールド

npx create-video@latest --yes --blank my-video
cd my-video
npm i
npm run dev        # ブラウザで Remotion Studio が開きます

Remotion の現在の安定ラインは 4.0.471 です。Node 16+(または Bun 1.0.3+)が必要で、ローカルレンダリングは macOS 15 (Sequoia)+ をターゲットとします。2026年1月以降、Remotion は Agent Skills を同梱しており、npx skills add remotion-dev/skills を実行すると Claude Code に Remotion 対応のガイダンスが組み込まれます。このスキルと一緒に Remotion フレームワーク独自のスキルをロードしたい場合は、Remotion プロジェクト内で実行してください。

最初に <Composition> で fps と寸法を固定し、プロジェクト途中で変更しないでください。 理由: 以降のすべての長さはフレーム単位で計測され、frames = seconds * fps だからです。長さを書き終えた後に fps を変更すると、すべてのタイミングが静かにずれます。 縦型ショートは 1080×1920 @ 30、横型は 1920×1080 @ 30 です。

コンポジショングラフ

// src/Root.tsx
import { Composition } from "remotion";
import { MyVideo } from "./MyVideo";

export const RemotionRoot: React.FC = () => {
  return (
    <Composition
      id="MyVideo"            // `remotion render` に渡す id
      component={MyVideo}
      durationInFrames={300}  // 30fps で 10 秒
      fps={30}
      width={1080}
      height={1920}
    />
  );
};
// src/MyVideo.tsx
import { AbsoluteFill, Sequence, useCurrentFrame, interpolate, spring, useVideoConfig } from "remotion";

export const MyVideo: React.FC = () => {
  const frame = useCurrentFrame();
  const { fps } = useVideoConfig();
  const opacity = interpolate(frame, [0, 30], [0, 1], { extrapolateRight: "clamp" });
  const scale = spring({ frame, fps, config: { damping: 200 } });
  return (
    <AbsoluteFill style={{ backgroundColor: "black" }}>
      <Sequence from={0} durationInFrames={90}>
        <AbsoluteFill style={{ opacity, transform: `scale(${scale})` }}>{/* シーン 1 */}</AbsoluteFill>
      </Sequence>
      <Sequence from={90} durationInFrames={210}>{/* シーン 2 */}</Sequence>
    </AbsoluteFill>
  );
};

アニメーションは useCurrentFrame() と interpolate()、spring() のみを使用してください。コンポジション内で壁時計時間 (Date.now()) を読み取ったり、シードなしで Math.random() を呼び出したりしないでください。 理由: レンダリングは並列かつフレームアドレス可能です。各フレームは独立して計算されるため、フレーム以外の入力を使用すると再レンダリング時に異なるピクセルが生成され、「同じ入力、同じ出力」の保証が破られます。 ランダム性が必要な場合は、Remotion の random(seed) を使用してください。

トランジション

@remotion/transitions を使用してください(v4.0.53 以降で利用可能)。<TransitionSeries> は .Sequence(クリップ、durationInFrames で指定)と .Transition(presentation + timing)を交互に配置します。トランジションの長さは合計から差し引かれるため、隣接するシーケンスはトランジション中に重なります。

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

<TransitionSeries>
  <TransitionSeries.Sequence durationInFrames={90}>{/* シーン A */}</TransitionSeries.Sequence>
  <TransitionSeries.Transition
    presentation={slide({ direction: "from-left" })}
    timing={springTiming({ config: { damping: 200 }, durationInFrames: 30, durationRestThreshold: 0.001 })}
  />
  <TransitionSeries.Sequence durationInFrames={120}>{/* シーン B */}</TransitionSeries.Sequence>
  <TransitionSeries.Transition
    presentation={fade()}
    timing={linearTiming({ durationInFrames: 15, easing: Easing.inOut(Easing.ease) })}
  />
  <TransitionSeries.Sequence durationInFrames={90}>{/* シーン C */}</TransitionSeries.Sequence>
</TransitionSeries>

各プレゼンテーションはサブインポートです(@remotion/transitions/slide、/fade、/wipe、/flip、/clockWipe、/none)。

プレゼンテーション印象 / 使用場面
slide次のシーンが現在のシーンを押し出す; ビート間の方向性のある動き
fadeソフトなクロスフェード; 穏やかでニュートラルなシーン変更
wipeハードエッジが画面を横切る; エネルギッシュで「次のトピック」
flip3D カードフリップ; 遊び心があり、何かを明らかにするときに
clockWipe放射状スイープ; カウントダウン、「時間の経過」
none動きのないハードカットだが、TransitionSeries ノードとして機能

予測可能でフレーム単位の正確なカットには linearTiming、有機的な動きには springTiming。 理由: linear は長さが決定論的なのでフレーム数を正確に予算化できます。spring はオーバーシュートして落ち着くため自然に見えますが、レンダリングがいつ終了したかを知るために durationRestThreshold が必要です。

アニメーション付き焼き込みキャプション

ネイティブの @remotion/captions パッケージは v4.0.216 で導入されました(古い convertToCaptions() ヘルパーが非推奨となった同じリリースです)。パイプラインは Node サーバー上で一度実行され、その後コンポジションがキャプションを読み取ります:

  1. 文字起こし。 @remotion/install-whisper-cpp が Whisper.cpp とモデル(medium.en は約 1.5 GB)をダウンロードし、Node サーバー上で音声を文字起こして Whisper JSON を出力します。
  2. 変換。 @remotion/install-whisper-cpp の toCaptions() がその JSON を、トークンごとのタイムスタンプを持つ Caption[] に変換します。(convertToCaptions() は v4.0.216 で非推奨となったレガシーエイリアスです。toCaptions() を使用してください。)
  3. ページへの分割。 @remotion/captions の createTikTokStyleCaptions({ captions, combineTokensWithinMilliseconds }) がトークンをグループ化し、一緒に表示される「ページ」にします。

combineTokensWithinMilliseconds の値がページサイズの調整ダイヤルです。 理由: 低い値(~200ms)では各単語が独立したページになり → 単語ごとのポップアニメーション、高い値(~1200ms)ではフレーズごとにまとまります。 低い ms = TikTok の単語単位のエネルギー、高い ms = 読みやすいフレーズ。デフォルトではなく、フォーマットに応じて選択してください。

完全な Whisper.cpp インストール手順、文字起こしサーバー、トークンハイライト付きキャプションレンダラーコンポーネント(セーフゾーンスタイリング付き)は references/captions-pipeline.md にあります。キャプションレイヤーを構築する前に読んでください。

自動無音除去

無音除去パスは、Remotion に渡す 前 のソース音声/動画に対して実行します。 コンポジション内では実行しません。理由: Remotion は与えられたフレームをレンダリングします。無音部分のトリミングはアセットに対する上流の編集であり、先に行うことで、以降のすべてのフレーム番号がすでにタイトになったタイムラインを反映します。

auto-editor(Python + ffmpeg エンジン)を使用して、音声のラウドネスに基づいて無音部分をカットする最初のパスを実行します:

auto-editor input.mp4 --margin 0.2s --edit audio:threshold=4% -o tightened.mp4
  • --margin は各保持領域にパディングを追加し、カットが話し言葉の冒頭を切らないようにします。
  • --edit audio:threshold=4% は、領域が「無音」とみなされるラウドネスのしきい値を設定します。
  • --export premiere はファイルの代わりに EDL/XML を出力し、NLE に再インポートできるようにします。

pip ディストリビューションは古く/非推奨です。公式バイナリまたは pipx を使用してインストールしてください。pip install は使わないでください。 理由: PyPI パッケージは遅れており、ドキュメントに記載されたフラグと一致しない可能性があります。 auto-editor が利用できない場合の低レベルフォールバックは、ffmpeg の silencedetect / silenceremove フィルターです。両方の完全なフラグマトリックスは references/render-and-pipeline.md にあります。

B ロールオーバーレイ

オーバーレイをメイン動画の上に重ねるには、<AbsoluteFill> 内に <OffthreadVideo>(または <Img>)を配置し、<Sequence from> でタイミングを制御します:

import { AbsoluteFill, Sequence, OffthreadVideo, staticFile } from "remotion";

const fps = 30;
const broll = { start: 4.0, duration: 3.0 }; // 秒
<AbsoluteFill>
  <OffthreadVideo src={staticFile("main.mp4")} />        {/* ベースレイヤー */}
  <Sequence from={Math.round(broll.start * fps)} durationInFrames={Math.round(broll.duration * fps)}>
    <AbsoluteFill style={{ /* 例: ピクチャーインピクチャーのための inset */ }}>
      <OffthreadVideo src={staticFile("broll.mp4")} />    {/* オーバーレイレイヤー */}
    </AbsoluteFill>
  </Sequence>
</AbsoluteFill>

すべてのタイムコードを境界で Math.round(seconds * fps) を使用してフレームに変換してください。 理由: 4.0 秒の B ロールキューは 30fps ではフレーム 120 ですが、60fps ではフレーム 240 になります。データ内では秒を維持し、useVideoConfig() から fps を乗算することで、fps を変更してもオーバーレイが同期しなくなります。 レンダリング中にフレーム単位のデコードを行うには、<OffthreadVideo>(DOM の <video> や <Video> ではなく)を使用してください。

レンダリング

# 最初にテスト: 1〜2 秒、パイプラインを安価に検証
npx remotion render MyVideo out/test.mp4 --frames=0-45

# その後、本レンダリング
npx remotion render MyVideo out/video.mp4

コンポジション id を省略すると、インタラクティブなピッカーが表示されます。remotion.config.ts の @remotion/cli/config で設定するか、CLI にフラグを渡します(フラグが優先):

// remotion.config.ts
import { Config } from "@remotion/cli/config";
Config.setConcurrency(8);
Config.setCodec("h264");
コーデック使用場面フラグ
h264Web/YouTube のデフォルト; 広範な互換性(デフォルト)
h265より小さいファイル、同じ品質、ユニバーサル再生は不可--codec=h265
prores編集グレードのマスター、大きなファイル、NLE に再インポート--codec=prores --prores-profile=4444 --pixel-format=yuva444p10le --image-format=png
vp8 / gifWeb アルファまたはループプレビュー--codec=vp8 / --codec=gif

本レンダリングの前に必ず 1〜2 秒の範囲 (--frames=0-45) でレンダリングしてください。 理由: 数分のコンポジションのフルレンダリングは時間と CPU を消費します。範囲テストは、壊れたキャプションレイヤーや不足しているアセットを数秒で発見します。 ヘッドレス/CI レンダリング、決定論的出力ルール、コーデック/品質マトリックスの詳細については、references/render-and-pipeline.md を参照してください。

アンチパターン

悪い例なぜ壊れるか良い例
JSX 内で長さを秒でハードコーディングRemotion はフレーム単位で考える; fps が変わると秒がずれるデータ内で秒を保持し、境界で Math.round(seconds * fps) を使用する
コンポジション内で Date.now() / 未シードの Math.random() を使用フレームは並列かつ再レンダリング時にレンダリング → 非決定論的なピクセルuseCurrentFrame() からすべてを駆動; random(seed) を使用する
長さを書いた後に fps を変更すべてのフレームカウントが下流で静かにずれる最初に <Composition> で fps + 寸法を固定し、変更しない
実行のたびに Whisper モデルを再ダウンロード約 1.5 GB の medium.en ダウンロードが繰り返され、パイプラインが停止する一度ダウンロードし、モデルパスをキャッシュして再利用する
1.5 GB の Whisper モデルを git にコミットリポジトリが肥大化する; モデルはビルドアセットであるモデルディレクトリを .gitignore し、セットアップ/CI で取得する
変更をテストするためにフル動画をレンダリング壊れたレイヤーを見つけるために何分もの無駄なレンダリング--frames=0-45 の範囲テスト、その後フルレンダリング
ここでキャプションのコピーやフックを書くそれはスクリプトであり、エンコードではない../video-shorts/SKILL.md にルーティング; あなたは焼き込むだけ
レンダリング内の B ロールに単純な <video> / <Video> を使用フレーム単位ではなく、レンダリング時にテアリングやスキップが発生するフレーム単位のデコードには <OffthreadVideo> を使用する
コンポジション内で無音除去を実行無音部分のトリミングは上流のアセット編集であるRemotion の前にソースファイルで auto-editor を実行する

検証とリファレンス

  • bash scripts/verify.sh <project-dir> — Remotion プロジェクトが適切に構成され、レンダリング可能かを確認します。Node + ffmpeg が存在する場合は、npx remotion compositions を実行してコンポジション id が存在することを確認し、短い範囲レンダリングを一時 MP4 に実行し、ffprobe を使用して期待される寸法/fps のビデオストリームを確認します。どちらもない場合は、静的チェックにフォールバックします: 少なくとも 1 つのコンポジション .tsx が存在し、レンダリングスクリプトが実際のコンポジション id と出力パスを参照していることを確認します。デフォルトでは読み取り専用で、空/クリーンなターゲットの場合は 0 で終了します。
  • references/captions-pipeline.md — 完全な Whisper.cpp インストール + 文字起こしサーバー、toCaptions、トークンハイライト付きキャプションレンダラーコンポーネント、キャプションスタイリング/セーフゾーンメモ。
  • references/render-and-pipeline.md — auto-editor + ffmpeg 無音コマンド、完全なレンダリングフラグマトリックス、ヘッドレス/CI レンダリング、コーデックテーブル、ffprobe 検証。

Individual skills in this repo

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

ericrisco/rsc-harness

Use when writing the words on a single conversion page — the hero headline and subhead, the offer, the proof and testimonials, and one primary CTA — or diagnosing a page that gets traffic and does not convert, as a copy problem rather than a layout one. NOT the paid ad that drives the click (that is `ads`), NOT the visual layout the words sit in (that is `design`), NOT the experiment that picks the winning variant (that is `ab-testing`).

ericrisco/rsc-harness

Use when you have raw 9:16 footage and need it cut into a post-ready vertical short — dead air removed, fast jump cuts, karaoke word-by-word burned-in captions from a transcript, cuts and zooms snapped to the music beat, safe-area placement so captions clear the platform UI, and a platform-correct MP4 export. NOT writing the script, hook, beats or caption text (that is `video-shorts`), NOT building a Remotion React composition codebase (that is `remotion-video`), NOT deciding when or where to post (that is `social-publisher`).

ericrisco/rsc-harness

Use when a Reels/TikTok/Shorts account needs its next video ideas scored into a ranked backlog, grounded in its own performance log plus dated trending sounds, each bet logged so its outcome feeds the next batch. NOT scripting a chosen idea (that is `video-shorts`), NOT pillars or cadence (that is `shortform-strategy`), NOT packaging a finished cut (that is `shortform-packaging`).

ericrisco/rsc-harness

Use when a vertical short is shot or scripted and you need the upload-form copy and cover that win the feed — the hook line, the first-frame on-screen text, the search-led caption, a tight hashtag set, and the cover frame; it learns from what performed via the 02-DOCS log. NOT inventing the idea (that is `shortform-ideation`), NOT scripting or directing the cuts (that is `video-shorts`), NOT executing the edit (that is `shortform-editing`), NOT scheduling the post (that is `social-publisher`).

ericrisco/rsc-harness

Use when the unit of work is a TikTok/Reels account, not one clip: positioning, sustainable cadence and format mix, ride-or-skip on a trend or sound, recurring series, diagnosing a flat account, and the dated learning loop. NOT the single script or hook variants (that is `video-shorts`), NOT the idea backlog (that is `shortform-ideation`).

ericrisco/rsc-harness

Use when planning a posting schedule, building a multi-platform content calendar, or reshaping one source asset into channel-native posts across X, LinkedIn, Instagram, Threads, Bluesky, TikTok, Facebook or YouTube — cadence, best-time slots, per-platform format limits, API publish caps, and a dated CSV or JSON calendar a scheduler can import. NOT the brand voice the posts speak in (that is `brand-voice`), NOT the editorial strategy of what to make (that is `content-engine`).

ericrisco/rsc-harness

Use when connecting a real TikTok account to code via the Content Posting, Display and Business Account APIs — OAuth, chunked video publish with status polling, and pulling views, watch time and impression sources, then logging that performance into the wiki as a dated feedback record. Covers short-lived tokens breaking a cron, unverified pull-from-URL ownership, and rate limits. NOT what to post or how to package it (that is `shortform-strategy` and `shortform-packaging`).

ericrisco/rsc-harness

Use when scripting or directing the edit of a single vertical short that has to hold attention from the first frame — turning a topic, a clip or a long video into a shot-by-shot script and an edit decision sheet, fixing a hook that dies in second three, generating hook variants to test, and planning cuts and on-screen text. NOT scheduling or cross-platform cadence (that is `social-publisher`), NOT running the editorial calendar (that is `content-engine`), NOT defining the durable brand tone (that is `brand-voice`).

ericrisco/rsc-harness

Use to judge whether a short-form clip is worth publishing — scores a reel, short or podcast excerpt 0-100 on ten weighted criteria with automatic penalties, then ranks a batch and says where the cut-off falls. Run it on transcript candidates before rendering. NOT writing the hook or caption (that is `shortform-packaging`), NOT inventing the idea (that is `shortform-ideation`), NOT executing the edit (that is `shortform-editing`).

関連スキル