[FFmpeg-user] Scene detection -- numerical output?
ubitux at gmail.com
Thu Nov 8 07:40:51 CET 2012
On Wed, Nov 07, 2012 at 08:04:59PM -0800, David Liontooth wrote:
> The scene detection feature is a great addition:
> ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
> Set a threshold value between 0 and 1 for detecting a new scene.
> Increase the value to lower the number of detected scenes; sane
> values are typically between 0.3 and 0.5.
> Is it possible to get a numerical output (say, frame numbers)
> instead of the montage?
ffmpeg -i input.avi -vf 'select=gt(scene\,.4),showinfo' -f null -
ffprobe -show_frames -of compact=p=0 -f lavfi 'movie=video.avi,select=gt(scene\,.4)'
You'll get various information about the frames, such as timestamps.
If you absolutely need the frame number you can try to:
- take the first example and add another showinfo at the beginning of the
filtergraph; check if for a given frames it reaches the second showinfo
(if so you can use the "n" value from the first showinfo)
- take the second example, and replace the select with select=scene+1 (to
call the scene detection but make sure all the frames are transmitted)
and then look yourself at the last lavfi.scene_score meta information
in what is printed to see if the score is a good enough one
I'm sure you can find various other simpler combinations.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 490 bytes
Desc: not available
More information about the ffmpeg-user