選項
首頁首頁 Skill 其他 video-editing

video-editing

affaan-m/ECC affaan-m/ECC

利用 FFmpeg、Remotion、ElevenLabs、fal.ai 以及傳統剪輯軟體組成的工作流程,對真實影片素材進行剪輯、結構調整及增強處理。

...展開全部
67
更新時間 2026-10-02

影片剪輯

針對真實影片的 AI 輔助剪輯。並非根據提示生成的影像。能快速剪輯現有影片。

何時啟用

  • 使用者希望編輯、剪輯或重新組織影片素材
  • 將長篇錄影轉化為短篇內容
  • 從原始拍攝素材製作部落格影片、教學影片或示範影片
  • 為現有影片添加疊加圖層、字幕、音樂或旁白
  • 為不同平台(YouTube、TikTok、Instagram)重新構圖影片
  • 使用者說「編輯影片」、「剪輯這段素材」、「製作生活影片」或「影片工作流程」

核心論點

當你不再要求 AI 製作整支影片,而是開始利用它來壓縮、結構化並增強真實影像時,AI 影片編輯便能發揮作用。其價值不在於生成,而在於壓縮。

工作流程

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

每個層級都有其特定功能。請勿跳過任何層級,也請勿試圖讓單一工具包辦一切。

層 1:擷取(Screen Studio / 原始片段)

蒐集原始素材:

  • Screen Studio:用於應用程式示範、編碼過程及瀏覽器工作流程的精修螢幕錄影
  • 原始攝影素材:Vlog 片段、訪談、活動錄影
  • 透過 VideoDB 進行桌面擷取:帶有即時情境的會話錄製(參見videodb技能)

輸出:可供整理的原始檔案。

第二層:整理(Claude / Codex)

使用 Claude Code 或 Codex 來:

  • 轉錄與標註:生成文字稿,識別話題與主題
  • 規劃結構:決定保留哪些內容、刪除哪些內容,以及何種順序最為合適
  • 識別冗餘段落:找出停頓、離題及重複片段
  • 生成剪輯決策清單:標記剪輯時間戳記及需保留的片段
  • 生成 FFmpeg 與 Remotion 程式碼框架:產生相關指令與組合
範例提示:
「這是長達 4 小時的錄音文字稿。請從中識別出 8 個最具亮點的片段,
用以製作 24 分鐘的影音部落格。並為每個片段提供 FFmpeg 剪輯指令。」

此階段著重於結構,而非最終的創意品味。

第三層:確定性剪輯(FFmpeg)

FFmpeg 負責處理那些枯燥但至關重要的工作:分割、修剪、串接及預處理。

根據時間戳記提取片段

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

根據編輯決策清單進行批次剪輯

#!/bin/bash
# cuts.txt:起始時間、結束時間、標籤
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 "檔案 '$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

  • 疊加層:文字、圖片、品牌標誌、畫面下三分之一區域
  • 資料視覺化:圖表、統計數據、動態數字
  • 動態圖形:轉場效果、解說動畫
  • 可組合場景:跨影片重複使用的模板
  • 產品示範:帶註解的螢幕截圖、介面重點展示

Remotion 基礎合成

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

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

  return (
    
      {/* 主畫面素材 */}
     
         

      {/* 標題疊加 */}
      
 

AI 剪輯套件

{/* 下一段落 */}
); };

渲染輸出

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 生成視覺效果

用於插入鏡頭、縮圖或尚不存在的輔助鏡頭:

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="編碼影音部落格的低保真背景音樂", duration=120)
sfx = coll.generate_sound_effect(prompt="微妙的呼嘯過場音效")

第 6 層:最終潤飾(Descript / CapCut)

最後一層由人來處理。請使用傳統剪輯軟體進行:

  • 節奏掌控:調整感覺過快或過慢的剪接點
  • 字幕:自動生成後,再手動潤飾
  • 調色:基礎校正與氛圍營造
  • 最終音訊混音:平衡人聲、音樂與音效的音量
  • 匯出:針對各平台的專用格式與畫質設定

這正是展現個人品味的關鍵所在。AI 負責處理重複性工作,最終決策權則掌握在您手中。

社群媒體內容重構

不同平台需要不同的畫面比例:

平台 長寬比 解析度
YouTube 16:9 1920x1080
TikTok / Reels 9:16 1080x1920
Instagram 動態 1:1 1080x1080
X / Twitter 16:9 或 1:1 1280x720 或 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 確定性剪輯、批次處理、格式轉換 無視覺編輯介面
Remotion 可程式化疊加層、可組合場景、可重複使用的範本 對非開發者而言學習曲線較陡
Screen Studio 立即產生精緻的螢幕錄影 僅限螢幕擷取
ElevenLabs 語音、旁白、音樂、音效 並非工作流程的核心
Descript / CapCut 最終節奏調整、字幕、潤飾 需手動操作,無法自動化

核心原則

  1. 編輯,而非生成。此工作流程旨在剪輯真實影像,而非根據提示生成內容。
  2. 結構優先於風格。在觸碰任何視覺元素之前,先在第 2 層確立正確的故事架構。
  3. FFmpeg 是核心骨幹。雖然枯燥但至關重要。正是透過它,冗長的素材才變得可控。
  4. 使用 Remotion 確保可重複性。若需重複執行某項操作,請將其轉為 Remotion 元件。
  5. 有選擇性地生成。僅將 AI 生成用於不存在的素材,而非所有內容。
  6. 品味是最後一層。AI 負責處理重複性工作,最終的創意決策由你來定。

相關技能

  • fal-ai-media— AI 圖像、影片與音訊生成
  • videodb— 伺服器端影片處理、索引與串流
  • content-engine— 平台原生內容分發
在 GitHub 上查看
---
name: video-editing
description: Edit real video footage using a pipeline of FFmpeg, Remotion, ElevenLabs, fal.ai, and traditional editors for cutting, structuring, and augmenting raw captures.
---

# Video Editing

AI-assisted editing for real footage. Not generation from prompts. Editing existing video fast.

## When to Activate

- User wants to edit, cut, or structure video footage
- Turning long recordings into short-form content
- Building vlogs, tutorials, or demo videos from raw capture
- Adding overlays, subtitles, music, or voiceover to existing video
- Reframing video for different platforms (YouTube, TikTok, Instagram)
- User says "edit video", "cut this footage", "make a vlog", or "video workflow"

## Core Thesis

AI video editing is useful when you stop asking it to create the whole video and start using it to compress, structure, and augment real footage. The value is not generation. The value is compression.

## The Pipeline

```
Screen Studio / raw footage
  → Claude / Codex
  → FFmpeg
  → Remotion
  → ElevenLabs / fal.ai
  → Descript or CapCut
```

Each layer has a specific job. Do not skip layers. Do not try to make one tool do everything.

## Layer 1: Capture (Screen Studio / Raw Footage)

Collect the source material:
- **Screen Studio**: polished screen recordings for app demos, coding sessions, browser workflows
- **Raw camera footage**: vlog footage, interviews, event recordings
- **Desktop capture via VideoDB**: session recording with real-time context (see `videodb` skill)

Output: raw files ready for organization.

## Layer 2: Organization (Claude / Codex)

Use Claude Code or Codex to:
- **Transcribe and label**: generate transcript, identify topics and themes
- **Plan structure**: decide what stays, what gets cut, what order works
- **Identify dead sections**: find pauses, tangents, repeated takes
- **Generate edit decision list**: timestamps for cuts, segments to keep
- **Scaffold FFmpeg and Remotion code**: generate the commands and compositions

```
Example prompt:
"Here's the transcript of a 4-hour recording. Identify the 8 strongest segments
for a 24-minute vlog. Give me FFmpeg cut commands for each segment."
```

This layer is about structure, not final creative taste.

## Layer 3: Deterministic Cuts (FFmpeg)

FFmpeg handles the boring but critical work: splitting, trimming, concatenating, and preprocessing.

### Extract segment by timestamp

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

### Batch cut from edit decision list

```bash
#!/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
```

### Concatenate segments

```bash
# Create file list
for f in segments/*.mp4; do echo "file '$f'"; done > concat.txt
ffmpeg -f concat -safe 0 -i concat.txt -c copy assembled.mp4
```

### Create proxy for faster editing

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

### Extract audio for transcription

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

### Normalize audio levels

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

## Layer 4: Programmable Composition (Remotion)

Remotion turns editing problems into composable code. Use it for things that traditional editors make painful:

### When to use Remotion

- Overlays: text, images, branding, lower thirds
- Data visualizations: charts, stats, animated numbers
- Motion graphics: transitions, explainer animations
- Composable scenes: reusable templates across videos
- Product demos: annotated screenshots, UI highlights

### Basic Remotion composition

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

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

  return (
    <AbsoluteFill>
      {/* Main footage */}
      <Sequence from={0} durationInFrames={300}>
        <Video src="/segments/intro.mp4" />
      </Sequence>

      {/* Title overlay */}
      <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)",
          }}>
            The AI Editing Stack
          </h1>
        </AbsoluteFill>
      </Sequence>

      {/* Next segment */}
      <Sequence from={300} durationInFrames={450}>
        <Video src="/segments/demo.mp4" />
      </Sequence>
    </AbsoluteFill>
  );
};
```

### Render output

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

See the [Remotion docs](https://www.remotion.dev/docs) for detailed patterns and API reference.

## Layer 5: Generated Assets (ElevenLabs / fal.ai)

Generate only what you need. Do not generate the whole video.

### Voiceover with ElevenLabs

```python
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": "Your narration text here",
        "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)
```

### Music and SFX with fal.ai

Use the `fal-ai-media` skill for:
- Background music generation
- Sound effects (ThinkSound model for video-to-audio)
- Transition sounds

### Generated visuals with fal.ai

Use for insert shots, thumbnails, or b-roll that doesn't exist:
```
generate(app_id: "fal-ai/nano-banana-pro", input_data: {
  "prompt": "professional thumbnail for tech vlog, dark background, code on screen",
  "image_size": "landscape_16_9"
})
```

### VideoDB generative audio

If VideoDB is configured:
```python
voiceover = coll.generate_voice(text="Narration here", voice="alloy")
music = coll.generate_music(prompt="lo-fi background for coding vlog", duration=120)
sfx = coll.generate_sound_effect(prompt="subtle whoosh transition")
```

## Layer 6: Final Polish (Descript / CapCut)

The last layer is human. Use a traditional editor for:
- **Pacing**: adjust cuts that feel too fast or slow
- **Captions**: auto-generated, then manually cleaned
- **Color grading**: basic correction and mood
- **Final audio mix**: balance voice, music, and SFX levels
- **Export**: platform-specific formats and quality settings

This is where taste lives. AI clears the repetitive work. You make the final calls.

## Social Media Reframing

Different platforms need different aspect ratios:

| Platform | Aspect Ratio | Resolution |
|----------|-------------|------------|
| YouTube | 16:9 | 1920x1080 |
| TikTok / Reels | 9:16 | 1080x1920 |
| Instagram Feed | 1:1 | 1080x1080 |
| X / Twitter | 16:9 or 1:1 | 1280x720 or 720x720 |

### Reframe with FFmpeg

```bash
# 16:9 to 9:16 (center crop)
ffmpeg -i input.mp4 -vf "crop=ih*9/16:ih,scale=1080:1920" vertical.mp4

# 16:9 to 1:1 (center crop)
ffmpeg -i input.mp4 -vf "crop=ih:ih,scale=1080:1080" square.mp4
```

### Reframe with VideoDB

```python
from videodb import ReframeMode

# Smart reframe (AI-guided subject tracking)
reframed = video.reframe(start=0, end=60, target="vertical", mode=ReframeMode.smart)
```

## Scene Detection and Auto-Cut

### FFmpeg scene detection

```bash
# Detect scene changes (threshold 0.3 = moderate sensitivity)
ffmpeg -i input.mp4 -vf "select='gt(scene,0.3)',showinfo" -vsync vfr -f null - 2>&1 | grep showinfo
```

### Silence detection for auto-cut

```bash
# Find silent segments (useful for cutting dead air)
ffmpeg -i input.mp4 -af silencedetect=noise=-30dB:d=2 -f null - 2>&1 | grep silence
```

### Highlight extraction

Use Claude to analyze transcript + scene timestamps:
```
"Given this transcript with timestamps and these scene change points,
identify the 5 most engaging 30-second clips for social media."
```

## What Each Tool Does Best

| Tool | Strength | Weakness |
|------|----------|----------|
| Claude / Codex | Organization, planning, code generation | Not the creative taste layer |
| FFmpeg | Deterministic cuts, batch processing, format conversion | No visual editing UI |
| Remotion | Programmable overlays, composable scenes, reusable templates | Learning curve for non-devs |
| Screen Studio | Polished screen recordings immediately | Only screen capture |
| ElevenLabs | Voice, narration, music, SFX | Not the center of the workflow |
| Descript / CapCut | Final pacing, captions, polish | Manual, not automatable |

## Key Principles

1. **Edit, don't generate.** This workflow is for cutting real footage, not creating from prompts.
2. **Structure before style.** Get the story right in Layer 2 before touching anything visual.
3. **FFmpeg is the backbone.** Boring but critical. Where long footage becomes manageable.
4. **Remotion for repeatability.** If you'll do it more than once, make it a Remotion component.
5. **Generate selectively.** Only use AI generation for assets that don't exist, not for everything.
6. **Taste is the last layer.** AI clears repetitive work. You make the final creative calls.

## Related Skills

- `fal-ai-media` — AI image, video, and audio generation
- `videodb` — Server-side video processing, indexing, and streaming
- `content-engine` — Platform-native content distribution

所有檔案

1 個檔案

安裝 video-editing

請下載並將技能檔案解壓縮至您的 .claude/skills/ 目錄中。

下載 ZIP

複製儲存庫並將技能檔案複製到您的專案中。

git clone https://github.com/affaan-m/ECC/tree/main/skills/video-editing # Copy SKILL.md to your .claude/skills/ directory

複製 複製
快速設定: 將技能資料夾複製到 .claude/skills/ Claude 會自動偵測並使用該技能
儲存庫 affaan-m/ECC

相關技能

v4-new-features
更新時間 2026-08-04
multica-creating-agents
更新時間 2026-08-12
pixijs-application
更新時間 2026-08-04
tilemaps
更新時間 2026-08-04
OR