What will be the performance in that case compared to every frame capture?
I need to extractN frames only in everyM seconds of the video file (N,M>=1)
sample_player shows amazing performance for HD video will it be retained capturing in that mode?
Or do I need to seek to key frames only and how to achieve that?
Try the following algorithm:
Identify/detect the GOP size and frame rate of your stream
Seek to key frame time-stamped right before your target frame
Start decoding from that key frame to your target frame
// 1) inputs
GOP = 15
Frame rate = 25
Target time = 3.4
// 2) processing
Frame number = frame rate * target time // 25*3.4 = 85
Keyframe = frame number DIV GOP // 85 DIV 15 = 5
Keyframe_NUMBER = GOP * keyframe // 15 * 5 = 75
//now start decoding at frame 75 (key frame 5)
For (int CurFrame = Keyframe_NUMBER; CurFrm <= Frame number; CurFrame++)
Target frame = decoder.GetFrame();
//exiting loop: this last Target frame is what you were looking for
That was a general algorithm; IPP already has pre-implemented portions.
Consider the processing phase #2 of the algorithm, IPPSplitter.SetTimePosition() will get you directly to the target Key frame Keyframe_NUMBER.