Guide · CLI · 2026
How to Extract Frames from Video with FFmpeg (Complete Guide)
Use FFmpeg to save one still, sample a video at intervals, or write every decoded frame. The commands below were tested on a generated video fixture and are ready to adapt to a file you are allowed to process.
Verified on 13 July 2026 with FFmpeg 7.1.1 on macOS.
Extract a single frame at a timestamp
Use this command to write one image near a timestamp. With -ss before -i, FFmpeg performs input seeking before decoding; the exact seek position can depend on the source and its keyframes.
ffmpeg -ss 00:01:23.000 -i input.mp4 -frames:v 1 frame.jpgSwap the timestamp as needed. For PNG, change the output name to frame.png.
Extract one frame every N seconds
Use the fps filter to sample the decoded video. fps=1 requests one output frame per second; fps=1/5 requests one every five seconds. Make the output folder first and inspect the resulting sequence.
mkdir -p frames
ffmpeg -i input.mp4 -vf fps=1 frames/out_%04d.jpg
# one frame every 5 seconds
ffmpeg -i input.mp4 -vf fps=1/5 frames/out_%04d.jpgExtract all frames
Omitting a frame-selection filter writes each decoded frame to the image sequence. This can create many files, so test a short copy first and make sure the destination has enough storage.
mkdir -p all_frames
ffmpeg -i input.mp4 all_frames/frame_%06d.pngControl JPG quality with -q:v
For JPG output, -q:v 2 is an explicit quality setting for FFmpeg’s MJPEG encoder. Compare a sample from your source before choosing a value; encoder behavior and visual results vary by build and input.
ffmpeg -ss 00:00:10 -i input.mp4 -frames:v 1 -q:v 2 still.jpgUse PNG when a lossless image format fits the work. Use JPG when its compression is appropriate for your intended use and available storage.
Before you run a batch
These examples assume FFmpeg can decode your input and your shell can write to the destination folder. They do not grant rights to copy, publish, or reuse footage. Process only media you own or are authorized to use, and check the image sequence before relying on it in a workflow.