EtienneAb3d / WhisperTimeSync

Synchronize Whisper's timestamps over an existing accurate transcription
123 stars 22 forks source link

Memory error when synchronising longer texts #2

Closed ext666 closed 1 year ago

ext666 commented 1 year ago

Hi, when I try to sync subtitles longer than about 30 minutes, WhisperTimeSync gives me the following error:

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at com.cubAIx.WhisperTimeSync.CubaixAlignerSimple.align(CubaixAlignerSimple.java:42)
at com.cubAIx.WhisperTimeSync.CubaixAlignerSimple.syncMarks1to2(CubaixAlignerSimple.java:16)
at com.cubAIx.WhisperTimeSync.WhisperTimeSync.process(WhisperTimeSync.java:48)
at com.cubAIx.WhisperTimeSync.WhisperTimeSync.main(WhisperTimeSync.java:91)

I solve it by splitting the subtitles into two parts, but it's not very comfortable.

EtienneAb3d commented 1 year ago

@ext666

Yes, as said at the bottom of the ReadMe, this aligner is RAM-consuming and time-consuming for large files.

But, you can increase the amount of RAM available to the JVM to a higher value (2G in the command line example), depending on the machine capability:

java -Xmx2G -jar ...

It should be a sufficient solution for your case.

ext666 commented 1 year ago

Works perfectly, thank you!