xiaohu-video-translate  by xiaohuailabs

AI-powered video subtitle generation and transcription

Created 1 month ago
608 stars

Top 53.1% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides an end-to-end, local pipeline for transforming foreign-language videos into Chinese-subtitled versions with accompanying transcripts. It targets users of AI coding command-line interfaces (CLIs) like Claude Code, OpenClaw, Gemini CLI, and Codex, offering a zero-cost, privacy-preserving alternative to cloud-based transcription and translation services. The primary benefit is automating a complex, multi-step video processing workflow into a single natural language command.

How It Works

The system orchestrates a five-step process: video download, audio extraction and transcription using Whisper (with word-level timestamps), translation (any language to Chinese), subtitle polishing (semantic segmentation, error correction, timestamp alignment), and finally, burning the subtitles into the video. It leverages local execution, utilizing Apple Silicon's MLX framework with Metal GPU acceleration for Whisper on macOS, or faster-whisper on other platforms. The approach prioritizes accuracy through word-level timing and human-grade subtitle generation, correcting common ASR errors and segmenting text semantically, while offering flexible subtitle output options.

Quick Start & Requirements

  • Primary Install/Run: Clone the repository and run the install.sh script. Integration involves configuring the specific AI coding tool (e.g., adding skills to Claude Code).
  • Prerequisites: yt-dlp, ffmpeg, Python 3.x. Transcription engines: mlx-whisper (Apple Silicon) or faster-whisper (non-Apple Silicon, Windows, Linux). AI coding CLI (e.g., Claude Code).
  • Resource Footprint: MLX models auto-download (~1.5GB) on first run.
  • Documentation: Installation and usage guides are detailed within the README.

Highlighted Details

  • Multi-language Support: Transcribes and translates numerous languages (e.g., English, Japanese, Korean, French, Spanish) into Chinese subtitles.
  • Subtitle Options: Offers pure Chinese subtitles or bilingual Chinese/English subtitles using ASS format for distinct font sizing.
  • Human-Grade Polish: Corrects transcription errors, segments lines by semantic meaning, and preserves technical terms in their original language.
  • Accurate Timestamps: Utilizes word-level timestamps for precise subtitle synchronization.
  • Local Processing: All transcription and translation steps occur locally, ensuring data privacy and offline capability.

Maintenance & Community

No specific details regarding maintainers, community channels (like Discord/Slack), or roadmap were found in the provided README.

Licensing & Compatibility

  • License: MIT.
  • Compatibility: Permissive for commercial use. Users must avoid committing their local configuration files (config.json) or sensitive login states (e.g., Douyin) to public repositories.

Limitations & Caveats

Burn-in subtitle rendering requires specific CJK fonts (e.g., PingFang SC on macOS, Microsoft YaHei on Windows, Noto Sans CJK on Linux), necessitating manual configuration on non-macOS systems. Transcription accuracy is dependent on audio quality and Whisper's performance, with potential issues arising from background noise. Integration requires compatible AI coding tools, and specific platforms like Douyin may require manual login steps.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
2
Issues (30d)
6
Star History
528 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.