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.

VPP error when enabling deinterlacing with sample_decvpp

Donald_G_
Beginner
1,338 Views

I run the decode sample "sample_decvpp" from the latest INDE 2015. The sample runs fine out of the box.

I add these two lines to InitVppParams() to enable deinterlacing:

m_mfxVppVideoParams.vpp.In.PicStruct = MFX_PICSTRUCT_FIELD_TFF;
m_mfxVppVideoParams.vpp.Out.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;

According to the documentation, this should enable deinterlacing, and in fact it does so with MSDK 2014 and earlier sample code, but it fails with the latest sample code! The error I receive with these two lines is MFX_WRN_INCOMPATIBLE_VIDEO_PARAM from RunFrameVPPAsync(). This crashes the sample. If I change the code to ignore that error, it runs but does not enable deinterlacing. There is no mention of this error in the API manual description for RunFrameVPPAsync().

Please advise how to enable deinterlacing with INDE 2015 Update 1 and the included sample_decvpp code and/or how to resolve this error. I have been impressed thus far with the new INDE and sample code, but obviously this is a gut shot. Thank you.

0 Kudos
16 Replies
Harshdeep_B_Intel
1,338 Views

Hi,

We have new safeguards with new API 1.13. I am consulting the team and will update with a workaround for the issue.

Thanks, 

0 Kudos
Donald_G_
Beginner
1,338 Views

Safeguards against enabling the deinterlacer? OK, thank you, I will wait patiently.

0 Kudos
Donald_G_
Beginner
1,338 Views

OK, I have found the bug in your sample_decvpp code.

Right before RunFrameVPPAsync(), there is this code:

                if (pOutSurface->Info.PicStruct != m_pCurrentFreeVppSurface->frame.Info.PicStruct) {
                    m_pCurrentFreeVppSurface->frame.Info.PicStruct = pOutSurface->Info.PicStruct;
                }

That overwrites my PicStruct setting and turns off the deinterlacing! I simply removed that code and single-rate deinterlacing works fine now. Please advise if removing that check can cause any problems.

There is still an issue with double-rate deinterlacing [the decode loop does not seem designed for it as it always runs RunFrameVPPAsync() only once per decoded frame]. I am investigating that and will post a new thread if I can't get it resolved on my own.

0 Kudos
Harshdeep_B_Intel
1,338 Views

Hi,

We currently do not have open bugs/issues with our samples. Our samples provides general information and working for building customer applications. We expect from customer to use the sample and build the application as per their requirements and get it working into their application. 

Glad that you could resolve the issue by commenting the sample code and build depending on your requirements. 

The decode loop does not seem designed for it as it always runs RunFrameVPPAsync() only once per decoded frame.-> Yes, our samples were not designed/built to run in a loop. But, by inserting a correct code snipet and calling all the other required parameters/functions in loop, you should be able to build the required feature into your application. 

Thanks,

0 Kudos
Donald_G_
Beginner
1,338 Views

Nonsense, I just demonstrated an issue with your sample code. You can't just go overwriting PicStruct like that. What is the point of that check, and is it safe to remove it? That is what I asked you, but you give me only a boilerplate response that doesn't address my question.

And saying your samples are "not designed to run in a loop" is just weird. The previous decode sample runs correctly for bobbing by calling the VPP multiple times as needed. This required functionality was removed in the latest sample code, or the authors didn't know what they were doing.

OK, I get it, we're on our own. I already knew that from past experience here, but I hoped things might have changed at least a little after I gave feedback on the forum and had an email chat with one of your people.

Apparently Intel doesn't realize the importance of proper reference code in enabling users to succeed with the MSDK.

0 Kudos
Harshdeep_B_Intel
1,338 Views

Hi,

We do support our customer applications who are using our product and building applications and resolve any issues related to our product. But, what we do not support is, we do not build a customer application, we leave it to customer to design and build there application using our products as per there requirements.  We have defined in mediasdk manual all the usage scenario for our samples and test case scenarios.

Thanks,

0 Kudos
Donald_G_
Beginner
1,338 Views

More nonsense. The documentation sucks and is not up to date.

And you still haven't answered my question about the check in the decoding loop that I identified as an issue. I also asked what safeguards you were talking about earlier but you did not respond.

From my perspective you have given me zero support.

 

0 Kudos
Nina_K_Intel
Employee
1,337 Views

Hi Donald,

Sorry for the confusion you have experienced. The issue here is that sample_decvpp is designed to showcase only VPP color conversion to support decoding and rendering of H265 streams, so no deinterlace support is intended. For deinterlace (and many other VPP algorihtms) configuration please check out the sample_vpp. It would support all the di configurations including calling RunVPPFrameAsync twice for one frame in case of 60 fields -> 60 frames conversion.

Regards,

Nina

0 Kudos
Donald_G_
Beginner
1,337 Views

Thank you, Nina, for your suggestion. The problem is that sample_vpp does not do decoding, so I have to figure out how to make a combined decode loop that functions correctly, when that should be available as reference code, in my humble opinion, especially when the documentation is inadequate.

My questions remain unanswered too. Shall I repeat them for a third time?

May I ask you this: if I purchase the professional version of INDE will I get access to competent support or will it be the same I am getting here?

0 Kudos
Donald_G_
Beginner
1,336 Views

OK, so I'm trying to get things going for bobbing in sample_decvpp.

I set the output frame rate to twice the input frame rate. But RunFrameVPPAsync() inexplicably returns MFX_ERR_NONE on its first call rather than the correct MFX_MORE_SURFACE.

Can you please help me with understanding that?

0 Kudos
Nina_K_Intel
Employee
1,336 Views

Donald,

Can you please check statuses after several more frames and even better - check if the produced output stream is as expected? The default algorithm used in VPP deinterlace is advanced deinterlace which may require frames buffering to use motion compensation to produce interpolated frames (for double rate deinterlace). For the first frame it will then just use BOB and output the result immediately but will need the next input frame to produce the second output frame (thus ERR_NONE). I'm not sure if that's the case at your side because it depends on the graphics driver version. But the idea is that our spec doesn't guarantee that the first RunFrameVPPAsync will return exactly MORE_SURFACE. You need to trace more frames to see if the pattern has changed compared to no deinterlacing case. 

BTW, if you want to use BOB algorithm then you should additionally override the default algo by attaching mfxExtVPPDeinterlacing with Mode = MFX_DEINTERLACING_BOB to mfxVideoParam.ExtParam at VPP.Init.

To your previous post: we do aim to provide competent support in this forum. However, we cannot provide reference code for any possible use case of Media SDK. We try to provide the necessary pieces to explain key concepts so that customers could use those pieces and the knowledge to build their own apps. Customers who pay for an INDE license get an additional support option: Premier Support, you may check more details on INDE web site. 

About that line which disables deinterlacing in sample_decvpp - yes, it is safe to remove it to enable deinterlacing. I guess that line was added exactly to prevent unintended deinterlace which could happen if input stream is interlaced - then DecodeFrameAsync would set the picstruct to interlaced. But mind this modification if you test other scenarios, where you don't intend to use deinterlace - you may need to make further corrections. Also, if you have the previous version of sample_decvpp working correctly you may just keep using it and/or check the difference with the latest sample_decvpp to see what's required to make the latest sample work for your case. 

As to "The documentation sucks and is not up to date" - can you please provide specific examples? We are willing to improve our documentation.

Regards,

Nina 

0 Kudos
Donald_G_
Beginner
1,336 Views

Thank you, Nina, for your information, suggestions, and patience. I will try your idea, see how it goes, and report back. I will also collect some feedback on the documentation for you.

0 Kudos
Donald_G_
Beginner
1,336 Views

Nina, your suggestion did apparently explain the return values but it doesn't bring me much closer to knowing how to modify the sample code for delivering two output frames per input frame. The reason for that is the code has a really complex surface management that is not explained and I do not understand. Also, this code has unexplained workarounds and even tests simply commented out. So I simply do not know how to appropriately modify it. And when I make stabs in the dark I run into unexplained errors like MFX_ERROR_NOT_SUPPORTED, etc. Harsh basically declined to assist in this regard, telling me that Intel is not responsible for developing my application. Well, my application is perfectly fine, the reference code is not. And then he says I only need to add a code snippet, but declines to tell me what the code snippet is and where to add it.

So I'll try one last time. Can you tell me specifically how to modify your reference code to support bobbing?

0 Kudos
Nina_K_Intel
Employee
1,336 Views

Hi again, Donald,

Why don't you try an easier way and just keep using the old version of the sample which worked successfully? Sample apps and library/graphics driver updates are separate. Old sample should work just fine with the new INDE version and the new graphics driver. As far as I understand you had bobbing enabled and working fine with some older sample code.

In addition, I recommend you check out the tutorial reference code, it is significantly simpler than sample apps:

https://software.intel.com/en-us/articles/media-sdk-tutorials-for-client-and-server

You may want to specifically check out the one named "simple_6_decode_vpp_postproc" for a pipeline of decode and vpp.

Regards,

Nina

0 Kudos
Nina_K_Intel
Employee
1,336 Views

Just to clarify: we're not hiding that "code snippet" from you, Harsh used it as a figure of speech. I agree sample_decvpp has a pretty complicated processing loop, so for any of us it would as well take quite an effort to enable the VPP bobbing in that sample. But assuming your final goal is to write your own app, not update our sample, why don't you just use a simpler example - that's my point. 

Nina

0 Kudos
Donald_G_
Beginner
1,336 Views

Hi Nina, thank you for your responses. I would love to use the old sample code but unfortunately it delivers two spurious extra frames at the start of decoding, and that was fixed in the new sample code.

I will check out your other suggestions.

regards,
Don

 

0 Kudos
Reply