# SRT Subtitle Generator: Auto Subtitles for Video & Audio (`fguiraud/srt-subtitle-generator`) Actor

Generate SRT subtitles for any video or audio: ready-to-upload SRT and WebVTT files with broadcast formatting (42 characters per line, 2 lines, max 6 s) and exact word timing, in 99 languages or translated to English. Whisper, no API key. Pay per minute.

- **URL**: https://apify.com/fguiraud/srt-subtitle-generator.md
- **Developed by:** [Fernando Guiraud](https://apify.com/fguiraud) (community)
- **Categories:** Videos, AI, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.00 / 1,000 audio minutes

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

### What does SRT Subtitle Generator do?

**SRT Subtitle Generator** creates **automatic subtitles for any video or audio file**: ready-to-upload **SRT and WebVTT** files in **99 languages**, or **translated to English**. Unlike raw speech-to-text output, the subtitles follow **broadcast formatting rules**: at most **42 characters per line**, **2 lines per subtitle**, **6 seconds on screen**, with breaks at sentence ends and **exact word timing**. They are ready for YouTube, Vimeo, LinkedIn, social media and video editors (Premiere Pro, DaVinci Resolve, Final Cut, CapCut).

It runs **open-source Whisper** on Apify, so there is no OpenAI key and no subscription. You **pay per minute of video**, and files with no speech are free.

It runs on the Apify platform, so you also get an API, scheduling, integrations (Make, Zapier, n8n, Google Drive) and access for **AI agents through the [Apify MCP server](https://mcp.apify.com)**.

![Sample output: real rows from a run of this Actor](https://fernandoguiraud16-coder.github.io/data-tools/assets/outputs/output-srt-subtitle-generator.png)

### Why use it?

- 🎬 **Video creators and agencies**: subtitles for every video in minutes instead of hours of manual typing.
- ♿ **Accessibility**: captions for deaf and hard-of-hearing viewers, and for the many people who watch social video without sound.
- 🌍 **Reach**: translate speech in any language to **English subtitles** with one option.
- 📱 **Vertical video**: set 32-37 characters per line for Reels, Shorts and TikTok.
- 🧩 **Automation**: send new videos from Google Drive or Dropbox and get subtitle files back through the API.

### How to generate SRT subtitles

1. Click **Try for free**.
2. Paste links to your videos or audio files (MP4, MOV, WEBM, MKV, MP3, WAV…). Google Drive, Dropbox and OneDrive share links work too.
3. Choose the **spoken language** (or leave `auto`), and **translate** if you want English subtitles.
4. Click **Start**, then download the `.srt` / `.vtt` files from the links in the results.

### Input

| Field | Description | Default |
|---|---|---|
| `sources` | Video or audio URLs, or share links | required (or `base64Files`) |
| `language` | Spoken language code, or `auto` | `auto` |
| `task` | `transcribe` (original language) or `translate` (English subtitles) | `transcribe` |
| `model` | `base` (recommended), `small` (most accurate) or `tiny` | `base` |
| `subtitleMaxChars` | Characters per line (42 standard; 32-37 for vertical video) | 42 |
| `subtitleMaxLines` | Lines per subtitle | 2 |
| `subtitleMaxDuration` | Maximum seconds per subtitle | 6 |
| `vocabulary` | Names and jargon to spell correctly (brands, people, products) | - |
| `outputs` | `srt`, `vtt`, and optionally `text`, `markdown`, `segments` | srt, vtt |

```json
{
  "sources": [{ "url": "https://example.com/my-video.mp4" }],
  "language": "auto",
  "subtitleMaxChars": 42
}
```

### Output

One record per file, with the subtitles inline and as downloadable files. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

```text
5
00:00:22,320 --> 00:00:26,460
our two countries on the issue of
trade will also be high on our agenda.

6
00:00:27,240 --> 00:00:31,480
As perhaps you've heard, last week
I placed new duties on some Japanese
```

```json
{
  "source": "https://example.com/my-video.mp4",
  "status": "ok",
  "language": "en",
  "durationSeconds": 310.6,
  "transcribedSeconds": 60,
  "billedMinutes": 1,
  "srt": "1\n00:00:07,500 --> 00:00:11,840\nMy fellow Americans, Prime Minister\nNakasoni of Japan, will be visiting me\n…",
  "vtt": "WEBVTT\n\n00:00:07.500 --> 00:00:11.840\n…",
  "files": { "srt": "https://api.apify.com/v2/key-value-stores/…/records/001-my-video.srt" }
}
```

### How much do automatic subtitles cost?

| Event | Price |
|---|---|
| Run start (per GB of memory, default 4 GB) | $0.0005 |
| Minute of video, base or tiny model | **$0.006** ($0.36 per hour) |
| Minute of video, small model | **$0.012** ($0.72 per hour) |

A 10-minute video costs about **$0.06**. Failed files and files without speech are free. Use `maxDurationMinutes` to cap long files.

### How accurate is it? Whisper tiny vs base vs small

We measured the three models ourselves, with the same code this Actor runs:

| Model | Word error rate (lower is better) | Speed on Apify (default 4 GB) | Price per minute |
|---|---|---|---|
| `tiny` | 11.3% | about 20–30× faster than real time | $0.006 |
| `base` (default) | 8.2% | about 11× faster than real time | $0.006 |
| `small` | **5.4%** | about 4× faster than real time | $0.012 |

Word error rate was measured on 73 clean English recordings from the LibriSpeech test set (8.6 minutes of audio). Speed was measured on a 2.6-minute speech recording in Apify runs (tiny: scheduled test runs). Accents, background noise and other languages give higher error rates, so choose `small` for those. A 60-minute video takes about 5–6 minutes with `base` and about 15 minutes with `small`.

### Use it with AI agents (MCP)

Add `https://mcp.apify.com?tools=fguiraud/srt-subtitle-generator` to Claude, Cursor or any MCP client and ask: *"Make English subtitles for this video: https://…/interview.mp4"*.

### Related tools

- Need the **transcript** of a video rather than subtitles? [Video to Text Transcriber](https://apify.com/fguiraud/video-to-text-transcriber).
- **YouTube** videos? [YouTube Transcript Scraper](https://apify.com/fguiraud/youtube-transcript-scraper) returns existing captions in seconds.
- Any audio or video, podcasts and AI summaries: [Audio & Video to Text Transcription](https://apify.com/fguiraud/audio-video-transcriber).

### FAQ and limitations

- **The file must be a direct link** (or a Drive/Dropbox/OneDrive share link). For TikTok, Instagram, X or Facebook links use [Video to Text Transcriber](https://apify.com/fguiraud/video-to-text-transcriber), which also returns SRT. For YouTube, use the YouTube tool above; Vimeo pages are not supported.
- **Speaker names** are not added to subtitles.
- **Accuracy**: `base` is good for clear speech; use `small` for accents, noise or music, and `vocabulary` for names.
- Found a problem or need a feature? Open an issue on the **Issues** tab. Replies within 48 hours. If the Actor saved you time, a quick review helps other creators find it.

# Changelog

This Actor's version history is a separate document: https://apify.com/fguiraud/srt-subtitle-generator/changelog.md

# Actor input Schema

## `sources` (type: `array`):

Direct links to the video or audio to subtitle (MP4, MOV, WEBM, MKV, MP3, WAV...). Google Drive, Dropbox, OneDrive and GitHub share links work too. For TikTok, Instagram, X (Twitter) or Facebook video links use Video to Text Transcriber (fguiraud/video-to-text-transcriber); for YouTube, YouTube Transcript Scraper (fguiraud/youtube-transcript-scraper).

## `base64Files` (type: `array`):

Short media files without a URL, e.g. from an AI agent: \[{"fileName": "memo.m4a", "content": "<base64>"}]. Keep the total input under ~9 MB; use URLs for longer recordings.

## `model` (type: `string`):

'base': good accuracy, fast (recommended). 'small': best accuracy, especially for accents, noisy audio and non-English speech; slower and billed at a higher per-minute price. 'tiny': fastest draft quality.

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

ISO code of the spoken language (en, es, de, fr, pt, it, ja, zh, ...) or 'auto' to detect it. Setting it avoids misdetection on short clips.

## `task` (type: `string`):

'transcribe': text in the spoken language. 'translate': translate the speech to English text.

## `vocabulary` (type: `array`):

Words the speech recognition should favour: people and company names, product names, technical terms (e.g. 'Kubernetes', 'Dr. Nguyen', 'Apify'). Improves spelling of rare words.

## `outputs` (type: `array`):

'text': full transcript split into paragraphs at pauses. 'segments': timestamped segments. 'srt' / 'vtt': ready-to-use subtitle files. 'chunks': ~chunkSize-character passages with start/end times and a token estimate, ready for vector databases. 'markdown': paragraphs prefixed with their start time, e.g. '**\[00:01:23]** ...'.

## `subtitleMaxChars` (type: `integer`):

Maximum characters per subtitle line (42 is the common broadcast and YouTube standard; use 32-37 for vertical/mobile video).

## `subtitleMaxLines` (type: `integer`):

Maximum lines shown at once in each subtitle (when line length is set).

## `subtitleMaxDuration` (type: `number`):

Longest time a single subtitle stays on screen (when line length is set).

## `aiInsights` (type: `boolean`):

Analyse each transcript with Claude: title, summary, key points, chapters with start times, action items and topics (in 'insights'). Requires your Anthropic API key; Claude usage is billed to your Anthropic account, plus one small 'AI insights' event per file.

## `anthropicApiKey` (type: `string`):

Your key from console.anthropic.com. Stored as a secret input; used only to call Claude for this run.

## `insightsModel` (type: `string`):

'claude-opus-5': best quality (default). 'claude-sonnet-5': cheaper, great for meetings and podcasts. 'claude-haiku-4-5': cheapest (transcripts up to ~2 hours).

## `insightsInstructions` (type: `string`):

Optional, e.g. 'Summarise in Spanish', 'Focus on decisions and owners', 'Chapters every ~10 minutes'.

## `saveFiles` (type: `boolean`):

Save the transcript (.txt) and subtitles (.srt / .vtt, if selected in outputs) as files in the run's key-value store; the result includes their download links.

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

Add start/end times for every word inside each segment (for karaoke-style captions or precise search). Slightly slower.

## `chunkSize` (type: `integer`):

Target size of 'RAG chunks'.

## `skipSilence` (type: `boolean`):

Detect speech first and skip silent parts. Faster and reduces hallucinated text in long pauses.

## `maxDurationMinutes` (type: `integer`):

Only the first N minutes of each file are transcribed (and billed).

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

Larger files are skipped (not billed).

## `failOnError` (type: `boolean`):

Mark the run as FAILED when a file cannot be transcribed. Useful for pipelines and monitoring.

## Actor input object example

```json
{
  "sources": [
    {
      "url": "https://upload.wikimedia.org/wikipedia/commons/e/e4/President_Ronald_Reagan%27s_Radio_Address_to_the_Nation_on_Free_and_Fair_Trade_from_Camp_David%2C_Maryland.webm"
    }
  ],
  "model": "base",
  "language": "auto",
  "task": "transcribe",
  "outputs": [
    "srt",
    "vtt"
  ],
  "subtitleMaxChars": 42,
  "subtitleMaxLines": 2,
  "subtitleMaxDuration": 6,
  "aiInsights": false,
  "insightsModel": "claude-opus-5",
  "saveFiles": true,
  "wordTimestamps": false,
  "chunkSize": 1000,
  "skipSilence": true,
  "maxDurationMinutes": 1,
  "maxFileSizeMb": 1000,
  "failOnError": false
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `files` (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 = {
    "sources": [
        {
            "url": "https://upload.wikimedia.org/wikipedia/commons/e/e4/President_Ronald_Reagan%27s_Radio_Address_to_the_Nation_on_Free_and_Fair_Trade_from_Camp_David%2C_Maryland.webm"
        }
    ],
    "outputs": [
        "srt",
        "vtt"
    ],
    "maxDurationMinutes": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("fguiraud/srt-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 = {
    "sources": [{ "url": "https://upload.wikimedia.org/wikipedia/commons/e/e4/President_Ronald_Reagan%27s_Radio_Address_to_the_Nation_on_Free_and_Fair_Trade_from_Camp_David%2C_Maryland.webm" }],
    "outputs": [
        "srt",
        "vtt",
    ],
    "maxDurationMinutes": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("fguiraud/srt-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 '{
  "sources": [
    {
      "url": "https://upload.wikimedia.org/wikipedia/commons/e/e4/President_Ronald_Reagan%27s_Radio_Address_to_the_Nation_on_Free_and_Fair_Trade_from_Camp_David%2C_Maryland.webm"
    }
  ],
  "outputs": [
    "srt",
    "vtt"
  ],
  "maxDurationMinutes": 1
}' |
apify call fguiraud/srt-subtitle-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fguiraud/srt-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/riRrK8fdLTwvvYPFB/builds/gTMoar9o6pLHKj8Vi/openapi.json
