compression – the C # screen recorder reduces the size of the AVI video file

I'm currently trying to make a screen recorder in C #, and so far it works, but the problem is that something as simple as a 20-second video will take about 1GB of space. I have it set so that a timer takes screenshots continuously with this method:

void takeScreenshot ()
{
Rectangle boundaries = Screen.FromControl (this) .Bounds;
using (bitmap of bitmap = new bitmap (limits.Ancho, limits.Height))
{
using (Graphics g = Graphics.FromImage (bitmap))
{
// Add screen to bitmap:
g.CopyFromScreen (new Point (limits.Left, limits.Top), Point.Empty, limits.Size);
}
// Create and save screenshot:
string name = path + "// screenshot-" + fileCount + ".jpeg";
bitmap.Save (name, ImageFormat.Jpeg);
inputImageSequence.Add (name);
fileCount ++;

// Delete the bitmap:
bitmap.Dispose ();
}
}

And then store those photos in a temporary folder on the D: // drive, and then, when it's done, take all the photos and create an AVI video like this:

// Set the limits of the video to the size of the screen:
Rectangle boundaries = Screen.FromControl (this) .Bounds;
int width = limits.Ancho;
int height = limits.Height;

var framRate = 5;

using (var vFWriter = new VideoFileWriter ())
{
// Create new video file:
vFWriter.Open (outputPath + "// video.avi", width, height, framRate, VideoCodec.Raw);

// Make each screenshot in a video frame:
foreach (var imageLocation in inputImageSequence)
{
Bitmap imageFrame = System.Drawing.Image.FromFile (imageLocation) as Bitmap;
vFWriter.WriteVideoFrame (imageFrame);
imageFrame.Dispose ();
}
vFWriter.Close ();
}
// Remove the screenshots and the temporary folder:
DeletePath (path);

Any help to reduce the inefficiency of this is appreciated, I am quite new in this type of programming.