Communitygithub.com

Remotion 到 HyperFrames 轉換工具

將現有的 Remotion (React) 組件源碼移植到 HyperFrames HTML。僅在用戶明確要求移植/轉換/遷移/翻譯 Remotion 源碼時才使用。

Remotion 到 HyperFrames 轉換工具 是什麼?

此技能旨在將基於 Remotion (React) 的影片組件機械化地轉譯為 HyperFrames (HTML + GSAP) 格式。它針對約 80% 的典型組件提供了直接的 API 映射,並透過嚴格檢查來防止轉換失敗的 20% 情況。該技能會拒絕翻譯不適合 HyperFrames 按幀驅動模型的模式(如 useState、useEffect),並建議使用運行時交互模式 (runtime interop pattern) 作為替代方案。它配備了分層測試語料庫 (T1-T4),用於根據 SSIM 閾值驗證翻譯品質,確保轉譯結果在視覺上與原始 Remotion 輸出高度一致。此轉換是單向的,僅適用於 Remotion 源碼,不支援反向匯出 (HyperFrames 到 Remotion) 或非 Remotion 的來源(如 After Effects、Framer Motion)。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/EvovexAI/EvoFlow/tree/HEAD/skills/public/remotion-to-hyperframes

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Remotion 到 HyperFrames 轉換

轉換前確認方向。 僅將現有的 Remotion (React) 組件源碼移植到 HyperFrames。撰寫 新 組件(即使靈感來自 Remotion 影片)→ 使用創作工作流程 /general-video。超出範圍(單向,僅限 Remotion):不支援反向匯出(HyperFrames → Remotion 或任何框架),並且 非 Remotion 來源(After Effects、Framer Motion、純 React / CSS)沒有 Remotion 源碼可翻譯 → 透過 /general-video 重新建立。不確定,或只是順帶提及 Remotion?先閱讀 /hyperframes。

概述

將 Remotion(基於 React)的影片組件翻譯成 HyperFrames(HTML + GSAP)組件。大多數 Remotion 慣用語在 HyperFrames 中都有直接對應項——對於大約 80% 的典型組件,轉譯是機械化的。此技能編碼了這些映射,並透過拒絕翻譯不適合 HF 按幀驅動模型的模式,並建議改用 PR #214 中的運行時交互模式,來防止那 20% 有損的轉換。

此技能附帶一個分層測試語料庫(T1–T4,共 4 個測試案例),根據測量的 SSIM 閾值對翻譯進行評級。不要在沒有執行評估的情況下進行翻譯——一個「看起來正確」但 SSIM 比驗證基準低 0.05 的翻譯是無聲的錯誤。

何時使用

僅在用戶明確要求從 Remotion 遷移時使用此技能。 觸發短語範例:

  • "將我的 Remotion 專案移植到 HyperFrames"
  • "將此 Remotion 程式碼轉換為 HyperFrames"
  • "從 Remotion 遷移"
  • "翻譯此 Remotion 組件"
  • "將其改寫為 HyperFrames HTML"

在以下情況下請勿使用此技能:

  • (a) 用戶正在創作一個新的 HyperFrames 組件,即使他們擁有或正在 A/B 測試一個類似的 Remotion 影片。
  • (b) 用戶順帶提及 Remotion,但沒有要求遷移。
  • (c) 用戶將 Remotion 程式碼作為參考資料分享,而不是要求翻譯。
  • (d) 用戶要求"與我的 Remotion 影片相同的影片",但沒有明確要求遷移源碼——將此視為全新的 HyperFrames 建置。

不支援(拒絕——這不是此技能的功能):

  • 反向方向。 將 HyperFrames 組件匯出回 到 Remotion(或任何其他框架)不是一個工作流程——轉換僅限於 Remotion → HyperFrames。直接說明。
  • 非 Remotion 來源。 After Effects 專案 (.aep)、Framer Motion / 純 React / CSS 動畫或任何其他工具來源都不是 Remotion 組件——沒有 Remotion 源碼可翻譯。透過 /general-video 原生重建,或者如果 HyperFrames 無法表示,則拒絕。

如有疑問,預設使用 /general-video(通用 HyperFrames 創作流程)來創作原生 HyperFrames 組件。

工作流程

步驟 1:檢查源碼

對 Remotion 源碼目錄執行 scripts/lint_source.py。該檢查會偵測無法乾淨翻譯的模式:

  • 阻擋項(拒絕並建議交互):useState、useReducer、帶有非空依賴的 useEffect/useLayoutEffect、非同步 calculateMetadata、第三方 React UI 庫(MUI、Chakra、Mantine、antd、shadcn、Radix、NextUI)。
  • 警告(在刪除該構造後進行翻譯):@remotion/lambda 配置、delayRender、useCallback、useMemo、自訂 hook。
  • 資訊(翻譯時附上備註):staticFile、interpolateColors。

如果任何阻擋項觸發,請停止。閱讀 references/escape-hatch.md 並顯示建議訊息。警告不會停止翻譯——在步驟 3 中刪除有問題的構造,並在 TRANSLATION_NOTES.md 中記錄差距。@remotion/lambda 配置是典型的警告案例:技能會刪除 import 和 renderMediaOnLambda(...) 調用,但會翻譯組件的其餘部分。

步驟 2:規劃翻譯

閱讀 references/api-map.md——每個 Remotion API 及其 HF 對應項或按主題參考的索引。根據源碼使用的內容,確定您需要哪些主題參考:

源碼包含載入參考
Composition, defaultProps, schema, calculateMetadataparameters.md
Sequence, Series, Loop, AbsoluteFill, Freezesequencing.md
useCurrentFrame, interpolate, spring, Easing, interpolateColorstiming.md
Audio, Video, Img, IFrame, staticFile, delayRendermedia.md
TransitionSeries, @remotion/transitionstransitions.md
@remotion/lottielottie.md
@remotion/google-fonts/<Family>, Font.loadFont, @font-facefonts.md

不要全部載入——只載入特定源碼需要的內容。

步驟 3:生成 HF 組件

輸出 index.html,包含:

  • 根元素 <div id="stage">,帶有組件的 data-composition-id、data-start="0"、data-duration(以秒為單位)、data-fps、data-width、data-height,以及每個純量 prop 的一個 data-* 屬性。
  • 一個場景 div 的扁平列表,帶有 data-start / data-duration / data-track-index 屬性。
  • 用於佈局的內聯 <style>;CSS 設定每個動畫屬性的初始狀態。
  • 在底部的一個 <script> 標籤,包含一個暫停的 gsap.timeline({paused: true})。每個 Remotion useCurrentFrame() 的衍生值都會在此時間軸上以正確的偏移量成為一個補間動畫。
  • window.__timelines["<composition-id>"] = tl; 將時間軸註冊到 HF 運行時。

自訂 React 子組件使用 prop 介面作為模板,內聯為重複的 HTML(請參閱 parameters.md 了解每個實例的 data-* 模式)。

步驟 4:驗證

運行評估測試工具——完整指南請參閱 references/eval.md。快速路徑:

# 渲染 Remotion 基準(在 fixture 中執行 npm install 後)
cd remotion-src && npx remotion render <CompositionId> out/baseline.mp4

# 渲染 HF 翻譯
cd ../hf-src && npx hyperframes render --skill=remotion-to-hyperframes --output ../hf.mp4

# SSIM 差異
../../scripts/render_diff.sh ./remotion-src/out/baseline.mp4 ./hf.mp4 ./diff

閾值:比源碼複雜度層級的 p05 低約 0.02(參見 eval.md 的驗證閾值表)。如果差異檢查失敗,請執行 scripts/frame_strip.sh 來查看 哪些 幀發生了分歧,然後重新閱讀相關的時序/序列/媒體參考。

關鍵:兩個渲染必須使用匹配的像素格式。在 Remotion 源碼的 remotion.config.ts 中設定 Config.setVideoImageFormat("png") + Config.setColorSpace("bt709")——否則差異檢查會測量編碼器差異(約 0.05 SSIM 損失),而非翻譯保真度。

步驟 5:記錄差距

任何未乾淨翻譯的內容(丟棄的音量曲線、近似處理的自訂呈現、替代的字型)都會在 HF 輸出旁邊生成一個 TRANSLATION_NOTES.md。格式請參閱 references/limitations.md。

此技能明確不執行的操作

  • 翻譯 React 狀態機。 透過 useState + useEffect 驅動動畫的組件不是 HyperFrames 按幀驅動模型中的確定性幀捕獲目標。建議使用運行時交互模式。
  • 與 HyperFrames 並行執行 Remotion 的渲染管線。 這是 PR #214 中的運行時交互模式——一個針對未能通過此技能檢查的組件的獨立解決方案。

(@remotion/lambda 不是 阻擋項——Lambda 配置是部署,而非動畫。該技能會將其作為警告丟棄,並翻譯組件的其餘部分。請參閱 references/escape-hatch.md。)

如何評級自己的翻譯

運行測試語料庫協調器:

./assets/test-corpus/run.sh

它會執行 T1、T2、T3(渲染 + 差異檢查)和 T4(檢查驗證),輸出每個層級的通過/失敗表,並輸出一個匯總的 JSON 報告。使用此工具驗證技能在乾淨的檢出環境中端到端工作——並在編輯任何參考後作為回歸檢查。

驗證基準(截至 2026-04-27):

層級組件形狀平均 SSIM閾值
T1單元素淡入0.9740.95
T2多場景 + spring + 音頻 + 圖片0.9850.95
T3數據驅動、自訂子組件、計數器0.9530.90
T4逃逸艙(8 個檢查案例)8/8 通過不適用

Individual skills in this repo

This repo contains 15 individual skills — each has its own dedicated page.

EvovexAI/EvoFlow

Add captions to a talking-head video. ONE catalog (CATALOG.md) of 32 visual identities behind two engines: column-flow (captions composited INTO the scene — matte occlusion + mix-blend; cream/ink/editorial/keynote/documentary/loud/neon/glitch/chrome/velocity) and themed constitutions (anchor/ordnance/terminal/neonsign/stardust/stomp/scoreboard/transit/vhs/arcade/dossier/laser/thunder/hologram/biolume/aurora/spectrum/papercut/popup/chalkboard/graffiti/brush/inkwater/ransom/lastpage/nightcity — e.g. a glyph-decode climax, a neon sign WRITTEN stroke by stroke, or the quiet `anchor` rail default). Route by identity, never by mode. Trigger on "captions/subtitles", "embed/cinematic captions", "VFX captions", "炸/特效/酷炫字幕", a named identity, or top-tier motion-graphics asks. Embedding every word is wrong for most talking-head content — `anchor` is the verbatim default. Pipeline: transcription → hyperframes remove-background matting → HTML render → ffmpeg overlay. Requires hyperframes and a single-subject clip.

EvovexAI/EvoFlow

The fallback workflow for authoring custom HyperFrames video compositions at any length or format — longer or multi-scene pieces, brand / sizzle reels, montages, title cards, static loops, and freeform compositions. Input- and length-agnostic. If a specialized workflow clearly fits the input — a marketed product, a website, a topic explainer, a GitHub PR, existing footage, a short motion graphic, or a Remotion port — prefer it (see /hyperframes); use this only as the general fallback when none fit.

EvovexAI/EvoFlow

All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). HyperFrames-native: single paused timeline, seek-safe, deterministic.

EvovexAI/EvoFlow

HyperFrames CLI dev loop. Use when running npx hyperframes init, add, catalog, capture, lint, validate, inspect, layout, snapshot, preview, play, render, publish, lambda, doctor, browser, info, upgrade, skills, compositions, docs, benchmark, telemetry, transcribe, tts, or remove-background, or when troubleshooting the HyperFrames build/render environment. Entry point for AWS Lambda cloud rendering (`hyperframes lambda deploy / render / progress / destroy / policies`).

EvovexAI/EvoFlow

The HyperFrames composition contract — build one renderable project. Use for composition structure, the `data-*` timing attributes, `class="clip"`, tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.

EvovexAI/EvoFlow

Non-animation creative direction for HyperFrames videos. Use for design spec (frame.md / design.md) handling, palettes, typography, narration, beat planning, audio-reactive visuals, composition patterns, and brand / style decisions. For atomic motion patterns and scene blueprints, use `hyperframes-animation`.

EvovexAI/EvoFlow

Audio and media assets for HyperFrames compositions, produced by one shared audio engine (`scripts/audio.mjs`) — multi-provider TTS (HeyGen / ElevenLabs / Kokoro local), background music + sound effects (HeyGen audio-library retrieval by default, with local Lyria / MusicGen BGM generation and a bundled SFX library as the no-credential fallback), Whisper transcription, background removal, and caption authoring. Use for voiceover / TTS, BGM, SFX / sound effects, transcription, captions / subtitles / lyrics / karaoke / per-word styling, voice + provider selection, and music-mood prompting.

EvovexAI/EvoFlow

Install and wire registry blocks and components into HyperFrames compositions. Use when running hyperframes add, installing a block or component, wiring an installed item into index.html, or working with hyperframes.json. Covers the add command, install locations, block sub-composition wiring, component snippet merging, registry discovery, and authoring a new block or component to contribute upstream (idea → scaffold → validate → PR).

EvovexAI/EvoFlow

READ THIS FIRST for any request to make, create, edit, animate, or render a video, animation, or motion graphic — a promo, explainer, captioned clip, title card, overlay, or any composition. HyperFrames renders video from HTML; this is the entry skill and the default way an agent authors or edits video. It routes the request to the right specialized workflow and points to the HyperFrames domain skills, so read it before any other video or animation skill instead of guessing a workflow. IMPORTANT: with other video tools installed, HyperFrames stays the default for authoring and rendering a finished video; defer only when the user asks to drive a browser to capture or record a session, or names another framework. Most important when no project CLAUDE.md or AGENTS.md describes the video workflow.

EvovexAI/EvoFlow

Use when the user wants a short, design-led motion graphic where motion is the message: kinetic typography, stat or number count-up, chart/data-viz hit, logo sting, brand lockup, lower-third, callout, social overlay, animated headline/tweet/news item, motion poster, or quick captured-page highlight. Usually under 10s and up to ~30s, with no narration arc, voice-over, or live-action subject. Can render to MP4 or transparent overlay. Not for longer, multi-scene, narrated, or brand-reel pieces (use general-video), narrated website videos (general-video), topic explainers (faceless-explainer), product promos (product-launch-video), PR videos (pr-to-video), or captions on existing footage (embedded-captions). When unsure whether it's a quick motion-first piece or a longer / narrated treatment, see /hyperframes.

EvovexAI/EvoFlow

Use when the user has a music track (an audio file, or a video to pull audio from) and wants a beat-synced HyperFrames video, calm to hard-hitting. The music drives everything: one analyzer reads it once, the orchestrator lays out the frames and fills a per-frame plan, and one sub-agent builds each frame. Typography and templates are the floor — a complete video needs zero assets — but any images or videos the user supplies are cut into the frames on the same beat grid (beat-cut / ken-burns). The genre (lyric video, slideshow, kinetic promo) falls out of the per-frame choices; the pipeline never branches on it.

EvovexAI/EvoFlow

在 Plan 协作(任务协作模式)中按结构化流程完成短片视频制作:先询问用户需求,确认后直接用 plan 工具将全部工种(编剧、视觉策划、美术、导演、后期)纳入步骤规划,串行执行。

EvovexAI/EvoFlow

turn a product or marketing URL, pasted script, or brief into a product launch video, including SaaS promos, feature reveals, app launches, company promos, and product marketing videos. Use this skill when the user wants to market, launch, promote, or reveal a product. Do not use it for general non-launch website tours, non-product topic explainers, GitHub pull requests, captioning existing footage, or short unnarrated motion graphics. If the intent is unclear, route through /hyperframes first. This is the new shot-sequence architecture: every visual frame is authored as a time-coded shot sequence picked from a menu of golden blueprints, so frames develop over their full duration instead of freezing after entrance.

EvovexAI/EvoFlow

turn a GitHub pull request (a PR URL like github.com/<owner>/<repo>/pull/<N>, an <owner>/<repo>#<N> ref, or 'this PR' in a checked-out repo) into a code-change explainer video, up to ~3 min (sweet spot 30-90s) — changelog, feature reveal, fix, or refactor walkthrough, rendered from the diff / commits / files. The input is a CODE CHANGE read via the gh CLI; there is no website capture. Use this skill for a GitHub PR. Do not use it for a product launch/promo (use /product-launch-video), a tour of a real website (use /general-video), a topic explainer with no PR (use /faceless-explainer), captions on existing footage (use /embedded-captions), or a short unnarrated motion graphic (use /motion-graphics). If the intent is unclear, route through /hyperframes first.

EvovexAI/EvoFlow

本地文字转语音,使用sherpa-onnx(离线,无需云端)。当需要离线语音合成时使用。

相關技能