jianfch / stable-ts

Transcription, forced alignment, and audio indexing with OpenAI's Whisper
MIT License
1.55k stars 172 forks source link

RTL problem formatting word_level time stamps #116

Closed hashefa closed 1 year ago

hashefa commented 1 year ago

I'm not sure if it has to do with your code, but RTL subtitles with the word_level timestamps get reversed and not showing correctly. Any idea how to fix it? Great work!

jianfch commented 1 year ago

I haven't tested it on RTL languages. Could you provide an example of what it produced and what it is supposed to be?

hashefa commented 1 year ago

image

This should be: image

jianfch commented 1 year ago

The latest version should now support RTL format.

result.to_srt_vtt('subtitles.srt', rtl=True)

or --rtl true for cli

hashefa commented 1 year ago

The latest version should now support RTL format.

result.to_srt_vtt('subtitles.srt', rtl=True)

or --rtl true for cli

I'll check it out. Thank you so much!

jianfch commented 1 year ago

The original issue comes from the concatenation of the English tags with RTL languages. So this new version does not resolve this issue (but only allows LTR languages to be formatted like RTL). Can you confirm if the RTL text is displays correctly if you disable the per word highlighting? With this:

result.to_srt_vtt('subtitles.srt', word_level=False)
hashefa commented 1 year ago

The original issue comes from the concatenation of the English tags with RTL languages. So this new version does not resolve this issue (but only allows LTR languages to be formatted like RTL). Can you confirm if the RTL text is displays correctly if you disable the per word highlighting? With this:

result.to_srt_vtt('subtitles.srt', word_level=False)

without word level it was fine also before, is there a way to fix the tags with rtl text?

jianfch commented 1 year ago

Seems to be a video player issue. The tags work fine with VLC on my end. But other players seem to suffer from this issue.

electro199 commented 1 year ago

Hello I was using stable ts with rtl in cli but --rtl flag was a little misleading it could be no arg flag like -y