Home → Blog → Automatic SRT and VTT subtitles from video and webinars
Automatic SRT and VTT subtitles from video and webinars
Subtitles raise watch time, make content usable with the sound off and help search engines understand what a video is about. Typing them by hand takes hours — here is how to get finished SRT and VTT files automatically.
SRT versus VTT
Both formats are text with timings, and the differences are small:
- SRT is the most widely accepted one: YouTube, most video platforms, editing suites and nearly every player read it. Time uses a comma:
00:00:12,500. - VTT (WebVTT) is the web standard for the HTML5 player and supports styling and positioning. Time uses a dot:
00:00:12.500.
The rule is simple: take SRT for uploads to video platforms and VTT for your own player on your own site.
Step 1. Extract the audio from the video
There is no need to send the whole video file — the audio track alone is dozens of times smaller. One command does it:
ffmpeg -i webinar.mp4 -vn -acodec libmp3lame -q:a 5 webinar.mp3
After that conversion, an hour-long webinar weighs about 25 MB, which fits the request size limit.
Step 2. Get the subtitles in one request
The format is chosen with response_format. The service returns a finished file, so you do not have to split the text into cues yourself:
from openai import OpenAI
client = OpenAI(base_url="https://voicesscribe.com/v1", api_key="your key")
with open("webinar.mp3", "rb") as f:
srt = client.audio.transcriptions.create(
model="whisper-1", file=f, response_format="srt",
)
open("webinar.srt", "w", encoding="utf-8").write(srt)
For the web, change one word:
vtt = client.audio.transcriptions.create(
model="whisper-1", file=f, response_format="vtt",
)
From a terminal it is just as short:
curl https://voicesscribe.com/v1/audio/transcriptions \
-H "Authorization: Bearer your key" \
-F file=@webinar.mp3 -F model=whisper-1 -F response_format=srt \
-o webinar.srtStep 3. Attach the subtitles to a player
In HTML5 one line inside the video tag is enough:
<video controls src="webinar.mp4">
<track kind="subtitles" src="webinar.vtt" srclang="en" label="English" default>
</video>
On video platforms the SRT file is uploaded in the subtitles section of the video — all that is left is to proofread the recognised text.
Long recordings: getting around the size limit
If a recording does not fit into 25 MB, split it and stitch the subtitles back together with a timing offset:
ffmpeg -i long.mp3 -f segment -segment_time 1800 -c copy part%03d.mp3
Send each part separately and, while merging, add the offset of the chunk to every timestamp. For half-hour pieces that is a few lines of code, and the limit stops being a problem.
How to make subtitles more readable
- Feed the terminology in. Product names and speaker surnames go into
promptand then appear spelled correctly in the subtitles. - State the language when it is known in advance:
language="en"removes the rare auto-detection mistakes. - Proofread the result. Automatic subtitles save hours, but the final pass over punctuation and terms is still better done by a human.
- Use verbose_json when you need your own line-breaking rules: it contains segments with exact start and end times.
Try it on your own recordings. Sign-up takes a minute, and the free minutes are enough to judge the quality.
Get a free API keyFrequently asked questions
Can I send the video file directly?
It is more practical to extract the audio track: it is dozens of times smaller and uploads faster. A single ffmpeg command does the job.
Are the subtitles suitable for YouTube?
Yes, the SRT format is uploaded to YouTube and other video platforms without conversion.
What about a recording longer than an hour?
Split it into 20–30 minute parts, transcribe them separately and merge the subtitles with a timing offset.
How accurate are the timings?
Accurate enough for viewing: cues line up with the speech. For frame-accurate editing, subtitles are usually adjusted by hand afterwards.
Are subtitles in other languages supported?
Yes, 99 languages are recognised and the language is detected automatically. For bilingual recordings it is better to process the fragments separately.
Related reading
- How to transcribe meeting recordings and get usable notes — Turn Zoom, Teams and Google Meet recordings into searchable text and structured notes: where the file lives, how to transcribe it and how to extract decisions.
- Podcast transcription: show notes, chapters and searchable episodes — How to transcribe a podcast episode automatically and turn the text into show notes, chapters and a page search engines can actually read. With code and a checklist.
- How to transcribe a call recording to text — A step-by-step guide to turning phone call recordings into text through an API in minutes: Python and C# samples, response formats and the errors you will meet.