# Video Compressor & Converter (MP4, WebM, MOV, GIF, Bulk) (`toowl/video-compressor`) Actor

Compress and convert videos in bulk from URLs: shrink MP4 for email, WhatsApp or the web, MOV/AVI/MKV/WebM to MP4 or WebM, resize to 1080p/720p/480p, trim, mute or make a GIF. Pay per minute.

- **URL**: https://apify.com/toowl/video-compressor.md
- **Developed by:** [Chalid Ade](https://apify.com/toowl) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $30.00 / 1,000 video minutes processed

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/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 Compressor & Converter — MP4, WebM, MOV, GIF in bulk

Compress and convert videos in bulk from URLs. Shrink an **MP4 for email, WhatsApp or your website**, turn **MOV, AVI, MKV or WebM into MP4**, make a **WebM (VP9)** for the web, resize to **1080p / 720p / 480p**, trim, mute, or make an **animated GIF** — hundreds of videos per run.

Runs ffmpeg inside the Actor: no third-party API, your files go nowhere else.

### Features

- **Constant-quality compression** (x264 CRF / VP9 CRF): three levels — high quality, balanced, smallest file.
- **Convert** to MP4 (H.264 + AAC, plays everywhere), WebM (VP9 + Opus), MOV, MKV or GIF.
- **Resize** by capping the short side (2160p … 360p). Never upscales. Phone rotation is applied.
- **Trim** with start/end seconds, **cap the frame rate**, **remove audio**.
- **Fast start** MP4 (plays while downloading).
- **Privacy**: GPS, device and date metadata removed by default.
- If a small, already-efficient MP4 would come out bigger, you get the original back.
- **Pay per minute of output video.** Failed files are free.

### Input

```json
{
  "files": [
    { "url": "https://example.com/IMG_1234.MOV" },
    { "url": "https://example.com/webinar.mp4" }
  ],
  "format": "mp4",
  "quality": "medium",
  "resolution": "720p"
}
```

| Field | Default | Notes |
| --- | --- | --- |
| `files` | — | Video URLs (MP4, MOV, MKV, WebM, AVI, M4V, 3GP, FLV, WMV, TS…) |
| `format` | `mp4` | `mp4`, `webm`, `mov`, `mkv`, `gif` |
| `quality` | `medium` | `high`, `medium`, `small` |
| `resolution` | `original` | `2160p`, `1440p`, `1080p`, `720p`, `480p`, `360p` |
| `fps` | — | Max frame rate (GIF default 12) |
| `removeAudio` | false | |
| `trimStart`, `trimEnd` | — | Seconds |
| `gifWidth` | 480 | GIF only |
| `keepMetadata` | false | |
| `maxFileSizeMb` | 500 | Give the run more memory for very large files |

### Output

Videos go to the run's key-value store; the dataset has one row per file:

```json
{
  "url": "https://example.com/IMG_1234.MOV",
  "name": "IMG_1234.MOV",
  "downloadUrl": "https://api.apify.com/v2/key-value-stores/…/records/0001-IMG_1234.mp4",
  "outputFormat": "mp4",
  "duration": 42.5,
  "minutes": 1,
  "widthBefore": 1920, "heightBefore": 1080,
  "width": 1280, "height": 720,
  "sizeBefore": 84211903,
  "sizeAfter": 9113302,
  "savedPercent": 89.2
}
```

### Pricing

Pay per event: one `video-minute` per started minute of output video (a 2 min 10 s video = 3). Failed files are free. Cap spending with "Max cost per run". More memory = more CPU = faster runs.

### Integrations

Use it from the Apify API, Zapier, Make, n8n or a webhook: compress every upload in a Drive/Dropbox folder, every new product video, or user uploads before they hit your storage.

### Free browser version

A few videos by hand? [toowl.my.id/en/compress-video](https://toowl.my.id/en/compress-video/) compresses in your browser, free, nothing uploaded.

### Call it from your code

```bash
curl -X POST "https://api.apify.com/v2/acts/toowl~video-compressor/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"files":[{"url":"https://example.com/your-file"}]}'
```

The same call works from Python (`apify-client`), JavaScript, Make, Zapier and n8n (Apify app/node or a plain HTTP request).

### Use it from AI agents (MCP)

Add this Actor as a tool to Claude, Cursor, VS Code or any MCP client through Apify's MCP server:

```
https://mcp.apify.com/?actors=toowl/video-compressor
```

The agent can then pass file URLs and read the results itself.

### More toowl file APIs

Speech to text & subtitles, AI vocal remover, text to speech, AI object remover, PDF to Markdown, PDF to Word & Excel, HTML/URL to PDF, OCR, Office to PDF, PDF compressor, PDF merge/split, PDF password protect, PDF to image, image to PDF, bulk watermark, image converter and compressor, background remover, AI upscaler, image to SVG, QR code and barcode generators, QR/barcode reader, favicon generator, video compressor, frame extractor and audio converter. All pay per file, all batch-friendly: [toowl.my.id/en/api](https://toowl.my.id/en/api/).

Questions or a format that fails? Open an issue on the Actor's **Issues** tab.

# Actor input Schema

## `files` (type: `array`):

Direct links to the videos. Accepted: MP4, MOV, MKV, WebM, AVI, M4V, 3GP, FLV, WMV, MPEG-TS and most others ffmpeg reads.

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

File type of the output.

## `quality` (type: `string`):

Constant-quality encoding: the file is as small as the chosen quality allows.

## `resolution` (type: `string`):

Caps the short side (height of a landscape video). Smaller videos are never enlarged. 720p is a good choice for WhatsApp and email.

## `fps` (type: `integer`):

Leave empty to keep the original. For GIF the default is 12.

## `removeAudio` (type: `boolean`):

Mute the video (also makes it smaller).

## `trimStart` (type: `number`):

Cut everything before this point.

## `trimEnd` (type: `number`):

Cut everything after this point.

## `gifWidth` (type: `integer`):

Only for GIF output.

## `keepMetadata` (type: `boolean`):

Off by default: GPS location, device and date tags are removed.

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

Larger files are skipped with an error (not charged). Give the run more memory for very large files.

## Actor input object example

```json
{
  "files": [
    {
      "url": "https://raw.githubusercontent.com/chalidade/tools/main/apify/samples/sample-video.mp4"
    }
  ],
  "format": "mp4",
  "quality": "medium",
  "resolution": "original",
  "removeAudio": false,
  "gifWidth": 480,
  "keepMetadata": false,
  "maxFileSizeMb": 500
}
```

# Actor output Schema

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

One row per input file, with a download link for the result where there is one.

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

Result files in the default key-value store, plus a SUMMARY record.

# 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 = {
    "files": [
        {
            "url": "https://raw.githubusercontent.com/chalidade/tools/main/apify/samples/sample-video.mp4"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("toowl/video-compressor").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 = { "files": [{ "url": "https://raw.githubusercontent.com/chalidade/tools/main/apify/samples/sample-video.mp4" }] }

# Run the Actor and wait for it to finish
run = client.actor("toowl/video-compressor").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 '{
  "files": [
    {
      "url": "https://raw.githubusercontent.com/chalidade/tools/main/apify/samples/sample-video.mp4"
    }
  ]
}' |
apify call toowl/video-compressor --silent --output-dataset

```

## MCP server setup

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

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/vUH9xqwfiZWzwGIe9/builds/VQEoPmJGC7mWQOVGF/openapi.json
