Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.

where is key frame ?

china_y_
Beginner
1,127 Views

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  

0 Kudos
3 Replies
celli4
New Contributor I
1,127 Views

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

0 Kudos
andy4us
Beginner
1,127 Views

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

};

0 Kudos
lee_j_
Beginner
1,127 Views

Hi

If you do the following:
sts = m_pmfxENC-> EncodeFrameAsync (NULL, & m_pEncSurfaces [nEncSurfIdx], & pCurrentTask-> mfxBS, & pCurrentTask-> EncSyncP);

How do I know if I am on the current frame is a key frame?

Or Do I know from another function?

Regards,

Lee

0 Kudos
Reply