Search code examples
c++videodirectxrecorddxgi

DXGI AcquireNextFrame receives the next frame only after 20ms (50fps), is it possible to speed up to 10ms?


Good afternoon.

I'm writing a program that would record video from the desktop at 100 fps, but I ran into a problem, AcquireNextFrame receives the next image from the desktop only after 20 ms, because of this, the maximum fps that I can get will be 50, you can do something with this?

Thanks.


Solution

  • IDXGIOutputDuplication::AcquireNextFrame will receive nothing if nothing changes on the captured output.

    It's not like a "PleaseCaptureScreenNow" command.

    Timouts are expected and must taken into account. That's why you can't really design a workflow for example like capture => convert => copy/encode on just one unique thread.

    Microsoft official DXGIDesktopDuplication sample is designed with multiple threads for that reason.

    This method can perfectly capture at 100fps or more if the screen changes at that speed (and you have good GPU, drivers, etc.).