這篇教學的每一條指令都來自本站在 RTX A6000 48 GB 工作站 上實際錄下的終端機過程(2026-11-05 的版本,commit 80e02e74a0af),照順序做即可。
開始前
本次測試環境為 Ubuntu Linux(核心 7.0.0-38-generic),配備 NVIDIA RTX A6000 GPU(驅動 580.159.03)與 Intel Core i7-9700 CPU。系統需預先安裝 Node.js(建議 v22+,若版本過舊腳本會自動下載)、Python 3.12、uv 以及 FFmpeg。由於渲染過程依賴無頭 Chrome 與 FFmpeg 編碼,請確保系統已具備這些基礎工具,且磁碟空間足夠存放約 1.7 GB 的原始碼與依賴套件。
安裝與執行
步驟 1:取得原始碼
從 GitHub 複製 heygen-com/hyperframes 專案,並切換至指定的 commit 版本(80e02e74a0af),以確保測試環境與我們錄製時完全一致。
git clone https://github.com/heygen-com/hyperframes hyperframes cd hyperframes
成功時會看到:執行 git log 後顯示 commit 訊息 'fix(lint): compositions in .hyperframesignore no longer count as the project's',且 du -sh 顯示目錄大小約 1.7G。(這一步我們花了 1.6 秒,結束碼 0)
bun.lock docs plans skills-manifest.json CLAUDE.md DOCS_GUIDELINES.md plugin.json test-utils CODE_OF_CONDUCT.md examples README.md themes commitlint.config.js gemini-extension.json registry TRIAGE.md context7.json knip.config.ts releases updates CONTRIBUTING.md lefthook.yml scripts
步驟 2:安裝 CLI 工具
透過 npm 全域安裝 hyperframes 指令行工具,並驗證安裝版本與系統中的 FFmpeg 是否可用,這是後續執行渲染指令的關鍵依賴。
npm install -g --prefix "~/lab/npm" --prefix "~/lab/npm" hyperframes && hyperframes --version && ffmpeg -version | head -1
成功時會看到:npm install 完成後,hyperframes --version 輸出 '0.9.16',ffmpeg -version 顯示 'ffmpeg version 6.1.1-3ubuntu5'。(這一步我們花了 9.2 秒,結束碼 0)
changed 78 packages in 9s ⠸ ⠸24 packages are looking for funding ⠸ run `npm fund` for details ⠸0.9.16 ffmpeg version 6.1.1-3ubuntu5 Copyright (c) 2000-2023 the FFmpeg developers
步驟 3:初始化範例專案
使用 hyperframes init 指令建立一個新的範例專案目錄,生成必要的設定檔與 HTML 結構,作為後續渲染的基礎。
rm -rf demo-video && CI=1 hyperframes init demo-video < /dev/null && ls -la demo-video
成功時會看到:終端機顯示 'Created demo-video/',並列出 AGENTS.md、hyperframes.json、index.html 等檔案,最後提示 'Get started' 與後續指令建議。(這一步我們花了 0.7 秒,結束碼 0)
-rw-rw-r-- 1 user user 7691 11月 5 23:04 AGENTS.md -rw-rw-r-- 1 user user 7691 11月 5 23:04 CLAUDE.md -rw-rw-r-- 1 user user 318 11月 5 23:04 hyperframes.json -rw-rw-r-- 1 user user 1609 11月 5 23:04 index.html -rw-rw-r-- 1 user user 91 11月 5 23:04 meta.json -rw-rw-r-- 1 user user 295 11月 5 23:04 package.json
步驟 4:檢視 HTML 合成檔
查看自動生成的 index.html 內容,了解專案如何透過 data 屬性定義時間軸、尺寸與 GSAP 動畫時間線,這是理解 Hyperframes 運作原理的關鍵。
cd "~/lab/demo-video" && for f in $(ls *.html 2>/dev/null | head -1); do echo "== $f"; head -80 "$f"; done
成功時會看到:輸出內容包含 <!doctype html>、viewport 設定為 1920x1080,以及引入 gsap.min.js 的 script 標籤,並定義了 #root 與 #title 的樣式。(這一步我們花了 0.0 秒,結束碼 0)
// Example: tl.fromTo("#title", { opacity: 0, filter: "blur(8px)" }, { opacity: 1, filter: "blur(0px)", duration: 0.18, ease: "power4.out" }, 0);
window.__timelines["main"] = tl;
tl.seek(0);
</script>
</body>
</html>步驟 5:渲染 MP4 影片
執行 hyperframes render 指令,啟動無頭 Chrome 逐格截圖並透過 FFmpeg 編碼,將 HTML 動畫轉換為 MP4 影片。
cd "~/lab/demo-video" && CI=1 hyperframes render < /dev/null 2>&1 | tail -40
成功時會看到:進度條從 0% 推進至 100%,顯示 'Streaming frame' 與 'Encoding frame' 過程,最後輸出 'Render complete' 以及生成的 MP4 檔案路徑與大小(29.0 KB · 10.0s video)。(這一步我們花了 7.6 秒,結束碼 0)
@hf-progress {"code":"assemble","done":0,"total":10,"pct":90}
@hf-progress {"code":"assemble","done":0,"total":10,"pct":90}
@hf-progress {"code":"assemble","done":10,"total":10,"pct":99}
◇ /home/user/lab/notes/heygen-com-hyperframes/demo-video/renders/demo-video_2026-11-05_23-04-36.mp4
29.0 KB · 10.0s video · rendered in 6.5s
@hf-result {"version":1,"operation":"render","reference_background":{"kind":"solid","rgb":[0,0,0]}}步驟 6:驗證輸出規格
使用 ffprobe 檢查生成的 MP4 檔案,確認其編碼格式、解析度、幀率與時長是否符合預期,確保渲染結果正確無誤。
cd "~/lab/demo-video" && ls -la renders/ && M=$(ls -t renders/*.mp4 | head -1) && ffprobe -v error -show_entries format=duration:stream=codec_name,width,height,r_frame_rate -of default=nw=1 "$M"
成功時會看到:ffprobe 輸出顯示 codec_name=h264、width=1920、height=1080、r_frame_rate=30/1、duration=10.000000。(這一步我們花了 0.1 秒,結束碼 0)
-rw-rw-r-- 1 user user 29708 11月 5 23:04 demo-video_2026-11-05_23-04-36.mp4 codec_name=h264 width=1920 height=1080 r_frame_rate=30/1 duration=10.000000
步驟 7:查看 CLI 指令
列出 hyperframes 支援的所有子指令,讓讀者了解除了 init 與 render 之外,還有哪些功能可用於專案開發、驗證與媒體處理。
hyperframes --help 2>&1 | head -40
成功時會看到:輸出顯示 'hyperframes v0.9.16',並列出 init、add、capture、preview、render、lint、check 等指令及其簡短說明。(這一步我們花了 0.1 秒,結束碼 0)
templates Pull a style template into this project (HyperFrames Pro) info Print project metadata compositions List all compositions in a project timeline Print the project's tracks and clips history List, undo and restore the project's recorded changes docs View inline documentation in the terminal
確認裝好了
渲染完成後,我們透過 ffprobe 確認生成的 MP4 檔案規格為 H.264 編碼、1920x1080 解析度、30 FPS,時長精確為 10 秒。檔案大小約 29 KB,位於 renders/ 目錄下,證明 HTML 動畫已成功轉換為確定性影片。
可能遇到的問題
1. 若 npm install 時出現權限錯誤,請確認是否已正確設定 npm prefix 或使用 sudo(不建議)。
2. 若渲染過程中 Chrome 啟動失敗,請檢查系統是否已安裝必要的無頭瀏覽器依賴庫(如 libnss3, libatk-bridge2.0-0 等)。
3. 若 ffmpeg 指令找不到,請確認系統 PATH 環境變數是否包含 ffmpeg 安裝路徑。
接下來
安裝成功後,讀者可以嘗試修改 index.html 中的 GSAP 動畫時間線,或參考官方文件使用 hyperframes add 指令從 registry 安裝更多元件區塊,進一步探索如何透過程式化方式生成複雜的影片內容。

