Communitygithub.com

DansiDanutz/Video-Editor

AI 輔助影片剪輯工作流程,適用於剪接、結構化與強化真實素材。涵蓋從原始拍攝到 FFmpeg、Remotion、ElevenLabs、fal.ai 並在 Descript 或 CapCut 中完成最終修飾的完整流程。當使用者想要編輯影片、剪輯素材、創作 Vlog 或建構影片內容時使用。

Video-Editor 是什麼?

這個技能定義了一套 AI 輔助的影片剪輯工作流程,專注於處理真實拍攝的素材而非從提示生成影片。它將編輯過程分為六個明確的層次:從螢幕錄製或原始拍攝的素材捕獲開始,接著利用 Claude/Codex 進行轉錄、分析和規劃剪輯決策,然後使用 FFmpeg 執行確定性的裁切、串接和轉碼。第四層是使用 Remotion 以程式化方式製作覆蓋層、動畫和數據可視化,第五層則透過 ElevenLabs 和 fal.ai 生成語音、音樂、音效和必要的視覺資產。最後,在 Descript 或 CapCut 中進行人工微調,以確保節奏、字幕和色彩校正的品質。此技能也包含場景偵測、靜音修剪和社群媒體比例調整(如 16:9 轉 9:16)的實用範例。其核心哲學是「剪輯,而非生成」——AI 的作用是壓縮和結構化素材,而非取代最終的創意決策。它支援 Claude Code、Codex 等平台,並提供具體的 Bash、Python 和 TypeScript 程式碼範例,讓開發者能建構可重複且高效的影片編輯自動化流程。

相容平台✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/DansiDanutz/Video-Editor/tree/HEAD/.claude/skills/video-editing

在你喜歡的 AI 中提問

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

預覽

來自技能 README

說明文件

影片剪輯

AI 輔助的真實素材編輯。不是從提示生成。快速編輯現有影片。

何時啟用

  • 使用者想要編輯、裁切或結構化影片素材
  • 將長時間錄製轉換為短影片內容
  • 從原始拍攝素材建構 Vlog、教學影片或示範影片
  • 為現有影片添加覆蓋層、字幕、音樂或旁白
  • 為不同平台(YouTube、TikTok、Instagram)重新構圖影片
  • 使用者說「編輯影片」、「剪裁這段素材」、「做一個 Vlog」或「影片工作流程」

核心論點

AI 影片剪輯的價值在於你不再要求它從頭到尾生成整部影片,而是利用它來壓縮、結構化與強化真實素材。價值不在於生成。價值在於壓縮。

處理流程

對於以測量為基礎的參考驅動工作,先將 taste-distillation 串連到 taste-application,然後回到此處進行編輯和最終輸出審查。 獨立的品味技能可以使用現有素材;生成是可選的。

在進入即時編輯器或 DAW 變更之前,儲存一個帶版本的專案檢查點並 確認檔案存在。在變更後再儲存並驗證另一個檢查點。 API 回讀僅證明當前的記憶體狀態,並不代表資料已儲存。 在交接過程中,將已渲染的媒體、可編輯的專案和創意審批保持為獨立的狀態。

對於 MIDI 驅動的音頻,請檢查音高是否符合接收機架的備忘錄映射並試聽結果; 成功的片段創建仍然可能產生靜音。 對於重建的專案,請透過原生載入和儲存進行驗證,按時間軸順序排序事件, 驗證樣本連結和靜音狀態,然後檢查並試聽導出的確切音頻是否有意外的靜音。 僅依靠 XML 解析並不能證明 DAW 接受了每個片段或產生了可聽的輸出。 在調用更新的指令之前,請檢查橋接器的能力握手。 不要將上傳或訓練資料遙測作為創意任務的副作用啟用; 在缺乏同意或能力時,請使用支援的本機控制路徑。

Screen Studio / 原始素材
  → Claude / Codex
  → FFmpeg
  → Remotion
  → ElevenLabs / fal.ai
  → Descript 或 CapCut

每個層次都有特定的工作。不要跳過層次。不要試圖讓一個工具包辦所有事情。

第一層:捕獲(Screen Studio / 原始素材)

收集來源素材:

  • Screen Studio:為應用程式示範、程式碼撰寫過程、瀏覽器工作流程進行的精美螢幕錄製
  • 原始攝影機素材:Vlog 素材、訪談、活動錄影
  • 透過 VideoDB 的桌面錄製:即時上下文的會話錄製(參閱 videodb 技能)

輸出:準備好進行整理的原始檔案。

第二層:組織(Claude / Codex)

使用 Claude Code 或 Codex 來:

  • 轉錄與標記:產生轉錄稿,識別主題和話題
  • 規劃結構:決定哪些保留、哪些刪除、什麼順序有效
  • 識別無效片段:找出停頓、離題、重複的拍攝
  • 產生剪輯決策清單:用於裁切的時間戳記、要保留的片段
  • 建構 FFmpeg 和 Remotion 程式碼:產生指令和組合
範例提示:
「以下是 4 小時錄製的轉錄稿。找出 8 個最強的片段以製作 24 分鐘的 Vlog。
為每個片段提供 FFmpeg 裁切指令。」

這個層次關乎結構,而非最終的創意品味。

第三層:確定性裁切(FFmpeg)

FFmpeg 處理無聊但關鍵的工作:分割、修剪、串接和預處理。

依時間戳記提取片段

ffmpeg -i raw.mp4 -ss 00:12:30 -to 00:15:45 -c copy segment_01.mp4

從剪輯決策清單批次裁切

#!/bin/bash
# cuts.txt: start,end,label
while IFS=, read -r start end label; do
  ffmpeg -i raw.mp4 -ss "$start" -to "$end" -c copy "segments/${label}.mp4"
done < cuts.txt

串接片段

# 建立檔案清單
for f in segments/*.mp4; do echo "file '$f'"; done > concat.txt
ffmpeg -f concat -safe 0 -i concat.txt -c copy assembled.mp4

建立代理以加快編輯速度

ffmpeg -i raw.mp4 -vf "scale=960:-2" -c:v libx264 -preset ultrafast -crf 28 proxy.mp4

提取音訊以便轉錄

ffmpeg -i raw.mp4 -vn -acodec pcm_s16le -ar 16000 audio.wav

標準化音訊電平

ffmpeg -i segment.mp4 -af loudnorm=I=-16:TP=-1.5:LRA=11 -c:v copy normalized.mp4

第四層:程式化組合(Remotion)

Remotion 將編輯問題轉化為可組合的程式碼。用它來處理傳統編輯器令人頭痛的事情:

何時使用 Remotion

  • 覆蓋層:文字、圖片、品牌標誌、下方三分之一資訊欄
  • 數據可視化:圖表、統計資料、動畫數字
  • 動態圖形:轉場、說明動畫
  • 可組合場景:跨影片的可重用模板
  • 產品示範:附註解的螢幕截圖、UI 高亮

基礎 Remotion 組合

import { AbsoluteFill, Sequence, Video, useCurrentFrame } from "remotion";

export const VlogComposition: React.FC = () => {
  const frame = useCurrentFrame();

  return (
    <AbsoluteFill>
      {/* 主要素材 */}
      <Sequence from={0} durationInFrames={300}>
        <Video src="/segments/intro.mp4" />
      </Sequence>

      {/* 標題覆蓋層 */}
      <Sequence from={30} durationInFrames={90}>
        <AbsoluteFill style={{
          justifyContent: "center",
          alignItems: "center",
        }}>
          <h1 style={{
            fontSize: 72,
            color: "white",
            textShadow: "2px 2px 8px rgba(0,0,0,0.8)",
          }}>
            AI 剪輯技術堆疊
          </h1>
        </AbsoluteFill>
      </Sequence>

      {/* 下一個片段 */}
      <Sequence from={300} durationInFrames={450}>
        <Video src="/segments/demo.mp4" />
      </Sequence>
    </AbsoluteFill>
  );
};

渲染輸出

npx remotion render src/index.ts VlogComposition output.mp4

請參閱 Remotion 文件 以了解詳細模式和 API 參考。

第五層:生成的資產(ElevenLabs / fal.ai)

僅生成你需要的東西。不要生成整部影片。

使用 ElevenLabs 製作旁白

import os
import requests

resp = requests.post(
    f"https://api.elevenlabs.io/v1/text-to-speech/{voice_id}",
    headers={
        "xi-api-key": os.environ["ELEVENLABS_API_KEY"],
        "Content-Type": "application/json"
    },
    json={
        "text": "你的旁白文字在此",
        "model_id": "eleven_turbo_v2_5",
        "voice_settings": {"stability": 0.5, "similarity_boost": 0.75}
    }
)
with open("voiceover.mp3", "wb") as f:
    f.write(resp.content)

使用 fal.ai 製作音樂和音效

使用 fal-ai-media 技能來:

  • 背景音樂生成
  • 音效(ThinkSound 模型,用於影片轉音訊)
  • 轉場音效

使用 fal.ai 生成視覺內容

用於插入鏡頭、縮圖或不存在的 B-roll:

generate(app_id: "fal-ai/nano-banana-pro", input_data: {
  "prompt": "專業技術部落格縮圖,深色背景,螢幕上顯示程式碼",
  "image_size": "landscape_16_9"
})

VideoDB 生成式音訊

如果已配置 VideoDB:

voiceover = coll.generate_voice(text="在此敘述旁白", voice="alloy")
music = coll.generate_music(prompt="程式開發 Vlog 背景 Lo-fi 音樂", duration=120)
sfx = coll.generate_sound_effect(prompt="輕柔的咻轉場音效")

第六層:最終修飾(Descript / CapCut)

最後一層是人的工作。使用傳統編輯器來處理:

  • 節奏:調整感覺太快或太慢的裁切點
  • 字幕:自動生成,然後手動清理
  • 調色:基本校正和氛圍設定
  • 最終音訊混音:平衡語音、音樂和音效的音量
  • 匯出:特定平台的格式和品質設定

這是品味所在的地方。AI 清除重複性工作。你做出最終決定。

社群媒體重新構圖

不同平台需要不同的長寬比:

平台長寬比解析度
YouTube16:91920x1080
TikTok / Reels9:161080x1920
Instagram Feed1:11080x1080
X / Twitter16:9 或 1:11280x720 或 720x720

使用 FFmpeg 重新構圖

# 16:9 轉換為 9:16(中央裁切)
ffmpeg -i input.mp4 -vf "crop=ih*9/16:ih,scale=1080:1920" vertical.mp4

# 16:9 轉換為 1:1(中央裁切)
ffmpeg -i input.mp4 -vf "crop=ih:ih,scale=1080:1080" square.mp4

使用 VideoDB 重新構圖

from videodb import ReframeMode

# 智慧重新構圖(AI 引導的主體追蹤)
reframed = video.reframe(start=0, end=60, target="vertical", mode=ReframeMode.smart)

場景偵測與自動裁切

FFmpeg 場景偵測

# 偵測場景變化(閾值 0.3 = 中等敏感度)
ffmpeg -i input.mp4 -vf "select='gt(scene,0.3)',showinfo" -vsync vfr -f null - 2>&1 | grep showinfo

靜音偵測以自動裁切

# 找出靜音片段(對裁切空白時段很有用)
ffmpeg -i input.mp4 -af silencedetect=noise=-30dB:d=2 -f null - 2>&1 | grep silence

精彩片段提取

使用 Claude 分析轉錄稿和場景時間戳記:

「給定這份包含時間戳記的轉錄稿和這些場景變更點,
找出 5 個最吸引人、長度 30 秒且適合社群媒體的片段。」

每個工具最擅長的事項

工具強項弱點
Claude / Codex組織、規劃、程式碼生成不是創意品味層
FFmpeg確定性裁切、批次處理、格式轉換沒有視覺編輯 UI
Remotion可程式化覆蓋層、可組合場景、可重用模板非開發者學習曲線高
Screen Studio立即取得精美螢幕錄製僅限螢幕捕獲
ElevenLabs語音、旁白、音樂、音效不是工作流程的核心
Descript / CapCut最終節奏、字幕、修飾手動,無法自動化

關鍵原則

  1. 剪輯,不要生成。 此工作流程用於裁切真實素材,而非從提示創建內容。
  2. 先結構後風格。 在第二層將故事結構處理好後,再碰觸任何視覺相關的東西。
  3. FFmpeg 是骨幹。 無聊但至關重要。是將長素材轉化為可管理狀態的關鍵。
  4. Remotion 用於可重複性。 如果你會做超過一次,就把它做成 Remotion 元件。
  5. 選擇性地生成。 只對不存在的資產使用 AI 生成,而不是對所有東西。
  6. 品味是最後一層。 AI 清除重複性工作。你做出最終的創意決定。

原生 Fusion 預設

ITO Production v1 提供了節制的高光光暈、相反的 RGB 空間偏移以及亮度/邊緣光暈。需在原生導入、儲存/重新開啟,並經雙來源視覺審查後的簡短動態渲染檢查中使用確切的檔案。這些是需要針對特定鏡頭進行審查的起始值;光暈不會偵測或追蹤主體。

ITO V28 包含經保存、原生驗證的 Fusion 圖形片段和一個冪等的 Lua 安裝程式。這些是技術相容性範例,不建議用作生產預設值:其記載的視覺限制需要在使用前進行調校和品味審查。請參閱套件來源資訊以了解先前導入和渲染檢查的範圍。

相關技能

  • fal-ai-media — AI 影像、影片和音訊生成
  • videodb — 伺服器端影片處理、索引和串流
  • content-engine — 平台原生內容分發

Individual skills in this repo

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

DansiDanutz/Video-Editor

Author or edit a custom HyperFrames composition when no specialized workflow fits, or when BRIEF.md sets flow: companion. Use for longer or multi-scene pieces, brand and sizzle reels, montages, static loops, static title cards, footage remixes, and freeform builds. Use motion-graphics instead for a short unnarrated motion-first unit, including an animated title. Route fresh creation through hyperframes before using this skill.

DansiDanutz/Video-Editor

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). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.

DansiDanutz/Video-Editor

Use when audio already placed in a HyperFrames composition needs to be mixed: fade-in/fade-out, crossfade, track gain or volume, volume automation, ducking, a music bed that fights a voiceover (voiceover carve), effects on a track (EQ, compressor, limiter, gate, saturation, delay, reverb, chorus, phaser, bitcrush), automation envelopes drawn on a track's volume or any effect parameter, or one submix bus carrying a chain, a fader and an automation clock for several tracks at once (`<hf-audio-group>`). Don't use for sourcing or generating audio — finding BGM, SFX, or making a voiceover is `/media-use`. Don't use for clip timing or track layout, which is `/hyperframes-core`.

DansiDanutz/Video-Editor

Use the HyperFrames CLI development loop: init, add, catalog, capture, lint, check, snapshot, compare, grade-compare, preview, play, present, beats, keyframes, single or batch render, publish, cloud, cloudrun, feedback, lambda, doctor, browser, info, upgrade, skills, compositions, timeline, history, docs, benchmark, telemetry, transcribe, auth, tts, and remove-background. Also use when diagnosing build or render failures. validate, inspect, and layout are deprecated aliases; use check. Covers local, HeyGen-hosted cloud, AWS Lambda, and Google Cloud Run rendering.

DansiDanutz/Video-Editor

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.

DansiDanutz/Video-Editor

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`.

DansiDanutz/Video-Editor

Use when a HyperFrames composition needs a punch-in, punch-out, zoom, reframe, Ken Burns treatment, camera move, visual match/whip handoff, or other seek-safe 2D/3D keyframes; also for GSAP, CSS keyframes, Anime.js, WAAPI, FLIP, paths, masks, SVG morph/draw, text trails, 3D depth, or `hyperframes keyframes` diagnostics. Don't use for broad scene strategy, brand design, media sourcing, captions, or general video planning.

DansiDanutz/Video-Editor

Search, install, and wire registry blocks and components into HyperFrames compositions. Use BEFORE hand-building any named visual — whenever a brief, a user, or a storyboard names a look, effect, treatment, or transition such as CRT scanlines, glitch, chromatic aberration, film grain, a shimmer sweep, a chart, a code or terminal window, a map, or a confetti burst — because roughly 400 hosted items already cover many of them and the search ranks all of them with nothing installed, no project, and no account. Also use when running hyperframes add or hyperframes catalog, installing one item or every block matching a tag, wiring an installed item into index.html, or working with hyperframes.json. Covers discovery, install locations, block sub-composition wiring, component snippet merging, and authoring a new block or component to contribute upstream (idea → scaffold → validate → PR).

DansiDanutz/Video-Editor

Mandatory entry point: read this first for any request to make, create, edit, animate, or render a video, animation, or motion graphic, including a promo, explainer, captioned clip, title card, overlay, slideshow or interactive deck, Remotion port, or any HyperFrames HTML composition. Also use it to inspect, diagnose, validate, preview, publish, or batch-render an existing HyperFrames project. Inputs may be a website URL, GitHub PR, Figma design or URL, text or brief, existing footage, or music. It resumes project state, captures intent when applicable, selects and installs the owning workflow, and routes domain capabilities. HyperFrames is the default output framework unless the user explicitly chooses another framework for the deliverable or asks only to record a browser session.

DansiDanutz/Video-Editor

Use when building or editing a HyperFrames project that people open in Studio: how the timeline should be laid out so it reads well (one caption track, one element kind per track, every scene a sub-composition) and where captions and key content may sit (safe zones). Don't use for how to perform an individual edit (split, trim, retime, volume, copy, swap): that is `creator-editing-recipes.md` in `/hyperframes-core`.

DansiDanutz/Video-Editor

Agent Media OS, the single skill for every media need in a HyperFrames project. Resolve BGM, SFX, image, icon, brand logo, voice, color grade, or LUT into a frozen local file or paste-ready block + ledger record (one verb, `resolve`); generate via TTS / music / image models when the catalog misses; produce voiceover, transcription, captions, and background removal through one shared audio engine; operate on media (cut / reframe / transform); and reuse assets across projects. Also use for vague feedback that real footage looks dark, flat, boring, should feel retro/camcorder/print/ASCII, needs privacy, or needs a media reveal.

DansiDanutz/Video-Editor

Turn a product or marketing URL, pasted script, or brief into a product launch / promo video — SaaS promos, feature reveals, product demos, app and company launches. Use when the user wants to market, launch, promote, or reveal a product; the default for any commercial URL. Site tours / showcases of a website route here too — the brief carries the show-it-as-is intent. Unclear → /hyperframes.

DansiDanutz/Video-Editor

Divide a finished story/script into filmable scenes with per-scene image and animation prompts. Use when building a scene outline or shot list, deciding scene boundaries, durations, or what each visual must show.

相關技能