# Burn Subtitles into Video: Hardcode SRT & VTT Captions (Bulk) (`data-done-right/video-subtitle-burner`) Actor

Burn SRT, VTT or ASS subtitles into videos from direct file URLs: hardcoded captions with font, colour, outline, position and margin options, or a soft mov_text track. ffmpeg + libass, mp4 out, signed links. No YouTube, no auto-captioning. Free when a video fails.

- **URL**: https://apify.com/data-done-right/video-subtitle-burner.md
- **Developed by:** [Data Done Right](https://apify.com/data-done-right) (community)
- **Categories:** Videos, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $40.00 / 1,000 video subtitleds

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

## Burn Subtitles into Video: Hardcode SRT & VTT Captions (Bulk)

This tool will **burn subtitles into video** files: give it direct video URLs and an **SRT, WebVTT or ASS subtitle file** (or paste the text), and it returns a download link for every video with the captions **hardcoded** into the picture, so they show in every player and on every platform. Choose font size, colour, outline or background box, position and margin. Or add the subtitles as a selectable **soft track** instead. It runs ffmpeg with libass in the cloud, so there is nothing to install and no API key.

> **What it does not do.** It **does not create subtitles**: no speech recognition, no translation. You bring the SRT, VTT or ASS file. It reads **direct video files** (mp4, mov, webm, mkv, avi) from a public URL; it **does not download from YouTube, Vimeo, TikTok, Instagram or other streaming sites** and rejects those links without charge. HLS/DASH playlists (.m3u8, .mpd) are not supported. It follows the robots.txt of the host that serves your files. It does not edit, cut or merge video. Use it only on videos you own or have the right to process.

**What you get**

- One dataset row per video: source URL, subtitle format and cue count, mode, measured duration, size, width, height, a signed download link, and a status or a clear error.
- Burned-in captions as H.264 mp4 (audio copied when it is already AAC, otherwise AAC), or a soft `mov_text` track with no re-encode.
- Bad inputs never stop the run, say exactly what is wrong, and are free: a bad subtitle file, a cue list that starts after the video ends, a private or streaming-site link, a file that is not a video.

### How to burn subtitles into a video

1. Put one or more **direct video URLs** in `videoUrls`.
2. Give the subtitles: `subtitleUrl` (link to a .srt, .vtt or .ass file) or `subtitleText` (the SRT or VTT pasted in). They apply to every video in the list.
3. Run it. Open the dataset: every row has a `url` to the subtitled mp4. The `SUMMARY` record lists each video's duration, resolution and notes.

### How to give every video its own subtitle file

Use `videos`: `[{"url": "https://example.com/ep1.mp4", "subtitleUrl": "https://example.com/ep1.en.srt", "name": "episode-1"}, {"url": "https://example.com/ep2.mp4", "subtitleText": "1\n00:00:01,000 --> 00:00:03,000\nHello"}]`. Videos listed there are added to `videoUrls`, and an entry overrides the run-level subtitle. Each distinct subtitle URL is downloaded once per run.

### How to change the look of the captions

Style options apply to **SRT and WebVTT**. Sizes (`fontSize`, `outlineWidth`, `marginBottom`) are in pixels on a **720-pixel-high frame** and scale with the video, so the same setting looks the same on a 720p and a 1080p file.

- `fontColor`, `outlineColor`, `outlineWidth`, `bold`: for example `{"fontColor": "#FFE600", "bold": true}`.
- `backgroundBox`, `boxColor`, `boxOpacity`: a semi-transparent box behind the text instead of an outline.
- `position` (`bottom`, `middle`, `top`) and `marginBottom` (distance from the bottom edge, or the top edge for `top`).
- `<i>`, `<b>` and `<u>` in SRT/VTT text are drawn; other tags are removed. An override tag such as `{\an8}` in an SRT cue is kept, so that cue goes where the tag says.
- An **ASS/SSA file keeps its own styling**: the style options are ignored and the row says so.

### Burn in or soft track

| | `burn` (default) | `soft` |
|---|---|---|
| What happens | the text is drawn into the frames; the video is re-encoded (H.264, `crf` sets quality) | a `mov_text` subtitle track is added to an mp4; picture and audio are copied when the mp4 container allows it |
| Shows everywhere | yes: in any player, on social platforms, in editors | no: players can hide the track and many platforms or editors ignore it |
| Speed and quality | slower, one re-compression generation | very fast, no quality loss |
| Styling | all style options | none (plain text; ASS styling is lost) |
| Language tag | none | `subtitleLanguage`, a 3-letter code such as `eng`, `deu`, `fra` |

If the source streams cannot be copied into an mp4 in soft mode (for example VP8 video from a webm), the video is re-encoded and the row says so.

### Input

| Field | Default | What it does |
|---|---|---|
| `videoUrls` | sample video | Direct video file links (required). |
| `subtitleUrl` | empty | Link to an SRT, WebVTT or ASS/SSA file (max 5 MB). |
| `subtitleText` | sample cues | Inline SRT or WebVTT text. Use this or `subtitleUrl`, not both. |
| `videos` | empty | Per-video subtitles: `[{"url", "subtitleUrl" or "subtitleText", "name"}]`. |
| `mode` | `burn` | `burn` or `soft`. |
| `subtitleLanguage` | `eng` | Language code written to a soft track. |
| `crf` | 23 | Burn-in quality (16 best, 35 smallest). |
| `maxWidth` | 0 | Burn-in: shrink to this width (0 = original, never upscales). |
| `fontName` | `DejaVu Sans` | Font family for SRT/VTT. |
| `fontSize` | 30 | Text height in px on a 720p frame. |
| `fontColor` | `#FFFFFF` | Text colour. |
| `bold` | false | Bold text. |
| `outlineWidth` / `outlineColor` | 2 / `#000000` | Outline around the letters. |
| `backgroundBox` / `boxColor` / `boxOpacity` | false / `#000000` / 60 | Box behind the text. |
| `position` | `bottom` | `bottom`, `middle` or `top`. |
| `marginBottom` | 36 | Distance from the bottom (or top) edge, px on a 720p frame. |
| `maxVideosPerRun` | 50 | Hard cap on videos per run (max 1000). |
| `maxVideoSizeMb` | 500 | Source size cap (max 2048). |
| `maxDurationMinutes` | 60 | Source duration cap. |
| `videoTimeoutSecs` | 900 | Per download and per ffmpeg job. |
| `outputStoreName` | empty | Save the files in a named store that is kept until you delete it. |

Input example:

```json
{
  "videoUrls": ["https://interactive-examples.mdn.mozilla.net/media/cc0-videos/friday.mp4"],
  "subtitleUrl": "https://interactive-examples.mdn.mozilla.net/media/examples/friday.vtt",
  "mode": "burn",
  "fontSize": 34,
  "fontColor": "#FFE600",
  "bold": true,
  "backgroundBox": true,
  "boxOpacity": 55,
  "marginBottom": 90
}
```

### Output

One row per video, from a real local run of the input above:

```json
{
  "sourceUrl": "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/friday.mp4",
  "videoIndex": 1,
  "name": null,
  "subtitleSource": "https://interactive-examples.mdn.mozilla.net/media/examples/friday.vtt",
  "subtitleFormat": "vtt",
  "cues": 5,
  "mode": "burn",
  "durationSeconds": 6.167,
  "width": 640,
  "height": 480,
  "bytes": 460735,
  "url": "https://api.apify.com/v2/key-value-stores/<store>/records/v01-subtitled.mp4",
  "key": "v01-subtitled.mp4",
  "status": "ok",
  "error": null,
  "note": null
}
```

A failure row has `status: "error"`, an `error` that names the problem, and `url: null`, for example `all 3 subtitle cues start after the end of the video (6.2s); the subtitles do not belong to this video or are offset`. On Apify the `url` is a signed link that downloads without a token. `status` is `ok`, `error` or `skipped` (spending limit or `maxVideosPerRun` reached).

### Use with the Apify API, MCP, n8n and Make

Python:

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("data-done-right/video-subtitle-burner").call(run_input={
    "videoUrls": ["https://example.com/talk.mp4"],
    "subtitleUrl": "https://example.com/talk.en.srt",
    "fontSize": 34, "backgroundBox": True})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["status"], row["url"] or row["error"])
```

JavaScript:

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<APIFY_TOKEN>' });
const run = await client.actor('data-done-right/video-subtitle-burner').call({
  videoUrls: ['https://example.com/talk.mp4'], subtitleUrl: 'https://example.com/talk.en.srt', mode: 'soft' });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

In n8n or Make use the Apify node with the actor name and the same JSON. With Apify's MCP server (mcp.apify.com) an AI assistant can call it: "burn this SRT into this mp4". It needs only a video URL and the subtitles.

### Use cases

- Hardcode captions for social video that is watched with the sound off, from SRT files you already have.
- Ship a lecture, webinar or course video with captions that cannot be switched off or lost on upload.
- Add translated subtitles to a batch of videos, one SRT per language and video, with a consistent look.
- Add a soft subtitle track to an mp4 library without re-encoding, tagged with the right language.
- Finish the output of a transcription pipeline: transcript to SRT, then SRT burned into the video.

### How much does it cost

Pay per event: **$0.02 per video delivered** (`video-subtitled`, $20 per 1,000). Failed and skipped videos, rejected links and the `SUMMARY` record are free. Plan discounts apply (Silver about 10%, Gold and higher about 20%).

- 1,000 videos: $20.
- 10,000 videos: $200.
- 100,000 videos: $2,000.

The price is per video whatever its length, size or mode; Apify platform usage is included. `maxVideosPerRun` caps a run, and if you set a maximum spend per run the Actor stops cleanly when it is reached and removes the file it could not charge for. Long or high-resolution burn-ins take longer because they re-encode: a typical 5-second 960x540 clip took about 1 second in a local test, and the default limits are 60 minutes and 500 MB per video.

### FAQ

#### Can it create the subtitles from the audio?

No. It only draws subtitles you provide. It does not transcribe or translate. Use a transcription tool to produce an SRT or VTT file, then pass it here.

#### Which subtitle formats work?

SRT, WebVTT and ASS/SSA text files up to 5 MB, detected from the content, not the file name. UTF-8 (with or without BOM) and UTF-16 with BOM are read directly; other files are read as Windows-1252 and the row notes it. Image-based subtitles (PGS, VobSub) are not supported.

#### Which languages and fonts work?

The image installs DejaVu Sans and Noto Sans from the Debian package archive, which cover Latin, Cyrillic, Greek and many other scripts. It does not include a Chinese, Japanese or Korean font, so those characters can show as empty boxes. A font name that is not installed falls back to a default font.

#### What if my subtitles are out of sync, or are for a different video?

The Actor reads the real video duration. If every cue starts after the end of the video, the video gets an error row and is not charged. If only some cues are past the end, the video is delivered and the row notes how many were not shown. It does not shift timing: fix the offset in the subtitle file first.

#### Why does the result have a different size or bitrate than the source?

Burn-in re-encodes to H.264 with yuv420p and even width and height (an odd side is rounded down by one pixel), keeping the frame rate. Use `crf` and `maxWidth` to trade size for quality. Embedded subtitle and data tracks of the source are dropped; only the first audio track is kept.

#### Which limits apply?

Source files up to 2 GB (default 500 MB) and 60 minutes by default (set `maxDurationMinutes` for more), up to 1,000 videos per run. Links to private or internal addresses are blocked, and the hosts of your files must allow automated fetching in their robots.txt. The whole source file is downloaded once per video.

#### How long are the files kept?

They live in the run's key-value store, which expires with your plan's retention period. Set `outputStoreName` to keep them in a named store until you delete it.

### Related tools

- **Video Frame Extractor: Keyframes, Scenes & Thumbnails for AI** pulls still images from the same videos.
- **Cut Video: Video Trimmer, Clip Cutter & Video to GIF** trims the video before you burn the captions in.
- **Add Watermark to Video: Logo, Text & Image Overlay (Bulk)** puts a logo or text on the same files.
- **Merge Videos: Concatenate, Join & Combine Video Clips** joins clips into one file.
- **Transcribe Audio to Text: Files, Podcasts & Video URLs** turns speech into a transcript to start your subtitles from.

# Actor input Schema

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

Direct links to video files (mp4, mov, webm, mkv, avi). Example: https://example.com/talk.mp4. Every video gets the subtitles given in 'Subtitle file URL' or 'Subtitle text', unless its entry in 'Videos with their own subtitles' says otherwise. YouTube, Vimeo, TikTok and other streaming-page links are rejected, with no charge.

## `subtitleUrl` (type: `string`):

Direct link to an SRT, WebVTT (.vtt) or ASS/SSA subtitle file, used for every video without its own subtitles. Example: https://example.com/talk.en.srt. Use this or 'Subtitle text', not both. Max 5 MB.

## `subtitleText` (type: `string`):

The subtitles pasted as SRT or WebVTT text, used for every video without its own subtitles. Example: 1, then 00:00:01,000 --> 00:00:03,000, then the line of text. Use this or 'Subtitle file URL', not both.

## `videos` (type: `array`):

One subtitle file per video: \[{"url": "https://example.com/a.mp4", "subtitleUrl": "https://example.com/a.srt", "name": "episode-1"}]. Instead of subtitleUrl you can give "subtitleText" with inline SRT. Videos listed here are added to 'Video URLs'; a video in both uses the subtitles given here.

## `mode` (type: `string`):

Burn in re-encodes the video (H.264) and draws the text into the frames, so it shows in every player and platform. Soft track only adds a mov_text subtitle track to an mp4: fast and lossless, but players and platforms can hide or ignore it, and ASS styling is lost.

## `subtitleLanguage` (type: `string`):

Soft track mode only: 3-letter ISO 639-2 language code written to the subtitle track, for example eng, deu, fra, spa.

## `crf` (type: `integer`):

Burn-in re-encode quality. Lower = better quality and bigger files: 18 is near-lossless, 23 is the default, 28 is small.

## `maxWidth` (type: `integer`):

Burn-in only: shrink the video to this width, keeping the aspect ratio, before the subtitles are drawn. 0 = original size. Never upscales. Example: 1280.

## `fontName` (type: `string`):

Font family for SRT and VTT subtitles. The Actor ships DejaVu Sans and Noto Sans (many scripts). A name that is not installed falls back to a default font. Example: Noto Sans.

## `fontSize` (type: `number`):

Text height in pixels on a 720-pixel-high frame; it scales with the video, so 30 looks the same on 720p and 1080p. 30 is a normal caption size, 44 is large.

## `fontColor` (type: `string`):

Hex colour of the text. Example: #FFFF00 for yellow.

## `bold` (type: `boolean`):

Draw the text in bold.

## `outlineWidth` (type: `number`):

Outline thickness around the letters, in pixels on a 720-pixel-high frame. 0 = no outline. Ignored when the background box is on.

## `outlineColor` (type: `string`):

Hex colour of the outline. Example: #000000 for black.

## `backgroundBox` (type: `boolean`):

Draw a filled box behind the text instead of an outline. Good for busy backgrounds.

## `boxColor` (type: `string`):

Hex colour of the background box (only with the box on). Example: #000000.

## `boxOpacity` (type: `integer`):

How solid the box is: 100 = opaque, 0 = invisible. Example: 60.

## `position` (type: `string`):

Where the text sits. Subtitles that carry their own position tag (for example {\an8} in SRT) keep it.

## `marginBottom` (type: `integer`):

Distance from the bottom edge (or the top edge when position is top), in pixels on a 720-pixel-high frame. Raise it to clear a lower third. Example: 60.

## `maxVideosPerRun` (type: `integer`):

Hard cap on videos processed in one run (and so on what you can be charged). Further videos are listed as skipped.

## `maxVideoSizeMb` (type: `integer`):

Source files above this size are rejected before the download finishes, without charge.

## `maxDurationMinutes` (type: `number`):

Longer videos are rejected without charge. Burn-in re-encodes, so long videos take real time. Example: 60 = one hour.

## `videoTimeoutSecs` (type: `integer`):

Applies separately to the download and to the ffmpeg job of each video. Example: 900 = 15 minutes.

## `outputStoreName` (type: `string`):

Optional key-value store name. Named stores are kept until you delete them, while the store of a run expires after your plan's retention period. Example: my-subtitled-videos.

## Actor input object example

```json
{
  "videoUrls": [
    "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"
  ],
  "subtitleText": "1\n00:00:00,500 --> 00:00:02,500\nHello and welcome.\n\n2\n00:00:02,800 --> 00:00:04,800\nSubtitles burned in with ffmpeg and libass.",
  "mode": "burn",
  "subtitleLanguage": "eng",
  "crf": 23,
  "maxWidth": 0,
  "fontName": "DejaVu Sans",
  "fontSize": 30,
  "fontColor": "#FFFFFF",
  "bold": false,
  "outlineWidth": 2,
  "outlineColor": "#000000",
  "backgroundBox": false,
  "boxColor": "#000000",
  "boxOpacity": 60,
  "position": "bottom",
  "marginBottom": 36,
  "maxVideosPerRun": 50,
  "maxVideoSizeMb": 500,
  "maxDurationMinutes": 60,
  "videoTimeoutSecs": 900
}
```

# Actor output Schema

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

One row per video with its download link, size, subtitle format and status, as JSON, CSV, Excel and more.

## `records` (type: `string`):

Key-value store records: the subtitled mp4 files and the run summary.

# 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://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"
    ],
    "subtitleText": `1
00:00:00,500 --> 00:00:02,500
Hello and welcome.

2
00:00:02,800 --> 00:00:04,800
Subtitles burned in with ffmpeg and libass.`
};

// Run the Actor and wait for it to finish
const run = await client.actor("data-done-right/video-subtitle-burner").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://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"],
    "subtitleText": """1
00:00:00,500 --> 00:00:02,500
Hello and welcome.

2
00:00:02,800 --> 00:00:04,800
Subtitles burned in with ffmpeg and libass.""",
}

# Run the Actor and wait for it to finish
run = client.actor("data-done-right/video-subtitle-burner").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://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"
  ],
  "subtitleText": "1\\n00:00:00,500 --> 00:00:02,500\\nHello and welcome.\\n\\n2\\n00:00:02,800 --> 00:00:04,800\\nSubtitles burned in with ffmpeg and libass."
}' |
apify call data-done-right/video-subtitle-burner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,data-done-right/video-subtitle-burner"
        }
    }
}
```

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/0Lma103osX0rPAoEM/builds/cVxcQO7vp4Hr2STds/openapi.json
