# Video Converter & Compressor: MP4, WebM, GIF, MP3, Images (`data-done-right/all-in-one-file-converter`) Actor

Video converter and compressor API: convert video to MP4, WebM or GIF, extract MP3 audio, compress and resize, plus images (PNG, JPG, WebP, TIFF), PDF to images, merge, split and compress PDFs, Office to PDF. Direct download links.

- **URL**: https://apify.com/data-done-right/all-in-one-file-converter.md
- **Developed by:** [Data Done Right](https://apify.com/data-done-right) (community)
- **Categories:** Videos, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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/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 Converter & Compressor: MP4, WebM, GIF, MP3, Images

This **video converter and compressor** is also a **file converter API**: video to MP4, WebM or GIF, audio to MP3, images, PDF and Office files in one place. It is **one Actor for every everyday file conversion**: PDF, Word, Excel, PowerPoint, images, audio and video. Give it file URLs (or records in your Apify key-value store) and a target format. You get back one row per output file with a **direct download URL**, size, page count, dimensions or duration. Built for automation workflows (Make, n8n, Zapier, your own API calls) and **AI agents**, so you don't have to wire up five different converters.

| From | To | How |
|---|---|---|
| **Images**: PNG, JPG, WebP, AVIF, TIFF (multi-page too), BMP, GIF (animated too), HEIC | PNG, JPG, WebP, AVIF, TIFF, BMP, GIF | Resize (max width/height), quality, **strip EXIF/GPS**, auto-rotate. Animated GIF to animated WebP keeps the frames |
| **Images** | **PDF** | One page per image (A4/Letter/… or the image's own size). **JPEGs are embedded losslessly** |
| **PDF** | PNG, JPG, WebP, TIFF… | One image per page, choose DPI and pages (`1-3,5,8-`) |
| **Several PDFs / images / Office files** | **One merged PDF** | Put them in one job |
| **PDF** | Several PDFs (**split**) | By ranges (`1-2,3-5,6-`) or every N pages |
| **PDF** | Smaller PDF (**compress**) | Lossless clean-up, plus recompresses and downsizes big images (medium/high) |
| **Word / Excel / PowerPoint / ODF / RTF / TXT** (docx, doc, xlsx, xls, pptx, ppt, odt, ods, odp, rtf) | **PDF** | LibreOffice. Also converts between Office formats (doc→docx, xls→xlsx, ppt→pptx, docx→odt…) and Office pages to images |
| **XLSX / XLS / ODS** | **CSV** (one per sheet) | Values (not formulas), dates as ISO, optional delimiter / Excel BOM |
| **CSV** | **XLSX** | Numbers detected (leading zeros like ZIP codes stay text); several CSVs in one job = one workbook with a sheet each |
| **Video** (mp4, mov, mkv, webm, avi, wmv, flv, 3gp, ts…) | **MP4** (H.264/AAC), **WebM** (VP9/Opus), **GIF** | Resolution cap, bitrate, CRF, FPS, trim (start/duration), remove audio |
| **Audio or video** | **MP3, M4A, WAV, FLAC, OGG** | Extract or convert audio, bitrate, mono/stereo, sample rate |

### Video converter and compressor

Give it video URLs and pick **MP4, WebM or GIF**, plus a resolution cap, to convert and compress video in one batch. Extract the audio as **MP3, M4A, WAV, FLAC or OGG**. You pay per started minute of output video ($0.017 per minute at 720p and below, counted double at 1080p, and so on up), and failed conversions are free. Each result is a direct download link.

### Why use this file converter

- **One tool, one API, one output shape.** Agents and workflows call the same Actor for PDFs, photos, Office files and media.
- **Direct download links** to every file, stored in the run's key-value store (or a named store you choose).
- **Batch-safe:** a broken link, a corrupt file or a too-long video becomes an `"status": "error"` row (and goes in the `FAILED` record) with a clear reason; the rest of the batch continues.
- **Safe by default:** macros are never executed (fresh LibreOffice profile with macros disabled for every file), per-conversion timeouts, input size cap, sanitized file names, EXIF/GPS stripped from images.
- **Quality-aware:** lossless JPEG embedding for images→PDF, fillable PDF forms keep working after merge/split, PDF compression never returns a bigger file.

### How to convert files (input)

#### Simple mode: many files, one target format

```json
{
  "urls": [
    "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
    "https://example.com/photos/IMG_0042.HEIC"
  ],
  "to": "jpg",
  "maxWidth": 1600,
  "quality": 80
}
```

Each URL is converted separately. A PDF becomes one JPG per page.

#### Jobs mode: merge, split, compress, per-job options

```json
{
  "jobs": [
    {"urls": ["https://example.com/cover.jpg", "https://example.com/report.docx", "https://example.com/annex.pdf"],
     "to": "pdf", "outputName": "full-report"},
    {"url": "https://example.com/big.pdf", "to": "pdf", "operation": "split", "options": {"ranges": "1-2,3-10,11-"}},
    {"url": "https://example.com/scan.pdf", "to": "pdf", "options": {"compression": "high"}},
    {"url": "https://example.com/slides.pptx", "to": "png", "options": {"dpi": 110, "pages": "1-5"}},
    {"url": "https://example.com/sales.xlsx", "to": "csv"},
    {"url": "https://example.com/clip.mov", "to": "mp4", "options": {"maxWidth": 1280, "crf": 26}},
    {"url": "https://example.com/clip.mov", "to": "gif", "options": {"startTime": 3, "duration": 5, "maxWidth": 400}},
    {"url": "https://example.com/interview.mp4", "to": "mp3", "options": {"audioBitrate": "128k"}},
    {"kvStoreId": "my-uploads", "kvKeys": ["invoice-17.docx"], "to": "pdf"}
  ]
}
```

- `url` / `urls` / `kvKeys` (+ `kvStoreId`, ID or name of your key-value store): the inputs.
- `to`: target format: `pdf png jpg webp avif tiff bmp gif csv xlsx docx odt rtf txt pptx odp ods mp4 webm mp3 m4a wav flac ogg`.
- `operation`: `auto` (default), `convert`, `merge`, `split`, `compress`. **Auto:** several inputs + `to: "pdf"` in one job = merge into one PDF; one PDF + `to: "pdf"` = compress; everything else = convert each input.
- `options`: see below. `outputName`: base name for the output file(s).
- Top-level `options` and the common fields (quality, maxWidth, maxHeight, dpi, pages, compression, pageSize, stripMetadata) apply to every job; a job's own `options` win.
- Private Apify record URLs (`https://api.apify.com/v2/key-value-stores/.../records/...`) work too: the run's own token is sent to `api.apify.com` only. Dropbox and Google Drive share links are turned into direct downloads.

#### Options

| Option | Applies to | Meaning |
|---|---|---|
| `maxWidth`, `maxHeight` | images, PDF pages, video | Fit inside the box, keep aspect ratio, never enlarge. Video defaults to a 1080p box |
| `quality` (1-100) | JPG/WebP/AVIF, PDF compression | Default 85 (70 for `compress` on images) |
| `stripMetadata` | images | Default `true`: removes EXIF/GPS/camera data (photo is auto-rotated first). Color profiles are kept |
| `lossless`, `pngColors`, `backgroundColor`, `tiffCompression` | images | WebP lossless; PNG palette size (smaller files); fill color for transparent → JPG; TIFF codec (`tiff_lzw`, `tiff_adobe_deflate`, `raw`…) |
| `dpi` (24-600), `pages`, `transparentBackground` | PDF/Office → images | Default 150 DPI, all pages (up to `maxPagesPerFile`) |
| `pageSize` (`A4`, `Letter`, `Legal`, `A3`, `A5`, `image`), `margin` (pt), `upscale` | images → PDF | Default A4, orientation follows each image |
| `ranges` or `everyNPages` | split | `"1-3,4-"` = 2 files; default = one file per page |
| `compression` (`low`, `medium`, `high`), `maxImagePixels` | PDF compress | low = lossless only; medium = JPEG q75, max 2000 px; high = q55, max 1400 px |
| `password` | PDF inputs | Opens password-protected PDFs |
| `sheets`, `delimiter`, `excelBom` | XLSX → CSV | Only these sheets (names or 1-based numbers); `;` or `tab`; UTF-8 BOM for Excel |
| `delimiter`, `detectNumbers` | CSV → XLSX | Delimiter is auto-detected by default |
| `startTime`, `duration` (seconds) | audio/video | Trim. GIFs default to the first 10 s (max 60 s) |
| `videoBitrate` (`"1500k"`, `"2M"`), `crf`, `fps`, `preset`, `removeAudio` | MP4/WebM | Default CRF 23 (MP4) / 34 (WebM). An H.264/AAC MP4 with no options is remuxed instantly instead of re-encoded |
| `fps`, `gifColors` | GIF | Default 10 fps, 128 colors, 480 px wide |
| `audioBitrate`, `audioChannels`, `sampleRate` | audio | Default MP3 192k, M4A 160k |

### What you get back (output)

One dataset row per output file:

```json
{
  "jobIndex": 1, "status": "ok", "operation": "convert",
  "source": "https://www.irs.gov/pub/irs-pdf/fw9.pdf", "sourceFileName": "fw9.pdf", "sourceFormat": "pdf",
  "sourceSizeBytes": 140815, "targetFormat": "png",
  "fileName": "fw9-p001.png", "key": "001-fw9-p001.png",
  "url": "https://api.apify.com/v2/key-value-stores/AbC123.../records/001-fw9-p001.png?signature=...",
  "contentType": "image/png", "sizeBytes": 160712,
  "page": 1, "pageCount": 6, "width": 1275, "height": 1650, "dpi": 150
}
```

Other fields appear when relevant: `durationSec`, `sheet`, `rowCount`, `savedPercent`, `imagesRecompressed`, `mergedFiles`, `pages`, `frames`, `note`.
Failed jobs give `{"jobIndex": 4, "status": "error", "source": [...], "targetFormat": "mp4", "error": "the input has no video stream; cannot make .mp4"}`. The `OUTPUT` record has a run summary and `FAILED` lists every problem.

### Use cases

- **AI agents and MCP:** "convert this DOCX to PDF", "give me page 3 as PNG", "extract the audio as MP3" with one tool and a predictable answer.
- **Workflows:** turn email attachments into PDFs, images into web-ready WebP thumbnails, XLSX exports into CSV for a database import.
- **Document pipelines:** merge cover + contract + annexes, split scanned batches, shrink scanned PDFs before emailing.
- **Media prep:** MP4 for the web, GIF previews, MP3 from recorded calls (from your own files).

### Limits (honest)

- Input files up to **200 MB** by default (`maxFileSizeMb`, hard cap 500 MB). Audio/video up to **30 min** per file by default (`maxMediaMinutes`, max 180); trim longer media with `startTime`/`duration`. Video output is capped at 1080p unless you set `maxWidth`/`maxHeight`.
- Office conversion uses **LibreOffice**: very complex layouts, exotic fonts and SmartArt can render slightly differently from Microsoft Office. Common fonts (Calibri, Cambria, Arial, Times New Roman) use metric-compatible substitutes. Macros are never run. Encrypted Office files are not supported.
- HTML/TXT → PDF is a simple document render (no JavaScript, no browser). Use a browser-based tool for web pages.
- PDF → Word/Excel (reverse conversion) and OCR are not included.
- Only public URLs or your own Apify storage. No login pages, no bot-protection bypass.
- Output files live in the run's key-value store and follow your Apify data retention. Use `outputStoreName` to keep them in a named store.

### How much does it cost

Pay per event:

- **`converted-file`**: a small fee for each output file delivered. A PDF rendered to 10 PNGs is 10 files, and a merged PDF is 1 file.
- **`media-minute`**: each started minute of output video (MP4, WebM, GIF). It counts x2 at 1080p, x4 at 1440p and x8 at 4K, because transcoding HD video uses far more compute than a document. A GIF always counts as 1.
- **`audio-minute`**: each started minute of output audio (MP3, M4A, WAV, FLAC, OGG).

Failed conversions are free. `maxOutputFiles` and `maxMediaMinutes` cap your cost. Each row shows `billedMediaMinutes` for media outputs.

### FAQ

#### How do I convert a file to PDF?

Put the file URL in `urls` and set `to` to `pdf`. Word, Excel, PowerPoint, OpenDocument, RTF, TXT and images all work. Several inputs with `to: "pdf"` in one job are merged into one PDF.

#### Can it merge, split or compress a PDF?

Yes. Use `jobs` with `operation` set to `merge`, `split` or `compress`. Splitting takes page ranges such as `1-2,3-5,6-` or every N pages. Compression comes in `low`, `medium` and `high` and never returns a bigger file.

#### Are online file converters safe? Do they keep my files?

Your files are downloaded from the URLs you give and the results are written to your own run's key-value store, which follows your Apify data retention. Office files are opened with macros disabled, and image EXIF and GPS data are removed by default. Use only links you trust, and do not send secrets in URLs.

#### Can it convert PDF to Word or run OCR?

No. PDF to Word or Excel and OCR are not included. For scanned PDFs use the PDF to Text converter listed below.

#### Can I convert video to MP4 or GIF, and video to MP3?

Yes. Video can be converted to MP4, WebM or GIF with resolution, bitrate and trim options, and audio or video can be converted to MP3, M4A, WAV, FLAC or OGG.

#### How is it priced?

You pay per output file, plus per started minute for video and audio output. Failed conversions are free, and `maxOutputFiles` and `maxMediaMinutes` cap the cost of a run.

### Related tools

- **[PDF to Text & Markdown Converter with Automatic OCR](https://apify.com/data-done-right/pdf-to-text-ocr)** reads the text and tables of PDFs and scans.
- **Extract ZIP Files: Unzip Archives & Email Attachments** unpacks archives before you convert what is inside.
- **Transcribe Audio to Text: Files, Podcasts & Video URLs** turns the audio you extract into a transcript.

### Questions this Actor answers

- How do I convert a MOV or WebM video to MP4?
- How do I compress a video file before sharing it?
- How do I make a GIF from an MP4 video?
- How do I extract the audio from a video as MP3?
- How do I convert HEIC photos to JPG?
- How do I shrink image file size and strip GPS and EXIF data?
- How do I merge several PDFs into one PDF?
- How do I split a PDF into single pages or page ranges?
- How do I compress a large PDF?
- How do I turn each PDF page into a PNG or JPG image?
- How do I convert Word, Excel or PowerPoint files to PDF?
- How do I convert a TIFF or AVIF image to PNG?

### Use with AI agents (Apify MCP)

Add this Actor as its own tool: `https://mcp.apify.com?tools=data-done-right/all-in-one-file-converter`. Example input: `{"urls": ["https://example.com/clip.mov"], "to": "mp4"}`.

# Actor input Schema

## `urls` (type: `array`):

Direct links to the files to convert. Each file is converted separately into the format below. Dropbox and Google Drive share links are turned into direct downloads automatically.

## `to` (type: `string`):

Target format for the URLs above (and the default for jobs that don't set their own 'to').

## `jobs` (type: `array`):

Each job: {"url" or "urls" or "kvKeys", "to", "operation" (auto | convert | merge | split | compress), "options", "outputName"}. Several urls + to=pdf in ONE job are merged into one PDF (images, PDFs and Office files can be mixed). See the README for every option.

## `options` (type: `object`):

Options applied to every job (a job's own options win). E.g. {"maxWidth": 1600, "quality": 80, "dpi": 200, "pages": "1-3", "ranges": "1-2,3-5", "startTime": 5, "duration": 10, "videoBitrate": "1M", "audioBitrate": "128k"}.

## `quality` (type: `integer`):

JPG/WebP/AVIF quality, and image quality when compressing PDFs. Empty = sensible default (85 for images, 70 for image compression).

## `maxWidth` (type: `integer`):

Shrink images, rendered PDF pages and videos to fit this width (keeps aspect ratio, never enlarges).

## `maxHeight` (type: `integer`):

Shrink to fit this height (keeps aspect ratio, never enlarges).

## `stripMetadata` (type: `boolean`):

Removes EXIF/GPS/camera data from image outputs (photos are auto-rotated first). Color profiles are kept.

## `dpi` (type: `integer`):

Render resolution for PDF/Office pages to images. Default 150 (screen). Use 300 for print/OCR.

## `pages` (type: `string`):

Which pages to render, e.g. 1-3,5,10- (empty = all, up to 'Max pages per file').

## `compression` (type: `string`):

Used when a PDF is converted to PDF (compress).

## `pageSize` (type: `string`):

Page size when images become PDF pages (orientation follows the image). Default A4.

## `keyValueStoreId` (type: `string`):

Convert records from one of your Apify key-value stores. Also the default store for jobs that use kvKeys.

## `keys` (type: `array`):

Record keys in the store above to convert to the 'Convert to' format.

## `outputStoreName` (type: `string`):

Optional. Save converted files into this named key-value store (kept until you delete it) instead of the run's default store.

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

Bigger files are skipped and reported in FAILED. Hard cap 500 MB.

## `maxPagesPerFile` (type: `integer`):

Cap on pages rendered to images (and images placed into one PDF). Also caps cost.

## `maxMediaMinutes` (type: `integer`):

Longer media is rejected unless you trim it with options.startTime / options.duration. GIFs are always short (default 10 s, max 60 s).

## `conversionTimeoutSecs` (type: `integer`):

A conversion that takes longer is stopped and reported; the batch continues.

## `maxOutputFiles` (type: `integer`):

Stops after this many delivered files (caps cost).

## `maxConcurrency` (type: `integer`):

Jobs processed at the same time. Video transcodes always run one at a time.

## `proxyConfiguration` (type: `object`):

Only needed if a file host blocks datacenter IPs.

## Actor input object example

```json
{
  "urls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ],
  "to": "png",
  "jobs": [],
  "stripMetadata": true,
  "maxFileSizeMb": 200,
  "maxPagesPerFile": 200,
  "maxMediaMinutes": 30,
  "conversionTimeoutSecs": 600,
  "maxOutputFiles": 1000,
  "maxConcurrency": 2,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

All result items of this run (the default dataset), as JSON, CSV, Excel and more.

## `records` (type: `string`):

Key-value store records: the run summary, notes on any problems, and any files.

# 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 = {
    "urls": [
        "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
    ],
    "to": "png",
    "jobs": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("data-done-right/all-in-one-file-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 = {
    "urls": ["https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"],
    "to": "png",
    "jobs": [],
}

# Run the Actor and wait for it to finish
run = client.actor("data-done-right/all-in-one-file-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 '{
  "urls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ],
  "to": "png",
  "jobs": []
}' |
apify call data-done-right/all-in-one-file-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,data-done-right/all-in-one-file-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/QK1QqWsNTQ9pgN79o/builds/ZUFdONTz3KGOoDrJi/openapi.json
