# Video Frame Extractor - Keyframes, Scenes, Thumbnails (`pshivam/video-frame-extractor-scraper`) Actor

Cut still frames from video links or another Actor's dataset: evenly spaced, every N seconds, scene changes, key frames, exact times or the best thumbnails. Sharpness, size and a contact sheet per video. Pay per frame.

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

## Pricing

from $0.70 / 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.
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

## Video Frame Extractor - Keyframes, Scenes, Thumbnails

**Cut still frames out of videos in bulk.** Give it links to video files, or the dataset of another scraper's run, and get the frames you want: **evenly spaced, every N seconds, at exact times, the video's key frames, one at every scene change, or the best frames** (sharp, well lit, far apart). Every frame is saved as JPEG, PNG or WebP and comes with its **real time to the millisecond, size, sharpness, brightness, contrast, main colour, a picture fingerprint for repeats, and the facts of its video** (length, resolution, frame rate, codec, audio, rotation). A **contact sheet** per video shows all frames at a glance. Blank frames and failed videos are free: **you pay only for frames you receive**. No proxy, no login, no AI.

**Actively maintained.** Last update: 2026-11-08. Every release passes 100+ automated tests on real videos (the cutting runs ffmpeg in the tests), and Apify test-runs it every day.

### What can you use it for?

- **Feed AI and vision pipelines.** One clean frame per scene, with a link, instead of whole videos.
- **Thumbnails and previews.** The best frames of a video, or evenly spaced stills with a contact sheet.
- **Video moderation and review.** A frame every few seconds, with brightness and sharpness to find black or blurry sections.
- **Scrape, then look.** Another Actor returns video addresses (TikTok, Instagram and similar scrapers do). Give this Actor that run's dataset and get the frames.
- **Research and archives.** Exact timestamps with the real frame time, video length, codec and frame rate in every row.

### What data do you get?

One row per frame. Failed videos are not rows: they are in the `FAILED_URLS` record with the reason.

| Field | What it is |
|---|---|
| `videoUrl`, `videoId` | The video address you gave, and a short id of it |
| `frameIndex`, `timestampSec`, `timecode` | The frame's number, its real time in seconds, and as HH:MM:SS.mmm |
| `mode` | The mode that chose the frame |
| `frameKey`, `frameUrl`, `format` | The record key, the link to the image, and `jpg`, `png` or `webp` |
| `width`, `height`, `bytes` | Image size in pixels and bytes |
| `sceneScore` | In scene mode: how strong the change into the frame is (0 to 1) |
| `sharpness`, `brightness`, `contrast`, `dominantColor` | How sharp, how bright and how contrasty the frame is, and its average colour |
| `hash`, `similarTo` | A 16-digit picture fingerprint, and the index of an earlier frame that looks the same |
| `videoDurationSec`, `videoWidth`, `videoHeight`, `videoFps` | Length, size as displayed and frame rate of the video |
| `videoCodec`, `videoBitrateKbps`, `videoSizeBytes` | Codec, bitrate and file size |
| `hasAudio`, `audioCodec`, `rotation` | Audio track, its codec, and the rotation stored in the file (frames are already upright) |
| `contactSheetUrl` | Link to the video's contact sheet |
| `extractedAt` | When the frame was cut (UTC) |

#### Example result

```json
{
  "videoUrl": "https://example.com/clips/launch.mp4",
  "videoId": "3f9a1c0b7d22",
  "frameIndex": 2,
  "timestampSec": 12.04,
  "timecode": "00:00:12.040",
  "mode": "scenes",
  "frameKey": "3f9a1c0b7d22-0002-00012040ms.jpg",
  "frameUrl": "https://api.apify.com/v2/key-value-stores/xxxx/records/3f9a1c0b7d22-0002-00012040ms.jpg",
  "format": "jpg",
  "width": 1280,
  "height": 720,
  "bytes": 84213,
  "sceneScore": 0.61,
  "sharpness": 412.7,
  "brightness": 0.46,
  "contrast": 0.21,
  "dominantColor": "#6d7f9a",
  "hash": "e1c3a7870f3d1b99",
  "similarTo": null,
  "videoDurationSec": 58.4,
  "videoWidth": 1920,
  "videoHeight": 1080,
  "videoFps": 29.97,
  "videoCodec": "h264",
  "videoBitrateKbps": 4200,
  "hasAudio": true,
  "audioCodec": "aac",
  "rotation": 0,
  "contactSheetUrl": "https://api.apify.com/v2/key-value-stores/xxxx/records/3f9a1c0b7d22-contact-sheet.jpg"
}
```

#### Which frames: the modes

| `mode` | What it does |
|---|---|
| `count` | `frameCount` frames, one in the middle of each of N equal parts. A blank frame is replaced by a nearby one from the same part |
| `interval` | A frame every `intervalSeconds` |
| `timestamps` | Frames at the times you list: seconds, clock times or percentages |
| `keyframes` | The key frames the video is built on (fast: only those frames are decoded) |
| `scenes` | The first frame and a frame at every scene change; `sceneThreshold` sets how big a change must be |
| `best` | The `frameCount` sharpest, best-lit frames, at least a fair distance apart |

`startTime` and `endTime` limit every mode to a part of the video. `timestampSec` is the frame's real time: asking for 3.99 s returns the frame at 4.00 s and says 4.0.

### How to use it

1. Paste video links into **Video URLs**, or give a **dataset id**.
2. Pick **Which frames**, and the number or spacing.
3. Set **Maximum frames** and press Start. Frames appear in the key-value store as the videos finish.

#### Input options

| Input | What it does |
|---|---|
| `videoUrls` | Direct links to video files: one by one, pasted (one per line) or from a text file |
| `datasetId`, `urlFields` | Cut every video address in the rows of another Actor's dataset; name the fields or let the Actor find them |
| `mode` | `count`, `interval`, `timestamps`, `keyframes`, `scenes` or `best` |
| `frameCount`, `intervalSeconds`, `timestamps`, `sceneThreshold` | The settings of the modes |
| `maxFramesPerVideo` | At most this many frames from one video; more moments are thinned out evenly |
| `startTime`, `endTime` | Cut only this part of each video |
| `imageFormat`, `maxWidth`, `imageQuality` | `jpg`, `png` or `webp`; scale frames down to this width (0 keeps the size); JPEG and WebP quality |
| `skipBlankFrames`, `dropDuplicates` | Drop black, white and single-colour frames; drop frames that look like an earlier one |
| `contactSheet`, `contactSheetColumns` | One picture per video with all frames as tiles, and its columns |
| `maxVideoSizeMb` | Larger videos are refused before they are downloaded |
| `maxRetries`, `timeoutSeconds`, `processingTimeoutSeconds` | Download retries, the wait for the server's next bytes, and the longest a video may take to cut |
| `maxPerHost`, `maxConcurrency` | Downloads at once from one site, and videos processed at once |
| `headers` | Extra request headers, for videos you are allowed to download |
| `keyValueStoreName` | Save into a named key-value store that does not expire |
| `onlyNew` | Skip videos that earlier runs of this same input already returned |
| `maxItems` | Stop after this many frames in total |

### How much does it cost?

You pay per frame you receive, nothing else. Failed videos, videos over the size limit, blank frames, dropped repeats and contact sheets are free and do not count toward the maximum. The first Apify plan includes free monthly credit to try it.

| Plan | Price per 1,000 frames |
|---|---|
| Free | $1.00 |
| Bronze | $0.90 |
| Silver | $0.80 |
| Gold | $0.70 |

### Use it via API, on a schedule, or with your tools

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("pshivam/video-frame-extractor-scraper").call(run_input={
    "datasetId": "<DATASET_ID_OF_ANOTHER_RUN>",
    "mode": "scenes",
    "maxFramesPerVideo": 12,
    "maxItems": 500,
})
for frame in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(frame["videoUrl"], frame["timecode"], frame["frameUrl"], frame["sharpness"])
```

Schedule it in the Apify Console (Schedules) and turn on **Only new videos** to cut only the videos earlier runs did not. Connect the result to Google Sheets, Make, Zapier, n8n or your own app with Apify's integrations.

### Good to know

- **Direct video links only.** The Actor downloads the file at the address you give and cuts it. A page link of a video site (a YouTube watch page, a TikTok page) is a web page: it fails with `html_instead_of_file` or `no_video_stream` and costs nothing. Video addresses that scrapers return (TikTok and Instagram scrapers return direct links) work.
- **Links expire.** Video links from social media often stop working after hours. Run this Actor soon after the scrape.
- **Scenes read the whole video.** Scene detection looks at every frame, so long videos take longer. The other modes jump to the moments they need.
- **Frames are cut with ffmpeg** in the Actor's own container: no outside service, no account.
- **Downloads are streamed to disk, retried and resumed** when the server supports byte ranges. Private and internal network addresses are refused.
- **More memory means more videos at once.** The default is 2 GB.
- **Frames are kept as your run's records.** Run records expire after your plan's retention time. Use `keyValueStoreName` for a store that stays.

### FAQ

#### How do I extract frames from a video?

Paste the video link into **Video URLs**, choose **Evenly spaced** and a number of frames, and press Start. Each frame is a row in the results and an image in the key-value store.

#### Can it find the scene changes of a video?

Yes. Choose **At every scene change**. It returns the first frame and a frame at every cut, with the strength of each change in `sceneScore`. Lower `sceneThreshold` to find smaller changes.

#### Can it give me the best thumbnail of a video?

Yes. Choose **The best frames**. It samples the video, scores every candidate for sharpness, contrast and brightness, and returns the best ones that are far apart in time.

#### Can I get frames at exact times?

Yes. Choose **At exact times** and list seconds, clock times or percentages. The row's `timestampSec` is the frame's real time.

#### Can it cut the videos from my TikTok or Instagram scrape?

Yes, with the dataset of that scraper's run. Give the dataset id; fields such as `videoUrl`, `downloadAddr` and `playUrl` are found on their own. Run it soon after the scrape because those links expire.

#### Does it work with YouTube links?

No. A YouTube page is not a video file. The Actor reads direct links to video files (mp4, mov, webm, mkv and others).

#### Do I need a proxy or an account?

No. The Actor downloads the address you give and cuts it with its own ffmpeg.

#### Is it legal to extract frames from videos?

The Actor fetches the addresses you give. You are responsible for having the right to download and use the videos and their frames and for following the terms of the sites you download from.

#### How do I cut only new videos every day?

Turn on **Only new videos** and schedule the Actor. It remembers what it returned in your key-value store.

# Actor input Schema

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

Direct links to video files (mp4, mov, webm, mkv, avi, ts ...). Add them one by one, paste a list (one per line) or load a text file. Page links of video sites (YouTube, TikTok pages) are not video files and fail for free.

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

The id of an Apify dataset (from another Actor's run). Every video address in its rows is cut: fields such as videoUrl, downloadAddr, playUrl or mediaUrl are found on their own.

## `urlFields` (type: `array`):

Only for a dataset: the fields that hold video addresses (videoUrl, videoMeta.downloadAddr). Empty: find them on their own.

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

Evenly spaced: the middle of N equal parts. Every N seconds. Exact times: your list. Key frames: the frames the video is built on (fast). Scene changes: a frame at each cut. Best: the sharpest, best lit frames, spread over the video.

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

For 'Evenly spaced' and 'Best': how many frames per video.

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

For 'Every N seconds': 10 gives a frame at 0 s, 10 s, 20 s ...

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

For 'At exact times': seconds (12.5), clock times (01:30 or 00:01:30.5) or percentages of the video (50%). A time past the end is skipped.

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

For 'At every scene change': lower finds more changes (0.1 = small changes), higher only hard cuts (0.5). The first frame is always included.

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

More moments than this are thinned out evenly (scene changes keep the strongest).

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

Only cut from this time on: seconds or a clock time such as 00:30. Empty: the start.

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

Only cut up to this time. Empty: the end.

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

The format of the saved frames.

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

Frames wider than this are scaled down (never up). 0 keeps the original size.

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

30 to 100. Higher is sharper and larger.

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

Drop black, white and single-colour frames (not charged). In 'Evenly spaced' a blank frame is first replaced by a nearby one.

## `dropDuplicates` (type: `boolean`):

Drop frames that look like an earlier frame of the same video (not charged). Off: they are kept and marked in 'similarTo'.

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

One picture per video with all its frames as small tiles and their times. Free.

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

Tiles per row on the contact sheet.

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

Larger videos are refused before they are downloaded and are not charged.

## `maxRetries` (type: `integer`):

Retries after a timeout, a dropped connection, HTTP 429 or a server error. A broken download continues where it stopped when the server allows.

## `timeoutSeconds` (type: `integer`):

How long to wait for the server's next bytes.

## `processingTimeoutSeconds` (type: `integer`):

The longest a single video may take to cut. 'Scene changes' reads the whole video, so long videos need more.

## `maxPerHost` (type: `integer`):

Videos downloaded at the same time from one site.

## `headers` (type: `object`):

Headers sent with every download, e.g. {"Authorization": "Bearer ..."} for videos you are allowed to download.

## `keyValueStoreName` (type: `string`):

Save frames into this named key-value store instead of the run's own one. Named stores do not expire.

## `onlyNew` (type: `boolean`):

Skip videos that earlier runs of this same input already returned, so you never pay twice. The first run works as usual and remembers what it returned, in your key-value store 'video-frame-extractor-scraper-only-new'.

## `maxItems` (type: `integer`):

Stop after this many frames in total. You are charged per frame; failed videos, blank frames and contact sheets are free.

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

Videos processed in parallel. More memory allows more.

## Actor input object example

```json
{
  "videoUrls": [
    {
      "url": "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"
    },
    {
      "url": "https://www.w3schools.com/html/mov_bbb.mp4"
    }
  ],
  "mode": "count",
  "frameCount": 10,
  "intervalSeconds": 10,
  "sceneThreshold": 0.3,
  "maxFramesPerVideo": 50,
  "imageFormat": "jpg",
  "maxWidth": 1280,
  "imageQuality": 85,
  "skipBlankFrames": true,
  "dropDuplicates": false,
  "contactSheet": true,
  "contactSheetColumns": 4,
  "maxVideoSizeMb": 500,
  "maxRetries": 3,
  "timeoutSeconds": 60,
  "processingTimeoutSeconds": 300,
  "maxPerHost": 4,
  "onlyNew": false,
  "maxItems": 20,
  "maxConcurrency": 4
}
```

# Actor output Schema

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

One row per frame, shown with the overview view.

## `analysis` (type: `string`):

Sharpness, brightness, contrast, colour, scene score and repeats.

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

Length, size, codec, frame rate and rotation of each video.

## `stored` (type: `string`):

The key-value store with every frame and contact sheet.

## `videoRecords` (type: `string`):

One summary per processed video (VIDEOS record).

## `failed` (type: `string`):

Videos that could not be processed, with the reason. Not charged.

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

Counts, failure reasons and skipped frames (RUN_SUMMARY record).

## `runStats` (type: `string`):

Requests, time, status codes and memory for this run (RUN_STATS record).

# 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": [
        {
            "url": "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"
        },
        {
            "url": "https://www.w3schools.com/html/mov_bbb.mp4"
        }
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("pshivam/video-frame-extractor-scraper").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": [
        { "url": "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4" },
        { "url": "https://www.w3schools.com/html/mov_bbb.mp4" },
    ],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("pshivam/video-frame-extractor-scraper").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": [
    {
      "url": "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"
    },
    {
      "url": "https://www.w3schools.com/html/mov_bbb.mp4"
    }
  ],
  "maxItems": 20
}' |
apify call pshivam/video-frame-extractor-scraper --silent --output-dataset

```

## MCP server setup

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

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/hqgLf7yFRQK8dLRso/builds/16hgY8DHXMl88sgjd/openapi.json
