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 t
I found it hard to parse the ffmpeg output, so I created a wrapper in Python:
pip3 install scenecut_extractor
It will by default extract the scene cuts based on a threshhold, so it'll give you all that are above the parameter:
$ scenecut_extractor /path/to/file.mp4
Will output JSON by default:
[
{
"frame": 114,
"pts": 114.0,
"pts_time": 3.8,
"score": 0.445904
},
{
"frame": 159,
"pts": 159.0,
"pts_time": 5.3,
"score": 0.440126
}
]
You can set -t 0
to extract everything. Check -h
for more options.
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
...