Transcribe audio and translate transcribed subtitles using WhisperX running on JarvisLabs.ai for $0.49/hr and DeepL API. Takes 2-3 minutes of compute time to transcribe a short clip.
-
Add your SSH key to your JarvisLabs.ai account at https://cloud.jarvislabs.ai/listsshkeys
-
Create
.env
file with the following content
DEEPL_KEY={your deepl.com API key}
JARVISLABS_KEY={your jarvislabs.ai API key}
JARVISLABS_UID={your jarvislabs.ai email address}
- Install deps and run the script. This will spin up a small instance, upload audio file, transcribe it, download back and call DeepL API to translate subtitles.
yarn # install deps
# transcribe and translate
./transcribe.js audio.wav ./subs.srt uk en /path/to/id_rsa ssh-passphrase
CLI arguments in order:
- WAV file
- relative path to output file for SRT subtitles
- Input language in the audio file
- Output language for translated subtitles (will be saved on disk with
_{lang}
suffix in the filename) - Absolute path to your private SSH key
- A pass phrase for your private key
You can retreive WAV audio from video file using ffmpeg
ffmpeg -i video.mp4 -vn -ac 1 audio.wav
If you find this tool useful — consider endorcing my work with a small donation