flowocr
把视频里出现过的所有文字读出来——不只是底部字幕,还有对话框、名牌、画面上的标注——每条带起止时间(精确到帧), 并按位置自动分成若干条"文字轨"(对白、字幕、界面、水印……)。产物是 SRT,或叠加在原画面上、每条字留在原位的 ASS 字幕。
用来做什么
- 画面文字翻译:画面各处的文字都读出来、按位置分好轨;在字幕稿里把原文改成译文,叠加时每条译文留在它原来的位置上。
- 字幕与原文对齐:游戏、影视常常能找到原文剧本。把读到的字幕对上原文,拿到准确的文本和时间轴,用来做翻译字幕。 原神、崩坏:星穹铁道、绝区零有现成的提取工具,按它的说明自己打出文本包(见相关项目)。
能读什么、在哪跑
- 文字:识别模型是 PaddlePaddle 的 PP-OCRv6(官方称支持约 50 种语言)。实际验证过的是日文(几十小时实况录像和四款游戏的直播录像)与简体中文; 英文只做过零星试跑;竖排文字没测过。
- 系统:Windows 10 / 11。有 NVIDIA 显卡时走显卡;没有也能跑,用 CPU,慢一到两个数量级。
- 另要 ffmpeg(完整构建)。
快速开始
要先装 uv 和完整版 ffmpeg;从源码装、参数和产物说明都在 使用手册。
uv tool install "flowocr[nvidia]" # 没有 NVIDIA 显卡用 "flowocr[cpu]"
uv tool update-shell # 第一次用 uv tool 时,然后重开终端
有原文剧本时,推荐开启匹配器,使用默认配置,先做到阶段 3 的字幕稿;导入 Aegisub 并加载视频,检查文字、时间和位置,改好保存后再跑阶段 4 渲染特效。
下面以星穹铁道为例,先按 game-text-data 的说明准备文本包,放进 gametext\:
flowocr-ocr video.mp4 --out out\v\v.jsonl # 阶段 1:读字
flowocr-gamescript out\v\v.jsonl --out out\v\v-ref.json --game starrail
flowocr-tracks out\v\v.jsonl --outdir out\v --tag v --matcher gametext --matcher-ctx game=starrail
flowocr-match out\v\v-tracks.json --matcher gametext --ctx ref=out\v\v-ref.json --out out\v\v-matched.json
flowocr-render out\v\v-matched.json --preset script # 阶段 3:只写 v-jp-main.script.ass,默认保留正文与名牌
在 Aegisub 中检查并保存 out\v\v-jp-main.script.ass,然后用 default 预设出特效字幕:
flowocr-typeset out\v\v-jp-main.script.ass --preset default # 阶段 4:写 v-jp-main.ass
原神 / 绝区零把 starrail 换成 genshin / zzz;没有剧本时省略剧本提取与匹配,用 flowocr-tracks 不带匹配参数建轨,再对 v-tracks.json 运行阶段 3,字幕稿为 v-main.script.ass。
相关项目
- game-text-data:从原神、崩坏:星穹铁道、绝区零的社区解包数据里提取对白文本(中日英对齐), 打成 flowocr 能直接读的文本包。它只公开提取代码,文本本身不分发——要用的话按它的说明自己打包。
问题与参与
- 用起来有问题、或者在别的显卡 / 机器上跑出了结果,欢迎开 issue。
- Pull request 请以
main为目标。开发环境、代码结构和验证方法见 开发指南,全部文档见 文档地图。 - 版本变化见 CHANGELOG。
许可
GPL-3.0-or-later,全文见 LICENSE。识别用的 PP-OCRv6 模型由 PaddlePaddle 以 Apache-2.0 发布,来源与我们的改动见 LICENSES/。
Metadata
Release files for flowocr 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| flowocr-0.1.0.tar.gz | 563.4 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flowocr-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.2 MB
Release files / flowocr-0.1.0.tar.gz
| Download URL | flowocr-0.1.0.tar.gz |
|---|---|
| Size | 563.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8cb210075000987c5cdbdb5032e84f3c4d5eb965a8c4a88ff6f6ca622a952f5
|
|
BLAKE2b-256 checksum How to use checksums |
3dba2e788820ad4a71a276a2e14c124a78cc925351e3eb179c5de5fe09dc2d71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.
Transparency logRelease files / flowocr-0.1.0-py3-none-any.whl
| Download URL | flowocr-0.1.0-py3-none-any.whl |
|---|---|
| Size | 617.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4be144313adfb2d68706fdec6ebfb6909fc8946afdb9e3f6e247237e268f04e9
|
|
BLAKE2b-256 checksum How to use checksums |
e5b14b7bc39cccb71f7936b609e336c872d83a032b869d1001347d8bcd225d59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.
Transparency logSecurity for flowocr 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for flowocr-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.