# Video Frame Extractor: Thumbnails, Keyframes, Scene Changes (`greenrun/video-frame-extractor`) Actor

Extract still frames from your video files (MP4, MOV, WebM, MKV): exact timestamps, every N seconds, N evenly spaced thumbnails, keyframes or scene changes, as JPEG, PNG or WebP with timecodes. Direct file links only, no YouTube or social media pages. Broken links and non-video files are free.

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

## Pricing

from $0.80 / 1,000 frames

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 Frame Extractor: Thumbnails, Keyframes, Scene Changes

Extract still frames from your video files (MP4, MOV, WebM, MKV): exact timestamps, every N seconds, N evenly spaced thumbnails, keyframes or scene changes, as JPEG, PNG or WebP with timecodes. Direct file links only, no YouTube or social media pages. Broken links and non-video files are free.

Give the Actor links to video files, a dataset field with links (for example the output of another Actor) or records of a key-value store, and choose which frames you want. **You get one dataset row per video with every frame's image link, exact timecode, size and keyframe flag, and the images in the run's key-value store.** It suits AI pipelines that need frames for vision models, thumbnails for catalogs and video QA. **You pay only for results: links that are not found, blocked, pages of video platforms and files that are not videos are free.**

### What it does

- **Reads** video files from direct links, a dataset field or a key-value store: MP4, MOV, WebM, MKV, AVI, MPEG-TS, 3GP, OGV and other formats ffmpeg reads, with H.264, HEVC, VP8, VP9, AV1, ProRes and more.
- **Picks** the frames you ask for: N evenly spaced, one every N seconds, exact timestamps, keyframes, or one per scene change (fast on keyframes, or accurate on every frame).
- **Returns** JPEG, PNG or WebP images with the exact time of each frame, as stored in the video, and the time you asked for.
- **Fixes** what makes frames look wrong: rotation of phone videos, non-square pixels, interlacing, HDR (tone-mapped to normal colours).
- **Makes** an optional contact sheet per video: one JPEG grid with all frames and their timecodes, free.
- **Explains** every free result: not found, blocked by robots.txt, a web page instead of a file, audio only, a streaming playlist, a video platform page.

### Why use it

- **No fee per video.** $0.0008 per frame, so ten thumbnails of a video cost $0.008.
- **Pay only for results.** Inputs that are not found, blocked by the site or are not videos are saved for free with the reason.
- **Fast where it can be.** Evenly spaced thumbnails move to a keyframe close to the right moment, which decodes as one frame instead of a whole group of frames; scene detection on keyframes needs no full decoding.
- **Exact when you need it.** Exact timestamps and accurate scene detection decode every frame, charged per scanned minute only when that work is needed.
- **Respectful.** robots.txt is always respected. No proxies, no CAPTCHA solving, no login, no downloads from video platforms.
- **Built for AI agents.** Clear status messages, a predictable price per result, and limited permissions.

### How to use

#### In Apify Console

1. Paste links to video files into **Video file URLs**, one per line (or pick a dataset or a key-value store).
2. Choose **Which frames**: count, interval, timestamps, keyframes or scenes, and the setting for that mode.
3. Pick the image format and the maximum width (1280 px by default; 0 keeps the original size).
4. Press **Start**. The **Output** tab shows one row per video; the frame images are in the run's key-value store.

#### From an AI agent (MCP)

Connect any MCP client to the Apify MCP server with only this Actor as a tool:

```
https://mcp.apify.com?tools=greenrun/video-frame-extractor
```

#### Through the API

```bash
curl -X POST "https://api.apify.com/v2/acts/greenrun~video-frame-extractor/run-sync-get-dataset-items" \
  -H "Authorization: Bearer <APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls": ["https://upload.wikimedia.org/wikipedia/commons/e/e3/Koel_at_bird_bath.webm"], "mode": "count", "frameCount": 5}'
```

### Input

| Field | Default | Description |
|---|---|---|
| `videoUrls` | example links | Direct http or https links to video files, one per line. Pages of YouTube, TikTok, Instagram and other video platforms are returned free with the reason. Links to records of Apify key-value stores (also signed links and records of a run's store) are read through the Apify API and count like store records. |
| `datasetId` | empty | Also take the video links found in this dataset, for example the output of another Actor. |
| `datasetField` | `url` | Field of each dataset item that holds the link; dot paths and lists work (`media.video`, `videos.url`). |
| `keyValueStoreId` | empty | Read video files stored as records of this key-value store. Choosing the store gives the Actor read access. |
| `keyValueStoreKeys` | empty | Keys of the video records; empty reads every record whose key ends with a video extension. |
| `mode` | `count` | `count`, `interval`, `timestamps`, `keyframes` or `scenes`. |
| `frameCount` | 10 | Mode count: frames spread evenly over the video or the range. |
| `intervalSeconds` | 10 | Mode interval: one frame every this many seconds (decimals work). |
| `timestamps` | empty | Mode timestamps: moments in seconds (12.5) or HH:MM:SS.mmm, one per line. |
| `startTime`, `endTime` | empty | Only frames between these moments, e.g. 30 or 00:01:30. |
| `sceneThreshold` | 0.3 | Mode scenes: how different two frames must be to count as a new scene (0 to 1). |
| `accurateScenes` | false | Mode scenes: compare every frame (charged per scanned minute) instead of the keyframes only. |
| `maxFramesPerVideo` | 100 | Upper limit of frames from one video in any mode. |
| `skipBlankFrames` | false | Leave out frames of one flat colour (they still count as frames, because they were decoded). |
| `imageFormat` | `jpg` | `jpg`, `png` or `webp`. |
| `imageQuality` | 85 | JPEG and WebP quality from 1 to 100. |
| `maxWidth` | 1280 | Wider frames are scaled down to this width; 0 keeps the original size. |
| `contactSheet` | false | Also make one JPEG grid per video with all frames and timecodes (free). |
| `contactSheetColumns` | 5 | Frames per row of the contact sheet. |
| `maxScanMinutes` | 60 | Most scanned minutes one video may use; a video that needs more is skipped for free. 0: never pay for scanned minutes. |
| `maxVideoSizeMb` | 1000 | Larger files are skipped for free. A run gets twice its memory as disk. |
| `maxConcurrency` | 2 | Videos downloaded at the same time. |
| `timeoutSecs` | 900 | A video whose download and extraction take longer fails for free. |

### Output

One row per video. A real row from a run on 21.11.2026 (Jellyfish 1080p test clip from test-videos.co.uk, mode count, 10 frames; shortened to the first two frames):

```json
{
  "index": 2,
  "input": "https://test-videos.co.uk/vids/jellyfish/mp4/h264/1080/Jellyfish_1080_10s_30MB.mp4",
  "status": "extracted",
  "fileName": "Jellyfish_1080_10s_30MB.mp4",
  "sizeBytes": 31458599,
  "durationSecs": 10.01,
  "width": 1920,
  "height": 1080,
  "fps": 29.97,
  "codec": "h264",
  "keyframes": 2,
  "keyframeIntervalSecs": 8.34,
  "mode": "count",
  "method": "pass",
  "framesRequested": 10,
  "framesExtracted": 10,
  "frames": [
    {"index": 1, "time": 0.501, "timecode": "00:00:00.501", "requestedTime": 0.499,
     "url": "https://api.apify.com/v2/key-value-stores/QVGygT608ZFd1ARhU/records/v0002-0001-00h00m00s501.jpg?signature=...",
     "key": "v0002-0001-00h00m00s501.jpg", "width": 1280, "height": 720, "format": "jpg", "sizeBytes": 60562,
     "keyframe": false, "blank": false, "frameEvents": 1},
    {"index": 2, "time": 1.502, "timecode": "00:00:01.502", "requestedTime": 1.496,
     "url": "https://api.apify.com/v2/key-value-stores/QVGygT608ZFd1ARhU/records/v0002-0002-00h00m01s502.jpg?signature=...",
     "key": "v0002-0002-00h00m01s502.jpg", "width": 1280, "height": 720, "format": "jpg", "sizeBytes": 65031,
     "keyframe": false, "blank": false, "frameEvents": 1}
  ],
  "scanMinutes": 0,
  "processingSecs": 6.5,
  "error": null,
  "billableEvents": {"frame": 10, "scan-minute": 0, "scan-minute-4k": 0}
}
```

The `RUN-REPORT` record in the key-value store counts the results, lists every free input with its reason and shows the run's estimated cost.

### Pricing

Pay per event, no subscription:

| Event | Price | When |
|---|---|---|
| Frame | $0.0008 | One frame stored as JPEG, PNG or WebP. A frame larger than 8.9 MP (2.1 MP in PNG) or 4 MB counts one per started block. A downloaded video file counts at least one frame per started 100 MB (the frames count toward it); a video record of a key-value store one more per started 8 MB. |
| Scanned minute | $0.012 | One started block of full decoding of a video up to 1080p (about one minute at 30 frames/s and 8 Mbit/s; heavier video counts more): accurate scene detection, or frames far from the keyframes before them. |
| Scanned minute, above 1080p | $0.04 | The same above 1080p (a block is about one minute of 4K at 30 frames/s and 10 Mbit/s). |

Free: links that are not found, blocked by robots.txt or refused by the site, pages of video platforms, streaming playlists, and files whose first bytes are not a video (they stop there). Apify also charges its Actor start event of $0.0045 per run for each GB of memory ($0.009 at the default 2 GB). You can cap the cost of a run with the maximum charge in the run options; the run stops cleanly at that limit and the status message says so.

Charges are made as the work goes: a downloaded video file, finished frames and started scan blocks are charged before the run spends more on them, so a run you abort keeps only what it already did charged, and nothing more is charged after the abort.

### Limits

- Direct video files only: no YouTube, TikTok or other platform pages, no HLS or DASH playlists, no login or cookies.
- A run never spends more than 80% of what its charges pay for. A download may take the run time that one frame per started 100 MB pays for (about 4.6 s at the default 2 GB of memory, 9 s at 1 GB), plus what the run has already earned: small files download from almost any server, but a large file needs about 22 MB/s at 2 GB. A slower server stops with a clear message, and the part already downloaded counts as one frame per started 100 MB. Cloud storage and most CDNs are fast enough (Wikimedia gave 30-70 MB/s in our tests).
- Decoding that would cost more than its price (very high bitrates, damaged files) stops early; the frames found until then are returned and charged.
- Files up to `maxVideoSizeMb` (1 000 MB by default, at most 10 000) and twice the run's memory as disk.
- A dataset is read up to 5 000 items, and only as many as the run has paid for at that point; a key-value store is listed up to 10 000 keys the same way. Split larger datasets or name the records in `keyValueStoreKeys`.
- Decoding uses about one CPU core per 4 GB of memory: more memory makes long scans faster, not cheaper.

### FAQ

**Do you keep the data?** No. Results stay in your run's dataset and key-value store in your own Apify account, under your data retention settings.

**Why was an input not charged?** Each free result has its reason in the `error` field, and the `RUN-REPORT` record in the key-value store counts them.

**Why was a failed video charged one frame?** Its file was downloaded (or read from your key-value store) before it failed, and that costs run time: a video file counts one frame per started 100 MB, a key-value store record one per started 8 MB. If decoding had started, its started scan blocks and finished frames count too. The row's `note` says so.

**What if I abort a run?** The work done until then is already charged (the downloaded files, finished frames, started scan blocks); nothing more is charged. Finished videos are in the dataset.

**Why did a run say it had no paid time left?** Rarely, Apify takes long to start a run (loading the Actor on a new server); when the start took more than the Actor start fee covers, the run stops instead of spending more. Run it again: a later start is usually fast.

**Which software does it use?** [FFmpeg](https://ffmpeg.org) (LGPL 2.1 or later; the Debian build includes GPL parts such as x264) for reading and decoding, and Pillow for contact sheets.

**Something is wrong with a result?** Open an issue on the Actor's **Issues** tab with the input.

# Actor input Schema

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

Direct http or https links to video files (MP4, MOV, WebM, MKV, AVI, MPEG-TS, 3GP, OGV and other formats ffmpeg reads), one per line. Pages of YouTube, TikTok, Instagram and other video platforms are not files: they are returned free with the reason. Each video becomes one row with the list of its frames.

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

Also take the video links found in this dataset, for example the output of another Actor. Pick the field below. Up to 5,000 items are read, and only as many as the run has paid for at that point (about 2,000 at 2 GB of memory); split larger datasets.

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

Field of each dataset item that holds the video link. Dot paths and lists work: url, videoUrl, media.video, videos.url.

## `keyValueStoreId` (type: `string`):

Read video files stored as records of this key-value store (for example files you uploaded through the Apify API). Choosing the store here gives the Actor read access.

## `keyValueStoreKeys` (type: `array`):

Keys of the video records to read. Leave empty to read every record whose key ends with a video extension (.mp4, .mov, .webm ...).

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

count: N frames spread evenly over the video (or the range below). interval: one frame every N seconds. timestamps: the exact moments you list. keyframes: the encoder's keyframes, the cheapest to decode. scenes: one frame per scene change.

## `frameCount` (type: `integer`):

For mode count: how many frames spread evenly over the video (or the range below). Each frame is the centre of its part of the video, or a keyframe close to it (within a quarter of the part, at most 5 s), which is much faster to decode; requestedTime in the output shows the centre.

## `intervalSeconds` (type: `number`):

For mode interval: one frame every this many seconds, from the start time. Decimals work, e.g. 0.5 for two frames per second.

## `timestamps` (type: `array`):

For mode timestamps: moments in seconds (12.5) or as HH:MM:SS.mmm (00:01:02.500), one per line. You get the first frame shown at or after each moment.

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

Only frames from this moment on, e.g. 30 or 00:00:30. Empty: the start of the video.

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

Only frames up to this moment, e.g. 90 or 00:01:30. Empty: the end of the video.

## `sceneThreshold` (type: `number`):

For mode scenes: how different two frames must be to count as a new scene (ffmpeg scene score, 0 to 1). Lower finds more scenes; 0.3 suits most videos.

## `accurateScenes` (type: `boolean`):

Off: scenes are found among the keyframes, fast and charged per frame only. On: every frame is compared, which finds every cut but decodes the whole video, charged per scanned minute.

## `maxFramesPerVideo` (type: `integer`):

Upper limit of frames from one video in any mode.

## `skipBlankFrames` (type: `boolean`):

Leave out frames that are one flat colour (black, white, a fade). They were decoded like the others, so each still counts as one frame. If every frame is blank, they are returned anyway.

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

Format of the frame images.

## `imageQuality` (type: `integer`):

JPEG and WebP quality from 1 to 100. PNG is lossless and ignores it.

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

Wider frames are scaled down to this width, keeping the aspect ratio. 0 keeps the original size.

## `contactSheet` (type: `boolean`):

One JPEG grid per video with all frames (up to 100) and their timecodes, for a quick look or one image for an AI model. Free.

## `contactSheetColumns` (type: `integer`):

Frames per row of the contact sheet.

## `maxScanMinutes` (type: `integer`):

Most minutes of video one video may decode in full (accurate scene detection, or videos with very few keyframes). A video that needs more is skipped for free with the reason. 0: never pay for scanned minutes.

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

Larger files are skipped for free. A run gets twice its memory as disk, so files above about 3 GB need more memory.

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

Videos downloaded at the same time. Decoding uses one CPU core per 4 GB of memory, so a download overlaps with the decoding of another video.

## `timeoutSecs` (type: `integer`):

Download and extraction of one video that take longer fail for free.

## Actor input object example

```json
{
  "videoUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/5/5b/A_pale_breasted_thrush_next_to_nestlings_in_northern_Maracay%2C_Venezuela.webm",
    "https://upload.wikimedia.org/wikipedia/commons/e/e3/Koel_at_bird_bath.webm"
  ],
  "datasetField": "url",
  "mode": "count",
  "frameCount": 10,
  "intervalSeconds": 10,
  "sceneThreshold": 0.3,
  "accurateScenes": false,
  "maxFramesPerVideo": 100,
  "skipBlankFrames": false,
  "imageFormat": "jpg",
  "imageQuality": 85,
  "maxWidth": 1280,
  "contactSheet": false,
  "contactSheetColumns": 5,
  "maxScanMinutes": 60,
  "maxVideoSizeMb": 1000,
  "maxConcurrency": 2,
  "timeoutSecs": 900
}
```

# Actor output Schema

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

No description

## `frames` (type: `string`):

No description

## `images` (type: `string`):

No description

## `report` (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://upload.wikimedia.org/wikipedia/commons/5/5b/A_pale_breasted_thrush_next_to_nestlings_in_northern_Maracay%2C_Venezuela.webm",
        "https://upload.wikimedia.org/wikipedia/commons/e/e3/Koel_at_bird_bath.webm"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("greenrun/video-frame-extractor").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://upload.wikimedia.org/wikipedia/commons/5/5b/A_pale_breasted_thrush_next_to_nestlings_in_northern_Maracay%2C_Venezuela.webm",
        "https://upload.wikimedia.org/wikipedia/commons/e/e3/Koel_at_bird_bath.webm",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("greenrun/video-frame-extractor").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://upload.wikimedia.org/wikipedia/commons/5/5b/A_pale_breasted_thrush_next_to_nestlings_in_northern_Maracay%2C_Venezuela.webm",
    "https://upload.wikimedia.org/wikipedia/commons/e/e3/Koel_at_bird_bath.webm"
  ]
}' |
apify call greenrun/video-frame-extractor --silent --output-dataset

```

## MCP server setup

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

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/cXsIQBc0smdNk7wvh/builds/dXLXKIuxCFb4u8LMG/openapi.json
