Adjust FFmpeg scdet Scene Change Threshold

This article explains how to adjust the scene change detection threshold using FFmpeg’s scdet filter. You will learn the specific command-line syntax, how the threshold parameter affects detection sensitivity, and how to apply these settings to customize your video processing workflow.

Understanding the scdet Threshold Parameter

The scdet (scene detection) filter in FFmpeg detects scene changes by comparing the intensity differences between consecutive frames. The primary parameter used to control this sensitivity is threshold (which can also be abbreviated as t).

How the Threshold Value Affects Sensitivity

FFmpeg Command Examples

To adjust the threshold, pass the threshold or t option to the scdet filter.

To set the threshold to 15.0 and print the detected scene change metadata to the console, use the following command:

ffmpeg -i input.mp4 -vf "scdet=threshold=15.0,metadata=print" -f null -

To use the shorthand t and output the results directly to a text file instead of the terminal, use this command:

ffmpeg -i input.mp4 -vf "scdet=t=12.5,metadata=print:file=scenes.txt" -f null -

Tips for Fine-Tuning