wydengyre / pgs-to-srt

OCR-based conversion of PGS subtitles to SRT
GNU Affero General Public License v3.0
16 stars 4 forks source link

Fail to extract pgs to srt when multiple subtitles are rendered #231

Open javierlopeza opened 2 months ago

javierlopeza commented 2 months ago

I've came across several subtitles that fail to extract from PGS to SRT and they all share similar scenes where subtitles are rendered at the top and bottom of the screen (generally when some signs and speech have to render at the same time).

See example below:

Screenshot 2024-05-03 at 10 02 04 AM

Here is a .sup file extracted from the video that reproduces the error: Google Drive link

For this .sup file, when I run the image extraction for the 109 frame (screenshot above):

$ pgs-to-srt 109 "Death Note (2006) - S01E06 - 006 - Unraveling [Bluray-720p][10bit][x264][FLAC 2.0][EN+JA+E
S+FR+PT]-NoobSubs.en.sup" > image.bmp

The error I get is:

error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0')
    at Ft (file:///pgs-to-srt/pgs-to-srt.js:2:79154)
    at Lt (file:///pgs-to-srt/pgs-to-srt.js:2:81570)
    at eventLoopTick (ext:core/01_core.js:168:7)
    at async file:///pgs-to-srt/pgs-to-srt.js:8:598

I also tried extracting it using pgs-to-srt.com but the process gets stuck and the browser console shows the following error:

Screenshot 2024-05-03 at 10 13 31 AM
wydengyre commented 2 months ago

Thank you for the very detailed error report. I'm definitely eager to tackle this error. Really appreciate your inclusion of a link to the file, too.

I'm trying to rearchitect this whole application, so it might take me a little while. Thanks for bearing with me!