Sub topic 8
Drafting captions and transcripts
This chapter covers how to get a caption draft from an AI tool, how to ask for it in WebVTT, and what the draft can and cannot be trusted to contain. Reviewing the draft against the audio comes later, in the caption review chapter. Here the goal is a usable first draft and a quick structural check.
Prerequisites
This chapter assumes you have:
- Used a chat-based AI assistant and written a prompt with audience, format, and constraints (see the prompt design chapter).
- Read short Python scripts and simple regular expressions.
- A basic idea of what a video lesson in an online course contains.
Transcripts and captions are different things
A transcript is the spoken words as plain text. A caption file is the same words cut into short timed pieces called cues, so the text appears on screen while it is spoken. Captions can also include sound information, such as music or a door closing.
| Artifact | Contains | Timing | Typical use |
|---|---|---|---|
| Transcript | Words, optional speaker names | None | Reading, searching, translation source |
| Caption file | Words split into cues | Start and end time per cue | Playback in a video player |
| Audio description | Description of visuals | Aligned to the video | Learners who cannot see the screen |
A good workflow produces the transcript first and the caption file second. Correcting words is easier in plain text. Timing is then a separate step.
Where the draft comes from
There are three common sources. Each has different failure patterns.
- Speech-to-text service. A tool listens to the audio and produces words with timestamps. Timing is usually measured from the audio, so it is often close. Words may be wrong, especially names and technical terms.
- A text-only AI assistant given a transcript. You paste in the transcript and ask for WebVTT. The assistant has not heard the audio. Any timestamps it writes are estimates or inventions.
- A text-only AI assistant given a script. The script is what the presenter planned to say. The recording usually differs from it, so captions built from the script will not match the speech.
Whichever source you use, you are producing a draft. The words and the timing both need checking against the audio before learners see them.
The WebVTT format
WebVTT is a plain-text caption format that most web video players accept. A file has these parts:
- A first line that is exactly
WEBVTT. - A blank line.
- Cues separated by blank lines. Each cue has a timing line and one or more lines of text.
- A timing line in the form
start --> end, with times written ashours:minutes:seconds.milliseconds.
WEBVTT
00:00:00.000 --> 00:00:03.200
Welcome to the course. Today we build a budget.
00:00:03.200 --> 00:00:07.000
Start by entering your income in column B.Points that cause errors in practice:
- The separator between milliseconds and seconds is a period, not a comma. A comma belongs to the older SRT format, and some tools export SRT by default.
- Each cue must end after it starts, and cues are normally listed in time order.
- A blank line ends a cue. A blank line inside the cue text splits it by accident.
- Save the file as UTF-8 so accented letters and symbols survive.
Prompting for a caption draft
Use the same structure as other drafting prompts: audience, goal, format, constraints. For captions, the constraints matter most, because the format is strict and the assistant is tempted to improve the wording.
You are helping me prepare captions for a course video.
Input: the transcript below, with a start time in seconds before each sentence.
Output: a WebVTT file. The first line must be WEBVTT.
Rules:
- Do not change, add, or remove any spoken words.
- Keep each cue to at most two lines of about 40 characters each.
- Use the start times I gave. End each cue when the next cue starts.
- Do not invent times. If a sentence has no start time, write TODO in place of the time.
- If a word is unclear, keep it and add [unclear] after it.
- Mark non-speech sounds only if I list them in the input.
If you are unsure of anything, list it after the file under the heading Questions.
Transcript:
0.0 Welcome to the course. Today we build a budget.
3.2 Start by entering your income in column B.Each rule answers a known problem:
- "Do not change the spoken words" stops the assistant from fixing grammar or smoothing speech. Captions should match what was said.
- "Do not invent times" gives the assistant a safe way out when information is missing. Without it, it fills gaps with plausible numbers.
- "[unclear]" and "Questions" make uncertainty visible. They give the reviewer a list of places to check first.
- Listing the non-speech sounds yourself keeps the assistant from guessing at sounds it cannot hear.
Line length and cue length
Readable captions are a design choice as well as a format. The accessibility chapter covers requirements in more detail, but a draft should already follow some working rules:
- Aim for one or two lines per cue.
- Keep lines short enough to read at the speaking pace. About 40 characters per line is a common limit.
- Break at natural phrase boundaries, not in the middle of a name or a verb phrase.
- Do not leave a cue on screen for less than about one second or more than about seven.
These numbers are conventions, not format rules. Your platform or accessibility policy may set different limits, so check it before you fix them in a prompt.
Names, terms, and numbers
Speech-to-text and AI tools both make most errors on content that is rare or specific to your course:
- Product names, tool names, and people's names.
- Abbreviations and acronyms, such as "CSV" heard as "see ess vee".
- Numbers, dates, currency, and units.
- Commands and formulas. A spoken "equals sum open paren B2 colon B6" should appear as
=SUM(B2:B6), and the assistant may or may not format it that way.
A practical fix is to give the tool a glossary in the prompt. A short list of correct spellings reduces repeated mistakes, though it does not remove them.
Glossary (use these spellings exactly):
WebVTT, SUM, CSV, Sheets-Lite
Speakers: Maria Okoye (instructor)A structural check you can run
A short script can catch format problems before a human listens. It cannot tell you whether the words are right. The check below flags cues that end before they start or appear out of order.
import re
TIME = re.compile(r"(\d+):(\d{2}):(\d{2})\.(\d{3}) --> (\d+):(\d{2}):(\d{2})\.(\d{3})")
def seconds(h, m, s, ms):
return int(h) * 3600 + int(m) * 60 + int(s) + int(ms) / 1000
def check_vtt(text):
problems = []
last_start = -1.0
for n, line in enumerate(text.splitlines(), 1):
m = TIME.search(line)
if not m:
continue
start = seconds(*m.groups()[:4])
end = seconds(*m.groups()[4:])
if end <= start:
problems.append(f"line {n}: end is not after start")
if start < last_start:
problems.append(f"line {n}: cue starts before the previous cue")
last_start = start
return problems
sample = """WEBVTT
00:00:00.000 --> 00:00:03.200
Welcome to the course. Today we build a budget.
00:00:07.000 --> 00:00:03.200
Start by entering your income in column B.
"""
print(check_vtt(sample))Running this on the sample prints ['line 7: end is not after start']. The second cue's end time is earlier than its start time.
What the script does not catch:
- A missing
WEBVTTheader. - A comma used in place of a period in the times.
- Words that differ from the audio.
- Cues that are in order but all shifted by two seconds.
- Cues that overlap each other.
You can extend the script for the first two, but the last three need a person watching and listening.
A drafting flow
The diagram shows the flow this chapter recommends. The review steps that follow it are covered later.
Common mistakes
- Asking the assistant to "clean up" the transcript. It may remove filler words, correct grammar, or rephrase. For captions, this makes the text differ from the speech. Decide in advance whether you want verbatim or lightly edited captions and say so.
- Trusting plausible timestamps. Evenly spaced times such as 0, 5, 10, 15 seconds are a sign of invention.
- Skipping speaker labels. If more than one person speaks, learners need to know who is talking. Add speaker names in the transcript and tell the tool how to show them.
- Pasting private recordings into a tool without checking its terms. Recordings of learners or colleagues can contain personal information. See the privacy chapter before you upload anything.
- Treating the structural check as a quality check. A file can pass every test and still say the wrong words.
Summary of working rules
- Produce the transcript first, then the cues.
- Say whether you want verbatim or edited text.
- Give the tool a glossary and tell it not to invent times.
- Ask the tool to mark anything it is unsure about.
- Run a structural check, then hand the file to a person for checking against the audio.
Exercise
An assistant returns a WebVTT file for a video it was only given a text script for. Every cue is exactly five seconds long, and the first cue starts at 00:00:00.000. Name two reasons you should not publish this file as it is, and say what you would do next.
Show answer
First, the assistant never heard the audio, so the timestamps are invented. Evenly spaced five-second cues are a typical sign of this. Second, the script is what the presenter planned to say, so the words may differ from the recording. Next, get a transcript with real timings from a speech-to-text tool run on the recording, or play the video and set each cue time by hand. Then correct the words against the audio and run the structural check.
Exercise
This cue timing line came out of an export: 00:00:05,400 --> 00:00:08,100. Will the structural check in this chapter flag it, and what is wrong with it?
Show answer
The check will not flag it. The regular expression requires a period before the milliseconds, so the line does not match and is skipped without a message. The problem is the comma, which is SRT style and not valid WebVTT. Replace the commas with periods, and consider extending the check to report lines containing "-->" that do not match the pattern.