Home > Uncategorized > Compress an AVI movie using C#

Compress an AVI movie using C#

I was looking for a way to compress an AVI file down without loosing quality, and to do so programatically, in C#. All I found on the web, were commercial components. However, I just found out you can use QuickTime in C#, to compress the files down in size.
 

private bool ConvertToQuickTime(AxQTOControlLib.AxQTControl Control,string fromFileName,string toFileName)

{

this.axQTControl1.URL = fromFileName;

if (!axQTControl1.Movie.CanExport) return false;

QTOLibrary.QTQuickTime qt;

qt = axQTControl1.QuickTime;

if (qt.Exporters.Count == 0) qt.Exporters.Add();

QTOLibrary.QTExporter exp;

exp = qt.Exporters[1];

// Set exporter type: AVI, 3G, MPEG-4, PNG, etc.

exp.TypeName = "QuickTime Movie";

exp.SetDataSource(axQTControl1.Movie);

exp.DestinationFileName = toFileName;

exp.ShowProgressDialog =

true;

exp.BeginExport();

return true;

}

Categories: Uncategorized
  1. Janey
    May 15, 2017 at 7:13 am

    Avdshare Video Converter also works great in compresss AVI, MKV, AVCHD, MOV, MPG, MP3, WAV etc video and audio file size

    Like

  1. No trackbacks yet.

Leave a comment