# Video Thumbnail Generator – Best Frames, YouTube Size & VTT (`gazidev/video-thumbnail-generator`) Actor

Generate thumbnails from your video files: candidate frames are scored for sharpness, exposure and variety, black and blurry ones are skipped, and the best N come back as JPG, WebP or PNG in YouTube 1280×720, square or 9:16 size, with optional title text. VTT sprites for players. $3 per 1,000.

- **URL**: https://apify.com/gazidev/video-thumbnail-generator.md
- **Developed by:** [Cemal Atakli](https://apify.com/gazidev) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 thumbnails

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

## Video Thumbnail Generator – Best Frames, YouTube Size & VTT

Give it a **video file URL** and get back the **best thumbnails** for it, ready to upload. The Actor looks at 24 candidate frames across the video, **scores each one for sharpness, exposure and colour**, drops black, washed-out and near-duplicate frames, and returns the top N **cropped to YouTube 1280×720, square 1080×1080 or vertical 1080×1920** as JPG, WebP or PNG. You can add a **title text overlay**. It can also build a **WebVTT sprite storyboard** (`thumbnails.vtt` + one tiled JPG) for seek-bar previews in your video player.

- **$3 per 1,000 thumbnails** ($0.003 each). Scoring is included: the candidates it scans but does not pick are free. A sprite storyboard costs $0.005 per video.
- **No frame picking by hand.** You don't have to guess timestamps: you get a ranked list, with the score and the signals behind it.
- **Ready-sized:** cover-crop or "contain" on a blurred background, so a 16:9 video still makes a clean 9:16 Shorts/Reels cover.
- **Fast on long videos:** it seeks straight to each candidate with HTTP range requests, so the file is never fully downloaded.

> Need **raw frames** instead, like one every N seconds, exact timestamps, scene changes, keyframes or a contact sheet? Use our [Video Frame Extractor](https://apify.com/gazidev/video-frame-extractor) ($1 per 1,000 frames). This Actor is for when you want the **few best images**, finished as thumbnails.

### What can I use it for?

- **Poster images for every upload** in a video CMS, LMS, course platform or e-commerce product video.
- **YouTube, podcast and course thumbnails:** get 3–5 strong candidates with your episode title on them, and pick one or A/B test them.
- **Shorts, Reels and TikTok covers** (1080×1920) from landscape footage.
- **Player seek-bar previews:** a WebVTT thumbnail track for Video.js, Plyr, JW Player, Shaka, hls.js and Vidstack.
- **Automation:** Make, Zapier, n8n or the API. Add a new video file and the best thumbnail URL comes back.

Video-platform pages (YouTube, TikTok, Instagram, Vimeo…) are deliberately **not supported**. Use direct links to files you own or are allowed to process: your CDN, an S3/R2/GCS bucket, Dropbox direct links or stock footage.

### How the best frame is chosen

1. `candidates` (default 24) evenly spaced frames are taken between 5% and 95% of the video, or of your `startTime`–`endTime` range, so intros and outros are skipped. Each is decoded at 480 px.
2. **Rejected (free):** near-black frames (mean luma < 18), white flashes (> 242) and flat frames (almost no contrast).
3. **Score (0–100)** = √sharpness × (0.3 + 0.7 × colourfulness) × exposure × dark-area penalty.
   - *Sharpness* is the variance of an edge filter, so blurry and motion-blurred frames score low.
   - *Colourfulness* is the Hasler–Süsstrunk metric.
   - *Exposure* penalises a mean brightness outside 40–215.
   - The *dark-area penalty* lowers frames that are mostly near-black, such as end credits, title cards and night shots.
   - Sharpness and colourfulness are normalised per video, so the best candidate is 100.
4. **Variety:** a candidate is skipped if its 64-bit perceptual hash (dHash) is within 10 bits of a better pick, or if it is closer than `duration / (2 × count)` to one. If that leaves too few frames, the rules are relaxed step by step.
5. The chosen frames are re-extracted at **full resolution**, cropped or padded to the preset, the title is drawn, and they are saved in order of score.

The method is a heuristic: it finds sharp, colourful and well-exposed frames that differ from each other. It does not detect faces or "interesting" moments. That's why you can ask for up to 20 ranked thumbnails and pick one yourself.

### Input

| Field | Description |
|---|---|
| `videoUrls`, `bulkText`, `datasetId` + `datasetField` | Direct video file links (MP4, MOV, WebM, MKV, AVI, M4V, TS, HLS `.m3u8`) |
| `thumbnailCount` | Thumbnails per video, 1–20 (default 3) |
| `candidates` | Frames scored per video, 8–100 (default 24) |
| `preset` | `youtube-1280x720` (default), `square-1080`, `vertical-1080x1920`, `original`, `custom` (+ `width`, `height`) |
| `fit` | `cover` (crop to fill) or `contain` (whole frame on a blurred background) |
| `imageFormat`, `quality` | `jpg` / `webp` / `png`, quality 88 |
| `titleText`, `titlePosition` | Optional overlay text: bottom, top or center (bold, outlined, on a gradient band) |
| `spriteSheet`, `spriteIntervalSec`, `spriteTileWidth`, `maxSpriteMinutes` | WebVTT storyboard: one tile every 10 s, 160 px tiles, up to 60 minutes |
| `startTime`, `endTime` | Only search part of the video (`90`, `00:01:30`) |
| `maxDurationMinutes`, `maxConcurrency`, `proxyConfiguration` | Safety limit (240 min), videos in parallel (2), optional proxy for hosts that block datacenter IPs |

```json
{
  "videoUrls": ["https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4"],
  "thumbnailCount": 3,
  "preset": "youtube-1280x720",
  "titleText": "Big Buck Bunny – full short film",
  "spriteSheet": true
}
```

### Output

One row per thumbnail (charged) and one free summary row per video. The Output tab shows **Thumbnails** (with previews) and **Videos, sprites & VTT**.

Thumbnail row:

```json
{
  "type": "thumbnail",
  "videoUrl": "https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4",
  "rank": 1,
  "timestamp": 242.32,
  "timecode": "00:04:02.320",
  "score": 58.8,
  "sharpness": 45.7,
  "brightness": 123.5,
  "colorfulness": 81.3,
  "imageUrl": "https://api.apify.com/v2/key-value-stores/<store>/records/v000-thumb-01.jpg",
  "width": 1280, "height": 720, "format": "jpg", "bytes": 148817,
  "preset": "youtube-1280x720", "fit": "cover", "upscaled": true, "titleText": null
}
```

Video row:

```json
{
  "type": "video",
  "videoUrl": "https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4",
  "status": "ok",
  "durationSec": 596.48, "width": 640, "height": 360, "codec": "h264", "fps": 24,
  "candidatesScanned": 24, "candidatesRejected": 0, "thumbnailsSaved": 3,
  "thumbnails": ["https://api.apify.com/v2/key-value-stores/<store>/records/v000-thumb-01.jpg", "…"],
  "spriteUrl": "https://api.apify.com/v2/key-value-stores/<store>/records/v000-sprite.jpg",
  "vttUrl": "https://api.apify.com/v2/key-value-stores/<store>/records/v000-thumbnails.vtt",
  "spriteTiles": 60, "spriteIntervalSec": 10
}
```

The VTT file uses the standard `sprite.jpg#xywh=x,y,w,h` cues with absolute URLs, so a player can load it straight from the key-value store. Download both files to your CDN if you need them for long.

`upscaled: true` means the source was smaller than the preset, for example a 640×360 video made into a 1280×720 thumbnail.

Error codes (free): `INVALID_URL`, `UNSUPPORTED_PLATFORM`, `HTTP_403`, `HTTP_404`, `HTTP_429`, `NOT_A_VIDEO`, `NO_VIDEO_STREAM`, `UNKNOWN_DURATION`, `RANGE_EMPTY`, `TIMEOUT`, `NETWORK_ERROR`, `INTERNAL_ERROR`. A run summary is saved as `OUTPUT` in the key-value store.

### Limits and safety

- **Max total charge respected:** the Actor checks the budget before every thumbnail and sprite. It stops cleanly with `stopReason: "MAX_CHARGE_REACHED"` and never goes over.
- **Run timeout:** it stops about 30 s before the timeout and keeps everything already saved (`TIME_LIMIT`).
- **Bad input never fails the run:** invalid values fall back to their defaults with a warning, and bad URLs get a free error row.
- Live streams with no known duration are not supported, because the candidates need a duration to spread over.

### Pricing

| Event | Price | When |
|---|---|---|
| Thumbnail | **$0.003** ($3 per 1,000) | Each finished thumbnail stored |
| Sprite storyboard | $0.005 | Per video with `spriteSheet: true` (sprite JPG + VTT) |
| Run start | $0.00005 | |

Examples: 3 thumbnails for 100 videos = **$0.90**. With storyboards = $1.40.

| Actor | Monthly users | Price | Picks the best frame |
|---|---|---|---|
| **This Actor** | new | **$0.003 / thumbnail**, candidates free | yes (scored + deduplicated) |
| automation-lab/video-thumbnail-frame-extractor | 26 | ≈ $0.006 / frame + $0.005 / start | no |
| badruddeen/smart-social-media-video-thumbnail-generator | 3 | $0.10 / video | – |
| parseforge/auto-video-thumbnail-generator | 1 | $0.045 | – |

Competitor figures are from the Apify Store on 2026-11-10.

### FAQ

**Why did it pick a frame I don't like?** The score measures image quality, not meaning. Ask for more thumbnails (`thumbnailCount: 5–10`), narrow the search with `startTime`/`endTime`, or raise `candidates`.

**Can I use YouTube or TikTok links?** No. Their terms forbid downloading their videos. Use a direct file URL you are allowed to process.

**Which fonts are used for the title?** DejaVu Sans Bold, an open licence font bundled in the image. Up to 3 lines are wrapped and sized automatically.

**I get HTTP_403 for a link that opens in my browser.** Some hosts block cloud IPs. Turn on *Proxy configuration* and run again.

**Is this legal?** The Actor only processes the URLs you provide and sends an honest User-Agent. Make sure you have the right to use those videos. Questions: iletisim.ortalamabiri@gmail.com.

### Use with AI agents / Apify MCP

Ask *"make three YouTube thumbnails for this video with the title 'Episode 12'"*. Through the [Apify MCP server](https://mcp.apify.com) (`https://mcp.apify.com?actors=gazidev/video-thumbnail-generator`), Claude, ChatGPT, Cursor and other MCP clients can call it directly. Over the API: `POST https://api.apify.com/v2/acts/gazidev~video-thumbnail-generator/run-sync-get-dataset-items`.

### Related Actors

[Video Frame Extractor (raw frames, scenes, keyframes)](https://apify.com/gazidev/video-frame-extractor) · [Media Transcriber](https://apify.com/gazidev/media-transcriber) · [Image OCR](https://apify.com/gazidev/image-ocr) · [Website Screenshot](https://apify.com/gazidev/website-screenshot)

# Actor input Schema

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

Direct links to video files: MP4, MOV, WebM, MKV, AVI, M4V, TS or HLS `.m3u8` (your CDN, S3/R2 bucket, Dropbox direct link...). Pages of YouTube, TikTok, Instagram, Vimeo etc. are not supported.

## `bulkText` (type: `string`):

One URL per line or a CSV with a `url` column.

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

Chain after another Actor: video URLs are read from this dataset.

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

Field name in that dataset.

## `thumbnailCount` (type: `integer`):

How many of the best-scoring, visually different frames to return (ranked by score).

## `candidates` (type: `integer`):

Evenly spaced frames between 5% and 95% of the video that are scored. More = better choice, slower. Not charged.

## `preset` (type: `string`):

Output size of each thumbnail.

## `width` (type: `integer`):

Only for preset `custom`.

## `height` (type: `integer`):

Only for preset `custom`.

## `fit` (type: `string`):

How a frame with a different aspect ratio is fitted into the preset.

## `imageFormat` (type: `string`):

File format of the thumbnails.

## `quality` (type: `integer`):

Higher = sharper and bigger files.

## `titleText` (type: `string`):

Optional text drawn on every thumbnail (bold white with a dark outline and gradient band). Leave empty for clean frames.

## `titlePosition` (type: `string`):

Where the title goes.

## `spriteSheet` (type: `boolean`):

Also build one tiled JPG sprite + `thumbnails.vtt` per video for player seek-bar previews (Video.js, Plyr, JW Player, hls.js...). Charged per video.

## `spriteIntervalSec` (type: `number`):

Tile interval. At 5 s or more only keyframes are decoded (fast).

## `spriteTileWidth` (type: `integer`):

Width of each tile; height follows the aspect ratio.

## `maxSpriteMinutes` (type: `integer`):

The storyboard covers at most this many minutes from the start time.

## `startTime` (type: `string`):

Optional, e.g. `00:00:30` - skip intros.

## `endTime` (type: `string`):

Optional, e.g. `00:09:00` - skip end credits.

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

Only this many minutes from the start time are considered. 0 = no limit.

## `maxConcurrency` (type: `integer`):

Each video also uses up to 4 parallel seeks.

## `proxyConfiguration` (type: `object`):

Only for hosts that block datacenter IPs (HTTP 403).

## Actor input object example

```json
{
  "videoUrls": [
    "https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4"
  ],
  "datasetField": "url",
  "thumbnailCount": 3,
  "candidates": 24,
  "preset": "youtube-1280x720",
  "width": 1280,
  "height": 720,
  "fit": "cover",
  "imageFormat": "jpg",
  "quality": 88,
  "titlePosition": "bottom",
  "spriteSheet": false,
  "spriteIntervalSec": 10,
  "spriteTileWidth": 160,
  "maxSpriteMinutes": 60,
  "maxDurationMinutes": 240,
  "maxConcurrency": 2,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `thumbnails` (type: `string`):

No description

## `videos` (type: `string`):

No description

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

No description

## `files` (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 = {
    "videoUrls": [
        "https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4"
    ],
    "thumbnailCount": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("gazidev/video-thumbnail-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 = {
    "videoUrls": ["https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4"],
    "thumbnailCount": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("gazidev/video-thumbnail-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 '{
  "videoUrls": [
    "https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4"
  ],
  "thumbnailCount": 3
}' |
apify call gazidev/video-thumbnail-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gazidev/video-thumbnail-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/BqiQlCffu1StXZQBN/builds/2Vulk6IgrcuGNkk2l/openapi.json
