G
File size: 484 Bytes
5db1549
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System;
using System.Drawing;
using AForge.Video.FFMPEG;

class Program
{
    static void Main(string[] args)
    {
        var videoWriter = new VideoFileWriter();
        videoWriter.Open("output.mp4", 640, 480, 25, VideoCodec.MPEG4);

        for (int i = 0; i < 10; i++)
        {
            Bitmap image = (Bitmap)Image.FromFile($"image{i}.jpg");
            videoWriter.WriteVideoFrame(image);
            image.Dispose();
        }

        videoWriter.Close();
    }
}