Communitygithub.com

長影片渲染

組裝完成的影片並執行審查循環。從片段(或帶有鏡頭運動的圖片)、語音、音效和字幕建立剪輯,渲染帶有場景編號和時間的低品質審查版本供客戶審閱,收集並套用修改(根據需要重新渲染審查版本),並在使用者批准後渲染高品質的最終影片。使用具有 CLI 或 MCP 的影片編輯器(如果有的話且使用者願意),否則使用內建的 ffmpeg 渲染器。在 long-video-sound 之後使用,或當使用者要求渲染、組裝、匯出、預覽或完成影片時使用。

長影片渲染 是什麼?

本技能「長影片渲染」是長影片工作流程中的第九階段,負責將所有前期製作的素材組裝成可供審查的影片版本,並在使用者確認後輸出最終的高品質成品。其主要功能包括從專案中盤點所有場景的影片片段、圖片、語音與音效檔案;選擇並驅動影片編輯工具(如支援 CLI/MCP 的編輯器或內建的 ffmpeg);根據腳本與素材建立精確的剪輯清單;渲染低解析度、帶有場景編號與時間碼的審查版本,供客戶或使用者評閱;收集回饋並分類處理(如剪輯調整、重新生成片段、語音或音效),並在每次修改後產出新的審查版本;最後,在獲得使用者明確批准後,以設定的解析度與編碼參數渲染最終的高品質影片。此技能支援多種平台與配置,並遵循嚴格的規則,例如未經明確批准絕不渲染最終版本、不擅自修改已批准的腳本、不在使用者要求前上傳或分享影片等。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/samanfirouzi/long-video-skill/tree/HEAD/skills/long-video-render

在你喜歡的 AI 中提問

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

說明文件

長影片渲染 是做什麼的?

長影片工作流程的第 9 階段。輸出:低品質審查渲染(直到使用者批准),然後輸出一個高品質的最終影片。

場景 指腳本中的一個片段,按照影片順序編號,與前面階段相同。場景編號會燒錄在審查影片中,以便審查者可以針對它們提出意見。

開始之前

  1. 在 ~/.long-video/projects/<slug>/ 中找到專案。需要 video-script.md 且 status: approved。
  2. 載入專案設定:解析度、長寬比、字幕模式 (visuals.captions)、響度需求、平台。
  3. 檢查 ffmpeg 和 ffprobe (ffmpeg -version)。內建渲染器需要支援 libx264 和 libass 的 ffmpeg。
  4. 如果 render/ 已存在,詢問:繼續(列出版本),或重新開始。

步驟 1:盤點

檢查每個場景並列出存在的項目:

項目位置用途
影片片段clips/scene-<NNN>_clip.*(或 _take2 及後續使用者批准的版本)該場景的畫面
僅圖片frames/scene-<NNN>_start.*根據腳本帶有鏡頭運動(推近、拉遠、平移)的靜態畫面
語音audio/lines/scene-<NNN>_<speaker>_<NN>.*旁白與對話
音效sound/mix/sfx_track.wav、amb_track.wav、music_track.wav特效、環境音、音樂

用簡短的表格報告缺口。一個沒有片段也沒有圖片的場景是阻塞項:列出這些場景並提議回到 long-video-keyframes 或 long-video-clips。只有在使用者選擇跳過那些階段時,才允許缺少語音或音效。如果某個階段已被跳過,不要再要求它。

如果片段階段被跳過(clips_mode: images-only),每個場景都會變成一個帶有從腳本鏡頭設定中取得的鏡頭運動的靜態畫面。

步驟 2:選擇組裝工具

  1. 檢查 Claude 可以驅動的影片編輯器:本次 session 中已連接的編輯 MCP 伺服器,或裝置上的 CLI(FilmCraft: filmcraft-cli commands;EffectCraft: effectcraft-cli --help)。請參閱 ../long-video-sound/references/tools.md,第 5 節。
  2. 如果有可用的工具,詢問:使用它(使用者可以開啟專案並調整),或使用內建渲染器。預設為內建渲染器。如果使用者選擇編輯器,請先閱讀其命令清單和文件,在副本上操作,安裝或建置任何東西前先詢問,並保持相同的檔案名稱。
  3. 說明將使用哪個工具。

本技能的其餘部分描述內建渲染器。使用編輯器時,透過其命令執行相同的步驟,並將審查和最終檔案匯出到相同的資料夾和名稱。

步驟 3:建立剪輯清單

閱讀 references/edl-format.md。從專案檔案寫入 render/edl.json:

  • 每個場景一個條目,包含其持續時間(來自腳本,或當實際片段長度在場景長度內較短或較長時的實際長度)、畫面來源、用於靜態畫面的鏡頭運動以及過場效果,
  • 語音放置:場景開始時間加上一個短偏移量(預設為 0.3 秒),依序排列的台詞之間有少量間隙,
  • 音效檔案,
  • 來自語音文字的字幕(根據每個語音檔案的持續時間設定開始和結束時間),如果設定需要字幕,
  • 解析度、高度、寬度和 fps 來自設定。預設 fps 為 24。預設響度目標為 -14 LUFS,真峰值低於 -1.5 dBTP。

規則:

  • 使用已批准腳本中的確切場景持續時間。不要為了配合而拉長或縮短故事。
  • 比其場景長的片段將從末尾修剪。比其場景短的片段將保持其最後一幀。兩者都應報告。
  • 超過其場景結尾或影片結尾的語音台詞將作為警告報告。
  • 過場效果:預設為 cut(直接切)。僅在腳本明確指定時使用 fade(淡出到黑色)。交叉溶解需要編輯器工具。
  • 在渲染前檢查計劃:node <skill folder>/scripts/build-render.mjs render/edl.json review render/review --plan。

顯示簡短摘要:場景數量、相對於目標的總時長、片段與靜態畫面之比、警告。修復可以在不改變故事的情況下解決的問題。對任何無法解決的問題詢問使用者。

步驟 4:渲染審查版本

審查品質:低解析度(約 360p)、高壓縮、場景編號和時間燒錄在左上角,如果設定使用內嵌字幕則包含字幕。

node <skill folder>/scripts/build-render.mjs render/edl.json review render/review --version 1
  • 輸出:render/review/<slug>_review_v1.mp4,以及一個包含持續時間、大小和響度的 .report.json 檔案。
  • 場景片段會被快取。後續審查只會重新渲染更改過的場景,因此速度會快很多。
  • 對於長度超過幾分鐘的影片,在背景執行命令並等待其完成。不要輪詢。
  • 如果字幕模式是 srt,則會在影片旁邊寫入一個 .srt 檔案。

檢查報告:實際持續時間與計劃持續時間、響度、串流。然後告訴使用者完整路徑和大小。

說明如何審查:觀看檔案,注意角落顯示的場景編號和時間以及每個評論。Claude 不會發送或上傳檔案。使用者將它分享給客戶。僅在使用者要求時提供準備上傳的服務,並且要先詢問。

步驟 5:收集修改

詢問:「需要任何修改嗎?如果是最終版,請說出來,我將渲染高品質版本。」

使用者可能會貼上客戶的回饋。閱讀 references/review-feedback.md。對於每個評論:

  1. 找到它所指的場景編號或時間。如果評論模糊,問一個簡短的問題。
  2. 對其進行分類並選擇處理方式:
    • 編輯級別(修剪、長度、順序、字幕文字、字幕開關、過場、語音、音樂或效果的音量):在 edl.json 或音效檔案的增益中修正。
    • 場景的畫面(外觀、角色、構圖、動作):回到這些場景的 long-video-keyframes 或 long-video-clips。新檔案將使用 _take2 風格的名稱。然後更新剪輯清單。
    • 語音台詞(表達、發音、措辭):這些台詞的 long-video-voice。對已批准腳本的措辭更改需要使用者批准和腳本修訂。
    • 音效(特效、環境音、音樂):這些提示的 long-video-sound,然後重新混音。
    • 故事或結構(新增或刪除場景):long-video-director,然後重新處理下游僅受影響的場景。
  3. 將清單寫入 render/review-log.md,包含版本、場景、請求、處理方式和狀態。
  4. 用一個簡短的表格向使用者展示計劃。在任何會耗費信用或時間的重新生成之前,請求使用者同意。
  5. 套用修改,然後渲染下一個審查版本(--version 2,依此類推)。保留所有舊的審查檔案。
  6. 逐個場景告訴使用者更改了什麼,以及新的檔案路徑。

重複直到使用者批准。沉默或「目前看起來不錯」不是批准。

步驟 6:渲染最終影片

僅在使用者明確表示某個特定的審查版本是最終版本後才能進行。

  1. 確認:「根據審查 v 渲染最終版本?」檢查剪輯清單是否與該版本匹配,並且審查日誌中沒有未完成的更改請求。
  2. 最終品質:設定的解析度、高品質 H.264 (crf 18, slow preset)、AAC 192k、兩遍響度正規化至目標值、無審查標籤。只有在設定指定內嵌時才燒錄字幕,否則會寫入一個 .srt 檔案。
  3. 執行它,對於長影片在背景執行:
node <skill folder>/scripts/build-render.mjs render/edl.json final render/final
  1. 使用報告和 ffprobe 驗證:持續時間與計劃匹配,解析度和 fps 正確,有一個視訊和一個音訊串流,響度接近目標值(在大約 1 LU 內),真峰值低於 -1 dBFS。
  2. 可選地檢查意外的黑畫面和長時間靜音:ffmpeg -i FILE -vf blackdetect=d=0.5 -af silencedetect=noise=-50dB:d=3 -f null -。報告發現結果。
  3. 更新 project.json:"stage": "final-rendered"、"final_video": "<path>" 以及被批准的審查版本。
  4. 告訴使用者完整路徑、大小和持續時間。提醒他們影片描述中 sound/credits.md 的致謝。
  5. 提議繼續進行 long-video-publish(YouTube 標題選項、描述、標籤和縮圖提示)。僅在使用者同意時才啟動。不要發布或上傳。除非使用者要求且該階段存在,否則不要啟動任何其他後續階段。

規則

  • 未經明確批准某個特定審查版本,絕不渲染最終版本。
  • 絕不更改已批准的腳本。如果回饋需要更改,請引導並詢問。
  • 未經使用者明確要求,絕不發送、分享或上傳影片。
  • 絕不刪除舊的審查渲染。
  • 未經使用者同意計劃,絕不重新生成圖片、片段、語音或音效。
  • 保持聊天訊息簡短。將更改清單放在 render/review-log.md 中。

Individual skills in this repo

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

long-video-assets

Video and animation skill. Build the visual foundation for a long video from an approved story. Extracts the recurring characters, environments and key objects, helps the user choose one art style from suggested options (10 at a time, more on request), then writes image generation prompts for every character (portrait plus character sheet), environment and object, all sharing one locked style. Can also generate the images (installed tool, API, MCP or browser) or hand the user a folder and file names to fill. Use after lon

long-video-director

Turn an approved story into a shot-by-shot video script, acting as the director. Asks whether the video uses a narrator or characters who speak (or both), suggests professional filming choices (camera type, lenses, camera movement, lighting, color, pacing), saves them as a separate film style file, then writes a script that matches the project config. Outputs film-style.md and video-script.md. Use after long-video-story (and long-video-assets) are done, or when the user asks for the video script, shot list, camera style or lighting plan.

long-video-keyframes

Create the start and end frame image for every scene (clip) of the approved video script. Writes one image prompt per frame with a fixed file name that holds the scene number and start or end, makes a folder for the images, and can generate the images with an available image tool, or hand the prompts to the user all at once or one by one. Use after long-video-director, or when the user asks for start frames, end frames, keyframes or scene images.

long-video-sound

Video and animation skill. Create the sound effects, ambience and background music for the video and place them on the timeline. Plans the sound design from the approved script, sources or makes each sound (Openverse for openly licensed recordings and music, Earshot to make sounds from words and to listen to and judge sounds, Clipwing real-sfx to place real sounds on exact frames), records licences and credits, and mixes separate stems (effects, ambience, music) with the music ducked under speech. Or gives the user a fold

long-video-story

Agree on the story for a long video. The user either supplies a story or asks Claude to write one. When Claude writes, it first asks which story style to use (for example niche discovery, or a provocative-questions narration), runs that style's skill, and revises until the user approves. Use after long-video-setup, or when the user says "story for my video", "give me an idea", or wants to change an unapproved story. Ends only when the user explicitly approves the story.

long-video-voice

Create the spoken audio (narration and character voices) for the approved video script. First decides whether the video needs speech and asks the user to confirm. If yes, builds a voice cast (narrator plus each speaking character), makes a short sample of each voice with an available tool such as an ElevenLabs MCP and asks the user to approve the voices, then generates one audio file per spoken line with a name that holds the scene number and speaker. Or gives the user the lines, file names and folder to record or generate themselves. Use after long-video-clips (or long-video-keyframes), or when the user asks for narration, voiceover, voices or dialogue audio.

相關技能