Put video file with name video.mp4
# create virtual env
python -m venv .venv
source .venv/bin/activate
# install dependencies for extracting audio file from video
pip install -r requirements.txt
python extract_audio.py
# install OpenAi Whisper to extract text and translate on the fly
pip install openai-whisper
whisper converted.wav --language German --task translate
It'll create subtitles files converted.*
, just use it in video player.