This is a simple script to OCR the text from a video and convert it to a subtitle file. Inspired by video-ocr.
- Python 3.10+
- ffmpeg installed and added to PATH
- Install PyTorch and torchvision from the official website for CUDA support
pip install -r requirements.txt
python video-text2sub.py input.mp4
-h, --help show this help message and exit
--lang LANG, -l LANG Select a language supported by EasyOCR you want to OCR
--rate RATE, -r RATE Amount of frames analyzed per second, must be >= video framerate
--gpu Use your GPU for OCR
--memory, -m Load all frames into memory
--output OUTPUT, -o OUTPUT Set output filepath
This project is licensed under the MIT License - see the LICENSE file for details.