Extracting a frame every second is useful for building a contact sheet, analyzing motion, or feeding frames into a machine learning pipeline. The fps filter resamples the video to a lower frame rate, and -frame_pts true names each output file by the source's timestamp.

The command

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

What it does

FFmpeg decodes the source, applies the fps=1 filter (one frame per second), and writes each frame as a sequentially numbered PNG. The %04d pattern means 4-digit zero-padded numbering: frame_0001.png, frame_0002.png, and so on. The output is one image per second of the source.

When to use it

For generating a contact sheet (review by browsing the images), for motion analysis (compare consecutive frames), and for ML pipelines that ingest video frame by frame. The image sequence is the standard interchange format for video editing tools that work with stills.

Video and audio requirements

Any decodable video. The output frame rate is exactly 1 fps; for a 60-second source, you get 60 images. The source's time base is preserved in the output filenames when you use -frame_pts true; without it, the numbers are sequential.

Things to avoid

  • Using a high frame rate for long videos. fps=1 on a 1-hour video produces 3,600 images. For a quick review, use fps=1/60 (one frame per minute) instead.
  • Forgetting to change the output format. frame_%04d.png produces PNG; for JPEG, use .jpg; for BMP, use .bmp. PNG is lossless and best for archival; JPEG is smaller and fine for previews.
  • Using %04d with more than 9,999 frames. The numbering rolls over; use %05d or %06d for longer sources.
  • Expecting the frames to align with scene changes. fps=1 samples every second, not every scene. For scene-based extraction, use the select filter with a scene-detection expression.