FFmpeg can save a thumbnail from a video as a JPG or PNG image: one frame at a time you choose, frames at regular intervals, or a frame picked automatically by the thumbnail filter.

Basic: Extracting a Single Frame at a Specific Timestamp

Set the time with -ss and save one frame with -vframes 1:

ffmpeg -i input.mp4 -ss 00:00:01 -vframes 1 thumbnail.jpg
  • -ss 00:00:01 — go to 1 second from the start
  • -vframes 1 — output only 1 frame (the same as -frames:v 1)
  • The file extension sets the image format (JPEG here)

Where you put -ss changes the speed. Before -i, FFmpeg jumps to the nearest keyframe (a frame that can be shown on its own) before that time and decodes from there. This is fast and returns the same frame as -ss after -i. After -i, FFmpeg decodes everything from the start, which is slow on long videos. For long videos, put -ss before -i.

For PNG:

ffmpeg -i input.mp4 -ss 00:00:01 -vframes 1 thumbnail.png

PNG is lossless: higher quality than JPEG, but larger files.

Extracting Multiple Frames at Regular Intervals

-vf fps=1 saves one frame per second as numbered files:

ffmpeg -i input.mp4 -vf fps=1 frame%03d.jpg

%03d in the file name becomes a counter with three digits.

Other intervals:

# One frame every 5 seconds
ffmpeg -i input.mp4 -vf fps=1/5 frame%03d.jpg

# One frame every 10 seconds
ffmpeg -i input.mp4 -vf fps=1/10 frame%03d.jpg

To save into a folder, include it in the name, like frames/frame%03d.jpg. Create the folder first; FFmpeg does not create it.

The thumbnail Filter — Automatic Representative Frame Selection

The thumbnail filter picks a representative frame for you. In each batch of frames, it chooses the one whose histogram (the spread of brightness and colors) is closest to the batch average.

ffmpeg -i input.mp4 -vf thumbnail -vframes 1 thumbnail.jpg

By default a batch is 100 frames. With -vframes 1, FFmpeg stops after the first batch, so the frame comes from the first 100 frames (about 3 seconds at 30 fps). To change the batch size:

ffmpeg -i input.mp4 -vf thumbnail=300 -vframes 1 thumbnail.jpg

A larger value picks from a longer stretch of the video but takes longer.

Extracting Thumbnails with Resolution Specification

Add -vf scale=width:height to resize while extracting:

ffmpeg -i input.mp4 -ss 00:00:05 -vframes 1 -vf scale=320:180 thumb.jpg

To set only the width and keep the aspect ratio, use -1 for the height:

ffmpeg -i input.mp4 -ss 00:00:05 -vframes 1 -vf scale=320:-1 thumb.jpg

-1 means “calculate this to keep the aspect ratio”. JPEG and PNG accept an odd result such as 320×181, so -1 is fine for images. -2, which rounds to an even number, is needed for video such as H.264.

To combine the thumbnail filter with scale, join them with a comma:

ffmpeg -i input.mp4 -vf "thumbnail,scale=320:180" -vframes 1 thumb.jpg

Choosing Between JPEG and PNG

Format Compression File Size Use Case
JPEG Lossy Small Web display, social media thumbnails
PNG Lossless Large High-quality storage, images with transparency

Set the JPEG quality with -q:v (2–31; lower means better quality):

ffmpeg -i input.mp4 -ss 00:00:01 -vframes 1 -q:v 2 thumbnail.jpg

Common Issues

Extracted frame is black
Usually the video really is dark at that moment (a fade-in or a cut to black). Pick a slightly later time.

ffmpeg -i input.mp4 -ss 00:00:05 -vframes 1 thumbnail.jpg

The thumbnail filter is slow
Use a smaller batch than the default 100 frames, such as thumbnail=30.

Summary

Goal Example Command
Single frame from a specific time -ss HH:MM:SS -vframes 1
Multiple frames at regular intervals -vf fps=1/N frame%03d.jpg
Automatic representative frame -vf thumbnail -vframes 1
Extract with resize -vf scale=W:H -vframes 1

Related Articles:

Frequently Asked Questions

How do I get a thumbnail at a specific second?

ffmpeg -ss 00:00:05 -i in.mp4 -vframes 1 -q:v 2 thumb.jpg. With -ss before -i, seeking stays fast even in long files.

Why is my thumbnail black?

Usually the frame at that time really is black (a fade-in or a cut to black). Try a slightly later time. If you seek past the end of the file, you do not get a black image: FFmpeg writes no image at all.

How do I extract every Nth frame?

-vf "select=not(mod(n\,30))" -fps_mode vfr saves every 30th frame as a numbered sequence. This is useful for sprite sheets or seek-bar preview images.

Should I save as JPEG or PNG?

JPEG at quality 2 or 3 for camera footage: smaller files, with no visible quality loss. PNG for screen recordings with sharp edges, or when you need transparency.

Can I generate a thumbnail grid (sprite)?

Yes, with the tile filter: -vf "fps=1/10,scale=160:-1,tile=5x5" makes a 5×5 grid of thumbnails, one every 10 s.