360 Secure SkillHub
360 安全技能中心
当前公开展示的是 Video to Text。本作品已批准的版本仍可按原地址安装和更新。

Video Transcribe

输入视频链接后,用 yt-dlp 下载视频,再调用本地 openai-whisper 模型把口播音频转写为带时间戳的分段文本和完整文本,并保留下载的视频文件。支持 yt-dlp 覆盖的站点,需自行安装 ffmpeg,仅 CPU 运行,模型体积较大需预先设置缓存目录。

xunx33
xunx33
热度 33.56
最近更新 2026-06-18 14:30:29
分类:效率依赖:代码执行 / 读写文件应用场景:文件转换

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add xunx33/video-transcribe
Metadata
name
video-transcribe
description
从视频链接下载视频,并将口播文案转录为文字。依赖 yt-dlp 和 openai-whisper,全部开源免费本地部署。
user-invocable
true

Video Transcribe

Extract text from video links (Douyin, Bilibili, YouTube, Kuaishou, etc.) with timestamps.

Dependencies

pip install yt-dlp openai-whisper
winget install ffmpeg  # Windows
# brew install ffmpeg  # macOS
# sudo apt install ffmpeg  # Linux

First-time Setup

Model cache directory (recommended: non-system drive)

Whisper large-v3 model is ~2.9GB. Set cache to a non-system drive:

# Windows PowerShell (permanent, User-level):
[Environment]::SetEnvironmentVariable("WHISPER_DOWNLOAD_ROOT", "X:\whisper_cache", "User")

# macOS/Linux (~/.zshrc or ~/.bashrc):
export WHISPER_DOWNLOAD_ROOT="~/whisper_cache"

Video download directory (optional)

# Windows PowerShell:
[Environment]::SetEnvironmentVariable("VIDEO_DOWNLOAD_DIR", "X:\video_downloads", "User")

# macOS/Linux:
export VIDEO_DOWNLOAD_DIR="~/video_downloads"

yt-dlp global config (optional)

# Windows: Create %APPDATA%\yt-dlp\config (one line):
-o X:\video_downloads\%(title)s.%(ext)s

# macOS/Linux: Create ~/.config/yt-dlp/config (one line):
-o ~/video_downloads/%(title)s.%(ext)s

Usage

Agent call

python transcribe.py "<video_url>" [model] [prompt]
  • model: large-v3 (default, best quality) or turbo (faster)
  • prompt: optional context hint for better recognition

Manual use

python transcribe.py "<video_url>"

Output

  • Segmented text: with timestamps for editing
    [0.0s-8.0s] Text here...
    [8.0s-20.0s] More text...
    
  • Full text: plain text for copying
  • Video file: saved to download directory

Supported Platforms

yt-dlp supports 1000+ sites: Douyin, TikTok, Bilibili, YouTube, Kuaishou, Weibo, Xiaohongshu, Xigua Video, etc.

Notes

  • CPU-only, no GPU required
  • large-v3: ~77s per minute of video on CPU
  • Chinese text optimized with punctuation
  • Models stored in WHISPER_DOWNLOAD_ROOT directory
  • If env vars not set, defaults to script directory