{"record":{"id":"f137a4f0f4ab544c","repo":"sgl-project/sglang","slug":"minimax-h3-audio-material-has-invalid-metadata","errorCode":null,"errorMessage":"MiniMax H3 audio material has invalid metadata","messagePattern":"MiniMax H3 audio material has invalid metadata","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":452,"sourceCode":"            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\n        if sample_rate <= 0:\n            raise ValueError(\"MiniMax H3 audio material has no usable sample rate\")\n        if channels <= 0:\n            raise ValueError(\"MiniMax H3 audio material has no usable channel count\")\n\n    durations: list[float] = []\n    for value in [\n        (payload.get(\"format\") or {}).get(\"duration\"),\n        *(stream.get(\"duration\") for stream in streams),\n    ]:\n        if value in {None, \"\", \"N/A\"}:\n            continue\n        try:\n            duration = float(value)\n        except (TypeError, ValueError):\n            continue\n        if math.isfinite(duration) and duration > 0:\n            durations.append(duration)","sourceCodeStart":434,"sourceCodeEnd":470,"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#L434-L470","documentation":"An audio stream's sample_rate or channels fields could not be converted to int — the ffprobe metadata is malformed for that stream.","triggerScenarios":"ffprobe returns an audio stream whose sample_rate/channels are non-numeric (None or garbage), making int() raise TypeError/ValueError.","commonSituations":"Partially corrupt audio tracks, streams from unusual containers, or high-channel layouts where ffprobe emits unexpected field formats.","solutions":["Re-encode the audio: ffmpeg -i in.mp4 -c:a aac -ar 44100 -ac 2 out.mp4","Inspect ffprobe -show_streams JSON for the offending audio stream","Drop the broken material or replace its source"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"for s in audio_streams:\n    int(s[\"sample_rate\"]); int(s[\"channels\"])  # KeyError/TypeError = bad metadata","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Re-encode audio with -ar/-ac at ingest"],"tags":["minimax-h3","audio-metadata","ffprobe"],"backgroundTag":"invalid-media-metadata","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}