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.

MFX_ERR_NOT_INITIALIZED

lonely_hearts_club
1,405 Views

Hi,

The RunEncode() function returned MFX_ERR_NOT_INITIALIZED when I tried to encode a video stream using the h264_enc_filter.

My Graph snapshot is uploaded, named as  capturegraph.png

It was the function EncodeFrameAsync() that returned MFX_ERR_NOT_INITIALIZED.

The video capture source has a resolution of 1280*720@50frame/s and the color format is YUY2.

The graph can be run by inserting a AVI Decompressor between Infinite Pin Tee and H264 Encoder, the AVI Decompressor actually changed the color format from YUY2 to RGB32.

What was going wrong with my graph?

0 Kudos
9 Replies
Anthony_P_Intel
Employee
1,405 Views
Hi, I believe I've reproduced the same issue and I'm investigating. -Tony
0 Kudos
lonely_hearts_club
1,405 Views
Tony Pabon (Intel) wrote:

Hi,
I believe I've reproduced the same issue and I'm investigating.

-Tony

Hi,Tony I had recalled a piece of important information that I didn’t think of before. Due to my own need, I had cancelled if(nMin > (mfxU32)props.cBuffers) { hr = E_FAIL; } in CEncoderInputPin::NotifyAllocator() method.(My post with this issue: http://software.intel.com/en-us/forums/topic/339247) This works fine with my webcam. But the video source was replaced by a hd video capture card this time(as you can see in capturegraph.png). Today, I rebuilt the filter by bringing the buffer number judgment statement back to the NotifyAllocator() method. Now graphedit automatically inserts a AVI Compressor everytime I tried to connect Infinite_Pin_Tee_Filter to h264_enc_filter . I think this implied that Infinite_Pin_Tee_Filter and h264_enc_filter failed to make an agreement(mMin>cBuffers) on the allocator. This is why on yesterday I could directly connect Infinite_Pin_Tee_Filter to h264_enc_filter but the encoder returned an error in runtime. How can I modify the Infinite_Pin_Tee_Filter to collaborate with h264_enc_filter directly and perfectly?(Fortunately, Mircosoft provides the sample code for the infinite_pin_tee in Windows SDK. ).I don't want the existance of AVI Decompressor because it takes a great CPU load. Many thanks. -Patrick
0 Kudos
Anthony_P_Intel
Employee
1,405 Views
Hi Patrick, This would explain some of the behavior I was seeing too. I see others have seen this issue as well (http://software.intel.com/en-us/forums/topic/311877). I suspect the Infinite_Pin_Tee_Filter could be modified to require more cBuffers from the source filter, but I am not familiar with that code. -Tony
0 Kudos
lonely_hearts_club
1,405 Views
Tony Pabon (Intel) wrote:

Hi Patrick,

This would explain some of the behavior I was seeing too. I see others have seen this issue as well (http://software.intel.com/en-us/forums/topic/311877). I suspect the Infinite_Pin_Tee_Filter could be modified to require more cBuffers from the source filter, but I am not familiar with that code.

-Tony

Hi,Tony I had just roughly gone through the infinite_pin_tee source code and discovered that it has overloaded the DecideAllocator() method and it assigned the allocator to the one from the upstream. I will upgrade this post if I make any progress. Thank you. -Patrick
0 Kudos
lonely_hearts_club
1,405 Views
Tony Pabon (Intel) wrote:

Hi Patrick,

This would explain some of the behavior I was seeing too. I see others have seen this issue as well (http://software.intel.com/en-us/forums/topic/311877). I suspect the Infinite_Pin_Tee_Filter could be modified to require more cBuffers from the source filter, but I am not familiar with that code.

-Tony

Hi, I have modified the inifinite pin tee filter to require more buffers in the following code: STDMETHODIMP CTeeInputPin::NotifyAllocator(IMemAllocator *pAllocator, BOOL bReadOnly) { CheckPointer(pAllocator,E_FAIL); CAutoLock lock_it(m_pLock); // Free the old allocator if any if (m_pTee->m_pAllocator) m_pTee->m_pAllocator->Release(); // Store away the new allocator pAllocator->AddRef(); m_pTee->m_pAllocator = pAllocator; //Require 10 buffers ALLOCATOR_PROPERTIES props; pAllocator->GetProperties(&props); props.cBuffers = 10; ALLOCATOR_PROPERTIES actual; pAllocator->SetProperties(&props,&actual); // Notify the base class about the allocator return CBaseInputPin::NotifyAllocator(pAllocator,bReadOnly); } // NotifyAllocator The MFX_ERR_NOT_INITIALIZED error still occurs after the graph starts. (EncodeFrameAsync returns MFX_ERROR_NONE for several times before it returns MFX_ERR_NOT_INITIALIZED). It seems that the samples have not been released in the CBaseEncoder::DeliverNextFrame() method. The running code has not stepped into the sample release statements before the error is thrown. if (!jt->pmfxSurface->Data.Locked) { MSDK_SAFE_DELETE(jt->pmfxSurface); jt->pSample->Release();//has not been executed before MFX_ERR_NOT_INITIALIZED error pEncoder->m_InputList.erase(jt); break; } I’ve uploaded the inftee project files for you to investigate my problem. What else should I do to the inftee filter? Thanks. -Patrick
0 Kudos
Eric_S_Intel
Employee
1,405 Views
Hi Patrick, Thanks for your patience, I did get a chance to look at this today. Simply modifying props.cBuffers to align with the number returned from GetRequiredFramesNum() in CEncoderInputPin::NotifyAllocator() made the connection succeed without the need for the AVI Decompressor. Using my MS LifeCamera the buffers needed were 12. I didn’t see any issues with MFX_ERR_NOT_INITIALIZED. In fact, the same graph’s been running for over an hour now. So, that probably means you are hitting an existing issue with either the graphics driver, MSDK lib, or version of the DShow filter. I am using the “latest” – which you don’t have. Can you update your graphics driver, and report back the versions of each component you are using? Then we can sort out what to update on your side. Thanks -Eric
0 Kudos
lonely_hearts_club
1,405 Views
Sorry,Eric,I've been busying preparing for exams recently. I will be free next week.;) Please wait. Thanks!! -Patrick
0 Kudos
lonely_hearts_club
1,405 Views
Hi Eric, Sorry for keep you waiting so long. My MSDK version is 3.0.774.38156. Driver version is 8.15.10.2696. And my CPU is i5-3570K. Actually the MFX_ERR_NOT_INITIALIZED problem only occur when the capture source is "Analog Xbar+PCIe HD Caputre Device"(with 720p,50 frames/second).Using webcams like MS HD-5000,MS Lifecam Cinema,Logitech C525(I've all tried,under 720P,30frames/second) does not have such kind of problem. -Patrick
0 Kudos
lonely_hearts_club
1,405 Views
Hi Eric, I found out that I had made a mistake in setting cbAlign and cbBuffer. Now the graph works most of the time. I will carefully re-check my modification part to the infinite_tee_pin. I will report here if I get any progress. Thank you!! -Patrick
0 Kudos
Reply