{"record":{"id":"fb2c5a4b855ea005","repo":"sgl-project/sglang","slug":"minimax-h3-video-material-has-invalid-dimensions","errorCode":null,"errorMessage":"MiniMax H3 video material has invalid dimensions","messagePattern":"MiniMax H3 video material has invalid dimensions","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/material_io.py","lineNumber":434,"sourceCode":"        \"flac\",\n        \"ogg\",\n    }\n    if not format_names or not format_names.issubset(allowed_formats):\n        raise ValueError(\"MiniMax H3 media container format is not allowed\")\n    video_streams = [s for s in streams if s.get(\"codec_type\") == \"video\"]\n    audio_streams = [s for s in streams if s.get(\"codec_type\") == \"audio\"]\n    if condition_type in {\"video\", \"video_audio\"} and not video_streams:\n        raise ValueError(\"MiniMax H3 video material has no video stream\")\n    if condition_type in {\"audio\", \"video_audio\"} and not audio_streams:\n        raise ValueError(\"MiniMax H3 audio material has no audio stream\")\n\n    primary_video: dict[str, Any] | None = None\n    for stream in video_streams:\n        try:\n            width = int(stream.get(\"width\") or 0)\n            height = int(stream.get(\"height\") or 0)\n        except (TypeError, ValueError) as exc:\n            raise ValueError(\n                \"MiniMax H3 video material has invalid dimensions\"\n            ) from exc\n        if width <= 0 or height <= 0:\n            raise ValueError(\"MiniMax H3 video material has no positive dimensions\")\n        fps = _parse_frame_rate(stream.get(\"avg_frame_rate\")) or _parse_frame_rate(\n            stream.get(\"r_frame_rate\")\n        )\n        if fps <= 0:\n            raise ValueError(\"MiniMax H3 video material has no usable frame rate\")\n        if primary_video is None:\n            primary_video = stream\n\n    for stream in audio_streams:\n        try:\n            sample_rate = int(stream.get(\"sample_rate\") or 0)\n            channels = int(stream.get(\"channels\") or 0)\n        except (TypeError, ValueError) as exc:\n            raise ValueError(\"MiniMax H3 audio material has invalid metadata\") from exc","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/material_io.py#L416-L452","documentation":"A video stream's width/height fields could not be parsed as integers (TypeError/ValueError from int() on the ffprobe values). The stream metadata is malformed.","triggerScenarios":"ffprobe returns a video stream whose 'width'/'height' keys hold non-numeric strings or None-like values that int() rejects.","commonSituations":"Exotic/corrupt containers where ffprobe emits partial metadata; streams with unset dimensions (some raw/coded streams).","solutions":["Re-mux/re-encode the file with ffmpeg to force dimension metadata: ffmpeg -i in.mkv -c:v libx264 out.mp4","Inspect ffprobe -show_streams -of json output for the offending stream","Drop or replace the problematic material"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"for s in video_streams:\n    try:\n        assert int(s[\"width\"]) > 0 and int(s[\"height\"]) > 0\n    except (KeyError, TypeError, ValueError):\n        raise BadMaterial(path)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Re-encode untrusted media with ffmpeg at ingest"],"tags":["minimax-h3","video-dimensions","ffprobe","metadata"],"backgroundTag":"invalid-media-metadata","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}