[FFmpeg-user] Cut detection with dynamic threshold possible?

Christoph Gerstbauer christophgerstbauer at gmail.com
Mon Apr 25 17:25:52 CEST 2016


Hello,

I want to make shotdetections (scene cut) with ffmpeg. (a shot is the 
video between 2 cuts)

My syntax knowledge at this time offers to generate only the FIRST FRAME 
of each shot. NO LAST FRAME. It would be nice to find also the last 
frame of a shot, but anyway this ticket should focus on the threshold 
itself.

Actual Syntax to generate shotdetection thumbnails with ffmpeg:

ffmpeg -i <inputvideo> -vf select='gt(scene\,0.7)' -vsync 0 -an 
keyframes%03d.jpg

the value "0.7" is the threshold.
A higher one will lead to less scenes thumbails - low sensitivity
A lower one will lead to much more thumbnails - high senisitivity

I mentioned that shotdetection algorythms generally has problems with to 
dark scenes, so it would be fine to have a threshold which is DYNAMIC to 
find every cut in the video. But my "FFmpeg-Fu" is to weak to find a 
solution on my own.
So, is it possible to use a dynamic threshold within ffmpeg scene 
detection, and  if yes -> how can I do that?

Best Regards
Christoph




More information about the ffmpeg-user mailing list