koffee is a tool that automates the translation and subtitling of Korean<>English videos.
Python versions >=3.10 are supported. Additionally, ffmpeg is required for koffee to run.
koffee can be installed using pip
.
pip install git+https://github.com/andrewwkimm/koffee
All that is needed is a working video file and the translated video will be outputted to the current directory.
koffee some_dir/some_video_file.mp4
Alternatively, usage through Python is also available.
import koffee
koffee.translate("some_dir/some_video_file.mp4")
Here is an example output using a sample video from examples.
sample_korean_video_translated.mp4
The koffee CLI has the following structure:
koffee COMMAND [ARGS] [OPTIONS]
Refer below for a list of all commands and parameters.
--file_path Path to the video file.
--device, -d Device to use for computation.
--compute_type, -c Type to use for computation.
--model, -m The Whisper model instance to use.
--output_dir, -o Directory for the output file.
--output_name, -n Name of the output file.
--subtitle_format, -sf Format to use for the subtitles.
--target_language, -t Language to which the video should be translated.
--help, -h Display this message and exit.
--version, -v Display application version.
--verbose, -V Print debug logs.
--subtitles, -s Write the translated subtitle file to disk.
The simplest way to start developing is by using either a DevContainer or Poetry.
If you are planning to develop inside DevContainer, choose the CUDA setup if you have a NVIDIA graphics card and would like to run koffee with CUDA support; otherwise, the default build is much leaner and recommended.
For Poetry, run the following commands to set up your environment:
git clone https://github.com/andrewwkimm/koffee.git
cd koffee
pip install pre-commit
make setup
Special thanks to Leah Song for designing the koffee logo.
Credits to 여배우의 책방 for the full version of the sample Korean video.