# Video OCR – On-Screen Text, Slides & Burned-In Subtitles (`gazidev/video-ocr`) Actor

Extract on-screen text from video files as a timed track: slides, burned-in (hardcoded) subtitles, captions and ad hook text. Merged segments with start/end times, full transcript, SRT and VTT files. Tesseract OCR, 15+ languages. $2 per 1,000 frames with text.

- **URL**: https://apify.com/gazidev/video-ocr.md
- **Developed by:** [Cemal Atakli](https://apify.com/gazidev) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 frame with texts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Video OCR – Extract On-Screen Text, Slides & Burned-In Subtitles

Turn the **text you can see in a video** into a **timed text track**. You get slide text, **burned-in (hardcoded) subtitles**, captions, lower thirds, credits, prices on screen and ad hook text. Give it direct links to video files. It samples a frame every N seconds plus every scene cut, skips black and duplicate frames, and runs **Tesseract 5 OCR** on the rest. Then it merges what it reads into **segments with start and end times**. For every video you get:

- **segments**: each line of on-screen text with `start`, `end`, timecodes, confidence and its position in the frame
- a **full on-screen transcript**: every distinct line once, in order of appearance
- **SRT and VTT subtitle files**: burned-in subtitles become a real subtitle file you can edit, translate or upload
- a **JSON file** with segments, cues and the OCR result of every sampled frame

**$2 per 1,000 frames that contain text** + $0.002 per video minute. Frames without text, duplicate frames, failed videos and invalid links are free.

### What does this do that our other listings don't?

| Actor | What you get | What it doesn't do |
|---|---|---|
| **Video OCR** (this Actor) | One **de-duplicated, timed text track** per video: segments `[start, end, text]`, transcript, **SRT/VTT** | No speech recognition, no frame images by default |
| [Video Frame Extractor](https://apify.com/gazidev/video-frame-extractor) | Still images (every N s, thumbnails, scenes, keyframes) with links | Doesn't read text |
| [Image to Text OCR](https://apify.com/gazidev/image-ocr) | Text, words and boxes from **image** URLs | Doesn't take videos, has no timeline and doesn't merge repeated text |
| [Audio & Video Transcription](https://apify.com/gazidev/media-transcriber) | What is **spoken** (speech to text, SRT) | Doesn't read text shown on screen |

You *could* run Video Frame Extractor and then Image to Text OCR. You would pay for every frame, get the same slide text 30 times, and still have to rebuild the timing yourself. This Actor does all of that in one run. It only OCRs frames that changed, and it returns a clean track with start and end times.

### What can I use it for?

- **Hardcoded subtitles → SRT:** recover subtitles burned into old videos, social clips or screen recordings. Then edit, translate or re-time them.
- **Ad creative research:** pull the hook text, offer, price and CTA from video ads you are allowed to analyze, with the second each one appears.
- **Lectures, webinars and conference talks:** get the slide text with timestamps for notes, chapters, search or SEO.
- **Video datasets for AI:** on-screen text as structured data next to the speech transcript (RAG, video search, moderation).
- **Compliance and QA:** check that disclaimers, prices or legal text are on screen, and for how long.
- **Credits and lower thirds:** names, titles and captions with times.

### How it works

1. The file is downloaded to the run's own disk (up to `maxFileSizeMb`, 500 MB by default). Links that point to private or internal network addresses are refused, and so are redirects to them.
2. ffmpeg samples one frame every `frameIntervalSec`, and also a frame at every hard scene cut, so text that appears with a new shot gets an exact start time. You can limit OCR to part of the frame, for example the bottom third for subtitles.
3. Flat frames (black, fades, plain sky) skip OCR. A frame that looks like the last OCR'd frame reuses its text, so a slide shown for 2 minutes is read once.
4. Tesseract reads the remaining frames. In **auto** mode the Actor tries a pass that isolates white and yellow text, because outlined subtitles on busy footage are unreadable for OCR otherwise. Then it falls back to the plain frame. Low-resolution frames are enlarged first. Words below `minConfidence` and lines that look like texture noise are dropped.
5. Lines are tracked across frames. Similar readings are merged into one segment, so OCR flicker doesn't break a line. A segment may be missing from up to 2 frames in a row. Cues for SRT/VTT are the time spans in which the visible text doesn't change.

### Input

| Field | Description |
|---|---|
| `videos`, `bulkText`, `datasetId` | Direct links to video files (MP4, MOV, WebM, MKV, AVI, TS…), a pasted list or CSV, or a dataset column |
| `uploadedFiles` + `uploadStore` | Videos uploaded from your computer (select the key-value store you uploaded them to) |
| `region` | `full`, `bottom-third` (subtitles), `bottom-half`, `top-third`, `top-half`, `middle-third`, or `custom` + `customRegion` (`x,y,width,height` in %) |
| `languages` | Up to 4 Tesseract languages (`eng` by default). Preinstalled: eng deu fra spa ita por nld tur pol rus ara hin chi_sim jpn kor. Any other of the ~100 Tesseract languages is downloaded at run start |
| `textColor` | `auto`, `light` (white/yellow subtitles) or `dark` (slides, screen recordings). Choosing one is faster |
| `textLayout` | `auto`, `sparse` (scattered labels) or `block` |
| `frameIntervalSec` | 1 s by default. 0.5 s for fast captions, 2–5 s for slides (cheaper) |
| `sceneDetection`, `sceneThreshold` | Extra frames at scene cuts (on, 0.3) |
| `skipDuplicateFrames`, `upscaleSmallFrames`, `minConfidence`, `maxFrameWidth` | Quality and speed settings (on, on, 60, 1280 px) |
| `outputMode` | `videos` (one row per video) or `segments` (one row per text segment) |
| `saveTextFrames` | Also store the OCR'd frames that contain text as JPEG files (greyscale, only the region that was read) |
| `maxMinutesPerVideo`, `maxFramesPerVideo`, `maxFileSizeMb` | Limits (60 min, 3,600 frames, 500 MB) |

```json
{
  "videos": ["https://example.com/media/webinar-recording.mp4"],
  "region": "full",
  "textColor": "dark",
  "frameIntervalSec": 3,
  "languages": ["eng"]
}
```

For burned-in subtitles:

```json
{
  "videos": ["https://example.com/clips/interview-subtitled.mp4"],
  "region": "bottom-third",
  "textColor": "light",
  "frameIntervalSec": 0.5
}
```

### Output

One row per video (from the demo run on the Sintel trailer, Blender Foundation, CC BY 3.0, shortened):

```json
{
  "videoUrl": "https://upload.wikimedia.org/.../Sintel_trailer-1080p.ogv.480p.vp9.webm",
  "status": "ok",
  "durationSec": 52.012,
  "framesSampled": 54,
  "framesOcr": 44,
  "framesWithText": 7,
  "framesDuplicate": 1,
  "framesFlat": 9,
  "segmentCount": 14,
  "cueCount": 4,
  "transcript": "THE BLENDER FOUNDATION\npresents\nSINTEL\nCOMING SOON\n...",
  "segments": [
    {"index": 1, "start": 10.09, "end": 12.09, "startTimecode": "00:00:10.090", "endTimecode": "00:00:12.090",
     "text": "THE BLENDER FOUNDATION", "confidence": 96.6, "frames": 2,
     "bbox": {"x": 311, "y": 204, "width": 232, "height": 13}}
  ],
  "srtUrl": "https://api.apify.com/v2/key-value-stores/.../records/001-Sintel_trailer-1080p.ogv.480p.vp9.srt",
  "vttUrl": "https://api.apify.com/v2/key-value-stores/.../records/001-Sintel_trailer-1080p.ogv.480p.vp9.vtt",
  "jsonUrl": "https://api.apify.com/v2/key-value-stores/.../records/001-Sintel_trailer-1080p.ogv.480p.vp9.json",
  "billedEvents": {"frame-with-text": 7, "video-minute": 1}
}
```

The SRT file:

```
1
00:00:10,090 --> 00:00:12,090
THE BLENDER FOUNDATION
presents

2
00:00:43,049 --> 00:00:48,049
SINTEL
```

Failed videos get a row with `errorCode` and `error` (for example `PRIVATE_HOST`, `NOT_MEDIA`, `UNSUPPORTED_PLATFORM`, `FILE_TOO_LARGE`) and are not charged.

### Pricing

| Event | Price | When |
|---|---|---|
| `frame-with-text` | **$0.002** | Each OCR'd frame in which text was found. Duplicate frames that reuse the text are free |
| `video-minute` | $0.002 | Per started minute of video read (decoding, sampling and OCR of frames that turn out to have no text) |

Examples: a 10-minute webinar of full-screen slides, a new slide every 30 s, `frameIntervalSec: 3`, costs about 20 frames + 10 minutes = **$0.06**. A 60-second subtitled clip at 1 s costs at most 60 frames + 1 minute = **$0.122**. The 52-second demo costs 7 frames + 1 minute = $0.016. A video with no text costs only the minutes.

| Actor | Price |
|---|---|
| **This Actor** | $0.002 per frame with text + $0.002 per minute. Duplicates and textless frames are free |
| kantolabs/video-ocr | $0.002 per frame with text |
| aemon/video-on-screen-text-extractor | $0.006 per video |

Set a **maximum total charge** on the run and the Actor stops cleanly when it is reached. The video it was reading keeps the part it scanned, `OUTPUT` shows `stoppedAtMaxCharge: true`, and you are never charged beyond the limit.

### Limits (please read)

- **OCR, not magic:** Tesseract reads clear printed text well: slides, standard subtitles, credits, UI. It reads heavily stylized fonts, tilted or 3D text, motion blur and tiny text in low-resolution video badly or not at all. Expect some garbled lines on busy footage. `minConfidence` and `region` are your filters.
- **Static logos and watermarks** in the frame become one long segment and show up in every cue. Use `region` to read only where the text you want is.
- **Timing resolution** is your sampling interval: a segment starts at the first sampled frame that shows it and ends at the first one that no longer does.
- **Direct video files only.** YouTube, TikTok, Instagram and other platform pages are refused, and so are HLS `.m3u8` playlists. Only process videos you are allowed to analyze.
- No handwriting or math recognition. Right-to-left and vertical CJK text work only as well as Tesseract handles them.

### FAQ

**Can it extract hardcoded subtitles to SRT?** Yes. That is the main use. Choose `region: bottom-third` and `textColor: light`. Use a 0.5–1 s interval.

**Does it transcribe speech?** No. For spoken words use [Audio & Video Transcription](https://apify.com/gazidev/media-transcriber). To *add* subtitles to a video, use [Add Subtitles to Video](https://apify.com/gazidev/video-auto-subtitles).

**I only need the frames as images.** Use [Video Frame Extractor](https://apify.com/gazidev/video-frame-extractor). For text in images (not videos), use [Image to Text OCR](https://apify.com/gazidev/image-ocr).

**How long does it take?** The 52-second demo took 7 s on 1 GB of memory. Long videos take roughly 1–3 s per OCR'd frame on 1 GB. More memory runs more OCR workers in parallel (1 per 2 GB).

**Is my video stored?** Only in your run's storage. The file is deleted from the container after processing. The SRT/VTT/JSON (and frames, if you ask for them) stay in your run's key-value store.

### Use with AI agents (Apify MCP)

This Actor works as a tool in the [Apify MCP server](https://mcp.apify.com) for Claude, ChatGPT, Cursor and other MCP clients. An agent can pass a video URL and get back the on-screen transcript and timed segments as JSON, for example to answer "what does the slide at 12:30 say?" or to summarize a webinar's slides. Through the API: `POST https://api.apify.com/v2/acts/gazidev~video-ocr/run-sync-get-dataset-items` with the input above.

# Actor input Schema

## `videos` (type: `array`):

Direct links to video FILES (MP4, MOV, WebM, MKV, M4V, AVI, TS...). YouTube/TikTok/Instagram pages and HLS playlists are refused: this Actor reads files you may process, it is not a downloader. Private-network addresses are refused too. The pre-filled demo is the Sintel trailer (Blender Foundation, CC BY 3.0, 52 s).

## `bulkText` (type: `string`):

One URL per line, or a CSV with a `url` column.

## `datasetId` (type: `string`):

Every item's URL field (below) is processed.

## `datasetField` (type: `string`):

Field name in that dataset.

## `uploadedFiles` (type: `array`):

This Actor runs with limited permissions, so ALSO select the store you uploaded into in 'Key-value store with your uploads'. When you upload files, the pre-filled demo video is ignored.

## `uploadStore` (type: `string`):

Grants this run read access to that store only. If `uploadedFiles` points into it, only those files are processed; otherwise every media file in the store is (up to 1,000).

## `region` (type: `string`):

OCR only this part of the frame. For burned-in subtitles pick 'Bottom third': faster, and logos or scenery text elsewhere stay out of your SRT.

## `customRegion` (type: `string`):

Used when 'Where is the text?' is Custom. Percent of the frame from the top-left corner, e.g. `0,75,100,25` = the bottom quarter.

## `languages` (type: `array`):

Tesseract language codes or names, up to 4 (e.g. `eng`, `deu`, `spa`, `tur`, `chi_sim`, or `en`, `german`). Preinstalled: eng deu fra spa ita por nld tur pol rus ara hin chi_sim jpn kor; any other of the ~100 Tesseract languages is downloaded at run start. Each extra language slows OCR down.

## `textColor` (type: `string`):

Auto tries an isolation pass for white/yellow outlined text on busy footage and falls back to the plain frame. Forcing one style is faster (one OCR pass per frame).

## `textLayout` (type: `string`):

Tesseract page segmentation. 'Sparse' finds isolated words (UI labels, ad stickers) but reads more noise.

## `minConfidence` (type: `integer`):

Words Tesseract is less sure about are dropped. Lines made mostly of symbols (texture noise) are always dropped.

## `frameIntervalSec` (type: `number`):

Time resolution of the text track. 1 s suits subtitles; 2-5 s is enough (and cheaper) for slides and webinars; 0.5 s for fast ad captions.

## `sceneDetection` (type: `boolean`):

Adds a frame at every hard cut (at least 0.3 s after the previous one), so text that appears with a new shot gets an exact start time.

## `sceneThreshold` (type: `number`):

ffmpeg scene score (0-1). Lower = more cuts detected.

## `skipDuplicateFrames` (type: `boolean`):

A frame that looks the same as the last OCR'd frame (static slide, paused screen) reuses its text: no OCR and no charge.

## `upscaleSmallFrames` (type: `boolean`):

Frames under 600 px high are enlarged 1.5-2x before OCR (small subtitles are read much better). Turn off for speed.

## `maxFrameWidth` (type: `integer`):

Larger frames are scaled down (4K video OCR'd at 1280 px is ~4x faster and reads normal-size text just as well). Raise it for tiny text in 4K screen recordings.

## `outputMode` (type: `string`):

SRT, VTT and a full JSON (segments, cues, per-frame OCR) are saved to the key-value store either way.

## `saveTextFrames` (type: `boolean`):

Stores each OCR'd frame with text (greyscale, the OCR'd region only, up to 500 per video) and links it in `textFrames`.

## `maxMinutesPerVideo` (type: `number`):

Only the first N minutes are read (and billed).

## `maxFramesPerVideo` (type: `integer`):

Safety cap on sampled frames (including skipped ones).

## `maxFileSizeMb` (type: `integer`):

Larger files are skipped (free). Above ~2,000 MB give the run more memory (disk).

## Actor input object example

```json
{
  "videos": [
    "https://upload.wikimedia.org/wikipedia/commons/transcoded/0/06/Sintel_trailer-1080p.ogv/Sintel_trailer-1080p.ogv.480p.vp9.webm"
  ],
  "datasetField": "url",
  "region": "full",
  "languages": [
    "eng"
  ],
  "textColor": "auto",
  "textLayout": "auto",
  "minConfidence": 60,
  "frameIntervalSec": 1,
  "sceneDetection": true,
  "sceneThreshold": 0.3,
  "skipDuplicateFrames": true,
  "upscaleSmallFrames": true,
  "maxFrameWidth": 1280,
  "outputMode": "videos",
  "saveTextFrames": false,
  "maxMinutesPerVideo": 60,
  "maxFramesPerVideo": 3600,
  "maxFileSizeMb": 500
}
```

# Actor output Schema

## `videos` (type: `string`):

No description

## `segments` (type: `string`):

No description

## `files` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "videos": [
        "https://upload.wikimedia.org/wikipedia/commons/transcoded/0/06/Sintel_trailer-1080p.ogv/Sintel_trailer-1080p.ogv.480p.vp9.webm"
    ],
    "languages": [
        "eng"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gazidev/video-ocr").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "videos": ["https://upload.wikimedia.org/wikipedia/commons/transcoded/0/06/Sintel_trailer-1080p.ogv/Sintel_trailer-1080p.ogv.480p.vp9.webm"],
    "languages": ["eng"],
}

# Run the Actor and wait for it to finish
run = client.actor("gazidev/video-ocr").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "videos": [
    "https://upload.wikimedia.org/wikipedia/commons/transcoded/0/06/Sintel_trailer-1080p.ogv/Sintel_trailer-1080p.ogv.480p.vp9.webm"
  ],
  "languages": [
    "eng"
  ]
}' |
apify call gazidev/video-ocr --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gazidev/video-ocr"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/e5wVrEOgSeI9eDhnh/builds/QVyXU638HRi5mH2qU/openapi.json
