# Video Keyframe Extractor API: Scene Cuts, No Login (`conserving_celerytop/video-scene-keyframes`) Actor

Find every scene change in a video file and save one keyframe per scene, or a frame every N seconds. Rows give scene start and end timecodes, frame image links, a contact sheet, video metadata and optional on-screen text. $0.01 per video minute, $0.003 per frame.

- **URL**: https://apify.com/conserving_celerytop/video-scene-keyframes.md
- **Developed by:** [Don Mangu](https://apify.com/conserving_celerytop) (community)
- **Stats:** 3 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.00 / 1,000 video minutes

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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 Scene Keyframe Extractor

Video Keyframe Extractor finds every scene change in a video and saves one keyframe per scene, with the scene's start and end timecodes.

Video Scene Keyframe Extractor finds every scene change in a video and saves one keyframe per scene, with the scene's start and end timecodes. It can also save one frame every N seconds instead. Each run gives you a table of frames with image links, a contact sheet per video, video metadata (length, resolution, frame rate, codecs) and, if you ask for it, the on-screen text in each frame. Give it direct links to video files you own or have the right to process.

### What can you do with a video keyframe extractor?

- **Video editors and archivists:** get a shot list with timecodes for a long recording before you cut it.
- **Marketing and ad teams:** break an ad into its shots to review pacing, or pull stills for thumbnails and storyboards.
- **AI and data teams:** turn video into a small set of representative images for captioning, tagging or search, instead of feeding every frame to a model.
- **Course and webinar owners:** capture every new slide in a recorded talk and read its title with on-screen text.

### How to extract keyframes from a video

1. Paste one or more direct video links into **Video URLs** (links that end in .mp4, .mov, .webm, .mkv and similar).
2. Keep **Frame selection** on scene detection, or switch to one frame every N seconds.
3. Optional: turn on **Read on-screen text** and pick the language.
4. Start the run. Frames appear in the **Keyframes** table as they are saved; the contact sheet link is in each row.

### How much does it cost to extract keyframes?

Pay per event. Nothing is charged for a video that fails to download or decode.

| Event | Price | When |
| --- | --- | --- |
| Video minute analysed | $0.01 per started minute | Scene mode. Covers Full HD at 30 fps or smaller; 1440p, 4K or 60 fps video counts 2 to 8 units per minute because it takes longer to decode. All keyframes and the contact sheet are included. |
| Frame saved | $0.003 per frame | Interval mode. |
| On-screen text read | $0.002 per frame | Only when the option is on and text is found. |

Example: a 12-minute 1080p webinar in scene mode costs 12 x $0.01 = $0.12, whether it has 20 scenes or 50. The same video in interval mode with a frame every 30 seconds is 24 frames x $0.003 = $0.072. Apify platform usage is included in these prices. Set a spending limit on the run and the Actor stops cleanly before it.

### Input example

```json
{
  "videoUrls": ["https://example.com/media/product-demo.mp4"],
  "mode": "scenes",
  "maxFramesPerVideo": 50,
  "readOnScreenText": true,
  "ocrLanguage": "eng"
}
```

### Output example

```json
{
  "videoUrl": "https://example.com/media/product-demo.mp4",
  "status": "ok",
  "sceneNumber": 3,
  "sceneStartTimecode": "00:00:41.208",
  "sceneEndTimecode": "00:01:02.500",
  "sceneDurationSeconds": 21.292,
  "frameTimecode": "00:00:51.854",
  "frameUrl": "https://api.apify.com/v2/key-value-stores/.../records/v0001-frame-0003.jpg",
  "frameWidth": 1280,
  "frameHeight": 720,
  "onScreenText": "Set up in three clicks",
  "scenesDetected": 14,
  "contactSheetUrl": "https://api.apify.com/v2/key-value-stores/.../records/v0001-contact-sheet.jpg",
  "videoDurationSeconds": 184.3,
  "videoFps": 29.97,
  "videoCodec": "h264",
  "audioCodec": "aac"
}
```

Videos that fail get one row with a `status` such as `not_found`, `not_video`, `file_too_large` or `platform_link` and a plain-language `error`. The full run summary is in the `STATS` record.

### Tips for better scene detection

- **Scene change sensitivity** 27 suits most edited video. Lower it (15 to 20) for soft fades and slide decks; raise it (35 to 45) if camera motion creates too many scenes.
- **Minimum scene length** merges very short scenes. Raise it to 2 or 3 seconds for fast-cut ads.
- Use 4 GB of memory for most files and 8 GB for files over 1 GB.

### Bulk lists

Use a long list of video links from an Apify Dataset or from a file. Pick the Dataset under **Dataset with the list** and write the name of its field under **Field in the dataset**. Leave the field name empty to use the first text field. Or paste the web address of a .txt, .csv or .json file under **List file URL**. A .csv file uses its first column. A header row is skipped. The file can be up to 10 MB. Entries from the Dataset and the file are added to the ones typed under **Video URLs**, and duplicates are removed. The price per result does not change.

### Related Actors

- Image to Text OCR, to read text from images you already have.
- Kokoro Text to Speech, to add a voice track to a video script.

### FAQ

**Is it legal to extract frames from a video?** The Actor only reads the files you link to. Use videos you own, have a licence for, or that are published under an open licence. It refuses links to video platform pages such as YouTube, TikTok or Instagram, and it follows each host's robots.txt.

**Which formats work?** Anything ffmpeg can read, including MP4 (H.264, H.265), MOV, WebM (VP8, VP9, AV1), MKV and AVI. Streaming playlists (HLS, DASH) are not supported; use a direct file link.

**Is my video stored?** The downloaded file is deleted when its frames are done. Frames and the contact sheet stay in your run's storage under your Apify data retention settings.

**Why are no scenes found in my video?** A single continuous shot is one scene. Lower the sensitivity or switch to interval mode.

# Actor input Schema

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

Direct links to video files (MP4, MOV, WebM, MKV, AVI and other formats ffmpeg reads). Use files you own or have the right to process. Links to video platform pages (YouTube, TikTok, Instagram and similar) are refused.

## `listDatasetId` (type: `string`):

Pick an Apify Dataset that holds your video links, one entry per item. They are added to the entries typed above.

## `listDatasetField` (type: `string`):

Name of the dataset field that holds the entry. Leave empty to use the first text field it finds.

## `listFileUrl` (type: `string`):

Web address of a .txt, .csv or .json file with your video links, one entry per line. A header row is skipped. Up to 10 MB.

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

Scenes: find every cut or scene change and save the middle frame of each scene, with scene start and end timecodes. Interval: save one frame every N seconds.

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

Interval mode: time between saved frames. The first frame is at 0:00.

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

Upper limit of frames saved from one video. In scene mode, keyframes are saved for the first scenes up to this number; the total scene count is still reported.

## `readOnScreenText` (type: `boolean`):

Read titles, captions and slide text in each saved frame with OCR. Adds the text to the row. Charged only for frames where text is found.

## `ocrLanguage` (type: `string`):

Language of the on-screen text.

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

Save one overview image per video with all saved frames and their timecodes (up to 60 thumbnails).

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

Lower values find more, subtler scene changes; higher values keep only hard cuts. 27 suits most edited video.

## `minSceneSeconds` (type: `number`):

Scenes shorter than this are merged with the next one. Raise it for fast-cut video such as ads or music videos.

## `maxMinutesPerVideo` (type: `integer`):

Only this many minutes from the start of each video are analysed.

## `frameFormat` (type: `string`):

Image format of saved frames and the contact sheet.

## `frameWidth` (type: `integer`):

Frames wider than this are scaled down, keeping the aspect ratio. 0 keeps the original size.

## `imageQuality` (type: `integer`):

JPEG and WebP quality (PNG is lossless).

## `maxFileMb` (type: `integer`):

Larger files are not downloaded. Large files need more memory and disk; use 4 GB or more for files over 1 GB.

## `maxVideos` (type: `integer`):

Upper limit of videos processed in one run.

## Actor input object example

```json
{
  "videoUrls": [
    "https://raw.githubusercontent.com/mediaelement/mediaelement-files/master/big_buck_bunny.mp4"
  ],
  "mode": "scenes",
  "intervalSeconds": 10,
  "maxFramesPerVideo": 50,
  "readOnScreenText": false,
  "ocrLanguage": "eng",
  "contactSheet": true,
  "sceneThreshold": 27,
  "minSceneSeconds": 1,
  "maxMinutesPerVideo": 30,
  "frameFormat": "jpeg",
  "frameWidth": 1280,
  "imageQuality": 85,
  "maxFileMb": 1024,
  "maxVideos": 100
}
```

# Actor output Schema

## `keyframes` (type: `string`):

No description

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

No description

## `stats` (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": [
        "https://raw.githubusercontent.com/mediaelement/mediaelement-files/master/big_buck_bunny.mp4"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("conserving_celerytop/video-scene-keyframes").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://raw.githubusercontent.com/mediaelement/mediaelement-files/master/big_buck_bunny.mp4"] }

# Run the Actor and wait for it to finish
run = client.actor("conserving_celerytop/video-scene-keyframes").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://raw.githubusercontent.com/mediaelement/mediaelement-files/master/big_buck_bunny.mp4"
  ]
}' |
apify call conserving_celerytop/video-scene-keyframes --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,conserving_celerytop/video-scene-keyframes"
        }
    }
}
```

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/lpTMCJ6EqEoK9m66p/builds/FBE4HuHykXuV4vhhh/openapi.json
