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.

Can't get double-rate deinterlacing to work

Donald_G_
Beginner
1,832 Views

I use INDE 2015 Update 1. I have an interlaced AVC stream that I want to double-rate deinterlace. I set the input params for TFF and 29.97 fps and the output params for PROGRESSIVE and 59.94 fps. I provide this extra configuration:

        mfxExtVPPDeinterlacing di;
        memset(&di, 0, sizeof(di));
        di.Header.BufferId = MFX_EXTBUFF_VPP_DEINTERLACING;
        di.Header.BufferSz = sizeof(di);
        di.Mode = MFX_DEINTERLACING_AUTO_DOUBLE;
        mfxExtBuffer* ExtBuffer[1];
        ExtBuffer[0] = (mfxExtBuffer*) &di;
        Pipeline.m_mfxVPPParams.NumExtParam = 1;
        Pipeline.m_mfxVPPParams.ExtParam = (mfxExtBuffer**) &ExtBuffer[0];


When running, I first decode an input frame, then I get MFX_MORE_SURFACE as expected from the first VPP run and sync. Then I run VPP and sync again.

I find that I do get 59.94 fps output, but the second output frame of a pair is always the same as the first one, i.e. I do not get proper bobbing where each input field gets it's own output frame.

I would appreciate any help in getting this working. Perhaps there is some sample code for double-rate deinterlacing. Thank you.

0 Kudos
12 Replies
Harshdeep_B_Intel
1,832 Views

Hi,

Yes, please refer to the video processing sample of MediaSDK from here: https://software.intel.com/en-us/articles/intel-media-client-getting-started-guide (or) https://software.intel.com/en-us/media-client-solutions-support/code-samples.

Also, please refer to the article which explains more on deinterlacing :https://software.intel.com/en-us/forums/topic/530561.

Thanks,

0 Kudos
Donald_G_
Beginner
1,832 Views

Thank you, Harsh, but I have already extensively looked at those things. Can you point me specifically to a sample that performs double-rate deinterlacing?

In the absence of such a sample, can you advise on what may be causing my problem? Thank you.

0 Kudos
Harshdeep_B_Intel
1,832 Views

Hi,

We do not have/provide a specific double-rate deinterlacing sample, samples are more like a starting point to build your own application. We generally advise to use our sample and ask you to build the required functionality using them. 

An idea to try, probably you can set the PicStruct to MFX_PICSTRUCT_UNKNOWN for the input format at the intialization and provide the correct input frame picture structure type on every frame. Let me know if that helps!

Thanks,

0 Kudos
Surbhi_M_Intel
Employee
1,832 Views

Hi Donald, 

This is BOB method being used to double the frame rate, which is duplicating the frames. It is not making use of any advance frame rate conversion technique.

-Surbhi

0 Kudos
Donald_G_
Beginner
1,832 Views

Harsh,

"An idea to try, probably you can set the PicStruct to MFX_PICSTRUCT_UNKNOWN for the input format at the intialization and provide the correct input frame picture structure type on every frame. Let me know if that helps!"

It does not help.

Surbhi,

Eric Gur tells me that proper bobbing (no frame duplication) should work fine (and does so in his DirectShow decoder). This contradicts what you tell me. I am asking how to achieve proper bobbing. Are you unable to tell me and continue to say it is not possible? It seems to me that the VPP must somehow be told to use the second input field of the input frame when generating the second output frame. In nVidia land there is a simple flag you set before calling VPP for the second frame. What is the equivalent for Intel?

thank you, Don

0 Kudos
Harshdeep_B_Intel
1,832 Views

Hi,

Let me correct that.Yes, We can achieve bobbing using MediaSDK. Let me consult the team and will update you on how to achieve proper bobbing in this particular case. 

It seems to me that the VPP must somehow be told to use the second input field of the input frame when generating the second output frame. In nVidia land there is a simple flag you set before calling VPP for the second frame. What is the equivalent for Intel? -> Will find out and update. 

Thanks,

0 Kudos
Surbhi_M_Intel
Employee
1,832 Views

Hi Don, 

I misunderstood your question, apologies for that. We are working with engineering team to how to achieve feature. We will update you how to implement this feature as soon as we can.
 
-Surbhi

0 Kudos
Donald_G_
Beginner
1,832 Views

Thank you, guys, I appreciate your support.

0 Kudos
Harshdeep_B_Intel
1,832 Views

Hi,

I have few updates from our development team and following are there suggestions to achieve double-deinterlacing and proper bobbing. In this special case ADI 60i->60p, in term of sample_vpp it is “-spic 0 -dpic 1” and “-sf 29.97 -df 59.94”. This will work for Win & Linux as well.
 

 To perform this special case of double de-interlacing, Please make following changes to your code.  

        mfxExtVPPDeinterlacing di;
        memset(&di, 0, sizeof(di));
        di.Header.BufferId = MFX_EXTBUFF_VPP_DEINTERLACING;
        di.Header.BufferSz = sizeof(di);
        di.Mode = MFX_DEINTERLACING_AUTO_DOUBLE;

        di.Mode = MFX_DEINTERLACING_ADVANCED;
        mfxExtBuffer* ExtBuffer[1];
        ExtBuffer[0] = (mfxExtBuffer*) &di;
        Pipeline.m_mfxVPPParams.NumExtParam = 1;
        Pipeline.m_mfxVPPParams.ExtParam = (mfxExtBuffer**) &ExtBuffer[0];

        Pipeline.m_mfxVPPParams.vpp.In.FrameRateExtN = <In frame rate>;

        Pipeline.m_mfxVPPParams.vpp.Out.FrameRateExtN = <Out Frame rate>;

Let me know if this solves your issue. 

Thanks,

0 Kudos
Donald_G_
Beginner
1,832 Views

Outstanding, Harsh! That solves the issue for me. Thank you very much.
 

0 Kudos
Harshdeep_B_Intel
1,832 Views

Hi, 

Glad, we could help resolve your issue. 

Thanks,

0 Kudos
Donald_G_
Beginner
1,832 Views

Status update...

While this worked for the old decode sample I now find that I cannot enable the deinterlacer using the latest sample_devpp code. I have posted a new thread about it and would appreciate your support. Thank you.

0 Kudos
Reply