https://github.com/luquedaniel/whisper2subs
A CLI tool that transcribes audio using openai-whisper and translates it using DeepL.
https://github.com/luquedaniel/whisper2subs
audio cli deepl subtitle transcribe translate video weekend-project whisper
Last synced: 8 months ago
JSON representation
A CLI tool that transcribes audio using openai-whisper and translates it using DeepL.
- Host: GitHub
- URL: https://github.com/luquedaniel/whisper2subs
- Owner: LuqueDaniel
- License: mit
- Created: 2023-04-11T10:58:44.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-01T22:05:43.000Z (over 1 year ago)
- Last Synced: 2025-01-31T18:28:24.190Z (over 1 year ago)
- Topics: audio, cli, deepl, subtitle, transcribe, translate, video, weekend-project, whisper
- Language: Python
- Homepage:
- Size: 32.2 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pypi.org/project/whisper2subs/)
[](https://pypi.org/project/whisper2subs/)
[](https://github.com/LuqueDaniel/whisper2subs/blob/main/LICENSE)
[](https://github.com/psf/black?style=flat-square)
# whisper2subs
A CLI tool that transcribes audio using [`openai-whisper`](https://github.com/openai/whisper) and translates it using [DeepL](https://www.deepl.com/docs-api).
## Install
```shell
pip install --user whisper2subs
```
## Usage
```shell
whisper2subs --help
```
### Translate
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**](https://www.deepl.com/en/pro?cta=header-pro-button/) to get an API key.
Transcribe and then translate to Spanish the audio of an mp4 file, using the `large-v2` model.
```shell
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.
```shell
whisper2subs -l ja -m large-v2 -t es --deepl-apikey "yout-api-key" input.mp4 subs/
```
Change output format to `str` only:
```shell
whisper2subs -l ja -t es --output-format srt --deepl-apikey "yout-api-key" input.mp4 subs/
```
For more information:
```shell
whisper2subs --help
```
### Transcribe
Transcribe audio without translating it:
```shell
whisper2subs input.mp4 text/
```
## References
* [Whisper](https://github.com/openai/whisper)
* [DeepL API reference](https://www.deepl.com/docs-api)
* [`deepl-python`](https://github.com/DeepLcom/deepl-python)