# Mute Video & Replace Audio – Remove Sound or Add Music to MP4 (`gazidev/video-audio-remover`) Actor

Remove the audio track from videos in bulk without re-encoding, or replace it with your own MP3/WAV, or mix background music under the original sound with auto-ducking and fade-out. The video stream is copied: no quality loss, fast. MP4, MOV, WebM and MKV from URLs. From $2 per 1,000 videos.

- **URL**: https://apify.com/gazidev/video-audio-remover.md
- **Developed by:** [Cemal Atakli](https://apify.com/gazidev) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 video processeds

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

## Mute Video & Replace Audio – Remove Sound or Add Music to MP4

Remove the sound from videos in bulk, swap the soundtrack for your own MP3/WAV, or lay background music under the original sound with automatic ducking. The **video stream is copied, never re-encoded**: no quality loss, and a muted 1080p MP4 is ready in about a second.

- **Mute** – strip the audio track: silent B-roll, product clips without copyrighted music, videos for autoplay.
- **Replace** – put your own audio track on the video (voice-over, licensed music, jingle). Loops or stops when it is shorter than the video, with an optional fade-out.
- **Mix** – keep the original sound and add background music at a chosen volume. **Auto-ducking** lowers the music while people talk and brings it back in the pauses.
- MP4, MOV, WebM, MKV, M4V and TS from direct URLs, a pasted list or CSV, an Apify dataset or your own uploads.
- One row per video with a download link, the output length, size and codecs. From **$2 per 1,000 muted videos**.

### What can I use it for?

- **Social and marketing teams:** silent B-roll for editors, or the same product video with a new music bed for each campaign.
- **E-commerce sellers:** marketplaces and ad platforms reject clips that carry copyrighted music. Mute them, or replace the music with a track you licensed.
- **Automation:** add a brand jingle or a voice-over to clips rendered by another tool or Actor, at the end of a pipeline.
- **Privacy:** remove background conversations from screen recordings or site footage before you share them.

### How it differs from our other media listings

| Listing | What it does | When to use it instead |
|---|---|---|
| **This Actor** | Touches the **audio only**; the video is stream-copied | You only need to mute, swap or add sound |
| [Media Converter](https://apify.com/gazidev/media-converter) | Full re-encode (format, size, compression; it can also mute while it re-encodes) | You also need a new format, resolution or a smaller file |
| [Video Trimmer](https://apify.com/gazidev/video-trimmer) | Cuts clips by timestamp (stream copy) | You need parts of a video |
| [Video Merger](https://apify.com/gazidev/video-merger) | Joins several clips, optionally with one music track | You need one video out of many |
| [Extract Audio from Video](https://apify.com/gazidev/extract-audio-from-video) | Saves the soundtrack as MP3/WAV | You want the audio, not the video |

### Input

| Field | Default | What it does |
|---|---|---|
| `videos` | 1 demo MP4 | Direct links to video files. Platform pages (YouTube, TikTok, Instagram, Vimeo...) are refused |
| `bulkText` | – | One URL per line, or a CSV with a `url` column |
| `datasetId` + `datasetField` | – / `url` | Read video URLs from another Apify dataset |
| `uploadedFiles` + `uploadStore` | – | Your own files uploaded in the Console (select the store too) |
| `mode` | `mute` | `mute`, `replace` or `mix` |
| `audioUrl` | – | The new audio (MP3, WAV, M4A, OGG, FLAC, or a video whose audio is used). Needed for `replace` and `mix`; downloaded once for all videos |
| `musicVolume` | `0.25` | Music level in `mix` (1 = unchanged) |
| `duck` | `true` | Mix: the music dips while the original sound is loud (sidechain compression, about 8 dB in our test) |
| `fadeOutSec` | `2` | Fade-out of the new audio at the end of the video |
| `loopAudio` | `true` | Loop the audio when it is shorter than the video; off = the rest has no new audio |
| `outputFormat` | `same` | `same` keeps the source container; `mp4` re-wraps MOV/MKV/WebM into MP4 |
| `maxFileSizeMb` | `500` | Bigger files are skipped for free |

Mute a list of videos:

```json
{ "videos": ["https://example.com/clip1.mp4", "https://example.com/clip2.mov"], "mode": "mute" }
```

Add quiet background music that ducks under speech:

```json
{
  "videos": ["https://example.com/interview.mp4"],
  "mode": "mix",
  "audioUrl": "https://example.com/licensed-music.mp3",
  "musicVolume": 0.25,
  "duck": true,
  "fadeOutSec": 3
}
```

### Output

One dataset row per video. The files are saved in the run's key-value store, and `outputUrl` is a direct download link.

```json
{
  "input": "https://download.samplelib.com/mp4/sample-5s.mp4",
  "mode": "mute",
  "status": "ok",
  "outputUrl": "https://api.apify.com/v2/key-value-stores/<store>/records/001-sample-5s-muted.mp4",
  "durationSec": 5.7,
  "sizeBytes": 2751359,
  "format": "mp4",
  "width": 1920,
  "height": 1080,
  "videoCodec": "h264",
  "audioCodec": null,
  "billedEvents": { "video-processed": 1 }
}
```

Failed videos get a row with `errorCode` and `error` and are **not charged**. The `SUMMARY` record holds the run totals.

### Pricing (pay per event)

| Event | Price | When |
|---|---|---|
| `video-processed` | **$0.002** | Each muted video (per started 60 minutes) |
| `audio-minute` | $0.003 | `replace` / `mix`: per started minute of output (only the audio is encoded) |
| `large-file-100mb` | $0.001 | Per started 100 MB beyond the first 100 MB of a downloaded video |
| Actor start | $0.00005 | Once per run |

Examples: 1,000 muted 30-second clips cost about **$2**. A 3-minute product video with new music costs $0.009. Invalid URLs, platform pages, non-video files, files above `maxFileSizeMb` and failed encodes are free. Set a maximum total charge on the run: the Actor stops cleanly before it would go over and marks the skipped videos with `MAX_CHARGE_REACHED`.

### FAQ

**Does muting reduce the quality?** No. The video stream is copied bit for bit (`-c:v copy`). Only the audio track is removed or replaced.

**Can I use any song?** Only music you hold the rights to (your own, licensed or royalty-free). The Actor does not check copyright: you are responsible for the audio you add.

**Can I paste a YouTube or TikTok link?** No. This tool edits files you own or may edit; it is not a downloader. Use direct file links or upload your files.

**My WebM/MKV should become MP4.** Set `outputFormat` to `mp4`. H.264, HEVC, AV1 and VP9 video can be re-wrapped without re-encoding; other codecs get a free error row (use [Media Converter](https://apify.com/gazidev/media-converter) for those).

**What audio codec is used?** AAC 160 kbit/s for MP4/MOV/MKV, Opus 128 kbit/s for WebM.

### Use with AI agents / Apify MCP

Add this Actor as a tool in the [Apify MCP server](https://mcp.apify.com) (`gazidev/video-audio-remover`). An agent passes video URLs and a `mode`, and gets back one row per video with an `outputUrl` download link, the output duration and the codecs, so it can check the result. It also works through the Apify API and the Python and JavaScript clients:

```bash
curl -X POST "https://api.apify.com/v2/acts/gazidev~video-audio-remover/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"videos":["https://example.com/clip.mp4"],"mode":"mute"}'
```

### Limits

- Direct file links only; HLS playlists (`.m3u8`) and private-network addresses are refused.
- The whole file is downloaded. Large files take longer and add the `large-file-100mb` event; above ~2 GB give the run more memory (disk).
- Ducking is a simple loudness-driven compressor: loud music or sound effects in the original also lower the music.
- One audio track per run (all videos get the same `audioUrl`). Run the Actor again for a different track.

# Actor input Schema

## `videos` (type: `array`):

Direct links to video FILES (MP4, MOV, WebM, MKV, M4V, TS...). YouTube/TikTok/Instagram pages are refused: this Actor edits files you own or may edit, it is not a downloader. Private-network addresses are refused too.

## `bulkText` (type: `string`):

One URL per line, or a CSV with a `url` column.

## `datasetId` (type: `string`):

Every item's URL field (below) is processed.

## `datasetField` (type: `string`):

Field name in that dataset.

## `uploadedFiles` (type: `array`):

This Actor runs with limited permissions, so ALSO select the store you uploaded into in 'Key-value store with your uploads'. When you upload files, the pre-filled demo video is ignored.

## `uploadStore` (type: `string`):

Grants this run read access to that store only. If `uploadedFiles` points into it, only those files are processed; otherwise every media file in the store is (up to 1,000).

## `mode` (type: `string`):

The VIDEO stream is always copied unchanged (no quality loss). `mute` drops the audio track. `replace` and `mix` encode only the new audio (AAC, or Opus in WebM).

## `audioUrl` (type: `string`):

Direct link to an MP3, WAV, M4A, OGG or FLAC file (or a video: its audio is used). Downloaded once for all videos. You must hold the rights to the music you add.

## `musicVolume` (type: `number`):

1 = unchanged, 0.25 = quiet background. Used in `mix` mode only (`replace` keeps the track at full volume).

## `duck` (type: `boolean`):

The original sound drives a compressor on the music (sidechain): the music dips under speech and comes back in pauses.

## `fadeOutSec` (type: `number`):

Fade-out at the end of the video (replace & mix). 0 = off.

## `loopAudio` (type: `boolean`):

Off: the rest of the video has no new audio.

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

`mp4` re-wraps MOV/MKV/WebM into MP4 (video codecs H.264, HEVC, AV1, VP9; others get a free error row).

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

Larger files are skipped (free). Files above 100 MB add the `large-file-100mb` event per started 100 MB beyond the first 100 MB. Above ~2,000 MB give the run more memory (disk).

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

How many videos are downloaded and processed at once.

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

Only for hosts that block datacenter IPs (HTTP 403).

## Actor input object example

```json
{
  "videos": [
    "https://download.samplelib.com/mp4/sample-5s.mp4"
  ],
  "datasetField": "url",
  "mode": "mute",
  "musicVolume": 0.25,
  "duck": true,
  "fadeOutSec": 2,
  "loopAudio": true,
  "outputFormat": "same",
  "maxFileSizeMb": 500,
  "maxConcurrency": 2,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `videos` (type: `string`):

No description

## `all` (type: `string`):

No description

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

No description

## `summary` (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 = {
    "videos": [
        "https://download.samplelib.com/mp4/sample-5s.mp4"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gazidev/video-audio-remover").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 = { "videos": ["https://download.samplelib.com/mp4/sample-5s.mp4"] }

# Run the Actor and wait for it to finish
run = client.actor("gazidev/video-audio-remover").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 '{
  "videos": [
    "https://download.samplelib.com/mp4/sample-5s.mp4"
  ]
}' |
apify call gazidev/video-audio-remover --silent --output-dataset

```

## MCP server setup

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

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/G8wxbKuOvHaTl9vBM/builds/yL2jQkiyOnpkW4ObV/openapi.json
