Nodes/TrentNodes/Video Folder Analyzer
ComfyUI Node

Video Folder Analyzer

Know What's Actually in Your Video Folder Before You Burn GPU Hours on It

By TrentHunter82·Created 9 months ago·Updated 4 days ago· 36
Video Folder Analyzer
    • report
    • json_data
    folder_path
    include_subfoldersfalse
    output_formatmarkdown
    file_extensionsmp4,avi,mov,mkv,wmv,flv,webm,m4v,mpg,mpeg

    Every video project has that moment: you've got a folder of clips and no idea which ones are 4K, which are 25fps, and which one is a 2-minute MP4 that OpenCV refuses to open. The Video Folder Analyzer is the inventory pass you run before you commit the expensive part of a pipeline to the wrong files. It scans a directory, reads the metadata out of every video it can open, and hands you a report in your choice of text, JSON, or Markdown.

    It's a report node, not a loader. If you want frames out of those videos, that's Video Folder Cowboy's job (same pack, also worth a look). This one answers "what's here and is it healthy" so you can catch problems in a batch before they waste a generation run.

    How it works

    Under the hood it's OpenCV doing the reading. For each file it opens a VideoCapture, pulls the width, height, FPS, and frame count from the container, derives duration as frame_count / fps, decodes the FOURCC bytes to get a readable codec string, and computes a rough bitrate from file size and duration. Files it can't open don't kill the run - they get collected into an errors section of the report, which is honestly the most useful part. A list of the clips OpenCV can't read is a great early-warning system for corrupt or half-downloaded files.

    The inputs that matter

    You'll mostly set two things and forget the rest:

    • folder_path - the directory to scan. There's no default shortcut: leave it blank and you get an "Invalid folder path" error right back, so type the absolute path. If no videos match, you get a clear "No video files found" message instead of silence.
    • output_format - text, json, or markdown. Markdown is the nicest to read and paste into a showAnything node; JSON is what you want if something downstream will parse it.

    Then there's include_subfolders (off by default - turn it on if your renders are nested) and file_extensions, a comma-separated list defaulting to mp4,avi,mov,mkv,wmv,flv,webm,m4v,mpg,mpeg. Add your exotic containers there if they're being skipped.

    Outputs

    Two strings:

    • report - the human-readable report in whatever format you picked.
    • json_data - the same data as JSON, ready for the JSON Extractor or any plumbing node.

    Wire report to a text preview or save it, and treat json_data as the machine-readable twin.

    Troubleshooting

    The classic gotcha is FPS or codec reading as 0/Unknown for codecs OpenCV can't fully demux - that's a limitation of the reader, not your file being broken. Also note the analyzer runs on CPU and opens every file, so a folder of 200 long clips takes a few seconds and can look frozen; it isn't.

    Installing

    TrentNodes is one pack of 60+ nodes, so install once and everything appears under the Trent/ menus. The clean path is ComfyUI Manager → search "Trent Nodes" → Install. If Manager balks (the author renamed the repo on day one and the registry ended up with a duplicate that occasionally flags the pack as unsafe), just do it by hand:

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

    Then restart ComfyUI. Heavy deps like transnetv2-pytorch and psd-tools come along for the ride, so the first install is the slow one - this node itself only needs OpenCV, which ComfyUI already has.

    CategoryTrent/Video

    Inputs (4)

    NameTypeDefaultDescription
    folder_pathSTRING
    include_subfoldersBOOLEANfalse
    output_formatCOMBOmarkdown3 options: text, json, markdown
    file_extensionsoptSTRINGmp4,avi,mov,mkv,wmv,flv,webm,m4v,mpg,mpeg

    Outputs (2)

    NameTypeDescription
    reportSTRING
    json_dataSTRING