Nodes/ComfyUI-FFMPEGA/Media Bridge (FFMPEGA)
ComfyUI Node

Media Bridge (FFMPEGA)

The translator between ComfyUI's tensor world and ffmpeg's file world

By AEmotionStudio·Created 8 months ago·Updated 2 days ago· 16
Media Bridge (FFMPEGA)
  • images
  • audio
  • mask
  • video_path
  • images
  • audio
  • mask
modeimages_to_path
video_path
fps24

ComfyUI thinks in IMAGE tensors - big batched arrays of frames living in GPU memory. FFMPEGA's Agent thinks in file paths - strings that ffmpeg reads from disk. Those two worlds don't talk, and that's the entire reason Media Bridge (FFMPEGA) exists. It's a bidirectional adapter: encode a tensor batch into a temp video file, or decode a video file back into a tensor batch plus audio. One node, a mode dropdown, both directions.

This is the node you reach for when a workflow has one foot in each world. Say you generated frames with a video model, want to run them through FFMPEGA's editor or agent, then come back to ComfyUI's tensor-based nodes with the result. Bridge handles the seams so you don't have to hand-assemble temp files and remember where you put them.

The inputs that matter

  • mode - the direction. images_to_path encodes an IMAGE tensor into a temp video file; path_to_images decodes a video path back into IMAGE + AUDIO. That's the whole node, really.
  • images - used in images_to_path mode: the frames to encode. Any IMAGE source works.
  • video_path - used in path_to_images mode: the file to decode.
  • fps - encoding frame rate (default 24), images_to_path only. Ignored in the other direction, where FPS is read from the file.
  • audio - optional, images_to_path only: mux this AUDIO into the encoded video. Leave it out and you get a silent temp file.

Outputs are populated in both modes for predictable wiring: video_path (temp file in one direction, empty string in the other), images, audio, plus fps and frame_count, which are always filled regardless of mode - handy metadata if you're using this as a pass-through measurement point.

Installing it

It ships in ComfyUI-FFMPEGA, so it comes with the pack: ComfyUI Manager → search ComfyUI-FFMPEGA → Install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/AEmotionStudio/ComfyUI-FFMPEGA.git
cd ComfyUI-FFMPEGA
pip install -r requirements.txt

Restart ComfyUI. FFMPEG on PATH is required (the encode/decode is real ffmpeg work, so ffmpeg -version should respond).

Where people get burned

Two things to keep straight. First, this writes a temp video - it's a bridge, not a save node. If you want a permanent file, run the result through Save Video (FFMPEGA), which copies it into ComfyUI's output directory without re-encoding. Second, images_to_path gives you a silent video unless you connect audio; if the downstream node is supposed to have sound and it doesn't, that's why. And don't confuse the bridge's 24 fps default with your actual content - if your frames were generated at 30 or 16, set fps explicitly or your "video" plays at the wrong speed and the decoded duration lies to you.

CategoryFFMPEGA

Inputs (6)

NameTypeDefaultDescription
modeCOMBOimages_to_pathimages_to_path: encode IMAGE tensor → temp video file path. path_to_images: decode video file path → IMAGE tensor + AUDIO.
imagesoptIMAGEVideo frames from a Load Video node or any IMAGE source. Used in images_to_path mode.
video_pathoptSTRINGPath to a video file. Used in path_to_images mode.
fpsoptINT241–120Frames per second for encoding (images_to_path mode). Ignored in path_to_images mode — FPS is read from the file.
audiooptAUDIOOptional audio to mux into the encoded video (images_to_path mode only).
maskoptMASKOptional upstream MASK pass-through. Forwarded as-is to the mask output.

Outputs (4)

NameTypeDescription
video_pathSTRINGFile path to the temp video (images_to_path) or empty string (path_to_images).
imagesIMAGEDecoded video frames (path_to_images) or empty tensor (images_to_path).
audioAUDIOExtracted audio (path_to_images) or silent fallback (images_to_path).
maskMASKUpstream MASK pass-through (or empty mask if not connected).