# Compress a video to 10 MB (MP4, 720p)

**Use case:** 

Compresses a video link to an MP4 aimed at a size you set and shrinks it to 720p. This example turns a 70-second 1080p NASA video of 72,214,235 bytes into a 1280x720 MP4 of 7,445,851 bytes, under the 10 MB target (10,485,760 bytes). $0.05 per started minute of 720p video per file ($0.08 for sources above 1080p); failed files are free.

## Input

```json
{
  "files": [
    "https://images-assets.nasa.gov/video/BalloonAscension_TL_VOTY/BalloonAscension_TL_VOTY~large.mp4"
  ],
  "fileFields": [
    "url"
  ],
  "operation": "video",
  "videoFormat": "mp4",
  "resolution": "720p",
  "quality": "balanced",
  "targetSizeMb": 10,
  "maxFps": 0,
  "mute": false,
  "audioFormat": "mp3",
  "audioKbps": 0,
  "channels": "keep",
  "sampleRate": "keep",
  "normalizeLoudness": false,
  "gifWidth": 480,
  "gifFps": 10,
  "frameCount": 5,
  "frameEverySeconds": 0,
  "frameFormat": "jpg",
  "frameWidth": 0,
  "maxFiles": 100,
  "maxMinutesPerFile": 60,
  "maxFileSizeMb": 1024,
  "maxConcurrency": 2
}
```

## Output

```json
{
  "fileIndex": {
    "label": "#",
    "format": "number"
  },
  "url": {
    "label": "Source",
    "format": "link"
  },
  "operation": {
    "label": "Operation",
    "format": "text"
  },
  "status": {
    "label": "Status",
    "format": "text"
  },
  "fileUrl": {
    "label": "Output file",
    "format": "link"
  },
  "format": {
    "label": "Format",
    "format": "text"
  },
  "durationSec": {
    "label": "Seconds",
    "format": "number"
  },
  "width": {
    "label": "Width",
    "format": "number"
  },
  "height": {
    "label": "Height",
    "format": "number"
  },
  "bytes": {
    "label": "Bytes",
    "format": "number"
  },
  "frameTimeSec": {
    "label": "Frame at (s)",
    "format": "number"
  },
  "sourceDurationSec": {
    "label": "Source seconds",
    "format": "number"
  },
  "sourceBytes": {
    "label": "Source bytes",
    "format": "number"
  },
  "note": {
    "label": "Note",
    "format": "text"
  },
  "billable": {
    "label": "Billable",
    "format": "boolean"
  },
  "error": {
    "label": "Error",
    "format": "text"
  }
}
```

## How it works

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

The Video & Audio Converter (FFmpeg): Compress, MP3, GIF, Frames Actor is ready to run with the inputs already set for "Compress a video to 10 MB (MP4, 720p)". [Sign up or log in](https://console.apify.com/create-task-from-example/NcHpKBUDmtW1Dqs2f) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Compress a video to 10 MB (MP4, 720p)" task

The Video & Audio Converter (FFmpeg): Compress, MP3, GIF, Frames Actor will start running based on the input automatically. You can also change all the input fields, like files, file link fields, and more, to match your specific use case.

### 3. Receive the "Compress a video to 10 MB (MP4, 720p)" 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 #, source, operation, 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 "Compress a video to 10 MB (MP4, 720p)" task via API](https://apify.com/kadben/video-audio-converter.md).

## FAQ

### How does the compress video task reach the size target?

The compress video task sets the bitrate from the length and the target (1 MB = 1,048,576 bytes) and encodes once more a little lower if the file is bigger; a row note says when it still is. The example came out at 7,445,851 bytes.

### How much does the compress video task cost?

The compress video task charges $0.05 per started minute of 720p output per file: the example is 2 minutes, $0.10, plus the $0.0002 start event. Over 30 fps counts twice; $0.015 per started 100 MB beyond the first 100 MB.

### Which videos can the compress video task read?

The compress video task reads direct links to MP4, MOV, WebM, MKV and other files FFmpeg reads. HEVC (H.265) video, pages of video platforms and HLS playlists are not processed and are free.

## About this Actor

This example demonstrates how to use [Video & Audio Converter (FFmpeg): Compress, MP3, GIF, Frames](https://apify.com/kadben/video-audio-converter.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/kadben/video-audio-converter.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/kadben/video-audio-converter.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`).
