Nodes/Dream Project Animation Nodes/🎬 Video Encoder (FFMPEG)
ComfyUI Node

🎬 Video Encoder (FFMPEG)

Turn thousands of frames into one mp4

By alt-key-projectΒ·Created 3 years agoΒ·Updated 2 years agoΒ· 114
🎬 Video Encoder (FFMPEG)
  • sequence
  • log_entry
β—„namevideoβ–Ί
β—„framerate_factor1.00β–Ί
β—„remove_imagestrueβ–Ί

You've rendered 900 frames of animation and you have a folder full of PNGs. Now what? This is the node that fuses them back into an actual video. Video Encoder (FFMPEG) [Dream] takes the sequence your Image Sequence Saver produced at the end of the animation, shells out to ffmpeg, and writes an mp4 next to the frames. It's the last node in the chain, and for a lot of Dream Project workflows it's the whole payoff.

How it works

The node collects the frame files from the incoming sequence, writes a temporary "concat" list where every frame gets an explicit duration, then runs your ffmpeg binary with arguments pulled from the pack's config.json (created in ComfyUI/custom_nodes/comfyui-dream-project/ on first run). Three placeholders get substituted into the argument list:

  • %FPS% - the target framerate
  • %FRAMES% - the temp frame-list file
  • %OUTPUT% - the output video path

The default config asks ffmpeg for a libx264 mp4 with yuv420p pixel format, which is the compatibility-safe choice. The output file gets numbered automatically (video.mp4, video_2.mp4, ...) so you never overwrite a previous render.

The inputs that matter

  • sequence - the ANIMATION_SEQUENCE from your Image Sequence Saver. If it's not connected, nothing happens (the node quietly returns an empty log entry).
  • name - base filename, default video.
  • framerate_factor - scales the output framerate. 1.0 is true speed; 0.5 gives slow-motion-ish playback of the same frames.
  • remove_images - default on, and this is the one to be careful with. After encoding, the node deletes the frame files. Great for not leaving 900 PNGs on disk, terrible if you wanted to re-encode later. Turn it off until you're happy with the output.

The only output is a log_entry, which you can wire into the pack's Log File node if you want the "Generated video …" message captured to disk.

Installing it

Ships with Dream Project Animation Nodes - ComfyUI Manager (search Dream Project Animation) or git clone https://github.com/alt-key-project/comfyui-dream-project into custom_nodes, pip install -r requirements.txt, restart. The pack doesn't bundle ffmpeg; you need a working ffmpeg on your system, and the pack needs to find it via the ffmpeg.path setting.

Common issues

This is the pack's most complained-about node, and the author knows it. The default ffmpeg argument list doesn't work on every ffmpeg build - some reject it silently, some error out. The fix is in config.json: under ffmpeg, fix path to the absolute location of your binary, and edit arguments until your ffmpeg accepts it. The node-supplied placeholders -i %FRAMES%, -r %FPS% and %OUTPUT% all need to stay in the call. People also hit the destructive remove_images surprise after the fact, and one common miss: if ffmpeg isn't on your PATH, the node fails at write time - so point ffmpeg.path at the real binary and test it once with a short render before you commit to a long one.

Category✨ Dream/πŸŽ₯ animation/βš™ postprocessing

Inputs (4)

NameTypeDefaultDescription
sequenceANIMATION_SEQUENCEβ€”
nameSTRINGvideoβ€”
framerate_factorFLOAT1.000.01–100β€”
remove_imagesBOOLEANtrueβ€”

Outputs (1)

NameTypeDescription
log_entryLOG_ENTRYβ€”