创建日期: 2026-03-23
版本: v1.0
自动处理短视频,实现:
# 处理单个视频
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
# 完整处理流程
python scripts/video_processor.py \
--input "input/video.mp4" \
--output "./output" \
--extract-audio \
--recognize-speech \
--generate-subtitles \
--add-subtitles \
--generate-title \
--export-video
输入视频
↓
提取音频
↓
分析视频信息(时长、分辨率等)
音频文件
↓
语音识别(Whisper/其他 ASR)
↓
生成文字稿(带时间戳)
文字稿 + 时间戳
↓
生成 SRT/VTT 字幕文件
↓
字幕样式配置
完整文字稿
↓
AI 提炼关键信息
↓
生成多个标题选项
原视频 + 字幕文件
↓
FFmpeg 烧录字幕
↓
输出新视频
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/ # 示例文件
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
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% 透明黑色
title_generation:
# 标题风格
style: "clickbait" # normal | clickbait | professional
# 标题长度
max_length: 30
# 生成数量
count: 5
# 包含元素
include_emoji: true
include_hashtags: true
1
00:00:01,000 --> 00:00:03,500
大家好,今天我们来分享一个有趣的话题
2
00:00:03,500 --> 00:00:06,000
关于如何使用 AI 来处理视频内容
3
00:00:06,000 --> 00:00:09,000
这将大大提高我们的工作效率
标题选项 1:
🔥 AI 自动处理视频,效率提升 10 倍!
标题选项 2:
📹 短视频自动加字幕,这个方法太神了!
标题选项 3:
💡 用 AI 提炼视频标题,解放双手!
标题选项 4:
🎬 视频处理神器,一键生成字幕 + 标题!
标题选项 5:
✨ 自媒体必备!AI 视频处理全流程!
output/
└── video_20260323_153300/
├── original.mp4 # 原视频
├── audio.wav # 提取的音频
├── transcript.txt # 完整文字稿
├── subtitles.srt # SRT 字幕
├── subtitles.vtt # VTT 字幕
├── titles.txt # 提炼的标题
├── video_with_subtitles.mp4 # 带字幕视频
└── thumbnail.jpg # 视频封面
Windows:
# 使用 winget
winget install ffmpeg
# 或下载:https://ffmpeg.org/download.html
macOS:
brew install ffmpeg
Linux:
sudo apt install ffmpeg
pip install openai-whisper
pip install moviepy
pip install yt-dlp
# 使用 OpenAI Whisper
pip install openai-whisper
# 或使用 faster-whisper(更快)
pip install faster-whisper
# 提取字幕
python scripts/video_processor.py \
--input "interview.mp4" \
--extract-subtitles \
--output "./output"
# 完整处理
python scripts/video_processor.py \
--input "course.mp4" \
--output "./output" \
--all
# 批量处理视频
python scripts/video_processor.py \
--input "./videos/" \
--output "./output" \
--batch
README.md - 完整使用文档references/subtitle_styles.md - 字幕样式指南references/title_templates.md - 标题模板版本: v1.0
创建日期: 2026-03-23
状态: ⏸️ 框架已完成,待实现
共 1 个版本