Neat Everything
ZHEN
Change the mood
← Projects

2026 · Solo Developer

YouTube Subtitle Auto-Translation Pipeline

A one-command, fully automated pipeline for 'auto-download → subtitle translation → Chinese hardsub burn-in' of YouTube videos, designed for Chinese-speaking audiences consuming overseas video content.

An overseas video consumption pipeline designed for Chinese-speaking audiences: drop in a YouTube link, and one command produces a finished video with Chinese subtitles.

Workflow

ytauto.sh "URL" completes everything in one pass: download the original video (1080p) → extract the original English subtitles → translate to Chinese (local LLM) → generate a Chinese subtitle SRT → burn Chinese subtitles into the video with ffmpeg, producing a watch-ready result.

Dual-Path Subtitles

Prioritizes the “direct official subtitle extraction” path (yt-dlp pulls existing subtitles). When subtitles are unavailable, it falls back to the “audio transcription” path (ffmpeg converts to WAV + whisper-cpp performs local speech recognition), ensuring usable Chinese-English subtitles for any video.

Fully Local Execution

Both translation and transcription run on local models (Ollama / whisper-cpp) — no cloud API needed, preserving privacy at zero cost. ffmpeg handles the subtitle burn-in.

Highlights

  • Integrates yt-dlp, whisper-cpp, a local LLM, and ffmpeg for end-to-end automation
  • Dual-path subtitle support: 'direct official subtitle extraction' or 'audio transcription when no subs available'
  • Produces both a Chinese subtitle SRT and a hardsubbed final video in a single run