VideoSubtitles / README.md
Nick021402's picture
Create README.md
13ae4d2 verified

A newer version of the Gradio SDK is available: 6.0.1

Upgrade
metadata
title: Video Subtitle Translator
emoji: 🎬
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: false
license: mit
hardware: cpu-basic
short_description: VideoSubtitles

🎬 Video Subtitle Translator

A lightweight and powerful Hugging Face Space that generates and translates subtitles for any video file with no size or duration limits.

✨ Features

  • 🎯 No Limits: Process videos of any size or duration
  • 🌐 Multi-language Support: Auto-detects 50+ languages and translates to English
  • ⚑ Lightweight Models: Uses efficient Whisper Base and Helsinki translation models
  • πŸ“± Universal Compatibility: Supports all video formats (MP4, AVI, MOV, MKV, etc.)
  • πŸ”§ Standard Output: Generates SRT subtitle files compatible with all media players
  • πŸš€ Fast Processing: Optimized for speed while maintaining quality

πŸ› οΈ How It Works

  1. Upload any video file
  2. Choose whether to translate to English or keep original language
  3. Process - the app will:
    • Extract audio from your video
    • Transcribe speech using Whisper
    • Detect the source language automatically
    • Translate to English (if requested)
    • Generate downloadable SRT files

πŸ”§ Technical Details

Models Used

  • Speech Recognition: OpenAI Whisper Base (fast, lightweight)
  • Translation: Helsinki-NLP/opus-mt-mul-en (multilingual to English)
  • Audio Processing: FFmpeg for universal video format support

Key Optimizations

  • Lazy model loading to save memory
  • Chunked processing for long videos
  • Automatic GPU acceleration when available
  • Efficient audio extraction pipeline

πŸ“‹ Usage Instructions

  1. Click "Upload Video File" and select your video
  2. Choose "Yes" to translate to English, or "No" for transcription only
  3. Click "Generate Subtitles" and wait for processing
  4. Download the generated SRT files
  5. Use the subtitle files with any video player (VLC, Media Player, etc.)

🌍 Supported Languages

The app automatically detects and can translate from 50+ languages including:

  • Spanish, French, German, Italian, Portuguese
  • Chinese (Mandarin), Japanese, Korean
  • Arabic, Hindi, Russian, Turkish
  • And many more...

🎯 Use Cases

  • Content Creators: Add subtitles to YouTube videos, tutorials, podcasts
  • Educators: Make educational content accessible in multiple languages
  • Businesses: Translate training videos, presentations, webinars
  • Personal: Add subtitles to family videos, travel vlogs
  • Accessibility: Make video content accessible to deaf/hard-of-hearing viewers

πŸš€ Getting Started

Simply upload your video and click "Generate Subtitles" - it's that easy!

πŸ“ Output Format

The app generates standard SRT (SubRip) subtitle files that work with:

  • VLC Media Player
  • Windows Media Player
  • YouTube (for upload)
  • Streaming platforms
  • All major video editing software

🀝 Contributing

Feel free to suggest improvements or report issues!


Built with ❀️ using Gradio, Whisper, and Transformers