Nodes/MKRShift_Nodes/Mux Video + Audio
ComfyUI Node

Mux Video + Audio

Stick the voiceover on the footage, no NLE required

By criskb·Created 7 months ago·Updated 5 months ago· 0
Mux Video + Audio
  • video
  • audio
  • video
  • output_path
  • summary
output_formatmp4
filename_prefixMKR_mux
subfolder
overwritefalse
audio_offset_ms0
audio_gain_db0.0
shortesttrue
filename_label

The "attach the audio" node

You've generated the video, you've generated (or loaded) the audio, and now you need one playable file. That's the whole job of MKRMuxVideoAudio: take a video track and an audio track and mux them into a single mp4, mov, or webm with ffmpeg. It's the glue step that turns two files into a deliverable, and it's the node you'll reach for at the end of almost every video workflow that involves sound.

It's part of MKRShift_Nodes, the utility pack by Cris K B. Everything here is ffmpeg under the hood, so ffmpeg on your PATH is a hard requirement - this node will refuse to do anything useful without it.

How it works

It resolves both inputs to file paths (the video must be resolvable to a file; the audio gets materialized to a temp file if needed), then runs ffmpeg with -map 0:v:0 -map 1:a:0 to keep the first video stream and the first audio stream. Simple, predictable, no re-encoding of the video track.

The useful knobs beyond the basics:

  • audio_offset_ms - delay the audio by up to 10 minutes. This is your sync-fixer when the voiceover is a few hundred ms off. (Offset only delays; if your audio is early, pre-trim it or plan accordingly.)
  • audio_gain_db (−30 to +30) - adjust audio level during the mux. Handy when the music bed is too hot relative to the VO, without a separate gain pass.
  • shortest (default on) - cut the output at the shorter of the two tracks. Turn it off if you want the full video duration with silence tailing the audio.

Plus the standard pack save controls: output_format (mp4/mov/webm), filename_prefix, subfolder, overwrite, optional filename_label.

Outputs

video (the pack's MKR_VIDEO payload pointing at the muxed file), output_path (where it landed), and a summary JSON with both source paths and any warnings.

Install and gotchas

cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes

Restart, or install "MKRShift Nodes" via ComfyUI Manager. No pip deps, no models - but again, ffmpeg must be installed and on PATH. The README calls this out explicitly; ignore it and every media node in the pack silently under-delivers.

Three real-world gotchas. First, if the video input can't be resolved to a file path, you get a warning and nothing happens - this node is pickier than the decode-based ones because muxing needs real files. Second, audio_offset_ms only goes one direction (positive delay); don't expect negative offsets. Third, muxing with mp4 and an unsupported audio codec can produce a file some players reject - if you hit that, remux to mov or transcode the audio first. For the 90% case - generated clip plus a voiceover, synced, loudness-checked, muxed - this is a one-node finish.

CategoryMKRShift Nodes/Media/IO

Inputs (10)

NameTypeDefaultDescription
video*
audio*
output_formatCOMBOmp43 options: mp4, mov, webm
filename_prefixSTRINGMKR_mux
subfolderSTRING
overwriteBOOLEANfalse
audio_offset_msINT00–600000
audio_gain_dbFLOAT0.0-30–30
shortestBOOLEANtrue
filename_labeloptSTRING

Outputs (3)

NameTypeDescription
videoMKR_VIDEO
output_pathSTRING
summarySTRING