This project is read-only.

Encoded AVI file is *huge* compared to WMV

Topics: Developer Forum, User Forum
Jun 27, 2011 at 10:24 AM

I'm converting a folder of images to a video file, and I've noticed that the resulting AVI file is huge (70MB) compared to a similar WMV file (1.2MB).

This is the code I'm using to perform the conversion, and I switch the renderer by commenting out the lines.

public static bool CreateVideo(IList<Bitmap> images, string destinationFileName)
                using (ITimeline timeline = new DefaultTimeline(1.0))
                    IGroup group = timeline.AddVideoGroup(24, 320, 240);
                    ITrack videoTrack = group.AddTrack();
                    int i = 0;
                    foreach (var bmp in images)
                    	IClip clip = videoTrack.AddImage(bmp);
                    	Console.WriteLine("Loading image {0}", ++i);
                    Console.WriteLine("Rendering video {0}.", destinationFileName);
                    Console.WriteLine("Please be patient. This could take a while...");
//                    IRenderer renderer = new AviFileRenderer(timeline, destinationFileName);
                    IRenderer renderer = new WindowsMediaRenderer(timeline, destinationFileName, WindowsMediaProfiles.HighQualityVideo);
                    return true;
	catch (Exception e)
		return false;

As you can see, it's not very complex code. For a video with a resolution of 320x240 consisting of 170 frames, 70 MB is really too large.


How do I go about tuning the parameters of the AVI file renderer? I've seen an AviFileRenderer constructor that takes additional parameters, but I do not know how to set those up. Any help in this regard would be much appreciated!

Jul 26, 2012 at 3:29 PM

Hello, you managed to reduce the file size? I'm with the same problem...