Strip other people's music before upload with Demucs and ffmpeg
Car radio, shop speakers and festival stages trigger Content ID. Split the soundtrack into stems, find the music on drums plus bass, keep the voice, replace the music, rebuild audio only.
# 1. Soundtrack out of the film ffmpeg -i film.mp4 -vn -ac 2 -ar 44100 film_audio.wav # 2. Four stems on the Apple GPU (drop -d mps for CUDA or CPU) demucs -d mps -o stems film_audio.wav # no install: uvx --with numpy --from demucs demucs -d mps -o stems film_audio.wav # output: stems/htdemucs/film_audio/vocals.wav drums.wav bass.wav other.wav # 3. Find the music: threshold the RMS of drums+bass per second, merge windows closer than a few seconds, print the window map before changing anything (dry run). # 4. Inside each window: the whole vocals stem + your score. Outside the windows: the original audio, sample for sample. # 5. Rebuild audio only, video copied ffmpeg -i film.mp4 -i clean_audio.wav -map 0:v -map 1:a -c:v copy -c:a aac film.clean.mp4
In Claude Code, paste the prompt as a message, or run /stem-split which does this end to end.
Steps
- Run the dry run and read the window map against the film: a window that starts mid-sentence means the threshold is too low.
- Inside the windows keep the whole vocals stem, not the parts the subtitles cover: STT misses exclamations, and 31 s of loud speech lived outside the subtitles on one film.
- Upload, then compare the platform's claimed time codes with your windows. Its claims are a check, not the map: Content ID sees a subset.
Example
Measured on one episode: 10 claims, about 4 minutes of songs, four of the claims blocking the video in two countries that were 21% of the channel’s audience. A claim is not a strike, but you do not choose the block.
Tips
- Detect on drums + bass, not on the no-vocals stem. Demucs puts the engine, wind and city into `other`, and road noise is louder than the radio almost everywhere.
- The singer's ghost stays in the vocals stem 5-10 dB under the speaker. It disappears under a new score; it does not disappear on its own.
- Speed: about 4 minutes per 20 minutes of audio on an Apple Silicon GPU; 60 s of a song took 8.3 s with `-d mps` and 15.7 s on CPU. Without `-d mps` Demucs does not pick the Apple GPU.
- Already published and the claim restricts nothing: leave it. Re-upload only for a block or lost monetisation; the platform's own 'erase song' takes days and cuts the whole segment, speech included.
- In Claude Code, `/stem-split` runs Demucs and `/video-edit` does the detection, the replacement and the rebuild.
| works with | ffmpeg: A terminal command you run yourself. · Claude Code: Runs as a skill or a prompt in the terminal; can read your files and write the result. · By hand: No tool needed: a checklist or a technique. |
| skill | npx skills add fortunto2/solo-factory/stem-split · source |
| cost | Free. No API, no key. |
| status | Unverified: written from the technique, not yet run end to end by us. |
| license | CC BY 4.0 for the text here; skills are MIT. |
| updated | 2026-11-01 |
| for agents | strip-other-peoples-music-demucs.md |
Related
Level every chapter to -16 LUFS with ffmpeg loudnorm
One ffmpeg line that brings a file to -16 LUFS integrated and -1.5 dBTP true peak without touching the video, the two-pass version for exact results, and the timestamp trap on upload.
Voice cleanup checklist: room tone, de-ess, noise gate, in that order
Six passes that turn a phone or lav recording into a usable voice track, each with the ffmpeg filter and a starting parameter to adjust by ear, in the order that keeps the gate off word endings.
Separate vocals, music and drums from a recording (/stem-split)
Separate a song or a film's soundtrack into stems (vocals, drums, bass, other) with Demucs, locally, on the Apple GPU when there is one.
Live music in frame: one continuous audio span, picture cuts on top
When a band or a busker is in the shot, keep one unbroken stretch of that clip's audio under the whole scene and cut only the picture; cut the audio per shot and the beat restarts.
Score with a hole, not ducking, where something plays live
Cut the score to silence under live music, a laugh or a knock instead of ducking it; ducking is audible, a hole is not. The rule, the measured levels and the ffmpeg line.
Beat-sync cutting: cut on the beat, not on every beat
A rule and an agent prompt for cutting to music from a list of beat timestamps: cuts land on beats, phrases get room to breathe, and the best shot is held through the hook.