Back to getSRT
getSRT Blog/ Generate Chinese Subtitles with whisper.cpp

Generate Chinese Subtitles with whisper.cpp

Generate Chinese subtitles using whisper.cpp is simple.

1 min read
  • 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-cli tool, 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 -osrt

Key Tips for Better Chinese Output

  • Model Choice: Use medium or large-v3 models 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 -p or --initial-prompt (e.g., --initial-prompt "以下是普通话的句子。") to nudge the model toward a specific style or regional phrasing.

  • Avoid Translate Flag: Do not use the --translate flag unless you want the Chinese audio translated into English subtitles; leave it on standard transcription mode