# Convert an MP4 video to JPG images, one every 2 seconds

**Use case:** 

Saves one JPG image every 2 seconds from each MP4, MOV, WebM, MKV or AVI file, starting at 0 s, with the exact time of every frame and a contact sheet of all of them. Videos come from direct links, your Apify key-value store or your uploads. Run it as it is to try the built-in 6-second test clip: you get frames at 0, 2 and 4 s.

## Input

```json
{
  "videoUrls": [],
  "mode": "interval",
  "intervalSec": 2,
  "sceneThreshold": 0.3,
  "maxFramesPerVideo": 50,
  "format": "jpeg",
  "maxWidth": 1280,
  "quality": 80,
  "contactSheet": true
}
```

## Output

```json
{
  "status": {
    "label": "Status",
    "format": "string"
  },
  "video": {
    "label": "Video",
    "format": "string"
  },
  "frameIndex": {
    "label": "Frame",
    "format": "integer"
  },
  "timecode": {
    "label": "Timecode",
    "format": "string"
  },
  "timestampSec": {
    "label": "Time (s)",
    "format": "number"
  },
  "imageUrl": {
    "label": "Image",
    "format": "string"
  },
  "width": {
    "label": "Width",
    "format": "integer"
  },
  "height": {
    "label": "Height",
    "format": "integer"
  },
  "format": {
    "label": "Format",
    "format": "string"
  },
  "bytes": {
    "label": "Size (bytes)",
    "format": "integer"
  },
  "sceneScore": {
    "label": "Scene score",
    "format": "number"
  },
  "chargedEvents": {
    "label": "Charged events",
    "format": "integer"
  },
  "errorCode": {
    "label": "Error code",
    "format": "string"
  },
  "errorMessage": {
    "label": "Error message",
    "format": "string"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Video Frame Extractor - Thumbnails, Scenes & Contact Sheet Actor is ready to run with the inputs already set for "Convert an MP4 video to JPG images, one every 2 seconds". [Sign up or log in](https://console.apify.com/create-task-from-example/dhpcecsqpwTcjC9fd) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Convert an MP4 video to JPG images, one every 2 seconds" task

The Video Frame Extractor - Thumbnails, Scenes & Contact Sheet Actor will start running based on the input automatically. You can also change all the input fields, like video links, which frames, and more, to match your specific use case.

### 3. Receive the "Convert an MP4 video to JPG images, one every 2 seconds" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as status, video, frame, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Convert an MP4 video to JPG images, one every 2 seconds" task via API](https://apify.com/quietworkslab/video-frame-extractor.md).

## FAQ

### How many JPG images does the MP4 to JPG task make?

The MP4 to JPG task saves a frame at 0 s and then one every 2 seconds, up to maxFramesPerVideo (default 50, at most 500). A 1-minute video gives 30 frames; raise the maximum for videos longer than 100 seconds.

### Can I choose another interval or image format?

The MP4 to JPG task uses 2 seconds and JPG. Set intervalSec to any value from 0.1 seconds, and format to PNG or WebP if you prefer; quality (default 80) applies to JPG and WebP.

### How much does the MP4 to JPG task cost?

The Video Frame Extractor charges $0.0015 per saved frame on the FREE tier, less with Apify Store discounts. Video data (1 event per 64 MB from a link, 16 MB from Apify storage) and long decoding count extra. The built-in sample has no frame charge.

## About this Actor

This example demonstrates how to use [Video Frame Extractor - Thumbnails, Scenes & Contact Sheet](https://apify.com/quietworkslab/video-frame-extractor.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/quietworkslab/video-frame-extractor.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/quietworkslab/video-frame-extractor.md

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`).
