Skip to content

[Bug] MiniMax-H3: the soundtrack runs past the video when frames*40/fps rounds up (124 frames at 24 fps: +8 ms), ending in a click #2331

Closed

Description

@yufei-pan

Git commit

5a1ba5d (master-1053). The lines involved are unchanged on today's master.

Operating System & Version

Arch Linux (kernel 7.2)

GGML backends

Vulkan (the bug is in a length calculation, so it should not depend on the backend)

Command-line arguments used

sd-cli --mode vid_gen --diffusion-model <minimax-h3 Q8_0 gguf> --vae <video vae> --audio-vae <audio vae> --llm <text encoder> \
  --prompt "<H3 structured prompt with overall_soundscape: N/A and non_diegetic_music: N/A>" \
  --cfg-scale 1 --width 1024 --height 768 --rng cpu --fps 24 --video-frames 124 --steps 4 --seed 44 --output out.avi

Steps to reproduce

  1. Render MiniMax-H3 at 24 fps with --video-frames 124, using a prompt that asks for no sound (a still interior scene, soundscape and music N/A).
  2. Read the PCM in out.avi and compare its length with the video's: 124 frames at 24 fps is 5.1667 s, which is 165333 samples at 32 kHz.

What you expected to happen

The soundtrack is as long as the video, as it already is for Wan2.2 S2V: generate_video cuts the driving track to the video's duration there (src/pipeline/video.cpp, "Limit the driving track to the generated video's duration").

What actually happened

get_minimax_h3_num_audio_latents returns lround(frames * 40.0 / fps). At 124 frames that is lround(206.67) = 207 latents = 165600 samples = 5.175 s. The sound runs 267 samples (8.3 ms) past the last frame, and nothing trims it for H3.

The extra samples aren't silence. On the render above, which is silent elsewhere, the PCM peaks at -56 dB up to the video's end and at -39 dB in the last 267 samples. The burst grows toward the end, and the last 1 ms peaks climb from -78 dB to -39 dB over the last 10 ms. A muxer or player that doesn't cut the audio to the video plays it as a click at the end of the clip.

It happens whenever frames * 40 / fps rounds up. At 24 fps that is frames mod 3 == 1: 22, 73, 124, 175, 226, 277, 328. On silent still scenes, 13 of 17 clips at those lengths ended in a click, against 1 of 19 at lengths where the sound is as long as the video or shorter. The same seed and prompt reproduce it exactly.

Logs / error messages / stack trace

None. The run succeeds.

Additional context / environment details

  • Suggested fix: cut H3's decoded audio to round(frames / fps * sample_rate) samples before it is returned, the same way as the S2V branch.
  • Not known: whether the burst is the content of the last audio latent or an edge effect of the audio decoder. Another H3 engine that also rounds the latent count up shows the same overhang and burst, which points at the model or the decoder rather than at sd.cpp's own code. sd.cpp is the place where the extra samples could be cut off.
  • GPU: AMD Radeon AI PRO R9700 (RADV). Model: MiniMax-H3 Q8_0 with its video and audio VAEs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions