DesktopDuplication | Useful for using a mobile device | Runtime Evironment library
kandi X-RAY | DesktopDuplication Summary
kandi X-RAY | DesktopDuplication Summary
A tool for mirroring a virtual screen to a window. Useful for using a mobile device as an external screen.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of DesktopDuplication
DesktopDuplication Key Features
DesktopDuplication Examples and Code Snippets
Community Discussions
Trending Discussions on DesktopDuplication
QUESTION
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 works fine with Nvidia graphics, and also with software encoders but fails when only intel graphics hardware MFT is available. The code works fine on the same intel graphics machine if I fallback to Software MFT. I also have ensured that the encoding is actually done in hardware on Nvidia graphics machines.
On Intel graphics, MFT returns MEError ("Unspecified error"), which happens just only after the first sample is fed, and subsequent calls to ProcessInput (when event generator triggers METransformNeedInput) returns "The callee is currently not accepting further input". It's rare that MFT consumes a few more samples before returning these errors. This behavior is confusing, I'm feeding a sample only when the event generator triggers METransformNeedInput asynchronously through IMFAsyncCallback, and also checking properly whether METransformHaveOutput is triggered as soon as a sample is fed. This really baffles me when the same asynchronous logic works fine with Nvidia hardware MFT & Microsoft software encoders.
There is also a similar unresolved question in the intel forum itself. My code is similar to the one mentioned in the intel thread, except for the fact that I'm also setting d3d device manager to the encoder like below.
And, there are three other stack overflow threads reporting a similar issue with no solution given (MFTransform encoder->ProcessInput returns E_FAIL & How to create IMFSample from D11 texture for Intel MFT encoder & Asynchronous MFT is not sending MFTransformHaveOutput Event(Intel Hardware MJPEG Decoder MFT)). I have tried every possible option with no improvement on this.
Color converter code is taken from intel media sdk samples. I have also uploaded my complete code here.
Method to set d3d manager:
...ANSWER
Answered 2019-Nov-13 at 21:50I 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
- D3DFMT_A8R8G8B8
- D3DFMT_X8R8G8B8
- D3DFMT_YUY2
- D3DFMT_NV12
INTEL : 3 output format
- D3DFMT_A8R8G8B8
- D3DFMT_X8R8G8B8
- D3DFMT_YUY2
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 :
- DXVAHD_STREAM_STATE_D3DFORMAT
- DXVAHD_STREAM_STATE_FRAME_FORMAT
- DXVAHD_STREAM_STATE_INPUT_COLOR_SPACE
- DXVAHD_STREAM_STATE_SOURCE_RECT
- DXVAHD_STREAM_STATE_DESTINATION_RECT
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.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install DesktopDuplication
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page