Skip to content

Instantly share code, notes, and snippets.

@dudewheresmycode
Last active March 4, 2024 10:06
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dudewheresmycode/054c8de34762091b43530af248b369e7 to your computer and use it in GitHub Desktop.
Save dudewheresmycode/054c8de34762091b43530af248b369e7 to your computer and use it in GitHub Desktop.
Notes on scene detection with FFMPEG

Basic ffmpeg scene detection:

ffmpeg -i input.flv -filter:v "select='gt(scene,0.4)',showinfo" -f null -

scene (video only) value between 0 and 1 to indicate a new scene; a low value reflects a low probability for the current frame to introduce a new scene, while a higher value means the current frame is more likely to be one (see the example below) https://ffmpeg.org/ffmpeg-filters.html#select_002c-aselect

Set the scene change detection threshold as a percentage of maximum change on the luma plane. Good values are in the [8.0, 14.0] range. Scene change detection is only relevant in case combmatch=sc. The range for scthresh is [0.0, 100.0]. https://ffmpeg.org/ffmpeg-filters.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment