# Audio & Video Transcription (offline Whisper) (`wrentools/audio-video-transcription`) Actor

Transcribes audio and video files to text with timestamps and SRT/VTT subtitles, offline with OpenAI Whisper inside the Actor: no third-party API. 100 languages, auto-detected, or translation to English. Respects robots.txt. Failed files are free.

- **URL**: https://apify.com/wrentools/audio-video-transcription.md
- **Developed by:** [WrenTools](https://apify.com/wrentools) (community)
- **Categories:** AI, Videos
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 audio minute 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 Transcription (offline Whisper)

Turn recordings into text: interviews, meetings, lectures, voice notes, podcast episodes you have as files, and the
sound track of videos. Give it links to audio or video files, or send files inline as base64, and get back for each
one: the full text, timed segments, the detected language, and SubRip (`.srt`) and WebVTT (`.vtt`) subtitle files.

Everything runs inside the Actor with OpenAI's [Whisper](https://github.com/openai/whisper) speech model (`base`, via
[faster-whisper](https://github.com/SYSTRAN/faster-whisper)). Your files are not sent to any third-party API.

**See it run:** a [90-second video](https://youtu.be/QKpCpwUyqCQ) shows this page, a sample clip with the subtitles
one real run returned, and a [Python example](https://github.com/WrenTools/apify-actor-examples/tree/main/transcribe-audio-to-text-and-subtitles)
that calls the Actor from your own code. We made the video; its narration is a synthetic voice.

**Podcasts:** a [second example](https://github.com/WrenTools/apify-actor-examples/tree/main/podcast-episodes-to-searchable-transcripts) reads a podcast's RSS feed with our
[RSS Feed Reader](https://apify.com/wrentools/rss-feed-reader), transcribes only the episodes it has not done yet,
and searches every transcript for the minute something was said.

### What you get

- **Text** of each file, and **segments** with start and end times in seconds (`includeSegments`, on by default).
- **Word timestamps** (`wordTimestamps`): each word's start, end and probability, for karaoke-style captions or
  search.
- **Subtitles**: `.srt` and `.vtt` files saved in the run's key-value store, linked from each item (`subtitles`), or
  embedded in the item too (`subtitlesInItem`).
- **100 languages**, detected automatically (`language` and `languageProbability`) or set by you; or **translation**
  of the speech to English text (`task: translate`).
- **Audio and video files**: MP3, M4A/AAC, MP4, MOV, 3GP, WAV, FLAC, ALAC, OGG/Vorbis, Opus, WebM, MKV, WMA/ASF, AVI,
  FLV, MPEG-TS, AIFF, CAF, AMR, AC-3/E-AC-3, DTS, WavPack, APE and more. Only the first audio track is used; video
  pictures are never decoded.
- **Silence and music skipped** before transcription (`vadFilter`, on by default, Silero VAD), which cuts made-up text
  in long pauses. Timestamps still refer to the original file.
- Long files are transcribed in 10-minute pieces split at a pause, so memory stays flat; the language found in the
  first piece is kept for the rest.

Failed files are reported in the dataset with a reason and are **not charged**: `fetch-failed`, `file-too-large`,
`robots-disallowed`, `unsupported-file`, `no-audio-track`, `unsupported-codec`, `undecodable-audio`, `invalid-base64`,
`time-limit`.

### Respectful by design

- **Only the files you name are downloaded**, one request each. The site's robots.txt is read first and obeyed, and
  downloads from one site are spaced (500 ms by default). No proxy, no browser, no login.
- Only public internet addresses are fetched: a URL or redirect into a private, loopback or link-local network is
  refused.
- Links must point to the media file itself. Pages on video platforms (YouTube, TikTok, Instagram) are not files, and
  this Actor does not extract media from them.

### Use it responsibly

From the [Whisper model card](https://github.com/openai/whisper/blob/main/model-card.md):

- **Consent.** Transcribe only recordings you have the right to process. OpenAI cautions "against using Whisper models
  to transcribe recordings of individuals taken without their consent".
- **Made-up text.** The model can output text that was never spoken ("hallucination"), most often in silence, music
  or noise, and can repeat itself. Check transcripts that matter against the audio.
- **Not for high-risk decisions.** Do not use the output on its own for decisions about people (legal, medical,
  employment, credit and the like). OpenAI recommends "against use in high-risk domains like decision-making
  contexts".
- **Accuracy varies** by language, accent, recording quality and background noise. `base` is a small, fast model: it
  is good on clear speech in widely spoken languages and weaker on others. Translation to English is rougher than
  transcription.

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `fileUrls` | string\[] | | links to audio or video files |
| `filesBase64` | array | | base64 strings, or `{"name": "call.mp3", "data": "<base64>"}`; a `data:` prefix is fine |
| `language` | string | `auto` | `auto`, or a Whisper language code such as `en`, `de`, `es`, `ja` |
| `task` | string | `transcribe` | `transcribe`, or `translate` (speech in any language to English text) |
| `includeSegments` | boolean | `true` | timed segments |
| `wordTimestamps` | boolean | `false` | word start, end and probability (about 10-20% slower) |
| `subtitleFormats` | string\[] | `["srt", "vtt"]` | subtitle files to write; `[]` for none |
| `subtitlesInItem` | boolean | `false` | also put the subtitle text in the item |
| `vadFilter` | boolean | `true` | skip silence and music before transcribing |
| `maxMinutesPerFile` | integer | `120` | 1 to 480; longer files are marked `truncated` |
| `maxFileSizeMb` | integer | `200` | 1 to 500; larger downloads stop, uncharged |
| `requestDelayMs` | integer | `500` | pause between downloads from one site |

Give `fileUrls`, `filesBase64` or both. Results come back in input order. Apify limits the whole input to a few MB,
so send larger files as links. The default run memory is 1 GB, which suits files up to about 300 MB; give larger files
2 GB or more.

### Output

One dataset item per file (this is the Store example, a 24-second spoken notice):

```json
{
  "source": "https://example.com/audio/speech-sample.mp3",
  "url": "https://example.com/audio/speech-sample.mp3",
  "finalUrl": "https://example.com/audio/speech-sample.mp3",
  "fileName": "speech-sample.mp3",
  "status": "ok",
  "error": null,
  "container": "mp3",
  "audioCodec": "mp3float",
  "hasVideo": false,
  "durationSeconds": 24.005,
  "transcribedSeconds": 24.005,
  "speechSeconds": 24.005,
  "billedMinutes": 1,
  "truncated": false,
  "language": "en",
  "languageProbability": 0.998,
  "languageDetected": true,
  "task": "transcribe",
  "model": "base",
  "segmentCount": 6,
  "charCount": 343,
  "wordCount": 59,
  "text": "This is a short sample recording for the transcription actor. The Riverside Community Garden will hold its spring planting day on Saturday, 12th of April, from 9 in the morning until noon. Please bring gloves, a trowel, and a bottle of water. ...",
  "segments": [
    {"id": 0, "start": 0, "end": 4, "text": "This is a short sample recording for the transcription actor."},
    {"id": 1, "start": 4, "end": 8.4, "text": "The Riverside Community Garden will hold its spring planting day on Saturday,"}
  ],
  "subtitles": {
    "srt": "https://api.apify.com/v2/key-value-stores/<store>/records/file-1.srt?signature=...",
    "vtt": "https://api.apify.com/v2/key-value-stores/<store>/records/file-1.vtt?signature=..."
  }
}
```

A failed file has `"status": "error"` and `"error": {"code": "no-audio-track", "message": "..."}`. A truncated file
has `"truncated": true` and a `truncatedReason`: `maxMinutesPerFile`, `the run's maximum charge` or `the run's time
limit`. If a result is too large for one dataset item (over 8 MB), its text and segments are stored in the run's
key-value store, and the item carries `fullOutputKey` and `fullOutputUrl`. The run's `SUMMARY` record counts files
transcribed and failed, audio seconds and minutes billed.

### Pricing

Pay per event, no start fee, and nothing for files that fail:

| Event | Price | Per 1,000 |
|---|---|---|
| `audio-minute` (one started minute of a file's audio, transcribed) | $0.01 | $10.00 |

Each file is billed by its started minutes of audio, at least 1 minute per file: a 30-second voice note costs $0.01,
a 4 minute 10 second clip costs $0.05, and a one-hour meeting costs $0.60. Only the audio actually transcribed is
billed. When you set a maximum charge for a run, the Actor stops before a file it cannot pay for, and transcribes only
the minutes the remainder covers (the item is marked `truncated`).

### Limits

- Speed: about 2 minutes of audio per minute of run time at the default 1 GB of memory, on clear speech. Noisy
  audio is slower. If the run's timeout comes first, the Actor stops a minute early, saves what it transcribed (marked
  `truncated`) and bills only that; give long files a longer run timeout.
- There is no speaker labelling (diarization): the text does not say who spoke.
- `base` trades accuracy for speed and price. Names, rare words and numbers can be misheard; numbers are usually
  written as digits.

### Licences

The speech model and libraries are open source: Whisper's code and weights and faster-whisper are MIT, CTranslate2 is
MIT (it includes Intel oneMKL under the Intel Simplified Software License), PyAV is BSD-3-Clause, and this software
uses libraries from the FFmpeg project under the LGPLv2.1, built LGPL-only and audio-only from FFmpeg's release
source. The full list, with licence texts and sources, is in the Actor's `THIRD_PARTY_NOTICES` file.

# Actor input Schema

## `fileUrls` (type: `array`):

Links to audio or video files you are allowed to process (MP3, M4A, MP4, MOV, WAV, FLAC, OGG, Opus, WebM, MKV, AAC, WMA, AVI and more). Each file is downloaded once; the site's robots.txt is respected. Links to web pages (YouTube, podcasts' pages) are not files and fail.

## `filesBase64` (type: `array`):

Files sent inline, for files that are not online: a list of base64 strings, or of objects {"name": "call.mp3", "data": "<base64>"}. A data: URL prefix is accepted. Apify limits the whole input to a few MB, so use links for larger files.

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

The language spoken in the files, or 'Detect automatically' (detected once per file, from its first minutes). Naming it avoids a wrong guess on short or noisy files.

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

Transcribe keeps the spoken language. Translate writes English text from speech in any language (rougher than transcription).

## `includeSegments` (type: `boolean`):

Add a 'segments' list: each phrase with its start and end time in seconds.

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

Add each word with its start, end and probability to the segments (slower, about 10-20% more time).

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

Subtitle files written to the run's key-value store for each file; the item links to them. Leave empty for none.

## `subtitlesInItem` (type: `boolean`):

Also put the subtitle text itself in each item (fields 'srt' and 'vtt').

## `vadFilter` (type: `boolean`):

Removes stretches without speech before transcribing (Silero VAD). This reduces made-up text in silences. Timestamps still refer to the original file.

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

Transcribe at most this many minutes of each file; longer files are marked truncated and charged only for what was transcribed.

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

Larger downloads are stopped and reported as file-too-large, without charge. Files over 300 MB need a run memory of 2 GB or more.

## `requestDelayMs` (type: `integer`):

Minimum pause between two downloads from the same site.

## Actor input object example

```json
{
  "fileUrls": [
    "https://api.apify.com/v2/key-value-stores/uM2zEXblvgf0s1cES/records/speech-sample.mp3"
  ],
  "language": "auto",
  "task": "transcribe",
  "includeSegments": true,
  "wordTimestamps": false,
  "subtitleFormats": [
    "srt",
    "vtt"
  ],
  "subtitlesInItem": false,
  "vadFilter": true,
  "maxMinutesPerFile": 120,
  "maxFileSizeMb": 200,
  "requestDelayMs": 500
}
```

# Actor output Schema

## `results` (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 = {
    "fileUrls": [
        "https://api.apify.com/v2/key-value-stores/uM2zEXblvgf0s1cES/records/speech-sample.mp3"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("wrentools/audio-video-transcription").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 = { "fileUrls": ["https://api.apify.com/v2/key-value-stores/uM2zEXblvgf0s1cES/records/speech-sample.mp3"] }

# Run the Actor and wait for it to finish
run = client.actor("wrentools/audio-video-transcription").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 '{
  "fileUrls": [
    "https://api.apify.com/v2/key-value-stores/uM2zEXblvgf0s1cES/records/speech-sample.mp3"
  ]
}' |
apify call wrentools/audio-video-transcription --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,wrentools/audio-video-transcription"
        }
    }
}
```

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/Qt6g4DsCYbdDu1iKA/builds/FIiRIZTjHlXr8Fucf/openapi.json
