record-promo

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Record Promo Video

录制游戏宣传视频

Autonomously capture smooth, high-FPS gameplay footage of your Phaser game — ready for TikTok, Reels, Moltbook, or X. No human input needed during recording.
自动捕获你的Phaser游戏流畅的高帧率游戏画面——适配TikTok、Reels、Moltbook或X平台。录制过程无需人工干预。

Instructions

操作步骤

Record a promo video of the game at
$ARGUMENTS
(or the current directory if no path given).
录制
$ARGUMENTS
路径下(若未指定路径则为当前目录)游戏的宣传视频。

1. Pre-checks

1. 前置检查

Verify these are available:
  • Dev server: Check if one is already running (
    curl -s http://localhost:3000/
    ). If not, start one with
    npm run dev
    in the background. Note the port.
  • Playwright:
    npx playwright --version
    . If not installed:
    npm install -D @playwright/test && npx playwright install chromium
  • FFmpeg:
    ffmpeg -version | head -1
    . If not found, tell the user to install it (
    brew install ffmpeg
    on macOS) and stop.
确认以下工具已就绪:
  • 开发服务器:检查是否已有运行中的开发服务器(执行
    curl -s http://localhost:3000/
    )。若没有,在后台执行
    npm run dev
    启动,并记录端口号。
  • Playwright:执行
    npx playwright --version
    检查版本。若未安装,执行
    npm install -D @playwright/test && npx playwright install chromium
    进行安装。
  • FFmpeg:执行
    ffmpeg -version | head -1
    检查是否安装。若未找到,告知用户进行安装(macOS系统可执行
    brew install ffmpeg
    )并终止流程。

2. Generate the capture script

2. 生成捕获脚本

Load the
promo-video
skill for the full technique reference.
Read the game's source files to understand:
  • src/scenes/GameScene.js
    — find death/failure methods to patch out
  • src/core/EventBus.js
    — event flow
  • src/core/Constants.js
    — input keys, game dimensions
  • src/main.js
    — verify
    __GAME__
    and
    __GAME_STATE__
    globals are exposed
Create
scripts/capture-promo.mjs
adapted for this specific game:
  • Patch out ALL death/failure code paths
  • Generate input sequences matching the game's actual controls
  • Include entrance animation pause (1-2s)
  • Default viewport:
    1080 × 1920
    (9:16 mobile portrait)
  • Default duration: 13s game-time
加载
promo-video
技能以查看完整技术参考。
读取游戏源码文件以了解以下信息:
  • src/scenes/GameScene.js
    — 找到并屏蔽死亡/失败相关方法
  • src/core/EventBus.js
    — 事件流逻辑
  • src/core/Constants.js
    — 输入按键、游戏尺寸
  • src/main.js
    — 确认已暴露
    __GAME__
    __GAME_STATE__
    全局变量
创建适配当前游戏的
scripts/capture-promo.mjs
脚本:
  • 屏蔽所有死亡/失败代码路径
  • 生成匹配游戏实际控制逻辑的输入序列
  • 加入开场动画停顿(1-2秒)
  • 默认视口:
    1080 × 1920
    (9:16 竖屏移动端)
  • 默认时长:13秒游戏时间

3. Copy the conversion script

3. 复制转换脚本

bash
cp <plugin-root>/skills/promo-video/scripts/convert-highfps.sh <project-dir>/scripts/
chmod +x <project-dir>/scripts/convert-highfps.sh
bash
cp <plugin-root>/skills/promo-video/scripts/convert-highfps.sh <project-dir>/scripts/
chmod +x <project-dir>/scripts/convert-highfps.sh

4. Run the capture

4. 执行捕获

bash
mkdir -p output
node scripts/capture-promo.mjs --port <port>
bash scripts/convert-highfps.sh output/promo-raw.webm output/promo.mp4 0.5
bash
mkdir -p output
node scripts/capture-promo.mjs --port <port>
bash scripts/convert-highfps.sh output/promo-raw.webm output/promo.mp4 0.5

5. Verify and preview

5. 验证与预览

Extract a thumbnail at the 5-second mark and show it to the user:
bash
ffmpeg -y -ss 5 -i output/promo.mp4 -frames:v 1 -update 1 output/promo-thumbnail.jpg
Read the thumbnail image and display it. Report duration, frame rate, and file size.
在视频第5秒处提取缩略图并展示给用户:
bash
ffmpeg -y -ss 5 -i output/promo.mp4 -frames:v 1 -update 1 output/promo-thumbnail.jpg
读取并展示该缩略图,同时报告视频时长、帧率和文件大小。

Example Usage

使用示例

/record-promo examples/flappy-bird
Result: Patches out death → generates input sequence for the game's controls → captures 13s of autonomous gameplay at 1080x1920 (9:16) → converts to 50 FPS MP4 →
output/promo.mp4
ready for TikTok/Reels.
Tell the user:
Promo video recorded! 50 FPS, mobile portrait (1080×1920).
File:
output/promo.mp4
Post it to TikTok, Reels, or X to drive traffic to your game.
/record-promo examples/flappy-bird
结果:屏蔽死亡逻辑 → 生成适配游戏控制的输入序列 → 以1080x1920(9:16)分辨率捕获13秒自动游戏画面 → 转换为50 FPS的MP4视频 →
output/promo.mp4
已可用于TikTok/Reels平台。
告知用户:
宣传视频录制完成!50 FPS,竖屏移动端(1080×1920)。
文件路径
output/promo.mp4
可发布至TikTok、Reels或X平台以引流至你的游戏。