Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
741 views
in Technique[技术] by (71.8m points)

video - FFMPEG: Get the Scene Change Detection value for all frame

I'm trying to measure how much a movies is "fast" (more action in the screen and quick scene chances). I don't want just a single value for the movie, but values along the movie to see how the action varies during it. After normalize the frame rate of the movies (10 fps), my idea is to compare each frame with the previous. I'm not only interest if the scene has changed, but also, if there was no cut, how much movement there is. Not only people/object movement but also, camera movement. In summary the paced (I think that the term) of the scenes.

My idea was to use the scene function from ffmpeg as a metric. But looking at the document and examples online I'm thinking I can only use the value of the Scene Change Detection as a threshold to return frames informations, but I can't get ffmpeg to return the value. Is that right? There is any way I can make it return the value?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Use

ffmpeg -i in.mp4 -vf "select='gte(scene,0)',metadata=print:file=scenescores.txt" -an -f null -

The text file created will have output like this:

...
frame:1440 pts:737280  pts_time:48     
lavfi.scene_score=0.003069
frame:1441 pts:737792  pts_time:48.0333
lavfi.scene_score=0.001593
frame:1442 pts:738304  pts_time:48.0667
lavfi.scene_score=0.000077
frame:1443 pts:738816  pts_time:48.1   
lavfi.scene_score=0.002219
...

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...