demusic

io.github.dawnwood-ai由 GitHub 帳號 dawnwood-ai 發布v0.1.0更新於 Nov 7, 2026

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

已驗證STDIO僅桌面媒體與設計AI 與機器學習

概覽

AI 產生的概覽

本機 MCP 伺服器,偵測 AI 生成影片片段中的背景音樂,並輸出去除該音樂、保留對白與音效的副本。

可以做什麼
  • 偵測影片或音訊片段是否含有背景音樂鋪底,並回報出現位置、響度與強度數值
  • 產生去除音樂的新副本:只在偵測到的音樂區間替換音訊,畫面以串流複製方式保留
  • 回傳清理後檔案的輸出路徑,預設在輸入檔旁以新檔名儲存
適用情境
適合 AI 影片模型替生成片段加上了不想要的背景音樂、需要疊上自己配樂的情況,也適合在交付前批次檢查算圖片段是否帶有音樂。
執行需求
以 stdio 在本機執行,通常透過 uvx 從 demusic 的 PyPI 套件啟動。需要 Python 3.10 以上,以及 PATH 中的 ffmpeg(或以 DEMUSIC_FFMPEG 指定路徑)。本機分離使用 Demucs 並會安裝 PyTorch;改用 fal 分離則需要 FAL_KEY。約 90 MB 的分類模型會下載一次到使用者快取目錄。
安裝前請注意
remove_music 會寫入新檔案到磁碟,但不會覆蓋輸入檔。當 DEMUSIC_SEPARATOR=fal 時,音訊會以 FAL_KEY 傳送到 fal.ai。場景中原本就有的音樂(例如畫面中的樂團或收音機)也會被移除,被處理區間內的非打擊類音效會一併消失。輸出檔會寫入署名註解標籤。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 demusic,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

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.

來源:README.md,提交 bb5bbb8

工具

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.

輸入參數path必填threshold

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

輸入參數modepath必填outputthreshold

版本歷史

1
  1. v0.1.0最新Nov 6, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分