# YouTube transcripts and captions: from one video to a training dataset

Learn how to get a YouTube transcript, distinguish creator captions from auto-generated and translated subtitles, and match text to audio for training datasets.

Canonical reference: https://flashdata.dev/docs/guides/youtube-transcripts-and-captions
FlashData · Sources checked: 2026-11-19

Open the video description and choose **Show transcript**. If captions are available, you can read the words and jump to the moment they were spoken. No API or download is needed.

<a id="get-text-from-one-video"></a>

## How to get a YouTube transcript without downloading the video


- [YouTube: View video transcripts](https://support.google.com/youtube/answer/15930243?hl=en)

1. **Find the passage.** On the watch page, expand the description and select **Show transcript**. Select a line to play that moment.
2. **Check the language.** The player's **Subtitles/CC** menu controls the text. **Audio track**, when present, controls what you hear. Switching the audio does not guarantee that the transcript changes with it.
3. **Verify a quote.** Copy the passage where text selection is available, or note the words and timestamp. Replay the line to check names, numbers, and words like “not” that can reverse the meaning.

- [Caption settings](https://support.google.com/youtube/answer/100078?co=GENIE.Platform%3DAndroid&hl=en)
- [YouTube: Audio track settings](https://support.google.com/youtube/answer/13339776?hl=en)

<a id="save-your-captions"></a>

### Save captions for a video you manage


In **YouTube Studio → Subtitles**, choose the video and select **Edit** beside the language you want. Under **Options**, choose **Download subtitles**. Keep the timed file; you can export a plain-text copy later.

If there is no track yet and you have a script in the spoken language, Studio can synchronize the script to the audio.

- [Download or edit captions](https://support.google.com/youtube/answer/2734705?hl=en)
- [Add captions or sync a script](https://support.google.com/youtube/answer/2734796?hl=en)

<a id="when-there-is-no-track"></a>

### When there is no caption track


Retrieving captions reads existing text. Transcribing creates new text from audio. For a recording you own or have permission to process, use a speech-to-text tool in **transcribe** mode to keep the spoken language. Translation is a separate step. Without captions or authorized access to the audio, ask the publisher for a transcript.

For example, to transcribe your own English interview locally, first select the correct audio stream. With FFmpeg, `whisper-cli` from the whisper.cpp quick start, and its English `base.en` model installed, the following produces both `interview.txt` and `interview.srt`:

- [whisper.cpp quick start](https://github.com/ggml-org/whisper.cpp#quick-start)

**Transcribe a local recording with whisper.cpp**

```bash
ffmpeg -i interview.mp4 -map 0:a:0 -ac 1 -ar 16000 -c:a pcm_s16le interview.wav
whisper-cli -m models/ggml-base.en.bin -f interview.wav -l en -otxt -osrt -of interview
```

Here `0:a:0` selects the **first audio stream**, not necessarily the original language. Listen to it first. For Japanese speech, for example, select the Japanese stream, use the multilingual model `ggml-base.bin`, and set `-l ja`. Review the output against the recording. This text was created by **your** transcription process; it is not a caption track supplied by YouTube.

<a id="what-captions-subtitles-and-transcripts-are"></a>

## What captions, subtitles, and transcripts are


A **caption track** is a sequence of cues: a piece of text and the time it should appear. Closed captions can be switched on and off. Accessibility captions convey meaningful sound as well as speech: a speaker change, a knock at the door, or an alarm that someone reacts to. **Subtitles** often means translated dialogue, but in many countries it also means same-language captions. The menu label alone does not tell you who wrote the words or whether they are a translation.

- [W3C: Captions and subtitles](https://www.w3.org/WAI/media/av/captions/)

A **transcript** presents the words for reading, with or without timestamps. YouTube's transcript panel is a reading view of captions, not an independent second transcription. A **summary** is different again: it can leave things out or paraphrase. If a speaker says "put it here" while pointing at a diagram, the transcript may say exactly that without explaining where. A descriptive transcript adds the missing visual information.

- [W3C: Transcripts](https://www.w3.org/WAI/media/av/transcripts/)

<a id="the-three-types-of-youtube-captions"></a>

## The three types of YouTube captions


When comparing transcripts, classify the **caption track you actually received**. The three common sources are creator-provided captions, YouTube's automatic transcription, and YouTube's automatic translation. The last two both use automation, but only one listens to the speech.

| Caption source | How the text was made | Example: a Japanese interview |
| --- | --- | --- |
| **Creator-provided (uploader)** | The channel supplies or publishes the wording. It can be typed, uploaded, or edited from an automatic draft. It is not necessarily written from scratch or verbatim. | The creator publishes English subtitles reading "Please wait a moment." This is a translation, but its source is still the **creator**, not YouTube Auto-translate. |
| **YouTube auto-generated (speech recognition, or ASR)** | YouTube turns **speech into text in the same language**. It can mishear the speaker; no translation is involved. | The guest says chotto matte. The track represents those words in Japanese. |
| **YouTube auto-translated (machine translation)** | YouTube turns **existing caption text into another language**. The source can be uploader-provided or automatic. It does not listen to a dub in the target language. | YouTube renders the Japanese caption in English as "Wait a little." If the Japanese caption misheard a name, the translation can inherit that error. |

- [YouTube Studio: Edit captions](https://support.google.com/youtube/answer/2734705?hl=en)
- [YouTube: Automatic captioning](https://support.google.com/youtube/answer/6373554?hl=en)
- [YouTube: Caption translation](https://developers.google.com/youtube/data/reference/rest/v3/captions/download)

<a id="why-one-video-can-have-several-english-texts"></a>

### Why one video can have several English texts


A **dub is audio, not a fourth caption type**. In the same fictional interview, the English voice actor might say "Give me a second." Both English subtitles above convey the meaning. Neither contains those spoken words. Use either for understanding, listen to the dub for a direct quote, and keep the source text and translation method separately for a translation dataset.

The original audio is the source performance; default playback is what the player selects and can differ with viewer preferences. Changing the caption language does not switch the audio. Do not assume every dub has a matching ASR track: YouTube describes automatic captions for multi-audio videos as being in the default language, not one transcription per dub.

- [Preferred audio languages](https://support.google.com/youtube/answer/13339776?hl=en)
- [YouTube automatic captioning](https://support.google.com/youtube/answer/6373554?hl=en)

<a id="choose-a-format"></a>

## YouTube transcript formats: TXT, SRT, VTT, and JSON


| Format | Choose it for | What to keep in mind |
| --- | --- | --- |
| Plain text (TXT) | Reading, notes, or a summary | Easy to edit, but flattening the track discards the link from each line to the video unless you preserve it separately. |
| SubRip (SRT) | Moving timed subtitles between editors and players | Numbered cues with start and end times. Useful when you care about playback rather than rich styling. |
| WebVTT (VTT) | Captions for a web player | Retains cue timing and can carry extra information such as positioning or voice labels when the author supplied them. |
| JSON or JSON Lines (JSONL) | Searching across videos or building datasets | You choose the schema. State whether times are seconds or milliseconds and whether they refer to the full video or an exported clip. |

Here is the fictional uploader subtitle in WebVTT. Its 1.9 seconds describe **when to display the cue**, not the start and end of each word.

- [WebVTT format](https://www.w3.org/TR/webvtt1/)
- [YouTube's supported caption formats](https://support.google.com/youtube/answer/2734698?hl=en)

**A timed WebVTT cue**

```vtt
WEBVTT

00:01:04.200 --> 00:01:06.100
Please wait a moment.
```

A text-only copy can simply say "Please wait a moment." A searchable note is more useful as "01:04 · Please wait a moment." If you cut a clip starting at 01:00, the subtitle belongs at **4.2 to 6.1 seconds in that clip**, not 64.2 to 66.1. Keep the original time range so you can reconstruct the reference.

<a id="build-a-transcript-dataset"></a>

## How to build a YouTube transcript dataset


Decide what **one example** is supposed to prove before collecting thousands of tracks. The same cue can be usable for one dataset and wrong for another:

| Dataset goal | Useful evidence | What to reject or label separately |
| --- | --- | --- |
| Search, summaries, or question answering | A readable passage, its language, a video ID, and a time range to cite | Do not present a translated passage as a verbatim quote from the speaker. Keep summaries separate from source text. |
| Speech recognition or word alignment | A specific audio clip paired with the words actually audible in it | Reject wrong dubs and paraphrases as verbatim labels. Separate unreviewed ASR from human-checked references. |
| Speech or text translation | Identified source speech/text and its corresponding translation | Keep human and machine translations distinguishable where known. Cues across languages can split or merge; line 12 need not translate line 12. |
| Video-text or multimodal training | Text that describes what appears in the relevant frames | Narration can refer to something off camera or to the next step. For example, HowTo100M used instructional narration as a training signal, not hand-verified descriptions of every frame. |

- [HowTo100M](https://www.di.ens.fr/willow/research/howto100m/)

<a id="record-the-audio-and-caption-pair"></a>

### Record the audio and caption pair


A video ID is not enough: it does not say which audio you used, which caption version you retrieved, or why a reviewer accepted a pair. Here is one illustrative dataset record, not a YouTube or FlashData API response:

**Dataset manifest: one caption and its audio**

```json
{
  "video_id": "EXAMPLE0001",
  "audio_asset": "interview-en-dub.wav",
  "audio_language": "en",
  "caption_language": "en",
  "caption_origin": "uploader",
  "start_s": 64.2,
  "end_s": 66.1,
  "time_base": "source_video",
  "text": "Please wait a moment.",
  "review": "English dub says 'Give me a second.'",
  "use_for_search": true,
  "use_as_verbatim_speech_label": false
}
```

That last decision is the point: both languages are English and the cue is on time, yet the text is **not** a verbatim label. For a real collection, also record the source or track identifier where available, retrieval date, file/version identifier, and the permission or license covering the intended use. Leave unknown provenance unknown rather than inferring it from a filename.

<a id="check-the-collection"></a>

### Check the collection before using it


1. **Measure coverage.** Count attempted videos, videos with a track in the target language, and videos that pass your quality policy. Separate "no eligible captions" from "could not retrieve." Otherwise a temporary failure looks like a language with poor coverage.
2. **Listen and sample.** Review clips across languages, caption sources, and channels. Check that numbers, names, negations, speaker changes, and cue boundaries match the actual recording. For verbatim speech, compare a sample to independently transcribed reference text. Word error rate counts substitutions, deletions, and insertions per reference word; it is not a translation-quality or timing score.
3. **Preserve the source and the time base.** Keep the timed track alongside cleaned text when permitted. Normalize line breaks for search, but don't blindly drop repeated phrases: "no, no" may be genuine speech. Check cues against clip duration and account for any trim offset.
4. **Split by recording, not by caption line.** Keep clips, dubs, and translations of the same recording in the same train/test split. Otherwise a model can see the same interview during training and evaluation. Keep unverified pairs out of an evaluation set intended to measure verbatim accuracy.
5. **Check rights before collection or release.** Publicly viewable does not mean cleared for redistribution or training. Record what permits your intended use, check for personal information, and plan for corrections or removals. Keep this decision separate from technical quality.

- [Word error rate](https://www.nist.gov/system/files/documents/2021/08/03/OpenASR20_EvalPlan_v1_5.pdf)
- [YouTube license types](https://support.google.com/youtube/answer/2797468?hl=en)
- [YouTube Terms of Service](https://www.youtube.com/static?template=terms)

<a id="retrieve-existing-tracks-with-flashdata"></a>

## Retrieve existing tracks with FlashData


Use this path when you have video IDs and want **existing** captions as text and timed segments. It does not generate speech-to-text for an uncaptioned video. YouTube Transcript and YouTube Captions use the same track-selection rules. Their defaults differ: `youtube_transcript` allows automatic sources (`auto: true`); `youtube_captions` defaults to uploader-only (`auto: false`). Both target **English** when `language` is omitted.

- [YouTube Transcript API](https://flashdata.dev/docs/sources/youtube_transcript/reference.md)
- [YouTube Captions API](https://flashdata.dev/docs/sources/youtube_captions/reference.md)

Here is a single-video Python example using `requests`. Replace the placeholder key and use a video ID you are authorized to process. Availability depends on the video:

**Retrieve an existing transcript with Python**

```python
import requests

response = requests.post(
    "https://data.flashdata.dev/v1/queries/realtime",
    headers={"X-API-Key": "your-api-key"},
    json={
        "source": "youtube_transcript",
        "video_id": "jNQXAC9IVRw",
        "params": {"language": "en", "auto": True},
    },
    timeout=(5, 90),
)
response.raise_for_status()
track = response.json()["results"][0]
print(track["languageCode"], track["captionSource"])
print(track["fullText"])
for cue in track["segments"]:
    print(f"{cue['start']:.3f} to {cue['end']:.3f} s: {cue['text']}")
```

<a id="caption-language-and-source"></a>

### Choose a language and caption source


A language code such as `"en"` asks for English regardless of the audio. To follow an audio track instead, use `"original"` for the marked original language or `"default"` for the playback language marked for the worker, not your browser setting. FlashData resolves both from audio information in the same extraction.

An explicit track code works differently: `"en-orig"` with `auto: true` requests that exact automatic track, without fallback. The `-orig` suffix is a yt-dlp naming convention, not proof that English was the original audio.

- [yt-dlp: YouTube track names](https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/extractor/youtube/_video.py)

For an ordinary language code, `"default"`, or `"original"`, `auto: true` tries caption sources in this order, all in the target language:

1. **Native speech recognition** (`youtube_asr`): YouTube transcribed the speech.
2. **Uploader captions** (`uploader`): the channel supplied the text.
3. **Unclassified automatic captions** (`youtube_auto_unknown`): the evidence does not distinguish ASR from translation. This is uncertainty about the source, not a fourth way of making captions.
4. **YouTube machine translation** (`youtube_translated`): YouTube translated another caption track.

With `auto: false`, only uploader captions qualify. In the interview example, suppose playback is marked English. There is an English upload and a YouTube translation, but no English ASR. Asking for `"default"` with `auto: true` returns `captionSource: "uploader"` and `isAutoGenerated: false`.

<a id="request-more-than-one-caption-language"></a>

### Request more than one language


Send an array such as `["original", "en", "es"]` for the same video. This requests each of 1 to 10 distinct selectors with one `auto` policy, not the first available language. Even a one-item array returns `results[0].tracks` and `results[0].errors` instead of a single track.

Successful tracks stay in request order. Match a track by `requestedLanguageCode` when present, otherwise by `languageCode`. Errors identify the failed selector by `languageCode`. Keep successes when another language fails. If none succeeds, handle the request-level error.

<a id="missing-or-failed-captions"></a>

### Tell a missing track from a failed fetch


An unconfirmed original language (`youtube_original_language_unknown`) differs from a known original language with no eligible captions (`youtube_original_subtitles_unavailable`). For default playback, the corresponding errors are `youtube_default_language_unknown` and `youtube_default_subtitles_unavailable`.

If YouTube returns HTTP 429 when serving translated captions and no requested track succeeds, FlashData's realtime API can report **HTTP 502** with `youtube_subtitle_retrieval_failed`. With partial success, the failed selector can instead have `errors[].code: "retrieval_failed"`. A bare 502 does not diagnose a YouTube 429. A 429 from FlashData's own request limiter is separate from a 429 at YouTube.

- [HTTP 429 while serving translated captions](https://flashdata.dev/docs/guides/youtube-transcripts-and-captions/reference.md#why-does-yt-dlp-report-http-429-for-youtube-auto-translated-captions)

The YouTube Download API selects audio separately via `audio_language` and may fall back to another track; asking both APIs for `"original"` does not establish alignment. See the timestamped captions recipe for saving results and the Bulk file guide for processing a list of video IDs.

- [YouTube Download API](https://flashdata.dev/docs/sources/youtube_download/reference.md)
- [timestamped captions recipe](https://flashdata.dev/docs/guides/timestamped-captions-recipe/reference.md)
- [Bulk file guide](https://flashdata.dev/docs/guides/bulk/reference.md)

<a id="youtube-transcript-faq"></a>

## YouTube transcript FAQ


<a id="can-i-get-a-youtube-transcript-for-free-without-downloading-the-video"></a>

### Can I get a YouTube transcript for free without downloading the video?


Yes, when captions are available, YouTube's **Show transcript** feature lets you read the text on the watch page without buying a tool or downloading media. For one lecture or interview, start there.

- [View video transcripts](https://support.google.com/youtube/answer/15930243?hl=en)

<a id="why-is-there-no-transcript-when-i-can-see-subtitles-in-the-picture"></a>

### Why is there no transcript when I can see subtitles in the picture?


Turn closed captions off. If the words remain, they may be burned in: part of the image rather than a selectable text track. A video can also lack published captions, or automatic captions may still be processing. For authorized material, transcribe the audio if you want what was **said**, or use optical character recognition (OCR) with review if you need the exact words **printed on screen**. The two can differ.

<a id="can-i-get-english-text-if-the-audio-is-in-another-language"></a>

### Can I get English text if the audio is in another language?


Often, but not always. Look for English subtitles first; if none are listed, check whether the player offers **Auto-translate**. This translates available captions. It does not create English audio or establish that the English dub used the same words.

- [YouTube caption languages](https://support.google.com/youtube/answer/100078?co=GENIE.Platform%3DAndroid&hl=en)

<a id="does-auto-generated-mean-machine-translated"></a>

### Does "auto-generated" mean "machine-translated"?


No. Speech recognition turns speech into writing in the **same language**. Machine translation changes text from one language to another. Both processes can be automatic, and a translation may start from imperfect speech recognition. When the origin is not disclosed, label it unknown.

<a id="why-does-yt-dlp-report-http-429-for-youtube-auto-translated-captions"></a>

### Why does yt-dlp report HTTP 429 for YouTube auto-translated captions?


A video can list a translation even when YouTube declines the request for its text with **HTTP 429 (Too Many Requests)**. In yt-dlp issue #13831, the maintainer's pinned explanation identifies **YouTube's auto-translated captions** as the affected case. Uploader-provided tracks and original-language ASR were not affected by **that particular issue**. It does not mean all translations fail or that other caption requests can never be rate-limited.

- [yt-dlp issue #13831, the maintainer's pinned explanation](https://github.com/yt-dlp/yt-dlp/issues/13831#issuecomment-3712613129)

If you just need readable text, check for an existing uploader or native ASR track **in your target language**. If you specifically need the YouTube translation, preserve successful tracks and defer only the failed translation. Honor `Retry-After` when the response includes it; otherwise back off, limit retries, and avoid retrying an entire collection at once. Record the outcome as **retrieval failed**, not **no captions**. A Japanese track arriving successfully does not satisfy a request for English.

- [HTTP 429 and Retry-After](https://datatracker.ietf.org/doc/html/rfc6585#section-4)

<a id="how-do-i-get-just-the-text-without-timestamps"></a>

### How do I get just the text without timestamps?


Export a plain-text version of a caption file, or join its cue text in order. Keep the timed original if you might later cite a line, make clips, or correct an error. Removing timestamps is easy; recovering accurate timing from a paragraph is a separate alignment task.

<a id="are-transcripts-available-for-youtube-shorts-and-livestreams"></a>

### Are transcripts available for YouTube Shorts and livestreams?


YouTube supports automatic captions for eligible Shorts as well as long-form videos, but availability is not guaranteed. Live captions and the archived video's captions are not necessarily the same: YouTube says it generates new automatic captions for the on-demand version. For a reproducible dataset, record which version you used and when.

- [YouTube automatic captioning](https://support.google.com/youtube/answer/6373554?hl=en)

<a id="does-the-official-youtube-data-api-return-transcripts-for-any-public-video"></a>

### Does the official YouTube Data API return transcripts for any public video?


No. Google's OAuth-authorized `captions.list` returns track metadata, not the actual words. `captions.download` retrieves the track and requires permission to edit the video. Being able to read a transcript as a viewer is not the same as having that API permission.

- [captions.list](https://developers.google.com/youtube/data/reference/rest/v3/captions/list)
- [captions.download](https://developers.google.com/youtube/data/reference/rest/v3/captions/download)

<a id="are-speaker-names-and-word-by-word-timestamps-included"></a>

### Are speaker names and word-by-word timestamps included?


Not reliably. A cue may cover a whole phrase, and a track may label a speaker, mark a sound, or do neither. If you need to know who spoke when, annotate or run speaker diarization and verify it. If you need when each word was spoken, use word alignment against the actual recording; don't divide a cue's duration evenly among its words.

<a id="are-youtube-transcripts-accurate-enough-to-quote"></a>

### Are YouTube transcripts accurate enough to quote?


Use the transcript to find the moment; use the recording to check the quote. If a Japanese speaker is quoted in English, say whether the words are your translation, the uploader's subtitle, or the dub. A fluent sentence is not evidence that any particular speaker used those exact words.

<a id="can-public-youtube-transcripts-be-used-to-train-a-model-or-shared-as-a-dataset"></a>

### Can public YouTube transcripts be used to train a model or shared as a dataset?


Public access alone does not grant permission for either use. Establish what covers collection, training, and any redistribution of the text or media; those are separate decisions. Then decide whether the labels fit the task: a permitted English translation can still be the wrong reference for English speech recognition. YouTube's license guide explains the difference between its standard license and Creative Commons Attribution.

- [YouTube's license guide](https://support.google.com/youtube/answer/2797468?hl=en)

<a id="why-is-a-transcript-different-when-i-fetch-it-again"></a>

### Why is a transcript different when I fetch it again?


Check the video, audio language, caption language, and track source. You may be comparing two tracks. Even the same video can change: a creator can edit text or timings and publish a revised caption track. Keep a retrieval date and version or content hash when permitted so you can distinguish an edit from a change in your selection policy.

- [YouTube: Edit or remove captions](https://support.google.com/youtube/answer/2734705?hl=en)
