Tools,

PGS to SRT: ffmpeg can't, SeConv can

1,275 of 1,275

words right with Gemma 4, 150 subtitles

Get the command

Every word: Gemma 4 in SeConv

SeConv is the free command line of Subtitle Edit. Point it at Gemma 4 in Ollama:

ollama pull gemma4:e4b
seconv movie.sup subrip --ocr-engine:ollama --ollama-model:gemma4:e4b

Keep the model flag: SeConv's default Ollama model is llama3.2-vision.

9.5 GB model download

63 to 78 s in 2 runs

The second run was slower than the first, so take times as rough.

No download: Apple Vision

Apple Vision is built into macOS. It read 1,273 words in 13.6 s:

seconv movie.sup subrip --ocr-engine:applevision

It misread 2 words: 1 am for "I am", and TIl for "I'll".

8 ways to read one Blu-ray .sup

Words right of 1,275, lines exact of 150
Reader Words Lines Time
Gemma 4 e4b 1,275 150 63 to 78 s
Apple Vision 1,273 148 13.6 s
pgsrip + RapidOCR 1,272 148 20.3 s
Tesseract + OCR rules 1,272 147 39.7 s
pgsrip + Tesseract 1,269 146 7.4 s
nOCR + OCR rules 1,262 141 2.9 s
Tesseract 1,224 109 37.2 s
nOCR 1,194 90 2.4 s

Rows without pgsrip are SeConv. Every SeConv run kept all 150 start and end times within 42 ms, one frame.

ffmpeg has no OCR step

ffmpeg -i act1.sup -c:s srt out.srt
Subtitle encoding currently only possible from text to text or bitmap to bitmap

It exits 234. ffmpeg 9.0.2 decodes PGS, but PGS subtitles are pictures, and it cannot read text out of a picture.

Tesseract writes | for I

Plain Tesseract put 44 pipes where the text has a capital I. Three OCR rules fix that:

seconv movie.sup subrip --ocr-engine:tesseract --ocr-language:eng \
  --fix-common-errors-rules:FixCommonOcrErrors,FixUppercaseIInsideWords,FixAloneLowercaseIToUppercaseI

That took it from 1,224 to 1,272 words.

Skip --fix-common-errors, which runs all rules. It joins two-line subtitles, adds periods (cut for.) and capitalizes (By the way). Apple Vision fell to 1,259 with it, Tesseract to 1,257.

Only nOCR keeps italics

The 26 italic stage directions came out plain in every other engine. nOCR kept all 26, in 2.9 s:

seconv movie.sup subrip --ocr-engine:nocr --ocr-db:/path/to/Latin.nocr \
  --fix-common-errors-rules:FixCommonOcrErrors,FixUppercaseIInsideWords,FixAloneLowercaseIToUppercaseI

Latin.nocr is in the Subtitle Edit repo, under Ocr. Without the OCR rules, nOCR swaps Arial's I and l: tabIe, AIgernon.

DVD VobSub: Apple Vision slips

Give SeConv movie.idx, with the .sub next to it. On these smaller 720x480 subtitles, Tesseract with the OCR rules beat Apple Vision.

VobSub: words right of 1,275, lines exact of 150
Reader Words Lines Time
Gemma 4 e4b 1,275 150 36.2 s
Tesseract + OCR rules 1,270 146 35.5 s
Apple Vision 1,259 135 12.2 s
nOCR + OCR rules 1,250 131 3.7 s
Tesseract 1,229 113 31.7 s

pgsrip dropped "Oh!"

pgsrip is a Python tool that rips PGS subtitles. With Tesseract it dropped the line "Oh!". With RapidOCR it also dropped "Oh! ...".

pip install "pgsrip[rapidocr]"
pgsrip rip -l en --engine rapidocr movie.en.sup

It writes movie.en.srt next to the .sup. Keep the .en: with -l en, a plain movie.sup is skipped ("1 file filtered out") and no .srt appears.

How I tested it

Real Blu-ray subtitles are copyrighted, so I made my own: the first 150 subtitles of Act I of The Importance of Being Earnest (1895, public domain). SeConv drew them as a Blu-ray .sup and a DVD VobSub.

The method
  • Truth: 1,275 words, 26 italic subtitles, 76 two-line subtitles.
  • The .sup: 1920x1080, Arial 50, white with a black outline. The VobSub: 720x480, Arial 28. ffmpeg 9.0.2 decodes both.
  • SeConv 5.5.0-beta6 (MIT), Tesseract 5.5.4 from Homebrew, pgsrip 0.3.0 (MIT) with --force -w 2, Ollama 0.40.16 with gemma4:e4b (Apache-2.0).
  • Every SeConv run also had --ocr-language:eng, and the Gemma runs had --ollama-url:http://127.0.0.1:11473/api/chat (Ollama on a spare port). One run at a time, lowest priority, on an Apple Silicon Mac.
  • Score: true words found in order, lines with the exact text, start and end within 42 ms. Curly and straight apostrophes count the same.
  • Bias: SeConv made the files and read them back. pgsrip is the outside reader. In Arial, a capital I and a small l look the same.
  • pgsrip with RapidOCR took 28.1 s on its first run, with the model download. The table shows the second run.
What I did not test
  • Real film subtitles, other fonts, colors and languages.
  • MKV input, the Subtitle Edit window, Windows and Linux.
Sources

Text in a scan, not a track?

Run it yourself. Our Apify Actor turns scanned PDFs and images into Markdown. It does not read subtitle tracks.

Try the Actor

Or send us the scan. Tack, our AI, does the job for $29, up to 50 pages. First page free.

Get one page free

Questions people ask

Can ffmpeg convert PGS to SRT?

No. PGS subtitles are pictures, and ffmpeg has no OCR step. ffmpeg 9.0.2 exits 234: "Subtitle encoding currently only possible from text to text or bitmap to bitmap".

How do I convert SUP to SRT on a Mac?

Use SeConv, the Subtitle Edit command line, with Apple Vision: seconv movie.sup subrip --ocr-engine:applevision. On my test it read 1,273 of 1,275 words in 13.6 s.

How do I convert VobSub to SRT?

Give SeConv the .idx file, with the .sub next to it. Gemma 4 read all 1,275 words. Tesseract with 3 OCR rules read 1,270.

Does Subtitle Edit OCR keep italics?

Only the nOCR engine did: 26 of 26 italic subtitles. Apple Vision, Tesseract and Gemma 4 kept none.