Vahid Rassouli
Vahid Rassouli

Reputation: 296

Using video codecs like XVid in c#

I'm trying to develop an application which captures a series of images from web cam using DirectShow.Net and then sends it over network to other clients. Everything is working fine, except the images are too big and compression methods like using GZipStream, JPEG Compression and etc does not help more about reducing the size.

Now, I want to know how to using codecs like XVid or any other codec, to reduce the size. Playing around the demos of VisioForge, it approves that XVid files are too smaller than regular AVI files.

Thanks for any help

Upvotes: 3

Views: 6193

Answers (1)

Roman Ryltsov
Roman Ryltsov

Reputation: 69662

There are specific video compression algorithms, which effectively compress video, some of the most popular are: M-JPEG, MPEG-4, H.261, H.263, H.264, VP8, Theora. In DirectShow the video compression items have form-factor of video compression filters (or codecs). Standard Windows does not normally include much for this task (for various reasons, patents to specifically mention), so you need to use a third party or otherwise installable codec. Luckily, the codecs have more or less uniform interface and you use them similarly from C#.

See related questions with helpful information:

Be sure to check DirectShow.NET samples out:

\Samples\Misc\DxWebCam

A poor man's web cam program. This application runs as a Win32 Service. It takes the output of a capture graph, turns it into a stream of JPEG files, and sends it thru TCP/IP to a client application.

\Samples\Capture\CapWMV

A .NET sample application using the WM ASF Writer filter to create an wmv file

Upvotes: 3

Related Questions