# Extract MP3 audio from a video

**Use case:** 

Extracts the audio track of a video link as an MP3 file (192 kbps by default; 22.05 kHz audio allows at most 160), or as M4A, WAV, FLAC or OGG. This example turns a 4 min 16 s NASA video (10,768,546 bytes) into a 160 kbps MP3 of 5,122,133 bytes. $0.003 per started audio minute per file: 5 minutes, $0.015; failed files are free.

## Input

```json
{
  "files": [
    "https://images-assets.nasa.gov/video/JPL-20240501-WHATSUf-0001-Whats_Up_May_2024/JPL-20240501-WHATSUf-0001-Whats_Up_May_2024~mobile.mp4"
  ],
  "fileFields": [
    "url"
  ],
  "operation": "audio",
  "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
}
```

## Output

```json
{
  "fileIndex": {
    "label": "#",
    "format": "number"
  },
  "url": {
    "label": "Source",
    "format": "link"
  },
  "operation": {
    "label": "Operation",
    "format": "text"
  },
  "status": {
    "label": "Status",
    "format": "text"
  },
  "fileUrl": {
    "label": "Output file",
    "format": "link"
  },
  "format": {
    "label": "Format",
    "format": "text"
  },
  "durationSec": {
    "label": "Seconds",
    "format": "number"
  },
  "width": {
    "label": "Width",
    "format": "number"
  },
  "height": {
    "label": "Height",
    "format": "number"
  },
  "bytes": {
    "label": "Bytes",
    "format": "number"
  },
  "frameTimeSec": {
    "label": "Frame at (s)",
    "format": "number"
  },
  "sourceDurationSec": {
    "label": "Source seconds",
    "format": "number"
  },
  "sourceBytes": {
    "label": "Source bytes",
    "format": "number"
  },
  "note": {
    "label": "Note",
    "format": "text"
  },
  "billable": {
    "label": "Billable",
    "format": "boolean"
  },
  "error": {
    "label": "Error",
    "format": "text"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Video & Audio Converter (FFmpeg): Compress, MP3, GIF, Frames Actor is ready to run with the inputs already set for "Extract MP3 audio from a video". [Sign up or log in](https://console.apify.com/create-task-from-example/MZsG0dDy0Ui3uSTrW) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Extract MP3 audio from a video" task

The Video & Audio Converter (FFmpeg): Compress, MP3, GIF, Frames Actor will start running based on the input automatically. You can also change all the input fields, like files, file link fields, and more, to match your specific use case.

### 3. Receive the "Extract MP3 audio from a video" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as #, source, operation, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Extract MP3 audio from a video" task via API](https://apify.com/kadben/video-audio-converter.md).

## FAQ

### Which formats can the extract audio task save?

The extract audio task saves MP3 (192 kbps by default, at most 160 for 16-24 kHz audio, 64 for 8-12 kHz), M4A (AAC), WAV (16-bit), FLAC or OGG (Opus). audioKbps changes the bitrate; channels can make it mono.

### How much does the extract audio task cost?

The extract audio task charges $0.003 per started audio minute per file: the 4 min 16 s example is 5 minutes, $0.015, plus the $0.0002 start event. $0.015 per started 100 MB beyond the first 100 MB; failed files are free.

### Can the extract audio task even out the loudness?

Yes. With normalizeLoudness the extract audio task levels the audio to -16 LUFS (EBU R128) with FFmpeg's loudnorm filter in one pass.

## About this Actor

This example demonstrates how to use [Video & Audio Converter (FFmpeg): Compress, MP3, GIF, Frames](https://apify.com/kadben/video-audio-converter.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/kadben/video-audio-converter.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/kadben/video-audio-converter.md

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`).
