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.
3056 Discussions

how to deinterlacing use vpp?i got a warning "MFX_WRN_INCOMPATIBLE_VIDEO_PARAM"

Jin_Shuyang
Beginner
516 Views

I written a small app. The app use the capture card grab video frames (yuy2,interlace,29.97fps) into the mem and use media sdk to encode it .

I want to sdk alter yuy2 to nv12 and deinterlace . alter yuy2 to nv12 is ok , but deinterlacing, i got the warning "MFX_WRN_INCOMPATIBLE_VIDEO_PARAM" ,the frames is still interlaced. the code like this:

m_mfxVppParams.IOPattern = MFX_IOPATTERN_IN_SYSTEM_MEMORY | MFX_IOPATTERN_OUT_SYSTEM_MEMORY;

m_mfxVppParams.vpp.In.FourCC=MFX_FOURCC_YUY2;

m_mfxVppParams.vpp.In.PicStruct = MFX_PICSTRUCT_FIELD_TFF;

ConvertFrameRate(30000.00/1001, &m_mfxVppParams.vpp.In.FrameRateExtN, &m_mfxVppParams.vpp.In.FrameRateExtD);

// width must be a multiple of 16

// height must be a multiple of 16 in case of frame picture and a multiple of 32 in case of field picture

m_mfxVppParams.vpp.In.Width = MSDK_ALIGN16(pInParams->nWidth);

m_mfxVppParams.vpp.In.Height = (MFX_PICSTRUCT_PROGRESSIVE == m_mfxVppParams.vpp.In.PicStruct)?

MSDK_ALIGN16(pInParams->nHeight) : MSDK_ALIGN32(pInParams->nHeight);

// set crops in input mfxFrameInfo for correct work of file reader

// VPP itself ignores crops at initialization

m_mfxVppParams.vpp.In.CropW = pInParams->nWidth;

m_mfxVppParams.vpp.In.CropH = pInParams->nHeight;

// fill output frame info

memcpy(&m_mfxVppParams.vpp.Out, &m_mfxVppParams.vpp.In, sizeof(mfxFrameInfo));

m_mfxVppParams.vpp.Out.FourCC=MFX_FOURCC_NV12;

m_mfxVppParams.vpp.Out.PicStruct=MFX_PICSTRUCT_PROGRESSIVE;

// only resizing is supported

m_mfxVppParams.vpp.Out.Width = MSDK_ALIGN16(pInParams->nDstWidth);

m_mfxVppParams.vpp.Out.Height = (MFX_PICSTRUCT_PROGRESSIVE == m_mfxVppParams.vpp.Out.PicStruct)?

MSDK_ALIGN16(pInParams->nDstHeight) : MSDK_ALIGN32(pInParams->nDstHeight);

// configure and attach external parameters

AllocAndInitVppDoNotUse();

m_VppExtParams.push_back((mfxExtBuffer *)&m_VppDoNotUse);

if (pInParams->bIsMVC)

m_VppExtParams.push_back((mfxExtBuffer *)&m_MVCSeqDesc);

m_mfxVppParams.ExtParam = &m_VppExtParams[0]; // vector is stored linearly in memory

m_mfxVppParams.NumExtParam = (mfxU16)m_VppExtParams.size();

return MFX_ERR_NONE;


debug mem info like this:

- In {reserved=0x002dd7ec FrameId={...} FourCC=844715353 ...} mfxFrameInfo

+ reserved 0x002dd7ec unsigned int [6]

+ FrameId {TemporalId=0 PriorityId=0 DependencyId=0 ...} mfxFrameId

FourCC 844715353 unsigned int

Width 1920 unsigned short

Height 1088 unsigned short

CropX 0 unsigned short

CropY 0 unsigned short

CropW 1920 unsigned short

CropH 1080 unsigned short

FrameRateExtN 30000 unsigned int

FrameRateExtD 1001 unsigned int

reserved3 0 unsigned short

AspectRatioW 0 unsigned short

AspectRatioH 0 unsigned short

PicStruct 2 unsigned short

ChromaFormat 0 unsigned short

reserved2 0 unsigned short

- Out {reserved=0x002dd830 FrameId={...} FourCC=842094158 ...} mfxFrameInfo

+ reserved 0x002dd830 unsigned int [6]

+ FrameId {TemporalId=0 PriorityId=0 DependencyId=0 ...} mfxFrameId

FourCC 842094158 unsigned int

Width 1920 unsigned short

Height 1088 unsigned short

CropX 0 unsigned short

CropY 0 unsigned short

CropW 1920 unsigned short

CropH 1080 unsigned short

FrameRateExtN 30000 unsigned int

FrameRateExtD 1001 unsigned int

reserved3 0 unsigned short

AspectRatioW 0 unsigned short

AspectRatioH 0 unsigned short

PicStruct 1 unsigned short

ChromaFormat 0 unsigned short

reserved2 0 unsigned short

0 Kudos
3 Replies
Jin_Shuyang
Beginner
516 Views
the error has been resolved . because of m_mfxEncParams.mfx.FrameInfo.PicStruct is set to interlaced . So, interlace->vpp->PROGRESSIVE -> encoder->interlace .
0 Kudos
Petter_L_Intel
Employee
516 Views
Hi Jin,

Thanks for updating us on the status. It saved us tome time having to look into the issue.
Glad you got it to work.

Regards,
Petter
0 Kudos
zhengbinham
Beginner
516 Views
Hi, Jin Shuyang, I have been writing an app for converting rgb4 to nv12, but error occurs, could you give me your app code? I will use it as a reference.Thank you .I am looking forward to your reply, my email address is zb_adventure@yahoo.com.cn.
0 Kudos
Reply