# Video Compressor & Audio Extractor (MP4, MP3) (`abzalp/video-compressor-converter`) Actor

Compress and convert video files (MP4, WebM, MOV) with customizable CRF and resolution presets (4K to 1080p/720p). Extract clean MP3 audio from any video.

- **URL**: https://apify.com/abzalp/video-compressor-converter.md
- **Developed by:** [Abdul Basit](https://apify.com/abzalp) (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 hd minutes

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

[![Apify Store](https://img.shields.io/badge/Apify%20Store-Run%20Actor-FF9800?style=for-the-badge\&logo=apify\&logoColor=white)](https://apify.com/abzalp/video-compressor-converter)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge)](LICENSE)
[![Free Tier Supported](https://img.shields.io/badge/Free%20Tier-5%20USD%20Monthly-brightgreen?style=for-the-badge)](https://apify.com/abzalp/video-compressor-converter)

> 🚀 **[Run this Actor on Apify Store](https://apify.com/abzalp/video-compressor-converter)** — Instant cloud execution with zero setup, zero proxies needed, and free monthly credits.

Make **your own videos** smaller, shrink them to a target size, convert them to MP4 or WebM, trim them, or save just the sound as MP3. Paste direct file links, or process every video link in a dataset.

**What you get**

- 🗜️ **Compress** with three quality levels, or to **at most a size you choose**, for example 10 MB.
- 🔁 **Convert** MOV, MKV, AVI, WebM and more to **MP4 (H.264 video)** or **WebM (VP8 + Opus)**.
- ✂️ **Trim** the start and end, remove the sound, or **save the sound as MP3**.
- 📐 **Resize** to 1080p, 720p, 480p or 360p. Videos are never enlarged, and upright phone videos stay upright.
- 🔊 **Sound:** in MP4, an ordinary AAC sound track (the usual kind in MP4 and MOV files) is kept as it is; other sound is saved as MP3.
- 💸 **Fair:** files that can't be read, and compressed results that aren't smaller than your file, are **not charged**.

### How much does it cost?

Pay-per-event pricing: a small start fee per run (it grows with the memory you give the run), plus a fee per **started minute of video** in each result. A minute counts as **HD** when the result's short side is above 480 pixels, **or your video is larger than 1080p** (such as 4K), because large videos take much more computing. Otherwise it counts as **SD**. MP3 results count as SD. A 20-second clip is billed as 1 minute and a 61-second video as 2. If you trim, only the kept part counts. The **Pricing** tab shows current prices. You can set a maximum cost per run, and the Actor won't start a video your limit can't cover.

### Try it first

The input contains the word `sample`, which processes a short test video that comes with the Actor. It's billed like any other video (1 minute). Replace it with your own links.

### Input example

```json
{
    "videoUrls": ["https://example.com/my-video.mov"],
    "task": "compress",
    "targetSizeMb": 25,
    "maxResolution": "720"
}
```

### Output

The new files are saved in the run's **key-value store**, and the dataset has one row per link:

```json
{
    "inputUrl": "https://example.com/my-video.mov",
    "status": "done",
    "outputUrl": "https://api.apify.com/v2/key-value-stores/.../records/video-0001.mp4",
    "inputMB": 84.2,
    "outputMB": 23.9,
    "savedPercent": 72,
    "outputWidth": 1280,
    "outputHeight": 720,
    "outputSeconds": 95.4,
    "billedMinutes": 2,
    "billedAs": "hd-minute"
}
```

Statuses: `done`, `not-smaller` (compressing didn't help; free), `skipped-limit` (not started because of your cost limit; free) and `failed` (with the reason; free). Anyone who has a file's link may be able to download it.

### Limits

- Up to **500 MB** and **60 minutes** per file. The result's short side is at most **1080 pixels** and its long side at most 1920.
- Input up to **4K at 60 frames a second**. **WebM** output is for inputs up to **1080p at 60 fps**; for larger videos choose MP4. Files over these limits fail with a message and aren't charged.
- Videos with more than 30 frames a second, such as 60 fps recordings, are saved at **30 fps or less** (60 becomes 30, 50 becomes 25).
- The result has the first video track and the first sound track. Subtitles, extra tracks and file metadata (such as where a phone video was filmed) are removed.
- With a **target size**, if the size is too small for the picture you chose, the picture is made smaller so it still looks clean. A result at 480p or lower is billed as SD, unless your video is larger than 1080p. If the video can't fit, it fails with a message and isn't charged.
- Videos are processed one after another. For long videos, raise the **timeout** in Run options. A run that was restarted or resurrected skips videos it already finished.
- **Direct file links only.** Pages on video sites (such as YouTube or TikTok) and playlist files (HLS, DASH) are refused. Private network addresses are refused too.

### Rules

Process only videos you own or have permission to use. This Actor isn't a downloader.

### Privacy

Files are processed inside your own Apify run with FFmpeg and aren't sent to another service. The temporary copies are deleted after each video. The Actor runs with **limited permissions**.

*This Actor uses FFmpeg. It is independent and isn't affiliated with the FFmpeg project or any video platform.*

### Support

Found a bug or need a feature? Open an issue on the **Issues** tab, and include the run link.

***

### 🔗 Related Developer Tools & Ecosystem

Extend your automation workflows with our companion tools on the Apify Store:

- 📄 **[YouTube Transcript & Subtitle Extractor](https://apify.com/abzalp/youtube-transcript-extractor)** — Extract clean video transcripts in Markdown & JSON for AI and LLMs.
- 📊 **[Google Sheets Sync & Importer](https://apify.com/abzalp/google-sheets-sync)** — Automatically export and append Apify dataset rows directly to Google Sheets.
- 📑 **[Dataset to Excel Report Generator](https://apify.com/abzalp/dataset-to-excel-report)** — Convert raw scraping datasets into styled, formatted Excel (.xlsx) reports with auto-filters.
- 📸 **[Website Screenshot & PDF Capture API](https://apify.com/abzalp/website-screenshot)** — Capture full-page screenshots and PDFs with mobile/retina presets and ad-blocking.
- 🖼️ **[AI Image Upscaler & Enhancer](https://apify.com/abzalp/ai-image-upscaler)** — Upscale low-resolution photos and images to 4K Ultra HD.
- 🎥 **[Video Compressor & Audio Extractor](https://apify.com/abzalp/video-compressor-converter)** — Fast video compression, format conversion, and clean MP3 audio extraction.

# Changelog

This Actor's version history is a separate document: https://apify.com/abzalp/video-compressor-converter/changelog.md

# Actor input Schema

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

Direct links to your own video or audio files (MP4, MOV, MKV, WebM, AVI and more), up to 500 MB and 60 minutes each. The word sample uses a short test video that comes with the Actor. Pages on video sites are not supported.

## `task` (type: `string`):

Compress makes the file smaller (not charged if it isn't smaller). Convert changes the format at high quality. MP3 saves just the sound.

## `outputFormat` (type: `string`):

MP4 plays almost everywhere. WebM is a web format.

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

Used by Compress when no target size is set.

## `targetSizeMb` (type: `integer`):

Compress to at most this many megabytes, for example 10. 0 means no target. A small target gets a smaller picture, which looks better.

## `maxResolution` (type: `string`):

The short side of the picture. Videos are never enlarged. The most is 1080.

## `startSeconds` (type: `integer`):

Cut off the beginning.

## `endSeconds` (type: `integer`):

Cut off everything after this point. 0 means the end of the video.

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

Make a silent video.

## `datasetId` (type: `string`):

Process every video link in a dataset. When you connect this Actor as an integration, use {{resource.defaultDatasetId}}.

## `urlField` (type: `string`):

The dataset field that holds the video link. Leave empty to detect common names.

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

Process at most this many. 0 means all.

## Actor input object example

```json
{
  "videoUrls": [
    "sample"
  ],
  "task": "compress",
  "outputFormat": "mp4",
  "quality": "balanced",
  "targetSizeMb": 0,
  "maxResolution": "720",
  "startSeconds": 0,
  "endSeconds": 0,
  "removeAudio": false,
  "maxVideos": 0
}
```

# Actor output Schema

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

No description

## `files` (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": [
        "sample"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("abzalp/video-compressor-converter").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": ["sample"] }

# Run the Actor and wait for it to finish
run = client.actor("abzalp/video-compressor-converter").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": [
    "sample"
  ]
}' |
apify call abzalp/video-compressor-converter --silent --output-dataset

```

## MCP server setup

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

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/eVRJBTPs261BKRU8c/builds/SKhRJPWUc1lWFJLfu/openapi.json
