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:
- Separate the audio into stems (Demucs
htdemucs_6s, locally or on your fal key).
- Is it loud enough to be a bed? The melodic stems must be audible (> -50 dBFS).
- 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.
- 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.
The music classifier (~90 MB ONNX, BSD-3) downloads once to ~/.cache/demusic.
Quickstart
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
AI agents (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.