polewsingles.blogg.se

Screen capturing
Screen capturing












screen capturing screen capturing

Direct3D APIs are used to perform this copy operation quickly.Īs stated above, the copying of each captured frame is probably the most complex part of the implementation shown in this article. Copying frames - Frames are copied from the capture frame buffer into a separate Direct3D surface that can be passed to the MediaStreamSource so that the resource isn't overwritten while being encoded.Synchronization is important to allow frames to be captured and encoded simultaneously. This example uses events to coordinate the requests for new frames between the different components of the example. Event handlers and threading - The primary driver of the main capture loop is the MediaStreamSource which requests frames periodically through the SampleRequested event.Initialization - This includes configuring the UWP classes described above, initializing the graphics device interfaces, picking a window to capture, and setting up the encoding parameters such as resolution and frame rate.The example code shown in this article can be categorized into a few different tasks: The MediaTranscoder class receives the stream produced by the MediaStreamSource and encodes it into a video file.The MediaStreamSource class receives the captured frames and generates a video stream.The Direct3D11CaptureFramePool class maintains a buffer of frames into which the screen contents are copied.

screen capturing

GraphicsCaptureSession is used to start and stop the capture operation. The GraphicsCaptureItem class represents the window or display being captured. The Windows.GraphicsCapture APIs do the work of actually grabbing the pixels from the screen.The screen capture process uses three primary UWP features: While it may seem like there is a lot of code required to implement this scenario, the high-level structure of a screen recorder app is fairly simple. This article provides a walkthrough of an example app that records the contents of a window to a video file. For a simple end-to-end sample app that utilizes the concepts and techniques shown in this article, see SimpleRecorder. For information on screen capturing still images, see Screen capture. This article describes how to encode frames captured from the screen with the APIs to a video file.














Screen capturing