Nodes/ComfyUI-ZoeyTool/Zoey - 视频批处理器
ComfyUI Node

Zoey - 视频批处理器

Re-encode a whole folder of videos to one format and frame rate — and skip the ones already done

By liangzoey·Created about a year ago·Updated 3 days ago· 5
Zoey - 视频批处理器
  • videos
  • 处理视频
frame_rate30
output_formatmp4
deviceauto
skip_existingtrue

VideoBatchProcessor is the "make all these videos the same" node. You feed it a list of video files and it rewrites each one into the container and frame rate you want - all of them to mp4, or all to avi or mov, at 30fps instead of whatever mix of 24/25/30 they arrived as. It's a normalizer, the kind of boring-but-necessary step you hit when you've collected clips from several sources and your next tool demands one format, one frame rate.

It belongs to the three-node video batch pipeline in comfyui-ZoeyTool: the pack's BatchVideoLoader scans a directory (natural sort, mp4/avi/mov, limit control), this processor normalizes each file, and EnhancedVideoSaver files them away neatly. ComfyUI is overkill for this on paper - ffmpeg does it in one line - but if you already live in ComfyUI and want the whole folder run inside your existing graph, it saves you a trip to the terminal.

How it works

Input videos expects a VIDEO_BATCH - in practice, the file-path list produced by the pack's own BatchVideoLoader. For each video it opens the file with OpenCV, and writes a new copy at your requested frame_rate and output_format into a processed subfolder next to the originals. Output filenames keep the source base name with the new extension.

Two mechanism details worth being honest about:

  • It rewrites the stream, it doesn't re-timestamp magic. All frames are written out at the target fps, so a 24fps clip normalized to 30fps keeps its frame count - meaning its duration shifts slightly. That's usually fine for normalization (players just label it 30fps). If you actually need to resample motion smoothly, that's a job for a proper video tool, not this node.
  • device is mostly cosmetic. There's a cuda/cpu/auto dropdown, but the actual encode runs through OpenCV on the CPU either way. Don't expect a GPU speedup; expect it to work everywhere.

The genuinely nice touch is skip_existing (default on): if a video already has a processed output, it's left alone. Re-run the batch after a crash or a settings change and only the missing files get built - that "resume" behavior is the reason a full folder doesn't make you start over.

The output is a 处理视频 (VIDEO_BATCH) socket holding one entry per successfully processed file, with source path, output path, and format - that's exactly the shape the pack's EnhancedVideoSaver consumes.

Installing it

Part of comfyui-ZoeyTool; install the pack once:

cd ComfyUI/custom_nodes
git clone https://github.com/liangzoey/comfyui-ZoeyTool.git
cd comfyui-ZoeyTool
pip install -r requirements.txt

Restart ComfyUI (or install via ComfyUI Manager by searching comfyui-ZoeyTool). Note the README lists PyAV as needed for the video processor - the code does check for it and will run a one-time pip install av upgrade on first use if it's missing or older than 12.0, but the actual encoding path is OpenCV, which the pack already pulls in. So don't be alarmed if you see it trigger a PyAV pip install in the log on the first run.

Where people get burned

The classic mistake is feeding it a list that isn't the pack's VIDEO_BATCH format or isn't file paths at all - e.g. you wire in an image batch by accident and the processor tries to cv2.VideoCapture a tensor. Keep the chain to BatchVideoLoader → this node. Second, remember output lands in a processed subfolder inside your source directory - check there, not in ComfyUI's output folder. Third, skip_existing is on by default: if you changed the format or fps and re-run expecting everything to rebuild, it won't touch files that already exist. Flip skip_existing off when you want a full rebuild.

CategoryZoey Tool/视频处理

Inputs (5)

NameTypeDefaultDescription
videosVIDEO_BATCH
frame_rateINT301–60
output_formatCOMBOmp43 options: mp4, avi, mov
deviceCOMBOauto3 options: auto, cuda, cpu
skip_existingoptBOOLEANtrue

Outputs (1)

NameTypeDescription
处理视频VIDEO_BATCH