修复了 FFmpeg 的字幕转换问题(2014 年的 bug)。
Show HN: I fixed FFmpeg's subtitle conversion (the bug from 2014)

原始链接: https://connollydavid.github.io/pgs-release/

这个FFmpeg版本(8.1)大幅扩展了字幕转换能力,克服了FFmpeg长期存在的编码转换限制(文本到位图及反之)。它引入了PGS编码器,实现了此前88种不可能的格式转换,包括在将ASS/SSA字幕转换为蓝光PGS时保留动画——自动检测并处理淡入淡出、颜色和运动。 主要功能包括在任何字幕格式之间转换(SRT、PGS、ASS、WebVTT等)、位图字幕的OCR(支持114种语言)以及直接RGBA到GIF编码。它可直接替换标准FFmpeg,无需任何依赖,并提供现成的二进制文件。 该项目经过充分测试,具有持续集成,并采用LGPL 2.1许可。它源自PunkGraphicStream,并受益于Claude AI模型的协助。

一位开发者在很大程度上解决了FFmpeg中一个长期存在的bug——无法可靠地在字幕格式之间转换,特别是从SRT到Blu-ray PGS的转换,该问题最初于2014年报告。他们利用Claude Code,一个AI编码助手,经过数周时间,构建了一个功能性的编码器和解码器,解决了动画处理和字幕时间重叠等复杂问题。 该项目涉及研究专利、做出架构决策以及纠正Claude对规范的偶尔误解。开发者已经发布了六个平台的预编译二进制文件,并将源代码发布在GitHub上,旨在最终将其集成到FFmpeg中。 尽管承认该功能具有小众特性(特别是对于淡入淡出等高级字幕效果),开发者渴望收集反馈并探索进一步的增强,包括利用OCR功能的翻译插件。他们还主动披露了AI的贡献,并添加了必要的测试,以备将来向FFmpeg主仓库提交pull request。
相关文章

原文

n8.1-pgs7.0 Convert subtitles between any format. SRT to Blu-ray PGS, PGS to SRT via OCR, styled subtitles with full animation — one command, no format barriers.

"Subtitle encoding currently only possible from text to text or bitmap to bitmap"

That bug is FFmpeg #3819, open since 2014. These builds fix it — ready-to-use binaries, no dependencies, drop-in replacement for your existing FFmpeg. Adds a PGS encoder (#6843), 88 format conversions that weren't possible before, and direct RGBA-to-GIF encoding.

Animation

Fades, colour changes, and movement in styled subtitles (ASS/SSA) are preserved when converting to Blu-ray PGS. The encoder detects animation automatically — no manual tagging, no frame-by-frame export. Overlapping subtitles with different timings are handled correctly.

Usage

# SRT/ASS/WebVTT to Blu-ray PGS
ffmpeg -i subtitles.srt -s 1920x1080 output.sup
ffmpeg -i input.mkv -c:s pgssub -c:v copy -c:a copy output.mkv

# PGS/DVD/DVB bitmap to SRT via OCR
ffmpeg -i input.mkv -c:s srt output.srt

# RGBA to GIF without filter pipeline
ffmpeg -i input.mp4 -c:v gif out.gif

Set the output format, FFmpeg handles the rest. Text to bitmap, bitmap to text, 114 OCR languages supported.

Download

Ready-to-use binaries built on FFmpeg 8.1. Download, extract, run. LGPL 2.1.

18 FATE tests, CI on every push. FFmpeg FATE Details

Each target has two variants: minimal (ffmpeg + ffprobe) and -eng (adds English OCR data). Other languages: download .traineddata from the tessdata release into a tessdata/ directory next to the binary.

Links

联系我们 contact @ memedata.com