Nodes/WAS Node Suite v3/Video Metadata
ComfyUI Node Runs on cloud

Video Metadata

Open the figures a video load measured

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
Video Metadata
  • metadata
  • fps
  • frame_count
  • duration
  • width
  • height
  • has_audio
  • bit_depth
  • source_fps
  • source_frame_count
  • source_duration
  • source_width
  • source_height
  • filename

The video loaders in WAS Node Suite don't splash a column of numbers across the canvas - they bundle everything they measured into one metadata socket, and Video Metadata is the node that opens it back up. If a load read a clip at a target fps, cut a range, or resized the frames, this is where you find out what actually came out versus what the source file held.

What it does

Take the metadata output of Load Video or Load Video (Upload), drop it in, and the figures arrive on individual sockets:

  • fps - the rate the batch plays at: target_fps when one was given, otherwise the file's encoded rate.
  • frame_count - how many frames actually came out, after the range, the strategy and target_fps were all applied. This is the one to feed a sampler that needs its length told to it.
  • duration - seconds the output plays for (frame_count ÷ fps).
  • width / height - frame size after any resizing the load did.
  • has_audio - true when the load's audio output carries sound.
  • bit_depth - the file's encoded depth (8 or 10); the video output carries the same, so a save can write it back as it came in.

Then comes the half that makes this node distinct: the source_ figures. source_fps, source_frame_count, source_duration, source_width and source_height describe the file as it was on disk, before target_fps, the range and the strategy cut it down. Compare source_frame_count against frame_count and you know exactly how much of the clip you kept - genuinely useful when you loaded every Nth frame or a trimmed window and want to confirm the math. And filename gives the source file's name (folder stripped) for stamping a render's filename prefix after its origin.

Why both sets of numbers

The reason it reports "what came out" and "what the file held" side by side is that a video load is a transform, not a copy. If you loaded a 30 fps file with target_fps 24 and asked for frames 0–100, the metadata socket knows all of that - and only this node surfaces it. Want the file's true rate before you resample further? That's source_fps. Want the length your sampler will actually see? That's frame_count. Both questions come up constantly in video pipelines, and this node answers both without re-reading the file.

Not the same as Video Info

It's easy to mix these two up. Video Info takes a VIDEO wire and measures it fresh from the header - use it when you have any video value and want its figures. Video Metadata takes the loader's metadata socket, which carries what that specific load already measured, including the source file's side of the story. If you loaded through Load Video, the metadata socket is richer (you get source_* and filename); if your video came from anywhere else, Video Info is the general-purpose measure. Pick the one that matches where your video came from.

Installing it

Part of WAS Node Suite v3 (WASasquatch's was-node-suite-comfyui, MIT). Search "WAS Node Suite v3" in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui.git

Restart ComfyUI after installing. Requires ComfyUI 0.14.0+ and Python 3.10+. Video decoding uses ComfyUI's bundled FFmpeg/PyAV stack; nothing extra to pip install for this node.

CategoryWAS Suite/IO

Inputs (1)

NameTypeDefaultDescription
metadataWAS_VIDEO_METADATAThe metadata output of Load Video or Load Video (Upload).

Outputs (13)

NameTypeDescription
fpsFLOATFrames per second the batch plays at: target_fps when one was given, otherwise the rate the file was encoded at.
frame_countINTHow many frames came out, after the range, the strategy and target_fps have all been applied. Feed it to a sampler that needs its length told to it.
durationFLOATSeconds the frames that came out play for, which is frame_count divided by fps.
widthINTFrame width in pixels, after resizing.
heightINTFrame height in pixels, after resizing.
has_audioBOOLEANTrue when the load's audio output carries sound. False for a silent file, and for one whose sound track PyAV could not decode.
bit_depthINTBits per colour component the file is encoded at, 8 for most footage and 10 for HDR and higher end capture. The video output carries the same depth, so a save writes it back as it came in.
source_fpsFLOATThe rate the file itself was encoded at, before target_fps.
source_frame_countINTFrames the whole file holds, before the range and the strategy cut it down. Compare it with frame_count to see how much was kept.
source_durationFLOATSeconds the whole file runs for, whatever was kept from it.
source_widthINTFrame width the file holds, before resizing.
source_heightINTFrame height the file holds, before resizing.
filenameSTRINGThe file the frames were read from, without its folder. Feed it to a filename prefix so a render is named after its source.