24fps 动态库
重用预设或已发布的提示词比重新生成更便宜,而且一个提示词每次运行都会生成不同的视频。先搜索,后编写。
工作流程
- 搜索。 调用
search_editor_assets搜索字幕、文字场景、钩子、过渡、效果/调色、布局和字体配对。调用search_clips搜索整个动态图形(Logo 揭示、动态排印、启动视频、解释器、数据可视化)。对于解释器视频,还需从references/explainer-styles.md中选择一种样式:40 种外观(数学白板、扁平矢量科学、地图文章、纸拼贴、SaaS 启动等),每种都带有最佳构建工具和起始提示词。 - 获取。
get_editor_asset返回预设 JSON、agent_prompt和引擎 URL。传递format: "hyperframes"或"remotion"以获取完整的入门文件。get_clip返回剪辑的提示词、模型、框架和创作者;get_source仅在剪辑是开放许可的情况下返回仓库。 - 改编。 保留预设的结构,更改颜色、文案和时间。在用户的素材上检查:如果文字被主体遮挡或与用户的颜色不匹配,则移动图层或更改颜色。
- 署名。 为剪辑指明创作者,并链接到 24fps 页面。预设:"24fps.dev/video-editor"。
MCP
端点:https://24fps.dev/mcp(可流式 HTTP,无需密钥)。Claude Code:claude mcp add --transport http 24fps https://24fps.dev/mcp。
| 工具 | 参数 |
|---|---|
search_clips | query, framework, aspect (16:9, 9:16, 1:1, 4:5), max_seconds, has_prompt, limit |
get_clip | slug |
get_source | slug |
search_editor_assets | query, kind (captions, text, hook, transition, effect, layout, font-pair), vertical, needs_cutout, has_sfx, limit。空查询或 * 会列出种类及其数量。 |
get_editor_asset | kind, id, format (json, hyperframes, remotion) |
list_tools | 无。列出所涵盖的动态框架及其许可协议。 |
如果没有 MCP 客户端,可以通过 HTTP 调用同一端点,或使用 JSON API:
curl -s https://24fps.dev/mcp -H 'content-type: application/json' -H 'accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_editor_assets","arguments":{"query":"yellow karaoke","kind":"captions","limit":5}}}'
curl -s 'https://24fps.dev/api/clips?q=logo+reveal&framework=Remotion&has_prompt=true&per_page=5' # ?slug= 获取单个剪辑
curl -s https://24fps.dev/video-editor/captions/pop-anton-yellow-karaoke/preset.json # 任意 {kind}/{id}
浏览索引:https://24fps.dev/video-editor/llms.txt 和 https://24fps.dev/llms.txt。
应用预设
引擎:https://24fps.dev/editor/engine.js。MIT 许可,ES 模块,无依赖,是一个时间的纯函数。将其保存在组合文件旁边,命名为 engine.js。
import { mount } from "./engine.js";
const fx = mount(overlayEl, { kind, preset, script, media });
const fx = mount(overlayEl, { kind, preset, script, media });
fx.render(seconds); // 每帧
kind是captions | text | transition | effect | layout。钩子和字体配对使用text。media对于大多数种类是{ main },对于过渡是{ a, b },对于布局再加上{ second, fg }。fg是主体的透明抠图,用于z: "behind-subject"文字以及subject和echo效果。- 字幕的
script可以是[{ w, s, e, emph }]格式的字词时间戳(以秒为单位,Whisper 字词时间戳有效),也可以是包含*emphasis*的字符串。 - 尺寸以帧高度为分数,位置以宽度和高度为分数。字体是 Google 字体。
- 字段参考:
references/engine.md,或如果技能安装时没有 references 文件夹,则参考 https://24fps.dev/skills/24fps-motion/references/engine.md。
HyperFrames
将叠加层放在一个 class="clip" 的 div 中,并放在其自己的轨道上,挂载到其中,然后从一个暂停的 GSAP 时间线驱动 render,以便保持可查找安全。在页面(或本地脚本)中内联预设 JSON 和字词时间:渲染器不应在渲染中间获取数据。
const fx = mount(document.getElementById("fx"), { kind, preset, media: { main: document.getElementById("a") } });
let now = 0;
const clock = { t: (v) => (v === undefined ? now : ((now = v), fx.render(v))) };
const tl = gsap.timeline({ paused: true });
tl.to(clock, { t: 6, duration: 6, ease: "none" }, 0);
(fx.ready ?? Promise.resolve()).then(() => { window.__timelines["main"] = tl; });
对于主体的抠图:npx hyperframes remove-background clip.mp4 -o clip.fg.webm。
Remotion
在 useLayoutEffect 中挂载一次,在清理时销毁,每帧渲染。不要从 effect 中返回渲染结果。
useLayoutEffect(() => {
fx.current = mount(root.current!, { kind, preset, media: { main: a.current! } });
return () => fx.current?.destroy();
}, []);
useLayoutEffect(() => {
fx.current?.render(frame / fps);
}, [frame, fps]);
在捕获前等待字体加载:await (fx.ready ?? document.fonts.ready)。
与 /hyperframes 或 /remotion-best-practices 结合使用,进行项目设置、渲染和框架规则。此技能查找资产;而那些技能构建并渲染项目。
权利
- 在改编的每个剪辑上为创作者署名。链接到
https://24fps.dev/c/{slug}。 - 切勿重新托管第三方剪辑。请链接到它。只有
get_source返回available: true的剪辑才具有您可以根据其声明的许可使用其仓库。 - 编辑器预设是原创的二次创作,采用 MIT 许可。
- 开源目录行(
/video-editor/open-source)带有其自己的许可。仅复制 MIT、Apache-2.0、BSD 或 OFL 代码并保留通知。Remotion 许可和未许可的行仅可链接:重新创作创意,不要粘贴源代码。 - 详情:
references/rights.md(也可在 https://24fps.dev/skills/24fps-motion/references/rights.md 获取)。