video-ocr-to-text

Local video on-screen text and formula extraction OCR skill: supports downloading video links from platforms like Douyin, Kuaishou, Bilibili, and YouTube, and also supports local video files. Uses ffmpeg + tesseract for pure local processing with zero token consumption. Suitable for extracting burned-in subtitles, on-screen formulas, PPT text, chart annotations, and lecture materials. Use this skill when the user provides a video link or local video and wants on-screen text/formulas extracted without calling any paid API or LLM.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "video-ocr-to-text" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-23684edb1133f5f71d5b9eb3e4cbcc65678cc07d57eba6703c13c4e6f28f0de0. Verify the upstream source and version against https://skillhub.cn/skills/user_0e3266b7/video-ocr-to-text before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Local video on-screen text and formula extraction OCR skill: supports downloading video links from platforms like Douyin, Kuaishou, Bilibili, and YouTube, and also supports local video files. Uses ffmpeg + tesseract for pure local processing with zero token consumption. Suitable for extracting burned-in subtitles, on-screen formulas, PPT text, chart annotations, and lecture materials. Use this skill when the user provides a video link or local video and wants on-screen text/formulas extracted without calling any paid API or LLM.

0 Downloads

Introduction source: third_party · user_0e3266b7 · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Translation pending; see source documentation.
Inputs and outputs
Translation pending; see source documentation.
Software, accounts and paid services
Translation pending; see source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: video-ocr-to-text
description: "从视频画面中提取文字与公式的本地 OCR 技能:支持抖音、快手、B站、YouTube 等平台视频链接下载,也支持本地视频文件;基于 ffmpeg + tesseract 纯本地处理,零 token 消耗。适用于提取烧录字幕、屏幕公式、PPT 文字、图表标注、课程讲义等。This skill should be used when the user provides a video link or local video and wants the on-screen text/formulas extracted without calling any paid API or LLM."
agent_created: true

video-ocr-to-text — 视频画面文本提取(本地 OCR,零 token)

概述

本技能提供一套纯本地的视频画面文字提取流水线:给定视频链接或本地视频文件,自动下载(仅链接场景)→ 均匀抽帧 → 本地 OCR(tesseract)→ 输出逐帧文本与去重清单。

核心特性:

  • 多平台链接支持:抖音(含短链 v.douyin.com/xxx)、快手、B站、YouTube 等。抖音走专用解析;其余平台走 yt-dlp。
  • 本地视频支持:直接传入 .mp4/.mkv/.mov 等本地路径,跳过下载。
  • 零 token 消耗:全程仅调用本地二进制(ffmpeg / tesseract)与本地 Python 库(opencv / numpy / pytesseract),不调用任何大模型、视觉 API 或云端转录服务。
  • 公式友好:对帧做放大 + Otsu 二值化,并对公式密集区补做多 PSM 模式识别,适合提取数学/量化表达式。

适用场景

  • 提取短视频/网课中烧录在画面上的字幕、公式、PPT 文字(抖音知识类视频常见)。
  • 提取图表、表格、成绩单等画面标注文字。
  • 需要批量把视频帧转为可检索文本,且不允许产生 API 费用 / token 消耗。

注意:本技能只提取画面可见文字。若视频仅有"语音口播"而无烧录字幕,需改用本地语音识别(见 references/advanced.md 的 Whisper 扩展),那同样零 token,但不在本技能默认流程内。

依赖项

运行环境需具备以下本地工具/库(均为免费、开源、离线可用):

依赖 用途 macOS 安装 Ubuntu 安装
ffmpeg 下载视频 / 抽帧 brew install ffmpeg apt install ffmpeg
tesseract (>=5) OCR 引擎 brew install tesseract apt install tesseract-ocr
tesseract-lang 中文等语言包 brew install tesseract-lang apt install tesseract-ocr-chi-sim tesseract-ocr-chi-tra
Python 3.10+ 运行脚本 系统自带 / brew install python 系统自带
opencv-python-headless 视频解码 / 图像处理 pip install opencv-python-headless 同左
numpy 数组运算 pip install numpy 同左
pytesseract tesseract 的 Python 封装 pip install pytesseract 同左
yt-dlp(可选) 非抖音平台链接下载 brew install yt-dlp pip install yt-dlp

安装示例(macOS,使用 WorkBuddy 管理的 Python venv):

brew install ffmpeg tesseract tesseract-lang yt-dlp
/Users/kimbalhuang/.workbuddy/binaries/python/versions/3.13.12/bin/python3 -m venv /Users/kimbalhuang/.workbuddy/binaries/python/envs/video-ocr
/Users/kimbalhuang/.workbuddy/binaries/python/envs/video-ocr/bin/pip install opencv-python-headless numpy pytesseract

校验:tesseract --list-langs 应能看到 chi_sim;python -c "import cv2,pytesseract" 不应报错。

Token 消耗说明(重要)

步骤 调用对象 是否消耗 token / 费用
解析视频直链 本地 curl / ffmpeg 否(仅网络流量)
抽帧 本地 opencv 否
OCR 识别 本地 tesseract 否(CPU 计算,零费用)
文本汇总 本地 Python 否
  • 本技能完整流程全程零 token、零 API 费用。 唯一的"成本"是本地 CPU 时间与磁盘 IO。
  • OCR 对希腊字母(μ/σ/Σ/λ/α/β)、上下标、数学符号常有误读,需人工或后续脚本校正(见下)。
  • 若你额外用 LLM 对 OCR 结果做清洗、纠错或把语音转写,那一步会产生 token——但那属于可选增强,不在本技能默认范围内,文档中明确标注。

用法

方式 A:作为 Skill 被调用

当用户给出视频链接或本地视频并希望"提取画面文字 / 公式 / 字幕"时,加载本技能,然后执行 scripts/extract_text.py。

方式 B:直接命令行

# 1) 抖音短链
python scripts/extract_text.py --input "https://v.douyin.com/9xc6Ca5fxz4/" \
       --lang chi_sim+eng --out ./output

# 2) 其他平台链接(走 yt-dlp)
python scripts/extract_text.py --input "https://www.bilibili.com/video/BVxxxx" \
       --lang chi_sim+eng --out ./output

# 3) 本地视频文件
python scripts/extract_text.py --input "./lecture.mp4" --out ./output

参数说明:

参数 默认值 说明
--input 必填 视频 URL 或本地文件路径
--lang chi_sim+eng tesseract 语言包,如 eng / chi_sim+eng / jpn
--interval 0.7 抽帧间隔(秒),越小帧越密、越慢
--upscale 2 帧放大倍数,公式密集建议 3
--out 当前目录 输出目录,生成 <stem>.ocr.json 与 <stem>.ocr.md
--keep-video 关 保留下载的视频(默认下载后处理完即删)

输出格式

在 --out 目录生成两个文件:

  • <stem>.ocr.json:结构化结果,含 meta(fps/帧数/时长)、frames(逐帧 OCR 文本)、lines(去重后的全部文本行,带时间戳)。
  • <stem>.ocr.md:可读报告,含逐帧文本与去重清单,便于人工校正与归档。

局限与优化建议

  1. 画面公式:tesseract 对数学符号识别弱。建议 --upscale 3 并对失败片段用 references/advanced.md 的多 PSM 补识别脚本。
  2. 纯语音视频:画面无文字时输出为空,需接本地 Whisper(见 advanced.md)。
  3. 平台防盗链:抖音链接偶发短期失效;B站/YouTube 需 yt-dlp 最新版。
  4. 长视频:--interval 调大以减少帧数;或先 ffmpeg 截取关键时间段再传入。

排错

  • tesseract is not installed → 安装 tesseract 并确认在 PATH。
  • chi_sim 不可用 → 安装 tesseract-lang(macOS)或 tesseract-ocr-chi-sim(Ubuntu)。
  • 抖音解析报 ROUTER_DATA 缺失 → 链接失效或被限流,换用桌面端分享链接或手动传本地文件。
  • 其他平台下载失败 → 确认 yt-dlp 已装且为最新:yt-dlp -U。

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value92/100

Highlights

  • 提供多平台视频链接及本地文件的画面文字提取能力,满足烧录字幕、公式、PPT 文字等高频刚需场景
  • 全程纯本地处理(ffmpeg + tesseract),零 token 消耗,显著区别于依赖云端 API 的同类工具
Trigger Precision95/100

Highlights

  • 触发条件清晰明确:用户提供视频链接或本地视频并希望提取画面文字/公式
  • 覆盖抖音、快手、B站、YouTube 等主流平台,边界无歧义
Structure and Standards93/100

Areas to improve

  • description 内容重复 Reported severity: Minor

    frontmatter 与 skill_body 内部均包含完整 description,存在冗余

    Recommendation: 建议仅在 frontmatter 保留 description,skill_body 内可省略或简化为引用

  • 缺少显式 'When to Use' 章节 Reported severity: Minor

    虽在 '适用场景' 章节涵盖相关内容,但未使用标准标题 'When to Use'

    Recommendation: 建议将 '适用场景' 章节标题改为 'When to Use' 以符合平台规范

Highlights

  • 文档结构完整,涵盖概述、依赖项、用法、输出格式、局限与排错等关键章节
  • 提供具体命令行示例与参数说明,便于用户直接使用
Execution Reliability91/100

Highlights

  • 依赖项清单详尽,包含各平台安装命令与校验方法
  • 排错指南覆盖常见安装与运行时问题(如语言包缺失、链接失效)
  • 默认处理完即删除下载视频,降低存储风险,提供 --keep-video 选项供控制
Evidence Verifiability (mean of the first four)93/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • v.douyin.com
  • www.bilibili.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Translation pending; see source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.