demusic

io.github.dawnwood-aiPublished by GitHub account dawnwood-aiv0.1.0Updated Nov 7, 2026

Remove background music AI video models bake into clips; keep dialogue and SFX.

VerifiedSTDIODesktop onlyMedia & DesignAI & ML

Overview

AI-generated overview

Local MCP server that detects background music in AI-generated video clips and writes a copy with that music removed, keeping dialogue and sound effects.

What you can do
  • Detect whether a video or audio clip contains a background music bed and where it occurs, with loudness and strength values
  • Write a new copy of a clip with the detected music spans replaced by dialogue and percussion while the picture is stream-copied
  • Report the output path of the cleaned file, defaulting to a new name next to the input
When to use it
Useful when AI video models add an unwanted music bed to generated clips and you want to lay your own score over them, or when you need to check a batch of renders for music before delivery.
Requirements
Runs locally over stdio, typically via uvx from the demusic PyPI package. Needs Python 3.10 or newer and ffmpeg on PATH (or a path set in DEMUSIC_FFMPEG). Local separation uses Demucs and pulls in PyTorch; the alternative fal separator needs FAL_KEY. A roughly 90 MB classifier model downloads once to the user's cache.
Before you install
remove_music writes new files to disk, though it never overwrites the input. With DEMUSIC_SEPARATOR=fal, audio is sent to fal.ai using your FAL_KEY. Music that is part of the scene, such as a band or radio, is removed too, and non-percussive effects inside stripped spans are lost. Output files get a comment tag crediting the tool.

Installation

In SourceWeft

  1. Open demusic in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

demusic

[tests] [License: Apache-2.0] [MCP server]

demusic removes the background music that AI video models (Seedance, Kling, Veo, Hailuo, Wan, ...) bake into generated clips, and keeps the dialogue, sound effects and ambience. It finds where the music is and only replaces the audio there, so the rest of the clip is untouched. Local, free, CLI + MCP server.

Read in Chinese · How detection works

Why

Native-audio video models often add a music bed nobody asked for: a few seconds of score at the start of a shot, a pad under the dialogue. Cut ten such clips together and you get ten pieces of music fighting each other, and you can't lay your own score over it.

The usual fix - run a vocal remover and keep only the vocals - throws away footsteps, doors, rain and room tone along with the music, and it is wrong on every clip that had no music to begin with. demusic is what we run on every clip of our AI dramas at Dawnwood:

  1. Separate the audio into stems (Demucs htdemucs_6s, locally or on your fal key).
  2. Is it loud enough to be a bed? The melodic stems must be audible (> -50 dBFS).
  3. Is it actually music? An AudioSet classifier must hear music on the accompaniment for 2+ seconds. Engine hum, gunfire and room tone pass step 2 but fail this one.
  4. Strip only those spans: there the audio becomes dialogue + percussion/impacts, with a 0.25 s crossfade; everywhere else the original audio stays. The picture is stream-copied (no re-encode).

It is deliberately conservative. On 164 clips with no music it wrongly flagged 2; on 87 clips a person had flagged by ear it found 33. The misses are very quiet beds - lower --threshold or use --mode force when you know a clip has music. Calibration details.

Install

Requires Python >= 3.10 and ffmpeg on PATH.

bash
pip install "demusic[demucs]"     # local separation (pulls in PyTorch; CPU is fine)# or, no torch, separation on fal.ai with your own key:pip install "demusic[fal]" && export FAL_KEY=...

The music classifier (~90 MB ONNX, BSD-3) downloads once to ~/.cache/demusic.

Quickstart

bash
# where is the music?demusic check shot_012.mp4# shot_012.mp4: MUSIC  spans 0-2.8s  melodic -42.1 dBFS  p=0.34
# write shot_012.demusic.mp4 with the music removeddemusic strip shot_012.mp4
# a whole folder; clean copies of every file (unchanged ones copied) into clean/demusic strip renders/*.mp4 --out-dir clean/
optionmeaning
--separator demucs|fal|DIRlocal Demucs (default), fal.ai with FAL_KEY, or a folder of stems you already separated (vocals.wav, drums.wav, bass/guitar/piano/other.wav or music.wav)
--mode spans|whole|forcereplace only where music was heard (default) / the whole track if any music was heard / always, without detection
--threshold 0.3classifier music probability; 0.2 finds quieter beds at a higher false-positive rate
--loud-floor -50melodic-stem loudness gate (dBFS)
-o FILE / --out-dir DIRoutput path for one file / for a batch
--jsonone JSON object on stdout (files[] with music, spans, melodic_dbfs, strength, action, output)

Exit codes: 0 ok (for check: no music), 1 check found music, 2 usage, 3 failure. demusic check in CI or a render pipeline = fail the build when a clip has a music bed.

Speed: separation is roughly real time on a laptop CPU (a 10 s clip ~10-20 s), much faster on a GPU. Detection itself is a few hundred ms.

Python

python
from demusic.core import processr = process("shot.mp4", "shot.clean.mp4")          # stripr = process("shot.mp4", strip=False)                # check onlyprint(r["music"], r["spans"])

AI agents (MCP)

bash
claude mcp add demusic -- demusic mcp            # Claude Code# or any MCP client: command "uvx", args ["--from", "demusic[demucs]", "demusic", "mcp"]

Tools: check_music (read-only) and remove_music (writes a new file, never overwrites the input). Set DEMUSIC_SEPARATOR=fal in the server env to use fal. There is also a Claude skill and AGENTS.md.

Limits

  • Music that is meant to be in the scene (a band on screen, a radio) is removed too when it is detected. Skip those clips.
  • Inside a stripped span, non-percussive effects (a running tap, wind) go with the music; Demucs has no separate SFX stem. Outside the spans nothing changes.
  • Sung vocals land in the vocals stem and are kept.

Credit

Apache-2.0. demusic writes cleaned with demusic by Dawnwood into each output file's comment tag. If it saves you time, please keep that and mention "demusic by Dawnwood" - a request, not a condition (see NOTICE).

Made by Dawnwood, an AI drama studio. More tools we use in production: dramapack (short-drama delivery packs and QC) · all our open source.

Source: README.md at commit bb5bbb8

Tools

2

check_music

Does this video/audio clip contain a background music bed, and where? Returns music (bool), spans [[start_s, end_s], ...], melodic_dbfs and strength (sustained music probability). Read-only. Conservative: it prefers missing a very quiet bed to flagging engine hum or room tone as music.

Parameterspathrequiredthreshold

remove_music

Write a copy of a clip with the background music removed: inside the detected music spans the audio becomes dialogue + percussion/impacts, elsewhere the original audio is kept; the picture is stream-copied. `output` defaults to <name>.demusic.<ext> next to the input; the input is never overwritten. mode: spans (default) | whole | force (strip without detection).

Parametersmodepathrequiredoutputthreshold

Version history

1
  1. v0.1.0LatestNov 6, 2026

Score

90% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts
  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts