Communitygithub.com

Bigper4mer/opus-motion

从 Opus Motion 动效库中选择、混合和集成动态图形 — 包含约 605 种参数化的 Remotion 动效(标题、背景、天气、粒子、角色、数据/HUD、UI 原型、图像效果、3D)、97 种转场、148 种样式和 33 种即用型配方。

opus-motion 是什么?

Opus Motion Library 是一个庞大的 Remotion 动效库,包含约 605 种参数化动效、97 种转场、148 种样式和 33 种即用型“配方”(预组合的场景)。它旨在让开发者、视频剪辑师和 AI 代理能够通过 CLI 工具 `node cli/mgl.mjs` 快速搜索、渲染和组合动效。该技能支持多种平台:可以使用 Remotion 渲染高质量的视频(MP4、WebM、ProRes),通过 Web 组件(React、Next.js、普通 HTML、WordPress)在网站或 Web 应用中使用,甚至可以为原生应用导出带 Alpha 通道的视频。其核心优势在于通过 CLI 参数或 JSON 配置文件,允许精确控制每个动效的属性(角色、叠加层、文本、颜色),从而实现复杂的、由 AI 驱动的可视化叙事和 UI 动画。该技能还通过 `AGENTS.md` 提供了详细的决策规则,以确保性能最佳并避免常见反模式。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Bigper4mer/documentary-film-kit/tree/HEAD/documentary-film/library/skills/opus-motion

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Opus Motion 动效库

根目录:此仓库克隆到的文件夹,或当前宿主项目中的副本。先阅读其中的 AGENTS.md — 它包含了决策流程、图层分层规则、Web 性能规则和反模式。然后阅读 docs/CHOOSING.md(意图 → 动效)和 docs/INTEGRATION.md(按技术栈划分)。

1. 选择(切勿凭记忆猜测)

  • node cli/mgl.mjs suggest "<用户描述的简要说明>" — 对 ★ 配方的和动效进行排序,说明理由,并打印一个 props 代码片段。支持过滤参数 --overlay --image --text --loop --light --category <c> --json。
  • node cli/mgl.mjs recipes — 即用型混合配方(预览图在 recipes/previews/<id>.jpg):hero-aurora-night, hero-paper-sketch, hero-blueprint-logo, product-launch, stats-reveal, testimonial-chat, testimonial-quote, loading-loop, section-divider, success-celebration, error-glitch, onboarding-steps, event-countdown, music-neon-promo, ocean-explainer, history-timeline, app-store-preview (9:16), social-short-captions (9:16), end-card。
  • node cli/mgl.mjs info <id> — 显示 props 以及 roles、overlay/overlayProps、loopable、mood、weight、pairsWith、textProps 等信息。
  • 混合规则:背景 + 主体 + 类型 + 微妙的强调;每个镜头只用一个主角;调暗支持图层;替换所有示例文本;传入品牌颜色。

2. 视频(Remotion)

node cli/mgl.mjs render <id> --props '{"key":"value"}' [--format landscape|square|portrait] [--frames N] --out out/<name>.mp4
node cli/mgl.mjs recipe <id> --overrides '{"<motion-id>":{…}}' [--format …] --out out/<name>.mp4
node cli/mgl.mjs still <id> --at 10,60,120 --out out/<name>-sheet.jpg     # 先预览,再读取缩略图
node cli/mgl.mjs compose specs/<name>.json --out out/<name>.mp4             # scenes[] (motion 或 layers[]), transitions, overlays, audio
node cli/direct.mjs storyboards/<name>.json                                 # 带解说:本地 Qwen3-TTS -> 字幕 -> 渲染 -> 主输出

图片:使用 public/ 路径(如 "demo/owl.jpg")或 https URL。切勿使用云端语音/音乐服务;音乐/音效来自 public/music、public/sfx。 如果需要在另一个 Remotion 项目中使用:node cli/mgl.mjs add <motions|recipes> --to <host>/src (仅复制所需源码和本地注册表;会打印 npm install 命令)。

3. 网站 / Web 应用

  • 先在动效库中执行 npm run build:lib,然后在项目中 import {MotionBackground, MotionPlayer, MotionMix} from 'opus-motion-library/web'(Vite 需要在 resolve.dedupe 中添加 react/remotion/@remotion/*/three),或者执行 mgl add … --player --to <app>/src(Next.js 需从 'use client' 文件中使用)。
  • 普通 HTML / WordPress / Vue / Svelte:使用 <script src="opus-motion.element.js"> + <opus-motion recipe="…" background> / <opus-motion motion="…" props='{…}'>。
  • 在 MotionBackground 上使用 HTML 文字(它会丢弃 type 类型的图层);overlay 动效悬浮在页面上;支持 playOnView、减少动效的静态帧、懒加载、每个视口最多 2 个活动播放器;复杂 3D 动效在手机上使用导出的视频。
  • 提供动效库 public/ 中使用的文件(或使用 assetBase / 绝对 URL)。

4. 原生应用、幻灯片、编辑器

node cli/mgl.mjs export <motion|recipe> --as mp4|webm|webm-alpha|prores-alpha|gif|png|poster [--format …] [--props …] (Alpha 导出会应用 overlayProps;用 ffprobe -c:v libvpx-vp9 … pix_fmt 验证 → 应为 yuva420p)。

5. 交付前检查

生成缩略图图块(ffmpeg -i out/x.mp4 -vf "fps=1,scale=480:-2,tile=6x5" -frames:v 1 out/x-sheet.jpg)或截取页面截图(node examples/screenshot.mjs <url> <dir> --targets "top,#section" — 间隔 1 秒拍摄两张,报告变化百分比),查看结果并修复问题。

向动效库添加新动效

请遵循 docs/AUTHORING.md 的说明,将动效放入 src/motions/<family>/<id>.tsx,然后运行 node cli/gen-registry.mjs && npx tsc --noEmit && node cli/gen-docs.mjs;可选地运行 node cli/probe-meta.mjs --only <id>(测量 loop / overlay / luma 属性),并在 docs/motion-meta.json 中添加覆盖设置。

相关技能