Repository navigation
Filter stemsplit
stemsplit separates a music track into two stems: vocals and accompaniment. It is an audio filter. It runs on ggml, the same runtime the whisper filter uses, so it adds no new library to the archive.
The filter comes from the ffmpeg-stemsplit project, pinned to a release. This build ships stemsplit 2.0.1. ffmpeg -h filter=stemsplit prints the version.
It is an offline filter. The network needs about 12 seconds of audio before it can emit anything. Do not use it for live playback.
| Spleeter | RoFormer | |
|---|---|---|
| Page | Filter-stemsplit-Spleeter | Filter-stemsplit-RoFormer |
| Model files | one file, 39 MB | four files, 3.38 GB together |
| Quality | modest | much better |
| Speed | fast, about 7 to 9 times real time on an 8-core desktop CPU | very slow on a CPU, fast on a Vulkan GPU |
| Choose it with | model= |
preset=, model=, models= or the per-stem lists |
| GPU | only when you ask (use_gpu=1) |
automatic (use_gpu=auto, the default) |
The models are not in the platform archives. Download them first. See Models.
Karaoke track with Spleeter, instrumental only:
ffmpeg -i song.flac -af "stemsplit=model=spleeter-2stems-f16.gguf:stem=accompaniment" karaoke.flacBoth stems with Spleeter, two outputs:
ffmpeg -i song.flac -filter_complex "[0:a]stemsplit=model=spleeter-2stems-f16.gguf:stem=all[v][a]" \
-map "[v]" vocals.flac -map "[a]" music.flacBoth stems with the best RoFormer recipe, run in the folder that holds the four RoFormer files:
ffmpeg -i song.flac -filter_complex "[0:a]stemsplit=preset=full[voc][acc]" \
-map "[voc]" vocals.flac -map "[acc]" instrumental.flacWith stem=all the filter has two output pads: vocals first, accompaniment second.
The tables list every option that ffmpeg -h filter=stemsplit prints for v1.0.47. Names, defaults and ranges are copied from that output.
| Option | Type | Default | Range | What it does |
|---|---|---|---|---|
model |
string | none | Path to one .gguf model file. Spleeter, or one RoFormer model. |
|
stem |
int | all |
0 to 2 |
vocals (0), accompaniment (1) or all (2, one output pad per stem). |
threads |
int | 0 |
0 to INT_MAX | Number of ggml threads. 0 is half the physical cores. |
use_gpu |
boolean | auto |
GPU use: 0 the CPU, 1 the GPU named by gpu_device, auto the fastest device that computes like the CPU. Spleeter never uses a GPU under auto. |
|
gpu_device |
int | 0 |
0 to INT_MAX | Which GPU either engine uses, counted over the GPU devices the machine reports. Under auto a non-zero value pins that device. |
These apply to Spleeter only. See Filter-stemsplit-Spleeter.
| Option | Type | Default | Range | What it does |
|---|---|---|---|---|
highband |
int | extend |
0 to 3 | How to rebuild the frequencies above the network's band: passthrough (0), zeros (1), average (2), extend (3). |
exponent |
float | 2 |
0.25 to 8 | Separation exponent. Lower is softer, higher is harder. |
bleed |
float | 0 |
0 to 0.5 | Minimum share of the mixture that every stem keeps. |
smooth |
int | 0 |
0 to 32 | Smooth the masks over this many frequency bins on each side. 0 disables it. |
overlap |
duration | 0 |
Segment overlap, crossfaded on output. |
These apply to RoFormer only. See Filter-stemsplit-RoFormer.
| Option | Type | Default | Range | What it does |
|---|---|---|---|---|
preset |
int |
0 (none) |
0 to 3 | StemForge's ensembles: vocal_full (1), instrumental_full (2), full (3). The files are found by name in model_dir. |
model_dir |
string | none | The directory that holds a preset's files. Empty is the working directory. | |
models |
string | none | 2 to 4 model files separated by |. Both stems are combined with ensemble. |
|
vocals_models |
string | none | 1 to 4 model files separated by | for the vocals stem. |
|
accompaniment_models |
string | none | 1 to 4 model files separated by | for the accompaniment stem. |
|
ensemble |
int | auto |
-1 to 3 | How the models of a list are combined: auto (-1), avg (0), max (1), min (2), median (3). |
vocals_ensemble |
int | same |
-2 to 3 | How the vocals stem is combined. same (-2) means as ensemble. |
accompaniment_ensemble |
int | same |
-2 to 3 | How the accompaniment stem is combined. same (-2) means as ensemble. |
weights |
string | none | Positive weights for avg, separated by |, one per model of the list, in its order. |
|
num_overlap |
int | 0 |
0 to 16 | Chunks that cover each sample. 0 uses the model's own value. Fewer is faster and lower in quality. |
cpu_assist |
boolean | true |
With a GPU, the CPU computes chunks beside it. 0 leaves the CPU idle beside the GPU. |
|
cpu_fallback |
boolean | true |
Run on the CPU when no GPU takes every model of the run. 0 refuses that run before it computes anything. |
These are test hooks of the filter. Do not use them in production. They are listed because -h prints them.
| Option | Type | Default | Range | What it does |
|---|---|---|---|---|
dump |
string | empty | Directory to dump intermediate tensors to, for parity tests. Empty disables it. | |
debug_input |
string | empty | Raw [C][T][F] float32 spectrogram to inject as the network input, bypassing the STFT. |
|
debug_identity |
boolean | false |
RoFormer only. Use a mask of 1 instead of the network's. | |
debug_mem_limit |
int64 | 0 |
0 to I64_MAX | RoFormer only. Memory limit in bytes for the memory check. 0 is half of physical memory. |
debug_group_bytes |
int64 | 0 |
0 to I64_MAX | RoFormer only. Bytes one group of a transformer or of the mask estimator may hold. 0 is 512 MiB. |
debug_no_mmap |
boolean | false |
RoFormer only. Read the weights into memory instead of mapping the file. Windows always reads. | |
debug_software_gpu |
boolean | false |
RoFormer only. A software rasteriser counts as a device and wins the ranking. | |
debug_dev_mem_limit |
int64 | 0 |
0 to I64_MAX | RoFormer only. The device's free memory in bytes for the memory decision. 0 asks the device. |
debug_cpu_models |
string | empty | RoFormer only. These models (1-based, |-separated) run on the CPU whatever the device decision. |
|
debug_selfcheck_db |
double | 0 |
0 to 1000 | RoFormer only. The self-check's limit in dB. 0 is the built-in threshold. |
debug_cpu_share |
int | 0 |
0 to 64 | RoFormer only. With a device, the CPU computes one chunk in this many of the device's models. 0 lets cpu_assist decide. |
- One 1024-sample frame per STFT hop. The output works with every encoder, including FLAC with its 65,535-sample block limit. No rechunking filter is needed.
- Any sample rate and any channel count work. The network is 44.1 kHz stereo. Other input is converted on the way in and converted back to the input's own rate and layout on the way out. A hi-res file keeps its rate but not its top octave.
- Input with more than two channels is folded to stereo and upmixed back. The filter logs a warning.
Every output frame carries these keys.
| Key | Meaning |
|---|---|
lavfi.stemsplit.version |
The stemsplit version, here 2.0.1. |
lavfi.stemsplit.model |
Every model used, in load order, as <file name>:<first 12 hex of its SHA-256>, separated by |. |
lavfi.stemsplit.arch |
The architecture of each model, in the same order. |
lavfi.stemsplit.preset |
The preset name, when one is used. |
lavfi.stemsplit.backend |
What computed the stem: cpu, or the ggml backend name such as vulkan. One value per model when they differ, for example vulkan|cpu. |
lavfi.stemsplit.device |
The name of the GPU, when a GPU ran. |
lavfi.stemsplit.cpu_variant |
The ggml CPU instruction-set level that runs. See CPU-Instruction-Sets. |
lavfi.stemsplit.rtf |
The real-time factor so far (RoFormer). |
Print them with ametadata:
ffmpeg -i song.flac -af "stemsplit=preset=full:stem=vocals,ametadata=mode=print" -f null -use_gpu=auto is the default since stemsplit 2.0.0 (v1.0.47). It was 0 before.
-
Spleeter stays on the CPU under
auto. The output is the same bytes as before. Useuse_gpu=1to opt in. -
RoFormer goes to a Vulkan GPU when the device is a real GPU, beats the CPU in a calibration, passes a self-check against the CPU and can hold the work. Otherwise it runs on the CPU and gives the same bytes as
use_gpu=0. -
use_gpu=0always means the CPU. - On Linux x86_64, Linux ARM64, Windows and FreeBSD the help text says
Backends enabled for use_gpu=auto: vulkan.On macOSautois the CPU. Metal is not enabled forauto; see Metal. -
cpu_fallback=0turns a CPU run into an error that starts withstemsplit: cpu_fallback=0 and, with a non-zero exit code. -
cpu_assistlets one worker thread compute chunks on the CPU beside the GPU. Two runs can then differ within the GPU tolerance.cpu_assist=0gives the same stems every time.
Since stemsplit 2.0.0 the filter sets GGML_VK_DISABLE_COOPMAT=1 and GGML_VK_DISABLE_F16=1 for its own process when use_gpu is auto or 1. This makes ggml-vulkan compute in 32-bit float. A variable that is already set is left alone. use_gpu=0 sets nothing.
Warning. These two variables are process-wide. A
whisperfilter on a GPU in the same ffmpeg process then computes in F32 too, and runs about 3.5 times slower (measured on the project's test machine). Runwhisperon a GPU in a different ffmpeg process than astemsplitrun that uses a GPU.
STEMSPLIT_VK_FAST=1 in the environment keeps the card's half-precision path. auto then refuses such a card.
Details, escape hatches and measurements are on GPU-Acceleration.
| Model | Where | Size |
|---|---|---|
spleeter-2stems-f16.gguf |
nomercy-stemsplit-models, release v2026.10.31 | 39,319,552 bytes |
| Four RoFormer files | the same release | 639 MB to 913 MB each |
The release is public. No token is needed. Every file has a .sha256 sidecar. manifest.json lists them all and manifest.json.sig signs it (the models release; FFmpeg releases ship no signature). The four RoFormer SHA-256 values are on Filter-stemsplit-RoFormer. The Spleeter file has this SHA-256: 155dc9d2e2eef70ad633af98134df29a5273defaeb98ef013d46251faa69d0ad.
Direct link to the Spleeter file:
https://github.com/NoMercy-Entertainment/nomercy-stemsplit-models/releases/download/v2026.10.31/spleeter-2stems-f16.gguf
- The filter is in every platform archive.
- GPU use needs a Vulkan loader and a driver from the host. Nothing graphics-related is bundled. macOS has no Vulkan. See GPU-Acceleration.
- A machine without a usable GPU runs on the CPU. The command line does not change.
| Version | Change |
|---|---|
| v1.0.45 (stemsplit 1.1.0) | RoFormer models, presets and ensembles. |
| v1.0.46 (stemsplit 1.2.1) |
use_gpu=auto for RoFormer on Vulkan. New metadata key lavfi.stemsplit.device. |
| v1.0.47 (stemsplit 2.0.1) |
use_gpu defaults to auto. cpu_fallback and cpu_assist are new. Cards with a half-precision path (an RTX 3070, for one) are now taken. |
Spleeter's code and released model checkpoints are MIT-licensed. If you use the filter or the model in published work, please cite: Hennequin, Khlif, Voituret, Moussallam (2020). Spleeter: a fast and efficient music source separation tool with pre-trained models. Journal of Open Source Software, 5(50), 2154, doi:10.21105/joss.02154.
You must hold the rights to any copyrighted material you process.
NoMercy did not make the RoFormer models. Their authors had published no licence for them when they were retrieved. The release notice file records who made each model. It is not a licence. See License for the licence of the build itself.
Users
Filters and components
- Filter-stemsplit
- Filter-lyricsalign
- Whisper-Language-Detection
- Whisper-Word-Timestamps
- Filter-trailingsilence
- Filter-keydetect
- Filter-beatdetect
- Filter-rubberband
- Muxer-Sprite-Sheet
- Muxer-Chapter-VTT
- Muxer-VOBsub
- Protocol-dvdread
- Protocol-OmniDrive
- Auto-Create-Directories
- AACS-and-BDplus
- HLS-Master-Playlist
- Subtitles-OCR
- HEVC-Alpha
Acceleration and codecs
Contributors