从一组图像中创建视频

idi*_*ish 7 c# video image avi

我一直在寻找使用C#代码从图像创建视频(.avi文件)的时间,

是否有任何图书馆可以维护视频?我一直在浏览AviFileWriter库,但是这个库似乎太固定了,因为我需要添加一些转换和其他元素.

那么如何使用C#来满足我的需求呢?我不在乎编码是否复杂.

Has*_*gha 5

这里是带有AVI主要功能的ac#项目 http://www.codeproject.com/Articles/7388/A-Simple-C-Wrapper-for-the-AviFile-Library

这里使用VideoStream从bmp文件创建视频制作帧

 //load the first image
Bitmap bitmap = (Bitmap)Image.FromFile(txtFileNames.Lines[0]);
//create a new AVI file
AviManager aviManager = 
    new AviManager(@"..\..\testdata\new.avi", false);
//add a new video stream and one frame to the new file
VideoStream aviStream = 
    aviManager.AddVideoStream(true, 2, bitmap);

Bitmap bitmap;
int count = 0;
for(int n=1; n<txtFileNames.Lines.Length; n++){
    if(txtFileNames.Lines[n].Trim().Length > 0){
        bitmap = 
           (Bitmap)Bitmap.FromFile(txtFileNames.Lines[n]);
        aviStream.AddFrame(bitmap);
        bitmap.Dispose();
        count++;
    }
}
aviManager.Close();
Run Code Online (Sandbox Code Playgroud)