shakeeb08/youtube-to-roman-urdu
๐ง YouTube to Roman Urdu Converter
An AI-powered web application that converts Urdu and English YouTube videos into Roman Urdu using Speech Recognition and Large Language Models.
๐ Live App: https://huggingface.co/spaces/shakeeb08/youtube-to-roman-urdu
๐ Project Overview
This application automates the following pipeline:
YouTube URL
โ
Audio Extraction (yt-dlp)
โ
Speech-to-Text (Whisper ASR)
โ
LLM Processing (Gemini)
โ
Roman Urdu Transcript Output
The system supports:
- Urdu audio โ Roman Urdu
- English audio โ Roman Urdu
๐ง Core Features
- โ Automatic language detection (Urdu / English)
- โ Chunk-based LLM processing to avoid token overflow
- โ Clean, interactive Streamlit interface
- โ Modular architecture (downloader, transcriber, romanizer)
- โ Secure API key management using environment variables
- โ Docker-based deployment support
๐ Architecture Design
The application follows a modular pipeline architecture:
1๏ธโฃ Downloader Module
- Uses
yt-dlpto extract audio from YouTube videos.
2๏ธโฃ Transcriber Module
- Uses
faster-whisperfor efficient speech recognition. - Detects source language automatically.
3๏ธโฃ Romanizer Module
- Uses Google Gemini LLM.
- Converts:
- Urdu script โ Roman Urdu
- English โ Roman Urdu
- Implements chunking to handle long transcripts safely.
โ๏ธ Tech Stack
- Python
- Streamlit
- faster-whisper
- yt-dlp
- Google Gemini API
- Docker (for cloud deployment)
๐ธ Application Screenshots
๐ Home Interface


๐ Sample Output (Roman Urdu Transcript)

๐ฆ Local Installation Guide
1๏ธโฃ Clone Repository
git clone https://github.com/Sadat-Shakeeb/multilingual-youtube-transcriber.git
cd multilingual-youtube-transcriber2๏ธโฃ Create Virtual Environment
python -m venv yt_env
yt_env\Scripts\activate # Windows3๏ธโฃ Install Dependencies
pip install -r requirements.txt4๏ธโฃ Add Gemini API Key
Create a .env file:
GEMINI_API_KEY=your_api_key_here5๏ธโฃ Run Application
streamlit run app.py๐ Deployment Notes
The app has been deployed on Hugging Face Spaces.
While deploying, the following real-world constraints were encountered:
- File watcher (inotify) limits on cloud infrastructure
- JavaScript runtime requirements for yt-dlp
- Network restrictions on some free-tier environments
These were addressed via:
- Streamlit configuration tuning
- Deployment strategy adjustments
- Modular system redesign
๐ฏ Key Engineering Learnings
- Handling cloud deployment limitations
- Managing environment secrets securely
- Designing chunk-based LLM pipelines
- Separating data ingestion from ML processing
- Debugging container health checks
- Optimizing Whisper performance on CPU
๐ Resume-Ready Project Description
Multilingual AI web application that converts Urdu and English YouTube videos into Roman Urdu using Whisper ASR and Gemini LLM. Designed with chunk-based LLM processing to handle long transcripts and deployed using Streamlit with secure API key management.
๐ฎ Future Improvements
- Direct audio file upload support
- Support for additional languages
- Migration to updated Gemini SDK
- Improved transcription accuracy tuning
- Background job processing for long videos
๐ License
MIT License
