Communitygithub.com

视频处理器

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

视频处理器 是什么?

该技能为 AI 代理(如 Claude Code、Cursor 等)提供了一个基于 FFmpeg 和 OpenAI Whisper 模型的视频处理功能。它通过一个统一的 CLI 脚本,支持音频提取、视频格式转换为 MP4 或 WebM,以及音频/视频文件的语音转录。技能提供了多种转录模型(从 tiny 到 large)和输出格式(txt、srt、vtt、json),以适应不同的精度和速度需求。该技能主要用于需要处理视频的工作流,例如为视频创建字幕、提取音频进行分析,或将视频转换为适合网络播放的格式。其核心脚本处理了依赖检查和临时文件清理,确保操作可靠。

兼容平台✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/aiskillstore/marketplace/tree/HEAD/skills/egadams/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. 转换为 Web 格式
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:创建带字幕的网络优化视频

用户请求:

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

您应该:

  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.

aiskillstore/marketplace

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.

aiskillstore/marketplace

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.

aiskillstore/marketplace

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. 落地页体验预检/广告落地页一致性检查

aiskillstore/marketplace

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.

aiskillstore/marketplace

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.

aiskillstore/marketplace

This skill helps users extract GitHub repository project details and contributor contact information using keywords, stars, and update dates. Agent should proactively apply this skill when users express needs like search for GitHub projects by keywords, find top open-source contributors in specific domains, extract developer contacts from GitHub repositories, discover trending repositories with high stars, gather contributor profiles and social links for tech recruiting, retrieve GitHub project descriptions and metrics, build developer communities by finding active contributors, search for repositories updated recently, collect personal website and Twitter links of developers, generate targeted leads for developer tools, or track active open-source contributors for collaboration.

aiskillstore/marketplace

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

aiskillstore/marketplace

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

aiskillstore/marketplace

Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks

aiskillstore/marketplace

Generates creative domain name ideas for your project and checks availability across multiple TLDs (.com, .io, .dev, .ai, etc.). Saves hours of brainstorming and manual checking.

aiskillstore/marketplace

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG/vector/code-native assets, extending an established icon or logo system, or building the visual directly in HTML/CSS/canvas.

aiskillstore/marketplace

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

aiskillstore/marketplace

Router skill for LLMQuant portfolio workflows. Use when the user needs company profiles, thesis tracking, theme research, watchlist monitoring, or alert management.

aiskillstore/marketplace

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", "我的风险", "持仓风险", "风险敞口", "資產", "資產配置", "風險分析", "績效歸因", "撤單

aiskillstore/marketplace

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

aiskillstore/marketplace

Use for Codex models/pricing, scheduled tasks, skills, settings, setup, troubleshooting, customization, automations, and self-knowledge—including 'you,' 'your,' 'this app,' or 'this coding agent' when they refer to Codex—and for OpenAI APIs/products and ChatGPT Work. Also use for model choice/migration, prompting, SDKs, Responses, Realtime, agents, evals, and Chat/Work/Codex comparisons. Do not use for generic app/software tasks that merely mention Codex.

aiskillstore/marketplace

Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.

aiskillstore/marketplace

Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks

aiskillstore/marketplace

Perform a read-only, defect-first review of a specified code change and return every actionable finding. Use when another agent delegates review of uncommitted changes, a base-branch diff, a commit, or custom review instructions.

aiskillstore/marketplace

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.

相关技能