Make a video from numbered photos with ffmpeg
Combine a sequence of numbered images into an MP4 slideshow or timelapse using the built-in image2 demuxer.
Run: ffmpeg -framerate 24 -i frame%04d.png -c:v libx264 -pix_fmt yuv420p output.mp4
01Command
Command
$ ffmpeg -framerate 24 -i frame%04d.png -c:v libx264 -pix_fmt yuv420p output.mp402What it does
Name your photos in a numbered sequence such as frame0001.png, frame0002.png; the %04d pattern matches four-digit numbering. -framerate 24 packs 24 images per second — raise it for a faster timelapse, lower it for a calmer slideshow. -pix_fmt yuv420p keeps the MP4 playable in most players and phones.
03Risk
!Warning: The numbering must start at 0001 and be gap-free, or ffmpeg will stop at the first missing image.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- FFmpeg DocumentationEvidence: Documents -framerate (input frames per second for the image demuxer), -i with image sequence patterns (frame%04d.png), and libx264 encoding via -c:v.
- FFmpeg Formats DocumentationEvidence: Documents the image2 image file demuxer/muxer used for numbered image sequences, including its framerate option and %d-style filename patterns.
Last verified: 2026-09-19 · Category: Media