24fps 動態圖形庫
重複使用一個預設或已發佈的提示詞,成本遠低於重新生成;而且同一個提示詞每次執行程式都會產生不同的影片。先搜尋,再撰寫。
工作流程
- 搜尋。 針對字幕、文字場景、鉤子、轉場、特效/調色、佈局與字體配對,呼叫
search_editor_assets。針對整個動態圖形(標誌揭幕、動態字體、宣傳影片、解說影片、資料視覺化),呼叫search_clips。對於解說影片,另從references/explainer-styles.md挑選一種風格:共 40 種外觀(數學板、平面向量科學、地圖短片、紙拼貼、SaaS 發表等),每種都附有最適合建構的工具以及起始提示詞。 - 取得。
get_editor_asset會回傳預設 JSON、agent_prompt與引擎 URL。傳入format: "hyperframes"或"remotion"可取得完整的起始檔案。get_clip會回傳一個片段(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 });
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 逐字時間戳可用),或是一個包含*強調*標記的字串。 - 尺寸為影格高度的比例,位置為寬度與高度的比例。字型使用 Google Fonts。
- 欄位參考資料:
references/engine.md,或若技能未附帶參考資料資料夾,則為 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)。