sgl-project/sglang · error · ValueError

MiniMax H3 audio material has no usable channel count

Error message

MiniMax H3 audio material has no usable channel count

What it means

An audio stream's channel count parsed but is <= 0 (field missing or 0). A positive channel count is required.

Source

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

            raise ValueError("MiniMax H3 video material has no positive dimensions")
        fps = _parse_frame_rate(stream.get("avg_frame_rate")) or _parse_frame_rate(
            stream.get("r_frame_rate")
        )
        if fps <= 0:
            raise ValueError("MiniMax H3 video material has no usable frame rate")
        if primary_video is None:
            primary_video = stream

    for stream in audio_streams:
        try:
            sample_rate = int(stream.get("sample_rate") or 0)
            channels = int(stream.get("channels") or 0)
        except (TypeError, ValueError) as exc:
            raise ValueError("MiniMax H3 audio material has invalid metadata") from exc
        if sample_rate <= 0:
            raise ValueError("MiniMax H3 audio material has no usable sample rate")
        if channels <= 0:
            raise ValueError("MiniMax H3 audio material has no usable channel count")

    durations: list[float] = []
    for value in [
        (payload.get("format") or {}).get("duration"),
        *(stream.get("duration") for stream in streams),
    ]:
        if value in {None, "", "N/A"}:
            continue
        try:
            duration = float(value)
        except (TypeError, ValueError):
            continue
        if math.isfinite(duration) and duration > 0:
            durations.append(duration)
    if not durations:
        raise ValueError("MiniMax H3 media material has no positive duration")

    duration_seconds = max(durations)

View on GitHub (pinned to 0132848349)

Solutions

  1. Re-encode with explicit channels: ffmpeg -i in.wav -ac 2 out.wav
  2. Inspect ffprobe -show_streams for the channels field
  3. Replace or re-mux the material
Defensive patterns

Strategy: validation

Validate before calling

assert all(int(s.get("channels") or 0) > 0 for s in audio_streams)

Prevention

When it happens

Trigger: Audio streams where ffprobe reports channels as absent or 0 — malformed stream headers or unusual channel layouts.

Common situations: Corrupt audio tracks, raw PCM streams without channel metadata, or files from broken encoders.

Related errors


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