FFMPEG: Get the Scene Change Detection value for all frame

前端 未结 2 1518
-上瘾入骨i
-上瘾入骨i 2020-12-17 05:02

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

2条回答
  •  盖世英雄少女心
    2020-12-17 05:49

    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.

提交回复
热议问题