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.29k stars 398 forks source link

Detect faded scene changing #100

Open llafcode opened 5 years ago

llafcode commented 5 years ago

Hi @Breakthrough ,

Thank you very much for your awesome software! I'm using it to detect scenes from some cartoon videos, see the original video here.

Now I'm having some problems of getting what I want. Specifically: I want to detect the real scene changes (not shot changes) in the video. There are usually two ways of representing real scene changes:

  1. fade into black screen and fade into next scene;
  2. fade directly into the next scene without a black screen.

The content-detector method works well for shot changes while the threshold-detector works well for real scene changes (option 1). But I'm missing many scenes with scene changes in the second way. For example, check scene changes happened at 03:22 to 03:23 and 05:52 to 05:53 in the original video I just posted.

I struggled with adjusting the parameters but I failed to achieve what I want. Any ideas of how I can make it?

Many thanks!

Breakthrough commented 5 years ago

Hi @llafcode;

Although it's not documented, multiple detectors are allowed at once (e.g. you can actually specify both detect-content and detect-threshold together). Have you tried this? Sounds like this might be a good use case for testing it out.

Thanks for the feedback, let me know if it works out for you.

llafcode commented 5 years ago

Hi @Breakthrough,

Thank you for your advice! Sounds interesting! Will try it later.

If I understand correctly, I can include both detect-threshold and detect-content within one command line, am I right? If so, how should I specify different threshold for the two detectors? By using two -t options? Sounds weird...

Breakthrough commented 5 years ago

@llafcode correct, that is possible. The output scene list will be the combination of scenes detected by both detectors.

llafcode commented 5 years ago

@Breakthrough Hi, I tried your suggestion. Although it didn't work exactly as I want, I still got better results. I also checked the states files, and see both rgb and hsv states at the timestamp I wanted to be cut. The result is I don't think the current two algorithm can cut in the way I want. But since no splitting program is perfect, your tool is still one of the best I found. Thank you again!

Breakthrough commented 5 years ago

Hi @llafcode;

I just re-analyzed the video, and sorry, I misinterpreted your original question. Indeed PySceneDetect currently doesn't deal well with slow fades like you mentioned.

If anyone does happen to have suggestions on how to approach the problem, I would be most welcome to investigate the possibility of adding support for it to PySceneDetect.

Thank you!

anujtyagi2802 commented 5 years ago

yes, the choosing of threshhold is quite complex but you should also consider audio features of a video to compute more accurate scene change,this will bring a huge change in algorithm

allenday commented 4 years ago

Seems like this issue is about cross-dissolve, but the video referenced by OP is now 404 and I can't confirm.

I noticed after examining stats output that cross-dissolve in my reference video causes a u-shaped decrease in the saturation delta. The other columns look to be not affected.

  1. is it possible to use the other columns, or to add more columns to stats?
  2. is it possible to define an alternate threshold that is negative rather than positive?
  3. can we use a loess type cut to detect rapid change in a metric rather than a global value for -t?