[FFmpeg-user] Programmatically detecting 'busiest' parts of a video

Oliver Fromme oliver at fromme.com
Wed Aug 7 12:56:33 EEST 2024


Rob Hallam wrote:
 > I'd like to programmatically detect the 'busiest' parts of a video- ie
 > the most visually active areas. I am leaving audio aside for the
 > purposes of considering this.
 > 
 > I figured it might be possible by looking at one / more of:
 > [...]
 >  - frame differences -- count pixels/blocks which differ, average over
 > a time segment

I think you should be able ot use the "scdet" filter (scdet = scene
change detection) for that.  If you set a low threshold, every frame
is regarded as a scene change when there is sufficient "activity".

The filter produces log messages that include a "score" (0 - 100) for
each frame.  I guess that score is what you're looking for.

Documentation:
https://ffmpeg.org//ffmpeg-filters.html#scdet-1

Best regards
 -- Oliver


More information about the ffmpeg-user mailing list