# Extract Audio From Video (`rixin/extract-audio-from-video`) Actor

From $1/hr. Extract Audio from Video - Pull audio tracks from MP4, AVI, MKV, and other video formats. Output to MP3, WAV, FLAC, AAC, OGG, or M4A. Adjustable bitrate settings. Perfect for podcasts, music extraction, and transcription prep.

- **URL**: https://apify.com/rixin/extract-audio-from-video.md
- **Developed by:** [Rixin Sc](https://apify.com/rixin) (community)
- **Categories:** Videos, Automation, Integrations
- **Stats:** 29 total users, 3 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### What does Extract Audio from Video do?

Extract Audio from Video pulls audio tracks from video files and saves them in your preferred audio format. Perfect for extracting music, creating podcasts from video content, or preparing audio for transcription.

- Extract audio from any video format to **6 audio formats**
- **Batch processing** - extract audio from multiple videos in a single run
- Adjustable **bitrate settings** from 64k to 320k
- **High quality extraction** - preserves original audio fidelity
- Output files stored in **Key-Value Store** with direct download URLs
- Export results via **JSON, CSV, Excel**, or integrate with any workflow
- Connect to any AI chatbot using **Apify MCP server**

### What audio formats can you extract to?

|     |     |     |
| --- | --- | --- |
| MP3 | WAV | FLAC |
| AAC | OGG | M4A |

### How to extract audio with Extract Audio from Video?

1. [Create](https://console.apify.com/sign-up) a free Apify account using your email.
2. Open [Extract Audio from Video](https://apify.com/store).
3. Add video URLs from which you want to extract audio.
4. Select your desired output audio format and bitrate.
5. Click the "Start" button and wait for the extraction to complete.
6. Download your extracted audio files from the Key-Value Store.

### Input

Configure the extractor with these parameters:

- **files**: Array of video URLs to extract audio from (required)
- **outputFormat**: Target audio format - mp3, wav, flac, aac, ogg, m4a (default: mp3)
- **bitrate**: Output bitrate - 64k, 128k, 192k, 256k, 320k (default: 192k)

#### Input JSON

```json
{
    "files": [
        "https://example.com/video.mp4",
        "https://example.com/interview.webm"
    ],
    "outputFormat": "mp3",
    "bitrate": "256k"
}
```

### Output

Extracted audio files are saved to the **Key-Value Store** with direct download URLs. Metadata for each extraction is pushed to the **Dataset**.

Here's an example of the output data:

```json
{
    "inputFileUrl": "https://example.com/video.mp4",
    "inputFileName": "video.mp4",
    "outputFormat": "mp3",
    "outputFileKey": "video-1706789012345.mp3",
    "outputFileUrl": "https://api.apify.com/v2/key-value-stores/abc123/records/video-1706789012345.mp3",
    "inputSizeBytes": 104857600,
    "outputSizeBytes": 5242880,
    "durationSeconds": 120,
    "processingTimeMs": 3456,
    "processedAt": "2024-02-01T12:30:00.000Z"
}
```

### How can I use extracted audio?

- **Podcast creation** - extract audio from video interviews or presentations
- **Music extraction** - pull soundtracks from video content
- **Transcription prep** - prepare audio for speech-to-text processing
- **Audiobook creation** - convert video lectures to audio format
- **Content repurposing** - turn video content into audio-only versions
- **Voice-over extraction** - separate narration from video for reuse

### FAQ

#### How much does it cost to use Extract Audio from Video?

Extract Audio from Video uses the **pay-per-event** (PPE) pricing model. You're charged **$0.000278 per second of video duration** (~$1/hour). For example, extracting audio from a 2-minute (120 second) video costs approximately $0.033. Your costs can be easily calculated using the information in the Actor's pricing tab.

#### Can I use integrations with Extract Audio from Video?

You can integrate Extract Audio from Video with almost any cloud service or web app. We offer integrations with **Make, Zapier, Slack, Airbyte, GitHub, Google Sheets, Google Drive**, and plenty more.

Alternatively, you could use webhooks to carry out an action whenever an event occurs, such as getting a notification when Extract Audio from Video successfully finishes a run.

#### Can I use Extract Audio from Video with the Apify API?

The Apify API gives you programmatic access to the Apify platform. The API is organized around RESTful HTTP endpoints that enable you to manage, schedule, and run Apify Actors. The API also lets you access any datasets, monitor Actor performance, fetch results, create and update versions, and more.

To access the API using Node.js, use the `apify-client` NPM package. To access the API using Python, use the `apify-client` PyPI package.

#### Can I use Extract Audio from Video through an MCP Server?

With Apify API, you can use almost any Actor in conjunction with an MCP server. You can connect to the MCP server using clients like Claude Desktop and LibreChat, or even build your own.

#### Your feedback

We're always working on improving the performance of our Actors. If you have any technical feedback for Extract Audio from Video or found a bug, please create an issue in the Issues tab.

# Actor input Schema

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

URLs of video files to extract audio from. One URL per line. Supports any public URL or Apify storage URLs.

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

Target audio format for the extracted audio

## `bitrate` (type: `string`):

Output audio bitrate

## Actor input object example

```json
{
  "files": [
    "https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4"
  ],
  "outputFormat": "mp3",
  "bitrate": "192k"
}
```

# Actor output Schema

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

No description

## `extractedAudio` (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 = {
    "files": [
        "https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rixin/extract-audio-from-video").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://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4"] }

# Run the Actor and wait for it to finish
run = client.actor("rixin/extract-audio-from-video").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://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4"
  ]
}' |
apify call rixin/extract-audio-from-video --silent --output-dataset

```

## MCP server setup

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

```

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/FHFBY07XxSRS9Wqlh/builds/ZhATenWIl9DjxNTRK/openapi.json
