# Audio/Video to SRT & VTT Subtitle Files (`960w/video-to-subtitles-srt-vtt`) Actor

Public Mandarin/English video or podcast → downloadable .srt + .vtt (and JSON). Bilibili, TED, Vimeo, direct MP3. YouTube/Douyin NOT supported (fail-fast ≤2min, no charge). Captions-first, local faster-whisper. Same PPE as video-to-transcript.

- **URL**: https://apify.com/960w/video-to-subtitles-srt-vtt.md
- **Developed by:** [TG960 T](https://apify.com/960w) (community)
- **Categories:** AI, Videos
- **Security:** 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 captions transcribeds

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

## Audio/Video to SRT & VTT Subtitle Files

Turn public Chinese (Mandarin) and English videos or podcast audio into **downloadable `.srt` and `.vtt` subtitle files**, plus timestamped JSON segments and plain text. Same hybrid pipeline as `960w/video-to-transcript`: extract existing captions first, then fall back to built-in CPU `faster-whisper` (no external API key).

> **Sibling actor**: Need a transcript-first Dataset for LLM / search indexing? Use [`960w/video-to-transcript`](https://apify.com/960w/video-to-transcript). This Actor is optimized for **subtitle file delivery** (SRT + WebVTT in the Key-Value Store).

***

### 1. What You Get

For each succeeded URL:

- **`.srt` (SubRip)** — Dataset field `srt` + KV key `SRT_###_*.srt`
- **`.vtt` (WebVTT)** — Dataset field `vtt` + KV key `VTT_###_*.vtt`
- Timestamped `segments` and plain `text`
- `source`: `"captions"` or `"whisper"`

Choose formats with input `subtitleFormats`: `["srt","vtt"]` (default), or only one of them.

***

### 2. Supported vs Unsupported

#### Supported (cloud-verified)

| Platform | Example | Path |
| :--- | :--- | :--- |
| **Bilibili public BV** | `https://www.bilibili.com/video/BV...` | captions (rare) or whisper |
| **Direct audio / podcast** | `https://.../*.mp3` / `.m4a` / `.wav` | whisper |
| **TED Talks** | `https://www.ted.com/talks/...` | captions (fast) |
| **Public Vimeo** | `https://vimeo.com/<id>` | captions or whisper |

#### NOT supported (fail-fast ≤ 2 minutes, **no PPE charge**)

| Link type | Behavior |
| :--- | :--- |
| **YouTube** | Immediate `status=failed` with clear reason (no TIMED-OUT hang) |
| **Douyin / TikTok** | Immediate `status=failed` |
| Private / VIP / login / DRM | `failed` or `skipped` with reason |

***

### 3. Input Example

```json
{
  "videoUrls": [
    "https://www.ted.com/talks/matt_cutts_try_something_new_for_30_days",
    "https://archive.org/download/call_to_arms_jl_librivox/calltoarms_06_lu.mp3"
  ],
  "subtitleFormats": ["srt", "vtt"],
  "languageHint": "auto",
  "useWhisperFallback": true,
  "whisperModel": "small",
  "maxDurationMinutes": 60,
  "maxVideos": 20
}
```

***

### 4. Output Example (TED captions → SRT + VTT)

Dataset record (excerpt):

```json
{
  "url": "https://www.ted.com/talks/matt_cutts_try_something_new_for_30_days",
  "title": "Try something new for 30 days",
  "durationSec": 190,
  "source": "captions",
  "language": "en",
  "srtKey": "SRT_001_1183.srt",
  "vttKey": "VTT_001_1183.vtt",
  "status": "succeeded",
  "error": null
}
```

KV Store also contains the raw `.srt` and `.vtt` files ready to download.

***

### 5. Pricing (Pay-Per-Event — same structure as video-to-transcript)

| Event | When charged | Price |
| :--- | :--- | :--- |
| `captions-transcribed` | Succeeded item from existing captions | **$0.002 / video** |
| `whisper-transcribed-minute` | Succeeded Whisper path, per started minute | **$0.025 / minute** |

Failed / skipped / unsupported URLs: **$0** PPE (charged only when `status == "succeeded"`).

***

### 6. FAQ

#### Do I need an OpenAI API key?

No. Whisper runs inside the Actor (`faster-whisper`, CPU int8).

#### Why is YouTube not supported?

Datacenter IPs are blocked by YouTube bot checks. This Actor never uses cookies or paid residential proxies. YouTube URLs fail fast with a clear error and are not charged.

#### SRT vs VTT — which should I pick?

Use **SRT** for most video editors and players. Use **VTT** for HTML5 `<track>` / web players. Default writes both.

#### How is this different from video-to-transcript?

Same engine and pricing events. This Actor emphasizes subtitle **files** (SRT + VTT keys, `subtitleFormats` input). The sibling focuses on transcript Dataset fields for NLP pipelines.

#### SLA

Unsupported links: clear failure within **2 minutes**. Processable items up to **60 minutes** of audio aim to finish within **~10 minutes** wall clock (auto model downshift + ffmpeg truncate for long files).

# Actor input Schema

## `videoUrls` (type: `array`):

Publicly accessible URLs. Supported: Bilibili BV, direct MP3/podcast audio, TED Talks, public Vimeo. NOT supported (fail-fast, no charge): YouTube, Douyin/TikTok share links, private/VIP/login-walled content.

## `subtitleFormats` (type: `array`):

Which subtitle files to write into the Key-Value Store and Dataset fields. Choose srt, vtt, or both.

## `languageHint` (type: `string`):

Preferred ISO language code (e.g. 'zh', 'zh-TW', 'zh-Hans', 'en') or 'auto' for automatic selection/detection.

## `useWhisperFallback` (type: `boolean`):

If true, downloads audio and transcribes locally on CPU with faster-whisper when no subtitles/captions exist.

## `whisperModel` (type: `string`):

faster-whisper model size to run on CPU (int8) when falling back to audio transcription.

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

Maximum allowed duration per item in minutes. Metadata durations above this limit are truncated for Whisper; captioned items may still succeed if captions exist.

## `maxVideos` (type: `integer`):

Maximum number of URLs to process in a single Actor run.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.ted.com/talks/matt_cutts_try_something_new_for_30_days",
    "https://archive.org/download/call_to_arms_jl_librivox/calltoarms_06_lu.mp3"
  ],
  "subtitleFormats": [
    "srt",
    "vtt"
  ],
  "languageHint": "auto",
  "useWhisperFallback": true,
  "whisperModel": "small",
  "maxDurationMinutes": 60,
  "maxVideos": 20
}
```

# Actor output Schema

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

Per-URL records with segments, text, srt, vtt, status.

## `subtitleFiles` (type: `string`):

Standalone .srt and .vtt files (SRT\_###*\*.srt / VTT*###\_\*.vtt).

# 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 = {
    "videoUrls": [
        "https://www.ted.com/talks/matt_cutts_try_something_new_for_30_days",
        "https://archive.org/download/call_to_arms_jl_librivox/calltoarms_06_lu.mp3"
    ],
    "subtitleFormats": [
        "srt",
        "vtt"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("960w/video-to-subtitles-srt-vtt").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 = {
    "videoUrls": [
        "https://www.ted.com/talks/matt_cutts_try_something_new_for_30_days",
        "https://archive.org/download/call_to_arms_jl_librivox/calltoarms_06_lu.mp3",
    ],
    "subtitleFormats": [
        "srt",
        "vtt",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("960w/video-to-subtitles-srt-vtt").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 '{
  "videoUrls": [
    "https://www.ted.com/talks/matt_cutts_try_something_new_for_30_days",
    "https://archive.org/download/call_to_arms_jl_librivox/calltoarms_06_lu.mp3"
  ],
  "subtitleFormats": [
    "srt",
    "vtt"
  ]
}' |
apify call 960w/video-to-subtitles-srt-vtt --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,960w/video-to-subtitles-srt-vtt"
        }
    }
}
```

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/oxdaquedlexccaaqv/builds/cli8Jcr6bHQ5LZNdM/openapi.json
