AForge.Video.VideoFileWriter,一秒钟后视频质量下降

时间:2019-12-29 04:32:25

标签: c# video ffmpeg aforge

我尝试使用AForge从images ..创建mp4视频,但是在进入视频大约1-2秒后遇到这种质量损失。只是想知道是否有人知道我的代码出了什么问题?

using AForge.Video.FFMPEG;
VideoFileWriter writer = new VideoFileWriter();
writer.Open(fileName, _width, _height, _frameRate, VideoCodec.MPEG4, 800000);
var s = AForge.Imaging.Image.FromFile(@"[path]\image.jpg");
int frameCount = _frameRate * scene.Time;
for (int i = 0; i < frameCount; i++)
{
    writer.WriteVideoFrame(s);
}
writer.Close();

我使用上面的代码创建一个3秒的1080p视频,其帧速率为60,比特率为800k,并以该图片为例:https://www.bushandbeach.co.nz/wp-content/uploads/2019/05/A-Taste-of-Auckland-Full-Day-1-opt.jpg

输出视频在此处:https://youtu.be/j0z7711cyOM

如您所见,图像质量似乎还可以,持续约2秒钟,然后在最后一秒模糊。

非常感谢

0 个答案:

没有答案
相关问题