To pull a single frame out of a video as a thumbnail, seek to a timestamp and tell ffmpeg to write one frame:
ffmpeg -ss 00:00:05 -i in.mp4 -frames:v 1 thumb.jpgThat grabs the frame at the five-second mark and writes it to thumb.jpg. The whole trick is the placement of -ss: putting it before -i makes ffmpeg seek the input by keyframe before it starts decoding, which is near-instant even on a two-hour file. -frames:v 1 then stops after the first decoded frame. The rest of this page is the variations: letting ffmpeg pick a representative frame for you, sampling one frame every N seconds, tiling those samples into a single contact sheet image, controlling JPEG quality, and scaling the output.
Grab a frame at a specific timestamp
The command above is the one you want most of the time. A few notes on the parts:
# Five seconds in, written as a JPEG
ffmpeg -ss 00:00:05 -i in.mp4 -frames:v 1 thumb.jpg
# Same idea, written as PNG (lossless, larger file)
ffmpeg -ss 00:00:05 -i in.mp4 -frames:v 1 thumb.png
# Seconds work too: 90 = 1:30
ffmpeg -ss 90 -i in.mp4 -frames:v 1 thumb.jpg-ss before -i is a fast input seek: ffmpeg jumps to the nearest keyframe at or before the timestamp, so it is quick but lands on a keyframe rather than the exact requested moment. For a thumbnail that almost never matters. When you need the frame at that exact time (frame-accurate), use two -ss flags: an input seek before -i to jump quickly to a keyframe a little before the target, then an output seek after -i to decode forward the remaining distance to the exact timestamp:
# Input-seek to ~4s (fast, keyframe), then decode forward 1s to land on exactly 5s
ffmpeg -ss 00:00:04 -i in.mp4 -ss 00:00:01 -frames:v 1 thumb.jpgThe two add up to the target time (4s + 1s = 5s), so you get the speed of input seeking plus the frame accuracy of an output seek. Accurate seeking is on by default; pass -noaccurate_seek to turn it off. For a single still this is overkill, but it is the pattern to reach for when the precise frame matters.
Let ffmpeg pick a representative frame
If you do not have a timestamp in mind and just want a frame that looks like the video (not a black fade-in or a transition), use the thumbnail filter. It analyses a batch of frames and picks the one most representative of the set:
ffmpeg -i in.mp4 -vf "thumbnail" -frames:v 1 thumb.jpgBy default it considers 100 frames at a time and scores them against the batch average, so it tends to skip the near-black opening frames that a naive first-frame grab lands on. It is the right default for auto-generating a poster image when you cannot hand-pick the moment. You can widen the analysis window by passing a frame count, for example thumbnail=300, at the cost of a little more decoding.
Sample one frame every N seconds
For a series of stills (a storyboard, a set of preview images, the input for a contact sheet) use the fps filter with a fractional rate. fps=1/10 means one frame every ten seconds:
# One frame every 10 seconds, numbered shot-001.jpg, shot-002.jpg, ...
ffmpeg -i in.mp4 -vf "fps=1/10" shot-%03d.jpgThe %03d in the output name is a printf-style counter that ffmpeg fills in, zero-padded to three digits. Change the fraction to change the cadence: fps=1 is one frame per second, fps=1/60 is one per minute. Note that here -ss does not help much, because you are walking the whole file by design, so leave it off and let the filter sample across the entire duration.
If you want a fixed number of evenly spaced frames regardless of length, compute the rate from the duration, or reach for the thumbnail filter per segment. For a single tiled preview image, the tile filter pairs with fps to lay the samples out in a grid in one pass, which is the next section.
Make a contact sheet
To turn a whole video into one image full of thumbnails (a contact sheet, storyboard, or preview grid), sample frames at an interval, scale them down, and let the tile filter arrange them:
ffmpeg -i in.mp4 -vf "fps=1/10,scale=320:-1,tile=4x3" -frames:v 1 sheet.pngThat takes one frame every 10 seconds, scales each to 320px wide, and packs the first 12 into a grid 4 columns across and 3 rows down. -frames:v 1 writes the single assembled sheet rather than 12 separate files. No ImageMagick, no temp directory. I reach for this when I need to find roughly where a scene is, or hand someone a one-image summary of a long recording.
The chain runs left to right, so order matters: sample first, scale the smaller set, then tile. tile=4x3 is shorthand for tile=layout=4x3. Size the grid to the samples you expect: a 10-minute video at fps=1/10 gives 60 frames, so a 4x3 sheet shows only the first 12. Either widen the grid (tile=10x6 for 60 cells) or sample less often, because columns times rows must be at least the duration divided by the interval to fit everything on one sheet. ffprobe -v error -show_entries format=duration -of csv=p=0 in.mp4 prints the duration in seconds for that math.
Sample keyframes instead of fixed intervals
Fixed-interval sampling can land on a fade, a black frame, or a blurry pan. To tile the encoder's keyframes (I-frames) instead:
ffmpeg -i in.mp4 -vf "select='eq(pict_type,I)',scale=320:-1,tile=4x3" -vsync vfr -frames:v 1 sheet.pngselect='eq(pict_type,I)' passes only intra-coded frames. -vsync vfr matters: without it ffmpeg duplicates the selected frames back to a constant rate and the sheet fills with repeats. -vsync is deprecated in current ffmpeg (it still works but prints a warning); the modern spelling -fps_mode vfr behaves identically. Encoders place I-frames on a regular GOP cadence (commonly every ~250 frames, roughly 10 seconds at 24fps) plus extra ones on hard cuts unless scene detection is off, so a keyframe sheet is a decent map of the distinct shots, while fps sampling is the cleaner map of time.
Padding, margin, and multiple sheets
By default the tiles touch. padding sets the gap between cells, margin the border around the sheet (both 0 to 1024 pixels), and color the fill for gaps and any unused cells in a short last row (a color name or hex like 0x202020):
ffmpeg -i in.mp4 -vf "fps=1/10,scale=320:-1,tile=4x3:padding=4:margin=8:color=white" -frames:v 1 sheet.pngFor a long video, drop -frames:v 1 and tile emits a new image each time the grid fills, numbered by the %03d counter:
ffmpeg -i in.mp4 -vf "fps=1/10,scale=320:-1,tile=4x3" sheet_%03d.pngThe first 12 frames become sheet_001.png, the next 12 sheet_002.png, and so on, which keeps the thumbnails a useful size on a feature-length file. A JPEG sheet (sheet.jpg with -q:v 2, covered next) is much smaller than PNG for photographic frames and fine for a preview. To sheet only part of a file, trim the clip first.
Control JPEG quality with -q:v
JPEG thumbnails default to a middling quality that can look soft. The -q:v flag (also spelled -qscale:v) sets the quality on a scale where lower is better: 1 is the best, 31 is the worst. For a crisp thumbnail, 2 is the standard choice:
ffmpeg -ss 00:00:05 -i in.mp4 -frames:v 1 -q:v 2 thumb.jpg-q:v 2 is the sweet spot for stills: visually near-lossless, still a reasonable file size. Drop to -q:v 1 if you want the absolute best and do not care about bytes. This flag only applies to lossy formats like JPEG; for PNG output it does nothing (PNG is already lossless), so save it for .jpg.
Scale the thumbnail
Resize while you extract by adding the scale filter. Use -1 for one dimension to preserve the aspect ratio:
# 320px wide, height auto to keep the aspect ratio
ffmpeg -ss 00:00:05 -i in.mp4 -frames:v 1 -vf "scale=320:-1" -q:v 2 thumb.jpgCombine it with the thumbnail filter by chaining them in one -vf chain (comma-separated, applied left to right):
ffmpeg -i in.mp4 -vf "thumbnail,scale=320:-1" -frames:v 1 -q:v 2 thumb.jpgIf a dimension comes out odd and your encoder complains, use -2 instead of -1 to round to the nearest even number, which some codecs require.
-frames:v versus -vframes
You will see both spellings in older guides. They do the same job for video, but -frames:v is the current form and -vframes is an obsolete alias:
# Current, preferred
ffmpeg -ss 00:00:05 -i in.mp4 -frames:v 1 thumb.jpg
# Old alias, still works but deprecated
ffmpeg -ss 00:00:05 -i in.mp4 -vframes 1 thumb.jpgPer the official documentation, -vframes is a deprecated alias and the stream-specifier form -frames:v is the one to use in new commands. Both stop writing after the given number of frames; reach for -frames:v so your commands age well.
FAQ
Placing -ss before -i is an input seek: ffmpeg jumps to the nearest keyframe before it starts decoding, so it is fast even on long files. Placing it after -i decodes every frame up to the timestamp, which is frame-accurate but slow. For a thumbnail, before--i is almost always what you want.
Seek to zero (or omit the seek): ffmpeg -i in.mp4 -frames:v 1 thumb.jpg. Be aware that the first frame is often a fade-in or near-black; if you want a frame that represents the video, use the thumbnail filter instead.
It sets JPEG quality, where lower is better. The scale runs 1 (best) to 31 (worst), so -q:v 2 is near-lossless with a sensible file size. It has no effect on PNG output, which is already lossless.
Use the fps filter with a fraction: ffmpeg -i in.mp4 -vf "fps=1/10" shot-%03d.jpg writes one frame every ten seconds, numbered by the %03d counter. Change the fraction to change the cadence.
Functionally yes for video, but -vframes is an obsolete alias. The official docs recommend the stream-specifier form -frames:v, so prefer that in new commands.
Make sure the grid has at least as many cells as you have samples. Frames sampled equals duration in seconds divided by your interval, so a 600-second video at fps=1/10 gives 60 frames and needs a grid of at least 60 cells, such as tile=10x6. Either widen the grid or sample less often (a larger interval like fps=1/30).
That happens with keyframe selection when ffmpeg pads the selected frames back to a constant rate. Add -vsync vfr (or -fps_mode vfr on recent ffmpeg, where -vsync is deprecated) so only the genuinely selected frames reach the tile step. With fixed-interval fps sampling you usually do not hit this.
See also
- The ffmpeg command cheat sheet: every common operation (convert, crop, trim, compress) in one reference.
- Trim and cut a video with ffmpeg: the same fast
-ssseek, applied to clipping a segment without re-encoding. - Convert a video to a high-quality GIF with ffmpeg: the two-pass palette approach for a clean GIF instead of a single still.
Sources
Authoritative references this article was fact-checked against.
- ffmpeg documentation (official)ffmpeg.org
- ffmpeg filters documentation (official)ffmpeg.org
- ffmpeg tile filter (official filters documentation)ffmpeg.org
- ffmpeg select filter (official filters documentation)ffmpeg.org
- ffmpeg -vsync / -fps_mode options (official ffmpeg documentation)ffmpeg.org
- ffmpeg color syntax (ffmpeg-utils manual)ffmpeg.org





