VideoCap Pro SDK ActiveX

VideoCap Pro SDK ActiveX

Platform : Windows 10, Windows 8, Vista, Windows 7, XP

For Windows Developers who need to view IP Camera, add video capture with overlay text, image, chroma key effect, face detection, motion detection with C++ , C#, VB.NET , VB, Delphi, Vfp, Ms Access, Labview.

Popular Solution Go   Back

C# - How to Record WebCam Video in MP4 with hardware GPU acceleration

Step 1: To install the VideoCap Pro ActiveX Control, begin by launching the setup file (videocapprosetup.exe). Select the desired installation folder for the VideoCap Pro ActiveX and continue with the installation on your development computer.

Step 2: Create New Visual C# Project, select Windows Application. 

 Step 3: The next step is to install VideoCap Pro ActiveX in ToolBox. Select Toolbox, select Components item, right click mouse button, select Choose Items...
 
Step 4: Select COM Components tab, select VideoCap Pro ActiveX Control , click OK.
 

Step 5: Now you will see the VideoCap Pro ActiveX's icon on toolbox, drag it to form. 
 
 Step 6: Design the UI same as following


 
 Step 7: If your computer have Intel GPU, you may set Mp4GPUCodec =3  you must set CaptureMode = true, UseMp4EncoderPlugin = true and set the MP4 video/audio bitrate, resolution before call Start method.

 The main code as the following:

 axVideoCap1.UseMp4EncoderPlugin = true;
 axVideoCap1.Mp4Videobitrate = Convert.ToInt32(txtmp4videobitrate.Text);
 axVideoCap1.Mp4Audiobitrate = Convert.ToInt32(txtmp4audiobitrate.Text);
 axVideoCap1.Mp4AudioSamplerate = Convert.ToInt32(cboaudiosamplerate.Text);
 axVideoCap1.Mp4Audiochannel = (short)Convert.ToInt32(txtaudiochannels.Text);
 axVideoCap1.Mp4Width = (short)Convert.ToInt32(txtmp4width.Text);
 axVideoCap1.Mp4Height = (short)Convert.ToInt32(txtmp4height.Text);
 axVideoCap1.Mp4GPUCodec =3; 
 axVideoCap1.CaptureMode = true;
 axVideoCap1.CaptureFileName = this.saveFileDialog1.FileName;
 short result = axVideoCap1.Start();


  Step 8: If you use high-end NVIDIA graphics card and install the latest NVIDIA graphics card driver. You may set Mp4GPUCodec  =1 and Mp4NVIDAPreset = 3. It will get good performance. 


 The main code as the following:

 axVideoCap1.UseMp4EncoderPlugin = true;
 axVideoCap1.Mp4Videobitrate = Convert.ToInt32(txtmp4videobitrate.Text);
 axVideoCap1.Mp4Audiobitrate = Convert.ToInt32(txtmp4audiobitrate.Text);
 axVideoCap1.Mp4AudioSamplerate = Convert.ToInt32(cboaudiosamplerate.Text);
 axVideoCap1.Mp4Audiochannel = (short)Convert.ToInt32(txtaudiochannels.Text);
 axVideoCap1.Mp4Width = (short)Convert.ToInt32(txtmp4width.Text);
 axVideoCap1.Mp4Height = (short)Convert.ToInt32(txtmp4height.Text);
 axVideoCap1.Mp4GPUCodec =1
 axVideoCap1.Mp4NVIDAPreset = 3; 
 axVideoCap1.CaptureMode = true;
 axVideoCap1.CaptureFileName = this.saveFileDialog1.FileName;
 short result = axVideoCap1.Start();

Finally if you do not know the user computer whether installed GPU. You may call Mp4DetectGPU method, it will return the following value .

0 - No GPU found.
1 - NVIDA
2 - AMD
3 - Intel