Communitygithub.com

zroeschen/影片製作工廠

影片剪輯管線中的第一個代理程式。用於從人物發言錄影中移除靜音和停頓。當被要求剪掉靜音、修剪停頓、移除死氣沉沉的空隙或緊湊原始影片節奏時使用,需搭配逐字稿。

影片製作工廠 是什麼?

這個技能是自動化影片剪輯管線的第一步,專門處理「剪掉靜音」的任務。它接收原始錄影及其逐字稿,利用基於閾值的規則來識別並修剪過長的停頓(預設為0.55秒),同時保留自然呼吸間隔(如0.14至0.24秒)。它會裁剪片頭片尾的空白,但不會處理語誤或重複,這些留給後續的「剪掉錯誤」代理程式。輸出包含一份編輯決策清單(EDL)、一份時間軸重建的逐字稿,以及可選擇透過 ffmpeg 渲染的剪輯後影片。支援的命令列選項可調整剪輯強度與輸出路徑。該代理程式主要用於 Node.js 環境,並與 ElevenLabs Scribe 格式的逐字稿相容。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/zroeschen/Video-Production-Factory/tree/HEAD/.agents/skills/cut-silences

在你喜歡的 AI 中提問

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

說明文件

剪掉靜音(管線代理程式 1)

自動化編輯的第一步。接受原始錄影 + 逐字稿,並移除僅有的靜音:第一個字之前的空白、最後一個字之後的空白,以及超過閾值的詞間停頓(修剪至自然的呼吸長度,絕不硬切至零間隙)。它保留說話者的文字內容——不處理語誤、重錄或結巴,這些是「剪掉錯誤」代理程式(代理程式 2)的工作。

此代理程式是確定性的且由逐字稿驅動,因此其輸出(*.silence-transcript.json)能乾淨地饋入後續代理程式和節拍驗證工具。

使用時機

  • 「剪掉靜音」、「修剪停頓」、「移除死氣沉沉的空隙」、「緊湊節奏」
  • 作為主編輯工作流程的第一階段,緊接在轉錄之後。

前置條件

一份逐字稿 JSON。可以是 ElevenLabs Scribe 格式 ({ words: [{ text, start, end, type }], audio_duration_secs })或通用格式 { words: [{ text, start, end }] }。使用工作區的轉錄工具產生:

node scripts/transcribe-elevenlabs.mjs path/to/raw.mp4    # -> path/to/raw.json

使用方式

# 1) 只規劃 — 計算剪輯,寫出 EDL + 重新對齊時間的逐字稿(不觸碰影片)
node .agents/skills/cut-silences/scripts/cut-silences.mjs <transcript.json> \
  --out-dir video-projects/<slug>/assets

# 2) 搭配影片 — 同時寫出 ffmpeg 指令(仍不實際轉檔)
node .agents/skills/cut-silences/scripts/cut-silences.mjs <transcript.json> \
  --video video-projects/<slug>/assets/raw.mp4 --out-dir video-projects/<slug>/assets

# 3) 渲染剪輯後的影片(本機 ffmpeg,重新編碼,影音保持同步)
#    加上 --apply 才會實際執行 ffmpeg
node .agents/skills/cut-silences/scripts/cut-silences.mjs <transcript.json> \
  --video video-projects/<slug>/assets/raw.mp4 --apply \
  --output video-projects/<slug>/assets/edited-silenced.mp4

選項

旗標預設值說明
--video <path>—來源影片;啟用 ffmpeg 指令/渲染
--out-dir <dir>逐字稿旁輸出寫入位置
--output <path><video-stem>.silenced.mp4剪輯後影片路徑
--gap <s>0.55視為可修剪靜音的最短停頓
--head-pad <s>0.22第一個字之前保留的靜音
--tail-pad <s>0.34最後一個字之後保留的靜音
--apply關閉實際執行 ffmpeg 渲染剪輯

判斷規則(靜音規則)

  • 低於 --gap(0.55秒)的停頓保持不變——自然的語速節奏。
  • 對於被修剪的停頓,會保留自然的呼吸長度,並根據上下文調整:長停頓(≥2秒)保留 0.24 秒,句子結尾(. ! ?)後保留 0.20 秒,其他情況保留 0.14 秒。保留的呼吸略微偏向之前短語的結尾。
  • 片頭/片尾的空白被修剪至 --head-pad / --tail-pad。
  • 刪除範圍合併;保留範圍為其互補集合。剪輯透過 ffmpeg 的 trim/atrim + concat 濾波器圖渲染(寫入 *.silence-filter.txt 腳本並透過 -filter_complex 傳入),確保影音同步。

輸出(寫入 --out-dir)

檔案用途
<stem>.silence-edl.json保留/刪除範圍、時長、參數——編輯決策清單
<stem>.silence-transcript.json在編輯後時間軸上重新對齊的逐字稿(饋入代理程式 2 + 節拍)
<stem>.silence-decisions.md人類可讀摘要 + 被修剪的最大停頓
<stem>.silence-filter.txtffmpeg 濾波器圖(僅搭配 --video)
<video-stem>.silenced.mp4剪輯後影片(僅搭配 --apply)

輸出至 stdout 的 JSON 摘要包含 removed、removedPct、範圍計數和輸出路徑——便於主工作流程記錄和串接。

調整備註

  • 談話性 YouTube 預設值(--gap 0.55)會從典型原始片段中移除約 15-20% 的純靜音。降低 --gap 可獲得更緊湊、更快的剪輯;提高則保留更多自然呼吸空間。
  • 如果剪輯在句子邊界感覺過於激進,可提高句子間呼吸長度,或提高 --gap。

移交給下一個代理程式

將 <stem>.silence-transcript.json(以及 silenced.mp4 如果已渲染)傳遞給剪掉錯誤代理程式。由於時間戳已位於編輯後時間軸上,後續的節拍定時和 scripts/validate-beat-sync.mjs 無需額外調整即可正常運作。

Individual skills in this repo

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

zroeschen/Video-Production-Factory

Agent 2 of the video editing pipeline. Finds and removes spoken mistakes — stutters, repeated words, false starts, and retakes (re-recorded lines) — from a talking-head recording. Use after cut-silences, when asked to cut mistakes, remove stutters / repeats / filler restarts, clean up flubs, or keep the best take. Works review-gated: it proposes every cut with context and a reason for approval, then renders only the approved cuts via ffmpeg. Requires a word-level transcript.

zroeschen/Video-Production-Factory

Edit a raw talking-head video through transcription, silence trimming, mistake review, visual storytelling, motion graphics, and verified HyperFrames rendering. Use for a complete edit; route a single requested operation directly to its specialist skill.

zroeschen/Video-Production-Factory

GSAP animation reference for HyperFrames. Covers gsap.to(), from(), fromTo(), easing, stagger, defaults, timelines (gsap.timeline(), position parameter, labels, nesting, playback), and performance (transforms, will-change, quickTo). Use when writing GSAP animations in HyperFrames compositions.

zroeschen/Video-Production-Factory

HyperFrames CLI tool — hyperframes init, lint, preview, render, transcribe, tts, doctor, browser, info, upgrade, compositions, docs, benchmark. Use when scaffolding a project, linting or validating compositions, previewing in the studio, rendering to video, transcribing audio, generating TTS, or troubleshooting the HyperFrames environment.

相關技能