Convert an Image Sequence into a Video with ffmpeg

Merge numbered PNG/JPG frames into a smooth MP4 — perfect for timelapses, animation frames, and scans.

WindowsvideomediaffmpegLow risk
Run `ffmpeg -framerate 24 -i img%04d.png -c:v libx264 -pix_fmt yuv420p slideshow.mp4` where img%04d matches img0001.png, img0002.png.

01Command

Command
$ ffmpeg -framerate 24 -i img%04d.png -c:v libx264 -pix_fmt yuv420p slideshow.mp4

02What it does

The -framerate option sets how many images play per second (24 here; use 1/5 for one image every 5 seconds in a slideshow). %04d is the number pattern — four digits with leading zeros — and ffmpeg's image2 demuxer reads files matching it. The yuv420p pixel format keeps the MP4 playable in phones, browsers, and social apps.

03Risk

RiskLow risk
Requirementsffmpeg installed (winget install Gyan.FFmpeg); images must follow a numbered pattern like img0001.png.
!Warning: File names must be consistently numbered; rename them first if the pattern doesn't match.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • FFmpeg Documentation
    FFmpeg · vendor-doc · 2026-09-17
    Evidence: Main ffmpeg documentation includes the -framerate input option and stream specifier syntax used in the conversion command.
  • FFmpeg Formats Documentation (image2 demuxer)
    FFmpeg · vendor-doc · 2026-09-17
    Evidence: Documents the image2 demuxer options -framerate and pattern_type used to read numbered image sequences.

Last verified: 2026-09-19 · Category: Media

06Related solutions