# Subtitle Generator — AI Captions, SRT, VTT & Burned-In MP4 (`steadyscrape/subtitle-generator`) Actor

AI subtitle generator for your own video and audio files: auto captions as SRT, VTT and ASS files, plus an MP4 with the captions burned in (720p or 1080p, word-by-word highlight for Reels, TikTok and Shorts). 99 languages, readable lines. No API key. Export to JSON, CSV or Excel, or via API.

- **URL**: https://apify.com/steadyscrape/subtitle-generator.md
- **Developed by:** [Steady Scrape](https://apify.com/steadyscrape) (community)
- **Categories:** Videos, AI, Social media
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 subtitle minute, balanced qualities

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

## Subtitle Generator — AI captions as SRT, VTT and ASS files, burned into your MP4

**Subtitle Generator** turns your own video and audio files into **subtitles**: give it a link to the file and get
**SRT, VTT and ASS subtitle files** to download, and, if you want, **an MP4 with the captions burned in**, ready to post
on Reels, Shorts, TikTok, YouTube or LinkedIn. Auto captions in **99 languages**, detected automatically, or translated
to English in the same pass.

**Readable subtitles, not a transcript cut every 30 seconds.** Lines of at most 42 characters (you choose), one or two
lines per subtitle, cut at sentences, commas and the speaker's pauses, never after "the" or "of", shown long enough to
read and never blinking off between two subtitles. Or the **short-form caption look**: two or three big words at a
time, the word being spoken in yellow.

**Whisper runs inside the Actor.** No API key, no third-party subtitle service your video is sent to.

### What you get for each video

- **An SRT file** — the subtitle format every player and every platform (YouTube, Vimeo, Facebook, LinkedIn, Premiere,
  DaVinci Resolve, Final Cut) imports.
- **A VTT (WebVTT) file** — for the `<track>` of an HTML5 video player.
- **An ASS file** — the same subtitles with their style (font, size, colours, position, word highlight), for Aegisub,
  VLC, mpv or your own FFmpeg.
- **A captioned MP4** (optional) — the captions burned into the picture, up to 720p or up to 1080p, vertical videos
  kept vertical, the sound kept as it was.
- **The cues as data** in the row: every subtitle with its start, end and text, and optionally every word's own times.

### Add subtitles to a video: how it works

1. Put the direct link to your file in **Video or audio links** (mp4, mov, webm, mkv, mp3, m4a, wav… a Dropbox, S3,
   Google Cloud Storage or CDN link to the file itself). Up to 1,000 per run.
2. Choose **Captioned MP4**: none (subtitle files only), 720p or 1080p.
3. Choose a **caption style** and a **layout**, or keep the defaults.
4. Run. Each file gives one row with links to its files. The links work for anyone you share them with.

```json
{
    "mediaUrls": ["https://example.com/my-video.mp4"],
    "captionedVideo": "1080p",
    "layout": "shortForm",
    "captionStyle": "highlight",
    "uppercase": true
}
```

### Burn subtitles into a video: three caption styles

| style | looks like | for |
|---|---|---|
| `classic` | white letters with a dark outline, as on TV | interviews, films, courses |
| `boxed` | letters on a dark band | busy or bright pictures |
| `highlight` | big bold words, the one being spoken in colour | Reels, TikTok, Shorts (use the short-form layout) |

The size is chosen for the picture: smaller letters on a vertical video so a line fits across it, larger in a
landscape one. Captions sit at the bottom, centre or top; on a vertical video they stay clear of the app's buttons.
Fonts: Open Sans, Roboto, Lato, Poppins, Anton, Noto Sans and more, with Noto and WenQuanYi drawing Chinese, Japanese,
Korean, Arabic, Hindi and Cyrillic letters.

### SRT generator settings: subtitle layout

| field | default | what it does |
|---|---|---|
| `layout` | `standard` | `standard`: one or two lines per subtitle, as on streaming services. `shortForm`: a few words on one line, changing with the voice. |
| `maxCharsPerLine` | 42 | The longest line (10–80). Chinese, Japanese and Korean characters count as two. |
| `maxLines` | 2 | Lines per subtitle in the standard layout (1–3). A second line only when one is not enough, balanced with the first. |
| `wordsPerCaption` | 3 | Short-form layout: the most words at once (1–8). |
| `maxCueSeconds` | 7 | No subtitle stays on screen longer than this (1–20 s). |
| `minGapMilliseconds` | 80 | The pause between two subtitles; shorter gaps are closed down to it so the text does not blink. |

### All input fields

| field | what it does |
|---|---|
| `mediaUrls` | Direct links to your own video or audio files. A YouTube, TikTok or Instagram page is not a file: it comes back as a free row that says so. |
| `captionedVideo` | `none` (default), `720p` or `1080p`: also return an MP4 with the captions burned in. Never upscaled: a 480p video stays 480p and is charged at the 720p price. |
| `captionStyle` | `classic` (default), `boxed` or `highlight`. |
| `language` | `auto` (default) or a code: `en`, `es`, `de`, `fr`, `pt`, `it`, `nl`, `ja`, `zh`, `ar`, `hi`, `ru`… |
| `translateToEnglish` | English subtitles for a video in any language, in the same pass. Not with `best`. |
| `quality` | `fast` (Whisper base), `balanced` (small, default) or `best` (large-v3-turbo). |
| `maxMinutesPerFile` | Only the first minutes of each file; 0 = the whole file. |
| `wordTimestamps` | Every cue in the row lists its words with their times. The files are the same either way. |
| `font`, `fontSize`, `captionPosition`, `textColor`, `highlightColor`, `uppercase` | The look of the MP4 and the ASS file. Leave `fontSize` empty to get the style's size fitted to the picture, or give 12–300. Colours as `#RRGGBB` or a name (white, yellow, cyan…). |

### Output

One row per link. A row of a subtitled file (cues shortened):

```json
{
    "status": "ok",
    "reason": null,
    "inputUrl": "https://example.com/address.mp4",
    "mediaUrl": "https://example.com/address.mp4",
    "language": "en",
    "durationSeconds": 37.48,
    "billedMinutes": 1,
    "layout": "standard",
    "cueCount": 8,
    "srtUrl": "https://api.apify.com/v2/key-value-stores/aBc123/records/1-address.srt?signature=…",
    "vttUrl": "https://api.apify.com/v2/key-value-stores/aBc123/records/1-address.vtt?signature=…",
    "assUrl": "https://api.apify.com/v2/key-value-stores/aBc123/records/1-address.ass?signature=…",
    "captionedVideo": {
        "url": "https://api.apify.com/v2/key-value-stores/aBc123/records/1-address-captioned.mp4?signature=…",
        "width": 1280,
        "height": 720,
        "durationSeconds": 37.48,
        "fileSizeBytes": 942370,
        "resolution": "720p",
        "billedMinutes": 1
    },
    "captionedVideoReason": null,
    "quality": "balanced",
    "text": "I do not believe that I should devote an hour or a day of my time to any personal partisan causes…",
    "srt": "1\n00:00:00,020 --> 00:00:04,300\nI do not believe that\nI should devote an hour\n\n2\n…",
    "cues": [
        { "index": 1, "start": 0.02, "end": 4.3, "text": "I do not believe that\nI should devote an hour", "words": null },
        { "index": 2, "start": 4.38, "end": 9.44, "text": "or a day of my time to any\npersonal partisan causes", "words": null }
    ]
}
```

| field | meaning |
|---|---|
| `status` | `ok`, or why there are no subtitles: `unreachable`, `not_media`, `too_large`, `no_speech`, `failed`. Only `ok` is charged. |
| `reason` | Why a row has no subtitles, or that an `ok` file was cut short; `null` otherwise. |
| `inputUrl`, `mediaUrl` | The line as you gave it, and the link it was read as (`null` when the line was not a link). |
| `durationSeconds`, `transcribedSeconds` | How long the file's sound is, and how much of it was subtitled. |
| `layout`, `cueCount` | The layout used, and how many subtitles came out. |
| `srtUrl`, `vttUrl`, `assUrl` | Download links of the subtitle files. They open for anyone you share them with. |
| `captionedVideo` | The burned-in MP4: its link, size, length, `resolution` charged (`720p` or `1080p`) and video minutes billed. |
| `captionedVideoReason` | Why a captioned video asked for is missing (an audio file has no picture; a broken video); its subtitles are still delivered and the video is not charged. |
| `language`, `languageProbability` | The language heard, and how sure Whisper was. |
| `translatedToEnglish`, `quality` | Whether the subtitles were translated to English, and the quality used. |
| `truncated` | The file was cut at `maxMinutesPerFile` or at your spending limit. |
| `billedMinutes` | Audio minutes charged for the subtitles. |
| `srt`, `cues` | The subtitles inside the row too, for workflows that read the dataset only. |
| `text`, `wordCount` | The plain transcript. |
| `contentType`, `fileSizeBytes` | What the link sent: its type and size. |
| `processingSeconds`, `transcribedAt` | How long Whisper took, and when the row was written (UTC). |

The run's summary (files per status, audio and video minutes billed) is in the key-value store as `SUMMARY`.

### Cost

Pay per started minute, only for what was delivered:

| event | price |
|---|---|
| Subtitles, `fast`, per audio minute | US$0.008 |
| Subtitles, `balanced` (default), per audio minute | US$0.02 |
| Subtitles, `best`, per audio minute | US$0.04 |
| Captioned MP4 up to 720p, per video minute | US$0.04 |
| Captioned MP4 up to 1080p, per video minute | US$0.08 |

A 3-minute vertical video for TikTok, balanced, captioned at 1080p: 3 × US$0.02 + 3 × US$0.08 = **US$0.30**. A
45-minute lecture, subtitle files only, fast: **US$0.36**. A link that does not answer, a web page, a silent file: a row
that says why, **free**. A video that could not be rendered is not charged; its subtitles are.

Your spending limit is respected to the minute: when it pays for fewer minutes than the next file lasts, that file is
subtitled (and captioned) up to where the limit allows, and the row says `truncated`. With a captioned MP4 each minute
needs both prices. When the limit cannot pay one more minute, the run stops there and its status message says so.

### Use cases

- **Short-form video**: word-by-word captions burned into Reels, TikTok and YouTube Shorts, for viewers who watch
  without sound.
- **YouTube and Vimeo uploads**: an SRT file to upload as the video's captions, in the spoken language or in English.
- **Courses, webinars and interviews**: subtitles for accessibility, WebVTT for your own player.
- **Agencies and editors**: subtitle many client videos in one run, through the API, from Make, Zapier or n8n.
- **Video pipelines**: chain it after an Actor that renders or collects videos; one JSON row per file.

### Limits

- **Your own files, by direct link.** This Actor does not download from YouTube, TikTok, Instagram or other video
  platforms: their pages come back as free `not_media` rows.
- Links to private or local addresses (localhost, 10.x, 192.168.x…) are free `unreachable` rows.
- 2 GB per file. Files are processed one after another; for many long videos, run several runs side by side.
- Whisper can mishear names and rare words; `best` mishears fewer. Music and silence are skipped.
- No speaker labels, no translation to languages other than English.
- The captioned MP4 is H.264 with AAC sound; other audio tracks and embedded subtitle tracks of the original are not
  carried over.

### Is it legal?

The Actor downloads only the files you point it at. Subtitle videos you have the right to process: your own, openly
licensed ones, or ones you have permission for. Speech can be personal data; if you process it, the GDPR and similar
laws apply to you as with any other tool. Whisper is open source (MIT licence, by OpenAI). This Actor is not
affiliated with, endorsed by or connected to OpenAI, YouTube, TikTok, Instagram, Facebook, LinkedIn, Vimeo or any other
platform or editing program named on this page; their names only say where the files can be used. The prefilled example is a clip of *Sintel* (© Blender Foundation, durian.blender.org,
CC BY 3.0).

# Actor input Schema

## `mediaUrls` (type: `array`):

Direct links to your own files: mp4, mov, webm, mkv, m4v, mp3, m4a, wav and anything else FFmpeg reads (a Dropbox, S3, Google Cloud Storage or CDN link to the file itself). A YouTube, TikTok or Instagram page is not a file: it comes back as a free row that says so.

## `captionedVideo` (type: `string`):

Also returns an MP4 with the captions burned into the picture, ready to post on Reels, Shorts, TikTok or LinkedIn. Up to 720p or up to 1080p on the short side (a smaller video is never upscaled; a vertical video stays vertical), charged per started minute of video at its own price. "No" returns the subtitle files only.

## `captionStyle` (type: `string`):

How the captions look in the MP4 and in the ASS file. Classic: white letters with a dark outline, as on TV. Boxed: letters on a dark band, readable on any picture. Highlight: big bold words, the one being spoken in the highlight colour, the short-form video look.

## `layout` (type: `string`):

Standard: subtitles of one or two lines, cut at sentences and pauses, as on TV and streaming. Short-form: a few words at a time on one line, changing with the voice, as on Reels, Shorts and TikTok (pair it with the Highlight style).

## `language` (type: `string`):

"auto" detects it from the first 90 seconds. Give a code (en, es, de, fr, pt, it, nl, ja, zh, ar, hi, ru… any of Whisper's 99) when you know it: it avoids a wrong guess on files that open with music or another language.

## `translateToEnglish` (type: `boolean`):

Whisper writes the subtitles in English instead of the spoken language, in the same pass: English captions for a video in any of its 99 languages. Not available with quality "best".

## `quality` (type: `string`):

fast: Whisper base, about 8× real time per 4 GB of memory, fine for clear speech. balanced: Whisper small, about 2.4×, good in most languages. best: Whisper large-v3-turbo, about 1.2×, the most accurate, for accents, noise and proper names. Each is charged at its own price per audio minute.

## `maxMinutesPerFile` (type: `integer`):

Subtitles only the first minutes of each file; 0 does the whole file. A file cut short says so in its row, its captioned video stops there too, and you pay only for the minutes done.

## `wordTimestamps` (type: `boolean`):

Each cue in the row lists its words with their start and end times, for your own karaoke or animated captions. The files are the same either way.

## `maxCharsPerLine` (type: `integer`):

The longest a line may be. 42 is the broadcast and streaming standard; Chinese, Japanese and Korean characters count as two. A single word longer than a line is never cut.

## `maxLines` (type: `integer`):

Standard layout: how many lines a subtitle may have. A subtitle uses a second line only when one is not enough, and the lines are balanced. Short-form captions are always one line.

## `wordsPerCaption` (type: `integer`):

Short-form layout: the most words shown at once (1 to 3 is the Reels and TikTok look).

## `maxCueSeconds` (type: `integer`):

A subtitle is never shown longer than this; a longer sentence is cut into several.

## `minGapMilliseconds` (type: `integer`):

The pause left between two subtitles, so the eye sees one change into the next. Gaps shorter than half a second are closed down to this, so subtitles do not blink on and off.

## `font` (type: `string`):

"auto" takes the style's font (Open Sans Bold for Classic and Boxed, Poppins ExtraBold for Highlight). Letters a font lacks (Chinese, Japanese, Arabic, Hindi…) are drawn from Noto and WenQuanYi fonts.

## `fontSize` (type: `integer`):

Empty takes the style's size, made smaller when the longest line would not fit across the picture (a vertical video gets smaller letters). Otherwise the height in pixels as on a 1080-pixel short side, whatever the video's size (12 to 300).

## `captionPosition` (type: `string`):

Where the captions sit in the picture.

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

As #RRGGBB (#FFFFFF is white) or a name: white, yellow, cyan…

## `highlightColor` (type: `string`):

Highlight style: the colour of the word being spoken.

## `uppercase` (type: `boolean`):

Writes the burned captions and the ASS file in capitals, a common short-form look. The SRT and VTT keep the spoken casing.

## Actor input object example

```json
{
  "mediaUrls": [
    "https://api.apify.com/v2/key-value-stores/RkSrriT2fTvMveOOb/records/sintel-clip.mp4?signature=DqX7vu3jAYw8EvQE12V1"
  ],
  "captionedVideo": "720p",
  "captionStyle": "classic",
  "layout": "standard",
  "language": "auto",
  "translateToEnglish": false,
  "quality": "balanced",
  "maxMinutesPerFile": 0,
  "wordTimestamps": false,
  "maxCharsPerLine": 42,
  "maxLines": 2,
  "wordsPerCaption": 3,
  "maxCueSeconds": 7,
  "minGapMilliseconds": 80,
  "font": "auto",
  "captionPosition": "bottom",
  "textColor": "#FFFFFF",
  "highlightColor": "#FFD400",
  "uppercase": false
}
```

# Actor output Schema

## `subtitles` (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 = {
    "mediaUrls": [
        "https://api.apify.com/v2/key-value-stores/RkSrriT2fTvMveOOb/records/sintel-clip.mp4?signature=DqX7vu3jAYw8EvQE12V1"
    ],
    "captionedVideo": "720p"
};

// Run the Actor and wait for it to finish
const run = await client.actor("steadyscrape/subtitle-generator").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 = {
    "mediaUrls": ["https://api.apify.com/v2/key-value-stores/RkSrriT2fTvMveOOb/records/sintel-clip.mp4?signature=DqX7vu3jAYw8EvQE12V1"],
    "captionedVideo": "720p",
}

# Run the Actor and wait for it to finish
run = client.actor("steadyscrape/subtitle-generator").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 '{
  "mediaUrls": [
    "https://api.apify.com/v2/key-value-stores/RkSrriT2fTvMveOOb/records/sintel-clip.mp4?signature=DqX7vu3jAYw8EvQE12V1"
  ],
  "captionedVideo": "720p"
}' |
apify call steadyscrape/subtitle-generator --silent --output-dataset

```

## MCP server setup

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

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/rUvyHOk11OGqoyajh/builds/d5tR12Ii2CEoqlrFk/openapi.json
