Guy Dubrovski
Guy Dubrovski

Reputation: 1560

compress avi video with c#

I have an AVI file that I would like to compress.

I have tried using Simple C# Wrapper for the AviFile Library but it was problematic because of 2 reasons:

Here is my 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();

Do you have any idea how I can:

  1. Fix those problems
  2. Use another library that can compress AVI videos

Thanks, Guy.

Upvotes: 2

Views: 4478

Answers (1)

Mustafa Ekici
Mustafa Ekici

Reputation: 7470

You can use EmguCv

//VideoWriter vw = new public VideoWriter(string fileName, int fps, int width, int height, bool isColor);
VideoWriter vw = new VideoWriter("test.avi", 30, 500, 500, true);
//Then write your frame
vw.WriteFrame(frame);

Upvotes: 2

Related Questions