# Inner workings of desktop video capture



## bernardolk (Sep 4, 2018)

Hello there.

I am interested in streaming technology in general and i want to understand how OBS software is even possible. How does the software fetches rendered frames from the computer to then encode them in the first place? I find this topic interesting, but did not found anything related in the forums.
Where in the source code can i find the module for the screen capture functionality per se? (If this does even make any sense)
With this i mean the low level, c++ gpu frame fetching routine, or something more technically correct.
Thanks a lot.


----------



## dodgepong (Sep 23, 2018)

On Windows, OBS uses the Windows API to capture individual Windows as well as the whole desktop. For game capture, it uses D3D shared textures to capture frames from the game directly on the GPU.


----------



## bernardolk (Sep 23, 2018)

Cool, thanks for your answer dodgepong!
Do you know where i could find this particular Windows API documentation or even OBS documentation regarding the utilization of this Windows API/ Direct3D inside the source code so i could analyze it on my own?
I feel a little overwhelmed by the amount oc .ccp files inside the project.
Thanks.


----------



## dodgepong (Sep 24, 2018)

Everything related to capturing things on Windows are found here: https://github.com/obsproject/obs-studio/tree/master/plugins/win-capture


----------

