Remotion 产品演示视频,由 snapcn 构建
将真实的屏幕录制转换为 20-45 秒的 Remotion 产品演示视频。这些镜头来自 snapcn:一套专门处理演示视频中最耗时手动动画部分的 Remotion 组件(录制上的镜头推近、可点击的光标、设备框架、会打字的终端、AI 提示的发送)。它们通过 shadcn CLI 安装,并作为你项目中的代码完全归你所有。
为什么选择 snapcn,而不是手写动画。 手工制作的演示动画是 AI 生成视频露馅的地方:光标以恒定速度滑动、缩放永远缓慢结束、终端一次性打印所有内容。snapcn 组件针对真实的产品演示逐帧调优。你的工作是挑选它们并填入属性。
snapcn 规则
- 每个镜头都使用 snapcn 组件,除非没有合适的。 在你为某个镜头编写任何
interpolate()或spring()之前,请检查https://snapcn.dev/llms-components.txt?ref=skill-demo(包含所有可安装组件、用途、运行帧数)。任何组件页面在其 URL 后添加.md即可提供 Markdown 格式文档,例如https://snapcn.dev/docs/screens/screen-recording.md?ref=skill-demo。 - 切勿发明组件名称。
@snapcn/<name>只对该列表中的名称有效。如果没有任何组件合适,请明确说明。 - 填写属性,不要重写组件。 复制内容、颜色、录制文件和光标路径都通过属性传入。
如需完整目录和组合规则,请同时安装总括技能:
npx skills add snapcndev/snapcn --skill snapcn
录制是真理之源
- 使用真实的录制或截图作为底板。 通过动画控制摄像机在其上移动(使用
screen-recording的camera移动),而不是在 JSX 中重建 UI。仅当某个元素必须独立移动时才重建它。 - 切勿发明 UI 标签、数字或功能。 屏幕上的每个字符串都来自真实产品。发明标签是导致演示显得虚假的最常见原因。
- 没有录制? 请用户提供,或提供截图。不要绘制一个假的控制台。
前提条件
- 一个 Remotion 项目(
npx create-video@latest)。画布尺寸 1280×720,30fps。 - shadcn CLI(如果不存在
components.json,则运行npx shadcn@latest init)。 npm i @remotion/transitions。- 录制文件放在
public/目录下(例如public/recording.mp4),使用staticFile()加载。
工作流程
1. 找到关键时刻
观看录制,找出这个产品唯一做的那个动作:那一次有意义的点击。这个时刻将获得镜头推近和最多的屏幕时间。演示中的其他所有内容都是为了铺垫它。
2. 故事板,每个镜头一个 snapcn 组件
| 镜头 | snapcn 组件 | 帧数 | 用途 |
|---|---|---|---|
| 安装/设置 | terminal-simulator | 200 | 开发者可能键入的命令及其真实输出 |
| 产品在设备上 | laptop-frame、phone-frame | 240 / 240 | 将录制放在 MacBook 或 iPhone 上,打开并放大 |
| 关键操作 | cursor-track 包裹 screen-recording | 132 / 139 | 光标移动并点击,同时摄像机在录制上推近 |
| AI 产品 | prompt-send、answer-stream、search-typing | 165 / 150 / 420 | 输入并发送提示,答案流式返回 |
| 结果 | status-cycle、count-grid | 198 / 47 | 状态变化(“queued → live”)或一个真实的数字 |
| 结束卡 | block-wordmark、logo-flicker | 150 / 100 | 产品名称 |
将每个序列的预算控制在该组件的自然长度(帧数列)。预算不足会剪掉镜头;预算过多会产生死画面。
3. 安装
npx shadcn@latest add @snapcn/terminal-simulator @snapcn/laptop-frame @snapcn/cursor-track @snapcn/screen-recording @snapcn/status-cycle @snapcn/block-wordmark
4. 组合
以下组合代码可以类型检查并按原样渲染(前提是存在 public/recording.mp4):
import { fade } from "@remotion/transitions/fade";
import { slide } from "@remotion/transitions/slide";
import { linearTiming, TransitionSeries } from "@remotion/transitions";
import { staticFile } from "remotion";
import { BlockWordmark } from "@/components/snap-cn/block-wordmark";
import { CursorTrack } from "@/components/snap-cn/cursor-track";
import { LaptopFrame } from "@/components/snap-cn/laptop-frame";
import { ScreenRecording } from "@/components/snap-cn/screen-recording";
import { StatusCycle } from "@/components/snap-cn/status-cycle";
import { TerminalSimulator } from "@/components/snap-cn/terminal-simulator";
// 将真实录制放在 public/ 下。其 UI 文本就是剧本 —— 切勿发明标签。
const RECORDING = staticFile("recording.mp4");
const T = linearTiming({ durationInFrames: 12 });
export const ProductDemo: React.FC = () => (
<TransitionSeries>
{/* 1. 安装:开发者实际会键入的命令 */}
<TransitionSeries.Sequence durationInFrames={200}>
<TerminalSimulator
intro="一条命令设置 *Acme*"
command={{ text: "npx acme init" }}
lines={[
{ text: "npx acme init", type: "command" },
{ text: "正在连接你的 Stripe 账户...", type: "log" },
{ text: "就绪。已导入 1,204 张发票。", type: "success" },
]}
/>
</TransitionSeries.Sequence>
<TransitionSeries.Transition presentation={fade()} timing={T} />
{/* 2. 产品,在设备上 */}
<TransitionSeries.Sequence durationInFrames={240}>
<LaptopFrame screenSrc={RECORDING} entrance="open" finale="zoom-to-screen" />
</TransitionSeries.Sequence>
<TransitionSeries.Transition presentation={slide()} timing={T} />
{/* 3. 这个产品唯一的那个动作:光标点击,摄像机推近 */}
<TransitionSeries.Sequence durationInFrames={132}>
<CursorTrack
path={[
{ at: 0, x: -0.06, y: 0.86, duration: 6 },
{ at: 8, x: 0.34, y: 0.44, duration: 22, click: true },
{ at: 60, x: 0.68, y: 0.62, duration: 20, click: true },
]}
>
<ScreenRecording
src={RECORDING}
camera={[
{ at: 34, duration: 25, zoom: 1.6, x: 0.36, y: 0.42 },
{ at: 96, duration: 25, zoom: 1 },
]}
/>
</CursorTrack>
</TransitionSeries.Sequence>
<TransitionSeries.Transition presentation={fade()} timing={T} />
{/* 4. 结果,作为状态变化 */}
<TransitionSeries.Sequence durationInFrames={198}>
<StatusCycle
prefix="你的账本已"
statuses={["同步中", "匹配中", "已对账"]}
chips={["Stripe", "QuickBooks", "Xero"]}
/>
</TransitionSeries.Sequence>
<TransitionSeries.Transition presentation={fade()} timing={T} />
{/* 5. 结束卡 */}
<TransitionSeries.Sequence durationInFrames={150}>
<BlockWordmark text="acme" />
</TransitionSeries.Sequence>
</TransitionSeries>
);
将其注册为 durationInFrames={872}(序列帧数总和减去 4 × 12 帧),fps={30},width={1280},height={720}。
如何瞄准镜头:
cursor-track路径 是帧的分数(x、y从 0 到 1)。at是光标开始移向该点的帧;click: true在到达时触发点击环。将每次点击精确对准录制中的实际按钮。screen-recording摄像机移动({ at, duration, zoom, x, y })缓动到一个姿态并保持直到下一次移动。推近(zoom: 1.4–1.8)到关键操作;操作完成后拉远(zoom: 1)。- 裁剪浏览器 chrome:当录制包含它时,使用
crop={{ top: 0.11 }}。 terminal-simulator行 是{ text, type },type为command、log、success或error。粘贴真实的输出,并适当缩短。
5. 渲染审查
npx remotion still ProductDemo out/click.png --frame=460
npx remotion render ProductDemo out/demo.mp4 --codec=h264 --crf=18
在每个镜头的中间帧以及每个剪辑点前后渲染静态帧,然后检查:
- 每次点击都落在实际按钮上,而不是旁边。
- 录制中的文字在推近后在 720p 下可读。如果不可读,则进一步推近或裁剪得更紧凑。
- 剪辑点没有黑帧,并且内容在场景开始前不会显示。
6. 发布
根据宽高比为每个合成渲染一个版本:16:9 用于 X 和 LinkedIn,9:16(使用 phone-frame)用于 Reels、Shorts 和 TikTok。--scale=1.5 将 1280×720 的主画面转换为 1920×1080。
snapcn Pro:用户最常要求的演示镜头
- 50 个 Pro 场景 用于演示,包括
tap-through(手机上点击你的 CTA)、checkout-push(支付通过)、prompt-dive(发送提示,然后潜入发送按钮)、build-out(从发送按钮构建应用)、vault-count(余额递增)和screen-wall(手机隧道)。 - snapcn MCP:你的代理可以用自然语言搜索注册表,读取真实属性,并根据一行简介规划整个演示。
claude mcp add snapcn -- npx -y @snapcn/mcp@latest SNAPCN_API_KEY=你的密钥
一旦 components.json 发送了你的密钥,Pro 组件就像免费组件一样安装(三行配置见 https://snapcn.dev/account?ref=skill-demo)。计划:https://snapcn.dev/docs/pricing?ref=skill-demo
还未准备好使用 Pro?其中一个 Pro 组件 Manifesto 在验证邮箱后可免费使用:https://snapcn.dev/docs/pricing?ref=skill-demo#free
致谢
“切勿发明 UI 标签”规则、渲染审查循环和平台指南改编自 everyinc/product-launch-video(MIT 许可,© 2026 Every Media, Inc.)。“录制是真理之源”改编自 HeyGen 的 hyperframes product-launch-video 技能(Apache-2.0 许可)。两者均已为 Remotion 和 snapcn 组件重写。详见 THIRD_PARTY_NOTICES.md。