1

I’m developing an application, which allows to record video from web camera. (using visual studio 2008, c#)

The required compress ratio is approximately 10 secs = 1 mb. I found the only one, that suits this: the one from DivX Codec Pack, but it seems to be not free. Or, may be, not, I’m not sure: it installs via DivXInstaller, which downloads many garbage, that I don’t need, and at DivX Control Panel there is a label: DivX Codec, trial, 15 days left. And this label isn’t changing for more than two weeks…

The other good alternative is VP40® Compressor. Compress ratio is about 1 sec to 1 mb. But it has some strange problems with Windows XP, and I cannot understand yet, what’s wrong with it.

There are the questions I have now:

  1. Is there a good installer for DivX Codec Pack, which will install only this pack, without adding 200 mb weight garbage?
  2. Are there other good video compressors, compatible with DirectShow? The ones, that I have by default (like Microsoft Video 1, DV Video Encoder, etc.) either have bad compress ration, or have a terribly bad recorded video quality.
  3. Well, of course, a free compressor is preferred.

P.S. Sorry for my bad English.

A piece of code:

    // the part of method to record video

capture = new Capture(filters.VideoInputDevices[VCB.SelectedIndex], filters.AudioInputDevices[ACB.SelectedIndex]);
    // VCB & ACB are the combobox for video & audio capture devices
capture.VideoCompressor = filters.VideoCompressors[CCB.SelectedIndex];
    // that's the video compressor, that is used
    //and then:
    try
                    {
                        capture.PreviewWindow = panelVideo;
                        Log.CreateLogFiles("Video panel initialized");
                    }
                    catch (Exception ex) { Log.CreateLogFiles(ex); }
                    capture.Filename = "Somestring";
                    capture.Start();
Olter
  • 1,129
  • 1
  • 21
  • 40
  • Are you capturing image sequences? Or what do you get from your webcam? – Matthias Dec 27 '11 at 06:51
  • Matthias Koch, as I understand, the output from webcam is a video stream. – Olter Dec 27 '11 at 07:03
  • Sorry, I have to ask again. Do you first create a video file, and then want to compress it? – Matthias Dec 27 '11 at 07:09
  • Well, sure I'm not an expert at DirectShow, but, here's the code. Oops, how should I add some code? Better to edit the main question. – Olter Dec 27 '11 at 07:14
  • Yes :) In case you have it from a website, you can also provide the url. – Matthias Dec 27 '11 at 07:18
  • No, that's a real time compression. I found a similar question here: [link](http://stackoverflow.com/questions/6678548/appropriate-codec-for-real-time-video-compression-with-directshow) but those answers are not good enough for me. (( – Olter Dec 27 '11 at 08:00

2 Answers2

2

You can consider using Windows Media format, if Windows-only solution is sufficient. There may be Mac support though. Adding WM ASF Writer Filter to DirectShow filter graph will render the output to a Windows Media file. The bitrate/quality is specified via built-in or user-defined profiles.

Windows Media Encoder from Windows Media Encoder 9 Series SDK is a UI tool that can be used to fine-tune the compression parameters, check the quality visually etc.

Dmitry Shkuropatsky
  • 3,902
  • 2
  • 21
  • 13
1

Have you tried xvid?

From wikipedia:

Xvid is a primary competitor of the DivX Pro Codec. In contrast with the DivX codec, which is proprietary software developed by DivX, Inc., Xvid is free software distributed under the terms of the GNU General Public License

yms
  • 10,361
  • 3
  • 38
  • 68