dxgi

DXGI Desktop Duplication: encoding frames to send them over the network

…衆ロ難τιáo~ 提交于 2019-12-03 09:59:08
问题 I'm trying to write an app which will capture a video stream of the screen and send it to a remote client. I've found out that the best way to capture a screen on Windows is to use DXGI Desktop Duplication API (available since Windows 8). Microsoft provides a neat sample which streams duplicated frames to screen. Now, I've been wondering what is the easiest, but still relatively fast way to encode those frames and send them over the network. The frames come from AcquireNextFrame with a

DXGI Desktop Duplication: encoding frames to send them over the network

为君一笑 提交于 2019-12-03 01:32:59
I'm trying to write an app which will capture a video stream of the screen and send it to a remote client. I've found out that the best way to capture a screen on Windows is to use DXGI Desktop Duplication API (available since Windows 8). Microsoft provides a neat sample which streams duplicated frames to screen. Now, I've been wondering what is the easiest, but still relatively fast way to encode those frames and send them over the network. The frames come from AcquireNextFrame with a surface that contains the desktop bitmap and metadata which contains dirty and move regions that were updated

MF SinkWriter Write Sample Failed

允我心安 提交于 2019-11-30 10:38:31
I'm trying to encode the ID3D11Texture2D to mp4 using MediaFoundation. Below is my current code. Initializing Sink Writer private int InitializeSinkWriter(String outputFile, int videoWidth, int videoHeight) { IMFMediaType mediaTypeIn = null; IMFMediaType mediaTypeOut = null; IMFAttributes attributes = null; int hr = 0; if (Succeeded(hr)) hr = (int)MFExtern.MFCreateAttributes(out attributes, 1); if (Succeeded(hr)) hr = (int)attributes.SetUINT32(MFAttributesClsid.MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS, 1); if (Succeeded(hr)) hr = (int)attributes.SetUINT32(MFAttributesClsid.MF_LOW_LATENCY, 1); /

Enumerating monitors on a computer

穿精又带淫゛_ 提交于 2019-11-29 20:09:10
I have found 7 different ways to enumerate the monitors attached to the computer. But all solutions give different results (number of the monitors and information on each monitor). These solutions are: Using the famous EnumDisplayDevices Using EnumDisplayMonitors Using the Windows Management Instrumentation (WMI) : With the following query: SELECT * FROM WmiMonitorID in the root\\WMI namespace. Again using the WMI : With the new query: SELECT * FROM Win32_DesktopMonitor in the root\\CIMV2 namespace. Using the Setup API : By first calling SetupDiGetClassDevs to retrieve the device information

MF SinkWriter Write Sample Failed

拥有回忆 提交于 2019-11-29 16:30:43
问题 I'm trying to encode the ID3D11Texture2D to mp4 using MediaFoundation. Below is my current code. Initializing Sink Writer private int InitializeSinkWriter(String outputFile, int videoWidth, int videoHeight) { IMFMediaType mediaTypeIn = null; IMFMediaType mediaTypeOut = null; IMFAttributes attributes = null; int hr = 0; if (Succeeded(hr)) hr = (int)MFExtern.MFCreateAttributes(out attributes, 1); if (Succeeded(hr)) hr = (int)attributes.SetUINT32(MFAttributesClsid.MF_READWRITE_ENABLE_HARDWARE

Enumerating monitors on a computer

99封情书 提交于 2019-11-28 15:58:05
问题 I have found 7 different ways to enumerate the monitors attached to the computer. But all solutions give different results (number of the monitors and information on each monitor). These solutions are: Using the famous EnumDisplayDevices Using EnumDisplayMonitors Using the Windows Management Instrumentation (WMI): With the following query: SELECT * FROM WmiMonitorID in the root\\WMI namespace. Again using the WMI: With the new query: SELECT * FROM Win32_DesktopMonitor in the root\\CIMV2

Desktop Duplication API & switchable graphics

老子叫甜甜 提交于 2019-11-27 03:41:08
问题 The problem : calling IDXGIOutput1::DuplicateOutput method returns DXGI_ERROR_UNSUPPORTED when you run an application using discrete graphics controller on a machine with switchable graphics. This answer shed some light on the issue. In short, the discrete graphics renders only a part of the screen and sends the data to the framebuffer of the intergrated graphics controller -- in other words all output always goes through the integrated graphics controller. It seems that this is why