# Subtitle Generator — Audio & Video to SRT/VTT in Any Language (`tidytools/subtitle-generator`) Actor

Generate original and translated SRT/VTT subtitles from audio or video files in one run. Downloadable files and timed transcript; $0.006/audio minute plus $0.002/min per successful translation language. Failures free.

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

## Pricing

from $4.80 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 — Audio & Video to SRT/VTT in Any Language

Generate downloadable original-language and translated SRT/VTT subtitles from spoken audio or video in one run. Paste public MP3/MP4 links or upload files; each successful file returns timed text and subtitle download links. The prefilled French LibriVox sample is 61.3 seconds and bills **2 audio minutes** (USD $0.012 on Free/Bronze) if transcription succeeds; its translation list is empty.

### What it does

This Actor delivers original and requested translated subtitle files for each successful spoken recording. It uses the audio-transcriber engine; translations are separate per language.

### How to use

1. Replace the prefilled URL with a public file or upload a file in Apify Console.
2. Enter up to five target languages, such as es and ja, or leave the list empty for original-language subtitles.
3. Keep SRT and VTT selected, set a maximum cost per run, then start the Actor. Download files from the row links.

### Input example

```json
{
  "urls": ["https://upload.wikimedia.org/wikipedia/commons/d/d0/Fetesgalantes_06_verlaine.mp3"],
  "subtitleLanguages": ["es"],
  "outputFormats": ["srt", "vtt"],
  "saveSubtitles": true
}
```

The example is a [public-domain French poem recording on Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Fetesgalantes_06_verlaine.mp3) (source checked 2026-10-28). Replace it with a recording you may process. Files must download without sign-in. Use **audioFiles** in Apify Console to upload a local recording. **language** may be an ISO code such as fr; omit it for automatic detection. **datasetId** plus optional **datasetField** can read media URLs from another Actor's dataset. **maxMinutesPerFile** and **maxTotalMinutes** set cost limits. **subtitleLanguages** accepts up to five extra languages; an empty list gives original-language subtitles only.

### Output and download links

Open **Subtitle links and transcripts** for the Dataset overview or **Full JSON results** for every engine field. Each input file yields one row. The row's **srtUrl** and **vttUrl** link the original-language files. Each successful member of **translatedSubtitles** has its own **language**, **srtUrl**, and **vttUrl** for that translated language. Click a URL to download its file. The run's **SRT and VTT files** link opens the key-value store file list. The engine returns additional fields in Full JSON.

| Dataset field | Meaning |
|---|---|
| url, success, language | Source link, result status, and spoken language |
| text, segments | Transcript and timed segments |
| srtUrl, vttUrl | Original-language subtitle file links when the format was selected and timing exists |
| translatedSubtitles | Per requested language: success, language, languageName, srtUrl/vttUrl on success, or errorType/error on failure |
| billedMinutes, charged | Started audio minutes and whether a charge was made |
| errorType, error | Reason for a free failed or silent row |

Translated subtitles are created only when a timed transcript is available; a language translation may fail independently. If the audio has no speech, the row has **success:false**, **charged:false**, **errorType:"no_text"** and no subtitle links. Invalid, blocked, missing and other failed files likewise return one free explanation row. **outputFormats** controls original-language SRT/VTT saving; the translation entries have their own SRT/VTT links. This Actor transcribes speech from the audio track, not text displayed in video frames.

### Pricing

This variant uses the [Audio Transcription engine](https://apify.com/tidytools/audio-transcriber) and **the same events and tier prices**. Free/Bronze prices are below; Silver and higher tiers have the engine's volume discounts. An audio minute is a started minute: the 61.3-second sample is 2 units. No start fee.

| Event | Free/Bronze price | When it applies |
|---|---:|---|
| audio-minute | $0.006/min | Successful spoken transcription, normal mode |
| subtitle-language-minute | $0.002/min/language | Each successfully translated language, in addition to audio minutes |
| audio-minute-diarized | $0.015/min | Advanced JSON speakerLabels:true; replaces regular audio-minute |
| ai-summary | $0.01/file | Advanced JSON summarize:true, successful summary |
| content-pack | $0.10/pack | Advanced JSON contentPack:true; only after its separately announced 2026-11-06-or-later activation and successful pack |

The focused form exposes the first two events. Advanced JSON may enable the other engine options. A failed translation adds no translation event; a failed, silent, invalid, blocked, or skipped file adds no audio-minute event and returns **charged:false** with **errorType**. A duplicate URL in the same run gets a separate free row with **errorType:"duplicate"**; its first occurrence is processed once. Set Apify's maximum cost per run before processing many files.

### Limitations

The form is intentionally focused; the engine can accept other input fields through API JSON even when they are hidden here. A public URL must download directly or be a supported public share link. Hosts may later block access; those failures are free. For large files, set **maxMinutesPerFile** and **maxTotalMinutes**. Review generated subtitles before publishing them, especially names and translation choices.

### FAQ

**Can I get both original and translated files in one run?** Yes. Original file URLs are on the row; translations are in translatedSubtitles.

# Actor input Schema

## `urls` (type: `array`):

Direct public MP3, MP4 or other audio/video file URLs that download without signing in; one per line. Replace the example with a file you may process. A spoken file creates a transcript and subtitle files.

## `audioFiles` (type: `array`):

Upload recordings from your computer in Apify Console (they are stored in a key-value store of your account and read from there). Same formats and 2 GB limit as the URLs. In API calls, pass file URLs in "urls" instead.

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

ISO 639-1 code such as en, es, de, ja or zh (names such as English also work). Leave empty to detect automatically. YouTube links are always transcribed in the spoken language; when it differs from this, the row says so in languageNote.

## `subtitleLanguages` (type: `array`):

Optional. Up to five extra languages, one per line (for example es, ja). Original-language SRT/VTT is created in the same run. Each successfully translated language costs $0.002 per started audio minute; failed translations are free. Leave empty to create original-language subtitles only.

## `outputFormats` (type: `array`):

Original-language subtitle files: srt, vtt, or both (default). Enter one format per line. An empty list saves no original-language subtitle file; translated subtitles use their own SRT/VTT links.

## `saveSubtitles` (type: `boolean`):

Save original-language SRT/VTT files for timed transcripts (default on). Translated subtitle links are returned separately when requested.

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

Skip files longer than this. Skipped files get a result row with errorType "too_large" and are not charged. Empty = no limit (0 also means no limit). YouTube videos: empty = 240 minutes (the maximum).

## `maxTotalMinutes` (type: `integer`):

Stop charging for new files once this many audio minutes were transcribed. Files that would go over it get a row with errorType "limit_reached" and are not charged. Empty or 0 = no limit (your Apify spending limit still applies).

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

Optional dataset whose rows contain media URLs. A URL is detected from common fields or the field named in datasetField.

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

Optional field with the media URL in datasetId rows, for example audioUrl or media.url. Leave blank for automatic detection.

## Actor input object example

```json
{
  "urls": [
    "https://upload.wikimedia.org/wikipedia/commons/d/d0/Fetesgalantes_06_verlaine.mp3"
  ],
  "subtitleLanguages": [],
  "outputFormats": [
    "srt",
    "vtt"
  ],
  "saveSubtitles": true
}
```

# Actor output Schema

## `subtitles` (type: `string`):

No description

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

No description

## `full` (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 = {
    "urls": [
        "https://upload.wikimedia.org/wikipedia/commons/d/d0/Fetesgalantes_06_verlaine.mp3"
    ],
    "subtitleLanguages": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("tidytools/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 = {
    "urls": ["https://upload.wikimedia.org/wikipedia/commons/d/d0/Fetesgalantes_06_verlaine.mp3"],
    "subtitleLanguages": [],
}

# Run the Actor and wait for it to finish
run = client.actor("tidytools/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 '{
  "urls": [
    "https://upload.wikimedia.org/wikipedia/commons/d/d0/Fetesgalantes_06_verlaine.mp3"
  ],
  "subtitleLanguages": []
}' |
apify call tidytools/subtitle-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tidytools/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/0aaZAeIHNM7VUJfvN/builds/6EySqtAbxPVwQgx5i/openapi.json
