Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6746 Discussions

Find resolution and frame type without decoding the full frame

santhosh_tns
Beginner
658 Views
Need to Identify the resolution of the current frame without fully decoding the frame.

My Application flow is given below.

1. MPEG4 Video frames (both I and P frames) will be received from the network one frame at a time.
2. Need to identify the frame type for all the received frames and resolution of every I Frame after each frame is received from network.
3. Whether to decode only I-frame or both I-frame and P frame is decided based on the user selection in the application.
4. If the user has selected I-frame decoding then based on the frame type identified in the step 2 only I frames will be decoded and P frames will be skipped.

Need your inputs on how to identify the frame type and resolution (Step 2) without decoding the entire frame.
0 Kudos
3 Replies
Tamer_Assad
Innovator
658 Views
Hi Santhosh,

The frame resolution (width*height) must be correctly pre-defined in order to have the decoder processing it.

To recognize the frame type:
1. Please locate the call to this function:
GetFrame(UMC::VideoData &DataIn, UMC::MediaData &DataOut);
the statement should appear as follows:
status = decoder.GetFrame(&DataIn, &DataOut);

2. place a break point at this call, and trace it down.

3. based on the decoder you are using, this trace will lead you to the core decoding syntax.
In your case, this could be:
Status MPEG4VideoDecoder::GetFrame(MediaData* in, MediaData* out){......}

4. There you can see how and where a frame gets decoded, according to its type I, P, or B frame. Look for
(I_PICTURE, B_PICTURE, P_PICTURE).

Note: It might takes a while tracing until you get the to the right function call, there are templates you will have to trace in debug mode, unfortunately I the documentation is not detailed enough here, and I cant go deeper now :), I hope it good for you can take it from here with little work from you, good luck.

Regards,
Tamer
0 Kudos
santhosh_tns
Beginner
658 Views

Thanks for your response.

Calling GetFrame function will decode the entire video frame.

Instead we need only some information like frame type, resolution etc by parsing the header.

We need your inputs on how to identify the frame type and resolution, without decoding the entire frame. A code snippet will be very helpful for us to proceed.

0 Kudos
Chao_Y_Intel
Moderator
658 Views

Hi Santhosh,

our mpeg4 decoder expert suggest you checking the following code on read the resolution and frame type information:

In the file, mp4parse.c:

mp4_Parse_VideoObject() and mp4_Parse_VideoObjectPlane() functions (mp4parse.c) read the information in question from the stream.

Thanks,

Chao

0 Kudos
Reply