Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak on skvideo.measure.scenedet #53

Closed
erichi opened this issue Sep 1, 2017 · 2 comments
Closed

Memory leak on skvideo.measure.scenedet #53

erichi opened this issue Sep 1, 2017 · 2 comments

Comments

@erichi
Copy link

erichi commented Sep 1, 2017

Hi, i'm trying to detect scenes using luminance algorithm on 8 minutes video, and after using all available memory process gets killed. I only get results on short ~1min videos.
I'm running script on my local machine.
Is there any solution for this kind of problem or i need to deploy it on cloud to work with long videos?
Thank you!

@beyondmetis
Copy link
Member

Based on this issue, I realized there was an inefficiency in the histogram-based scene detection (the default setting). The code converted the entire video to luminance in one pass, creating a copy in memory. This is now avoided. I just pushed and tested the fix, so you should not have that problem at least.

At some point, memory would become a concern anyway, since the scene detector requires the whole chunk to be provided at once. I realize this is incredibly inefficient, since the algorithm only makes comparisons between 2 frames. For larger videos, where you don't want to load the entire video at once, you could provide pairs of frames to the scene detection function and keep track of the frames that are returned ([0] is always returned as a scene boundary, but you should probably discard that).

@erichi
Copy link
Author

erichi commented Sep 5, 2017

Thanks so much @beyondmetis ! I've tested the fix on the same video and now it works.
And thanks for the recommendation for larger videos.

@erichi erichi closed this as completed Sep 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants