FFmpeg Scene Change Detection: Extracting Frames

Extracting specific frames from a video based on scene transitions is a powerful capability of FFmpeg. This guide explains how to use FFmpeg’s select filter alongside the scene detection parameter to identify major visual changes and export those key moments as individual image files. You will learn the exact command syntax, how the detection threshold works, and how to customize the sensitivity for your videos.

To extract frames at scene changes, you use the select video filter with the scene evaluation variable. Here is the standard command:

ffmpeg -i input.mp4 -vf "select='gt(scene,0.4)'" -fps_mode vfr output_%03d.png

How the Command Works

Adjusting Sensitivity

The decimal value in gt(scene,0.4) controls how sensitive the detection is:

Including Timestamps in the Console

If you want to view the exact timestamps of when the scene changes occurred while extracting the frames, add the showinfo filter to your command:

ffmpeg -i input.mp4 -vf "select='gt(scene,0.4)',showinfo" -fps_mode vfr output_%03d.png

This will output detailed frame metadata, including presentation timestamps (PTS), directly to your terminal.