{"record":{"id":"0e1e47b64e40255b","repo":"sgl-project/sglang","slug":"generated-minimax-h3-mp4-has-invalid-size-width-x","errorCode":null,"errorMessage":"generated MiniMax H3 MP4 has invalid size {width}x{height}","messagePattern":"generated MiniMax H3 MP4 has invalid size (.+?)x(.+?)","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":429,"sourceCode":"        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:\n        raise RuntimeError(\n            \"generated MiniMax H3 MP4 must contain exactly one video stream and \"\n            f\"one audio stream, got {len(video_streams)} video, \"\n            f\"{len(audio_streams)} audio, and {len(streams)} total streams\"\n        )\n    video_stream = video_streams[0]\n    audio_stream = audio_streams[0]\n    width = int(video_stream.get(\"width\") or 0)\n    height = int(video_stream.get(\"height\") or 0)\n    if width <= 0 or height <= 0:\n        raise RuntimeError(\n            f\"generated MiniMax H3 MP4 has invalid size {width}x{height}\"\n        )\n    if expected_size is not None and (width, height) != expected_size:\n        raise RuntimeError(\n            \"generated MiniMax H3 MP4 size does not match the resolved request: \"\n            f\"expected {expected_size[0]}x{expected_size[1]}, got {width}x{height}\"\n        )\n    rate_raw = str(video_stream.get(\"avg_frame_rate\") or \"\")\n    try:\n        if \"/\" in rate_raw:\n            numerator, denominator = rate_raw.split(\"/\", 1)\n            fps = float(numerator) / float(denominator)\n        else:\n            fps = float(rate_raw)\n    except (TypeError, ValueError, ZeroDivisionError):\n        fps = 0.0\n    if abs(fps - float(MINIMAX_H3_SUPPORTED_FPS)) > 1e-6:\n        raise RuntimeError(","sourceCodeStart":411,"sourceCodeEnd":447,"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#L411-L447","documentation":"The video stream's width/height (defaulting to 0 when absent) must both be positive. A 0x0 or negative reported size means the stream metadata is missing dimensions or the file is corrupt, so the adapter raises RuntimeError.","triggerScenarios":"ffprobe reports no width/height keys on the video stream (defaults to 0), producing width<=0 or height<=0.","commonSituations":"Truncated or header-only MP4 files; unusual codecs where ffprobe cannot extract dimensions; partially-written outputs.","solutions":["Probe the file manually: `ffprobe -select_streams v -show_entries stream=width,height <file>`","Check disk space and generation logs for incomplete writes","Retry the request; corrupt outputs are usually transient","If persistent, investigate the decode/mux stage writing dimension-less streams"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"w,h = video_stream.get(\"width\",0), video_stream.get(\"height\",0)\nassert w>0 and h>0","typeGuard":"def has_positive_dims(vs: dict) -> bool:\n    return (vs.get(\"width\") or 0) > 0 and (vs.get(\"height\") or 0) > 0","tryCatchPattern":null,"preventionTips":["Discard zero-byte or header-only outputs before validation","Watch for disk-full errors during generation"],"tags":["minimax-h3","mp4","dimensions","validation"],"backgroundTag":"media-file-corrupt","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}