Breakthrough / PySceneDetect

:movie_camera: Python and OpenCV-based scene cut/transition detection program & library.
https://www.scenedetect.com/
BSD 3-Clause "New" or "Revised" License
3.12k stars 386 forks source link

Only perform detection within a region-of-interest #147

Closed laphlaw closed 3 months ago

laphlaw commented 4 years ago

My use case is to skip dead time in a sporting event, e.g. a basketball game. To do this, I thought I'd just analyze the section of the video frame that contains the scoreboard, identify the timestamps of 'dead time', and skip over those.

Is this possible with either the command line tool or the library?

Breakthrough commented 4 years ago

Hi @laphlaw;

Currently this is not implemented, but is definitely possible. Eventually I'd like to add motion detection capability to PySceneDetect, combining it with the other tool DVR-Scan (which performs what you mention, only returns frames that have some sort of motion). As such, #43 would be a required feature to be implemented before addressing this.

At that point I would need to figure out how to have a kind of filter/detector pipeline, but that should be possible. Will mark this as an enhancement for now and add it to the backlog, thanks for your suggestion.

Breakthrough commented 4 years ago

Note that DVR-Scan ( https://dvr-scan.readthedocs.io/en/latest/ ) supports this using the -roi argument.

Tetsujinfr commented 2 years ago

@laphlaw if I understand your use case you want to cut the input video and remove the game off times. Is that not kind of the opposite of what this repo is trying to achieve, which is detecting cuts already in the video, not generating them from the video ?

Breakthrough commented 1 year ago

After re-reading @Tetsujinfr's comment I think as worded the original post is requesting something entirely differently. I had intended this to support detection on a smaller subset of the input video, cropping out a particular region. As a workaround though the video can be pre-cropped.

Breakthrough commented 3 months ago

I think this is too ambiguous so will close this as a duplicate of #286. Feel free to file a new feature request if you would like, thanks!