Create slideshow from images
// what it does
Builds a video from a numbered image sequence. -framerate 1 tells the image demuxer to treat the input as 1 fps, so each PNG shows for one second; the %04d pattern reads frame_0001.png upward. It encodes to H.264 with libx264, and -pix_fmt yuv420p forces the chroma format that browsers, QuickTime, and most players require for reliable playback.
// shell
$ ffmpeg -framerate 1 -i frame_%04d.png -c:v libx264 -pix_fmt yuv420p output.mp4// gotcha
-framerate is an input option and must come before -i; placed after -i it's ignored and the input defaults to 25 fps. Also, yuv420p/libx264 require even width and height — odd-dimension images fail with "width/height not divisible by 2", so add scale or pad. Numbering must be contiguous (the demuxer stops at the first missing index), and it only auto-detects a start among the first few indices, so a sequence beginning at a higher number needs -start_number.