I need Need To extract Key Frames from Video/Stream.So is there any standard implementation.
I am using open CV.
(Currently i am extracting frames each second which is slower i need to improve performance.)
So if any one has optimized implementation please reply in here.
I need Need To extract Key Frames from Video/Stream.So is there any standard implementation.
Share
Using ffmpeg you can extract all key frames using the following code:
What follows -vf in a ffmpeg command line is a Filtergraph description. The select filter selects frames to pass in output. The constant of the filter is “pict_type” and the value “ PICT_TYPE_I”. So ffmpeg is only passing key frames to the output.
-vsync 2 prevents ffmpeg to generate more than one copy for each key frame.
-f image2 writes video frames to image files. The output filenames are specified by a pattern, which can be used to produce sequentially numbered series of files. The pattern may contain the string “%d” or “%0Nd”.
Reference:
http://www.videoproductionslondon.com/blog/scene-change-detection-during-encoding-key-frame-extraction-code