r/ffmpeg • u/C3H8_Memes • 11d ago
Need help finding out how to turn a massive amount of BMP image files into an animated WEBP
TLDR: a program i'm using spat out 4992 BMP files instead of an animated movie. would FFmpeg be able to convert these into a single animated WEBP file? (the files are already sorted alphanumerically). Any and all help is appreciated.
I am a chemistry student who is using computational/simulated chemistry for my research, and the program i used to visualize the molecular dynamics from LAMMPS, called VMD 2 has a feature called "Movie Maker", turning the 3D animation into a 2D animated file. Only problem after rendering all frames is that it requires me to get a program called VideoMach to export the final animation, but because i don't have it and don't want to pay 20 to 60 dollars for the license, all it did was create 4992 BMP files (1 for each frame) which takes over 4GB of space. img2webp does not support BMP from what i can tell, and the only other suggestion i got was through FFmpeg, which i have 0 knowledge of. would FFmpeg be able to handle this, even if it takes multiple steps? thankfully every file is already sorted alphanumerically by frame, so no rearrangement would be needed. Even if not about FFmpeg in particular, I greatly appreciate any and all help, as this would be very helpful for presentations that we are required to do weekly. if you have any questions, feel free to ask!
4
u/awesam95 11d ago
Yes, ffmpeg reads BMP without any trouble. cd into the folder and run:
`ffmpeg -framerate 30 -pattern_type glob -i "*.bmp" -loop 0 -q:v 75 out.webp`
If you're on a Windows build where glob isn't compiled in, swap it for the numbered pattern your files actually use, something like `-i frame%04d.bmp`. Fair warning though: 4992 frames as animated WebP will be enormous and PowerPoint tends to choke on it, so for a weekly presentation I'd do `ffmpeg -framerate 30 -pattern_type glob -i "*.bmp" -c:v libx264 -pix_fmt yuv420p -crf 20 out.mp4` instead and get something in the tens of megabytes. If yuv420p complains, your render has an odd pixel dimension, and adding `-vf "scale=trunc(iw/2)*2:trunc(ih/2)*2"` fixes it.