A web-based tool to extract captions from videos with timestamps. Supports Hindi, English, and auto-language detection.
- Language support: Hindi, English, and Hinglish
- Multiple output formats: SRT, VTT, JSON with timestamps
- Drag and drop: Easy video upload interface
- Flexible model selection: From tiny (fast) to large-v3 (most accurate)
- Web UI: Easy-to-use browser interface
- Local processing: No API costs, runs entirely on your machine
Upload a video → Configure settings → Generate captions → Download
- Python 3.9 or higher
- FFmpeg installed on your system
macOS (Homebrew):
brew install ffmpegUbuntu/Debian:
sudo apt update && sudo apt install ffmpegWindows: Download from https://ffmpeg.org/download.html and add to PATH.
- Clone the repository:
git clone https://github.com/PrasanBora/video-caption-tool.git
cd video-caption-tool- Install dependencies:
pip install -r requirements.txt- Run the app:
streamlit run app.py- Open http://localhost:8501 in your browser
- Upload a video file (MP4, MKV, AVI, MOV, WebM)
- Configure settings in the sidebar:
- Choose a Whisper model (Medium recommended)
- Select language or use auto-detect
- Pick output format (SRT, VTT, or JSON)
- Click "Generate Captions"
- Preview the generated captions
- Download the caption file
| Model | RAM Required | Speed | Accuracy |
|---|---|---|---|
| Tiny | ~1 GB | Fastest | Basic |
| Base | ~1 GB | Fast | Good |
| Small | ~2 GB | Medium | Better |
| Medium | ~5 GB | Slower | High (Recommended) |
| Large | ~10 GB | Slow | Very High |
| Large-v3 | ~10 GB | Slowest | Best |
- SRT: Standard subtitle format, works with most video players
- VTT: WebVTT format, good for web applications
- JSON: Raw data format with timestamps for custom processing
video-caption-tool/
├── app.py # Main Streamlit web app
├── config.py # Configuration & settings
├── requirements.txt # Python dependencies
├── core/
│ ├── video_handler.py # Video validation & metadata
│ ├── audio_extractor.py # FFmpeg audio extraction
│ ├── transcriber.py # Whisper transcription
│ └── caption_formatter.py # SRT/VTT/JSON output
├── models/
│ ├── transcript.py # Transcript data models
│ └── caption.py # Caption segment models
└── utils/
└── time_utils.py # Timestamp utilities
- OpenAI Whisper: Speech-to-text transcription
- FFmpeg: Audio extraction from videos
- Streamlit: Web UI framework
- Pydantic: Data validation
- For Hindi/English videos, auto-detect works well
- Use Medium model for best balance of speed and accuracy
- GPU (CUDA or Apple Silicon) significantly speeds up transcription
- SRT format is most widely supported by video players
MIT License - feel free to use and modify.
Contributions are welcome! Please feel free to submit a Pull Request.