New Tool Radar

Local AI

How to Get Word-Level Timestamps from whisper.cpp

Add -ml 1 to your whisper-cli command and get one timestamped line per word, so you can find the exact moment each word was spoken.

Schematic diagram with three steps: run whisper-cli with -ml 1 on a sample, read one timestamped line per word, and use the word times to find exact moments.

Ordinary whisper.cpp output gives one timestamp per segment, which can be several seconds of speech. If you need to know exactly when a single word was spoken — to jump to it in the audio, or to line it up with a video frame — you need word-level timestamps. The README’s experimental “Word-level timestamp” section shows how: the --max-len argument, used as -ml 1, makes whisper-cli print one line per word. This guide is about whisper.cpp’s own word-level timestamps; it is different from the faster-whisper word-timestamps guide and from the SRT subtitle guide, which use different tools.

Run whisper-cli with -ml 1

Build the project first if you have not already, with the README’s own commands:

git clone https://github.com/ggml-org/whisper.cpp.git
cd whisper.cpp
cmake -B build
cmake --build build -j --config Release

Download a model if you need one — the README’s example uses base.en:

sh ./models/download-ggml-model.sh base.en

Then transcribe with -ml 1 added. The README’s own command uses the project’s jfk.wav sample:

./build/bin/whisper-cli -m ./models/ggml-base.en.bin -f ./samples/jfk.wav -ml 1

Note that whisper-cli currently runs only with 16-bit WAV files, so convert your input first if it is not already one.

Read one line per word

Each word gets its own start and end time. The README’s own output for the sample starts like this:

[00:00:00.000 --> 00:00:00.320]
[00:00:00.320 --> 00:00:00.370]   And
[00:00:00.370 --> 00:00:00.690]   so
[00:00:00.690 --> 00:00:00.850]   my
[00:00:00.850 --> 00:00:01.590]   fellow
[00:00:01.590 --> 00:00:02.850]   Americans

The log line for that run says the file is 11.0 seconds long. For a practice check, pick a word you can hear clearly, such as “fellow”, and play the audio at its start time — the word should begin right there.

Use the word times to find exact moments

With per-word times you can jump straight to a word instead of hunting through a segment. Pick a word from the output, open the audio at its start timestamp, and listen: the word should start at that moment and end by the end timestamp. Punctuation gets its own lines too — in the README’s output the comma after “Americans” has its own time range — so when you count words, remember that punctuation marks appear as separate lines.

Try it: four checks

Check What you should see If you do not see it
Flag The command includes -ml 1 Without -ml 1 you get one line per segment, not per word
Words One line per word, such as And at 00:00:00.320 to 00:00:00.370 Check the -m flag points at a downloaded model such as ggml-base.en.bin
Match Playing the audio at a word’s start time plays that word The timestamps are per word, so play from the start time, not the segment time
Punctuation Commas and full stops appear on their own timestamped lines Do not count punctuation lines as words when you check the transcript

Expected result. We checked the whisper.cpp README for the Word-level timestamp section, the -ml 1 flag with –max-len, the whisper-cli command on samples/jfk.wav with ggml-base.en.bin, the 11.0-second file in the log, and the per-word output lines for “And”, “so”, “my”, “fellow”, and “Americans” with their start and end times. We did not run whisper.cpp or transcribe any audio.

Limits

The README marks this feature experimental, so the per-word times are estimates from the model, not measurements — a word boundary can be off, so listen to the audio before trusting a single timestamp. This is a different flag from the karaoke movie option: -owts generates a highlighted video and needs ffmpeg, while -ml 1 only changes the printed transcript. Word-level timestamps are also different from the SRT subtitle guide, which writes subtitle files with segment times. We did not run whisper.cpp, so no timestamp here is a recorded result.

Sources

See all