All writing

Make a separate SRT subtitle file with faster-whisper

Turn a short recording into an SRT file and verify when captions appear and disappear.

Last updated

Menus and supported features can change. Compare the source-check date below with your current app version.

App · APP
Official documentation · not hands-on tested Sources checked:

A transcript tells you what was said. A subtitle also needs to tell a player when to show and hide each line. This exercise turns a recording you make into a separate practice.srt file. It builds on the timestamped transcript guide by putting those timings in a format a player can load.

Use this for a first caption pass on a tutorial or interview. An SRT file is separate from the picture, so you can adjust wording and timing without exporting the video again. This guide follows the faster-whisper 1.2.1 documentation and the SRT format description. I did not run the model or produce a transcription for this exercise. The cover is an explanatory graphic.

1. Record a short clip and keep its start time

Make a fresh folder. Record yourself saying The market opens at nine. Leave about two or three seconds of space, then say Bring the blue notebook. Export the recording as practice.wav. If your recorder gives you an M4A, renaming it to WAV does not convert it. Use a recorder or editor that can export WAV, or change the input filename in the script and confirm the decoder can open your original format.

When the target is a video, export its audio from the same starting point as the video you intend to caption. Trimming silence from just one of the two files shifts all your timings. Use a recording without background music for the first exercise. It makes it easier to separate a timing mistake from a word the model misheard.

2. Install the package in its own environment

Use Python 3.12. In PowerShell or Terminal, enter cd "path to your practice folder", substituting your actual folder path. Use dir or ls to check the recording is there. Run the block for your operating system.

py -3.12 -m venv .venv
.\.venv\Scripts\python.exe -m pip install "faster-whisper==1.2.1"
python3.12 -m venv .venv
.venv/bin/python -m pip install "faster-whisper==1.2.1"

According to the project documentation, audio is decoded through PyAV, which bundles the FFmpeg libraries, so this Python route does not require a separate system FFmpeg installation. The first model run needs an internet connection and disk space for the download. The example uses CPU with int8 compute; it does not promise a particular run time.

3. Write two timestamps for each cue

Save the script as make_srt.py next to practice.wav. The example language is English (en). For a Korean recording, set it to ko and try a short, clear recording before a whole video. The voice activity filter detects stretches without speech; the model may still split or combine the two sentences differently.

from pathlib import Path
from faster_whisper import WhisperModel

def stamp(seconds):
    ms = max(0, round(seconds * 1000))
    sec, ms = divmod(ms, 1000)
    minute, sec = divmod(sec, 60)
    hour, minute = divmod(minute, 60)
    return f"{hour:02}:{minute:02}:{sec:02},{ms:03}"

model = WhisperModel("small", device="cpu", compute_type="int8")
segments, _ = model.transcribe("practice.wav", language="en", vad_filter=True)
entries = []
for segment in segments:
    line = " ".join(segment.text.split())
    if line and round(segment.end * 1000) > round(segment.start * 1000):
        entries.append(f"{len(entries)+1}\n{stamp(segment.start)} --> {stamp(segment.end)}\n{line}")
if not entries:
    raise SystemExit("No subtitle cues found. Listen to practice.wav and check its language.")
Path("practice.srt").write_text("\n\n".join(entries) + "\n", encoding="utf-8")
print(f"Saved {len(entries)} cues: practice.srt")

On Windows, use .\.venv\Scripts\python.exe make_srt.py. On Mac or Linux, use .venv/bin/python make_srt.py. Each subtitle cue should contain a number, a start and end time, and its text. A blank line separates one cue from the next. The comma in a timestamp such as 00:00:01,250 separates seconds and milliseconds. That value shows the format; your own recording will have different times.

4. Open the file and listen with the captions

Open practice.srt in a text editor. Check that numbering starts at 1, each end time is later than its start time, and cues have blank lines between them. If you have a video, open it in a player such as VLC and, on Windows or Linux in VLC 3.0, choose Subtitle → Add Subtitle File. See whether each caption arrives near the words and stays long enough to finish reading. If you have audio only, you can compare the time of the first and last audible word in an audio editor.

If the file cannot be found, check the working folder and look for a doubled extension before reinstalling anything. If few words are recognised, listen to the source and check the language selection. If every caption is shifted by about the same amount, check that the audio and video begin at the same point. Edit the subtitle copy and reopen it. You can improve wording or timing without touching the original recording.

Sources & further reading