Communitygithub.com

bg-szy/TOP-SKILLS

處理影片檔案,包含音訊萃取、格式轉換(mp4、webm)以及 Whisper 語音轉文字。當使用者提及影片轉換、音訊萃取、語音轉錄、mp4、webm、ffmpeg 或 whisper 轉錄時使用。

TOP-SKILLS 是什麼?

這是一個專為 AI 代理設計的影片處理技能,提供音訊萃取、影片格式轉換與語音轉錄功能。它依賴 FFmpeg 進行多媒體處理,並使用 OpenAI 的 Whisper 模型進行語音轉文字。支援的平台包括 macOS、Ubuntu/Debian 等,透過一個統一的 Python CLI 腳本 (`video_processor.py`) 來操作。開發者可以輕鬆地將影片轉換為 MP4 或 WebM 格式、萃取出 WAV/MP3/AAC/FLAC 等音訊檔,或使用不同大小的 Whisper 模型(tiny 到 large)進行高品質轉錄,並輸出純文字、SRT 字幕或 JSON 格式。技能腳本內建錯誤處理與自動清理暫存檔,適合在 CI/CD、本機開發或自動化工作流程中整合。

相容平台✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/bg-szy/TOP-SKILLS/tree/HEAD/skills/marketplace/video-processor

在你喜歡的 AI 中提問

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

說明文件

影片處理器

指令

本技能提供影片處理工具,包括音訊萃取、格式轉換以及使用 FFmpeg 和 OpenAI Whisper 模型進行音訊轉錄。

先決條件

必要工具(必須安裝於您的環境中):

  • FFmpeg:多媒體框架,用於影音處理

    # macOS
    brew install ffmpeg
    
    # Ubuntu/Debian
    apt-get install ffmpeg
    
    # 驗證安裝
    ffmpeg -version
    
  • OpenAI Whisper:語音轉文字轉錄模型

    # 透過 pip 安裝
    pip install -U openai-whisper
    
    # 驗證安裝
    whisper --help
    

Python 套件(腳本透過 PEP 723 內含):

  • click(CLI 框架)
  • ffmpeg-python(FFmpeg 的 Python 包裝)

工作流程

所有影片處理任務皆使用 scripts/video_processor.py 腳本。該腳本提供一個簡單的 CLI,包含以下指令:

1. 從影片中萃取音訊

從影片檔案中萃取音軌:

uv run .claude/skills/video-processor/scripts/video_processor.py extract-audio input.mp4 output.wav

選項:

  • --format:輸出音訊格式(預設:wav)。支援:wav、mp3、aac、flac
  • 輸出結果可直接用於轉錄或獨立音訊使用

2. 將影片轉換為 MP4

將任何影片檔案轉換為 MP4 格式:

uv run .claude/skills/video-processor/scripts/video_processor.py to-mp4 input.avi output.mp4

選項:

  • --codec:影片編碼器(預設:libx264)。常用選項:libx264、libx265、h264
  • --preset:編碼速度/品質預設(預設:medium)。選項:ultrafast、fast、medium、slow、veryslow

3. 將影片轉換為 WebM

將任何影片檔案轉換為 WebM 格式(針對網頁最佳化):

uv run .claude/skills/video-processor/scripts/video_processor.py to-webm input.mp4 output.webm

選項:

  • --codec:影片編碼器(預設:libvpx-vp9)。選項:libvpx、libvpx-vp9
  • WebM 針對網頁播放與串流進行最佳化

4. 使用 Whisper 轉錄音訊

使用 OpenAI 的 Whisper 模型將音訊或影片檔案轉錄為文字:

# 轉錄影片檔案(音訊會自動萃取)
uv run .claude/skills/video-processor/scripts/video_processor.py transcribe input.mp4 transcript.txt

# 直接轉錄音訊檔案
uv run .claude/skills/video-processor/scripts/video_processor.py transcribe audio.wav transcript.txt

選項:

  • --model:Whisper 模型大小(預設:base)。選項:
    • tiny:最快,準確度最低(約 1GB RAM)
    • base:快速,準確度良好(約 1GB RAM)[預設]
    • small:平衡(約 2GB RAM)
    • medium:高準確度(約 5GB RAM)
    • large:最高準確度,最慢(約 10GB RAM)
  • --language:語言代碼(預設:自動偵測)。範例:en、es、fr、de、zh
  • --format:輸出格式(預設:txt)。選項:txt、srt、vtt、json

轉錄工作流程:

  1. 若輸入為影片,FFmpeg 會將音訊萃取至暫存 WAV 檔案
  2. Whisper 處理該音訊檔案
  3. 轉錄結果以要求的格式儲存
  4. 暫存檔案會自動清理

5. 複合工作流程範例

端到端處理一部影片:

# 1. 萃取音訊供分析
uv run .claude/skills/video-processor/scripts/video_processor.py extract-audio lecture.mp4 lecture.wav

# 2. 轉錄為 SRT 字幕
uv run .claude/skills/video-processor/scripts/video_processor.py transcribe lecture.mp4 lecture.srt --format srt --model small

# 3. 轉換為網頁格式
uv run .claude/skills/video-processor/scripts/video_processor.py to-webm lecture.mp4 lecture.webm

關鍵技術細節

FFmpeg 與 Whisper 整合:

  • FFmpeg 本身不會轉錄音訊——它會為外部轉錄準備音訊
  • 工作流程為:萃取音訊(FFmpeg)→ 轉錄(Whisper)→ 可選:重新整合回影片
  • FFmpeg 可以將音訊直接 pipe 到 Whisper 以進行即時處理(進階使用案例)

轉錄用的音訊格式:

  • Whisper 最適合使用 WAV 或 MP3 格式
  • 取樣率:16kHz 為最佳(腳本會自動處理轉換)
  • 腳本會以最佳設定萃取音訊供 Whisper 使用

輸出格式:

  • txt:純文字轉錄稿
  • srt:SubRip 字幕格式(包含時間戳記)
  • vtt:WebVTT 字幕格式(網路標準)
  • json:包含逐字時間戳記的詳細 JSON 資料

錯誤處理

腳本包含全面的錯誤處理:

  • 驗證輸入檔案是否存在
  • 檢查 FFmpeg 與 Whisper 是否已安裝
  • 針對缺少相依套件提供明確的錯誤訊息
  • 發生錯誤時處理暫存檔案清理

效能提示

  • 對於快速草稿,使用 tiny 或 base 模型
  • 對於正式轉錄,使用 small 或 medium 模型
  • 僅在需要最高準確度時使用 large 模型
  • 對於長影片,建議先萃取音訊,再分段轉錄
  • 使用 VP9 轉換為 WebM 耗時較長,但產生的檔案較小

範例

範例 1:快速將影片轉換為 MP4

使用者請求:

我有一部舊相機的 AVI 檔案。你能將它轉換成 MP4 嗎?

您應該:

  1. 使用預設設定的 to-mp4 指令:
    uv run .claude/skills/video-processor/scripts/video_processor.py to-mp4 old_video.avi output.mp4
    
  2. 確認轉換成功完成
  3. 告知使用者輸出檔案位置

範例 2:萃取音訊並轉錄

使用者請求:

我錄了一堂講座影片,需要一份轉錄稿。你可以萃取音訊並轉錄嗎?

您應該:

  1. 先萃取音訊:
    uv run .claude/skills/video-processor/scripts/video_processor.py extract-audio lecture.mp4 lecture.wav
    
  2. 接著使用 base 模型(速度與準確度平衡良好)進行轉錄:
    uv run .claude/skills/video-processor/scripts/video_processor.py transcribe lecture.mp4 transcript.txt --model base
    
  3. 將 transcript.txt 檔案提供給使用者

範例 3:製作網頁最佳化影片與字幕

使用者請求:

我需要把這部影片放到我的網站上,並加上字幕。你能幫忙嗎?

您應該:

  1. 轉換為 WebM 以進行網頁最佳化:
    uv run .claude/skills/video-processor/scripts/video_processor.py to-webm presentation.mp4 presentation.webm
    
  2. 產生 SRT 字幕檔案:
    uv run .claude/skills/video-processor/scripts/video_processor.py transcribe presentation.mp4 subtitles.srt --format srt --model small
    
  3. 告知使用者現在擁有:
    • presentation.webm(網頁最佳化影片)
    • subtitles.srt(供嵌入使用的字幕檔案)

範例 4:指定語言的高品質轉錄

使用者請求:

我有一部西班牙語訪談影片,需要一份精確的轉錄稿供出版使用。

您應該:

  1. 使用較大模型並指定語言以獲得最佳準確度:
    uv run .claude/skills/video-processor/scripts/video_processor.py transcribe interview.mp4 transcript.txt --model medium --language es
    
  2. 可選地建立 SRT 供審閱:
    uv run .claude/skills/video-processor/scripts/video_processor.py transcribe interview.mp4 transcript.srt --format srt --model medium --language es
    
  3. 與使用者一同審閱轉錄稿並進行必要的修正

範例 5:批次處理多部影片

使用者請求:

我有一個訓練影片資料夾,裡面所有影片都需要轉換成 WebM 並轉錄。

您應該:

  1. 列出目錄中的所有影片檔案:
    ls training_videos/*.mp4
    
  2. 對每個影片檔案執行轉換與轉錄:
    # 對於每個影片:video1.mp4、video2.mp4 等
    uv run .claude/skills/video-processor/scripts/video_processor.py to-webm training_videos/video1.mp4 output/video1.webm
    uv run .claude/skills/video-processor/scripts/video_processor.py transcribe training_videos/video1.mp4 output/video1.txt --model base
    
    # 對每個檔案重複執行
    
  3. 確認所有轉換與轉錄已完成
  4. 提供輸出檔案的摘要

摘要

影片處理器技能為常見的影片處理任務提供統一的介面:

  • 音訊萃取:以多種格式萃取音軌
  • 格式轉換:轉換為 MP4(通用)或 WebM(網頁最佳化)
  • 語音轉錄:支援多種輸出格式的語音轉文字
  • 靈活性:CLI 參數支援模型選擇、語言和輸出格式

所有操作皆透過單一、文件完善的腳本執行,並提供合理的預設值與全面的錯誤處理。

Individual skills in this repo

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

bg-szy/TOP-SKILLS

Brand-first landing page designer — runs a brand-identity interview (colors, typography, shape language), then generates and iterates on a polished landing page via Stitch with deployment-ready HTML. Use when the user asks to create, design, or build a landing page, homepage, or marketing page and has no established visual direction. Skip when they have a design mockup, need a dashboard or app UI, are working at component level, building a multi-page app, or restyling with known design tokens — use frontend-design instead.

bg-szy/TOP-SKILLS

Fill out Microsoft Azure Landing Zone (ALZ) Accelerator checklists by interviewing the user, mapping their Azure subscriptions, integrating IP addressing documentation, and applying Microsoft Cloud Adoption Framework best practices. Produces a completed Excel checklist (.xlsx) ready for ALZ deployment. Use this skill whenever the user mentions Azure Landing Zone, ALZ checklist, landing zone accelerator, platform landing zone configuration, ALZ bootstrap, hub-and-spoke setup, Azure network topology planning, or wants to fill out any ALZ-related checklist or configuration file. Also trigger when the user uploads an Excel file that contains tabs like "Accelerator - Bootstrap", "Accelerator - Bicep", or "Accelerator - Terraform".

bg-szy/TOP-SKILLS

Compose a premium, animated landing page section by section in Next.js + Tailwind + Motion (Framer Motion) — built on a real design system, with editorial copy and motion that feels human-crafted, not template-generated. Use when building or rebuilding a landing page, marketing site, or hero/feature/pricing/CTA sections that need to look production-ready and bespoke from day one.

bg-szy/TOP-SKILLS

Write high-converting landing page copy using proven frameworks like PAS (Problem-Agitate-Solution), AIDA, and StoryBrand. Creates headlines, value propositions, CTAs, and full page sections optimized for conversion. Use when users need landing page copy, sales page content, or marketing website text.

bg-szy/TOP-SKILLS

Optimize landing pages for conversions, performance, and SEO. Use when improving landing pages, increasing conversions, or optimizing page performance.

bg-szy/TOP-SKILLS

Review investment portfolios for risk, diversification, fees. Asset allocation recommendations, tax-loss harvesting, rebalancing.

bg-szy/TOP-SKILLS

Beads Viewer - Graph-aware triage engine for Beads projects. Computes PageRank, betweenness, critical path, and cycles. Use --robot-* flags for AI agents.

bg-szy/TOP-SKILLS

CI red? Call us. Pipeline fire brigade deploys. Use when user mentions CI failures, build errors, test failures, or pipeline issues. Do NOT load for: local builds, standard implementation work, reviews, or setup.

bg-szy/TOP-SKILLS

CASS Memory System - procedural memory for AI coding agents. Three-layer cognitive architecture with confidence decay, anti-pattern learning, cross-agent knowledge transfer, trauma guard safety system. Bun/TypeScript CLI.

bg-szy/TOP-SKILLS

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.

bg-szy/TOP-SKILLS

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities.

bg-szy/TOP-SKILLS

Use when the user asks to "pre-launch check the landing page", "run a Quality-Score preflight", or "verify ad-to-page message match before launch"; produces an ad↔page continuity report — message-match gaps, above-the-fold check, page-speed read, form-friction count, mobile-render flags — as a pass/fix punch list. Not for redesigning or rewriting the page — use landing-optimizer; not for scoring the account or the RQS — use ad-account-auditor. 落地页体验预检/广告落地页一致性检查

bg-szy/TOP-SKILLS

Use when the user asks to "optimize our landing page for influencer traffic", "fix our promo-code landing page", or "improve conversion from a creator campaign"; produces a message-match audit, page-structure and social-proof recommendations, a promo-code/CTA conversion plan, and an A/B test roadmap. Not for measuring campaign results after launch — use performance-analyzer.

bg-szy/TOP-SKILLS

Audit a landing page, sales page or checkout page for conversion leaks and return a fix list ordered by expected revenue impact. Use when asked to review, critique or improve a landing page, sales page, opt-in page, product page or checkout flow, when conversion rate is low, when paid traffic is not converting, or when someone asks "why isn't this page converting" or wants a CRO / landing page review.

bg-szy/TOP-SKILLS

Landing page conversion optimization with layout rules, hero section design, and CTA psychology. Covers above-the-fold formula, social proof placement, mobile design, and F-pattern reading. Use for: startup landing pages, product pages, SaaS marketing, conversion optimization. Triggers: landing page, hero section, above the fold, conversion optimization, landing page design, cta button, hero image, landing page layout, saas landing page, product page design, conversion rate, landing page best practices

bg-szy/TOP-SKILLS

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

bg-szy/TOP-SKILLS

Landing page conversion optimization with layout rules, hero section design, and CTA psychology. Covers above-the-fold formula, social proof placement, mobile design, and F-pattern reading. Use for: startup landing pages, product pages, SaaS marketing, conversion optimization. Triggers: landing page, hero section, above the fold, conversion optimization, landing page design, cta button, hero image, landing page layout, saas landing page, product page design, conversion rate, landing page best practices

bg-szy/TOP-SKILLS

Account assets, equity and fund positions, P&L, cash flow records, account statements, margin ratios, buy-power estimates, order management, and DCA recurring investments via Longbridge (most require Trade permission). Frameworks: portfolio diagnosis, rebalancing, asset allocation, risk analysis (VaR/CVaR), performance attribution, and tax-loss harvesting. Triggers: "持仓", "账户", "盈亏", "资产", "对账单", "下单", "买入", "卖出", "撤单", "定投", "组合诊断", "再平衡", "资产配置", "风险分析", "绩效归因", "税损收割", "持倉", "賬戶", "盈虧", "對賬單", "下單", "買入", "賣出", "組合診斷", "再平衡", "稅損收割", "positions", "portfolio", "P&L", "order", "buy", "sell", "DCA", "statement", "risk analysis", "rebalancing", "tax harvesting", "我的风险", "持仓风险", "风险敞口", "資產", "資產配置", "風險分析", "績效歸因", "撤單

bg-szy/TOP-SKILLS

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

bg-szy/TOP-SKILLS

Using the Wonda CLI to generate images, videos, music, and audio from the terminal — plus LinkedIn, Reddit, and X/Twitter research and automation

相關技能