Communitygithub.com

Hownameee/ショートビデオ

コンテンツ、アニメーション、エフェクトのベストプラクティス

ショートビデオ とは?

このスキルは、Remotionを使用したReactベースの動画制作で、短尺動画(ショートビデオ)に最適なコンテンツ、アニメーション、エフェクトの実装を支援します。Claude CodeやCursor、CodexなどのAIエージェントが、このスキルに従って効率的なコードを生成できます。`useCurrentFrame()`と`interpolate()`を使ったアニメーション駆動や、インタラクティブコンポーネントの推奨パターン、動画・オーディオ・画像などのメディアアセットの適切な扱い方を網羅しています。また、トランジション、モーションブラー、テキストハイライト、3Dコンテンツ、地図など、多様なエフェクトや機能に関するリファレンスへのリンクも含まれており、開発者はこれをガイドとして高品質な動画を迅速に構築できます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Hownameee/short-videos/tree/HEAD/.agent/skills/remotion-markup

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

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

プレビュー

スキル README より

ドキュメント

これはRemotion Reactマークアップのガイダンスです。 これに関係ない場合は、代わりにRemotionのベストプラクティスをロードしてください。

ユーザーによる変更の保持

ユーザーが会話の外部でコードを編集することがあります。

その間に驚くような変更を検出した場合は、上書きせず、意図的なものであると想定するか、確認を求めてください。

一般ルール

アニメーションはuseCurrentFrame()とinterpolate()を使用して駆動します。 CSSのtransitionやanimationは正しくレンダリングされないため、リファクタリングが必要です。 Tailwindのアニメーションクラスは正しくレンダリングされないため、リファクタリングが必要です。

タイミングのカスタマイズにはEasing.bezier()とEasing.spring()を使用します。

Remotionのインタラクティブ性のベストプラクティスに従ってマークアップを構成します。 編集可能なプロパティを持つカスタムビジュアルコンポーネントにはInteractive.withSchema({wrapInSequence: true})を優先し、再利用可能なシーンは接続されたコンポジションとして登録します。 タイミングをサポートするコンポーネントに直接タイミングを設定し、冗長な<Sequence>ラッパーは避けます。 premountForをサポートするすべてのタイミングコンポーネントに、1秒間のプリマウントを設定します: premountFor={fps}(fpsはuseVideoConfig()から取得)。これをメディア、インタラクティブコンポーネント、<Sequence>、<Series.Sequence>、 <TransitionSeries.Sequence>、<TransitionSeries.Overlay>に適用します。 シーン内にネストされたタイミングコンポーネントも含みます。 ネストされたアイテムが親の開始前にマウントする必要がある場合は、親のタイムラインアイテムもプリマウントします。 premountForがないコンポーネント(<TransitionSeries.Transition>など)は代替の必要はありません。

スタジオは、アイテムを作成したJSXソースノードを編集します。すべてのコンポジション登録、クリップ、シーン、レイヤー、シーケンスは、独立して編集可能な独自のJSXノードとして、編集可能なプロパティをインラインに記述します。 プログラムによるループは、生成されたインスタンスをユーザーが個別に編集する必要がある場合ではなく、1つのソーステンプレートとして意図的に制御する場合に適しています。

import { useCurrentFrame, useVideoConfig, Easing, interpolate, Interactive } from "remotion";

export const FadeIn = () => {
  const frame = useCurrentFrame();
  const {fps} = useVideoConfig();

  return (
    <Interactive.Div
      name="タイトル"
      premountFor={fps}
      style={{
        opacity: interpolate(frame, [0, 2 * fps], [0, 1], {
          extrapolateRight: "clamp",
          extrapolateLeft: "clamp",
          easing: Easing.bezier(0.16, 1, 0.3, 1),
        }),
      }}
    >
      こんにちは世界!
    </Interactive.Div>
  );
};

interpolate()の呼び出しはstyleプロパティにインラインで記述します。 transformの代わりにCSSプロパティscale、translate、rotateを使用します。

// 👍 インラインで編集可能なキーフレームとtransformのショートハンド
style={{
  scale: interpolate(frame, [0, 100], [0, 1], {
    extrapolateLeft: 'clamp',
    extrapolateRight: 'clamp',
    easing: Easing.spring({damping: 200}),
    output: 'perceptual-scale' // `scale`アニメーションの場合は "output: 'perceptual-scale'" を使用
  }),
  translate: interpolate(frame, [0, 100], ["0px 0px", "100px 100px"], {
    extrapolateLeft: 'clamp',
    extrapolateRight: 'clamp',
    easing: Easing.spring({damping: 200}),
  }),
  rotate: interpolate(frame, [0, 100], ["20deg", "90deg"], {
    extrapolateLeft: 'clamp',
    extrapolateRight: 'clamp',
    easing: Easing.spring({damping: 200}),
  }),
}}

// 👎 インラインでない値やtransform文字列はスタジオでの編集が難しくなる
const scale = interpolate(frame, [0, 100], [0, 1]);

style={{
  transform: `scale(${scale})`,
}}

アセット

アセットはプロジェクトルートのpublic/フォルダに配置します。 public/フォルダのファイルを参照するにはstaticFile()を使用します。

メディアコンポーネント

ビデオとオーディオは@remotion/mediaの<Video>と<Audio>を使用して追加します。 画像は<CanvasImage>コンポーネントを使用して追加します。 アニメーションGIF、APNG、WebP、AVIF画像は<AnimatedImage>を使用し、Chrome以外の場合は@remotion/gifを使用します。 public/内のファイルにはstaticFile()を使用するか、リモートURLを直接渡します:

import { Audio, Video } from "@remotion/media";
import { staticFile, CanvasImage, AnimatedImage, useVideoConfig } from "remotion";

export const MyComposition = () => {
  const {fps} = useVideoConfig();

  return (
    <>
      <Video src={staticFile("video.mp4")} premountFor={fps} style={{ opacity: 0.5 }} />
      <Audio src={staticFile("audio.mp3")} premountFor={fps} />
      <CanvasImage
        src={staticFile("logo.png")}
        premountFor={fps}
        style={{ width: 100, height: 100 }}
      />
      <Video src="https://remotion.media/video.mp4" premountFor={fps} />
      <AnimatedImage src={staticFile('nyancat.gif')} premountFor={fps} />
    </>
  );
};

コンポジションが主にビデオまたはオーディオクリップのタイムラインである場合は、ソース構造を選択する前にvideo-editing.mdをお読みください。

シーンの例

背景ビデオとローワーサード。 ローワーサードは独自のタイムラインを持つインタラクティブコンポーネントで、接続されたコンポジションとして登録されています。 そのテキストはchildrenとして渡され、accentColorは編集可能なプロパティです。 フェードインは呼び出し元のサイトでインラインでキーフレーム設定されています。

// MyScene.tsx
import { Video } from "@remotion/media";
import { Easing, interpolate, useCurrentFrame, useVideoConfig } from "remotion";
import { LowerThird } from "./LowerThird";

export const MyScene = () => {
  const { fps } = useVideoConfig();
  const frame = useCurrentFrame();

  return (
    <>
      <Video
        name="背景"
        src="https://remotion.media/video.mp4"
        premountFor={fps}
        objectFit="cover"
        style={{
          position: "absolute",
          width: "100%",
          height: "100%",
        }}
      />
      <LowerThird
        name="ローワーサード"
        from={1 * fps}
        premountFor={fps}
        accentColor="#0b84f3"
        style={{
          opacity: interpolate(frame, [1 * fps, 2 * fps], [0, 1], {
            extrapolateRight: "clamp",
            extrapolateLeft: "clamp",
            easing: Easing.bezier(0.16, 1, 0.3, 1),
          }),
        }}
      >
        山田太郎、プロダクトデザイナー
      </LowerThird>
    </>
  );
};
// LowerThird.tsx
import type React from "react";
import { Interactive, type InteractivitySchema } from "remotion";

type LowerThirdProps = {
  readonly children: string;
  readonly accentColor: string;
  readonly style?: React.CSSProperties;
};

const LowerThirdInner: React.FC<LowerThirdProps> = ({
  children,
  accentColor,
  style,
}) => {
  return (
    <Interactive.Div
      style={{
        position: "absolute",
        left: 80,
        bottom: 80,
        display: "flex",
        alignItems: "center",
        gap: 20,
        backgroundColor: "white",
        borderRadius: 16,
        padding: "20px 32px",
        color: "black",
        fontFamily: "Helvetica, Arial, sans-serif",
        fontSize: 48,
        fontWeight: 600,
        ...style,
      }}
    >
      <div
        style={{
          width: 8,
          alignSelf: "stretch",
          borderRadius: 4,
          backgroundColor: accentColor,
        }}
      />
      {children}
    </Interactive.Div>
  );
};

const lowerThirdSchema = {
  children: { type: "text-content", default: "", description: "テキスト" },
  accentColor: {
    type: "color",
    default: "#0b84f3",
    description: "アクセントカラー",
  },
} as const satisfies InteractivitySchema;

export const LowerThird = Interactive.withSchema({
  Component: LowerThirdInner,
  componentName: "<LowerThird>",
  schema: lowerThirdSchema,
  wrapInSequence: true,
});
// Root.tsx
import { Composition } from "remotion";
import { LowerThird } from "./LowerThird";
import { MyScene } from "./MyScene";

export const RemotionRoot: React.FC = () => {
  return (
    <>
      <Composition
        id="MyScene"
        component={MyScene}
        durationInFrames={60}
        fps={30}
        width={1280}
        height={720}
      />
      <Composition
        id="LowerThird"
        component={LowerThird}
        durationInFrames={30}
        fps={30}
        width={1280}
        height={720}
        defaultProps={{
          children: "山田太郎、プロダクトデザイナー",
          accentColor: "#0b84f3",
        }}
      />
    </>
  );
};

遅延、トリミング

タイミングをサポートするコンポーネントに直接タイミングを設定します。サポートされているプロパティ、例、操作順序については、Timing propsを参照してください。

地図

ビデオに地図を含めたい場合は、Remotion Mapsを参照してください。

テキストハイライトと注釈

テキストハイライト(ハイライトマーカー)、円、下線、取り消し線、打ち消しテキスト、ボックスについては、text-highlights.mdを参照してください。

マルチシーンビデオ

複数の連続するシーンを持つビデオを作成する予定の場合は、multi-scene-video.mdを参照してください。

接続されたコンポジション

シーンまたはレイヤーのグループに独自の編集可能なタイムラインが必要な場合は、connected-compositions.mdに従ってください。マルチシーンビデオの重要なシーンにはこの構造を優先します。

プリコンポーズアクション

「Ambient glowをプリコンポーズ(src/BarChart.tsx:134)」のようなスタジオリクエストの場合、指定された場所にある選択されたシーケンスマークアップを見つけます。接続されたコンポジションを作成し、connected-compositions.mdに従います:マークアップを名前付きコンポーネントに抽出し、できればInteractive.withSchema({wrapInSequence: true})でインタラクティブにし、同じエクスポートされたコンポーネント参照をルートの一意の<Composition>に登録します。インタラクティブコンポーネントをタイミングプロパティとともに直接レンダリングするか、ラッパーに目的がある場合はシーケンスの唯一の子としてレンダリングします。選択されたノードがすでにシーケンスである場合は、そのプロパティを保持し、子を抽出します。登録には、親の使用と同等の寸法、fps、duration、defaultPropsが必要です。登録されたコンポジションがないコンポーネントの抽出は、プリコンポーズリクエストを完了しません。

ナレーション

ElevenLabs TTSを使用してRemotionコンポジションにAI生成のナレーションを追加するには、voiceover.mdを参照してください。

ビデオの埋め込み

ビデオの埋め込み(トリミング、音量、速度、ループ、ピッチ)に関する高度な知識については、embedding-videos.mdを参照してください。

オーディオの埋め込み

トリミング、音量、速度、ピッチなどの高度なオーディオ機能については、audio.mdを参照してください。

クロッピング

コンポーネントの表示領域をクロップする必要がある場合は、cropping.mdを参照してください。

トランジション

シーントランジションパターンについては、transitions.mdを参照してください。

モーションブラー

モーションブラーまたは移動軌跡を追加する場合は、推奨されるHTMLインキャンバスアプローチ、プレビュー要件、および代替案についてmotion-blur.mdをお読みください。

ビジュアルエフェクトとピクセルエフェクト

ビジュアルエフェクトを作成する場合、CSSとHTMLで実現可能か、それともシェーダーが必要かを検討します。 優先順位:

  1. 通常のHTML + CSSまたはその他のWeb技術
  2. 要素に直接適用するエフェクト(<Video>、<Img>)、またはコンテンツを<HtmlInCanvas>でラップする方法。<HtmlInCanvas>はeffectsも受け入れます:
    • effects.mdでリストされているエフェクト
    • プリセットがない場合のeffects.mdによるカスタムcreateEffect()

3Dコンテンツ

Three.jsとReact Three Fiberを使用したRemotionの3Dコンテンツについては、./3d.mdを参照してください。

効果音

効果音を使用する必要がある場合は、./sfx.mdファイルをロードして詳細を確認してください。

オーディオビジュアライゼーション

オーディオを視覚化する必要がある場合(スペクトラムバー、波形、低音反応エフェクト)は、./audio-visualization.mdファイルをロードして詳細を確認してください。

地図

静的マップ、アニメーションルートとマーカー、地理的な説明、Mapbox、MapLibre、MapTiler、GeoJSON、または3D地理フライオーバーについては、Remotion Mapsをロードしてください。

キャプション

キャプションまたは字幕を扱う場合は、Remotion Captionsスキルをロードして詳細を確認してください。

Google Fonts

Remotionでフォントをロードする推奨方法です。Google Fontsをロードする方法については、google-fonts.mdを参照してください。

ローカルフォント

ローカルフォントをロードする方法については、local-fonts.mdを参照してください。

GIF

Remotionのタイムラインと同期してGIFを表示する方法については、gifs.mdを参照してください。

詳細な画像

画像のサイズ設定と配置、動的な画像パス、画像の寸法取得については、images.mdを参照してください。

Lottieアニメーション

RemotionにLottieアニメーションを埋め込む方法については、lottie.mdを参照してください。

タイミング

interpolate()のその他のタイミングテクニックについては、timing.mdを参照してください。

パラメータ化された動画

Zodスキーマを追加してコンポジションをパラメータ化可能にする方法については、parameters.mdを参照してください。

DOMノードの測定

RemotionでDOM要素の寸法を測定する方法については、measuring-dom-nodes.mdを参照してください。

テキストの測定

テキストの寸法測定、コンテナへのテキストのフィッティング、オーバーフローの確認については、measuring-text.mdを参照してください。

FFmpegの使用

ビデオのトリミングや無音検出など、一部のビデオ操作にはFFmpegを使用する必要があります。./ffmpeg.mdファイルをロードして詳細を確認してください。

無音検出

ビデオまたはオーディオファイルから無音部分を検出してトリミングする必要がある場合は、./silence-detection.mdファイルをロードしてください。

動的なduration、寸法、データ

コンポジションのduration、寸法、プロパティを動的に設定する方法については、calculate-metadata.mdを参照してください。

コンポジションとスティル

<Composition>または<Still>要素を登録する前に、ソース編集可能な登録、フォルダ、デフォルトプロパティ、ネスティングについてcompositions.mdをお読みください。シーンの独自のタイムラインへのスタジオナビゲーションには、接続されたコンポジションを使用します。

高度なシーケンス

その他のシーケンスパターン(遅延、トリミング、アイテムのduration制限)については、sequencing.mdを参照してください。

モジュールのインストール

適切なバージョンで新しいパッケージを追加するには、npx remotion addを使用します:

npx remotion add @remotion/media

Individual skills in this repo

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

Hownameee/short-videos

Generate, revise or troubleshoot local Kokoro narration, pronunciation and scene word timing. Reuse verified unchanged clips; inspect the Python environment before setup changes. Exclude research, visuals, music composition and publishing.

Hownameee/short-videos

Router for all Remotion skills

Hownameee/short-videos

Transcribing, displaying and animating captions

Hownameee/short-videos

Structure Remotion markup for interactivity

Hownameee/short-videos

Remotion Map animation knowledge

Hownameee/short-videos

Upgrade Remotion, and related packages

Hownameee/short-videos

>- Run Phase 1 of the shared short-video workflow: turn a raw topic or prompt into a sourced research pack and 2–4 distinct video directions, each with a defensible tension hook, promise, payoff, beats, visual approach, duration range, and risks. Use whenever the user asks for video ideas, angles, research, facts, hooks, topic analysis, or choices before scriptwriting. Stop for the user's direction choice and do not silently continue into script or production.

Hownameee/short-videos

Produce an approved short video or correct an existing video's background sound, emotion, captions, mix or export. Generate only changed narration, render and review a current preview, run technical and editorial QC, then export. Exclude script-only and general audio-advice requests.

Hownameee/short-videos

>- Run Phase 2 of the shared short-video workflow: convert an explicitly selected direction and its research into a reviewable beat sheet, narration, flexible scene timing, on-screen text, visual plan, captions, music and SFX cues, pronunciation notes, payoff, takeaway, and contextual CTA. Use whenever a user asks to write, revise, preview, or approve a short-video script. Stop for script approval and do not generate TTS or render video yet.

Hownameee/short-videos

>- Design and review a coherent visual system for short-form video before and during Remotion implementation. Use for video art direction, scene UI, typography, layout, color, diagrams, captions, motion, transitions, platform safe areas, or visual-quality review. Use Remotion skills separately for API, timeline, media, Studio, and rendering behavior; do not use this skill for narration-only or research-only work.

Hownameee/short-videos

Coordinate prompt-to-short-video discovery, scripting and production. Resume existing projects and route soundtrack or mix corrections directly to production. Preserve direction choice and script approval; exclude general audio advice.

関連スキル