-
Notifications
You must be signed in to change notification settings - Fork 4
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
Extract keyframes from a video using Katna #2
Comments
I checked the katna keyframe detection workflow. Here is how it works -
It took an average of
https://github.com/scikit-image/scikit-image/blob/master/doc/source/user_guide/video.rst
I am encountering a multiprocessing bug in Katna with Python 3.6, 3.7 and 3.8 where a process lock does not get released / is not found after extracting the first set of frames. I did not test older Python versions. Katna does not seem to have good load balancing. A long video continues processing in a single process. Shorter videos do not use all cpu cores equally. I need to test this further. It is dependent on moviepy which is not working with new python versions and is not executing consistently well even with Python 3.6. Unless these issues are fixed, Katna does not seem stable for production use. |
Thank you @duggalsu for evaluating this. If we were to take a step back and reevaulate this. Our main problem statement is to extract key frames out of a video. I am guessing its unlikely we'll find one library that takes care of all use cases. So maybe a good approach is to enumerate the use cases and implement different implementation for it? This is not an exhaustive list but we did a similar enumeration of use cases for another project and some parameters we identified were video length, file size, frame rate, frame resolution, format (avi, mp4, mov, flv). These are things that could affect what mechanism to extract frames. What makes this slightly more complex is that its never just one parameter that could be used to decide the algorithm. for instance a short video with high frame resolution might need as much memory as a long video with low frame resolution. so the solution we decided on was to start supporting limited use cases and respond with a NOT_SUPPORTED message for ALL use cases that our system doesn't support. with that in mind, our primary use cases are
we can deprioritize the very long videos and other use cases for now. |
Instead of extracting one random keyframe from a video, we should try using Katna library to extract keyframes.
in my MVP i dropped support for katna that was implemented by @anushree-a because it was taking prohibitively long times to complete on long files. But that could have been some error on my part. So this needs further investigation.
Intended Outcome
When a video is posted to the server, it should download the video, extract x number of keyframes from it and index it.
We need to think about what happens for long files. What are some edge cases we are willing to let go etc.
The text was updated successfully, but these errors were encountered: