# Video & Audio Converter (FFmpeg): Compress, MP3, GIF, Frames (`kadben/video-audio-converter`) Actor

Video and audio converter (FFmpeg API): compress video to MP4/WebM or a target size, extract MP3/M4A/WAV, fast cut, GIFs, thumbnails, burn-in subtitles, media info, from links or datasets. $0.05 per video minute (720p), $0.003 per audio minute; failed files free.

- **URL**: https://apify.com/kadben/video-audio-converter.md
- **Developed by:** [Kadben](https://apify.com/kadben) (community)
- **Categories:** Videos, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $42.50 / 1,000 video minute (up to 720p)s

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 & Audio Converter (FFmpeg): Compress, MP3, GIF, Frames

**Video and audio converter (FFmpeg API)** for Apify: compress or convert videos to **MP4 or WebM** (optionally to a target size in MB), extract **MP3, M4A, WAV, FLAC or OGG** audio, cut clips without re-encoding, make **animated GIFs** and **thumbnails**, burn **SRT/WebVTT subtitles** into a video, or read media info. Files come from links or from a field of your datasets; results are files in the run's storage plus one ZIP link. **From $0.05 per minute of video up to 720p, $0.003 per minute of audio, $0.001 per frame.** Failed files are free.

Why use it:

- **FFmpeg without a server.** Run FFmpeg jobs from n8n Cloud, Make, Zapier, the API or an AI agent, where you cannot install FFmpeg yourself.
- **Compress to a size.** Set `targetSizeMb` (e.g. 25 for e-mail) and the bitrate is computed from the length; a file that still comes out too big is encoded once more a little lower.
- **Subtitles that match the cut.** Burn in an SRT or WebVTT file, for example from our [Audio & Video Transcription](https://apify.com/kadben/audio-video-transcription) Actor; with `start` set, the subtitle times are shifted to the clip.
- **Six jobs in one Actor.** Video, audio, fast cut, GIF, frames and media info, for 1 to 1,000 files per run.
- **Works after scrapers and feeds.** Pick a dataset and the field with the links (for example `fileUrl` of Bulk File Downloader).
- **Safe with any link.** Only public addresses, every redirect checked, sizes capped, FFmpeg in a separate process with a time limit.

### What it does

- **Input:** direct links to video or audio files in `files`, or `datasets` with the fields that hold the links (`fileFields`). Dropbox and Google Drive share links are turned into download links. Pages of video platforms, HLS (`.m3u8`) and DASH (`.mpd`) playlists are not supported.
- **Reads:** what the Debian build of FFmpeg 7.1 reads, e.g. MP4, MOV, M4V, WebM, MKV, AVI, MPEG-TS, 3GP, FLV, WMV, OGV; MP3, M4A, AAC, WAV, FLAC, OGG, Opus, WMA, AIFF, AMR. Video in HEVC (H.265) or VVC (H.266), common on newer phones, is not decoded because of how these codecs are licensed: `cut`, `audio` and `probe` work on such files, `video`, `gif` and `frames` return a free `error`.
- **Operations** (`operation`):

| Operation | Output | Main options |
|---|---|---|
| `video` | MP4 (H.264 + AAC) or WebM (VP9 + Opus) | `resolution` (short side, never enlarged), `quality` or `targetSizeMb`, `maxFps`, `mute`, `subtitlesUrl` |
| `audio` | MP3, M4A (AAC), WAV (16-bit), FLAC, OGG (Opus) | `audioKbps`, `channels`, `sampleRate`, `normalizeLoudness` (-16 LUFS) |
| `cut` | the same codecs in the source's container (MP4, MOV, WebM, MKV, MP3, M4A …) | stream copy: very fast, no quality loss; the start snaps to a keyframe; not for raw streams (.h264, .hevc) |
| `gif` | animated GIF, up to 30 s | `gifWidth`, `gifFps` |
| `frames` | JPEG, PNG or WebP images | `frameCount` (evenly spaced), `frameEverySeconds` or `frameTimes`, `frameWidth` |
| `probe` | no file: one row with duration, size, codecs, frame rate | — |

`start` and `end` (seconds or times such as `1:30`) select a part of each file for every operation except `probe`.

- **Output:** files in the run's key-value store (keys `out-00001-<name>.<ext>`), one dataset row per output file (a row per frame for `frames`), and an `OUTPUT` summary with a `zipUrl` that downloads all files as one ZIP.

### How it works

1. **Collect the links.** From `files` first, then from your datasets, each link once, up to `maxFiles`. A value in `files` that is not an http(s) link gets an `error` row.
2. **Download safely.** The host must resolve to a public IP; private, loopback and cloud metadata addresses are refused, and every redirect is checked again. Web pages, images and playlists are refused before the body is read. HTTP 408, 425, 429, 500, 502, 503, 504 and dropped connections get 2 more tries.
3. **Read the file.** `ffprobe` reads the duration, tracks, size and rotation. A file that is not media (for example a login page served as `video/mp4`) gets an `error` row and is free. Phone videos with a rotation flag are turned upright.
4. **Run FFmpeg.** In a separate process with a time limit that scales with the length and the run's CPU, stopped cleanly if the run migrates or nears its timeout. H.264 uses the `veryfast` preset (CRF 20 / 23 / 28 for high / balanced / small); VP9 uses real-time mode.
5. **Save, then charge.** Each file is uploaded to the key-value store, its row is written (`billable: true`), and only then charged, at most the amount reserved for it before processing. After a restart, saved rows are matched to their link by `sourceId`, so nothing is processed or charged twice.

The User-Agent is `KadbenMediaConverter/0.1 (+https://apify.com/kadben)`. The Actor keeps no cookies. Your files are processed in the run only; they are not sent to any outside service.

### Input

| Field | Default | What it does |
|---|---|---|
| `files` | — | Direct video or audio links, one per line. |
| `datasets` / `fileFields` | — / `["url"]` | Datasets whose rows hold file links, and the fields: `videoUrl`, `media.url`, `media.*.url`. |
| `operation` | `video` | `video`, `audio`, `cut`, `gif`, `frames` or `probe`. |
| `start` / `end` | beginning / end | Part of each file, in seconds (`90`) or as a time (`1:30`, `01:02:03.5`). |
| `videoFormat` | `mp4` | `mp4` (H.264 + AAC) or `webm` (VP9 + Opus). |
| `resolution` | `keep` | `2160p` … `240p`: the shorter side at most this size (720p = 1280 × 720 or 720 × 1280). Never enlarges. |
| `quality` | `balanced` | `high`, `balanced` or `small` when no `targetSizeMb` is set. |
| `targetSizeMb` | 0 | Aim at this size (1 MB = 1,048,576 bytes). 0 = off. |
| `maxFps`, `mute` | 0, `false` | Lower the frame rate (never raised); drop the sound. |
| `subtitlesUrl` | — | SRT or WebVTT link to burn into the video (DejaVu Sans, white with an outline). |
| `audioFormat`, `audioKbps` | `mp3`, 0 | 0 = MP3 192, M4A 160, OGG 128 kbps. MP3 at 16, 22.05 or 24 kHz allows at most 160 kbps and at 8–12 kHz at most 64, so such audio comes out at that bitrate. |
| `channels`, `sampleRate`, `normalizeLoudness` | `keep`, `keep`, `false` | Mono/stereo; resample (Opus only 8, 12, 16, 24 or 48 kHz; other rates become 48 kHz); EBU R128 loudness to -16 LUFS. |
| `gifWidth`, `gifFps` | 480, 10 | GIF size (never wider than the video) and frame rate; at most 30 s from `start`. |
| `frameCount`, `frameEverySeconds`, `frameTimes`, `frameFormat`, `frameWidth` | 5, 0, —, `jpg`, 0 | Evenly spaced frames, one every N seconds (at most 300), or exact times. |
| `maxFiles`, `maxMinutesPerFile`, `maxFileSizeMb`, `maxConcurrency` | 100, 60, 1024, 2 | Limits (files at once are lowered to fit the run's disk; at most 2 downloads from one site). |

Minimal input (compress a video to 720p MP4):

```json
{ "files": ["https://images-assets.nasa.gov/video/BalloonAscension_TL_VOTY/BalloonAscension_TL_VOTY~large.mp4"], "operation": "video", "resolution": "720p" }
```

Extract MP3 from every video of a dataset:

```json
{ "datasets": ["<datasetId>"], "fileFields": ["fileUrl"], "operation": "audio", "audioFormat": "mp3" }
```

### Output

A real row from a platform run (2026-11-20, build 0.1.4 with prices on, 1080p NASA video to 720p at 4 GB; the signed link shortened):

```json
{
  "fileIndex": 0,
  "sourceId": "5ab083075fb3dfada648",
  "url": "https://images-assets.nasa.gov/video/BalloonAscension_TL_VOTY/BalloonAscension_TL_VOTY~large.mp4",
  "operation": "video",
  "status": "ok",
  "error": null,
  "note": null,
  "sourceContainer": "mov,mp4,m4a,3gp,3g2,mj2",
  "sourceDurationSec": 70.467,
  "sourceWidth": 1920,
  "sourceHeight": 1080,
  "sourceVideoCodec": "h264",
  "sourceAudioCodec": "aac",
  "sourceFps": 30,
  "sourceBytes": 72214235,
  "format": "mp4",
  "durationSec": 70.467,
  "width": 1280,
  "height": 720,
  "bytes": 13923674,
  "frameTimeSec": null,
  "fileName": "BalloonAscension_TL_VOTY_large.mp4",
  "key": "out-00001-BalloonAscension_TL_VOTY_large.mp4",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/EmziYyLzPzCNe6W4q/records/out-00001-BalloonAscension_TL_VOTY_large.mp4?signature=…",
  "finalUrl": "https://images-assets.nasa.gov/video/BalloonAscension_TL_VOTY/BalloonAscension_TL_VOTY~large.mp4",
  "httpStatus": 200,
  "sources": ["input"],
  "billable": true,
  "charges": {"video-minute": 2},
  "ms": 48433,
  "processedAt": "2026-11-20T17:46:48Z"
}
```

| Field | Type | Meaning |
|---|---|---|
| `status` | text | `ok`, `error` (not processed: the reason is in `error`, free) or `skipped` (not done and free: the run's timeout or maximum charge; a resurrected run tries it again). |
| `fileUrl`, `key`, `fileName` | text | Signed link to the output file (opens without a token), its record key, its name. |
| `format`, `durationSec`, `width`, `height`, `bytes` | text, numbers | The output file (`durationSec` for video, audio and cuts). |
| `frameTimeSec` | number | For `frames`: the time of the frame in the source, in seconds. |
| `source…` | text, numbers | What ffprobe found in the source: container, length, size (upright), codecs, frame rate, bytes. For `probe` these are the result. |
| `charges` | object | The events billed for this file, e.g. `{"video-minute": 2}`. |
| `note` | text | E.g. "only the first 60 min after 'Start' were processed", "fast cut: the start snaps to the nearest earlier keyframe", a target size that was not reached. |
| `fileIndex`, `sourceId`, `url`, `finalUrl`, `httpStatus`, `sources` | number, text | Which link the row belongs to (`sourceId` is a hash of the link, stable across restarts), the address after redirects, where the link came from. |
| `billable`, `ms` | boolean, number | Whether the row is billed (saved first, charged right after); processing time. |

The `OUTPUT` record holds the counts (`processed`, `outputs`, `errors`, `skipped`), `sourceBytes`, `outputBytes`, `outputSeconds`, what was charged (`chargedVideoMinutes`, `chargedFullHdMinutes`, `charged4kMinutes`, `chargedAudioMinutes`, `chargedFastCutMinutes`, `chargedFrames`, `chargedGifSeconds`, `chargedProbes`, `chargedExtra100mb`, and `filesNotCharged`), `failures` and `zipUrl`. Files follow Apify data retention; copy them if you need permanent links.

### Pricing

| Event | When | Price |
|---|---|---|
| `video-minute` | Each started minute of converted video, output up to 720p (shorter side) | $0.05 |
| `fullhd-video-minute` | Each started minute, output up to 1080p, or any output from a source above 1080p | $0.08 |
| `4k-video-minute` | Each started minute, output above 1080p | $0.30 |
| `audio-minute` | Each started minute of extracted or converted audio | $0.003 |
| `fast-cut-minute` | Each started minute of a fast cut | $0.01 |
| `frame` | Each saved frame image | $0.001 |
| `gif-second` | Each started second of a GIF | $0.001 |
| `file-probed` | Each file read with `probe` | $0.002 |
| `extra-100mb` | Each started 100 MB (104,857,600 bytes) beyond the first 100 MB of a file, counted on the bigger of the source and the output, but never more blocks than were reserved before processing (from the source's size; for WAV and FLAC output from the uncompressed size of the selected part) | $0.015 |

**Paid Apify plans pay less.** Apify Store discounts apply automatically: `video-minute`: Bronze 5%, Silver 10%, Gold and higher 15% off; `fullhd-video-minute`, `4k-video-minute`: Bronze 5%, Silver 10%, Gold and higher 10% off; `frame`, `gif-second`: Bronze 10%, Silver 20%, Gold and higher 30% off; `file-probed`: Bronze 10%, Silver 20%, Gold and higher 20% off; `extra-100mb`: Bronze 10%, Silver 15%, Gold and higher 20% off; no discount on `audio-minute` and `fast-cut-minute`. The prices above are Free-plan prices; the Store card shows the lowest (Gold) price. The start event (`apify-actor-start`) has no discount.

- Minutes are counted per file, from the length of the output (a few milliseconds over a full minute do not count).
- **Video above 30 frames per second counts each minute twice** (twice the frames to decode and encode); use `maxFps: 30` to avoid it.
- A file is never charged more than the amount reserved for it before processing (shown in its `charges`).

Free: files that fail (download errors, HTTP errors, blocked addresses, web pages and playlists, damaged files, parts with no audio or video, time-outs, out of memory), and files not started because of the charge limit or the run timeout.

Apify also charges its start event, `apify-actor-start`: $0.00005 per GB of run memory, so $0.0002 per run at the default 4 GB.

Examples:

- Compress 100 phone videos of 2 min each (1080p, 30 fps, about 250 MB each, so 2 extra 100 MB blocks) to 720p MP4: 100 × (2 × $0.05 + 2 × $0.015) = **$13.00**.
- The same videos kept at 1080p: 100 × (2 × $0.08 + 2 × $0.015) = **$19.00**.
- A 70-second 1080p video to 720p: 2 started minutes = **$0.10**.
- MP3 from 1,000 podcast episodes of 45 min (about 60 MB each): 1,000 × 45 × $0.003 = **$135**.
- 5 thumbnails from each of 1,000 videos: 5,000 × $0.001 = **$5.00** (+ $0.015 per started 100 MB beyond the first 100 MB of each video).
- A 6-second GIF: **$0.006**.
- A fast cut of 1 minute from a 1,200 MB source (1 MB = 1,048,576 bytes): $0.01 + 11 × $0.015 = **$0.175**.

### Limits

- Up to 1,000 files per run; up to 600 minutes per file (`maxMinutesPerFile`, default 60); up to 300 frames per file; GIFs up to 30 s.
- **Disk:** a run's disk is twice its memory and holds the source and the output of every file in progress (plus a 16-bit FLAC copy of the part, about 5 MB per stereo minute, when normalizing loudness from a `start`), so fewer files run at once when `maxFileSizeMb` is high: at the default 4 GB and 1,024 MB the disk allows 3 files at a time and `maxConcurrency` (default 2) sets how many run (at most 2 downloads from one site); one source of about 3.2 GB fits at 4 GB. A 1.7 GB 4K source worked at 8 GB.
- **Speed and cost measured on the platform** (2026-11-20, build 0.1.1, NASA videos; run time includes the download):

| Job | Memory | Run time | Platform cost |
|---|---|---|---|
| 1080p30, 70 s, 72 MB → 720p MP4 | 4 GB | 54 s | $0.013 |
| same → 480p | 4 GB | 35 s | $0.008 |
| same → 1080p | 4 GB | 102 s | $0.024 |
| same → 720p | 8 GB | 35 s | $0.016 |
| 4K60, 1.7 GB source, first 20 s → 4K | 8 GB | 139 s | $0.063 |
| 4K60, first 20 s → 720p | 8 GB | 74 s | $0.033 |
| MP3 from the 70 s video | 4 GB | 3 s | $0.001 |
| 10 frames from the 70 s video | 4 GB | 7 s | $0.002 |
| 5-second GIF | 4 GB | 5 s | $0.001 |
| Fast cut of 60 s (70 MB) | 4 GB | 5 s | $0.005 |
| 720p, 20 min 17 s, 367 MB → MP3 (build 0.1.2) | 4 GB | 30 s | $0.008 |
| same → 480p (build 0.1.2) | 4 GB | 654 s | $0.151 |

Platform cost is the run's final `usageTotalUsd`. Apify hosts differ: these runs had no CPU limit of their own; on hosts that limit a run to its memory share, video takes up to about twice as long. More memory brings more CPU: a single file gets all of the run's cores as FFmpeg threads, so runs are shorter at about the same cost. The speed rows come from builds 0.1.1 and 0.1.2; the encoder settings are unchanged since.

- **Load test** (2026-11-20, build 0.1.4 code, local Docker on a 2017 laptop CPU, 4 GB, all files from one site so 2 downloads at a time, one FFmpeg process; the file server answering with delays, HTTP 429, HTTP 500 and dropped connections on every 10th, 13th and 17th file): 200 files to MP3 in 77 s (156 per minute), 60 videos to 240p in 71 s, 100 videos to 200 frames in 49 s; every file processed once, nothing lost or charged twice. At the cap of 1,000 files per run (MP3, container limited to 4 GB of memory): 392 s (153 per minute), 218 retries served, all 1,000 processed and charged once.
- Long files: tested on the platform up to 20 min 17 s (720p, 367 MB) and 20 s of 4K; longer recordings are cut at `maxMinutesPerFile`. A file that does not finish within the processing limit (6 s per second of media divided by the CPU share, counted up to 4 cores, plus 60 s; at least 120 s; never past the run timeout) is free.
- Not supported: DRM-protected files, HLS/DASH playlists, pages of video platforms, links that need a login.

### Use it from your stack

You need an Apify account and token. No third-party API keys are needed.

- **API:**
  ```bash
  curl -X POST "https://api.apify.com/v2/acts/kadben~video-audio-converter/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
    -H 'Content-Type: application/json' -d '{"files":["https://images-assets.nasa.gov/video/BalloonAscension_TL_VOTY/BalloonAscension_TL_VOTY~mobile.mp4"],"operation":"audio"}'
  ```
- **Python** (`apify-client` 3.x):
  ```python
  from apify_client import ApifyClient
  client = ApifyClient("<APIFY_TOKEN>")
  run = client.actor("kadben/video-audio-converter").call(run_input={"files": ["https://images-assets.nasa.gov/video/BalloonAscension_TL_VOTY/BalloonAscension_TL_VOTY~mobile.mp4"], "operation": "frames", "frameCount": 3})
  print(client.dataset(run.default_dataset_id).list_items().items)
  ```
- **n8n:** the Apify node, *Run an Actor* with `kadben/video-audio-converter`, then *Get dataset items*. The node sends 1,024 MB of memory by default, which Apify raises to this Actor's minimum of 2,048 MB; set Memory to 4,096 MB or more for faster video runs.
- **Make / Zapier:** the Apify app with the same Actor.
- **MCP / AI agents:** `https://mcp.apify.com?tools=kadben/video-audio-converter`.

### Use with AI agents

Ask your assistant to run `kadben/video-audio-converter` through Apify's MCP server (`https://mcp.apify.com?tools=kadben/video-audio-converter`), by its full name. Minimal input: `{"files": ["https://example.com/clip.mp4"], "operation": "audio", "audioFormat": "mp3"}`.
`operation` is one of `video`, `audio`, `cut`, `gif`, `frames`, `probe`. Failed files are free.

### FAQ

**Can I use it from n8n Cloud, which cannot run FFmpeg?** Yes: the Apify node runs this Actor in Apify's cloud; set Memory to 4,096 MB or more for video.

**How do I compress a video to fit an e-mail or chat limit?** Set `targetSizeMb` (for example 25). The bitrate follows from the length; very short targets for long videos are refused with a reason, and the row's `note` says when the result is still over the target.

**Why is my iPhone video refused?** Newer phones often record HEVC (H.265). This Actor does not decode HEVC or VVC video (patent licensing), so `video`, `gif` and `frames` return a free error; set the phone camera to "Most Compatible" (H.264), or use `audio`, `cut` or `probe`.

**Can it download from YouTube, TikTok or Instagram?** No. It processes files you own or may process, from direct links.

**Why is a cut not exact?** `cut` copies the streams without re-encoding, so the start snaps to the nearest earlier keyframe. For an exact start, use `video` with `start` and `end` (re-encoded, priced per minute of video).

**Why did my 60 fps video cost twice?** Each minute above 30 frames per second counts twice, because twice the frames are decoded and encoded. Set `maxFps: 30` to keep the normal rate.

**Which subtitles work?** SRT and WebVTT, UTF-8 or UTF-16. Styling other than italic, bold and underline is removed; the text is drawn in DejaVu Sans, white with a dark outline. Characters such as < and > are shown as written; braces and backslashes are drawn as look-alike characters (⦃ ⦄ ∖).

**Are my files kept?** Outputs stay in the run's key-value store under Apify data retention. Sources are deleted from the run's disk after each file.

### Fair use and licences

- Process only files you own or may process. Encoding H.264 or AAC can be covered by patent licences in some countries; WebM (VP9 + Opus), MP3, FLAC and WAV are alternatives.
- FFmpeg 7.1 (Debian package, LGPL-2.1+ / GPL-2+, run as a separate program) with libx264 (GPL-2+), libvpx (BSD-3-Clause), libopus (BSD-3-Clause), LAME (LGPL-2), libass (ISC) and DejaVu fonts (free licence); httpx (BSD-3-Clause); Apify SDK (Apache-2.0). FFmpeg is a trademark of Fabrice Bellard; this Actor is not affiliated with the FFmpeg project.

### Ready-made examples

Saved inputs for common jobs: open one and run it as it is, or change the input first.

- [Compress a video to 10 MB (MP4, 720p)](https://apify.com/kadben/video-audio-converter/examples/compress-video-to-10-mb)
- [Extract MP3 audio from a video](https://apify.com/kadben/video-audio-converter/examples/extract-mp3-from-video)
- [Extract thumbnails from a video (JPEG frames)](https://apify.com/kadben/video-audio-converter/examples/extract-video-thumbnails)
- [Convert a video clip to an animated GIF](https://apify.com/kadben/video-audio-converter/examples/convert-video-to-gif)
- [Cut a clip from a video without re-encoding](https://apify.com/kadben/video-audio-converter/examples/cut-a-clip-from-a-video)

### Related Actors

- [Audio & Video Transcription](https://apify.com/kadben/audio-video-transcription): speech to text, SRT and VTT subtitles to burn in here.
- [Bulk File Downloader](https://apify.com/kadben/bulk-file-downloader): collect files from links first, then process the `fileUrl` field.
- [RSS Feed Reader](https://apify.com/kadben/rss-feed-reader): podcast feeds with enclosure links to convert.
- [Image Converter & Compressor](https://apify.com/kadben/image-converter): resize and compress the frames to WebP or AVIF.

### Support

Open an issue on the Actor page. We aim to answer within a week. You can also e-mail support@kadben.com. Until 2026-11-27 this Actor was published as `klarto/video-audio-converter`. Links and API calls by that old name no longer work: use `kadben/video-audio-converter`, or `kadben~video-audio-converter` in API URLs. The Actor ID is unchanged.

# Actor input Schema

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

Direct links to video or audio files you own or may process: MP4, MOV, WebM, MKV, AVI, MP3, M4A, WAV, FLAC, OGG and other formats FFmpeg reads. Dropbox and Google Drive share links are turned into download links. Pages of video platforms are not supported.

## `datasets` (type: `array`):

Optional: datasets whose rows hold file links, e.g. the output of Bulk File Downloader (field fileUrl) or of RSS Feed Reader (podcast enclosures). Picking a dataset gives this run read access to it only.

## `fileFields` (type: `array`):

Fields of the dataset rows that hold the links: videoUrl, media.url, files.0, media.*.url (* = every item of a list). A field may hold one link, a list of links, or objects with a url, src, href or fileUrl key.

## `operation` (type: `string`):

What to make from each file. 'Start' and 'End' below apply to every operation except Media info.

## `start` (type: `string`):

Optional: where to begin, as seconds (90) or a time (1:30, 01:02:03.5). Empty = the beginning.

## `end` (type: `string`):

Optional: where to stop, as seconds or a time. Empty = the end of the file (at most 'Max minutes per file' after 'Start').

## `videoFormat` (type: `string`):

Output format of 'Convert or compress video'.

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

Shrink the shorter side to this size, keeping the aspect ratio (720p = 1280x720 landscape or 720x1280 portrait). Smaller videos are never enlarged. Price per minute by output size: up to 720p, up to 1080p, above 1080p; sources above 1080p cost at least the 1080p rate, and video above 30 fps counts each minute twice.

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

Encoder quality when no 'Target size' is set (H.264 CRF 20 / 23 / 28, VP9 CRF 30 / 34 / 40).

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

Optional: aim the output at this size (1 MB = 1,048,576 bytes), e.g. 25 for e-mail or 16 for chat apps. The bitrate is set from the length (never above the source's bitrate, so a target bigger than the source does not inflate the file); if the file comes out bigger, it is encoded once more a little lower. 0 = off (use 'Quality').

## `maxFps` (type: `integer`):

Optional: lower the frame rate to this value (e.g. 30 or 24). 0 = keep the source frame rate.

## `mute` (type: `boolean`):

Make a video without sound.

## `subtitlesUrl` (type: `string`):

Optional: a direct link to an SRT or WebVTT file (e.g. from our Audio & Video Transcription Actor) to draw into the video. The times are read from the start of the source file; with 'Start' set they are shifted to match. Used with 'Convert or compress video' only.

## `audioFormat` (type: `string`):

Output format of 'Extract or convert audio'.

## `audioKbps` (type: `integer`):

Bitrate for MP3, M4A and OGG. 0 = default (MP3 192, M4A 160, OGG 128). MP3 at 16–24 kHz allows at most 160 kbps (8–12 kHz: 64), OGG (Opus) at most 256 kbps per channel. WAV and FLAC ignore it.

## `channels` (type: `string`):

Mono halves the size of speech recordings.

## `sampleRate` (type: `string`):

Resample the audio. Opus (OGG) supports 8, 16, 24 and 48 kHz; other rates are encoded at 48 kHz.

## `normalizeLoudness` (type: `boolean`):

Even out the loudness to -16 LUFS (EBU R128; a common podcast level) with FFmpeg's loudnorm filter (one pass).

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

Width of the animated GIF (never wider than the video). GIFs use at most 30 seconds from 'Start'.

## `gifFps` (type: `integer`):

Frames per second of the GIF. 10-15 keeps files small.

## `frameCount` (type: `integer`):

Frames / thumbnails: this many images, evenly spaced over the part between 'Start' and 'End'. Ignored when 'Frame every N seconds' or 'Frame times' is set.

## `frameEverySeconds` (type: `integer`):

Optional: one image every N seconds instead (at most 300 per file). 0 = off.

## `frameTimes` (type: `array`):

Optional: exact times for the images, e.g. 5, 1:30, 00:02:10.5 (up to 300). Overrides the two options above.

## `frameFormat` (type: `string`):

Image format of the frames.

## `frameWidth` (type: `integer`):

Shrink frames to this width, keeping the aspect ratio. 0 = the video's size.

## `maxFiles` (type: `integer`):

Stop after this many unique links (up to 1,000 per run).

## `maxMinutesPerFile` (type: `integer`):

Process at most this many minutes of each file after 'Start'; the rest is left out (and not charged).

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

Bigger source files are not downloaded and are free. The run's disk is twice its memory and holds the source and the output of every file in progress, so fewer files run at once when this is high (at the default 4 GB and 1,024 MB the disk allows 3 at a time; 'Max concurrency' sets how many run). For bigger files give the run more memory; 4 GB fits a single source of about 3.2 GB. Give 4K video 4 GB or more.

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

Files processed at once, lowered so that they fit the run's disk (see 'Max source size'); at most 2 downloads from one site. FFmpeg runs up to one process per full CPU core and never more than the files in progress; a single file gets all cores as threads, so more memory brings more CPU.

## Actor input object example

```json
{
  "files": [
    "https://images-assets.nasa.gov/video/BalloonAscension_TL_VOTY/BalloonAscension_TL_VOTY~mobile.mp4"
  ],
  "fileFields": [
    "url"
  ],
  "operation": "video",
  "videoFormat": "mp4",
  "resolution": "480p",
  "quality": "balanced",
  "targetSizeMb": 0,
  "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
}
```

# Actor output Schema

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

One row per output file: status, link to the file, format, length in seconds, size in pixels and bytes, the frame time for thumbnails; plus a row with the reason for each file that could not be processed.

## `summary` (type: `string`):

Files processed, failed and skipped, bytes and seconds of output, charged events, failure reasons, and zipUrl (all output files as one ZIP).

# 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": [
        "https://images-assets.nasa.gov/video/BalloonAscension_TL_VOTY/BalloonAscension_TL_VOTY~mobile.mp4"
    ],
    "fileFields": [
        "url"
    ],
    "operation": "video",
    "resolution": "480p"
};

// Run the Actor and wait for it to finish
const run = await client.actor("kadben/video-audio-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 = {
    "files": ["https://images-assets.nasa.gov/video/BalloonAscension_TL_VOTY/BalloonAscension_TL_VOTY~mobile.mp4"],
    "fileFields": ["url"],
    "operation": "video",
    "resolution": "480p",
}

# Run the Actor and wait for it to finish
run = client.actor("kadben/video-audio-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 '{
  "files": [
    "https://images-assets.nasa.gov/video/BalloonAscension_TL_VOTY/BalloonAscension_TL_VOTY~mobile.mp4"
  ],
  "fileFields": [
    "url"
  ],
  "operation": "video",
  "resolution": "480p"
}' |
apify call kadben/video-audio-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kadben/video-audio-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/XkMT3Yl9IAfHRywT8/builds/lSzGeMqAwINtEWP2V/openapi.json
