{"record":{"id":"6b5a305d9ee9e698","repo":"sgl-project/sglang","slug":"minimax-h3-media-material-has-no-positive-duration","errorCode":null,"errorMessage":"MiniMax H3 media material has no positive duration","messagePattern":"MiniMax H3 media material has no positive duration","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":472,"sourceCode":"            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)\n    if not durations:\n        raise ValueError(\"MiniMax H3 media material has no positive duration\")\n\n    duration_seconds = max(durations)\n    facts: dict[str, Any] = {\n        \"condition_type\": condition_type,\n        \"duration_seconds\": duration_seconds,\n        \"has_audio\": bool(audio_streams),\n    }\n    if primary_video is not None:\n        coded_width = int(primary_video.get(\"width\") or 0)\n        coded_height = int(primary_video.get(\"height\") or 0)\n        display_width, display_height, sar, rotation = _display_geometry(primary_video)\n        fps = _parse_frame_rate(primary_video.get(\"avg_frame_rate\"))\n        if fps <= 0:\n            fps = _parse_frame_rate(primary_video.get(\"r_frame_rate\"))\n        raw_count = primary_video.get(\"nb_frames\")\n        try:\n            frame_count = int(raw_count)\n        except (TypeError, ValueError):","sourceCodeStart":454,"sourceCodeEnd":490,"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#L454-L490","documentation":"No positive, finite duration could be found from the container format.duration or any stream duration. Every candidate was missing, zero/negative, or NaN/inf. The pipeline needs a duration for scheduling and truncation.","triggerScenarios":"Media files where ffprobe reports no duration at all (live streams, some raw streams, growing files) or only 0/N/A durations.","commonSituations":"Concatenated or streamed captures without seek indexes, files still being written, or raw streams (.aac, .h264 elementary).","solutions":["Re-mux to force duration metadata: ffmpeg -i in.webm -c copy out.mp4","Fully finalize/finish writing the media before submitting (no growing files)","For live captures, record with a proper container (mp4/mkv) so duration is indexed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"dur = float(json.loads(subprocess.check_output([\"ffprobe\", \"-v\", \"error\", \"-show_entries\", \"format=duration\", \"-of\", \"json\", path]))[\"format\"].get(\"duration\") or 0)\nassert dur > 0","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never submit files still being written","Re-mux captures to mp4/mkv to force a duration index"],"tags":["minimax-h3","duration","ffprobe","media"],"backgroundTag":"missing-media-metadata","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}