Skip to content

cli, core: add --no-audio option to skip audio VAE decode and write video-only MP4 - #58

Open
lorenzoperrone wants to merge 1 commit into
antirez:mainfrom
lorenzoperrone:feature/no-audio-option
Open

cli, core: add --no-audio option to skip audio VAE decode and write video-only MP4#58
lorenzoperrone wants to merge 1 commit into
antirez:mainfrom
lorenzoperrone:feature/no-audio-option

Conversation

@lorenzoperrone

Copy link
Copy Markdown

Currently, h3_generate() always decodes the audio VAE (7 blocks) and muxes a soundtrack, even when only visual output is needed. This is primarily a workflow and output-control feature rather than a major performance optimization: on tested Apple Silicon (M2 Pro) it saves roughly 1–4 seconds, while text encoding, DiT, and the video VAE still dominate generation time.

Changes

  • Add disable_audio field to struct h3_params and its default initialization in H3_PARAMS_DEFAULT, validated as zero-or-one like other boolean parameters.
  • Add --no-audio CLI flag in main.c and document it in usage().
  • Bypass the audio VAE decoding phase in h3_generate() when disable_audio is enabled; waveform remains zeroed, ensuring cleanup and error paths remain safe.
  • Select the existing video-only writer h3_ffmpeg_write_rgb24() at mux time instead of h3_ffmpeg_write_av_rgb24_f32().
  • Add !audio [on|off] command and Audio: on/off display in interactive !status (h3_cli.c).

Use cases

  • Fast visual previews and denoising iteration when audio synthesis is not required.
  • Creating clean video-only MP4 files without dummy or silence audio tracks, resulting in smaller file sizes.

Verification

Tested on Apple M2 Pro (macOS):

make -j8
make test
./h3 -d ./MiniMax-H3 -p "A cute red fox in snow" --width 256 --height 256 \
    --frames 22 --steps 2 --no-audio -o outputs/test_silent.mp4
ffprobe outputs/test_silent.mp4
  1. make test passes all checks cleanly (ok: 1768 checks, FFmpeg mux tests pass).
  2. With --no-audio, the generation skips the audio VAE phase entirely.
  3. DiT streaming metrics remain identical to the standard path.
  4. ffprobe confirms the output container has only a single H.264 video stream and no audio stream:
Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 256x256, 24 fps, 24 tbr, 12288 tbn (default)
  1. Interactive REPL session tested: !status displays Audio: on, !audio off toggles it to Audio: off, and !audio toggles state back and forth as expected.

…ideo-only MP4

Add --no-audio CLI flag and interactive !audio on|off REPL command to allow
skipping the audio VAE decode stage and generating silent/video-only MP4s.

- Add disable_audio parameter to struct h3_params and default initialization
- Add --no-audio command line option to main.c
- Bypass audio VAE decoding in h3_generate() when disable_audio is set
- Use video-only h3_ffmpeg_write_rgb24() writer when audio is disabled
- Add !audio [on|off] command and status display in h3_cli.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant