OBS software is free, open source video recording and editing software. It is open source, cross platform (Windows, Mac, Linux) can record video, and stream everything that happens on your computer screen.
It is written in C and C++, and uses all known and unknown streaming services of our time: Twitch.tv, Youtube/Youtube Gaming, hitbox, beam.pro, Daily Motion, Livecoding.tv, Web.Tv, and many others still.
Of course, it can also be used to record on video what is happening on your computer screen, even if you are playing a game.
It takes advantage of DirectX 11 but you can also configure it for OpenGL. For video encoding, it uses, among others, codec capabilities such as x264 free software library, Intel Quick Sync Video and Nvidia NVENC to create video streams in H.264/MPEG-4 AVC format, offering the best possible ratio between the size of file and quality.
Download the application on the platform you are interested in