# Video Frame Extractor: frames, thumbnails and scene changes (`examsens.ai/video-frame-extractor`) Actor

Pulls still frames from video files you link or upload: every N seconds, at the timestamps you list, N evenly spaced frames, or at each scene change. Adds a best thumbnail and a contact sheet, and returns a download link and timestamp for every frame.

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

## Pricing

from $5.40 / 1,000 frame extracteds

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: frames, thumbnails and scene changes

Give it video files, by link or from one of your key value stores, and it saves still frames from each one, picked in one of the five ways below. Every frame goes into the run's key value store, and the dataset gives you its download link, timestamp and timecode, with the video's length, size, codec and frame rate.

### Modes and image options

- Evenly spaced: N frames, one from the middle of each of N equal parts of the video
- Every N seconds: a frame at the start time you set, then one every N seconds. Decimals work, such as 0.5
- At timestamps: the times you list, as seconds (`12.5`) or timecodes (`1:30`, `00:01:30`). A time past the end of the video gets an error item and is not charged
- Scene changes: the first frame plus every frame where the picture changes sharply, found with FFmpeg's scene score. Set the sensitivity from 0.1 (finds subtle changes) to 0.5 (hard cuts only)
- Thumbnail only: one best thumbnail per video
- Best thumbnail: on by default in every mode. The FFmpeg thumbnail filter picks the most typical frame of the 150 frames that start 10% into the video
- Contact sheet: one grid image per video with every saved frame and its timecode, free
- Image format: JPEG, WebP or PNG, with a quality setting for JPEG and WebP
- Size: frames are scaled down to a maximum width and height with the aspect ratio kept, and never enlarged. Rotated phone videos come out upright

A file that ends early still gives every frame that can be decoded, and times past the break get an error item.

### Accepted files

- Containers: WebM, MKV and Ogg (`.ogv`, `.ogg`)
- Video codecs: AV1, VP8, VP9 and Theora
- Audio codecs, when the video has a soundtrack: Opus, Vorbis, FLAC, MP3 and PCM

A file in any other format, or one that holds any other codec, gets an error item that names what it holds and lists what is accepted, and is not charged.

### Example

A 10 second 640 by 360 VP8 WebM in evenly spaced mode with 4 frames gave frames at 1.25, 3.75, 6.25 and 8.75 seconds, each 640 by 360, and the best thumbnail came from 3.8 seconds.

### Input

- Video URLs: direct links to video files
- Files in a key value store: to use videos from your computer, upload them to one of your key value stores and pick that store. Every record whose key ends in `.webm`, `.mkv`, `.ogv` or `.ogg` is processed
- Record keys: only process these records from that store
- Which frames: evenly spaced (default), every N seconds, at timestamps, scene changes, or thumbnail only
- Number of frames for evenly spaced (default 6)
- Seconds between frames and start time for every N seconds (defaults 10 and 0)
- Timestamps for at timestamps
- Scene change sensitivity (default 0.3)
- Maximum frames per video (default 50), for every mode. The thumbnail is not counted
- Add a best thumbnail (default on)
- Contact sheet (default on) and its number of columns (default 4)
- Image format: JPEG (default), WebP or PNG, and quality (default 85)
- Maximum width (default 1280, 0 keeps the full size) and maximum height (default no limit)
- Maximum video size in MB (default 500)
- Time limit per ffmpeg step in seconds (default 900)

### Output

Dataset: one item per frame with `imageUrl` (download link), `imageKey`, `kind` (`frame`, `scene`, `thumbnail` or `contactSheet`), `frameNumber`, `timestampSeconds`, `timecode`, `imageWidth`, `imageHeight`, `imageBytes`, and the video's `durationSeconds`, `videoWidth`, `videoHeight`, `videoCodec`, `frameRate`, `container`, `videoBytes` and `hasAudio`. Files are named by the video's position in your list, its file name, the frame number and the time, such as `0001-big_buck_bunny_360_10s_1mb-frame-0002-3.750s.jpg`.

A video that cannot be read gets one item with `ok: false` and an `error`, such as `HTTP 404`, "the link returns a web page, not a video file", a file over the size limit, "the file has no video stream", or "the file has H.264 video, which this actor does not accept" followed by the accepted formats. One bad video never stops the run.

### Pricing

Pay per event: one event per frame image saved, the best thumbnail included. Contact sheets, failed videos and failed timestamps are not charged. The run stops when it reaches the maximum charge you set.

### Scope and conduct

Only the files you supply are downloaded. The actor does not log in anywhere, does not download from video sharing sites and uses no proxies. Process videos you have the right to use.

### Support

Questions and problems: the Issues tab on this page.

# Actor input Schema

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

Direct links to video files in WebM, MKV or Ogg, with AV1, VP8, VP9 or Theora video. Other files get an error item naming their format. Pages of video sites are not supported.

## `inputStore` (type: `string`):

To use video files from your computer, upload them to one of your key value stores, then pick that store here. Every record whose key ends in .webm, .mkv, .ogv or .ogg is processed, or only the keys you list below.

## `inputKeys` (type: `array`):

Only process these records from the store above, one key per line. Empty processes every record with a known file extension.

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

Evenly spaced: N frames, one from the middle of each of N equal parts of the video. Every N seconds: one frame at the start time, then one every N seconds. At timestamps: the exact times you list. Scene changes: the first frame plus every frame where the picture changes sharply. Thumbnail only: one best thumbnail per video.

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

How many frames the evenly spaced mode takes from each video.

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

Gap between frames in the every N seconds mode. Decimals work, such as 0.5.

## `startSeconds` (type: `number`):

Where the every N seconds mode takes its first frame, in seconds.

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

Times to take frames at, one per line: seconds such as 12.5, or a timecode such as 00:01:30 or 1:30.

## `sceneThreshold` (type: `string`):

The ffmpeg scene score, from 0 to 1, a frame needs to count as a new scene. Lower finds more and subtler changes.

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

Upper limit for every mode, so a long video cannot produce thousands of frames. The thumbnail is not counted.

## `addThumbnail` (type: `boolean`):

Also save one thumbnail per video. The ffmpeg thumbnail filter picks the most typical frame of the 150 frames that start 10% into the video, so black openings and fades are skipped.

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

Also save one grid image per video with every saved frame and its timecode. Free.

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

Frames per row on the contact sheet.

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

JPEG opens everywhere. WebP is smaller. PNG is lossless.

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

1 to 100 for JPEG and WebP. PNG ignores it.

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

Frames wider than this are scaled down with the aspect ratio kept. 0 keeps the full video width. Frames are never enlarged.

## `maxHeight` (type: `integer`):

Frames taller than this are scaled down with the aspect ratio kept. 0 means no height limit.

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

Larger videos are skipped with an error item and are not charged.

## `timeoutSecondsPerVideo` (type: `integer`):

Stops one ffmpeg step that runs longer than this, such as scene detection on a very long video, and reports an error for that video.

## Actor input object example

```json
{
  "videoUrls": [
    {
      "url": "https://test-videos.co.uk/vids/bigbuckbunny/webm/vp9/360/Big_Buck_Bunny_360_10s_1MB.webm"
    }
  ],
  "mode": "count",
  "frameCount": 6,
  "intervalSeconds": 10,
  "startSeconds": 0,
  "sceneThreshold": "0.3",
  "maxFramesPerVideo": 50,
  "addThumbnail": true,
  "contactSheet": true,
  "contactSheetColumns": 4,
  "imageFormat": "jpeg",
  "quality": 85,
  "maxWidth": 1280,
  "maxHeight": 0,
  "maxVideoSizeMb": 500,
  "timeoutSecondsPerVideo": 900
}
```

# Actor output Schema

## `results` (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": [
        {
            "url": "https://test-videos.co.uk/vids/bigbuckbunny/webm/vp9/360/Big_Buck_Bunny_360_10s_1MB.webm"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("examsens.ai/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": [{ "url": "https://test-videos.co.uk/vids/bigbuckbunny/webm/vp9/360/Big_Buck_Bunny_360_10s_1MB.webm" }] }

# Run the Actor and wait for it to finish
run = client.actor("examsens.ai/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": [
    {
      "url": "https://test-videos.co.uk/vids/bigbuckbunny/webm/vp9/360/Big_Buck_Bunny_360_10s_1MB.webm"
    }
  ]
}' |
apify call examsens.ai/video-frame-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,examsens.ai/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/XNsoK4z52vhCWpgAc/builds/c1oFd1TwUlGO2O7Md/openapi.json
