I am trying to create a code that takes series of screenshot of a game, use Open-CV to edit it, and display it in a window, all in real-time. I am using windows operating system. For taking screenshots I have tried almost all the methods answered in this question. None of them gives FPS of more than 30, but do affect the performance of the game.
I found out that for games OBS Studio uses a different method called D3d shared texture to capture frames from the game directly on the GPU..
I searched for shared texture in OBS github code but I find the results confusing. Searching on search engine does not give relevant results.
Can someone explain what is this shared texture method and how do I implement it in my code?