# Video to Audio — Extract MP3, M4A or WAV from File URLs (`ponderable_hydrometer/video-to-audio`) Actor

Audio extractor: pull the audio track from video or audio files by direct link and convert it to MP3, M4A or WAV. Uses ffmpeg inside the Actor. Each result links to the stored audio file.

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

## Pricing

from $10.00 / 1,000 results

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 to Audio — Extract MP3, M4A or WAV from File URLs

**Get the sound out of a video file.** Give it direct links and pick a format; it returns stored audio files, ready for a podcast feed or for transcription.

### What you can do with it

- **Turn video episodes into podcast audio** (MP3 or M4A).
- **Prepare files for transcription**: convert to WAV and send to a speech-to-text step.
- **Pull the sound out of several files in one run**: list direct links, one result per file.

### What you get

One row per converted file: `mediaUrl`, `fileUrl` (link to the audio), `format`, `contentType`, `bytes`.

### Output sample

```json
{
  "mediaUrl": "https://example.com/talk.mp4",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/abc123/records/audio-1.mp3",
  "format": "mp3",
  "contentType": "audio/mpeg",
  "bytes": 1048576
}
```

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `mediaUrls` | array | — | Direct links to files such as MP4, WebM, MOV, WAV. |
| `format` | string | `"mp3"` | mp3, m4a or wav. |
| `bitrateKbps` | integer | `128` | For mp3 and m4a. |

### Input example

```json
{
  "mediaUrls": ["https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"],
  "format": "mp3",
  "bitrateKbps": 128
}
```

| Format | Codec | Notes |
|---|---|---|
| `mp3` | MP3 (LAME) | Bitrate set by `bitrateKbps` (32-320) |
| `m4a` | AAC | Bitrate set by `bitrateKbps` (32-320) |
| `wav` | 16-bit PCM | Uncompressed; `bitrateKbps` is ignored |

Audio files (for example a WAV) also work as input.

### Use it from the API or an AI agent

```bash
curl -X POST "https://api.apify.com/v2/acts/ponderable_hydrometer~video-to-audio/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"mediaUrls": ["https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"], "format": "mp3"}'
```

Through the Apify MCP server: `https://mcp.apify.com?tools=ponderable_hydrometer/video-to-audio`.

### Limits and good to know

- It needs a **direct link to the file**. Pages on YouTube, TikTok and similar sites are not supported.
- **No trimming, splitting or loudness options**: the whole audio track is converted with ffmpeg.
- A file with no audio track, or one that cannot be read, produces no row and no result fee. If every file fails, the run ends as FAILED.
- Each file must download within about 3 minutes.
- Use it only on media you have the right to convert. Files are kept for your account's data retention period.

### FAQ

**Can it extract audio from YouTube?** No, only direct file links.

**Is WAV larger than MP3?** Yes. WAV is uncompressed 16-bit PCM, so files are bigger.

### Pricing

Pay per result — **$10.00 per 1,000 results** (one converted file = one result), plus Apify's standard per-run start event ($0.00005 per GB of memory, so a fraction of a cent per run). No subscription.

# Actor input Schema

## `mediaUrls` (type: `array`):

Direct links to files such as MP4, WebM, MOV, WAV.

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

mp3, m4a or wav.

## `bitrateKbps` (type: `integer`):

For mp3 and m4a.

## Actor input object example

```json
{
  "mediaUrls": [
    "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4",
    "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/friday.mp4",
    "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav"
  ],
  "format": "mp3",
  "bitrateKbps": 128
}
```

# Actor output Schema

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

All rows produced by this run, as JSON.

# 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 = {
    "mediaUrls": [
        "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4",
        "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/friday.mp4",
        "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ponderable_hydrometer/video-to-audio").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 = { "mediaUrls": [
        "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4",
        "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/friday.mp4",
        "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ponderable_hydrometer/video-to-audio").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 '{
  "mediaUrls": [
    "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4",
    "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/friday.mp4",
    "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav"
  ]
}' |
apify call ponderable_hydrometer/video-to-audio --silent --output-dataset

```

## MCP server setup

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

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/v4QBjOeqBIWc4pm8h/builds/rmY4Jbe7ETwqnmlaH/openapi.json
