FFmpeg can save frames from a video as PNG or JPG images, for a thumbnail, a contact sheet or editing. You can save one frame at a chosen time, frames at a steady rate such as one per second, or every frame.
Save the images to an empty folder: numbered images overwrite existing files with the same names without asking. A 10-minute 30 fps clip has about 18,000 frames, so try a short part first to see how much space the images take.
1. Capture a Single Frame
Most often you want a single still. This command saves one frame from the start of the video (the frame just before 0.5 seconds) and stops:
ffmpeg -i input.mp4 -vf fps=1 -frames:v 1 output.png
-vf fps=1… sample the stream at one frame per second-frames:v 1… write only the first matching frameoutput.png… a single PNG image
To get the frame at a specific time, put -ss before -i. This saves the frame at 5 seconds:
ffmpeg -ss 00:00:05 -i input.mp4 -frames:v 1 output.png
| Option | Meaning |
|---|---|
-ss 00:00:05 |
Start reading at 5 seconds |
-frames:v 1 |
Output exactly one frame |
With
-ssbefore-i, FFmpeg jumps to the nearest keyframe (a frame that can be decoded on its own) before that time, then decodes and discards frames up to the requested time. This accurate seeking is on by default whenever FFmpeg re-encodes, as it does here. If the time falls between two frames, you get a real frame near it; FFmpeg does not make up an image. More detail: Seeking wiki.
2. Extract One Frame per Second
To save stills at a steady rate, use the fps filter and a numbered file name:
ffmpeg -i input.mp4 -vf fps=1 output_%04d.png
This produces output_0001.png, output_0002.png, … one image for each second of the video.
-vf fps=1… one frame per second (usefps=1/5for one every 5 seconds,fps=2for two per second)output_%04d.png…%04dbecomes a counter padded with zeros
Type
output_%04d.pngas it is in PowerShell or a terminal; FFmpeg replaces the pattern with numbers. In a Windows.bator.cmdfile, double the percent sign:output_%%04d.png. The number in a file name only counts the images. It does not tell you the time in the video.
3. Export Every Frame
To save every frame, leave out the fps filter and add -fps_mode passthrough. This stops FFmpeg from adding or dropping frames to keep a constant frame rate:
ffmpeg -i input.mp4 -fps_mode passthrough output_%04d.png
You get one PNG per frame. Without -fps_mode passthrough, FFmpeg can duplicate or drop frames on some inputs, so leaving out the filter is not enough. Image files do not store frame times. If the video has a variable frame rate (VFR) and you plan to rebuild it from the images, save the timestamps separately.
| Goal | Filter | Result |
|---|---|---|
| Every decoded frame | No rate filter; -fps_mode passthrough |
No duplicated or dropped frames |
| One per second | -vf fps=1 |
1 image/sec |
| One every 5 seconds | -vf fps=1/5 |
1 image/5 sec |
| Two per second | -vf fps=2 |
2 images/sec |
4. PNG vs JPG and Quality
Count Check on a Synthetic VFR Clip
On a 3-second test clip with a variable frame rate and 50 frames, the passthrough command from section 3 wrote 50 PNG files, one per frame (FFmpeg 8.1 on Windows). Writing two frames to the single name single.png, with no number pattern and no -update 1, stopped with an error after the first image. Test conditions and output hashes: frame-timing-checks.json.
Choose the Image Format
PNG stores the decoded image without further loss. It is still not an exact copy of the video data: decoding, the conversion from the video’s YUV colors to RGB, scaling and HDR handling can all change pixel values first. JPG is lossy and gives smaller files, which suits previews. To save one frame as JPG and set its quality:
ffmpeg -ss 00:00:05 -i input.mp4 -frames:v 1 -q:v 2 output.jpg
-q:v 2… JPG quality (2 is high; the scale runs 2–31, lower is better)
| Format | Size | Quality | Best for |
|---|---|---|---|
| PNG | Large | Lossless | Editing, archival, transparency |
| JPG | Small | Lossy | Previews, contact sheets, web |
To let FFmpeg pick a representative frame for a thumbnail, see the thumbnail guide.
5. Resize Frames While Extracting
Add scale to save smaller images directly. This saves the frame at 5 seconds, 640px wide, with the height scaled to match:
ffmpeg -ss 00:00:05 -i input.mp4 -vf scale=640:-1 -frames:v 1 output.png
scale=640:-1… set width to 640,-1lets FFmpeg compute the height to keep aspect ratio
You can chain filters with a comma: -vf "scale=640:-1,fps=1" resizes and samples in one pass.
6. Troubleshooting
Issue 1: Only one image is written when I wanted many
Cause: The command includes -frames:v 1, or the file name has no number pattern. Without a pattern, FFmpeg stops with an error when it tries to write the second image. (Writing every frame over one file on purpose needs -update 1.)
Fix: Put %04d (or similar) in the output name (section 2).
Issue 2: The extracted frame is slightly off the moment I wanted
Cause: The time you chose may fall between two frames, or your player counts time differently from the timestamps in the file. A variable frame rate or damaged timestamps can also cause this.
Fix: Try times slightly before and after, and look at the output. To compare, put -ss after -i. FFmpeg then decodes from the start and discards everything before that time, instead of jumping:
ffmpeg -i input.mp4 -ss 00:00:05 -frames:v 1 output.png
Issue 3: PNG files are huge
Cause: PNG is lossless, so high-resolution or noisy images stay large.
Fix: Try JPG with -q:v, or a smaller resolution, on a short part of the video first.
FAQ
Q1. What’s the difference between extracting frames and making a thumbnail? A. Extracting frames saves plain stills at the rate you choose. The thumbnail guide is about one representative image: letting FFmpeg pick the frame, and setting its size.
Q2. How do I get one frame every N seconds?
A. Use -vf fps=1/N. For example fps=1/10 gives one frame every 10 seconds.
Q3. Can I extract frames as JPG instead of PNG?
A. Yes. Use a .jpg output name and -q:v 2 for high quality (section 4).
Q4. Why does my image sequence overwrite itself?
A. Check whether the command has -update 1, which writes every frame to the same image, and whether you reused an output folder. For a sequence, type %04d as it is (or %%04d in a Windows batch file) and use an empty folder.
Q5. Does extracting frames affect the original video? A. No. These commands only read the video and write separate image files. Check the output folder and file names first, so that no important file gets overwritten. If you only need one picture, the browser thumbnail tool saves only the frames you pick instead of thousands of images.