# Video Keyframe Extractor: Scene Frames from Files (`bardach_technologies/video-keyframe-extractor`) Actor

Video keyframe extractor for video files you may process: scene keyframes with timestamps and a contact sheet, blurred and blank frames rejected. Direct file links or stored files only, no YouTube or TikTok. USD 0.002 per keyframe, plus scan and data fees.

- **URL**: https://apify.com/bardach_technologies/video-keyframe-extractor.md
- **Developed by:** [Bardach Technologies](https://apify.com/bardach_technologies) (community)
- **Categories:** Videos, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 keyframe delivered

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/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 keyframe extractor: finds the scene changes in video files you are entitled to process and delivers the sharpest usable frame of each scene, with its timestamp, plus one contact sheet. Blurred and blank frames are dropped. Files come from direct links or a key-value store.

**Status:** the one-click default (the free bundled sample) ran on the Apify platform on 26.11.2026: succeeded in 5.0 seconds with 1 row. Runs on your own video files are tested locally only and have not been measured on the platform.

Try it: click **Start** with the prefilled input. It runs the free bundled 8-second test video and writes one row with 3 keyframes and a contact sheet in about 2.3 seconds in a local run on 29.11.2026 (the platform run of 26.11.2026 took 5.0 seconds). Nothing is charged for the sample except Apify's start fee (USD 0.00005).

### Sample output

The prefilled run (done locally on 29.11.2026) wrote 1 row for the bundled sample (`status` `sample`, `charged` false, 4 scenes found, 1 blurred frame rejected) and its keyframes:

| index | timeSec | width | height | sharpness | sceneScore |
|---|---|---|---|---|---|
| 1 | 1.467 | 320 | 180 | 5105.15 | 1.0 |
| 2 | 2.467 | 320 | 180 | 3143.83 | 0.3668 |
| 3 | 4.467 | 320 | 180 | 3473.26 | 0.3201 |

### Input

Run it with the prefilled input to get the free sample. A normal run:

```json
{
  "videoUrls": ["https://cdn.example.com/talks/episode-12.mp4"],
  "maxFrames": 12,
  "sceneThreshold": 0.12,
  "rejectBlurry": true,
  "contactSheet": true
}
```

| Field | Meaning | Default |
|---|---|---|
| `videoUrls` | Direct video file links, up to 100 | empty |
| `fileKeys`, `keyValueStoreId` | Video files in a key-value store, up to 100, each at most 100 MB | empty, this run's store |
| `useSample` | Free built-in 8-second generated video | on when nothing else is given; switched off with nothing else given, the run writes one free `nothingGiven` note row |
| `maxFrames` | Frames per video, 1 to 100 | 12 |
| `sceneThreshold` | Picture change that starts a scene, 0.02 to 0.6 | 0.12 |
| `minSceneSeconds` | Shortest scene | 1 |
| `rejectBlurry` | Drop frames much less sharp than the video's others | on |
| `maxWidth` | Largest frame width, 160 to 1920 | 1280 |
| `contactSheet` | One overview image, no extra event | on |
| `maxFileMb`, `maxMinutes` | Your limits, up to 2,048 MB and 180 minutes | 500, 60 |

### Use cases

- Thumbnails and cover images: pick the sharpest still of each scene from your product videos or talks.
- Review and approval: one contact sheet per video shows its content at a glance, without playing it.
- Input for image models and archives: send a few representative frames instead of the whole video, or index recordings by their scene changes with exact timestamps.

### Use it from n8n, Make, the API or an AI agent

1. Put direct links to your video files in `videoUrls`, or store the files in a key-value store and list their keys in `fileKeys`.
2. In n8n or Make use the Apify module: run this Actor with `videoUrls` or `fileKeys` and `maxFrames`, then get the dataset items. With the API, start a run with the same JSON and read its default dataset. An AI agent can call the Actor as a tool with the same JSON, for example through the Apify MCP server.
3. Read one row per video. Each row lists its keyframes with their timestamps and links, and the link of the contact sheet.
4. Read `outcome` in the key-value store record `OUTPUT`: `complete` only when every video succeeded.

### Related Actors

- **Our speech-to-text Actor** (Apify Store; search for "Speech to Text: Audio, Video and Podcast Transcriber"): turns the sound of audio and video files into text.
- **Our dataset to Google Sheets Actor** (Apify Store; search for "Dataset to Google Sheets Export via Service Account"): writes dataset rows, such as these video rows, into a spreadsheet.

### How to extract keyframes from a video file

1. Put direct links to your video files in `videoUrls`, or store the files in a key-value store and list their keys in `fileKeys`.
2. Choose how many frames you want per video (`maxFrames`) and, if needed, a lower `sceneThreshold` for videos with soft cuts.
3. Start the run. Each video gets one dataset row with its frames, their timestamps and a contact sheet link.
4. Download the frames from the run's key-value store, or read the links from the rows in your own tool.

Run it once with the prefilled input to see the free sample row first.

### Do not use it when

- you only have a YouTube, TikTok, Instagram, Facebook, X, Vimeo or other platform link. These are refused, also when a link redirects to them;
- you need playlists or live streams (HLS, DASH), or pictures above 1920x1088;
- you need faces or people identified. This Actor does no face detection or identification;
- you do not have the right to process the file.

### Output

One dataset row per video. Images are records in the run's key-value store, and rows hold their keys and links. This row is shortened from a local run on the bundled sample:

```json
{
  "position": 1,
  "source": "sample",
  "status": "sample",
  "charged": false,
  "contentSha256": "4e247b3a3fa9955c178b70ca64d1b86ff711a3d2fd5ebd2b6fc1e9a66bf892c3",
  "durationSec": 8.0,
  "scenesFound": 4,
  "rejectedBlurry": 1,
  "frames": [
    {
      "index": 1,
      "timeSec": 1.467,
      "key": "frame-62926a9e56d3-001.jpg",
      "bytes": 9486,
      "width": 320,
      "height": 180,
      "sharpness": 5105.15,
      "sceneScore": 1.0
    }
  ],
  "contactSheet": {
    "key": "sheet-62926a9e56d3.jpg",
    "bytes": 13865
  },
  "chargedEvents": {}
}
```

`timeSec` is the delivered frame's own start time in the video: the picture on screen at the chosen moment. In slides, low frame rate video and screen recordings that skip identical frames, a picture can stay on screen for seconds, so `timeSec` can lie before the moment the scene was sampled; the same held picture is delivered and paid only once.

Row statuses: `ok`, `"sample"` (the free bundled clip), `duplicate`, `platformUrlRefused`, `urlRefused`, `hostRefused`, `notFound`, `downloadFailed`, `tooLarge`, `tooLong`, `unsupportedFormat`, `unreadable`, `durationUnknown`, `resolutionTooHigh`, `noFrames`, `fileMissing`, `timeLimit`, `toolFailed`, `partial`, `nothingGiven` (one free note row with `source` `none` when no links, files or sample were given). The `OUTPUT` record holds the run summary: `outcome` (`complete` only when every video succeeded; `finishedWithProblems` when any video failed or was refused; `stoppedEarly`; `incomplete`), and exact counts in `videosSucceeded`, `videosFailed`, `videosRefused`, `duplicateRows` and `statusCounts`.

### Troubleshooting

- `platformUrlRefused`: give a direct file link you may use, or store the file in a key-value store.
- `hostRefused`: the host refused the request. Use a link that allows it, or upload the file.
- `noFrames`: the picture may be blank or blurred. Try `rejectBlurry: false` or a lower `sceneThreshold`.
- Only one frame: the video may have no scene change. Lower `sceneThreshold`.
- `unreadable`: the file is damaged or uses an unsupported codec.
- `unsupportedFormat`: not a video container this Actor reads. AVI files are not read; convert to MP4 first (`ffmpeg -i in.avi -c copy out.mp4`, or re-encode).
- `nothingGiven`: no links, files or sample were given. Add links or files, or switch `useSample` on.
- `partial`: the file is cut short or damaged. Download or upload it again completely.
- `durationUnknown`: an MKV or WebM written live, to a pipe or by a browser recorder states no length. Remux it so it states one.
- Fewer frames than scenes: a chosen frame is left out when no clean decode run reaches it (damage, or an error FFmpeg reports after a seek that no earlier keyframe within the time budget avoided), when the same held picture was already delivered, or when the per-video frame time budget ran out. A frame is charged only when delivered, and an `ok` row also pays for its scan and data (see Pricing).

### FAQ

**Does it work with YouTube, TikTok or Instagram links?** No. Only direct file links and stored files are read; platform links are refused as free rows.

**What do I pay for a video that fails?** Nothing. Refused, failed, partial, duplicate and sample rows are free; an `ok` video is charged for its delivered frames, its scan and, for large files, its data.

**Why did I get fewer frames than `maxFrames`?** The video has fewer scene changes, a frame was blurred or blank, or no clean decode run reached it. See Troubleshooting.

### Limits and safety

- Containers: MP4, MOV, M4V, WebM and MKV, identified from the file's bytes. Common video codecs only. AVI files are not read: they end as a free `unsupportedFormat` row before any decoding; convert to MP4 first, for example `ffmpeg -i in.avi -c copy out.mp4`, or re-encode.
- MKV and WebM files that do not state their length are refused free as `durationUnknown`: recordings written live or to a pipe, and browser screen recordings (MediaRecorder WebM). Without a stated length a cut-short file cannot be told from a whole one. Remux such a file first (for example `ffmpeg -i in.webm -c copy out.webm`) so it states its length.
- Links must point to public http(s) hosts. Every redirect is checked, private addresses are refused, and https links may not redirect to http.
- A host that answers 401, 403, 407, 429 or 451, shows a challenge page, or answers a server error (5xx) with a web page instead of the file, is asked once and not contacted again in that run or after a restart; the rows are free. This includes a redirect that carries a challenge marker (`cf-mitigated`): it is not followed.
- The link and the store key you typed are shown back in each row (`url`, `fileKey`). A link whose host or path holds a phone number, an e-mail address or a contact link (`tel:`, `wa.me` ...) is shown as `https://<host>/[removed]` (the host name too is shown as `[removed]` when it holds the number), and a store key that holds one as `[removed]`; the real link and key are still used to read the video. Query and fragment of a link are never shown. Plain digit names and hyphenated number codes such as `112-1234567-1234567` are shown as written.
- Query strings of links are not stored in rows, because signed links can hold secrets.
- Frame extraction has a time budget per video (6 seconds per chosen frame), so a very sparse file may deliver fewer frames than chosen; dense 1080p footage with long keyframe distances can also deliver fewer frames than chosen, because every frame is decoded from the keyframe before it, twice (once to find the frame on screen, once to cut it). A frame is charged only when delivered, and an `ok` row also pays for its scan and data (see Pricing).
- A file cut short or damaged (for example an interrupted download) is detected: when the file is shorter than its own container sizes (MP4 boxes, the Matroska segment), when the decoded time falls short of the video track's stated length (by more than 2 seconds or 2 %), or when FFmpeg reports an error for the picture or one of the warnings we know to mean lost data (a corrupt decoded frame, an HEVC slice skipped as undecodable, and similar), the row is `partial`, free and holds no frames. A chosen frame is delivered only when one whole decode run from a keyframe to it reported no error; when decoding from the nearest keyframe reports one (healthy open-GOP H.264 does this right after a seek, real damage does too), decoding starts again from an earlier keyframe, down to the file start, inside the frame time budget, and the frame is left out when no clean decode run reaches it, which is not always file damage. To keep the scan fast, analysis of video whose container states 10 frames per second or more does not decode non-reference frames (frames no other frame is built from; video stated slower is decoded in full, because there one such frame can be a whole scene), so damage only inside those is not seen by the scan, and in a slide video that states a high rate (for example a variable-rate MKV stating 30 fps) a slide stored as such a frame is not seen and its scene is not delivered: such a file can end `ok` with fewer frames than scenes, or `noFrames`, because every frame from the keyframe before a chosen frame up to it is decoded in full and a chosen frame is left out when no clean decode run reaches it. Errors and those warnings are detected; a file changed so that it still decodes without any of them can give a garbled picture that no tool can see, and such a frame is delivered and charged. In our tests this happened most often with HEVC (a few altered or zeroed bytes), and also with VP9. The scan is charged as for the whole file. An MP4 box without a size ("to the end of the file") is accepted only for the picture data or zero padding; anywhere else the file is a free `partial` row. Sound longer than the picture is fine for MP4; for MKV/WebM the container length counts, so such a file can end as a free `partial` row.
- A file whose video timestamps start late (for example an MKV starting at 10 s, as some recorders and cut tools write) can end as a free `partial` row.
- Store keys starting with `-` are not read (spreadsheet apps would run them as formulas); rename the record.
- Analysis has a time limit of 30 seconds plus 1 second per video second, at most 1,500 seconds. Typical footage takes about 2 seconds per minute, so long files are fine; dense 1080p footage (about 65 to 75 seconds per minute measured on a development Mac with one thread) over about 20 minutes ends as a free `timeLimit` row.
- A run stops early after 900 seconds (download, reading and analysis together) spent on videos that ended free, so a list of slow or damaged links cannot run for hours.
- No new video starts in the last 2 minutes before the run's time limit, and every download, analysis, frame and contact-sheet step stops 1 minute before it (fewer frames may be delivered; a frame is charged only when delivered, and an `ok` row also pays for its scan and data), so the summary is always written. Run again with the same input to continue.
- After a crash while a result is being delivered, that row can stay uncharged. A row is never charged twice. Frames of a row that ends free are removed from the store.
- **Known gap (open):** a scene can be missed, for example in a slide video stored as a variable-frame-rate MKV that states 30 fps: the scan skips non-reference frames from 10 frames per second in any container, so a slide written as such a frame is not seen and its scene is not delivered. Nothing wider is tested. The row can end `ok` with fewer frames than scenes; an `ok` row is charged for its delivered frames and also for its scan and data, and no wrong picture is sold.

### Pricing

Pay per event. Only `ok` rows are charged. Refused, failed, partial, duplicate and sample rows are free.

| Event | Price (USD) |
|---|---|
| `keyframe-extracted`, per delivered frame | 0.002 |
| `scan-minute-sd`, per scan unit up to 854x480 | 0.002 |
| `scan-minute-hd`, per scan unit up to 1920x1088 | 0.003 |
| `data-25mb`, per started 25 MB of input plus output beyond the first 5 MB | 0.012 |
| `apify-actor-start`, charged by Apify per run | 0.00005 |

A scan unit is one started minute of video, or one started 100 MB of input when that is more, because dense files take longer to decode. Example: a 10-minute 1080p file of 200 MB with 12 frames costs 12 x 0.002 + 10 x 0.003 + 8 x 0.012 = USD 0.15. Before a video is processed, its largest possible cost is checked against your spending limit, and the run stops if the limit cannot cover it. That bound counts every frame at its size cap (1.5 bytes per output pixel plus 64 KB; a larger frame is not delivered), so the default settings fit the minimum spending limit of USD 0.05 for short SD videos.

# Actor input Schema

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

Direct links to MP4, MOV, M4V, WebM or MKV files, one per line, up to 100. AVI files are not read (free row); convert them to MP4 first. Only use files you are entitled to process. YouTube, TikTok, Instagram and other platform links are refused with a free row. Playlists and streams are not read. Default: empty.

## `fileKeys` (type: `array`):

Keys of video files in a key-value store, one per line, up to 100, each at most 100 MB. Default: empty.

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

Store that holds the files named above. Leave empty to use this run's own store.

## `useSample` (type: `boolean`):

Processes a built-in 8-second generated test video, free of charge. It also runs when no links or files are given, unless this is switched off; then the run writes one free nothingGiven note row.

## `maxFrames` (type: `integer`):

At most this many frames are delivered per video, the strongest scene changes first. Each delivered frame is one charged event. Default: 12.

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

How much the picture must change to count as a new scene, from 0.02 (very sensitive) to 0.6. Default: 0.12.

## `minSceneSeconds` (type: `number`):

Changes closer together than this do not start a new scene. Default: 1.

## `rejectBlurry` (type: `boolean`):

Drops chosen frames much less sharp than the video's other chosen frames. Default: on.

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

Frames wider than this are scaled down; smaller videos are not enlarged. Default: 1280.

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

Adds one overview image of the delivered frames, at no extra event. Default: on.

## `maxFileMb` (type: `integer`):

Larger files are refused with a free row. Default: 500.

## `maxMinutes` (type: `integer`):

Longer videos are refused with a free row. Analysis may take at most 1,500 seconds per video, so dense 1080p footage over about 20 minutes can end as a free timeLimit row. Default: 60.

## Actor input object example

```json
{
  "videoUrls": [
    "https://cdn.example.com/talks/episode-12.mp4"
  ],
  "fileKeys": [
    "episode-12.mp4"
  ],
  "useSample": true,
  "maxFrames": 8,
  "sceneThreshold": 0.2,
  "minSceneSeconds": 2,
  "rejectBlurry": true,
  "maxWidth": 960,
  "contactSheet": true,
  "maxFileMb": 200,
  "maxMinutes": 30
}
```

# Actor output Schema

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

One row per video with status, timestamps and frame links.

## `files` (type: `string`):

Keyframes and contact sheets are records in the run's key-value store.

## `summary` (type: `string`):

How the run ended, counts per status and events charged.

# 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 = {
    "useSample": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("bardach_technologies/video-keyframe-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 = { "useSample": True }

# Run the Actor and wait for it to finish
run = client.actor("bardach_technologies/video-keyframe-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 '{
  "useSample": true
}' |
apify call bardach_technologies/video-keyframe-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bardach_technologies/video-keyframe-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/nfmIenKR6phdBrGmk/builds/u6Y0pHMz20E7iYaF8/openapi.json
