# 💬 DarijaSubtitler
### Automatic Moroccan Darija → English Subtitle Generation
**OpenAI Whisper** speech recognition · **GPT-4o** translation · **FFmpeg** video burning
---
## ✨ Features
| Feature | Details |
|---|---|
| 🎙 **Darija Transcription** | OpenAI Whisper detects Moroccan Darija (دارجة) with French/Arabic code-switching |
| 🌐 **GPT-4o Translation** | Natural, contextual English translation preserving meaning and tone |
| ✏ **Live Editor** | Edit any subtitle segment inline before exporting |
| 🎨 **Style Customiser** | Font, colour, opacity, position, animation, outline, shadow — full control |
| 📍 **9-position grid** | Top/Centre/Bottom × Left/Centre/Right |
| 🎬 **Video Export** | Subtitles burned directly into MP4 via FFmpeg |
| 📄 **Subtitle Export** | SRT, WebVTT, plain TXT, formatted DOCX transcript |
| 📊 **Dashboard** | Processing stats, history, success rate |
| 🔊 **Speaker Detection** | Automatic speaker labelling from pause patterns |
| ✨ **AI Enhancement** | Auto-punctuation, smart segmentation, sync optimisation |
| 📁 **Large Files** | Chunked upload support up to 5 GB |
---
## 🏗 Architecture
```
┌─────────────────────────────────────────────────┐
│ Browser │
│ React + TypeScript + Vite │
│ Upload · Editor · Style Panel · Dashboard │
└──────────────────────┬──────────────────────────┘
│ HTTP / REST
┌──────────────────────▼──────────────────────────┐
│ FastAPI Backend (Python) │
│ /api/videos /api/subtitles /api/exports │
│ ┌────────────┐ ┌──────────────┐ │
│ │ Whisper │ │ GPT-4o │ OpenAI API │
│ │ (transcribe│ │ (translate) │ │
│ └────────────┘ └──────────────┘ │
│ ┌────────────────────────────────┐ │
│ │ FFmpeg │ │
│ │ extract audio · burn subs │ │
│ └────────────────────────────────┘ …