Communitygithub.com

Kiratuu/Video-Wrapper-Skills

為訪談影片加入綜藝特效(花字、卡片、人物條、章節標題等)。支援 4 種視覺主題,先分析字幕內容產生建議供使用者審核,再渲染影片。

Video-Wrapper-Skills 是什麼?

這是一個專為訪談影片設計的 AI 技能,能基於 Python + Playwright + MoviePy 自動分析字幕內容,產生並套用多種視覺特效,如人物條、章節標題、花字高亮、名詞卡片、金句卡片、數據動畫與要點列表。使用者可先檢視並審核系統提供的建議,再客製化調整配置,然後以選定的主題(Notion、Cyberpunk、Apple、Aurora)渲染最終影片。此技能支援多種視覺主題與可客製化組件,適合知識分享、科技評論或創意內容等場景。技術上使用 HTML + CSS + Anime.js 透過 Playwright 截圖實現高品質動畫,並以 MoviePy 合成影片;若 Playwright 不可用,則自動回退至 PIL 渲染。工作流程分為三步驟:分析字幕、使用者審核、產生配置並渲染,確保使用者對最終特效有完全掌控。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add Kiratuu/Video-Wrapper-Skills

在你喜歡的 AI 中提問

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

說明文件

訪談影片處理器

基於 Python + Playwright + MoviePy 的影片特效處理工具,使用 HTML/CSS/Anime.js 渲染高品質視覺效果。

工作流程

第一步:分析字幕內容

當使用者提供影片和字幕檔案時,先分析字幕內容,產生特效建議:

  1. 讀取字幕檔案 (.srt)
  2. 分析內容,識別:
    • 來賓資訊(用於人物條)
    • 話題切換點(用於章節標題)
    • 關鍵字與術語(用於花字)
    • 專業名詞(用於名詞卡片)
    • 精彩觀點(用於金句卡片)
    • 數字數據(用於數據動畫)
    • 核心要點(用於要點列表)
  3. 產生建議列表,展示給使用者審核

第二步:使用者審核

將建議以 Markdown 格式展示給使用者:

## 視覺特效建議

**主題**: notion

### 1. 人物條 (Lower Third)
- **姓名**: Dario Amodei
- **職位**: CEO
- **公司**: Anthropic
- **出現時間**: 1000ms

### 2. 花字高亮 (Fancy Text)
1. **通用人工智能** (emphasis)
   時間: 2630ms - 5500ms
   原因: 核心概念首次提及

...

使用者可以:

  • 確認全部建議
  • 修改部分建議
  • 刪除不需要的元件
  • 加入新的元件

第三步:產生配置並渲染

根據使用者審批後的建議產生 config.json,然後渲染影片。

可用元件

元件用途配置欄位
人物條 (lower_third)顯示來賓資訊name, role, company, startMs, durationMs
章節標題 (chapter_title)話題切換標題number, title, subtitle, startMs, durationMs
花字 (fancy_text)概括當前觀點text, style, startMs, endMs, position
名詞卡片 (term_card)解釋術語chinese, english, description, firstAppearanceMs
金句卡片 (quote_callout)突出精彩觀點text, author, startMs, durationMs, position
數據動畫 (animated_stats)展示數字prefix, number, unit, label, startMs
要點列表 (bullet_points)總結核心要點title, points[], startMs, durationMs
社交媒體條 (social_bar)關注引導platform, label, handle, startMs, durationMs

花字使用規範

⚠️ 重要:花字必須遵循以下規範:

  1. 必須是片語:用簡短的句子概括說話人當時的觀點

    • ✅ 正確:「AI發展是平滑曲線」「智慧增長類似摩爾定律」
    • ❌ 錯誤:「人工智能」「摩爾定律」(這些是單詞,應該用名詞卡片)
  2. 與名詞卡片互補:

    • 花字:概括觀點(如「智慧每年翻倍增長」)
    • 名詞卡片:解釋術語(如「摩爾定律:積體電路電晶體數量每18-24個月翻一番」)
  3. 位置在上方:預設顯示在螢幕上方區域(字幕上方),避免遮擋人臉

社交媒體條使用規範

  • 預設顯示時長:8 秒(比其他元件更長,給使用者足夠時間記住)
  • 通常在影片結尾出現
  • 支援平台:twitter, weibo, youtube

主題系統

支援 4 種視覺主題:

主題風格適用場景
notion溫暖知識風教育、知識分享
cyberpunk霓虹未來感科技、前沿話題
apple極簡優雅商務、專業訪談
aurora漸變流光創意、藝術內容

配置檔格式

{
  "theme": "notion",
  "lowerThirds": [
    {
      "name": "Dario Amodei",
      "role": "CEO",
      "company": "Anthropic",
      "startMs": 1000,
      "durationMs": 5000
    }
  ],
  "chapterTitles": [
    {
      "number": "Part 1",
      "title": "指數增長的本質",
      "subtitle": "The Nature of Exponential Growth",
      "startMs": 0,
      "durationMs": 4000
    }
  ],
  "keyPhrases": [
    {
      "text": "通用人工智能",
      "style": "emphasis",
      "startMs": 2630,
      "endMs": 5500
    }
  ],
  "termDefinitions": [
    {
      "chinese": "摩爾定律",
      "english": "Moore's Law",
      "description": "積體電路電晶體數量每18-24個月翻一番",
      "firstAppearanceMs": 37550,
      "displayDurationSeconds": 6
    }
  ],
  "quotes": [
    {
      "text": "AI 的發展是一個非常平滑的指數曲線",
      "author": "— Dario Amodei",
      "startMs": 30000,
      "durationMs": 5000
    }
  ],
  "stats": [
    {
      "prefix": "增長率 ",
      "number": 240,
      "unit": "%",
      "label": "計算能力年增長",
      "startMs": 45000,
      "durationMs": 4000
    }
  ],
  "bulletPoints": [
    {
      "title": "核心觀點",
      "points": [
        "AI 發展是平滑的指數曲線",
        "類似摩爾定律的智慧增長",
        "沒有突然的奇點時刻"
      ],
      "startMs": 50000,
      "durationMs": 6000
    }
  ]
}

依賴安裝

# 進入虛擬環境
cd ~/.claude/skills/video-wrapper
source venv/bin/activate

# 安裝依賴
pip install -r requirements.txt

# 安裝 Playwright 瀏覽器
playwright install chromium

命令列使用

# 使用瀏覽器渲染器(推薦)
python src/video_processor.py video.mp4 subs.srt config.json output.mp4

# 指定渲染器
python src/video_processor.py video.mp4 subs.srt config.json -r browser
python src/video_processor.py video.mp4 subs.srt config.json -r pil

技術實現

  • 視覺渲染: HTML + CSS + Anime.js (透過 Playwright 截圖)
  • 影片合成: MoviePy
  • 動畫引擎: Anime.js (Spring 物理動畫)
  • 備用渲染: Python PIL

檔案結構

~/.claude/skills/video-wrapper/
├── src/
│   ├── video_processor.py    # 主處理腳本
│   ├── browser_renderer.py   # Playwright 渲染器
│   ├── content_analyzer.py   # 內容分析器
│   ├── fancy_text.py         # PIL 花字(備用)
│   └── term_card.py          # PIL 卡片(備用)
├── templates/
│   ├── fancy-text.html       # 花字模板
│   ├── term-card.html        # 名詞卡片模板
│   ├── lower-third.html      # 人物條模板
│   ├── chapter-title.html    # 章節標題模板
│   ├── quote-callout.html    # 金句卡片模板
│   ├── animated-stats.html   # 數據動畫模板
│   └── bullet-points.html    # 要點列表模板
├── static/
│   ├── css/
│   │   ├── effects.css       # 基礎效果
│   │   ├── theme-notion.css  # Notion 主題
│   │   ├── theme-cyberpunk.css
│   │   ├── theme-apple.css
│   │   └── theme-aurora.css
│   └── js/
│       └── anime.min.js      # Anime.js
└── requirements.txt

注意事項

  • 影片處理需要較長時間,請耐心等待
  • 確保有足夠的磁碟空間儲存輸出影片
  • Playwright 渲染效果更好,但需要安裝 Chromium
  • 如果 Playwright 不可用,會自動回退到 PIL 渲染

相關技能