CSWebCam
Capture WebCam to Video Files with C# VB .NET.
.NET library to display and to capture local (USB) and online (URL) camera to video files with C# and VB .NET Framework and .NET Core.
Table of contents:
Benefits
Example
Instructions
Related Links
Table of contents:
About The CSCamera is a .NET library that allows developers to display and to capture local camera (such a USB or webcam) to many types of video files, such as AVI, MP4, MPEG, FLV, VOB, WMV etc.. easily, with C# VB .NET.
Benefits
- .NET library (standard) for .NET Framework and .NET Core.
- Display camera activities in your program.
- USB / Webcam / URL camera.
- Based on the FFmpeg libraries (LGPL).
- Capture the camera to many types of video files:
- AVI
- FLV
- MOV
- MP4
- MPEG
- MKV
- MTS
- VOB
- WEBM
- WMV
- and more 60+ video (and audio) formats.
- Display a preview.
- Get all the installed camera devices.
- Get all the installed audio devices.
- Capture / Stop / Pause / Resume.
- High quality results.
- For WPF / Winform / Console Apps.
- Many relevant events.
- Built in threads handling.
- Safe exit.
- Easy to use.
- For C# / VB / ASP .NET.
- C# / VB .NET well documented examples.
- Cut your developing time up to 80%.
- Just import the library to your program and start to work immediately.
- The source code of this component is also available.
- Can be use in a FREE and commercial products.
Example
Here is a snap example of using the CSWebCam in order save the camera activity to video file using C#:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Set the video format | |
_Camera.VideoResolutionX = txtVideoResolutionX.Text; | |
_Camera.VideoResolutionY = txtVideoResolutionY.Text; | |
//Set the FPS | |
_Camera.VideoFPS = "30"; | |
//Set the buffer size | |
_Camera.BufferSize = "100MB"; | |
//In the MS camera I had to add this | |
//in order to display the camera | |
_Camera.DispWinPixFmt = "yuv420p"; | |
//Set more properties of the | |
//destination video | |
//_Camera.VideoBitrate = "316k"; | |
//_Camera.VideoCodec = "..."; | |
//Audio: | |
//_Camera.AudioCodec = "..."; | |
//_Camera.AudioBitrate = "128k"; | |
//_Camera.AudioSamplerate = "44100"; | |
//_Camera.AudioChannels = "2"; | |
//Set the ID3 Tags | |
ID3Tags iD3Tags = new ID3Tags(); | |
iD3Tags.Title = "Title"; | |
iD3Tags.Comment = "Comment"; | |
iD3Tags.Album = "Album"; | |
iD3Tags.Artist = "Artist"; | |
iD3Tags.Date = "2020"; | |
_Camera.SetID3Tags(iD3Tags); | |
//Set the preview | |
_Camera.SetPicView(cameraPreviewWF1.Preview); | |
//Open the device and save the results to a media file | |
_Camera.OpenDevice(cboCamDevices.Text, cboAudioDevices.Text, saveFileDialog1.FileName); |
Instructions
- Download the CSWebCam to your machine.
- Extract the compressed file (with 7-zip).
- Open the CSWebCam.sln with Visual Studio.
FREE Download SDK
The CSWebCam is available for FREE for learning or for FREE purposes, for commercial or any other use please order a license.
Order a license here
Order a license here
- You can distribute the library with commercial products.
- You will get your own UserName and UserKey.
- The price is one-time-fee of $89 and it contains an online support.
- The source code of the library is also available under MS-PL license.
- We are using the MyCommerce® services in order to handle with the registration process.
Related Links

Written with
Visual Studio 2022
AI Here
Great integration with Github Copilot AI.

Great integration with Github Copilot AI.