Skip to main content

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.

By Published Updated

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.jpg

Swap 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.jpg

Extract 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.png

Control 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.jpg

Use 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.

Official FFmpeg references

FAQ

Frequently asked questions

What is the fastest FFmpeg command for one frame?
Use -ss before -i with -frames:v 1 when input seeking is suitable for your source. The command writes one frame, but the exact seek position can depend on the file and its keyframes. Example: ffmpeg -ss 00:01:23 -i input.mp4 -frames:v 1 frame.jpg
How do I extract 1 frame per second with FFmpeg?
Use the fps filter: ffmpeg -i input.mp4 -vf fps=1 frames/out_%04d.jpg. For one frame every 5 seconds use fps=1/5. Create the output folder first.
Should I use JPG or PNG with FFmpeg?
Use PNG when a lossless image format is appropriate for the work. Use JPG when its compression and storage trade-off fits the intended use. Test a sample from your source before choosing a quality setting.