Link Copied
Hi,
You can do this, the UMC simple_player sample is flexible and rich, it is demonstrating how to process a variety of media formats.
Regards,
Tamer AssadWhat 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?
Hi 9ine,
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
////
Example:
// 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
Regards,
Tamer Assad
Hi 9ine,
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.
Regards,
Tamer Assad
For more complete information about compiler optimizations, see our Optimization Notice.