Short answer: text that is drawn into the picture (burned-in subtitles, captions, titles, lower-thirds, slide text) is not stored anywhere in the video file. Speech-to-text will not find it either, because it listens to the audio. To get it out you read the frames with OCR (optical character recognition): grab a frame every second or so, read the text in each frame, then merge the repeats into lines with start and end times. Written as SRT, that gives you a subtitle file of everything shown on screen.
This guide covers three ways to do it: by hand, with a short Python script (real output below), and with a cloud tool that does the merging and timing for you.
On-screen text vs. speech vs. subtitle tracks
Three different things get called "the text of a video":
| Text | Where it lives | How to get it |
|---|---|---|
| Spoken words | The audio track | Speech-to-text (Whisper and similar) |
| Soft subtitles (you can switch them off) | A separate track in the file, or a sidecar .srt/.vtt | Extract the track, e.g. ffmpeg -i in.mkv out.srt |
| Burned-in subtitles, captions, titles, slide text | The pixels of each frame | OCR on the frames |
Before you start with OCR, check the second row: if the player lets you turn subtitles on and off, the text is a track and ffmpeg can copy it out exactly. OCR is for everything else: short-form videos with captions baked in, ads with hook text, lectures and screen recordings, news with name lower-thirds, hardsubbed films.
Method 1: Pause, screenshot, OCR
For a short clip: pause on each caption, take a screenshot, and paste it into anything that reads text from images (Google Lens, the iPhone and Android photo apps, PowerToys Text Extractor on Windows). It works for a dozen lines. It does not give you timings, and a 10-minute video has hundreds of captions.
Method 2: A short Python script (ffmpeg + RapidOCR)
This script takes one frame per second with ffmpeg, reads each frame with RapidOCR (the PaddleOCR models packaged for ONNX, runs on CPU), and prints the text whenever it changes:
import glob, os, subprocess, sys
from rapidocr_onnxruntime import RapidOCR
video, every = sys.argv[1], float(sys.argv[2]) if len(sys.argv) > 2 else 1.0
os.makedirs("frames", exist_ok=True)
# 1. one frame every N seconds
subprocess.run(["ffmpeg", "-loglevel", "error", "-y", "-i", video,
"-vf", f"fps=1/{every}", "frames/%05d.jpg"], check=True)
ocr = RapidOCR()
last = None
for i, path in enumerate(sorted(glob.glob("frames/*.jpg"))):
result, _ = ocr(path)
text = " | ".join(r[1] for r in (result or []) if float(r[2]) > 0.7)
if text and text != last: # print only when the text changes
t = i * every
print(f"{int(t // 60)}:{t % 60:04.1f} {text}")
last = text
pip install rapidocr_onnxruntime
python video_text.py captions.mp4 1
We ran it on a 30-second vertical science clip with burned-in captions. This is the real output, first half:
0:00.0 If you do a quick search | for spectroscopy data,
0:01.0 If you do a quick search | forspectroscopy data,
0:03.0 there are numerous ways | that the data can appear.
0:06.0 Those variations are | basedonthe source | of the cosmic light.
0:07.0 WAVELENGTH | Those variations are | basedonthe source | of the cosmic light.
0:08.0 WAVELENGTH | Those variations are | basedon the source | of the cosmic light.
0:09.0 There are3types of | spectra that we can use
0:10.0 There are 3types of | spectra that we can use
0:11.0 There are 3 types of | spectra that we can use
0:13.0 Continuous | Spectrum | Brightness | Wavelength | continuous
0:14.0 Emission | Spectrum | Brightness | Wavelength | emission
It reads the captions, and that is already useful. It also shows the problems you will have to solve before this becomes a subtitle file:
- The same caption comes back several times. "There are 3 types of spectra" appears three
times because the OCR read the spaces differently in each frame (
3types,3 types). A plain "did the text change?" check is not enough; you need fuzzy matching. - Spaces get lost (
basedonthe source,forspectroscopy) on tight caption fonts. - Captions and graphics get mixed. At 0:07 the word WAVELENGTH from a diagram is glued onto the subtitle. You need to know where each text sits on screen to separate captions from the rest.
- No end times. To write SRT you need when each line disappears, not only when it appears.
- Every frame is read, even when nothing changed, which is slow on long videos.
None of this is hard on its own: compare positions, merge lines whose text is about 85-90 %
similar, keep the most common spelling, write start --> end. It is a weekend of edge cases.
Method 3: Video OCR on Apify
We built Video OCR, an actor that does the steps above and returns each piece of on-screen text once, with its start and end time, its position (top, middle, bottom), a confidence score, a frame image, a full transcript and SRT/VTT files. (Disclosure: Kanto Labs makes it, and this is our own tool.) It uses the same family of open-source OCR models (PP-OCR, Apache-2.0) inside the run, so the video is not sent to an outside AI service.
The input:
{
"videoUrls": [
"https://api.apify.com/v2/key-value-stores/aXcXwfChlioPWAUJv/records/sample-ocr-captions.mp4",
"https://media.w3.org/2010/05/sintel/trailer.mp4"
],
"sampleIntervalSeconds": 1,
"ocrLanguage": "en",
"textRegion": "full"
}
The first file is the same 30-second captions clip. The second is the trailer of Sintel, the Blender Foundation's open movie, which has title cards and a credits block at the end.
What came back
For the captions clip, each caption is one row, with the repeats merged and the spaces fixed. These are the first segments, as returned:
00:00:01.000 - 00:00:03.000 middle 0.98 If you do a quick search / for spectroscopy data,
00:00:04.000 - 00:00:06.000 bottom 1.00 there are numerous ways / that the data can appear.
00:00:07.000 - 00:00:09.000 bottom 0.99 Those variations are / based on the source / of the cosmic light.
00:00:09.000 - 00:00:10.000 middle 1.00 WAVELENGTH
00:00:10.000 - 00:00:13.000 bottom 0.99 There are 3 types of / spectra that we can use
00:00:13.000 - 00:00:15.000 top 0.99 Continuous / Spectrum
Compare it with the script: "There are 3 types of spectra" is one line from 0:10 to 0:13 instead of
three near-copies, "based on the source" has its spaces, and WAVELENGTH from the diagram is its own
segment because it sits in a different place on screen. The video row also has hookText, the text
shown in the first three seconds, which is what ad and short-form researchers usually want first:
{
"fileName": "sample-ocr-captions.mp4",
"durationSeconds": 30.03,
"segmentCount": 17,
"framesSampled": 31,
"framesWithText": 24,
"hookText": "If you do a quick search\nfor spectroscopy data,",
"fullText": "[0:01] If you do a quick search for spectroscopy data,\n[0:04] there are numerous ways that the data can appear.\n[0:07] Those variations are based on the source of the cosmic light.\n...",
"srtUrl": "https://api.apify.com/v2/key-value-stores/.../sample-ocr-captions-onscreen-text.srt"
}
For the trailer, it found the seven pieces of text in 52 seconds of film, including the credits block split by position:
[0:10] THE BLENDER FOUNDATION presents
[0:41] SINTEL
[0:48] COMING SOON
[0:49] BLENDER FOUNDATION PRESENTS THE DURIAN OPEN MOVIE PROJECT SINTEL
[0:49] HALINA REIJN - THOM HOFFMAN
[0:49] REALIZED WITH THE SUPPORT OF: BLENDER FOUNDATION - THE NETHERLANDS FILM FUND - CINEGRID DIVX -JAN MORGENSTERN PRODUCED BY BLENDER INSTITUTE, AMSTERDAM
[0:49] (CC) CREATIVE COMMONS ATTRIBUTION 3.0 http://durian.blender.org
Only 10 of its 53 sampled frames had text. Frames without text are not billed, so a mostly text-free film costs little; see the Store page for current prices.
Settings that matter
- Sampling interval. 1 second catches normal subtitles. Use 0.5 for fast word-by-word TikTok captions, 2-5 seconds for slides and screen recordings.
- Text region.
bottomreads only the lower part of the frame (subtitles and lower-thirds) and ignores signs, logos and on-screen graphics. - Script. The default model reads English and also Chinese and Japanese. Pick
latin,cyrillic,korean,arabic,devanagari,greekorthaifor those scripts. - Inputs. Direct video links, public YouTube, TikTok, Instagram, Facebook and X video links, or the dataset of a TikTok / Instagram / Facebook Ads scraper run on Apify.
What it does not do
- It reads text that is visible. It does not transcribe speech; pair it with a speech-to-text tool if you need both.
- Stylised fonts, text over busy backgrounds and very small text come back with lower confidence or
not at all. Lower
minConfidencefor those, and check the frame image of each segment. - Timings are as precise as your sampling interval (1 second by default).
Which route should you pick?
| Situation | Route |
|---|---|
| A few captions from one clip | Screenshot + phone or Google Lens OCR |
| You want to own the code and can handle merging and timing | The script above, then fuzzy-merge and write SRT |
| Many videos, SRT files, positions and hook text, from links or scraper datasets | Video OCR |
And check for a soft subtitle track first. If there is one, ffmpeg gives you the exact text for free.
Drafted with AI assistance and checked against real runs of the tools on 2026-11-23; all output shown is real.