title: compress avi video with c#
body: <p>I have an AVI file that I would like to compress.</p>
  
  <p>I have tried using <a href="http://www.codeproject.com/Articles/7388/A-Simple-C-Wrapper-for-the-AviFile-Library" rel="nofollow">Simple C# Wrapper for the AviFile Library</a> but it was problematic because of 2 reasons:</p>
  
  <ul>
  <li>while compression, the infrastructure pops up a form window to choose a compression method, and I can't chooce the compression method by code</li>
  <li>The compression makes the audio disappear</li>
  </ul>
  
  <p>Here is my code:</p>
  
  <pre><code>        AviManager aviManager = new AviManager(aviFilePath, true);
          VideoStream aviStream = aviManager.GetVideoStream();
  
          VideoStream newStream;
          AviManager newManager = aviStream.DecompressToNewFile(compressedAviPath, true, out newStream);
  
          aviManager.Close();
          //save and close un-/re-compressed file
          newManager.Close();
  </code></pre>
  
  <p>Do you have any idea how I can:</p>
  
  <ol>
  <li>Fix those problems</li>
  <li>Use another library that can compress AVI videos</li>
  </ol>
  
  <p>Thanks,
  Guy.</p>