A CLI tool that transcribes audio using openai-whisper
and translates it using DeepL.
pip install --user whisper2subs
whisper2subs --help
In order to perform translations into languages other than English, it's required to provide an API key from DeepL. Using the --deepl-apikey
option or with the DEEPL_APIKEY
environment variable. You can create a free account to get an API key.
Transcribe and then translate to Spanish the audio of an mp4 file, using the large-v2
model.
whisper2subs -m large-v2 -t es --deepl-apikey "yout-api-key" input.mp4 subs/
If the language of the input file is not specified Whisper will try to detect it. To specify the language of the input file, use the -l
option.
whisper2subs -l ja -m large-v2 -t es --deepl-apikey "yout-api-key" input.mp4 subs/
Change output format to str
only:
whisper2subs -l ja -t es --output-format srt --deepl-apikey "yout-api-key" input.mp4 subs/
For more information:
whisper2subs --help
Transcribe audio without translating it:
whisper2subs input.mp4 text/