# Subtitle Generator (SRT and VTT from audio or video) (`psypherz/subtitle-generator`) Actor

Create timed SRT and WebVTT subtitles from audio and video files, with readable line lengths. 90+ languages, optional English translation. Open-source Whisper.

- **URL**: https://apify.com/psypherz/subtitle-generator.md
- **Developed by:** [Muhammad Yasin Bin Abdul Rahman](https://apify.com/psypherz) (community)
- **Categories:** Videos, For creators
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $7.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

## Subtitle Generator (SRT and VTT from audio or video)

Make ready-to-use subtitle files from audio and video. You get timed SRT and WebVTT files with readable line lengths, split at natural pauses and sentence ends. Paste direct file links or upload a file. 90+ languages are detected for you, and you can translate the speech into English subtitles. It runs on open-source Whisper with word-level timing, so you need no API key.

**Price: US$0.007 per audio minute, plus a US$0.001 run fee.** A 10-minute video costs US$0.071.

### What people use it for

- **Video creators:** captions for YouTube, TikTok, Reels and LinkedIn uploads. Captioned videos keep viewers watching with the sound off.
- **Course and webinar platforms:** WebVTT tracks for HTML5 video players.
- **Translation workflows:** English subtitles from foreign-language video, or a timed source file for translators.
- **Accessibility compliance:** captions for training and public-sector video.
- **Editors:** import SRT straight into Premiere Pro, DaVinci Resolve, Final Cut or CapCut.

### Example output

Real output from the sample file (117 seconds of speech, 27 subtitles):

```
1
00:00:00,000 --> 00:00:02,120
Chajno is small city in Poland.

2
00:00:02,800 --> 00:00:07,560
As of the year 2000, 14,900 people live in
the city.

3
00:00:08,080 --> 00:00:09,900
The city is on the river Scora.
```

Dataset item (subtitle text shortened):

| fileName | durationSec | language | cueCount | srtUrl | vttUrl |
|---|---|---|---|---|---|
| Wikipedia\_-*Chojnów*(spoken_by_AI_voice).mp3 | 117.0 | en | 27 | link to .srt | link to .vtt |

```json
{
  "sourceUrl": "https://upload.wikimedia.org/wikipedia/commons/2/2a/Wikipedia_-_Chojn%C3%B3w_%28spoken_by_AI_voice%29.mp3",
  "fileName": "Wikipedia_-_Chojnów_(spoken_by_AI_voice).mp3",
  "durationSec": 117.0,
  "billedMinutes": 2,
  "language": "en",
  "model": "base",
  "cueCount": 27,
  "srt": "1\n00:00:00,000 --> 00:00:02,120\nChajno is small city in Poland.\n\n...",
  "srtUrl": "https://api.apify.com/v2/key-value-stores/.../records/001-Wikipedia_-_Chojnów_(spoken_by_AI_voice).srt",
  "vtt": "WEBVTT\n\n00:00:00.000 --> 00:00:02.120\nChajno is small city in Poland.\n\n...",
  "vttUrl": "https://api.apify.com/v2/key-value-stores/.../records/001-Wikipedia_-_Chojnów_(spoken_by_AI_voice).vtt",
  "createdAt": "2026-10-27T09:00:00+00:00"
}
```

Each file is also saved in the run's key-value store, ready to download.

### Input

| Field | What it does | Default |
|---|---|---|
| `mediaUrls` | Direct links to audio or video files, up to 100. 1 GB per file. | 1 sample file |
| `uploadedFile` | Or upload one file from your computer. | none |
| `formats` | `srt`, `vtt`, or both. | both |
| `maxCharsPerLine` | 16 to 80. 42 is the common broadcast guideline. Use about 32 for vertical video. | `42` |
| `maxLinesPerCue` | 1 to 3. Use 1 for short-form vertical video. | `2` |
| `maxCueSeconds` | Longest time one subtitle stays on screen, 1 to 15 seconds. | `6` |
| `model` | `tiny` (fast), `base` (balanced) or `small` (accurate). | `base` |
| `language` | `auto` or a code such as `en`, `es`, `de`. | `auto` |
| `task` | `transcribe` keeps the spoken language. `translate` makes English subtitles. | `transcribe` |
| `skipSilence` | Skip silence and music-only parts. | `true` |
| `maxMinutesPerFile` | Longer files are skipped without charge. | `180` |

### Pricing

| Event | Price |
|---|---|
| Run fee, once per run (per 2 GB of memory; the default is 2 GB) | US$0.001 |
| Audio minute, fast or balanced model | US$0.007 |
| Audio minute, accurate model | US$0.013 |

Examples: a 1-minute clip costs US$0.008. A 10-minute video costs US$0.071. A 60-minute talk on the accurate model costs US$0.781. Failed files are not charged.

### Limits

- Direct file links only. Links to YouTube, TikTok, Instagram, Facebook, X, Vimeo and similar pages are refused. Only process files you have the right to use.
- 100 files per run, 1 GB and 600 minutes per file.
- No speaker labels, and no styling (colours, positions).

### FAQ

**Will the timing match my video?** Yes. Timing comes from the audio track itself, word by word.

**Can I make subtitles in other languages?** You get subtitles in the spoken language, or in English with `translate`. Other target languages are not supported.

**Is my file stored?** It is processed on the run's temporary disk and deleted. The subtitles are saved in your own Apify storage.

**Can an AI agent call it?** Yes. Pass file links, get the subtitle text and download links back as JSON.

### More tools from the same developer

Same style: clean JSON output, pay only for results, no charge on failed items.

| Tool | What it does |
|---|---|
| [Bulk Keyword Search Volume](https://apify.com/PsypherZ/keyword-search-volume) | Google Ads search volume, CPC, competition and 12-month trend for up to 10,000 keywords |
| [Google Trends API](https://apify.com/PsypherZ/google-trends-api) | Interest over time, by region, and rising queries and topics for up to 500 keywords |
| [Google SERP Results](https://apify.com/PsypherZ/google-serp-results) | Organic results, featured snippets and People Also Ask for any keyword, country and device |
| [Google AI Overview Tracker](https://apify.com/PsypherZ/google-ai-overview-tracker) | Which keywords show an AI Overview, what it says, and whether it cites your site |
| [Audio and Video Transcriber](https://apify.com/PsypherZ/audio-video-transcriber) | Timestamped transcripts from audio and video files in 90+ languages |
| [Podcast Transcriber](https://apify.com/PsypherZ/podcast-transcriber) | Timestamped transcripts of podcast episodes from any RSS feed or Apple Podcasts link |
| [Image OCR](https://apify.com/PsypherZ/image-ocr) | Text from images in 20 languages, with confidence scores |
| [PDF to Text and Markdown](https://apify.com/PsypherZ/pdf-to-text-markdown) | Clean text and Markdown from PDFs, with OCR for scanned pages |
| [Bulk PageSpeed Insights Audit](https://apify.com/PsypherZ/bulk-pagespeed-audit) | Core Web Vitals and Lighthouse scores for many pages, mobile and desktop |

# Actor input Schema

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

Direct links to audio or video files (MP3, WAV, M4A, OGG, FLAC, MP4, MOV, WEBM, MKV and more). Up to 100 per run, 1 GB each. Links to YouTube, TikTok, Instagram and other social or streaming pages are not accepted.

## `uploadedFile` (type: `string`):

Upload one audio or video file from your computer.

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

Larger models are more accurate, especially for accents and noisy audio, but slower. The accurate model has a higher price per minute because it needs about 3 times the compute.

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

"auto" detects it. Or set a code such as en, es, de, fr, ja, hi, ar for better accuracy.

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

Keep the original language, or translate the speech into English.

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

Removes long silent or music-only parts before transcribing. Faster and fewer made-up words.

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

Files longer than this are skipped without charge. A safety limit on cost.

## `formats` (type: `array`):

SRT works in most video editors and players. WebVTT is for web video players.

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

42 is the common broadcast guideline. Use about 32 for vertical video.

## `maxLinesPerCue` (type: `integer`):

Use 1 for short-form vertical video.

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

Long subtitles are split so viewers can keep up.

## Actor input object example

```json
{
  "mediaUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/2/2a/Wikipedia_-_Chojn%C3%B3w_%28spoken_by_AI_voice%29.mp3"
  ],
  "model": "base",
  "language": "auto",
  "task": "transcribe",
  "skipSilence": true,
  "maxMinutesPerFile": 180,
  "formats": [
    "srt",
    "vtt"
  ],
  "maxCharsPerLine": 42,
  "maxLinesPerCue": 2,
  "maxCueSeconds": 6
}
```

# Actor output Schema

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

One row per file: language, duration, cue count and links to the SRT and VTT files.

# 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://upload.wikimedia.org/wikipedia/commons/2/2a/Wikipedia_-_Chojn%C3%B3w_%28spoken_by_AI_voice%29.mp3"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("psypherz/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://upload.wikimedia.org/wikipedia/commons/2/2a/Wikipedia_-_Chojn%C3%B3w_%28spoken_by_AI_voice%29.mp3"] }

# Run the Actor and wait for it to finish
run = client.actor("psypherz/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://upload.wikimedia.org/wikipedia/commons/2/2a/Wikipedia_-_Chojn%C3%B3w_%28spoken_by_AI_voice%29.mp3"
  ]
}' |
apify call psypherz/subtitle-generator --silent --output-dataset

```

## MCP server setup

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