# Video Frame Extractor: Extract Frames, Thumbnails & Scenes (`phaux/video-frame-extractor`) Actor

Extract still frames from video files or direct MP4/WebM links: every N seconds, at timestamps or at scene changes. Use for thumbnails or vision models. Input: videoUrls, mode, everySeconds or timestamps, format. Output per frame: image URL, timestamp, width, height. YouTube/TikTok links refused.

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

## Pricing

from $1.00 / 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: Extract Frames, Thumbnails & Scenes

**Extract frames** from a video and save them as images: thumbnails, keyframes at scene changes, or one frame every few seconds.

Give this Actor links to your own video files. It saves still frames as JPG or PNG with exact timestamps: every few seconds, at times you choose, or where the scene changes. It reads only the parts of the file it needs, so long videos stay fast and cheap. It does not download from YouTube, TikTok or other platforms. Videos that can't be read are listed and cost nothing.

### Quick start for AI agents and API users

- **What it does:** Extract still frames from video files or direct MP4/WebM links: every N seconds, at timestamps or at scene changes.
- **When to use it:** For thumbnails or vision models.
- **Example input** (the form's prefill; it finishes in under a minute):

```json
{
  "videoUrls": [
    {
      "url": "https://upload.wikimedia.org/wikipedia/commons/b/b3/Big_Buck_Bunny_Trailer_400p.ogv"
    }
  ],
  "mode": "interval",
  "everySeconds": 5,
  "maxFramesPerVideo": 10,
  "format": "jpg"
}
```

- **Example output:** one real dataset row from run `lZhefYHgsBCJ0BIOd` (2026-10-23), with long fields shortened and empty fields left out. Fields not shown are listed in the output table below.

```json
{
  "videoUrl": "https://upload.wikimedia.org/wikipedia/commons/b/b3/Big_Buck_Bunny_Trailer_400p.ogv",
  "status": "ok",
  "videoIndex": 1,
  "frameIndex": 1,
  "timestampSecs": 0,
  "timecode": "00:00:00.000",
  "imageUrl": "https://api.apify.com/v2/key-value-stores/EfEbBuaDeCLW5cJcY/records/v001-Big_Buck_Bunny_Trailer_400p.ogv-f0001-0.000s.jpg?signature=wtVkP...",
  "key": "v001-Big_Buck_Bunny_Trailer_400p.ogv-f0001-0.000s.jpg",
  "format": "jpg",
  "width": 720,
  "height": 400,
  "sizeBytes": 1890,
  "mode": "interval",
  "videoDurationSecs": 32.997,
  "videoWidth": 720,
  "videoHeight": 400
}
```

- **Cost (pay per event, Free-plan prices):** Frame $0.001; Video $0.002; Scene-scan minute $0.002. Failed items are not charged.
- **From an AI agent:** with the Apify MCP server, call `call-actor` with actor `phaux/video-frame-extractor`, or load it as its own tool with `https://mcp.apify.com?tools=phaux/video-frame-extractor`. Read results with `get-dataset-items`.

### What does Video Frame Extractor do?

- **Three modes:**
  - **Every N seconds** (`interval`): e.g. one frame every 5 s, starting where you want.
  - **At timestamps** (`timestamps`): `["0:05", 42, "1:02:03.5"]`.
  - **At scene changes** (`scenes`): compares the video's keyframes (video encoders place a keyframe at each cut) on a small downscaled copy, without decoding the frames in between, and saves a full-size frame at each detected cut. The strongest changes are kept when there are more than *Max frames*. Very fast on any codec (H.264, HEVC, VP9, AV1 ...); a cut inside a long keyframe interval is reported at the next keyframe.
- **Exact timestamps** in seconds and as a `hh:mm:ss.mmm` timecode on every frame.
- **JPG, PNG or WebP**, original size or scaled to a max width, adjustable quality.
- **Reads only what it needs:** large files are read with HTTP range requests (seek, then decode one frame); small files (≤ 200 MB) are downloaded once and read locally.
- Works with mp4, mov, webm, mkv, ogv, avi, m4v and most formats FFmpeg reads.

### Why use it?

- **Cheap, predictable price:** a small fee per video plus a price per frame; scene detection adds a per-minute scan fee.
- **Failures are free:** unreadable files, refused links and frames that can't be decoded are not charged.
- **No platform-terms risk:** only your own files and direct links.

Use cases: video thumbnails and poster frames, contact sheets, dataset creation for computer vision, content moderation sampling, scene/shot lists for editors, keyframes for LLM video understanding, and visual QA of encoded files.

### What it does NOT do

It refuses **YouTube, TikTok, Instagram, Facebook, X/Twitter, Vimeo, Loom, Twitch, Dailymotion** and similar platform links, including links that redirect there. Web pages are refused; the link must point to the video file. Files over 2 GB or 3 hours are refused.

### How to use it

1. Paste direct links into **Video URLs** or upload files under **Upload videos**.
2. Choose the **Mode** and its setting (seconds, timestamps or scene sensitivity) and **Max frames per video**.
3. Pick the **Image format** and optional **Max width**.
4. Run. The **Frames** view shows thumbnails; each row has an `imageUrl` to download the image.

### Input example

```json
{
  "videoUrls": [{"url": "https://upload.wikimedia.org/wikipedia/commons/b/b3/Big_Buck_Bunny_Trailer_400p.ogv"}],
  "mode": "interval",
  "everySeconds": 5,
  "maxFramesPerVideo": 10,
  "format": "jpg"
}
```

The example video is the *Big Buck Bunny* trailer, © Blender Foundation, [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/), via Wikimedia Commons. Empty input runs this example.

| Field | Default | Description |
|---|---|---|
| `videoUrls` | — | Direct links to video files. |
| `uploadedFiles` | — | Uploaded files (key-value store). |
| `mode` | `interval` | `interval`, `timestamps` or `scenes`. |
| `everySeconds` | `5` | Interval mode gap. |
| `startSeconds` | `0` | Interval mode start. |
| `timestamps` | — | Timestamps mode: seconds or `[hh:]mm:ss`. |
| `sceneThreshold` | `0.3` | Scenes mode sensitivity (lower = more cuts). |
| `maxFramesPerVideo` | `20` | Frames saved per video (1–1000). |
| `format` | `jpg` | `jpg`, `png` or `webp`. |
| `maxWidth` | `0` | Scale down to this width (0 = original). |
| `jpgQuality` | `85` | JPG/WebP quality. |
| `timeBudgetSecs` | `0` | Stop after N seconds and keep what is saved. |

### Output example

One dataset item per frame:

```json
{
  "videoUrl": "https://upload.wikimedia.org/wikipedia/commons/b/b3/Big_Buck_Bunny_Trailer_400p.ogv",
  "status": "ok",
  "videoIndex": 1,
  "frameIndex": 3,
  "timestampSecs": 10.0,
  "timecode": "00:00:10.000",
  "imageUrl": "https://api.apify.com/v2/key-value-stores/.../records/v001-Big_Buck_Bunny_Trailer_400p.ogv-f0003-10.000s.jpg",
  "key": "v001-Big_Buck_Bunny_Trailer_400p.ogv-f0003-10.000s.jpg",
  "format": "jpg",
  "width": 720,
  "height": 400,
  "sizeBytes": 19383,
  "mode": "interval",
  "videoDurationSecs": 32.997,
  "videoWidth": 720,
  "videoHeight": 400,
  "videoCodec": "theora"
}
```

A video that fails gets one row with `"status": "failed"` and an `error` (`platform_not_supported`, `not_media`, `not_found`, `access_denied`, `robots_disallowed`, `no_video`, `too_large`, `too_long`, `unreadable_media` ...). It is not charged. In scenes mode each frame also has a `sceneScore`; the first frame (0 s) is always included.

### Pricing

| Event | Price |
|---|---|
| Video (once per video that produced at least one frame) | $0.002 |
| Frame (per frame saved) | $0.001 |
| Scene-scan minute (scenes mode only, per started minute of video) | $0.002 |
| Actor start | $0.00005 |

Examples: 10 frames from one video = $0.002 + 10 × $0.001 = **$0.012**. Scene detection on a 12-minute video keeping 30 frames = $0.002 + 30 × $0.001 + 12 × $0.002 = **$0.056**.

### FAQ

**Can I extract frames from YouTube or TikTok links?**
No. Platform links are refused. Use a direct link to a video file you have the rights to, or upload the file.

**How do I get one frame every N seconds?**
Use mode `interval` and set `everySeconds` (and optionally `startSeconds`).

**How do I get frames at specific times?**
Use mode `timestamps` with values like `["0:05", 42, "1:02:03.5"]`.

**How does scene detection work?**
Mode `scenes` compares the video's keyframes on a small downscaled copy and saves a full-size frame at each detected cut. Lower `sceneThreshold` finds more cuts.

**What does it cost?**
$0.002 per video plus $0.001 per frame; scenes mode adds $0.002 per started minute of video. 10 frames from one video cost $0.012.

**Are failed videos charged?**
No. A video that can't be read gets one row with `"status": "failed"` and an error code, and is free.

**Something isn't working?**
Open an issue on the Actor's Issues tab with the run ID.

### Legal

Process only videos you own or have the right to use. Copyright stays with the owner. Hosts' robots.txt is respected and private network addresses are refused. FFmpeg (Debian build) is used for decoding.

# Actor input Schema

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

Direct links to video files (mp4, webm, mov, mkv, ogv, avi ...): your server, S3/GCS signed links, Dropbox direct links or Apify storage. Platform pages are refused. Example: \[{"url": "https://upload.wikimedia.org/wikipedia/commons/b/b3/Big_Buck_Bunny_Trailer_400p.ogv"}].

## `uploadedFiles` (type: `array`):

Upload your own video files (stored in your Apify key-value store) or paste their links.

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

interval = a frame every N seconds; timestamps = frames at the times you list; scenes = a frame at each scene change (also charged per minute scanned). Default: "interval".

## `everySeconds` (type: `number`):

Gap between frames in interval mode (0.1–3600 s). Default: 5.

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

First frame time in interval mode. Default: 0.

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

Times as seconds (12.5) or \[hh:]mm:ss (1:02:03). Times past the end of a video are skipped for free. Example: \[0, 12.5, 60].

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

0.05–0.95; lower finds more scene changes. 0.3 suits most videos. Default: 0.3.

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

Upper limit of frames saved per video (1–1000). In scenes mode the strongest changes are kept. Default: 20.

## `format` (type: `string`):

jpg (small), png (lossless) or webp. Default: "jpg".

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

Scale frames down to this width, keeping the aspect ratio (0 = original size). Default: 0.

## `jpgQuality` (type: `integer`):

10–100 (85 = good quality, small files). Default: 85.

## `timeBudgetSecs` (type: `integer`):

Stop after this many seconds and keep the frames saved (0 = only the run timeout guard). Default: 0.

## Actor input object example

```json
{
  "videoUrls": [
    {
      "url": "https://upload.wikimedia.org/wikipedia/commons/b/b3/Big_Buck_Bunny_Trailer_400p.ogv"
    }
  ],
  "mode": "interval",
  "everySeconds": 5,
  "startSeconds": 0,
  "sceneThreshold": 0.3,
  "maxFramesPerVideo": 10,
  "format": "jpg",
  "maxWidth": 0,
  "jpgQuality": 85,
  "timeBudgetSecs": 0
}
```

# Actor output Schema

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

No description

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

No description

## `errors` (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://upload.wikimedia.org/wikipedia/commons/b/b3/Big_Buck_Bunny_Trailer_400p.ogv"
        }
    ],
    "mode": "interval",
    "everySeconds": 5,
    "maxFramesPerVideo": 10,
    "format": "jpg"
};

// Run the Actor and wait for it to finish
const run = await client.actor("phaux/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://upload.wikimedia.org/wikipedia/commons/b/b3/Big_Buck_Bunny_Trailer_400p.ogv" }],
    "mode": "interval",
    "everySeconds": 5,
    "maxFramesPerVideo": 10,
    "format": "jpg",
}

# Run the Actor and wait for it to finish
run = client.actor("phaux/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://upload.wikimedia.org/wikipedia/commons/b/b3/Big_Buck_Bunny_Trailer_400p.ogv"
    }
  ],
  "mode": "interval",
  "everySeconds": 5,
  "maxFramesPerVideo": 10,
  "format": "jpg"
}' |
apify call phaux/video-frame-extractor --silent --output-dataset

```

## MCP server setup

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