{"record":{"id":"baff62052afd7e65","repo":"deezer/spleeter","slug":"no-stream-was-found-with-ffprobe","errorCode":null,"errorMessage":"No stream was found with ffprobe","messagePattern":"No stream was found with ffprobe","errorType":"exception","errorClass":"SpleeterError","httpStatus":null,"severity":"error","filePath":"spleeter/audio/ffmpeg.py","lineNumber":109,"sourceCode":"\n        Raises:\n            SpleeterError:\n                If any error occurs while loading audio.\n        \"\"\"\n        if isinstance(path, Path):\n            path = str(path)\n        if not isinstance(path, str):\n            path = path.decode()\n        try:\n            probe = ffmpeg.probe(path)\n        except ffmpeg._run.Error as e:\n            raise SpleeterError(\n                \"An error occurs with ffprobe (see ffprobe output below)\\n\\n{}\".format(\n                    e.stderr.decode()\n                )\n            )\n        if \"streams\" not in probe or len(probe[\"streams\"]) == 0:\n            raise SpleeterError(\"No stream was found with ffprobe\")\n        metadata = next(\n            stream for stream in probe[\"streams\"] if stream[\"codec_type\"] == \"audio\"\n        )\n        n_channels = metadata[\"channels\"]\n        if sample_rate is None:\n            sample_rate = metadata[\"sample_rate\"]\n        output_kwargs = {\"format\": \"f32le\", \"ar\": sample_rate}\n        if duration is not None:\n            output_kwargs[\"t\"] = str(dt.timedelta(seconds=duration))\n        if offset is not None:\n            output_kwargs[\"ss\"] = str(dt.timedelta(seconds=offset))\n        process = (\n            ffmpeg.input(path)\n            .output(\"pipe:\", **output_kwargs)\n            .run_async(pipe_stdout=True, pipe_stderr=True)\n        )\n        buffer, _ = process.communicate()\n        waveform = np.frombuffer(buffer, dtype=\"<f4\").reshape(-1, n_channels)","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/deezer/spleeter/blob/c8854001ac8acad34a9bc2bd15f28475541828b1/spleeter/audio/ffmpeg.py#L91-L127","documentation":"After a successful ffprobe, `load()` requires the probe result to contain at least one stream. If the `streams` key is absent or empty, spleeter raises this `SpleeterError`. This typically means the file is not a media container ffprobe can find streams in.","triggerScenarios":"Calling `adapter.load(path)` on a file that ffprobe can parse but which contains zero streams — e.g. an empty/corrupt container, a text file renamed to .mp3, or a video file with no streams.","commonSituations":"Empty placeholder files, interrupted downloads producing 0-byte or header-only files, feeding non-audio data files to the separator.","solutions":["Verify the file is a real media file: `ffprobe <path>` and confirm it reports streams","Re-obtain or re-download the file; delete and regenerate zero-byte/corrupt files","If the file should have audio, re-encode it with ffmpeg: `ffmpeg -i in.wav out.wav`"],"exampleFix":"# before\naudio, sr = adapter.load('empty.mp3')  # 0-byte file\n// after\nimport os\nif os.path.getsize('empty.mp3') == 0:\n    raise ValueError('empty.mp3 is not a valid audio file')\naudio, sr = adapter.load('empty.mp3')","handlingStrategy":"validation","validationCode":"import os, json, subprocess\ndef has_streams(path) -> bool:\n    if not os.path.isfile(path) or os.path.getsize(path) == 0:\n        return False\n    r = subprocess.run(['ffprobe', '-print_format', 'json', '-show_streams', str(path)], capture_output=True)\n    try:\n        return len(json.loads(r.stdout).get('streams', [])) > 0\n    except json.JSONDecodeError:\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    audio, rate = adapter.load(path)\nexcept Exception as e:\n    if 'No stream was found with ffprobe' in str(e):\n        logger.warning('Skipping %s: no media streams', path)\n        audio = None\n    else:\n        raise","preventionTips":["Reject empty or zero-byte files early in ingestion pipelines","Confirm files contain audio with ffprobe -show_streams before loading","Re-download or re-encode media that yields zero streams"],"tags":["ffmpeg","invalid-media","empty-file","ffprobe"],"backgroundTag":"no-audio-stream-found","analyzedSha":"c8854001ac8acad34a9bc2bd15f28475541828b1","analyzedAt":"2026-08-28T21:38:40.142Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}