4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

HyperFrames 入門:HTML で動画を作る仕組みと Remotion との違い、Claude Code に15秒の動画を作らせるまで

4
Last updated at Posted at 2026-10-30

初めに

この記事では次の 3 つをやります。

  1. HyperFrames の仕組みを、最小のコードで説明する
  2. 同じ 5 秒の映像を Remotion でも書いて比べる
  3. Claude Code に 15 秒の動画を頼み、何をして、何分・いくらで仕上げたかを見る

結論

HyperFrames Remotion
書くもの HTML + CSS + GSAP React
時間の決め方 要素に「何秒目から何秒出すか」を属性で書く 「今が何コマ目か」から値を計算する
ライセンス Apache-2.0 個人や 3 人までの会社は無料。それ以外は有料の Company License
向いている人 HTML を 1 枚書く感覚で作りたい人、AI に書かせたい人 React に慣れている人

Claude Code に頼んだ 15 秒の動画は、約 6 分 45 秒、Claude Code の表示で 2.48 ドル分で、書き出しまで終わりました。

HyperFrames の仕組み

ブラウザで HTML を開き、時刻を 1 コマずつ進めて撮り、MP4 にします。Node.js 22 以上と FFmpeg が要ります(README)。

npx hyperframes init my-video
cd my-video
npx hyperframes preview   # ブラウザでプレビュー
npx hyperframes check     # 書き方の誤り・はみ出し・文字の読みやすさを点検
npx hyperframes render    # MP4 に書き出す

最小の例

題が下から出て、棒グラフが 3 本伸びる 5 秒の映像です。

index.html
<!doctype html>
<html lang="ja">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=1920, height=1080" />
    <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
    <style>
      body { margin: 0; background: #f5f1e8; color: #1d1d1f; font-family: system-ui, sans-serif; }
      #root { position: relative; width: 100%; height: 100%; overflow: hidden; }
      .clip { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 64px; }
      h1 { margin: 0; font-size: 110px; }
      .bars { display: flex; align-items: flex-end; gap: 48px; height: 400px; }
      .bar { width: 160px; background: #e8603c; transform-origin: bottom; }
    </style>
  </head>
  <body>
    <div id="root" data-composition-id="main" data-start="0" data-width="1920" data-height="1080" data-duration="5">
      <section id="scene" class="clip" data-start="0" data-duration="5">
        <h1 id="title">HTML で動画を作る</h1>
        <div class="bars">
          <div class="bar" style="height: 120px"></div>
          <div class="bar" style="height: 240px"></div>
          <div class="bar" style="height: 400px"></div>
        </div>
      </section>
    </div>
    <script>
      const tl = gsap.timeline({ paused: true });
      tl.from("#title", { y: 48, opacity: 0, duration: 0.6, ease: "power3.out" }, 0.2);
      tl.from(".bar", { scaleY: 0, duration: 0.8, stagger: 0.2, ease: "power2.out" }, 0.8);
      window.__timelines["main"] = tl;
    </script>
  </body>
</html>

決まりは 3 つだけです。

決まり この例では
一番外の要素に、画面の大きさと長さを書く data-width="1920" data-height="1080" data-duration="5"
出す要素に、何秒目から何秒出すかを書く <section data-start="0" data-duration="5">
GSAP の動きを止めた状態で作り、登録する gsap.timeline({ paused: true }) を window.__timelines["main"] に入れる

再生は HyperFrames が時刻に合わせてタイムラインを動かします。自分で play() は呼びません。あとは普通の HTML と CSS です。

Remotion で同じ映像を書く

src/Main.tsx
import { AbsoluteFill, Easing, interpolate, useCurrentFrame, useVideoConfig } from "remotion";

const HEIGHTS = [120, 240, 400];

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

  const titleT = interpolate(frame, [0.2 * fps, 0.8 * fps], [0, 1], {
    extrapolateLeft: "clamp",
    extrapolateRight: "clamp",
    easing: Easing.out(Easing.cubic),
  });

  return (
    <AbsoluteFill style={{ background: "#f5f1e8", color: "#1d1d1f", fontFamily: "system-ui, sans-serif", alignItems: "center", justifyContent: "center", gap: 64 }}>
      <h1 style={{ margin: 0, fontSize: 110, opacity: titleT, transform: `translateY(${(1 - titleT) * 48}px)` }}>HTML で動画を作る</h1>
      <div style={{ display: "flex", alignItems: "flex-end", gap: 48, height: 400 }}>
        {HEIGHTS.map((h, i) => {
          const start = (0.8 + i * 0.2) * fps;
          const s = interpolate(frame, [start, start + 0.8 * fps], [0, 1], {
            extrapolateLeft: "clamp",
            extrapolateRight: "clamp",
            easing: Easing.out(Easing.quad),
          });
          return <div key={h} style={{ width: 160, height: h, background: "#e8603c", transformOrigin: "bottom", transform: `scaleY(${s})` }} />;
        })}
      </div>
    </AbsoluteFill>
  );
};

このほかに、長さや大きさを決める Root.tsx と、登録用の index.ts が要ります。

違いは「動きの書き方」です。

  • HyperFrames:「0.2 秒目に、題を、下から 0.6 秒かけて出す」と、出来事を並べて書く
  • Remotion:「今が何コマ目か」を useCurrentFrame() で受け取り、そのコマでの透明度や位置を毎回計算して返す

できた映像

左が HyperFrames、右が Remotion。上が 1.2 秒、下が 3 秒の時点です。

grid.png

イージングの式が少し違うので途中の高さはわずかにずれますが、同じ映像になりました。

プレビュー画面

HyperFrames(npx hyperframes preview)

HyperFrames のプレビュー

Remotion(npx remotion studio)

Remotion Studio

ライセンス

  • HyperFrames:Apache-2.0。会社でも無料
  • Remotion:個人、従業員 3 人までの会社、非営利団体などは無料。それ以外の会社は Company License が要る

会社の仕事で使うなら、Remotion は先に LICENSE.md を読んでください。

Claude Code に作らせる

HyperFrames の README の見出しは「Write HTML. Render video. Built for agents.」です。AI のコーディングエージェント向けに、作り方の手順書(スキル)が配られています。

実際に Claude Code へ 15 秒の動画を頼んで、何をするかを記録しました。

準備

Claude Code にスキルを入れます。どちらかで入ります(README)。

# プラグインで入れる
claude plugin marketplace add heygen-com/hyperframes
claude plugin install hyperframes@hyperframes

# スキルだけ入れる
npx hyperframes skills update

頼んだ文

/hyperframes で、15 秒の動画を作ってください。

- 題材:「HTML で動画を作る」。HyperFrames は HTML と CSS がそのまま動画になる、という紹介
- 3 場面:題 → 「HTML を書く → ブラウザで撮る → MP4」の 3 段の図 → 締めの一言
- 1920×1080、明るい背景、日本語
- 声・BGM・画像生成は使わない。図形と文字だけ
- 確認は要らないので、npx hyperframes check が通るまで直して、render まで進めてください

途中で確認されないよう、claude -p で最後まで任せました。

Claude Code がやったこと

順 やったこと
1 スキルの手順書を読み、npx hyperframes skills update でスキルを最新にした
2 npx hyperframes init でひな形を作った
3 BRIEF.md(何を作るか)と SPEC.md(見た目の決め事)を書いた
4 index.html と、場面ごとの HTML 3 つ(title.html pipeline.html closing.html)を書いた
5 npx hyperframes check を実行。指摘を直して、もう一度
6 npx hyperframes snapshot で決めた時刻の静止画を撮り、自分で見て、図が小さいのを直した
7 もう一度 check と snapshot。場面の切り替わりの前後を細かく撮って確かめた
8 REVIEW.md に判断と弱い所を書き、npx hyperframes render で書き出した

できた動画

claude-video.gif

時間 場面
0〜4 秒 題「HTML で、動画を作る。」
4〜11 秒 エディタにコードが打たれる → ブラウザで撮る → MP4 が落ちてくる
11〜15 秒 締め「Web が書けるなら、動画も作れる。」と $ npx hyperframes init

頼んでいない見出し「やることは、3 段だけ。」と、締めのコマンドは Claude Code が足したものです。

場面をファイルに分ける形

index.html は場面を読み込むだけです(プレビュー時に付いた data-hf-id は省きました)。

index.html(抜粋)
<div id="root" data-composition-id="main" data-start="0" data-duration="15" data-width="1920" data-height="1080">
  <div id="ground"></div>
  <div id="title" data-composition-id="title" data-composition-src="compositions/title.html"
       data-start="0" data-duration="4" data-width="1920" data-height="1080"></div>
  <div id="pipeline" data-composition-id="pipeline" data-composition-src="compositions/pipeline.html"
       data-start="4" data-duration="7" data-width="1920" data-height="1080"></div>
  <div id="closing" data-composition-id="closing" data-composition-src="compositions/closing.html"
       data-start="11" data-duration="4" data-width="1920" data-height="1080"></div>
</div>

場面のファイルは <template> で包み、中に CSS と GSAP を書きます。題の場面はこうなっていました(CSS は省略)。

compositions/title.html(抜粋)
<template>
  <div id="root" data-composition-id="title" data-width="1920" data-height="1080">
    <div id="title-stage">
      <div id="title-kicker"><span class="tag">&lt;</span>HyperFrames<span class="tag"> /&gt;</span></div>
      <h1 id="title-head">
        <span class="w accent">HTML</span> <span class="w">で、</span><br /><span class="w">動画を</span><span class="w">作る。</span>
      </h1>
      <p id="title-sub">HTML と CSS が、そのまま動画になる。</p>
    </div>
  </div>
  <script>
    (() => {
      const tl = gsap.timeline({ paused: true });
      const words = "#title-head .w";
      // 語ごとに薄灰 → ink(HTML は accent へ)。frame 0 から薄く見える
      tl.fromTo(words, { opacity: 0.3 }, { opacity: 1, duration: 0.35, ease: "power2.out", stagger: 0.09 }, 0.15);
      tl.fromTo("#title-sub", { opacity: 0, filter: "blur(8px)" }, { opacity: 1, filter: "blur(0px)", duration: 0.2, ease: "power4.out" }, 1.0);
      // 左へ whip して次の場面へ
      tl.to("#title-stage", { x: -420, opacity: 0, filter: "blur(14px)", duration: 0.3, ease: "power3.in" }, 3.65);
      window.__timelines["title"] = tl;
    })();
  </script>
</template>

場面ごとに data-start を変えるだけで並べ替えられます。自分の 17 分の動画も、章ごとに 9 つのファイルに分けて同じ形で作っています。

check が見つけたもの

1 回目の check の結果です(抜粋)。

Layout
  ⚠ t=4.167, 5.833, 7.5, 9.167s container_overflow #pipe-code inside #pipe-editor overflowed bottom 402px
Contrast
  ✗ ... 2.29:1 (need 3:1, t=7.5s)
    Try rgb(141,149,159); source compositions/pipeline.html
Craft
  ⚠ first_frame_empty: Frame 0 shows only the background, and the first frame is the thumbnail on social players ...
  ⚠ text_below_floor: Type floor is 28 px ... the smallest "localhost:3002" at 22 px ...
Audio
  ℹ audio_none: The film has no sound: no clip in it plays audio.
◇  Check passed
指摘 中身 Claude Code の直し方
container_overflow コードの枠から、中身が下に 402px はみ出している 改行の指定(white-space: pre)を行ごとの要素に移した
Contrast 行番号の色が薄く、背景との差が 2.29:1 で足りない 色を #a3acb8 から #8d959f に濃くした
first_frame_empty 0 秒目が背景だけ。SNS では最初のコマがサムネになる 0 秒目の題の濃さを 0.18 から 0.3 に上げ、上の小見出し <HyperFrames /> はフェードをやめて最初から出した
text_below_floor 28px 未満の文字があり、スマホで読めない 22〜24px だった URL などを 28px にした

Check passed でも警告は出ます。Claude Code は警告も 0 になるまで直していました。

snapshot で自分の目でも見る

check は通っても、見た目の良し悪しまではわかりません。Claude Code は snapshot で決めた時刻の静止画を撮り、並べた画像を自分で見て直していました。

npx hyperframes snapshot --at 0,3.5,5.2,7,9.5,10.9,14.5

contact-sheet.jpg

これを見て「図が小さく上に寄っている」と判断し、枠と文字を大きくして、縦の位置を下げていました。

かかった時間

項目 値
全体の時間 約 6 分 45 秒
やり取りの回数 48 回
書き出し 15 秒の動画を 17.6 秒
HyperFrames の版 0.8.219

任せるときの注意

  • npx hyperframes skills update は、~/.claude/skills などにあるスキルを最新版で上書きします。今回の実行でも、Claude Code が最初に自分で実行しました。HyperFrames の版を固定して使っているなら、スキルの版とずれないよう気をつけてください
  • Node.js 22 未満だと動きません
  • 確認なしで最後まで任せると、頼んでいない文字(今回は見出しとコマンド)が入ることがあります。できたものは自分で見て確かめます

まとめ

  • React に慣れているなら Remotion
  • HyperFrames は check と snapshot があるので、AI に「通るまで直して」と任せやすい
4
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?