sgl-project/sglang · error · ValueError

MiniMax H3 media container format is not allowed

Error message

MiniMax H3 media container format is not allowed

What it means

The container format names reported by ffprobe are empty or include a format outside the allowlist (mp4, mov, webm, mkv, avi, and audio containers wav, mp3, flac, ogg). Enforced to guarantee downstream decoders only see supported containers.

Source

Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/material_io.py:420

    format_names = set(
        str((payload.get("format") or {}).get("format_name") or "").split(",")
    )
    allowed_formats = {
        "mov",
        "mp4",
        "m4a",
        "3gp",
        "3g2",
        "mj2",
        "matroska",
        "webm",
        "wav",
        "mp3",
        "flac",
        "ogg",
    }
    if not format_names or not format_names.issubset(allowed_formats):
        raise ValueError("MiniMax H3 media container format is not allowed")
    video_streams = [s for s in streams if s.get("codec_type") == "video"]
    audio_streams = [s for s in streams if s.get("codec_type") == "audio"]
    if condition_type in {"video", "video_audio"} and not video_streams:
        raise ValueError("MiniMax H3 video material has no video stream")
    if condition_type in {"audio", "video_audio"} and not audio_streams:
        raise ValueError("MiniMax H3 audio material has no audio stream")

    primary_video: dict[str, Any] | None = None
    for stream in video_streams:
        try:
            width = int(stream.get("width") or 0)
            height = int(stream.get("height") or 0)
        except (TypeError, ValueError) as exc:
            raise ValueError(
                "MiniMax H3 video material has invalid dimensions"
            ) from exc
        if width <= 0 or height <= 0:
            raise ValueError("MiniMax H3 video material has no positive dimensions")

View on GitHub (pinned to 0132848349)

Solutions

  1. Re-mux or re-encode into an allowed container
  2. For audio, prefer wav/mp3/flac/ogg; for video mp4/mov/webm/mkv

Example fix

# before
ffmpeg -i input.flv -c copy output.flv
# after
ffmpeg -i input.flv -c:v libx264 -c:a aac output.mp4
Defensive patterns

Strategy: validation

Validate before calling

import subprocess, json
out = subprocess.check_output(["ffprobe", "-v", "error", "-show_format", "-of", "json", path])
names = set(json.loads(out)["format"]["format_name"].split(","))
allowed = {"mp4", "mov", "webm", "mkv", "avi", "wav", "mp3", "flac", "ogg"}
assert names and names <= allowed

Prevention

When it happens

Trigger: A media material in, e.g., FLV, TS, M4A, AIFF, or a container ffprobe can't identify (format_names empty).

Common situations: Live-stream captures (MPEG-TS), Apple audio (m4a), or unusual muxings from user uploads hitting the pipeline.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/51e908d3eefea2aa. Report an issue: GitHub.