C # Record video

This is a use of C # language production record framework that supports the recorded desktop, multi-screen interface, sound, camera, an application

 

1. Install

Using this framework to install extension package Kogel.Record , you can search Nuget

Or use the command Nuget

Install-Package Kogel.Record -Version 1.0.4

After the installation is complete there will be a package DLL file folder, there will be some dependent DLL

 

 

 After right-click to select all - property, set the Copy to Output Directory - Always copy

 

 

 

2. Definitions

It requires the application of the main entry point to initialize the global configuration

// initialize the DLL configuration 
Global.InitDllPath ();

 

 

 

3. Record the desktop

Use ScreenRecorder class

First create a desktop recording class object

// video storage path 
String recorderPath + = AppDomain.CurrentDomain.BaseDirectory DateTime.Now.ToString ( " MMddHHmmss " ) + " .mp4 " ;
 // initializes the recorder (the first parameter is the path, the second parameter is the number of frames The third parameter is whether to record sound) 
var Recorder = new new the ScreenRecorder (recorderPath, 10 , to true );

Start recording

// Start display set and 
recorder.Start (VideoStreamer_NewFrame);

End recording

recorder.End();

 

The first time you use this framework VS may pop up warning

 

 Select "except when triggered from the following location" on the line, this follow-up will not happen again

 

 

 

This framework also supports recording your desktop, multi-screen interface, sound, camera, a program of

Open source framework, complete Demo can go to download on Github:

https://github.com/a935368322/Kogel.Record.Test.git

If you have questions you can also add QQ group discussion:

Technology Group 710 217 654

Guess you like

Origin www.cnblogs.com/kogel/p/12166398.html