Extract Frames from Video as Images Using FFmpeg

This article provides a quick overview and step-by-step guide on how to extract specific frames from a video file using FFmpeg on Linux. You will learn the exact commands to capture a single frame at a precise timestamp, extract frames sequentially at a specific interval, and export a high-quality batch of images from your video files. FFmpeg handles these tasks efficiently through the command line without the need for heavy video editing software.


Extracting a Single Frame at a Specific Timestamp

To pull a single, precise frame from a video, you use the seek (-ss) flag. Placing -ss before the input file ensures fast seeking, which allows FFmpeg to jump directly to the timestamp without reading the entire video from the beginning.

ffmpeg -ss 00:01:30 -i input.mp4 -vframes 1 output.jpg

Extracting Frames Sequentially at Intervals

If you need to sample a video by saving a frame at regular intervals—such as one frame every second or one frame every minute—you can utilize the frame rate video filter (-vf fps=).

ffmpeg -i input.mp4 -vf "fps=1" thumb_%04d.png

Extracting All Frames from a Specific Video Segment

When you need to dump every single frame from a specific scene for high-precision work, combine the seek time, duration, and sequential naming conventions.

ffmpeg -ss 00:02:15 -i input.mp4 -t 5 frames_%03d.png

Managing Output Quality

By default, FFmpeg applies standard compression to JPEG outputs. If image quality is a priority, you can control the compression level using the -q:v (or -qscale:v) option.

ffmpeg -ss 00:05:00 -i input.mp4 -vframes 1 -q:v 2 high_quality.jpg