Generate Chinese Subtitles with whisper.cpp
Generate Chinese subtitles using whisper.cpp is simple.
- whisper.cpp
- subtitles
- translation
How can you generate Chinese subtitles?
You can use whisper.cpp to generate Chinese subtitles. It fully supports Chinese speech recognition and can output direct subtitle files in .srt format or .vtt format locally on your device.
How to Generate Chinese Subtitles
-
Prepare your audio: Convert your media file into a 16kHz WAV audio file using a tool like FFmpeg.
-
Run the command: Use the
whisper-clitool, set the language flag to Chinese (-l zh), and request the subtitle output flag (-osrt).
Example command:
./whisper-cli -m models/ggml-base.bin -f input.wav -l zh -osrtKey Tips for Better Chinese Output
-
Model Choice: Use
mediumorlarge-v3models for better accuracy with characters, proper nouns, and context. -
Simplified vs. Traditional: Whisper defaults based on audio context, but you can pass an initial prompt via
-por--initial-prompt(e.g.,--initial-prompt "以下是普通话的句子。") to nudge the model toward a specific style or regional phrasing. -
Avoid Translate Flag: Do not use the
--translateflag unless you want the Chinese audio translated into English subtitles; leave it on standard transcription mode