Communitygithub.com

影片剪輯(everything-claude-code)

從原始素材到成片:FFmpeg、Remotion、ElevenLabs、fal.ai,再到 Descript/CapCut 拋光。

影片剪輯(everything-claude-code) 是什麼?

演示拍完後整理結構與節奏——可交付的上線成片剪輯。

相容平台✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/video-editing

在你喜歡的 AI 中提問

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

預覽

來自技能 README

說明文件

影片剪輯

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

何時啟用

  • 使用者想要編輯、剪裁或組織影片素材
  • 將長錄製內容轉換為短影音
  • 從原始錄製內容建立 vlog、教學或展示影片
  • 為現有影片加入覆疊、字幕、音樂或旁白
  • 為不同平台(YouTube、TikTok、Instagram)重新構圖影片
  • 使用者說「剪輯影片」、「剪裁這段素材」、「製作 vlog」或「影片工作流程」

核心論點

當你停止要求 AI 創造整支影片,轉而使用它來壓縮、組織和增強真實素材時,AI 影片剪輯才真正有用。價值不在於生成,而在於壓縮。

流程

對於有參照基準的工作,將 taste-distillation 串接到 taste-application,然後回到此處進行編輯和最終輸出審查。獨立的美感技能可以使用現有素材;生成是非必要的。

在進行即時編輯器或 DAW 變更之前,請儲存一個版本化的專案檢查點,並確認檔案存在。變更後再儲存並確認另一個檢查點。API 回讀證明的是目前的記憶體狀態,而非已儲存。請在交接時將渲染媒體、可編輯專案和創意核准保持為分離的狀態。

對於 MIDI 驅動的音訊,請根據接收機架的 Note 映射檢查音高並試聽結果;成功的片段建立仍可能產生靜音。對於重建的專案,請透過原生載入和儲存進行驗證,按時間軸順序排序事件,驗證樣本連結和靜音狀態,然後檢查並試聽確切的匯出音訊是否有意外靜音。僅靠 XML 解析無法證明 DAW 接受了每個片段或產生了可聽的輸出。

在呼叫較新的指令之前,請檢查橋接器的能力握手。請勿將上傳或訓練資料遙測作為創意任務的副作用啟用;在缺乏同意或能力時,請使用受支援的本機控制路徑。

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

每個圖層都有其特定工作。請勿跳過圖層,也別試圖讓一個工具做所有事。

圖層 1:錄製(Screen Studio / 原始素材)

收集來源材料:

  • Screen Studio:為應用程式示範、程式碼撰寫、瀏覽器工作流程製作的精美螢幕錄影
  • 原始相機素材:vlog 素材、訪談、活動錄影
  • 透過 VideoDB 的桌面錄製:帶有即時情境的工作階段錄製(請參閱 videodb 技能)

輸出:準備好進行組織的原始檔案。

圖層 2:組織(Claude / Codex)

使用 Claude Code 或 Codex 來:

  • 轉錄和標記:產生逐字稿,識別主題和話題
  • 規劃結構:決定哪些保留、哪些剪掉、以及何種順序可行
  • 識別無效段落:找出停頓、離題、重複的片段
  • 產生剪輯決策列表:包含剪輯時間點和要保留的片段
  • 建構 FFmpeg 和 Remotion 程式碼:產生指令和組合
範例提示:
「這是一段 4 小時錄影的逐字稿。請找出最適合一段 24 分鐘 vlog 的 8 個最強片段。給我每個片段的 FFmpeg 剪裁指令。」

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

圖層 3:確定性剪裁(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

圖層 4:可程式化組合(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 參考。

圖層 5:生成素材(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": "科技 vlog 專業縮圖,深色背景,螢幕上有程式碼",
  "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="輕柔的咻一聲轉場音效")

圖層 6:最終修飾(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. 先結構,後風格。 在接觸任何視覺元素之前,先在圖層 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 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

相關技能