A Python application for translating videos from one language to another, with a Streamlit web interface for easy interaction.
- Extract and translate video captions using multiple translation services:
- OpenAI GPT
- DeepL
- HuggingFace
- Download videos from YouTube
- Transcribe audio to text using OpenAI Whisper
- Support for multiple input formats:
- YouTube URLs
- Local video files
- Output formats:
- Text
- JSON (with timestamps)
- Install Poetry if you haven't already:
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
- Install dependencies:
poetry install
pip install -r requirements.txt
Create a .env
file with the following API keys:
OPENAI_API_KEY=your_openai_key
DEEPL_API_KEY=your_deepl_key
HUGGINGFACE_API_TOKEN=your_huggingface_token
poetry run streamlit run app/video_translator.py
make start
Or manually:
docker-compose build --no-cache
docker-compose up -d
The application will be available at http://localhost:8501
The application can be configured through config.py
. Key settings include:
- Translation service (OpenAI, DeepL, HuggingFace)
- Default source and target languages
- Output format (Text/JSON)
- Model names and API configurations
- Python >= 3.12
- Streamlit
- OpenAI
- DeepL
- youtube-transcript-api
- pytube
- python-dotenv
MIT License - See LICENSE file for details
Feel free to open issues or submit pull requests. Please ensure tests pass before submitting PRs.
- Implement pre-trained AI models for caption translation
- Add Text-to-Speech synthesis for translated captions
- Synchronize generated speech with video timestamps
- Add support for more translation services
- Improve error handling and user feedback