Exemplo n.º 1
0
        private void _startCaptureInternal(GraphicsCaptureItem item)
        {
            _captureVideoFilePath = System.IO.Path.Combine(_captureFolder.Path, "ouput.wmv");

            _mediaEncoder.OpenVideoWriter(_captureVideoFilePath, item.Size.Width, item.Size.Height);

            _framePool = Direct3D11CaptureFramePool.Create(CanvasDevice.GetSharedDevice(), DirectXPixelFormat.B8G8R8A8UIntNormalized, 1, item.Size);
            _seesion   = _framePool.CreateCaptureSession(item);
            _seesion.StartCapture();
            _capturing = true;

            QueryPerformanceCounter(out long counter);
            _startTime = TimeSpan.FromTicks(counter);
            Task.Run(_onFrameArraved);
        }