# Video Frame Extractor: Scenes, Keyframes, Thumbnails, JPG/PNG (`ctriolab/video-frame-extractor`) Actor

Give direct video file URLs (MP4, WebM, MOV, MKV) and get one JSON row per frame: public image link, timestamp, size and video metadata. Every N seconds, N thumbnails, scene changes, keyframes or exact times. No login or API key. Only new videos mode for schedules. Failed videos are free.

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

## Pricing

from $0.70 / 1,000 frame extracteds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 (scenes, keyframes, thumbnails, every N seconds)

Turn **direct video file URLs** into still images. Pick how frames are chosen, get one dataset row per frame with a public image link, the exact timestamp and the video metadata. Everything runs with FFmpeg inside the Actor: no third-party API, no API key.

- Works with **MP4, WebM, MOV, MKV, AVI, M4V, OGV** and most other formats FFmpeg reads (H.264, H.265/HEVC, VP8, VP9, AV1, MPEG-4).
- Five ways to pick frames:
  - **N evenly spaced frames**: thumbnails or a storyboard (the centre of each slice, so no black first frame).
  - **Every N seconds**: 1 per second, 2 per second, 1 per minute, anything.
  - **Scene changes**: one clean frame per shot, taken after cuts and dissolves settle. Great for AI vision, video summaries and search indexes.
  - **Keyframes**: the codec I-frames, the fastest way through very long videos.
  - **Exact timestamps**: `90.5`, `1:30` or `01:02:03.5`.
- **JPG, PNG or WebP**, quality setting, resize by max width and height (never upscaled). Phone videos are turned upright.
- Optional **contact sheet**: one grid image per video with timecodes (free).
- **Video metadata** in every row: length, resolution, fps, codec, pixel format, bitrate, container, audio track, file size.
- Trim with **Start at** and **End at**, cap frames per video, file size and length limits.
- **Only new videos** mode for scheduled runs over a list of URLs.
- **Videos that fail are never charged**: broken links, web pages instead of files, files without video, files above your limits.

> **Direct file URLs only.** The URL must return the video file itself (for example `https://example.org/clip.mp4`). Pages of YouTube, TikTok, Instagram, Facebook, X, Vimeo, Twitch and similar platforms are rejected at once and not charged, because their terms do not allow downloading. Use your own storage links (S3, Google Cloud Storage, Cloudflare R2, a CDN), links from your CMS, or public archives such as Wikimedia Commons and NASA.

### How to use

1. Paste one or more direct video links into **Video file URLs**.
2. Choose **Which frames**: N evenly spaced, every N seconds, scene changes, keyframes or exact timestamps, and set the number next to it.
3. Optionally pick the image format, a max width, a time range or the contact sheet.
4. Run. Open the **Frames** tab to see the images, or download the rows as JSON, CSV or Excel. Each `imageUrl` is a public link you can use directly, for example as input to an AI vision model.

If you start the Actor with an empty input, it extracts 10 frames from a 17-second public domain clip (Ranger 8 launch, NASA/JPL, via Wikimedia Commons) so you can see the output.

#### Input example

```json
{
  "videoUrls": [
    "https://images-assets.nasa.gov/video/NG%2015%20Rollout%20and%20Lift%20Video/NG%2015%20Rollout%20and%20Lift%20Video~mobile.mp4"
  ],
  "mode": "scenes",
  "imageFormat": "jpg",
  "maxWidth": 1280,
  "contactSheet": true
}
```

#### Output example

One row per frame (real output, shortened):

```json
{
  "videoUrl": "https://images-assets.nasa.gov/video/NG%2015%20Rollout%20and%20Lift%20Video/NG%2015%20Rollout%20and%20Lift%20Video~mobile.mp4",
  "videoIndex": 1,
  "frameIndex": 2,
  "timestampSeconds": 60.867,
  "timecode": "00:01:00.867",
  "imageUrl": "https://api.apify.com/v2/key-value-stores/<id>/records/v001-f00002-t000060867ms.jpg?signature=<...>",
  "imageKey": "v001-f00002-t000060867ms.jpg",
  "format": "jpg",
  "width": 320,
  "height": 180,
  "mode": "scenes",
  "sceneScore": 19.46,
  "contactSheetUrl": "https://api.apify.com/v2/key-value-stores/<id>/records/v001-contact-sheet.jpg?signature=<...>",
  "video": {
    "fileName": "NG 15 Rollout and Lift Video~mobile.mp4",
    "durationSeconds": 159.467,
    "width": 320,
    "height": 180,
    "fps": 15,
    "videoCodec": "h264",
    "pixelFormat": "yuv420p",
    "bitRate": 317103,
    "container": "mov,mp4,m4a,3gp,3g2,mj2",
    "hasAudio": true,
    "audioCodec": "aac",
    "fileSizeBytes": 6320929
  }
}
```

The `SUMMARY` record in the key-value store lists every video with its metadata and contact sheet, and every skipped video with the reason.

#### Output fields

| Field | Type | Meaning |
|---|---|---|
| `videoUrl` | string | Video file URL from the input |
| `videoIndex` | integer | Position of the video in the input list, from 1 |
| `frameIndex` | integer | Position of the frame in its video, from 1 |
| `timestampSeconds` | number | Time of the frame in seconds |
| `timecode` | string | Same time as hh:mm:ss.mmm |
| `imageUrl` | string | Public link to the frame image |
| `imageKey` | string | Record key of the image in the run key-value store |
| `format` | string | jpg, png or webp |
| `width`, `height` | integer | Saved image size in pixels |
| `bytes` | integer | Saved image file size |
| `mode` | string | count, interval, scenes, keyframes or timestamps |
| `sceneScore` | number | Scenes mode only: picture change (0 to 100) that started the shot |
| `contactSheetUrl` | string or null | Grid image of all frames of the video, null when off |
| `extractedAt` | string | Extraction time, ISO 8601 UTC |
| `video` | object | Source video metadata: `fileName`, `durationSeconds`, `width`, `height`, `fps`, `videoCodec`, `pixelFormat`, `bitRate`, `container`, `rotation`, `hasAudio`, `audioCodec`, `frameCountHint`, `fileSizeBytes` |

### Pricing

Pay per event: **$0.001 per extracted frame** ($1 per 1,000 frames). Store discounts: Bronze $0.0009, Silver $0.0008, Gold and above $0.0007 per frame. Contact sheets, metadata and skipped or failed videos are free. You can cap the cost of a run with the **Max cost per run** setting in Apify; the Actor stops cleanly when it is reached.

Platform usage (compute) is billed to your Apify account as for any Actor. It is small, measured with the default 1 GB memory:

| Job | Run time | Compute |
|---|---|---|
| 10 thumbnails from a 17 s clip (empty input) | 6 s | 0.002 CU |
| 1 frame per minute from a 52 min, 129 MB MP4 (53 frames) | 10 s | 0.003 CU |
| Keyframes every 30 s or more from the same 52 min MP4 (98 frames) | 14 s | 0.004 CU |
| Scene changes in the same 52 min MP4 (300 frames, the whole video is decoded) | 154 s | 0.043 CU |

So 1,000 thumbnails usually cost about $1 plus a few cents of compute. Scene detection decodes every frame, so long high-resolution videos take longer: give the run more memory (2 to 4 GB) to make it faster.

### Tips

- **Thumbnails for a video library**: mode *N evenly spaced frames*, 1 to 5 frames, max width 640, WebP.
- **Frames for AI vision or a video summary**: mode *Scene changes* gives one frame per shot, so you do not pay to analyse 30 near-identical frames of the same scene. Add a max width of 768 or 1024 to keep the images small.
- **Very long videos (hours)**: *Keyframes* or *Every N seconds* are fastest, because the Actor jumps straight to the frames it needs.
- **Scene sensitivity**: 10 suits most edited videos. Use 5 for slow fades, 20 or more for shaky handheld footage.
- **Monitoring**: use *Only new videos* with a schedule to process only new URLs from a list. The state is kept in a named key-value store (Monitor name).

### FAQ

**Can I use a YouTube, TikTok or Instagram link?** No. This Actor only accepts direct file URLs. Platform pages are rejected immediately and not charged.

**How long can a video be?** Up to 720 minutes and 5 GB per file, with defaults of 180 minutes and 1,000 MB that you can raise.

**Where are the images stored?** In the run's default key-value store, with public links in the dataset. They follow your Apify data retention settings. Download them or copy them to your own storage if you need them longer.

**Does it extract audio or subtitles?** No, only images and metadata.

**Can I call it from code or an AI agent?** Yes, like any Apify Actor: the Apify API, the JavaScript and Python clients, Make, Zapier, n8n or the Apify MCP server.

### Licenses

Built on FFmpeg through PyAV (BSD, FFmpeg LGPL) and Pillow. Sample video: public domain (NASA/JPL). You are responsible for having the right to process the videos you submit.

Made by [Ctrio Lab](https://ctriolab.com). Questions or feature requests: open an issue on the Actor page or write to help@ctriolab.com.

If this Actor saved you time, a short review on its Apify Store page helps other people find it. Thank you.

# Actor input Schema

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

Direct links to video files, one per line, for example https://example.org/clip.mp4 (MP4, WebM, MOV, MKV, AVI, M4V, OGV and most formats FFmpeg reads). The URL must return the file itself: pages of YouTube, TikTok, Instagram, Vimeo and similar platforms are rejected and not charged. Leave empty to try a 17 second public domain sample.

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

How frames are chosen. count (default): N evenly spaced thumbnails, set in frameCount. interval: one frame every N seconds, set in intervalSeconds. scenes: one frame per shot, detected from picture changes. keyframes: the codec keyframes (fastest on long videos). timestamps: exact times you list in timestamps.

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

Used only in count mode: how many evenly spaced frames to take from each video, for example 5 for a storyboard. Default 10. Each frame is taken from the centre of its slice, so the first one is not a black opening frame.

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

Used only in interval mode: seconds between two frames, for example 1 for one frame per second, 0.5 for two per second, 60 for one per minute. Default 10 seconds.

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

Used only in timestamps mode (and required there): times in seconds (90.5) or mm:ss / hh:mm:ss (1:30, 01:02:03.5), one per line. Times past the end of a video are ignored.

## `sceneThreshold` (type: `integer`):

Used only in scenes mode: picture change from 1 to 100 that counts as a new shot. Lower finds more scenes. Default 10 suits most edited videos; try 5 for slow fades, 20 for shaky handheld footage.

## `minGapSeconds` (type: `number`):

Used in scenes and keyframes modes: minimum seconds between two returned frames, for example 30 to get at most one keyframe every 30 seconds. Default 1 avoids bursts of near-identical frames during flashes or fast cuts.

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

Only use the part of each video after this time, in seconds (20) or mm:ss / hh:mm:ss (0:20). Applies to every mode. Empty (default) means the start of the video.

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

Only use the part of each video before this time, in seconds (120) or mm:ss / hh:mm:ss (2:00). Must be after Start at. Empty (default) means the end of the video.

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

Safety cap on frames per video in every mode, from 1 to 5000. Default 100. You pay only for frames you get.

## `maxFileSizeMb` (type: `integer`):

Largest video file to download, in megabytes. Larger files are skipped and not charged. Default 1000 MB, up to 5000.

## `maxDurationMinutes` (type: `integer`):

Longest video to process, in minutes. Longer videos are skipped and not charged. Default 180 minutes, up to 720.

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

File type of the saved frames: jpg (default) is smallest for photos, png is lossless, webp is small with good quality. The value is also returned in the format column.

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

Compression quality for jpg and webp, from 1 to 100 (ignored for png). Higher is sharper and larger. Default 85.

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

Scale frames down to at most this width in pixels, keeping the aspect ratio, for example 768 for AI vision input. 0 (default) keeps the original size. Frames are never scaled up.

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

Scale frames down to at most this height in pixels, keeping the aspect ratio, for example 720. 0 (default) means no limit. Frames are never scaled up.

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

If true, also save one JPG grid image per video with all extracted frames and their timecodes (free, up to 200 tiles); its link is in the contactSheetUrl column. Default false.

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

Tiles per row in the contact sheet, from 1 to 12. Default 5. Used only when Contact sheet is on.

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

If true, skip video URLs this Actor already processed in an earlier run with the same Monitor name, so scheduled runs over a list only return frames from new URLs. Default false processes every URL.

## `stateName` (type: `string`):

Name of the key-value store that remembers processed URLs when Only new videos is on, for example my-video-list. Use a different name per list. Default video-frame-extractor-state.

## Actor input object example

```json
{
  "videoUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/5/57/The_launch_of_Ranger_8%2C_NASA%27s_second_lunar-impact_mission_%28JPL-19650217-RANGERf-0001-AVC2002151_Ranger_8_Launches%29.webm"
  ],
  "mode": "count",
  "frameCount": 10,
  "intervalSeconds": 10,
  "sceneThreshold": 10,
  "minGapSeconds": 1,
  "maxFramesPerVideo": 100,
  "maxFileSizeMb": 1000,
  "maxDurationMinutes": 180,
  "imageFormat": "jpg",
  "quality": 85,
  "maxWidth": 0,
  "maxHeight": 0,
  "contactSheet": false,
  "contactSheetColumns": 5,
  "onlyNew": false,
  "stateName": "video-frame-extractor-state"
}
```

# Actor output Schema

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

One item per frame: image link, timestamp, size, scene score and video metadata.

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

Frame images and contact sheets in the run's key-value store.

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

Per-video metadata and the list of skipped videos with reasons (skipped videos are not 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 = {
    "videoUrls": [
        "https://upload.wikimedia.org/wikipedia/commons/5/57/The_launch_of_Ranger_8%2C_NASA%27s_second_lunar-impact_mission_%28JPL-19650217-RANGERf-0001-AVC2002151_Ranger_8_Launches%29.webm"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ctriolab/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://upload.wikimedia.org/wikipedia/commons/5/57/The_launch_of_Ranger_8%2C_NASA%27s_second_lunar-impact_mission_%28JPL-19650217-RANGERf-0001-AVC2002151_Ranger_8_Launches%29.webm"] }

# Run the Actor and wait for it to finish
run = client.actor("ctriolab/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://upload.wikimedia.org/wikipedia/commons/5/57/The_launch_of_Ranger_8%2C_NASA%27s_second_lunar-impact_mission_%28JPL-19650217-RANGERf-0001-AVC2002151_Ranger_8_Launches%29.webm"
  ]
}' |
apify call ctriolab/video-frame-extractor --silent --output-dataset

```

## MCP server setup

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