# Video Frame Extractor – Frames & Thumbnails from Any Video (`mvisiondigital/video-frame-extractor`) Actor

Extract frames from video files: every N seconds, a set number of frames, exact timestamps or one per scene change. Make thumbnails, preview strips and frames for AI vision models. JPG, PNG or WebP with timestamps. Pay per frame.

- **URL**: https://apify.com/mvisiondigital/video-frame-extractor.md
- **Developed by:** [Mohit Sawhney](https://apify.com/mvisiondigital) (community)
- **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

### What it does

Video Frame Extractor pulls still images out of video files. Give it links to videos and choose which frames you want:

- **Every N seconds**, e.g. one frame every 5 seconds for a contact sheet or preview strip.
- **A set number of frames**, spread evenly across the video, e.g. 10 thumbnails.
- **At exact timestamps**, e.g. 1.5 s, 10 s and 62 s.
- **At each scene change**, one frame per new shot, good for summaries and finding cover images.

Frames come back as JPG, PNG or WebP, optionally resized, each with its timestamp.

Common uses: video thumbnails, preview strips, training data for vision models, feeding frames to an AI model for video understanding, catalogue images from product videos, and checking footage without watching it.

### How much it costs

You pay **per frame saved**. Scene-change mode also has a small charge **per minute of video scanned**, because it reads the whole video. See the Pricing tab for current prices. Videos that fail are not charged.

Set "Most frames per video" to cap how many frames a long video can produce.

### Input

| Field | What it means |
|---|---|
| Video file links | Direct links to MP4, MOV, WebM, MKV or AVI files. Page links from YouTube, TikTok or Instagram are not supported. |
| Which frames | Every N seconds, a set number, exact timestamps, or scene changes. |
| Seconds between frames | For "every N seconds". |
| Number of frames | For "a set number". |
| Timestamps | For "exact timestamps", in seconds. |
| Scene change sensitivity | For "scene changes". Lower finds more scenes; 0.3 suits most videos. |
| Image format | JPG, PNG or WebP. |
| Maximum width | Shrink frames wider than this. Empty keeps full size. |
| Most frames per video | Safety cap. Default 100. |

Example:

```json
{
    "videoUrls": ["https://example.com/product-demo.mp4"],
    "mode": "count",
    "frameCount": 12,
    "imageFormat": "webp",
    "maxWidth": 1280
}
```

### Output

One row per frame:

```json
{
    "videoUrl": "https://example.com/product-demo.mp4",
    "frameNumber": 3,
    "timestampSeconds": 22.5,
    "imageUrl": "https://api.apify.com/v2/key-value-stores/.../records/video-001-frame-00003.webp",
    "videoWidth": 1920,
    "videoHeight": 1080,
    "error": null
}
```

If a video could not be processed, its row has `error` set and no frames.

### Use it as an API

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("mvisiondigital/video-frame-extractor").call(run_input={
    "videoUrls": ["https://example.com/product-demo.mp4"],
    "mode": "scenes",
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["timestampSeconds"], item["imageUrl"])
```

### Good to know

- Videos up to 2 GB.
- Frames are stored in your own Apify storage.
- Exact timestamps are matched to the nearest frame in the video.

# Actor input Schema

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

Direct links to video files (MP4, MOV, WebM, MKV, AVI). Links to pages on YouTube, TikTok or Instagram are not supported.

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

Every N seconds, a set number spread evenly, exact timestamps, or one frame at each scene change.

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

Used with "Every N seconds".

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

Used with "A set number of frames".

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

Used with "At exact timestamps", e.g. 1.5, 10, 62.

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

Used with "At each scene change". Lower finds more scenes. 0.3 suits most videos.

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

File type of the saved frames. WebP is smallest, PNG is lossless.

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

Shrink frames wider than this. Leave empty to keep full size.

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

A safety cap so a long video can't produce more frames than you want.

## Actor input object example

```json
{
  "videoUrls": [
    "https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_1MB.mp4"
  ],
  "mode": "interval",
  "intervalSeconds": 5,
  "frameCount": 10,
  "sceneThreshold": 0.3,
  "imageFormat": "jpg",
  "maxFramesPerVideo": 100
}
```

# Actor output Schema

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

One row per frame, with its timestamp and a download link.

# 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://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_1MB.mp4"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mvisiondigital/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://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_1MB.mp4"] }

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

```

## MCP server setup

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