KY_FFmpeg: Merge Video/Audio
Mux a soundtrack onto a silent clip
- video_path
You've got a video-only render - from a video diffusion model, from KY_FFmpegTrimVideo, wherever - and a separate audio track you want stitched onto it. That's this node: a thin wrapper around ffmpeg that muxes a video file and an audio file together into one output, fast, because it copies the video stream instead of re-encoding it.
What's different about this whole node family
The KY_FFmpeg* nodes in this pack - this one, KY_FFmpegVideoToImages, KY_FFmpegTrimVideo, KY_FFmpegCustomCmd - all operate on plain file paths on disk, not ComfyUI's in-memory IMAGE/AUDIO/VIDEO tensors. That's a deliberate departure from how most of ComfyUI works, and it matters: you need to already have your video and audio saved as real files before this node can touch them, and its output is a file path string, not a playable object you can preview inline without another node reading it back.
The inputs and output
Three required string paths - video_in_path, audio_in_path, output_path - plus audio_codec, an enum of aac, mp3, or copy. The video stream is always stream-copied (fast, no quality loss, no re-encode wait); the audio codec choice controls whether your audio track gets transcoded to AAC or MP3, or passed through untouched with copy. The single output, video_path, is the string path to the finished, muxed file.
The default placeholder values (C:/path/to/video_only.mp4, etc.) are Windows-style - a hint at the original author's own setup - so if you're on Linux or macOS, just type in your real path with forward slashes; nothing about the node itself is OS-specific.
Installing it
ComfyUI Manager: search ComfyUI-KYNode, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/yorkane/ComfyUI-KYNode
Restart ComfyUI. This is where the pack's real dependency lives: ffmpeg itself needs to be installed on your system and reachable on PATH, since the node shells out to it rather than bundling a copy. The pack's README doesn't spell this out explicitly (it's a bare feature list, no install/requirements section), but every KY_FFmpeg* node's job description makes it unambiguous - this is a wrapper, not a from-scratch implementation.
Common issues
If the node fails outright, check ffmpeg -version from the same environment ComfyUI runs in - a portable Windows build especially can have a shell that doesn't see a system-wide ffmpeg install even if you can run it fine from your regular terminal.
If muxing fails with a codec/container error, that's usually the copy option for audio_codec - stream-copying audio only works if the source audio codec is actually compatible with your output container, and it often isn't. Switch to aac (broadly compatible with MP4) if copy throws an error.
And because this node reads and writes file paths rather than ComfyUI objects, if your video is coming from an upstream generation node, make sure something has actually saved it to disk first - wire a save node before this one, then feed this node the path that save node reports, not the in-memory video itself.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| video_in_path | STRING | C:/path/to/video_only.mp4 | — |
| audio_in_path | STRING | C:/path/to/audio_track.mp3 | — |
| output_path | STRING | C:/path/to/final_video.mp4 | — |
| audio_codec | COMBO | aac | 3 options: aac, mp3, copy |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| video_path | STRING | — |