sgl-project/sglang · error · RuntimeError

ffprobe not found; install ffmpeg

Error message

ffprobe not found; install ffmpeg

What it means

Raised by _ffprobe_has_audio in MiMo-V2's multimodal processor when the ffprobe binary cannot be located on PATH. The subprocess call to ffprobe raises FileNotFoundError, which is re-wrapped as RuntimeError with the hint 'install ffmpeg'. It means the host machine lacks the ffmpeg/ffprobe toolchain needed to probe whether video inputs contain audio streams.

Source

Thrown at python/sglang/srt/multimodal/processors/mimo_v2.py:261

                "json",
                "-show_streams",
                "-select_streams",
                "a",
                src,
            ],
            input=stdin,
            capture_output=True,
            timeout=30,
        )
        if r.returncode != 0:
            stderr = r.stderr.decode("utf-8", errors="replace")
            raise RuntimeError(f"ffprobe failed for {label}: {stderr}")
        return bool(json.loads(r.stdout).get("streams"))
    except subprocess.TimeoutExpired:
        logger.error("ffprobe timed out for %s", label)
        raise
    except FileNotFoundError as e:
        raise RuntimeError("ffprobe not found; install ffmpeg") from e
    except json.JSONDecodeError:
        logger.error("ffprobe returned invalid JSON for %s", label)
        raise


class MiMoProcessor:
    def __init__(
        self,
        tokenizer,
        patch_size=14,
        merge_size=2,
        temporal_patch_size=2,
        temporal_compression_ratio=1,
        video_tokens_per_second=2,
        use_video_timestamps=False,
        video_audio_interleave_length=0,
        use_per_grid_t_timestamps=True,
        audio_kernel_size=3,

View on GitHub (pinned to 0132848349)

Solutions

  1. Install ffmpeg (e.g. 'apt-get update && apt-get install -y ffmpeg' or 'conda install -y ffmpeg') and restart the sglang server
  2. Verify with 'ffprobe -version' inside the exact container/user the server runs as
  3. If containerized, add ffmpeg to the image build and confirm PATH includes it for the server process

Example fix

# before: slim image, ffprobe missing → RuntimeError: ffprobe not found; install ffmpeg
# after (Dockerfile)
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg \
    && rm -rf /var/lib/apt/lists/*
Defensive patterns

Strategy: validation

Validate before calling

import shutil
if shutil.which('ffprobe') is None:
    raise SystemExit('ffmpeg/ffprobe required for video inputs; install it before starting the server')

Try / catch

try:
    resp = client.generate(prompt, video=url)
except RuntimeError as e:
    if 'ffprobe not found' in str(e):
        abort_with_instruction('server host needs ffmpeg installed')
    raise

Prevention

When it happens

Trigger: Calling a MiMo-V2 endpoint with a video input (or video-with-audio) — the processor shells out to ffprobe to inspect audio streams, and subprocess raises FileNotFoundError because ffprobe is not installed or not on PATH in the server's environment (common in slim Docker images).

Common situations: Running sglang in a minimal container (python:slim, distroless) without apt ffmpeg; CI environments; systems where ffmpeg is installed only for a different user/shell PATH than the sglang server process.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/af581c0f422fac31. Report an issue: GitHub.