Summary
从长视频(直播回放、会议录像、播客)中批量生成短视频切片。基于转写文稿精确定位观点边界,自动去除静音卡顿和口吃,输出音画同步的短视频。适用于:直播切片、会议精华提取、短视频二创、播客精彩片段。
yfge/video-skills-suite · Archived
从长视频(直播回放、会议录像、播客)中批量生成短视频切片。基于转写文稿精确定位观点边界,自动去除静音卡顿和口吃,输出音画同步的短视频。适用于:直播切片、会议精华提取、短视频二创、播客精彩片段。
npx skills add yfge/video-skills-suite --skill video-clipper
从长视频(直播回放、会议录像、播客)中批量生成短视频切片。基于转写文稿精确定位观点边界,自动去除静音卡顿和口吃,输出音画同步的短视频。适用于:直播切片、会议精华提取、短视频二创、播客精彩片段。
This repository is archived — consider an actively maintained alternative.
视频/音频转文字稿。从视频文件中提取音频,用 whisperX 进行语音识别、时间戳对齐和说话人分离,输出…
1 installs视频?
1 installs从长文本(直播文稿、会议记录、播客转录、文章)中提炼核心观点、金句、争议点和行动项。输出结构化…
1 installs从观点摘要和原始素材生成可发布的文章。支持多种文体(博客、知乎回答、?
1 installsRelated neighbors and high-traction skills in the same topics — useful to compare before installing.
Guidance for distinctive, intentional visual design when building new UI or reshaping an existi…
866.4K installsBrowser automation CLI for AI agents. Use when the user needs to interact with websites, includ…
810.4K installsReview UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "chec…
617.3K installsBuild, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and …
576.5K installsDebug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe …
568.9K installsOther skills from yfge/video-skills-suite.
npx skills add yfge/video-skills-suite
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
main
Files included with this skill beyond the listing page.
SKILL.md
8,542 B
SUMMARY.md
309 B
scripts/.venv-whisperx/(用于二次质检)video-to-text skill 的带时间戳 JSON 输出(用于精确定位和口吃检测)workspace/scripts/):- batch-clip-v4.sh — 主批量切片脚本(去静音 + 去口吃 + crossfade) - smart-silence.py — 智能静音处理(长静音删除 / 短静音压缩) - stutter-detect.py — 口吃检测(基于原始转写 JSON) - clip-postcheck.py — WhisperX 二次扫描 + 自动修复残留口吃 - batch-postcheck.sh — 批量二次质检脚本 - iterate-until-clean.py — 单条 clip 反复迭代(转写→检测→修复→再转写)直到零问题
Phase 1: 素材准备
Phase 2: 切片点定位(观点边界)
Phase 3: 批量切片(去静音 + 去口吃 + crossfade)← batch-clip-v4.sh
Phase 4: 二次质检(WhisperX 重转写 → 残留口吃检测修复)← batch-postcheck.sh
``bash ln -sf "/path/to/直播回放.mp4" /tmp/livestream-input.mp4 ``
video-to-text skill 的输出(含 word_segments 级时间戳)最关键的一步——不能凭直觉猜时间戳,必须基于转写文字精确定位。
insight-extractor 输出中的金句和时间戳import json
with open("transcript.json") as f:
data = json.load(f)
for seg in data["segments"]:
if START <= seg["start"] <= END:
m, s = divmod(int(seg["start"]), 60)
h, m = divmod(m, 60)
ts = f"{h}:{m:02d}:{s:02d}" if h else f"{m}:{s:02d}"
print(f" [{ts}] {seg['text'].strip()}")
MM:SS(如 41:40)H:MM:SS(如 1:50:08)使用 scripts/batch-clip-v4.sh。
ffmpeg -ss ... -to ...):从原视频按时间段切出原始片段smart-silence.py + stutter-detect.py):- 长静音(≥0.5s):完全跳过 - 短静音(0.25-0.5s):压缩到 0.12s(保留呼吸感) - 口吃(重复词/短语):基于原始转写 JSON 检测,跳过第一次出现
- 视频:plain concat(避免视觉闪烁) - 音频:链式 acrossfade(每拼接点 20ms,消除"咔哒"感)
select/aselect:长视频音视频时间基不同,会产生漂移nohup 后台运行:14 条 × 每条约 2-3 分钟,总耗时 ~20-30 分钟mapfile:用 while IFS= read -r line 替代H:MM:SS 格式(109:30 → 1:49:30)# 确认 symlink 存在
ln -sf "/path/to/原始视频.mp4" /tmp/livestream-input.mp4
# 后台运行
nohup bash workspace/scripts/batch-clip-v4.sh > /tmp/batch-clip-v4.log 2>&1 &
# 监控
tail -f /tmp/batch-clip-v4.log
编辑 batch-clip-v4.sh 中的 clips=() 数组,格式为 "start|end|name":
clips=(
"30:16|31:58|01-胆子够大"
"1:50:08|1:52:20|02-AI后背发凉"
...
)
为什么需要二次质检?
口吃检测基于原始转写 JSON,但原始转写有时会漏掉某些口吃(没有转写出来)。 编辑后的 clip 可能仍含残留口吃,需要用 WhisperX 重新转写 clip 本身,再做检测。
原始转写 JSON → stutter-detect.py → 跳切 → clip
↓
clip-postcheck.py(WhisperX 重转写)
↓
发现残留 → 自动二次修复
# 激活 whisperx venv
source scripts/.venv-whisperx/bin/activate
# 单条检测(不修复,只报告)
python3 scripts/clip-postcheck.py clips/02-AI后背发凉.mp4
# 单条检测 + 自动修复(-fixed.mp4 会替换原文件)
python3 scripts/clip-postcheck.py clips/02-AI后背发凉.mp4 --fix
# 批量检测 + 自动修复全部 clips/
bash scripts/batch-postcheck.sh
有效叠词白名单(不误判):试试、看看、谢谢、刚刚、常常、爷爷、妈妈 等 100+ 词
对质量要求极高的 clip,用 iterate-until-clean.py:
source scripts/.venv-whisperx/bin/activate
python3 scripts/iterate-until-clean.py clips/02-AI后背发凉.mp4
每轮:WhisperX 转写 → 检测 → 修复 → 替换 → 再转写验证。 最多 5 轮,通常 1-2 轮收敛。
WhisperX 转写 1 分钟 clip ≈ 60-90 秒(CPU)。 14 条全部 post-check ≈ 15-20 分钟。务必后台运行。
for f in clips/*.mp4; do
[ -f "$f" ] || continue
sz=$(du -h "$f" | cut -f1)
dur=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$f" 2>/dev/null | cut -d. -f1)
min=$((dur/60)); sec=$((dur%60))
printf "%-35s %5s %d:%02d\n" "$(basename "$f")" "$sz" "$min" "$sec"
done
workspace/clips/<编号>-<名称>.mp401-胆子够大.mp4、02-AI后背发凉.mp4video-to-text → 转写 JSON(时间戳 + 口吃检测来源)
↓
insight-extractor → 观点摘要(切片候选来源)
↓
video-clipper → 短视频切片(本 skill)
├── Phase 3: batch-clip-v4.sh(去静音 + 去口吃 + crossfade)
└── Phase 4: batch-postcheck.sh(WhisperX 二次质检)
↓
(人工 / 剪映加字幕)→ 发布短视频平台
| 问题 | 原因 | 解决 |
|---|---|---|
| 音画不同步 | select/aselect 滤镜音视频时间基不同 |
改用 trim/atrim + concat |
| 时间戳不认 | 109:30 格式超过 59:59 |
改为 H:MM:SS(1:49:30) |
| macOS zsh 报错 | mapfile 不存在 |
用 while IFS= read -r line |
| 中文文件名乱码 | nohup 后台 + CJK 路径 | 建英文 symlink |
| exec session 超时 | 15-30 分钟任务被 SIGTERM | 所有批量任务必须 nohup |
| 残留口吃 | 原始转写漏识别,stutter-detect 抓不到 | Phase 4 WhisperX post-check |
| 跳切"咔哒"声 | trim+concat 拼接点音频突变 | 每拼接点加 20ms acrossfade |
| 口吃误判叠词 | 试试/看看/谢谢 被当作重复 | VALID_REDUP 白名单过滤 |
| 切片数 | 总原始时长 | Phase 3 耗时 | Phase 4 耗时 |
|---|---|---|---|
| 6 条 | ~15 min | ~8 min | ~10 min |
| 14 条 | ~35 min | ~20 min | ~20 min |
| 20 条 | ~50 min | ~30 min | ~28 min |