HomeBlog → How to transcribe a YouTube video to text

How to transcribe a YouTube video to text

Published 2026-08-05 · 6 min read

There are three ways to turn a YouTube video into text, and they differ enormously in quality and in what you are allowed to do with them. Picking the wrong one is how people end up with a wall of unpunctuated words and no timestamps.

Option 1: the captions YouTube already made

Every popular video already has auto-generated captions. Open the transcript panel under the video, copy the text, done — no code, no cost.

Where this falls apart:

For a single video you want to read once, stop here — it is free and takes ten seconds. For anything repeatable, keep going.

Option 2: your own transcription of the audio

This is what you want when the text matters: for your own videos, for research, for content you are going to publish. Extract the audio, send it for recognition, get punctuated text with timestamps.

Extracting the audio from a file you already have:

ffmpeg -i video.mp4 -vn -ac 1 -ar 16000 -b:a 48k audio.mp3

Then a single request:

from openai import OpenAI

client = OpenAI(base_url="https://voicesscribe.com/v1", api_key="your key")

with open("audio.mp3", "rb") as f:
    r = client.audio.transcriptions.create(
        model="whisper-1", file=f, response_format="verbose_json",
    )

print(r.text)

The difference from auto-captions is immediate: punctuation, correct casing, and segments with exact timings you can turn into chapters or subtitles.

A note on downloading other people's videos

Downloading video from YouTube is restricted by its Terms of Service, and the content itself is usually someone's copyrighted work. Transcribing your own uploads, or material you have rights to, is straightforward. For everything else, the honest options are the built-in transcript panel or asking the author.

This is not legal advice and the rules differ by country — but "the tool made it easy" has never been a defence, and it is worth knowing which side of the line you are on before building a pipeline.

Option 3: bulk work over a channel archive

For your own back catalogue, the job is the batch pattern: a folder of files, a work queue, and results derived from what already exists on disk.

import pathlib
from openai import OpenAI

client = OpenAI(base_url="https://voicesscribe.com/v1", api_key="your key")
OUT = pathlib.Path("transcripts"); OUT.mkdir(exist_ok=True)

for video in pathlib.Path("videos").glob("*.mp4"):
    out = OUT / (video.stem + ".txt")
    if out.exists():
        continue                      # already done — do not pay twice
    audio = video.with_suffix(".mp3")
    # ffmpeg -i video.mp4 -vn -ac 1 -ar 16000 -b:a 48k audio.mp3
    with audio.open("rb") as f:
        out.write_text(client.audio.transcriptions.create(
            model="whisper-1", file=f).text, encoding="utf-8")

An hour of video becomes about 25 MB of mono audio, which fits a single request. Longer recordings get split — the size limit is 25 MB per request.

Getting subtitles instead of plain text

If the goal is to put captions back on the video rather than to read the text, ask for the subtitle format directly and skip the conversion step:

srt = client.audio.transcriptions.create(
    model="whisper-1", file=f, response_format="srt",
)
open("video.srt", "w", encoding="utf-8").write(srt)

The resulting SRT uploads to YouTube in the subtitles section of the video and replaces the auto-generated track. For most channels this alone is a visible quality jump, because your captions now have punctuation and the right spelling of names.

Making the text worth publishing

Which option to choose

SituationBest option
One video, need the gist nowBuilt-in transcript panel
Your own video, text will be publishedOwn transcription of the audio
Whole channel archiveBatch pipeline over the audio
Need captions on the videoOwn transcription with response_format=srt
Someone else's videoTranscript panel, or ask the author

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 key

Frequently asked questions

Can I just copy the YouTube transcript?

For a single video, yes — the transcript panel is free and instant. It is auto-generated, though, so punctuation and proper nouns are unreliable, and copying does not scale to an archive.

Do I need to download the video to transcribe it?

Only the audio track, and only for videos you have rights to. Audio is dozens of times smaller than video, and the picture is not used by recognition at all.

How long does an hour-long video take?

A few minutes: processing runs faster than real time. Extracting the audio with ffmpeg usually takes longer than the transcription itself.

Will I get timestamps?

Yes, with response_format=verbose_json you get segments with exact start and end times, and with srt or vtt you get a ready subtitle file.

Is transcription better than YouTube auto-captions?

On the same audio, a dedicated transcription pass gives punctuation, correct casing and far better handling of names and terms — especially when you pass the vocabulary through the prompt parameter.

Related reading