Kosinkadink / ComfyUI-VideoHelperSuite

Nodes related to video workflows
GNU General Public License v3.0
513 stars 90 forks source link

Why is it necessary to use 'pad' in VideoCombine? #247

Open eastoc opened 1 month ago

eastoc commented 1 month ago

Why is it necessary to use 'pad' in VideoCombine?

eastoc commented 1 month ago

When I remove the pad, the video becomes unusable

AustinMroz commented 1 month ago

There's two types of padding Video Combine applies, audio padding and dimension padding. I'm going to assume you're referring to dimension padding. Video codecs will frequently require that the dimensions of a video are of a certain multiple. For instance, most videos use a pix_fmt like yuv420p that has chroma subsampling. Some formats like AV1, require dimensions reach a greater multiple.

I set 8 as the default since all VAEs I'm aware of have a downscale ratio of 8 or greater. This makes it difficult to obtain output that does not satisfy this ratio under normal operation.. There is support for each video_format to include a dim_alignment property which either raises or lowers this value, but as you've noticed, failing to meet the dim alignment required by a format produces no output.