修复了 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——它无法可靠地在不同的字幕格式之间转换,这个问题最早在2014年就被报告。该项目以Claude Code作为主要的编码伙伴,涉及构建新的编码器和解码器,规避复杂的专利规范,并解决诸如处理字幕淡入淡出和文本重叠等问题。 该解决方案通过识别和高效处理像素变化,智能优化转换,尤其是在从Advanced SubStation Alpha到Blu-ray的PGS等格式的转换。该项目利用现有的FFmpeg库(libass, Tesseract)进行文本和位图处理,包括114种语言的OCR。 针对六个平台提供了预构建的二进制文件,无需任何依赖项 ([https://connollydavid.github.io/pgs-release/](https://connollydavid.github.io/pgs-release/)),开发者欢迎bug报告,并计划未来开发专注于翻译插件。源代码可在GitHub上获取。
相关文章

原文

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