Community
cancel
Showing results for 
Search instead for 
Did you mean: 
9ine
Beginner
23 Views

Is it possible to seek to a random location in video file with UMC simple_player

Is it possible to build a video player with seeking capabilities using UMC from simple_player sample?
0 Kudos
7 Replies
Tamer_Assad
Innovator
23 Views

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 Assad
9ine
Beginner
23 Views

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?

Tamer_Assad
Innovator
23 Views

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

9ine
Beginner
23 Views

Hello

How to determine GOP with IPP?

Thanks
Tamer_Assad
Innovator
23 Views

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

9ine
Beginner
23 Views

What is processing phase #2? SetTimePosition takes second as argument not a key frame number.
Tamer_Assad
Innovator
23 Views

Hi 9ine,

phase #2 in the example above :)

Regards,
Tamer Assad