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.

JPEG Decoder failing with SDK Decoding Sample

Tim_S_
Beginner
2,015 Views

Dear Support:

I am using the Media SDK 2014 R2 for Clients that I recently downloaded from the Intel site.  I also downloaded the Intel Media SDK Samples and built the Video Decoding Sample and was able to successfully decode and render an output image as well as convert the resulting output to YUV frames.  However when I try to do the same with JPEG images, it fails with the message "fatal: failed to find output surfce, that's a bug!".  And it does this regardless whether I try to render it or store it to a YUV file.  I have tried several different JPEG images from cameras that decode with no problem with a standard JPEG viewer, but Media SDK is complaining for some reason.  Can you tell me what may be the problem?

Thanks,
Tim

0 Kudos
11 Replies
Sravanthi_K_Intel
2,015 Views

Thanks for your question. I tried the sample decode with JPEG (JPEG and also MJPEG), and I was able to execute without a problem. Can you please try the decoder again with the test inputs provided by the Media SDK and let us know if you see the issue? (http://software.intel.com/sites/default/files/sample_video_content_0.zip).

In addition, following information will help us reproduce the issue and help you:

1. If possible, please share the input you are having trouble with for us to reproduce the error on our side. Alternately, if you can reproduce the issue with videos under Creative Commons license, that will be good too.

2. System details such as OS, processor, graphics etc. You can get that information by running media_sys_analyzer.exe from tools/ folder of MSDK install folder.

 

0 Kudos
Tim_S_
Beginner
2,015 Views

Hey Sravanthi K.

Thanks for your quick response.  Indeed the JPEG sample file you provided decoded ok - thanks for proving it.  From this, I noticed that I didn't have the nAsyncDepth=4 in my code and that fixed the problem allowing me to decode it.  However I am still having problems with some of the JPEG clips I am using.   I am attaching 2 of the JPEG files that I have that don't decode correctly.  They are single JPEG files.  However I noticed that if I create another binary file with multiples of this JPEG clip replicated over and over to consume around 500 Kbytes, that the code will decode it then.  I have attached the multi versions of these JPEG clips as well.   Is there something with the JPEG clips that I am using that prevent them from being decoded as a single picture, but when I duplicate it over and over to make a bunch of them, then the decoder can decode it?

A few other quick questions:

1.)  I couldn't find the actual JPEG calls that are made in the example.  For example, I see a MFXVideoDECODE(...) call, but not a MFXVideoDECODE_DecodeHeader(...), MFXVideoDECODE_Init(...), etc.  How do these functions get called in the sample code that is provided in the sample_decode example code in the MediaSDKVideoDecoderSample download?

2.)  Is there an example available (i.e., pseudo code) that allows me to make specific calls in my own code that make use of the Header, Init, Decode and Close calls that are indicated in the Media SDK Reference Manual for JPEG?

3.)  Is there a notable advantage of using the Media SDK vs using Intel IPP to decode JPEG clips?  I don't need the full power of the Intel IPP, just a fast video codec and currently only JPEG.

4.)  I had a license of an earlier version of the Intel_IPP, but upgraded to a new PC with Windows 7 and a newer version of Visual Studio 2012 and I'm not current on the latest download.  And from what I can tell, you can't even download the Intel IPP anymore as a single library - it is bundled with other packages as is indicated in this URL:

https://software.intel.com/en-us/intel-ipp

Do you have an opinion of using the old Intel IPP on this newer PC and/or getting a new download of Intel IPP vs just using the Media SDK since all I am trying to do is decode a JPEG clip and display it?  Your thoughts...

5.)  Please see also the attached Powerpoint slide providing the output on my PC from running the mediasdk_system_analyzer_32.exe utility.  Any issues with what you see?

Thanks,
Tim

0 Kudos
Tim_S_
Beginner
2,015 Views

Hey Sravanthi K.

Wanted to get back with you my progress.  I found the problem with the JPEG clips that I was using and why the decoder was not decoding them properly.  They did not have a FF D9 at the end.  I placed this at the end of the clip and they decode properly now.  Also in my questions in 1.) and 2.) above, after single stepping through the code I see what is going on now - so never mind getting back with me on this.  So when you get a chance, please let me know your thoughts on questions 3.), 4.), and 5.) above.

Lastly, as I am incorporating the code into my project using Visual Studio 2012, I am getting several unresolved external symbols of _MFXInit, _MFXClose, _MFXQueryIMPL, _MFXSetPriority, _MFXVideoCORE_SetHandle, etc during the link phase of the build.  I am adding the library "libmfx.lib" to my project and referring the linker to the directory where this is located.  Do you know what may be the problem?  I noticed that there is a libmfxsw64.dll in the /bin/x64 directory of the SDK and a libmfx_d.lib in the /build/win_Win32/lib directory of the SDK.  Do I need to incorporate these into my project as well?  Your thoughts as to why the linker would be complaining.

Thanks,
Tim

0 Kudos
Sravanthi_K_Intel
2,015 Views

Thanks for the update, glad you found the issue.

Regarding the VS2012 project, I have a very simple suggestion. If you open the Properties pane in the existing VS solution files for any one our samples or tutorials, you can see what you are missing with linking and other dependencies. If you still are not able to figure, send us the errors and the properties you are setting.

I will get back to you on your other questions.

0 Kudos
Jeffrey_M_Intel1
Employee
2,015 Views

Regarding your questions 3 and 4 above:

Have you seen libjpeg-turbo?   This may be an alternative to IPP jpeg.  Intel IPP is a primitives product and the libjpeg interface is a discontinued sample.  For more info see this note on the external samples package for IPP 8 and forward.  While we don't have prepared performance comparisons, my unofficial tests have indicated that performance shouldn't be a major concern with this transition.

For libjpeg-turbo vs. Media SDK comparisons, this may be apples and oranges.  Media SDK's jpeg is a subset intended for MJPEG use cases.  Most notably, it only works with baseline format so it isn't a general jpeg replacement.  Also, for MJPEG parameters such as resolution are expected to stay the same over many images.  There is some overhead associated with initializing a Media SDK pipeline which may negate some of the performance advantages of hardware acceleration if you need to work with arbitrary picture sizes.

Clearly this needs more research and solid data to make recommendations.  I suspect that there will be scenarios where HW acceleration shines and others where SW will be better.  However, we have to prioritize gathering this data with many other goals so I can't guarantee any timelines yet.  Please watch for more updates on this topic in the future.

 

 

 

 

0 Kudos
Tim_S_
Beginner
2,015 Views

Hey Sravanthi K.

Thanks for your answers.  On the build problem that I am having, I have attached the output "BuildProblem.txt" from Visual Studio 2012 that I am getting from the build of my project.    It is a result of building the "Sample.cpp" file that I have also attached.

0 Kudos
Tim_S_
Beginner
2,015 Views

Whoops, looks like I hit the wrong button - trying again.  Continuation of the previous post and make that "Source.cpp".  Here I am just making several Media SDK API calls to test things out - knowing I still have more to add, but just wanting to add things to my project piecemeal.  This file compiles ok with no issues.  However during the linking stage, I am getting a bunch of linking errors indicating that it can't find the Media SDK function calls.  I have added the "libmfx.lib" to my Properties Pages for the Linker Input libraries and have provided the directory in the Linker General category of the Property Page.  I think this is all I am supposed to do for Visual Studio to find the library and use it.  Is there something else I am missing?  Please advise.

Thanks,
TIm

0 Kudos
Tim_S_
Beginner
2,015 Views

One more issue and don't know if this is related.  I went back to an older version of IPP 7.x and tried to build the sample_player and it also failed (i.e., BuildIPP7Problem.txt) with lots of linker problems as well - see attached file.  Is it possible that I don't have a particular environment variable setup properly?  And I don't see any library references to IPP libraries in the simple_player project which I assumed it would need to reference some of the IPP libraries in order to build ok.  Any ideas as to what may be the problem?

Thanks,
Tim

0 Kudos
Tim_S_
Beginner
2,015 Views

Dear Support:

I think I found the problem here.  It's due to my project being a Microsoft MFC application and it wants to use MFC as a shared DLL or as a static library and won't work when specifying to "Use Standard Windows Libraries".  I created another empty project where I could add this "Source.cpp" file that I had created and it built and worked fine as long as I chose "Use Standard Windows Libraries".  I also noticed that the sample_decoder that comes with the Media SDK is built this way as well using "Use Standard Windows Libraries".  So now my question is how do I get the Media SDK library "libmfx.lib" to build with an application that uses MFC in a static library or shared DLL?  Once I get this to build ok, I think I'm there.  Please help...

Thanks,
TIm

0 Kudos
Sravanthi_K_Intel
2,015 Views

Hi Tim,

I see that you have started a new thread https://software.intel.com/en-us/forums/topic/531800 on the above issue, and Surbhi is working with you on it as well. To avoid repetition, Surbhi will follow-up with you on your question about the build issue.

0 Kudos
Tim_S_
Beginner
2,015 Views

Hey Sravanthi K.

Thanks and will work with Surbhi on this - we can close out this forum post.  This is my last outstanding issue on getting this all to work - hopefully I can get this resolved soon.

Thanks,
Tim

0 Kudos
Reply