{"record":{"id":"af581c0f422fac31","repo":"sgl-project/sglang","slug":"ffprobe-not-found-install-ffmpeg","errorCode":null,"errorMessage":"ffprobe not found; install ffmpeg","messagePattern":"ffprobe not found; install ffmpeg","errorType":"error_code","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/multimodal/processors/mimo_v2.py","lineNumber":261,"sourceCode":"                \"json\",\n                \"-show_streams\",\n                \"-select_streams\",\n                \"a\",\n                src,\n            ],\n            input=stdin,\n            capture_output=True,\n            timeout=30,\n        )\n        if r.returncode != 0:\n            stderr = r.stderr.decode(\"utf-8\", errors=\"replace\")\n            raise RuntimeError(f\"ffprobe failed for {label}: {stderr}\")\n        return bool(json.loads(r.stdout).get(\"streams\"))\n    except subprocess.TimeoutExpired:\n        logger.error(\"ffprobe timed out for %s\", label)\n        raise\n    except FileNotFoundError as e:\n        raise RuntimeError(\"ffprobe not found; install ffmpeg\") from e\n    except json.JSONDecodeError:\n        logger.error(\"ffprobe returned invalid JSON for %s\", label)\n        raise\n\n\nclass MiMoProcessor:\n    def __init__(\n        self,\n        tokenizer,\n        patch_size=14,\n        merge_size=2,\n        temporal_patch_size=2,\n        temporal_compression_ratio=1,\n        video_tokens_per_second=2,\n        use_video_timestamps=False,\n        video_audio_interleave_length=0,\n        use_per_grid_t_timestamps=True,\n        audio_kernel_size=3,","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/multimodal/processors/mimo_v2.py#L243-L279","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Install ffmpeg (e.g. 'apt-get update && apt-get install -y ffmpeg' or 'conda install -y ffmpeg') and restart the sglang server","Verify with 'ffprobe -version' inside the exact container/user the server runs as","If containerized, add ffmpeg to the image build and confirm PATH includes it for the server process"],"exampleFix":"# before: slim image, ffprobe missing → RuntimeError: ffprobe not found; install ffmpeg\n# after (Dockerfile)\nRUN apt-get update && apt-get install -y --no-install-recommends ffmpeg \\\n    && rm -rf /var/lib/apt/lists/*","handlingStrategy":"validation","validationCode":"import shutil\nif shutil.which('ffprobe') is None:\n    raise SystemExit('ffmpeg/ffprobe required for video inputs; install it before starting the server')","typeGuard":null,"tryCatchPattern":"try:\n    resp = client.generate(prompt, video=url)\nexcept RuntimeError as e:\n    if 'ffprobe not found' in str(e):\n        abort_with_instruction('server host needs ffmpeg installed')\n    raise","preventionTips":["Bake ffmpeg into the server Docker image","Add a startup health check that asserts shutil.which('ffprobe') is not None","Run ffprobe -version in the same env/user as the server to verify PATH"],"tags":["ffmpeg","subprocess","missing-dependency","multimodal","video"],"backgroundTag":"missing-system-dependency","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}