This project provides a tool for transcribing audio and video content using the OpenAI Whisper model.
pip install -U openai-whisper
ffmpeg
is a powerful tool to handle multimedia data. It's required for extracting audio from video.
# on Ubuntu or Debian
sudo apt update && sudo apt install ffmpeg
# on Arch Linux
sudo pacman -S ffmpeg
# on MacOS using Homebrew (https://brew.sh/)
brew install ffmpeg
# on Windows using Chocolatey (https://chocolatey.org/)
choco install ffmpeg
# on Windows using Scoop (https://scoop.sh/)
scoop install ffmpeg
In some cases, you might need Rust to be installed, especially if some dependencies don't provide pre-built binaries.
Follow the Getting started page to install Rust. You might need to set up your PATH
:
export PATH="$HOME/.cargo/bin:$PATH"
If you encounter the error No module named 'setuptools_rust'
, install setuptools_rust
:
pip install setuptools-rust
MoviePy is a Python module for video editing, which can also be used for opening and modifying video files.
pip install moviepy
git clone [REPOSITORY LINK]
cd [REPOSITORY NAME]
python v2t.py --help
python v2t.py --task video --video path_to_video_file.mp4 --output_dir desired_output_directory
python v2t.py --task audio --audio path_to_audio_file.wav --output_dir desired_output_directory
python v2t.py --task audio --audio path_to_audio_file.wav --model model_name
python v2t.py --task audio --audio path_to_audio_file.wav --output_format txt
python v2t.py --task audio --audio path_to_audio_file.wav --language es
python v2t.py --task audio --audio path_to_audio_file.wav --translate
python v2t.py --task audio --audio path_to_audio_file.wav --verbose false
Combine arguments as needed. For example, to transcribe a Spanish video, save the results as a txt file, and translate it to English
python v2t.py --task video --video path_to_video_file.mp4 --language es --output_format txt --translate