yuvraj108c / ComfyUI-Whisper

Transcribe audio and add subtitles to videos using Whisper in ComfyUI
Other
64 stars 8 forks source link

other language #1

Open Tobe2d opened 6 months ago

Tobe2d commented 6 months ago

Is there a way to utalize this in other languages?

yuvraj108c commented 6 months ago

yes, whisper supports various languages by default. You might need to add new fonts in the fonts directory depending on the target language, to display the subtitles properly @Tobe2d

Tobe2d commented 6 months ago

Thanks for the reply 🙏

I have tested this but the text is broken thats why I came here to ask in case someghing withn the code need to support UTF-8 Unicode encoding

yuvraj108c commented 6 months ago

If you print the transcription to terminal, it should be correct, the issue is most likely with PIL not rendering other fonts properly.

Perhaps I'm incorrectly loading the font here: font = ImageFont.truetype(os.path.join(FONT_DIR,font_family), font_size)

You can try to create 1 image with your font using PIL in an external python script & see if it works as expected. I'll also look into the issue.

Tobe2d commented 6 months ago

Hey, thanks for the sugesstion but I'm actually not sure how to implement the changes you've suggested. Would it be possible for you to help me out by testing it? here is link to the font I was testing on https://fonts.google.com/noto/specimen/Noto+Sans+Arabic