amanwalia123 / KeyFramesExtraction

This repository contains script to divide a video into key frames.
MIT License
158 stars 34 forks source link

key_frame numbers problem #3

Closed chen-ming2019 closed 5 years ago

chen-ming2019 commented 5 years ago

Hi ,could the code set the numbers of extracting key_frame from video ?

amanwalia123 commented 5 years ago

You can certainly do that although not in the original code. In line 171 where frame_indexes are obtained, use those to obtain the corresponding sm_diff_array values and store the corresponding values as (key, value) pair with key being sm_diff_array and value being frame_indexes. Once you get that, sort the (key, value) tuple according to keys(sm_diff_array values), then extract the top n frame indexes as per what you need. Rest of the code remains the same.

chen-ming2019 commented 5 years ago

@amanwalia92 ok ,thanks!