When to Use
Use this skill when the user needs to:
- Generate SRT subtitles from an audio or video file (offline, no API calls)
- Automatically detect the spoken language in a media file
- Fix/correct Whisper transcription errors using a provided original spoken script (原口播文本)
- Batch-process media files into subtitles
Do NOT use for:
- Real-time/live transcription (faster-whisper is offline/batch only)
- Non-SRT output formats (only SRT is supported)
- Cloud-based transcription (this is local-only)
Procedure
- Install dependencies:
pip install faster-whisper. Install ffmpeg for your OS:- macOS:
brew install ffmpeg - Linux:
sudo apt install ffmpeg(Debian/Ubuntu) orsudo dnf install ffmpeg(Fedora) - Windows:
choco install ffmpeg(Chocolatey) orscoop install ffmpeg(Scoop), or download from https://ffmpeg.org
- macOS:
- Ensure the easy-subtitle package is installed:
pip install -e .from the project root. - Basic transcription: Run
easy-subtitle -i video.mp4to generatevideo.srtwith auto-detected language. - Specify language: Run
easy-subtitle -i audio.wav -l zhif you know the language (faster and more accurate than auto-detect). - Fix with original script: Run
easy-subtitle -i video.mp4 --original-text script.txtto align and correct the transcription using the provided script. - Tune model size: Use
-m smallfor speed or-m large-v3for accuracy. Default ismedium. - Adjust VAD: Use
--vad-min-silence 1000for more aggressive silence splitting (quieter content). Use--no-vadto disable.
Pitfalls
- First run downloads the model (~1.5GB for medium) — allow extra time and disk space.
- Whisper auto language detection can be unreliable for very short clips (<5 seconds) — use -l to specify manually.
- Original-text alignment works best when the script matches the audio verbatim. Ad-libs, pauses, and improvisations will be left as Whisper output.
- faster-whisper uses INT8 quantization by default on CPU — this is fast but slightly less accurate than FP16 on GPU.
- ffmpeg must be installed separately (not a Python package).
- macOS:
brew install ffmpeg - Linux:
sudo apt install ffmpeg - Windows:
choco install ffmpegor download from https://ffmpeg.org
- macOS:
Verification
- Run
easy-subtitle --versionto confirm installation. - Test basic transcription:
easy-subtitle -i test_audio.mp3 -m tinyshould produce a .srt file quickly. - Verify SRT output: open in a video player or check that it contains numbered blocks with
HH:MM:SS,mmm --> HH:MM:SS,mmmtimestamps. - Test original-text alignment: provide a script that matches the audio — the output should contain the exact script text, not Whisper's transcription.