openTitles is a Flask-based web application that allows users to automate the process of applying subtitles to a video.
- Video Upload: Upload videos directly from your local system.
- Audio Transcription: Automatically transcribe the audio using Whisper AI.
- Subtitle Customization: Customize font, size, color, position, and word count for subtitles.
- Gentle Docker Integration: Use the Gentle tool for accurate alignment.
- TTS Option: Optionally generate a text-to-speech (TTS) version of the audio. (In development)
serve.py: Main Python script for running the Flask application.templates/index.html: HTML interface for uploading videos and displaying results.static/: Directory for static files like Bootstrap and custom fonts.uploads/: Directory for storing uploaded videos and subtitle files.gentle/: Docker setup for Gentle alignment tool.gentle_data/: Directory for Gentle’s data (linked to Docker).
- Python 3.8+ installed
- Docker (Install Docker)
- ffmpeg installed:
sudo apt-get install ffmpeg - Gentle Docker Setup: Pull the Gentle Docker image from Docker Hub:
sudo docker pull lowerquality/gentle
- Clone the repository:
git clone https://github.com/code-zm/openTitles cd openTitles - Install Python dependencies:
pip install -r requirements.txt
- Start the Gentle Docker container:
sudo docker run -d -p 8765:8765 \ -v $(pwd)/gentle_data:/gentle/data \ --name gentle lowerquality/gentle - Start the Flask server:
python serve.py
- Access the app at:
http://localhost:5000
- Upload your MP4 video using the web interface.
- Generate subtitles and customize their appearance.
- Download the video with embedded subtitles.
-
Gentle Docker Container: If the Gentle container stops or fails, restart it with:
sudo docker start gentle
-
Stopping the Container:
To stop the Gentle container when not in use:sudo docker stop gentle
Feel free to fork the repository and submit pull requests.
This project is licensed under the MIT License.