PySceneDetect icon indicating copy to clipboard operation
PySceneDetect copied to clipboard

Detect a scenes by a text in the corner

Open mrahmadt opened this issue 4 years ago • 3 comments

First of all, apologize if this is not the place to ask questions, please let me know if you have another place, and will post it over there.

I have thousands of small videos (3-5 minutes) with multiple scenes in each video, each scene has a text written in the left/right corn of the video.

is there a way to use the text change to detect the start/end of each scene? I'm sure this will be way easier than the detect content filter and will provide a way better results for my videos.

Thanks

mrahmadt avatar Aug 27 '21 16:08 mrahmadt

See #147 for some discussion on this issue. At the moment, this is on the roadmap for a future release. Per that issue, you could investigate using DVR-Scan for this purpose.

wjs018 avatar Aug 29 '21 05:08 wjs018

As @wjs018 said, you might want to look into using DVR-Scan with the -roi argument to specify a small region around the text. Doing this robustly in a general sense can be difficult, however, since it depends quite a bit on how the background is changing, as well as if the text colour changes.

If the backgrounds remain relatively static within a scene, DVR-Scan should be able to handle this fairly robustly out of the box for your use case. If not though, a better approach might be to use optical character recognition. It's definitely possible to hack up a custom detector type and add it to the command line (we should add some documentation on how to do this).

(Unrelated, but it would be awesome in the future to have some kind of plugin system where you could pip install other detector types, that way it's easier to have unofficial detector types.)

Breakthrough avatar Sep 04 '21 14:09 Breakthrough

Also, if anyone can provide a small amount of samples (@kimlia545 / @mrahmadt) or even screenshots, that would be helpful for working on this feature as well as testing.

Breakthrough avatar Sep 04 '21 14:09 Breakthrough