【发布时间】:2015-04-12 11:50:26
【问题描述】:
我的程序中有一个图像列表,我正在从中生成一个 AVI 视频。为此,我使用 avifilewrapper_src 库来处理视频的创建。 创建过程为:
Bitmap bitmap;
//load the first image
bitmap = (Bitmap)imageSequence[0];
//create a new AVI file
AviManager aviManager = new AviManager(paths.outputVideo, false);
//add a new video stream and one frame to the new file
VideoStream aviStream =
aviManager.AddVideoStream(true, (double)nud_picturePerSec.Value, bitmap);
if(chb_audio.Checked)
aviManager.AddAudioStream(paths.sampleAudio, 0);
int count = 0;
for (int n = 0; n < imageSequence.Count; n++) {
bitmap = (Bitmap)imageSequence[n];
aviStream.AddFrame(bitmap);
bitmap.Dispose();
count++;
}
aviManager.Close();
如果我继续提供不同的图像,它会正常工作。但是,如果我放置两个相似的图像,则视频会倒置显示第二张图像(左/右侧是正确的)。我所说的两个相似的图像是指创建第二个图像并从第一个图像中复制它。
我感觉这与流有某种关系,但我找不到图像反转的原因。
【问题讨论】:
标签: c# image bitmap stream avi