Communitygithub.com

视频处理器 (bg-szy/TOP-SKILLS)

处理视频文件,支持音频提取、格式转换(mp4、webm)和 Whisper 转录。当用户提到视频转换、音频提取、转录、mp4、webm、ffmpeg 或 Whisper 转录时使用。

TOP-SKILLS) 是什么?

该技能提供了一个统一的视频处理接口,集成了 FFmpeg 和 OpenAI Whisper 模型,允许 AI 助手直接处理视频文件。它可以执行音频提取、格式转换(MP4 和 WebM)以及语音转录,支持多种输出格式如 SRT、VTT 和 JSON。适用于 Claude Code、Cursor、Codex 等平台,通过 Python 脚本和 CLI 命令驱动。用户只需提及视频转换、音频提取或转录相关需求即可触发。技能包含详细的错误处理和性能优化建议,例如选择不同大小的 Whisper 模型来平衡速度和准确性。

兼容平台✓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 内存)
    • base:快速,良好准确度(约 1GB 内存)[默认]
    • small:平衡(约 2GB 内存)
    • medium:高准确度(约 5GB 内存)
    • large:最佳准确度,最慢(约 10GB 内存)
  • --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 可以将音频直接管道传输到 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:创建带字幕的 Web 优化视频

用户请求:

我需要把这个视频放到我的网站上,还要带字幕。你能帮忙吗?

你可以:

  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

相关技能