DXGICaptureSample icon indicating copy to clipboard operation
DXGICaptureSample copied to clipboard

Can't capture fullscreen program on windows 8.1

Open ubershy opened this issue 7 years ago • 3 comments

Hi. Thank you for your work.

I'm trying to capture a DirectX game running in fullscreen mode.

I set capture source to monitor 1: g_DXGIManager.SetCaptureSource(CSMonitor1);

I use timeout in command line to be able to switch to the fullscreen game before the program starts: timeout 10 & DXGICaptureSample.exe

On Windows 10 the program is able to get a screenshot of the game. On Windows 8.1 it fails, the console output says display size is 0x0 (which should be 1920x1080).

Do you know a way to make it work for fullscreen applications under Windows 8.1?

ubershy avatar Sep 18 '17 12:09 ubershy

Hi,

All APIs should be supported under Windows 8.1, your case does not ring the bell. The only way to go is try to debug what's going on. First few questions that came up into my mind are:

  1. what's in the log?
  2. have you tried to set capture source to CSDesktop? Or you are specifically capturing Monitor1?
  3. check monitor configuration - is CSMonitor1 really the right monitor? What rect do you have if capturing from CSMonitor2?

pgurenko avatar Sep 19 '17 02:09 pgurenko

I'm sorry for my late answer. This is my test environment:

  1. Windows 8.1 OS.
  2. 1600x900 monitor on the left. It is seen in Windows "Screen Resolution" panel as "Display 2". This is "CSMonitor2" in DXGICaptureSample's code. This is "DeviceName=\.\DISPLAY1" in DXGICaptureSample's log.
  3. 1920x1080 monitor on the right. It is seen in Windows "Screen Resolution" panel as "Display 1". This is "CSMonitor1" in DXGICaptureSample's code. This is "DeviceName=\.\DISPLAY2" in DXGICaptureSample's log. I run fullscreen game on this display.

Answering your questions:

  1. Console, log, and file outputs: here
  2. I have tried to set capture source to CSDesktop. It works fine and captures image from both monitors. But when there is a fullscreen game running on my "CSMonitor1", it ignores this monitor, producing a capture.bmp of just "CSMonitor2". This can be seen in logs.
  3. Yes, CSMonitor1 is the one with fullscreen game I try to capture with 1920x1080 resolution. The rect of CSMonitor2 is "DesktopCoordinates={(-1600,0),(0,900)}". This can be seen in logs.

ubershy avatar Oct 03 '17 07:10 ubershy

Thank you for so thorough logs. I think, this call is failing hr = spDXGIOutput1->DuplicateOutput(spDXGIDevice, &spDXGIOutputDuplication); and there was no log for it yet. Could you pull the latest code and see what hr it puts in the log?

pgurenko avatar Oct 04 '17 04:10 pgurenko