PRACTICAL GUIDE · 2026-10-24
FFmpeg extract frames
The short answer
To extract every decoded frame with FFmpeg, create an empty frames folder and run:
ffmpeg -n -i input.mp4 -fps_mode passthrough frames/frame-%03d.pngFor one image per second, use -vf fps=1 instead of -fps_mode passthrough. The commands below were tested with FFmpeg on a locally generated sample.
Copy the command for your task
Install FFmpeg from a source linked by the official download page, and check ffmpeg -version. Replace input.mp4 with your file. Create each output folder first. These examples are direct terminal commands; a Windows batch file requires doubling each percent sign in the filename pattern.
Every decoded frame
ffmpeg -n -i input.mp4 -fps_mode passthrough frames/frame-%03d.pngThis tested command produced six PNG files from the six-frame sample. The numbering pattern makes separate files; -n prevents overwriting an existing output.
One image per second
ffmpeg -n -i input.mp4 -vf fps=1 seconds/frame-%03d.pngCreate seconds first. This run produced three PNG files from the same source.
One image at a chosen time
ffmpeg -n -i input.mp4 -ss 1 -frames:v 1 single/frame-%03d.pngCreate single first. This run saved one image after seeking to one second. The numbered filename is retained so the command matches the tested sequence-output form.
Our reproducible test
Tested on Windows with FFmpeg 6.1.1. The source was a three-second, 160 × 90 H.264 clip generated locally from this synthetic pattern:
ffmpeg -n -f lavfi -i "testsrc2=size=160x90:rate=2:duration=3" -c:v libx264 -pix_fmt yuv420p sample.mp4
| Command mode | PNG files saved | Total image bytes | Dimensions |
|---|---|---|---|
| Every decoded frame | 6 | 64,687 | 160 × 90 |
| fps=1 | 3 | 30,158 | 160 × 90 |
| Seek to one second; one frame | 1 | 11,074 | 160 × 90 |
We compared the saved PNG file hashes across these runs. The three fps-filter images matched the first, third and fifth images from the full sequence; the single image matched its third image. This ties the reported counts to actual saved content for this sample. Counting files alone would not have established which source images the shorter outputs contained.
That agreement is specific to our regular two-frame-per-second test clip and these settings. It does not prove that a one-per-second filter always selects the same timestamps as a browser interval export. Timestamp rounding and source timing can matter. When matching two workflows, compare the selected pictures or presentation times, rather than assuming that equal output counts establish identical sampling.
The byte totals are sums of the saved PNG files, not input-video sizes or ZIP sizes. For the full sequence we added the six file lengths; for the sampled sequence we added its three file lengths. Changing the selected pictures changed the total. These measurements are useful for reproducing this run, but they cannot predict the storage needed for your own video.
Read the result before running a large export
A numbered filename records output order, not an elapsed time. In our test the third file of the full sequence corresponded to the image at one second, while the first file of the single-image export contained that same picture. Treating both file numbers as timestamps would give conflicting answers. Keep the command and source timing with the images when time alignment matters.
Use separate empty folders when comparing settings. If an old output remains in a folder, counting its files can overstate what the latest run produced. Our commands used fresh folders and stopped on errors before recording the counts. The no-overwrite option makes an accidental filename collision visible instead of silently replacing an earlier result.
Choose the smallest representative test that answers your question before processing a large clip. Confirm the saved dimensions, count and selected moments, then reuse the intended command. Our complete six-frame run verifies these examples on one FFmpeg build; it does not measure speed, memory consumption, HDR fidelity or compatibility with every input codec.
Sources and browser alternative
The FFmpeg image sequence documentation describes numbered output patterns. The installed build’s filter help documents fps; its command-line help documents the options used here. Our counts, byte totals and hash matches come from the local runs, not documentation examples.
For a visual workflow, see Extract images from video and open the browser tool. For output format decisions, see PNG vs JPG.