# Video Frame Extractor: Scene Detection, Keyframes, Thumbnails (`chivalrous_skyline_vtd/video-frame-extractor`) Actor

Extract still frames from video file URLs: every N seconds, N evenly spaced, or at scene changes. JPG/PNG with exact timecodes for thumbnails, AI vision and video search. No login.

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

## Pricing

$1.50 / 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: Scene Detection, Keyframes, Thumbnails

Takes direct links to video files and returns still frames with exact timestamps (timecodes): every N seconds, N evenly spaced frames, or one frame per scene change. Useful for thumbnails, contact sheets, datasets and feeding frames to AI vision models.

### What you get

- JPG or PNG frames stored in the run's key-value store, with a link for each.
- Exact timecode for every frame (seconds and HH:MM:SS.mmm).
- Three modes: fixed interval, N evenly spaced frames, or scene-change detection.

### Why this Actor

- **No login and no platform scraping**: you give direct video file URLs, nothing is downloaded from YouTube or social platforms.
- **Timecodes included**, so frames can be matched back to the video.
- **Cost control**: a per-video frame cap and the run's maximum charge setting.

### Use cases

- Thumbnails and preview images for video libraries.
- Input frames for AI vision models and video search indexes.
- Building image datasets from video footage you own.
- Reviewing long recordings quickly through scene-change frames.

### Quick start

Keep the example video (a short public-domain clip) and mode `count`, then press Start. Each frame becomes one row with an image link and its timecode. Switch `mode` to `scene` for footage with cuts.

### Input

```json
{ "videoUrls": ["https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"], "mode": "count", "frameCount": 3, "sceneThreshold": 0.3,
  "maxFramesPerVideo": 60, "format": "jpg", "maxWidth": 1280 }
```

| Field | Meaning |
|---|---|
| `mode` | `interval` (every `everySeconds`), `count` (`frameCount` evenly spaced, centred in equal slices), `scene` (at scene changes) |
| `maxFramesPerVideo` | Hard cap, 1-500, default 60 |
| `format` | `jpg` or `png` |
| `maxWidth` | Larger frames are scaled down (aspect ratio kept); never upscaled |

### Output

One dataset row per frame: `videoUrl`, `frameIndex`, `timestampSeconds`, `timestamp` (HH:MM:SS.mmm), `imageUrl`, `imageKey`, `bytes`, `videoDurationSeconds`. Images are stored in the run's key-value store. A video that fails gives one row with `status: error` and the reason.

### Pricing

Pay per event: one `frame-extracted` event per frame returned. Failed or empty videos are not charged. Set a maximum charge per run to cap the cost.

### Limits

- Direct video file URLs only (mp4, webm, mov, mkv...). Pages of YouTube, TikTok, Instagram, Facebook, X, Vimeo, Twitch and Niconico are rejected: this Actor does not download from platforms.
- Public hosts only (private and loopback addresses are refused, redirects are checked at every hop). Maximum 300 MB per video. Use videos you have the right to process.
- `interval` and `count` timestamps are the requested seek points; `scene` timestamps are the frame times reported by ffmpeg.
- Video decoding is done by ffmpeg (bundled through the `imageio-ffmpeg` package).

### Run the tests

`python -m unittest discover -s tests -t .` (the ffmpeg tests make a 4-second clip and are skipped if ffmpeg is missing; no network access needed).

### Related actors

- [AI Crawler Checker & GEO / AEO Audit](https://apify.com/chivalrous_skyline_vtd/ai-search-readiness-audit): check a site for AI search readiness (llms.txt, AI bots, JSON-LD).
- [Stable Diffusion Prompt Extractor](https://apify.com/chivalrous_skyline_vtd/sd-prompt-extractor): read prompts and settings embedded in AI images.
- [Japanese to Romaji, Hiragana & Furigana Converter](https://apify.com/chivalrous_skyline_vtd/japanese-furigana-romaji): readings for Japanese text.
- [Japan Diet Parliament Debates & Speeches Search](https://apify.com/chivalrous_skyline_vtd/japan-diet-minutes): speeches from Japan's National Diet since 1947.

# Actor input Schema

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

Direct links to video files (mp4, webm, mov, mkv...). Page URLs of YouTube, TikTok, Instagram etc. are not supported. Use videos you have the right to process.

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

interval: one frame every N seconds. count: N frames evenly spaced over the video. scene: a frame at each scene change.

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

Used in interval mode.

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

Used in count mode.

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

Used in scene mode. 0.1 = many frames, 0.6 = only hard cuts.

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

Hard cap (1-500). Also limits your cost.

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

Output image format: jpg (smaller) or png (lossless).

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

Frames wider than this are scaled down, keeping the aspect ratio. Never upscaled.

## Actor input object example

```json
{
  "videoUrls": [
    "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"
  ],
  "mode": "count",
  "everySeconds": 10,
  "frameCount": 3,
  "sceneThreshold": 0.3,
  "maxFramesPerVideo": 60,
  "format": "jpg",
  "maxWidth": 1280
}
```

# Actor output Schema

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

One row per extracted frame (or per failed video) in the default dataset. Image files are in the default key-value store.

# 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://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"
    ],
    "mode": "count",
    "frameCount": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("chivalrous_skyline_vtd/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://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"],
    "mode": "count",
    "frameCount": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("chivalrous_skyline_vtd/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://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"
  ],
  "mode": "count",
  "frameCount": 3
}' |
apify call chivalrous_skyline_vtd/video-frame-extractor --silent --output-dataset

```

## MCP server setup

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