a screen recording Windows application based on Nvidia's NvCodec and D3D11 API. The code illustrates a GPU-based realtime pipeline that generates stream of screenshots as ID3D11Texture2D textures and uses them on the fly as an raw frame input to NvCodec H264-encoder .
Prior to this implementation, another Windows-based but much less efficient version of the screen recorder was developed
- project has been saved with VS2017, the Direct X SDK should be installed
- minumum software & hardware requirements are as reported in NVIDIA's "video-sdk-samples" README
The solution is built on top of this application from NVIDIA's "video-sdk-samples". Specifically, the solution implements the producer-consumer pattern along with a thread-safe Queue implementation to manage the screen frames. About command line usage:
- the Nvidia's utils function for command line parsing is modified to accept -dur argument (duration in seconds)
- to explore the typical video encoding options you can call it with -h
to the research done by Diederickh for Windows based high-performance GPU frame-capturing using IDXGIOutputDuplication in this repository
- omit the fixed duration argument and implement record stopping functionality by capturing specific keys
- integrate some piece of code for transcoding the raw .h264 into a container format (mp4/mkv)
- move the frame-writing out of the encoder loop in the Consumer function