My subtitle editor is now on PyPI.

https://pypi.org/project/subtle-gui/

It is very much in an alpha state, but I've used it quite a bit to convert Bluray subtitles to SRT (text) files for use with Plex. It requires MKVToolNix for reading media files, and Tesseract OCR for OCR scanning. These applications need to be callable from the command line. I plan to make this configurable later.

#VideoTools #Media #MKV #Subtitles #Bluray #OpenSource #Python #Qt6

Client Challenge

My favourite bit to code in that project was the PGS (Presentation Graphic Stream) parser, which is the format used for subtitles on Bluray discs.

It's basically a stream of transparent images with text. It's a binary format using run length encoding for the image data. It's the first time I've processed raw binary streams with Python, and it was a lot easier than I expected.

https://github.com/vkbo/Subtle/blob/main/subtle_gui/formats/pgssubs.py

#Python #Code

Subtle/subtle_gui/formats/pgssubs.py at main ยท vkbo/Subtle

Subtitle editor and converter for Blurays, based on Python and Qt6. - vkbo/Subtle

GitHub
I found another Python project parsing this, but I didn't like the implementation, so I started from scratch with a blog post describing the format as a reference, as well as a few files from some Blurays in my collection. I eventually found out all the quirks and various ways the format is used in practice, I hope, so it's been a while since the parser threw any errors.