deezer/spleeter · error · SpleeterError

An error occurs with ffprobe (see ffprobe output below) {}

Error message

An error occurs with ffprobe (see ffprobe output below)

{}

What it means

During `FFMPEGAudioAdapter.load`, the file is inspected with `ffmpeg.probe()` (ffprobe). If ffprobe fails on the file, the underlying `ffmpeg._run.Error` is wrapped in a `SpleeterError` that embeds ffprobe's stderr output, so the actual cause is in the attached message.

Source

Thrown at spleeter/audio/ffmpeg.py:103

            dtype (bytes):
                (Optional) Data type to use, default to `b'float32'`.

        Returns:
            Signal:
                Loaded data a (waveform, sample_rate) tuple.

        Raises:
            SpleeterError:
                If any error occurs while loading audio.
        """
        if isinstance(path, Path):
            path = str(path)
        if not isinstance(path, str):
            path = path.decode()
        try:
            probe = ffmpeg.probe(path)
        except ffmpeg._run.Error as e:
            raise SpleeterError(
                "An error occurs with ffprobe (see ffprobe output below)\n\n{}".format(
                    e.stderr.decode()
                )
            )
        if "streams" not in probe or len(probe["streams"]) == 0:
            raise SpleeterError("No stream was found with ffprobe")
        metadata = next(
            stream for stream in probe["streams"] if stream["codec_type"] == "audio"
        )
        n_channels = metadata["channels"]
        if sample_rate is None:
            sample_rate = metadata["sample_rate"]
        output_kwargs = {"format": "f32le", "ar": sample_rate}
        if duration is not None:
            output_kwargs["t"] = str(dt.timedelta(seconds=duration))
        if offset is not None:
            output_kwargs["ss"] = str(dt.timedelta(seconds=offset))
        process = (

View on GitHub (pinned to c8854001ac)

Solutions

  1. Read the embedded ffprobe stderr in the error message to identify the root cause
  2. Verify the file exists, is readable, and is a valid media file: `ffprobe <path>` outside spleeter
  3. Re-download or re-encode the file if it is corrupt or truncated

Example fix

# before
audio, sr = adapter.load('/data/song.mp3')  # file missing
# after
import os
assert os.path.isfile('/data/song.mp3')
audio, sr = adapter.load('/data/song.mp3')
Defensive patterns

Strategy: validation

Validate before calling

import os, subprocess
def probe_ok(path) -> bool:
    if not os.path.isfile(path):
        return False
    return subprocess.run(['ffprobe', str(path)], capture_output=True).returncode == 0
if not probe_ok('song.mp3'):
    raise ValueError(f'ffprobe cannot read song.mp3')

Try / catch

try:
    audio, rate = adapter.load(path, offset=0, duration=30)
except Exception as e:
    if 'An error occurs with ffprobe' in str(e):
        logger.error('ffprobe failed on %s: %s', path, str(e))
        audio = None  # or fall back to another file
    else:
        raise

Prevention

When it happens

Trigger: Calling `adapter.load(path)` where ffprobe exits non-zero: nonexistent file, unreadable/corrupt file, unsupported or unrecognized format, permission errors.

Common situations: Passing a URL or path that 404s, truncated downloads, files with wrong extensions/container formats, DRM-protected or zero-byte files.

Related errors


AI-assisted analysis of deezer/spleeter@c8854001ac (2026-08-28). Data as JSON: /api/errors/734859cf20230c4c. Report an issue: GitHub.