pywhispercpp icon indicating copy to clipboard operation
pywhispercpp copied to clipboard

Timestamp Precision Issue with Chinese Subtitles

Open Carmel0 opened this issue 10 months ago • 5 comments

The timestamps for Chinese subtitles are only accurate to the second, which causes significant offsets when generating subtitles. I didn’t observe this problem with English subtitles, where the timestamps seem to be more precise.

Here’s an example of the output during the generation process:

Progress:  91%
[00:05:16.000 --> 00:05:18.000]  现在烤好了

Is there a way to improve the timestamp precision for Chinese subtitles, or am I possibly misconfiguring something?

Carmel0 avatar Feb 22 '25 10:02 Carmel0

I think the accuracy of the model depends on its size, so in order to get a better accuracy try to use the bigger models. If this didn't help maybe this is a good question to ask in the whisper.cpp repository.

absadiki avatar Feb 23 '25 02:02 absadiki

I think the accuracy of the model depends on its size, so in order to get a better accuracy try to use the bigger models. If this didn't help maybe this is a good question to ask in the whisper.cpp repository.

Thank you so much for your response! I went through many issues on the whisper.cpp repository, and I indeed found some commits in the updates that address this problem. I tried using the latest whisper.cpp commit during the installation of pywhispercpp, but I encountered an error. Pywhispercpp is incredibly convenient to use, and I’m looking forward to your help in adapting it to the latest whisper.cpp version.

Carmel0 avatar Feb 23 '25 10:02 Carmel0

You can just clone the repo and checkout to the commit you want in the whisper.cpp submodule and build the package. Have you tried this ?

absadiki avatar Feb 24 '25 06:02 absadiki

You can just clone the repo and checkout to the commit you want in the whisper.cpp submodule and build the package. Have you tried this ?

Thank you! I tried the approach you mentioned, but I encountered some interface conflicts. I commented out the deprecated interfaces from pywhispercpp, and the compilation was successful. I’m now testing to see if it resolves the issue I initially mentioned. However, I’m not very optimistic because I’ve noticed that using whisper.cpp’s timestamps directly results in continuous timestamps without any gaps, which is quite inconvenient for creating subtitle timelines. This has been an ongoing issue discussed in the whisper.cpp repository, but it remains unresolved. Anyway, thanks again for your help.

Carmel0 avatar Feb 24 '25 06:02 Carmel0

You are welcome, I hope this issue will get resolved soon.

I will try to update the package to the latest whisper.cpp release and fix the deprecated attributes. Thanks for letting me know.

absadiki avatar Feb 25 '25 02:02 absadiki