Xpersona
视

视频字幕自动生成器——免费的才是最好的

CLAWHUB · Unverified

自动提取视频音频,识别生成带时间戳的文字稿,输出SRT/VTT字幕及带字幕的视频,并智能提炼视频标题。 Skill: 视频字幕自动生成器——免费的才是最好的 Owner: chall2015 Summary: 自动提取视频音频,识别生成带时间戳的文字稿,输出SRT/VTT字幕及带字幕的视频,并智能提炼视频标题。 Tags: ffmpeg:2.1.1, latest:2.1.1, speech-to-text:2.1.1, subtitle:2.1.1, video:2.1.1, whisper:2.1.1 Version history: v2.1.1 | 2026-03-24T09:01:03.923Z | user - 完善了字幕样式配置。 - 移除了文件“打包完成报告.md”以简化项目结构。 - 其他代码和文档内容保持不变。 v2.1.0 | 2026-03-24T06:31:05.590Z | user 视频自动上字幕。实现语音识别、自动生成 SRT 字幕、标题提炼、视频合成。支持字幕繁简转换、样式自定义、后处理修正(个别

62
Rank
84
Safety
1.2k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.2K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17b1f67m59n4b1y85x10j0amn83ggxp:video-processor
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-chall2015-video-processor/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

87,028 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

# 短视频自动处理技能

**创建日期**: 2026-03-23  
**版本**: v1.0

---

## ✨ 技能概述

自动处理短视频,实现:
- 🎙️ **语音识别** - 自动提取视频音频并识别为文字
- 📝 **字幕生成** - 生成 SRT/VTT 格式字幕文件
- 🎯 **标题提炼** - 从内容中智能提炼吸引人的标题
- 📺 **字幕添加** - 将字幕烧录到视频中
- 🎬 **视频生成** - 输出带字幕的新视频

---

## 🎯 使用场景

### 1. 自媒体内容二次创作
- 提取视频内容
- 添加中文字幕
- 重新发布到多平台

### 2. 课程视频处理
- 自动添加字幕
- 提炼章节标题
- 生成学习资料

### 3. 访谈/会议记录
- 语音转文字
- 生成会议纪要
- 添加时间戳

### 4. 短视频本地化
- 识别原语言字幕
- 翻译为目标语言
- 烧录新字幕

---

## 🚀 快速使用

### 基础使用

```bash
# 处理单个视频
python scripts/video_processor.py \
  --input "video.mp4" \
  --output "./output"

# 处理并添加字幕
python scripts/video_processor.py \
  --input "video.mp4" \
  --output "./output" \
  --add-subtitles

# 处理并提炼标题
python scripts/video_processor.py \
  --input "video.mp4" \
  --output "./output" \
  --generate-title
```

### 完整流程

```bash
# 完整处理流程
python scripts/video_processor.py \
  --input "input/video.mp4" \
  --output "./output" \
  --extract-audio \
  --recognize-speech \
  --generate-subtitles \
  --add-subtitles \
  --generate-title \
  --export-video
```

---

## 📋 处理流程

### 1. 视频分析
```
输入视频
  ↓
提取音频
  ↓
分析视频信息(时长、分辨率等)
```

### 2. 语音识别
```
音频文件
  ↓
语音识别(Whisper/其他 ASR)
  ↓
生成文字稿(带时间戳)
```

### 3. 字幕生成
```
文字稿 + 时间戳
  ↓
生成 SRT/VTT 字幕文件
  ↓
字幕样式配置
```

### 4. 标题提炼
```
完整文字稿
  ↓
AI 提炼关键信息
  ↓
生成多个标题选项
```

### 5. 视频生成
```
原视频 + 字幕文件
  ↓
FFmpeg 烧录字幕
  ↓
输出新视频
```

---

## ⚙️ 技术栈

### 核心依赖
- **FFmpeg** - 视频处理、字幕烧录
- **OpenAI Whisper** - 语音识别(可选)
- **Python** - 脚本处理

### 可选依赖
- **yt-dlp** - 下载视频
- **moviepy** - 视频编辑
- **stable-diffusion** - 生成封面图

---

## 📁 文件结构

```
skills/video-processor/
├── SKILL.md                 # 技能说明
├── README.md                # 使用文档
├── scripts/
│   ├── video_processor.py   # 主处理脚本
│   ├── speech_recognition.py # 语音识别模块
│   ├── subtitle_generator.py # 字幕生成模块
│   ├── title_extractor.py   # 标题提炼模块
│   └── video_renderer.py    # 视频渲染模块
├── references/
│   ├── subtitle_styles.md   # 字幕样式配置
│   └── title_templates.md   # 标题模板
├── output/                  # 输出目录
│   ├── subtitles/           # 字幕文件
│   ├── videos/              # 输出视频
│   └── titles/              # 标题文件
└── examples/                # 示例文件
```

---

## 🎨 配置说明

### 语音识别配置

```yaml
speech_recognition:
  # 识别引擎
  engine: "whisper"  # whisper | google | azure
  
  # 语言设置
  language: "zh"     # zh | en | ja | ko
  
  # 模型大小
  model: "base"      # tiny | base | small | medium | large
  
  # 输出格式
  output_format: "srt"  # srt | vtt | txt
```

### 字幕样式配置

```yaml
subtitle_style:
  # 字体设置
  font: "Arial"
  font_size: 24
  font_color: "white"
  
  # 边框设置
  border_color: "black"
  border_width: 2
  
  # 位置设置
  position: "bottom"  # top | bottom | center
  margin: 50
  
  # 背景设置
  background: true
  background_color: "black@0.5"  # 50% 透明黑色
```

### 标题提炼配置

```yaml
title_generation:
  # 标题风格
  style: "clickbait"  # normal | clickbait | professional
  
  # 标题长度
  max_length: 30
  
  # 生成数量
  count: 5
  
  # 包含元素
  include_emoji: true
  include_hashtags: true
```

---

## 📊 输出示例

### 生成的字幕文件 (SRT)

```srt
1
00:00:01,000 -

README.md

# 🎬 短视频自动处理技能 - 使用指南

**版本**: v2.1  
**创建日期**: 2026-03-23  
**最后更新**: 2026-03-24

---

## ✨ 功能概述

自动处理短视频,实现:
- 🎙️ **语音识别** - 自动提取音频并识别为文字(支持 Whisper/faster-whisper)
- 📝 **字幕生成** - 生成 SRT 格式字幕(时间戳与人声精确同步)
- 🎯 **标题提炼** - 智能提炼吸引人的标题
- 📺 **字幕添加** - 将字幕烧录到视频
- 🎬 **视频生成** - 输出带字幕的新视频
- ✏️ **后处理** - 支持修改文字稿后重新生成
- 🎨 **样式配置** - 自定义字幕字体、颜色、大小、位置

---

## 🏆 推荐配置

**对于正式内容,推荐使用 medium 模型**:

```bash
python scripts/video_processor.py -i "video.mp4" -m "medium"
```

**准确度对比**(测试视频:2 分 35 秒):

| 模型 | 准确度 | 处理时间 | 推荐场景 |
|------|--------|----------|----------|
| medium | ⭐⭐⭐⭐⭐ | ~3 分钟 | 正式内容、专业制作 |
| small | ⭐⭐⭐⭐ | ~1.5 分钟 | 较高精度需求 |
| base | ⭐⭐⭐ | ~45 秒 | 日常使用、快速处理 |
| tiny | ⭐⭐ | ~30 秒 | 仅测试 |

---

## 🔄 完整工作流程

### 步骤 1: 初次处理

```bash
python scripts/video_processor.py -i "video.mp4" -m "medium"
```

### 步骤 2: 编辑文字稿(修正错别字)

用文本编辑器打开 `output_medium/xxx/transcript.txt`,修正错别字后保存。

### 步骤 3: 重新生成(可选)

```bash
# 使用默认样式
python scripts/subtitle_processor.py \
  -t "output_medium/xxx/transcript_fixed.txt" \
  -v "video.mp4" \
  -o "./final"

# 使用自定义样式
python scripts/subtitle_processor.py \
  -t "output_medium/xxx/transcript_fixed.txt" \
  -v "video.mp4" \
  -o "./final" \
  -s "my_style.json"
```

---

## 🎨 字幕样式配置

### 快速使用

```json
{
  "font": "Microsoft YaHei",
  "fontsize": 28,
  "primary_color": "&H0000FFFF",
  "bold": 1,
  "border_style": 1,
  "outline": 3,
  "alignment": 2
}
```

### 预设样式

- `subtitle_style_template.json` - 完整模板
- `demo_style.json` - 黄色综艺字幕演示

详细配置见:`字幕后处理完整指南.md`

---

## 🚀 快速开始

### 1. 安装依赖

**安装 FFmpeg** (必需):

**Windows**:
```bash
# 使用 winget
winget install ffmpeg

# 或下载:https://ffmpeg.org/download.html
# 添加到系统 PATH
```

**macOS**:
```bash
brew install ffmpeg
```

**Linux**:
```bash
sudo apt install ffmpeg
```

---

### 🔧 安装语音识别引擎(可选但推荐)

**无 Whisper 时**:程序使用模拟模式生成示例字幕(用于测试)

**安装 faster-whisper**(推荐,更快):
```bash
pip install faster-whisper
```

**或安装 openai-whisper**:
```bash
pip install openai-whisper
```

**模型大小选择**:
- `tiny` - 最快,适合测试(约 75MB)
- `base` - 平衡速度与精度(约 142MB)← 默认
- `small` - 更高精度(约 244MB)
- `medium` - 高精度(约 769MB)
- `large` - 最高精度(约 1550MB)

---

### 2. 基础使用

```bash
cd skills/video-processor

# 处理单个视频
python scripts/video_processor.py \
  --input "video.mp4" \
  --output "./output"
```

---

## 📋 完整流程

### 处理步骤

```
1. 输入视频
   ↓
2. 提取音频 (FFmpeg)
   ↓
3. 语音识别 → 文字稿
   ↓
4. 生成字幕 (SRT/VTT)
   ↓
5. 提炼标题
   ↓
6. 烧录字幕到视频
   ↓
7. 输出成品视频
```

### 命令行示例

```bash
# 完整处理流程
python scripts/video_processor.py \
  --input "input/interview.mp4" \
  --output "./output"
```

---

## 📁 输出文件

处理后会生成以下文件:

```
output/video_20260323_153300/
├── audio.wav                    # 提取的音频
├── transcript.txt               # 完整文字稿
├── subtitles.srt                # SRT 字幕文件
├── subtitles.vtt                # VTT 字幕文件
├── titles.txt                   # 提炼的标题
├── video_with_subtitles.mp4     # 带字幕视频
└── info.json                    # 视频信息
```

---

## 🎨 输出示例

### 1. SRT 字幕文件

```srt
1
00:00:01,000 --> 00:00:04,000
大家好,欢迎观看本期视频

2
00:00:04,000 

_meta.json

{
  "ownerId": "kn7445748ap830d4e1bpnvdjjn82v6rh",
  "slug": "video-processor",
  "version": "2.1.1",
  "publishedAt": 1774342863923
}

CHANGELOG.md

# 更新日志

## v2.1 (2026-03-24) - 模型优化与精度提升

### ✨ 新增功能

1. **多模型支持** - 支持 tiny/base/small/medium/large 五种模型
2. **精确时间戳同步** - 字幕时间戳与人声精确匹配
3. **模型对比测试** - 新增详细测试报告

### 🔧 优化改进

1. **简化识别参数** - 移除过度处理,保留原始时间戳
2. **VAD 优化** - 合理过滤静音,避免过度合并
3. **字幕生成优化** - 直接使用识别时间戳,不做人为修改

### 📊 模型测试结果

**测试视频**:2 分 35 秒 AI 设备介绍

| 模型 | 大小 | 段数 | 处理时间 | 准确度 | 推荐度 |
|------|------|------|----------|--------|--------|
| tiny | 75MB | 5 段 | ~30 秒 | ⭐⭐ | ❌ |
| base | 142MB | 56 段 | ~45 秒 | ⭐⭐⭐ | ⭐⭐⭐ |
| small | 244MB | 90 段 | ~90 秒 | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ |
| medium | 769MB | 47 段 | ~3 分钟 | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ |

### 🏆 推荐配置

```bash
# 最佳精度(强烈推荐)
python scripts/video_processor.py -i "video.mp4" -m "medium"

# 平衡速度与精度
python scripts/video_processor.py -i "video.mp4" -m "small"

# 快速处理
python scripts/video_processor.py -i "video.mp4" -m "base"
```

### 📈 准确度提升示例

**开场白识别对比**:
- tiny: "這裡是湖聯網直光波浪會的現場" ❌
- base: "这里是互联网职光博兰会的现场" ⚠️
- small: "这里是互联网直光博览会的现场" ✅
- medium: "这里是互联网直观博览会的现场" ✅

**关键术语识别**:
- "博览会":medium/small ✅ | base/tiny ❌
- "外骨骼机器人":medium/small ✅ | base/tiny ❌
- "仿生手":medium/small ✅ | base/tiny ❌

---

## v2.0 (2026-03-24) - 重大更新

### ✨ 新增功能

1. **真实语音识别支持**
   - 支持 OpenAI Whisper 引擎
   - 支持 faster-whisper 引擎(推荐,速度更快)
   - 自动检测并选择可用的引擎
   - 无 Whisper 时自动降级为模拟模式

2. **同步字幕生成**
   - 字幕时间戳基于实际语音识别结果
   - 每段字幕时间与语音片段精确对应
   - 标准 SRT 格式(HH:MM:SS,mmm)

3. **改进的音频提取**
   - 16kHz 采样率(Whisper 要求)
   - 单声道 WAV 格式
   - 显示音频文件大小

4. **增强的错误处理**
   - 更详细的错误信息
   - 优雅降级(无 Whisper 时使用模拟模式)
   - 路径转义修复(Windows 兼容)

### 🔧 修复问题

1. **SRT 时间戳格式** - 从错误的逗号分隔修复为标准格式
2. **字幕烧录路径** - 修复 Windows 路径转义问题
3. **文字稿内容** - 从硬编码改为实际语音识别生成

### 📋 使用说明

```bash
# 基础使用(模拟模式)
python scripts/video_processor.py -i "video.mp4" -o "./output"

# 使用 Whisper 识别(需要安装)
python scripts/video_processor.py -i "video.mp4" -o "./output" -m "base"

# 使用更小模型(更快)
python scripts/video_processor.py -i "video.mp4" -o "./output" -m "tiny"
```

### 📦 依赖安装

```bash
# 必需
# FFmpeg - 视频处理

# 可选(用于真实语音识别)
pip install faster-whisper  # 推荐
# 或
pip install openai-whisper
```

---

## v1.0 (2026-03-23) - 初始版本

- 基础视频处理框架
- 模拟语音识别
- SRT 字幕生成
- 标题提炼
- 视频字幕烧录

skill-card.md

## Description:

Automatically processes videos by extracting audio, transcribing speech, generating timestamped subtitles, suggesting titles, and producing videos with burned-in subtitles.

This skill is ready for commercial/non-commercial use.

## Publisher:

[chall2015](https://clawhub.ai/user/chall2015)

### License/Terms of Use:

MIT-0

## Use Case:

Content creators, educators, and developers use this skill to turn local video files into editable transcripts, SRT subtitles, title suggestions, and subtitled output videos.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Dependency installation and media processing can expose the user to untrusted packages or files.

Mitigation: Install in a virtual environment, prefer pinned dependency versions, and process only media and style files the user trusts.

Risk: If Whisper or faster-whisper is unavailable, the script can generate clearly labeled synthetic demo subtitles instead of real transcripts.

Mitigation: Check that Whisper is installed before relying on generated transcripts or subtitles for real content.

Risk: Transcripts and burned-in subtitle videos may reveal sensitive spoken content.

Mitigation: Keep outputs in a dedicated folder and review storage, sharing, and retention before publishing generated files.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/chall2015/skills/video-processor)
- [README.md](README.md)
- [CHANGELOG.md](CHANGELOG.md)
- [字幕后处理完整指南.md](字幕后处理完整指南.md)
- [后处理使用指南.md](后处理使用指南.md)
- [模型对比测试.md](模型对比测试.md)
- [优化指南.md](优化指南.md)
- [功能清单.md](功能清单.md)
- [subtitle_style_template.json](subtitle_style_template.json)

## Skill Output:

**Output Type(s):** [text, files, shell commands, configuration, guidance]

**Output Format:** [Markdown guidance with inline shell commands and JSON configuration examples; runtime scripts produce TXT transcripts, SRT subtitles, title text, JSON video metadata, WAV audio, and MP4 videos.]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Runs locally with FFmpeg and optional Whisper/faster-whisper models; subtitle styling is controlled by JSON configuration.]

## Skill Version(s):

2.1.1 (source: server release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to 视频字幕自动生成器——免费的才是最好的 and adjacent AI workflows.