I\'m capturing the desktop using DesktopDuplication API and converting the samples from RGBA to NV12 in GPU and feeding the same to MediaFoundation hardware H264 MFT. This w
As mentioned in the post, the error MEError ("Unspecified error") was returned by Transform's Event generator immediately after feeding the first input sample on Intel hardware, and, further calls just returned "Transform Need more input", but no output was produced. The same code worked fine on Nvidia machines though. After experimenting and researching a lot, I figured out that I was creating too many instances of D3d11Device, In my case, I created 2 to 3 devices for Capturing, color conversion, and Hardware encoder respectively. Whereas, I could simply have reused a single D3dDevice instance. Creating multiple D3d11Device instances might work on high-end machines though. This is not documented anywhere. I was unable to find even a clue for the causes of the "MEError" error. It's mentioned nowhere. There were many StackOverflow threads similar to this kept unanswered, even Microsoft people were unable to point out the problem, given the complete source code.
Reusing the D3D11Device instance solved the problem. Posting this solution as it might be helpful for people who face the same issue as mine.
I looked at your code.
According to your post, i suspect an Intel video processor problem.
My OS is Win7, so i decide to test the video processor behaviour with a D3D9Device on my Nvidia card, and then on an Intel HD Graphics 4000.
I suppose the video processor capabilities will behave the same way for a D3D9Device as for a D3D11Device. Of course it will be necessary to check.
So i made this program to check : https://github.com/mofo7777/DirectXVideoScreen (see D3D9VideoProcessor sub-project)
It seems you do not check sufficient things about the video processor capabilities.
With IDXVAHD_Device::GetVideoProcessorDeviceCaps, here is what i check :
DXVAHD_VPDEVCAPS.MaxInputStreams > 0
DXVAHD_VPDEVCAPS.VideoProcessorCount > 0
DXVAHD_VPDEVCAPS.OutputFormatCount > 0
DXVAHD_VPDEVCAPS.InputFormatCount > 0
DXVAHD_VPDEVCAPS.InputPool == D3DPOOL_DEFAULT
I also check input and output format supported with IDXVAHD_Device::GetVideoProcessorOutputFormats and IDXVAHD_Device::GetVideoProcessorInputFormats.
This is where i found a difference between Nvidia GPU and Intel GPU.
NVIDIA : 4 output format
INTEL : 3 output format
On Intel HD Graphics 4000, there is no support for the NV12 output format.
Also for the program to work correctly, i need to setup stream state before using VideoProcessBltHD :
For D3D11 :
ID3D11VideoProcessorEnumerator::GetVideoProcessorCaps == IDXVAHD_Device::GetVideoProcessorDeviceCaps
(D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT) ID3D11VideoProcessorEnumerator::CheckVideoProcessorFormat == IDXVAHD_Device::GetVideoProcessorOutputFormats
(D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT) ID3D11VideoProcessorEnumerator::CheckVideoProcessorFormat == IDXVAHD_Device::GetVideoProcessorInputFormats
ID3D11VideoContext::(...) == IDXVAHD_VideoProcessor::SetVideoProcessStreamState
Could you first verify the video processor capabilities of your GPU. Do you see same difference as i see ?
This is the first thing we need to know, and it seems your program does not check this, from what i've seen on your github project.