where is key frame ?

where is key frame ?

i  use the intel media sdk to encode video .

when  i get the encoded frame i want to know what frame it is .

sts = m_VideoSession.SyncOperation(syncp,6000) ;
MSDK_CHECK_RESULT(sts,MFX_ERR_NONE,sts) ;
nLenOut = m_fxBS.DataLength ;
if (MFX_FRAMETYPE_I==m_fxBS.FrameType)
{
bKeyFrame = TRUE ;
}
else
{
bKeyFrame = FALSE ;
}
WriteBitStream(&m_fxBS,pBuffOut) ;

up  is my code  i am confused about  the  m_fxBS.FrameType

its value  is 193 when i encoded the first frame ,this must be a key frame ,but the sdk do not define  any value  193 as the frame type ,

sometime it return 66 the same .

and  very little it return 4 that means a B_frame

i was confused about this

is anybody  who can give me some suggest?

very appreciate it

thank you very much  in advanced  

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

MFX_FRAMETYPE_I and its brethren appear to be mask values, an should  be checked for using Bitwise And.

http://en.wikipedia.org/wiki/Bitwise_operation#AND

Look in the file mfxstructures.h

/* FrameType */

enum {

MFX_FRAMETYPE_UNKNOWN =0x0000,

MFX_FRAMETYPE_I =0x0001,

MFX_FRAMETYPE_P =0x0002,

MFX_FRAMETYPE_B =0x0004,

MFX_FRAMETYPE_S =0x0008,

MFX_FRAMETYPE_REF =0x0040,

MFX_FRAMETYPE_IDR =0x0080,

MFX_FRAMETYPE_xI =0x0100,

MFX_FRAMETYPE_xP =0x0200,

MFX_FRAMETYPE_xB =0x0400,

MFX_FRAMETYPE_xS =0x0800,

MFX_FRAMETYPE_xREF =0x4000,

MFX_FRAMETYPE_xIDR =0x8000

};

Leave a Comment

Please sign in to add a comment. Not a member? Join today