Convert animated WEBP to MP4
Animated WebP, similar to animated GIF, is not the best video format to work with, but this is what the usual SVD (image or text to video) and ComfyUI will generate.
Unfortunately, FFMPEG does not support WebP to MP4 conversion yet, so this simple frame-by-frame conversation had to be done. As it's generating a PNG for each frame, it's rather slow, so it's only suitable for short animations.
The below simple python code converts the animated WebP into MP4, using the predefined FPS.
Don't forget to
pip3 install pillow moviepy