{"record":{"id":"a4d22f44748c5d9e","repo":"sgl-project/sglang","slug":"ffprobe-returned-invalid-json-for-minimax-h3-outpu","errorCode":null,"errorMessage":"ffprobe returned invalid JSON for MiniMax H3 output","messagePattern":"ffprobe returned invalid JSON for MiniMax H3 output","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/video_adapter.py","lineNumber":400,"sourceCode":"    except subprocess.TimeoutExpired as exc:\n        raise RuntimeError(\n            \"MiniMax H3 final output ffprobe timed out after 30 seconds\"\n        ) from exc\n    except FileNotFoundError as exc:\n        raise RuntimeError(\n            \"ffprobe is required to validate final MiniMax H3 output\"\n        ) from exc\n    except subprocess.CalledProcessError as exc:\n        detail = (exc.stderr or \"\").strip()\n        suffix = f\": {detail}\" if detail else \"\"\n        raise RuntimeError(\n            f\"ffprobe failed for final MiniMax H3 output{suffix}\"\n        ) from exc\n\n    try:\n        payload = json.loads(probe.stdout)\n    except (TypeError, ValueError) as exc:\n        raise RuntimeError(\n            \"ffprobe returned invalid JSON for MiniMax H3 output\"\n        ) from exc\n    if not isinstance(payload, dict):\n        raise RuntimeError(\"ffprobe returned invalid JSON for MiniMax H3 output\")\n    streams = payload.get(\"streams\") or []\n    if not isinstance(streams, list):\n        raise RuntimeError(\"ffprobe returned invalid stream metadata\")\n    video_streams = [\n        stream\n        for stream in streams\n        if isinstance(stream, dict) and stream.get(\"codec_type\") == \"video\"\n    ]\n    audio_streams = [\n        stream\n        for stream in streams\n        if isinstance(stream, dict) and stream.get(\"codec_type\") == \"audio\"\n    ]\n    if len(streams) != 2 or len(video_streams) != 1 or len(audio_streams) != 1:","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/video_adapter.py#L382-L418","documentation":"After ffprobe succeeds, its stdout is parsed as JSON (ffprobe -show_streams -of json style). If json.loads raises TypeError/ValueError, the output is not parseable JSON — typically because ffprobe printed warnings/banners to stdout or an unexpected format was requested. The adapter cannot extract stream metadata, so it raises RuntimeError.","triggerScenarios":"ffprobe stdout containing non-JSON noise (version banners, warnings) or truncated output, causing json.loads to fail.","commonSituations":"Exotic ffprobe builds/versions with different JSON output behavior; locale/env forcing extra output; stdout interleaved with warnings.","solutions":["Run the same ffprobe command manually and inspect raw stdout","Upgrade/normalize the ffmpeg installation (use a standard distro build)","Pin output_path to local storage to avoid interleaved FS warnings"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    fields = adapter.validate_final_outputs_sync(paths, batch)\nexcept RuntimeError as e:\n    if \"invalid JSON\" in str(e):\n        fields = manual_ffprobe_json(paths[0])  # parse ffprobe yourself\n    else:\n        raise","preventionTips":["Pin a standard distro ffmpeg package in images","Avoid custom ffprobe wrappers on PATH"],"tags":["minimax-h3","ffprobe","json-parse","validation"],"backgroundTag":"invalid-json-response","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}