Extract a single video frame as a JPEG image
Grabbing a single frame from a video is useful for thumbnails, previews, or extracting a still for editing. The -ss flag seeks to the timestamp; -frames:v 1 tells FFmpeg to output one video frame and stop.
The command
ffmpeg -ss 00:00:05 -i input.mp4 -vframes 1 frame.jpgWhat it does
FFmpeg seeks to 5 seconds in the input, decodes the frame there, and writes a single JPEG. The output is a still image at the source's resolution. The encode is fast — the entire operation takes a fraction of a second.
When to use it
For generating thumbnails, previews, or stills for documentation. The command makes no assumption about the source other than that it can be opened; the timestamp can be any value within the source's duration.
Video and audio requirements
Any decodable video. The timestamp can be in seconds (00:00:05) or in HH:MM:SS.MS format for sub-second precision (00:00:05.500). The -vframes 1 flag is the key: it tells FFmpeg to output exactly one video frame and stop.
Things to avoid
- Using
-ssafter-i. That positions the seek for decode, which is slow. The command above uses input-option seeking, which is fast (the demuxer jumps to the timestamp). - Expecting a frame exactly at the requested timestamp. The closest keyframe is decoded; if you need frame-accurate extraction, use
-ssafter-iand accept the slower seek. - Forgetting that the output format determines the codec. The
.jpgextension makes FFmpeg use the JPEG encoder. For PNG, use.png; for WebP, use.webp. - Using this for high-quality stills. JPEG is lossy and the default quality is medium. For archival, use PNG or specify
-q:v 1for the highest JPEG quality (still lossy but visually lossless).